JP5377897B2 - Stream data ranking query processing method and stream data processing system having ranking query processing mechanism - Google Patents

Stream data ranking query processing method and stream data processing system having ranking query processing mechanism Download PDF

Info

Publication number
JP5377897B2
JP5377897B2 JP2008174086A JP2008174086A JP5377897B2 JP 5377897 B2 JP5377897 B2 JP 5377897B2 JP 2008174086 A JP2008174086 A JP 2008174086A JP 2008174086 A JP2008174086 A JP 2008174086A JP 5377897 B2 JP5377897 B2 JP 5377897B2
Authority
JP
Japan
Prior art keywords
ranking
stream
information
window
stream data
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.)
Active
Application number
JP2008174086A
Other languages
Japanese (ja)
Other versions
JP2009134689A (en
Inventor
格 西澤
常之 今木
俊彦 樫山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2008174086A priority Critical patent/JP5377897B2/en
Priority to US12/222,413 priority patent/US8335782B2/en
Publication of JP2009134689A publication Critical patent/JP2009134689A/en
Application granted granted Critical
Publication of JP5377897B2 publication Critical patent/JP5377897B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To (1) achieve a ranking calculating mechanism for maintaining compatibility in inserting stream data into a window and also in extinguishing data, and to (2) achieve a general-purpose interface for delivering a ranking calculation result to an application and an output mechanism according to the interface in order to secure the versatility of a stream data processing system. <P>SOLUTION: (1) A mechanism for managing ranking information using a sign of a stream tuple generated when stream data is inserted into, or deleted from, a window is provided. (2) A mechanism for generating only the differential information of ranking calculation results, a mechanism for adding ranking information according to a request, an interface for generating and outputting all ranking information from the differential information, a mechanism for generating all ranking calculation results, and an interface for using these mechanisms are provided. <P>COPYRIGHT: (C)2009,JPO&amp;INPIT

Description

本発明は、時々刻々と到来するストリームデータをリアルタイムに処理するストリームデータ処理システムにおける、ランキング計算方法、および該計算方法を有するストリームデータ処理システムに関する。   The present invention relates to a ranking calculation method and a stream data processing system having the calculation method in a stream data processing system that processes stream data that comes every moment in real time.

従来、企業情報システムのデータ管理の中心にはデータベース管理システム(以下、DBMSとする)が位置づけられていた。DBMSは、処理対象のデータをストレージに格納し、格納したデータに対してトランザクション処理に代表される高信頼な処理を実現している。これに対して、時々刻々と到着する大量のデータをリアルタイム処理するデータ処理システムに対する要求が高まっている。例えば、株取引を支援するファイナンシャルアプリケーションを考えた場合、株価の変動にいかに迅速に反応できるかがシステムの最重要の課題の一つである。従来のDBMSのように株式のデータを一旦記憶装置に格納してから、該格納データに関して検索を行うようなシステムでは、データの格納とそれに続く検索処理が株価変動のスピードに追いつくことができず、ビジネスチャンスを逃してしまうことになりかねない。例えば、米国特許5495600号(特許文献1)では、記憶されているクエリが周期的に実行される機構を開示しているが、この機構においても前述の株価のようにデータが入ってきた瞬間にクエリを実行することが重要となる。すなわちクエリの実行周期とデータ処理のタイミングのずれが許容できないので、前記のファイナンシャルアプリケーションに代表されるリアルタイムデータ処理には適用が困難であった。Java(R)に代表されるプログラミング言語を用いて、各種のリアルタイムアプリケーションを個別に作りこむアプローチは、開発期間の長期化、開発コストの高騰、該アプリケーションを利用する業務の変化への迅速な対応が難しいなどの問題があり、汎用のリアルタイムデータ処理機構が求められるようになっていた。   Conventionally, a database management system (hereinafter referred to as DBMS) has been positioned at the center of data management of enterprise information systems. The DBMS stores data to be processed in a storage and realizes highly reliable processing represented by transaction processing for the stored data. On the other hand, there is an increasing demand for a data processing system that processes a large amount of data that arrives every moment in real time. For example, when considering a financial application that supports stock trading, one of the most important issues of the system is how quickly it can react to fluctuations in stock prices. In a system in which stock data is temporarily stored in a storage device as in a conventional DBMS and a search is performed on the stored data, data storage and subsequent search processing cannot keep up with the speed of stock price fluctuations. , You could miss a business opportunity. For example, US Pat. No. 5,495,600 (Patent Document 1) discloses a mechanism in which a stored query is periodically executed. Even in this mechanism, the moment when data enters like the aforementioned stock price. It is important to execute the query. That is, since the difference between the query execution cycle and the data processing timing cannot be tolerated, it has been difficult to apply to the real-time data processing represented by the financial application. The approach of creating various real-time applications individually using a programming language such as Java (R) is a quick response to prolonged development time, rising development costs, and changes in operations that use the applications. However, there is a problem that it is difficult, and a general-purpose real-time data processing mechanism has been demanded.

このようなリアルタイムデータ処理に好適なデータ処理システムとして、ストリームデータ処理システムが提案されている。例えばR. Motwani、 J. Widom、 A. Arasu、 B. Babcock、 S. Babu、 M. Datar、 G. Manku、 C. Olston、 J. Rosenstein、 and R. Varma著:“Query Processing、 Resource Management、 and Approximation in a Data Stream Management System”、In Proc. of the 2003 Conf. on Innovative Data Systems Research (CIDR)、 January 2003 (非特許文献1)にストリームデータ処理システムSTREAMが開示されている。   A stream data processing system has been proposed as a data processing system suitable for such real-time data processing. For example, R.A. Motwani, J.M. Widom, A. Arasu, B.H. Babcock, S.M. Babu, M.M. Data, G.G. Manku, C.I. Olston, J.M. Rosenstein, and R.R. By Varma: “Query Processing, Resource Management, and Application in a Data Stream Management System”, In Proc. of the 2003 Conf. A stream data processing system STREAM is disclosed in on Innovative Data Systems Research (CIDR) and January 2003 (Non-Patent Document 1).

ストリームデータ処理システムでは、従来のDBMSとは異なり、まずクエリ(問合せ)をシステムに登録し、データの到来と共に該クエリが継続的に実行される。ここでのストリームデータとは、映像ストリームのような論理的に継続する一つの大きなデータではなく、ファイナンシャルアプリケーションにおける株価配信データ、小売業でのPOSデータ、交通情報システムにおけるプローブカーデータ、計算機システム管理におけるエラーログ、センサやRFIDなどのユビキタスデバイスから発生するセンシングデータなど、比較的小さな論理的には独立した大量の時系列データである。ストリームデータは継続してシステムに到着し続けるため、その終わりを待ってから処理を開始するのでは実時間での処理は不可能である。また、システムに到着したデータは、データ処理の負荷に影響されることなく、その到着順を守って処理する必要がある。前記STREAMでは、システムに到来し続けるストリームデータを、最新10分間などの時間の幅、もしくは最新1000件などの個数の幅を指定してストリームデータの一部を切り取りながらリアルタイムの処理を実現するため、スライディングウィンドウ(以下単にウィンドウと呼ぶ)と呼ばれる概念を導入している。ウィンドウ指定を含むクエリの記述言語の好適な例としては非特許文献1に開示されているCQL(Continuous Query Language)をあげることができる。CQLは、DBMSで広く用いられているSQL(Structured Query Language)のFROM句に、ストリーム名に続いて括弧を用いることにより、ウィンドウを指定する拡張が施されている。SQLに関しては、C. J. Date、 Hugh Darwen著:“A Guide to SQL Standard (4th Edition)”、Addison−Wesley Professional; 4 edition (November 8、 1996)、ISBN: 0201964260(非特許文献2)が詳しい。   In a stream data processing system, unlike a conventional DBMS, a query is first registered in the system, and the query is continuously executed as data arrives. The stream data here is not one large logically continuous data such as a video stream, but stock price distribution data in a financial application, POS data in a retail business, probe car data in a traffic information system, computer system management Is a relatively small amount of time-series data that is logically independent such as an error log and sensing data generated from a ubiquitous device such as a sensor or RFID. Since stream data continues to arrive at the system, processing in real time is impossible if processing is started after waiting for the end of the stream data. In addition, data that arrives at the system must be processed in the order of arrival without being affected by the data processing load. In the STREAM, in order to realize real-time processing of stream data that continues to arrive in the system by specifying a time width such as the latest 10 minutes or a number of widths such as the latest 1000, and cutting out part of the stream data. A concept called a sliding window (hereinafter simply referred to as a window) is introduced. As a suitable example of a query description language including window specification, CQL (Continuous Query Language) disclosed in Non-Patent Document 1 can be cited. CQL is extended by specifying a window by using parentheses following a stream name in the FROM clause of SQL (Structured Query Language) widely used in DBMS. Regarding SQL, C.I. J. et al. Date, Hugh Darwen: “A Guide to SQL Standard (4th Edition)”, Addison-Wesley Professional; 4 edition (November 8, 1996), ISBN: 0201964260 (non-patent document).

図12のクエリ1201は非特許文献1の2.1節に示されているCQLによるクエリの例である。該クエリでは、あるWebプロキシサーバにおいて、ドメインstanford.eduからの現時点から過去1日分のアクセスの総数を計算する。Requestsは前記Webプロキシサーバに到来し続けるWebアクセスデータであり、従来のDBMSで取り扱うテーブル(表)のような静止化されたデータではなく、切れ目のないストリームデータとなる。そのため、アクセスの総数を計算は、ウィンドウ指定“[Range 1 Day Preceding]”による、ストリームデータのどの部分を対象とするかの指定なしでは、不可能となる。ウィンドウによって切り取られたストリームデータはメモリ上に保持され、クエリ処理に使用される。代表的なウィンドウの指定方法には、ウィンドウの幅を時間で指定するRangeウィンドウと、ウィンドウの幅をデータ数で指定するRowウィンドウがある。例えば、Rangeウィンドウを用いて、[Range 10 minutes]とすると、最新の10分間分がクエリ処理の対象となり、Rowウィンドウを用いて[Rows 10]とすると、最新の10件がクエリ処理の対象となる。   A query 1201 in FIG. 12 is an example of a query by CQL shown in section 2.1 of Non-Patent Document 1. In this query, a domain proxy. The total number of accesses for the past day from the current time from edu is calculated. Requests is Web access data that continues to arrive at the Web proxy server, and is not static data such as a table handled in a conventional DBMS, but is stream data without interruption. Therefore, the total number of accesses cannot be calculated without specifying which part of the stream data is targeted by the window specification “[Range 1 Day Preceding]”. The stream data cut by the window is held in the memory and used for query processing. As a typical window designation method, there are a range window for designating a window width by time and a row window for designating a window width by the number of data. For example, if [Range 10 minutes] is selected using the Range window, the latest 10 minutes are subject to query processing. If [Rows 10] is selected using the Row window, the latest 10 items are subject to query processing. Become.

ストリームデータ処理システムは、ファイナンシャルアプリケーション、小売業での売り上げモニタリング、交通情報システム、計算機システム管理に代表される、リアルタイム処理が必要とされる応用に対する適用が期待されている。以下、リアルタイム処理を必要とする応用をリアルタイムアプリケーションと呼ぶ。リアルタイムアプリケーションにおいては、膨大な情報から瞬時に重要度の高い情報を取り出すために、ある瞬間でのランキング計算が必要とされる場合が多い。例えばファイナンシャルアプリケーションでは、株価の値動きや取引量が大きい株に注目するためのランキング情報が重要であり、小売業の売り上げモニタリングでは、店舗別、商品別など様々な角度からの売上高、売上数のランキング情報が注目される。また、交通情報システムでは、渋滞度が高い、通行量が多い地区に注目するためのランキング情報が必要となり、計算機管理においても、重大なエラーの数、アクセス数など、管理対象の優先度をつけるためのランキング情報が必須となる。   Stream data processing systems are expected to be applied to applications that require real-time processing, such as financial applications, retail sales monitoring, traffic information systems, and computer system management. Hereinafter, an application that requires real-time processing is referred to as a real-time application. In real-time applications, it is often necessary to perform ranking calculation at a certain moment in order to quickly extract highly important information from a huge amount of information. For example, in financial applications, ranking information to focus on stock price fluctuations and stocks with large trading volumes is important. In retail sales monitoring, sales and sales figures from various angles, such as by store and by product, are important. Ranking information attracts attention. In addition, traffic information systems require ranking information to focus on areas with high traffic congestion and high traffic volume. In computer management, prioritize management targets such as the number of serious errors and the number of accesses. Ranking information is essential.

ランキング計算対象のデータが静止化されている場合、すなわちランキング付けしようとするデータが変更されない場合には、該データをランキング付けしようとするキー(以下、ランキングキー)でソーティングし、ソーティング結果の順位に従って、データを出力すればよい。例えば、データベースに格納されている株価の売上高の上位10位のランキング情報を計算する際には、その日の各銘柄別の売上高を集計し、売上高をランキングキーとして集計した結果をソートし、上位の10件を選択して出力すればよい。ユーザが投入したクエリからランキングキー(前述の例では売上高)を自動的に決定する方法が米国特許7251648号(特許文献2)で開示されている。米国公開特許US2006/0259457号(特許文献3)では、DBMSのクエリで最初のn行のみを出力する指定があった場合に、クエリ処理時に条件を追加することによって余分なデータ処理のコストを削減する方法が開示されている。また、前記SQLでは銘柄別の分類のためのGROUP BY句、売上高の総計を計算するための集計関数SUM、集計値に基づいてソーティングを実行するORDER BY句が準備されている。これらを組合せることで、データベースに格納されている一日の株取引データから売上高の高い順(もしくは低い順)のランキング計算結果を生成することができる。   When the ranking calculation target data is static, that is, when the data to be ranked is not changed, the data is sorted by the key for ranking (hereinafter, ranking key), and the ranking of the sorting results According to the above, data may be output. For example, when calculating the top 10 ranking information of sales of stock prices stored in the database, the sales for each brand on that day are aggregated, and the results of aggregation using the sales as a ranking key are sorted. The top 10 items may be selected and output. US Pat. No. 7,251,648 (Patent Document 2) discloses a method for automatically determining a ranking key (sales amount in the above example) from a query input by a user. US published patent US2006 / 0259457 (patent document 3) reduces the cost of extra data processing by adding a condition during query processing when there is a specification to output only the first n rows in a DBMS query A method is disclosed. In the SQL, a GROUP BY phrase for classification by brand, an aggregation function SUM for calculating the total sales amount, and an ORDER BY phrase for performing sorting based on the aggregation value are prepared. By combining these, it is possible to generate ranking calculation results in descending order of sales (or in ascending order) from daily stock transaction data stored in the database.

しかしながら、前記リアルタイムアプリケーションにおいては、新しいデータ(ストリームデータ)が次々に到来し続けるため、その静止化は困難である。DBMSを用いて、リアルタイムアプリケーション向けのランキング計算を実施しようとする場合、ストリームデータが到来するごとに該データをDBMSに格納し、DBMSで前記の分類、集計、ソーティング処理を行う必要がある。これらの処理では、基本的にデータベース内の大量のデータにアクセスする必要があり、処理コストが高い。そのため、リアルタイムアプリケーションから発生するストリームデータが高速で到来する場合、すなわちストリームデータの到来する時間間隔が短い場合には、該時間間隔内での処理の実行は不可能であり、DBMSを用いたリアルタイムアプリケーション向けのランキング計算の実現は困難であった。   However, in the real-time application, since new data (stream data) continues to arrive one after another, it is difficult to make it static. When a ranking calculation for a real-time application is to be performed using a DBMS, it is necessary to store the data in the DBMS every time stream data arrives, and perform the above-described classification, aggregation, and sorting processing by the DBMS. In these processes, it is basically necessary to access a large amount of data in the database, and the processing cost is high. For this reason, when stream data generated from a real-time application arrives at high speed, that is, when the time interval at which stream data arrives is short, it is impossible to execute processing within the time interval, and real-time using DBMS Realizing ranking calculation for applications has been difficult.

前述したように、ストリームデータ処理システムでは、無限に続くストリームデータから、処理の対象を前述のウィンドウで切り取って処理している。処理対象のデータは、ウィンドウ中に存在するデータのみであり、ウィンドウから押し出されたデータはランキング処理の対象から削除する必要がある。ウィンドウからデータが押し出されるタイミングは、ウィンドウの指定方法が時間である(前述のRangeウィンドウ)か、件数である(前述のRowウィンドウ)かによって異なる。件数指定の場合、処理対象のデータがウィンドウから押し出される時刻は、該データがウィンドウに入った瞬間には決定できず、後続のストリームデータによって決定される。一方、時間指定の場合には、処理対象のデータがウィンドウから押し出される時刻は、該データがウィンドウに入った瞬間に決定できるが、その消去タイミング(ウィンドウから押し出されるタイミング)は、後続のデータとは同期しない。   As described above, in the stream data processing system, the processing target is cut out from the infinite stream data and processed in the above-described window. The data to be processed is only the data existing in the window, and the data pushed out from the window needs to be deleted from the target of the ranking process. The timing at which data is pushed out of the window differs depending on whether the window designation method is time (the aforementioned Range window) or the number of cases (the aforementioned Row window). In the case of specifying the number of cases, the time at which the data to be processed is pushed out of the window cannot be determined at the moment when the data enters the window, but is determined by the subsequent stream data. On the other hand, in the case of time designation, the time when the data to be processed is pushed out from the window can be determined at the moment when the data enters the window, but the erasure timing (timing pushed out from the window) Does not synchronize.

ランキング計算においては、ウィンドウへのストリームデータの挿入の都度、ランキング計算を実行してランキング情報の整合性を保つ必要がある。それに加えて、ウィンドウからのデータの消滅の際にも同様にランキング情報の整合性を保つことが必要となる。とくにウィンドウが時間指定の場合には、後続のデータ到来とは同期しないウィンドウからのデータの消滅タイミングを考慮してランキング計算を実行する必要がある。   In ranking calculation, it is necessary to maintain ranking information consistency by executing ranking calculation every time stream data is inserted into a window. In addition, it is necessary to maintain the consistency of ranking information when data disappears from the window. In particular, when a window is designated for time, it is necessary to perform ranking calculation in consideration of the disappearance timing of data from a window that is not synchronized with the arrival of subsequent data.

さらに、ランキング計算では、処理の効率化によって、ストリームデータ処理システム利用の重要な目的の一つであるリアルタイム処理の制約を守る必要がある。加えて、ストリームデータ処理システムは汎用のデータ処理基盤であるため、ランキング計算結果の差分情報のみを渡す、ランキング計算結果全体を渡す、ランキング計算結果に順位情報を含めるなど利用するアプリケーションの要求に応えるための汎用のインタフェース、そのインタフェースに従う処理を実現する機構を準備する必要がある。以上の条件を満足するストリームデータ処理システム向けのランキング計算方法はこれまで実現されていなかった。   Furthermore, in the ranking calculation, it is necessary to observe the restrictions of real-time processing, which is one of the important purposes of using the stream data processing system, by improving the processing efficiency. In addition, since the stream data processing system is a general-purpose data processing platform, it responds to the demands of applications to use, such as passing only difference information of ranking calculation results, passing the entire ranking calculation results, and including ranking information in ranking calculation results. It is necessary to prepare a general-purpose interface and a mechanism for realizing processing according to the interface. A ranking calculation method for a stream data processing system that satisfies the above conditions has not been realized so far.

米国特許5495600号US Pat. No. 5,495,600 米国特許7251648号US Pat. No. 7,251,648 米国公開特許US2006/0259457号US Published Patent US2006 / 0259457 特開2006−338432号JP 2006-338432 A R. Motwani、 J. Widom、 A. Arasu、 B. Babcock、 S. Babu、 M. Datar、 G. Manku、 C. Olston、 J. Rosenstein、 and R. Varma著:“Query Processing、 Resource Management、 and Approximation in a Data Stream Management System”、In Proc. of the 2003 Conf. on Innovative Data Systems Research (CIDR)、 January 2003R. Motwani, J.M. Widom, A. Arasu, B.H. Babcock, S.M. Babu, M.M. Data, G.G. Manku, C.I. Olston, J.M. Rosenstein, and R.R. By Varma: “Query Processing, Resource Management, and Application in a Data Stream Management System”, In Proc. of the 2003 Conf. on Innovative Data Systems Research (CIDR), January 2003 C. J. Date、 Hugh Darwen著:“A Guide to SQL Standard (4th Edition)”、Addison−Wesley Professional; 4 edition (November 8、 1996)、ISBN: 0201964260C. J. et al. Date, Hugh Darwen: “A Guide to SQL Standard (4th Edition)”, Addison-Wesley Professional; 4 edition (November 8, 1996), ISBN: 0201964260.

リアルタイムアプリケーションで必要となるランキング計算を実現するためにストリームデータ処理システムを用いる場合、ウィンドウへのストリームデータの挿入に加えて、該ストリームデータの消滅の際にも整合性を保つランキング処理の実現が必要となる。また、リアルタイムと呼べるランキング処理結果を得るには、処理対象ウィンドウの内部データの時々刻々の変化の度に実行するランキング更新の処理を高速化する必要がある。   When using a stream data processing system to achieve the ranking calculation required for real-time applications, in addition to inserting stream data into a window, it is possible to realize ranking processing that maintains consistency even when the stream data disappears Necessary. In order to obtain a ranking process result that can be called real time, it is necessary to speed up the ranking update process that is executed every time the internal data of the processing target window changes.

本発明の目的は、処理対象ウィンドウの内部データの時々刻々の変化の度に行なうランキング更新の演算を高速化でき、しかも処理結果の整合性を保つランキング処理方法及びシステムを提供するにある実現することにある。   An object of the present invention is to provide a ranking processing method and system capable of speeding up the ranking update operation that is performed every time the internal data of the processing target window changes, and that maintains the consistency of the processing results. There is.

本願で開示される発明のうち、代表的な発明の概要は以下の通りである。すなわち、代表的実施態様ではウィンドウへのストリームデータの挿入、削除の度毎に、すなわちあるストリームタプルの生存期間の開始、及びあるストリームタプルの生存期間の終了の度毎に、生存期間にあるストリームタプルの範囲内でそれらのランキングを生成・更新し、かつ出力指定された順位の範囲を越えて、生存期間にあるストリームタプルの範囲内でバッファに保存するストリームデータ処理を採用する。   Among the inventions disclosed in this application, the outline of typical inventions is as follows. That is, in a typical embodiment, every time stream data is inserted into or deleted from a window, that is, every time a stream tuple starts its lifetime and every time a stream tuple lives, the stream that is in its lifetime Stream data processing that generates and updates those rankings within the range of tuples and stores them in a buffer within the range of stream tuples that are in the lifetime beyond the rank range specified for output is adopted.

ある時点でのランキング情報の出力だけから言えば、ランキング情報の保存は出力指定された順位のストリームタプルの範囲で行なえば一見充分であるかに思われる。しかしながら、新たなストリームタプルの受け付けに起因して、ウィンドウ内のストリームタプルへの挿入および削除が生じ、その挿入、削除の度にランキングそのものが変動する。したがって、整合性のあるランキング計算を継続して実行するには、その挿入・削除の度毎にランキング情報の更新が必要であり、かつ出力指定された順位の範囲を越えて、生存期間にあるストリームタプルの範囲内のストリームタプル及びそれらのランキング情報を保存する必要がある。   Speaking only from the output of ranking information at a certain point in time, it seems that it is sufficient to store the ranking information if it is performed within the range of stream tuples in the rank specified for output. However, due to acceptance of a new stream tuple, insertion and deletion into the stream tuple in the window occur, and the ranking itself changes each time the insertion and deletion are performed. Therefore, in order to continue to perform consistent ranking calculation, it is necessary to update the ranking information for each insertion / deletion, and the lifetime is beyond the rank range specified for output. It is necessary to store stream tuples within the range of stream tuples and their ranking information.

さらに上記代表的実施態様は、受け付けたストリームタプルをランキング計算の処理対象としてウィンドウへ挿入し、該ストリームタプルのウィンドウ内での生存期間を決定し、生存期間の終了時には上記ウィンドウからの削除を行なうウィンドウマネージャと、ランキング計算を行うランキング処理モジュールとの2段階の処理機構を持ち、上記ウィンドウマネージャは、ウィンドウ内のストリームタプル全体の情報ではなく、刻々の変化部分を示すウィンドウ差分情報を上記ランキング処理モジュールに伝達し、上記ランキング処理モジュールは、伝達された上記ウィンドウ差分情報と、過去にランキング計算を行って保存した保存情報とを用いてランキングの更新を行う構成とした点に特徴を有する。具体的には当該ストリームタプルがウィンドウに挿入されたことを示す符号を付加したストリームタプル、および当該ストリームタプルがウィンドウから削除されたことを示す符号を付加したストリームタプルが上記のウィンドウ差分情報としてランキング処理モジュールに伝達され、ランキング処理モジュールでは該差分情報に基づいてランキング情報を更新し、ランキング情報保持バッファに保存するとともに、指定された形式でランキング出力情報を出力する。   Further, the representative embodiment inserts the received stream tuple into a window as a processing target for ranking calculation, determines the lifetime of the stream tuple in the window, and deletes the stream tuple from the window at the end of the lifetime. It has a two-stage processing mechanism of a window manager and a ranking processing module that performs ranking calculation, and the window manager performs not only the information of the entire stream tuple in the window but the window difference information indicating the changing part every moment. The ranking processing module is transmitted to the module, and the ranking processing module is characterized in that the ranking is updated using the transmitted window difference information and saved information that has been calculated and saved in the past. Specifically, the stream tuple to which the code indicating that the stream tuple has been inserted into the window and the stream tuple to which the code indicating that the stream tuple has been deleted from the window are ranked as the window difference information. The ranking processing module updates ranking information based on the difference information, saves it in the ranking information holding buffer, and outputs ranking output information in a designated format.

本発明を用いることにより、時々刻々と到来する大量データをリアルタイム処理するストリームデータ処理システムにおいて、入力されるストリームデータとの整合性を保ち、かつ高速、高効率のランキング計算が実現できる。本ランキング計算方法の適用により、リアルタイムアプリケーションで共通に利用可能なデータ処理基盤が提供できる。   By using the present invention, in a stream data processing system that processes a large amount of data that arrives from moment to moment in real time, it is possible to achieve high-speed and high-efficiency ranking calculation while maintaining consistency with input stream data. By applying this ranking calculation method, it is possible to provide a data processing infrastructure that can be commonly used in real-time applications.

図1および図16に、本発明のストリームデータ処理システムの好適な実現例を示す。アプリケーション1(102)を実行するクライアント計算機101、アプリケーション2(104)を実行するクライアント計算機103は、ネットワーク107を介してストリームデータ処理システム115に接続されている。ネットワーク107は、イーサネット、光ファイバなどで接続されるローカルエリアネットワーク(LAN)、もしくはLANよりも低速なインターネットを含んだワイドエリアネットワーク(WAN)でも差し支えない。また、クライアント計算機はパーソナルコンピュータ、ブレード型の計算機システムなどの任意のコンピュータシステムでよい。   1 and 16 show a preferred implementation example of the stream data processing system of the present invention. A client computer 101 that executes application 1 (102) and a client computer 103 that executes application 2 (104) are connected to a stream data processing system 115 via a network 107. The network 107 may be a local area network (LAN) connected by Ethernet, optical fiber, or the like, or a wide area network (WAN) including the Internet that is slower than the LAN. The client computer may be an arbitrary computer system such as a personal computer or a blade type computer system.

本実施例のストリームデータ処理システムが稼動する計算機をストリームデータ処理サーバと呼ぶ。図16に示すように、ストリームデータ処理サーバ1601は、イーサネットアダプタなどの通信インタフェース1602、CPU1603、メモリ1604、およびI/Oインタフェース1605を備えた計算機であり、ブレード型計算機システム、PCサーバなどの任意のコンピュータシステムでよい。ストリームデータ処理サーバでは、前記通信インタフェースを介して前記クライアント計算機、後述するデータソースにアクセスする。ストリームデータ処理サーバで、ストリームデータ処理結果、処理の中間結果、システム動作に必要な設定データを不揮発性のストレージに格納する場合には、ストリームデータ処理サーバに接続したストレージ装置1606を用いることができる。ストレージ装置1606は、ストリームデータ処理サーバのI/Oインタフェースを介して直接接続されるか、もしくは通信インタフェースを介してネットワーク接続される。   A computer on which the stream data processing system of this embodiment operates is called a stream data processing server. As shown in FIG. 16, the stream data processing server 1601 is a computer having a communication interface 1602 such as an Ethernet adapter, a CPU 1603, a memory 1604, and an I / O interface 1605, and is an arbitrary one such as a blade computer system or a PC server. Computer system. The stream data processing server accesses the client computer and a data source described later through the communication interface. When the stream data processing server stores the stream data processing result, the intermediate result of the processing, and the setting data necessary for system operation in the nonvolatile storage, the storage device 1606 connected to the stream data processing server can be used. . The storage device 1606 is directly connected via the I / O interface of the stream data processing server, or connected to the network via the communication interface.

ストリームデータ処理システム115は、前記ストリームデータ処理サーバ1601の上で動作する。図1にストリームデータ処理システムの主要構成要素を示す。アプリケーションは、まずストリームデータ処理システムにクエリを登録する(105)。登録されたクエリはクエリ管理テーブル(112)に格納される。クエリ登録の詳細な手順、ストリームデータ処理システム内部のデータの格納方法、格納形式、クエリを受け付けた後の解析方法、最適化方法、システムへの登録方法、ストリームデータ処理システムへのストリームの登録方法、システム内のデータ保持方法については、特開2006−338432号「ストリームデータ処理システムのクエリ処理方法」(特許文献4)に、その好適な実施の方法が開示されている。クエリ管理テーブルは、ストリームデータ処理サーバ上のメモリ1604に保持するのでも、ストリームデータ処理サーバに接続されているストレージ装置1606に格納するのでも差し支えない。   The stream data processing system 115 operates on the stream data processing server 1601. FIG. 1 shows the main components of the stream data processing system. The application first registers a query in the stream data processing system (105). The registered query is stored in the query management table (112). Detailed procedure for query registration, data storage method inside stream data processing system, storage format, analysis method after receiving query, optimization method, system registration method, stream data processing system registration method As for the data holding method in the system, Japanese Patent Application Laid-Open No. 2006-338432 “Query processing method of stream data processing system” (Patent Document 4) discloses a suitable method of implementation. The query management table may be held in the memory 1604 on the stream data processing server or stored in the storage device 1606 connected to the stream data processing server.

ストリームデータ処理システムには、一つ以上のストリームデータソースであるストリームデータソース1(122)〜ストリームデータソースN(123)からネットワーク121を介して時々刻々と大量のデータが到来する。このデータをストリームデータと呼ぶ。ストリームデータの好適な例としては、ファイナンシャルアプリケーションにおける株価配信情報、小売業でのPOSデータ、交通情報システムにおけるプローブカー情報、計算機システム管理におけるエラーログなどが挙げられる。ストリームデータ処理システムでは、通信インタフェース1602を介してデータフローマネージャ119が受け付けたストリームデータをクエリ処理エンジン113にフィードする。   A large amount of data comes to the stream data processing system from the stream data source 1 (122) to the stream data source N (123), which are one or more stream data sources, via the network 121 every moment. This data is called stream data. Preferable examples of stream data include stock price distribution information in a financial application, POS data in a retail business, probe car information in a traffic information system, an error log in computer system management, and the like. In the stream data processing system, the stream data received by the data flow manager 119 is fed to the query processing engine 113 via the communication interface 1602.

前述したように、継続して到来する比較的小さな論理的には独立した大量の時系列データであるストリームデータを取り扱うために、ストリームデータ処理システムではウィンドウを用いる。図1のウィンドウマネージャ126は、到来するストリームデータに対して、クエリで指定されたウィンドウ演算を適用してストリームタプルを生成し、ストリームタプルのシステム内での生存期間を設定する。ストリームデータがウィンドウに挿入された時が生存期間の開始時刻、そしてウィンドウから該ストリームデータが削除される時が生存期間の終了時刻に相当する。   As described above, a window is used in a stream data processing system in order to handle stream data that is a relatively small amount of logically independent time series data that continuously arrives. The window manager 126 in FIG. 1 generates a stream tuple by applying the window operation specified by the query to the incoming stream data, and sets the lifetime of the stream tuple in the system. The time when the stream data is inserted into the window corresponds to the start time of the lifetime, and the time when the stream data is deleted from the window corresponds to the end time of the lifetime.

図15を用いて、ウィンドウマネージャの構成と動作内容を説明する。ウィンドウマネージャ126は、ストリームデータ受付インタフェース1505、ストリームタプル保持バッファ1502、生存期間決定部1504、および差分情報生成部1506から構成される。ストリームデータ受付インタフェースは、受け付けたストリームデータの構成要素であるストリームタプルを、ストリームタプル保持バッファ1502に格納するとともに、生存期間決定部1506に格納したことを伝達する。生存期間決定部1506は前記ウィンドウ演算により各ストリームタプルの生存期間を決定し、生存期間が終了するストリームプルをストリーム保存バッファ1502から消去する。差分情報生成部1504は、ストリームタプルが該ストリームタプル保持バッファに格納されたタイミングで、プラスタプルを生成し、差分情報として出力する(1508)。同様に、ストリームタプルがストリームタプル保持バッファから消去されるタイミング(ストリームタプルの生存期間が終了するタイミング)でマイナスタプルを生成し、同様に差分情報として出力する(1508)。   The configuration and operation contents of the window manager will be described with reference to FIG. The window manager 126 includes a stream data reception interface 1505, a stream tuple holding buffer 1502, a lifetime determination unit 1504, and a difference information generation unit 1506. The stream data reception interface stores that the stream tuple as a component of the received stream data is stored in the stream tuple holding buffer 1502 and stored in the lifetime determination unit 1506. The lifetime determination unit 1506 determines the lifetime of each stream tuple by the window operation, and erases the stream pull whose lifetime has ended from the stream storage buffer 1502. The difference information generation unit 1504 generates a plus tuple at the timing when the stream tuple is stored in the stream tuple holding buffer, and outputs it as difference information (1508). Similarly, a minus tuple is generated at the timing at which the stream tuple is deleted from the stream tuple holding buffer (the timing at which the lifetime of the stream tuple ends), and similarly output as difference information (1508).

図16に示すように、ストリームタプル保持バッファ1502は、クエリ処理エンジン113内のメモリマネージャ117によって割り当てられるメモリ上に配置される。該メモリは、ストリームデータ処理サーバ1601上のメモリ1604、もしくは要求される性能要件、信頼性要件に応じて、ストリームデータ処理サーバに接続されたストレージ装置1606、もしくはストリームデータ処理サーバとネットワークで接続される、ストリームデータ処理サーバと同様の計算機資源を保持するサーバ計算機(図1のブロック133)上のメモリを利用してもよい。   As shown in FIG. 16, the stream tuple holding buffer 1502 is arranged on a memory allocated by the memory manager 117 in the query processing engine 113. The memory is connected to the memory 1604 on the stream data processing server 1601 or the storage device 1606 connected to the stream data processing server or the stream data processing server via a network according to the required performance requirement and reliability requirement. Alternatively, a memory on a server computer (block 133 in FIG. 1) that holds the same computer resources as the stream data processing server may be used.

次に、図2を用いてランキング処理モジュールの構成を説明する。ランキング処理モジュール116はストリームタプル受付インタフェース206、順序・順位生成部204、ランキング情報保持バッファ202、ランキング情報保持テーブル203、順位管理インデックス208、およびランキング処理結果出力インタフェース207から構成される。図16に示すように、ランキング処理モジュールは、クエリ処理エンジン113内のメモリマネージャ117によって割り当てられるメモリ上に配置される。該メモリは、ストリームデータ処理サーバ1601上のメモリ1604、もしくは要求される性能要件、信頼性要件に応じて、ストリームデータ処理サーバに接続されたストレージ装置1606、もしくはストリームデータ処理サーバとネットワークで接続される、ストリームデータ処理サーバと同様の計算機資源を保持するサーバ計算機(図1のブロック133)上のメモリを利用してもよい。   Next, the configuration of the ranking processing module will be described with reference to FIG. The ranking processing module 116 includes a stream tuple reception interface 206, an order / rank generation unit 204, a ranking information holding buffer 202, a ranking information holding table 203, a ranking management index 208, and a ranking processing result output interface 207. As shown in FIG. 16, the ranking processing module is arranged on a memory allocated by the memory manager 117 in the query processing engine 113. The memory is connected to the memory 1604 on the stream data processing server 1601 or the storage device 1606 connected to the stream data processing server or the stream data processing server via a network according to the required performance requirement and reliability requirement. Alternatively, a memory on a server computer (block 133 in FIG. 1) that holds the same computer resources as the stream data processing server may be used.

図17に本発明のストリームデータ処理における、ランキング情報生成のシーケンスを示す。前記ウィンドウマネージャ126は外部データソースから到来するストリームデータを受け付け(1701)、差分情報(符号付ストリームタプル)を生成する(1702)。ランキング処理モジュール116では、ストリームタプル受付インタフェース206が、前記ウィンドウマネージャから出力された差分情報(符号付ストリームタプル)を受け取り、順序・順位生成部204に転送する。順序・順位生成部では、ランキング情報保持バッファ202を参照しながら、受け取った符号付ストリームタプルをランキングバッファの適切な位置に追加、もしくはランキングバッファ内の適切な位置のランキング情報を削除し、前回の出力時とのランキング情報の差分(ランキング差分情報)を生成し(1705)、該ランキング差分情報をランキング処理結果出力インタフェース207に転送する(1706)。ランキング処理結果出力インタフェースでは、前記クエリによって指定されているデータの出力形式に従ってランキング情報を出力する。   FIG. 17 shows a ranking information generation sequence in the stream data processing of the present invention. The window manager 126 receives stream data coming from an external data source (1701) and generates difference information (signed stream tuple) (1702). In the ranking processing module 116, the stream tuple reception interface 206 receives the difference information (signed stream tuple) output from the window manager and transfers it to the order / rank generation unit 204. The order / rank generation unit adds the received signed stream tuple to an appropriate position in the ranking buffer while referring to the ranking information holding buffer 202 or deletes the ranking information at an appropriate position in the ranking buffer. A difference (ranking difference information) between the ranking information and the output time is generated (1705), and the ranking difference information is transferred to the ranking processing result output interface 207 (1706). The ranking processing result output interface outputs ranking information in accordance with the data output format specified by the query.

以下、具体的なクエリ、ストリームデータに対する、本実施例のランキング計算方法を説明する。図3(a)に示すクエリ301は、順位出力(順位そのものを出力すること)を指定しないランキング処理を命じるクエリである。1行目のSELECT句はs.idとs.valの値の組を出力対象とすることを、2行目のFROM句はストリームsを対象とすることを、同じく2行目のPartition By句はs.idの値でグルーピングしてそれぞれのs.valの値の最新の1件を保持することを、また3行目のLIMIT句は、s.valの値の降順に3件を出力すること意味する。本実施例のストリームデータ処理システムでは、予め入力されるクエリにて、ランキング計算の対象となるカラムと、ランキング付けの方向(昇順/降順)と、ランキング計算結果を出力する個数と、計算結果に順位情報を付与するか否かが指定される。クエリ301では、3行目のLIMIT句が、s.valの値の降順に3件を出力するランキング指定である。さらに、1行目のIDSTREAM句は、本クエリは出力として前回の出力時との差分情報のみを出力することを意味している。   Hereinafter, the ranking calculation method of the present embodiment for specific queries and stream data will be described. A query 301 shown in FIG. 3A is a query that commands a ranking process that does not specify rank output (outputting the rank itself). The SELECT clause on the first line is s. id and s. The output value is a set of val values, the FROM phrase in the second line is the stream s, and the Partition By phrase in the second line is the s. By grouping with the value of id, each s. Keeping the latest one of the values of val, and the LIMIT phrase on the third line is s. This means that 3 items are output in descending order of the value of val. In the stream data processing system of the present embodiment, in a query inputted in advance, the columns to be subjected to ranking calculation, the ranking direction (ascending / descending order), the number of ranking calculation results to be output, and the calculation results It is specified whether or not rank information is added. In query 301, the LIMIT phrase on the third line is s. It is a ranking specification that outputs three items in descending order of the value of val. Further, the IDSTREAM phrase on the first line means that this query outputs only the difference information from the previous output as the output.

図4および図5(a)を用いて、クエリ301が設定されたストリームデータ処理システムに対して、ストリームデータが到来した際の処理内容を説明する。クエリ301がストリームデータ処理システム115に登録された場合、例えば特許文献4に示された方法でクエリ解析、クエリ最適化、クエリ生成が実行され、クエリ処理エンジンにクエリの実行形式が登録される。クエリ301はランキング計算指定を含むため、実行形式のクエリの実行時には、クエリ処理エンジン113内のランキング処理モジュール116でランキング計算が実行される。特許文献1で述べられているように、ストリームデータ処理システムでは、クエリは登録された後システム上で動作し続け、一つ一つのストリームデータがシステムに到来するたびに、その状態が変化する。   With reference to FIG. 4 and FIG. 5A, processing contents when stream data arrives for the stream data processing system in which the query 301 is set will be described. When the query 301 is registered in the stream data processing system 115, for example, query analysis, query optimization, and query generation are executed by the method disclosed in Patent Document 4, and the query execution format is registered in the query processing engine. Since the query 301 includes a ranking calculation specification, the ranking calculation module 116 in the query processing engine 113 executes the ranking calculation when executing the execution format query. As described in Patent Document 1, in a stream data processing system, a query continues to operate on the system after being registered, and the state of each query changes each time stream data arrives at the system.

クエリ301が登録されている状況で、図4に示すストリームデータが到来したことを仮定する。図4および図5(a)では、時刻の経過を縦軸にとり、時刻の経過と共にシステムに到来したストリームデータが各処理モジュールで処理される様子を模式的に表している。凡例402および502に示すように、本実施例では到来するストリームデータは{id,val}の形式と仮定しており、これを楕円で表現している。t1〜t7(401)は、405〜411の各ストリームデータがストリームデータ処理システムに到来する時刻を表している。例えば、ストリームデータ{a,50}(405)、及びストリームデータ{b,10}(406)はそれぞれ、時刻t1、t2にストリームデータ処理システムに到来することを示している。図4の横軸は到来したストリームデータが処理される位置、および生成されるデータを表している。さらに、図4の左側の角丸四角(1502)は、システムに到来した前記ストリームデータに対して、前記ウィンドウマネージャ(126)でウィンドウ演算“[Partition By s.id Rows 1]”(403)を適用した結果を格納した、ストリーム保持バッファの各時刻での状態を示している。また、右側の角丸四角(202)は、ウィンドウマネージャから到来するストリームタプルに対して、前記ランキング処理モジュール(116)内の順序・順位生成部(204)における、ランキング計算指定句“LIMIT 3 By s.val DESC”(404)の適用した結果を格納した、ランキング情報保持バッファの各時刻での状態を示している。   Assume that the stream data shown in FIG. 4 has arrived in a situation where the query 301 is registered. 4 and 5 (a) schematically show how each processing module processes stream data that has arrived at the system as time passes, with the passage of time taken along the vertical axis. As shown in the legends 402 and 502, in this embodiment, the incoming stream data is assumed to be in the form of {id, val}, which is represented by an ellipse. t1 to t7 (401) represent times when the stream data 405 to 411 arrive at the stream data processing system. For example, stream data {a, 50} (405) and stream data {b, 10} (406) indicate that they arrive at the stream data processing system at times t1 and t2, respectively. The horizontal axis of FIG. 4 represents the position where the incoming stream data is processed and the data to be generated. Further, the rounded square (1502) on the left side of FIG. 4 performs a window operation “[Partition By s.id Rows 1]” (403) by the window manager (126) on the stream data that has arrived at the system. The state at each time of the stream holding buffer storing the applied result is shown. The right rounded square (202) is a ranking calculation specification phrase “LIMIT 3 By in the order / rank generation unit (204) in the ranking processing module (116) for the stream tuple coming from the window manager. The status of the ranking information holding buffer storing the application result of “s.val DESC” (404) at each time is shown.

前述したように、ウィンドウマネージャ126は、到来するストリームデータに対して、クエリで指定されたウィンドウ演算を適用してストリームタプルを生成し、ストリームタプルのシステム内での生存期間を設定する。図4の例では、生存期間の開始時刻は黒丸(426)、終了時刻は白丸427で表現されており、該ウィンドウ演算により、ストリームタプル{a,50}(405)の生存期間は時刻t1に始まり、時刻t7に終わることを示している。本実現例においては、ストリームデータの生存期間の開始時刻には、システム内部で前記のストリームデータに増加分を表す符号を付けたタプル(以下プラスタプル)が生成される。また、ウィンドウからストリームデータが削除された場合、先に出力されたプラスタプルへの参照を持つ、減少分を表す符号を付けたタプル(以下マイナスタプル)が生成される。以上の処理は、前記ウィンドウマネージャで実行される。例えば、図4の場合、時刻t1にはストリームデータ{a,50}(405)に対応するプラスタプル430が生成され、時刻t7に該ストリームデータのマイナスタプル431が生成されることとなる。ウィンドウ演算に続く、後段のクエリ処理は、本プラスタプルおよびマイナスタプルが到着したタイミングで該プラスタプルとマイナスタプルに起因して生成される差分情報に関して実行される。なおプラスタプル、マイナスタプルそのものの概念は前述の非特許文献1に紹介されている。   As described above, the window manager 126 generates a stream tuple by applying the window operation specified by the query to the incoming stream data, and sets the lifetime of the stream tuple in the system. In the example of FIG. 4, the start time of the survival period is represented by a black circle (426) and the end time is represented by a white circle 427, and the survival time of the stream tuple {a, 50} (405) is obtained at time t1 by the window operation. It starts and ends at time t7. In this implementation example, at the start time of the lifetime of the stream data, a tuple (hereinafter referred to as a plus tuple) in which a sign indicating an increase is added to the stream data is generated inside the system. Further, when stream data is deleted from the window, a tuple (hereinafter referred to as a minus tuple) with a reference representing a decrease and having a reference to the previously output plus tuple is generated. The above processing is executed by the window manager. For example, in the case of FIG. 4, a plus tuple 430 corresponding to the stream data {a, 50} (405) is generated at time t1, and a minus tuple 431 of the stream data is generated at time t7. Subsequent query processing subsequent to the window operation is executed with respect to difference information generated due to the plus tuple and the minus tuple at the arrival timing of the main tuple and the minus tuple. The concept of plus tuple and minus tuple itself is introduced in Non-Patent Document 1 described above.

クエリ301では、到来するストリームデータはまずウィンドウ演算“[Partition By s.id Rows 1]”(403)により、s.idの値毎に最新1個のみが保持される。具体的には、図4で時刻t1にストリームデータ{a,50}(405)が、時刻t2に{b,10}(406)が、時刻t3に{c,30}(407)が、時刻t4に{d,20}(408)が、そして時刻t5に{e,40}(409)がそれぞれ到来する。これら5つのストリームデータはs.idの値が異なるので、それぞれウィンドウに保持される。次に、時刻t6に新たなストリームデータ{e,15}(410)が到来すると、それまでウィンドウに保持されていたs.idの値がeのストリームデータ409はウィンドウから押し出される(削除される)。次に時刻t7に{a,45}(411)が到来すると、同様に{a,50}(405)がウィンドウから削除される。この様子を図示したのが図4の中央部分429である。例えば、ストリームデータ{a,50}(412)は時刻t1に到来し、時刻t7に{a,45}(418)が到来するまでウィンドウに保持される。この時、ストリームデータ{a、50}の生存期間はt1からt7(但し時刻t7は含まない)と表現する。図4の例では、生存期間の開始時刻は黒丸(426)、終了時刻は白丸(427)で、生存期間中は実線で表している。同様にして、{e,40}(417)の生存期間はt5からt6となる。一方、{b,10}(413)、{c,30}(414)、{d,20}(415)、{e,15}(417)、および{a,45}(418)については、時刻t7の時点では終了時刻が決定していないため、実線で表現されている。   In the query 301, the incoming stream data is first s.d. by the window operation “[Partition By s. Id Rows 1]” (403). Only the latest one is held for each id value. Specifically, in FIG. 4, stream data {a, 50} (405) at time t1, {b, 10} (406) at time t2, {c, 30} (407) at time t3, time {d, 20} (408) arrives at t4, and {e, 40} (409) arrives at time t5. These five stream data are s. Since the value of id is different, it is held in each window. Next, when new stream data {e, 15} (410) arrives at time t6, s. The stream data 409 whose id value is e is pushed out (deleted) from the window. Next, when {a, 45} (411) arrives at time t7, {a, 50} (405) is similarly deleted from the window. This is illustrated in the central portion 429 of FIG. For example, stream data {a, 50} (412) arrives at time t1, and is held in the window until {a, 45} (418) arrives at time t7. At this time, the lifetime of the stream data {a, 50} is expressed as t1 to t7 (however, the time t7 is not included). In the example of FIG. 4, the start time of the survival period is indicated by a black circle (426), the end time is indicated by a white circle (427), and the lifetime is indicated by a solid line. Similarly, the lifetime of {e, 40} (417) is from t5 to t6. On the other hand, for {b, 10} (413), {c, 30} (414), {d, 20} (415), {e, 15} (417), and {a, 45} (418), Since the end time is not determined at time t7, it is represented by a solid line.

以上のように生存期間を持つストリームデータから、どのようにランキング情報を生成するかを、同じく図4を用いて説明する。図4の右側432に、ランキング計算指定句“LIMIT 3 By s.val DESC”(404)による処理結果を示す。前述したように、本ランキング指定句の意味は、s.valの値で降順に3件を抽出することである。今、ストリームデータ{a,50}(419)、{b,10}(420)、{c,30}(421)がそれぞれ時刻t1、t2、t3に到来する。これら3つのストリームデータは上位3件ランキング情報としてそれぞれ出力される。次に、時刻t4に{d,20}(422)が到来すると、そのs.valの値20は、これまでに保持されている{b、10}の10よりも大きいため、{b,10}が上位3件のランキング情報から削除されてその生存期間がt4で終了し(428)、{d,20}がランキング計算結果として出力される。次に時刻t5に{e,40}(423)が到来すると、そのs.valの値は40となるため、上位3件に含まれるため、ランキング情報として出力される。そしてこれまで上位3件に保持されていた中で最も値の小さい{d,20}がランキングから削除される。ところが、時刻t6には、前述したように{e、15}(417)の到来により{e,40}(416)がウィンドウから削除されるため、再び{d,20}(424)が上位3件に復活することになり、再びランキング計算結果として出力される。時刻t7には{a,50}(412)が{a、45}(418)に置き換わり、{a,45}のs.valの値45は上位3件に含まれるため、{a,45}(425)がランキング結果として出力される。   As described above, how ranking information is generated from stream data having a lifetime will be described with reference to FIG. The right side 432 of FIG. 4 shows the processing result by the ranking calculation designation phrase “LIMIT 3 By s.val DESC” (404). As described above, the meaning of this ranking specification phrase is s. It is to extract 3 cases in descending order by the value of val. Now, stream data {a, 50} (419), {b, 10} (420), {c, 30} (421) arrive at times t1, t2, and t3, respectively. These three stream data are respectively output as the top three ranking information. Next, when {d, 20} (422) arrives at time t4, the s. Since the value 20 of val is larger than 10 of {b, 10} held so far, {b, 10} is deleted from the ranking information of the top three cases, and its lifetime ends at t4 ( 428), {d, 20} is output as a ranking calculation result. Next, when {e, 40} (423) arrives at time t5, the s. Since the value of val is 40, it is included in the top three cases, so it is output as ranking information. Then, {d, 20} having the smallest value among the top three held so far is deleted from the ranking. However, at time t6, as described above, {e, 40} (416) is deleted from the window due to the arrival of {e, 15} (417), so {d, 20} (424) is again the top 3 Will be revived and will be output again as a ranking calculation result. At time t7, {a, 50} (412) is replaced with {a, 45} (418), and s. Since the val value 45 is included in the top three cases, {a, 45} (425) is output as the ranking result.

以上のランキング計算の好適な実施方法を図2、図9、図10、図18、および図19を用いて説明する。ランキング処理モジュール116のストリームタプル受付インタフェース206が差分情報であるストリームタプルを受け取る(902)。すると、順序・順位生成部204はランキング情報保持バッファ202のバッファメンテナンスを実行する(903)。バッファメンテナンス処理の処理方法について、図2および図10を用いて説明する。順序・順位生成部204は、ストリームタプルを受け取ると、該ストリームタプルの符号がプラスであるかマイナスであるかをチェックする(1002)。符号がプラスの場合(1002でYesが選択された場合)、ランキング情報保持バッファ202のランキング情報保持テーブル203に受け取ったストリームタプルを追加し(1003)、ランキング情報保持バッファメンテナンス処理を終了する。ランキング情報保持バッファへのストリームタプル追加処理の詳細を図18のフローチャートを用いて説明する。順位・順序生成部では、追加対象のストリームタプル(符号がプラスのストリームタプル)を受け取ると、追加先のランキング情報保持テーブル203に順位管理インデックス208が付与されているかどうかをチェックする(1802)。順位管理インデックスは、順位付けの対象のカラムをキーとしたB+treeインデックスやハッシュインデックスで差し支えない。順位管理インデックスが存在する場合(ステップ1802でYesが選択された場合)には、順位・順序生成部は該インデックスを利用して追加対象のストリームタプルの、ランキング情報保持テーブルへの挿入位置を決定する(1803)。該インデックスが存在しない場合(ステップ1802でNoが選択された場合)には、順位・順序生成部はランキング情報保持テーブルを検索し、追加対象のストリームタプルの、ランキング情報保持テーブルへの挿入位置を決定する(1804)。挿入位置を決定した後、順位・順序生成部は追加対象のストリームタプルをランキング情報保持テーブルに挿入し(1805)、順位管理インデックスが存在する場合(ステップ1806でYesが選択された場合)には、該インデックスも更新してランキング情報保持バッファへのストリームタプル追加処理を終了する(1808)。   A preferred implementation method for the above ranking calculation will be described with reference to FIGS. 2, 9, 10, 18, and 19. The stream tuple reception interface 206 of the ranking processing module 116 receives a stream tuple as difference information (902). Then, the order / rank generation unit 204 executes buffer maintenance of the ranking information holding buffer 202 (903). A processing method of the buffer maintenance process will be described with reference to FIGS. When receiving the stream tuple, the order / rank generation unit 204 checks whether the sign of the stream tuple is positive or negative (1002). When the sign is positive (when Yes is selected in 1002), the received stream tuple is added to the ranking information holding table 203 of the ranking information holding buffer 202 (1003), and the ranking information holding buffer maintenance process is terminated. Details of the stream tuple addition processing to the ranking information holding buffer will be described with reference to the flowchart of FIG. When receiving the stream tuple to be added (stream tuple with a plus sign), the rank / order generation unit checks whether the rank management index 208 is added to the rank information holding table 203 of the addition destination (1802). The rank management index may be a B + tree index or a hash index using the column to be ranked as a key. When the rank management index exists (when Yes is selected in step 1802), the rank / order generation unit determines the insertion position of the stream tuple to be added to the ranking information holding table using the index. (1803). If the index does not exist (No is selected in step 1802), the rank / order generation unit searches the ranking information holding table, and determines the insertion position of the stream tuple to be added to the ranking information holding table. Determine (1804). After determining the insertion position, the rank / order generation unit inserts the stream tuple to be added into the ranking information holding table (1805), and if a rank management index exists (if Yes is selected in step 1806). The index is also updated, and the stream tuple addition processing to the ranking information holding buffer is completed (1808).

好適なランキング情報保持バッファの実現形態では、追加されたストリームタプルの、ランキング指定されたカラムの値での順序関係が保持される。ストリームタプルの追加時に順序関係を保持しておく理由は、遅延処理により一括して順序関係を作成する方法では、リアルタイム処理アプリケーションの要求である即時の結果出力が困難であるためである。例えば、図3のクエリ301の場合には、順序付けの対象となるカラム(前述のランキングキー)はs.valであるので、図2のランキング情報保持バッファ中のランキング情報保持テーブル(203)ではs.valの降順に順位情報とストリームタプルを保持している。   In a preferred embodiment of the ranking information holding buffer, the order relation of the added stream tuples in the column value designated for ranking is held. The reason for maintaining the order relationship when adding a stream tuple is that it is difficult to output the immediate result, which is a request of the real-time processing application, in the method of creating the order relationship collectively by delay processing. For example, in the case of the query 301 in FIG. 3, the column to be ordered (the above-described ranking key) is s. In the ranking information holding table (203) in the ranking information holding buffer of FIG. The rank information and stream tuple are held in descending order of val.

図10に戻って、受け取ったストリームタプルの符号がマイナスの場合(図10の1002でNoが選択された場合)、ランキング情報保持バッファ(202)から該ストリームタプルに対応する、符号がプラスのタプルを削除し(1004)、ランキング情報保持バッファメンテナンス処理を終了する。   Returning to FIG. 10, when the sign of the received stream tuple is negative (when No is selected in 1002 of FIG. 10), the tuple with positive sign corresponding to the stream tuple from the ranking information holding buffer (202). Is deleted (1004), and the ranking information holding buffer maintenance process is terminated.

ランキング情報保持バッファからのストリームタプル削除処理の詳細を図19のフローチャートを用いて説明する。順位・順序生成部では、ランキング情報保持テーブル203に順位管理インデックス208が付与されているかどうかをチェックする(1902)。順位管理インデックスが存在する場合(ステップ1902でYesが選択された場合)には、順位・順序生成部は該インデックスを利用して、ランキング情報保持テーブル中の削除対象のストリームタプルを検索する(1903)。該インデックスが存在しない場合(ステップ1902でNoが選択された場合)には、順位・順序生成部はランキング情報保持テーブルを検索し、削除対象のストリームタプルを決定する(1904)。削除対象のストリームタプルが決定されると、順位・順序生成部では該ストリームタプルの削除処理を実行する(1905)。順位管理インデックスが存在する場合(ステップ1906でYesが選択された場合)には、順位管理インデックスも更新し、ランキング情報保持バッファからのストリームタプル削除処理を終了する。   Details of the stream tuple deletion processing from the ranking information holding buffer will be described with reference to the flowchart of FIG. The rank / order generation unit checks whether or not the rank management index 208 is assigned to the ranking information holding table 203 (1902). When the rank management index exists (when Yes is selected in step 1902), the rank / order generation unit uses the index to search for a stream tuple to be deleted in the ranking information holding table (1903). ). If the index does not exist (No is selected in step 1902), the rank / order generation unit searches the ranking information holding table and determines a stream tuple to be deleted (1904). When the stream tuple to be deleted is determined, the rank / order generation unit executes the deletion process of the stream tuple (1905). If the rank management index exists (if Yes is selected in step 1906), the rank management index is also updated, and the stream tuple deletion process from the ranking information holding buffer is terminated.

ここで図14を用いて、図3(a)のクエリを登録したストリームデータ処理システムに対して、図4で示したタイムチャートでストリームが到来する場合の、ランキング情報保持テーブルに保持されるランキング情報の変化の様子を説明する。図14では、左側のt0(1416)、t1(1404)、…、t7が時刻を、中央の符号付きの楕円(1405、1407、…)がウィンドウマネージャで生成された差分情報(符号付ストリームタプル)を、そして右側のテーブル(1417、1406、…、1415)がランキング情報保持テーブルに保持されるランキング情報を表す。便宜上時刻t1以前のt0にはランキング情報は存在しなかったと仮定する。   Here, with reference to FIG. 14, the ranking held in the ranking information holding table when the stream arrives in the time chart shown in FIG. 4 for the stream data processing system in which the query of FIG. 3A is registered. Explain how information changes. In FIG. 14, t0 (1416), t1 (1404),..., T7 on the left is the time, and the center signed ellipse (1405, 1407,...) Is the difference information (signed stream tuple) generated by the window manager. ) And the right table (1417, 1406,..., 1415) represent the ranking information held in the ranking information holding table. For convenience, it is assumed that no ranking information exists at t0 before time t1.

時刻t1(1404)に、プラスの符号を持つストリームタプル{a,50}(1405)が到来すると、ランキング情報保持テーブルに該ストリームタプルが登録される(1406)。次に、時刻t2(1418)にプラスの符号を持つストリームタプル{b,10}(1407)が到来すると、その順位付け対象s.valの値である10を、ランキング情報保持テーブルに保持されているストリームタプルのs.valの値50と比較し、挿入位置が{a,50}(1405)の次と決定され、該挿入位置にストリームタプル{b,10}が挿入される(1408)。以下同様に、t3、t4、t5にそれぞれ、{c,30}、{d,20}、{e,40}が到来すると、これらのストリームタプルが順位付け対象のs.valの値の順にソートされて登録される。   When a stream tuple {a, 50} (1405) having a plus sign arrives at time t1 (1404), the stream tuple is registered in the ranking information holding table (1406). Next, when a stream tuple {b, 10} (1407) having a plus sign arrives at time t2 (1418), its ranking object s. The value 10 of val is set to s. of the stream tuple held in the ranking information holding table. Compared with the value 50 of val, the insertion position is determined to be next to {a, 50} (1405), and the stream tuple {b, 10} is inserted at the insertion position (1408). Similarly, when {c, 30}, {d, 20}, {e, 40} arrive at t3, t4, and t5, respectively, these stream tuples are assigned to the s. Sorted and registered in the order of the value of val.

図4に示すように、時刻t6において{e,15}(408)が到来すると、図3(a)に示した1行指定のRowウィンドウクエリでは{e、40}がウィンドウから削除される(433)。そのため、図14に示すランキング処理モジュール(116)のストリームタプル受付インタフェース206には、マイナス符号の付いたストリームタプル{e,40}(1413)と、プラス符号の付いたストリームタプル{e,15}(1414)が到来する。順序・順位生成部204では、マイナス符号の付いたストリームタプル{e,40}に対応するプラス符号の付いたストリームタプルを検索、決定し(1412の上から2番目)、該ストリームタプルを削除する。そして、プラス符号の付いた新たなストリームタプル{e,15}(1414)の挿入位置を決定し(1415の上から4番目)、ランキング情報保持テーブルに該ストリームタプルを追加する。時刻t7についても同様である。   As shown in FIG. 4, when {e, 15} (408) arrives at time t6, {e, 40} is deleted from the window in the one-row designated Row window query shown in FIG. 433). Therefore, the stream tuple reception interface 206 of the ranking processing module (116) shown in FIG. 14 includes a stream tuple {e, 40} (1413) with a minus sign and a stream tuple {e, 15} with a plus sign. (1414) arrives. The order / rank generation unit 204 searches and determines a stream tuple with a plus sign corresponding to the stream tuple with a minus sign {e, 40} (second from the top of 1412), and deletes the stream tuple. . Then, the insertion position of a new stream tuple {e, 15} (1414) with a plus sign is determined (fourth from the top of 1415), and the stream tuple is added to the ranking information holding table. The same applies to time t7.

本実施例では、ランキング情報保持バッファ内でのデータ構造がテーブルの場合を示したが、ランキング情報保持バッファ内でのデータ構造の他の好適な実現例としては、例えば図13に示すようなランキングキーをノードとした二分探索木(binary search tree)を挙げることができる。図13では、二分探索木のノード(ランキングキー)を四角1301で、ノードからポイントされるデータ本体(ストリームタプル)を円と楕円の組1302で示した。二分探索木を用いる場合には、ランキングキーをノードとして、あるノードの左側の子およびその全ての子孫ノードのランキングキーの値は、該ノードのランキングキーの値より小さく、右の子およびその全ての子孫ノードの値は該ノードのランキングキーの値と等しいもしくは大きくなるように構成する。図13の角丸四角1303内の二分探索木は、図4の時刻t5の時点でのランキング情報保持バッファが保持するデータの二分探索木での構成の例であり、保持しているデータの内容は図14のランキング情報保持テーブル1412と等しい。二分探索木を用いてランキングキーに基づいた順序を管理することで、前記プラスタプル、および前記マイナスタプル到来時の順序関係の管理を効率化することができる。さらに、ストリームタプルの順序関係を保持して管理するための他の好適なデータ構造としては、多くのDBMSのデータ管理機構で利用されるB+−Treeを利用するのでも差し支えない。   In this embodiment, the case where the data structure in the ranking information holding buffer is a table is shown. However, as another preferable implementation example of the data structure in the ranking information holding buffer, for example, a ranking as shown in FIG. A binary search tree with a key as a node can be cited. In FIG. 13, a node (ranking key) of the binary search tree is indicated by a square 1301, and a data body (stream tuple) pointed to by the node is indicated by a circle and ellipse set 1302. When using a binary search tree, with the ranking key as a node, the value of the ranking key of the left child of all nodes and all of its descendant nodes is smaller than the value of the ranking key of the node, and the right child and all of them. The value of the descendant node is configured to be equal to or greater than the ranking key value of the node. The binary search tree in the rounded circle 1303 in FIG. 13 is an example of the configuration of the binary search tree of the data held in the ranking information holding buffer at the time t5 in FIG. 4, and the contents of the held data Is equivalent to the ranking information holding table 1412 of FIG. By managing the order based on the ranking key using the binary search tree, the management of the order relation when the plus tuple and the minus tuple arrive can be made efficient. Further, as another suitable data structure for maintaining and managing the order relation of stream tuples, B + -Tree used in many DBMS data management mechanisms may be used.

ランキング情報保持バッファでは、ユーザに指定されたランキングの出力件数のみでなく、生存期間中のストリームデータに対応する全てのストリームタプルを保持する必要がある。例えば、図3のクエリ301では、ユーザからは上位3件のみを出力するように指示されているが、図4に示すストリームデータの系列がシステムに到来する場合、時刻t4で{d,20}(408)が到来した際に、前記ランキング情報保持バッファから、順位が4位となったストリームデータ{b,10}(406)に対応するストリームタプル433を削除してはならない。その理由は、ストリームデータ処理においては、新しいストリームデータがシステムに到来するときに加えて、ストリームデータの生存期間が終了した際にもランキングが変化するため、現在はユーザが指定した範囲外にあるストリームデータが、他のストリームデータの生存期間の終了によって、再びランキング結果として出力する必要が出てくるためである。例えば、図4では時刻t4で到来し、上位3件に含まれたストリームデータ{d,20}(408)が時刻t5に到来した{e,40}(409)によってランキング外に押し出されてしまっているが、時刻t6に到来した{e,15}(410)によって、{e,40}はウィンドウから消去される(433)ため、{d,20}は再びランキング計算結果に含まれる(424)必要がある。すなわち、ランキング情報保持バッファでは、ユーザに指定されたランキングの出力件数のみでなく、ウィンドウで管理されているストリームデータに対応する全て、すなわち生存期間中のストリームデータに対応する全てのストリームタプルを保持する必要がある。   In the ranking information holding buffer, it is necessary to hold not only the number of ranking outputs specified by the user but also all stream tuples corresponding to the stream data during the lifetime. For example, in the query 301 of FIG. 3, the user is instructed to output only the top three items, but when the stream data series shown in FIG. 4 arrives in the system, at time t4, {d, 20} When (408) arrives, the stream tuple 433 corresponding to the stream data {b, 10} (406) having the fourth rank should not be deleted from the ranking information holding buffer. The reason is that in stream data processing, the ranking changes when the new stream data arrives in the system and also when the lifetime of the stream data ends, so it is currently outside the range specified by the user. This is because the stream data needs to be output again as a ranking result when the lifetime of the other stream data ends. For example, in FIG. 4, the stream data {d, 20} (408) included in the top three cases arrives at time t4 and is pushed out of the ranking by {e, 40} (409) arrived at time t5. However, {e, 40} is deleted from the window by {e, 15} (410) that arrived at time t6 (433), so {d, 20} is included in the ranking calculation result again (424) )There is a need. That is, in the ranking information holding buffer, not only the number of ranking output specified by the user, but also all the stream tuples corresponding to the stream data managed in the window, that is, all the stream tuples corresponding to the live stream data are held. There is a need to.

但し、ストリームタプルが到着した瞬間に上位50位以内に含まれていない場合には、該ストリームタプルはランキングの対象としないなどのアプリケーションの特別な条件が存在する場合には、該アプリケーションの条件に従ってランキング情報保持バッファで保持するストリームタプルの数を変更することは可能である。   However, if the stream tuple is not included in the top 50 at the moment of arrival, the stream tuple is not subject to ranking. It is possible to change the number of stream tuples held in the ranking information holding buffer.

図9に戻って、順序・順位生成部では、受け取ったストリームタプルのバッファメンテナンス処理(903)の結果に基づき、該処理結果がランキングに影響するか否かをチェックする(904)。処理結果がランキングに影響を及ぼす場合とは、受け取ったストリームタプルに基づいたランキング情報保持バッファのメンテナンスの結果、クエリで指定されている範囲の順序に変更がある場合を指す。例えば、図3のクエリ301では、上位3件を出力の範囲に指定しているため、上位3位以内の順序に変更がある場合、処理結果がランキングに影響するか否かの判定(ステップ904)はYesとなる。例えば、図4で示した処理の場合、時刻t4で{d,20}が到来した場合には上位3位以内の順序に変更があるので、Yesの例となる。処理結果がランキングに影響する場合(ステップ904でYesが選択された場合)、順序出力指定があるかないかをチェックする(905)。順序出力指定がある場合(ステップ905でYesが選択された場合)、処理結果タプルへの順位情報カラムを追加して(906)、処理結果タプルを出力し(907)、ランキング処理を終了する(908)。順位出力の指定がない場合(ステップ905でNoが選択された場合)、処理結果タプルを出力し(907)、ランキング処理を終了する(908)。   Returning to FIG. 9, the order / rank generation unit checks whether the processing result affects the ranking based on the result of the buffer maintenance processing (903) of the received stream tuple (904). The case where the processing result affects the ranking refers to the case where the order of the range specified by the query is changed as a result of the maintenance of the ranking information holding buffer based on the received stream tuple. For example, in the query 301 of FIG. 3, since the top three cases are specified as the output range, if the order within the top three is changed, it is determined whether the processing result affects the ranking (step 904). ) Becomes Yes. For example, in the case of the process shown in FIG. 4, when {d, 20} arrives at time t4, the order within the top three is changed, so this is an example of Yes. If the processing result affects the ranking (if Yes is selected in step 904), it is checked whether there is an order output designation (905). If there is an order output designation (if Yes is selected in step 905), a rank information column is added to the processing result tuple (906), the processing result tuple is output (907), and the ranking process is terminated ( 908). If there is no designation of rank output (when No is selected in step 905), a processing result tuple is output (907), and the ranking process is terminated (908).

図3のクエリ301の場合には、順位出力の指定はないので、ランキング処理結果出力インタフェースから出力する処理結果タプルは、例えば図5の523に示すものであり、順位情報は付加されていない。順位出力の指定がある場合(ステップ905でYesが選択された場合)の例については後述する。   In the case of the query 301 of FIG. 3, since the rank output is not specified, the processing result tuple output from the ranking processing result output interface is, for example, shown at 523 in FIG. 5, and no rank information is added. An example of the case where the rank output is designated (when Yes is selected in step 905) will be described later.

前述したように、リアルタイムアプリケーションのランキング計算では、膨大な情報から瞬時に有用な情報を取り出す必要があるため、処理の効率化が必要となる。そこで、本実施例のストリームデータ処理システムでは、ランキングに変動があった差分だけを出力するインタフェースと、その時点のランキング内の全データを出力するインタフェースを備える。図5(a)中央の202は、図4で説明したクエリ301(図3)のウィンドウ演算“[Partition By s.id Rows 1]”、およびランキング計算指定句“LIMIT 3 By s.val DESC”の処理結果を格納したランキング情報保持バッファの各時刻での状態を示している。クエリ301では、最終的な出力形式として、IDSTREAM句が指定されている。IDSTREAM句は、ランキング計算の結果、ランキングに追加されたタプルを増加分タプルとして、ランキングから削除されたタプルを減少分タプルとして出力するインタフェースである。図5(a)では、IDSTREAM句(504)によって処理された後のストリームデータを図の右側の角丸四角523内に示した。ただし、該ストリームデータの黒丸は増加分、白丸は減少分を表す。以下、IDSTREAM句の処理の内容について説明する。時刻t1に{a,50}(505)がランキングに追加されるので、IDSTREAM句では処理結果の増加分ストリームデータとして{a,50}(512)を出力する。次に時刻t2、t3にそれぞれ{b,10}(506)および{c,30}(507)がランキングに追加されるので、{b,10}(514)および{c,30}(515)が増加分として出力される。時刻t4には、{d,20}(508)がランキングに挿入されると共に、{b,10}(506)がランキングから削除される。この場合、IDSTREAM句では、時刻t4に{d,20}(516)を増加分として、{b,10}(517)を減少分として出力する。増加分と減少分の情報のみを計算し、該情報を利用するクライアント計算機に送信することにより、ストリームデータ処理システムの処理コスト、および通信コストを削減することができる。例えば図5(a)の場合、t1からt7までの間に、クライアント計算機に対して11個の処理結果が送信されるが、各タイミングで上位n件の全結果を全て送信する場合にはn×7個の処理結果を送信する必要があり、特にnが大きい場合差分情報のみを送信する本発明の効果は高い。   As described above, in ranking calculation of a real-time application, it is necessary to instantly extract useful information from an enormous amount of information. Therefore, it is necessary to improve processing efficiency. Therefore, the stream data processing system according to the present embodiment includes an interface that outputs only the difference in ranking, and an interface that outputs all data in the ranking at that time. The center 202 in FIG. 5A is the window operation “[Partition By s. Id Rows 1]” of the query 301 (FIG. 3) described in FIG. 4 and the ranking calculation designation phrase “LIMIT 3 By s.val DESC”. This shows the status of the ranking information holding buffer storing the processing results at each time. In the query 301, the IDSTREAM phrase is specified as the final output format. The IDSTREAM phrase is an interface that outputs a tuple added to the ranking as an increase tuple and a tuple deleted from the ranking as a decrease tuple as a result of ranking calculation. In FIG. 5A, the stream data after being processed by the IDSTREAM phrase (504) is shown in a rounded square 523 on the right side of the figure. However, the black circle of the stream data represents an increase, and the white circle represents a decrease. The contents of the IDSTREAM phrase processing will be described below. Since {a, 50} (505) is added to the ranking at time t1, {a, 50} (512) is output as the stream data corresponding to the increased processing result in the IDSTREAM phrase. Next, {b, 10} (506) and {c, 30} (507) are added to the rankings at times t2 and t3, respectively, so {b, 10} (514) and {c, 30} (515) Is output as an increment. At time t4, {d, 20} (508) is inserted into the ranking and {b, 10} (506) is deleted from the ranking. In this case, in the IDSTREAM phrase, {d, 20} (516) is output as an increase and {b, 10} (517) is output as a decrease at time t4. By calculating only the information on the increase and the decrease and transmitting it to the client computer that uses the information, the processing cost and the communication cost of the stream data processing system can be reduced. For example, in the case of FIG. 5A, eleven processing results are transmitted to the client computer between t1 and t7. However, when all the top n results are transmitted at each timing, n It is necessary to transmit 7 processing results, and the effect of the present invention in which only difference information is transmitted is particularly high when n is large.

但し、クライアント計算機側でランキング情報を随時ユーザに提供し続ける必要がある場合には、クライアント計算機側で差分情報から全体のランキング情報を作成し続ける必要がある。本処理では、クライアント計算機側で状態(ステート)を管理する必要があるため、クライアント計算機の状態、リアルタイムアプリケーションの形態によっては実現が難しい場合もある。このような状況でもランキング情報を利用できるようにするために、本出願のストリームデータ処理システムでは、生成した差分ランキング情報から全体のランキング情報を生成し、出力するインタフェースを備える。図3(b)のクエリ302は、1行目のRSTREAM句以外はクエリ301と同一であり、1行目のSELECT句はs.idとs.valの値の組を出力対象とすることを、2行目のFROM句はストリームsを対象とすることを、同じく2行目のPartition By句はs.idの値でグルーピングしてそれぞれのs.valの値の最新の1件を保持することを、3行目のLIMIT句はs.valの値の降順に3件を出力することを指定する。クエリ301の1行目のIDSTREAM句が、前回の出力時との差分情報のみを出力するのに対して、クエリ302の1行目のRSTREAM句は、出力のタイミング毎に、出力指定範囲内のストリームタプル全てのランキング情報を出力することを意味している。図5(b)に、該インタフェースでのランキング計算出力結果を示す。図5(b)のランキング情報保持バッファ(202)の各時刻の状態は図5(a)の場合と同じである。LIMIT句の処理後に、図3(b)に示すクエリ302のRSTREAM句を適用した結果が図5(b)の右側の角丸四角526内に示すストリームデータとなる。以下図5(b)を用いて、ランキング計算結果の出力形式について説明する。時刻t1に{a,50}(505)がランキングに追加されるので、RSTREAM句では{a,50}(527)を出力する。次に時刻t2に{b,10}(506)がランキングに追加されると、RSTREAM句はランキング全体、すなわち{a,50}と{b,10}の2つのストリームデータを出力する(528)。次に時刻t3で{c,30}(507)がランキングに追加されると、{a,50}、{b,10}に加えて{c,30}が出力される(529)。次に、時刻t4で{d,20}(508)がランキングに挿入されると共に、{b,10}(506)がランキングから削除される。この場合、RSTREAM句では、時刻t4に{a,50}、{c,30}、{d,20}を出力する(530)。本処理を実現するためには、処理結果出力時にランキング処理結果出力インタフェース(207)で前回の出力時の出力内容を保持し、該出力内容と、順序・順位生成部(204)で新たに生成されたランキング情報とを組合せて、出力情報を生成すればよい。今回の説明では、RSTREAM句の出力タイミングは、入力となるストリームデータが到来した瞬間としたが、出力生成の負荷、通信コスト削減のために、例えば1秒毎などの一定間隔、入力タプルn個毎、出力タプルm個毎などでも差し支えない。   However, if it is necessary for the client computer side to continue to provide the ranking information to the user at any time, it is necessary to continue to create the overall ranking information from the difference information on the client computer side. In this processing, since it is necessary to manage the state on the client computer side, it may be difficult to realize depending on the state of the client computer and the form of the real-time application. In order to make it possible to use ranking information even in such a situation, the stream data processing system of the present application includes an interface that generates and outputs overall ranking information from the generated difference ranking information. The query 302 in FIG. 3B is the same as the query 301 except for the RSTREAM phrase in the first line, and the SELECT phrase in the first line is s. id and s. The output value is a set of val values, the FROM phrase in the second line is the stream s, and the Partition By phrase in the second line is the s. By grouping with the value of id, each s. The LIMIT phrase in the third line is s. Specifies that 3 items are output in descending order of the value of val. The IDSTREAM phrase on the first line of the query 301 outputs only the difference information from the previous output, whereas the RSTREAM phrase on the first line of the query 302 has an output specification range within each output timing. This means that ranking information for all stream tuples is output. FIG. 5B shows a ranking calculation output result at the interface. Each time state of the ranking information holding buffer (202) in FIG. 5 (b) is the same as in FIG. 5 (a). After the processing of the LIMIT phrase, the result of applying the RSTREAM phrase of the query 302 shown in FIG. 3B is the stream data shown in the rounded square 526 on the right side of FIG. 5B. Hereinafter, the output format of the ranking calculation result will be described with reference to FIG. Since {a, 50} (505) is added to the ranking at time t1, {a, 50} (527) is output in the RSTREAM phrase. Next, when {b, 10} (506) is added to the ranking at time t2, the RSTREAM phrase outputs the entire ranking, that is, two stream data of {a, 50} and {b, 10} (528). . Next, when {c, 30} (507) is added to the ranking at time t3, {c, 30} is output in addition to {a, 50} and {b, 10} (529). Next, {d, 20} (508) is inserted into the ranking at time t4, and {b, 10} (506) is deleted from the ranking. In this case, in the RSTREAM phrase, {a, 50}, {c, 30}, {d, 20} are output at time t4 (530). In order to realize this processing, when the processing result is output, the ranking processing result output interface (207) holds the output content at the previous output, and the output content and the order / rank generation unit (204) newly generate it. The output information may be generated by combining the ranking information. In this explanation, the output timing of the RSTREAM phrase is the moment when the input stream data arrives. However, in order to reduce the load of output generation and communication cost, for example, at regular intervals such as every 1 second, n input tuples For example, every m output tuples can be used.

次に、クエリで順位出力指定がある場合(図9のステップ905でYesが選択される場合)の例について、図6のクエリ601および602を用いて説明する。クエリ601では、クエリ301で出力したs.idとs.valに加えて、1行目のRANKING AS rank指定により、その時点での順位情報も加えて出力することが指定されている。また、クエリ601が前回出力した後の差分情報のみを出力するのに対して、クエリ602では、出力タイミング毎にランキング情報を全て出力する。   Next, an example in the case where the rank output is specified in the query (when Yes is selected in step 905 in FIG. 9) will be described using queries 601 and 602 in FIG. In the query 601, the s. id and s. In addition to val, the rank information at that time is specified to be output by the RANKING AS rank specification on the first line. Further, only the difference information after the query 601 is output last time is output, whereas the query 602 outputs all the ranking information for each output timing.

最初に、順位出力指定を含む場合のランキング計算方法について、図7を用いて説明する。図7の左側の角丸四角(1502)は、ウィンドウ演算“[Partition By s.id Rows 1]”の処理結果を格納したストリームタプル保持バッファの各時刻での状態を示しており、図4と同じである。各時刻の状態に対して、順位出力指定を含むランキング計算の方法を説明する。図7の凡例702に示すように、楕円で囲まれた2つの値の組は{id,val}の形式のストリームデータを表す。また、凡例703に示すように、角丸四角形で囲まれた3つの値の組は、{rank,id,val}の形式のストリームデータを表す。ここで、rankは出力時のvalの値に基づいた順位である。   First, a ranking calculation method in the case of including rank output designation will be described with reference to FIG. The rounded square (1502) on the left side of FIG. 7 shows the state at each time of the stream tuple holding buffer storing the processing result of the window operation “[Partition By s. Id Rows 1]”. The same. A ranking calculation method including rank output designation for each time state will be described. As shown in the legend 702 in FIG. 7, a set of two values surrounded by an ellipse represents stream data in the format of {id, val}. Also, as shown in the legend 703, a set of three values surrounded by a rounded rectangle represents stream data in the format {rank, id, val}. Here, rank is a rank based on the value of val at the time of output.

時刻t1にストリームデータで{a,50}(705)が到来すると、本ストリームタプルはランキングに含まれ、かつその順位は1位であるので、ランキング計算結果は{1,a,50}(712)となる。次に時刻t2にストリームデータ{b、10}(706)が到来すると、本ストリームデータもランキングに含まれるので、{2,b,10}(713)が出力される。時刻t3に{c,30}(707)が到来すると、本ストリームデータもランキングに含まれ、かつそのvalの値30が{b,10}よりも大きいため順位は2位となり、同時に{b,10}の順位は3位となる。そのため、ランキング計算結果からは、{2,b,10}が削除され、{3,b,10}(714)および{2,c,30}(715)が追加される。続いて、時刻t4にストリームデータ{d,20}(708)が到来すると、そのvalの値20が{b,10}のvalの値10よりも大きいので、{3,b,10}がランキング計算結果から削除され、{3,d,20}(716)が計算結果に追加される。次に、時刻t5でストリームデータ{e,40}(709)が到来すると、そのvalの値40は現在ランキング計算結果に含まれている{c,30}および{d,20}よりも大きく、順位は2位となるため{2,e,40}(718)がランキング計算結果に含まれる。同時に、{3,d,20}がランキング計算結果から削除され、かつ{c,30}の順位が2位から3位に変化するため、{2,c,30}が削除され、{3,c,30}(717)が追加される。時刻t6、t7にそれぞれ{e,15}(710)および{a,45}(711)が到来する場合も同様である。これらのランキング計算処理は、図2の順序・順位生成部(204)で実行され、各時刻でのランキング計算処理結果はランキング情報保持バッファ(202)に格納される。計算の好適な実施方法は、図9のフローチャートでは、ランキング情報保持バッファメンテナンス(903)までは共通である。次に、順序出力指定があるかないかをチェックし(905)、順序出力指定がある場合(905でYesが選択された場合)には処理結果タプルの順位情報カラム追加処理を実施する(906)。順位情報追加処理は、ランキング情報処理バッファ(202)を利用する。前述したように、好適な実施例では、ランキング情報保持バッファでは、追加されたストリームタプルを、順序付けが指定されたカラムの値の順序関係を保持しながら管理する。例えば、クエリ601の場合には、クエリ301の場合と同様に、順序付けの対象となるカラムはs.valであるので、ランキング情報保持バッファ内でのデータ構造としては、図2の203に示すようなテーブル形式や、図13のs.valの値をキーにした二分探索木が実施の方法として挙げられる。順位情報の追加処理では、順位情報追加対象のストリームカラムがs.valをキーにした場合何番目にあるかを計算し、該順位をクエリで指定されたカラムの位置に追加する。例えば、クエリ601の場合には、SELECT句の最初のカラムに“RANKING AS rank”指定があるため、一番目のカラムに順位情報を含めて出力する。   When {a, 50} (705) arrives at the time t1 in the stream data, this stream tuple is included in the ranking and its rank is first, so the ranking calculation result is {1, a, 50} (712 ) Next, when stream data {b, 10} (706) arrives at time t2, since this stream data is also included in the ranking, {2, b, 10} (713) is output. When {c, 30} (707) arrives at time t3, this stream data is also included in the ranking, and the value 30 of val is larger than {b, 10}. 10} is ranked 3rd. Therefore, {2, b, 10} is deleted from the ranking calculation result, and {3, b, 10} (714) and {2, c, 30} (715) are added. Subsequently, when the stream data {d, 20} (708) arrives at time t4, the val value 20 is larger than the val value 10 of {b, 10}, so {3, b, 10} is ranked. It is deleted from the calculation result, and {3, d, 20} (716) is added to the calculation result. Next, when stream data {e, 40} (709) arrives at time t5, its val value 40 is larger than {c, 30} and {d, 20} included in the current ranking calculation result, Since the ranking is second, {2, e, 40} (718) is included in the ranking calculation result. At the same time, {3, d, 20} is deleted from the ranking calculation result, and the order of {c, 30} changes from 2nd to 3rd, so {2, c, 30} is deleted, {3, c, 30} (717) is added. The same applies when {e, 15} (710) and {a, 45} (711) arrive at times t6 and t7, respectively. These ranking calculation processes are executed by the order / rank generation unit (204) of FIG. 2, and the ranking calculation process results at each time are stored in the ranking information holding buffer (202). The preferred implementation method of the calculation is common to the ranking information holding buffer maintenance (903) in the flowchart of FIG. Next, it is checked whether or not there is an order output designation (905). If there is an order output designation (when Yes is selected in 905), a rank information column addition process for the processing result tuple is performed (906). . The ranking information addition process uses the ranking information processing buffer (202). As described above, in the preferred embodiment, the ranking information holding buffer manages the added stream tuple while holding the order relation of the column values for which the ordering is specified. For example, in the case of the query 601, as in the case of the query 301, the column to be ordered is s. Since it is val, the data structure in the ranking information holding buffer includes a table format as indicated by 203 in FIG. A binary search tree using the value of val as a key can be cited as an implementation method. In the rank information addition process, the stream column to which rank information is added is s. When val is used as a key, the position number is calculated, and the rank is added to the column position specified by the query. For example, in the case of the query 601, since “RANKING AS rank” is specified in the first column of the SELECT clause, the rank information is output in the first column.

クエリ601では、最終的な出力形式として、IDSTREAM句が指定されている。クエリ301を用いて説明したように、IDSTREAM句は、ランキング計算の結果、ランキングに追加されたストリームデータを増加分として、ランキングから削除されたストリームデータを減少分として出力するインタフェースである。図8(a)では、IDSTREAM句(804)によって処理された後のストリームデータを図の右側(819)に示した。時刻t1に{a,50}(805)が到来した場合、出力カラムの先頭に前記順序・順位生成部で計算した順位情報をクエリで指定された1番目のカラムに追加して出力する。{a,50}が到来したときには、ストリームデータは1つしかなく、その順位は1位となるので、{1,a,50}(811)を出力する。次に時刻t2に{b,10}(806)が到来すると、その順位は2位となるので、{2,b,10}(812)を出力する。時刻t3に{c,30}(807)が到来すると、そのvalの値30は{a,50}のvalの値50よりは小さく、{b,10}のvalの値10よりは大きいため、その順位は2位となる。そのため、時刻t3では、{3,b,10}(813)および{2,c,30}(814)が増加分として出力されると共に、{2,b,10}(815)が減少分として出力される。図5で示したクエリ301の例では、{c,30}によりランキング出力に含まれる集合自体は変化しなかったため、増加分として{c,30}のみを出力した(515)が、図8のクエリ601の例では{c,30}の到来によって順位が変化するため、増加分、減少分を合わせて3つのストリームデータが出力される。同様にして、時刻t5およびt6では順位の変化に対応して、それぞれ4個(820)、(821)となり、クエリ301の場合よりも出力するストリームタプル数が増加している。クエリ601では、最終的な出力形式として、前記IDSTREAM句が指定されているため、増減分のストリームデータを出力しているが、順位出力指定がない場合と同様に、順位出力指定がある場合も各瞬間のランキングの全体を出力する要求もある。クエリ602がその例である。クエリ601のIDSTREAMのかわりにRSTREAMを指定する(829)ことによって、出力時点でのランキング計算結果全体を出力する。図8(b)はクエリ602の実行結果を示している。時刻t1〜t7のそれぞれの出力を822〜828に示した。   In the query 601, the IDSTREAM phrase is specified as the final output format. As described using the query 301, the IDSTREAM phrase is an interface that outputs the stream data added to the ranking as an increase and the stream data deleted from the ranking as a decrease as a result of the ranking calculation. In FIG. 8A, the stream data after being processed by the IDSTREAM phrase (804) is shown on the right side (819) of the figure. When {a, 50} (805) arrives at time t1, the rank information calculated by the order / rank generation unit is added to the head of the output column and output in the first column specified by the query. When {a, 50} arrives, there is only one stream data and the rank is first, so {1, a, 50} (811) is output. Next, when {b, 10} (806) arrives at time t2, the rank becomes second, so {2, b, 10} (812) is output. When {c, 30} (807) arrives at time t3, the val value 30 is smaller than the val value 50 of {a, 50} and larger than the val value 10 of {b, 10}. The ranking is 2nd. Therefore, at time t3, {3, b, 10} (813) and {2, c, 30} (814) are output as increments, and {2, b, 10} (815) as increments. Is output. In the example of the query 301 shown in FIG. 5, since the set itself included in the ranking output did not change due to {c, 30}, only {c, 30} was output as an increase (515). In the example of the query 601, since the order changes with the arrival of {c, 30}, three stream data are output by adding the increment and decrement. Similarly, at times t5 and t6, four (820) and (821) respectively correspond to the change in rank, and the number of stream tuples to be output is increased compared to the case of the query 301. In the query 601, since the IDSTREAM phrase is specified as the final output format, stream data corresponding to the increase / decrease is output. There is also a request to output the entire ranking of each moment. An example is the query 602. By specifying RSTREAM instead of IDSTREAM of the query 601 (829), the entire ranking calculation result at the time of output is output. FIG. 8B shows the execution result of the query 602. Respective outputs at times t1 to t7 are shown in 822 to 828.

以上の実施例では、ランキングの指定は降順でその開始順位は1位のみを示したが、ランキングの指定は昇順でも差し支えない。また、ランキング開始順位は任意の整数値での指定が可能である。例えば、図11のクエリ1101はストリームsから、s.idとs.valの値の組を、s.idの値でグルーピングしてそれぞれのs.valの値の最新の1件を保持し、開始順位10位からs.valの値の昇順に3件を出力することを示している。図3のクエリ301との違いは、3行目のOFFSET句とASC指定であり、前者が開始順位の指定、後者が昇順の指定である。OFFSET指定がある場合には、図9のランキング処理の受け取ったタプルがランキングに影響するか否かのチェック(904)は、受け取ったストリームタプルが、OFFSET句で指定された開始順位から、LIMIT句で指定された出力指定範囲に影響するか否かをチェックすればよい。ランキング情報の保持、管理に関しては、図2に示したランキング処理モジュール(116)でOFFSET指定なしの場合と同様に処理できる。
さらに、上述の実施例ではランキング付け対象のカラムが明示的にシステム投入されるが、ランキング付け対象のカラムを自動的に決定するシステムにも本発明は適用可能である。
In the above embodiment, the designation of ranking is in descending order and only the first ranking is shown, but the designation of ranking may be in ascending order. The ranking start order can be specified by an arbitrary integer value. For example, the query 1101 in FIG. id and s. The set of val values is denoted by s. By grouping with the value of id, each s. The latest one of the values of val is held, and s. It shows that 3 items are output in ascending order of the value of val. The difference from the query 301 in FIG. 3 is the OFFSET phrase and ASC designation on the third line, where the former is the designation of the start order and the latter is the designation in ascending order. If there is an OFFSET designation, a check (904) on whether the received tuple in the ranking process in FIG. 9 affects the ranking is performed by checking whether the received stream tuple is a LIMIT phrase from the start order designated by the OFFSET phrase. It is sufficient to check whether or not the output specification range specified in is affected. Retention and management of ranking information can be processed in the same manner as when OFFSET is not designated in the ranking processing module (116) shown in FIG.
Further, in the above-described embodiment, the ranking target column is explicitly input to the system, but the present invention can also be applied to a system that automatically determines the ranking target column.

本発明におけるストリームデータ処理システムの構成を示す図。The figure which shows the structure of the stream data processing system in this invention. 本発明におけるランキング処理モジュールの構成を示す図。The figure which shows the structure of the ranking process module in this invention. 本発明におけるランキング指定を含むクエリ(順位出力指定含まず)の例。An example of a query including ranking designation (not including rank output designation) in the present invention. 本発明におけるランキング計算の計算内容(順位出力指定含まず)を示す図。The figure which shows the calculation content (rank output designation | designated is not included) of the ranking calculation in this invention. 本発明におけるランキング計算結果の出力結果(順位出力指定含まず)を示す図。The figure which shows the output result (The ranking output designation is not included) of the ranking calculation result in this invention. 本発明におけるランキング指定を含むクエリ(順位出力指定含む)の例。The example of the query (rank output specification is included) containing the ranking specification in this invention. 本発明におけるランキング計算の計算内容(順位出力指定含む)を示す図。The figure which shows the calculation content (rank output designation | designated) of the ranking calculation in this invention. 本発明におけるランキング計算結果の出力結果(順位出力指定含む)を示す図。The figure which shows the output result (an order | rank output specification is included) of the ranking calculation result in this invention. 本発明におけるランキング処理手順を示すフローチャート。The flowchart which shows the ranking process sequence in this invention. 本発明におけるランキング情報保持バッファメンテナンス処理手順を示すフローチャート。The flowchart which shows the ranking information holding buffer maintenance processing procedure in this invention. 本発明におけるランキング指定を含むクエリ(オフセット指定含む)の例。An example of a query (including offset designation) including ranking designation in the present invention. クエリ処理言語CQLによるクエリ記述例。An example of query description in the query processing language CQL. 本発明におけるランキング情報の二分探索木による表現の例。The example of the expression by the binary search tree of the ranking information in this invention. 本発明におけるランキング情報保持バッファ内のランキング情報保持テーブルの変化の様子を示す図。The figure which shows the mode of a change of the ranking information holding table in the ranking information holding buffer in this invention. 本発明におけるウィンドウマネージャの構成を示す図。The figure which shows the structure of the window manager in this invention. 本発明におけるクエリ処理エンジンの計算機上での実現例を示す図。The figure which shows the implementation example on the computer of the query processing engine in this invention. 本発明におけるランキング計算方法を示すシーケンス図。The sequence diagram which shows the ranking calculation method in this invention. 本発明におけるランキング情報保持バッファへのストリームタプル追加処理方法を示すフローチャート。The flowchart which shows the stream tuple addition processing method to the ranking information holding buffer in this invention. 本発明におけるランキング情報保持バッファからのストリームタプル削除処理方法を示すフローチャート。The flowchart which shows the stream tuple deletion processing method from the ranking information holding buffer in this invention.

符号の説明Explanation of symbols

115…ストリームデータ処理システム
107、121…ネットワーク
113…クエリ処理エンジン
116、…ランキング処理モジュール
202…ランキング情報保持バッファ
203…ランキング情報保持テーブル
204…順序・順位生成部
206…ストリームタプル受付インタフェース
207…ランキング処理結果出力インタフェース
208…順位管理インデックス
116…ランキング処理モジュール
117…メモリマネージャ
126…ウィンドウマネージャ
1502…ストリームタプル保持バッファ
1504…生存期間決定部
1505…ストリームデータ受付インタフェース
1506…差分情報生成部
301、302、601、602、1101、1201…クエリ
1601…ストリームデータ処理サーバ
1602…通信インタフェース
1603…CPU
1604…メモリ
1605…I/Oインタフェース
1606…ストレージ装置
115: Stream data processing system 107, 121 ... Network 113 ... Query processing engine 116 ... Ranking processing module 202 ... Ranking information holding buffer 203 ... Ranking information holding table 204 ... Order / rank generation unit 206 ... Stream tuple reception interface 207 ... Ranking Processing result output interface 208 ... ranking management index 116 ... ranking processing module 117 ... memory manager 126 ... window manager 1502 ... stream tuple holding buffer 1504 ... lifetime determination unit 1505 ... stream data reception interface 1506 ... difference information generation units 301 and 302, 601, 602, 1101, 1201 ... Query 1601 ... Stream data processing server 1602 ... Communication interface 603 ... CPU
1604 ... Memory 1605 ... I / O interface 1606 ... Storage device

Claims (11)

継続的に到来する、タイムスタンプが付与された複数のストリームタプルで構成されるストリームデータを受け付け、予め登録されたクエリにより前記ストリームデータにクエリ処理を継続実行する制御部を有するストリームデータ処理システムにおける、ストリームデータのランキングクエリ処理方法であって、
前記制御部は、
前記クエリにより指定するウィンドウ指定に従い、各ストリームタプルが到着したタイミング毎に、該ストリームタプルのウィンドウ中の生存期間、もしくはそれに加えて過去に到着したストリームタプルのウィンドウ中の生存期間の終了を決定し、前記ウィンドウへのストリームタプルの挿入、及び前記ウィンドウからのストリームタプルの削除を示すウィンドウ差分情報を生成し、
前記クエリにより指定するランキング処理に従い、前記ウィンドウ差分情報に基づいて前記ウィンドウ中での生存期間にあるストリームタプルの範囲内でストリームタプル間のランキングを示すランキング情報を、第一のランキング情報から第二のランキング情報に更新し、
前記第一のランキング情報と前記第二のランキング情報との差分であるランキング差分情報を生成し、
前記ランキング差分情報と前記クエリで指定される出力指定範囲に基づいて、ランキング処理結果を出力すること、を特徴とするストリームデータのランキングクエリ処理方法。
In a stream data processing system having a control unit that continuously receives stream data composed of a plurality of stream tuples with time stamps and continuously executes query processing on the stream data by a pre-registered query , Stream data ranking query processing method,
The controller is
In accordance with the window specification specified by the query, for each timing when each stream tuple arrives , the lifetime in the stream tuple window or the end of the lifetime in the stream tuple window that arrived in the past is determined. Generating window difference information indicating insertion of a stream tuple into the window and deletion of the stream tuple from the window;
In accordance with the ranking process specified by the query , the ranking information indicating the ranking between the stream tuples within the range of the stream tuple in the lifetime in the window based on the window difference information is changed from the first ranking information to the second ranking information. Updated to the ranking information of
Generating ranking difference information that is a difference between the first ranking information and the second ranking information;
A ranking query processing method for stream data, comprising: outputting a ranking processing result based on the ranking difference information and an output designation range designated by the query.
前記制御部は、前記出力指定範囲を越えて生存期間内にあるストリームタプルの更新されたランキング情報を保存することを特徴とする請求項1に記載のストリームデータのランキングクエリ処理方法。  2. The stream data ranking query processing method according to claim 1, wherein the control unit stores the updated ranking information of stream tuples that are within the lifetime beyond the specified output range. 前記制御部は、前記ランキング差分情報に基づいて、前記第一のランキング情報と前記第二のランキング情報との差分を前記ランキング処理結果として出力することを特徴とする請求項1に記載のストリームデータランキングクエリ処理方法。  The stream data according to claim 1, wherein the control unit outputs a difference between the first ranking information and the second ranking information as the ranking processing result based on the ranking difference information. Ranking query processing method. 前記制御部は、出力した前記ランキング処理結果を保存し、前記ランキング差分情報と前回出力した前記ランキング処理結果とに基づいて、前記出力指定範囲に含まれる前記ランキング情報全体を前記ランキング処理結果として出力することを特徴とする請求項1に記載のストリームデータランキングクエリ処理方法  The control unit stores the outputted ranking process result, and outputs the entire ranking information included in the output designated range as the ranking process result based on the ranking difference information and the ranking process result outputted last time. The stream data ranking query processing method according to claim 1, 前記ランキング情報の保存は、生存期間内にある全てのストリームタプルに亘って行うことを特徴とする請求項1のストリームデータのランキングクエリ処理方法。  2. The stream data ranking query processing method according to claim 1, wherein the ranking information is stored over all stream tuples within the lifetime. 前記ランキング情報は、前記ウィンドウ内に各ストリームタプルと順位を対応させた表として保存することを特徴とする請求項1のストリームデータのランキングクエリ処理方法。  2. The ranking query processing method for stream data according to claim 1, wherein the ranking information is stored in the window as a table in which each stream tuple is associated with a rank. 継続的に到来する、タイムスタンプが付与された複数のストリームタプルで構成されるストリームデータを受け付け、予め登録されたクエリにより前記ストリームデータにクエリ処理を継続実行するストリームデータ処理システムであり、  A stream data processing system that continuously receives stream data composed of a plurality of stream tuples with time stamps attached thereto, and continuously executes query processing on the stream data according to a query registered in advance.
到来するストリームタプルに対してクエリで指定されたウィンドウ演算を実行し、各ストリームタプルのウィンドウ中の生存期間を決定するウィンドウマネージャと、  A window manager that performs the window operation specified in the query on the incoming stream tuple and determines the lifetime in the window of each stream tuple;
該クエリで指定されたランキング処理を行い、該クエリで指定された出力指定範囲に含まれるストリームタプルの集合を出力するランキング処理モジュールとを有し、  A ranking processing module that performs ranking processing specified by the query and outputs a set of stream tuples included in the output specification range specified by the query;
前記ウィンドウマネージャは、  The window manager
各ストリームタプルが到着したタイミング毎に前記ウィンドウへのストリームタプルの挿入、及び前記ウィンドウからのストリームタプルの削除を示すウィンドウ差分情報を生成して前記ランキング処理モジュールに伝達し、  Generates window difference information indicating insertion of a stream tuple into the window and deletion of a stream tuple from the window at each timing when each stream tuple arrives, and transmits it to the ranking processing module.
前記ランキング処理モジュールは、前記ウィンドウマネージャの差分情報生成部から伝達されるウィンドウ差分情報に基づいて、前記ウィンドウ中での生存期間にあるストリームタプルの範囲内でそれらのランキング情報を第一のランキング情報から第二のランキング情報に更新し、  The ranking processing module, based on the window difference information transmitted from the difference information generation unit of the window manager, converts the ranking information into first ranking information within the range of the stream tuple in the lifetime in the window. To the second ranking information from
前記ウィンドウ中の生存期間にあるストリームタプルの範囲内で前記第二のランキング情報をランキング情報保持バッファに保存し、  Storing the second ranking information in the ranking information holding buffer within the range of the stream tuple in the lifetime in the window;
前記第一のランキング情報と前記第二のランキング情報との差分であるランキング差分情報を生成し、前記ランキング差分情報と前記クエリで指定される出力指定範囲に基づいて、ランキング処理結果を出力する、ことを特徴とするストリームデータ処理システム。  Generating ranking difference information that is a difference between the first ranking information and the second ranking information, and outputting a ranking processing result based on the ranking difference information and an output designation range designated by the query; A stream data processing system.
前記ランキング処理モジュールは、前記ランキング差分情報に基づいて、前記第一のランキング情報と前記第二のランキング情報との差分を前記ランキング処理結果として出力すること、を特徴とする請求項7に記載のストリームデータ処理システム。  8. The ranking processing module according to claim 7, wherein the ranking processing module outputs a difference between the first ranking information and the second ranking information as the ranking processing result based on the ranking difference information. Stream data processing system. 前記ランキング処理モジュールは、出力した前記ランキング処理結果を保存し、前記ランキング差分情報と前回出力した前記ランキング処理結果とに基づいて、前記出力指定範囲に含まれる前記ランキング情報全体を前記ランキング処理結果として出力すること、を特徴とする請求項7に記載のストリームデータ処理システム。  The ranking processing module stores the output ranking processing result, and based on the ranking difference information and the ranking processing result output last time, the ranking information as a whole is included in the output designation range as the ranking processing result. The stream data processing system according to claim 7, wherein the stream data processing system outputs the stream data. 前記ランキング情報保持バッファは、各ストリームタプルとその順位を対応させた表として前記ランキング情報を保持することを特徴とする請求項7に記載のストリームデータ処理システム。  8. The stream data processing system according to claim 7, wherein the ranking information holding buffer holds the ranking information as a table in which each stream tuple and its rank are associated with each other. 前記差分情報生成部は、ストリームタプルが到来した時、該ストリームタプルに前記ウィンドウへの挿入を示す符号を付加し、決定したストリームタプルの生存期間の終了の時点で前記ウィンドウからの該ストリームタプルの削除を示す別の符号を付加し、それぞれ前記ウィンドウ差分情報として前記ランキング処理モジュールに伝達することを特徴とする請求項7に記載のストリームデータ処理システム。  When the stream tuple arrives, the difference information generation unit adds a code indicating insertion into the window to the stream tuple, and the stream tuple from the window at the end of the determined lifetime of the stream tuple. 8. The stream data processing system according to claim 7, wherein another code indicating deletion is added, and the difference information is transmitted as the window difference information to the ranking processing module.
JP2008174086A 2007-10-29 2008-07-03 Stream data ranking query processing method and stream data processing system having ranking query processing mechanism Active JP5377897B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2008174086A JP5377897B2 (en) 2007-10-29 2008-07-03 Stream data ranking query processing method and stream data processing system having ranking query processing mechanism
US12/222,413 US8335782B2 (en) 2007-10-29 2008-08-08 Ranking query processing method for stream data and stream data processing system having ranking query processing mechanism

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2007279786 2007-10-29
JP2007279786 2007-10-29
JP2008174086A JP5377897B2 (en) 2007-10-29 2008-07-03 Stream data ranking query processing method and stream data processing system having ranking query processing mechanism

Publications (2)

Publication Number Publication Date
JP2009134689A JP2009134689A (en) 2009-06-18
JP5377897B2 true JP5377897B2 (en) 2013-12-25

Family

ID=40866482

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008174086A Active JP5377897B2 (en) 2007-10-29 2008-07-03 Stream data ranking query processing method and stream data processing system having ranking query processing mechanism

Country Status (1)

Country Link
JP (1) JP5377897B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10474698B2 (en) 2013-10-31 2019-11-12 International Business Machines Corporation System, method, and program for performing aggregation process for each piece of received data

Families Citing this family (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4925143B2 (en) * 2009-08-12 2012-04-25 株式会社日立製作所 Stream data processing system, stream data processing method, and stream data processing program
JP5395565B2 (en) * 2009-08-12 2014-01-22 株式会社日立製作所 Stream data processing method and apparatus
WO2011111235A1 (en) * 2010-03-08 2011-09-15 株式会社日立製作所 Stream data processing system, stream data processing method, and stream data flow rate control program
US9189280B2 (en) 2010-11-18 2015-11-17 Oracle International Corporation Tracking large numbers of moving objects in an event processing system
US8990416B2 (en) 2011-05-06 2015-03-24 Oracle International Corporation Support for a new insert stream (ISTREAM) operation in complex event processing (CEP)
KR101238381B1 (en) * 2011-06-07 2013-02-28 엔에이치엔(주) Method and device to provide the most optimal process of n sort queries in multi-range scan
US9563663B2 (en) 2012-09-28 2017-02-07 Oracle International Corporation Fast path evaluation of Boolean predicates
US9805095B2 (en) 2012-09-28 2017-10-31 Oracle International Corporation State initialization for continuous queries over archived views
US10956422B2 (en) 2012-12-05 2021-03-23 Oracle International Corporation Integrating event processing with map-reduce
US10298444B2 (en) 2013-01-15 2019-05-21 Oracle International Corporation Variable duration windows on continuous data streams
US9390135B2 (en) 2013-02-19 2016-07-12 Oracle International Corporation Executing continuous event processing (CEP) queries in parallel
US9418113B2 (en) 2013-05-30 2016-08-16 Oracle International Corporation Value based windows on relations in continuous data streams
JP6021741B2 (en) 2013-06-05 2016-11-09 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Spatio-temporal database processing method, program and system
US10331672B2 (en) * 2013-06-21 2019-06-25 Hitachi, Ltd. Stream data processing method with time adjustment
JP6107495B2 (en) 2013-07-16 2017-04-05 富士通株式会社 Verification method and verification program
US9934279B2 (en) 2013-12-05 2018-04-03 Oracle International Corporation Pattern matching across multiple input data streams
US20160314153A1 (en) * 2013-12-17 2016-10-27 Nec Corporation Write information storage device, method, and recording medium
US9886486B2 (en) 2014-09-24 2018-02-06 Oracle International Corporation Enriching events with dynamically typed big data for event processing
US10120907B2 (en) 2014-09-24 2018-11-06 Oracle International Corporation Scaling event processing using distributed flows and map-reduce operations
WO2017018901A1 (en) 2015-07-24 2017-02-02 Oracle International Corporation Visually exploring and analyzing event streams
CN115858636B (en) * 2023-03-01 2023-06-27 深圳市宏博信息科技有限公司 Big data stream oriented distributed index searching method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6947934B1 (en) * 2000-02-16 2005-09-20 International Business Machines Corporation Aggregate predicates and search in a database management system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10474698B2 (en) 2013-10-31 2019-11-12 International Business Machines Corporation System, method, and program for performing aggregation process for each piece of received data

Also Published As

Publication number Publication date
JP2009134689A (en) 2009-06-18

Similar Documents

Publication Publication Date Title
JP5377897B2 (en) Stream data ranking query processing method and stream data processing system having ranking query processing mechanism
US8335782B2 (en) Ranking query processing method for stream data and stream data processing system having ranking query processing mechanism
JP5395565B2 (en) Stream data processing method and apparatus
US10217256B2 (en) Visually exploring and analyzing event streams
JP5337447B2 (en) Stream data processing method and system
JP5154366B2 (en) Stream data processing program and computer system
KR101719399B1 (en) Background format optimization for enhanced sql-like queries in hadoop
US9098587B2 (en) Variable duration non-event pattern matching
US8495082B2 (en) Stream data processing method cooperable with reference external data
US10298444B2 (en) Variable duration windows on continuous data streams
KR102037232B1 (en) System and method for distributed database query engines
US7996388B2 (en) Adding new continuous queries to a data stream management system operating on existing queries
US20160085809A1 (en) Enriching events with dynamically typed big data for event processing
JP2010134599A (en) Stream data processing control method, stream data processing apparatus and stream data processing control program
US20120221534A1 (en) Database index management
JP5480395B2 (en) Stream data processing method and apparatus
US20090106189A1 (en) Dynamically Sharing A Subtree Of Operators In A Data Stream Management System Operating On Existing Queries
JP4992945B2 (en) Stream data generation method, stream data generation device, and stream data generation program
JP6114473B2 (en) How to process stream data using time adjustment
US10812322B2 (en) Systems and methods for real time streaming
US8943017B2 (en) Method and device for real-time knowledge processing based on an ontology with temporal extensions
US10346371B2 (en) Data processing system, database management system, and data processing method
US20160171372A1 (en) Method And Device for Real-Time Knowledge Processing Based on an Ontology With Temporal Extensions
CN116975085A (en) Asynchronous data processing method, system and electronic equipment
JP2012142004A (en) Computing system, stream data management method and program

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110523

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20121228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130115

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130315

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: 20130827

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130925

R151 Written notification of patent or utility model registration

Ref document number: 5377897

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151