JP3439364B2 - Storage and retrieval methods for undefined length data - Google Patents

Storage and retrieval methods for undefined length data

Info

Publication number
JP3439364B2
JP3439364B2 JP08674099A JP8674099A JP3439364B2 JP 3439364 B2 JP3439364 B2 JP 3439364B2 JP 08674099 A JP08674099 A JP 08674099A JP 8674099 A JP8674099 A JP 8674099A JP 3439364 B2 JP3439364 B2 JP 3439364B2
Authority
JP
Japan
Prior art keywords
length data
block
indefinite length
data
indefinite
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP08674099A
Other languages
Japanese (ja)
Other versions
JP2000285014A (en
Inventor
達也 前田
Original Assignee
エヌイーシーマイクロシステム株式会社
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 エヌイーシーマイクロシステム株式会社 filed Critical エヌイーシーマイクロシステム株式会社
Priority to JP08674099A priority Critical patent/JP3439364B2/en
Publication of JP2000285014A publication Critical patent/JP2000285014A/en
Application granted granted Critical
Publication of JP3439364B2 publication Critical patent/JP3439364B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【発明の属する技術分野】本発明は、不定長データをメ
モリに格納する方法及びメモリに格納された不定長デー
タを検索する方法に関する。これらの方法は、例えば、
不定長データの配列の書き込み及び読み出しに用いられ
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for storing indefinite length data in a memory and a method for retrieving indefinite length data stored in the memory. These methods are, for example,
It is used for writing and reading an array of indefinite length data.

【0002】[0002]

【従来の技術】従来の不定長データをメモリに格納する
方法の一例が、特開平2−287739号公報に記載さ
れている。
2. Description of the Related Art An example of a conventional method for storing indefinite length data in a memory is described in Japanese Patent Laid-Open No. 2-287739.

【0003】この従来の方法では、メモリに不定長デー
タを順に詰めて格納し、別途用意したテーブルに各デー
タのサイズを格納することでメモリの使用効率向上を図
っている。
In this conventional method, the use efficiency of the memory is improved by storing indefinite length data in the memory in order and storing the size of each data in a separately prepared table.

【0004】この様に格納されたデータを検索する場合
は、取出したいデータの1つ前のデータまでのサイズを
合計することで、該当データの格納位置を求めている。
When retrieving data stored in this way, the storage position of the corresponding data is obtained by summing the sizes of the data up to the data immediately before the data to be retrieved.

【0005】[0005]

【発明が解決しようとする課題】しかし最近では、シス
テムの高機能化/多機能化に伴い、より多くのデータを
格納できるように、システムを制御するマイコンとして
は、大容量のメモリを搭載したものが使われるようにな
ってきた。
Recently, however, a large-capacity memory has been installed as a microcomputer for controlling the system so that more data can be stored as the system becomes more sophisticated / multifunctional. Things have come to be used.

【0006】この様になると、単に連続して格納する方
法では、データの数が多い場合に、1つ目のデータから
順に該当データの1つ前のデータまでのサイズを合計し
ていたのでは検索に時間が掛かる為に、データをブロッ
ク化して処理時間を高速化する必要があった。そのブロ
ック化した例を図3に示す。
In such a case, in the method of simply storing data, if the number of data is large, the sizes from the first data to the data immediately before the corresponding data may be summed in order. Since it takes time to search, it was necessary to speed up the processing time by dividing the data into blocks. An example of the block is shown in FIG.

【0007】この例に示したブロック化したデータを検
索する場合は図4に示したフローに沿って動作する。
When searching the blocked data shown in this example, the operation is performed according to the flow shown in FIG.

【0008】しかし、この従来技術では、図3に示すよ
うに、ブロック化した為に各ブロックの終端に空白がで
きてしまうという問題点がある。
However, in this conventional technique, as shown in FIG. 3, there is a problem that a blank is formed at the end of each block because it is made into blocks.

【0009】本発明は、不定長データをメモリの使用効
率を下げずに高速検索を考慮してメモリに格納する格納
方法及び当該格納方法に対応した高速な検索方法を提供
することを目的とする。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a storage method for storing indefinite length data in a memory in consideration of high speed search without reducing the memory usage efficiency, and a high speed search method corresponding to the storage method. .

【0010】[0010]

【課題を解決するための手段】本発明による不定長デー
タの格納方法は、複数の不定長データを先頭アドレスよ
り並ぶ所定容量の複数のブロックに区切られたメモリに
前記先頭アドレスより隙間なく連続して格納するステッ
プと、前記複数の不定長データの各々の長さを第1のテ
ーブルに格納するステップと、前記複数のブロックのう
ちの先頭ブロックから各々のブロックまでに格納された
前記不定長データの累積数と、前記複数のブロックの各
々に格納された最後の前記不定長データの超過の長さと
をブロック毎に第2のテーブルに格納するステップと、
を有することを特徴とする。
According to a method of storing undefined length data according to the present invention, a plurality of unfixed length data are continuously stored in a memory divided into a plurality of blocks having a predetermined capacity arranged from a leading address without a gap from the leading address. And storing each length of the plurality of indefinite length data in the first table, the indefinite length data stored from the first block to each block of the plurality of blocks And a step of storing, in a second table, the cumulative number of each of the plurality of blocks and the length of the last excess of the indefinite length data stored in each of the plurality of blocks, for each block.
It is characterized by having.

【0011】本発明による不定長データの検索方法は、
先頭アドレスより並ぶ所定容量の複数のブロックに区切
られたメモリに前記先頭アドレスより隙間なく連続して
格納された複数の不定長データから、所定の番号の不定
長データを、前記複数の不定長データの各々の長さを格
納した第1のテーブルと、前記複数のブロックのうちの
先頭ブロックから各々のブロックまでに格納された前記
不定長データの累積数と、前記複数のブロックの各々に
格納された最後の不定長データの超過の長さをブロック
毎に格納した第2のテーブルとを参照して、検索するこ
とを特徴とする。
The method for searching indefinite length data according to the present invention is
From the plurality of indefinite length data continuously stored in the memory divided into a plurality of blocks having a predetermined capacity arranged from the start address without a gap from the start address, the indefinite length data of a predetermined number is converted into the plurality of indefinite length data. A first table storing the length of each of the blocks, the cumulative number of the indefinite length data stored from the first block to each block of the plurality of blocks, and stored in each of the plurality of blocks. It is characterized in that the last excess length of the indefinite length data is searched by referring to the second table storing each block.

【0012】また、本発明による不定長データの検索方
法は、上記の不定長データの検索方法において、前記第
2のテーブルを参照して、当該検索する不定長データの
番号と前記累積数を基に、当該検索する不定長データの
属するブロックを求める第1のステップと、前記第2の
テーブルを参照して、当該検索する不定長データの属す
るブロックの前のブロックに係る超過の長さを基に、当
該検索する不定長データの属するブロック内の最初の不
定長データの位置を求める第2のステップと、前記第1
及び第2のテーブルを参照して、当該検索する不定長デ
ータの属するブロック内の最初の不定長データの位置、
当該検索する不定長データの番号、当該検索する不定長
データの属するブロックに係る累積数及び所定の範囲の
前記不定長データの長さを基に、前記検索する不定長デ
ータの位置を求める第3のステップと、を有することを
特徴とする。
Further, in the method for retrieving indefinite length data according to the present invention, in the above method for retrieving indefinite length data, the number of the indefinite length data to be retrieved and the cumulative number are referred to by referring to the second table. First, the first step of obtaining the block to which the indefinite length data to be searched belongs and the excess length related to the block before the block to which the indefinite length data to be searched belong are based on the second table. The second step of obtaining the position of the first indefinite length data in the block to which the indefinite length data to be searched belongs, and the first step.
And referring to the second table, the position of the first indefinite length data in the block to which the indefinite length data to be searched belongs,
A third position for finding the unfixed-length data to be searched based on the number of the unfixed-length data to be searched, the cumulative number of blocks to which the unfixed-length data to be searched belongs, and the length of the unfixed-length data in a predetermined range. And the steps of.

【0013】また、本発明による不定長データの検索方
法は、上記の不定長データの検索方法において、前記第
1のステップでは、当該検索する不定長データの番号と
各々のブロックに係る累積番号を先頭ブロックより比較
して、当該検索する不定長データの番号が累積番号以下
なったときのブロックを求めるブロックとすることを
特徴とする。
Further, in the method for retrieving indefinite length data according to the present invention, in the above method for retrieving indefinite length data, in the first step, the number of the indefinite length data to be retrieved and the cumulative number of each block are calculated. Compared with the first block, the number of the undefined length data to be searched is less than the cumulative number
It is characterized in that the block when it becomes is a block to be obtained.

【0014】更に、本発明による不定長データの検索方
法は、上記の不定長データの検索方法において、前記第
3のステップでは、当該検索する不定長データの属する
ブロックの前のブロックに係る累積数に対応する番号の
次の番号から当該検索する不定長データの番号の前の番
号までの前記不定長データの長さの総和を当該検索する
不定長データの属するブロック内の最初の不定長データ
の位置に加算することにより当該検索する不定長データ
の位置を求めることを特徴とする。
Further, in the method for retrieving indefinite length data according to the present invention, in the above method for retrieving indefinite length data, in the third step, the cumulative number of blocks before the block to which the indefinite length data to be retrieved belongs. Of the first variable length data in the block to which the variable length data to be searched belongs to the sum of the lengths of the variable length data from the number next to the number before the number of the variable length data to be searched. It is characterized in that the position of the undefined length data to be searched for is obtained by adding to the position.

【0015】本発明によるコンピュータ読み取り可能な
記録媒体は、上記の不定長データの格納方法をコンピュ
ータに実行させるためのプログラムを記録したことを特
徴とする。
A computer-readable recording medium according to the present invention is characterized by recording a program for causing a computer to execute the above-described method for storing indefinite length data.

【0016】また、本発明によるコンピュータ読み取り
可能な記録媒体は、上記の不定長データの検索方法をコ
ンピュータに実行させるためのプログラムを記録したこ
とを特徴とする。
A computer-readable recording medium according to the present invention is characterized by recording a program for causing a computer to execute the above-described method for searching for indefinite length data.

【0017】[0017]

【発明の実施の形態】図1において、サイズの等しい複
数のブロックから構成されるDATAメモリ2には、不
定長データ群が格納されている。また、これとは別に、
ブロック毎の情報として、先頭からそのブロックまでの
データ格納数と、そのブロックの最後尾のデータが次の
ブロックに超過するByte数とがブロック情報テーブ
ル3に別途格納されている。
BEST MODE FOR CARRYING OUT THE INVENTION In FIG. 1, an indefinite length data group is stored in a DATA memory 2 composed of a plurality of blocks having the same size. Also, apart from this,
As information for each block, the number of stored data from the head to the block and the number of Bytes that the last data of the block exceeds in the next block are separately stored in the block information table 3.

【0018】今、X番目に格納されているデータDAT
Axを読み出す場合、まず、BLOCK情報テーブル3
のデータ格納数情報よりDATAxが格納されているブ
ロックであるBLOCKxを検索する。これは、格納番
号Xがデータ格納数以下となるまで繰返し比較すること
で行う。
Now, the data DAT stored in the Xth position
When reading Ax, first, BLOCK information table 3
BLOCKx, which is a block in which DATAx is stored, is searched from the information on the number of stored data. This is performed by repeatedly comparing until the storage number X becomes equal to or less than the number of stored data.

【0019】このBLOCKxに格納されている最初の
データDATAx0の開始アドレスは次式で求められ
る。
The start address of the first data DATAx0 stored in this BLOCKx is obtained by the following equation.

【0020】開始アドレス=(ブロック番号−1)×ブ
ロックサイズ+(1つ前のブロックの超過Byte数) また、DATAx0の格納番号は、1つ前のブロックの
データ格納数+1である。
Start address = (block number-1) .times.block size + (number of excess bytes of previous block) Further, the storage number of DATAx0 is the data storage number of the previous block + 1.

【0021】よって、DATAxを読み出す場合に必要
となるDATAxの開始アドレスは、DATAx0の開
始アドレスに、DATAx0からDATA(x−1)ま
でのデータサイズを順次加算することで求めることがで
きる。
Therefore, the start address of DATAx required for reading DATAx can be obtained by sequentially adding the data size from DATAx0 to DATA (x-1) to the start address of DATAx0.

【0022】つまり不定長データをブロック化されたメ
モリに連続して格納することにより、高速な検索とメモ
リの効率的な使用との両立を可能にしている。
That is, continuous storage of indefinite length data in a blocked memory enables both high-speed retrieval and efficient use of the memory.

【0023】図1は、本発明のデータ格納方法の1実施
形態を示すメモリ構成図である。
FIG. 1 is a memory block diagram showing an embodiment of the data storage method of the present invention.

【0024】また、図2は、本実施形態におけるデータ
検索時の処理を示すフローチャートである。
FIG. 2 is a flow chart showing the processing at the time of data search in this embodiment.

【0025】図1を参照すると、本発明の実施の形態
は、不定長データを格納するDATAメモリ2と、格納
された不定長データの各々のデータサイズを格納するD
ATAサイズテーブル1と、DATAメモリ2の各ブロ
ック毎の情報を格納するBLOCK情報テーブル3とか
ら構成されている。
Referring to FIG. 1, according to the embodiment of the present invention, a DATA memory 2 for storing indefinite length data and a D memory for storing the data size of each of the stored indefinite length data.
It is composed of an ATA size table 1 and a BLOCK information table 3 which stores information for each block of the DATA memory 2.

【0026】更にBLOCK情報テーブル3は、各ブロ
ック毎の情報として、データ格納数と、ブロックの最後
尾のデータが次のブロックに超過する超過Byte数と
を格納している。
Further, the BLOCK information table 3 stores, as information for each block, the number of stored data and the number of excess bytes by which the data at the end of the block exceeds the next block.

【0027】DATAサイズテーブル1、DATAメモ
リ2、BLOCK情報テーブル3に上記のデータを格納
する方法は、複数の不定長データをDATAメモリ2に
先頭アドレスより隙間なく連続して格納するステップ
と、複数の不定長データの各々のバイト数をDATAサ
イズテーブル1に格納するステップと、DATAメモリ
2の前記先頭アドレスより並ぶ所定数のバイトよりなる
複数のブロックのうちの先頭ブロックから当該ブロック
までに格納された前記不定長データの累積数と、前記複
数のブロックの各々に格納された最後の前記不定長デー
タの超過のバイト数をBLOCK情報テーブル3に格納
するステップと、を有する。
The method of storing the above-mentioned data in the DATA size table 1, the DATA memory 2, and the BLOCK information table 3 includes a step of continuously storing a plurality of indefinite length data in the DATA memory 2 without a gap from the start address, and a plurality of steps. Storing the number of bytes of each of the indefinite length data in the DATA size table 1, and storing from the first block of the plurality of blocks of a predetermined number of bytes lined up from the first address of the DATA memory 2 to the corresponding block. And a step of storing in the BLOCK information table 3 the cumulative number of the indefinite length data and the number of excess bytes of the last indefinite length data stored in each of the plurality of blocks.

【0028】また、図2のフローチャートにおいては、
検索したいデータがどのブロックに格納されているかを
検索するブロック検索ステップ221と、検索したブロ
ックの最初のデータ格納アドレスを求めるアドレス設定
ステップ222と、ブロック内の検索したいデータを検
索するデータ検索ステップ223とを含む。
Further, in the flow chart of FIG.
A block search step 221 for searching in which block the data to be searched is stored, an address setting step 222 for obtaining the first data storage address of the searched block, and a data search step 223 for searching the data to be searched in the block. Including and

【0029】これらのステップの概略を次に説明する。An outline of these steps will now be described.

【0030】ブロック検索ステップ221では、検索し
たいデータの格納番号を、BLOCK情報テーブル3の
先頭よりの累積データ格納数と先頭より順に比較し、格
納番号が累積データ格納数以下になるブロックを探す。
In the block search step 221, the storage number of the data to be searched is sequentially compared with the cumulative data storage number from the head of the BLOCK information table 3 and the block whose storage number is equal to or less than the cumulative data storage number is searched.

【0031】アドレス設定ステップ222では、探し出
したブロックの番号とBLOCK情報テーブル3の超過
Byte数とから、検索したいデータを格納するブロッ
クの最初のデータ格納アドレスを求める。
In the address setting step 222, the first data storage address of the block storing the data to be searched for is obtained from the number of the block found and the number of excess bytes in the BLOCK information table 3.

【0032】データ検索ステップ223では、ブロック
内の最初のデータから順に、検索したいデータの1つ手
前のデータまでのデータサイズを、DATAサイズテー
ブル1を参照し合計して検索データを読み出すアドレス
を求める。
In the data search step 223, the data size from the first data in the block to the data immediately before the data to be searched is summed up by referring to the DATA size table 1 to obtain an address for reading the search data. .

【0033】次に、図2のフローチャートを参照して本
実施例の検索時の動作について詳細に説明する。
Next, the search operation of this embodiment will be described in detail with reference to the flow chart of FIG.

【0034】まず、変数のBLOCKカウンタに初期値
1を設定する(ステップA1)。
First, an initial value 1 is set in the variable BLOCK counter (step A1).

【0035】次に、BLOCKカウンタが示すブロック
の累積データ格納数をBLOCK情報テーブル3から参
照し、検索するデータの格納番号と比較する(ステップ
A2)。
Next, the cumulative data storage number of the block indicated by the BLOCK counter is referenced from the BLOCK information table 3 and compared with the storage number of the data to be searched (step A2).

【0036】比較の結果、検索データの格納番号がブロ
ックの累積データ格納数を超えている場合には、BLO
CKカウンタに1加算する(ステップA3)。
As a result of the comparison, if the storage number of the retrieval data exceeds the cumulative data storage number of the block, BLO
1 is added to the CK counter (step A3).

【0037】加算の結果、BLOCKカウンタの値がブ
ロック数を超えていなければ前記ステップA2まで処理
を戻し、格納番号が累積データ格納数未満となるまで繰
返し比較を行う(ステップA4)。なお、BLOCKカ
ウンタの値がブロック数を超えた場合は、検索データは
格納されていなかったとしてエラー処理に進む。
As a result of the addition, if the value of the BLOCK counter does not exceed the number of blocks, the process is returned to the step A2, and the repeated comparison is performed until the storage number becomes less than the accumulated data storage number (step A4). If the value of the BLOCK counter exceeds the number of blocks, it is determined that the search data is not stored and the process proceeds to error processing.

【0038】ステップA2において、検索データの格納
番号がブロックの累積データ格納数以下となった場合
に、検索データが格納されているブロックを検出できた
ことになり、ブロックの検索を終了する。ここで、BL
OCKカウンタが1であるか確認し(ステップA5)、
もし1ならば変数のREADアドレスに0を設定し(ス
テップA6)、変数のDATAカウンタに1を設定する
(ステップA7)。
In step A2, when the storage number of the search data is less than or equal to the cumulative number of stored data of blocks, it means that the block storing the search data has been detected, and the block search is terminated. Where BL
Check if the OCK counter is 1 (step A5),
If it is 1, the variable READ address is set to 0 (step A6), and the variable DATA counter is set to 1 (step A7).

【0039】BLOCKカウンタが1以外なら、BLO
CKカウンタを1減じる(ステップA13)。
If the BLOCK counter is other than 1, BLO
The CK counter is decremented by 1 (step A13).

【0040】次に1減じたBLOCKカウンタの値にブ
ロックのサイズを乗じた値をREADアドレスに設定す
る(ステップA14)。
Next, the value obtained by multiplying the value of the BLOCK counter by 1 by the size of the block is set to the READ address (step A14).

【0041】更に、BLOCKカウンタが示すブロック
の超過Byte数をBLOCK情報テーブル3から参照
し、READアドレスに加算する(ステップA15)。
Further, the number of excess bytes of the block indicated by the BLOCK counter is referred to from the BLOCK information table 3 and added to the READ address (step A15).

【0042】次いで、DATAカウンタに、BLOCK
カウンタが示すブロックのデータ格納数+1を設定する
(ステップA16)。
Then, the DATA counter is set to BLOCK.
The data storage number of the block indicated by the counter is set to +1 (step A16).

【0043】最後に、この様にして求められたREAD
アドレスとDATAカウンタにより、検索データの検索
を行う。まず、DATAカウンタと検索データの格納番
号とを比較する(ステップA8)。
Finally, the READ thus obtained
The search data is searched by the address and the DATA counter. First, the DATA counter is compared with the storage number of the search data (step A8).

【0044】比較結果が不一致であるなら、DATAカ
ウンタが示すデータのサイズをDATAサイズテーブル
1から参照し、READアドレスに加算する(ステップ
A9)。
If the comparison result is a mismatch, the data size indicated by the DATA counter is referenced from the DATA size table 1 and added to the READ address (step A9).

【0045】次に、DATAカウンタに1加算する(ス
テップA10)。
Next, 1 is added to the DATA counter (step A10).

【0046】加算の結果、DATAカウンタの値がデー
タの全格納数を超えていなければ前記ステップA8まで
処理を戻し、DATAカウンタと検索データの格納番号
が一致するまで繰返し比較を行う(ステップA11)。
なお、DATAカウンタの値が全格納数を超えた場合
は、検索データは格納されていなかったとしてエラー処
理に進む。
As a result of the addition, if the value of the DATA counter does not exceed the total number of stored data, the process is returned to the step A8 and repeated comparison is performed until the DATA counter and the storage number of the search data match (step A11). .
When the value of the DATA counter exceeds the total number of stored data, it is determined that the search data has not been stored and the process proceeds to error processing.

【0047】そして、ステップA8において、DATA
カウンタと検索データの格納番号が一致した場合に、検
索データを検出できたことになり、この時点のREAD
アドレスからデータの読み出しを行う(ステップA1
7)。
Then, in step A8, DATA
If the counter and the storage number of the search data match, it means that the search data could be detected.
Data is read from the address (step A1)
7).

【0048】次に、具体例を用いて説明する。Next, a specific example will be described.

【0049】図1に示すように、不定長データDATA
1,DATA2,DATA3,…は、DATAメモリ2
の先頭から順に連続して格納されている。この例におい
ては、DATAメモリ2を256Byte、つまり16
進数で100Hずつのブロックで分割している。今、X
番目に格納されているデータDATAxを読み出す場
合、まず、ブロック検索ステップ221で、DATAx
が格納されているブロックを検索する。これは、格納番
号Xがデータ格納数以下となるBLOCKxを検出する
まで行われる。次いでアドレス設定ステップ222によ
り、次式に基づいてBLOCKxに格納されている最初
のデータDATAx0の開始アドレスを求める。
As shown in FIG. 1, undefined length data DATA
1, DATA2, DATA3, ... are DATA memories 2
Are sequentially stored from the beginning of. In this example, the DATA memory 2 has 256 bytes, that is, 16 bytes.
It is divided into blocks of 100H each. X now
When reading the data DATAx stored in the second position, first in the block search step 221, DATAx
Search for the block in which is stored. This is performed until BLOCKx at which the storage number X is equal to or smaller than the number of stored data is detected. Next, in the address setting step 222, the start address of the first data DATAx0 stored in BLOCKx is obtained based on the following equation.

【0050】開始アドレス=(ブロック番号−1)×1
00H+(1つ前のブロックの超過Byte数) また、DATAx0の格納番号は、1つ前のブロックの
データ格納数+1である。
Start address = (block number-1) × 1
00H + (excessive number of bytes of the block immediately before) Further, the storage number of DATAx0 is the number of data storages of the block immediately before + 1.

【0051】よって、DATAxを読み出す場合に必要
となるDATAxの開始アドレスは、DATAx0の開
始アドレスに、DATAx0からDATA(x−1)ま
でのデータサイズを順次加算することで求めることがで
きる。
Therefore, the start address of DATAx required when reading DATAx can be obtained by sequentially adding the data size from DATAx0 to DATA (x-1) to the start address of DATAx0.

【0052】なお、検索する不定長データが含まれてい
るブロックを最終ブロックから検索することも可能であ
る。この場合、検索する不定長データの番号と各々のブ
ロックに係る累積番号を最終ブロックより遡って比較し
て、当該検索する不定長データの番号が累積番号以下と
なる条件を満たすブロックのうち先頭に最も近いブロッ
クを求めるブロックとする。
It should be noted that it is also possible to retrieve the block containing the undefined length data to be retrieved from the final block. In this case, the number of the undefined length data to be searched and the cumulative number of each block are compared retroactively from the last block, and the number of the undefined length data to be searched is equal to or less than the cumulative number.
A block for determining the closest block to the beginning of the composed satisfy blocks.

【0053】また、データ検索ステップ223では、検
索する不定長データが属するブロック内の最終位置の不
定長データから検索する不定長データまでのデータ長と
当該ブロックの超過バイト数より検索する不定長データ
の位置を求めることもできる。この場合、当該ブロック
の次のブロックのアドレスから当該最終位置の不定長デ
ータから検索する不定長データまでのデータ長の和を差
し引いて、更に、当該ブロックに係る超過バイト数を加
算することにより検索する不定長データの位置を求め
る。
In the data search step 223, the variable length data to be searched is determined from the data length from the variable length data at the final position in the block to which the variable length data to be searched to the variable length data to be searched and the number of excess bytes in the block. You can also find the position of. In this case, the search is performed by subtracting the sum of the data lengths from the indefinite length data at the final position to the indefinite length data to be searched from the address of the block next to the block, and then adding the number of excess bytes related to the block. Determine the position of undefined length data.

【0054】また、上記の実施形態による方法は、CP
Uに当該方法を実行させるためのプログラムを記録した
CD−ROMなどの記録媒体からCPUが当該プログラ
ムを読み込んで実行することにより実現することもでき
る。
Further, the method according to the above embodiment is
It can also be realized by the CPU reading and executing the program from a recording medium such as a CD-ROM in which a program for causing the U to execute the method is recorded.

【0055】更に、上記の実施形態による装置は、CP
Uを当該装置の各手段として機能させるためのプログラ
ムを記録したCD−ROMなどの記録媒体からCPUが
当該プログラムを読み込んで実行することにより実現す
ることもできる。
Furthermore, the device according to the above-mentioned embodiment is a CP
It can also be realized by the CPU reading and executing the program from a recording medium such as a CD-ROM that records a program for causing U to function as each unit of the apparatus.

【0056】この際、通常は、CPUは、オペレーティ
ングシステムにより、当該プログラムを当該記録媒体か
ら主メモリに一旦転送した後に、主メモリから当該プロ
グラムを読み込んで実行する。
At this time, normally, the CPU once transfers the program from the recording medium to the main memory by the operating system, then reads the program from the main memory and executes it.

【0057】更に、超過バイト数は、各ブロックの先頭
位置にある超過バイト数として管理しても良い。この場
合、先頭ブロックの超過バイト数は0である。
Further, the excess byte number may be managed as the excess byte number at the head position of each block. In this case, the number of excess bytes in the first block is 0.

【0058】更に、超過バイト数の代わりに、各ブロッ
クの最終不定長データの当該ブロックにおさまるバイト
数を使用しても良い。
Further, instead of the excess byte number, the number of bytes of the final unfixed length data of each block that fits in the block may be used.

【0059】更に、ブロック情報テーブルに、各ブロッ
クの累積データ格納数の代わりに、各ブロックのデータ
格納数を格納して、各ブロックのデータ格納数より演算
により累積データ格納数を求めるようにしても良い。
Further, instead of the cumulative data storage number of each block, the data storage number of each block is stored in the block information table, and the cumulative data storage number is calculated from the data storage number of each block. Is also good.

【0060】更に、バイトを単位として管理する代わり
に、ビットや数バイトを単位として管理しても良い。
Further, instead of managing in units of bytes, bits or several bytes may be managed in units.

【0061】更に、データサイズテーブル1には、各々
の不定長データのバイト数の代わりに累積された不定長
データのバイト数を格納して、それを基に、所定の範囲
の不定長データのバイト数の総和を求めるようにしても
良い。
Further, the data size table 1 stores the accumulated number of bytes of indefinite length data instead of the number of bytes of each indefinite length data, and based on that, stores the indefinite length data of a predetermined range. You may make it obtain | require the total of the number of bytes.

【0062】更に、上記の実施形態による方法は、CP
Uに当該方法を実行させるためのプログラムを記録した
CD−ROMなどのプログラム記録媒体からCPUが当
該プログラムを読み込んで実行することにより実現する
こともできる。この際、通常は、CPUは、オペレーテ
ィングシステムなどにより、当該プログラムを当該記録
媒体からメインメモリに一旦転送した後に、メインメモ
リから当該プログラムを読み込んで実行する。
Furthermore, the method according to the above-mentioned embodiment is
It can also be realized by the CPU reading and executing the program from a program recording medium such as a CD-ROM in which a program for causing the U to execute the method is recorded. At this time, normally, the CPU temporarily transfers the program from the recording medium to the main memory by the operating system or the like, then reads the program from the main memory and executes the program.

【0063】また、上記プログラムは、インタプリタ形
式の命令を記述したテキスト形式のファイルと、このフ
ァイルを読み込んで実行命令に変換するインタプリタよ
り生成されることもある。
The program may be generated by a text format file in which an interpreter format instruction is described and an interpreter that reads this file and converts it into an execution instruction.

【0064】[0064]

【発明の効果】以上説明したように本発明によれば、不
定長データをメモリに格納する際にデータ検索を高速化
する為のブロック化を行った場合でもメモリ効率を損な
わずに格納できるという効果が奏される。
As described above, according to the present invention, it is possible to store indefinite length data without deteriorating the memory efficiency even when it is divided into blocks for speeding up data retrieval when storing the data in the memory. The effect is played.

【0065】その理由は、ブロックの最後尾のデータが
次のブロックに超過する超過Byte数を記憶するテー
ブルを持つことにより、不定長データをメモリにブロッ
クに拘わらず連続して格納することが可能なためであ
る。
The reason for this is that by having a table for storing the number of excess bytes in which the data at the end of a block exceeds the next block, it is possible to store indefinite length data in a memory continuously regardless of the block. This is because.

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

【図1】本発明の実施形態による不定長データの格納方
法により形成されるデータサイズテーブル、データメモ
リ及びブロック情報テーブルの内容を示す図である。
FIG. 1 is a diagram showing the contents of a data size table, a data memory, and a block information table formed by a method of storing indefinite length data according to an embodiment of the present invention.

【図2】本発明の実施形態による不定長データの検索方
法の処理の流れを示すフローチャートである。
FIG. 2 is a flowchart showing a processing flow of a method for searching indefinite length data according to the embodiment of the present invention.

【図3】従来例による不定長データの格納方法により形
成されるデータサイズテーブル、データメモリ及びブロ
ック情報テーブルの内容を示す図である。
FIG. 3 is a diagram showing contents of a data size table, a data memory, and a block information table formed by a method of storing undefined length data according to a conventional example.

【図4】従来例による不定長データの検索方法の処理の
流れを示すフローチャートである。
FIG. 4 is a flowchart showing a processing flow of a method for searching for indefinite length data according to a conventional example.

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

1 データサイズテーブル 2 データメモリ 3 ブロック情報テーブル 1 Data size table 2 data memory 3 block information table

───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.7,DB名) G06F 12/00 - 12/06 G06F 17/30 ─────────────────────────────────────────────────── ─── Continuation of the front page (58) Fields surveyed (Int.Cl. 7 , DB name) G06F 12/00-12/06 G06F 17/30

Claims (9)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 複数の不定長データを先頭アドレスより
並ぶ所定容量の複数のブロックに区切られたメモリに前
記先頭アドレスより隙間なく連続して格納するステップ
と、 前記複数の不定長データの各々の長さに関連する情報を
第1のテーブルに格納するステップと、 前記複数のブロックのうちの各々のブロックに格納され
た前記不定長データの数に関連する情報と、前記複数の
ブロックの各々の端に格納された前記不定長データの端
数長に関連する情報をブロック毎に第2のテーブルに格
納するステップと、 を有することを特徴とする不定長データの格納方法。
1. A step of continuously storing a plurality of indefinite length data in a memory divided into a plurality of blocks of a predetermined capacity arranged from a head address without a gap from the head address, and each of the plurality of indefinite length data. Storing information related to length in a first table, information related to the number of the undefined length data stored in each block of the plurality of blocks, and each of the plurality of blocks A step of storing, for each block, information relating to a fractional length of the indefinite length data stored at the end in a second table, the indefinite length data storing method.
【請求項2】 複数の不定長データを先頭アドレスより
並ぶ所定容量の複数のブロックに区切られたメモリに前
記先頭アドレスより隙間なく連続して格納するステップ
と、 前記複数の不定長データの各々の長さを第1のテーブル
に格納するステップと、 前記複数のブロックのうちの先頭ブロックから各々のブ
ロックまでに格納された前記不定長データの累積数と、
前記複数のブロックの各々に格納された最後の前記不定
長データの超過の長さとをブロック毎に第2のテーブル
に格納するステップと、 を有することを特徴とする不定長データの格納方法。
2. A step of continuously storing a plurality of indefinite length data in a memory divided into a plurality of blocks of a predetermined capacity arranged from a start address without a gap from the start address, and each of the plurality of indefinite length data. Storing a length in a first table; a cumulative number of the indefinite length data stored from the first block to each block of the plurality of blocks;
Storing the last excess length of the indefinite length data stored in each of the plurality of blocks for each block in a second table, the indefinite length data storing method.
【請求項3】 先頭アドレスより並ぶ所定容量の複数の
ブロックに区切られたメモリに前記先頭アドレスより隙
間なく連続して格納された複数の不定長データから、所
定の番号の不定長データを、前記複数の不定長データの
各々の長さに関連する情報を格納した第1のテーブル
と、前記複数のブロックのうちの各々のブロックに格納
された前記不定長データの数に関連する情報と、前記複
数のブロックの各々の端に格納された前記不定長データ
の端数長に関連する情報をブロック毎に格納した第2の
テーブルとを参照して、検索することを特徴とする不定
長データ検索方法。
3. An indefinite length data having a predetermined number is stored from a plurality of indefinite length data continuously stored in the memory divided into a plurality of blocks having a predetermined capacity arranged from the start address without a gap from the start address. A first table storing information relating to the length of each of the plurality of indefinite length data; information relating to the number of the indefinite length data stored in each block of the plurality of blocks; An indefinite length data retrieving method characterized in that information relating to a fraction length of the indefinite length data stored at each end of a plurality of blocks is retrieved by referring to a second table in which each block is stored. .
【請求項4】 先頭アドレスより並ぶ所定容量の複数の
ブロックに区切られたメモリに前記先頭アドレスより隙
間なく連続して格納された複数の不定長データから、所
定の番号の不定長データを、前記複数の不定長データの
各々の長さを格納した第1のテーブルと、前記複数のブ
ロックのうちの先頭ブロックから各々のブロックまでに
格納された前記不定長データの累積数と、前記複数のブ
ロックの各々に格納された最後の不定長データの超過の
長さをブロック毎に格納した第2のテーブルとを参照し
て、検索することを特徴とする不定長データ検索方法。
4. An indefinite length data of a predetermined number is stored from a plurality of indefinite length data continuously stored in the memory divided into a plurality of blocks having a predetermined capacity arranged from the start address without a gap from the start address. A first table storing the length of each of the plurality of indefinite length data, a cumulative number of the indefinite length data stored from the first block to each block of the plurality of blocks, and the plurality of blocks And a second table storing, for each block, the excess length of the last unfixed length data stored in each of the unspecified length data search methods.
【請求項5】 請求項4に記載の不定長データ検索方法
において、 前記第2のテーブルを参照して、当該検索する不定長デ
ータの番号と前記累積数を基に、当該検索する不定長デ
ータの属するブロックを求める第1のステップと、 前記第2のテーブルを参照して、当該検索する不定長デ
ータの属するブロックの前のブロックに係る超過の長さ
を基に、当該検索する不定長データの属するブロック内
の最初の不定長データの位置を求める第2のステップ
と、 前記第1及び第2のテーブルを参照して、当該検索する
不定長データの属するブロック内の最初の不定長データ
の位置、当該検索する不定長データの番号、当該検索す
る不定長データの属するブロックに係る累積数及び所定
の範囲の前記不定長データの長さを基に、前記検索する
不定長データの位置を求める第3のステップと、 を有することを特徴とする不定長データの検索方法。
5. The variable length data search method according to claim 4, wherein the variable length data to be searched is searched based on the number of the variable length data to be searched and the cumulative number by referring to the second table. A block to which the indefinite length data to be searched is referred to based on the excess length of the block before the block to which the indefinite length data to be searched belongs, with reference to the second table. A second step of obtaining the position of the first indefinite length data in the block to which the variable belongs, and referring to the first and second tables, the first indefinite length data in the block to which the indefinite length data to be searched belongs Based on the position, the number of the variable length data to be searched, the cumulative number of blocks to which the variable length data to be searched belongs, and the length of the variable length data in a predetermined range, the variable length data to be searched is And a third step of obtaining the position of the data, and a method for retrieving indefinite length data.
【請求項6】 請求項4又は5に記載の不定長データの
検索方法において、 前記第1のステップでは、当該検索する不定長データの
番号と各々のブロックに係る累積番号を先頭ブロックよ
り比較して、当該検索する不定長データの番号が累積番
以下になったときのブロックを求めるブロックとする
ことを特徴とする不定長データの検索方法。
6. The method for searching indefinite length data according to claim 4 or 5, wherein in the first step, the number of the indefinite length data to be searched and the cumulative number of each block are compared from the top block. A method for searching for indefinite length data, wherein the block is obtained when the number of the indefinite length data to be searched becomes equal to or less than the cumulative number.
【請求項7】 請求項4乃至6のいずれか1項に記載の
不定長データの検索方法において、 前記第3のステップでは、当該検索する不定長データの
属するブロックの前のブロックに係る累積数に対応する
番号の次の番号から当該検索する不定長データの番号の
前の番号までの前記不定長データの長さの総和を当該検
索する不定長データの属するブロック内の最初の不定長
データの位置に加算することにより当該検索する不定長
データの位置を求めることを特徴とする不定長データの
検索方法。
7. The method for retrieving indefinite length data according to claim 4, wherein in the third step, the cumulative number of blocks preceding the block to which the indefinite length data to be retrieved belongs. Of the first variable length data in the block to which the variable length data to be searched belongs to the sum of the lengths of the variable length data from the number next to the number before the number of the variable length data to be searched. A method for retrieving indefinite length data, characterized by obtaining the position of the indefinite length data to be retrieved by adding to the position.
【請求項8】 請求項1又は2に記載の不定長データの
格納方法をコンピュータに実行させるためのプログラム
を記録したことを特徴とするコンピュータ読み取り可能
な記録媒体。
8. A computer-readable recording medium having recorded thereon a program for causing a computer to execute the method for storing indefinite length data according to claim 1.
【請求項9】 請求項3乃至7のいずれか1項に記載の
不定長データの検索方法をコンピュータに実行させるた
めのプログラムを記録したことを特徴とするコンピュー
タ読み取り可能な記録媒体。
9. A computer-readable recording medium having recorded thereon a program for causing a computer to execute the method for searching for indefinite length data according to any one of claims 3 to 7.
JP08674099A 1999-03-29 1999-03-29 Storage and retrieval methods for undefined length data Expired - Fee Related JP3439364B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP08674099A JP3439364B2 (en) 1999-03-29 1999-03-29 Storage and retrieval methods for undefined length data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP08674099A JP3439364B2 (en) 1999-03-29 1999-03-29 Storage and retrieval methods for undefined length data

Publications (2)

Publication Number Publication Date
JP2000285014A JP2000285014A (en) 2000-10-13
JP3439364B2 true JP3439364B2 (en) 2003-08-25

Family

ID=13895216

Family Applications (1)

Application Number Title Priority Date Filing Date
JP08674099A Expired - Fee Related JP3439364B2 (en) 1999-03-29 1999-03-29 Storage and retrieval methods for undefined length data

Country Status (1)

Country Link
JP (1) JP3439364B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6841024B2 (en) * 2016-12-09 2021-03-10 富士通株式会社 Data processing equipment, data processing programs and data processing methods

Also Published As

Publication number Publication date
JP2000285014A (en) 2000-10-13

Similar Documents

Publication Publication Date Title
KR940005775B1 (en) Method of opening disk file
US8161240B2 (en) Cache management
US5740445A (en) Information processing apparatus for generating directory information to manage a file using directories
US7822931B2 (en) File storage device, host apparatus, method for formatting nonvolatile semiconductor memory, and method of writing data in nonvolatile semiconductor memory
US6449613B1 (en) Method and data processing system for hashing database record keys in a discontinuous hash table
JP3024619B2 (en) File management method
JP3251138B2 (en) Hash method
JPH0786844B2 (en) Formatting a write-once optical storage medium
US7191360B2 (en) Method of data backup and recovery
JP2656524B2 (en) Data storage method and device
JP3439364B2 (en) Storage and retrieval methods for undefined length data
JPS59220853A (en) Disc cache system
JP3112709B2 (en) Access device for write-once storage medium
JP2002091806A (en) Filing system
JPS63104284A (en) Disk file access system
JP2822869B2 (en) Library file management device
US6154792A (en) Method and computer program product for paging control using a reference structure including a reference bitmap
JPH0239225A (en) Filing system
JP2912657B2 (en) File access processor
JPH02116936A (en) Reorganizing system
JP2838988B2 (en) File storage system in external storage device
JPS61103242A (en) High-speed retrieval system
JP3348279B2 (en) Price lookup data search circuit, search method therefor, and recording medium storing control program therefor
JP2000172542A (en) File access system
JPH0452737A (en) File control system

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees