JP5776403B2 - Region search method, region search program, and information processing apparatus - Google Patents
Region search method, region search program, and information processing apparatus Download PDFInfo
- Publication number
- JP5776403B2 JP5776403B2 JP2011160299A JP2011160299A JP5776403B2 JP 5776403 B2 JP5776403 B2 JP 5776403B2 JP 2011160299 A JP2011160299 A JP 2011160299A JP 2011160299 A JP2011160299 A JP 2011160299A JP 5776403 B2 JP5776403 B2 JP 5776403B2
- Authority
- JP
- Japan
- Prior art keywords
- area
- search
- overlapping
- node
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、領域検索方法などに関する。 The present invention relates to a region search method and the like.
従来、空間内に存在する大量のデータから条件に合ったデータを高速に検索するために、インデックスを用いたデータ管理が利用される。インデックスを用いたデータ管理方式には、一次元のデータを検索する場合に用いられるB−Tree(Bツリー)を利用した方式や多次元データを検索する場合に用いられるR−Tree(Rツリー)を利用した方式がある。 Conventionally, data management using an index is used in order to retrieve data meeting a condition from a large amount of data existing in a space at high speed. Data management methods using indexes include a method using B-Tree (B-tree) used when searching one-dimensional data and an R-Tree (R-tree) used when searching multidimensional data. There is a method using.
例えば、Rツリーを利用したデータ管理について、図25を参照して説明する。図25は、Rツリーで管理するデータと矩形領域の例を示す図である。図25に示すように、R0は、子ノードR1〜R4の矩形領域を全て含む矩形領域であり、R1は、R5〜R8の矩形領域を全て含む矩形領域である。また、最下段のR5〜R11は葉ノードであり、内部にデータを含む矩形領域である。すなわち、R0はR1のインデックス情報となり、R1は、R5のインデックス情報となっている。 For example, data management using an R-tree will be described with reference to FIG. FIG. 25 is a diagram illustrating an example of data managed by the R-tree and a rectangular area. As shown in FIG. 25, R0 is a rectangular area including all the rectangular areas of the child nodes R1 to R4, and R1 is a rectangular area including all of the rectangular areas R5 to R8. Further, R5 to R11 in the lowermost stage are leaf nodes, which are rectangular areas including data therein. That is, R0 is index information of R1, and R1 is index information of R5.
条件に合ったデータを検索するために、かかるインデックス情報を用いて該当範囲を検索(「範囲検索」という。)していく場合、ルートノードであるR0の4つの子ノードR1〜R4から検索範囲が重なるノードを選択する。重なる部分を持つノードは再帰的に検索範囲が重なるノードを選択し、最終的に葉ノードの中から検索範囲内にあるデータを選択する。 In order to search for data that meets the conditions, when searching for the corresponding range using this index information (referred to as “range search”), the search range from the four child nodes R1 to R4 of R0 that is the root node. Select the nodes that overlap. A node having overlapping portions recursively selects a node having overlapping search ranges, and finally selects data within the search range from leaf nodes.
かかる範囲検索の手法として、広い領域に複数のより狭い領域が含まれるというように階層化された領域に関する座標情報とGPS装置により測定された現在の位置とから、現在の位置が階層化された領域の何れに属するかを検索判定する技術が特許文献1に開示されている。 As a method of such range search, the current position is hierarchized from the coordinate information on the hierarchized area such that a plurality of narrow areas are included in a wide area and the current position measured by the GPS device. Patent Document 1 discloses a technique for performing a search determination as to which region belongs.
しかしながら、インデックスを用いた従来の範囲検索では、検索時間を要してしまうという問題があった。すなわち、Rツリーを利用したデータ管理方式では、検索操作を実行する都度、ルートノードから検索を開始するので、常時logNオーダの検索回数が必要となり、検索時間を要してしまう。 However, the conventional range search using an index has a problem of requiring a search time. That is, in the data management method using the R-tree, every time a search operation is executed, the search is started from the root node, so that the number of times of logN order search is always required, and search time is required.
階層化された領域に関する座標情報を用いて範囲検索する場合であっても、現在の位置が測定される都度、測定される現在の位置に関する検索判定を、広い領域から順番に開始するので、検索時間を要してしまうことには変わりがない。 Even when a range search is performed using coordinate information related to the hierarchized area, search determination related to the current position to be measured is started in order from a wide area every time the current position is measured. There is no change in taking time.
開示の技術は、インデックスを用いた範囲検索の検索時間を高速化することができることを目的とする。 It is an object of the disclosed technique to speed up the search time for a range search using an index.
1つの側面では、領域検索方法は、領域を探索する際に用いられるインデックス情報であって複数の領域を含む領域情報とともに前記領域を管理するインデックス情報をツリー構造で表したインデックスツリーを用いて、所定の位置を含む領域を検索し、該位置を含む領域を検索できた場合、複数の領域のそれぞれについて領域と重複する重複領域の情報を記憶した記憶部に基づいて、検索できた領域の重複領域の中から該位置を含む領域を検索し、検索できた領域の情報を出力することを含む。 In one aspect, the region search method uses index tree that is index information used when searching for a region, and includes index information for managing the region together with region information including a plurality of regions, in a tree structure. When an area including a predetermined position is searched and an area including the position can be searched, the overlapping of the areas that can be searched based on the storage unit that stores information on the overlapping areas that overlap the areas for each of the plurality of areas This includes retrieving an area including the position from the area and outputting information on the retrieved area.
本願の開示する領域検索方法の一つの態様によれば、インデックスを用いた範囲検索の検索時間を高速化することができる。 According to one aspect of the region search method disclosed in the present application, it is possible to speed up the search time for a range search using an index.
以下に、本願の開示する領域検索方法、領域検索プログラムおよび情報処理装置の実施例を図面に基づいて詳細に説明する。なお、実施例によりこの発明が限定されるものではない。 Hereinafter, embodiments of a region search method, a region search program, and an information processing device disclosed in the present application will be described in detail with reference to the drawings. The present invention is not limited to the embodiments.
[領域検索サーバ]
図1は、実施例1に係る領域検索サーバの構成を示す機能ブロック図である。図1に示すように、領域検索サーバ1は、通信インタフェースと11と、記憶部12と、制御部13とを有する。
[Area Search Server]
FIG. 1 is a functional block diagram illustrating the configuration of the area search server according to the first embodiment. As illustrated in FIG. 1, the area search server 1 includes a communication interface 11, a
通信インタフェース11は、各端末装置との間で通信を確立して、各端末装置から領域検索要求を受信したり、各端末装置に領域検索応答を送信したりするインタフェースである。ここで、領域検索要求とは、端末装置の位置情報がいずれの領域に含まれるかを検索する要求である。位置情報は、例えば端末装置が存在する緯度、経度の情報であるが、空間内の範囲を示す情報であっても良い。そして、領域検索要求は、例えば端末装置の位置情報や端末装置が持つセンサーの識別IDを含む内容となる。領域検索応答とは、領域検索要求に対応する応答であり、検索結果を含む内容となる。なお、通信インタフェース11は、例えば、LANやインターネット等と接続するネットワークインタフェースカードや、無線アンテナを有する無線通信部等である。 The communication interface 11 is an interface that establishes communication with each terminal device, receives a region search request from each terminal device, and transmits a region search response to each terminal device. Here, the area search request is a request for searching in which area the position information of the terminal device is included. The position information is, for example, latitude and longitude information where the terminal device exists, but may be information indicating a range in space. The area search request includes, for example, the location information of the terminal device and the sensor identification ID of the terminal device. The area search response is a response corresponding to the area search request and includes the search result. The communication interface 11 is, for example, a network interface card connected to a LAN or the Internet, a wireless communication unit having a wireless antenna, or the like.
記憶部12は、制御部13が実行するプログラム等を記憶するとともに、領域インデックスDB121と領域データDB122とを有する。なお、記憶部12は、例えば、RAM(Random Access Memory)、フラッシュメモリ(flash memory)等の半導体メモリ素子、または、ハードディスク、光ディスク等の記憶装置である。
The
領域インデックスDB121は、空間内に存在する大量の領域から条件に合った領域を高速に検索するための索引情報である。例えば、領域インデックスDB121は、どの領域がどこにあるのかを示したインデックスをRツリーで保持する。
The
ここで、領域インデックスDB121に記憶される情報の例を、図2を参照して説明する。図2は、領域インデックスDBに記憶される情報の例を示す図である。図2に示すように、領域インデックスDB121は、ルートノード、中間ノードおよび葉ノードのいずれかを示す領域データで形成されるRツリーを記憶する。ルートノードは、Rツリーに1つ存在する頂点の領域データである。また、葉ノードは、Rツリーの最底辺のノードであり、自らは子ノードを含まず、検索対象となる多次元の領域データを1つ以上持つ。それ以外の木の中間に存在するノードは、中間ノードであり、それぞれ子ノードを1つ以上持つ。
Here, an example of information stored in the
図2の例では、ルートノードがR1であり、R1の子ノード且つ中間ノードがR10、R11である。R1がR10、R11の矩形領域を全て含む矩形領域となっている。中間ノードR10の子ノードである葉ノードがR100、R101である。R10がR100、R101の矩形領域を全て含む矩形領域となっている。中間ノードR11の子ノードである葉ノードがR110、R111である。R11がR110、R111の矩形領域を全て含む矩形領域となっている。そして、葉ノードであるR100は、検索対象となる領域データ1、2、3を持っている。葉ノードであるR101は、検索対象となる領域データ4、5を持っている。葉ノードであるR110は、検索対象となる領域データ6、7を持っている。葉ノードであるR111は、検索対象となる領域データ8、9を持っている。なお、領域データ1〜9とは、例えば領域データを識別可能な領域ID(IDentification)としても良い。
In the example of FIG. 2, the root node is R1, and the child nodes and intermediate nodes of R1 are R10 and R11. R1 is a rectangular area including all of the rectangular areas R10 and R11. Leaf nodes that are child nodes of the intermediate node R10 are R100 and R101. R10 is a rectangular area including all the rectangular areas of R100 and R101. Leaf nodes that are child nodes of the intermediate node R11 are R110 and R111. R11 is a rectangular area including all the rectangular areas of R110 and R111. The leaf node R100 has
領域インデックスDB121は、Rツリーの実体としてルート、中間、葉の各ノードの情報を記憶する。図3は、領域インデックスDBに記憶されるルートノードの情報の例を示す図である。図3に示すように、領域インデックスDB121は、ルートノードR1の情報として、「ノード種別、矩形領域、子ノードリスト」を記憶する。「ノード種別」は、ノードがルート、中間、葉のいずれかであるかを示す情報である。「矩形領域」は、子ノードの担当領域を全て含む最小外接矩形の情報である。最小外接矩形とは、子ノードの領域を全て含む最小の矩形領域をいう。「子ノードリスト」は、当該ノードの子ノードへのリンクポインタのリストである。
The
図3の例では、ルートノードR1は、x、yの2次元データを管理し、「x1=35.5、y1=139.0」が担当領域の最小点であり、「x2=35.9、y2=139.5」が担当領域の最大点であることを示す。すなわち、R1が担当する領域は、両点を頂点として各次元軸に直交した4直線で作られる領域である。また、R1は、子ノード「R10、R11」へのポインタのリストを記憶する。 In the example of FIG. 3, the root node R1 manages two-dimensional data of x and y, “x1 = 35.5, y1 = 139.0” is the minimum point of the assigned area, and “x2 = 35.9 , Y2 = 139.5 ”indicates the maximum point of the assigned area. That is, the region in charge of R1 is a region formed by four straight lines that are perpendicular to each dimension axis with both points as vertices. Also, R1 stores a list of pointers to child nodes “R10, R11”.
図4は、領域インデックスDBに記憶される中間ノードの情報の例を示す図である。図4に示すように、領域インデックスDB121は、中間ノードの情報として、「ノード種別、矩形領域、子ノードリスト」を記憶する。ここで記憶される「ノード種別」、「矩形領域」、「子ノードリスト」は、図3と同様であるので詳細な説明は省略する。領域インデックスDB121は、R10、R11について、図4の情報を記憶する。
FIG. 4 is a diagram illustrating an example of intermediate node information stored in the region index DB. As illustrated in FIG. 4, the
図4の場合、中間ノードR10は、x、yの2次元データを管理し、「x1=35.5、y1=139.2」が担当領域の最小点であり、「x2=35.7、y2=139.3」が担当領域の最大点であることを示す。すなわち、中間ノードR10が担当する領域は、両点を頂点として各次元軸に直交した4直線で作られる領域である。また、R10は、子ノード「R100、R101」へのポインタのリストを記憶する。 In the case of FIG. 4, the intermediate node R10 manages two-dimensional data of x and y, “x1 = 35.5, y1 = 139.2” is the minimum point of the assigned area, and “x2 = 35.7, “y2 = 139.3” indicates the maximum point of the assigned area. In other words, the region handled by the intermediate node R10 is a region formed by four straight lines that are perpendicular to each dimension axis with both points serving as vertices. In addition, R10 stores a list of pointers to child nodes “R100, R101”.
図5は、領域インデックスDBに記憶される葉ノードの情報の例を示す図である。図5に示すように、領域インデックスDB121は、葉ノードの情報として、「ノード種別、矩形領域、データリスト」を記憶する。ここで記憶される「ノード種別」、「矩形領域」は、図3と同様であるので詳細な説明は省略する。「データリスト」は、管理する多次元の領域データである。領域インデックスDB121は、R100、R101、R110、R111について、図5の情報を記憶する。
FIG. 5 is a diagram illustrating an example of leaf node information stored in the region index DB. As illustrated in FIG. 5, the
図5の場合、葉ノードR100は、x、yの2次元データを管理し、「x1=35.5、y1=139.2」が担当領域の最小点であり、「x2=35.6、y2=139.3」が担当領域の最大点であることを示す。すなわち、葉ノードR100が担当する領域は、両点を頂点として各次元軸に直交した4直線で作られる領域である。また、R100は、領域データ「D1、D2、D3、D4」へのポインタのリストを記憶する。領域データへのポインタの一例として、領域データを識別する領域IDが用いられる。各領域データの実体は、領域データDB122に格納されている。
In the case of FIG. 5, the leaf node R100 manages two-dimensional data of x and y, “x1 = 35.5, y1 = 139.2” is the minimum point of the assigned area, and “x2 = 35.6, “y2 = 139.3” indicates the maximum point of the assigned area. That is, the area in which the leaf node R100 is in charge is an area formed by four straight lines orthogonal to each dimension axis with both points serving as vertices. The R100 stores a list of pointers to the area data “D1, D2, D3, D4”. As an example of a pointer to the area data, an area ID for identifying the area data is used. The substance of each area data is stored in the
図1に戻って、領域データDB122は、複数の領域データを管理するとともに、複数の領域データのそれぞれについて、領域データの領域と重複する他の領域の領域データを管理する。
Returning to FIG. 1, the
ここで、領域データDB122のデータ構造の一例を、図6を参照して説明する。図6は、領域データDBのデータ構造の一例を示す図である。図6に示すように、領域データDB122は、領域ID122a毎に、データ名122b、領域情報122cおよび重複領域122dを対応付けて記憶する。領域ID122aは、領域データを一意に識別可能なIDを示す。データ名122bは、領域IDで示される領域データのデータ名を示す。領域情報122cは、領域IDで示される領域データの実体である具体的な範囲を示す。重複領域122dは、領域IDで示される領域データと重複する他の領域データの領域IDを示す。例えば、領域ID122aが「00001」である場合、データ名122bとして「A商店X店舗近辺」、領域情報122cとして「円領域:緯度35.491、経度139.650、半径100m」と記憶している。そして、領域ID122aが「00001」である場合の重複領域122dとして「00034」の領域IDを記憶している。
Here, an example of the data structure of the
図1に戻って、制御部13は、リクエスト受付部131、レスポンス転送部132、ツリー検索部133、重複データ検索部134および重複領域設定部135を有する。制御部13は、例えば、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)等の集積回路またはCPU(Central Processing Unit)やMPU(Micro Processing Unit)等の電子回路である。
Returning to FIG. 1, the
リクエスト受付部131は、通信インタフェース11によって受信された検索リクエストを受け付ける。レスポンス転送部132は、検索リクエストに対応する領域検索応答を通信インタフェース11に転送する。
The
ツリー検索部133は、領域インデックスDB121を用いて、所定の位置情報を含む領域を検索する。例えば、ツリー検索部133は、リクエスト受付部131によって受け付けられた領域検索要求の中から位置情報を取り出す。そして、ツリー検索部133は、ルートノードから子ノードへトップダウンに辿り順番にノードを選択し、選択したノードの子ノードに、取り出した位置情報を含むものがあるか否かを、領域インデックスDB121を用いて判定する。一例として、ツリー検索部133は、領域インデックスDB121を用いて、選択したノードの子ノードリストを読み出し、さらに、読み出した子ノードリストに含まれるそれぞれの子ノードの矩形領域を読み出す。そして、ツリー検索部133は、読み出したそれぞれの子ノードの矩形領域に、取り出した位置情報を含むものがあるか否かを判定する。
The
また、ツリー検索部133は、取り出した位置情報を含む子ノードを選択候補ノードとして追加する。そして、ツリー検索部133は、選択候補ノードとして追加されたノードを1つずつ選択し、選択したノードが葉ノードであれば、葉ノードにある領域データの内、取り出した位置情報を含むものがあるか否かを、領域インデックスDB121を用いて判定する。一例として、ツリー検索部133は、領域インデックスDB121を用いて、葉ノードであるノードのデータリストを読み出し、読み出したデータリストに含まれる領域データへのポインタを取り出す。ここでは、領域データを領域IDとすると、ツリー検索部133は、領域データDB122に記憶された領域情報122cを用いて、領域IDに対応する領域情報122cに、取り出した位置情報を含むものがあるか否かを判定する。そして、ツリー検索部133は、領域IDに対応する領域情報122cに、取り出した位置情報を含むものが1つでもあれば、いずれか1つの領域情報122cの領域IDを検索結果に追加し、領域インデックスDB121を用いた検索を終了する。なお、ツリー検索部133は、位置情報を含む領域情報が複数ある場合には、重複領域の数が最も小さい領域情報を選択することが望ましい。これは、後述する重複データ検索部134が、さらに位置情報を含む領域を、選択した領域情報の重複領域から検索することとなるので、検索対象となる重複領域の数を減らすためである。
In addition, the
重複データ検索部134は、ツリー検索部133によって位置情報を含む領域情報を検索できた場合、領域データDB122に記憶された重複領域に基づいて、検索できた領域情報に対応する重複領域の中から位置情報を含む領域情報を検索する。例えば、重複データ検索部134は、ツリー検索部133によって追加された検索結果から領域IDを取り出す。そして、重複データ検索部134は、領域データDB122に記憶された重複領域122dに基づいて、取り出した領域IDの領域情報と重複する重複領域の領域IDを読み出す。そして、重複データ検索部134は、該当する重複領域の領域IDを1つずつ選択し、選択した領域IDの重複領域が位置情報を含むか否かを判定する。そして、重複データ検索部134は、位置情報を含む重複領域の領域IDを検索結果に追加する。
When the
重複領域設定部135は、領域データDB122の重複領域を設定する。なお、重複領域設定部135は、領域インデックスDB121に新たな領域を追加する際に、その追加領域を領域データDB122に追加すると共に、その追加領域と重複する重複領域を設定するようにすれば良い。例えば、重複領域設定部135は、ルートノードから子ノードに向かって順番にノードを選択し、選択したノードの子ノードに、追加領域を含むものがあるか否かを、領域インデックスDB121を用いて判定する。一例として、重複領域設定部135は、領域インデックスDB121を用いて、選択したノードの子ノードリストを読み出し、さらに、読み出した子ノードリストに含まれるそれぞれの子ノードの矩形領域を読み出す。そして、重複領域設定部135は、読み出したそれぞれの子ノードの矩形領域に追加領域を含むものがあるか否かを判定する。
The overlapping
また、重複領域設定部135は、追加領域を含む子ノードを選択候補ノードとして追加する。そして、重複領域設定部135は、選択候補ノードとして追加されたノードを1つずつ選択し、選択したノードが葉ノードであれば、葉ノードにある領域データの内、追加領域と重複する部分がある領域データを重複領域として選択する。そして、重複領域設定部135は、重複領域として選択した領域データを、領域データDB122の追加領域に対応する重複領域122dに追加する。さらに、重複領域設定部135は、追加領域を、重複領域として選択した領域データに対応する重複領域122dに追加する。
In addition, the overlapping
[領域検索要求のデータの一例]
次に、リクエスト受付部131が通信インタフェース11を介して受け付ける領域検索要求の内容について、図7を参照して説明する。図7は、領域検索要求の内容の一例を示す図である。図7に示すように、領域検索要求には、センサーを識別するセンサーIDと、緯度および経度とを含む。緯度および経度は、位置情報の一例である。図7の例では、センサーIDとして「Sensor000X」、緯度として「35.4134」、経度として「139.6252」と設定している。なお、領域検索要求には、センサーIDを含むものとしたが、これに限定されず、領域検索を要求する端末装置の装置IDであっても良いし、領域検索を要求する携帯電話の携帯電話番号であっても良い。
[Example of area search request data]
Next, the contents of the area search request received by the
[領域検索応答のデータの一例]
次に、レスポンス転送部132が通信インタフェース11を介して出力する領域検索応答の内容について、図8を参照して説明する。図8は、領域検索応答の内容の一例を示す図である。図8に示すように、領域検索応答は、領域検索の結果を示す領域情報のリストであり、領域情報に対応する領域IDと領域名とを含む。図8の例では、領域IDとして「00001」、領域名として「A商店X店舗周辺」と設定している。また、領域IDとして「00034」、領域名として「レストランC周辺」と設定している。なお、領域情報のリストには、領域IDと領域名とを含むものとしたが、これに限定されず、領域の位置、大きさや形状等を含むものとしても良い。
[Example of area search response data]
Next, the contents of the area search response output by the
[リクエスト受付処理の手順]
次に、検索に係るリクエスト受付処理の手順について、図9Aを参照して説明する。図9Aは、検索に係るリクエスト受付処理の手順を示すフローチャートである。
[Request reception processing procedure]
Next, the procedure of the request reception process related to the search will be described with reference to FIG. 9A. FIG. 9A is a flowchart illustrating a procedure of request reception processing related to search.
まず、リクエスト受付部131は、領域検索要求を受け付けたか否かを判定する(S10A)。そして、領域検索要求を受け付けていないと判定した場合(ステップS10A;No)、リクエスト受付部131は、領域検索要求を受け付けるまで、判定処理を繰り返す。一方、領域検索要求を受け付けたと判定した場合(ステップS10A;Yes)、リクエスト受付部131は、検索処理を実行する(ステップS10B)。
First, the
そして、リクエスト受付部131は、リクエスト受付処理を終了したか否かを判定する(ステップS10C)。リクエスト受付処理を終了していないと判定した場合(ステップS10C;No)、リクエスト受付部131は、ステップS10Aに移行する。一方、リクエスト受付処理を終了したと判定した場合(ステップS10C;Yes)、リクエスト受付部131は、処処理を終了する。
Then, the
[検索処理の手順]
次に、図9AのステップS10Bに示した検索処理について、図9Bを参照して説明する。図9Bは、実施例1に係る検索処理の手順を示すフローチャートである。なお、図9Bの例では、領域検索要求に含まれる位置情報を検索座標として説明する。
[Search process steps]
Next, the search process shown in step S10B of FIG. 9A will be described with reference to FIG. 9B. FIG. 9B is a flowchart illustrating the search processing procedure according to the first embodiment. In the example of FIG. 9B, the position information included in the area search request will be described as search coordinates.
リクエスト受付部131によって領域検索要求が受け付けられると、ツリー検索部133は、領域インデックスDB121に基づいて、ルートノードを選択する(ステップS11)。そして、ツリー検索部133は、選択した選択ノードが葉ノードであるか否かを判定する(ステップS12)。
When the area search request is received by the
選択ノードが葉ノードでないと判定した場合(ステップS12;No)、ツリー検索部133は、選択ノードの子ノードに検索座標を含むものがあるか否かを、領域インデックスDB121を用いて判定する(ステップS13)。一例として、ツリー検索部133は、領域インデックスDB121に基づいて、選択ノードの子ノードリストを読み出し、読み出した子ノードリストに含まれるそれぞれの子ノードの矩形領域を読み出す。そして、ツリー検索部133は、読み出したそれぞれの子ノードの矩形領域に、検索座標を含むものがあるか否かを判定する。
If it is determined that the selected node is not a leaf node (step S12; No), the
選択ノードの子ノードに検索座標を含むものがあると判定した場合(ステップS13;Yes)、ツリー検索部133は、検索座標を含む子ノードを選択候補ノードに追加し(ステップS14)、ステップS15に移行する。一方、選択ノードの子ノードに検索座標を含むものがないと判定した場合(ステップS13;No)、ツリー検索部133は、ステップS15に移行する。
When it is determined that there is a child node of the selected node that includes the search coordinate (step S13; Yes), the
続いて、ツリー検索部133は、全ての選択候補ノードの検索を終えたか否かを判定する(ステップS15)。全ての選択候補ノードの検索を終えていないと判定した場合(ステップS15;No)、ツリー検索部133は、選択候補ノード内の1つの未検索ノードを選択し(ステップS16)、ステップS12に移行する。
Subsequently, the
ステップS12では、選択ノードが葉ノードであると判定した場合(ステップS12;Yes)、ツリー検索部133は、選択した葉ノードが持つ領域データの内、検索座標を含むものがあるか否かを判定する(ステップS17)。一例として、ツリー検索部133は、領域インデックスDB121に基づいて、葉ノードであるノードのデータリストを読み出し、読み出したデータリストに含まれる領域データへのポインタ、例えば領域IDを取り出す。そして、ツリー検索部133は、領域データDB122に基づいて、取り出した領域IDに対応する領域情報122cに検索座標を含むものがあるか否かを判定する。
In step S12, when it is determined that the selected node is a leaf node (step S12; Yes), the
選択した葉ノードが持つ領域データの内、検索座標を含むものがないと判定した場合(ステップS17;No)、ツリー検索部133は、次の選択候補ノードを検索すべく、ステップS15に移行する。
If it is determined that none of the area data held by the selected leaf node includes the search coordinates (step S17; No), the
一方、選択した葉ノードが持つ領域データの内、検索座標を含むものがあると判定した場合(ステップS17;Yes)、ツリー検索部133は、該当領域データの内、重複領域の数が最小の領域データを検索結果に追加する(ステップS18)。一例として、ツリー検索部133は、領域データDB122に記憶された重複領域122dに基づいて、重複領域の数が最小の領域データ(領域ID)を検索結果に追加する。ここで、領域インデックスDB121を用いた検索を終了する。
On the other hand, when it is determined that there is a search coordinate included in the area data of the selected leaf node (step S17; Yes), the
続いて、重複データ検索部134は、領域データDB122の重複領域122dに基づいて、検索結果に追加した領域データの重複領域から未判定のものを読み出し、読み出した重複領域を1つ選択する(ステップS19)。そして、重複データ検索部134は、選択した重複領域が検索座標を含むか否かを判定する(ステップS20)。選択した重複領域が検索座標を含むと判定した場合(ステップS20;Yes)、重複データ検索部134は、含むと判定した重複領域の領域IDを検索結果に追加し(ステップS21)、ステップS22に移行する。
Subsequently, based on the
一方、選択した重複領域が検索座標を含まないと判定した場合(ステップS20;No)、重複データ検索部134は、全重複領域の判定を終えていない場合(ステップS22;No)、次の重複領域を判定すべく、ステップS19に移行する。一方、重複データ検索部134は、全重複領域の判定を終えた場合(ステップS22;Yes)、作成した検索結果を問合せ側へ返答すべく、レスポンス転送部132に出力する(ステップS23)。その後、レスポンス転送部132は、検索結果を領域検索応答として領域検索要求の問合せ側へ送信する。
On the other hand, if it is determined that the selected overlapping area does not include the search coordinates (step S20; No), the overlapping
ステップS15では、全ての選択候補ノードの検索を終えていると判定した場合(ステップS15;Yes)、ツリー検索部133は、選択ノードに検索座標を含むものがないので、検索結果無しとして問合せ側へ返答すべく、レスポンス転送部132に出力する(ステップS24)。その後、レスポンス転送部132は、検索結果を領域検索応答として領域検索要求の問合せ側へ送信する。
In step S15, when it is determined that the search of all selection candidate nodes has been completed (step S15; Yes), the
[領域データ追加処理の手順]
次に、実施例1に係る領域データ追加処理の手順について、図10、図11を参照して説明する。図10、図11は、実施例1に係る領域データ追加処理の手順を示すフローチャートである。
[Procedure for adding area data]
Next, the procedure of region data addition processing according to the first embodiment will be described with reference to FIGS. 10 and 11 are flowcharts illustrating the procedure of the area data adding process according to the first embodiment.
まず、重複領域設定部135は、領域インデックスDB121に基づいて、ルートノードを選択する(ステップS31)。そして、重複領域設定部135は、選択した選択ノードが葉ノードであるか否かを判定する(ステップS32)。
First, the overlapping
選択ノードが葉ノードでないと判定した場合(ステップS32;No)、重複領域設定部135は、領域インデックスDB121に基づいて、選択ノードの子ノードに追加領域を包含するものがあるか否かを判定する(ステップS33)。一例として、重複領域設定部135は、領域インデックスDB121に基づいて、選択ノードの子ノードリストを読み出し、読み出した子ノードリストに含まれるそれぞれの子ノードの矩形領域を読み出す。そして、ツリー検索部133は、読み出したそれぞれの子ノードの矩形領域に、追加領域を包含する矩形領域があるか否かを判定する。
When it is determined that the selected node is not a leaf node (step S32; No), the overlapping
追加領域を包含するものがあると判定した場合(ステップS33;Yes)、重複領域設定部135は、追加領域を包含する子ノードの内、矩形領域の面積が最小のものを選択ノードとする(ステップS34)。そして、重複領域設定部135は、ステップS32に移行する。
If it is determined that there is an additional region included (step S33; Yes), the overlapping
一方、追加領域を包含するものがないと判定した場合(ステップS33;No)、重複領域設定部135は、追加領域を含めると拡大量が最小になる子ノードを選択ノードとする(ステップS35)。そして、重複領域設定部135は、ステップS32に移行する。
On the other hand, when it is determined that there is no object including the additional area (step S33; No), the overlapping
ステップS32では、選択ノードが葉ノードであると判定した場合(ステップS32;Yes)、重複領域設定部135は、ステップS41に移行する。
If it is determined in step S32 that the selected node is a leaf node (step S32; Yes), the overlapping
続いて、重複領域設定部135は、選択した葉ノードに追加領域の領域データを追加する(ステップS41)。一例として、重複領域設定部135は、領域インデックスDB121の該当する葉ノードのデータリストに、追加領域の領域データへのポインタ、例えば領域IDを追加する。そして、重複領域設定部135は、重複領域設定処理を実行する(ステップS42)。
Subsequently, the overlapping
ここで、選択した葉ノードの持つ領域データ数が上限を超える場合がある。この場合には、重複領域設定部135は、以下の処理を行う。重複領域設定部135は、選択した葉ノードの持つ領域データ数が上限を超えるか否かを判定する(ステップS43)。領域データ数が上限を超える場合(ステップS43;Yes)、重複領域設定部135は、葉ノードの矩形領域を分割する場合に、分割結果の矩形領域の大きさの和が最小となるように葉ノードを2分割し、親ノードに追加する(ステップS44)。一方、領域データ数が上限を超えない場合(ステップS43;No)、重複領域設定部135は、領域データ追加処理を終了する。
Here, the number of area data of the selected leaf node may exceed the upper limit. In this case, the overlapping
さらに、追加する親ノードの持つ子ノード数が上限を超える場合がある。この場合には、重複領域設定部135は、以下の処理を行う。重複領域設定部135は、追加する親ノードの持つ子ノード数が上限を超えるか否かを判定する(ステップS45)。追加する親ノードの持つ子ノード数が上限を超える場合(ステップS45;Yes)、重複領域設定部135は、追加する親ノードがルートノードであるか否かを判定する(ステップS46)。一方、追加する親ノードの持つ子ノード数が上限を超えない場合(ステップS45;No)、重複領域設定部135は、領域データ追加処理を終了する。
Furthermore, the number of child nodes of the parent node to be added may exceed the upper limit. In this case, the overlapping
追加する親ノードがルートノードでないと判定した場合(ステップS46;No)、重複領域設定部135は、分割結果の矩形領域の大きさの和が最小となるようにノードを分割する。そして、重複領域設定部135は、分割後の増加したノードを分割元のノードの親ノードに追加する(ステップS47)。そして、重複領域設定部135は、ステップS45に移行する。
When it is determined that the parent node to be added is not the root node (step S46; No), the overlapping
一方、追加する親ノードがルートノードであると判定した場合(ステップS46;Yes)、重複領域設定部135は、現在のルートノードを分割し、現在のルートノードの上に新ルートノードを作成する(ステップS48)。そして、重複領域設定部135は、領域データ追加処理を終了する。
On the other hand, when it is determined that the parent node to be added is the root node (step S46; Yes), the overlapping
[重複領域設定処理の手順]
次に、図11のステップS42に示した重複領域設定処理について、図12を参照して説明する。図12は、重複領域設定処理の手順を示すフローチャートである。
[Overlapping area setting procedure]
Next, the overlapping area setting process shown in step S42 of FIG. 11 will be described with reference to FIG. FIG. 12 is a flowchart showing the procedure of the overlapping area setting process.
重複領域設定部135は、領域インデックスDB121に基づいて、ルートノードを選択する(ステップS51)。そして、重複領域設定部135は、選択した選択ノードが葉ノードであるか否かを判定する(ステップS52)。
The overlapping
選択ノードが葉ノードであると判定した場合(ステップS52;Yes)、重複領域設定部135は、選択ノードにある領域データの内、追加領域と重なる領域データの領域を重複領域として選択する(ステップS53)。一例として、重複領域設定部135は、領域インデックスDB121に基づいて、選択ノードのデータリストを読み出し、読み出したデータリストに含まれる領域データへのポインタ、例えば領域IDを取り出す。そして、重複領域設定部135は、領域データDB122に基づいて、取り出した領域IDの内、追加領域と重なる部分がある領域IDを重複領域として選択する。そして、重複領域設定部135は、ステップS56に移行する。
When it is determined that the selected node is a leaf node (step S52; Yes), the overlapping
一方、選択ノードが葉ノードでないと判定した場合(ステップS52;No)、重複領域設定部135は、領域インデックスDB121に基づいて、選択ノードの子ノードに追加領域と重なるものがあるか否かを判定する(ステップS54)。選択ノードの子ノードに追加領域と重なるものがあると判定した場合(ステップS54;Yes)、重複領域設定部135は、重なった子ノードを選択候補ノードに加え(ステップS55)、ステップS56に移行する。また、選択ノードの子ノードに追加領域と重なるものがないと判定した場合(ステップS54;No)、重複領域設定部135は、ステップS56に移行する。
On the other hand, when it is determined that the selected node is not a leaf node (step S52; No), the overlapping
続いて、重複領域設定部135は、全ての選択候補ノードの検索を終えたか否かを判定する(ステップS56)。全ての選択候補ノードの検索を終えていないと判定した場合(ステップS56;No)、重複領域設定部135は、選択候補ノード内の1つの未検索ノードを選択し(ステップS57)、ステップS52に移行する。
Subsequently, the overlapping
一方、全ての選択候補ノードの検索を終えたと判定した場合(ステップS56;Yes)、重複領域設定部135は、選択済みの重複領域を追加領域の重複領域に追加する(ステップS58)。一例として、重複領域設定部135は、重複領域として選択した領域データを、領域データDB122の追加領域に対応する重複領域122dに追加する。
On the other hand, when it is determined that all the selection candidate nodes have been searched (step S56; Yes), the overlapping
さらに、重複領域設定部135は、追加領域を各選択済みの重複領域に重複領域として追加する(ステップS59)。一例として、重複領域設定部135は、追加領域を、領域データDB122の重複領域として選択した各領域データに対応する重複領域122dに追加する。そして、重複領域設定部135は、重複領域設定処理を終了する。
Further, the overlapping
[重複領域設定の具体例]
ここで、重複領域設定の具体例を、図13を参照して説明する。図13は、重複領域設定の具体例を示す図である。なお、図13の例では、選択した葉ノードのデータリストには、領域データとして領域ID「00001」と「00002」とが設定されているものとする。また、追加領域を、領域IDとして「00034」、データ名として「レストランC周辺」、領域情報として「円領域:緯度35.492、緯度139.650、半径100m」とする。
[Specific example of overlapping area setting]
Here, a specific example of overlapping area setting will be described with reference to FIG. FIG. 13 is a diagram illustrating a specific example of the overlapping area setting. In the example of FIG. 13, it is assumed that region IDs “00001” and “00002” are set as region data in the data list of the selected leaf node. Further, the additional area is “00034” as the area ID, “Restaurant C neighborhood” as the data name, and “Circle area: latitude 35.492, latitude 139.650, radius 100 m” as the area information.
重複領域設定部135は、選択した葉ノードにある領域データの内、追加領域と重なる領域データの領域を重複領域として選択する。ここでは、重複領域設定部135は、葉ノードにある領域データとしての領域ID「00001」について、領域に重なる部分があるので、重複領域として選択する。また、重複領域設定部135は、葉ノードにある領域データとしての領域ID「00002」について、領域に重なる部分がないので、重複領域として選択しない。
The overlapping
そして、重複領域設定部135は、重複領域として選択した領域IDを、領域データDB122の追加領域の重複領域の欄に追加する。ここでは、重複領域設定部135は、領域ID「00001」を、領域データDB122の領域ID「00034」に対応する重複領域R1に追加する。
Then, the overlapping
さらに、重複領域設定部135は、追加領域の領域IDを、領域データDB122の各重複領域の重複領域の欄に追加する。ここでは、重複領域設定部135は、追加領域の領域ID「00034」を、領域データDB122の重複領域の領域ID「00001」に対応する重複領域R2に追加する。
Furthermore, the overlapping
このようにして、重複領域設定部135は、追加領域と、追加領域と重複する各重複領域とを、領域データDB122の重複領域の欄に相互に追加するようにした。しかしながら、追加領域が例えば都心から半径10kmの領域のような広い領域であるような場合、追加領域と重複する重複領域の数が極端に多くなることがある。かかる場合には、重複領域設定部135は、追加領域の重複領域の欄に重複領域を追加しないようにして、検索中にその領域が検索結果になった場合にはインデックスDB検索を継続しても良い。重複領域の欄に追加する重複領域の数が極端に多くなると、重複データ検索部134による検索処理に時間を要するからである。
In this way, the overlapping
そこで、重複領域設定部135の処理の変形例として、追加領域と重複する重複領域の数が所定の数以上の場合には、追加領域の重複領域の欄に重複領域を追加しない処理について説明する。なお、所定の数とは、例えば「200」であったり、インデックスツリーの子ノード数の上限値の10倍の数であったり、全領域データ数の0.1%の数であったりするが、これに限定されず、検索処理に遅延をきたさない重複領域の数であれば良い。
Therefore, as a modification of the process of the overlap
[重複領域設定処理の変形例の手順]
図14は、重複領域設定処理の変形例の手順を示すフローチャートである。なお、図12に示す重複領域設定部135の処理と同一の処理S51〜S59については同一符号を示すことで、その重複する処理の説明については省略する。図14に示す重複領域設定部135の処理が図12に示す重複領域設定部135の処理と異なるところは、S61を追加した点にある。
[Procedure of modified example of overlapping area setting process]
FIG. 14 is a flowchart illustrating the procedure of a modified example of the overlapping area setting process. Note that the same processes S51 to S59 as those of the overlapping
重複領域設定部135は、全ての選択候補ノードの検索を終えたか否かを判定し、全ての選択候補ノードの検索を終えたと判定した場合(ステップS56;Yes)、追加領域と重複する重複領域の数が所定の数以上であるか否かを判定する(ステップS61)。追加領域と重複する重複領域の数が所定の数以上でない場合(ステップS61;No)、重複領域設定部135は、選択済みの重複領域を追加領域の重複領域に追加する(ステップS58)。続いて、重複領域設定部135は、追加領域を各選択済みの重複領域に重複領域として追加する(ステップS59)。
The overlapping
一方、追加領域と重複する重複領域の数が所定の数以上である場合(ステップS61;Yes)、重複領域設定部135は、選択済みの重複領域を追加領域の重複領域に追加せず、重複領域には特殊値である「重複数過大」と記録する(ステップS62)。そして、重複領域設定部135は、追加領域を各選択済みの重複領域に重複領域として追加する(ステップS59)。
On the other hand, when the number of overlapping areas overlapping with the additional area is equal to or greater than the predetermined number (step S61; Yes), the overlapping
なお、かかる重複領域設定処理によって重複領域に「重複数過大」と記録された領域データ(領域ID)が追加される場合がある。かかる場合に、検索処理が、この領域データを検索結果に追加した場合であっても、この領域データを使わないで領域インデックスDB121を用いた検索を継続するようにする。具体的には、図9Bの検索処理のステップS18では、ツリー検索部133は、該当領域データの内、重複領域の数が最小の領域データを検索結果に追加する。一例として、ツリー検索部133は、領域データDB122に記憶された重複領域122dに基づいて、重複領域の数が最小の領域データ(領域ID)を検索結果に追加する。ここで、ツリー検索部133は、検索結果に「重複数過大」と記録された領域データしかない場合には、この領域データを使わないで領域インデックスDB121を用いた検索を継続すべく、ステップS15に移行すれば良い。
Note that there may be a case where area data (area ID) recorded as “overlapping multiple multiples” is added to the overlapping area by the overlapping area setting process. In this case, even if the search processing adds this area data to the search result, the search using the
[実施例1の効果]
上記実施例1によれば、領域検索サーバ1は、領域を探索する際に用いられるインデックス情報であって複数の領域を含む領域情報とともに前記領域を管理するインデックス情報を領域インデックスDB121として記憶部12に記憶する。そして、領域検索サーバ1は、領域インデックスDB121に記憶されたインデックス情報をツリー構造で表したインデックスツリーを用いて、所定の位置を含む領域を検索する。そして、領域検索サーバ1は、該位置を含む領域を検索できた場合、領域データDB122に記憶された重複領域に基づいて、検索できた領域の重複領域の中から該位置を含む領域を検索する。そして、領域検索サーバ1は、検索できた領域の情報を出力する。かかる構成によれば、領域検索サーバ1は、インデックスツリーを用いて、所定の位置を含む領域を検索できた場合、インデックスツリーを用いた検索を終了し、検索できた領域の重複領域を用いた検索に移行することとした。このため、領域検索サーバ1は、インデックスツリーを用いて所定の位置を含む領域を1個検索できれば、検索できた領域の重複領域の中から該位置を含む領域を検索すれば良いので、該位置を含む領域検索の検索時間を高速化できる。
[Effect of Example 1]
According to the first embodiment, the area search server 1 uses the index information used when searching for an area and includes the area information including a plurality of areas as index information for managing the area as the
ところで、実施例1に係る領域検索サーバ1では、インデックスツリーを用いて問合せ位置を含む領域を検索し、当該領域を検索できた場合、検索できた領域と重複する重複領域を検索対象として検索する場合を説明した。しかしながら、領域検索サーバ1は、これに限定されず、検索できた領域を次回の検索に活かすべく、前回検索できた領域として記録するようにしても良い。そこで、実施例2では、検索できた領域を前回検索できた領域として記録する領域検索サーバ2について説明する。
By the way, in the area search server 1 according to the first embodiment, an area including a query position is searched using an index tree, and when the area can be searched, an overlapping area overlapping with the searched area is searched as a search target. Explained the case. However, the area search server 1 is not limited to this, and the area that has been searched may be recorded as the area that has been searched the last time in order to be used for the next search. Therefore, in the second embodiment, an
[実施例2に係る領域検索サーバの構成]
図15は、実施例2に係る領域検索サーバの構成を示す機能ブロック図である。なお、図1に示す領域検索サーバ1と同一の構成については同一符号を示すことで、その重複する構成および動作の説明については省略する。実施例1と実施例2とが異なるところは、記憶部12に前回位置DB201を追加した点にある。また、実施例1と実施例2とが異なるところは、制御部13に前回領域検索部202と前回領域記録部203とを追加した点にある。
[Configuration of Area Search Server According to Second Embodiment]
FIG. 15 is a functional block diagram illustrating the configuration of the area search server according to the second embodiment. The same components as those of the area search server 1 shown in FIG. 1 are indicated by the same reference numerals, and the description of the overlapping components and operations is omitted. The difference between the first embodiment and the second embodiment is that the
前回位置DB201は、前回領域検索要求があったときに検索できた位置情報を当該要求元に対応付けて管理する。ここで、前回位置DB201のデータ構造の一例を、図16を参照して説明する。図16は、前回位置DB201のデータ構造の一例を示す図である。図16に示すように、前回位置DB201は、センサーID201a毎に、前回検索領域201bを対応付けて記憶する。センサーID201aは、領域検索要求の要求元のセンサーの識別IDを示す。前回検索領域201bは、前回領域検索要求があったときに検索できた領域情報を示す。例えば前回検索領域201bには、検索できた場合に検索できた領域の領域IDが記憶され、検索できなかった場合に「未検出」が記憶される。例えば、センサーID201aが「Sensor0001」である場合、前回検索領域201bとして「未検出」と記憶している。また、センサーID201aが「Sensor0002」である場合、前回検索領域201bとして「領域ID00034」と記憶している。
The
図15に戻って、前回領域検索部202は、前回領域検索した際に検索できた領域を用いて、所定の位置情報を含む領域を検索する。例えば、前回領域検索部202は、リクエスト受付部131によって受け付けられた領域検索要求の中からセンサーIDおよび位置情報を取り出す。そして、前回領域検索部202は、取り出したセンサーIDの前回検索領域を前回位置DB201に記憶しているか否かを判定する。そして、前回領域検索部202は、センサーIDの前回検索領域を記憶している場合、領域検索要求の中から取り出した位置情報が前回検索領域に含まれるか否かを判定する。そして、前回領域検索部202は、取り出した位置情報が前回検索領域に含まれる場合、当該前回検索領域を検索結果に追加し、前回領域検索部202の検索処理を終了する。その後、重複データ検索部134が、領域データDB122に記憶された重複領域に基づいて、検索結果に対応する重複領域の中から当該位置情報を含む重複領域を検索する。そして、重複データ検索部134は、検索できた重複領域の領域IDを検索結果に追加する。
Returning to FIG. 15, the previous
また、前回領域検索部202は、取り出した位置情報が前回検索領域に含まれない場合、当該位置情報を含む領域をツリー検索部133に検索させる。すなわち、ツリー検索部133が、領域インデックスDB121を用いて、前回検索領域を領域データに持つ葉ノードから当該位置情報を含む領域を検索する。
Further, when the extracted position information is not included in the previous search area, the previous
ツリー検索部133は、葉ノードが持つ領域データの内、当該位置情報を含む領域データがあれば、検索できた領域データを検索結果に追加する。その後、重複データ検索部134が、領域データDB122に記憶された重複領域に基づいて、検索結果に対応する重複領域の中から当該位置情報を含む重複領域を検索する。一方、ツリー検索部133は、葉ノードが持つ領域データの内、当該位置情報を含む領域データがなければ、子ノードからルートノードへノードをボトムアップにノードを順番に辿り、当該位置情報を含むノードを選択する。そして、ツリー検索部133は、選択したノードの子ノードに、当該位置情報を含むものがあるか否かを、領域インデックスDB12を用いて判定する。そして、ツリー検索部133は、当該位置情報を含む子ノードを選択候補ノードとして追加する。そして、ツリー検索部133は、選択候補ノードとして追加されたノードを1つずつ選択し、選択したノードが葉ノードであれば、葉ノードにある領域データの内、当該位置情報を含む領域データがあるか否かを、領域インデックスDB121を用いて判定する。そして、ツリー検索部133は、当該位置情報を含む領域データが1つでもあれば、いずれか1つの領域データを検索結果に追加し、領域インデックスDB121を用いた検索を終了する。その後、重複データ検索部134が、領域データDB122に記憶された重複領域に基づいて、検索結果に対応する重複領域の中から当該位置情報を含む重複領域を検索する。そして、重複データ検索部134は、検索できた重複領域の領域IDを検索結果に追加する。
If there is area data including the position information among the area data of the leaf node, the
また、前回領域検索部202は、センサーIDの前回検索領域を記憶していない場合、ツリー検索部133および重複データ検索部134による検索処理に移行する。なお、ツリー検索部133および重複データ検索部134によって行われる検索処理については、実施例1で説明したとおりであるので、その説明を省略する。
Further, the previous
前回領域記録部203は、領域検索要求があった要求元のセンサーIDに対応付けて検索結果を前回位置DB201に記録する。ここで、検索結果に検索できた領域IDが複数ある場合がある。かかる場合には、前回領域記録部203は、複数ある領域IDの内、重複領域の数が最小の領域IDを選択し、選択した領域IDを前回位置DB201に記録すれば良い。これにより、次回の領域検索要求で、当該領域検索要求の位置情報が前回記録された領域IDの領域に含まれていれば、続いて行われる当該領域と重複する重複領域に係る検索回数を減らせるからである。
The previous
[検索処理の手順]
次に、実施例2に係る検索処理の手順について、図17〜図19を参照して説明する。図17〜図19は、実施例2に係る検索処理の手順を示すフローチャートである。なお、図17〜図19の例では、領域検索要求に含まれる位置情報を検索座標として説明する。
[Search process steps]
Next, a search process procedure according to the second embodiment will be described with reference to FIGS. FIGS. 17 to 19 are flowcharts illustrating the procedure of the search process according to the second embodiment. In the examples of FIGS. 17 to 19, the position information included in the area search request is described as search coordinates.
まず、リクエスト受付部131によって領域検索要求が受け付けられると、前回領域検索部202は、問合せのセンサーIDの前回データ(前回検索領域)を前回位置DB201に記憶しているか否かを判定する(ステップS71)。問合せのセンサーIDの前回データを前回位置DB201に記憶していると判定した場合(ステップS71;Yes)、前回領域検索部202は、検索座標が前回データ内にあるか否かを判定する(ステップS72)。検索座標が前回データ内にある場合(ステップS72;Yes)、前回領域検索部202は、前回データを該当データとして検索結果に追加する(ステップS73)。
First, when an area search request is received by the
続いて、重複データ検索部134は、領域データDB122の重複領域122dに基づいて、検索結果に追加した領域データの重複領域から未判定のものを読み出し、読み出した重複領域を1つ選択する(ステップS74)。そして、重複データ検索部134は、選択した重複領域が検索座標を含むか否かを判定する(ステップS75)。選択した重複領域が検索座標を含むと判定した場合(ステップS75;Yes)、重複データ検索部134は、含むと判定した重複領域の領域IDを検索結果に追加し(ステップS76)、ステップS77に移行する。
Subsequently, based on the
一方、選択した重複領域が検索座標を含まないと判定した場合(ステップS75;No)、重複データ検索部134は、全重複領域の判定を終えていない場合(ステップS77;No)、次の重複領域を判定すべく、ステップS74に移行する。一方、重複データ検索部134は、全重複領域の判定を終えた場合(ステップS77;Yes)、作成された検索結果を問合せ側へ返答すべく、レスポンス転送部132に出力する(ステップS78)。そして、前回領域記録部203は、重複データ検索部134によって作成された検索結果の内1つの領域IDを問合せのセンサーIDに対応付けて前回位置DB201に記録し(ステップS79)、検索処理を終了する。
On the other hand, when it is determined that the selected overlapping area does not include the search coordinates (step S75; No), the overlapping
ステップS71では、問合せのセンサーIDの前回データを前回位置DB201に記憶していない場合(ステップS71;No)、前回領域検索部202は、ノードをルートノードからトップダウンに辿る検索処理に移行すべく、ステップS11に移行する。
In step S71, when the previous data of the inquired sensor ID is not stored in the previous position DB 201 (step S71; No), the previous
ステップS72では、検索座標が前回データ内にない場合(ステップS72;No)、前回領域検索部202は、ノードをボトムアップに辿る検索処理に移行すべく、ステップS80に移行する。
In step S72, when the search coordinates are not in the previous data (step S72; No), the previous
ステップS80では、ツリー検索部133が、領域インデックスDB121に基づいて、前回データを領域データとしてデータリストに持つ葉ノードまたは親ノードを選択する(ステップS80)。そして、ツリー検索部133は、選択した選択ノードが検索座標を含むか否かを、領域インデックスDB121を用いて判定する(ステップS81)。選択ノードが検索座標を含むと判定した場合(ステップS81;Yes)、ツリー検索部133は、さらにノードを選択ノードからトップダウンに辿る検索処理に移行すべく、ステップS91に移行する。
In step S80, based on the
一方、選択ノードが検索座標を含まないと判定した場合(ステップS81;No)、ツリー検索部133は、選択ノードがルートノードであるか否かを、領域インデックスDB121を用いて判定する(ステップS82)。選択ノードがルートノードでなければ(ステップS82;No)、ツリー検索部133は、親ノードを検索すべく、ステップS80に移行する。
On the other hand, when it is determined that the selected node does not include the search coordinates (step S81; No), the
一方、選択ノードがルートノードであれば(ステップS82;Yes)、ツリー検索部133は、検索結果無しとして問合せ側へ返答すべく、レスポンス転送部132に出力する(ステップS83)。そして、前回領域記録部203は、問合せのセンサーIDに対応付けて未検出である旨を前回位置DB201に記録し(ステップS84)、検索処理を終了する。
On the other hand, if the selected node is the root node (step S82; Yes), the
[前回位置DBに前回データを記憶していない場合の検索処理の手順]
次に、図17のステップS71に示した前回位置DB201に前回データを記憶していない場合の検索処理の手順について、図18を参照して説明する。なお、図18に示すように、ステップS11〜ステップS24については、図9と同様の処理手順であるので、その説明を省略する。図9と図18とが異なる点は、前回領域記録部203が検索結果を記録する点にある。
[Procedure for search processing when previous data is not stored in previous position DB]
Next, the procedure of search processing when the previous data is not stored in the
重複データ検索部134が全重複領域の判定を終えると(ステップS22;Yes)、作成された検索結果を問合せ側へ返答すべく、レスポンス転送部132に出力する(ステップS23)。そして、前回領域記録部203は、重複データ検索部134によって作成された検索結果の内1つの領域IDを問合せのセンサーIDに対応付けて前回位置DB201に記録し(ステップS23A)、検索処理を終了する。
When the duplicate
また、ツリー検索部133が全ての選択候補ノードの検索を終えると(ステップS15;Yes)、検索結果無しとして問合せ側へ返答すべく、レスポンス転送部132に出力する(ステップS24)。そして、前回領域記録部203は、問合せのセンサーIDに対応付けて未検出である旨を前回位置DB201に記録し(ステップS24A)、検索処理を終了する。
When the
[選択ノードが検索座標を含む場合の検索処理の手順]
次に、図17のステップS81に示した選択ノードが検索座標を含む場合の検索処理の手順について、図19を参照して説明する。
[Procedure for search processing when the selected node contains search coordinates]
Next, the procedure of search processing when the selected node shown in step S81 of FIG. 17 includes search coordinates will be described with reference to FIG.
ツリー検索部133は、検索座標を含む選択ノードが葉ノードであるか否かを、領域インデックスDB121を用いて判定する(ステップS91)。
The
選択ノードが葉ノードでないと判定した場合(ステップS91;No)、ツリー検索部133は、選択ノードの子ノードに検索座標を含むものがあるか否かを、領域インデックスDB121を用いて判定する(ステップS92)。一例として、ツリー検索部133は、領域インデックスDB121に基づいて、選択ノードの子ノードリストを読み出し、読み出した子ノードリストに含まれるそれぞれの子ノードの矩形領域を読み出す。そして、ツリー検索部133は、読み出したそれぞれの子ノードの矩形領域に、検索座標を含むものがあるか否かを判定する。
When it is determined that the selected node is not a leaf node (step S91; No), the
選択ノードの子ノードに検索座標を含むものがあると判定した場合(ステップS92;Yes)、ツリー検索部133は、検索座標を含む子ノードを選択候補ノードに追加し(ステップS93)、ステップS94に移行する。一方、選択ノードの子ノードに検索座標を含むものがないと判定した場合(ステップS92;No)、ツリー検索部133は、ステップS94に移行する。
If it is determined that there is a child node of the selected node that includes the search coordinate (step S92; Yes), the
続いて、ツリー検索部133は、全ての選択候補ノードの検索を終えたか否かを判定する(ステップS94)。全ての選択候補ノードの検索を終えていないと判定した場合(ステップS94;No)、ツリー検索部133は、選択候補ノード内の1つの未検索ノードを選択し(ステップS95)、ステップS91に移行する。
Subsequently, the
ステップS91では、選択ノードが葉ノードであると判定した場合(ステップS91;Yes)、ツリー検索部133は、選択した葉ノードが持つ領域データの内、検索座標を含むものがあるか否かを判定する(ステップS96)。一例として、ツリー検索部133は、領域インデックスDB121に基づいて、葉ノードであるノードのデータリストを読み出し、読み出したデータリストに含まれる領域データへのポインタ、例えば領域IDを取り出す。そして、ツリー検索部133は、領域データDB122に基づいて、取り出した領域IDに対応する領域情報122cに検索座標を含むものがあるか否かを判定する。
If it is determined in step S91 that the selected node is a leaf node (step S91; Yes), the
選択した葉ノードが持つ領域データの内、検索座標を含むものがないと判定した場合(ステップS96;No)、ツリー検索部133は、次の選択候補ノードを検索すべく、ステップS94に移行する。
If it is determined that none of the area data held by the selected leaf node includes the search coordinates (step S96; No), the
一方、選択した葉ノードが持つ領域データの内、検索座標を含むものがあると判定した場合(ステップS96;Yes)、ツリー検索部133は、該当領域データの内の1つを該当データとして検索結果に追加する(ステップS97)。ここで、領域インデックスDB121を用いた検索を終了し、ステップS74に移行する。なお、ツリー検索部133は、該当領域データの内の1つとして、重複領域の数が最小の領域データを検索結果に追加しても良い。これは、ステップS74以降の重複データ検索部134の処理において、さらに検索座標を含む領域を検索する際、検索対象となる重複領域の数を減らすためである。
On the other hand, if it is determined that there is the area data included in the selected leaf node that includes the search coordinates (step S96; Yes), the
ステップS94では、全ての選択候補ノードの検索を終えたと判定した場合(ステップS94;Yes)、ツリー検索部133は、選択ノードに検索座標を含むものがないので、さらに親ノードから検索すべく、ステップS80に移行する。
In step S94, when it is determined that the search of all selection candidate nodes has been completed (step S94; Yes), the
このようにして、重複領域設定部135は、領域検索要求の検索座標(位置情報)を領域データに含む場合に、当該領域データを前回位置DB201に記録するようにした。また、ツリー検索部133は、検索座標(位置情報)を領域データに全く含まない場合に、未検出である旨を前回位置DB201に記録するようにした。しかしながら、ツリー検索部133は、検索座標(位置情報)を領域データに全く含まない場合であっても、検索座標を含むノードがあれば、当該ノードの内最も深いノード(最深ノード)を前回位置DB201に記録するようにしても良い。これは、次回の領域検索要求の際、前回の検索座標を含むノードの内最深ノードから領域検索を行うことで、領域検索にヒットする確率を高くできるとともに、且つ検索回数を減らすことができる可能性があるからである。
In this way, the overlapping
[検索処理の変形例の手順]
図20、図21は、実施例に係る検索処理の変形例の手順を示すフローチャートである。なお、図17に示す検索処理と同一の処理S71〜S83については同一符号を示すことで、その重複する処理の説明については省略する。また、図19に示す、選択ノードが検索座標を含む場合の検索処理と同一の処理S91〜S97については同一符号を示すことで、その重複する処理の説明については省略する。
[Procedure of modified search process]
20 and 21 are flowcharts illustrating the procedure of a modification of the search process according to the embodiment. In addition, about the process S71-S83 same as the search process shown in FIG. 17, the description is abbreviate | omitted by showing the same code | symbol. In addition, the same processes S91 to S97 as the search process in the case where the selected node includes the search coordinates shown in FIG. 19 are denoted by the same reference numerals, and the description of the overlapping processes is omitted.
図20に示す検索処理が図17に示す検索処理と異なる点は、S91、S92を追加した点にある。図20に示すように、前回領域検索部202は、問合せのセンサーIDの前回データ(前回検索領域)を前回位置DB201に記憶しているか否かを判定する(ステップS71)。問合せのセンサーIDの前回データを前回位置DB201に記憶していると判定した場合(ステップS71;Yes)、前回領域検索部202は、前回データが領域データ(領域ID)か否かを判定する(ステップS91)。前回データが領域データである場合には(ステップS91;Yes)、前回領域検索部202は、ステップS72に移行する。一方、前回データが領域データでない場合には(ステップS91;No)、前回領域検索部202は、前回データのノードを選択し(ステップS92)、ステップS81に移行する。
The search process shown in FIG. 20 is different from the search process shown in FIG. 17 in that S91 and S92 are added. As shown in FIG. 20, the previous
また、図20に示す検索処理が図17に示す検索処理と異なる点は、S121〜S123を追加した点にある。図20に示すように、ツリー検索部133は、選択ノードがルートノードであるか否かを、領域インデックスDB121を用いて判定する(ステップS82)。選択ノードがルートノードでなければ(ステップS82;No)、ツリー検索部133は、親ノードを検索すべく、ステップS80に移行する。一方、選択ノードがルートノードであれば(ステップS82;Yes)、ツリー検索部133は、検索結果無しとして問合せ側へ返答すべく、レスポンス転送部132に出力する(ステップS83)。そして、前回領域記録部203は、最深該当ノードがあるか否かを判定する(ステップS121)。最深該当ノードがあれば(ステップS121;Yes)、前回領域記録部203は、前回位置DB201に最深該当ノードを問合せのセンサーIDに対応付けて記録し(ステップS122)、検索処理を終了する。一方、最深該当ノードがなければ(ステップS121;No)、前回領域記録部203は、問合せのセンサーIDに対応付けて未検出である旨を前回位置DB201に記録し(ステップS123)、検索処理を終了する。
Further, the search process shown in FIG. 20 is different from the search process shown in FIG. 17 in that S121 to S123 are added. As illustrated in FIG. 20, the
図21に示す、選択ノードが検索座標を含む場合の検索処理が図19に示す、同様の検索処理と異なる点は、S101、S102を追加した点にある。図21に示すように、ツリー検索部133は、選択ノードが最深該当ノードより深いか否かを判定する(ステップS101)。選択ノードが最深該当ノードより深い場合には(ステップS101;Yes)、ツリー検索部133は、選択ノードを最深該当ノードとして一時的に記憶部12に記録し(ステップS102)、ステップS91に移行する。一方、選択ノードが最深該当ノードより深くない場合には(ステップS101;No)、ツリー検索部133は、ステップS91に移行する。
The search process when the selected node includes the search coordinates shown in FIG. 21 is different from the similar search process shown in FIG. 19 in that S101 and S102 are added. As shown in FIG. 21, the
また、図21に示す、選択ノードが検索座標を含む場合の検索処理が図19に示す、同様の検索処理と異なる点は、S103、S104を追加した点にある。図21に示すように、選択ノードが葉ノードでない場合(ステップS91;No)且つ選択ノードの子ノードに検索座標を含むものがある場合(ステップS92;Yes)、ツリー検索部133は、以下の処理を行う。ツリー検索部133は、検索座標を含む子ノードを選択候補ノードに追加し(ステップS93)、当該子ノードが最深該当ノードより深いか否かを判定する(ステップS103)。そして、当該子ノードが最深該当ノードより深い場合(ステップS103;Yes)、ツリー検索部133は、子ノードを最深該当ノードとして一時的に記憶部12に記録し(ステップS104)、ステップS94に移行する。一方、当該子ノードが最深該当ノードより深くない場合(ステップS103;No)、ツリー検索部133は、ステップS94に移行する。
21 is different from the similar search process shown in FIG. 19 in that the search process when the selected node includes search coordinates is that S103 and S104 are added. As shown in FIG. 21, when the selected node is not a leaf node (step S91; No) and when there is a child node of the selected node that includes a search coordinate (step S92; Yes), the
[最深ノードの説明]
ここで、最深ノードの具体例について、図22を参照して説明する。図22は、最深ノードの具体例を説明する図である。図22に示すように、ルートノードR0は、中間ノードR1〜R4の矩形領域を全て含む矩形領域であり、中間ノードR1は、子ノードR5〜R8の矩形領域を全て含む矩形領域である。領域検索要求の位置情報をP0で示す検索座標とすると、検索座標P0は、ルートノードR0に含まれ、且つ中間ノードR1に含まれている。ところが、検索座標P0は、中間ノードR2〜R4や、中間ノードR1に含まれる子ノードR5〜R8に含まれない。そこで、ツリー検索部133は、最深ノードを、検索座標P0を含むノードの内最も深いノードであるR1とする。そして、前回領域記録部203は、前回位置DB201に最深ノードR1を領域検索要求のセンサーIDに対応付けて記録する。
[Description of deepest node]
Here, a specific example of the deepest node will be described with reference to FIG. FIG. 22 is a diagram illustrating a specific example of the deepest node. As shown in FIG. 22, the root node R0 is a rectangular area including all the rectangular areas of the intermediate nodes R1 to R4, and the intermediate node R1 is a rectangular area including all of the rectangular areas of the child nodes R5 to R8. If the position information of the area search request is a search coordinate indicated by P0, the search coordinate P0 is included in the root node R0 and included in the intermediate node R1. However, the search coordinate P0 is not included in the intermediate nodes R2 to R4 or the child nodes R5 to R8 included in the intermediate node R1. Therefore, the
[実施例2の効果]
上記実施例2によれば、領域検索サーバ2は、所定の位置を含む領域検索要求を取得すると、該位置が前回検索できた領域に含まれるか否かを判定する。そして、領域検索サーバ2は、判定の結果、該位置が前回検索できた領域に含まれると判定された場合、領域データDB122に基づいて、含まれると判定された領域の重複領域の中から該位置を含む領域を検索する。かかる構成によれば、領域検索サーバ2は、次回の領域検索を前回検索できた領域から行うこととした。仮に、領域検索要求を行う要求元が領域の大きさに対して小さい移動距離しか移動しないような場合には、次回の領域検索要求の位置が前回検索できた領域の近傍にある可能性が高くなる。このため、領域検索サーバ2は、前回検索できた領域から次回の領域検索を行うことにより次回の位置を含む領域検索の検索時間を高速化できる。
[Effect of Example 2]
According to the second embodiment, when the
また、上記実施例2によれば、領域検索サーバ2は、所定の位置を含む領域検索要求を取得すると、該位置が前回検索できた領域に含まれるか否かを判定する。そして、領域検索サーバ2は、判定の結果、該位置が前回検索できた領域に含まれないと判定された場合、ツリー構造を形成するノードの中で、含まれないと判定された領域を含むインデックスの葉ノードから該位置を含む領域を検索する。そして、領域検索サーバ2は、該位置を含む領域を検索できた場合、検索できた情報の重複領域の中から該位置を含む領域を検索する。かかる構成によれば、領域検索サーバ2は、次回の領域検索を前回検索できた領域から行うこととした。仮に、領域検索要求を行う要求元が領域の大きさに対して小さい移動距離しか移動しないような場合には、次回の領域検索要求の位置が前回検索できた領域の近傍にある可能性が高くなる。このため、領域検索サーバ2は、次回の領域検索要求の位置が前回検索できた領域に含まれていなくても、当該位置が前回検索できた領域の近傍を含むインデックスの葉ノードから次回の領域検索を行うことにより次回の位置を含む領域検索の検索時間を高速化できる。
Further, according to the second embodiment, when the
[領域検索の検索回数の比較結果]
ここで、ルートノードから検索を開始した場合と、前回検索できた領域から検索を開始した場合との領域検索の検索回数の比較結果を、図23を参照して説明する。図23は、検索回数の比較結果を説明する図である。図23に示すように、Rツリーは、深さ5のインデックスツリーである。そして、ルートノードR0は、深さが1のノードR1等の矩形領域を全て含む矩形領域である。ノードR1は、深さが2のノードR2等の矩形領域を全て含む矩形領域である。ノードR2は、深さが3のノードR3等の矩形領域を全て含む矩形領域である。ノードR3は、深さが4のノードRA、RBの矩形領域を全て含む矩形領域である。ノードRAは、A1、A2、A3の領域データを含む。ノードRBは、B1、B2、B3の領域データを含む。そして、A2は、A1、A3、B1と重複する重複領域である。A3は、A1、A2、B1と重複する重複領域である。
[Comparison result of area search frequency]
Here, a comparison result of the number of search times of the area search when the search is started from the root node and when the search is started from the area that has been searched last time will be described with reference to FIG. FIG. 23 is a diagram for explaining a comparison result of the number of searches. As shown in FIG. 23, the R-tree is an index tree having a depth of 5. The root node R0 is a rectangular area including all rectangular areas such as the node R1 having a depth of 1. The node R1 is a rectangular area including all rectangular areas such as the node R2 having a depth of 2. The node R2 is a rectangular area including all rectangular areas such as the node R3 having a depth of 3. The node R3 is a rectangular area including all the rectangular areas of the nodes RA and RB having a depth of 4. The node RA includes area data of A1, A2, and A3. The node RB includes region data of B1, B2, and B3. A2 is an overlapping area overlapping with A1, A3, and B1. A3 is an overlapping area overlapping with A1, A2, and B1.
まず、領域検索サーバ2は、最初にP2の位置を含む領域検索要求の領域検索を行った結果、P2の位置を含む領域データA2、B1の内、A2を前回検索領域として前回位置DB201に記録したものとする。そして、領域検索サーバ2は、次回、P3の位置を含む領域検索要求の領域検索を行うとする。すると、領域検索サーバ2によって行われる検索回数N1は、以下のようになる。
N1=1(A2)+3(A2の重複領域)=4
すなわち、N1は、P3の位置がA2の領域に含まれるかを検索する1回と、P3の位置がA2の領域に含まれているので、A2の領域と重複する重複領域A1、A3、B1にP3の位置が含まれているかを検索する3回とを加算した値4となる。
First, as a result of the area search of the area search request including the position of P2 first, the
N1 = 1 (A2) +3 (overlapping area of A2) = 4
That is, N1 searches once whether the position of P3 is included in the area of A2, and since the position of P3 is included in the area of A2, overlapping areas A1, A3, B1 overlapping with the area of A2 The value 4 is obtained by adding 3 times to search whether or not the position of P3 is included.
一方、ルートノードから検索を開始した場合には、検索回数O1は、以下のようになる。なお、各ノードの子ノードが3であるとする。
O1=4×3(R0〜R3)+3(RA)+3(RB)=18
すなわち、O1には、R0〜R3の4個のノードについて各子ノードの数(3)分P3の位置が各ノードに含まれるかを検索する12回が設定される。さらに、P3の位置がRA、RBに含まれているので、RAに含まれる3個の領域データにP3の位置が含まれているかを検索する3回をO1に加算した15回が設定される。さらに、RBに含まれる3個の領域データにP3の位置が含まれているかを検索する3回をO1に加算した18回が設定される。
On the other hand, when the search is started from the root node, the search count O1 is as follows. It is assumed that the child node of each node is 3.
O1 = 4 × 3 (R0 to R3) +3 (RA) +3 (RB) = 18
That is, 12 times for searching whether each node includes the position of P3 by the number of child nodes (3) for the four nodes R0 to R3 is set in O1. Furthermore, since the position of P3 is included in RA and RB, 15 times obtained by adding 3 times for searching whether the position of P3 is included in the three area data included in RA to O1 is set. . Furthermore, 18 times obtained by adding 3 times for searching whether the position of P3 is included in the 3 area data included in the RB to O1 is set.
領域検索サーバ2が次回の領域検索を行った結果、P3の位置を含む領域データA1、A2、A3、B1の内、A2を前回検索領域として前回位置DB201に記録したものとする。そして、領域検索サーバ2は、さらに次回、P4の位置を含む領域検索要求の領域検索を行うとする。すると、領域検索サーバ2によって行われる検索回数N2は、以下のようになる。
N2=1(A2)+3(RA)+3(A3の重複領域)=7
すなわち、N2には、P4の位置がA2の領域に含まれるかを検索する1回が設定される。さらに、P4の位置がA2の領域に含まれていないので、A2のノードRAに含まれる3個の領域データにP4の位置が含まれているかを検索する3回をN2に加算した4回が設定される。さらに、P4の位置がA3の領域に含まれているので、A3の領域と重複する重複領域A1、A2、B1にP4の位置が含まれているかを検索する3回をN2に加算した7回が設定される。一方、ルートノードから検索を開始した場合には、検索回数O1、すなわち18回となる。
As a result of the
N2 = 1 (A2) +3 (RA) +3 (overlapping area of A3) = 7
That is, N2 is set once to search whether the position of P4 is included in the area of A2. Further, since the position of P4 is not included in the area of A2, four times obtained by adding 3 times to search for whether the position of P4 is included in the three area data included in the node RA of A2 are added to N2. Is set. Furthermore, since the position of P4 is included in the area of A3, 7 times of adding 3 to the search for whether the position of P4 is included in the overlapping areas A1, A2, and B1 overlapping with the area of A3 is added to N2. Is set. On the other hand, when the search is started from the root node, the number of searches is O1, that is, 18 times.
このようにして、領域検索サーバ2は、前回検索領域から次回の領域検索を行うことにより次回の位置を含む領域検索の検索回数を、ルートノードから検索を開始した場合の検索回数より少なくでき、検索時間を高速化できる。
In this way, the
なお、重複領域設定部135の処理の変形例として、追加領域と重複する重複領域が所定の数以上の場合には、追加領域の重複領域の欄に重複領域を追加しないようにした。しかしながら、重複領域設定部135は、これに限定されず、追加領域と重複する重複領域が所定の数以上の場合には、追加領域の重複領域の欄に「重複領域数過多」である旨の情報を追加するようにしても良い。
Note that, as a modification of the processing of the overlapping
また、前回位置DB201は、センサーID201aと前回検索領域201とを対応付けるものとして説明した。しかしながら、前回位置DB201は、センサーID201aを、例えば、領域検索を要求する端末装置の装置IDに代えても良いし、領域検索を要求する携帯電話の携帯電話番号に代えても良い。すなわち、センサーID201aに相当するIDは、ユースケース毎に変えることができる。
Further, the
また、ツリー検索部133は、検索座標(位置情報)を領域データに全く含まない場合であっても、検索座標を含むノードがあれば、当該ノードの内最も深いノード(最深ノード)を前回位置DB201に記録するようにした。ここで、同じ深さで複数の最深ノードが存在する場合がある。かかる場合には、ツリー検索部133は、例えば最深ノード毎に有する子ノードの数が最小の最深ノードを前回位置DB201に記録すれば良い。また、別の例では、ツリー検索部133は、最深ノード毎に有する矩形領域の面積あたりの子ノードの数が最小の最深ノードを前回位置DB201に記録する。具体的には、ツリー検索部133は、最深ノード毎に、子ノードリストの子ノード数を矩形領域の面積で割った値を算出し、算出した値が最小の最深ノードを選択し、選択した最深ノードを前回位置DB201に記録する。つまり、次回の検索量が少なくなるノードであることが望ましいのである。
Moreover, even if the search coordinates (position information) are not included in the region data at all, if there is a node including the search coordinates, the
[プログラムなど]
なお、領域検索サーバ1、2は、既知のパーソナルコンピュータ、ワークステーションなどの情報処理装置に、上記したツリー検索部133、重複データ検索部134などの各機能を搭載することによって実現することができる。
[Programs]
The
また、図示した各装置の各構成要素は、必ずしも物理的に図示の如く構成されていることを要しない。すなわち、各装置の分散・統合の具体的態様は図示のものに限られず、その全部または一部を、各種の負荷や使用状況などに応じて、任意の単位で機能的または物理的に分散・統合して構成することができる。例えば、ツリー検索部133と重複データ検索部134とを1個の部として統合しても良い。一方、ツリー検索部133を、葉ノードにおける検索処理と葉ノード以外のノードにおける検索処理とに分散しても良い。また、領域データDB122などの記憶部を領域検索サーバ1、2の外部装置としてネットワーク経由で接続するようにしても良い。
In addition, each component of each illustrated apparatus does not necessarily need to be physically configured as illustrated. That is, the specific mode of distribution / integration of each device is not limited to that shown in the figure, and all or a part thereof may be functionally or physically distributed or arbitrarily distributed in arbitrary units according to various loads or usage conditions. Can be integrated and configured. For example, the
また、上記実施例で説明した各種の処理は、あらかじめ用意されたプログラムをパーソナルコンピュータやワークステーションなどのコンピュータで実行することによって実現することができる。そこで、以下では、図1に示した領域検索サーバ1と同様の機能を実現する領域検索プログラムを実行するコンピュータの一例を説明する。図24は、領域検索プログラムを実行するコンピュータの一例を示す図である。 The various processes described in the above embodiments can be realized by executing a program prepared in advance on a computer such as a personal computer or a workstation. Therefore, in the following, an example of a computer that executes an area search program that implements the same function as the area search server 1 illustrated in FIG. 1 will be described. FIG. 24 is a diagram illustrating an example of a computer that executes an area search program.
図24に示すように、コンピュータ200は、各種演算処理を実行するCPU201と、ユーザからのデータの入力を受け付ける入力装置202と、ディスプレイ203を有する。また、コンピュータ200は、記憶媒体からプログラム等を読取る読み取り装置204と、ネットワークを介して他のコンピュータとの間でデータの授受を行うインタフェース装置205とを有する。また、コンピュータ200は、各種情報を一時記憶するRAM206と、ハードディスク装置207を有する。そして、各装置201〜207は、バス208に接続される。
As illustrated in FIG. 24, the
ハードディスク装置207は、領域検索プログラム207a、重複領域設定プログラム207bを記憶する。CPU201は、各プログラム207a〜207bを読み出して、RAM206に展開する。領域検索プログラム207aは、領域検索プロセス206aとして機能する。重複領域設定プログラム207bは、重複領域設定プロセス206bとして機能する。
The
例えば、領域検索プロセス206aは、ツリー検索部133および重複データ検索部134に対応する。重複領域設定プロセス206bは、重複領域設定部135に対応する。
For example, the
なお、各プログラム207a〜207bについては、必ずしも最初からハードディスク装置207に記憶させておかなくてもよい。例えば、コンピュータ200に挿入されるフレキシブルディスク(FD)、CD−ROM、DVDディスク、光磁気ディスク、ICカードなどの「可搬用の物理媒体」に各プログラムを記憶させておく。そして、コンピュータ200がこれらから各プログラム207a〜207bを読み出して実行するようにしても良い。
Note that the
以上の実施例1〜2を含む実施形態に関し、さらに以下の付記を開示する。 The following appendices are further disclosed with respect to the embodiments including Examples 1 and 2 described above.
(付記1)コンピュータが
領域を探索する際に用いられるインデックス情報であって複数の領域を含む領域情報とともに前記領域を管理するインデックス情報をツリー構造で表したインデックスツリーを用いて、所定の位置を含む領域を検索し、
該位置を含む領域を検索できた場合、複数の領域のそれぞれについて領域と重複する重複領域の情報を記憶した記憶部に基づいて、検索できた領域の重複領域の中から該位置を含む領域を検索し、
検索できた領域の情報を出力する
ことを実行する領域検索方法。
(Supplementary Note 1) Index information used when a computer searches for an area and including index information for managing the area together with area information including a plurality of areas, using an index tree representing a predetermined position, Search for the containing area,
When the area including the position can be searched, the area including the position is selected from the overlapping areas of the searched areas based on the storage unit storing the information of the overlapping area overlapping the area for each of the plurality of areas. Search and
An area search method that outputs information on areas that can be searched.
(付記2)所定の位置を含む領域の問合せ要求を取得すると、該位置が前回検索できた領域に含まれるか否かを判定し、
判定の結果、該位置が前回検索できた領域に含まれると判定された場合、前記記憶部に基づいて、含まれると判定された領域の重複領域の中から該位置を含む領域を検索することを特徴とする付記1に記載の領域検索方法。
(Supplementary Note 2) When an inquiry request for an area including a predetermined position is acquired, it is determined whether or not the position is included in the area that was previously searched,
As a result of the determination, when it is determined that the position is included in the area that can be searched last time, an area including the position is searched from the overlapping areas determined to be included based on the storage unit. The region search method according to appendix 1, characterized by:
(付記3)前記判定の結果、該位置が前回検索できた領域に含まれないと判定された場合、前記ツリー構造を形成するノードの中で、含まれないと判定された領域を含むインデックス情報の葉ノードから該位置を含む領域を検索し、
該位置を含む領域を検索できた場合、検索できた情報の重複領域の中から該位置を含む領域を検索することを特徴とする付記2に記載の領域検索方法。
(Supplementary Note 3) When it is determined that the position is not included in the previously searched area as a result of the determination, the index information includes the area determined not to be included in the nodes forming the tree structure. Search the area containing the position from the leaf node,
The area search method according to
(付記4)前記領域を検索する処理において、検索できた領域が複数ある場合、複数ある領域の内、重複領域の数が最も小さい領域を選択することを特徴とする付記2または付記3に記載の領域検索方法。
(Additional remark 4) In the process which searches the said area | region, when there are two or more areas which were able to be searched, the area | region with the smallest number of overlapping areas is selected from several areas, The
(付記5)前記記憶部に記憶する処理は、領域と重複する重複領域が所定の値を超える場合、当該領域に関する重複領域の情報を記憶しないことを特徴とする付記1に記載の領域検索方法。 (Supplementary note 5) The region search method according to supplementary note 1, wherein the process of storing in the storage unit does not store the information of the overlapping region relating to the region when the overlapping region overlapping the region exceeds a predetermined value .
(付記6)コンピュータに、
領域を探索する際に用いられるインデックス情報であって複数の領域を含む領域情報とともに前記領域を管理するインデックス情報をツリー構造で表したインデックスツリーを用いて、所定の位置を含む領域を検索し、
該位置を含む領域を検索できた場合、複数の領域のそれぞれについて領域と重複する重複領域の情報を記憶した記憶部に基づいて、検索できた領域の重複領域の中から該位置を含む領域を検索し、
検索できた領域の情報を出力する
各処理を実行させることを特徴とする領域検索プログラム。
(Appendix 6)
Using the index tree that represents the index information used when searching for the area and the area information including a plurality of areas and the index information for managing the area in a tree structure, the area including the predetermined position is searched,
When the area including the position can be searched, the area including the position is selected from the overlapping areas of the searched areas based on the storage unit storing the information of the overlapping area overlapping the area for each of the plurality of areas. Search and
An area search program that outputs information on areas that can be searched and that executes each process.
(付記7)複数の領域のそれぞれについて領域と重複する重複領域の情報を記憶した記憶部と、
領域を探索する際に用いられるインデックス情報であって複数の領域を含む領域情報とともに前記領域を管理するインデックス情報をツリー構造で表したインデックスツリーを用いて、所定の位置を含む領域を検索する第1の検索部と、
前記第1の検索部によって該位置を含む領域を検索できた場合、前記記憶部に基づいて、検索できた領域の重複領域の中から該位置を含む領域を検索する第2の検索部と、
前記第1の検索部および前記第2の検索部によって検索できた領域の情報を出力する出力部と
を有することを特徴とする情報処理装置。
(Additional remark 7) The memory | storage part which memorize | stored the information of the overlapping area which overlaps with an area | region about each of several area | region,
The index information used when searching for an area, and using the index tree representing the index information for managing the area in a tree structure together with the area information including a plurality of areas, the area including the predetermined position is searched. 1 search part,
A second search unit that searches for an area including the position from among the overlapping areas of the areas that can be searched based on the storage unit when the first search unit can search the area including the position;
An information processing apparatus comprising: an output unit that outputs information on an area that can be searched by the first search unit and the second search unit.
1、2 領域検索サーバ
11 通信インタフェース
12 記憶部
121 領域インデックスDB
122 領域データDB
13 制御部
131 リクエスト受付部
132 レスポンス転送部
133 ツリー検索部
134 重複データ検索部
135 重複領域設定部
201 前回位置DB
202 前回領域検索部
203 前回領域記録部
1, 2 area search server 11
122 Area data DB
DESCRIPTION OF
202 Previous
Claims (6)
領域を探索する際に用いられるインデックス情報であって複数の領域を含む領域情報とともに前記領域を管理するインデックス情報をツリー構造で表したインデックスツリーを用いて、所定の位置を含む領域を検索し、
該位置を含む領域を検索できた場合、複数の領域のそれぞれについて他の領域と一部が重複する場合の当該他の領域を示す重複領域の情報を記憶した記憶部に基づいて、検索できた領域と重複する重複領域の中から該位置を含む領域を検索し、
検索できた領域の情報を出力する
ことを実行する領域検索方法。 A search is made for an area including a predetermined position by using an index tree which is index information used when a computer searches for an area and which includes a plurality of areas and index information for managing the area in a tree structure. And
When the area including the position can be searched, the search can be performed based on the storage unit storing the information of the overlapping area indicating the other area when a part of the plurality of areas overlaps with the other area . Search for the area containing the position from the overlapping areas that overlap with the area,
An area search method that outputs information on areas that can be searched.
判定の結果、該位置が前回検索できた領域に含まれると判定された場合、前記記憶部に基づいて、含まれると判定された領域の重複領域の中から該位置を含む領域を検索することを特徴とする請求項1に記載の領域検索方法。 When an inquiry request for an area including a predetermined position is acquired, it is determined whether or not the position is included in the area that was previously searched,
As a result of the determination, when it is determined that the position is included in the area that can be searched last time, an area including the position is searched from the overlapping areas determined to be included based on the storage unit. The region search method according to claim 1.
該位置を含む領域を検索できた場合、検索できた情報の重複領域の中から該位置を含む領域を検索することを特徴とする請求項2に記載の領域検索方法。 As a result of the determination, when it is determined that the position is not included in the area that was previously searched, from the leaf nodes of the index information including the area determined not to be included among the nodes that form the tree structure Search for the area containing the position,
3. The area search method according to claim 2, wherein, when an area including the position can be searched, an area including the position is searched from an overlapping area of the searched information.
領域を探索する際に用いられるインデックス情報であって複数の領域を含む領域情報とともに前記領域を管理するインデックス情報をツリー構造で表したインデックスツリーを用いて、所定の位置を含む領域を検索し、
該位置を含む領域を検索できた場合、複数の領域のそれぞれについて他の領域と一部が重複する場合の当該他の領域を示す重複領域の情報を記憶した記憶部に基づいて、検索できた領域と重複する重複領域の中から該位置を含む領域を検索し、
検索できた領域の情報を出力する
各処理を実行させることを特徴とする領域検索プログラム。 On the computer,
Using the index tree that represents the index information used when searching for the area and the area information including a plurality of areas and the index information for managing the area in a tree structure, the area including the predetermined position is searched,
When the area including the position can be searched, the search can be performed based on the storage unit storing the information of the overlapping area indicating the other area when a part of the plurality of areas overlaps with the other area . Search for the area containing the position from the overlapping areas that overlap with the area,
An area search program that outputs information on areas that can be searched and that executes each process.
領域を探索する際に用いられるインデックス情報であって複数の領域を含む領域情報とともに前記領域を管理するインデックス情報をツリー構造で表したインデックスツリーを用いて、所定の位置を含む領域を検索する第1の検索部と、
前記第1の検索部によって該位置を含む領域を検索できた場合、前記記憶部に基づいて、検索できた領域と重複する重複領域の中から該位置を含む領域を検索する第2の検索部と、
前記第1の検索部および前記第2の検索部によって検索できた領域の情報を出力する出力部と
を有することを特徴とする情報処理装置。 A storage unit that stores information on an overlapping area indicating the other area when a part of each of the plurality of areas overlaps with another area ;
The index information used when searching for an area, and using the index tree representing the index information for managing the area in a tree structure together with the area information including a plurality of areas, the area including the predetermined position is searched. 1 search part,
A second search unit that searches for an area including the position from an overlapping area that overlaps the searched area based on the storage unit when the first search unit can search the area including the position; When,
An information processing apparatus comprising: an output unit that outputs information on an area that can be searched by the first search unit and the second search unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011160299A JP5776403B2 (en) | 2011-07-21 | 2011-07-21 | Region search method, region search program, and information processing apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011160299A JP5776403B2 (en) | 2011-07-21 | 2011-07-21 | Region search method, region search program, and information processing apparatus |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2013025591A JP2013025591A (en) | 2013-02-04 |
JP5776403B2 true JP5776403B2 (en) | 2015-09-09 |
Family
ID=47783863
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011160299A Expired - Fee Related JP5776403B2 (en) | 2011-07-21 | 2011-07-21 | Region search method, region search program, and information processing apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5776403B2 (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6065708B2 (en) * | 2013-03-28 | 2017-01-25 | 富士通株式会社 | Information processing method, apparatus and program |
JP6086021B2 (en) * | 2013-04-25 | 2017-03-01 | 富士通株式会社 | Search system and search method |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3501957B2 (en) * | 1998-08-28 | 2004-03-02 | 日本電信電話株式会社 | Location related information search method |
JP2001109760A (en) * | 1999-10-06 | 2001-04-20 | Toshiba Corp | Device for displaying geographical information and storage medium with program executing the same stored therein |
US7493565B2 (en) * | 2000-12-22 | 2009-02-17 | Microsoft Corporation | Environment-interactive context-aware devices and methods |
WO2004013776A2 (en) * | 2002-08-05 | 2004-02-12 | Metacarta, Inc. | Desktop client interaction with a geographic text search system |
JP5237837B2 (en) * | 2009-01-07 | 2013-07-17 | 株式会社日立製作所 | Spatial data management device, spatial data management method, and spatial data management program |
JP5446799B2 (en) * | 2009-12-04 | 2014-03-19 | ソニー株式会社 | Information processing apparatus, information processing method, and program |
US20110239163A1 (en) * | 2009-12-04 | 2011-09-29 | Daisuke Mochizuki | Display screen control method, graphical user interface, information processing apparatus, information processing method, and program |
-
2011
- 2011-07-21 JP JP2011160299A patent/JP5776403B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2013025591A (en) | 2013-02-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20070192301A1 (en) | Systems and methods for indexing and searching data records based on distance metrics | |
US20130054647A1 (en) | Information processing apparatus, information processing method, and program | |
CN107690637B (en) | Connecting semantically related data using large-table corpus | |
CN102316167B (en) | Website recommending method, system thereof and network server | |
US20130159347A1 (en) | Automatic and dynamic design of cache groups | |
CN102073733B (en) | Method and device for managing Hash table | |
Rahman et al. | Hdbscan: Density based clustering over location based services | |
CN117235285B (en) | Method and device for fusing knowledge graph data | |
CN113779286B (en) | Method and device for managing graph data | |
US20070130139A1 (en) | Search system for providing information of keyword input freguency by category and method thereof | |
CN108897698B (en) | File data block addressing method, system and equipment and storage medium | |
JP5776403B2 (en) | Region search method, region search program, and information processing apparatus | |
CN114840487A (en) | Metadata management method and device for distributed file system | |
JP6086021B2 (en) | Search system and search method | |
JP2010277329A (en) | Neighborhood retrieval device | |
CN103514224A (en) | Method for processing data in database, data query method and corresponding device | |
JP5845818B2 (en) | Region search method, region search program, and information processing apparatus | |
WO2019228009A1 (en) | Lsm tree optimization method and device and computer equipment | |
KR101687755B1 (en) | Method for providing Dynamic Service of Spatial Information | |
CN114297381A (en) | Text processing method, device, equipment and storage medium | |
JP5765253B2 (en) | Area search method, area search program, and information processing apparatus | |
JP6176107B2 (en) | Information collection program, information collection method, and information collection apparatus | |
KR20220099745A (en) | A spatial decomposition-based tree indexing and query processing methods and apparatus for geospatial blockchain data retrieval | |
JP6167531B2 (en) | Region search method, region index construction method, and region search device | |
US20020078133A1 (en) | Information collection apparatus and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20140404 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20140930 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20141028 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20141225 |
|
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: 20150609 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20150622 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5776403 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |