JP2012174212A - Window processing device, method, and program - Google Patents

Window processing device, method, and program Download PDF

Info

Publication number
JP2012174212A
JP2012174212A JP2011038656A JP2011038656A JP2012174212A JP 2012174212 A JP2012174212 A JP 2012174212A JP 2011038656 A JP2011038656 A JP 2011038656A JP 2011038656 A JP2011038656 A JP 2011038656A JP 2012174212 A JP2012174212 A JP 2012174212A
Authority
JP
Japan
Prior art keywords
window
data
processing
target element
buffer
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.)
Granted
Application number
JP2011038656A
Other languages
Japanese (ja)
Other versions
JP5637896B2 (en
Inventor
Tatsuya Asai
達哉 浅井
Hiroaki Morikawa
裕章 森川
Shinichiro Tako
真一郎 多湖
Hiroya Inakoshi
宏弥 稲越
Nobuhiro Yugami
伸弘 湯上
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2011038656A priority Critical patent/JP5637896B2/en
Publication of JP2012174212A publication Critical patent/JP2012174212A/en
Application granted granted Critical
Publication of JP5637896B2 publication Critical patent/JP5637896B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a window processing device capable of reducing computation time and a calculation area for window processing.SOLUTION: A window processing device 1 comprises: a data stream acquisition unit 12 that acquires a data stream including elements having the inclusion relation; a data stream analysis unit 13 that sequentially detects a position of a window element and a position of an arithmetic target element related to the window element from a data series, and stores a set of arithmetic processing values corresponding to the most recently detected arithmetic target element and a window element start symbol in a buffer 14 for every detection of the window element; a solution output unit 16 that performs window processing on the set of arithmetic processing values stored in the buffer 14.

Description

本発明は,包含関係を持つ要素を含むデータのストリームに対するウィンドウ処理技術に関する。   The present invention relates to a window processing technique for a stream of data including elements having an inclusion relationship.

近年,センサデータ,POS(Point of Sales)データ,ブログやツィッター(twitter)などのウェブデータなど,時々刻々と発生し続ける大量データを,リアルタイムに処理することを目的としたストリーム処理(Stream Processing)が注目を集めている。   In recent years, stream processing (Stream Processing) for the purpose of processing in real time a large amount of data that is constantly generated, such as sensor data, POS (Point of Sales) data, and web data such as blogs and Twitter. Has attracted attention.

ストリーム処理では,リアルタイム性が要求されるため,限られた計算領域を用いて,できるだけ少ない処理量で計算する技術が必須である。   In stream processing, real-time performance is required, so a technique for calculating with as little processing as possible using a limited calculation area is essential.

これまでは,大量データの処理にはDBMS(データベース管理システム)を用いるのが主流であった。しかし,DBMSでは,データ格納や補助データ作成に膨大な処理時間が必要となるため,リアルタイム処理には不向きである。   Until now, DBMS (database management system) has been the mainstream for processing large amounts of data. However, since DBMS requires a huge amount of processing time for data storage and auxiliary data creation, it is not suitable for real-time processing.

なお,現在の商用またはオープンソースのストリーム処理エンジンは,データ種としてCSVのような固定長のデータを想定しており,より柔軟なデータ表現が可能なXML形式のデータを効率よく扱うことはできない。   In addition, the current commercial or open source stream processing engine assumes fixed-length data such as CSV as the data type, and cannot efficiently handle data in XML format that allows more flexible data representation. .

ストリーム処理における最も基本的な処理の1つとして,ウィンドウ処理がある。ウィンドウ処理では,決められた処理期間内のデータのみを逐次的に処理することによって,無限長のデータストリームに対して,決められた計算領域だけを用いてリアルタイムで処理することができる。   One of the most basic processes in stream processing is window processing. In window processing, only data within a predetermined processing period is sequentially processed, so that an infinitely long data stream can be processed in real time using only a predetermined calculation area.

上記のウィンドウ処理を,XMLデータのストリームに適用するために,Xquery拡張言語およびその実行システムが提案されている(第1の既存技術)。   In order to apply the above window processing to a stream of XML data, an Xquery extension language and its execution system have been proposed (first existing technology).

図16は,XMLデータのストリームの例を説明するための図である。   FIG. 16 is a diagram for explaining an example of an XML data stream.

図16に示す例では,ある要素をルートにして包含関係を持つ構成要素を含むXMLデータが次々と発生してストリームを構成しているとする。   In the example shown in FIG. 16, it is assumed that XML data including constituent elements having an inclusion relationship with a certain element as a root is generated one after another to form a stream.

図16に示すXMLデータのストリームは,POSシステムで生成されたデータである。このPOS要素をルートとするXMLデータ(以下,POS木と呼ぶ)は,cust要素とshop要素とを持つ。また,レジ担当者(店員)が変わるまでは,新しいPOS木は発生しないものとする。   The XML data stream shown in FIG. 16 is data generated by the POS system. The XML data having the POS element as a root (hereinafter referred to as a POS tree) has a custom element and a shop element. Further, it is assumed that a new POS tree does not occur until the cashier person (store clerk) changes.

cust要素は,顧客の買い物データを表わす。cust要素は,必須要素として,購入品の価格を表すpric要素を持ち,任意要素として,購入者名を表すname要素を持つ。cust要素は,1つのPOS木に何回現れてもよい。   The custom element represents customer shopping data. The “cust” element has a “pric” element representing the price of the purchased product as an essential element, and a “name” element representing the purchaser name as an optional element. The custom element may appear any number of times in a single POS tree.

shop要素は,レジ担当の店員データを表わす。shop要素は,必須要素として,店員IDを表すid要素を持つ。shop要素は,POS木に正確に1回だけ現れるものとする。   The shop element represents the clerk data in charge of the cash register. The shop element has an id element representing a clerk ID as an essential element. The shop element shall appear exactly once in the POS tree.

図16に示すPOS木に対するウィンドウ処理として,以下のようなXMLウィンドウ問い合わせが与えられたとする。   Assume that the following XML window query is given as window processing for the POS tree shown in FIG.

for window $w in /pos/cust
range 3
sliding 1
return SUM($w/pric)
上記のXMLウィンドウ問い合わせは,ウィンドウ処理として,ウィンドウサイズ(range)=3,スライド幅(sliding)=1のスライディングウィンドウが設定されること,パス式“/pos/cust”で指定される部分木をウィンドウ構成要素とし,各ウィンドウ$wに対して,パス式“$w/pric”で指定される演算対象要素(pric要素)に対応する演算対象要素値の総和を出力することを示す。
for window $ w in / pos / cust
range 3
sliding 1
return SUM ($ w / pric)
In the above XML window query, a sliding window with window size (range) = 3, slide width (sliding) = 1 is set as window processing, and a subtree specified by the path expression “/ pos / cust” is set. This indicates that the sum of the calculation target element values corresponding to the calculation target element (pric element) specified by the path expression “$ w / pric” is output for each window $ w.

図17は,XMLデータ系列に対するウィンドウ処理を説明するための図である。   FIG. 17 is a diagram for explaining window processing for an XML data series.

図17に示すように,ウィンドウ処理では,XMLデータのストリームから,1スキャン目の処理でウィンドウ構成要素(cust要素から始まる部分木)が1つ切り出され,ウィンドウバッファBに格納される。そして,2スキャン目の処理で,ウィンドウバッファB内のウィンドウ構成要素から演算対象要素値が取得されて集計装置M内のバッファに格納される。その後,集計装置Mにより,バッファ内に格納された演算対象要素値が集計される。   As shown in FIG. 17, in the window processing, one window component (partial tree starting from a custom element) is cut out from the XML data stream in the first scan and stored in the window buffer B. Then, in the process of the second scan, the calculation target element value is acquired from the window constituent element in the window buffer B and stored in the buffer in the counting device M. Thereafter, the calculation target element values stored in the buffer are totaled by the totaling device M.

また,別の既存技術として,ストリーム型のXpath照合が提案されている(第2の既存技術)。   As another existing technology, stream-type Xpath matching has been proposed (second existing technology).

ストリーム型のXpath照合は,XMLデータを1回スキャンしてXpath問合せを照合する手法に基づいた,ストリーム型のXpath照合エンジンにより実現される。   The stream type Xpath collation is realized by a stream type Xpath collation engine based on a method of collating an Xpath query by scanning XML data once.

図18は,XMLデータ系列に対するストリーム型のXpath照合を説明するための図である。   FIG. 18 is a diagram for explaining stream-type Xpath verification for an XML data series.

ストリーム型のXpath照合では,1スキャン目で,ウィンドウ構成要素を指定したパス(Xpath:/pos/cust)が照合され,さらに,2スキャン目で,演算対象要素を指定したパス(Xpath:/pos/cust/pric)が照合されて,演算対象要素に対応付けられた演算対象要素値が特定される。   In the stream type Xpath collation, the path (Xpath: / pos / cus) specifying the window component is collated at the first scan, and the path (Xpath: / pos) specifying the operation target element at the second scan. / Cust / pric) is collated, and the calculation target element value associated with the calculation target element is specified.

XMLデータから単に演算対象要素(pric)を検出するだけであれば,Xpathが指定するXMLの部分木を1スキャンで取得することができる。しかし,XMLデータは,ウィンドウ構成要素に包含される演算対象要素が不特定であることなど,柔軟な表現が可能である。そのため,包含関係にある演算対象要素をウィンドウ構成要素による部分木と関連付けて取得するためには,2スキャンが必要であった。   If the calculation target element (prix) is simply detected from the XML data, the XML subtree specified by Xpath can be acquired in one scan. However, the XML data can be expressed flexibly, for example, the calculation target element included in the window component is unspecified. For this reason, two scans are required in order to acquire the calculation target element in the inclusive relation in association with the subtree by the window constituent element.

具体的には,上記のXMLウィンドウ問い合わせの場合のように演算を各ウィンドウ構成要素単位(XP1)で行いたい場合には,図18に示すように,演算対象要素XP2_2,XP2_3が,包含関係にあるウィンドウ構成要素XP1_2に関連付けられて取得されなければならなかった。すなわち,XMLデータからのウィンドウ構成要素の照合と各ウィンドウ構成要素からの演算対象要素の照合とのために,2スキャンが必要であった。   Specifically, when it is desired to perform an operation in units of each window component (XP1) as in the case of the above XML window inquiry, as shown in FIG. 18, the operation target elements XP2_2 and XP2_3 are in an inclusion relationship. It had to be acquired in association with a certain window component XP1_2. That is, two scans are required for collating the window constituent elements from the XML data and collating the calculation target elements from the respective window constituent elements.

A.Arasu,et al, “The CQL Continuous Query Language: Semantic Foundations and Query Execution”, VLDB J., Vol. 15(2), pp.121−142, 2006年A. Arasu, et al, “The CQL Continuous Query Language: Semantic Foundations and Query Execution”, VLDB J. et al. , Vol. 15 (2), pp. 121-142, 2006 I. Botan, et al, “Extending XQuery with Window Functions”, Proc. VLDB 2007, pp.75−86, 2007年I. Botan, et al, “Extending XQuery with Window Functions”, Proc. VLDB 2007, pp. 75-86, 2007 I. Avila−Campillo, et al, “XMLTK: An XML Toolkit for Scalable XML Stream Processing”, Proc. PLANX’02, 2002年I. Avila-Camillo, et al, “XMLTK: An XML Tool for Scalable XML Stream Processing”, Proc. PLANX'02, 2002 Y. Diao, et al, “Path Sharing and Predicate Evaluation for High−Performance XPath Filtering”, Proc. ACM TODS, 28(4), 467−516, 2003年Y. Diao, et al, “Path Sharing and Predicate Evaluation for High-Performance XPath Filtering”, Proc. ACM TODS, 28 (4), 467-516, 2003

上記で第1の既存技術として説明した,XMLデータ系列に対するウィンドウ処理では,ウィンドウ構成要素の取得に1スキャン,さらに演算対象要素値の取得に1スキャンの合計2回のスキャンの実行が必要であり,処理が非効率であるという問題があった。   In the window processing for the XML data series described above as the first existing technology, it is necessary to execute two scans in total, that is, one scan for acquiring the window component and one scan for acquiring the calculation target element value. There was a problem that the processing was inefficient.

また,第2の既存技術として説明した,XMLデータ系列に対するストリーム型Xpathの照合処理では,互いに包含関係にある部分木を関連付けて取得するために,ウィンドウ構成要素と演算対象要素のそれぞれの照合に2スキャンの実行が必要であり,同様に,処理が非効率であるという問題があった。   Also, in the collation processing of the stream type Xpath for the XML data series described as the second existing technology, in order to obtain the subtrees in an inclusive relationship in association with each other, the collation between the window constituent element and the calculation target element is performed. Two scans are required to be executed, and similarly, there is a problem that the processing is inefficient.

本発明の目的は,例えばXMLデータのように,包含関係を持つ要素を含むデータ系列に対するウィンドウ処理において,ウィンドウ構成要素と関連付けた演算対象要素を1回のスキャンで取得できる処理技術を提供することである。   An object of the present invention is to provide a processing technique capable of acquiring a calculation target element associated with a window constituent element in a single scan in a window process for a data series including elements having an inclusive relation such as XML data. It is.

本発明の一態様として開示されるウィンドウ処理装置は,1)データを格納するバッファと,2)包含関係を持つ要素を含むデータ系列を取得するデータ取得部と,3)前記データ系列から,ウィンドウ処理単位を定めるウィンドウ構成要素の位置および前記ウィンドウ構成要素に包含される演算対象要素の位置を前記ウィンドウ構成要素に関連付けて逐次的に検出し,前記ウィンドウ構成要素を検出する度に,直前に検出したウィンドウ構成要素と関連付けた演算対象要素に対応する演算対象要素値の集合を前記バッファに格納するデータストリーム解析部と,4)前記バッファに格納された前記ウィンドウ構成要素に関連付けられた演算処理値の集合に対してウィンドウ処理を行うウィンドウ処理部とを備える。   A window processing device disclosed as one aspect of the present invention includes 1) a buffer for storing data, 2) a data acquisition unit for acquiring a data series including elements having inclusion relations, and 3) a window from the data series. The position of the window component that defines the processing unit and the position of the operation target element included in the window component are sequentially detected in association with the window component, and are detected immediately before each window component is detected. A data stream analysis unit that stores in the buffer a set of operation target element values corresponding to the operation target element associated with the window component, and 4) an operation processing value associated with the window component stored in the buffer A window processing unit for performing window processing on the set of

また,本発明の別の態様として開示されるウィンドウ処理方法は,コンピュータが,上記ウィンドウ処理装置の各処理部で実現される各処理に対応する処理ステップを実行するものである。   In addition, in a window processing method disclosed as another aspect of the present invention, a computer executes processing steps corresponding to each process realized by each processing unit of the window processing apparatus.

また,本発明の別の態様として開示されるウィンドウ処理プログラムは,コンピュータに,上記ウィンドウ処理装置の各処理部で実現される各処理に対応する処理ステップを実行させるものである。   A window processing program disclosed as another aspect of the present invention causes a computer to execute processing steps corresponding to each processing realized by each processing unit of the window processing device.

上記した手段によれば,データ系列からウィンドウ構成要素と演算対象要素とを1回のスキャンで同時に行うことができ,ウィンドウ処理の計算時間と計算領域との効率化を実現することができる。   According to the above-described means, the window constituent element and the operation target element can be simultaneously performed from the data series by one scan, and the efficiency of the calculation time and calculation area of the window processing can be realized.

本発明の一態様として開示するウィンドウ処理装置の一実施例における構成例を示す図である。It is a figure which shows the structural example in one Example of the window processing apparatus disclosed as 1 aspect of this invention. データストリーム解析部の構成例を示す図である。It is a figure which shows the structural example of a data stream analysis part. XMLストリームXSのデータ構造の表現例を示す図である。It is a figure which shows the example of expression of the data structure of XML stream XS. ウィンドウクエリQの例を示す図である。It is a figure which shows the example of the window query Q. ウィンドウ処理装置の処理フローを示す図である。It is a figure which shows the processing flow of a window processing apparatus. ウィンドウクエリ取得処理のより詳細な処理フロー例を示す図である。It is a figure which shows the example of a more detailed process flow of a window query acquisition process. データストリーム解析処理の処理フロー例を示す図である。It is a figure which shows the example of a processing flow of a data stream analysis process. データCXの例を示す図である。It is a figure which shows the example of the data CX. ステップS22のストリーム解析のより詳細な処理フローを示す図である。It is a figure which shows the more detailed process flow of the stream analysis of step S22. XMLストリームのXMLデータとパス照合によりバッファに出力されるデータとの関係例を示す図である。It is a figure which shows the example of a relationship between the XML data of an XML stream, and the data output to a buffer by path | pass verification. 解出力処理の処理フロー例を示す図である。It is a figure which shows the example of a processing flow of a solution output process. バッファのデータと,解出力処理により出力シーケンスSeqに出力されるデータとの関係を模式的に示す図(その1)である。FIG. 6 is a diagram (part 1) schematically illustrating a relationship between buffer data and data output to an output sequence Seq by a solution output process. バッファのデータと,解出力処理により出力シーケンスSeqに出力されるデータとの関係を模式的に示す図(その2)である。FIG. 10 is a diagram (part 2) schematically illustrating a relationship between buffer data and data output to an output sequence Seq by a solution output process. バッファのデータと,解出力処理により出力シーケンスSeqに出力されるデータとの関係を模式的に示す図(その3)である。FIG. 11 is a diagram (No. 3) schematically illustrating a relationship between buffer data and data output to an output sequence Seq by a solution output process. XMLストリームXSの各XMLデータと,バッファに出力されるデータとの関係を模式的に示す図である。It is a figure which shows typically the relationship between each XML data of the XML stream XS, and the data output to a buffer. XMLデータのストリームの例を説明するための図である。It is a figure for demonstrating the example of the stream of XML data. XMLデータ系列に対するウィンドウ処理を説明するための図である。It is a figure for demonstrating the window process with respect to an XML data series. XMLデータ系列に対するストリーム型のXpath照合を説明するための図である。It is a figure for demonstrating the stream type Xpath collation with respect to an XML data series.

本発明の一態様として開示するウィンドウ処理装置は,既知のストリーム型のXPath照合機能に,XMLストリームからウィンドウ構成要素に関連付けられた演算対象要素を検出し,検出済みの演算対象要素に対応する演算対象要素値を取得して,ウィンドウ構成要素の開始位置を検出する度に,ウィンドウ構成要素開始を表わす記号と検出済みの演算対象要素に対応する演算対象値の集合とをバッファに送信する機能を有する。   A window processing apparatus disclosed as one aspect of the present invention detects a calculation target element associated with a window constituent element from an XML stream using a known stream type XPath collation function, and performs a calculation corresponding to the detected calculation target element. A function that acquires a target element value and detects the start position of the window component, and sends a symbol representing the start of the window component and a set of calculation target values corresponding to the detected calculation target element to the buffer. Have.

図1は,本発明の一態様として開示するウィンドウ処理装置1の一実施例における構成例を示す図である。   FIG. 1 is a diagram illustrating a configuration example in an embodiment of a window processing apparatus 1 disclosed as one aspect of the present invention.

ウィンドウ処理装置1は,包含関係を持つ要素を含むデータ系列,例えばXMLデータのストリーム(以下,XMLストリーム)に対するウィンドウ処理を実行する。より詳しくは,ウィンドウ処理装置1は,ユーザが使用するクエリ装置2からXMLストリームXSに対するウィンドウ問い合わせ(クエリ)Qを受け付け,データ送信装置3からネットワークNを介して送信されたXMLストリームXSに対するウィンドウ処理を実行する。ウィンドウ処理として,ウィンドウクエリQで設定されたウィンドウサイズwおよびスライド幅sをもとに,直近のウィンドウ集計値aを,ウィンドウがスライドするたびに出力し,その出力をウィンドウクエリQの解(集計値a)Aとして送信する。   The window processing apparatus 1 executes window processing on a data series including elements having an inclusion relationship, for example, an XML data stream (hereinafter, XML stream). More specifically, the window processing device 1 receives a window inquiry (query) Q for the XML stream XS from the query device 2 used by the user, and performs window processing for the XML stream XS transmitted from the data transmission device 3 via the network N. Execute. As window processing, based on the window size w and slide width s set in the window query Q, the latest window total value a is output each time the window slides, and the output is the solution of the window query Q (total) Value a) Send as A.

ウィンドウ処理装置1は,上記の機能を実現するため,ウィンドウクエリ受付部11,データストリーム取得部12,データストリーム解析部13,バッファ14,バッファ集計部15,および解出力部16を備える。   The window processing device 1 includes a window query reception unit 11, a data stream acquisition unit 12, a data stream analysis unit 13, a buffer 14, a buffer totaling unit 15, and a solution output unit 16 in order to realize the above functions.

ウィンドウクエリ受付部11は,ユーザのクエリ装置2から,ウィンドウ単位であるウィンドウ構成要素XP1,演算対象を示す演算対象要素XP2,ウィンドウサイズw(w≧1)およびスライド幅s(s≧1)の指定を含むウィンドウクエリQを受け付ける。   The window query reception unit 11 receives a window component element XP1, which is a window unit, an operation target element XP2, an operation target element XP2, a window size w (w ≧ 1), and a slide width s (s ≧ 1) from the user query device 2. A window query Q including designation is accepted.

データストリーム取得部12は,XMLデータの発生源であるデータ送信装置3から,ネットワークNを解してXMLストリームXSを受信する。   The data stream acquisition unit 12 receives the XML stream XS through the network N from the data transmission device 3 that is the generation source of the XML data.

データストリーム解析部13は,逐次的に,受信したXMLストリームXSから,ウィンドウ構成要素XP1の位置を検出し,さらにウィンドウ構成要素XP1に包含される演算対象要素XP2の位置をウィンドウ構成要素XP1に関連付けて検出する。そして,データストリーム解析部13は,検出した演算対象要素XP2に対応する演算対象要素値の集合を保持し,ウィンドウ構成要素XP1の開始位置を検出する度に,保持している演算対象要素値の集合,すなわち直前に検出した演算対象要素XP2に対応する演算対象要素値の集合をバッファ14に格納する。   The data stream analyzer 13 sequentially detects the position of the window component XP1 from the received XML stream XS, and further associates the position of the operation target element XP2 included in the window component XP1 with the window component XP1. To detect. Then, the data stream analysis unit 13 holds a set of calculation target element values corresponding to the detected calculation target element XP2, and every time the start position of the window component element XP1 is detected, the data stream analysis unit 13 A set, that is, a set of calculation target element values corresponding to the calculation target element XP2 detected immediately before is stored in the buffer 14.

バッファ14は,ウィンドウ構成要素XP1の検出,および検出したウィンドウ構成要素XP1に関連付けられた演算対象要素値の集合である値リストVを保持する。   The buffer 14 holds a value list V that is a set of element values to be calculated associated with the detection of the window component XP1 and the detected window component XP1.

バッファ集計部15は,ウィンドウサイズwおよびスライド幅sにもとづいて,バッファ14に格納されているウィンドウサイズw分の演算対象要素値の集合を集計してウィンドウ集計値aを得る。バッファ集計部15は,ウィンドウがスライドする度に,直近に得られたウィンドウ集計値aを解出力部16へ出力する。   Based on the window size w and the slide width s, the buffer tabulation unit 15 tabulates a set of calculation target element values for the window size w stored in the buffer 14 to obtain a window tabulation value a. The buffer totalization unit 15 outputs the window totalization value a obtained most recently to the solution output unit 16 each time the window slides.

解出力部16は,出力されたウィンドウ集計値aを,ウィンドウクエリの解Aとしてクエリ装置2へ送る。   The solution output unit 16 sends the output window total value a to the query device 2 as the solution A of the window query.

なお,上記バッファ集計部15,解出力部16およびウィンドウクエリ受付部11は,ウィンドウ処理部の一実施例である。   The buffer totaling unit 15, the solution output unit 16, and the window query receiving unit 11 are examples of a window processing unit.

図2は,データストリーム解析部13の構成例を示す図である。   FIG. 2 is a diagram illustrating a configuration example of the data stream analysis unit 13.

データストリーム解析部13は,ストリーム型パス照合部131,ウィンドウ構成要素位置検出部132,演算対象要素位置検出部133,演算対象要素値検出部135,演算対象要素値取得部136,ウィンドウ構成要素開始記号送信部137,および演算対象要素値リスト送信部138を備える。   The data stream analysis unit 13 includes a stream type path matching unit 131, a window component position detection unit 132, a calculation target element position detection unit 133, a calculation target element value detection unit 135, a calculation target element value acquisition unit 136, and a window component start A symbol transmission unit 137 and a calculation target element value list transmission unit 138 are provided.

ストリーム型パス照合部131は,受け付けたXMLストリームXSの各XMLデータに対してストリーム型のXpath照合を行って,XMLデータから要素を検出する。   The stream type path verification unit 131 performs stream type Xpath verification on each XML data of the received XML stream XS, and detects elements from the XML data.

ウィンドウ構成要素位置検出部132は,XMLデータから,ウィンドウ構成要素XP1の開始位置または終了位置を検出する。ここで,ウィンドウ構成要素XP1の開始位置および終了位置は,ウィンドウ構成要素XP1の開始/終了を示すタグまたはイベントとする。   The window component position detector 132 detects the start position or the end position of the window component XP1 from the XML data. Here, the start position and the end position of the window component XP1 are tags or events indicating the start / end of the window component XP1.

演算対象要素位置検出部133は,XMLデータから,演算対象要素XP2の開始位置または終了位置を検出する。ここで,演算対象要素XP2の開始位置および終了位置は,演算対象要素XP2を示す開始/終了を示すタグまたはイベントとする。   The calculation target element position detection unit 133 detects the start position or end position of the calculation target element XP2 from the XML data. Here, the start position and end position of the calculation target element XP2 are a tag or event indicating the start / end indicating the calculation target element XP2.

演算対象要素値検出部135は,検出した演算対象要素XP2に対応する演算対象要素値を検出する。   The calculation target element value detection unit 135 detects a calculation target element value corresponding to the detected calculation target element XP2.

演算対象要素値取得部136は,XMLデータから,ウィンドウ構成要素に関連付けられて検出された演算対象要素XP2に対応する演算対象要素値を取得して,値リストVに追加する。   The calculation target element value acquisition unit 136 acquires a calculation target element value corresponding to the calculation target element XP2 detected in association with the window component from the XML data, and adds the calculation target element value to the value list V.

ウィンドウ構成要素開始記号送信部137は,ウィンドウ構成要素XP1の開始位置が検出される度に,検出されたウィンドウ構成要素XP1の開始位置を示すフラグ($)をバッファ14に書き出す。   The window component start symbol transmission unit 137 writes a flag ($) indicating the start position of the detected window component XP1 to the buffer 14 every time the start position of the window component XP1 is detected.

演算対象要素値リスト送信部138は,ウィンドウ構成要素XP1の開始位置が検出された後に演算対象要素XP2の終了位置が検出された場合に,検出済みの演算対象要素値のリストVをバッファ14に書き出す。   The calculation target element value list transmission unit 138 stores the list V of detected calculation target element values in the buffer 14 when the end position of the calculation target element XP2 is detected after the start position of the window component element XP1 is detected. Write out.

図3(A)〜(C)は,XMLストリームXSのデータ構造の表現例を示す図である。   FIGS. 3A to 3C are diagrams illustrating examples of the representation of the data structure of the XML stream XS.

データストリーム取得部12が受信するXMLストリームXSにおける各XMLデータは,POSシステムで生成されたデータであり,POS要素をルートとして,包含関係を持つ要素を含む。XMLデータは,cust要素とshop要素とを持ち,レジ担当者(店員)が変わるまでは,新しいXMLデータ(POS要素)は発生しないものとする。   Each XML data in the XML stream XS received by the data stream acquisition unit 12 is data generated by the POS system, and includes elements having an inclusion relationship with the POS element as a root. The XML data has a custom element and a shop element, and new XML data (POS element) is not generated until the cashier person (store clerk) changes.

顧客の買い物データを示すcust要素は,必須要素として,購入品の価格を表すpric要素を持ち,任意要素として,購入者名を表すname要素を持つ。cust要素は,1つのXMLデータに何回出現してもよい。   The custom element indicating the customer's shopping data has a price element indicating the price of the purchased item as an essential element and a name element indicating the purchaser name as an optional element. The custom element may appear any number of times in a piece of XML data.

レジ担当の店員データを示すshop要素は,必須要素として,店員IDを表すid要素を持ち,XMLデータ内に1回だけ出現するものとする。   The shop element indicating the clerk data in charge of the cash register has an id element representing the clerk ID as an essential element, and appears only once in the XML data.

図3(A)〜(C)は,XMLストリームXSのデータ構造の表現例を示す図である。   FIGS. 3A to 3C are diagrams illustrating examples of the representation of the data structure of the XML stream XS.

図3(A)は,上記したXMLデータのデータ構造を木構造で表現したものである。図3(A)に示すXMLデータの木構造表現は,図3(B)に示すように,タグを用いたテキスト表現に変換することができる。さらに,図3(B)のXMLデータのテキスト表現は,図3(C)に示すようなイベント列の表現として扱うことができる。XMLデータのイベント列表現の代表例として,W3C標準のSAXがある。   FIG. 3A shows the tree structure of the data structure of the XML data described above. The tree structure representation of the XML data shown in FIG. 3A can be converted into a text representation using tags as shown in FIG. Further, the text representation of the XML data in FIG. 3B can be treated as an event string representation as shown in FIG. As a representative example of the event string representation of XML data, there is the W3C standard SAX.

本実施例において,データストリーム取得部12は,XMLストリームXSとして,XMLデータのテキスト表現またはイベント表現のストリームを取得することができる。   In the present embodiment, the data stream acquisition unit 12 can acquire a text expression or event expression stream of XML data as the XML stream XS.

また,本実施例において,データストリーム解析部13は,XMLデータのイベント列表現に対して動作するが,XMLデータのテキスト表現を直接入力して,逐次的にイベントを検出しながら処理を行うように構成されてもよい。   In the present embodiment, the data stream analysis unit 13 operates on the event string representation of the XML data. However, the data stream analysis unit 13 directly inputs the text representation of the XML data and performs processing while sequentially detecting the event. It may be configured.

図4は,ウィンドウクエリQの例を示す図である。   FIG. 4 is a diagram illustrating an example of the window query Q.

図4に示すウィンドウクエリQは,ウィンドウ構成要素XP1を指定するパス式“/pos/cust”,演算対象要素XP2を指定するパス式“/pos/cust/pric”,ウィンドウサイズrange=3,およびスライド幅sliding=1の指定が含まれている。   The window query Q shown in FIG. 4 includes a path expression “/ pos / cust” that specifies the window component XP1, a path expression “/ pos / cust / pric” that specifies the operation target element XP2, a window size range = 3, and The designation of slide width sliding = 1 is included.

以下,ウィンドウ処理装置1の処理の流れを説明する。   Hereinafter, the process flow of the window processing apparatus 1 will be described.

図5は,ウィンドウ処理装置1の処理フローを示す図である。   FIG. 5 is a diagram showing a processing flow of the window processing apparatus 1.

ステップS1: ウィンドウクエリ取得処理
ウィンドウクエリ受付部11がウィンドウクエリ取得処理を実行する。
Step S1: Window Query Acquisition Processing The window query reception unit 11 executes window query acquisition processing.

図6は,ウィンドウクエリ取得処理のより詳細な処理フロー例を示す図である。   FIG. 6 is a diagram illustrating a more detailed processing flow example of the window query acquisition processing.

ウィンドウクエリ受付部11は,ユーザのクエリ装置2からウィンドウクエリQを受け取る(ステップS11)。   The window query reception unit 11 receives the window query Q from the user query device 2 (step S11).

ウィンドウクエリ受付部11は,受信したウィンドウクエリQから,ウィンドウ構成要素XP1および演算対象要素XP2のパス指定を抽出する。そして,ウィンドウクエリ受付部11は,データストリーム解析部13へXpath照合で用いる指定パス,すなわち,ウィンドウ構成要素XP1を指定するXpath XP1=/pos/cust,演算対象要素XP2を指定するXpath XP2=/pos/cust/pricを送信する(ステップS12)。   The window query reception unit 11 extracts path designations of the window component element XP1 and the calculation target element XP2 from the received window query Q. Then, the window query reception unit 11 specifies the specified path used for the Xpath collation to the data stream analysis unit 13, that is, Xpath XP1 = / pos / cus for specifying the window component element XP1, and Xpath XP2 = / for specifying the operation target element XP2. pos / cust / pric is transmitted (step S12).

ウィンドウクエリ受付部11は,受信したウィンドウクエリQから,ウィンドウサイズw(=3),スライド幅s(=1)を抽出し,バッファ集計部15へ送る(ステップS13)。   The window query accepting unit 11 extracts the window size w (= 3) and the slide width s (= 1) from the received window query Q, and sends them to the buffer totaling unit 15 (step S13).

ステップS2: データストリーム解析処理
データストリーム解析部13は,XMLストリームXSに対するXpath照合を行って,ウィンドウ構成要素XP1,演算対象要素XP2を抽出する。
Step S2: Data Stream Analysis Processing The data stream analysis unit 13 performs Xpath collation on the XML stream XS, and extracts the window component element XP1 and the operation target element XP2.

図7は,データストリーム解析処理の処理フロー例を示す図である。   FIG. 7 is a diagram illustrating a processing flow example of the data stream analysis processing.

データストリーム解析部13は,XMLストリームXSを受け取る。データストリーム解析部13は,XMLストリームXSでの処理対象とするXMLデータを示すCXを用意し,初期化として,受け取ったXMLストリームXSの最初のXMLデータをデータCXとする(ステップS21)。図8は,データCXの例を示す図である。データストリーム解析部13は,XMLデータのイベント列表現を受け取る。   The data stream analysis unit 13 receives the XML stream XS. The data stream analysis unit 13 prepares CX indicating the XML data to be processed in the XML stream XS, and sets the first XML data of the received XML stream XS as data CX as initialization (step S21). FIG. 8 is a diagram illustrating an example of the data CX. The data stream analysis unit 13 receives an event string representation of XML data.

次に,データストリーム解析部13は,データCXに対してパス照合処理を行う(ステップS22)。   Next, the data stream analysis unit 13 performs a path matching process on the data CX (step S22).

データストリーム解析部13は,XMLストリームXSのデータCXの次にXMLデータが存在するか判定する(ステップS23)。データストリーム解析部13は,XMLストリームXSのデータCXの次にXMLデータが存在すれば(ステップS23のY),次のXMLデータをデータCXとし(ステップS24),XMLストリームXSに次のXMLデータが存在しなければ(ステップS23のN),処理を終了する。   The data stream analysis unit 13 determines whether XML data exists after the data CX of the XML stream XS (step S23). If there is XML data next to the data CX of the XML stream XS (Y in step S23), the data stream analysis unit 13 sets the next XML data as the data CX (step S24), and the next XML data in the XML stream XS. Is not present (N in step S23), the process is terminated.

図9は,ステップS22のパス照合処理のより詳細な処理フローを示す図である。   FIG. 9 is a diagram showing a more detailed processing flow of the path matching process in step S22.

データストリーム解析部13のストリーム型パス照合部131は,初期化として,スキャン位置を示すカーソルCをデータCX(イベント列)の最初のイベントに設定し,演算対象要素フラグFA=0,値リストVを空リストとする(ステップS221)。そして,ストリーム型パス照合部131は,パス照合を行い,データCXのカーソルCがあるイベントの種別を判定する(ステップS222)。   The stream type path matching unit 131 of the data stream analyzing unit 13 sets the cursor C indicating the scan position as the first event of the data CX (event sequence) as an initialization, the calculation target element flag FA = 0, the value list V Is an empty list (step S221). Then, the stream type path matching unit 131 performs path matching and determines the type of event where the cursor C of the data CX is present (step S222).

ステップS222の処理で,ウィンドウ構成要素位置検出部132により,そのイベントが「ウィンドウ構成要素XP1の開始」であると判定された場合に,ウィンドウ構成要素開始記号送信部137が,ウィンドウ構成要素開始記号“$”をバッファ14に出力する(ステップS223)。ウィンドウ構成要素位置検出部132により,イベントが「ウィンドウ構成要素XP1の終了」であると判定された場合に,演算対象要素値リスト送信部138が,値リストVをバッファ14に出力する(ステップS224)。   In the process of step S222, when the window component position detection unit 132 determines that the event is “start of window component XP1”, the window component start symbol transmission unit 137 displays the window component start symbol. “$” Is output to the buffer 14 (step S223). When the window component position detecting unit 132 determines that the event is “end of window component XP1”, the calculation target element value list transmitting unit 138 outputs the value list V to the buffer 14 (step S224). ).

演算対象要素位置検出部133により,イベントが「演算対象要素XP2の開始」であると判定された場合に,演算対象要素位置検出部133が,演算対象要素フラグFA=1を設定する(ステップS225)。イベントが「演算対象要素XP2の終了」であると判定された場合に,演算対象要素位置検出部133が,演算対象要素フラグFA=0を設定する(ステップS226)。   When the calculation target element position detection unit 133 determines that the event is “start of calculation target element XP2”, the calculation target element position detection unit 133 sets the calculation target element flag FA = 1 (step S225). ). When it is determined that the event is “completion of the calculation target element XP2”, the calculation target element position detection unit 133 sets the calculation target element flag FA = 0 (step S226).

また,演算対象要素値検出部135により,イベントが「テキスト」のノードであると判定された場合に,さらに,演算対象要素値取得部136が,演算対象要素フラグFA=1であるかを判定する(ステップS227)。そして,演算対象要素フラグFA=1であれば(ステップS227のY),演算対象要素値取得部136が,カーソルCが位置するイベントのテキスト値をリストVに追加する(ステップS228)。一方,演算対象要素フラグFA=1でなければ(ステップS227のN),ステップS229の処理へ進む。   When the calculation target element value detection unit 135 determines that the event is a “text” node, the calculation target element value acquisition unit 136 further determines whether the calculation target element flag FA = 1. (Step S227). If the calculation target element flag FA = 1 (Y in step S227), the calculation target element value acquisition unit 136 adds the text value of the event where the cursor C is located to the list V (step S228). On the other hand, if the calculation target element flag FA is not 1 (N in step S227), the process proceeds to step S229.

ステップS223〜S226およびS228の処理後,または,ステップS222の処理においてカーソルCが位置するイベントが上記のいずれの場合にも該当しない場合(それ以外),または,ステップS227の処理で演算対象要素フラグFA=1でない場合に,ストリーム型パス照合部131は,データCXで,カーソルCが位置するイベントの次にイベントが存在するかを判定する(ステップS229)。カーソルCが位置するイベントの次にイベントが存在する場合に(ステップS229のY),ストリーム型パス照合部131は,カーソルCを次のイベントに移し(ステップS2210),ステップS222の処理へ戻す。   After the processing of steps S223 to S226 and S228, or when the event where the cursor C is located in the processing of step S222 does not correspond to any of the above cases (other than that), or in the processing of step S227, the calculation target element flag When FA is not 1, the stream type path matching unit 131 determines whether there is an event after the event where the cursor C is located in the data CX (step S229). If there is an event next to the event where the cursor C is located (Y in step S229), the stream type path matching unit 131 moves the cursor C to the next event (step S2210), and returns to the processing in step S222.

カーソルCが位置するイベントの次にイベントが存在しない場合に(ステップS229のN),演算対象要素値リスト送信部138は,値リストVをバッファ14に出力する(ステップS2211)。   When there is no event next to the event where the cursor C is located (N in step S229), the calculation target element value list transmission unit 138 outputs the value list V to the buffer 14 (step S2211).

図10は,XMLストリームのXMLデータと,パス照合によりバッファ14に出力されるデータとの関係例を示す図である。   FIG. 10 is a diagram illustrating an example of the relationship between XML data of an XML stream and data output to the buffer 14 by path verification.

図10に示すXMLストリームXSにおいて,データCXを破線矩形で示している。図10のデータCXは,図8に示すイベント列に対応している。 In XML stream XS shown in FIG. 10 shows a data CX 1 by a broken line rectangle. The data CX 1 in FIG. 10 corresponds to the event sequence shown in FIG.

データストリーム解析部13により,データCXにおいて,XP1=/pos/custとの照合によりパス/pos/custが検出されると(図8(a)),ウィンドウ構成要素XP1“cust”の開始位置と判断されて,ウィンドウ構成要素開始記号“$”がバッファ14に出力される。 When the data stream analysis unit 13 detects the path / pos / cus in the data CX 1 by collating with XP1 = / pos / cus (FIG. 8A), the start position of the window component XP1 “cust” The window component start symbol “$” is output to the buffer 14.

その後に,XP2=/pos/cust/pricとの照合によりパス/pos/cust/pricが検出されると(図8(b)),演算対象要素“pric”の開始位置と判断されて,FA=1が設定され,対応する演算対象要素値(500)が抽出されて値リストVに格納される(図8(c))。続いて,パス/pos/cust/pricの終了が検出されると(図8(d)),演算対象要素“pric”の終了位置と判断されて,FA=0と変更される。   After that, when the path / pos / cus / pric is detected by collating with XP2 = / pos / cust / pric (FIG. 8 (b)), it is determined as the start position of the calculation target element “pric”, and FA = 1 is set, the corresponding element value (500) to be calculated is extracted and stored in the value list V (FIG. 8 (c)). Subsequently, when the end of the path / pos / cust / pric is detected (FIG. 8D), it is determined that the calculation target element “pric” ends, and FA = 0 is changed.

その後に,パス/pos/custの終了が検出されると(図8(e)),ウィンドウ構成要素XP1“cust”の終了位置と判断されて,値リストV={500}がバッファ14に出力される。   Thereafter, when the end of the path / pos / cus is detected (FIG. 8 (e)), it is determined as the end position of the window component XP1 “cust”, and the value list V = {500} is output to the buffer 14 Is done.

図10に示すXMLストリームXSにおいて,データCXを破線矩形で示している。 In XML stream XS shown in FIG. 10 shows a data CX 2 by a broken line rectangle.

データCXの場合と同様に,データストリーム解析部13によって,XP1=/pos/custとのパス照合によってウィンドウ構成要素XP1“cust”の開始位置が検出されると,ウィンドウ構成要素開始記号“$”がバッファ14に出力される。 Similarly to the case of the data CX 1 , when the data stream analysis unit 13 detects the start position of the window component XP1 “cust” by path verification with XP1 = / pos / cus, the window component start symbol “$” "Is output to the buffer 14.

その後に,XP2=/pos/cust/pricとのパス照合によって演算対象要素“pric”の開始位置が検出されると,FA=1が設定され,対応する演算対象要素値(300)がリストVに格納される。演算対象要素“pric”の終了位置が検出されると,FA=0と変更されるが,データXでは,続いて,演算対象要素“pric”の開始が検出されて,FA=1が再設定され,対応する演算対象要素値(200)がリストVに追加される。 Thereafter, when the start position of the calculation target element “pric” is detected by path matching with XP2 = / pos / cust / pric, FA = 1 is set, and the corresponding calculation target element value (300) is displayed in the list V. Stored in When the end position of the calculation target element “pric” is detected, FA = 0 is changed. However, in the data X 2 , the start of the calculation target element “prix” is subsequently detected and FA = 1 is reset. The calculation target element value (200) is set and added to the list V.

その後,データCXの場合と同様に,ウィンドウ構成要素XP1“cust”の終了が検出されると,リストV={300,200}がバッファ14に出力される。 Thereafter, as in the case of the data CX 1 , when the end of the window component XP 1 “cust” is detected, the list V = {300, 200} is output to the buffer 14.

ステップS3: 解出力処理
図11は,解出力処理の処理フロー例を示す図である。
Step S3: Solution Output Processing FIG. 11 is a diagram illustrating a processing flow example of the solution output processing.

バッファ集計部15は,初期化として,バッファ14でのデータの位置を示すカーソルCBを,バッファ14の最初のデータに設定し,ウィンドウサイズカウンタCW=0を設定し,出力シーケンスSeqを空列とする(ステップS31)。   As an initialization, the buffer totaling unit 15 sets the cursor CB indicating the position of data in the buffer 14 to the first data in the buffer 14, sets the window size counter CW = 0, and sets the output sequence Seq as an empty string. (Step S31).

バッファ集計部15は,バッファ14で,カーソルCBが設定されたデータの種類を判定する(ステップS32)。データの種類が,ウィンドウ構成要素開始記号“$”であれば(ステップS32の「記号$」),バッファ集計部15は,ウィンドウサイズカウンタCWを1増やして(ステップS33),ステップS39に進み,データの種類が,値リストVであれば(ステップS32の「値リスト」),ステップS34に進む。ステップS34の処理で,バッファ集計部15は,CW≧0ならば,カーソルCBが設定された値リストVを出力シーケンスSeqの末尾に追加する。   The buffer totaling unit 15 determines the type of data for which the cursor CB is set in the buffer 14 (step S32). If the data type is the window component start symbol “$” (“symbol $” in step S32), the buffer tabulation unit 15 increments the window size counter CW by 1 (step S33), and proceeds to step S39. If the data type is the value list V (“value list” in step S32), the process proceeds to step S34. In the process of step S34, if CW ≧ 0, the buffer totaling unit 15 adds the value list V in which the cursor CB is set to the end of the output sequence Seq.

続いて,バッファ集計部15は,ウィンドウサイズカウンタCWがウィンドウサイズwより小さいか(CW<w)を判定して(ステップS35),ウィンドウサイズカウンタCWがウィンドウサイズwより小さくなく,等しい(CW=w)場合に(ステップS35のN),出力シーケンスSeq内のデータ(値リストV)の集計値aを求めて,解出力部16へ出力する(ステップS36)。解出力部16は,上記のステップS36の処理により,集計値aを逐次受け取り,ウィンドウクエリQの解Aとしてクエリ装置2へ送る。   Subsequently, the buffer totalization unit 15 determines whether the window size counter CW is smaller than the window size w (CW <w) (step S35), and the window size counter CW is not smaller than the window size w and is equal (CW = w) In the case (N in step S35), the total value a of the data (value list V) in the output sequence Seq is obtained and output to the solution output unit 16 (step S36). The solution output unit 16 sequentially receives the total value a by the processing of step S36 described above, and sends it to the query device 2 as the solution A of the window query Q.

さらに,バッファ集計部15は,出力シーケンスSeqに格納されたデータの先頭からs件のデータを削除する。なお,スライド幅sがウィンドウサイズwより大きい(s>w)場合は,出力シーケンスSeqに格納されたデータを全件削除する。バッファ集計部15は,ウィンドウサイズカウンタCWを,CW−sの値に置き換える(ステップS37)。   Furthermore, the buffer totalization unit 15 deletes s data from the head of the data stored in the output sequence Seq. When the slide width s is larger than the window size w (s> w), all data stored in the output sequence Seq is deleted. The buffer totalization unit 15 replaces the window size counter CW with the value of CW-s (step S37).

その後,バッファ集計部15は,バッファ14内でカーソルCBが設定されたデータの次にデータが存在するかを判定する(ステップS38)。バッファ14内に次のデータが存在する場合に(ステップS38のY),バッファ集計部15は,カーソルCBを次のデータ(値リスト)に移し(ステップS39),ステップS32の処理へ戻る。バッファ14内に次のデータが存在しない場合に(ステップS38のN),処理を終了する。   Thereafter, the buffer totaling unit 15 determines whether data exists after the data for which the cursor CB is set in the buffer 14 (step S38). When the next data exists in the buffer 14 (Y in step S38), the buffer totalization unit 15 moves the cursor CB to the next data (value list) (step S39), and returns to the process in step S32. If the next data does not exist in the buffer 14 (N in step S38), the process is terminated.

図12〜図14は,バッファ14のデータと,解出力処理により出力シーケンスSeqに出力されるデータとの関係を模式的に示す図である。図12〜図14に示す処理は,ウィンドウサイズw=3,スライド幅s=1の場合のものである。   12 to 14 are diagrams schematically showing the relationship between the data in the buffer 14 and the data output to the output sequence Seq by the solution output process. The processing shown in FIGS. 12 to 14 is for the case where the window size w = 3 and the slide width s = 1.

バッファ集計部15によって,バッファ14内で,先頭のデータにカーソルCBが設定され,ウィンドウサイズカウンタCW=0に初期化される。   The buffer tabulation unit 15 sets the cursor CB to the first data in the buffer 14 and initializes the window size counter CW = 0.

図12(A)に示すように,CBが位置するデータがウィンドウ構成要素開始記号“$”であり,ウィンドウサイズカウンタCWが1増加され(CW=1),カーソルCBが次のデータに移される。そして,図12(B)に示すように,CBが移動したデータが,演算対象要素値の値リストVであれば,値リストV={500}が出力シーケンスSeqに格納され,カーソルCBはさらに次のデータに移される。   As shown in FIG. 12A, the data in which CB is located is the window element start symbol “$”, the window size counter CW is incremented by 1 (CW = 1), and the cursor CB is moved to the next data. . Then, as shown in FIG. 12B, if the data moved by CB is the value list V of the element values to be calculated, the value list V = {500} is stored in the output sequence Seq, and the cursor CB further Move to next data.

そして,図13(A)に示すように,カーソルCBが移動したデータがウィンドウ構成要素開始記号“$”であれば,ウィンドウサイズカウンタCW=2となり,カーソルCBが次のデータに移される。そして,図13(B)に示すように,カーソルCBが移動したデータの値リストV={300,200}が出力シーケンスSeqに格納され,さらにカーソルCBが次のデータに移される。   Then, as shown in FIG. 13A, if the data that the cursor CB has moved is the window element start symbol “$”, the window size counter CW = 2, and the cursor CB is moved to the next data. Then, as shown in FIG. 13B, the data value list V = {300, 200} to which the cursor CB has moved is stored in the output sequence Seq, and the cursor CB is moved to the next data.

同様にして,カーソルCBが移動したデータがウィンドウ構成要素開始記号“$”であれば,CW=3となり,カーソルCBが次のデータに移される。   Similarly, if the data to which the cursor CB has moved is the window component start symbol “$”, CW = 3, and the cursor CB is moved to the next data.

その後,図14(A)に示すように,カーソルCBが移動したデータが値リストであれば,その値リストV={100}が出力シーケンスSeqに格納される。ここで,ウィンドウサイズカウンタCWがウィンドウサイズw(=3)と等しくなるので,出力シーケンスSeqに格納された値リストが集計されて,集計値a(1100)が得られる。さらに,図14(B)に示すように,出力シーケンスSeqに格納されたデータ(値リスト)の先頭から,s=1件のデータ(値リスト)が削除され,ウィンドウサイズカウンタCWがCW−s(=2)の値に変更される。なお,カーソルCBは,同様にして次のデータに移される。   Thereafter, as shown in FIG. 14A, if the data to which the cursor CB has moved is a value list, the value list V = {100} is stored in the output sequence Seq. Here, since the window size counter CW is equal to the window size w (= 3), the value list stored in the output sequence Seq is totaled to obtain the total value a (1100). Further, as shown in FIG. 14B, s = 1 data (value list) is deleted from the head of the data (value list) stored in the output sequence Seq, and the window size counter CW is set to CW-s. The value is changed to (= 2). The cursor CB is similarly moved to the next data.

図15は,XMLストリームXSの各XMLデータと,バッファに出力されるデータとの関係を模式的に示す図である。   FIG. 15 is a diagram schematically illustrating a relationship between each XML data of the XML stream XS and data output to the buffer.

ウィンドウ処理装置1は,ウィンドウ構成要素XP1の開始位置を検出する度に,直前に検出された演算対象要素XP2に対応する演算対象要素値の集合とウィンドウ構成要素開始記号“$”とをバッファ14に格納する。   Each time the window processing device 1 detects the start position of the window component XP1, the buffer 14 stores a set of calculation target element values corresponding to the calculation target element XP2 detected immediately before and the window component start symbol “$”. To store.

ウィンドウ処理装置1は,1つのウィンドウ構成要素XP1に含まれる演算対象要素XP2が不特定数であっても,包含される演算対象要素XP2をすべてウィンドウ構成要素XP1に関連付けて検出し,演算対象要素XP2に対応する演算対象値をリストにまとめて保持する。   The window processing apparatus 1 detects all the included calculation target elements XP2 in association with the window component XP1 even if the calculation target element XP2 included in one window component XP1 is an unspecified number. The calculation target values corresponding to XP2 are held together in a list.

したがって,バッファ14には,1回のスキャンで,ウィンドウ構成要素XP1の開始位置を示すウィンドウ構成要素開始記号“$”と,ウィンドウ構成要素XP1に含まれる演算対象要素XP2に対応する演算対象要素値の集合(値リストV)とが交互に格納される。そのため,解集計処理において,ウィンドウ構成要素を単位とした演算対象要素値の集計が可能となる。   Therefore, in the buffer 14, the window component element start symbol “$” indicating the start position of the window component element XP1 and the calculation object element value corresponding to the operation element XP2 included in the window element element XP1 are stored in the buffer 14 once. Are stored alternately (value list V). Therefore, in the solution aggregation process, it is possible to aggregate the calculation target element values in units of window components.

本実施例において,ウィンドウ処理装置1は,ステップS2のデータストリーム解析処理とステップS3の解出力処理を,XMLストリームXSのXMLデータXごとに実行し,XMLストリームXSのXMLデータXの取得に従ってループして実行する。しかし,XMLストリームXSが有限の系列であれば,ウィンドウ処理装置1は,XMLストリームXSについて,ステップS2のデータストリーム解析処理とステップS3の解出力処理をバッチ的に実行するように構成されてもよい。   In the present embodiment, the window processing apparatus 1 executes the data stream analysis process of step S2 and the solution output process of step S3 for each XML data X of the XML stream XS, and loops according to the acquisition of the XML data X of the XML stream XS. And run. However, if the XML stream XS is a finite sequence, the window processing apparatus 1 may be configured to execute the data stream analysis process in step S2 and the solution output process in step S3 in batch for the XML stream XS. Good.

ウィンドウ処理装置1は,CPUおよびメモリ等を有するハードウェアと,ソフトウェアプログラムとを備えるコンピュータ・システム,または専用ハードウェアによって実現することができる。   The window processing device 1 can be realized by a computer system including hardware having a CPU, a memory, and the like, and a software program, or dedicated hardware.

ウィンドウ処理装置1は,演算装置(CPU),一時記憶装置(DRAM,フラッシュメモリ等)および永続性記憶装置(HDD,フラッシュメモリ等)を有し,外部とデータの入出力をするコンピュータによって実施することができる。また,ウィンドウ処理装置1は,このコンピュータが実行可能なプログラムによっても実施することができる。この場合に,ウィンドウ処理装置1が有すべき機能の処理内容を記述したプログラムが提供される。提供されたプログラムを上記コンピュータが実行することによって,上記説明したウィンドウ処理装置1の処理機能がコンピュータ上で実現される。なお,上記コンピュータは,可搬型記録媒体から直接プログラムを読み取り,そのプログラムに従った処理を実行することもできる。さらに,上記プログラムは,コンピュータで読み取り可能な記録媒体に記録しておくことができる。   The window processing apparatus 1 includes a processing unit (CPU), a temporary storage device (DRAM, flash memory, etc.), and a permanent storage device (HDD, flash memory, etc.), and is implemented by a computer that inputs and outputs data to the outside. be able to. The window processing apparatus 1 can also be implemented by a program executable by this computer. In this case, a program describing the processing contents of the functions that the window processing apparatus 1 should have is provided. When the computer executes the provided program, the processing functions of the window processing apparatus 1 described above are realized on the computer. The computer can also read a program directly from a portable recording medium and execute processing according to the program. Furthermore, the program can be recorded on a computer-readable recording medium.

以上説明したように,開示したウィンドウ処理装置1によれば,次のような効果がある。   As described above, the disclosed window processing apparatus 1 has the following effects.

すなわち,ウィンドウ処理装置1によれば,ウィンドウ構成要素に含まれる演算対象の要素が不特定数であるようなデータのストリームに対しても1回のスキャンによるウィンドウ処理が可能となり,処理時間および格納領域を軽減することができる。   In other words, the window processing device 1 enables window processing by one scan even for a data stream in which an operation target element included in a window component is an unspecified number, and processing time and storage The area can be reduced.

従来技術では,ウィンドウ構成要素の開始位置と演算対象要素位置を検出するために,XMLストリームにおける各XMLデータを,2回スキャンする必要があった。しかし,ウィンドウ処理装置1によれば,ウィンドウ構成要素の開始位置と演算対象要素位置を1回のスキャンで同時に検出するため,計算時間を削減できる。   In the prior art, in order to detect the start position of the window constituent element and the calculation target element position, it is necessary to scan each XML data in the XML stream twice. However, according to the window processing apparatus 1, since the start position of the window constituent element and the calculation target element position are detected simultaneously in one scan, the calculation time can be reduced.

さらに,副次的効果として,ウィンドウ処理装置1では,ウィンドウ構成要素のすべてをバッファ14に保持するタイプの従来技術とは異なり,集計処理に必要最低限のデータ(値リスト)を取得してバッファ14に格納する。その結果として,ウィンドウ処理装置1によれば,バッファ14に保持するデータ量を削減できるため,計算時間と計算領域とを削減できる。   Further, as a secondary effect, the window processing apparatus 1 obtains the minimum data (value list) necessary for the totaling processing and obtains the buffer, unlike the conventional technique in which all the window components are held in the buffer 14. 14. As a result, according to the window processing apparatus 1, the amount of data held in the buffer 14 can be reduced, so that the calculation time and the calculation area can be reduced.

1 ウィンドウ処理装置
11 ウィンドウクエリ受付部
12 データストリーム取得部
13 データストリーム解析部
131 ストリーム型パス照合部
132 ウィンドウ構成要素位置検出部
133 演算対象要素位置検出部
135 演算対象要素値検出部
136 演算対象要素値取得部
137 ウィンドウ構成要素開始記号送信部
138 演算対象要素値リスト送信部
14 バッファ
15 バッファ集計部
16 解出力部
2 クエリ装置
3 データ送信装置
DESCRIPTION OF SYMBOLS 1 Window processing apparatus 11 Window query reception part 12 Data stream acquisition part 13 Data stream analysis part 131 Stream type | mold path collation part 132 Window component element position detection part 133 Calculation object element position detection part 135 Calculation object element value detection part 136 Calculation object element Value acquisition unit 137 Window component element start symbol transmission unit 138 Operation target element value list transmission unit 14 Buffer 15 Buffer aggregation unit 16 Solution output unit 2 Query device 3 Data transmission device

Claims (4)

データ系列に対するウィンドウ処理を実行するウィンドウ処理装置であって,
データを格納するバッファと,
包含関係を持つ要素を含むデータ系列を取得するデータ取得部と,
前記データ系列から,ウィンドウ処理単位を定めるウィンドウ構成要素の位置および前記ウィンドウ構成要素に包含される演算対象要素の位置を前記ウィンドウ構成要素に関連付けて逐次的に検出し,前記ウィンドウ構成要素を検出する度に,直前に検出したウィンドウ構成要素と関連付けた演算対象要素に対応する演算対象要素値の集合を前記バッファに格納するデータストリーム解析部と,
前記バッファに格納された前記ウィンドウ構成要素に関連付けられた演算処理値の集合に対してウィンドウ処理を行うウィンドウ処理部とを備える
ことを特徴とするウィンドウ処理装置。
A window processing device for performing window processing on a data series,
A buffer for storing data,
A data acquisition unit for acquiring a data series including elements having inclusion relations;
From the data series, the position of the window component defining the window processing unit and the position of the operation target element included in the window component are sequentially detected in association with the window component, and the window component is detected. A data stream analysis unit that stores a set of calculation target element values corresponding to the calculation target element associated with the window component detected immediately before, in the buffer;
A window processing device, comprising: a window processing unit that performs window processing on a set of operation processing values associated with the window component stored in the buffer.
前記データストリーム解析部は,前記検出した演算対象要素に対応する演算対象要素値の集合を保持し,前記ウィンドウ構成要素の開始位置を検出する度に,前記保持している演算対象要素値の集合と該検出したウィンドウ構成要素の開始位置記号とを前記バッファに格納し,
前記ウィンドウ処理部は,前記バッファに格納されたウィンドウ構成要素の開始位置記号にもとづいて前記ウィンドウ処理を行う
ことを特徴とする請求項1に記載のウィンドウ処理装置。
The data stream analysis unit holds a set of calculation target element values corresponding to the detected calculation target element, and each time the start position of the window constituent element is detected, the held set of calculation target element values And the start position symbol of the detected window component in the buffer,
The window processing device according to claim 1, wherein the window processing unit performs the window processing based on a start position symbol of a window component stored in the buffer.
コンピュータが実行する,データ系列に対するウィンドウ処理方法であって,
包含関係を持つ要素を含むデータ系列を取得する処理ステップと,
前記データ系列から,ウィンドウ処理単位を定めるウィンドウ構成要素の位置および前記ウィンドウ構成要素に包含される演算対象要素の位置を前記ウィンドウ構成要素に関連付けて逐次的に検出する処理ステップと,
前記ウィンドウ構成要素を検出する度に,直前に検出したウィンドウ構成要素と関連付けた演算対象要素に対応する演算対象要素値の集合を前記バッファに格納する処理ステップと,
前記バッファに格納された前記ウィンドウ構成要素に関連付けられた演算処理値の集合に対してウィンドウ処理を行う処理ステップとを備える
ことを特徴とするウィンドウ処理方法。
A window processing method for a data series executed by a computer,
A processing step for obtaining a data series including elements having inclusion relations;
A step of sequentially detecting, from the data series, a position of a window component that defines a window processing unit and a position of an operation target element included in the window component in association with the window component;
A step of storing, in the buffer, a set of operation target element values corresponding to the operation target elements associated with the window configuration element detected immediately before each detection of the window component;
A window processing method comprising: performing a window process on a set of operation processing values associated with the window component stored in the buffer.
コンピュータに,データ系列に対するウィンドウ処理を実行させるためのウィンドウ処理プログラムであって,
前記コンピュータに
包含関係を持つ要素を含むデータ系列を取得する処理と,
前記データ系列から,ウィンドウ処理単位を定めるウィンドウ構成要素の位置および前記ウィンドウ構成要素に包含される演算対象要素の位置を前記ウィンドウ構成要素に関連付けて逐次的に検出する処理と,
前記ウィンドウ構成要素を検出する度に,直前に検出したウィンドウ構成要素と関連付けた演算対象要素に対応する演算対象要素値の集合を前記バッファに格納する処理と,
前記バッファに格納された前記ウィンドウ構成要素に関連付けられた演算処理値の集合に対してウィンドウ処理を行う処理とを,実行させる
ことを特徴とするウィンドウ処理プログラム。
A window processing program for causing a computer to perform window processing on a data series,
A process of obtaining a data series including elements having an inclusion relation in the computer;
A process of sequentially detecting, from the data series, a position of a window component that defines a window processing unit and a position of an operation target element included in the window component in association with the window component;
A process of storing, in the buffer, a set of operation target element values corresponding to the operation target element associated with the window component detected immediately before each detection of the window component;
A window processing program for executing a window processing on a set of operation processing values associated with the window component stored in the buffer.
JP2011038656A 2011-02-24 2011-02-24 Window processing apparatus, method and program Active JP5637896B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011038656A JP5637896B2 (en) 2011-02-24 2011-02-24 Window processing apparatus, method and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011038656A JP5637896B2 (en) 2011-02-24 2011-02-24 Window processing apparatus, method and program

Publications (2)

Publication Number Publication Date
JP2012174212A true JP2012174212A (en) 2012-09-10
JP5637896B2 JP5637896B2 (en) 2014-12-10

Family

ID=46977024

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011038656A Active JP5637896B2 (en) 2011-02-24 2011-02-24 Window processing apparatus, method and program

Country Status (1)

Country Link
JP (1) JP5637896B2 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003036255A (en) * 2001-04-26 2003-02-07 Internatl Business Mach Corp <Ibm> Efficient processing of xml(extensible markup language) document in content based routing network
JP2007034763A (en) * 2005-07-28 2007-02-08 Nippon Telegr & Teleph Corp <Ntt> XPath EXPRESSION PROCESSOR, XPath EXPRESSION PROCESSING METHOD AND XPath EXPRESSION PROCESSING PROGRAM
JP2007249724A (en) * 2006-03-17 2007-09-27 Nippon Telegr & Teleph Corp <Ntt> Xpath expression processor, xpath expression processing method and xpath expression processing program
JP2008294774A (en) * 2007-05-24 2008-12-04 Nippon Telegr & Teleph Corp <Ntt> Stream data processing method, stream data processing program and stream data processing system
JP2009032025A (en) * 2007-07-26 2009-02-12 Fujitsu Ltd Collation processing program and collation processing apparatus
JP2010140258A (en) * 2008-12-11 2010-06-24 Fujitsu Ltd Retrieving method and retrieving device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003036255A (en) * 2001-04-26 2003-02-07 Internatl Business Mach Corp <Ibm> Efficient processing of xml(extensible markup language) document in content based routing network
JP2007034763A (en) * 2005-07-28 2007-02-08 Nippon Telegr & Teleph Corp <Ntt> XPath EXPRESSION PROCESSOR, XPath EXPRESSION PROCESSING METHOD AND XPath EXPRESSION PROCESSING PROGRAM
JP2007249724A (en) * 2006-03-17 2007-09-27 Nippon Telegr & Teleph Corp <Ntt> Xpath expression processor, xpath expression processing method and xpath expression processing program
JP2008294774A (en) * 2007-05-24 2008-12-04 Nippon Telegr & Teleph Corp <Ntt> Stream data processing method, stream data processing program and stream data processing system
JP2009032025A (en) * 2007-07-26 2009-02-12 Fujitsu Ltd Collation processing program and collation processing apparatus
JP2010140258A (en) * 2008-12-11 2010-06-24 Fujitsu Ltd Retrieving method and retrieving device

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
CSNG200600448003; 浜野泰男ほか3名: 'XMLストリームに対する時制問合せの一手法' 情報処理学会研究報告 第2006巻 第33号, 20060322, pp.15〜22, 社団法人情報処理学会 *
CSNG200801122004; 蜂巣吉成ほか3名: 'ストリーム指向によるXQuery問い合わせ処理の効率化' ソフトウェアエンジニアリング最前線2007 初版, 20070930, pp.69〜78, 株式会社近代科学社 *
JPN6014030488; 浜野泰男ほか3名: 'XMLストリームに対する時制問合せの一手法' 情報処理学会研究報告 第2006巻 第33号, 20060322, pp.15〜22, 社団法人情報処理学会 *
JPN6014030489; 蜂巣吉成ほか3名: 'ストリーム指向によるXQuery問い合わせ処理の効率化' ソフトウェアエンジニアリング最前線2007 初版, 20070930, pp.69〜78, 株式会社近代科学社 *

Also Published As

Publication number Publication date
JP5637896B2 (en) 2014-12-10

Similar Documents

Publication Publication Date Title
JP6952067B2 (en) No event with variable duration Pattern matching
EP2929467B1 (en) Integrating event processing with map-reduce
US10614527B2 (en) System and method for automatic generation of reports based on electronic documents
JP4925143B2 (en) Stream data processing system, stream data processing method, and stream data processing program
US8983895B2 (en) Representation of multiplicities for Docflow reporting
KR101889120B1 (en) Generating data pattern information
CN105379183B (en) Variable duration window on continuous data stream
US8234248B2 (en) Tracking changes to a business object
US9135351B2 (en) Data processing method and distributed processing system
US20080270403A1 (en) Segmentation and processing of continuous data streams using transactional semantics
US7962804B2 (en) Method and system for analyzing time series data
WO2014159296A1 (en) A method, system and program product for matching of transaction records
CN110232586B (en) Advertisement push system based on big data
WO2011148565A1 (en) Database, management server, and management program
US8051110B2 (en) Identifying screen flows to support multiple entities and their diverse rules with a single application instance
US20220036477A1 (en) System and method for determining revenue generated by any zone in a webpage
JP2012078963A (en) Applicable campaign retrieval device, applicable campaign retrieval method, program and information recording medium
JP5637896B2 (en) Window processing apparatus, method and program
US20170169518A1 (en) System and method for automatically tagging electronic documents
JP2006155630A5 (en)
JP6041431B2 (en) Stream data processing method, stream data processing apparatus, and program
JP2016062289A (en) Data cleansing system and data cleansing program
Alauddin et al. Airline digital click stream event processing for enriching the airline business
JP2005092721A (en) Device, system, and method for analyzing market information, and program
Wolffensperger Static and Dynamic Visualization of Quality and Performance Dimensions on Process Trees

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20131106

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20140528

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20140722

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140918

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141021

R150 Certificate of patent or registration of utility model

Ref document number: 5637896

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150