JPH0232468A - Character string data retrieving system - Google Patents

Character string data retrieving system

Info

Publication number
JPH0232468A
JPH0232468A JP63182863A JP18286388A JPH0232468A JP H0232468 A JPH0232468 A JP H0232468A JP 63182863 A JP63182863 A JP 63182863A JP 18286388 A JP18286388 A JP 18286388A JP H0232468 A JPH0232468 A JP H0232468A
Authority
JP
Japan
Prior art keywords
string data
character string
random number
character
database
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.)
Pending
Application number
JP63182863A
Other languages
Japanese (ja)
Inventor
Takao Mugitani
麦谷 尊雄
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 JP63182863A priority Critical patent/JPH0232468A/en
Publication of JPH0232468A publication Critical patent/JPH0232468A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To reduce the number of times of the comparison of character string data, and to shorten a retrieving time by storing a random number value together with the character string data, generating the random number value at the time of retrieve, and first comparing them. CONSTITUTION:When a user inputs a character string data storing request through an input means 1, a character string data memory means 2 designates the inputted character string data, accesses a random number generating means 3, and generates the random number value. The means 2 stores them into a data base 5 as the second character data and the random number value. When the user inputs the character string data retrieving request, in the same way as the storing request, the first character string data and the random number value are generated by a character string data retrieving means 4 and the means 3. Next the first and second random number values are compared, only at the time of correspondence, by comparing the character string data character by character, the number of times of the comparison necessary for the retrieve can be reduced, and the time can be shortened.

Description

【発明の詳細な説明】 (産業上の利用分野〕 本発明は文字列データ検索方式に関し、特に利用者から
のデータベースへの文字列データ検索要求に対して利用
者により指定された文字列データ(以下、第1の文字列
データと称する)とデータベースに格納されている文字
列データ(以下、第2の文字列データと称する)との比
較を行い、完全一致する第2の文字列データをデータベ
ースより抽出する文字列データ検索方式に関する。
DETAILED DESCRIPTION OF THE INVENTION (Field of Industrial Application) The present invention relates to a character string data retrieval method, and in particular, the present invention relates to a character string data retrieval method, and in particular to a method for searching character string data ( The first character string data (hereinafter referred to as the first character string data) is compared with the character string data stored in the database (hereinafter referred to as the second character string data), and the second character string data that completely matches is stored in the database. This invention relates to a string data search method for extracting character string data.

〔従来の技術〕[Conventional technology]

従来、この種の文字列データ検索方式では、データベー
スには第2の文字列データが格納され、利用者からのデ
ータベースへの文字列データ検索要求に対して第1の文
字列データと第2の文字列データとを先頭力rら1文字
ずつ比較していき、−致しなくなった時点で第1の文字
列データと第2の文字列データとが完全一致しないもの
と判定し、全ての文字が一致した場合のみ第1の文字列
データと第2の文字列データとが完全一致するものと判
定して第2の文字列データをデータベースから抽出して
いた。
Conventionally, in this type of string data search method, second string data is stored in the database, and in response to a string data search request from a user to the database, the first string data and the second string data are stored in the database. The first character string data is compared character by character, starting with r, and when they no longer match, it is determined that the first character string data and the second character string data do not completely match, and all characters are Only when they match, it is determined that the first character string data and the second character string data completely match, and the second character string data is extracted from the database.

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

上述した従来の文字列データ検索方式では、第1の文字
列データと第2の文字列データとを先頭から1文字ずつ
比較していたので、比較対象の文字列データのサイズが
大きくなるにつれて比較回数が増えるために検索時間が
多くかかるという欠点がある。
In the conventional character string data search method described above, the first character string data and the second character string data are compared character by character from the beginning, so as the size of the character string data to be compared increases The disadvantage is that it takes a lot of time to search because the number of searches increases.

特に、第2の文字列データの多くが同じ値で始まってい
るような場合には上述の比較回数は多大なものになって
しまっていた。
In particular, when much of the second character string data starts with the same value, the number of comparisons described above becomes large.

本発明の目的は、上述の点に鑑み、データベースに利用
者により指定された文字列データとともにこの文字列デ
ータを基に生成された乱数値を格納しておき、データベ
ース検索時に利用者により指定された文字列データを基
に乱数値を生成させて文字列データの比較前に乱数値を
比較して完全一致する可能性のない文字列データの比較
をしないようにすることにより、文字列データの比較回
数を削減して、検索時間を少なくすることができる文字
列データ検索方式を提供することにある。
In view of the above-mentioned points, an object of the present invention is to store character string data specified by the user in a database as well as random numbers generated based on this character string data, and to This method generates random values based on the string data obtained and compares the random values before comparing the string data to avoid comparing string data that may not be an exact match. To provide a character string data search method capable of reducing the number of comparisons and search time.

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

本発明の文字列データ検索方式は、文字列データの値を
基に再生成可能な整数属性の乱数値を算出する乱数生成
手段と、利用者からのデータベースへの文字列データ格
納要求に対して利用者により指定された文字列データを
前記乱数生成手段により算出された乱数値とともにデー
タベースに格納する文字列データ格納手段と、利用者か
らのデータベースへの文字列データ検索要求に対して利
用者により指定された文字列データの値を基に前記乱数
生成手段を用いて乱数値を算出して算出した乱数値と文
字列データとともにデータベースに格納されている乱数
値との比較を行った後に乱数値が一致したものに限り利
用者により指定された文字列データとデータベースに格
納されている文字列データとの比較を行う文字列データ
検索手段とを有する。
The string data search method of the present invention includes a random number generation means that calculates a random value of an integer attribute that can be regenerated based on the value of string data, and a response to a request from a user to store string data in a database. a character string data storage means for storing character string data specified by a user in a database together with a random number value calculated by the random number generating means; A random value is generated after comparing the calculated random value using the random number generation means based on the value of the specified character string data and the random value stored in the database together with the character string data. The apparatus includes a character string data search means that compares the character string data specified by the user with the character string data stored in the database only if they match.

〔作用〕[Effect]

本発明の文字列データ検索方式では、乱数生成手段が文
字列データの値を基に再生成可能な整数属性の乱数値を
算出し、文字列データ格納手段が利用者からのデータベ
ースへの文字列データ格納要求に対して利用者により指
定された文字列データを乱数生成手段により算出された
乱数値とともにデータベースに格納し、文字列データ検
索手段が利用者からのデータベースへの文字列データ検
索要求に対して利用者により指定された文字列データの
値を基に乱数生成手段を用いて乱数値を算出して算出し
た乱数値と文字列データとともにデータベースに格納さ
れている乱数値との比較を行った後に乱数値が一致した
ものに限り利用者により指定された文字列データとデー
タベースに格納されている文字列データとの比較を行う
In the string data search method of the present invention, the random number generation means calculates a random value of an integer attribute that can be regenerated based on the value of the string data, and the string data storage means inputs the string from the user into the database. String data specified by the user in response to a data storage request is stored in the database together with a random number value calculated by the random number generation means, and the string data search means responds to the string data search request from the user to the database. A random number is calculated using a random number generator based on the value of the string data specified by the user, and the calculated random number is compared with the random number stored in the database along with the string data. After that, the character string data specified by the user is compared with the character string data stored in the database only if the random numbers match.

〔実施例〕〔Example〕

次に、本発明について図面を参照して詳細に説明する。 Next, the present invention will be explained in detail with reference to the drawings.

第1図は、本発明の一実施例の文字列データ検索方式の
構成を示すブロック図である0本実施例の文字列データ
検索方式は、入力手段1と、文字列データ格納手段2と
、乱数生成手段3と、文字列データ検索手段4と、デー
タベース5と、出力手段6とから構成されている。
FIG. 1 is a block diagram showing the configuration of a string data search method according to an embodiment of the present invention. It is composed of a random number generation means 3, a character string data search means 4, a database 5, and an output means 6.

人力手段1は、利用者が文字列データ格納要求。In the human power means 1, a user requests storage of character string data.

文字列データ検索要求および文字列データを入力する手
段である。
This is a means for inputting a character string data search request and character string data.

出力手段6は、文字列データ検索結果の第2の文字列デ
ータを出力する手段である。
The output means 6 is means for outputting second character string data as a result of character string data search.

データベース5は、通常のデータベース管理システムで
見られるものと同様のものである。
Database 5 is similar to that found in typical database management systems.

第2図を参照すると、文字列データ格納手段2における
処理は、文字列データ入力ステップ21と、乱数生成ス
テップ22と、文字列データ格納ステップ23とからな
る。
Referring to FIG. 2, the processing in the character string data storage means 2 consists of a character string data input step 21, a random number generation step 22, and a character string data storage step 23.

第3図を参照すると、乱数生成手段3における処理は、
変数n(nは整数)初期化ステップ31と、文字列デー
タ先頭文字変数c (cは整数)セントステップ32と
、変数n変数C加算ステップ33と、変数C文字列デー
タ最後文字判定ステップ34と、変数C次文字セントス
テップ35とからなる。
Referring to FIG. 3, the processing in the random number generation means 3 is as follows:
Variable n (n is an integer) initialization step 31, character string data first character variable c (c is an integer) cent step 32, variable n variable C addition step 33, variable C character string data last character determination step 34 , variable C next character cent step 35.

第4図を参照すると、文字列データ検索手段4における
処理は、第1の文字列データ入力ステップ41と、第1
の乱数値生成ステップ42と、第2の文字列データ読込
みステップ43と、第2の文字列データ有無判定ステッ
プ44と、第2の乱数値読込みステップ45と、乱数値
一致判定ステップ46と、文字列データ一致判定ステッ
プ47と、第2の文字列データ出力ステップ48とから
なる。
Referring to FIG. 4, the processing in the character string data search means 4 includes a first character string data input step 41;
Random value generation step 42, second character string data reading step 43, second character string data presence/absence determination step 44, second random value reading step 45, random value matching determination step 46, character It consists of a string data match determination step 47 and a second character string data output step 48.

次に、このように構成された本実施例の文字列データ検
索方式の動作について説明する。
Next, the operation of the character string data search method of this embodiment configured as described above will be explained.

入力手段1を介して利用者から文字列データ格納要求が
入力されることにより起動された文字列データ格納手段
2は、まず、入力手段1を介してデータベース5に格納
すべき文字列データの入力を利用者から受は取る(ステ
ップ21)0次に、文字列データ格納手段2は、入力し
た文字列データを指定して乱数生成手段3を呼び出す(
ステップ22)。
The character string data storage means 2, which is activated by the input of a character string data storage request from the user through the input means 1, first inputs character string data to be stored in the database 5 through the input means 1. is received from the user (step 21).Next, the character string data storage means 2 specifies the input character string data and calls the random number generation means 3 (
Step 22).

文字列データ格納手段2から呼び出された乱数生成手段
3は、乱数値をデータベース5に格納するための変数n
をOに初期化しくステップ31)、文字列データ格納手
段2により指定された文字列データの先頭の文字を変数
Cにセントする(ステップ32)0次に、変数Cの文字
コードの値を整数値に変換したものを変数nの現在の値
に加える(ステップ33)0次に、乱数生成手段3は、
変数Cにセントされた文字が文字列データ中の最後の文
字か否かを判定しくステップ34)、最後の文字である
場合には処理を終了する。Il後の文字でなければ、乱
数生成手段3は、変数Cを文字列データ中の次の文字に
セットしなおして(ステップ35)、ステップ33に戻
り処理を繰り返すことにより、変数値を生成する。
The random number generation means 3 called from the character string data storage means 2 generates a variable n for storing random numbers in the database 5.
is initialized to O (step 31), and the first character of the character string data specified by the character string data storage means 2 is placed in variable C (step 32).Next, the value of the character code of variable C is initialized. The converted numerical value is added to the current value of the variable n (step 33).Next, the random number generation means 3
It is determined whether the character placed in the variable C is the last character in the character string data (step 34), and if it is the last character, the process is terminated. If it is not the character after Il, the random number generation means 3 resets the variable C to the next character in the character string data (step 35), returns to step 33, repeats the process, and generates a variable value. .

実際の乱数生成方法としては、ハツシング等の既知の技
法で用いられている乱数生成方法を応用することができ
る。ただし、ハツシング技法のようにハツシュテーブル
のサイズに合わせて数値の範囲を限定する必要はない。
As an actual random number generation method, a random number generation method used in known techniques such as hashing can be applied. However, unlike the hashing technique, there is no need to limit the numerical range according to the size of the hash table.

乱数値が生成されたならば、文字列データ格納手段2は
、利用者から入力された文字列データと乱数生成手段3
により生成された乱数値とをそれぞれ第2の文字列デー
タと第2の乱数値としてデータベース5に格納する(ス
テップ23)。
Once the random number value is generated, the character string data storage means 2 stores the character string data input by the user and the random number generation means 3.
The generated random numbers are stored in the database 5 as second character string data and second random numbers, respectively (step 23).

このようにして、データベース5には、第2の文字列デ
ータとともに第2の乱数値が格納されている。
In this way, the second random value is stored in the database 5 together with the second character string data.

一方、入力手段1を介して利用者から文字列データ検索
要求が入力されることにより起動されると、文字列デー
タ検索手段4は、まず、入力手段1を介して第1の文字
列データの入力を利用者から受は取り (ステップ41
)、受は取った第1の文字列データを指定して乱数生成
手段3を呼び出す(ステップ42)。
On the other hand, when activated by inputting a character string data search request from the user via the input means 1, the character string data search means 4 first searches for first character string data via the input means 1. Receive input from the user (Step 41)
), the receiver designates the obtained first character string data and calls the random number generation means 3 (step 42).

文字列データ検索手段4から呼び出された乱数生成手段
3は、文字列データ検索手段4から呼び出されたときと
同様にして、第1の乱数値を生成する。
The random number generation means 3 called by the character string data search means 4 generates a first random number value in the same manner as when called from the character string data search means 4.

乱数生成手段3により第1の乱数値が生成されたならば
、文字列データ検索手段4は、データベース5に格納さ
れている第2の文字列データを読み込み(ステップ43
)、データベース5に第2の文字列データが存在するか
否かを判定する(ステップ44)0文字列データ検索手
段4は、データベース5に第2の文字列データが存在し
ない場合には処理を終了し、存在する場合には第2の文
字列データとともに格納されている第2の乱数値をデー
タベース5から読み込む(ステップ45)。次に、文字
列データ検索手段4は、第1の乱数値と第2の乱数値と
を比較しくステップ46)、一致しない場合はステップ
43に戻って次の第2の文字列データを読み込み、処理
を操り返す。第1の乱数値と第2の乱数値とが一致しす
る場合には、文字列データ検索手段4は、第1の文字列
データと第2の文字列データとを先頭の文字から順に比
較する(ステップ47)、第1の文字列データと第2の
文字列データとが一致する場合には、文字列データ検索
手段4は、第2の文字列データを出力手段6に出力した
後に(ステップ48)、ステップ43に戻って処理を繰
り返す、第1の文字列データと第2の文字列データとが
一致しない場合には、文字列データ検索手段4は、ステ
ップ48をスキップして、ステップ43に戻って処理を
繰り返す。
Once the first random number value has been generated by the random number generation means 3, the character string data search means 4 reads the second character string data stored in the database 5 (step 43).
), it is determined whether or not the second character string data exists in the database 5 (step 44). If the second character string data does not exist in the database 5, the character string data search means 4 executes the process. When the second random number value exists, the second random value stored together with the second character string data is read from the database 5 (step 45). Next, the character string data search means 4 compares the first random value and the second random value (step 46), and if they do not match, returns to step 43 and reads the next second character string data, Manipulate the process. When the first random number value and the second random number value match, the character string data search means 4 compares the first character string data and the second character string data in order from the first character. (Step 47), if the first character string data and the second character string data match, the character string data search means 4 outputs the second character string data to the output means 6, and then (step 47) 48) Return to step 43 and repeat the process. If the first character string data and the second character string data do not match, the character string data search means 4 skips step 48 and repeats the process in step 43. Return to and repeat the process.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明は、文字列データとともに乱
数値をデータベースに格納しておき文字列データ検索時
に乱数値を生成させて文字列データの比較前に乱数値を
比較するようにしたことにより、文字列データを実際に
1文字ずつ比較することなく完全一致する可能性のない
文字列データの多くを比較対象から外すことができるた
めに、文字列データ検索に要する比較回数の総数を削減
でき、検索時間を短縮することができるという効果があ
る。特に、データベースに格納されている文字列データ
の多くが同じ値で始まっているような場合には、上述の
効果は顕著である。
As explained above, the present invention stores random values together with character string data in a database, generates random values when searching for character string data, and compares the random values before comparing character string data. , it is possible to exclude from comparison most of the string data for which there is no possibility of an exact match without actually comparing the string data character by character, which reduces the total number of comparisons required for string data searches. This has the effect of shortening the search time. In particular, the above effect is remarkable when much of the character string data stored in the database starts with the same value.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は本発明の一実施例の文字列データ検索方式の構
成を示すブロック図、 第2図は第1図中の文字列データ格納手段における処理
を示す流れ図、 第3図は第1図中の乱数生成手段における処理を示す流
れ図、 第4図は第1図中の文字列データ検索手段における処理
を示す流れ図である。 図において、 1・・・入力手段、 2・・・文字列データ格納手段、 3・・・乱数生成手段、 4・・・文字列データ検索手段、 5・・・データベース、 6・・・出力手段である。
FIG. 1 is a block diagram showing the configuration of a character string data search method according to an embodiment of the present invention, FIG. 2 is a flowchart showing the processing in the character string data storage means in FIG. 1, and FIG. 3 is the same as that shown in FIG. 1. 4 is a flowchart showing the processing in the random number generation means in FIG. 1. FIG. 4 is a flowchart showing the processing in the character string data search means in FIG. In the figure, 1...Input means, 2...Character string data storage means, 3...Random number generation means, 4...Character string data search means, 5...Database, 6...Output means It is.

Claims (1)

【特許請求の範囲】 文字列データの値を基に再生成可能な整数属性の乱数値
を算出する乱数生成手段と、 利用者からのデータベースへの文字列データ格納要求に
対して利用者により指定された文字列データを前記乱数
生成手段により算出された乱数値とともにデータベース
に格納する文字列データ格納手段と、 利用者からのデータベースへの文字列データ検索要求に
対して利用者により指定された文字列データの値を基に
前記乱数生成手段を用いて乱数値を算出して算出した乱
数値と文字列データとともにデータベースに格納されて
いる乱数値との比較を行った後に乱数値が一致したもの
に限り利用者により指定された文字列データとデータベ
ースに格納されている文字列データとの比較を行う文字
列データ検索手段と を有することを特徴とする文字列データ検索方式。
[Claims] Random number generation means for calculating a random value of an integer attribute that can be regenerated based on the value of character string data; a character string data storage means for storing the generated character string data in a database together with the random number value calculated by the random number generation means; A random number that matches the random number after comparing the calculated random number using the random number generation means based on the value of the column data and the random number stored in the database together with the character string data. 1. A character string data search method comprising a character string data search means for comparing character string data specified by a user with character string data stored in a database.
JP63182863A 1988-07-22 1988-07-22 Character string data retrieving system Pending JPH0232468A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP63182863A JPH0232468A (en) 1988-07-22 1988-07-22 Character string data retrieving system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP63182863A JPH0232468A (en) 1988-07-22 1988-07-22 Character string data retrieving system

Publications (1)

Publication Number Publication Date
JPH0232468A true JPH0232468A (en) 1990-02-02

Family

ID=16125761

Family Applications (1)

Application Number Title Priority Date Filing Date
JP63182863A Pending JPH0232468A (en) 1988-07-22 1988-07-22 Character string data retrieving system

Country Status (1)

Country Link
JP (1) JPH0232468A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008201305A (en) * 2007-02-21 2008-09-04 Ichikoh Ind Ltd Waterproof cover of wiper blade and its manufacturing method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008201305A (en) * 2007-02-21 2008-09-04 Ichikoh Ind Ltd Waterproof cover of wiper blade and its manufacturing method

Similar Documents

Publication Publication Date Title
US5619199A (en) Order preserving run length encoding with compression codeword extraction for comparisons
CA2364886A1 (en) Pattern retrieving method, pattern retrieval apparatus, computer-readable storage medium storing pattern retrieval program, pattern retrieval system, and pattern retrieval program
JPH05282367A (en) Automatic generating device for relative key word
JPH0232468A (en) Character string data retrieving system
JPH04340163A (en) Keyword retrieval system
JPH1074156A (en) Data processor
JPS61141036A (en) Data retrieval system
JPH10177582A (en) Method and device for retrieving longest match
JPH06274701A (en) Word collating device
JP2586172B2 (en) Table search device with learning function
JPH09114854A (en) Document retrieving system
JPH05165889A (en) Document retrieval device
JP3040114B2 (en) Record search device
JPH09330322A (en) Data retrieval device
JPH0546666A (en) Information retrieving device
JPS6259810B2 (en)
JPH01180632A (en) Record retrieving system
JPH03127254A (en) Word retrieving device
JPH05165891A (en) Data registration/retrieval system of data base
JPS62131348A (en) Multi-index file access system
JPS62159223A (en) Retrieving system for document information
JPH03223965A (en) Inequality sign condition connection system for related data base system
JPH05108719A (en) Information retrieving device
JP2003296368A (en) Device and method for retrieving database, and storage medium and program
JP2001195413A (en) Device and method for retrieving character string