JP2735255B2 - Hatching treatment method - Google Patents

Hatching treatment method

Info

Publication number
JP2735255B2
JP2735255B2 JP63285655A JP28565588A JP2735255B2 JP 2735255 B2 JP2735255 B2 JP 2735255B2 JP 63285655 A JP63285655 A JP 63285655A JP 28565588 A JP28565588 A JP 28565588A JP 2735255 B2 JP2735255 B2 JP 2735255B2
Authority
JP
Japan
Prior art keywords
value
keys
array
hash table
key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP63285655A
Other languages
Japanese (ja)
Other versions
JPH02132556A (en
Inventor
泰 金田
正弘 菅谷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP63285655A priority Critical patent/JP2735255B2/en
Publication of JPH02132556A publication Critical patent/JPH02132556A/en
Application granted granted Critical
Publication of JP2735255B2 publication Critical patent/JP2735255B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 本発明は、ハツシングをパイプライン型ベクトル計算
機によつてベクトル処理するか、または並列型計算機に
よつて、並列処理することによつて高速実行を可能にす
ることを目的とする。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention provides high-speed execution of hashing by performing vector processing by a pipeline type vector computer or by performing parallel processing by a parallel type computer. The purpose is to enable.

〔従来の技術〕[Conventional technology]

ハツシングは、データを高速に検索することができる
ため、しばしば使用される、周知のデータのキーつきの
データの表への登録方法および表の検索方法である。ハ
ツシングにはオープン・ハツシングとバケツト・ハツシ
ングという2種類の方法があり、いずれも、つぎの文献
で説明されている。
Hashing is a method of registering well-known data with a key in a table and a method of searching the table, which are often used because data can be searched at high speed. There are two types of hashing, open hashing and bucket hashing, both of which are described in the following documents.

(1) ジ アート オブ コンピユータ プログラミ
ング 第3巻 ソーテイング アンド サーチング,ア
デイソン ウエスレイ,第506頁から第549頁(1973年) (The Art of Computer Programming,Vol3,Sorting a
nd Searching,Addison Wesley,pp.506-549,1973)。
(1) The Art of Computer Programming, Volume 3, Sorting and Searching, Addison Wesley, pp. 506-549 (1973) (The Art of Computer Programming, Vol3, Sorting a
nd Searching, Addison Wesley, pp. 506-549, 1973).

文献(1)においてはハツシングを逐次処理すること
を前提にしている。
Document (1) is based on the premise that hashing is sequentially processed.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

ハツシングを汎用計算機より高速に実行するためにベ
クトル計算機を使用することがかんがえられるが、文献
(1)にしめされた方法では、表へのキーの登録はベク
トル処理あるいは並列処理によつておこなうことができ
ず、高速実行することができなかった。以下、文献
(1)の方法を「従来の技術」とよぶ。
Although it is conceivable to use a vector computer to execute hashing faster than a general-purpose computer, in the method described in reference (1), registration of a key in a table is performed by vector processing or parallel processing. Could not be executed at high speed. Hereinafter, the method of Reference (1) is referred to as “conventional technology”.

従来の方法では、複数のキーをまとめて登録しようと
してもベクトル処理あるいは並列処理できない理由を、
第2図を使用して説明する。以下、一般的用語にしたが
つて、キーを登録する表をハツシユ表とよぶ。第2図
は、配列211にふくまれる4個のキーをハツシユ表212に
登録する過程をしめしている。配列211にふくまれるキ
ー201,キー202を登録する場合、キー201のハツシユ値22
1とキー202のハツシユ値222とを添字値としてハツシユ
表に登録しようとするが、ハツシユ値221とハツシユ値2
22とが衝突する、すなわちひとしくなることがありう
る。
The reason why the conventional method does not allow vector processing or parallel processing even when registering multiple keys at once,
This will be described with reference to FIG. Hereinafter, a table for registering keys according to general terms will be referred to as a hash table. FIG. 2 shows the process of registering four keys included in the array 211 in the hash table 212. When registering the keys 201 and 202 included in the array 211, the hash value 22 of the key 201 is registered.
1 and the hash value 222 of the key 202 are to be registered in the hash table as subscript values, but the hash value 221 and the hash value 2
22 can collide with, or become unidentified.

従来の方法では、キー201に関する計算と、キー202に
関する計算とを、第2図にしめしているとおり、逐次的
に実行する。したがつて、キー202の登録の際には、衝
突が生じたことが検出されるので、再計算によつて添字
値223をもとめ、ただしく登録することができる。しか
し、この逐次性のため、各キーの登録をベクトル処理あ
るいは並列処理することができず、したがつてベクトル
処理あるいは並列処理することができない。また、キー
201の登録とキー202の登録とを並行しておこなうように
強引にベクトル処理あるいは並列処理すれば、衝突をた
だしく検出することができず、いずれかのキーが登録さ
れないまま、処理を終了してしまう。
In the conventional method, the calculation regarding the key 201 and the calculation regarding the key 202 are sequentially performed as shown in FIG. Therefore, when the key 202 is registered, it is detected that a collision has occurred. Therefore, the subscript value 223 can be obtained by recalculation and registered. However, due to this sequentiality, the registration of each key cannot be performed by vector processing or parallel processing, and therefore cannot be performed by vector processing or parallel processing. Also the key
If vector processing or parallel processing is forcibly performed so that registration of 201 and registration of key 202 are performed in parallel, collision cannot be detected properly, and processing is terminated without any key being registered. I will.

〔課題を解決するための手段〕[Means for solving the problem]

上記の問題を解決するには、複数のキーを関する計算
およびハツシユ表への登録をそれぞれ並行しておこな
い、衝突の処理をつぎのような手順でおこなうようにす
ればよい。
In order to solve the above-described problem, the calculation of a plurality of keys and the registration in the hash table are performed in parallel, and the collision process is performed in the following procedure.

(1) 前記の複数のキーの登録をおこなうまえにすで
にハツシユ表に登録されているキーと、前記の複数のキ
ーとの衝突は、前記の複数のキーを登録するまえにベク
トル処理あるいは並列処理によつて、すなわちベクトル
処理あるいは並列処理によつて検出する。
(1) A collision between a key already registered in the hash table before registration of the plurality of keys and the plurality of keys may be performed by vector processing or parallel processing before registering the plurality of keys. , Ie, by vector processing or parallel processing.

(2) 前記の複数のキーを登録する際に生じる衝突
は、これらをハツシユ表にかきこんだあとで、表に格納
された複数の値をよみだして、対応する前記の複数のキ
ーと一致するかどうかをベクトル処理あるいは並列処理
によつて判定することによつて検出する。
(2) A collision that occurs when registering a plurality of keys described above, after writing them into a hash table, reads out a plurality of values stored in the table, and matches the corresponding plurality of keys. This is detected by judging whether this is done by vector processing or parallel processing.

(3) (1)および(2)において衝突が検出された
キーについては、ハツシユ表のことなるエントリに登録
しなおす。再度衝突が発生する場合もあるので、エント
リをかえながら、(2)の操作をくりかえし実行する。
(3) The key for which the collision is detected in (1) and (2) is registered again in a different entry in the hash table. Since a collision may occur again, the operation of (2) is repeated while changing entries.

〔作用〕[Action]

上記の手順で衝突の処理をおこなえば、 (1) ハツシユ表にあらかじめ登録されているキーと
あらたに登録すべき複数のキーとの衝突が生じたときに
は、前記の複数のキーが前記のあらかじめ登録されてい
るキーとはことなるエントリに登録されるとともに、 (2) 前記の複数のキーのあいだでの衝突が発生した
ときには、衝突によつてただしくかきこまれなかつたキ
ーがいずれであるかが検出され、それらがただしく登録
されるまでくりかえし登録処理がおこなわれるため、 前記の複数のキーのすべてを、ベクトル処理あるいは
並列処理によつてハツシユ表に高速に登録することがで
きる。
If the collision process is performed in the above procedure, (1) When a collision between a key registered in advance in the hash table and a plurality of keys to be newly registered occurs, the plurality of keys are registered in the previously registered key. (2) When a collision occurs between the plurality of keys, it is determined which of the keys was not properly written in due to the collision. Since the repeated registration processing is performed until they are detected and registered properly, all of the plurality of keys can be registered in the hash table at high speed by vector processing or parallel processing.

〔実施例〕〔Example〕

第1図,第3図および第5図を使用して、本特許の一
実施例を説明する。この実施例はオープン・ハツシング
に関しているが、バケツト・ハツシングはごく一部を変
更するだけで容易に実現することができる。
An embodiment of the present invention will be described with reference to FIGS. 1, 3, and 5. FIG. Although this embodiment relates to open hashing, bucket hashing can be easily realized with only a few changes.

第1図は、複数のキーを要素としてふくみ、主記憶上
にある配列データを入力し、それを主記憶上にあるハツ
シユ表に登録する手続きをしめすフロー・チヤートであ
る。第1図の各ステツプは、ベクトル計算機の演算器お
よびベクトル・レジスタを使用して逐次的に実行される
が、各ステツプの内部で並行処理すなわちパイプライン
処理、チエイニングおよび複数命令の並列実行などをお
こなつている。
FIG. 1 is a flow chart showing a procedure of including a plurality of keys as elements, inputting array data in a main memory, and registering the array data in a hash table in the main memory. Each of the steps shown in FIG. 1 is sequentially executed by using an arithmetic unit and a vector register of a vector computer. In each step, parallel processing, ie, pipeline processing, chaining, and parallel execution of a plurality of instructions are performed. I am doing it.

第3図は、4個のキーからなる配列K 211を入力し
て第1図の手続きを実行したときに生成されるデータと
その手順とをしめしている。ハツシユ表212のサイズは
6としている。ハツシユ表のサイズとしては、通常はこ
れよりはるかにおおきな値が使用されるが、ここでは説
明を簡単にするため、ちいさな値にしてある。ハツシユ
表にはキーとデータとを対にして登録することがおおい
が、ハツシユ表212にはキーだけを登録するようにして
いる。ハツシユ表212には、あらかじめ103というキーが
登録されている。
FIG. 3 shows the data generated when the procedure shown in FIG. 1 is executed by inputting an array K 211 composed of four keys, and the procedure. The size of the hash table 212 is 6. Normally, a much larger value is used as the size of the hash table, but here a small value is used for the sake of simplicity. In most cases, keys and data are registered in pairs in the hash table, but only keys are registered in the hash table 212. In the hash table 212, a key 103 is registered in advance.

第5図は本実施例におけるベクトル計算機の構成をし
めす図である。すなわち、主記憶装置501,ベクトル・レ
ジスタ群502,マスク・レジスタ群503,パイプライン演算
器群504から構成されている。そして、主記憶装置501か
らベクトル・レジスタ群502の任意のレジスタへのパイ
プラインによるロードとストアができる。また、ベクト
ル・レジスタ群502の任意のレジスタおよびマスク・レ
ジスタ群503の任意のレジスタから演算器群503の任意の
演算器にデータを入力してパイプライン演算し、結果を
ベクトル・レジスタ群502の任意のレジスタに格納する
ことができる。本実施例においては、主記憶装置501
に、キー配列K 211とハツシユ表212とがあらかじめ格
納されている。
FIG. 5 is a diagram showing the configuration of the vector computer in the present embodiment. That is, it is composed of a main storage device 501, a vector register group 502, a mask register group 503, and a pipeline operation unit group 504. Then, loading and storing can be performed from the main storage device 501 to an arbitrary register of the vector / register group 502 by pipeline. Further, data is input from an arbitrary register of the vector register group 502 and an arbitrary register of the mask register group 503 to an arbitrary arithmetic unit of the arithmetic unit group 503 to perform a pipeline operation, and a result is stored in the vector register group 502. It can be stored in any register. In the present embodiment, the main storage device 501
The key layout K 211 and the hash table 212 are stored in advance.

第3図を使用して第1図の手続きを説明する。 The procedure of FIG. 1 will be described with reference to FIG.

[1] まず、ステツプ101が実行される。すなわち、
ベクトル計算機の演算器においてキー配列K 211の各
要素K(i)のハツシユ値がもとめられ、配列HV 301の
各要素HV(i)に代入される。配列HV 301の値は0以上
かつハツシユ表サイズ未満の値であり、ベクトル計算機
のベクトル・レジスタ上に保持される。
[1] First, step 101 is executed. That is,
The hash value of each element K (i) of the key array K 211 is obtained in the arithmetic unit of the vector computer, and is substituted for each element HV (i) of the array HV301. The value of the array HV301 is a value greater than or equal to 0 and less than the size of the hash table, and is held on the vector register of the vector computer.

[2] つぎに、ステツプ102が実行される。すなわ
ち、配列HV 301の各要素HV(i)(i=1,…,N)を添字
としてハツシユ表HT 212をひく。第3図の場合はN=4
である。ハツシユ表HT 212のエントリHT(HV(i))
(i=1,…,N)からえられる値が、未登録であることを
あらわす値(図では※であらわしている)かどうかを判
定する。判定した結果を論理値としてもとめ、それを要
素とする配列を生成すると、配列303がもとめられる。
i=1,2,4については未登録のため、対応する配列303の
要素の値はtrueとなるが、i=3についてはハツシユ表
HT 212にすでに登録された値103がアクセスされるの
で、対応する配列303の要素の値はfalseとなる。
[2] Next, step 102 is executed. That is, the hash table HT212 is drawn using each element HV (i) (i = 1,..., N) of the array HV301 as a subscript. In the case of FIG. 3, N = 4
It is. The entry HT of the hash table HT 212 (HV (i))
It is determined whether or not the value obtained from (i = 1,..., N) is a value indicating that it is not registered (represented by * in the figure). When the result of the determination is obtained as a logical value and an array having the logical value as an element is generated, an array 303 is obtained.
Since i = 1,2,4 is not registered, the value of the element of the corresponding array 303 is true, but for i = 3, the hash table
Since the value 103 already registered in the HT 212 is accessed, the value of the corresponding element of the array 303 becomes false.

配列303の要素の値がtrueであるようなiについてだ
けキー配列K 211の要素HV(i)を添字としてハツシ
ユ表HT 212に格納する。すなわち、ハツシユ表HT 212の
エントリHT(HV(i))に代入する。すなわち、キー配
列K 211の第1要素の値353,第2要素の値621,第4要
素の値911とを代入する。値353と値911とはこの値でハ
ツシユ表HT 212の第5要素に代入されるので、第5要素
の値は911となる。結果としてハツシユ表HTは212eのよ
うになる。
Only for i for which the value of the element of the array 303 is true, the element HV (i) of the key array K 211 is stored in the hash table HT 212 as a subscript. That is, it is assigned to the entry HT (HV (i)) of the hash table HT212. That is, the value 353 of the first element, the value 621 of the second element, and the value 911 of the fourth element of the key array K 211 are substituted. Since the value 353 and the value 911 are substituted into the fifth element of the hash table HT 212 by this value, the value of the fifth element is 911. As a result, the hash table HT becomes like 212e.

[3] つぎに、ステツプ103が実行される。すなわ
ち、キー配列K 211の各要素K(i)(i=1,…,N)
の値がハツシユ表HT 212eのエントリHT(HV(i))に
ふくまれる値と一致しているかどうかを判定する。判定
した結果を論理値として配列ENT 304の各要素ENT(i)
に代入する。K(1)と値911とを比較するとひとしく
ないことがわかるのでENT(1)の値はfalseとなる。K
(2),K(4)についてはひとしいことがわかるので、
ENT(2),ENT(4)の値はそれぞれtrueとなる。K
(3)は値103と比較されるので、ひとしくないことが
わかり、ENT(3)の値はfalseとなる。
[3] Next, step 103 is executed. That is, each element K (i) of the key array K 211 (i = 1,..., N)
Is determined to be equal to the value included in the entry HT (HV (i)) of the hash table HT 212e. Each element ENT (i) of the array ENT 304 as a logical value using the result of the determination.
Substitute for When K (1) is compared with the value 911, it is found that the value is not equal, so the value of ENT (1) is false. K
(2), K (4)
The values of ENT (2) and ENT (4) are each true. K
Since (3) is compared with the value 103, it is known that there is no difference, and the value of ENT (3) becomes false.

[4] つぎに、ステツプ104が実行される。すなわ
ち、ベクトル計算機がもつマスク・カウント命令(たと
えば日立S−810においてはVMCO命令)で配列ENT 304の
要素であってfalseという値をもつものの数をかぞえる
ことによつて、未登録要素の数をもとめ、変数NRに代入
する。変数NRの値は2となる。
[4] Next, step 104 is executed. That is, the number of unregistered elements can be reduced by counting the number of elements of the array ENT 304 having a value of false in the mask count instruction (eg, the VMCO instruction in Hitachi S-810) of the vector computer. First, substitute for the variable NR. The value of the variable NR is 2.

[5] つぎに、ステツプ105が実行される。すなわ
ち、配列ENT 304でベクトル圧縮格納命令(S−810にお
いてはVSTC命令またはVSTDC命令のうちのいずれか)を
マスク制御することにより、配列HV 301の各要素HV
(j)(j=1,…,NR)にHV(i)(i=1,…,N)のう
ちの未登録のものだけを格納することによつて、配列HV
は301aのようになる。すなわち、配列NET 304の第1要
素ENT(1)は、未登録であることをあらわす値すなわ
ちfalseなので、配列301の第1要素の値5が配列301aの
第1要素に格納される。ENT(2)は登録ずみであるこ
とをあらわす値すなわちtrueなので、配列301の第2要
素の値3はすてられる。ENT(3)の値はfalseなので、
配列301の第3要素の値1は配列301aの第2要素に格納
される。ENT(4)の値はtrueなので、配列301の第4要
素の値5はすてられる。配列K 211の各要素K(j)
(j=1,…,NR)にK(i)(i=1,…,N)の値のうち
の未登録のものだけを格納する。したがつて、配列K
211aの第1要素の値は353、第2要素の値は415となる。
[5] Next, step 105 is executed. That is, by controlling the vector compression storage instruction (either the VSTC instruction or the VSTDC instruction in S-810) in the array ENT 304, each element HV of the array HV 301 is controlled.
(J) By storing only the unregistered ones of HV (i) (i = 1,..., N) in (j = 1,..., NR), the array HV
Will look like 301a. That is, since the first element ENT (1) of the array NET 304 is a value indicating that it is not registered, that is, false, the value 5 of the first element of the array 301 is stored in the first element of the array 301a. Since ENT (2) is a value indicating that it has been registered, that is, true, the value 3 of the second element of the array 301 is omitted. Since the value of ENT (3) is false,
The value 1 of the third element of the array 301 is stored in the second element of the array 301a. Since the value of ENT (4) is true, the value 5 of the fourth element of the array 301 is discarded. Each element K (j) of array K 211
In (j = 1,..., NR), only the unregistered values of K (i) (i = 1,..., N) are stored. Therefore, the array K
The value of the first element of 211a is 353, and the value of the second element is 415.

[6] つぎに、ステツプ106が実行される。すなわ
ち、変数NRの値が0かどうかが判定される。0であれば
登録は完了しているので、手続きの実行は終了するが、
この場合は変数NRの値は0でない、すなわち、登録が完
了していないキーがあるので、処理を続行する。
[6] Next, step 106 is executed. That is, it is determined whether the value of the variable NR is 0. If it is 0, the registration has been completed, and the execution of the procedure ends.
In this case, since the value of the variable NR is not 0, that is, there is a key whose registration has not been completed, the processing is continued.

[7] つぎに、ステツプ107が実行される。すなわ
ち、変数Nに変数NRの値が実行される。Nの値は2にな
る。
[7] Next, step 107 is executed. That is, the value of the variable NR is executed for the variable N. The value of N becomes 2.

[8] つづいて、ステツプ108が実行される。すなわ
ち、配列HV 301aの各要素の値HV(i)を使用して(HV
(i)+1)をハツシユ表サイズでわつたあまりの値
(i=1,…N)をもとめ、配列HV 301bの各要素HV
(i)(i=1,…N)に代入する。
[8] Subsequently, step 108 is executed. That is, using the value HV (i) of each element of the array HV 301a,
(I) +1) is obtained by hash table size (i = 1,... N), and each element HV of array HV 301b is obtained.
(I) Substitute (i = 1,... N).

[9] つぎに、ステツプ102が再度実行される。すな
わち、配列HV 301bの各要素HV(i)(i=1,…N)を
添字としてハツシユ表HV 212eをひく。その結果であるH
T(HV(i))(i=1,…N)が、未登録であることを
あらわす値かどうかを判定する。半定した結果を論理値
としてもとめ、それを要素とする配列をもとめると、配
列305が生成される。i=1,2のいずれについても未登録
のため、対応する配列305の要素の値はtrueとなる。
[9] Next, step 102 is executed again. That is, the hash table HV212e is drawn using each element HV (i) (i = 1,... N) of the array HV301b as a subscript. H which is the result
It is determined whether or not T (HV (i)) (i = 1,..., N) is a value indicating that it has not been registered. When the semi-determined result is obtained as a logical value and an array having the logical value as an element is obtained, an array 305 is generated. Since neither i = 1 or 2 has been registered, the value of the corresponding element of the array 305 is true.

配列305の要素の値がtrueであるようなiについてだ
けキー配列K 211aのハツシユ表HT 212eのエントリHT
(HV(i))に代入する。いまの場合は、キー配列の第
1要素353、第2要素415の両方を代入する。結果として
ハツシユ表HTは212fのようになる。
The entry HT of the hash table HT 212e of the key array K 211a only for i for which the value of the element of the array 305 is true.
(HV (i)). In this case, both the first element 353 and the second element 415 of the key array are substituted. As a result, the hash table HT becomes like 212f.

[10] つぎに、ステツプ103が再度実行される。すな
わち、キー配列K 211aの各要素K(i)(i=1,…
N)の値がハツシユ表HT 212fのエントリHT(HV
(i))にふくまれる値として一致しているかどうかを
判定する。判定した結果を論理値として配列ENT 306の
各要素ENT(i)に代入する。K(1)の値と値353,K
(2)の値と値415とが比較され、これらはいずれもひ
としいことがわかるので、ENT(1),ENT(2)の値は
いずれもtrueとなる。
[10] Next, step 103 is executed again. That is, each element K (i) of the key array K 211a (i = 1,...)
N) is the entry HT (HV
It is determined whether the values match as the values included in (i)). The result of the determination is substituted into each element ENT (i) of the array ENT 306 as a logical value. K (1) value and value 353, K
The value of (2) is compared with the value 415, and it is found that they are all equal. Therefore, the values of ENT (1) and ENT (2) are both true.

[11] つぎに、ステツプ104が再度実行される。すな
わち、ベクトル計算機がもつマスク・カウント命令で配
列ENT 304の要素であつてfalseという値をもつものの数
をかぞえることによつて、未登録要素の数をまとめ、NR
とする。NRの値は0となる。
[11] Next, step 104 is executed again. That is, by counting the number of elements of the array ENT 304 having a value of false in the mask count instruction of the vector calculator, the number of unregistered elements is collected,
And The value of NR is 0.

[12] つぎに、ステツプ105が実行される。すなわ
ち、配列ENT 306でベクトル圧縮格納命令をマスク制御
することにより、配列HV 301aの各要素HV(j)(j=
1,…NR)はHV(i)(i=1,…N)のうちの未登録のも
のだけを格納する。配列HVは空配列すなわち要素が0個
の配列になる。配列K 211aの各要素K(j)(j=1,
…NR)にK(i)(i=1,…N)のうちの未登録のもの
だけを格納する。したがって、配列Kも空配列になる。
[12] Next, step 105 is executed. That is, by controlling the vector compression storage instruction by masking in the array ENT 306, each element HV (j) (j =
.. NR) store only unregistered HV (i) (i = 1,... N). The array HV is an empty array, that is, an array having zero elements. Each element K (j) of the array K 211a (j = 1,
.. NR) only the unregistered ones of K (i) (i = 1,... N) are stored. Therefore, the array K also becomes an empty array.

[13] つぎに、ステツプ106が実行される。すなわ
ち、変数NRの値が0かどうかが判定される。変数NRの値
は0すなわち登録は完了しているので、手続きの実行を
終了する。出力としてえられるハツシユ表HT 212fには
入力したすべてのキーが登録されている。
[13] Next, step 106 is executed. That is, it is determined whether the value of the variable NR is 0. Since the value of the variable NR is 0, that is, the registration has been completed, the execution of the procedure ends. In the hash table HT 212f obtained as an output, all input keys are registered.

以上で一実施例の説明をおわり、補足説明をする。 This is the end of the description of the embodiment, and a supplementary explanation will be given.

以上の実施例においては、キーだけをハツシユ表に登
録した。しかし、一般的にはキーとデータとを対にして
ハツシユ表に登録する。その場合には、ハツシユ表の各
エントリを2つに分割し、それぞれにキーとデータとを
格納するようにすればよい。キーをふくむ配列を圧縮す
る際(ステツプ105)には、データをふくむ配列もあわ
せて圧縮する必要がある。
In the above embodiment, only the key is registered in the hash table. However, in general, a key and data are paired and registered in a hash table. In that case, each entry of the hash table may be divided into two, and a key and data may be stored in each. When the array containing the keys is compressed (step 105), it is necessary to also compress the array containing the data.

また、以上の実施例においては、ただしく登録された
かどうかを、ハツシユ表に登録されたキーと、キー配列
にふくまれるキーとを比較することによつて判定してい
る。したがつて、キー配列に複数の同一の値のキーがふ
くまれているときにはただしく動作しない。このような
場合にもただしく動作するようにするには、第1図のス
テツプ102のかわりに第4図にしめした手順で登録すれ
ばよい。
Further, in the above embodiment, whether the key has been registered properly is determined by comparing the key registered in the hash table with the key included in the key layout. Therefore, when the key layout includes a plurality of keys having the same value, the operation does not work properly. In order to operate properly in such a case, it is sufficient to register in accordance with the procedure shown in FIG. 4 instead of step 102 in FIG.

さらに、以上の実施例におては、パイプライン型ベク
トル計算機による実行を前提としていたが、並列計算機
においても、パイプライン型ベクトル計算機と同様に処
理することができる。第6図に、第1図の手順を実行す
ることができる並列計算機をしめす。この並列計算機に
おいて、主記憶装置群601の主記憶装置はそれぞれバス
によつてプロセシング・ユニツト群602のプロセシング
・ユニツトに結合され、各バスはデータ交換ネツトワー
ク603によつて接続されている。並列計算機の場合は、
第1図の各ステツプが逐次的に実行されるようにプロセ
シング・ユニツト間の同期をとる必要があるが、第6図
の並列計算機においては同期用バス604によつて同期が
とられる。キー配列K 211とハツシユ表212とは、第6
図のように主記憶装置群にあらかじめ分散して格納され
る。
Further, in the above embodiment, the execution by the pipeline type vector computer is premised, but the parallel computer can perform the same processing as the pipeline type vector computer. FIG. 6 shows a parallel computer capable of executing the procedure of FIG. In this parallel computer, the main storage units of the main storage unit group 601 are connected to the processing units of the processing unit group 602 by buses, respectively, and each bus is connected by a data exchange network 603. In the case of a parallel computer,
Although it is necessary to synchronize the processing units so that each step of FIG. 1 is executed sequentially, in the parallel computer of FIG. 6, synchronization is achieved by the synchronization bus 604. The key layout K 211 and the hash table 212 correspond to the sixth
As shown in the figure, the data is distributed and stored in the main storage device group in advance.

〔発明の効果〕〔The invention's effect〕

日立S−810のようなベクトル計算機では、以上の各
ステツプにおけるほとんどの演算はベクトル命令で実行
することができるため、一度に登録すべきキーの個数す
なわち入力するキー配列の要素数が数10個またはそれ以
上の場合には、従来の方法にくらべて数倍〜10数倍の速
度でハツシユ表への登録をおこなうことができる。並列
計算機においても同期の効果がえられる。
In a vector computer such as the Hitachi S-810, most of the operations in each of the above steps can be executed by vector instructions. Or, in the case of more than that, registration to the hash table can be performed several times to several tens times faster than the conventional method. The effect of synchronization can also be obtained in a parallel computer.

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

第1図は、本発明の実施例におけるハツシユ表への登録
手続き、すなわち、複数のキーを要素としてふくむ配列
を入力し、それをベクトル処理によつてハツシユ表に登
録する手続きをしめすフロー・チヤートである。第2図
は、従来の方法の問題点の説明図である。すなわち、4
個のキーからなる配列を入力しているスカラ処理でハツ
シユ表への登録をおこなつたときに生成されるデータと
その手順とをしめしている。第3図は、実施例において
4個のキーからなる配列を入力して第1図の手続きを実
行したとき、すなわちベクトル処理でハツシユ表への登
録をおこなつたときに生成されるデータとその手順とを
しめしている。第4図は、補足実施例における第1図の
一部のかわりになる手順をしめすフロー・チヤートであ
る。第5図は、本実施例におけるベクトル計算機の構成
をしめす図である。第6図は、補足実施例における並列
計算機の構成をしめす図である。
FIG. 1 is a flow chart showing a procedure for registering a hash table in an embodiment of the present invention, that is, a procedure for inputting an array including a plurality of keys as elements and registering the array in a hash table by vector processing. It is. FIG. 2 is an explanatory diagram of a problem of the conventional method. That is, 4
The table shows the data generated when registration in the hash table is performed by scalar processing in which an array consisting of individual keys is input, and the procedure. FIG. 3 shows the data generated when the procedure shown in FIG. 1 is executed by inputting an array consisting of four keys in the embodiment, that is, when data is registered in the hash table by vector processing, The procedure is closed. FIG. 4 is a flow chart showing a procedure instead of a part of FIG. 1 in the supplementary embodiment. FIG. 5 is a diagram showing a configuration of a vector computer according to the present embodiment. FIG. 6 is a diagram showing a configuration of a parallel computer in a supplementary embodiment.

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】複数のキーをハッシュして記憶装置上にあ
るハッシュ表のアドレスを計算し、該アドレスに上記の
複数のキーを格納するハッシング処理方法において、上
記複数のキーに関する計算および上記ハッシュ表への格
納をベクトル処理または並列処理によって複数のキーに
対して同時に行ない、上記格納時における衝突の処理
を、 (1) 上記の複数のキーの格納をおこなう前に既に上
記ハッシュ表に格納されているキーと、上記の複数のキ
ーのそれぞれとの衝突は、上記の複数のキーを格納する
前にベクトル処理または並列処理によって検出する第1
のステップ、 (2) 格納の際に上記の複数のキーの間で生じる衝突
は、これらを上記ハッシュ表に格納した後に、ハッシュ
表に格納された複数の値を読み出し、対応する上記の複
数のキーと一致するかどうかをベクトル処理または並列
処理によって判定することで検出する第2のステップ、 (3) 上記第1及び第2のステップにおいて衝突が検
出されたキーについては、上記ハッシュ表の異なるアド
レスに格納しなおす第3のステップ によって行なうハッシング処理方法。
1. A hashing method for hashing a plurality of keys to calculate an address of a hash table on a storage device and storing the plurality of keys at the address, wherein the calculation relating to the plurality of keys and the hashing are performed. A plurality of keys are simultaneously stored in a table by vector processing or parallel processing, and a collision process at the time of the storage is performed. (1) Before storing the plurality of keys, the keys are already stored in the hash table. The collision between the key and the plurality of keys is detected by vector processing or parallel processing before storing the plurality of keys.
(2) When a collision occurs between the plurality of keys at the time of storage, after storing them in the hash table, a plurality of values stored in the hash table are read out and the corresponding plurality of keys are read out. A second step of detecting whether or not the key matches with a vector processing or a parallel processing, and (3) a key in which a collision is detected in the first and second steps is different from the hash table. A hashing processing method performed by the third step of storing the data in the address again.
JP63285655A 1988-11-14 1988-11-14 Hatching treatment method Expired - Lifetime JP2735255B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63285655A JP2735255B2 (en) 1988-11-14 1988-11-14 Hatching treatment method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63285655A JP2735255B2 (en) 1988-11-14 1988-11-14 Hatching treatment method

Publications (2)

Publication Number Publication Date
JPH02132556A JPH02132556A (en) 1990-05-22
JP2735255B2 true JP2735255B2 (en) 1998-04-02

Family

ID=17694348

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63285655A Expired - Lifetime JP2735255B2 (en) 1988-11-14 1988-11-14 Hatching treatment method

Country Status (1)

Country Link
JP (1) JP2735255B2 (en)

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
金田,小島,菅谷 「ベクトル計算機のための探索問題の計算法『並列バックトラック計算法』」 情報処理学会論文誌,Vol.29,No.10 1988 P.985−994 (昭63−10−15)

Also Published As

Publication number Publication date
JPH02132556A (en) 1990-05-22

Similar Documents

Publication Publication Date Title
US20230237099A1 (en) Bitmap filter, a method of generating the same, and a method of using a bitmap filter to perform a join
JPS61210478A (en) Vector processing device
JP2735255B2 (en) Hatching treatment method
JP3061486B2 (en) Data sort processing system
JP2926951B2 (en) Save / restore register address generation circuit
JPS61110233A (en) Data processor
JPH03147036A (en) Variable length data processor
JPH04101272A (en) Data element retrieving method
JPH0528290A (en) Data driven type computer
JPH01226026A (en) Retrieving circuit
JPH0250220A (en) Summarized arithmetic processing machine
JPH0512337A (en) Data retrieval system using hash method
JPH0833812B2 (en) Sorting device
JPH02216584A (en) Set data equivalence deciding device
JPH04348469A (en) Character string retrieving device and its method
JPS61110232A (en) Data processor
JPH05250410A (en) Hierarchical symbol correcting system
JPS62187930A (en) Retrieval method and its device
JPS61110235A (en) Data processor
JPH02294729A (en) Sort processing system
JPH06175862A (en) Electronic computer
JPS61110234A (en) Data processor
JPH01175662A (en) Logic simulator
JPH01284922A (en) Matching check device
JPH052608A (en) Data retrieval device