JPWO2009095981A1 - Method and apparatus for building tree structure data from tables - Google Patents

Method and apparatus for building tree structure data from tables Download PDF

Info

Publication number
JPWO2009095981A1
JPWO2009095981A1 JP2009551334A JP2009551334A JPWO2009095981A1 JP WO2009095981 A1 JPWO2009095981 A1 JP WO2009095981A1 JP 2009551334 A JP2009551334 A JP 2009551334A JP 2009551334 A JP2009551334 A JP 2009551334A JP WO2009095981 A1 JPWO2009095981 A1 JP WO2009095981A1
Authority
JP
Japan
Prior art keywords
record
node
array
parent
value
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
JP2009551334A
Other languages
Japanese (ja)
Other versions
JP5241738B2 (en
Inventor
古庄 晋二
晋二 古庄
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Turbo Data Laboratories Inc
Original Assignee
Turbo Data Laboratories Inc
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 Turbo Data Laboratories Inc filed Critical Turbo Data Laboratories Inc
Publication of JPWO2009095981A1 publication Critical patent/JPWO2009095981A1/en
Application granted granted Critical
Publication of JP5241738B2 publication Critical patent/JP5241738B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データは、1個のレコードが1個のノードに対応し、各レコードがレコードの並び順を表すレコード順序番号によって識別される、仮想的なレコードの配列によって表現される。レコードは、当該レコードに対応するノードの親ノードのレコード順序番号を格納する親子関係フィールドと、当該ノードに属する属性名を指定する属性名番号を格納する属性名フィールドと、当該ノードに属する属性値を指定する属性値番号を格納する属性値フィールドとを含む。Tree structure data consisting of a plurality of nodes, each node being represented by an attribute name and attribute value, is identified by a record sequence number in which one record corresponds to one node and each record represents the order of the records. Represented by an array of virtual records. The record includes a parent-child relationship field that stores a record order number of a parent node of a node corresponding to the record, an attribute name field that stores an attribute name number that specifies an attribute name that belongs to the node, and an attribute value that belongs to the node And an attribute value field for storing an attribute value number for designating.

Description

本発明は、表形式データからツリー構造データを構築する方法及び装置に係わり、特に、各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データを、各レコードがレコードの並び順を表すレコード順序番号によって識別される仮想的なレコードの配列として、記憶装置上に構築する方法及び装置に関係する。   The present invention relates to a method and apparatus for constructing tree structure data from tabular data, and in particular, tree structure data composed of a plurality of nodes, each node being represented by an attribute name and attribute value, each record being an array of records. The present invention relates to a method and apparatus constructed on a storage device as an array of virtual records identified by record sequence numbers representing the order.

本発明は、表構造の原データを記憶するメモリを備え、上記原データを各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データに変換し上記メモリに格納する装置にも関係する。   The present invention provides a device that includes a memory that stores original data having a table structure, converts the original data into tree structure data including a plurality of nodes each represented by an attribute name and an attribute value, and stores the converted data in the memory. Also related.

さらに、本発明は、コンピュータに上記方法を実行させるためのプログラム、プログラムプロダクト、及び、プログラムを記録した記録媒体に関係する。   Furthermore, the present invention relates to a program for causing a computer to execute the above method, a program product, and a recording medium on which the program is recorded.

さらに、本発明は、各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データが、各レコードがレコードの並び順を表す上記レコード順序番号によって識別される、仮想的なレコードの配列として記録された記録媒体に関係する。   Furthermore, the present invention provides a virtual record in which tree structure data composed of a plurality of nodes each represented by an attribute name and attribute value is identified by the record sequence number in which each record represents the order of the records. Related to the recording medium recorded as an array of

現在最も普及しているデータベースマネージメントシステム(DBMS)はリレーショナルデータベース(RDB)である。RDBは表形式データベースであるため、ツリー構造データの取り扱いを苦手としていることがよく知られている。   The most popular database management system (DBMS) at present is the relational database (RDB). Since RDB is a tabular database, it is well known that it is not good at handling tree structure data.

また、一般に、表形式データからツリー構造データを抽出(又は解釈)する作業は非常に厄介である。たとえば、対象とする表のレコードが、最上位項目から最下位項目までの複数個の項目により定義されている場合を考える。このとき、表形式データからツリー構造データを解釈するためには、
(1)最上位項目に同じ項目値を有するレコードをグループ分けし、
(2)上位項目に関して同じグループに分類されたレコードを、現在項目に関して同じ項目値を有するレコード毎にグループ分けし、
(3)現在項目が最下位項目に達するまで(2)を繰り返す、
という操作が必要である。この操作は、表形式データがn行m列(レコード数=n、項目数=m)であるならば、O(n*m)回の比較演算を必要とする。また、同じ項目名が多数回出現し、かつ、同じ項目値が多数回出現するので、これらの情報を記憶するために多量のメモリが必要である。さらに、同じ項目値が多数回出現するので、データ更新時に多数個の値を書き換えなければならない。
In general, it is very troublesome to extract (or interpret) tree structure data from tabular data. For example, consider a case where a target table record is defined by a plurality of items from the highest item to the lowest item. At this time, in order to interpret the tree structure data from the tabular data,
(1) Group records with the same item value in the top item,
(2) Group records classified into the same group with respect to the upper item into records having the same item value with respect to the current item,
(3) Repeat (2) until the current item reaches the lowest item.
This operation is necessary. This operation requires O (n * m) comparison operations if the tabular data has n rows and m columns (number of records = n, number of items = m). Further, since the same item name appears many times and the same item value appears many times, a large amount of memory is required to store these pieces of information. Furthermore, since the same item value appears many times, many values must be rewritten when data is updated.

そこで、ツリー構造データを階層化された複数個の表形式データで記述する種々の手法が提案されている。   Therefore, various methods for describing tree structure data with a plurality of hierarchical tabular data have been proposed.

第一に、一般的に木構造を持つ拡張マークアップ言語(XML)データをRDBに関連付けることは困難であるが、XMLデータの持つ自由度や柔軟性を大きく阻害することなく、XMLデータを表形式のデータ構造で表現する技術が提案されている(特許文献1)。特許文献1に記載されている技術では、XMLデータは、ルートエレメントから順にたどって各テーブルに格納され、格納されたデータには出現順序情報を付与される。各テーブルには、出現順序情報を含むダウングリップカラムと、格納されたデータと親子関係にある親データのダウングリップカラムの出現順序情報が割り当てられたアップグリップカラムとが作成されている。さらに、各テーブルには、ルートエレメントからの階層の深さを表すレベル値を格納するレベルカラムが作成されている。しかし、この技術では、XMLデータのスキーマ情報に基づいてデータの単位となるエレメント毎に1つのテーブルが作成され、テーブルにスキーマ情報に従ったデータが格納される。   First, it is difficult to associate Extensible Markup Language (XML) data having a tree structure with an RDB in general, but XML data can be displayed without greatly impairing the flexibility and flexibility of XML data. A technique for expressing the data structure in a format has been proposed (Patent Document 1). In the technique described in Patent Document 1, XML data is stored in each table in order from the root element, and appearance order information is given to the stored data. In each table, a downgrip column including appearance order information and an upgrip column assigned with appearance order information of the downgrip column of the parent data having a parent-child relationship with the stored data are created. Further, a level column for storing a level value representing the depth of the hierarchy from the root element is created in each table. However, in this technique, one table is created for each element as a data unit based on the schema information of XML data, and data according to the schema information is stored in the table.

第二に、項目に属する項目値を含むレコードの配列として表現される複数の表形式データを結合し、深さの浅い表形式データのレコードから深さの深い表形式データのレコードまでを順次特定し、これにより、深さと、レコードを示す値とからなるツリー記述テーブルを作成することにより、ツリー構造データを複数の表形式データへ変換する技術も提案されている(特許文献2)。この例でも、深さ毎に1つの表形式データが存在している。   Second, by combining multiple tabular data expressed as an array of records that contain item values belonging to the item, it is possible to sequentially identify the records from the shallow tabular data to the deep tabular data record. Thus, a technique for converting tree structure data into a plurality of tabular data by creating a tree description table including a depth and a value indicating a record has been proposed (Patent Document 2). Also in this example, one tabular data exists for each depth.

特許文献1又は特許文献2において取り扱われている表形式データは、ツリー構造データに変換することが意図されたデータである。たとえば、特許文献1では、ダウングリップカラム及びアップグリップカラムがテーブルの中に存在している。これに対して、近年、生産管理システムやトレーサビリティシステムで使用されている部品表と呼ばれるBOM(Bill of Materials)は、本来、ツリー構造データに変換されることが予定されていないが、データを分析したり、データを理解したりするとき、部品表をツリーデータ構造に展開すること(BOM展開)が必要とされる。たとえば、ストラクチャー型部品表では親部品図番と子部品図番の対が1つのデータとして格納されている。たとえば、親部品Aに子部品B1、B2及びB3が存在する場合、(A,B1)、(A,B2)及び(A,B3)の3組の対がストラクチャー型部品表に格納されている。さらに、子部品B1がC1及びC2という子部品を含むならば、(B1,C1)及び(B1,C2)という2組の対もまたストラクチャー型部品表に格納されている。
特開2004−178084号公報 国際公開第2004/038612号公報 国際公開第2005/088479号公報 国際公開第00/10103号公報 国際公開第03/040960号公報
The tabular data handled in Patent Document 1 or Patent Document 2 is data intended to be converted into tree structure data. For example, in Patent Document 1, a down grip column and an up grip column are present in a table. On the other hand, BOM (Bill of Materials) used in production management systems and traceability systems in recent years is not originally planned to be converted into tree structure data, but the data is analyzed. When comprehending or understanding data, it is necessary to expand the BOM into a tree data structure (BOM expansion). For example, in the structure type parts table, a pair of a parent part drawing number and a child part drawing number is stored as one data. For example, when there are child parts B1, B2, and B3 in the parent part A, three pairs (A, B1), (A, B2), and (A, B3) are stored in the structure-type parts table. . Further, if the child part B1 includes child parts C1 and C2, two pairs (B1, C1) and (B1, C2) are also stored in the structure-type parts table.
JP 2004-178084 A International Publication No. 2004/038612 International Publication No. 2005/088479 International Publication No. 00/10103 International Publication No. 03/040960

特許文献1に記載されている従来技術では、予めどのようなデータ構造が存在するかをスキャンによって、又は、文書型定義(DTD)のような定義によって知った上で、データを格納する格納先テーブルを作成する必要がある。よって、様々なデータ構造が現場で生成されるエディタなどの用途には、性能の面で不適当である。   Storage destination in the prior art described in Patent Document 1, by a scan or pre what data structures are present, or, in the knowledge by definition, such as Document Type Definition (DTD), for storing data You need to create a table. Therefore, it is unsuitable in terms of performance for applications such as editors in which various data structures are generated on site.

また、特許文献1又は特許文献2に記載されているような、ツリー構造データを複数個の階層化された表形式データで記述する従来のデータ表現形式は、1個の表形式データで記述する手法より、比較演算回数が削減され、メモリ使用量が削減されているが、任意のトポロジーをもつツリーを追加することが困難であり、データ編集の自由度が低い。   In addition, the conventional data representation format for describing tree structure data as a plurality of hierarchized tabular data as described in Patent Document 1 or Patent Document 2 is described as a single tabular data. Although the number of comparison operations is reduced and the memory usage is reduced by the method, it is difficult to add a tree having an arbitrary topology, and the degree of freedom of data editing is low.

よって、ツリー構造データを記述するデータ表現形式は、データ構造の動的な変化に対応可能であり、高い編集の自由度を有することが好ましい。   Therefore, it is preferable that the data expression format describing the tree structure data can cope with a dynamic change in the data structure and has a high degree of freedom in editing.

ツリー構造データは、それ自体を解釈するための比較操作が削減され、それ自体を格納するためのメモリ使用量が削減され、ツリー構造の更新時に書き換えるべきデータ量が削減され、事前のデータ構造の定義を不要とすることが好ましい。   Tree structure data reduces the number of comparison operations to interpret itself, reduces memory usage to store itself, reduces the amount of data to be rewritten when updating the tree structure, It is preferable to make the definition unnecessary.

本発明の一実施例によれば、各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データを各レコードがレコードの並び順を表すレコード順序番号によって識別される仮想的なレコードの配列として記憶装置上に構築する装置であって、
階層構造を有する複数のテーブルを階層毎にマッチングキーによってマッチングさせ、親側のテーブルと子側のテーブルとの間で親子関係がある行番号同士の行番号対応表を作成する手段と、
上記行番号対応表から親子関係がある上記親側のテーブル中の行番号及び上記子側のテーブル中の行番号を探索する手段と、
上記探索する手段によって見つけられた順に、上記子側のテーブル中の行に割り当てられるレコード順序番号を決定し、上記仮想的なレコードの配列中の上記レコード順序番号によって識別される位置に、親子関係フィールド値として上記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、上記ノードの属性名フィールド値として上記子側のテーブル中の行に属する項目名を格納し、上記ノードの属性値フィールド値として上記子側のテーブル中の行に属する項目値を格納する手段と、
を備える装置が提供される。
According to an embodiment of the present invention, tree structure data consisting of a plurality of nodes each represented by an attribute name and attribute value is identified by a record sequence number in which each record represents the sequence of records. A device constructed on a storage device as an array of records,
Means for matching a plurality of tables having a hierarchical structure with a matching key for each hierarchy, and creating a row number correspondence table between row numbers having a parent-child relationship between the parent side table and the child side table;
Means for searching the row number in the parent table and the row number in the child table having a parent-child relationship from the row number correspondence table;
A record sequence number assigned to a row in the child table is determined in the order found by the searching means, and a parent-child relationship is determined at the position identified by the record sequence number in the virtual record array. Store the record order number of the parent node of the node corresponding to the row in the child table as a field value, store the item name belonging to the row in the child table as the attribute name field value of the node, Means for storing an item value belonging to a row in the child side table as an attribute value field value of the node;
An apparatus comprising:

一実施例では、1個のレコードは1個のノードに対応していてもよい。階層構造を有する複数のテーブルは、ツリー構造データに展開されるべき表構造の原データである。また、マッチングキーはジョインキーでよい。ジョインキーを用いるマッチング、すなわち、ジョインは、原データからジョインテーブル、すなわち、中間データを生成する。ジョインテーブルは、親子関係にある原データ自体と、親子関係にある原データ間の結合関係を表現するようなテーブルである。   In one embodiment, one record may correspond to one node. A plurality of tables having a hierarchical structure is original data of a table structure to be expanded into tree structure data. The matching key may be a join key. Matching using a join key, i.e., join, generates a join table, i.e., intermediate data, from the original data. The join table is a table that represents the original data itself in the parent-child relationship and the connection relationship between the original data in the parent-child relationship.

本発明の一実施例によれば、上記装置は、上記ノードの属性名フィールド値が上記レコード順序番号の順番に格納されている配列から、上記レコード順序番号の順に上記属性名を一意に特定する属性名番号が格納されている属性名番号配列、上記属性名番号配列の要素の順番に上記属性名番号によって一意に特定される上記属性名が格納されている属性名配列、上記レコード順序番号の順に上記属性値を一意に特定する属性値番号が格納されている属性値番号配列、及び、上記属性値番号配列の要素の順番に上記属性値番号によって一意に特定される上記属性値が格納されている属性値配列を作成する手段をさらに備える。   According to an embodiment of the present invention, the apparatus uniquely identifies the attribute names in the order of the record order numbers from an array in which the attribute name field values of the nodes are stored in the order of the record order numbers. An attribute name number array storing attribute name numbers, an attribute name array storing the attribute names uniquely specified by the attribute name numbers in the order of the elements of the attribute name number array, and the record sequence number An attribute value number array storing attribute value numbers that uniquely identify the attribute values in order, and the attribute values uniquely specified by the attribute value numbers are stored in the order of the elements of the attribute value number array. Means for creating the attribute value array.

本発明の一実施例によれば、上記複数のテーブルが部品の親子関係を表現するストラクチャー型部品表であり、上記行番号対応表を作成する手段が、最上位階層のテーブルとして、上記ツリー構造データのルートノードに対応する部品を選択し、その他の階層のデータとして同一の上記ストラクチャー型部品表を利用する。   According to an embodiment of the present invention, the plurality of tables is a structure-type parts table that expresses a parent-child relationship of parts, and the means for creating the row number correspondence table includes the tree structure as a top-level table. The part corresponding to the root node of the data is selected, and the same structure type parts table is used as the data of the other hierarchy.

本発明の一実施例によれば、上記行番号対応表を作成する手段が、上記マッチングキーとして、上記親側のテーブルにおけるデータの出現順に割り当てられた順序番号と、上記子側のテーブルにおけるデータに対応する親側のデータに割り当てられた順序番号との対を利用する。   According to an embodiment of the present invention, the means for creating the row number correspondence table includes, as the matching key, a sequence number assigned in the order of appearance of data in the parent table, and data in the child table. The pair with the sequence number assigned to the parent data corresponding to is used.

本発明の一実施例によれば、階層構造を有する複数のテーブルを記憶するメモリを備え、上記複数のテーブルを各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データに変換し上記メモリに格納する装置であって、
上記複数のテーブルを階層毎にマッチングキーによってマッチングさせるマッチング部と、
上記複数のテーブルの階層毎にマッチングした親側のテーブルと子側のテーブルとの間で親子関係がある行番号同士の行番号対応表を作成する対応表作成部と、
上記行番号対応表から親子関係がある上記親側のテーブル中の行番号及び上記子側のテーブル中の行番号を探索する探索部と、
上記探索部によって見つけられた順に、上記子側のテーブル中の行に割り当てられるレコード順序番号を決定し、上記仮想的なレコードの配列中の上記レコード順序番号によって識別される位置に、親子関係フィールド値として上記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、上記ノードの属性名フィールド値として上記子側のテーブル中の行に属する項目名を格納し、上記ノードの属性値フィールド値として上記子側のテーブル中の行に属する上記原データに属する項目値を格納するレコード生成部と、
を備え、
上記ツリー構造データが、各レコードがレコードの並び順を表す上記レコード順序番号によって識別される、仮想的なレコードの配列として上記メモリに構築される装置が提供される。
According to an embodiment of the present invention, a memory for storing a plurality of tables having a hierarchical structure is provided, and the plurality of tables are converted into tree structure data composed of a plurality of nodes each represented by an attribute name and an attribute value. A device for converting and storing in the memory,
A matching unit for matching the plurality of tables with a matching key for each hierarchy;
A correspondence table creation unit that creates a row number correspondence table between row numbers having a parent-child relationship between a parent table and a child table that are matched for each hierarchy of the plurality of tables;
A search unit for searching for a row number in the parent table and a row number in the child table having a parent-child relationship from the row number correspondence table;
A record sequence number assigned to a row in the child table is determined in the order found by the search unit, and a parent-child relationship field is located at a position identified by the record sequence number in the virtual record array. The record order number of the parent node of the node corresponding to the row in the child table is stored as a value, the item name belonging to the row in the child table is stored as the attribute name field value of the node, and A record generation unit for storing an item value belonging to the original data belonging to a row in the child table as an attribute value field value of the node;
With
An apparatus is provided in which the tree structure data is constructed in the memory as an array of virtual records in which each record is identified by the record order number representing the order of the records.

本発明の一実施例によれば、上記装置は、上記ノードの属性名フィールド値が上記レコード順序番号の順番に格納されている配列から、上記レコード順序番号の順に上記属性名を一意に特定する属性名番号が格納されている属性名番号配列、上記属性名番号配列の要素の順番に上記属性名番号によって一意に特定される上記属性名が格納されている属性名配列、上記レコード順序番号の順に上記属性値を一意に特定する属性値番号が格納されている属性値番号配列、及び、上記属性値番号配列の要素の順番に上記属性値番号によって一意に特定される上記属性値が格納されている属性値配列を作成する値分離部をさらに備える。   According to an embodiment of the present invention, the apparatus uniquely identifies the attribute names in the order of the record order numbers from an array in which the attribute name field values of the nodes are stored in the order of the record order numbers. An attribute name number array storing attribute name numbers, an attribute name array storing the attribute names uniquely specified by the attribute name numbers in the order of the elements of the attribute name number array, and the record sequence number An attribute value number array storing attribute value numbers that uniquely identify the attribute values in order, and the attribute values uniquely specified by the attribute value numbers are stored in the order of the elements of the attribute value number array. And a value separator for creating the attribute value array.

本発明の一実施例によれば、上記複数のテーブルが部品の親子関係を表現するストラクチャー型部品表であり、上記対応表作成部が、最上位階層の表構造の中間データとして、上記ツリー構造データのルートノードに対応する部品を選択し、その他の表構造の中間データとして同一の上記ストラクチャー型部品表を利用する。   According to an embodiment of the present invention, the plurality of tables is a structure-type parts table that expresses a parent-child relationship of parts, and the correspondence table creation unit uses the tree structure as intermediate data of the table structure of the highest hierarchy. A part corresponding to the root node of the data is selected, and the same structure type parts table is used as intermediate data of other table structures.

本発明の一実施例によれば、上記対応表作成部が、上記マッチングキーとして、上記親側のテーブルにおけるデータの出現順に割り当てられた順序番号と、上記子側のテーブルにおけるデータに対応する親側のデータに割り当てられた順序番号との対を利用する。   According to an embodiment of the present invention, the correspondence table creating unit uses the sequence number assigned in the order of appearance of data in the parent table as the matching key and the parent corresponding to the data in the child table. Use the pair with the sequence number assigned to the side data.

本発明の一実施例によれば、各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データを各レコードがレコードの並び順を表すレコード順序番号によって識別される仮想的なレコードの配列として記憶装置上に構築する方法であって、
階層構造を有する複数のテーブルを階層毎にマッチングキーによってマッチングさせ、親側のテーブルと子側のテーブルとの間で親子関係がある行番号同士の行番号対応表を作成するステップと、
上記行番号対応表から親子関係がある上記親側のテーブル中の行番号及び上記子側のテーブル中の行番号を探索し、探索によって見つけられた順に、上記子側のテーブル中の行に割り当てられるレコード順序番号を決定し、上記仮想的なレコードの配列中の上記レコード順序番号によって識別される位置に、親子関係フィールド値として上記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、上記ノードの属性名フィールド値として上記子側のテーブル中の行に属する項目名を格納し、上記ノードの属性値フィールド値として上記子側のテーブル中の行に属する項目値を格納するステップと、
を備える方法が提供される。
According to an embodiment of the present invention, tree structure data consisting of a plurality of nodes each represented by an attribute name and attribute value is identified by a record sequence number in which each record represents the sequence of records. A method of constructing an array of records on a storage device,
A step of matching a plurality of tables having a hierarchical structure with a matching key for each hierarchy, and creating a row number correspondence table between row numbers having a parent-child relationship between the parent side table and the child side table;
The row number in the parent table and the row number in the child table that have a parent-child relationship are searched from the row number correspondence table and assigned to the rows in the child table in the order found by the search. Record of the node corresponding to the row in the child side table as the parent-child relationship field value at the position identified by the record sequence number in the virtual record array. Stores the sequence number, stores the item name belonging to the row in the child table as the attribute name field value of the node, and the item value belonging to the row in the child table as the attribute value field value of the node A step of storing
A method comprising:

本発明の一実施例によれば、上記方法は、上記ノードの属性名フィールド値が上記レコード順序番号の順番に格納されている配列から、上記レコード順序番号の順に上記属性名を一意に特定する属性名番号が格納されている属性名番号配列、上記属性名番号配列の要素の順番に上記属性名番号によって一意に特定される上記属性名が格納されている属性名配列、上記レコード順序番号の順に上記属性値を一意に特定する属性値番号が格納されている属性値番号配列、及び、上記属性値番号配列の要素の順番に上記属性値番号によって一意に特定される上記属性値が格納されている属性値配列を作成するステップをさらに備える。   According to an embodiment of the present invention, the method uniquely identifies the attribute names in the order of the record order numbers from an array in which the attribute name field values of the nodes are stored in the order of the record order numbers. An attribute name number array storing attribute name numbers, an attribute name array storing the attribute names uniquely specified by the attribute name numbers in the order of the elements of the attribute name number array, and the record sequence number An attribute value number array storing attribute value numbers that uniquely identify the attribute values in order, and the attribute values uniquely specified by the attribute value numbers are stored in the order of the elements of the attribute value number array. The method further includes the step of creating an attribute value array.

本発明の一実施例によれば、上記複数のテーブルが部品の親子関係を表現するストラクチャー型部品表であり、上記行番号対応表を作成するステップにおいて、最上位階層のテーブルとして、上記ツリー構造データのルートノードに対応する部品を選択し、その他の階層のテーブルとして同一の上記ストラクチャー型部品表を利用する。   According to an embodiment of the present invention, the plurality of tables is a structure-type parts table that expresses a parent-child relationship of parts, and in the step of creating the row number correspondence table, the tree structure is used as a top-level table. The part corresponding to the root node of the data is selected, and the same structure type parts table is used as the table of the other hierarchy.

本発明の一実施例によれば、上記行番号対応表を作成するステップにおいて、上記マッチングキーとして、上記親側のテーブルにおけるデータの出現順に割り当てられた順序番号と、上記子側のテーブルにおけるデータに対応する親側のデータに割り当てられた順序番号との対を利用する。   According to an embodiment of the present invention, in the step of creating the row number correspondence table, as the matching key, the sequence number assigned in the order of appearance of the data in the parent table and the data in the child table The pair with the sequence number assigned to the parent data corresponding to is used.

本発明の一実施例によれば、階層構造を有する複数のテーブルを記憶するメモリを備え、上記複数のテーブルを各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データに変換し上記メモリに格納するコンピュータに、
上記複数のテーブルを階層毎にマッチングキーによってマッチングさせる機能と、
上記複数のテーブルの階層毎に、マッチングした親側のテーブルと子側のテーブルとの間で、親子関係がある行番号同士の行番号対応表を作成する機能と、
上記行番号対応表から親子関係がある上記親側のテーブル中の行番号及び上記子側のテーブル中の行番号を探索する機能と、
探索によって見つけられた順に、上記子側のテーブル中の行に割り当てられる上記レコード順序番号を決定する機能と、
上記ツリー構造データが、各レコードがレコードの並び順を表す上記レコード順序番号によって識別される、仮想的なレコードの配列として上記メモリに構築されるように、上記仮想的なレコードの配列中の上記レコード順序番号によって識別される位置に、親子関係フィールド値として上記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、上記ノードの属性名フィールド値として上記子側のテーブル中の行に属する項目名を格納し、上記ノードの属性値フィールド値として上記子側のテーブル中の行に属する項目値を格納する機能と、
を実現させるためのプログラムが提供される。
According to an embodiment of the present invention, a memory for storing a plurality of tables having a hierarchical structure is provided, and the plurality of tables are converted into tree structure data composed of a plurality of nodes each represented by an attribute name and an attribute value. To a computer that converts and stores it in the memory,
A function of matching the plurality of tables with a matching key for each hierarchy;
A function for creating a row number correspondence table between row numbers having a parent-child relationship between the matched parent table and child table for each of the plurality of table hierarchies;
A function for searching for a row number in the parent table and a row number in the child table having a parent-child relationship from the row number correspondence table;
A function for determining the record sequence numbers assigned to the rows in the child table in the order found in the search;
In the virtual record array, the tree structure data is constructed in the memory as a virtual record array, wherein each record is identified by the record sequence number representing the order of the records. In the position identified by the record sequence number, the record sequence number of the parent node of the node corresponding to the row in the child side table is stored as the parent-child relationship field value, and the child side attribute name field value is stored in the child side as the attribute name field value. A function for storing item names belonging to rows in the table and storing item values belonging to rows in the child table as attribute value field values of the nodes;
A program for realizing the above is provided.

本発明の一実施例によれば、上記プログラムは、上記ノードの属性名フィールド値が上記レコード順序番号の順番に格納されている配列から、上記レコード順序番号の順に上記属性名を一意に特定する属性名番号が格納されている属性名番号配列、上記属性名番号配列の要素の順番に上記属性名番号によって一意に特定される上記属性名が格納されている属性名配列、上記レコード順序番号の順に上記属性値を一意に特定する属性値番号が格納されている属性値番号配列、及び、上記属性値番号配列の要素の順番に上記属性値番号によって一意に特定される上記属性値が格納されている属性値配列を作成する機能を上記コンピュータさらに実現させる。   According to an embodiment of the present invention, the program uniquely identifies the attribute names in the order of the record order numbers from an array in which the attribute name field values of the nodes are stored in the order of the record order numbers. An attribute name number array storing attribute name numbers, an attribute name array storing the attribute names uniquely specified by the attribute name numbers in the order of the elements of the attribute name number array, and the record sequence number An attribute value number array storing attribute value numbers that uniquely identify the attribute values in order, and the attribute values uniquely specified by the attribute value numbers are stored in the order of the elements of the attribute value number array. The above-mentioned computer further realizes the function of creating the attribute value array.

本発明の一実施例によれば、上記複数のテーブルが部品の親子関係を表現するストラクチャー型部品表であり、上記プログラムは、最上位階層のテーブルとして、上記ツリー構造データのルートノードに対応する部品を選択し、その他の階層のテーブルとして同一の上記ストラクチャー型部品表を利用する機能を上記コンピュータにさらに実現させる。   According to an embodiment of the present invention, the plurality of tables is a structure-type parts table that represents a parent-child relationship of parts, and the program corresponds to a root node of the tree structure data as a top-level table. A function of selecting a part and using the same structure-type parts table as a table of another hierarchy is further realized in the computer.

本発明の一実施例によれば、上記プログラムは、上記マッチングキーとして、上記親側のテーブルにおけるデータの出現順に割り当てられた順序番号と、上記子側のテーブルにおけるデータに対応する親側のデータに割り当てられた順序番号との対を利用する機能を上記コンピュータにさらに実現させる。   According to an embodiment of the present invention, the program uses, as the matching key, a sequence number assigned in the order of appearance of data in the parent table and parent data corresponding to the data in the child table. The computer is further realized with a function of using a pair with the sequence number assigned to the computer.

本発明の一実施例によれば、上記プログラムを記録したコンピュータ読み取り可能な記録媒体が提供される。   According to one embodiment of the present invention, a computer-readable recording medium on which the above program is recorded is provided.

本発明の一実施例によれば、階層構造を有する複数のテーブルを記憶するメモリを備え、上記複数のテーブルを各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データに変換し上記メモリに格納するコンピュータに、
上記複数のテーブルを階層毎にマッチングキーによってマッチングさせる機能と、
上記複数のテーブルの階層毎に、マッチングした親側のテーブルと子側のテーブルとの間で、親子関係がある行番号同士の行番号対応表を作成する機能と、
上記行番号対応表から親子関係がある上記親側のテーブル中の行番号及び上記子側のテーブル中の行番号を探索する機能と、
探索によって見つけられた順に、上記子側のテーブル中の行に割り当てられるレコード順序番号を決定する機能と、
上記ツリー構造データが、各レコードがレコードの並び順を表す上記レコード順序番号によって識別される、仮想的なレコードの配列として上記メモリに構築されるように、上記仮想的なレコードの配列中の上記レコード順序番号によって識別される位置に、親子関係フィールド値として上記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、上記ノードの属性名フィールド値として上記子側のテーブル中の行に属する項目名を格納し、上記ノードの属性値フィールド値として上記子側のテーブル中の行に属する項目値を格納する機能と、
を実現させるためのプログラムプロダクトが提供される。
According to an embodiment of the present invention, a memory for storing a plurality of tables having a hierarchical structure is provided, and the plurality of tables are converted into tree structure data composed of a plurality of nodes each represented by an attribute name and an attribute value. To a computer that converts and stores it in the memory,
A function of matching the plurality of tables with a matching key for each hierarchy;
A function for creating a row number correspondence table between row numbers having a parent-child relationship between the matched parent table and child table for each of the plurality of table hierarchies;
A function for searching for a row number in the parent table and a row number in the child table having a parent-child relationship from the row number correspondence table;
A function for determining a record sequence number assigned to a row in the child table in the order found in the search;
In the virtual record array, the tree structure data is constructed in the memory as a virtual record array, wherein each record is identified by the record sequence number representing the order of the records. In the position identified by the record sequence number, the record sequence number of the parent node of the node corresponding to the row in the child side table is stored as the parent-child relationship field value, and the child side attribute name field value is stored in the child side as the attribute name field value. A function for storing item names belonging to rows in the table and storing item values belonging to rows in the child table as attribute value field values of the nodes;
A program product for realizing the above is provided.

本発明の一実施例によれば、各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データを記録したコンピュータ読み取り可能な記録媒体であって、
上記ツリー構造データは、各レコードがレコードの並び順を表すレコード順序番号によって識別される、仮想的なレコードの配列によって表現され、
レコードは、上記レコードに対応するノードの親ノードのレコード順序番号を格納する親子関係フィールドと、上記ノードに属する属性名を指定する属性名番号を格納する属性名フィールドと、上記ノードに属する属性値を指定する属性値番号を格納する属性値フィールドとを含み、
上記ノードの親ノードが上記ノードに対応する上記レコードに含まれる上記親子関係フィールドに格納されている上記レコード順序番号によって特定され、
上記ノードに属する属性名が上記ノードに対応する上記レコードに含まれる上記属性名番号と上記属性名が上記属性名番号の順番に格納されている属性名配列とによって特定され、
上記ノードに属する属性値が上記ノードに対応する上記レコードに含まれる上記属性値番号と上記属性値が上記属性名番号の順番に格納されている属性値配列とによって特定される、
コンピュータ読み取り可能な記録媒体が提供される。
According to an embodiment of the present invention, there is provided a computer-readable recording medium on which tree structure data including a plurality of nodes each represented by an attribute name and an attribute value is recorded.
The tree structure data is represented by a virtual array of records, each record being identified by a record sequence number representing the order of the records.
The record includes a parent-child relationship field that stores a record sequence number of a parent node of a node corresponding to the record, an attribute name field that stores an attribute name number that specifies an attribute name that belongs to the node, and an attribute value that belongs to the node An attribute value field for storing an attribute value number for specifying
The parent node of the node is identified by the record sequence number stored in the parent-child relationship field included in the record corresponding to the node,
The attribute name belonging to the node is specified by the attribute name number included in the record corresponding to the node and the attribute name array in which the attribute name is stored in the order of the attribute name number,
The attribute value belonging to the node is specified by the attribute value number included in the record corresponding to the node and the attribute value array in which the attribute value is stored in the order of the attribute name number;
A computer readable recording medium is provided.

本発明の一実施例によれば、上記レコード順序番号は、深さ優先探索又は幅優先探索の順で上記複数のノードのうちの各ノードに対応する上記レコードに割り当てられている。   According to an embodiment of the present invention, the record order number is assigned to the record corresponding to each of the plurality of nodes in the order of depth-first search or width-first search.

本発明の少なくとも1つの実施例によれば、ツリー構造データを解釈するための比較操作が削減され、メモリ使用量が削減され、ツリー構造の更新時に書き換えるべきデータ量が削減され、事前のデータ構造の定義を不要とするようなツリー構造データの構築が可能になる。   According to at least one embodiment of the present invention, the comparison operation for interpreting the tree structure data is reduced, the memory usage is reduced, the amount of data to be rewritten when the tree structure is updated is reduced, and the prior data structure is reduced. It is possible to construct tree structure data that eliminates the need to define

図1は、本発明の一実施形態によるツリー構造データを処理するコンピュータシステムのハードウェア構成を示すブロック図である。FIG. 1 is a block diagram showing a hardware configuration of a computer system that processes tree structure data according to an embodiment of the present invention. 図2は、ツリー構造データの例におけるノードの階層関係を示す図である。FIG. 2 is a diagram illustrating the hierarchical relationship of nodes in an example of tree structure data. 図3Aは、本発明の一実施形態によるツリー構造データを記述する深さ優先によるデータ表現形式の説明図である。図3Bは、本発明の一実施形態によるツリー構造データを記述する幅優先によるデータ表現形式の説明図である。FIG. 3A is an explanatory diagram of a data representation format with depth priority describing tree structure data according to an embodiment of the present invention. FIG. 3B is an explanatory diagram of a data representation format with breadth priority describing tree structure data according to an embodiment of the present invention. 図4Aは、本発明の一実施形態によるツリー構造データを記述する値が分離されたデータ表現形式の説明図である。図4Bは、本発明の一実施形態によるツリー構造データを記述する情報ブロック型のデータ表現形式の説明図である。FIG. 4A is an explanatory diagram of a data representation format in which values describing tree structure data according to an embodiment of the present invention are separated. FIG. 4B is an explanatory diagram of an information block type data representation format describing tree structure data according to an embodiment of the present invention. 図5は、情報ブロックに基づくデータ管理機構を説明するための表形式データの一例を表す図である。FIG. 5 is a diagram illustrating an example of tabular data for explaining a data management mechanism based on information blocks. 図6は、情報ブロック型のデータ表現形式の説明図である。FIG. 6 is an explanatory diagram of an information block type data representation format. 図7は、ストラクチャー型部品表の一例の説明図である。FIG. 7 is an explanatory diagram of an example of a structure-type parts table. 図8は、ストラクチャー型部品表に埋め込まれている階層関係を示す図である。FIG. 8 is a diagram showing the hierarchical relationship embedded in the structure-type parts table. 図9は、ストラクチャー型部品表から作成された中間データと中間データ間のレコードの対応関係を示す図である。FIG. 9 is a diagram showing the correspondence between the intermediate data created from the structure-type parts table and the records between the intermediate data. 図10Aは、ストラクチャー型部品表から生成された深さ優先形式によるツリー構造データの一例の説明図である。図10Bは、ストラクチャー型部品表から生成された幅優先形式によるツリー構造データの一例の説明図である。FIG. 10A is an explanatory diagram of an example of tree structure data in a depth-first format generated from a structure-type parts table. FIG. 10B is an explanatory diagram of an example of tree structure data in a width-first format generated from the structure-type parts table. 図11Aは、ストラクチャー型部品表から生成された深さ優先形式によるツリー構造データ(情報ブロック型)の一例の説明図である。図11Bは、ストラクチャー型部品表から生成された幅優先形式によるツリー構造データ(情報ブロック型)の一例の説明図である。FIG. 11A is an explanatory diagram of an example of tree structure data (information block type) in a depth-first format generated from a structure-type parts table. FIG. 11B is an explanatory diagram of an example of tree structure data (information block type) in a width-first format generated from a structure-type parts table. 図12Aは、ツリー構造データを記述する複数のテーブルの一例の説明図である。図12Bは、複数のテーブルで記述されたツリー構造データの階層関係を示す図である。FIG. 12A is an explanatory diagram of an example of a plurality of tables describing tree structure data. FIG. 12B is a diagram illustrating a hierarchical relationship of tree structure data described in a plurality of tables. 図13Aは、本発明の一実施形態によるレコード番号対応表の作成処理の説明図である。図13Bは、本発明の一実施形態によるレコード番号対応表の作成処理の説明図である。FIG. 13A is an explanatory diagram of record number correspondence table creation processing according to an embodiment of the present invention. FIG. 13B is an explanatory diagram of record number correspondence table creation processing according to an embodiment of the present invention. 図14Aは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図14Bは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図14Cは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。FIG. 14A is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. FIG. 14B is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. FIG. 14C is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. 図15Aは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図15Bは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図15Cは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。FIG. 15A is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. FIG. 15B is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. FIG. 15C is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. 図16Aは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図16Bは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図16Cは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。FIG. 16A is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. FIG. 16B is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. FIG. 16C is an explanatory diagram of a tree structure data generation process based on the depth priority method according to an embodiment of the present invention. 図17Aは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図17Bは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図17Cは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。FIG. 17A is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. FIG. 17B is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. FIG. 17C is an explanatory diagram of a tree structure data generation process based on the depth priority method according to an embodiment of the present invention. 図18Aは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図18Bは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図18Cは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。FIG. 18A is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. FIG. 18B is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. FIG. 18C is an explanatory diagram of a tree structure data generation process based on the depth priority method according to an embodiment of the present invention. 図19Aは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図19Bは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図19Cは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。FIG. 19A is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. FIG. 19B is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. FIG. 19C is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. 図20Aは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図20Bは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。図20Cは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図である。FIG. 20A is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. FIG. 20B is an explanatory diagram of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention. FIG. 20C is an explanatory diagram of tree structure data generation processing based on the depth priority scheme according to an embodiment of the present invention. 図21Aは、統合されたツリー構造データを示す図である。図21Bは、値リストが分離されたツリー構造データを示す図である。図21Cは、情報ブロック型のツリー構造データを示す図である。FIG. 21A is a diagram showing integrated tree structure data. FIG. 21B is a diagram showing tree structure data from which a value list is separated. FIG. 21C is a diagram showing information block type tree structure data. 図22は、本発明の一実施形態による情報ブロックに基づくデータ形式への変換処理の説明図である。FIG. 22 is an explanatory diagram of a conversion process to a data format based on an information block according to an embodiment of the present invention. 図23は、本発明の一実施形態による値リストの共通化処理の説明図である。FIG. 23 is an explanatory diagram of a value list sharing process according to an embodiment of the present invention. 図24は、本発明の一実施形態による項目値のリストを値番号と値リストに分離する処理の説明図である。FIG. 24 is an explanatory diagram of a process for separating a list of item values into a value number and a value list according to an embodiment of the present invention. 図25Aは、本発明の一実施形態によるジョインを利用するレコード番号対応表の作成処理の説明図である。図25Bは、本発明の一実施形態によるジョインを利用するレコード番号対応表の作成処理の説明図である。FIG. 25A is an explanatory diagram of a process of creating a record number correspondence table using a join according to an embodiment of the present invention. FIG. 25B is an explanatory diagram of a process of creating a record number correspondence table using a join according to an embodiment of the present invention. 図26Aは、本発明の一実施例によるジョインを利用するレコード番号対応表の作成処理の説明図である。図26Bは、本発明の一実施例によるジョインを利用するレコード番号対応表の作成処理の説明図である。FIG. 26A is an explanatory diagram of processing for creating a record number correspondence table using a join according to an embodiment of the present invention. FIG. 26B is an explanatory diagram of a process for creating a record number correspondence table using a join according to an embodiment of the present invention. 図27は、本発明の一実施形態によるツリー構造データの生成処理を適用した結果の説明図である。FIG. 27 is an explanatory diagram of the result of applying the tree structure data generation processing according to an embodiment of the present invention. 図28は、本発明の他の実施形態によるツリー構造データの生成処理を適用した結果の説明図である。FIG. 28 is an explanatory diagram of the result of applying the tree structure data generation processing according to another embodiment of the present invention. 図29は、本発明の一実施形態による幅優先方式のツリー構造データ生成処理の説明図である。FIG. 29 is an explanatory diagram of a tree structure data generation process of the width priority method according to an embodiment of the present invention. 図30は、本発明の一実施形態による幅優先方式のツリー構造データ生成処理の説明図である。FIG. 30 is an explanatory diagram of the tree structure data generation processing of the width priority method according to an embodiment of the present invention. 図31は、本発明の一実施形態による幅優先方式のツリー構造データ生成処理の説明図である。FIG. 31 is an explanatory diagram of a tree structure data generation process of the width priority method according to an embodiment of the present invention. 図32は、本発明の一実施形態による幅優先方式のツリー構造データ生成処理の説明図である。FIG. 32 is an explanatory diagram of a tree structure data generation process of the width priority method according to an embodiment of the present invention. 図33は、本発明の一実施形態による幅優先方式のツリー構造データ生成処理の説明図である。FIG. 33 is an explanatory diagram of a tree structure data generation process of the width priority method according to an embodiment of the present invention. 図34は、本発明の一実施形態による幅優先方式のツリー構造データ生成処理の説明図である。FIG. 34 is an explanatory diagram of a tree structure data generation process of the width priority method according to an embodiment of the present invention. 図35は、本発明の一実施形態による幅優先方式のツリー構造データ生成処理を用いて生成された情報ブロック型ツリー構造データの説明図である。FIG. 35 is an explanatory diagram of information block type tree structure data generated using the tree structure data generation process of the breadth-first method according to an embodiment of the present invention. 図36は、本発明の一実施形態によるツリー構造データの生成処理を適用した結果の説明図である。FIG. 36 is an explanatory diagram of a result of applying the tree structure data generation processing according to the embodiment of the present invention. 図37は、本発明の他の実施形態によるツリー構造データの生成処理を適用した結果の説明図である。FIG. 37 is an explanatory diagram of the result of applying the tree structure data generation processing according to another embodiment of the present invention.

符号の説明Explanation of symbols

10 コンピュータシステム
12 CPU
14 RAM
16 ROM
18 ハードディスク
19 CD−ROM
20 CD−ROMドライバ
22 インタフェース
24 入力装置
26 表示装置
28 バス
10 Computer system 12 CPU
14 RAM
16 ROM
18 Hard disk 19 CD-ROM
20 CD-ROM driver 22 Interface 24 Input device 26 Display device 28 Bus

以下、本発明を実施するための種々の形態を図面と共に詳細に説明する。   Hereinafter, various embodiments for carrying out the present invention will be described in detail with reference to the drawings.

[コンピュータシステム構成]
図1は、本発明の一実施形態によるツリー構造データを処理するコンピュータシステムのハードウェア構成を示すブロック図である。図1に示すように、このコンピュータシステム10は、通常のコンピュータシステムと同様の構成であり、プログラムを実行することによりシステム全体および個々の構成部分を制御するCPU12と、ワークデータなどを記憶するRAM(Random Access Memory)14と、プログラム等を記憶するROM(Read Only Memory)16と、ハードディスク等の固定記憶装置18と、CD−ROM19を駆動するためのCD−ROMドライバ20と、CD−ROMドライバ20や外部ネットワーク(図示せず)と接続された外部端子との間に設けられたインタフェース(I/F)22と、キーボードやマウスからなる入力装置24と、表示装置26とを備えている。CPU12、RAM14、ROM16、外部記憶装置18、I/F22、入力装置24および表示装置26は、バス28を介して相互に接続されている。
[Computer system configuration]
FIG. 1 is a block diagram showing a hardware configuration of a computer system that processes tree structure data according to an embodiment of the present invention. As shown in FIG. 1, a computer system 10 has a configuration similar to that of a normal computer system, and a CPU 12 that controls the entire system and individual components by executing a program, and a RAM that stores work data and the like. (Random Access Memory) 14, a ROM (Read Only Memory) 16 for storing programs, a fixed storage device 18 such as a hard disk, a CD-ROM driver 20 for driving a CD-ROM 19, and a CD-ROM driver 20 and an interface (I / F) 22 provided between an external terminal connected to an external network (not shown), an input device 24 including a keyboard and a mouse, and a display device 26. The CPU 12, RAM 14, ROM 16, external storage device 18, I / F 22, input device 24, and display device 26 are connected to each other via a bus 28.

本発明の一実施形態によるツリー構造データを処理するプログラムは、CD−ROM19に収容され、CD−ROMドライバ20によって読取られても良く、或いは、ROM16に予め記憶されていても良い。また、いったんCD−ROM19から読み出したものを、外部記憶装置18の所定の領域に記憶しておいても良い。或いは、上記プログラムは、ネットワーク(図示せず)、外部端子およびI/F22を経て外部から供給されるものであっても良い。   A program for processing tree structure data according to an embodiment of the present invention may be stored in the CD-ROM 19 and read by the CD-ROM driver 20 or may be stored in the ROM 16 in advance. Further, what is once read from the CD-ROM 19 may be stored in a predetermined area of the external storage device 18. Alternatively, the program may be supplied from the outside via a network (not shown), an external terminal, and the I / F 22.

また、本発明の一実施形態による情報処理装置は、コンピュータシステム10にツリー構造データを処理するプログラムを実行させることにより実現される。   An information processing apparatus according to an embodiment of the present invention is realized by causing the computer system 10 to execute a program for processing tree structure data.

なお、以下の説明では、特に断らない限り、本発明の種々の実施形態は、コンピュータシステムの環境で実施され、動作の主体は、プログラム命令等のソフトウェアを実行するCPU等のプロセッサ、専用ハードウェア、又は、ファームウェア、或いは、それらの組み合わせである。   In the following description, unless otherwise specified, various embodiments of the present invention are implemented in the environment of a computer system, and the main operation is a processor such as a CPU that executes software such as program instructions, and dedicated hardware. Or firmware or a combination thereof.

[ツリー構造データのデータ表現形式]
最初に、本発明の一実施形態によるツリー構造データのデータ表現形式を説明する。以下の説明では、一例として、XML形式では、
<Story>Harry Potter
<Family>Potter
<Name>James</Name>
<Name>Lily</Name>
<Name>Harry</Name>
</Family>
<Family>Black
<Name>Sirius</Name>
</Family>
</Story>
と記述されるツリー構造データの例を考える。このXMLテキストの1行目は、属性名=Storyと属性値=Harry Potterとからなる属性を定義している。2行目は、属性名=Familyと属性値=Potterとからなる属性を定義している。
[Data representation format of tree structure data]
First, a data representation format of tree structure data according to an embodiment of the present invention will be described. In the following description, as an example, in the XML format,
<Story> Harry Potter
<Family> Potter
<Name> James <// Name>
<Name> Lily <// Name>
<Name> Harry <// Name>
</ Family>
<Family> Black
<Name> Sirius <// Name>
</ Family>
</ Story>
Consider an example of tree structure data described as The first line of the XML text defines an attribute including attribute name = Story and attribute value = Harry Potter. The second line defines an attribute including attribute name = Family and attribute value = Potter.

図2はこのツリー構造データの例におけるノードの階層関係を示す図である。同図によれば、ルートノードは、属性名:属性値=Story:Harry Potterという属性を保有するノードであり、ルートノードには、Family:Potterという属性を保有する子ノードと、Family:Blackという属性を保有する子ノードとが存在することがわかる。さらに、ノードFamily:Potterには、子ノードName:Jamesと、子ノードName:Lilyと、子ノードName:Harryとが存在する。一方、ノードFamily:Blackには、子ノードName:Siriusが存在する。ここで、ノードは、ノード属性名:属性値という表記によって指定されている。   FIG. 2 is a diagram showing the hierarchical relationship of nodes in this tree structure data example. According to the figure, the root node is a node having an attribute name: attribute value = Story: Harry Potter, and the root node has a child node having an attribute of Family: Potter and a family: Black. It can be seen that there are child nodes having attributes. Further, in the node Family: Potter, there are a child node Name: James, a child node Name: Lily, and a child node Name: Harry. On the other hand, a child node Name: Sirius exists in the node Family: Black. Here, the node is designated by the notation of node attribute name: attribute value.

図3は、本発明の一実施形態によるツリー構造データを記述するデータ表現形式の説明図である。特に、図3Aは、図2に示されたツリー構造データの例における深さ優先でのデータ表現形式を示し、図3Bは幅優先でのデータ表現形式を示している。   FIG. 3 is an explanatory diagram of a data representation format describing tree structure data according to an embodiment of the present invention. In particular, FIG. 3A shows a data representation format with depth priority in the example of the tree structure data shown in FIG. 2, and FIG. 3B shows a data representation format with width priority.

ここで、深さ優先方式と幅優先方式について簡単に説明する。たとえば、図2のツリー構造データのノードをルートノードから順番に深さ優先方式で探索し、見つけられた順番にノードにノード識別子を付与する場合を考える。このとき、各ノードに付与されるノード識別子は、ルートノードのノード識別子を0とすると、
ノードStory:Harry Potterのノード識別子=0
ノードFamily:Potterのノード識別子=1
ノードName:Jamesのノード識別子=2
ノードName:Lilyのノード識別子=3
ノードName:Harryのノード識別子=4
ノードFamily:Blackのノード識別子=5
ノードName:Siriusのノード識別子=6
となる。一方、図2のツリー構造データのノードを幅優先方式で探索し、同様に、ノードにノード識別子を付与すると、
ノードStory:Harry Potterのノード識別子=0
ノードFamily:Potterのノード識別子=1
ノードName:Jamesのノード識別子=3
ノードName:Lilyのノード識別子=4
ノードName:Harryのノード識別子=5
ノードFamily:Blackのノード識別子=2
ノードName:Siriusのノード識別子=6
となる。すなわち、深さ優先探索とは、同じ世代のノードより子ノードを優先するノード探索を表し、幅優先探索とは、子ノードより同じ世代のノードを優先するノード検索を表している。このようなツリー構造データの記述法は特許文献3に記載されている。
Here, the depth priority method and the width priority method will be briefly described. For example, consider a case where the nodes of the tree structure data in FIG. 2 are searched in a depth-first order from the root node, and node identifiers are assigned to the nodes in the order found. At this time, if the node identifier given to each node is 0 as the node identifier of the root node,
Node Story: Node identifier of Harry Potter = 0
Node Family: Potter node identifier = 1
Node Name: James node identifier = 2
Node Name: Node identifier of Lily = 3
Node Name: Node identifier of Harry = 4
Node Family: Black node identifier = 5
Node Name: Sirius node identifier = 6
It becomes. On the other hand, when the node of the tree structure data in FIG.
Node Story: Node identifier of Harry Potter = 0
Node Family: Potter node identifier = 1
Node Name: Node identifier of James = 3
Node Name: Node identifier of Lily = 4
Node Name: Node identifier of Harry = 5
Node Family: Black node identifier = 2
Node Name: Sirius node identifier = 6
It becomes. That is, the depth-first search represents a node search that gives priority to child nodes over the same generation node, and the breadth-first search represents a node search that gives priority to nodes of the same generation over child nodes. The description method of such tree structure data is described in Patent Document 3.

ここで、本明細書中での配列の記法について説明する。一般に、配列Aは、添字をiとすると、配列の要素がA[i]のように表記できるが、図面中では、配列は、配列の要素A[i]は、実線で囲まれた領域内に示され、要素A[i]と要素A[i+1]の境界は点線で示されている。また、要素A[i]の添字iが要素A[i]の左側に示されている。また、配列の添字iは0から始まる整数で表されている。   Here, the notation of the arrangement | sequence in this specification is demonstrated. In general, an array element A can be expressed as A [i], where i is a subscript. However, in the drawing, an array element A [i] is within a region surrounded by a solid line. The boundary between the element A [i] and the element A [i + 1] is indicated by a dotted line. The subscript i of element A [i] is shown on the left side of element A [i]. Further, the subscript i of the array is represented by an integer starting from 0.

図3A、Bを再び参照すると、ツリー構造データは、1個のレコードが1個のノードに対応し、各レコードがレコードの並び順を表すレコード順序番号によって識別される、レコードの配列によって表現されている。なお、ノードとレコードが1対1で対応しているので、レコード順序番号は上述のノード識別子と一致している。   Referring back to FIGS. 3A and 3B, the tree structure data is represented by an array of records where one record corresponds to one node and each record is identified by a record sequence number representing the order of the records. ing. Since the node and the record have a one-to-one correspondence, the record sequence number matches the node identifier described above.

レコードは、レコードに対応するノードの親ノードのレコード順序番号を格納する親子関係フィールドTopologyと、当該ノードに属する属性名を指定する属性名フィールドTitleと、当該ノードに属する属性値を指定する属性値フィールドValueとを含む。たとえば、レコード順序番号=iであるレコードRecord[i]の各フィールドの要素は、Topology[i]、Title[i]及びValue[i]によって表される。   The record includes a parent-child relationship field Topology that stores the record order number of the parent node of the node corresponding to the record, an attribute name field Title that specifies an attribute name that belongs to the node, and an attribute value that specifies an attribute value that belongs to the node Field Value. For example, the element of each field of record Record [i] with record sequence number = i is represented by Topology [i], Title [i], and Value [i].

深さ優先による図3Aの例では、レコード順序番号=0のレコードの各フィールドの要素は、
Topology[0]=−1
Title[0]=Story
Value[0]=Harry Potter
となる。親子関係フィールドTopologyに、レコード順序番号として存在しない値、たとえば、−1が格納されているレコードは、このレコードが親ノードの存在しないノードに対応していること示している。よって、レコード順序番号=0のレコードはルートノードに対応し、ルートノードの属性名がStoryであり、属性値がHarry Potterであることもわかる。
In the example of FIG. 3A with depth priority, the element of each field of the record with the record sequence number = 0 is
Topology [0] =-1
Title [0] = Story
Value [0] = Harry Potter
It becomes. A record in which a value that does not exist as a record sequence number, for example, -1, is stored in the parent-child relationship field Topology indicates that this record corresponds to a node that does not have a parent node. Therefore, it can also be seen that the record with the record order number = 0 corresponds to the root node, the attribute name of the root node is Story, and the attribute value is Harry Potter.

さらに、図3Aの例において、レコード順序番号=3のレコードの各フィールドの要素は、
Topology[3]=1
Title[3]=Name
Value[3]=Lily
である。よって、このレコードは、親ノードのレコード順序番号が1であるノードに対応し、かつ、ノードの属性名=Name、ノードの属性値=Lilyであることを示している。当該ノードの親ノードは、レコード順序番号=1のレコードに対応するノード、すなわち、親ノードのレコード順序番号=0、ノードの属性名=Family、かつ、ノードの属性値=Potterを保有するノードであることがわかる。
Furthermore, in the example of FIG. 3A, the element of each field of the record of record sequence number = 3 is
Topology [3] = 1
Title [3] = Name
Value [3] = Lily
It is. Therefore, this record corresponds to the node whose record order number of the parent node is 1, and indicates that the node attribute name = Name and the node attribute value = Lily. The parent node of the node is a node corresponding to the record of record order number = 1, that is, a node having a record order number of the parent node = 0, a node attribute name = Family, and a node attribute value = Potter I know that there is.

一方、幅優先による図3Bの例においても、たとえば、レコード順序番号=6のレコードの各フィールドの要素は、
Topology[6]=2
Title[6]=Name
Value[6]=Sirius
である。よって、このレコードは、親ノードのレコード順序番号が2であるノードに対応し、かつ、ノードの属性名=Name、ノードの属性値=Siriusであることを示している。当該ノードの親ノードは、レコード順序番号=2のレコードに対応するノード、すなわち、親ノードのレコード順序番号=0、ノードの属性名=Family、かつ、ノードの属性値=Blackを保有するノードであることがわかる。
On the other hand, also in the example of FIG. 3B by width priority, for example, the element of each field of the record of record sequence number = 6 is
Topology [6] = 2
Title [6] = Name
Value [6] = Sirius
It is. Therefore, this record corresponds to the node whose record order number of the parent node is 2, and indicates that the node attribute name = Name and the node attribute value = Sirius. The parent node of the node is a node corresponding to the record of record order number = 2, that is, a node having a record order number of the parent node = 0, a node attribute name = Family, and a node attribute value = Black. I know that there is.

このように、本発明の一実施形態によるツリー構造データを記述するデータ表現形式は、1つの表に統合されているので、非常に操作性に優れ、新しいツリーの追加又はツリーの削除に柔軟に対応し、データ編集の自由度が高い。   As described above, the data representation format for describing the tree structure data according to the embodiment of the present invention is integrated into one table, so that it is very easy to operate and flexible for adding a new tree or deleting a tree. Corresponding, the freedom of data editing is high.

ここで、図3A及び3Bに示されているツリー構造データを記述するレコードの配列は、メモリ等の記憶装置上にこのままの形式で、すなわち、配列Topology、配列Title及び配列Valueとして記憶されている必要はなく、このレコードの配列を実質的に表現可能であればどのような表現でも構わない。このようにレコードの配列を等価的に表現できるデータは、本書中では、「仮想的な」レコードの配列と呼ばれることがある。   Here, the array of records describing the tree structure data shown in FIGS. 3A and 3B is stored in the same format on the storage device such as a memory, that is, as an array Topology, an array Title, and an array Value. There is no need, and any representation can be used as long as the array of records can be substantially represented. Data that can equivalently represent an array of records in this way is sometimes referred to as a “virtual” record array in this document.

たとえば、レコードは、当該レコードに対応するノードの親ノードのレコード順序番号を格納する親子関係フィールドと、当該ノードに属する属性名を指定する属性名番号を格納する属性名フィールドと、当該ノードに属する属性値を指定する属性値番号を格納する属性値フィールドとによって定義することができる。そして、当該ノードの親ノードが当該ノードに対応するレコードに含まれる親子関係フィールドに格納されているレコード順序番号によって特定され、当該ノードに属する属性名が当該ノードに対応するレコードに含まれる属性名番号と属性名が属性名番号の順番に格納されている属性名配列とによって特定され、当該ノードに属する属性値が当該ノードに対応するレコードに含まれる属性値番号と属性値が属性名番号の順番に格納されている属性値配列とによって特定されるように構成することが可能である。   For example, a record belongs to a parent-child relationship field that stores the record order number of the parent node of the node corresponding to the record, an attribute name field that stores an attribute name number that specifies an attribute name that belongs to the node, and the node It can be defined by an attribute value field that stores an attribute value number that specifies an attribute value. Then, the parent node of the node is identified by the record sequence number stored in the parent-child relationship field included in the record corresponding to the node, and the attribute name belonging to the node is included in the record corresponding to the node Number and attribute name are stored in the attribute name array stored in the order of attribute name number, and the attribute value number and attribute value included in the record corresponding to the node are attribute value numbers belonging to the node. It can be configured to be specified by the attribute value array stored in order.

これは、属性名や属性値のような値を、値リストVLと値リストへのポインタ配列VNoとの組み合わせによって表現する考え方に基づいている。値リストVLと値リストへのポインタ配列との組み合わせは「情報ブロック」とも呼ばれ、特許文献4において提案されている概念である。   This is based on the idea of expressing values such as attribute names and attribute values by a combination of a value list VL and a pointer array VNo to the value list. The combination of the value list VL and the pointer array to the value list is also called an “information block” and is a concept proposed in Patent Document 4.

図4A、Bは、この情報ブロックの概念を導入することにより記憶装置上に構築された、本発明の一実施形態によるツリー構造データのデータ表現形式の説明図である。同図の例は、深さ優先方式に従っている。図4Aは、属性名Titleが属性名番号配列Title_VNoと属性名配列Title_VLとに分離され、属性値Valueが属性値番号配列Value_VNoと属性値配列Value_VLとに分離されたデータ表現形式の説明図であり、図4Bは図4Aの表現形式に基づいて導出された情報ブロック型のデータ表現形式の説明図である。たとえば、レコード順序番号iを指定すると、親子関係フィールドの値は、Topology[i]によって特定され、属性名は、Title_VL[Title_VNo[i]]によって特定され、属性値は、Value_VL[Value_VNo[i]]によって特定されることがわかるであろう。   4A and 4B are explanatory diagrams of a data representation format of tree structure data constructed on a storage device by introducing the concept of this information block according to an embodiment of the present invention. The example in the figure follows the depth priority method. FIG. 4A is an explanatory diagram of a data expression format in which an attribute name Title is separated into an attribute name number array Title_VNo and an attribute name array Title_VL, and an attribute value Value is separated into an attribute value number array Value_VNo and an attribute value array Value_VL. 4B is an explanatory diagram of an information block type data representation format derived based on the representation format of FIG. 4A. For example, when the record order number i is specified, the value of the parent-child relationship field is specified by Topology [i], the attribute name is specified by Title_VL [Title_VNo [i]], and the attribute value is Value_VL [Value_VNo [i]. ] Will be understood.

[情報ブロックに基づくデータ管理機構]
図4A、Bのデータ表現形式がより良く理解されるように、情報ブロックに基づくデータ管理機構について簡単に説明する。
[Data management mechanism based on information blocks]
A data management mechanism based on information blocks will be briefly described so that the data representation format of FIGS. 4A and 4B can be better understood.

図5は情報ブロックに基づくデータ管理機構を説明するための表形式データの一例を表す図である。この表形式データは、上述の特許文献4に提案されたデータ管理機構を用いることにより、コンピュータ内では図6に示されるようなデータ構造として、メモリ(たとえばRAM14)に記憶される。このデータ構造は、市販されているコンピュータ、たとえば、パーソナルコンピュータのハードウェア資源、特に、プロセッサ及びメモリを使用して大規模な表形式データの検索、ソート、集計等を実現するために提案された、コンピュータのメモリ上に置かれる表形式データのデータ構造であることに注意すべきである。   FIG. 5 is a diagram showing an example of tabular data for explaining a data management mechanism based on information blocks. The tabular data is stored in a memory (for example, RAM 14) as a data structure as shown in FIG. 6 in the computer by using the data management mechanism proposed in Patent Document 4 described above. This data structure has been proposed to realize retrieval, sorting, aggregation, etc. of large-scale tabular data using hardware resources of commercially available computers, for example, personal computers, in particular, processors and memories. It should be noted that the data structure of tabular data placed on the computer memory.

なお、「元の表形式データ中でレコードが収容されている位置を表す情報レコード番号(すなわち、原始レコード位置番号)」と「レコードの並び順を表す情報(すなわち、レコード順序番号)」とは明確に区別されるべきである。すべてのレコードには原始レコード位置番号が関連付けられている。この原始レコード位置番号は、データ項目に対応した項目値を含む個々のレコードを特定するために利用される仮想的な情報である。一般に、表形式データは、レコードが常に原始レコード位置番号の順番に配列されているとは限らない。たとえば、元の表形式データをある項目の項目値に関して昇順にソートすると、得られる表形式データのレコードの並び順は元の表形式データのレコードの並び順とは異なる。但し、元々の表形式データ中のレコードは、レコードが原始レコード位置番号の順番に並べられていることがあり、この場合には、原始レコード位置番号とレコード順序番号とが初期的に一致している。   Note that “information record number representing the position in which the record is accommodated in the original tabular data (ie, the original record position number)” and “information representing the record order (ie, record order number)” It should be clearly distinguished. Every record has a source record position number associated with it. This primitive record position number is virtual information used for specifying individual records including item values corresponding to data items. In general, in the tabular data, records are not always arranged in the order of the original record position numbers. For example, when the original tabular data is sorted in ascending order with respect to the item value of a certain item, the order of the tabular data record obtained is different from the order of the original tabular data record. However, the records in the original tabular data may be arranged in the order of the source record position numbers. In this case, the source record position number and the record sequence number are initially matched. Yes.

図6に示すように、表形式データの各レコードの並び順の番号(レコード順序番号)と、原始レコード位置番号は、レコード順序指定配列601(以下、この配列を「OrdSet」のように略記する。)によって対応付けられる。レコード順序指定配列601は、レコード順序番号の順に原始レコード位置番号を格納している。図6の例では、レコードは原始レコード位置番号の順番に並べられている。   As shown in FIG. 6, the order number (record order number) of each record of the tabular data and the original record position number are abbreviated as a record order designation array 601 (hereinafter, this array is abbreviated as “OrdSet”). .). The record order specification array 601 stores source record position numbers in the order of record order numbers. In the example of FIG. 6, the records are arranged in the order of the original record position numbers.

図6を参照すると、性別に関しては、表形式データのレコード順序番号=0に対応する原始レコード位置番号は、配列OrdSet[0]から「0」であることがわかる。原始レコード位置番号が「0」であるレコードに関する実際の性別の値、即ち、「男」又は「女」は、実際の値が所定の順序(たとえば、昇順又は降順)に従ってソートされた値リストである項目値配列603(以下、項目値配列、すなわち、値リストを「VL」のように略記する。)へのポインタ配列である項目値番号配列602(以下、項目値番号配列、すなわち、ポインタ配列を「VNo」のように略記する。)を参照することによって取得できる。ポインタ配列602は、配列OrdSet601に格納されている原始レコード位置番号の順番に従って、実際の値リスト603中の要素を指し示すポインタを格納している。これにより、表形式データのレコード「0」に対応する性別の項目値は、(1)配列OrdSet601からレコード順序番号=0に対応する原始レコード位置番号=0を取り出し、(2)値リストへのポインタ配列602から原始レコード位置番号=0に対応する要素「1」を取り出し、(3)値リスト603から、値リストへのポインタ配列602から取り出された要素「1」によって指し示される要素「女」を取り出すことにより取得できる。   Referring to FIG. 6, regarding gender, it can be seen that the original record position number corresponding to the record order number = 0 of the tabular data is “0” from the array OrdSet [0]. The actual gender value for the record whose source record position number is “0”, ie, “male” or “female” is a value list in which the actual values are sorted according to a predetermined order (eg, ascending or descending order). An item value number array 602 (hereinafter, an item value number array, that is, a pointer array) that is a pointer array to a certain item value array 603 (hereinafter, an item value array, that is, a value list is abbreviated as “VL”). Is abbreviated as “VNo.”). The pointer array 602 stores pointers that point to elements in the actual value list 603 according to the order of the source record position numbers stored in the array OrdSet 601. As a result, the item value of the gender corresponding to the record “0” of the tabular data is (1) the original record position number = 0 corresponding to the record sequence number = 0 is extracted from the array OrdSet 601 and (2) is stored in the value list. The element “1” corresponding to the original record position number = 0 is extracted from the pointer array 602, and (3) the element “female” indicated by the element “1” extracted from the pointer array 602 to the value list is extracted from the value list 603. Can be obtained by taking out "".

他のレコードに対しても、また、年齢及び身長に関しても同様に項目値を取得することができる。   The item values can be acquired in the same manner for other records and also for age and height.

このように表形式データは、値リストVLと、値リストへのポインタ配列VNoの組合せにより表現され、この組合せを、特に、「情報ブロック」と称する。図6には、性別、年齢及び身長に関する情報ブロックがそれぞれ情報ブロック608、609及び610として示されている。   In this way, the tabular data is expressed by a combination of the value list VL and the pointer array VNo to the value list, and this combination is particularly referred to as an “information block”. In FIG. 6, information blocks relating to gender, age and height are shown as information blocks 608, 609 and 610, respectively.

単一のコンピュータが単一のメモリ(物理的には複数であっても良いが、単一のアドレス空間に配置されアクセスされるという意味で単一のメモリ)を有するならば、単一のコンピュータは、当該メモリに、順序集合の配列OrdSet、各情報ブロックを構成する値リストVLおよびポインタ配列VNoとを記憶しておけばよい。しかしながら、本発明の種々の実施形態では、表形式データの操作は、複数台の演算ユニットにより並列的に実行することも可能である。   If a single computer has a single memory (physically multiple, but a single memory in the sense that it is located and accessed in a single address space) May store the ordered set array OrdSet, the value list VL constituting each information block, and the pointer array VNo in the memory. However, in various embodiments of the present invention, the manipulation of tabular data can be performed in parallel by a plurality of arithmetic units.

[部品表(BOM)展開]
次に、生産管理システムにおける部品表(BOM)展開に関して本発明の一実施形態を説明する。以下の説明では、Car_Aという車とCar_Bという車の構成(又は、構成に対応した部品図番)が部品表の形で与えられている場合を考える。図7は、車の構成に関するストラクチャー型部品表の一例の説明図である。同図に示された部品表には、10組の親部品の図番(すなわち、親図番)と子部品の図番(すなわち、子図番)の対が格納されている。左端の0から9までの番号は、部品表のレコード番号を表している。部品表の親図番と子図番の対、すなわち、レコードは、このレコード番号によって識別される。たとえば、部品表の先頭行(すなわち、レコード番号=0のレコード)には、親図番=Car_Aと子図番=Body_1の対が格納されている。また、レコード番号=1のレコードには、親図番=Car_Aと子図番=Engine_1の対が格納されている。さらに、レコード番号=4、レコード番号=5及びレコード番号=6のレコードには、親図番=Body_1が格納されているので、それぞれの子図番は、Tire_1、Chassis_1及びDoor_1であることがわかる。このように、図7の部品表には、部品の階層関係が埋め込まれているので、特に、ストラクチャー型部品表とも呼ばれる。
[Parts list (BOM) expansion]
Next, an embodiment of the present invention will be described with respect to parts table (BOM) expansion in a production management system. In the following description, it is assumed that the configuration of the car Car_A and the car Car_B (or the part diagram number corresponding to the configuration) is given in the form of a parts table. FIG. 7 is an explanatory diagram of an example of a structure-type parts table relating to the configuration of the vehicle. In the parts table shown in the figure, pairs of figure numbers (that is, parent figure numbers) of 10 sets of parent parts and figure numbers (that is, child figure numbers) of child parts are stored. The numbers from 0 to 9 at the left end represent the record numbers of the parts table. A pair of a parent figure number and a child figure number in the BOM, that is, a record is identified by this record number. For example, a pair of parent figure number = Car_A and child figure number = Body_1 is stored in the first row of the parts table (that is, the record with record number = 0). Further, the record of record number = 1 stores a pair of parent figure number = Car_A and child figure number = Engine_1. Further, since the record number = 4, the record number = 5, and the record number = 6 store the parent figure number = Body_1, it can be seen that the respective child figure numbers are Tire_1, Chassis_1, and Door_1. . In this manner, the parts table in FIG. 7 is also called a structure-type parts table because the hierarchical relationship of the parts is embedded.

図8は図7の部品表に記述されている車の構成の階層関係を示す図である。本発明の一実施形態は、図7に示されている部品表(原データ)を、図8に示されているツリー構造データに変換(展開)する方法を提供する。この方法は、本発明の一実施形態では、図1に示されたコンピュータシステム10によって実行される。つまり、以下に述べる処理ステップは、コンピュータシステム10、特に、コンピュータシステム10中のCPU12により実行される。また、処理ステップにおいて生成されるデータ、表、配列は、それぞれ、メモリ(たとえば、RAM14)中に格納される。変換後のツリー構造データは、図3A、B又は図4A、Bを参照して説明したツリー構造データのデータ表現形式によって記述される。   FIG. 8 is a diagram showing a hierarchical relationship of the vehicle configuration described in the parts table of FIG. One embodiment of the present invention provides a method for converting (expanding) the parts table (original data) shown in FIG. 7 into the tree structure data shown in FIG. This method is performed by the computer system 10 shown in FIG. 1 in one embodiment of the invention. That is, the processing steps described below are executed by the computer system 10, particularly the CPU 12 in the computer system 10. Further, data, tables, and arrays generated in the processing steps are each stored in a memory (for example, RAM 14). The converted tree structure data is described in the data representation format of the tree structure data described with reference to FIGS. 3A and 3B or FIGS. 4A and 4B.

ステップ1:展開したいデータの指定
部品表自体は、親子関係を記述しているが、たとえば、深さ優先順又は幅優先順に整列されているとは限らない。したがって、部品表をツリー構造データに変換するために、最初に、展開したいデータ(ツリー構造データのルートノード)が指定される。展開したいデータは、たとえば、図1に示されたコンピュータシステム10のハードディスク18、入力装置24に予め記憶され、又は、CD−ROMドライバ20を介してCD−ROM19から供給され、又は、I/F22を介して外部端子から供給されるなどの様々な形で与えられる。コンピュータシステム10のCPU12は、何れかの形で与えられたデータを展開したいデータとして指定する。本例では、Car_Aをツリー構造データに変換する場合を考える。
Step 1: Designation of Data to be Expanded The parts table itself describes a parent-child relationship, but it is not always arranged in, for example, depth priority order or width priority order. Therefore, in order to convert the parts table into tree structure data, first, the data to be expanded (the root node of the tree structure data) is designated. The data to be expanded is stored in advance in the hard disk 18 and the input device 24 of the computer system 10 shown in FIG. 1, or supplied from the CD-ROM 19 via the CD-ROM driver 20, or the I / F 22 It is given in various forms such as being supplied from an external terminal via The CPU 12 of the computer system 10 designates data given in any form as data to be developed. In this example, consider the case where Car_A is converted into tree structure data.

ステップ2:展開したいデータの表の作成
次に、第1階層の中間データとして、展開したいデータの表が作成される。具体的には、項目名=展開指令、項目値=Car_Aという1個のレコード(レコード番号=0)からなる表が作成される。なお、中間データとして作成されるレコードは、レコード順序の入れ替えを想定する必要がないので、簡単のため、レコード順序番号がレコード番号と呼ばれることもある。また、項目名と項目値を併せて項目と呼ぶことがあるが、このとき、項目は項目名で区別される。よって、項目=展開指令という表記は、項目名=展開指令という項目を指している。
Step 2: Creation of a table of data to be expanded Next, a table of data to be expanded is created as intermediate data of the first hierarchy. Specifically, a table including one record (record number = 0) in which item name = development command and item value = Car_A is created. In addition, since it is not necessary to assume that the record order is changed for the record created as the intermediate data, the record order number is sometimes referred to as a record number for simplicity. In addition, the item name and the item value may be collectively referred to as an item. At this time, the item is distinguished by the item name. Therefore, the notation of item = expansion command indicates an item of item name = expansion command.

ステップ3:レコード番号対応表の作成(1回目)
第2階層の中間データとして、原データである部品表が準備される。そして、第1階層の中間データ(すなわち、親側のテーブル)と第2階層の中間データ(すなわち、子側のテーブル)との間で、共通化のためのキー項目(すなわち、マッチングキー)に関してマッチングが実行され、2つの階層間でレコード番号対応表が作成される。たとえば、第1階層の中間データ中のあるレコード(たとえば、レコードa)と、第2階層の中間データ中のあるレコード(たとえば、レコードb)が、当該キー項目に関して同一の項目値を有するならば、第1階層の中間データ中のレコードaと第2階層の中間データ中のレコードbの組み合わせがレコード番号対応表に登録される。なお、本書において、原データ又は中間データに含まれているレコードは、仮想的なレコード配列中のレコードと区別するために、「行」と呼ばれることがある。同様に、レコード番号が「行番号」と呼ばれ、レコード番号対応表が「行番号対応表」と呼ばれることがある。
Step 3: Create record number correspondence table (first time)
A parts table that is original data is prepared as intermediate data of the second hierarchy. The key item for sharing (ie, matching key) between the intermediate data of the first hierarchy (ie, the parent table) and the intermediate data of the second hierarchy (ie, the child table) Matching is executed, and a record number correspondence table is created between the two hierarchies. For example, if a certain record (for example, record a) in the intermediate data of the first hierarchy and a certain record (for example, record b) in the intermediate data of the second hierarchy have the same item value for the key item The combination of the record a in the intermediate data of the first hierarchy and the record b in the intermediate data of the second hierarchy is registered in the record number correspondence table. In this document, a record included in original data or intermediate data may be referred to as a “row” in order to distinguish it from a record in a virtual record array. Similarly, the record number may be referred to as a “line number”, and the record number correspondence table may be referred to as a “line number correspondence table”.

このようなマッチングの一例はジョインによって実現することが可能である。ジョインとは、たとえば、特許文献5に記載されているように、情報ブロックを用いて記述されている2個の表形式データの間で、等価な項目(すなわち、ジョインキー)を見出し、等価な項目に関する情報ブロックに含まれる値リストを比較し、両方の表形式データで参照される値リストを共通化する技術である。ジョインを使ってレコード番号対応表を作成する方法は後述されている。   An example of such matching can be realized by a join. For example, as described in Patent Document 5, an equivalent item (that is, a join key) is found between two tabular data described using an information block, and the equivalent is equivalent. This is a technique for comparing value lists included in an information block relating to an item, and sharing a value list referenced by both tabular data. A method of creating a record number correspondence table using a join will be described later.

本例では、第1階層の中間データの項目=展開指令と、第2階層の中間データの項目=親図番が共通化のためのキー項目として選択される。第1階層の中間データのレコード番号=0のレコード(以下では、簡単のため、レコード番号=NのレコードをレコードNと表記することがある)には、項目値=Car_Aが格納されている。一方、第2階層の中間データの項目=親図番に項目値=Car_Aが格納されているレコードは、レコード0及びレコード1であることがわかる。よって、第1階層の中間データと第2階層の中間データとの間に、
0 → 0,1
というレコード番号対応表が作成される。
In this example, the intermediate data item of the first hierarchy = development command and the intermediate data item of the second hierarchy = the parent figure number are selected as key items for sharing. An item value = Car_A is stored in the record of record number = 0 of the intermediate data in the first layer (hereinafter, for the sake of simplicity, the record of record number = N may be expressed as record N). On the other hand, it can be seen that the records in which the item value = Car_A is stored in the intermediate data item of the second hierarchy = the parent figure number are the record 0 and the record 1. Therefore, between the intermediate data of the first hierarchy and the intermediate data of the second hierarchy,
0 → 0, 1
The record number correspondence table is created.

ステップ4:レコード番号対応表の作成(2回目)
レコード番号対応表は、共通化のためのキー項目に関して項目値が一致するレコードが存在しなくなるまで続けられる。具体的には、ステップ3において作成されたレコード番号対応表に出現した第2階層の中間データのレコード0及びレコード1に関して、さらに親子関係のあるデータが存在するかどうかが調べられる。本例では、第3階層の中間データとして、原データである部品表がさらに準備される。部品表展開の場合、中間データとして原データが繰り返し利用される。なぜならば、ストラクチャー型部品表は、1つの表の中に階層関係が埋め込まれているからである。第2階層の中間データと第3階層の中間データとの間では、第2階層の中間データの項目=子図番と第3階層の中間データの項目=親図番が共通化のためのキー項目として選択される。
Step 4: Create record number correspondence table (second time)
The record number correspondence table is continued until there is no record having the same item value for the key item for sharing. More specifically, it is checked whether or not there is further data having a parent-child relationship with respect to the record 0 and the record 1 of the intermediate data in the second hierarchy appearing in the record number correspondence table created in step 3. In this example, a parts table that is original data is further prepared as intermediate data in the third hierarchy. In the case of parts list expansion, original data is repeatedly used as intermediate data. This is because the structure type parts table has a hierarchical relationship embedded in one table. Between the intermediate data of the second hierarchy and the intermediate data of the third hierarchy, the intermediate data item of the second hierarchy = the child figure number and the intermediate data item of the third hierarchy = the parent figure number is a key for sharing Selected as an item.

第2階層の中間データのレコード0の項目=子図番は、項目値=Body_1であり、レコード1の項目=子図番は、項目値=Engine_1である。一方、第3階層の中間データ、すなわち、原データである部品表の項目=親図番に項目値=Body_1が格納されているレコードは、レコード4、レコード5及びレコード6である。また、第3階層の中間データ、すなわち、原データである部品表の項目=親図番に項目値=Engine_1が格納されているレコードは存在しない。よって、第2階層の中間データと第3階層の中間データとの間に、
0 → 4,5,6
1 →
というレコード番号対応表が作成される。
The item = child figure number of record 0 of the intermediate data in the second hierarchy is item value = Body_1, and the item of record 1 = child figure number is item value = Engine_1. On the other hand, the records in which the item value = Body_1 is stored in the intermediate data of the third hierarchy, that is, the item of the parts table as the original data = the parent figure number are the record 4, the record 5, and the record 6. Also, there is no record in which item value = Engine_1 is stored in the intermediate data of the third hierarchy, that is, the item of the parts table as the original data = the parent figure number. Therefore, between the intermediate data of the second hierarchy and the intermediate data of the third hierarchy,
0 → 4, 5, 6
1 →
The record number correspondence table is created.

ステップ5:レコード番号対応表の作成(3回目)
第2階層と第3階層との間に作成されたレコード番号表を参照して、第3階層の中間データのレコード4、レコード5及びレコード6に属する項目=子図番と、第4階層の中間データ、すなわち、原データである部品表の項目=親図番とをキー項目として、さらにレコード番号対応表を作成する。しかし、本例では、第3階層の中間データのレコード4の項目値=Tire_1、レコード5の項目値=Chassis_1及びレコード6の項目値=Door_1に対応する項目値が第4階層の中間データのレコードの項目=親図番に存在しない。よって、第4階層の中間データ、及び、第3階層と第4階層との間のレコード番号対応表を作成する必要がないことがわかった。
Step 5: Create record number correspondence table (third time)
Referring to the record number table created between the second hierarchy and the third hierarchy, the items belonging to the record 4, the record 5 and the record 6 of the intermediate data in the third hierarchy = the child figure number, and the fourth hierarchy A record number correspondence table is further created using the intermediate data, that is, the item of the parts table as the original data = the parent figure number as a key item. However, in this example, the item value of the record 4 of the intermediate data in the third layer = Tire_1, the item value of the record 5 = Chassis_1, and the item value of the record 6 = Door_1 are records of the intermediate data of the fourth layer. Item = not present in parent figure number. Therefore, it has been found that there is no need to create intermediate data of the fourth hierarchy and a record number correspondence table between the third hierarchy and the fourth hierarchy.

図9は、上記のステップ1からステップ5の処理によって、ストラクチャー型部品表から作成された中間データと中間データ間のレコードの対応関係を示す図である。中間データTable_0と中間データTable_1との間の矢印、及び、中間データTable_1と中間データTable_2との間の矢印は、それぞれ、第1階層と第2階層との間のレコード番号対応表、及び、第2階層と第3階層との間のレコード番号対応表と等価である。   FIG. 9 is a diagram showing the correspondence between the intermediate data created from the structure-type parts table and the records between the intermediate data by the processing from step 1 to step 5 described above. The arrows between the intermediate data Table_0 and the intermediate data Table_1 and the arrows between the intermediate data Table_1 and the intermediate data Table_2 are respectively a record number correspondence table between the first hierarchy and the second hierarchy, and This is equivalent to the record number correspondence table between the second layer and the third layer.

ステップ6:レコード番号対応表からツリー構造データの生成
次に、取得されたレコード番号対応表からツリー構造データを生成する。上述されているように、Table_0とTable_1との間のレコード番号対応表は、
0 → 0,1
であり、Table_1とTable_2との間のレコード番号対応表は、
0 → 4,5,6
1 →
である。図10A、Bには生成されたツリー構造データが示されている。図10Aはストラクチャー型部品表から生成された深さ優先形式によるツリー構造データの一例の説明図であり、図10Bは同じストラクチャー型部品表から生成された幅優先形式によるツリー構造データの一例の説明図である。
Step 6: Generation of tree structure data from record number correspondence table Next, tree structure data is generated from the acquired record number correspondence table. As described above, the record number correspondence table between Table_0 and Table_1 is
0 → 0, 1
The record number correspondence table between Table_1 and Table_2 is
0 → 4, 5, 6
1 →
It is. 10A and 10B show the generated tree structure data. FIG. 10A is an explanatory diagram of an example of tree structure data in a depth priority format generated from a structure type BOM, and FIG. 10B is an explanatory diagram of an example of tree structure data in a width priority format generated from the same structure type BOM. It is.

レコード番号対応表からツリー構造データを生成するステップは、深さ優先又は幅優先の何れかの方式で、レコード番号対応表から、親子関係のある親側の中間データ中のレコード番号と子側の中間データ中のレコード番号を探索するステップ6−1と、ツリー構造データの仮想的なレコードの配列中のレコードを生成するステップ6−2とを含む。   The step of generating tree structure data from the record number correspondence table is either depth-first or width-priority, and the record number in the intermediate data on the parent side having a parent-child relationship from the record number correspondence table and the intermediate on the child side Step 6-1 for searching for a record number in the data and Step 6-2 for generating a record in the virtual record array of the tree structure data are included.

ステップ6−1において、深さ優先探索を実行すると、深さ優先形式によるツリー構造データが生成され、幅優先探索を実行すると、幅優先形式によるツリー構造データが生成される。深さ優先と幅優先の何れを選択するかは、予め設定されていてもよく、ユーザによって毎回指定されてもよく、又は、アプリケーションに応じて自動的に選択されてもよい。   In step 6-1, if depth-first search is executed, tree structure data in the depth-first format is generated, and if width-first search is executed, tree structure data in the width-first format is generated. Whether to select depth priority or width priority may be set in advance, may be specified every time by the user, or may be automatically selected according to the application.

たとえば、本例において、深さ優先探索を実行すると、
(1)Table_0[0] → Table_1[0]
(2) Table_1[0] → Table_2[4]
(3) Table_1[0] → Table_2[5]
(4) Table_1[0] → Table_2[6]
(5)Table_0[0] → Table_1[1]
という順番で親子関係のあるレコードが取得される。
For example, in this example, when a depth-first search is performed,
(1) Table_0 [0] → Table_1 [0]
(2) Table_1 [0] → Table_2 [4]
(3) Table_1 [0] → Table_2 [5]
(4) Table_1 [0] → Table_2 [6]
(5) Table_0 [0] → Table_1 [1]
Records with parent-child relationships are acquired in this order.

ステップ6−2は、ステップ6−1において1つの親子関係が取得されるたびに実行される。たとえば、ステップ6−1において、最初に、親子関係(1)が取得されると、新たに仮想的なレコードの配列に作成されるべきレコードにレコード順序番号0が割り当てられ、レコード順序番号0が割り当てられたレコードRecord[0]には、このレコードに対応するノードの親ノードのレコード順序番号Topology[0]と、このレコードに対応する原データの項目名Title[0]と、このレコードに対応する原データの項目値Value[0]がそれぞれ格納される。本例では、Record[0]は、中間データTable_0[0]に対応している。このレコードに対応するノードには親ノードが存在しないので、Topology[0]=−1である。また、Title[0]にはTable_0[0]の項目名=展開指令が格納され、Value[0]にはTable_0[0]の項目値=Car_Aが格納される。続いて、親子関係(1)の子側のレコードに関する新たなレコードがツリー構造データに生成される。そのため、子側のレコードに対応して新たに生成されるべきレコードには次のレコード順序番号1が割り当てられる。よって、新たに生成されるレコードはRecord[1]である。そして、Topology[1]には、このレコードに対応するノードの親ノードに対応するレコードのレコード順序番号、すなわち、0が格納され、Title[1]には、Table_1の項目名=子図番が格納され、Value[1]にはTable_1[0]の項目=子図番に収容されている項目値=Body_1が格納される。ステップ6−2において、新たなレコードが生成されると、処理はステップ6−1へ戻り、次の親子関係が探索される。   Step 6-2 is executed each time one parent-child relationship is acquired in Step 6-1. For example, in step 6-1, when the parent-child relationship (1) is first acquired, a record sequence number 0 is assigned to a record to be newly created in the virtual record array, and the record sequence number 0 is set. The assigned record Record [0] corresponds to the record sequence number Topology [0] of the parent node of the node corresponding to this record, the item name Title [0] of the original data corresponding to this record, and this record The item value Value [0] of the original data to be stored is stored. In this example, Record [0] corresponds to the intermediate data Table_0 [0]. Since the node corresponding to this record has no parent node, Topology [0] = − 1. In addition, an item name = Table_0 [0] is stored in Title [0], and an item value = Car_A in Table_0 [0] is stored in Value [0]. Subsequently, a new record related to the child-side record of the parent-child relationship (1) is generated in the tree structure data. Therefore, the next record sequence number 1 is assigned to a record to be newly generated corresponding to the child record. Therefore, the newly generated record is Record [1]. Then, Topology [1] stores the record order number of the record corresponding to the parent node of the node corresponding to this record, that is, 0, and Title [1] contains the item name = child figure number of Table_1. Stored in Value [1], the item of Table_1 [0] = the item value accommodated in the child figure number = Body_1 is stored. If a new record is generated in step 6-2, the process returns to step 6-1 to search for the next parent-child relationship.

本例では、次に、親子関係(2)が見つけられ、再びステップ6−2へ進み、新たなレコードが生成される。このステップでは、既に、親側のTable_1[0]に関するレコードは生成されているので、子側のTable_2[4]に関するレコードRecord[2]がRecord[1]と同様に生成される。レコード2に対応するノードの親ノードはレコード1であるため、Topology[2]=1である。また、Title[2]には、Table_2の項目名=子図番が格納され、Value[2]には、Table_2[4]の項目=子図番に収容されている項目値=Tire_1が格納される。以下、深さ優先方式でステップ6−1とステップ6−2を繰り返し実行することにより、図10Aに示されているようなツリー構造データを表す仮想的なレコードの配列が生成される。   In this example, next, the parent-child relationship (2) is found, the process proceeds again to step 6-2, and a new record is generated. In this step, since the record related to Table_1 [0] on the parent side has already been generated, the record Record [2] related to Table_2 [4] on the child side is generated in the same manner as Record [1]. Since the parent node of the node corresponding to the record 2 is the record 1, Topology [2] = 1. In addition, the item name of Table_2 = child figure number is stored in Title [2], and the item value = Tire_1 stored in Item_2 [4] item = child figure number is stored in Value [2]. The Thereafter, by repeatedly executing Step 6-1 and Step 6-2 in the depth priority method, an array of virtual records representing the tree structure data as shown in FIG. 10A is generated.

幅優先方式の場合も、深さ優先方式と同様にステップ6−1とステップ6−2を繰り返し実行することにより、図10Bに示されているようなツリー構造データを表す仮想的なレコードの配列が生成される。   In the case of the width priority method, the virtual record array representing the tree structure data as shown in FIG. 10B is obtained by repeatedly executing Step 6-1 and Step 6-2 as in the depth priority method. Generated.

ステップ7:値の分離
図4A、Bを参照して説明したように、ツリー構造データ中の項目=Titleと項目=Valueは、項目値配列と項目値配列へのポインタ配列とに分離することができる。よって、好ましい一実施形態では、ツリー構造データに基づく検索・集計・ソートなどの処理を効率化するため、項目=Titleと項目=Valueは情報ブロック型に変換される。一方、項目=Topologyは要素が整数の配列によって記述されているので、情報ブロック型に変換する必要はない。
Step 7: Separation of values As described with reference to FIGS. 4A and 4B, the item = Title and the item = Value in the tree structure data can be separated into an item value array and a pointer array to the item value array. it can. Therefore, in a preferred embodiment, the item = Title and the item = Value are converted into the information block type in order to improve the efficiency of search / aggregation / sorting based on the tree structure data. On the other hand, since item = Topology is described by an array of integers, there is no need to convert it to an information block type.

図11A、Bは、図10A、Bに示されたツリー構造データを情報ブロック型へ変換することによって生成されたツリー構造データを示す図である。図11Aは図10Aの深さ優先型のツリー構造データに対応し、図11Bは図10Bの幅優先型のツリー構造データに対応している。   11A and 11B are diagrams showing tree structure data generated by converting the tree structure data shown in FIGS. 10A and 10B into an information block type. 11A corresponds to the depth-priority tree structure data in FIG. 10A, and FIG. 11B corresponds to the width-priority tree structure data in FIG. 10B.

以上の説明のように、本発明の一実施形態によれば、ストラクチャー型部品表から統合されたツリー構造データを生成することが可能である。ツリー構造データは、必要に応じて、深さ優先、幅優先の何れの形式でも生成できる。   As described above, according to an embodiment of the present invention, it is possible to generate integrated tree structure data from a structure-type parts table. Tree structure data can be generated in either depth-first or width-first format as required.

[複数のテーブルで記述されたツリー構造データの統合]
特許文献1又は特許文献2に記載では、ツリー構造データは複数のテーブルの連鎖又は連結によって表現されている。そのため、ツリー構造データを対象とする検索・ソート・集計などの操作が容易ではない。そこで、本発明の一実施形態では、複数のテーブルで記述されたツリー構造データを統合されたツリー構造データに変換する方法が提供される。
[Integration of tree structure data described in multiple tables]
In the description in Patent Document 1 or Patent Document 2, tree structure data is expressed by a chain or connection of a plurality of tables. Therefore, operations such as search, sort, and aggregation for tree structure data are not easy. Therefore, in one embodiment of the present invention, a method for converting tree structure data described in a plurality of tables into integrated tree structure data is provided.

図12A、Bは、複数のテーブルで記述されたツリー構造データの一例の説明図であり、図12Aには、ツリー構造データを記述する複数のテーブルが示され、図12Bには、複数のテーブルによって記述されているツリー構造データの階層関係が示されている。   12A and 12B are explanatory diagrams of an example of tree structure data described in a plurality of tables. FIG. 12A illustrates a plurality of tables describing tree structure data, and FIG. 12B illustrates a plurality of tables. The hierarchical relationship of the tree structure data described by is shown.

図12Aにおいて、1番目のテーブルTable_0は、項目Storyと項目DGripとを保有している。ここで、項目Storyは、データに属している実体的な情報であり、項目DGripはテーブルの要素間の親子関係を表現するために利用される情報である。2番目のテーブルTable_1は、項目UGripと項目Familyと項目DGripとを保有している。ここでも、項目Familyは実体的な情報であり、項目UGrip及び項目DGripは親子関係を表現するために利用される情報である。3番目のテーブルTable_2は、親子関係を表現するための情報である項目UGripと、実体的な情報である項目Nameとを保有している。DGripとして表記されているダウングリップは、データの出現順に割り当てられた順番号である。UGripとして表記されているアップグリップは、親エレメントに割り当てられたダウングリップの値である。よって、一般に、あるテーブル中のあるレコードiのUGripの値がmであり、直前のテーブル中のレコードjのDGripの値がmであるならば、あるテーブル中のレコードiの親エレメントは、直前のテーブル中のレコードjである。それぞれのレコードは、ツリー構造データ中の1つのノードに対応し、それぞれのレコードの実体的な情報である項目名と項目値が、当該レコードに対応するノードに属する属性名及び属性値を表している。このように、アップグリップとダウングリップを組み合わせることにより、ツリー構造データが複数のテーブルで記述されている。   In FIG. 12A, the first table Table_0 has an item Story and an item DGrip. Here, the item Story is substantive information belonging to the data, and the item DGrip is information used to express the parent-child relationship between the elements of the table. The second table Table_1 has an item UGrip, an item Family, and an item DGrip. Here again, the item Family is substantive information, and the item UGrip and the item DGrip are information used to express a parent-child relationship. The third table Table_2 holds an item UGrip which is information for expressing a parent-child relationship and an item Name which is substantial information. The down grip represented as DGrip is a sequence number assigned in the order of appearance of data. The up grip indicated as UGrip is the value of the down grip assigned to the parent element. Therefore, generally, if the value of UGrip of a record i in a certain table is m and the value of DGrip of record j in the immediately preceding table is m, the parent element of record i in a certain table is Record j in the table. Each record corresponds to one node in the tree structure data, and an item name and an item value, which are substantive information of each record, represent an attribute name and an attribute value belonging to the node corresponding to the record. Yes. As described above, the tree structure data is described in a plurality of tables by combining the up grip and the down grip.

図12Bを参照すると、図12Aの複数のテーブルは、Harry Potterをルートノードとするツリーと、Mr.Incredibleをルートノードとするツリーの2つのツリーを含むツリー構造データを表していることがわかる。このような複数のテーブルは、予めデータのスキャン、又は、データ構造の定義などによって、どのようなデータ構造が存在しているかを知り、それに応じて格納先テーブルを作成し、データを格納するという手順に従って構築されるので、様々なデータ構造が随時生成されるエディタのようなアプリケーションには、性能の面で不適当である。   Referring to FIG. 12B, the plurality of tables in FIG. 12A include a tree having Harry Potter as a root node, Mr. It can be seen that it represents tree structure data including two trees of which the Incredible is a root node. It is said that such a plurality of tables know in advance what data structure exists by scanning data or defining the data structure, creating a storage destination table accordingly, and storing the data Since it is constructed according to the procedure, it is unsuitable in terms of performance for an application such as an editor in which various data structures are generated at any time.

[深さ優先方式の統合されたツリー構造データ]
最初に、複数のテーブルで記述されたツリー構造データ、すなわち、原データを深さ優先方式の統合されたツリー構造データへ変換する本発明の一実施形態を説明する。以下に述べる処理ステップは、コンピュータシステム10、特に、コンピュータシステム10中のCPU12により実行される。また、処理ステップにおいて生成されるデータ、表、配列は、それぞれ、メモリ(たとえば、RAM14)中に格納される。
[Integrated tree structure data of depth-first method]
First, an embodiment of the present invention for converting tree structure data described in a plurality of tables, that is, original data into integrated tree structure data of a depth-first method will be described. The processing steps described below are executed by the computer system 10, particularly the CPU 12 in the computer system 10. Further, data, tables, and arrays generated in the processing steps are each stored in a memory (for example, RAM 14).

ステップ1:レコード番号対応表の作成
第1階層のテーブルTable_0と第2階層のテーブルTable_1との間でレコード番号対応表が作成される。レコード番号対応表は、Table_0の項目DGripとTable_1の項目UGripをキー項目として、Table_0とTable_1の2つのテーブルをジョインすることにより作成される。なお、本発明の一実施形態によれば、ジョインはレコード番号対応表を作成するために使用されるので、ジョインテーブルを生成する必要がないことに注意すべきである。Table_0のレコード0と、Table_1のレコード1及びレコード2のキー項目値=0が一致し、Table_0のレコード1とTable_1のレコード0のキー項目値=1が一致しているので、
0 → 1,2
1 → 0
というレコード対応表が完成される。第2階層のテーブルTable_1と第3階層のテーブルTable_2との間でも同様にレコード番号対応表を作成すると、
0 → 4,5,6,7
1 → 1,2,3
2 → 0
というレコード番号対応表が得られる。図13A、Bは、本発明の一実施形態によるレコード番号対応表の作成処理の説明図であり、図13Aには、Table_0とTable_1との間のレコード番号対応表が示され、図13Bには、Table_1とTable_2との間のレコード番号対応表が示されている。
Step 1: Creation of Record Number Correspondence Table A record number correspondence table is created between the first layer table Table_0 and the second layer table Table_1. The record number correspondence table is created by joining the two tables Table_0 and Table_1 with the table DGrip and Table_1 items UGrip as key items. It should be noted that, according to one embodiment of the present invention, joins are used to create a record number correspondence table, so there is no need to generate a join table. Since the record 0 of Table_0 matches the key item value = 0 of the record 1 and the record 2 of Table_1, the record 1 of the table_1 and the key item value = 1 of the record 0 of Table_1 match.
0 → 1, 2
1 → 0
The record correspondence table is completed. Similarly, if a record number correspondence table is created between the table Table_1 of the second layer and the table Table_2 of the third layer,
0 → 4, 5, 6, 7
1 → 1, 2, 3
2 → 0
The record number correspondence table is obtained. 13A and 13B are explanatory diagrams of a record number correspondence table creation process according to an embodiment of the present invention. FIG. 13A shows a record number correspondence table between Table_0 and Table_1, and FIG. , A record number correspondence table between Table_1 and Table_2 is shown.

ステップ2:レコード番号対応表からツリー構造データの生成
次に、取得されたレコード番号対応表からツリー構造データを生成する。具体的には、仮想的なレコードの配列の各レコードにTopologyフィールドの値、Titleフィールドの値、及び、Valueフィールドの値を格納する。
Step 2: Generation of tree structure data from record number correspondence table Next, tree structure data is generated from the acquired record number correspondence table. Specifically, the value of the Topology field, the value of the Title field, and the value of the Value field are stored in each record of the virtual record array.

ステップ2−1:レコード0の生成
ステップ2−1−1:初期化
配列Topology、配列Title、配列Value、及び、親ノードのレコード識別番号を格納するスタック配列ParentNodeNoの領域をメモリに確保し、スタック配列の先頭、すなわち、ParentNodeNo[0]に−1をセットする。さらに、スタック配列ParentNodeNoに格納されている値−1をTopology[0]へコピーする。図14A−Cは、本発明の一実施形態による深さ優先方式に基づくツリー構造データ生成処理の説明図であり、図14Aには、ステップ2−1−1の処理が示されている。
Step 2-1: Generation of Record 0 Step 2-1: Initialization Array Topology, Array Title, Array Value, and stack array ParentNodeNo storing the record identification number of the parent node are secured in the memory, and the stack -1 is set to the top of the array, that is, ParentNodeNo [0]. Further, the value −1 stored in the stack array ParentNodeNo is copied to Topology [0]. 14A to 14C are explanatory diagrams of tree structure data generation processing based on the depth priority method according to an embodiment of the present invention, and FIG. 14A shows the processing of step 2-1-1.

ステップ2−1−2:値の格納
図14Bには、ルートノード(ノード0)に対応するレコード0の生成処理が示されている。同図に上向き矢印で示されているレコード番号対応表中の現在位置は、Table_0のレコード0であるので、Table_0のレコード0の項目名及び項目値を取得して、Title[0]及びValue[0]にそれぞれ格納する。
Step 2-1-2: Value Storage FIG. 14B shows a process for generating record 0 corresponding to the root node (node 0). Since the current position in the record number correspondence table indicated by the upward arrow in the drawing is the record 0 of Table_0, the item name and item value of the record 0 of Table_0 are acquired, and Title [0] and Value [ 0] respectively.

ステップ2−1−3:子ノードへの移動
図14Cには、子ノードへの移動処理が示されている。同図に示されているように、レコード番号対応表に従って、現在位置を子ノードへ移動させる。このとき、親ノードの格納アドレス(添字)、すなわち、レコード順序番号=0をスタック配列ParentNodeNoにプッシュする。また、同図に横向き矢印で示されている配列Topology、配列Title、及び、配列Valueへのポインタが値を格納済みのレコード位置を指しているので、当該ポインタをインクリメントする(1つ先へ進める)。
Step 2-1-3: Move to Child Node FIG. 14C shows a move process to the child node. As shown in the figure, the current position is moved to the child node according to the record number correspondence table. At this time, the storage address (subscript) of the parent node, that is, the record sequence number = 0 is pushed to the stack array ParentNodeNo. In addition, since the pointers to the array Topology, array Title, and array Value indicated by the horizontal arrows in the same figure indicate the record positions where the values have been stored, the pointer is incremented (go forward one step). ).

ステップ2−2:レコード1の生成
図15A−Cには、ノード1に対応するレコード1を生成する処理が示されている。最初に、図15Aに示されているように、スタック配列ParentNodeNoに格納されている値を配列Topology[1]へコピーする。次に、図15Bに示されているように、レコード番号対応表中の現在位置は、Table_1のレコード1であるので、Table_1のレコード1の項目名及び項目値を取得して、Title[1]及びValue[1]にそれぞれ格納する。最後に、図15Cに示されているように、レコード番号対応表に従って、現在位置を子ノードへ移動させる。このとき、親ノードの格納アドレス(添字)、すなわち、レコード順序番号=1をスタック配列ParentNodeNoにプッシュする。また、同図に横向き矢印で示されている配列Topology、配列Title、及び、配列Valueへのポインタが値を格納済みのレコード位置を指しているので、当該ポインタをインクリメントする(1つ先へ進める)。
Step 2-2: Generation of Record 1 FIGS. 15A to 15C show a process for generating record 1 corresponding to node 1. First, as shown in FIG. 15A, the value stored in the stack array ParentNodeNo is copied to the array Topology [1]. Next, as shown in FIG. 15B, since the current position in the record number correspondence table is the record 1 of Table_1, the item name and item value of the record 1 of Table_1 are acquired, and Title [1] And Value [1]. Finally, as shown in FIG. 15C, the current position is moved to the child node according to the record number correspondence table. At this time, the storage address (subscript) of the parent node, that is, the record sequence number = 1 is pushed to the stack array ParentNodeNo. In addition, since the pointers to the array Topology, array Title, and array Value indicated by the horizontal arrows in the same figure indicate the record positions where the values have been stored, the pointer is incremented (go forward one step). ).

ステップ2−3:レコード2の生成
図16A−Cには、ノード2に対応するレコード2を生成する処理が示されている。最初に、図16Aに示されているように、スタック配列ParentNodeNoに格納されている値を配列Topology[2]へコピーする。次に、図16Bに示されているように、レコード番号対応表中の現在位置は、Table_2のレコード1であるので、Table_2のレコード1の項目名及び項目値を取得して、Title[2]及びValue[2]にそれぞれ格納する。最後に、図16Cに示されているように、レコード番号対応表に従って、子ノードが存在するかどうかをチェックし、子ノードが無ければ、弟ノードが存在するかどうかをチェックする。本例では、弟ノードが存在するので、レコード番号対応表中の現在位置を弟ノードへ移動させる。深さ優先方式であるため、子ノードが弟ノードより優先して調べられている。現在位置を弟ノードへ移動させるとき、スタック配列ParentNodeNoは操作されない。また、図16Cに横向き矢印で示されている配列Topology、配列Title、及び、配列Valueへのポインタが値を格納済みのレコード位置を指しているので、当該ポインタをインクリメントする(1つ先へ進める)。
Step 2-3: Generation of Record 2 FIGS. 16A to 16C show processing for generating record 2 corresponding to node 2. FIG. First, as shown in FIG. 16A, the value stored in the stack array ParentNodeNo is copied to the array Topology [2]. Next, as shown in FIG. 16B, since the current position in the record number correspondence table is the record 1 of Table_2, the item name and the item value of the record 1 of Table_2 are acquired, and Title [2] And Value [2]. Finally, as shown in FIG. 16C, it is checked whether there is a child node according to the record number correspondence table. If there is no child node, it is checked whether there is a younger brother node. In this example, since there is a younger brother node, the current position in the record number correspondence table is moved to the younger brother node. Since this is a depth-first method, the child node is examined in preference to the brother node. When the current position is moved to the younger brother node, the stack array ParentNodeNo is not operated. Further, since the pointers to the array Topology, array Title, and array Value indicated by the horizontal arrows in FIG. 16C point to the record positions where the values have been stored, the pointers are incremented (go forward one step). ).

ステップ2−4:レコード3の生成
図17A−Cに示されているように、図16A−Cに示されたステップ2−3と同様にレコード3が生成される。
Step 2-4: Generation of Record 3 As shown in FIGS. 17A-C, record 3 is generated in the same manner as in Step 2-3 shown in FIGS. 16A-C.

ステップ2−5:レコード4の生成
図18A−Cには、ノード4に対応するレコード4を生成する処理が示されている。最初に、図18Aに示されているように、スタック配列ParentNodeNoに格納されている値を配列Topology[4]へコピーする。次に、図18Bに示されているように、レコード番号対応表中の現在位置は、Table_2のレコード3であるので、Table_2のレコード3の項目名及び項目値を取得して、Title[4]及びValue[4]にそれぞれ格納する。最後に、図18Cに示されているように、レコード番号対応表に従って、子ノードが存在するかどうかをチェックし、子ノードが無ければ、弟ノードが存在するかどうかをチェックする。本例では、弟ノードも存在しないので、レコード番号対応表中の現在位置を親ノードへ移動させる(戻す)。現在位置を親ノードへ戻すとき、スタック配列ParentNodeNoから格納されているレコード順序番号をポップする。親ノードは、Table_1のレコード1に対応している。次に、この親ノードに弟ノードが存在するかどうかをチェックする。本例では、弟ノードが存在するので、レコード番号対応表中の現在位置をTable_1のレコード1の弟ノード、すなわち、Table_1のレコード2へ移動させる。また、図18Cに横向き矢印で示されている配列Topology、配列Title、及び、配列Valueへのポインタが値を格納済みのレコード位置を指しているので、当該ポインタをインクリメントする(1つ先へ進める)。
Step 2-5: Generation of Record 4 FIGS. 18A to 18C show processing for generating record 4 corresponding to node 4. First, as shown in FIG. 18A, the value stored in the stack array ParentNodeNo is copied to the array Topology [4]. Next, as shown in FIG. 18B, since the current position in the record number correspondence table is the record 3 of Table_2, the item name and the item value of the record 3 of Table_2 are acquired, and Title [4] And Value [4]. Finally, as shown in FIG. 18C, it is checked whether there is a child node according to the record number correspondence table. If there is no child node, it is checked whether there is a brother node. In this example, since there is no younger brother node, the current position in the record number correspondence table is moved (returned) to the parent node. When returning the current position to the parent node, the record sequence number stored from the stack array ParentNodeNo is popped. The parent node corresponds to the record 1 of Table_1. Next, it is checked whether there is a younger brother node in this parent node. In this example, since a younger brother node exists, the current position in the record number correspondence table is moved to the younger brother node of the record 1 of Table_1, that is, the record 2 of Table_1. Further, since the pointers to the array Topology, array Title, and array Value indicated by the horizontal arrows in FIG. 18C point to the record positions where the values have been stored, the pointers are incremented (go forward one step). ).

ステップ2−6:レコード5の生成
図19A−Cには、ノード5に対応するレコード5を生成する処理が示されている。最初に、図19Aに示されているように、スタック配列ParentNodeNoに格納されている値を配列Topology[5]へコピーする。次に、図19Bに示されているように、レコード番号対応表中の現在位置は、Table_1のレコード2であるので、Table_1のレコード2の項目名及び項目値を取得して、Title[5]及びValue[5]にそれぞれ格納する。最後に、図19Cに示されているように、レコード番号対応表に従って、現在位置を子ノードへ移動させる。このとき、親ノードの格納アドレス(添字)、すなわち、レコード順序番号=5をスタック配列ParentNodeNoへプッシュする。また、図19Cに横向き矢印で示されている配列Topology、配列Title、及び、配列Valueへのポインタが値を格納済みのレコード位置を指しているので、当該ポインタをインクリメントする(1つ先へ進める)。
Step 2-6: Generation of Record 5 FIGS. 19A to 19C show processing for generating record 5 corresponding to node 5. First, as shown in FIG. 19A, the value stored in the stack array ParentNodeNo is copied to the array Topology [5]. Next, as shown in FIG. 19B, since the current position in the record number correspondence table is the record 2 of Table_1, the item name and the item value of the record 2 of Table_1 are acquired, and Title [5] And Value [5]. Finally, as shown in FIG. 19C, the current position is moved to the child node according to the record number correspondence table. At this time, the storage address (subscript) of the parent node, that is, the record sequence number = 5 is pushed to the stack array ParentNodeNo. In addition, since the pointers to the array Topology, array Title, and array Value indicated by the horizontal arrows in FIG. 19C point to the record positions where the values have been stored, the pointers are incremented (go forward one step). ).

ステップ2−7:レコード6の生成
図20A−Cには、ノード6に対応するレコード6を生成する処理が示されている。最初に、図20Aに示されているように、スタック配列ParentNodeNoに格納されている値を配列Topology[6]へコピーする。次に、図20Bに示されているように、レコード番号対応表中の現在位置は、Table_2のレコード0であるので、Table_2のレコード0の項目名及び項目値を取得して、Title[6]及びValue[6]にそれぞれ格納する。最後に、図20Cに示されているように、レコード番号対応表に従って、子ノードが存在するかどうかをチェックする。子ノードが存在しないので、弟ノードが存在するかどうかをチェックする。本例では、弟ノードも存在しないので、レコード番号対応表中の現在位置を親ノードへ移動させる(戻す)。現在位置を親ノードへ戻すとき、スタック配列ParentNodeNoから格納されているレコード順序番号をポップする。親ノードは、Table_1のレコード2に対応している。次に、この親ノードに弟ノードが存在するかどうかをチェックする。本例では、弟ノードも存在しないので、レコード番号対応表中の現在位置をTable_1のレコード2の親ノード、すなわち、Table_0のレコード0へ移動させる。このとき、スタック配列ParentNodeNoから格納されているレコード順序番号をポップする。また、図20Cに横向き矢印で示されている配列Topology、配列Title、及び、配列Valueへのポインタが値を格納済みのレコード位置を指しているので、当該ポインタをインクリメントする(1つ先へ進める)。
Step 2-7: Generation of Record 6 FIGS. 20A to 20C show processing for generating record 6 corresponding to node 6. FIG. First, as shown in FIG. 20A, the value stored in the stack array ParentNodeNo is copied to the array Topology [6]. Next, as shown in FIG. 20B, since the current position in the record number correspondence table is the record 0 of Table_2, the item name and the item value of the record 0 of Table_2 are acquired, and Title [6] And Value [6], respectively. Finally, as shown in FIG. 20C, it is checked whether there is a child node according to the record number correspondence table. Since there is no child node, it is checked whether a brother node exists. In this example, since there is no younger brother node, the current position in the record number correspondence table is moved (returned) to the parent node. When returning the current position to the parent node, the record sequence number stored from the stack array ParentNodeNo is popped. The parent node corresponds to the record 2 of Table_1. Next, it is checked whether there is a younger brother node in this parent node. In this example, since there is no younger brother node, the current position in the record number correspondence table is moved to the parent node of the record 2 of Table_1, that is, the record 0 of Table_0. At this time, the record sequence number stored from the stack array ParentNodeNo is popped. In addition, since the pointers to the array Topology, array Title, and array Value indicated by the horizontal arrows in FIG. 20C point to the record positions where the values have been stored, the pointers are incremented (go forward one step). ).

以上の処理により、レコード番号対応表中の現在位置がTable_0のレコード0まで戻ったので、Harry Potterに関する深さ優先方式の統合されたツリー構造データが完成した。   As a result of the above processing, the current position in the record number correspondence table has returned to the record 0 of Table_0, so that the integrated tree structure data of the depth priority method for the Harry Potter is completed.

もう一方のTable_0のレコード1のMr.Incredibleに関する深さ優先方式の統合されたツリー構造データも同様の処理によって生成される。Table_0のレコード1の処理は、1台のプロセッサによって、Table_0のレコード0に関する処理の後に逐次的に実行されてもよいが、たとえば、複数台のプロセッサを用いて、Table_0のレコード0に関する処理と、Table_0のレコード1に関する処理が並列的に実行されてもよい。   Mr. of the record 1 of the other Table_0. The integrated tree structure data of the depth-first method regarding Incredible is also generated by the same processing. The process of the record 1 of Table_0 may be sequentially executed by one processor after the process related to the record 0 of Table_0. For example, the process related to the record 0 of Table_0 using a plurality of processors, Processing regarding the record 1 of Table_0 may be executed in parallel.

ステップ3:値リストが分離されたツリー構造データの生成
ステップ2で生成されたツリー構造データは、値リストが分離されたツリー構造データに変換することが可能である。そして、値リストが分離されたツリー構造データは、情報ブロック型のツリー構造データと等価である。よって、本発明の一実施形態では、統合されたツリー構造データを値リストが分離されたツリー構造データに変換する方法が提供される。図21A−Cは、図12Aの原データから生成された、値リストが分離されたツリー構造データの説明図である。図21Aには統合されたツリー構造データが示されている。
Step 3: Generation of Tree Structure Data with Separated Value List The tree structure data generated in Step 2 can be converted into tree structure data with a separated value list. The tree structure data from which the value list is separated is equivalent to the information block type tree structure data. Thus, in one embodiment of the present invention, a method is provided for converting consolidated tree structure data into tree structure data with separated value lists. 21A to 21C are explanatory diagrams of tree structure data generated from the original data in FIG. 12A and from which the value list is separated. FIG. 21A shows the integrated tree structure data.

本実施形態では、配列Titleに出現する値が値番号と一意かつ昇順(又は降順)の値リストとに分離され、配列Valueに出現する値もまた値番号と一意かつ昇順(又は降順)の値リストとに分離される。たとえば、配列Titleを参照すると、配列Title中に出現する値は、
Story
Name
Family
の3個である。これらの3個の値をアルファベット順に並べ替えると、
Family
Name
Story
の順になる。よって、値Familyに値番号0を、値Nameに値番号1を、値Storyに値番号2を割り当て、かつ、
VL[0]=Family
VL[1]=Name
VL[2]=Story
という値リストを準備すると、値は値番号VNoと値リストVLに分離される。図21Bには、このようにして、値が値番号と値リストに分離されたツリー構造データが示されている。図21Cには、値番号と値リストの組を項目Titleと項目Valueに関して分離した情報ブロック型のツリー構造データが示されている。
In this embodiment, values appearing in the array Title are separated into a value number and a unique and ascending (or descending) value list, and values appearing in the array Value are also unique and ascending (or descending) values. Separated into a list. For example, referring to the array Title, the values that appear in the array Title are:
Story
Name
Family
It is three. If you sort these three values alphabetically,
Family
Name
Story
It becomes in order. Therefore, a value number 0 is assigned to the value Family, a value number 1 is assigned to the value Name, a value number 2 is assigned to the value Story, and
VL [0] = Family
VL [1] = Name
VL [2] = Story
When the value list is prepared, the values are separated into a value number VNo and a value list VL. FIG. 21B shows tree structure data in which values are separated into value numbers and value lists in this way. FIG. 21C shows information block type tree structure data in which a set of a value number and a value list is separated with respect to an item Title and an item Value.

このように値リストが分離されると、配列Titleや配列Valueが整数型配列になるので、コンピュータで高速に処理できるようになる。また、値リストの分離によって重複値の保持が無くなるので、データサイズがコンパクトになる。さらに、値リストの分離によって、検索の際に、同じ値について検索条件の成立を何回も調べる必要がなくなるので、検索が容易になる。また、値リストの分離によって、集計の際に、次元値の一覧が即座に利用できるので、集計が容易になる。その上、値リストの分離によって、ソートの際に、カウンティングソートを利用できるので、ソートが容易になる。   When the value list is separated in this way, the array Title and the array Value become integer arrays, so that the computer can process them at high speed. In addition, the separation of the value list eliminates the holding of duplicate values, thereby reducing the data size. Furthermore, the separation of the value list eliminates the need to repeatedly check whether the search condition is satisfied for the same value at the time of search, thus facilitating the search. In addition, the separation of the value list facilitates tabulation because the list of dimension values can be used immediately at the time of tabulation. In addition, by separating the value list, counting can be used for sorting, so that sorting becomes easy.

[順序集合と値リストを用いたツリー構造データの生成]
上記の本発明の一実施形態では、ツリー構造データ中の値は、統合されたツリー構造データが作成された後に、値番号と値リストに分離されている。これに対して、本発明の他の実施形態では、複数のテーブルで記述されたツリー構造データ、すなわち、原データを順序集合と情報ブロックとに分離した後に、統合されたツリー構造データを生成する方法が提供される。以下に述べる処理ステップも、コンピュータシステム10、特に、コンピュータシステム10中のCPU12により実行される。また、処理ステップにおいて生成されるデータ、表、配列は、それぞれ、メモリ(たとえば、RAM14)中に格納される。
[Generation of tree structure data using ordered set and value list]
In one embodiment of the present invention described above, the values in the tree structure data are separated into value numbers and value lists after the integrated tree structure data is created. In contrast, in another embodiment of the present invention, tree structure data described in a plurality of tables, that is, integrated tree structure data is generated after separating original data into an ordered set and an information block. A method is provided. The processing steps described below are also executed by the computer system 10, particularly the CPU 12 in the computer system 10. Further, data, tables, and arrays generated in the processing steps are each stored in a memory (for example, RAM 14).

ステップ1:データ形式の変換
最初に、図12Aに示された原データ、すなわち、Table_0、Table_1及びTable_2は、順序集合配列OrdSetと情報ブロックとからなるデータ形式に変換される。このデータ形式は、既に[情報ブロックに基づくデータ管理機構]において説明した通りである。図22は、図12Aに示された原データから情報ブロックに基づくデータ形式への変換の説明図である。
Step 1: Conversion of Data Format First, the original data shown in FIG. 12A, that is, Table_0, Table_1, and Table_2 are converted into a data format composed of an ordered set array OrdSet and an information block. This data format is as described in [Data management mechanism based on information block]. FIG. 22 is an explanatory diagram of the conversion from the original data shown in FIG. 12A to the data format based on the information block.

ステップ2:項目Valueのための値リストの共通化
次に、項目Story、項目Family及び項目Nameの値リストが共通化される。そのため、最初に項目Storyの値リストと項目Familyの値リストを共通化し、その後に、最初に共通化された値リストと項目Nameの値リストを共通化する。値リストの共通化は、最終的な情報ブロック型のツリー構造データの項目Valueの情報ブロックを作成するために必要な処理である。図23は、値リストの共通化処理の説明図である。項目Storyの値リストと項目Familyの値リストを共通化すると、共通化された値リストには、それぞれの値リストからの要素が、重複することなく、アルファベット順に格納されている。そして、各項目の値番号配列の要素は、共通化された値リスト中の対応する値を指定するように値番号が書き換えられる。複数の項目の値リストを共通化すると、複数の項目を1つの情報ブロックとして取り扱えるようになる。
Step 2: Common Value List for Item Value Next, common value lists for Item Story, Item Family, and Item Name are made common. Therefore, the value list of the item story and the value list of the item family are first made common, and then the value list made common first and the value list of the item name are made common. The sharing of the value list is a process necessary for creating the information block of the item value of the final information block type tree structure data. FIG. 23 is an explanatory diagram of a value list sharing process. When the value list of the item story and the value list of the item family are made common, elements from the respective value lists are stored in the common value list in alphabetical order without duplication. Then, the value number of the element of the value number array of each item is rewritten so as to specify the corresponding value in the common value list. If a value list of a plurality of items is shared, a plurality of items can be handled as one information block.

ステップ3:項目Titleの値番号と値リストの分離
次に、ツリー構造データの項目Titleを記述するため、Titleのリストを値番号配列VNoと値リストVLに分離する。図24は、値配列を値番号と値リストへ分離する処理の説明図である。
Step 3: Separation of Item Title Value Number and Value List Next, in order to describe the item Title of the tree structure data, the Title list is separated into a value number array VNo and a value list VL. FIG. 24 is an explanatory diagram of processing for separating a value array into a value number and a value list.

ステップ4:レコード番号対応表の作成
次に、Table_0とTable_1との間、及び、Table_1とTable_2との間でレコード番号対応表が作成される。この処理は図13を参照して説明した処理と同様である。この処理は、上述されているように、特許文献5に記載されたジョイン処理を利用することによって実現される。図25A、Bは、本発明の一実施形態による、ジョインを利用するレコード番号対応表の作成処理の説明図である。図25AはTable_0とTable_1との間のジョイン処理を示し、図25BはTable_1とTable_2との間のジョイン処理を示している。図25A、Bにおいて、マスタ側とは、元のテーブルの順序集合の順序が保存されている方のテーブルを表し、本例では、上位階層のテーブルがマスタ側に相当し、反対に、スレイブ側とは、元のテーブルの順序集合の順序がジョインキーでソートされている方のテーブルを表し、本例では、下位階層のテーブルがスレイブ側に相当する。
Step 4: Creation of record number correspondence table Next, a record number correspondence table is created between Table_0 and Table_1, and between Table_1 and Table_2. This process is the same as the process described with reference to FIG. This process is realized by using the join process described in Patent Document 5 as described above. FIGS. 25A and 25B are explanatory diagrams of processing for creating a record number correspondence table using a join according to an embodiment of the present invention. FIG. 25A shows join processing between Table_0 and Table_1, and FIG. 25B shows join processing between Table_1 and Table_2. 25A and 25B, the master side represents a table in which the order of the ordered set of the original table is stored. In this example, the upper layer table corresponds to the master side, and conversely, the slave side. Represents the table in which the order of the ordered set of the original table is sorted by the join key. In this example, the lower layer table corresponds to the slave side.

図25Bを参照して、ジョインを利用した、レコード番号対応表の作成処理を詳細に説明する。Table_1とTable_2をジョインするとき、キー項目は、マスタ側であるTable_1のDGripと、スレイブ側であるTable_2のUGripである。たとえば、マスタ側テーブルのレコードmのキー項目値と一致するキー項目値を有する要素がスレイブ側データにn個存在している場合、ジョインによって生成されるジョインテーブルには、マスタ側テーブルのレコードmがn回繰り返して出現する。本例では、マスタ側のTable_1のレコード0に対応するスレイブ側のTable_2のレコードは、レコード4、レコード5、レコード6及びレコード7の4個存在している。同様に、マスタ側のレコード1には、スレイブ側のレコード1、レコード2及びレコード3が対応し、マスタ側のレコード2には、スレイブ側のレコード0が対応している。図25Bに示されているマスタ側累計数配列と、マスタ側順序集合配列と、マスタ側ジョインキー配列と、スレイブ側累計数配列と、スレイブ側順序集合配列は、このようなマスタ側レコードとスレイブ側レコードの対応関係を記述している。   With reference to FIG. 25B, a record number correspondence table creation process using join will be described in detail. When joining Table_1 and Table_2, the key items are DGrip of Table_1 on the master side and UGrip of Table_2 on the slave side. For example, when there are n elements having key item values that match the key item value of the record m in the master side table in the slave side data, the join table generated by the join includes the record m in the master side table. Appears repeatedly n times. In this example, there are four records, that is, a record 4, a record 5, a record 6, and a record 7, corresponding to the record 0 on the slave side corresponding to the record 0 on the table 1 on the master side. Similarly, the record 1 on the slave side corresponds to the record 1, the record 2 and the record 3 on the slave side, and the record 2 on the slave side corresponds to the record 2 on the master side. The master-side cumulative number array, the master-side ordered set array, the master-side join key array, the slave-side cumulative number array, and the slave-side ordered set array shown in FIG. The correspondence of the side record is described.

マスタ側累計数配列は、スレイブ側の対応するレコードの個数を累計数化することにより得られる配列であり、マスタ側累計数配列[1]=4から、マスタ側順序集合配列[0]=0によって指定されるマスタ側レコード0に対応するスレイブ側レコードの個数が4個であることがわかる。同様に、マスタ側累計数配列[2]=7から、マスタ側順序集合配列[1]=1によって指定されるマスタ側レコード1に対応するスレイブ側レコードの個数が7−4=3個であることがわかる。さらに、マスタ側累計数配列[3]=8から、マスタ側順序集合配列[2]=2によって指定されるマスタ側レコード2に対応するスレイブ側レコードの個数が8−7=1個であることがわかる。よって、マスタ側累計数配列とマスタ側順序集合配列の組み合わせは、図26Aに示されているような仮想的な順序集合配列をコンパクトに表現していることがわかる。換言すると、マスタ側累計数配列[i]は、対応するマスタ側順序集合配列[i]で指定される要素が仮想的な順序集合配列中に出現する開始位置を表している。   The master side cumulative number array is an array obtained by accumulating the number of corresponding records on the slave side. From the master side cumulative number array [1] = 4, the master side ordered set array [0] = 0. It can be seen that the number of slave side records corresponding to the master side record 0 specified by is four. Similarly, from the master side cumulative number array [2] = 7, the number of slave side records corresponding to the master side record 1 specified by the master side ordered set array [1] = 1 is 7-4 = 3. I understand that. Furthermore, from the master side cumulative number array [3] = 8, the number of slave side records corresponding to the master side record 2 specified by the master side ordered set array [2] = 2 is 8-7 = 1. I understand. Therefore, it can be seen that the combination of the master side cumulative number array and the master side ordered set array expresses a virtual ordered set array as shown in FIG. 26A in a compact manner. In other words, the master side cumulative number array [i] represents the start position where the element specified by the corresponding master side ordered set array [i] appears in the virtual ordered set array.

スレイブ側順序集合は、ジョインキー、本例では、UGripの値でソートされている。図26Bに示されているように、スレイブ側累計数配列[i]もまた、共通化されたジョインキーVL[i]に対応する要素がスレイブ側順序集合配列中に出現する開始位置を示している。   The slave side ordered set is sorted by the join key, in this example, the value of UGrip. As shown in FIG. 26B, the slave side cumulative number array [i] also indicates the start position at which the element corresponding to the shared join key VL [i] appears in the slave side ordered set array. Yes.

図25Bに示されているようなデータを取得する処理の一例として、特許文献5に記載されているジョイン処理を簡単に説明する。   As an example of a process for acquiring data as shown in FIG. 25B, the join process described in Patent Document 5 will be briefly described.

最初に、複数の表形式データの間で、共通化すべき項目(ジョインキー)を見出す。次に、複数の表形式データにおいて、値リストを比較して、双方の値リストを等価にする。値リストを等価にする際には、項目値の追加に伴ってポインタ配列を変換して、新たなポインタ配列を生成する。さらに、スレイブ表形式データに関するレコードの個数を示す存在数を、項目値に対応して格納するスレイブ側存在数配列を生成し、スレイブ側存在数配列中の存在数を参照して、項目値に対応した存在数の累計数を格納したスレイブ側累計数配列を生成する。一方、マスタ側のレコード番号が示すポインタ配列中のポインタ値を取り出し、ポインタ値が指し示す項目値に対応したスレイブ側存在数配列中の要素を特定し、マスタ側のレコード番号と対応付けて、マスタ表形式データの各レコードに対応するスレイブ表形式データのレコード数を示すレコード数指示配列中に収容し、レコード数指示配列中のレコード数を参照して、マスタ側のレコード番号に対応した、レコード数の累計数を格納するマスタ側累計数配列を生成する。さらに、マスタ側累計数配列に関して、レコード数の累計数の総和を求め、当該総和の数だけの要素を収容可能な、結合された表形式データに関する新たなレコードを特定するための新たなレコード番号配列中の新たなレコード番号と、マスタ側累計数配列中の要素とを比較することにより、重複を考慮した、マスタ表形式データにおけるレコード番号を収容したマスタ側順序集合配列を求める。次に、マスタ側順序集合配列中の要素であるマスタ表形式データにおけるレコード番号により指し示される、スレイブ表形式データに関するポインタ配列中の要素を特定し、スレイブ表形式データに関するポインタ配列中の要素が指し示す、スレイブ側累計数配列中の要素を特定し、これをスレイブ側の開始アドレスとして一時的に保持し、新たなレコード番号配列中のレコード番号と、当該レコード番号により特定されるマスタ累計数配列中の要素と、スレイブ側の開始アドレスとから、重複を考慮した、スレイブ表形式データにおけるレコード番号を収容したスレイブ側順序集合配列を求める。   First, an item (join key) to be shared is found among a plurality of tabular data. Next, in a plurality of tabular data, the value lists are compared to make both value lists equivalent. When the value lists are made equivalent, the pointer array is converted along with the addition of the item value to generate a new pointer array. Furthermore, a slave side existence number array that stores the existence number indicating the number of records related to the slave table format data corresponding to the item value is generated, and the item value is referred to by referring to the existence number in the slave side existence number array. A slave side cumulative number array storing the cumulative number of corresponding existence numbers is generated. On the other hand, the pointer value in the pointer array indicated by the record number on the master side is taken out, the element in the slave side existence number array corresponding to the item value indicated by the pointer value is specified, and the master side is associated with the record number on the master side. A record corresponding to the record number on the master side, stored in the record number indicating array indicating the number of records of the slave tabular data corresponding to each record of the tabular data, and referring to the number of records in the record number indicating array Generate a master-side cumulative number array that stores the cumulative number of numbers. Furthermore, with respect to the master side cumulative number array, a new record number for determining the total number of the total number of records and identifying a new record related to the combined tabular data that can accommodate the number of elements of the total number By comparing a new record number in the array and an element in the master side cumulative number array, a master side ordered set array that accommodates the record numbers in the master tabular data in consideration of duplication is obtained. Next, the element in the pointer array related to the slave table format data specified by the record number in the master table format data which is an element in the master side ordered set array is specified, and the element in the pointer array related to the slave table format data is Identify the element in the slave side cumulative number array to point to, temporarily hold this as the start address on the slave side, record number in the new record number array, and master cumulative number array specified by the record number A slave side ordered set array containing record numbers in the slave table format data considering duplication is obtained from the elements inside and the start address on the slave side.

もう一度図25Bに戻り、マスタ側レコードから対応するスレイブ側レコードを取得する処理を説明する。マスタ側順序集合配列[0]=0と、対応するマスタ側ジョインキーVNo「0」=0とから、マスタ側レコード0に対応するスレイブ側レコードのレコード番号は、スレイブ側順序集合配列中のスレイブ側累計数配列[0]=0番目から、スレイブ側累計数配列[0+1]=4−1=3番目までの要素、すなわち、レコード番号=4、5、6及び7であることがわかる。これにより、レコード番号対応表の1行目の
0 → 4,5,6,7
が取得できる。同様に、マスタ側レコード1に対応するスレイブ側レコードは、スレイブ側順序集合配列中のスレイブ側累計数配列[1]=4番目から、スレイブ側累計数配列[1+1]=7−1=6番目までの要素、すなわち、レコード番号=1、2及び3であることがわかる。これにより、レコード番号対応表の2行目の
1 → 1,2,3
が取得できる。さらに、同様に、マスタ側レコード2に対応するスレイブ側レコードは、スレイブ側順序集合配列中のスレイブ側累計数配列[2]=7番目から、スレイブ側累計数配列[2+1]=8−1=7番目までの要素、すなわち、レコード番号=0であることがわかる。これにより、レコード番号対応表の3行目の
2 → 0
が取得できる。
Returning to FIG. 25B again, the processing for acquiring the corresponding slave side record from the master side record will be described. From the master side ordered set array [0] = 0 and the corresponding master side join key VNo “0” = 0, the record number of the slave side record corresponding to the master side record 0 is the slave in the slave side ordered set array. It can be seen that the elements from the side cumulative number array [0] = 0th to the slave side cumulative number array [0 + 1] = 4-1 = third, that is, record numbers = 4, 5, 6, and 7. As a result, 0 → 4, 5, 6, 7 in the first row of the record number correspondence table.
Can be obtained. Similarly, the slave side record corresponding to the master side record 1 is the slave side cumulative number array [1 + 1] = 7-1 = 6th from the slave side cumulative number array [1] = 4th in the slave side ordered set array. It can be seen that the above elements, that is, record numbers = 1, 2, and 3. As a result, 1 → 1, 2, 3 in the second row of the record number correspondence table
Can be obtained. Further, similarly, the slave side record corresponding to the master side record 2 is the slave side cumulative number array [2 + 1] = 8-1 from the slave side cumulative number array [2] = 7th in the slave side ordered set array. It can be seen that up to the seventh element, that is, record number = 0. As a result, 2 → 0 in the third row of the record number correspondence table
Can be obtained.

Table_0とTable_1との間のレコード番号対応表もジョイン処理を利用して同様に取得できる。   The record number correspondence table between Table_0 and Table_1 can be obtained in the same manner using the join process.

ステップ5:ツリー構造データの生成
ステップ4において取得されたレコード番号対応表が生成されると、ツリー構造データのTopology配列と、Title_VNo配列と、Value_VNo配列に、レコード0から順に値を格納することにより、値が分離されたツリー構造データが生成される。このとき、図23に示されているような、項目Story、項目Family及び項目Nameを共通化した項目Valueに関する値番号及び値リストと、図24に示されているような、項目Titleに関する値番号及び値リストが使用される。
Step 5: Generation of tree structure data When the record number correspondence table acquired in step 4 is generated, values are stored in order from the record 0 in the Topology array, Title_VNo array, and Value_VNo array of the tree structure data. , Tree structure data with separated values is generated. At this time, as shown in FIG. 23, a value number and a value list related to the item Value in which the item Story, the item Family and the item Name are made common, and a value number related to the item Title as shown in FIG. And a list of values is used.

ステップ5−1:レコード0の生成
ステップ5−1−1:初期化
配列Topology、配列Title、配列Value、及び、親ノードのレコード識別番号を格納するスタック配列ParentNodeNoの領域をメモリに確保し、スタック配列の先頭、すなわち、ParentNodeNo[0]に−1をセットする。さらに、スタック配列ParentNodeNoに格納されている値−1をTopology[0]へコピーする。この処理は、図14Aを参照して説明した処理に類似している。
Step 5-1: Generation of record 0 Step 5-1: Initialization Array Topology, Array Title, Array Value, and stack array ParentNodeNo storing the record identification number of the parent node are secured in the memory, and the stack -1 is set to the top of the array, that is, ParentNodeNo [0]. Further, the value −1 stored in the stack array ParentNodeNo is copied to Topology [0]. This process is similar to the process described with reference to FIG. 14A.

ステップ5−1−2:値の格納
この処理は、図14Bを参照して説明したルートノード(ノード0)に対応するレコード0の生成処理と類似している。レコード番号対応表中の現在位置は、Table_0のレコード0であるので、Table_0のレコード0の項目名storyの値番号=2、及び、項目値の値番号4を取得して、Title[0]及びValue[0]にそれぞれ格納する。このように、本実施形態では、配列Title及び配列Valueに格納される値が、項目名及び項目値ではなく、項目名の値番号及び項目値の値番号である。
Step 5-1-2: Value Storage This process is similar to the record 0 generation process corresponding to the root node (node 0) described with reference to FIG. 14B. Since the current position in the record number correspondence table is the record 0 of Table_0, the value number = 2 of the item name “story” of the record 0 of Table_0 and the value number 4 of the item value are obtained, and Title [0] and Each stored in Value [0]. Thus, in this embodiment, the values stored in the array Title and the array Value are not the item name and the item value, but the item name value number and the item value value number.

ステップ5−1−3:子ノードへの移動
この処理は、図14Cを参照して説明された子ノードへの移動処理と類似している。レコード番号対応表に従って、現在位置を子ノードへ移動させる。このとき、親ノードの格納アドレス(添字)、すなわち、レコード順序番号=0をスタック配列ParentNodeNoにプッシュする。また、同図に横向き矢印で示されている配列Topology、配列Title、及び、配列Valueへのポインタが値を格納済みのレコード位置を指しているので、当該ポインタをインクリメントする(1つ先へ進める)。
Step 5-1-3: Move to Child Node This process is similar to the move process to the child node described with reference to FIG. 14C. The current position is moved to the child node according to the record number correspondence table. At this time, the storage address (subscript) of the parent node, that is, the record sequence number = 0 is pushed to the stack array ParentNodeNo. In addition, since the pointers to the array Topology, array Title, and array Value indicated by the horizontal arrows in the same figure indicate the record positions where the values have been stored, the pointer is incremented (go forward one step). ).

ステップ5−2:レコード1の生成
この処理は、図15A−Cを参照して説明されたノード1に対応するレコード1を生成する処理と類似している。最初に、スタック配列ParentNodeNoに格納されている値を配列Topology[1]へコピーする。次に、レコード番号対応表中の現在位置は、Table_1のレコード1であるので、Table_1のレコード1の項目名Familyの値番号=0及び項目値Potterの値番号=10を取得して、Title[1]及びValue[1]にそれぞれ格納する。最後に、レコード番号対応表に従って、現在位置を子ノードへ移動させる。このとき、親ノードの格納アドレス(添字)、すなわち、レコード順序番号=1をスタック配列ParentNodeNoにプッシュする。また、図15Cに横向き矢印で示されている配列Topology、配列Title、及び、配列Valueへのポインタが値を格納済みのレコード位置を指しているので、当該ポインタをインクリメントする(1つ先へ進める)。
Step 5-2: Generation of Record 1 This process is similar to the process of generating record 1 corresponding to node 1 described with reference to FIGS. 15A-C. First, the value stored in the stack array ParentNodeNo is copied to the array Topology [1]. Next, since the current position in the record number correspondence table is the record 1 of Table_1, the item name Family value number = 0 and the item value Potter value number = 10 of the record_1 of Table_1 are acquired, and Title [ 1] and Value [1], respectively. Finally, the current position is moved to the child node according to the record number correspondence table. At this time, the storage address (subscript) of the parent node, that is, the record sequence number = 1 is pushed to the stack array ParentNodeNo. Further, since the pointers to the array Topology, array Title, and array Value indicated by the horizontal arrows in FIG. 15C indicate the record positions where the values have been stored, the pointers are incremented (go forward one step). ).

以下、図16A−C乃至図20A−Cを参照して説明した処理と同様の処理を実行することにより、図21Bに示されているように、値リストが分離されたツリー構造データが生成される。この値リストが分離されたツリー構造データを、図21Cに示されるような情報ブロック型のツリー構造データへ変換する処理は前述されている通りである。   Thereafter, by executing processing similar to the processing described with reference to FIGS. 16A to 16A to 20C, tree structure data in which the value list is separated is generated as shown in FIG. 21B. The The process of converting the tree structure data from which the value list is separated into the information block type tree structure data as shown in FIG. 21C is as described above.

最後に、もう一方のTable_0のレコード1のMr. Incredibleに関する深さ優先方式のツリー構造データも同様の処理によって生成される。Table_0のレコード1の処理は、1台のプロセッサによって、Table_0のレコード0に関する処理の後に逐次的に実行されてもよいが、たとえば、複数台のプロセッサを用いて、Table_0のレコード0に関する処理と、Table_0のレコード1に関する処理が並列的に実行されてもよい。   Finally, Mr. of record 1 of the other Table_0 is recorded. The tree structure data of the depth-first method related to Incredible is also generated by the same processing. The process of the record 1 of Table_0 may be sequentially executed by one processor after the process related to the record 0 of Table_0. For example, the process related to the record 0 of Table_0 using a plurality of processors, Processing regarding the record 1 of Table_0 may be executed in parallel.

図27には、Table_0のレコード0とレコード1の両方に対して、本発明の一実施形態によるツリー構造データの生成処理を適用した結果が示されている。この例では、Table_0のレコード0が一方のルートノードに対応し、Table_1のレコード1がもう一方のルートノードに対応している。これに対して、Table_0のレコード0に対応するノードとTable_1のレコード1に対応するノードが兄弟ノードとなるようなツリー構造データを生成することも可能である。図28には、Table_0のレコード0とレコード1を兄弟ノードとして取り扱うような、本発明の別の実施形態によるツリー構造データの生成処理を適用した結果が示されている。   FIG. 27 shows the result of applying the tree structure data generation processing according to the embodiment of the present invention to both the record 0 and the record 1 of Table_0. In this example, the record 0 of Table_0 corresponds to one root node, and the record 1 of Table_1 corresponds to the other root node. On the other hand, it is also possible to generate tree structure data in which a node corresponding to the record 0 of Table_0 and a node corresponding to the record 1 of Table_1 are sibling nodes. FIG. 28 shows a result of applying the tree structure data generation processing according to another embodiment of the present invention in which the record 0 and the record 1 of Table_0 are handled as sibling nodes.

[幅優先方式の統合されたツリー構造データ]
今度は、複数のテーブルで記述されたツリー構造データ、すなわち、原データを幅優先方式の統合されたツリー構造データへ変換する本発明の一実施形態を説明する。ここでも、原データは、図12Aに示されているような複数のテーブルで記述されたツリー構造データである。以下に述べる処理ステップも、コンピュータシステム10、特に、コンピュータシステム10中のCPU12により実行される。また、処理ステップにおいて生成されるデータ、表、配列は、それぞれ、メモリ(たとえば、RAM14)中に格納される。
[Integrated tree structure data of breadth-first method]
Next, an embodiment of the present invention for converting tree structure data described in a plurality of tables, that is, original data into integrated tree structure data in a breadth-first manner will be described. Again, the original data is tree structure data described in a plurality of tables as shown in FIG. 12A. The processing steps described below are also executed by the computer system 10, particularly the CPU 12 in the computer system 10. Further, data, tables, and arrays generated in the processing steps are each stored in a memory (for example, RAM 14).

ステップ1:レコード番号対応表の作成
図13A、Bを参照して説明した、深さ優先方式におけるレコード番号対応表の作成処理が幅優先方式においても全く同様に適用される。
Step 1: Creation of Record Number Correspondence Table The record number correspondence table creation processing in the depth priority method described with reference to FIGS. 13A and 13B is also applied to the width priority method in exactly the same manner.

ステップ2:レコード番号対応表からツリー構造データの生成
次に、取得されたレコード番号対応表からツリー構造データを生成する。具体的には、幅優先方式であるため、最上位階層から順に仮想的なレコードの配列での格納位置を決定し、仮想的なレコードの配列の各レコードにTopologyフィールドの値、Titleフィールドの値、及び、Valueフィールドの値を格納する。
Step 2: Generation of tree structure data from record number correspondence table Next, tree structure data is generated from the acquired record number correspondence table. Specifically, because of the breadth-first method, the storage position in the virtual record array is determined in order from the highest layer, and the value of the Topology field, the value of the Title field, And the value of the Value field is stored.

ステップ3:レコード0の生成
最上位ノードは、Table_0のレコード0である。最上位ノードには親ノードが存在しないので、−1をTopology[0]に格納する(転送1)。Table_0のレコード0の項目名及び項目値を取得して、Title[0]及びValue[0]にそれぞれ格納する(転送2)。確定したレコード順序番号(すなわち、ノード番号、この例では、0)をレコード番号対応表に追記する(転送3)。ノード0には弟ノードが存在しないので、次のノードは、次の階層(深さ)に存在する最初のノードである。図29は、このような本発明の一実施形態による幅優先方式のツリー構造データ生成処理の説明図である。
Step 3: Generation of Record 0 The highest node is Record 0 of Table_0. Since the parent node does not exist in the highest node, −1 is stored in Topology [0] (Transfer 1). The item name and the item value of the record 0 of Table_0 are acquired and stored in Title [0] and Value [0], respectively (Transfer 2). The confirmed record sequence number (that is, the node number, 0 in this example) is added to the record number correspondence table (Transfer 3). Since there is no younger brother node in node 0, the next node is the first node existing in the next hierarchy (depth). FIG. 29 is an explanatory diagram of such a breadth-first tree structure data generation process according to an embodiment of the present invention.

ステップ4:レコード1の生成
次に、図30を参照して、ツリー構造データのレコード1の生成処理を説明する。現在のノードは、Table_1のレコード1である。親ノードのレコード順序番号は0であるので、Topology[1]に0を格納する(転送1)。Table_1のレコード1の項目名及び項目値を取得して、Title[1]及びValue[1]にそれぞれ格納する(転送2)。確定したノード番号(この例では、1)をレコード番号対応表に追記する(転送3)。ノード1には弟ノードが存在するので、次のノードは弟ノードである。
Step 4: Generation of Record 1 Next, a generation process of the record 1 of the tree structure data will be described with reference to FIG. The current node is record 1 of Table_1. Since the record order number of the parent node is 0, 0 is stored in Topology [1] (Transfer 1). The item name and item value of the record 1 of Table_1 are acquired and stored in Title [1] and Value [1], respectively (Transfer 2). The confirmed node number (1 in this example) is added to the record number correspondence table (transfer 3). Since node 1 has a younger brother node, the next node is a younger brother node.

ステップ5:レコード2の生成
次に、図31を参照して、ツリー構造データのレコード2の生成処理を説明する。現在のノードは、Table_1のレコード2である。親ノードのレコード順序番号は0であるので、Topology[2]に0を格納する(転送1)。Table_1のレコード2の項目名及び項目値を取得して、Title[2]及びValue[2]にそれぞれ格納する(転送2)。確定したノード番号(この例では、2)をレコード番号対応表に追記する(転送3)。ノード2には弟ノードが存在せず、かつ、同世代にも未確定ノードが存在しないので、次のノードは、次の階層(深さ)に存在する最初のノードである。
Step 5: Generation of Record 2 Next, the generation process of the record 2 of the tree structure data will be described with reference to FIG. The current node is the record 2 of Table_1. Since the record order number of the parent node is 0, 0 is stored in Topology [2] (Transfer 1). The item name and item value of the record 2 of Table_1 are acquired and stored in Title [2] and Value [2], respectively (Transfer 2). The confirmed node number (2 in this example) is added to the record number correspondence table (transfer 3). Since there is no younger brother node in node 2 and there is no undetermined node in the same generation, the next node is the first node existing in the next hierarchy (depth).

ステップ6:レコード3の生成
次に、図32を参照して、ツリー構造データのレコード3の生成処理を説明する。現在のノードは、Table_2のレコード1である。親ノードのレコード順序番号は1であるので、Topology[3]に1を格納する(転送1)。Table_2のレコード1の項目名及び項目値を取得して、Title[3]及びValue[3]にそれぞれ格納する(転送2)。確定したノード番号(この例では、3)をレコード番号対応表に追記する(転送3)。ノード3には弟ノードが存在するので、次のノードは弟ノードである。
Step 6: Generation of Record 3 Next, the generation process of the record 3 of the tree structure data will be described with reference to FIG. The current node is record 1 of Table_2. Since the record order number of the parent node is 1, 1 is stored in Topology [3] (Transfer 1). The item name and item value of the record 1 of Table_2 are acquired and stored in Title [3] and Value [3], respectively (Transfer 2). The confirmed node number (3 in this example) is added to the record number correspondence table (transfer 3). Since the younger brother node exists in the node 3, the next node is the younger brother node.

ステップ7:レコード4の生成
次に、ツリー構造データのレコード4の生成処理を説明する。現在のノードは、Table_2のレコード2である。親ノードのレコード順序番号は1であるので、Topology[4]に1を格納する(転送1)。Table_2のレコード2の項目名及び項目値を取得して、Title[4]及びValue[4]にそれぞれ格納する(転送2)。確定したノード番号(この例では、4)をレコード番号対応表に追記する(転送3)。ノード4には弟ノードが存在するので、次のノードは弟ノードである。
Step 7: Generation of Record 4 Next, generation processing of the record 4 of the tree structure data will be described. The current node is record 2 of Table_2. Since the record order number of the parent node is 1, 1 is stored in Topology [4] (Transfer 1). The item name and item value of the record 2 of Table_2 are acquired and stored in Title [4] and Value [4], respectively (Transfer 2). The confirmed node number (4 in this example) is added to the record number correspondence table (transfer 3). Since node 4 has a brother node, the next node is a brother node.

ステップ8:レコード5の生成
次に、図33を参照して、ツリー構造データのレコード5の生成処理を説明する。現在のノードは、Table_2のレコード3である。親ノードのレコード順序番号は1であるので、Topology[5]に1を格納する(転送1)。Table_2のレコード3の項目名及び項目値を取得して、Title[5]及びValue[5]にそれぞれ格納する(転送2)。確定したノード番号(この例では、5)をレコード番号対応表に追記する(転送3)。ノード5には弟ノードは存在しないが、同世代の未確定ノードが存在するので、次のノードは同世代の次のデータである。
Step 8: Generation of Record 5 Next, the generation process of the record 5 of the tree structure data will be described with reference to FIG. The current node is record 3 of Table_2. Since the record order number of the parent node is 1, 1 is stored in Topology [5] (Transfer 1). The item name and item value of the record 3 of Table_2 are acquired and stored in Title [5] and Value [5], respectively (Transfer 2). The confirmed node number (5 in this example) is added to the record number correspondence table (transfer 3). Although there is no younger brother node in node 5, there is an indeterminate node of the same generation, so the next node is the next data of the same generation.

ステップ9:レコード6の生成
次に、図34を参照して、ツリー構造データのレコード6の生成処理を説明する。現在のノードは、Table_2のレコード0である。親ノードのレコード順序番号は2であるので、Topology[6]に2を格納する(転送1)。Table_2のレコード0の項目名及び項目値を取得して、Title[6]及びValue[6]にそれぞれ格納する(転送2)。確定したノード番号(この例では、6)をレコード番号対応表に追記する(転送3)。ノード6には、弟ノードも次の世代のノードも存在しないので、ツリー構造データの生成処理が完了する。
Step 9: Generation of Record 6 Next, the generation process of the record 6 of the tree structure data will be described with reference to FIG. The current node is record 0 of Table_2. Since the record order number of the parent node is 2, 2 is stored in Topology [6] (Transfer 1). The item name and item value of record 0 of Table_2 are acquired and stored in Title [6] and Value [6], respectively (Transfer 2). The confirmed node number (6 in this example) is added to the record number correspondence table (transfer 3). Since the node 6 has neither a younger brother node nor a next generation node, the generation process of the tree structure data is completed.

幅優先方式によるツリー構造データの生成処理の場合も、深さ優先方式と同様に、値リストが分離されたツリー構造データの生成処理や、順序集合と値リストを用いたツリー構造データの生成処理を実現することが可能である。図35は、本発明の一実施形態による幅優先方式のツリー構造データ生成処理を用いて生成された情報ブロック型ツリー構造データの説明図である。   In the case of tree structure data generation processing using the breadth-first method, as well as the depth-first method, tree structure data generation processing with separated value lists and tree structure data generation processing using ordered sets and value lists are performed. It is possible to realize. FIG. 35 is an explanatory diagram of information block type tree structure data generated using the tree structure data generation process of the breadth-first method according to an embodiment of the present invention.

最後に、もう一方のTable_0のレコード1のMr. Incredibleに関する幅優先方式のツリー構造データも同様の処理によって生成される。Table_0のレコード1の処理は、1台のプロセッサによって、Table_0のレコード0に関する処理の後に逐次的に実行されてもよいが、たとえば、複数台のプロセッサを用いて、Table_0のレコード0に関する処理と、Table_0のレコード1に関する処理が並列的に実行されてもよい。   Finally, Mr. of record 1 of the other Table_0 is recorded. The breadth-first tree structure data related to Incredibles is also generated by the same process. The process of the record 1 of Table_0 may be sequentially executed by one processor after the process related to the record 0 of Table_0. For example, the process related to the record 0 of Table_0 using a plurality of processors, Processing regarding the record 1 of Table_0 may be executed in parallel.

図36には、Table_0のレコード0とレコード1の両方に対して、本発明の一実施形態によるツリー構造データの生成処理を適用した結果が示されている。この例では、Table_0のレコード0が一方のルートノードに対応し、Table_1のレコード1がもう一方のルートノードに対応している。これに対して、Table_0のレコード0に対応するノードとTable_1のレコード1に対応するノードが兄弟ノードとなるようなツリー構造データを生成することも可能である。図37には、Table_0のレコード0とレコード1を兄弟ノードとして取り扱うような、本発明の別の実施形態によるツリー構造データの生成処理を適用した結果が示されている。   FIG. 36 shows the result of applying the tree structure data generation processing according to the embodiment of the present invention to both the record 0 and the record 1 of Table_0. In this example, the record 0 of Table_0 corresponds to one root node, and the record 1 of Table_1 corresponds to the other root node. On the other hand, it is also possible to generate tree structure data in which a node corresponding to the record 0 of Table_0 and a node corresponding to the record 1 of Table_1 are sibling nodes. FIG. 37 shows a result of applying tree structure data generation processing according to another embodiment of the present invention in which the records 0 and 1 of Table_0 are handled as sibling nodes.

本発明は、以上の実施の形態に限定されることなく、特許請求の範囲に記載された発明の範囲内で、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。   The present invention is not limited to the above embodiments, and various modifications can be made within the scope of the invention described in the claims, and these are also included in the scope of the present invention. Needless to say.

Claims (20)

各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データを各レコードがレコードの並び順を表すレコード順序番号によって識別される仮想的なレコードの配列として記憶装置上に構築する装置であって、
階層構造を有する複数のテーブルを階層毎にマッチングキーによってマッチングさせ、親側のテーブルと子側のテーブルとの間で親子関係がある行番号同士の行番号対応表を作成する手段と、
前記行番号対応表から親子関係がある前記親側のテーブル中の行番号及び前記子側のテーブル中の行番号を探索する手段と、
前記探索する手段によって見つけられた順に、前記子側のテーブル中の行に割り当てられるレコード順序番号を決定し、前記仮想的なレコードの配列中の前記レコード順序番号によって識別される位置に、親子関係フィールド値として前記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、前記ノードの属性名フィールド値として前記子側のテーブル中の行に属する項目名を格納し、前記ノードの属性値フィールド値として前記子側のテーブル中の行に属する項目値を格納する手段と、
を備える装置。
A tree structure data composed of a plurality of nodes, each node being represented by an attribute name and attribute value, is constructed on the storage device as a virtual record array identified by a record sequence number in which each record represents the order of the records. A device,
Means for matching a plurality of tables having a hierarchical structure with a matching key for each hierarchy, and creating a row number correspondence table between row numbers having a parent-child relationship between the parent side table and the child side table;
Means for searching a row number in the parent table and a row number in the child table having a parent-child relationship from the row number correspondence table;
A record sequence number assigned to a row in the child table is determined in the order found by the searching means, and a parent-child relationship is determined at the position identified by the record sequence number in the virtual record array. Store the record order number of the parent node of the node corresponding to the row in the child table as a field value, store the item name belonging to the row in the child table as the attribute name field value of the node, Means for storing an item value belonging to a row in the child table as an attribute value field value of the node;
A device comprising:
前記ノードの属性名フィールド値が前記レコード順序番号の順番に格納されている配列から、前記レコード順序番号の順に前記属性名を一意に特定する属性名番号が格納されている属性名番号配列、前記属性名番号配列の要素の順番に前記属性名番号によって一意に特定される前記属性名が格納されている属性名配列、前記レコード順序番号の順に前記属性値を一意に特定する属性値番号が格納されている属性値番号配列、及び、前記属性値番号配列の要素の順番に前記属性値番号によって一意に特定される前記属性値が格納されている属性値配列を作成する手段をさらに備える、請求項1に記載の装置。   An attribute name number array in which attribute name numbers that uniquely identify the attribute names are stored in the order of the record order numbers from an array in which the attribute name field values of the nodes are stored in the order of the record order numbers; An attribute name array storing the attribute name uniquely specified by the attribute name number in the order of the elements of the attribute name number array, and an attribute value number for uniquely specifying the attribute value in the order of the record sequence number An attribute value number array, and means for creating an attribute value array in which the attribute value uniquely specified by the attribute value number is stored in the order of the elements of the attribute value number array. Item 2. The apparatus according to Item 1. 前記複数のテーブルが部品の親子関係を表現するストラクチャー型部品表であり、
前記行番号対応表を作成する手段が、最上位階層のテーブルとして、前記ツリー構造データのルートノードに対応する部品を選択し、その他の階層のデータとして同一の前記ストラクチャー型部品表を利用する、
請求項1又は2に記載の装置。
The plurality of tables is a structure-type parts table that represents a parent-child relationship of parts,
The means for creating the row number correspondence table selects a part corresponding to the root node of the tree structure data as a table of the highest hierarchy, and uses the same structure type parts table as data of other hierarchy,
The apparatus according to claim 1 or 2.
前記行番号対応表を作成する手段が、前記マッチングキーとして、前記親側のテーブルにおけるデータの出現順に割り当てられた順序番号と、前記子側のテーブルにおけるデータに対応する親側のデータに割り当てられた順序番号との対を利用する、請求項1又は2に記載の装置。   The means for creating the row number correspondence table is assigned to the parent side data corresponding to the sequence number assigned in the order of appearance of the data in the parent side table and the data in the child side table as the matching key. The apparatus according to claim 1 or 2, wherein a pair with a specific sequence number is used. 階層構造を有する複数のテーブルを記憶するメモリを備え、前記複数のテーブルを各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データに変換し前記メモリに格納する装置であって、
前記複数のテーブルを階層毎にマッチングキーによってマッチングさせるマッチング部と、
前記複数のテーブルの階層毎にマッチングした親側のテーブルと子側のテーブルとの間で親子関係がある行番号同士の行番号対応表を作成する対応表作成部と、
前記行番号対応表から親子関係がある前記親側のテーブル中の行番号及び前記子側のテーブル中の行番号を探索する探索部と、
前記探索部によって見つけられた順に、前記子側のテーブル中の行に割り当てられるレコード順序番号を決定し、前記仮想的なレコードの配列中の前記レコード順序番号によって識別される位置に、親子関係フィールド値として前記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、前記ノードの属性名フィールド値として前記子側のテーブル中の行に属する項目名を格納し、前記ノードの属性値フィールド値として前記子側のテーブル中の行に属する前記原データに属する項目値を格納するレコード生成部と、
を備え、
前記ツリー構造データが、各レコードがレコードの並び順を表す前記レコード順序番号によって識別される、仮想的なレコードの配列として前記メモリに構築される装置。
A device comprising a memory for storing a plurality of tables having a hierarchical structure, wherein the plurality of tables are converted into tree structure data composed of a plurality of nodes each represented by an attribute name and attribute value, and stored in the memory. And
A matching unit for matching the plurality of tables with a matching key for each hierarchy;
A correspondence table creation unit that creates a row number correspondence table between row numbers having a parent-child relationship between a parent table and a child table matched for each of the plurality of table hierarchies;
A search unit for searching for a row number in the parent-side table having a parent-child relationship and a row number in the child-side table from the row-number correspondence table;
A record sequence number assigned to a row in the child table is determined in the order found by the search unit, and a parent-child relationship field is located at a position identified by the record sequence number in the virtual record array. Storing the record order number of the parent node of the node corresponding to the row in the child side table as a value, storing the item name belonging to the row in the child side table as the attribute name field value of the node, A record generation unit for storing an item value belonging to the original data belonging to a row in the child table as an attribute value field value of a node;
With
An apparatus in which the tree structure data is constructed in the memory as a virtual record array in which each record is identified by the record order number representing the order of records.
前記ノードの属性名フィールド値が前記レコード順序番号の順番に格納されている配列から、前記レコード順序番号の順に前記属性名を一意に特定する属性名番号が格納されている属性名番号配列、前記属性名番号配列の要素の順番に前記属性名番号によって一意に特定される前記属性名が格納されている属性名配列、前記レコード順序番号の順に前記属性値を一意に特定する属性値番号が格納されている属性値番号配列、及び、前記属性値番号配列の要素の順番に前記属性値番号によって一意に特定される前記属性値が格納されている属性値配列を作成する値分離部をさらに備える、請求項5に記載の装置。   An attribute name number array in which attribute name numbers that uniquely identify the attribute names are stored in the order of the record order numbers from an array in which the attribute name field values of the nodes are stored in the order of the record order numbers; An attribute name array storing the attribute name uniquely specified by the attribute name number in the order of the elements of the attribute name number array, and an attribute value number for uniquely specifying the attribute value in the order of the record sequence number And a value separation unit for creating an attribute value array in which the attribute value uniquely specified by the attribute value number is stored in the order of the attribute value number array and the element of the attribute value number array. The apparatus according to claim 5. 前記複数のテーブルが部品の親子関係を表現するストラクチャー型部品表であり、
前記対応表作成部が、最上位階層の表構造の中間データとして、前記ツリー構造データのルートノードに対応する部品を選択し、その他の表構造の中間データとして同一の前記ストラクチャー型部品表を利用する、
請求項5又は6に記載の装置。
The plurality of tables is a structure-type parts table that represents a parent-child relationship of parts,
The correspondence table creation unit selects a part corresponding to the root node of the tree structure data as intermediate data of the table structure of the highest hierarchy, and uses the same structure type parts table as intermediate data of other table structures To
Apparatus according to claim 5 or 6.
前記対応表作成部が、前記マッチングキーとして、前記親側のテーブルにおけるデータの出現順に割り当てられた順序番号と、前記子側のテーブルにおけるデータに対応する親側のデータに割り当てられた順序番号との対を利用する、請求項5又は6に記載の装置。   The correspondence table creation unit, as the matching key, a sequence number assigned in the order of appearance of data in the parent table, a sequence number assigned to the parent data corresponding to the data in the child table, 7. An apparatus according to claim 5 or 6, wherein a pair of 各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データを各レコードがレコードの並び順を表すレコード順序番号によって識別される仮想的なレコードの配列として記憶装置上に構築する方法であって、
階層構造を有する複数のテーブルを階層毎にマッチングキーによってマッチングさせ、親側のテーブルと子側のテーブルとの間で親子関係がある行番号同士の行番号対応表を作成するステップと、
前記行番号対応表から親子関係がある前記親側のテーブル中の行番号及び前記子側のテーブル中の行番号を探索し、探索によって見つけられた順に、前記子側のテーブル中の行に割り当てられるレコード順序番号を決定し、前記仮想的なレコードの配列中の前記レコード順序番号によって識別される位置に、親子関係フィールド値として前記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、前記ノードの属性名フィールド値として前記子側のテーブル中の行に属する項目名を格納し、前記ノードの属性値フィールド値として前記子側のテーブル中の行に属する項目値を格納するステップと、
を備える方法。
A tree structure data composed of a plurality of nodes, each node being represented by an attribute name and attribute value, is constructed on the storage device as a virtual record array identified by a record sequence number in which each record represents the order of the records. A method,
A step of matching a plurality of tables having a hierarchical structure with a matching key for each hierarchy, and creating a row number correspondence table between row numbers having a parent-child relationship between the parent side table and the child side table;
A row number in the parent table having a parent-child relationship and a row number in the child table are searched from the row number correspondence table, and assigned to the rows in the child table in the order found by the search. Record of the parent node of the node corresponding to the row in the child side table as a parent-child relationship field value at the position identified by the record sequence number in the virtual record array An order number is stored, an item name belonging to a row in the child side table is stored as an attribute name field value of the node, and an item value belonging to a row in the child side table is stored as an attribute value field value of the node A step of storing
A method comprising:
前記ノードの属性名フィールド値が前記レコード順序番号の順番に格納されている配列から、前記レコード順序番号の順に前記属性名を一意に特定する属性名番号が格納されている属性名番号配列、前記属性名番号配列の要素の順番に前記属性名番号によって一意に特定される前記属性名が格納されている属性名配列、前記レコード順序番号の順に前記属性値を一意に特定する属性値番号が格納されている属性値番号配列、及び、前記属性値番号配列の要素の順番に前記属性値番号によって一意に特定される前記属性値が格納されている属性値配列を作成するステップをさらに備える、請求項9に記載の方法。   An attribute name number array in which attribute name numbers that uniquely identify the attribute names are stored in the order of the record order numbers from an array in which the attribute name field values of the nodes are stored in the order of the record order numbers; An attribute name array storing the attribute name uniquely specified by the attribute name number in the order of the elements of the attribute name number array, and an attribute value number for uniquely specifying the attribute value in the order of the record sequence number And further comprising the step of creating an attribute value array in which the attribute value number and the attribute value uniquely specified by the attribute value number are stored in the order of the elements of the attribute value number array. Item 10. The method according to Item 9. 前記複数のテーブルが部品の親子関係を表現するストラクチャー型部品表であり、
前記行番号対応表を作成するステップにおいて、最上位階層のテーブルとして、前記ツリー構造データのルートノードに対応する部品を選択し、その他の階層のテーブルとして同一の前記ストラクチャー型部品表を利用する、
請求項9又は10に記載の方法。
The plurality of tables is a structure-type parts table that represents a parent-child relationship of parts,
In the step of creating the row number correspondence table, the part corresponding to the root node of the tree structure data is selected as the highest hierarchy table, and the same structure type parts table is used as the other hierarchy table.
The method according to claim 9 or 10.
前記行番号対応表を作成するステップにおいて、前記マッチングキーとして、前記親側のテーブルにおけるデータの出現順に割り当てられた順序番号と、前記子側のテーブルにおけるデータに対応する親側のデータに割り当てられた順序番号との対を利用する、請求項9又は10に記載の方法。   In the step of creating the row number correspondence table, the matching key is assigned to the order number assigned in the order of appearance of data in the parent side table and the parent side data corresponding to the data in the child side table. The method according to claim 9 or 10, wherein a pair with a specific sequence number is used. 階層構造を有する複数のテーブルを記憶するメモリを備え、前記複数のテーブルを各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データに変換し前記メモリに格納するコンピュータに、
前記複数のテーブルを階層毎にマッチングキーによってマッチングさせる機能と、
前記複数のテーブルの階層毎に、マッチングした親側のテーブルと子側のテーブルとの間で、親子関係がある行番号同士の行番号対応表を作成する機能と、
前記行番号対応表から親子関係がある前記親側のテーブル中の行番号及び前記子側のテーブル中の行番号を探索する機能と、
探索によって見つけられた順に、前記子側のテーブル中の行に割り当てられる前記レコード順序番号を決定する機能と、
前記ツリー構造データが、各レコードがレコードの並び順を表す前記レコード順序番号によって識別される、仮想的なレコードの配列として前記メモリに構築されるように、前記仮想的なレコードの配列中の前記レコード順序番号によって識別される位置に、親子関係フィールド値として前記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、前記ノードの属性名フィールド値として前記子側のテーブル中の行に属する項目名を格納し、前記ノードの属性値フィールド値として前記子側のテーブル中の行に属する項目値を格納する機能と、
を実現させるためのプログラム。
A computer comprising a memory for storing a plurality of tables having a hierarchical structure, wherein the plurality of tables are converted into tree structure data composed of a plurality of nodes each represented by an attribute name and an attribute value, and stored in the memory.
A function of matching the plurality of tables for each hierarchy by a matching key;
A function for creating a row number correspondence table between row numbers having a parent-child relationship between the matched parent-side table and child-side table for each of the plurality of table hierarchies;
A function of searching for a row number in the parent table and a row number in the child table having a parent-child relationship from the row number correspondence table;
A function for determining the record sequence numbers assigned to the rows in the child table in the order found in the search;
The tree structure data is constructed in the memory as an array of virtual records, wherein each record is identified by the record sequence number representing the order of the records. At the position identified by the record sequence number, the record sequence number of the parent node of the node corresponding to the row in the child side table is stored as the parent-child relationship field value, and the child side attribute value is stored as the attribute name field value of the node. A function for storing item names belonging to the rows in the table, and storing item values belonging to the rows in the child table as attribute value field values of the nodes;
A program to realize
前記ノードの属性名フィールド値が前記レコード順序番号の順番に格納されている配列から、前記レコード順序番号の順に前記属性名を一意に特定する属性名番号が格納されている属性名番号配列、前記属性名番号配列の要素の順番に前記属性名番号によって一意に特定される前記属性名が格納されている属性名配列、前記レコード順序番号の順に前記属性値を一意に特定する属性値番号が格納されている属性値番号配列、及び、前記属性値番号配列の要素の順番に前記属性値番号によって一意に特定される前記属性値が格納されている属性値配列を作成する機能を前記コンピュータさらに実現させるための請求項13に記載のプログラム。   An attribute name number array in which attribute name numbers that uniquely identify the attribute names are stored in the order of the record order numbers from an array in which the attribute name field values of the nodes are stored in the order of the record order numbers; An attribute name array storing the attribute name uniquely specified by the attribute name number in the order of the elements of the attribute name number array, and an attribute value number for uniquely specifying the attribute value in the order of the record sequence number The computer further realizes a function of creating an attribute value number array and an attribute value array storing the attribute value uniquely specified by the attribute value number in the order of the elements of the attribute value number array The program according to claim 13 for causing the program to occur. 前記複数のテーブルが部品の親子関係を表現するストラクチャー型部品表であり、
最上位階層のテーブルとして、前記ツリー構造データのルートノードに対応する部品を選択し、その他の階層のテーブルとして同一の前記ストラクチャー型部品表を利用する機能を前記コンピュータにさらに実現させるための請求項13又は14に記載のプログラム。
The plurality of tables is a structure-type parts table that represents a parent-child relationship of parts,
Claims for further realizing the function of selecting a part corresponding to a root node of the tree structure data as a top hierarchy table and using the same structure type BOM as a table of other hierarchy The program according to 13 or 14.
前記マッチングキーとして、前記親側のテーブルにおけるデータの出現順に割り当てられた順序番号と、前記子側のテーブルにおけるデータに対応する親側のデータに割り当てられた順序番号との対を利用する機能を前記コンピュータにさらに実現させるための請求項13又は14に記載のプログラム。   A function of using a pair of a sequence number assigned in the order of appearance of data in the parent table and a sequence number assigned to parent data corresponding to the data in the child table as the matching key. The program according to claim 13 or 14 for further realizing the computer. 請求項13乃至16のうちの何れか1項に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体。   The computer-readable recording medium which recorded the program of any one of Claim 13 thru | or 16. 階層構造を有する複数のテーブルを記憶するメモリを備え、前記複数のテーブルを各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データに変換し前記メモリに格納するコンピュータに、
前記複数のテーブルを階層毎にマッチングキーによってマッチングさせる機能と、
前記複数のテーブルの階層毎に、マッチングした親側のテーブルと子側のテーブルとの間で、親子関係がある行番号同士の行番号対応表を作成する機能と、
前記行番号対応表から親子関係がある前記親側のテーブル中の行番号及び前記子側のテーブル中の行番号を探索する機能と、
探索によって見つけられた順に、前記子側のテーブル中の行に割り当てられるレコード順序番号を決定する機能と、
前記ツリー構造データが、各レコードがレコードの並び順を表す前記レコード順序番号によって識別される、仮想的なレコードの配列として前記メモリに構築されるように、前記仮想的なレコードの配列中の前記レコード順序番号によって識別される位置に、親子関係フィールド値として前記子側のテーブル中の行に対応するノードの親ノードのレコード順序番号を格納し、前記ノードの属性名フィールド値として前記子側のテーブル中の行に属する項目名を格納し、前記ノードの属性値フィールド値として前記子側のテーブル中の行に属する項目値を格納する機能と、
を実現させるためのプログラムプロダクト。
A computer comprising a memory for storing a plurality of tables having a hierarchical structure, wherein the plurality of tables are converted into tree structure data composed of a plurality of nodes each represented by an attribute name and an attribute value, and stored in the memory.
A function of matching the plurality of tables for each hierarchy by a matching key;
A function for creating a row number correspondence table between row numbers having a parent-child relationship between the matched parent-side table and child-side table for each of the plurality of table hierarchies;
A function of searching for a row number in the parent table and a row number in the child table having a parent-child relationship from the row number correspondence table;
A function for determining a record sequence number assigned to a row in the child table in the order found in the search;
The tree structure data is constructed in the memory as an array of virtual records, wherein each record is identified by the record sequence number representing the order of the records. At the position identified by the record sequence number, the record sequence number of the parent node of the node corresponding to the row in the child side table is stored as the parent-child relationship field value, and the child side attribute value is stored as the attribute name field value of the node. A function for storing item names belonging to the rows in the table, and storing item values belonging to the rows in the child table as attribute value field values of the nodes;
Program product to realize.
各ノードが属性名及び属性値によって表現される複数のノードからなるツリー構造データを記録したコンピュータ読み取り可能な記録媒体であって、
前記ツリー構造データは、各レコードがレコードの並び順を表すレコード順序番号によって識別される、仮想的なレコードの配列によって表現され、
レコードは、前記レコードに対応するノードの親ノードのレコード順序番号を格納する親子関係フィールドと、前記ノードに属する属性名を指定する属性名番号を格納する属性名フィールドと、前記ノードに属する属性値を指定する属性値番号を格納する属性値フィールドとを含み、
前記ノードの親ノードが前記ノードに対応する前記レコードに含まれる前記親子関係フィールドに格納されている前記レコード順序番号によって特定され、
前記ノードに属する属性名が前記ノードに対応する前記レコードに含まれる前記属性名番号と前記属性名が前記属性名番号の順番に格納されている属性名配列とによって特定され、
前記ノードに属する属性値が前記ノードに対応する前記レコードに含まれる前記属性値番号と前記属性値が前記属性名番号の順番に格納されている属性値配列とによって特定される、
コンピュータ読み取り可能な記録媒体。
A computer-readable recording medium that records tree structure data composed of a plurality of nodes each node is represented by an attribute name and an attribute value,
The tree structure data is represented by a virtual array of records, each record being identified by a record sequence number representing the order of the records,
The record includes a parent-child relationship field that stores a record sequence number of a parent node of a node corresponding to the record, an attribute name field that stores an attribute name number that specifies an attribute name that belongs to the node, and an attribute value that belongs to the node An attribute value field for storing an attribute value number for specifying
A parent node of the node is identified by the record sequence number stored in the parent-child relationship field included in the record corresponding to the node;
The attribute name belonging to the node is specified by the attribute name number included in the record corresponding to the node and the attribute name array in which the attribute name is stored in the order of the attribute name number,
An attribute value belonging to the node is specified by the attribute value number included in the record corresponding to the node and an attribute value array in which the attribute values are stored in the order of the attribute name numbers;
Computer-readable recording medium.
前記レコード順序番号は、深さ優先探索又は幅優先探索の順で前記複数のノードのうちの各ノードに対応する前記レコードに割り当てられている、請求項19に記載のコンピュータ読み取り可能な記録媒体。   The computer-readable recording medium according to claim 19, wherein the record order number is assigned to the record corresponding to each node of the plurality of nodes in the order of depth-first search or width-first search.
JP2009551334A 2008-01-28 2008-01-28 Method and apparatus for building tree structure data from tables Active JP5241738B2 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2008/051185 WO2009095981A1 (en) 2008-01-28 2008-01-28 Method and device for building tree-structured data from table

Publications (2)

Publication Number Publication Date
JPWO2009095981A1 true JPWO2009095981A1 (en) 2011-05-26
JP5241738B2 JP5241738B2 (en) 2013-07-17

Family

ID=40912352

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009551334A Active JP5241738B2 (en) 2008-01-28 2008-01-28 Method and apparatus for building tree structure data from tables

Country Status (2)

Country Link
JP (1) JP5241738B2 (en)
WO (1) WO2009095981A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8288332B2 (en) 2009-07-30 2012-10-16 The Procter & Gamble Company Fabric care conditioning composition in the form of an article
JP5032602B2 (en) * 2010-01-21 2012-09-26 株式会社東芝 Recognition device
JP5873782B2 (en) * 2012-09-19 2016-03-01 株式会社日立ソリューションズ Terminal management device, terminal management system
WO2014065919A1 (en) 2012-10-22 2014-05-01 Ab Initio Technology Llc Profiling data with location information
EP3594821B1 (en) 2014-03-07 2023-08-16 AB Initio Technology LLC Managing data profiling operations related to data type
WO2018096998A1 (en) * 2016-11-28 2018-05-31 株式会社ターボデータラボラトリー Data compressor, computer program, and data compression method
US11068540B2 (en) 2018-01-25 2021-07-20 Ab Initio Technology Llc Techniques for integrating validation results in data profiling and related systems and methods
JP2021067962A (en) * 2018-02-21 2021-04-30 株式会社ターボデータラボラトリー Information processing system and information processing method
CN109213775B (en) * 2018-09-18 2022-11-01 深圳壹账通智能科技有限公司 Search method, search device, computer equipment and storage medium
CN110727687B (en) * 2019-10-23 2023-06-27 京东方科技集团股份有限公司 Material list conversion method and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2000267906A (en) * 1999-03-19 2000-09-29 Mitsubishi Electric Corp Database model converting method
JP4045400B2 (en) * 2001-08-24 2008-02-13 富士ゼロックス株式会社 Search device and search method
JP3861044B2 (en) * 2002-10-24 2006-12-20 株式会社ターボデータラボラトリー Conversion method of chained join table to tree structure and conversion program
JP4398664B2 (en) * 2003-04-03 2010-01-13 株式会社セック XML data search method and search apparatus, program, and recording medium recording the program
US20060085451A1 (en) * 2004-10-15 2006-04-20 Microsoft Corporation Mapping of schema data into data structures

Also Published As

Publication number Publication date
JP5241738B2 (en) 2013-07-17
WO2009095981A1 (en) 2009-08-06

Similar Documents

Publication Publication Date Title
JP5241738B2 (en) Method and apparatus for building tree structure data from tables
CN107491561B (en) Ontology-based urban traffic heterogeneous data integration system and method
JP4681544B2 (en) Array generation method, information processing apparatus, and program
JP4886693B2 (en) Information processing method, information processing apparatus, and information processing program
US7752192B2 (en) Method and system for indexing and serializing data
KR101572299B1 (en) Method for converting system model, computer program, and system model conversion device
JP4712718B2 (en) Array generation method and array generation program
US20080270435A1 (en) Method for Handling Tree-Type Data Structure, Information Processing Device, and Program
US9753960B1 (en) System, method, and computer program for dynamically generating a visual representation of a subset of a graph for display, based on search criteria
JP2005521954A (en) Method and apparatus for querying a relational database
WO2015010509A1 (en) One-dimensional liner space-based method for implementing trie tree dictionary search
JP2002318798A (en) Method and system for user-controllable data grouping in structural document translation
Lima et al. Application modeling for the semantic web
JP2007087216A (en) Hierarchical dictionary preparing device, program and hierarchical dictionary preparing method
CN102982095B (en) A kind of body automatic creation system based on thesaurus and method thereof
KR101244466B1 (en) Method for data modelling using NoSQL
JP3797821B2 (en) Ontology construction support device
JP2011154653A (en) Data modelling method, device, and program
CN113590894A (en) Dynamic and efficient remote sensing image metadata warehousing retrieval method
JP4681555B2 (en) Node insertion method, information processing apparatus, and node insertion program
JP2005521953A (en) Method and apparatus for querying a relational database
JP2005250820A (en) Xml document classification method in storage system
CN112328543B (en) IFC data efficient storage method based on label attribute graph structure
KR20010045025A (en) A logical structure information extractor for xml documents
JP5374456B2 (en) Method of operating document search apparatus and computer program for causing computer to execute the same

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20110815

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20121218

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130205

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130402

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20160412

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

Ref document number: 5241738

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313113

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250