JP2001256249A - Device and method for setting group number - Google Patents

Device and method for setting group number

Info

Publication number
JP2001256249A
JP2001256249A JP2000064030A JP2000064030A JP2001256249A JP 2001256249 A JP2001256249 A JP 2001256249A JP 2000064030 A JP2000064030 A JP 2000064030A JP 2000064030 A JP2000064030 A JP 2000064030A JP 2001256249 A JP2001256249 A JP 2001256249A
Authority
JP
Japan
Prior art keywords
group number
record
records
group
data record
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
JP2000064030A
Other languages
Japanese (ja)
Other versions
JP3555542B2 (en
Inventor
Kazue Ishikawa
和重 石川
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP2000064030A priority Critical patent/JP3555542B2/en
Publication of JP2001256249A publication Critical patent/JP2001256249A/en
Application granted granted Critical
Publication of JP3555542B2 publication Critical patent/JP3555542B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Abstract

PROBLEM TO BE SOLVED: To solve a problem such that a processing speed is decelerated when there are massive data records and related records. SOLUTION: On the basis of contents in a related record table 12, a group setting processing part 21 sets a group number to a correspondent data record table 11. Except for data records directly related in the related record table, however, data records are indirectly related through the other related record sometimes and in that case, the same group number is set while including the indirectly related data records as well.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、グループ番号設定
装置およびグループ番号設定方法に関し、特に、データ
レコードおよび関連レコードを備え、新規に追加された
関連レコードの内容に基づいて、データレコードにグル
ープ番号を設定するグループ番号設定装置およびグルー
プ番号設定方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a group number setting apparatus and a group number setting method, and more particularly, to a group number setting apparatus and a group number setting method, comprising a data record and a related record. The present invention relates to a group number setting device and a group number setting method for setting a group number.

【0002】[0002]

【従来の技術】従来、この種のグループ番号設定装置と
して、特開平2−234269号公報に開示された技術
がある。本技術は、1レコード毎にデータを入力するデ
ータ入力手段と、入力したレコードが1つ前に入力した
レコードと同一のグループに属するか否かをグルーピン
グ項目の項目値をもとに判定するグループ識別手段と、
連続した2レコードが同一のグループに属すると判定さ
れたときに連続した2レコードの項目値をペアにして出
力する2項関係生成手段と、生成された項目値のペアを
もとに全てのグループについて矛盾のない項目値の出現
順序を表現する統合出現順序情報を随時に作成・実行す
る統合出現順序更新手段と、全てのデータの入力終了後
に前記統合出現順序情報をもとに項目名順序情報を出力
する項目名順序出力手段とを備えている。かかる構成に
おいて、概略、項目名について全グループ内の項目値の
出現順に矛盾しない一貫した順序の並びを実現してい
る。また、同様のグループ番号設定装置としては、特開
平8−241228号公報に開示された技術が知られて
いる。
2. Description of the Related Art Conventionally, as this kind of group number setting device, there is a technology disclosed in Japanese Patent Application Laid-Open No. 2-234269. The present technology includes a data input unit that inputs data for each record, and a group that determines whether an input record belongs to the same group as a record input immediately before based on an item value of a grouping item. Identification means;
A binary relation generating means for outputting the item values of two consecutive records as a pair when it is determined that two consecutive records belong to the same group, and all groups based on the pair of the generated item values; Means for generating and executing integrated appearance order information expressing the appearance order of item values consistent with each other, and item name order information based on the integrated appearance order information after all data has been input. Is output. In such a configuration, the order of appearance of the item values in all the groups is generally consistent with the item names in a consistent order. Further, as a similar group number setting device, a technology disclosed in Japanese Patent Application Laid-Open No. 8-241228 is known.

【0003】[0003]

【発明が解決しようとする課題】上述した従来のグルー
プ番号設定装置においては、大量のデータレコード、お
よび、関連レコードがある場合に、処理速度が低速にな
ってしまうといった課題があった。さらに、このような
グループ番号設定装置においては、所定のデータレコー
ドを削除する際に、当該データレコードが削除対象外で
あると判断された場合、このデータレコードに関連づい
ている全データレコードを削除対象外とする処理が必要
である。
In the above-described conventional group number setting apparatus, there is a problem that the processing speed is reduced when there are a large number of data records and related records. Further, in such a group number setting device, when a predetermined data record is deleted, if it is determined that the data record is not to be deleted, all data records related to this data record are deleted. Exempt processing is required.

【0004】本発明は、上記課題にかんがみてなされた
もので、上記必要とされる所定のデータレコードを削除
する際の処理を実現可能とするとともに、データベース
に付与されたインデックスを利用することにより処理速
度の高速化を実現することが可能なグループ番号設定装
置およびグループ番号設定方法の提供を目的とする。
[0004] The present invention has been made in view of the above-mentioned problems, and makes it possible to realize a process for deleting the above-mentioned required predetermined data record, and to utilize an index given to a database. It is an object of the present invention to provide a group number setting device and a group number setting method capable of realizing a high processing speed.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するた
め、請求項1にかかる発明は、各レコードをグループ番
号にて管理するデータレコードテーブルとこのデータレ
コードテーブルと二項関係を有するレコードを有する関
連レコードテーブルとを備え、上記データレコードテー
ブルのグループ番号を設定するグループ番号設定装置で
あって、少なくとも1つ以上の関連レコードを有する関
連レコードテーブルから順次関連レコードに格納された
関連名を読み出す関連名読出手段と、上記データレコー
ドテーブルにて読み出された関連名を含む二つのレコー
ドを特定する特定手段と、上記特定されたデータレコー
ドのグループ番号を上記関連レコードの読み出し順に従
って新しく生成したグループ番号によって設定する設定
手段とを具備する構成としてある。
According to a first aspect of the present invention, there is provided a data record table for managing each record by a group number, and a record having a binary relationship with the data record table. A group number setting device for setting a group number of the data record table, wherein the group name setting device sequentially reads relation names stored in the relation records from a relation record table having at least one relation record. Name reading means, specifying means for specifying two records including the related name read in the data record table, and a group number of the specified data record newly generated according to the reading order of the related record Setting means for setting by number. There as.

【0006】上記のように構成した請求項1にかかる発
明においては、データレコード、および、その関連レコ
ード(二項関係)からなるシステムにおいて、新規に追
加された関連レコードの内容に基づき、データレコード
にグループ番号を設定する方法を実現するものである。
本発明にかかるグループ番号設定装置は、各レコードを
グループ番号にて管理するデータレコードテーブルと、
このデータレコードテーブルと二項関係を有するレコー
ドを有する関連レコードテーブルとを備え、このデータ
レコードテーブルのグループ番号を設定する。
According to the first aspect of the present invention, in a system comprising a data record and its related record (binary relation), a data record is created based on the contents of a newly added related record. This implements a method of setting a group number in a.
A group number setting device according to the present invention, a data record table that manages each record by a group number,
A data record table and a related record table having a record having a binary relation are provided, and a group number of the data record table is set.

【0007】かかる設定において、関連名読出手段は、
少なくとも1つ以上の関連レコードを有する関連レコー
ドテーブルから順次関連レコードに格納された関連名を
読み出すとともに、特定手段にて、データレコードテー
ブルから読み出された関連名を含む二つのレコードを特
定する。そして、設定手段が、特定されたデータレコー
ドのグループ番号を関連レコードの読み出し順に従って
新しく生成したグループ番号に設定する。
In such a setting, the related name reading means includes:
The related names stored in the related record are sequentially read from the related record table having at least one or more related records, and the specifying unit specifies two records including the related names read from the data record table. Then, the setting means sets the group number of the specified data record to the newly generated group number in accordance with the reading order of the related records.

【0008】また、請求項2にかかる発明は、請求項1
に記載のグループ番号設定装置において、上記設定手段
は、上記特定手段にて特定された二つのレコードのグル
ープ番号が未設定の場合、この二つのグループ番号に、
上記設定手段にて生成した同一のグループ番号を設定す
る構成としてある。上記のように構成した請求項2にか
かる発明においては、特定手段にて特定された二つのレ
コードのグループ番号が未設定の場合、設定手段は、こ
の二つのグループ番号に、設定手段にて生成した同一の
グループ番号を設定する。
[0008] The invention according to claim 2 is based on claim 1.
In the group number setting device described in the above, the setting means, when the group number of the two records specified by the specifying means is not set, to the two group numbers,
The same group number generated by the setting means is set. In the invention according to claim 2 configured as described above, when the group numbers of the two records specified by the specifying unit are not set, the setting unit generates the two group numbers by the setting unit. Set the same group number.

【0009】さらに、請求項3にかかる発明は、請求項
1または請求項2のいずれかに記載のグループ番号設定
装置において、上記設定手段は、上記特定手段にて特定
された二つのレコードのグループ番号について、一方の
レコードのグループ番号のみが設定されている場合、当
該レコードのグループ番号を設定されていない他方のグ
ループ番号に設定する構成としてある。
Further, according to a third aspect of the present invention, in the group number setting device according to any one of the first and second aspects, the setting means comprises a group of two records specified by the specifying means. When only the group number of one record is set for the number, the group number of the record is set to the other group number that is not set.

【0010】上記のように構成した請求項3にかかる発
明においては、特定手段にて特定された二つのレコード
のグループ番号について、一方のレコードのグループ番
号のみが設定されている場合、設定手段は、このレコー
ドのグループ番号を設定されていない他方のグループ番
号に設定する。
In the invention according to claim 3 configured as described above, if only the group number of one record is set for the group numbers of the two records specified by the specifying means, the setting means , The group number of this record is set to the other group number that has not been set.

【0011】さらに、請求項4にかかる発明は、請求項
1〜請求項3のいずれかに記載のグループ番号設定装置
において、上記設定手段は、上記特定手段にて特定され
た二つのレコードのグループ番号について、既に両方の
レコードのグループ番号が設定されている場合、これら
の既に設定されているグループ番号どうしを比較し、小
さい値のグループ番号を大きい値のグループ番号を有す
るレコードのグループ番号として設定する構成としてあ
る。
According to a fourth aspect of the present invention, in the group number setting device according to any one of the first to third aspects, the setting means includes a group of two records specified by the specifying means. If the group numbers of both records have already been set, compare these already set group numbers and set the smaller group number as the group number of the record with the larger group number. There is a configuration to do.

【0012】上記のように構成した請求項4にかかる発
明においては、特定手段にて特定された二つのレコード
のグループ番号について、既に両方のレコードのグルー
プ番号が設定されている場合、設定手段は、これらの既
に設定されているグループ番号どうしを比較し、小さい
値のグループ番号を決定する。そして、比較にて大きい
値とされたグループ番号と一致するレコード番号を有す
るレコードの当該レコード番号を上述した小さいレコー
ド番号に更新し設定する。
In the invention according to claim 4 configured as described above, with respect to the group numbers of the two records specified by the specifying means, when the group numbers of both records have already been set, the setting means Then, these already set group numbers are compared with each other to determine a group number having a smaller value. Then, the record number of the record having the record number that matches the group number that has been set to a large value in the comparison is updated and set to the above-described small record number.

【0013】さらに、請求項5にかかる発明は、請求項
1〜請求項4のいずれかに記載のグループ番号設定装置
において、上記関連レコードテーブルは、上記データレ
コードテーブルと所定の整数Nにて形成されるN項関係
を有する構成としてある。上記のように構成した請求項
5にかかる発明においては、関連レコードテーブルとデ
ータレコードテーブルとを所定の整数NにてN項関係を
有するように形成する。
According to a fifth aspect of the present invention, in the group number setting apparatus according to any one of the first to fourth aspects, the related record table is formed by the data record table and a predetermined integer N. This is a configuration having an N-term relation. In the invention according to claim 5 configured as described above, the related record table and the data record table are formed to have an N-term relationship with a predetermined integer N.

【0014】このように、各レコードをグループ番号に
て管理するデータレコードテーブルとこのデータレコー
ドテーブルと二項関係を有するレコードを有する関連レ
コードテーブルとを備え、上記データレコードテーブル
のグループ番号を設定する手法は必ずしも実体のある装
置に限られる必要はなく、その方法としても機能するこ
とは容易に理解できる。
As described above, a data record table for managing each record by a group number and a related record table having a record having a binary relation with the data record table are provided, and a group number of the data record table is set. The method is not necessarily limited to a substantial device, and it can be easily understood that the method also functions as the method.

【0015】このため、請求項6にかかる発明は、各レ
コードをグループ番号にて管理するデータレコードテー
ブルとこのデータレコードテーブルと二項関係を有する
レコードを有する関連レコードテーブルとを備え、上記
データレコードテーブルのグループ番号を設定するグル
ープ番号設定方法であって、少なくとも1つ以上の関連
レコードを有する関連レコードテーブルから順次関連レ
コードに格納された関連名を読み出す関連名読出工程
と、上記データレコードテーブルにて読み出された関連
名を含む二つのレコードを特定する特定工程と、上記特
定されたデータレコードのグループ番号を上記関連レコ
ードの読み出し順に従って新しく生成したグループ番号
によって設定する設定工程とを具備する構成としてあ
る。すなわち、必ずしも実体のある装置に限らず、その
方法としても有効であることに相違はない。
According to a sixth aspect of the present invention, there is provided a data record table for managing each record by a group number and a related record table having a record having a binary relation with the data record table. A group number setting method for setting a group number of a table, comprising: a related name reading step of sequentially reading related names stored in related records from a related record table having at least one related record; And a setting step of setting the group number of the specified data record by a newly generated group number in accordance with the reading order of the related record. There is a configuration. In other words, there is no difference in that the present invention is not necessarily limited to a substantial device and is also effective as a method.

【0016】[0016]

【発明の実施の形態】以下、図面にもとづいて本発明の
実施形態を説明する。図1は、本発明の一実施形態にか
かるグループ番号設定装置をブロック図により示してい
る。ここで、本実施形態にかかるグループ番号設定装置
はデータレコードテーブルおよびその関連レコードテー
ブル(二項関係)からなるシステムにおいて、新規に追
加された関連レコードの内容に基づき、データレコード
テーブルにグループ番号を設定する方法を実現するもの
である。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram showing a group number setting device according to an embodiment of the present invention. Here, in a system including a data record table and its related record table (binary relation), the group number setting device according to the present embodiment assigns a group number to the data record table based on the content of a newly added related record. This implements a setting method.

【0017】図1に示すように、本実施形態のグループ
番号設定装置は、記憶装置(データベース)10とデー
タ処理装置20を有しており、また、記憶装置10はデ
ータレコードテーブル11と関連レコードテーブル12
を有し、データ処理装置20はグループ番号生成処理部
22とグループ更新処理部23とを有している。
As shown in FIG. 1, the group number setting device of the present embodiment has a storage device (database) 10 and a data processing device 20, and the storage device 10 has a data record table 11 and a related record. Table 12
And the data processing device 20 has a group number generation processing unit 22 and a group update processing unit 23.

【0018】ここで、グループ設定処理部21は関連レ
コードテーブル12の内容に基づいて、対応するデータ
レコードテーブル11にグループ番号を設定する。但
し、関連レコードテーブル内で直接関連づけられている
データレコード同士でない場合でも、他の関連レコード
を通して間接的に関連づけられていることがあり、その
場合には間接的に関連づけられているデータレコードも
含めて同じグループ番号を設定する必要がある。
Here, the group setting processor 21 sets a group number in the corresponding data record table 11 based on the contents of the related record table 12. However, even if the data records are not directly related to each other in the related record table, they may be related indirectly through other related records. The same group number.

【0019】また、既に異なるグループ番号が設定され
ている場合に、グループ番号のマージが必要になる。こ
こでは、これらの関連付け処理を(1)直接関連づけら
れている場合の処理、および(2)既に関連づけられて
おり、グループ番号のマージを行う場合の処理に分解
し、間接的に関連づけられている場合でも、(1)およ
び(2)の組み合わせで処理を実行する。
Further, when a different group number has already been set, it is necessary to merge the group numbers. Here, these association processes are decomposed into (1) a process in a case where they are directly associated, and (2) a process in which a group number is already associated and a group number is merged, and are indirectly associated. Even in this case, the processing is executed by a combination of (1) and (2).

【0020】グループ番号のマージ処理では、二つの異
なるグループ番号を一つのグループ番号にマージするこ
とになるが、この場合、一方のグループ番号をもつ全デ
ータレコードのグループ番号を他方のグループ番号に変
更することになる。データレコード内のグループ番号列
にはデータベース・インデックスを置いているため、指
定されたグループ番号を持つデータレコードを高速に検
索する。
In the merging of group numbers, two different group numbers are merged into one group number. In this case, the group numbers of all data records having one group number are changed to the other group number. Will do. Since the database index is set in the group number column in the data record, the data record having the specified group number can be searched at high speed.

【0021】例えば、データレコード1〜4について、
関連レコード1でデータレコード1とデータレコード2
が、関連レコード2でデータレコード3とデータレコー
ド4が、関連レコード3でデータレコード2とデータレ
コード3が関連づいているとする。この場合、データレ
コード1〜4のすべてに同じグループ番号を設定する必
要がある。関連レコード1、および、関連レコード2で
は、(1)直接関連づけられている場合の処理、を行
い、関連レコード3では、グループ番号のマージを行う
場合の処理、を行うことで、すべてのデータレコードに
同じグループ番号を設定することができる。
For example, for data records 1 to 4,
Data record 1 and data record 2 in related record 1
However, it is assumed that data record 3 and data record 4 are related in related record 2, and data record 2 and data record 3 are related in related record 3. In this case, it is necessary to set the same group number for all of the data records 1 to 4. The related record 1 and the related record 2 perform (1) the process when directly related, and the related record 3 perform the process when the group numbers are merged, so that all the data records are processed. Can be set to the same group number.

【0022】このようにして、たとえ直接関連づけられ
ていない場合でも、関連づいているすべてのデータレコ
ードに同じグループ番号を設定することが可能になる。
ここでは、以下の前提に基づいている。 (1)全く関連づいていないデータレコードはグループ
番号を保持する必要はない。 (2)関連レコードが削除されることはない。
In this way, even if they are not directly related, it is possible to set the same group number for all related data records.
Here, it is based on the following premise. (1) Data records that are not related at all need not hold the group number. (2) Related records are not deleted.

【0023】図1において、グループ設定処理部21は
関連レコードテーブル12から新規に追加された関連レ
コードを取り出し、対応するデータレコードをデータレ
コードテーブル11から取り出す。関連レコードはデー
タレコードに関する二項関係を保持しているため、対応
するデータレコードは二件取り出される。
In FIG. 1, the group setting processor 21 extracts a newly added related record from the related record table 12 and extracts a corresponding data record from the data record table 11. Since the related record holds the binary relation regarding the data record, two corresponding data records are extracted.

【0024】取り出された二件のデータレコードにグル
ープ番号が設定されているかどうかで、この後の処理は
以下の三通りに別れる。 (1)どちらのデータレコードにもグループ番号が設定
されていない場合には、グループ番号生成処理部22か
ら新しい番号を取り出し、両方のデータレコードにこの
グループ番号を設定し、データレコードテーブル11に
保存する。グループ番号生成処理部22では、次のグル
ープ番号を保持し、一つ返す毎にインクリメントする。
The subsequent processing is divided into the following three depending on whether or not the group numbers are set in the two retrieved data records. (1) If a group number is not set in either data record, a new number is taken out from the group number generation processing unit 22, this group number is set in both data records, and stored in the data record table 11. I do. The group number generation processing unit 22 holds the next group number and increments each time one is returned.

【0025】(2)片方のデータレコードにグループ番
号が設定されている場合には、設定されていないデータ
レコードにこの番号を設定し、データレコードテーブル
11に保存する。
(2) If a group number is set in one of the data records, this number is set in the data record that has not been set, and is stored in the data record table 11.

【0026】(3)どちらのデータレコードにもグルー
プ番号が設定されている場合には、二つのグループ番号
を、大きい方、小さい方に分類し、グループ更新処理部
23に移る。グループ更新処理部23では、まず、デー
タレコードテーブル11から大きい方の番号をグループ
番号として持つ全データレコードを取り出し、小さい方
の番号を新しいグループ番号として設定する。ここで、
上述したように、本実施形態においては、グループ設定
処理部21が本発明にかかる関連名読出手段および特定
手段を構成し、グループ更新処理部23、グループ番号
生成処理部22およびグループ設定処理部21が設定手
段を構成する。
(3) If a group number is set in both data records, the two group numbers are classified into a larger group and a smaller group number, and the process proceeds to the group update processing section 23. The group update processing unit 23 first extracts all data records having the larger number as the group number from the data record table 11, and sets the smaller number as a new group number. here,
As described above, in the present embodiment, the group setting processing unit 21 constitutes the related name reading unit and the specifying unit according to the present invention, and the group update processing unit 23, the group number generation processing unit 22, and the group setting processing unit 21 Constitute the setting means.

【0027】次に、図1のブロック図および図2のフロ
ーチャートを参照して本実施例の全体の動作について詳
細に説明する。まず最初に、未処理の関連レコードを取
り出す。次に、関連レコードで関連づけられている二個
のデータレコード1,2を取り出す(ステップA2)。
ここで、データレコード1,2のグループ番号が設定さ
れていない場合には(ステップA3,A4)、新しい番
号を取り出し(ステップA6)、その番号をデータレコ
ード1,2のグループ番号として設定する(ステップA
7)。
Next, the overall operation of this embodiment will be described in detail with reference to the block diagram of FIG. 1 and the flowchart of FIG. First, an unprocessed related record is extracted. Next, two data records 1 and 2 related by the related record are extracted (step A2).
If the group numbers of the data records 1 and 2 have not been set (steps A3 and A4), a new number is extracted (step A6), and the number is set as the group number of the data records 1 and 2 (step A6). Step A
7).

【0028】また、データレコード1はグループ番号が
設定されていないが(ステップA3)、データレコード
2はグループ番号が設定されている場合には(ステップ
A4)、データレコード1にデータレコード2のグルー
プ番号を設定する(ステップA8)。
If the data record 1 has no group number set (step A3), but the data record 2 has a group number set (step A4), the data record 1 has the group number of the data record 2. A number is set (step A8).

【0029】一方、データレコード1はグループ番号が
設定されているが(ステップA3)、データレコード2
がグループ番号が設定されていない場合には(ステップ
A5)、データレコード2にデータレコード1のグルー
プ番号を設定する(ステップA9)。最後に、データレ
コード1,2ともにグループ番号が設定されている場合
には(ステップA3,A5)、小さい方のグループ番号
を決定し(ステップA10)、二個のグループ番号のう
ち大きい方のグループ番号を持つ全データレコードを取
り出し(ステップA11)、小さい方のグループ番号に
基づいて、これらのデータレコードのグループ番号を更
新する(ステップA12)。
On the other hand, although the data record 1 has a group number set (step A3), the data record 2
If no group number has been set (step A5), the group number of data record 1 is set in data record 2 (step A9). Finally, when the group numbers are set for both data records 1 and 2 (steps A3 and A5), the smaller group number is determined (step A10), and the larger group number of the two group numbers is set. All data records having numbers are retrieved (step A11), and the group numbers of these data records are updated based on the smaller group number (step A12).

【0030】次に、ステップA11にて取り出した全デ
ータレコードについて、番号の更新が完了したか否かを
判定し(ステップA13)、完了していなければ、ステ
ップS12に戻り番号を更新する処理を繰り返す。この
ように、ステップA7,A8,A9,A12の設定およ
び更新が完了した場合は、関連レコードデータベースを
検索し、上記各グループ番号の設定および更新の処理に
ついて未処理の関連レコードが残っているか否かを判定
する、すなわち、全関連レコードについての処理が終了
したか否かを判定する(ステップA14)。そして、残
っている場合はステップA1に戻り上述した処理を繰り
返す。
Next, it is determined whether or not the update of the numbers has been completed for all the data records retrieved in step A11 (step A13). If not, the process returns to step S12 to update the numbers. repeat. As described above, when the setting and updating of steps A7, A8, A9, and A12 are completed, the related record database is searched to determine whether there is any unprocessed related record for the setting and updating of each group number. That is, it is determined whether or not the processing has been completed for all the related records (step A14). If there is any remaining, the process returns to step A1 to repeat the above-described processing.

【0031】次に、具体例を用いて説明する。図3、
4、5に示す例では、図3において処理前のデータレコ
ード、および、関連レコードの内容を示している。最初
の関連レコードでは、どちらのデータレコードもグルー
プ番号を持たないため、新しいグループ番号1を生成
し、このグループ番号をデータレコード1,2に設定し
ている。2番目、および、3番目の関連レコードも、最
初の関連レコード同様、どちらのデータレコードもグル
ープ番号を持たないため、新しいグループ番号2,3を
生成し、これらのグループ番号をそれぞれ、データレコ
ード3,4、および、データレコード6,8に設定して
いる。
Next, a specific example will be described. FIG.
In the examples shown in FIGS. 4 and 5, the contents of the data record and the related record before processing are shown in FIG. In the first related record, since neither data record has a group number, a new group number 1 is generated, and this group number is set in the data records 1 and 2. Similarly to the first related record, both the second and third related records have no group number, so new group numbers 2 and 3 are generated, and these group numbers are respectively assigned to data record 3 , 4, and data records 6, 8.

【0032】4番目の関連レコードでは、片方のデータ
レコード4のみがグループ番号2を持っているため、他
方のデータレコード10にも同じグループ番号2を設定
している。5番目の関連レコードでは、1〜3番目の関
連レコードと同様、どちらのデータレコードもグループ
番号を持たないため、新しいグループ番号4を生成し、
このグループ番号をデータレコード5,9に設定してい
る。ここまでの結果は図4に示されている。最後に、6
番目の関連レコードでは、どちらのデータレコードもグ
ループ番号を持つため、大きい方の番号2を持つデータ
レコード3,4,10に、小さい方のグループ番号1を
設定している。最終結果は図5に示されている。
In the fourth related record, since only one of the data records 4 has the group number 2, the same group number 2 is set in the other data record 10. In the fifth related record, similarly to the first to third related records, since neither data record has a group number, a new group number 4 is generated.
This group number is set in data records 5 and 9. The results so far are shown in FIG. Finally, 6
In the second related record, since both data records have group numbers, the smaller group number 1 is set to the data records 3, 4, and 10 having the larger number 2. The end result is shown in FIG.

【0033】次に、本発明の他の実施例について図面を
参照して詳細に説明する。本実施例は、関連レコード
が、N個のデータレコード間の関連を保持している点で
異なる。実施例の構成は図1と変わらないため、図1を
そのまま利用して説明する。ここでは、以下の前提に基
づいている。 (1)全く関連づいていないデータレコードはグループ
番号を保持する必要はない。 (2)関連レコードが削除されることはない。 (3)各関連レコードでは、常に同じ数の関連を保持す
る必要はなく、例えば、あるものが三個のデータレコー
ド間の関連を、他のものが五個のデータレコード間の関
連を保持することが可能である。
Next, another embodiment of the present invention will be described in detail with reference to the drawings. The present embodiment is different in that the related record holds the relation between the N data records. Since the configuration of the embodiment is the same as that of FIG. 1, the description will be made using FIG. 1 as it is. Here, it is based on the following premise. (1) Data records that are not related at all need not hold the group number. (2) Related records are not deleted. (3) In each related record, it is not always necessary to hold the same number of relations. For example, one holds the relation between three data records and the other holds the relation between five data records. It is possible.

【0034】図1において、グループ設定処理部21は
関連レコードテーブル12から新規に追加された関連レ
コードを取り出し、対応するデータレコードをデータレ
コードテーブル11から取り出す。ここで、関連レコー
ドはデータレコードに関するN項関係を保持しているた
め、対応するデータレコードはN件取り出される。取り
出されたN件のデータレコードにグループ番号が設定さ
れているかどうかで、この後の処理は以下の3通りに別
れる。
In FIG. 1, the group setting processing section 21 extracts a newly added related record from the related record table 12 and extracts a corresponding data record from the data record table 11. Here, since the related record holds the N-ary relation of the data record, N corresponding data records are extracted. The subsequent processing is divided into the following three depending on whether or not the group number is set in the extracted N data records.

【0035】(1)どのデータレコードにもグループ番
号が設定されていない場合には、グループ番号生成処理
部22から新しい番号を取り出し、N件のデータレコー
ド全てにこのグループ番号を設定し、データレコードテ
ーブル11に保存する。グループ番号生成処理部22で
は、次のグループ番号を保持し、一つ返す毎にインクリ
メントする。
(1) If no group number is set in any data record, a new number is taken out from the group number generation processing unit 22, and this group number is set in all N data records. Store in Table 11. The group number generation processing unit 22 holds the next group number and increments each time one is returned.

【0036】(2)グループ番号が設定されている全デ
ータレコードに同じグループ番号が設定されている場合
には、設定されていないデータレコードにこの番号を設
定し、データレコードテーブル11に保存する。
(2) If the same group number is set for all data records for which a group number has been set, this number is set for the data record for which no group number has been set, and stored in the data record table 11.

【0037】(3)上記以外の場合には、小さい方の番
号を決定後、グループ更新処理部23に移る。グループ
更新処理部23では、まず、データレコードテーブル1
1から決定した小さい方の番号以外の番号をグループ番
号としてもつ全データレコードを取り出し、決定した小
さい方の番号を新しいグループ番号として設定する。
(3) In cases other than the above, after the smaller number is determined, the process proceeds to the group update processing unit 23. In the group update processing unit 23, first, the data record table 1
All data records having a group number other than the smaller number determined from 1 are taken out, and the smaller number determined is set as a new group number.

【0038】次に、図1および図6のフローチャートを
参照して本実施例の全体の動作について詳細に説明す
る。まず最初に、未処理の関連レコードを取り出す。次
に、関連レコードで関連づけられているN個のデータレ
コード1〜Nを取り出す(ステップA2)。ここで、全
てのデータレコード1〜Nのグループ番号が設定されて
いない場合には(ステップA3)、新しい番号を取り出
し(ステップA5)、その番号をデータレコード1〜N
のグループ番号として設定する(ステップA6)。グル
ープ番号が設定されているデータレコードに全て同じグ
ループ番号が設定されている場合には(ステップA
4)、グループ番号が設定されていないデータレコード
にこのグループ番号を設定する(ステップA7)。
Next, the overall operation of this embodiment will be described in detail with reference to the flowcharts of FIGS. First, an unprocessed related record is extracted. Next, N data records 1 to N associated with the related record are extracted (step A2). Here, if the group numbers of all the data records 1 to N are not set (step A3), a new number is taken out (step A5), and the number is assigned to the data records 1 to N.
(Step A6). If the same group number is set in all data records to which the group number is set (step A
4) The group number is set to the data record for which the group number is not set (step A7).

【0039】最後に、グループ番号が設定されているデ
ータレコードに異なるグループ番号が設定されている場
合には(ステップA4)、もっとも小さいグループ番号
を決定し(ステップA8)、グループ番号が設定されて
いないデータレコードにこのグループ番号を設定する
(ステップA9)。次に、このもっとも小さいグループ
番号以外のグループ番号を持つ全データレコードを取り
出し(ステップA10)、このもっとも小さいグループ
番号に基づいて、これらのデータレコードのグループ番
号を更新する(ステップ11)。
Finally, when a different group number is set in the data record in which the group number is set (step A4), the smallest group number is determined (step A8), and the group number is set. This group number is set to a data record that does not exist (step A9). Next, all data records having group numbers other than the smallest group number are extracted (step A10), and the group numbers of these data records are updated based on the smallest group number (step 11).

【0040】次に、ステップA10にて取り出した全デ
ータレコードについて、番号の更新が完了したか否かを
判定し(ステップA12)、完了していなければ、ステ
ップA11に戻り番号を更新する処理を繰り返す。この
ように、ステップA6,A7,A11の設定および更新
が完了した場合は、関連レコードデータベースを検索し
上記各グループ番号の設定および更新の処理について未
処理の関連レコードが残っているか否かを判定する。す
なわち、全関連レコードについての処理が終了したか否
かを判定する(ステップA13)。そして、残っている
場合はステップA1に戻り上述した処理を繰り返す。
Next, it is determined whether or not the update of the numbers has been completed for all the data records retrieved in step A10 (step A12). If not completed, the process returns to step A11 to update the numbers. repeat. As described above, when the setting and updating in steps A6, A7, and A11 are completed, the related record database is searched to determine whether there is any unprocessed related record for the setting and updating of each group number. I do. That is, it is determined whether or not the processing has been completed for all the related records (step A13). If there is any remaining, the process returns to step A1 to repeat the above-described processing.

【0041】次に、具体例について説明する。図7、
8、9に示す例では、図7において処理前のデータレコ
ード、および、関連レコードの内容を示している。最初
の関連レコードでは、どちらのデータレコードもグルー
プ番号を持たないため、新しいグループ番号1を生成
し、このグループ番号をデータレコード1,2に設定し
ている。2番目、および、3番目の関連レコードも、最
初の関連レコード同様、どちらのデータレコードもグル
ープ番号を持たないため、新しいグループ番号2,3を
生成し、これらのグループ番号をそれぞれ、データレコ
ード3,4および、データレコード6,8に設定してい
る。
Next, a specific example will be described. FIG.
In the examples shown in FIGS. 8 and 9, the contents of the data record and the related record before processing are shown in FIG. In the first related record, since neither data record has a group number, a new group number 1 is generated, and this group number is set in the data records 1 and 2. Similarly to the first related record, both the second and third related records have no group number, so new group numbers 2 and 3 are generated, and these group numbers are respectively assigned to data record 3 , 4 and data records 6, 8.

【0042】4番目の関連レコードでは、一つのデータ
レコード4のみがグループ番号2を持っているため、そ
の他のデータレコード9,10にも同じグループ番号2
を設定している。ここまでの結果は図8に示されてい
る。最後に、5番目の関連レコードでは、三つのデータ
レコードともグループ番号を持つため、もっとも小さい
グループ番号1以外のグループ番号2,3を持つデータ
レコード3,4,6,8,9,10に、もっとも小さい
グループ番号1を設定している。最終結果は図9に示さ
れている。
In the fourth related record, since only one data record 4 has the group number 2, the other data records 9 and 10 have the same group number 2.
Is set. The results so far are shown in FIG. Finally, in the fifth related record, since all three data records have group numbers, data records 3, 4, 6, 8, 9, and 10 having group numbers 2 and 3 other than the smallest group number 1 The smallest group number 1 is set. The end result is shown in FIG.

【0043】[0043]

【発明の効果】第1の効果は、無限に続く可能性がある
関連レコードによる関連パスを走査することなしに、ま
た、これらを効率的に行うために、主記憶装置内に関連
する全データレコードを取り出すことなしに、処理でき
ることにある。その理由は、データレコード上のグルー
プ番号を直接更新しているためであり、また、(1)直
接関連づけられている場合の処理、および(2)既に関
連づけられており、グループ番号のマージを行う場合の
処理、に分解し、間接的に関連づけられている場合で
も、(1)および(2)の組み合わせで処理しているた
めである。
The first advantage is that all data related in main storage is stored in the main memory without scanning the related path by the related record which can be infinitely long, and in order to do so efficiently. It can be processed without retrieving records. The reason is that the group number on the data record is directly updated. Further, (1) the processing in the case of the direct association, and (2) the group number already associated and the group number is merged. This is because, even when the processing is decomposed into and the processing is indirectly related, the processing is performed by the combination of (1) and (2).

【0044】第2の効果は、大量のデータレコード、お
よび、関連レコードがある場合でも、高速にグループ番
号の設定ができることになる。その理由は、グループ番
号をデータレコードの一部として格納しているため、デ
ータベース・インデックスを置くことで、指定されたグ
ループ番号を持つデータレコードを高速に検索できるた
めである。
The second effect is that the group number can be set at high speed even when there are a large number of data records and related records. The reason is that since the group number is stored as a part of the data record, the data record having the designated group number can be searched at high speed by placing the database index.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の一実施形態にかかるグループ番号設定
装置のブロック図である。
FIG. 1 is a block diagram of a group number setting device according to an embodiment of the present invention.

【図2】第一の実施例の全体の動作を処理内容を示した
フローチャートである。
FIG. 2 is a flowchart showing the processing contents of the entire operation of the first embodiment.

【図3】第一の実施例における処理前のデータレコード
テーブルおよび関連レコードテーブルの内容を示した図
である。
FIG. 3 is a diagram showing contents of a data record table and a related record table before processing in the first embodiment.

【図4】第一の実施例における処理中のデータレコード
テーブルおよび関連レコードテーブルの内容を示した図
である。
FIG. 4 is a diagram showing contents of a data record table and a related record table during processing in the first embodiment.

【図5】第一の実施例における処理後のデータレコード
テーブルおよび関連レコードテーブルの内容を示した図
である。
FIG. 5 is a diagram showing contents of a data record table and a related record table after processing in the first embodiment.

【図6】第二の実施例の全体の動作を処理内容を示した
フローチャートである。
FIG. 6 is a flowchart showing processing contents of the entire operation of the second embodiment.

【図7】第二の実施例における処理前のデータレコード
テーブルおよび関連レコードテーブルの内容を示した図
である。
FIG. 7 is a diagram showing contents of a data record table and a related record table before processing according to the second embodiment.

【図8】第二の実施例における処理中のデータレコード
テーブルおよび関連レコードテーブルの内容を示した図
である。
FIG. 8 is a diagram showing the contents of a data record table and a related record table during processing in the second embodiment.

【図9】第二の実施例における処理後のデータレコード
テーブルおよび関連レコードテーブルの内容を示した図
である。
FIG. 9 is a diagram showing contents of a data record table and a related record table after processing in the second embodiment.

【符号の説明】[Explanation of symbols]

1 記憶装置(データベース) 2 データ処理装置 11 データレコードテーブル 12 関連レコードテーブル 21 グループ設定処理部 22 グループ番号生成処理部 23 グループ更新処理部 REFERENCE SIGNS LIST 1 storage device (database) 2 data processing device 11 data record table 12 related record table 21 group setting processing unit 22 group number generation processing unit 23 group update processing unit

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 各レコードをグループ番号で管理するデ
ータレコードテーブルと、このデータレコードテーブル
と二項関係を有するレコードを有する関連レコードテー
ブルとを備え、上記データレコードテーブルのグループ
番号を設定するグループ番号設定装置であって、 少なくとも1つ以上の関連レコードを有する関連レコー
ドテーブルから順次関連レコードに格納された関連名を
読み出す関連名読出手段と、 上記データレコードテーブルにて読み出された関連名を
含む二つのレコードを特定する特定手段と、 上記特定されたデータレコードのグループ番号を上記関
連レコードの読み出し順に従って新しく生成したグルー
プ番号によって設定する設定手段とを具備することを特
徴とするグループ番号設定装置。
1. A group number comprising: a data record table for managing each record by a group number; and a related record table having a record having a binary relation with the data record table, wherein a group number for setting the group number of the data record table is provided. A setting device, comprising: related name reading means for sequentially reading related names stored in related records from a related record table having at least one or more related records; and a related name read from the data record table. A group number setting device, comprising: a specifying unit that specifies two records; and a setting unit that sets a group number of the specified data record according to a newly generated group number according to a reading order of the related records. .
【請求項2】 上記請求項1に記載のグループ番号設定
装置において、 上記設定手段は、上記特定手段にて特定された二つのレ
コードのグループ番号が未設定の場合、この二つのグル
ープ番号に、上記設定手段にて生成した同一のグループ
番号を設定することを特徴とするグループ番号設定装
置。
2. The group number setting device according to claim 1, wherein the setting unit sets the two record numbers specified by the specifying unit to two group numbers when the group numbers are not set. A group number setting device, wherein the same group number generated by the setting means is set.
【請求項3】 上記請求項1または請求項2のいずれか
に記載のグループ番号設定装置において、 上記設定手段は、上記特定手段にて特定された二つのレ
コードのグループ番号について、一方のレコードのグル
ープ番号のみが設定されている場合、当該レコードのグ
ループ番号を設定されていない他方のグループ番号に設
定することを特徴とするグループ番号設定装置。
3. The group number setting device according to claim 1, wherein the setting means determines a group number of one of the records based on a group number of the two records specified by the specifying means. When only a group number is set, the group number of the record is set to the other group number that is not set.
【請求項4】 上記請求項1〜請求項3のいずれかに記
載のグループ番号設定装置において、 上記設定手段は、上記特定手段にて特定された二つのレ
コードのグループ番号について、既に両方のレコードの
グループ番号が設定されている場合、これらの既に設定
されているグループ番号どうしを比較し、小さい値のグ
ループ番号を大きい値のグループ番号を有するレコード
のグループ番号として設定することを特徴とするグルー
プ番号設定装置。
4. The group number setting device according to claim 1, wherein the setting unit is configured to determine whether the group numbers of the two records specified by the specifying unit are both records. When the group numbers are set, the group numbers which have been set are compared with each other, and the group number having the smaller value is set as the group number of the record having the group number having the larger value. Number setting device.
【請求項5】 上記請求項1〜請求項4のいずれかに記
載のグループ番号設定装置において、 上記関連レコードテーブルは、上記データレコードテー
ブルと所定の整数Nにて形成されるN項関係を有するこ
とを特徴とするグループ番号設定装置。
5. The group number setting device according to claim 1, wherein the related record table has an N-term relationship formed by the data record table and a predetermined integer N. A group number setting device, characterized in that:
【請求項6】 各レコードをグループ番号にて管理する
データレコードテーブルとこのデータレコードテーブル
と二項関係を有するレコードを有する関連レコードテー
ブルとを備え、上記データレコードテーブルのグループ
番号を設定するグループ番号設定方法であって、 少なくとも1つ以上の関連レコードを有する関連レコー
ドテーブルから順次関連レコードに格納された関連名を
読み出す関連名読出工程と、 上記データレコードテーブルにて読み出された関連名を
含む二つのレコードを特定する特定工程と、 上記特定されたデータレコードのグループ番号を上記関
連レコードの読み出し順に従って新しく生成したグルー
プ番号によって設定する設定工程とを具備することを特
徴とするグループ番号設定方法。
6. A group number comprising a data record table for managing each record by a group number and a related record table having a record having a binary relation with the data record table, wherein a group number for the data record table is set. A setting method, comprising: a related name reading step of sequentially reading related names stored in related records from a related record table having at least one or more related records; and a related name read in the data record table. A group number setting method, comprising: a specifying step of specifying two records; and a setting step of setting a group number of the specified data record by a newly generated group number in accordance with the reading order of the related records. .
JP2000064030A 2000-03-08 2000-03-08 Group number setting device and group number setting method Expired - Fee Related JP3555542B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2000064030A JP3555542B2 (en) 2000-03-08 2000-03-08 Group number setting device and group number setting method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000064030A JP3555542B2 (en) 2000-03-08 2000-03-08 Group number setting device and group number setting method

Publications (2)

Publication Number Publication Date
JP2001256249A true JP2001256249A (en) 2001-09-21
JP3555542B2 JP3555542B2 (en) 2004-08-18

Family

ID=18583798

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000064030A Expired - Fee Related JP3555542B2 (en) 2000-03-08 2000-03-08 Group number setting device and group number setting method

Country Status (1)

Country Link
JP (1) JP3555542B2 (en)

Also Published As

Publication number Publication date
JP3555542B2 (en) 2004-08-18

Similar Documents

Publication Publication Date Title
CN105373541A (en) Processing method and system for data operation request of database
JP3555542B2 (en) Group number setting device and group number setting method
JP2925042B2 (en) Information link generation method
JP2002140218A (en) Data processing method, computer-readable recording medium and data processing device
JPS63204434A (en) Electronic document retrieving device
JPH10301942A (en) Data mining device
JP5163662B2 (en) File generation system and file generation method
JPH1011338A (en) Relational database system, method for storing and reading data in it and recording medium for recording program for it
JP2001273178A (en) Method and system for controlling database
CN117725077A (en) Identification search method, apparatus, computer device, storage medium, and program product
JPH04139546A (en) Relational data base device
JPH11212838A (en) System and method for change record history management by table split
CN110895531A (en) Data writing method of data storage table, partition server and electronic equipment
JPH02302869A (en) File edition system
JPH05165891A (en) Data registration/retrieval system of data base
JPH06162117A (en) Register processing system for hierarchical structure data base
JPH0546666A (en) Information retrieving device
JPH06149635A (en) Method for additional processing of record
JPH04137035A (en) Software design structure storage device
JP2002073943A (en) Method and device for classifying event transition pattern and storage medium storing event transition pattern classification program
JPH04275624A (en) Module-divided program controller
JPH06124219A (en) Data evaluation system
JPH02239370A (en) Data retrieve system
JPH05120338A (en) Index retrieving system
JPH0962553A (en) Journal output system

Legal Events

Date Code Title Description
A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20040106

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20040305

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20040503

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees