JP2002229847A - Data management device of flash memory - Google Patents

Data management device of flash memory

Info

Publication number
JP2002229847A
JP2002229847A JP2001029106A JP2001029106A JP2002229847A JP 2002229847 A JP2002229847 A JP 2002229847A JP 2001029106 A JP2001029106 A JP 2001029106A JP 2001029106 A JP2001029106 A JP 2001029106A JP 2002229847 A JP2002229847 A JP 2002229847A
Authority
JP
Japan
Prior art keywords
packet
data
state
block
information
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
JP2001029106A
Other languages
Japanese (ja)
Inventor
Tsunemori Asahi
常盛 旭
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.)
Seiko Epson Corp
Original Assignee
Seiko Epson 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 Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2001029106A priority Critical patent/JP2002229847A/en
Publication of JP2002229847A publication Critical patent/JP2002229847A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a data management device of a flash memory suitable for speed-up of access to a packet. SOLUTION: When updating data in the packet, state information of the packet is set in the third state and the state information of a packet to be renewed is set in the first state at the start time of data writing, and renewed data are written in a data part 82 of the packet to be renewed, and the state information of the packet to be renewed is set in the second state and the state information of the packet of a renewal source is set in the fourth state at the completion time of the data writing. The packet having the state information in the second or third state is determined as an effective one, and the packet having the state information in the first or fourth state is determined as an ineffective one. Tables 400, 420 wherein access information for accessing the effective packet is registered are generated at the start time, and access to the packet is executed by referring to the generated tables 400, 420.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、フラッシュメモリ
の記憶領域にパケット単位でデータを記憶する装置に係
り、特に、パケットへのアクセスを高速化するのに好適
なフラッシュメモリのデータ管理装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an apparatus for storing data in a storage area of a flash memory in packet units, and more particularly to a data management apparatus for a flash memory suitable for speeding up access to a packet.

【0002】[0002]

【従来の技術】従来、フラッシュメモリの記憶領域にパ
ケット単位でデータを記憶する装置としては、例えば、
特開平5-233426号公報に開示されたフラッシュメモリの
使用方法がある。これは、フラッシュメモリを複数のセ
クタで区切り、各セクタに論理アドレス部分と、消去管
理表示部分と、データ部分とを設け、論理アドレスによ
りセクタを検索する。そして更新するとき、セクタの消
去管理表示部分の消去可能フラグをオンにし、空きセク
タにその論理アドレスを付加し、更新データを書き込
む。
2. Description of the Related Art Conventionally, as an apparatus for storing data in a storage area of a flash memory in packet units, for example,
There is a method of using a flash memory disclosed in Japanese Patent Application Laid-Open No. Hei 5-233426. In this method, a flash memory is divided into a plurality of sectors, a logical address portion, an erase management display portion, and a data portion are provided in each sector, and a sector is searched by a logical address. Then, when updating, the erasure enable flag in the erasure management display portion of the sector is turned on, the logical address is added to the empty sector, and the update data is written.

【0003】これにより、フラッシュメモリ上でのデー
タの消去は、消去対象となるデータが格納されているセ
クタの消去管理部にデータが無効であることを示す無効
フラグを設定することにより行われるので、フラッシュ
メモリの初期化回数が少なくなり、フラッシュメモリの
寿命の低下を防止するとともにデータの書換が高速に行
える。
[0003] As a result, data is erased from the flash memory by setting an invalid flag indicating that the data is invalid in the erase manager of the sector storing the data to be erased. In addition, the number of times of initialization of the flash memory is reduced, and the life of the flash memory is prevented from being shortened, and data can be rewritten at high speed.

【0004】[0004]

【発明が解決しようとする課題】しかしながら、上記従
来のフラッシュメモリの使用方法にあっては、セクタの
データを更新する場合は、更新後のデータを新たなセク
タに書き込み、更新前のセクタの消去管理部に無効フラ
グを設定するため、例えば、停電やシステムのハングア
ップまたはリセットスイッチの誤投入といった事態がデ
ータの更新中に生じた場合は、更新前のセクタと新たな
セクタの消去管理部にデータが有効であることを示す有
効フラグがともに設定されたまま、データの更新が中断
されてしまい、どちらが正しいデータであるかを識別す
ることが困難であるという問題があった。
However, in the above conventional method of using a flash memory, when updating data in a sector, the updated data is written into a new sector, and the sector before the update is erased. In order to set an invalid flag in the management unit, for example, if a power failure, system hang-up, or erroneous turning on of the reset switch occurs during data update, the erase management unit of the sector before update and the new sector Updating of the data is interrupted with the valid flag indicating that the data is valid, and it is difficult to identify which is the correct data.

【0005】こうした問題に対処するためには、更新前
のセクタが属するブロックを一旦初期化し、その上で、
更新後のデータを新たなセクタに書き込むということを
しなければならず、結局、フラッシュメモリの初期化回
数を少なくすることができない。なお、この場合は、初
期化したブロックのうち更新前のセクタ以外のものを、
元の状態に書き換え直す必要がある。
In order to deal with such a problem, a block to which a sector before update belongs is first initialized, and then,
It is necessary to write the updated data to a new sector, and as a result, the number of times of initialization of the flash memory cannot be reduced. In this case, of the initialized blocks other than the sector before the update,
It is necessary to rewrite to the original state.

【0006】そこで、フラッシュメモリの初期化回数を
少なくして、フラッシュメモリの寿命の低下を防止する
とともにデータの書換を高速に行い、しかもデータの更
新を高い信頼性をもって行うには、例えば、次のような
構成が考えられる。これは、フラッシュメモリの記憶領
域にパケット単位でデータを記憶する装置において、パ
ケットは、そのパケットの管理に関する管理データを格
納するための管理部と、データを格納するためのデータ
部とからなり、管理部には、管理データとして、パケッ
トの異なる4つの状態を示す状態情報が格納可能となっ
ている。そして、パケットのデータを更新するときは、
更新後のデータを格納するための更新先パケットを記憶
領域に生成し、データ書込開始時に、更新先パケットの
状態情報を第1の状態にかつ更新前のデータを格納して
いる更新元パケットの状態情報を第3の状態に設定し、
更新先パケットのデータ部に更新後のデータを書き込
み、データ書込完了時に、更新先パケットの状態情報を
第2の状態にかつ更新元パケットの状態情報を第4の状
態に設定し、状態情報が第2の状態または第3の状態で
あるパケットを有効なパケットであると判定し、状態情
報が第1の状態または第4の状態であるパケットを無効
なパケットであると判定するようになっている。
Therefore, to reduce the number of times of initialization of the flash memory to prevent the life of the flash memory from being shortened, to rewrite data at high speed, and to update data with high reliability, for example, The following configuration is conceivable. This is a device that stores data in packet units in a storage area of a flash memory, and a packet includes a management unit for storing management data related to management of the packet and a data unit for storing data. The management unit can store state information indicating four different states of the packet as management data. Then, when updating the data of the packet,
An update source packet storing an update destination packet for storing data after update in a storage area, and at the time of starting data writing, updating the status information of the update destination packet to the first state and storing the data before update State information of the third state,
Writing the updated data in the data portion of the update destination packet; setting the status information of the update destination packet to the second status and the status information of the update source packet to the fourth status when the data writing is completed; Determines that a packet in the second state or the third state is a valid packet, and determines that a packet whose state information is the first state or the fourth state is an invalid packet. ing.

【0007】このような構成であれば、パケットのデー
タを更新するときは、まず、パケットの状態情報が第1
の状態に設定され、パケット長などの情報が設定されて
いる、更新先のパケット管理部を末尾パケットの次の位
置に書き込み、更新元パケットの状態情報が第3の状態
に設定される。そして、更新先パケットのデータ部に更
新後のデータが書き込まれ、データ書込完了時には、更
新先パケットの状態情報が第2の状態に設定され、更新
元パケットの状態情報が第4の状態に設定される。
With such a configuration, when updating data of a packet, first, the state information of the packet is stored in the first state.
, And the packet management unit of the update destination in which information such as the packet length is set is written in the position next to the last packet, and the state information of the update source packet is set to the third state. Then, the updated data is written to the data portion of the update destination packet. When the data writing is completed, the status information of the update destination packet is set to the second state, and the status information of the update source packet is set to the fourth state. Is set.

【0008】例えば、何らかの原因によりデータの更新
が中断された場合は、状態情報が第2の状態または第3
の状態であるパケットが有効なパケットであると判定さ
れ、状態情報が第1の状態または第4の状態であるパケ
ットが無効なパケットであると判定される。しかしなが
ら、こうした構成であっても、更新先パケットの状態情
報が第2の状態に設定された後であって更新元パケット
の状態情報が第4の状態に設定される前に、例えば、何
らかの原因によりデータの更新が中断された場合は、更
新先パケットの状態情報は第2の状態となるが更新元パ
ケットの状態情報が第3の状態となったままなので、い
ずれも有効なパケットであると判定されてしまう。
For example, if the data update is interrupted for some reason, the status information is changed to the second status or the third status.
Is determined to be a valid packet, and a packet whose status information is the first state or the fourth state is determined to be an invalid packet. However, even with such a configuration, for example, after the state information of the update destination packet is set to the second state and before the state information of the update source packet is set to the fourth state, for example, for some reason, When the data update is interrupted, the state information of the update destination packet is in the second state, but the state information of the update source packet is still in the third state. It will be judged.

【0009】この場合、更新後のデータの書込が完了し
ているので、更新先パケットを有効なパケットであると
判定し、更新元パケットを無効なパケットであると判定
しなければならない。具体的には、パケットへのアクセ
スを行うごとに、記憶領域のうちパケットが記憶されて
いる全領域をスキャンし、IDが同一のパケットについ
てすべての状態情報を取得し、状態情報が第2の状態で
あるパケットと状態情報が第3の状態であるパケットが
併存するときは、状態情報が第2の状態であるパケット
の方を有効なパケットであると判定する必要がある。
In this case, since the writing of the updated data has been completed, the update destination packet must be determined to be a valid packet, and the update source packet must be determined to be an invalid packet. More specifically, every time a packet is accessed, the entire area of the storage area where the packet is stored is scanned, all the state information is acquired for the packet having the same ID, and the state information is stored in the second area. When the state packet and the state information of the third state coexist, it is necessary to determine that the state information of the second state packet is a valid packet.

【0010】したがって、パケットへのアクセスを行う
ごとに、記憶領域のうちパケットが記憶されている全領
域をスキャンするため、パケットへのアクセスに時間を
要するという問題が想定される。このことは、更新元パ
ケットの状態情報の書換を更新先パケットのそれよりも
先に行う場合でも同様である。すなわち、更新元パケッ
トの状態情報が第4の状態に設定された後であって更新
先パケットの状態情報が第2の状態に設定される前に、
例えば、何らかの原因によりデータの更新が中断された
場合は、更新元パケットの状態情報は第4の状態となる
が更新先パケットの状態情報が第1の状態となったまま
なので、いずれも無効なパケットであると判定されてし
まう。
[0010] Therefore, every time the packet is accessed, the entire area of the storage area where the packet is stored is scanned, so that a problem that access to the packet takes time is expected. This is the same even when the state information of the update source packet is rewritten before that of the update destination packet. That is, after the state information of the update source packet is set to the fourth state and before the state information of the update destination packet is set to the second state,
For example, if the data update is interrupted for some reason, the status information of the update source packet will be in the fourth state, but the status information of the update destination packet will be in the first state. It is determined to be a packet.

【0011】この場合、更新後のデータの書込が完了し
ているので、更新先パケットを有効なパケットであると
判定し、更新元パケットを無効なパケットであると判定
しなければならない。したがって、状態情報が第1の状
態であるパケットは通常データ書込途中であり有効なパ
ケットではないが、状態情報が第1の状態であるパケッ
トと状態情報が第4の状態であるパケットが併存してい
る場合は、例外的に、状態情報が第1の状態であるパケ
ットの方を有効なパケットであると判定する必要があ
る。
In this case, since the writing of the updated data has been completed, the update destination packet must be determined to be a valid packet, and the update source packet must be determined to be an invalid packet. Therefore, a packet whose status information is in the first state is normally in the middle of data writing and is not a valid packet, but a packet whose status information is in the first state and a packet whose status information is in the fourth state coexist. If so, it is necessary to exceptionally determine that the packet whose status information is in the first state is a valid packet.

【0012】そこで、本発明は、このような従来の技術
の有する未解決の課題に着目してなされたものであっ
て、パケットへのアクセスを高速化するのに好適なフラ
ッシュメモリのデータ管理装置を提供することを目的と
している。
SUMMARY OF THE INVENTION The present invention has been made in view of such unresolved problems of the prior art, and is a data management apparatus for a flash memory suitable for speeding up access to a packet. It is intended to provide.

【0013】[0013]

【課題を解決するための手段】上記目的を達成するため
に、本発明に係る請求項1記載のフラッシュメモリのデ
ータ管理装置は、フラッシュメモリの記憶領域にパケッ
ト単位でデータを記憶するようになっており、前記パケ
ットは、当該パケットの管理に関する管理データを格納
するための管理部と、データを格納するためのデータ部
とからなり、前記管理部には、前記管理データとして、
前記パケットの状態を示す状態情報が格納可能となって
おり、前記パケットのデータを更新するときは、更新後
のデータを格納するための更新先パケットを前記記憶領
域に生成し、データ書込開始時に、前記更新先パケット
の状態情報を第1の状態にかつ更新前のデータを格納し
ている更新元パケットの状態情報を第3の状態に設定
し、前記更新先パケットのデータ部に前記更新後のデー
タを書き込み、データ書込完了時に、前記更新先パケッ
トの状態情報を第2の状態にかつ前記更新元パケットの
状態情報を第4の状態に設定し、前記状態情報が前記第
2の状態または前記第3の状態であるパケットを有効な
パケットであると判定し、前記状態情報が前記第1の状
態または前記第4の状態であるパケットを無効なパケッ
トであると判定する装置において、前記記憶領域に格納
されているパケットのうち前記有効なパケットにアクセ
スするためのアクセス情報を登録したアクセス情報管理
テーブルを参照して、前記パケットへのアクセスを行う
ようになっている。
According to a first aspect of the present invention, there is provided a data management apparatus for a flash memory which stores data in a storage area of the flash memory in packet units. The packet includes a management unit for storing management data relating to the management of the packet, and a data unit for storing data, and the management unit includes, as the management data,
State information indicating the state of the packet is storable, and when updating the data of the packet, an update destination packet for storing the updated data is generated in the storage area, and data writing is started. At the time, the status information of the update destination packet is set to the first status, and the status information of the update source packet storing the data before update is set to the third status, and the data portion of the update destination packet is set to the update status. After writing the data, when the data writing is completed, the status information of the update destination packet is set to the second status and the status information of the update source packet is set to the fourth status, and the status information is set to the second status. A packet in a state or the third state is determined to be a valid packet, and a packet in the state information in the first state or the fourth state is determined to be an invalid packet. In location, by referring to the access information management table registered access information for accessing the valid packet among the packets stored in said storage area, and performs the access to the packet.

【0014】このような構成であれば、アクセス情報管
理テーブルを参照して、パケットへのアクセスが行われ
る。アクセス情報管理テーブルには、有効なパケットへ
のアクセス情報が登録されているため、パケットへのア
クセスを行うごとに、パケットが有効か無効かの判定を
行う必要がなくなる。なお、パケットのデータを更新す
るときは、まず、パケットの状態情報が第1の状態に設
定され、パケット長などの情報が設定されている、更新
先のパケット管理部を末尾パケットの次の位置に書き込
み、かつ更新元パケットの状態情報が第3の状態に設定
される。そして、更新先パケットのデータ部に更新後の
データが書き込まれ、データ書込完了時には、更新先パ
ケットの状態情報が第2の状態にかつ更新元パケットの
状態情報が第4の状態に設定される。
With such a configuration, the access to the packet is performed with reference to the access information management table. Since access information for valid packets is registered in the access information management table, it is not necessary to determine whether a packet is valid or invalid each time a packet is accessed. When updating the packet data, first, the packet status information is set to the first state, and information such as the packet length is set. And the status information of the update source packet is set to the third status. Then, the updated data is written to the data portion of the update destination packet, and when the data writing is completed, the status information of the update destination packet is set to the second status and the status information of the update source packet is set to the fourth status. You.

【0015】例えば、何らかの原因によりデータの更新
が中断された場合は、状態情報が第2の状態または第3
の状態であるパケットが有効なパケットであると判定さ
れ、状態情報が第1の状態または第4の状態であるパケ
ットが無効なパケットであると判定される。したがっ
て、データの更新が完了するまでは、更新先パケット
は、有効なパケットとして識別されない。
For example, if the update of data is interrupted for some reason, the status information indicates the second status or the third status.
Is determined to be a valid packet, and a packet whose status information is the first state or the fourth state is determined to be an invalid packet. Therefore, the update destination packet is not identified as a valid packet until the data update is completed.

【0016】ここで、本装置は、あらかじめ生成された
アクセス情報管理テーブルを参照するようになっていて
もよいし、アクセス情報管理テーブルを生成し、生成し
たアクセス情報管理テーブルを参照するようになってい
てもよい。後者の場合、アクセス情報管理テーブルの生
成の時期は、いつでもよい。また、第2の状態である状
態情報と第3の状態である状態情報とは、それぞれ異な
る状態を示すものであってもよいし、いずれも同一の状
態を示すものであってもよい。このことは、第1の状態
である状態情報と第4の状態である状態情報との関係に
ついても同様である。
Here, the present apparatus may refer to an access information management table generated in advance, or generate an access information management table and refer to the generated access information management table. May be. In the latter case, the access information management table may be generated at any time. Further, the state information as the second state and the state information as the third state may indicate different states, respectively, or may indicate the same state. The same applies to the relationship between the state information in the first state and the state information in the fourth state.

【0017】また、パケットは、どのようなデータ長で
あってもよく、固定長であってもよいし、可変長であっ
てもよい。また、更新先パケットの状態情報を第2の状
態にかつ更新元パケットの状態情報を第4の状態に設定
する順番は、どちらが先であってもよいが、更新先パケ
ットの状態情報を第2の状態に設定してから、更新元パ
ケットの状態情報を第4の状態に設定する順番の方が好
ましい。これは、更新先パケットの状態情報を変更した
後であって更新元パケットの状態情報を変更する前に、
何らかの原因によりデータの更新が中断された場合で
も、更新先パケットが有効なパケットであると判定され
るからである。
The packet may have any data length, may have a fixed length, or may have a variable length. The order in which the state information of the update destination packet is set to the second state and the state information of the update source packet is set to the fourth state may be any order, but the state information of the update destination packet is set to the second state. It is more preferable to set the state information of the update source packet to the fourth state after setting the state to the fourth state. This is after changing the status information of the update destination packet and before changing the status information of the update source packet,
This is because, even if the data update is interrupted for some reason, the update destination packet is determined to be a valid packet.

【0018】また、更新先パケットの状態情報を第1の
状態にかつ更新元パケットの状態情報を第3の状態に設
定する順番は、どちらが先であってもよい。さらに、本
発明に係る請求項2記載のフラッシュメモリのデータ管
理装置は、請求項1記載のフラッシュメモリのデータ管
理装置において、前記アクセス情報管理テーブルを起動
時に生成するようになっている。
The order in which the state information of the update destination packet is set to the first state and the state information of the update source packet is set to the third state may be any order. Further, a flash memory data management device according to a second aspect of the present invention is the flash memory data management device according to the first aspect, wherein the access information management table is generated at the time of startup.

【0019】このような構成であれば、起動すると、ア
クセス情報管理テーブルが生成され、起動後は、生成さ
れたアクセス情報管理テーブルを参照して、パケットへ
のアクセスが行われる。さらに、本発明に係る請求項3
記載のフラッシュメモリのデータ管理装置は、請求項1
および2のいずれかに記載のフラッシュメモリのデータ
管理装置において、前記アクセス情報は、前記パケット
を識別するためのパケット識別情報と、前記パケットの
格納位置を特定するためのアドレスとを含んで構成され
ている。
With such a configuration, when activated, an access information management table is generated. After activation, access to the packet is performed with reference to the generated access information management table. Further, claim 3 according to the present invention.
The data management device for a flash memory according to claim 1,
3. The data management device for a flash memory according to claim 1, wherein the access information includes packet identification information for identifying the packet, and an address for specifying a storage position of the packet. ing.

【0020】このような構成であれば、パケット識別情
報が与えられると、与えられたパケット識別情報をもと
にアクセス情報管理テーブルが検索され、そのパケット
識別情報に該当するアクセス情報が索出される。そし
て、索出されたアクセス情報に含まれるアドレスに基づ
いてパケットへのアクセスが行われる。さらに、本発明
に係る請求項4記載のフラッシュメモリのデータ管理装
置は、請求項3記載のフラッシュメモリのデータ管理装
置において、前記アクセス情報は、さらに、前記有効な
パケットを含んで構成されている。
With this configuration, when the packet identification information is provided, the access information management table is searched based on the provided packet identification information, and the access information corresponding to the packet identification information is found. . Then, access to the packet is performed based on the address included in the retrieved access information. According to a fourth aspect of the present invention, in the data management device for a flash memory according to the third aspect, the access information further includes the valid packet. .

【0021】このような構成であれば、例えば、パケッ
トからのデータ読込は、アクセス情報管理テーブルから
行われる。さらに、本発明に係る請求項5記載のフラッ
シュメモリのデータ管理装置は、請求項1ないし4のい
ずれかに記載のフラッシュメモリのデータ管理装置にお
いて、前記アクセス情報管理テーブルを、データの保持
に電力を要する記憶媒体に記憶するようになっている。
With such a configuration, for example, data reading from a packet is performed from the access information management table. A flash memory data management device according to a fifth aspect of the present invention is the flash memory data management device according to any one of the first to fourth aspects, wherein the access information management table is used to hold data. Is stored in a storage medium that requires

【0022】このような構成であれば、アクセス情報管
理テーブルが、データの保持に電力を要する記憶媒体に
記憶される。
With such a configuration, the access information management table is stored in a storage medium that requires power to hold data.

【0023】[0023]

【発明の実施の形態】以下、本発明の実施の形態を図面
を参照しながら説明する。図1ないし図18は、本発明
に係るフラッシュメモリのデータ管理装置の実施の形態
を示す図である。本実施の形態は、本発明に係るフラッ
シュメモリのデータ管理装置を、図1に示すように、フ
ラッシュメモリであるフラッシュROM52のデータ初
期化単位からなるブロックに、コンピュータ100の設
定に必要なデータ(例えば、IPアドレス、アクセスす
べきWWW(World Wide Web)サーバのURL(Univer
sal Resource Locater))を、可変長のパケット単位で
記憶する場合について適用したものである。
Embodiments of the present invention will be described below with reference to the drawings. 1 to 18 are diagrams showing an embodiment of a data management device for a flash memory according to the present invention. In the present embodiment, as shown in FIG. 1, the data management device for a flash memory according to the present invention stores data necessary for setting of the computer 100 in a block composed of data initialization units of a flash ROM 52 as a flash memory. For example, an IP address, a URL of a WWW (World Wide Web) server to be accessed (Univer
sal Resource Locater)) is applied to the case of storing in variable-length packet units.

【0024】まず、コンピュータ100の構成を図1を
参照しながら説明する。図1は、コンピュータ100の
構成を示すブロック図である。コンピュータ100は、
図1に示すように、制御プログラムに基づいて演算およ
びシステム全体を制御するCPU50と、所定領域にあ
らかじめCPU50の制御プログラム等を格納している
フラッシュROM52と、フラッシュROM52等から
読み出したデータやCPU50の演算過程で必要な演算
結果を格納するためのRAM54と、VRAM55に格
納されているデータを画像信号に変換して出力するグラ
フィックチップ56と、外部装置に対してデータの入出
力を媒介するI/F58とで構成されており、これら
は、データを転送するための信号線であるバス59で相
互にかつデータ授受可能に接続されている。
First, the configuration of the computer 100 will be described with reference to FIG. FIG. 1 is a block diagram showing a configuration of the computer 100. Computer 100
As shown in FIG. 1, a CPU 50 for controlling the arithmetic and the entire system based on a control program, a flash ROM 52 in which a control program for the CPU 50 is stored in a predetermined area in advance, data read from the flash ROM 52 and the like, A RAM 54 for storing a calculation result required in a calculation process, a graphic chip 56 for converting data stored in a VRAM 55 into an image signal and outputting the image signal, and an I / O for mediating data input / output to / from an external device. F58, which are connected to each other and capable of exchanging data via a bus 59, which is a signal line for transferring data.

【0025】I/F58には、外部装置として、ヒュー
マンインターフェースとしてデータの入力が可能でかつ
画像信号に基づいて画面を表示するLCD(Liquid Cry
stalDisplay)からなるタッチパネル60が接続されて
おり、その他、図示しないが、音を出力するスピーカ
と、インターネットに接続するための信号線等が接続さ
れている。
The I / F 58 is an external device such as an LCD (Liquid Cry) which can input data as a human interface and displays a screen based on image signals.
The touch panel 60 is connected to the touch panel 60 and a speaker (not shown) for outputting sound, a signal line for connecting to the Internet, and the like.

【0026】グラフィックチップ56は、VRAM55
に格納されている表示用データを先頭アドレスから所定
周期で順次読み出し、読み出した表示用データを画像信
号に変換してタッチパネル60に出力するようになって
いる。次に、フラッシュROM52の構成を図2ないし
図8を参照しながら詳細に説明する。図2は、ブロック
A,Bのデータ構造を示す図である。
The graphic chip 56 includes a VRAM 55
Are sequentially read from the head address at a predetermined cycle, and the read display data is converted into an image signal and output to the touch panel 60. Next, the configuration of the flash ROM 52 will be described in detail with reference to FIGS. FIG. 2 is a diagram showing the data structure of blocks A and B.

【0027】フラッシュROM52は、データ書換可能
な不揮発性の記憶素子からなり、図2に示すように、そ
の記憶領域をデータ初期化単位からなる複数のブロック
に論理的に区分し、それらブロックのうち2つのブロッ
クA,Bが、データの書込を行うためのデータ書込用領
域、およびブロックの更新時に用いるデータ更新用領域
として利用される。なお、フラッシュROM52は、例
えば、初期化状態(初期化されてデータが書き込まれて
いない状態)では記憶領域のデータビットが「1」とな
るものである。
The flash ROM 52 is composed of a data rewritable nonvolatile storage element. As shown in FIG. 2, the storage area is logically divided into a plurality of blocks each composed of a data initialization unit. The two blocks A and B are used as a data write area for writing data and a data update area used when updating a block. In the flash ROM 52, for example, the data bits in the storage area are “1” in an initialized state (a state in which data is initialized and data is not written).

【0028】ブロックA,Bは、いずれも、ブロックの
管理に関する領域管理データを格納するための領域管理
部70と、パケットを格納するためのパケット部72と
からなっており、一方がデータ書込用領域となっている
ときは、他方がデータ更新用領域となり、逆に、他方が
データ書込用領域となっているときは、一方がデータ更
新用領域となる。データの書込は、データ書込用領域と
なるブロックに対して行う。これに対し、ブロックの更
新は、データ書込用領域となるブロックのパケット部7
2にデータを書き込むための領域が不足したときに行う
ものであって、データ書込用領域となるブロックのパケ
ット部72の有効なパケットのデータを、その配置位置
が整順されるように、データ更新用領域となるブロック
のパケット部72に書き込むことにより行う。そして、
パケット部72へのデータの書込が完了した時点で、デ
ータ更新用領域となっているブロックをデータ書込用領
域とし、データ書込用領域となっているブロックをデー
タ更新用領域とする。
Each of the blocks A and B comprises an area management section 70 for storing area management data relating to block management and a packet section 72 for storing packets. When it is a data update area, the other is a data update area, and when the other is a data write area, one is a data update area. Data writing is performed on a block that is to be a data writing area. On the other hand, the update of the block is performed by the packet unit 7 of the block serving as the data write area.
2 is performed when an area for writing data is insufficient, and data of valid packets in the packet section 72 of a block serving as a data writing area are arranged in order such that their arrangement positions are ordered. This is performed by writing to the packet section 72 of the block that becomes the data update area. And
When the data writing to the packet unit 72 is completed, the block serving as the data update area is set as the data write area, and the block serving as the data write area is set as the data update area.

【0029】領域管理部70は、図3に示すように、ブ
ロックの初期化回数を示す初期化回数情報を格納する領
域70aと、ブロックの異なる5つの状態を示す領域状
態情報1〜5を格納する領域70b〜70fとからなっ
ており、各領域70a〜70fは、フラッシュROM5
2のデータ読出単位(例えば、4バイト(32ビッ
ト))の記憶容量を有している。図3は、領域管理部7
0のデータ構造を示す図である。
As shown in FIG. 3, the area management section 70 stores an area 70a for storing initialization number information indicating the number of initializations of a block, and area state information 1 to 5 indicating five different states of the block. Area 70b to 70f, and each area 70a to 70f
It has a storage capacity of two data read units (for example, 4 bytes (32 bits)). FIG. 3 shows the area management unit 7.
It is a figure showing the data structure of 0.

【0030】各領域状態情報1〜5は、図4に示すよう
に構成されている。図4は、領域状態情報の内容を示す
図である。領域状態情報1は、図4の上1段目の項目に
示すように、ブロックが初期化されていること(初期化
完了状態)を示す情報であって、「INIT」という4
バイトの書込情報として領域70bに書き込まれる。ま
た、領域状態情報2は、図4の上2段目の項目に示すよ
うに、ブロックへのデータ書込中であること(データ書
込中状態)を示す情報であって、「STUP」という4
バイトの書込情報として領域70cに書き込まれる。ま
た、領域状態情報3は、図4の上3段目の項目に示すよ
うに、ブロックへのデータ書込が完了し、さらにブロッ
クのパケット部72にデータの追記が可能であること
(データ書込完了状態)を示す情報であって、「NOR
M」という4バイトの書込情報として領域70dに書き
込まれる。
Each of the area status information 1 to 5 is configured as shown in FIG. FIG. 4 is a diagram showing the contents of the area state information. The area state information 1 is information indicating that the block has been initialized (initialization completed state), as shown in the first row of FIG.
It is written to the area 70b as byte write information. The area state information 2 is information indicating that data is being written to the block (data writing state), and is referred to as “STUP”, as shown in the second item in the upper part of FIG. 4
The data is written to the area 70c as byte write information. As shown in the upper third column of FIG. 4, the area state information 3 indicates that data writing to the block has been completed and that data can be additionally written to the packet portion 72 of the block (data writing). Information indicating the status of “NOR”
M ”is written to the area 70d as 4-byte write information.

【0031】領域状態情報4は、図4の上4段目の項目
に示すように、ブロックのデータを更新するため、ブロ
ックからのデータ移動中であること(データ移動中)を
示す情報であって、「MOVE」という4バイトの書込
情報として領域70eに書き込まれる。また、領域状態
情報5は、図4の上5段目の項目に示すように、ブロッ
クからのデータ移動が完了したこと(データ移動完了状
態)を示す情報であって、「MFIN」という4バイト
の書込情報として領域70fに書き込まれる。
The area state information 4 is information indicating that data is being moved from the block (data is being moved) in order to update the data of the block, as shown in the fourth column in FIG. Then, it is written into the area 70e as 4-byte write information "MOVE". The area state information 5 is information indicating that data movement from a block has been completed (data movement completed state), as shown in the fifth item in the upper part of FIG. Is written in the area 70f.

【0032】領域状態情報1〜5は、その順序で各領域
70b〜70fに書き込まれるものである。したがっ
て、例えば、領域状態情報3は、領域状態情報1,2が
書き込まれていない状態では、書き込まれないし、領域
状態情報4,5が書き込まれている状態でも、書き込ま
れない。なお、領域状態情報1〜5がいずれも書き込ま
れていない状態、または領域状態情報1〜5がその順序
で書き込まれていない状態は、ブロックが一度も初期化
されたことがないもの(未初期化状態)として定義し、
取り扱う。
The area state information 1 to 5 are written in the respective areas 70b to 70f in that order. Therefore, for example, the area state information 3 is not written when the area state information 1 and 2 are not written, and is not written even when the area state information 4 and 5 are written. A state in which none of the area state information 1 to 5 has been written or a state in which the area state information 1 to 5 has not been written in that order means that the block has never been initialized (uninitialized). State)
handle.

【0033】パケット部72は、フラッシュROM52
のデータ読出単位(例えば、4バイト)の倍数からなる
所定容量の記憶領域を有し、図5に示すように、可変長
の複数のパケットP1〜Pnを格納可能となっており、各
パケットP1〜Pnは、パケットの管理に関する管理デー
タを格納するための管理部80と、データを格納するた
めのデータ部82とからなり、パケット部72の先頭ア
ドレスから末尾アドレスに向けて順次生成されていく。
図5は、パケット部72のデータ構造を示す図である。
The packet section 72 includes a flash ROM 52
5 has a storage area of a predetermined capacity which is a multiple of a data read unit (for example, 4 bytes), and as shown in FIG. 5, a plurality of packets P 1 to P n of variable length can be stored. Each of the packets P 1 to P n includes a management unit 80 for storing management data related to packet management, and a data unit 82 for storing data. The packets P 1 to P n are sequentially arranged from the top address to the end address of the packet unit 72. Generated.
FIG. 5 is a diagram illustrating a data structure of the packet unit 72.

【0034】管理部80は、図6に示すように、パケッ
トの異なる5つの状態を示す状態情報を格納する領域8
0aと、パケットを識別するためのIDを示すID情報
を格納する領域80bと、パケットが生成された順に付
す連続番号を示す連続番号情報を格納する領域80c
と、データ部82のデータ長を示すデータ長情報を格納
する領域80dとからなり、各領域80a〜80dは、
1バイト(8ビット)の記憶容量を有し、管理部80全
体として、フラッシュROM52のデータ読出単位(例
えば、4バイト(32ビット))の記憶容量を有してい
る。図6は、管理部80のデータ構造を示す図である。
As shown in FIG. 6, the management unit 80 stores an area 8 for storing state information indicating five different states of the packet.
0a, an area 80b for storing ID information indicating an ID for identifying a packet, and an area 80c for storing serial number information indicating a serial number assigned in the order in which the packets were generated.
And an area 80d for storing data length information indicating the data length of the data section 82. Each of the areas 80a to 80d includes:
The management unit 80 as a whole has a storage capacity of a data read unit (for example, 4 bytes (32 bits)) of the flash ROM 52. FIG. 6 is a diagram illustrating a data structure of the management unit 80.

【0035】状態情報は、上記領域状態情報と異なり、
領域80aに格納される1つのデータによりパケットの
異なる5つの状態を示すものであって、図7に示すよう
に構成されている。図7は、状態情報の内容を示す図で
ある。状態情報は、第1の状態として、パケットへのデ
ータ書込中であること(データ書込中状態)を示し、こ
の場合、「7FH」という1バイトの書込情報として領
域80aに書き込まれる。また、第2の状態として、パ
ケットへのデータ書込が完了したこと(データ書込完了
状態)を示し、この場合、第1の状態を示す書込情報の
「1」の最上位ビットを「0」に設定した「3FH」と
いう1バイトの書込情報として領域80aに書き込まれ
る。また、第3の状態として、パケットのデータ更新中
であること(データ更新中状態)を示し、この場合、第
2の状態を示す書込情報の「1」の最上位ビットを
「0」に設定した「1FH」という1バイトの書込情報
として領域80aに書き込まれる。
The state information is different from the area state information.
This shows five different states of the packet by one data stored in the area 80a, and is configured as shown in FIG. FIG. 7 is a diagram showing the contents of the state information. The status information indicates, as the first status, that data is being written to the packet (data writing status). In this case, the status information is written in the area 80a as 1-byte write information “7FH”. The second state indicates that data writing to the packet has been completed (data write completed state). In this case, the most significant bit of “1” in the write information indicating the first state is “2”. It is written to the area 80a as 1-byte write information of "3FH" set to "0". The third state indicates that the data of the packet is being updated (data updating state). In this case, the most significant bit of “1” of the write information indicating the second state is set to “0”. The data is written to the area 80a as the set 1-byte write information “1FH”.

【0036】状態情報は、第4の状態として、パケット
のデータ更新が完了したこと(データ更新完了状態)を
示し、この場合、第3の状態を示す書込情報の「1」の
最上位ビットを「0」に設定した「0FH」という1バ
イトの書込情報として領域80aに書き込まれる。ま
た、第5の状態として、パケットが未使用であること
(未使用状態)を示し、この場合、「FFH」という1
バイトの書込情報(すなわち、初期化状態のまま)とし
て領域80aに書き込まれる。
The state information indicates, as the fourth state, that the data update of the packet has been completed (data update completed state). In this case, the most significant bit of “1” of the write information indicating the third state Is set to “0”, and is written to the area 80a as 1-byte write information “0FH”. Also, the fifth state indicates that the packet is unused (unused state), and in this case, “1” called “FFH”
It is written to the area 80a as byte write information (that is, in the initialized state).

【0037】状態情報は、第5の状態、第1の状態、第
2の状態、第3の状態および第4の状態の順序で領域8
0aに書き込まれるものである。したがって、例えば、
状態情報が第3の状態であるときは、そのパケットが属
するブロックが初期化されない限り、第1の状態または
第2の状態になることはない。また、フラッシュROM
52には、図8に示すように、ブロックA,Bの領域状
態情報の状態に応じてブロックA,Bに対する処理を割
り当てた処理定義テーブルが格納されている。図8は、
処理定義テーブルのデータ構造を示す図である。
The state information is stored in the area 8 in the order of the fifth state, the first state, the second state, the third state, and the fourth state.
0a. So, for example,
When the state information is the third state, the state does not change to the first state or the second state unless the block to which the packet belongs is initialized. Also, flash ROM
As shown in FIG. 8, the processing definition table 52 stores the processing definition to which the processing for the blocks A and B is assigned according to the state of the area state information of the blocks A and B. FIG.
It is a figure showing the data structure of a process definition table.

【0038】処理定義テーブルは、図8に示すように構
成されており、ブロックA,Bのそれぞれの状態によっ
て特定される処理定義テーブルの各要素が示す処理内容
は、次のようになっている。ブロックAの状態がデータ
移動中でありかつブロックBの状態が未初期化またはデ
ータ書込中であるときは、ブロックBを初期化する。ブ
ロックAの状態がデータ移動中でありかつブロックBの
状態が初期化完了であるときは、ブロックAの有効なパ
ケットのデータをブロックBのパケット部72に書き込
むことにより、ブロックAをブロックBに更新する。ブ
ロックAの状態がデータ書込中でありかつブロックBの
状態が未初期化若しくは初期化完了であるとき、ブロッ
クAの状態がデータ移動中でありかつブロックBの状態
がデータ書込完了であるとき、またはブロックAの状態
がデータ移動完了でありかつブロックBの状態が未初期
化、初期化完了、データ書込中若しくはデータ書込完了
であるときは、ブロックAを初期化する。ブロックAの
状態がデータ書込完了でありかつブロックBの状態が未
初期化、初期化完了若しくはデータ書込中であるとき
は、ブロックAをデータ書込用領域とする。
The processing definition table is configured as shown in FIG. 8, and the processing contents indicated by each element of the processing definition table specified by each state of the blocks A and B are as follows. . If the state of the block A is in data movement and the state of the block B is not initialized or data is being written, the block B is initialized. When the state of the block A is moving data and the state of the block B is initialization completed, the data of the valid packet of the block A is written into the packet section 72 of the block B, so that the block A is changed to the block B. Update. When the state of the block A is writing data and the state of the block B is uninitialized or the initialization is completed, the state of the block A is data moving and the state of the block B is data writing completed. At this time, or when the state of the block A is data movement completed and the state of the block B is uninitialized, initialization completed, data writing or data writing completed, the block A is initialized. When the state of the block A is data writing completed and the state of the block B is uninitialized, initialization completed, or data writing is being performed, the block A is used as a data writing area.

【0039】また、ブロックBの状態がデータ移動中で
ありかつブロックAの状態が未初期化またはデータ書込
中であるときは、ブロックAを初期化する。ブロックB
の状態がデータ移動中でありかつブロックAの状態が初
期化完了であるときは、ブロックBの有効なパケットの
データをブロックAのパケット部72に書き込むことに
より、ブロックBをブロックAに更新する。ブロックB
の状態がデータ書込中でありかつブロックAの状態が未
初期化若しくは初期化完了であるとき、ブロックBの状
態がデータ移動中でありかつブロックAの状態がデータ
書込完了であるとき、またはブロックBの状態がデータ
移動完了でありかつブロックAの状態が未初期化、初期
化完了、データ書込中若しくはデータ書込完了であると
きは、ブロックBを初期化する。ブロックBの状態がデ
ータ書込完了でありかつブロックAの状態が未初期化、
初期化完了若しくはデータ書込中であるときは、ブロッ
クBをデータ書込用領域とする。
If the state of the block B is data movement and the state of the block A is not initialized or data is being written, the block A is initialized. Block B
Is in a data movement state and the state of the block A is initialization completed, the block B is updated to the block A by writing the data of the valid packet of the block B into the packet section 72 of the block A. . Block B
Is in data writing and the state of block A is uninitialized or initialization completed, when the state of block B is data movement and the state of block A is data writing completed, Alternatively, when the state of the block B is data transfer completed and the state of the block A is uninitialized, initialization completed, during data writing, or data writing completed, the block B is initialized. The state of block B is data write completed and the state of block A is uninitialized,
When initialization is completed or data writing is being performed, block B is used as a data writing area.

【0040】また、ブロックAの状態が未初期化若しく
は初期化完了でありかつブロックBの状態が未初期化ま
たは初期化完了であるときは、ブロックA,Bに対する
初期化処理を行う。一方、図1に戻り、CPU50は、
マイクロプロセッシングユニットMPU等からなり、フ
ラッシュROM52の所定領域に格納されている所定の
プログラムを起動させ、そのプログラムに従って、図9
のフローチャートに示すテーブル生成処理を起動時に実
行し、図12および図15のフローチャートに示すパケ
ットアクセス処理およびブロック更新処理をそれぞれ時
分割で実行するようになっている。
When the state of the block A is uninitialized or the initialization is completed, and the state of the block B is uninitialized or the initialization is completed, the initialization processing for the blocks A and B is performed. On the other hand, returning to FIG.
A predetermined program stored in a predetermined area of the flash ROM 52 is started by the micro processing unit MPU or the like, and the program shown in FIG.
12 is executed at the time of startup, and the packet access process and the block update process shown in the flowcharts of FIGS. 12 and 15 are respectively executed in a time-division manner.

【0041】初めに、テーブル生成処理を図9を参照し
ながら詳細に説明する。図9は、テーブル生成処理を示
すフローチャートである。テーブル生成処理は、パケッ
ト部72に格納されているパケットのうち有効なパケッ
トにアクセスするためのアクセス情報を登録したパケッ
トアドレス管理テーブル400およびIDインデックス
変換テーブル420をRAM54上に生成する処理であ
って、CPU50において実行されると、図9に示すよ
うに、まず、ステップS10に移行するようになってい
る。
First, the table generation processing will be described in detail with reference to FIG. FIG. 9 is a flowchart showing the table generation processing. The table generation process is a process of generating, on the RAM 54, a packet address management table 400 and an ID index conversion table 420 in which access information for accessing a valid packet among the packets stored in the packet unit 72 is registered. When executed by the CPU 50, the process first proceeds to step S10, as shown in FIG.

【0042】ステップS10では、パケットアドレス管
理テーブル400をRAM54上に生成する。パケット
アドレス管理テーブル400は、図10に示すような構
成となっている。図10は、パケットアドレス管理テー
ブル400のデータ構造を示す図である。パケットアド
レス管理テーブル400には、図10に示すように、有
効なパケットごとに1つのレコードが登録される。各レ
コードは、レコードを参照するための参照インデックス
を登録するフィールド402と、有効なパケットのフラ
ッシュROM52上のアドレスを登録するフィールド4
04と、有効なパケットのデータ部82のデータ長を登
録するフィールド405と、有効なパケットのデータ部
82の内容を登録するフィールド406とを含んで構成
されている。なお、図10の例では、パケットアドレス
管理テーブル400にいくつかのレコードが登録されて
いるが、これは、ステップS18,S20を繰り返し経
てレコードが登録された結果を示すものであって、ステ
ップS10では、レコードが1つも登録されてない空の
テーブルを生成する。
In step S10, a packet address management table 400 is generated on the RAM 54. The packet address management table 400 has a configuration as shown in FIG. FIG. 10 shows a data structure of the packet address management table 400. As shown in FIG. 10, one record is registered in the packet address management table 400 for each valid packet. Each record has a field 402 for registering a reference index for referring to the record, and a field 4 for registering an address on the flash ROM 52 of a valid packet.
04, a field 405 for registering the data length of the data portion 82 of the valid packet, and a field 406 for registering the contents of the data portion 82 of the valid packet. In the example of FIG. 10, some records are registered in the packet address management table 400. This indicates the result of the record registration after repeating steps S18 and S20. Then, an empty table in which no record is registered is generated.

【0043】次いで、ステップS16に移行して、パケ
ットが有効であるか否かを判定し、パケットが有効であ
ると判定したとき(Yes)は、ステップS18に移行す
る。具体的に、ステップS16では、パケットの有効・
無効を次のように判定する。パケットの状態情報が第2
の状態または第3の状態であるときは、パケットが有効
であると判定し、パケットの状態情報が第1の状態また
は第4の状態であるときは、パケットが無効であると判
定する。また、同一のID情報を有するパケットについ
て状態情報が第2の状態であるパケットと状態情報が第
3の状態であるパケットが併存する場合には、状態情報
が第2の状態であるパケットの方を有効なパケットであ
ると判定する。
Next, the process proceeds to step S16, where it is determined whether the packet is valid. If it is determined that the packet is valid (Yes), the process proceeds to step S18. Specifically, in step S16, the validity
Invalidity is determined as follows. If the packet status information is
When the state is the third state or the third state, it is determined that the packet is valid. When the state information of the packet is the first state or the fourth state, it is determined that the packet is invalid. In addition, when packets having the same ID information and packets having status information in the second state coexist with packets having status information in the third state, the packet having the status information in the second state coexists. Is determined to be a valid packet.

【0044】ステップS18では、パケットのデータ部
82からデータを読み込み、ステップS20に移行し
て、参照インデックスを生成し、生成した参照インデッ
クス、パケットのフラッシュROM52上のアドレス、
パケットのデータ部82のデータ長およびデータの内容
をパケットアドレス管理テーブル400に登録し、ステ
ップS12に移行する。
In step S18, data is read from the data portion 82 of the packet, and the flow advances to step S20 to generate a reference index, the generated reference index, the address of the packet on the flash ROM 52,
The data length and data contents of the data portion 82 of the packet are registered in the packet address management table 400, and the process proceeds to step S12.

【0045】ステップS12では、パケットの管理部8
0からデータ長情報を取得し、ステップS14に移行し
て、取得したデータ長情報に基づいて次のパケットの格
納位置を特定し、ステップS22に移行する。ステップ
S22では、パケットがパケット部72の先頭アドレス
から数えて末尾のものであるか否かを判定し、パケット
が末尾のものであると判定したとき(Yes)は、ステップ
S24に移行するが、そうでないと判定したとき(No)
は、ステップS12に移行する。パケットが末尾のもの
であるか否かの判定は、具体的には次のようにして行
う。管理部80の状態情報を読み出し、読み出した状態
情報が第5の状態であるときは、その直前のパケットを
末尾のものであると判定する。末尾パケットの末尾アド
レスを新規パケット書き込みの際に使うため保存してお
く。
In step S12, the packet management unit 8
Data length information is acquired from 0, and the process proceeds to step S14, where the storage location of the next packet is specified based on the acquired data length information, and the process proceeds to step S22. In step S22, it is determined whether or not the packet is the last one counted from the first address of the packet part 72. If it is determined that the packet is the last one (Yes), the process proceeds to step S24. If not (No)
Moves to step S12. The determination of whether or not the packet is the last one is specifically performed as follows. The status information of the management unit 80 is read, and when the read status information is the fifth status, it is determined that the immediately preceding packet is the last packet. The last address of the last packet is saved for use when writing a new packet.

【0046】ステップS24では、ID情報を参照イン
デックスと対応付けて登録するIDインデックス変換テ
ーブル420をRAM54上に生成し、一連の処理を終
了して元の処理に復帰させる。IDインデックス変換テ
ーブル420は、図11に示すような構成となってい
る。図11は、IDインデックス変換テーブルのデータ
構造を示す図である。
In step S24, an ID index conversion table 420 for registering the ID information in association with the reference index is generated in the RAM 54, and a series of processing is completed to return to the original processing. The ID index conversion table 420 has a configuration as shown in FIG. FIG. 11 shows a data structure of the ID index conversion table.

【0047】IDインデックス変換テーブル420に
は、図11に示すように、各ID情報ごとに1つのレコ
ードが登録される。各レコードは、ID情報を登録する
フィールド422と、パケットアドレス管理テーブル4
00の参照インデックスを登録するフィールド424と
を含んで構成されている。図11の例では、IDインデ
ックス変換テーブル420には、使用が想定されるすべ
てのID情報を登録し、フィールド424には、ID情
報により特定されるパケットが有効なパケットとして存
在する場合は、パケットアドレス管理テーブル400の
対応する参照インデックスを登録し、ID情報により特
定されるパケットが有効なパケットとして存在しない場
合は、存在しないことを示す符号として例えば「−1」
を登録する。
As shown in FIG. 11, one record is registered in the ID index conversion table 420 for each piece of ID information. Each record includes a field 422 for registering ID information and a packet address management table 4
And a field 424 for registering a reference index of 00. In the example of FIG. 11, all ID information that is assumed to be used is registered in the ID index conversion table 420, and if the packet specified by the ID information exists as a valid packet, The corresponding reference index of the address management table 400 is registered, and when the packet specified by the ID information does not exist as a valid packet, for example, “−1” is used as a code indicating that it does not exist.
Register

【0048】一方、ステップS16で、パケットが無効
であると判定したとき(No)は、ステップS12に移行す
る。次に、パケットアクセス処理を図12を参照しなが
ら詳細に説明する。図12は、パケットアクセス処理を
示すフローチャートである。パケットアクセス処理は、
フラッシュROM52に対してデータの読込または書込
を行おうとする他の処理(図9、図12ないし図17の
フローチャートに示す処理以外のもの。以下、要求元処
理という。)からのデータ読込要求またはデータ書込要
求に応じて、パケット部72に格納されているパケット
にアクセスする処理であって、CPU50において実行
されると、図12に示すように、まず、ステップS50
に移行するようになっている。
On the other hand, if it is determined in step S16 that the packet is invalid (No), the process proceeds to step S12. Next, the packet access processing will be described in detail with reference to FIG. FIG. 12 is a flowchart showing the packet access processing. Packet access processing
A data read request from another process for reading or writing data to the flash ROM 52 (other than the processes shown in the flowcharts of FIGS. 9 and 12 to 17; hereinafter, referred to as a request source process) or This is a process of accessing a packet stored in the packet unit 72 in response to a data write request. When the process is executed by the CPU 50, first, as shown in FIG.
It is supposed to move to.

【0049】ステップS50では、要求元処理によりパ
ケットからデータを読み込むべきデータ読込要求がある
か否かを判定し、データ読込要求があると判定したとき
(Yes)は、ステップS52に移行して、データを読み込
むべきパケットを特定するためのID情報を要求元処理
から取得し、ステップS54に移行する。ステップS5
4では、取得したID情報に対応する参照インデックス
をIDインデックス変換テーブル420から取得し、取
得した値が、パケットが存在しないことを示す符号「−
1」であるか否かを判定し、取得した値が、パケットが
存在しないことを示す符号「−1」でないと判定したと
き(Yes)は、ステップS56に移行して、取得した参照
インデックスをもとに、パケットのデータ部82のデー
タをパケットアドレス管理テーブル400から取得して
要求元処理に受け渡し、一連の処理を終了して元の処理
に復帰させる。
In step S50, it is determined whether or not there is a data read request to read data from the packet by the request source process, and when it is determined that there is a data read request.
(Yes) moves to step S52, acquires ID information for specifying a packet from which data is to be read from the request source process, and moves to step S54. Step S5
In 4, a reference index corresponding to the acquired ID information is acquired from the ID index conversion table 420, and the acquired value is a sign “−” indicating that the packet does not exist.
1 ”, and when the obtained value is not the code“ −1 ”indicating that the packet does not exist (Yes), the process proceeds to step S56, and the obtained reference index is changed. Originally, the data of the data portion 82 of the packet is acquired from the packet address management table 400 and passed to the request source process, and a series of processes is completed to return to the original process.

【0050】一方、ステップS54で、IDインデック
ス変換テーブル420から取得した値が、パケットが存
在しないことを示す符号「−1」であると判定したとき
(No)は、ステップS58に移行して、エラーを出力し、
一連の処理を終了して元の処理に復帰させる。一方、ス
テップS50で、要求元処理によりデータ読込要求がな
いと判定したとき(No)は、ステップS60に移行して、
要求元処理によりパケットにデータを書き込むべきデー
タ書込要求があるか否かを判定し、データ書込要求があ
ると判定したとき(Yes)は、ステップS62に移行し
て、データを書き込むべきパケットを特定するためのI
D情報を要求元処理から取得し、ステップS64に移行
する。
On the other hand, when it is determined in step S54 that the value obtained from ID index conversion table 420 is code "-1" indicating that no packet exists.
(No) moves on to step S58 and outputs an error,
A series of processes is terminated and the process returns to the original process. On the other hand, when it is determined in step S50 that there is no data read request by the request source process (No), the process proceeds to step S60,
The request source process determines whether or not there is a data write request to write data to the packet. If it is determined that there is a data write request (Yes), the process proceeds to step S62 and the packet to be written I to identify
The D information is obtained from the request source process, and the routine goes to Step S64.

【0051】ステップS64では、取得したID情報に
対応する参照インデックスをIDインデックス変換テー
ブル420から取得し、取得した値が、パケットが存在
しないことを示す符号「−1」であるか否かを判定し、
取得した値が、パケットが存在しないことを示す符号
「−1」であると判定したとき(No)は、ステップS66
に移行して、データ新規書込処理を実行し、一連の処理
を終了して元の処理に復帰させる。
In step S64, a reference index corresponding to the obtained ID information is obtained from the ID index conversion table 420, and it is determined whether or not the obtained value is a code "-1" indicating that no packet exists. And
If it is determined that the obtained value is the code “−1” indicating that the packet does not exist (No), the process proceeds to step S66.
Then, a new data write process is executed, a series of processes is completed, and the process returns to the original process.

【0052】一方、IDインデックス変換テーブル42
0から取得した値が、パケットが存在しないことを示す
符号「−1」でないと判定したとき(Yes)は、ステップ
S68に移行して、データ更新処理を実行し、一連の処
理を終了して元の処理に復帰させる。一方、ステップS
60で、要求元処理によりデータ書込要求がないと判定
したとき(No)は、一連の処理を終了して元の処理に復帰
させる。
On the other hand, the ID index conversion table 42
When it is determined that the value obtained from 0 is not the code “−1” indicating that the packet does not exist (Yes), the process proceeds to step S68 to execute the data update process, and terminate the series of processes. Return to the original processing. On the other hand, step S
At 60, when it is determined that there is no data write request by the request source process (No), a series of processes is terminated and the process returns to the original process.

【0053】次に、上記ステップS66のデータ新規書
込処理を図13を参照しながら詳細に説明する。図13
は、データ新規書込処理を示すフローチャートである。
データ新規書込処理は、ブロックA,Bに対してデータ
の新規書込をパケット単位で行うときに実行され、初期
状態ではブロックAをデータ書込用領域とし、ブロック
Aに対してデータの書込を行い、それ以降は処理に応じ
てデータ書込用領域となるブロックに対してデータの書
込を行う処理であって、CPU50において実行される
と、図13に示すように、まず、ステップS100に移
行するようになっている。
Next, the new data writing process in step S66 will be described in detail with reference to FIG. FIG.
9 is a flowchart showing a data new writing process.
The new data write process is executed when new data is written to blocks A and B in packet units. In the initial state, block A is used as a data write area and data is written to block A. After that, as shown in FIG. 13, when the CPU 50 executes the processing, data is written into a block serving as a data writing area in accordance with the processing. The process proceeds to S100.

【0054】ステップS100では、ブロックの更新が
完了したか否かを判定し、ブロックの更新が完了したと
判定したとき(Yes)は、ステップS102に移行する
が、そうでないと判定したとき(No)は、ブロックの更新
が完了するまでステップS100で待機する。ステップ
S102では、新規データを格納するためのパケットを
生成する領域がパケット部72に不足しているか否かを
判定し、パケットを生成する十分な領域がパケット部7
2にあると判定したとき(No)は、ステップS104に移
行する。
In step S100, it is determined whether or not the update of the block has been completed. If it is determined that the update of the block has been completed (Yes), the process proceeds to step S102. If it is determined that the update has not been completed (No) ) Waits in step S100 until the block update is completed. In step S102, it is determined whether an area for generating a packet for storing new data is insufficient in the packet section 72, and a sufficient area for generating a packet is determined in the packet section 7.
If it is determined that the number is 2 (No), the process proceeds to step S104.

【0055】ステップS104では、新規データを格納
するためのパケットをパケット部72に生成し、ステッ
プS108に移行する。ステップS104では、具体的
に、パケット部72にパケットが1つも生成されていな
いときは、パケット部72の先頭アドレスからパケット
を生成し、パケット部72に既にパケットが生成されて
いるときは、パケット部72の先頭アドレスから数えて
末尾にあるパケットの末尾アドレスの次のアドレスから
パケットを生成する。また、パケットを生成するとき
は、要求元処理から取得したID情報、このパケットが
生成される順番を示す連続番号、新規データのデータ長
を示すデータ長情報をそれぞれ管理部80に書き込み、
状態情報を第1の状態に設定する。
In step S104, a packet for storing new data is generated in the packet section 72, and the flow advances to step S108. In step S104, specifically, if no packet has been generated in the packet section 72, a packet is generated from the start address of the packet section 72, and if a packet has already been generated in the packet section 72, the packet is generated. The packet is generated from the address next to the end address of the packet at the end counted from the start address of the unit 72. When a packet is generated, the ID information acquired from the request source process, a serial number indicating the order in which the packet is generated, and data length information indicating the data length of new data are written in the management unit 80, respectively.
Set the state information to the first state.

【0056】ステップS108では、新規データを、生
成したパケットのデータ部82に書き込み、ステップS
110に移行して、生成したパケットの状態情報を第2
の状態に設定し、ステップS112に移行して、参照イ
ンデックスを生成し、生成した参照インデックス、格納
位置を特定したパケットのフラッシュROM52上のア
ドレス、ステップS108で書き込んだデータ長および
データの内容をパケットアドレス管理テーブル400に
登録し、一連の処理を終了して元の処理に復帰させる。
In step S108, the new data is written into the data portion 82 of the generated packet, and
Proceeding to 110, the state information of the generated packet is stored in the second
Then, the process proceeds to step S112 to generate a reference index. The generated reference index, the address of the packet whose storage position is specified on the flash ROM 52, the data length and the data content written in step S108 are stored in the packet. The information is registered in the address management table 400, and a series of processing is ended to return to the original processing.

【0057】一方、ステップS102で、新規データを
格納するためのパケットを生成する領域がパケット部7
2に不足していると判定したとき(Yes)は、ステップS
128に移行して、ブロックの更新をすべきブロック更
新要求を出力し、ステップS100に移行する。次に、
上記ステップS68のデータ更新処理を図14を参照し
ながら詳細に説明する。図14は、データ更新処理を示
すフローチャートである。
On the other hand, in step S102, the area for generating a packet for storing new data is
If it is determined that there is a shortage in step 2 (Yes), step S
The process proceeds to 128, where a block update request for updating the block is output, and the process proceeds to step S100. next,
The data updating process in step S68 will be described in detail with reference to FIG. FIG. 14 is a flowchart showing the data update processing.

【0058】データ更新処理は、ブロックA,Bに対し
てデータの更新をパケット単位で行うときに実行され、
初期状態ではブロックAをデータ書込用領域とし、ブロ
ックAに対してデータの書込を行い、それ以降は処理に
応じてデータ書込用領域となるブロックに対してデータ
の書込を行う処理であって、CPU50において実行さ
れると、図14に示すように、まず、ステップS113
に移行するようになっている。
The data update process is executed when updating data for blocks A and B in packet units.
In the initial state, block A is used as a data write area, data is written into block A, and thereafter, data is written into a block that becomes a data write area according to processing. When executed by the CPU 50, first, as shown in FIG.
It is supposed to move to.

【0059】ステップS113では、ブロックの更新が
完了したか否かを判定し、ブロックの更新が完了したと
判定したとき(Yes)は、ステップS114に移行する
が、そうでないと判定したとき(No)は、ブロックの更新
が完了するまでステップS113で待機する。ステップ
S114では、更新後のデータを格納するための更新先
パケットを生成する領域がパケット部72に不足してい
るか否かを判定し、パケットを生成する十分な領域がパ
ケット部72にあると判定したとき(No)は、ステップS
116に移行する。
In step S113, it is determined whether or not the update of the block has been completed. If it is determined that the update of the block has been completed (Yes), the process proceeds to step S114. ) Waits in step S113 until the block update is completed. In step S114, it is determined whether or not an area for generating an update destination packet for storing the updated data is insufficient in the packet unit 72, and it is determined that the packet unit 72 has a sufficient area for generating the packet. (No), the step S
Move to 116.

【0060】ステップS116では、更新後のデータを
格納するための更新先パケットをパケット部72に生成
し、ステップS118に移行する。ステップS116で
は、具体的に、パケットを生成するときは、更新前のデ
ータを格納した更新元パケットに与えられたIDと同一
のIDを示すID情報、このパケットが生成される順番
を示す連続番号、および更新後のデータのデータ長を示
すデータ長情報をそれぞれ管理部80に書き込み、状態
情報を第1の状態に設定する。なお、パケットの生成場
所については、上記ステップS104と同様である。
In step S116, an update destination packet for storing the updated data is generated in the packet section 72, and the flow advances to step S118. In step S116, specifically, when a packet is generated, ID information indicating the same ID as the ID given to the update source packet storing the data before update, and a serial number indicating the order in which the packet is generated , And data length information indicating the data length of the updated data are written in the management unit 80, and the state information is set to the first state. The location where the packet is generated is the same as in step S104.

【0061】ステップS118では、更新元パケットの
状態情報を第3の状態に設定し、ステップS122に移
行して、更新後のデータを更新先パケットのデータ部8
2に書き込み、ステップS124に移行して、更新先パ
ケットの状態情報を第2の状態に設定し、ステップS1
26に移行して、更新元パケットの状態情報を第4の状
態に設定し、一連の処理を終了して元の処理に復帰させ
る。
In step S118, the state information of the update source packet is set to the third state, and the flow shifts to step S122 to update the updated data in the data portion 8 of the update destination packet.
2 and the process proceeds to step S124, where the status information of the update destination packet is set to the second status, and the process proceeds to step S1.
Then, the process goes to step S26, where the status information of the update source packet is set to the fourth status, and a series of processes is ended to return to the original process.

【0062】一方、ステップS114で、更新後のデー
タを格納するための更新先パケットを生成する領域がパ
ケット部72に不足していると判定したとき(Yes)は、
ステップS132に移行して、ブロックの更新をすべき
ブロック更新要求を出力し、ステップS113に移行す
る。次に、ブロック更新処理を図15を参照しながら詳
細に説明する。図15は、ブロック更新処理を示すフロ
ーチャートである。
On the other hand, if it is determined in step S114 that the area for generating the update destination packet for storing the updated data is insufficient in the packet section 72 (Yes),
The process shifts to step S132 to output a block update request to update the block, and shifts to step S113. Next, the block update processing will be described in detail with reference to FIG. FIG. 15 is a flowchart showing the block update processing.

【0063】ブロック更新処理は、上記ステップS12
8,S132で出力されるブロック更新要求を受けてブ
ロックA,Bを更新する処理であって、CPU50にお
いて実行されると、図15に示すように、まず、ステッ
プS300に移行するようになっている。ステップS3
00では、図8に示す処理定義テーブルを参照して、ブ
ロックA,Bに対する処理を実行し、ステップS302
に移行して、上記ステップS128,S132によりブ
ロック更新要求があるか否かを判定し、ブロック更新要
求があると判定したとき(Yes)は、ステップS304に
移行する。
The block updating process is performed in step S12
8. This is a process of updating blocks A and B in response to the block update request output in S132, and when executed by CPU 50, first, as shown in FIG. 15, the process proceeds to step S300. I have. Step S3
At 00, the processing for the blocks A and B is executed with reference to the processing definition table shown in FIG.
Then, it is determined whether there is a block update request in steps S128 and S132, and if it is determined that there is a block update request (Yes), the process proceeds to step S304.

【0064】ステップS304では、ブロックAが有効
であるか否かを判定し、ブロックAが有効であると判定
したとき(Yes)は、ステップS306に移行する。ステ
ップS304では、ブロックの有効・無効を次のように
判定する。ブロックの領域管理部70に領域状態情報
3,4が格納されているときは、そのブロックが有効で
あると判定し、ブロックの領域管理部70に領域状態情
報1,2,5が格納されているとき、またはブロックの
状態が未初期化であるときは、そのブロックが無効であ
ると判定する。
In step S304, it is determined whether or not block A is valid. If it is determined that block A is valid (Yes), the process proceeds to step S306. In step S304, the validity / invalidity of the block is determined as follows. If the area status information 3, 4 is stored in the block area management unit 70, it is determined that the block is valid, and the area state information 1, 2, 5, 5 is stored in the block area management unit 70. When the block is present or when the state of the block is not initialized, it is determined that the block is invalid.

【0065】ステップS306では、ブロックAの領域
管理部70に領域状態情報4を書き込み、ステップS3
00に移行する。一方、ステップS304で、ブロック
Aが無効であると判定したとき(No)(この場合、ブロッ
クBが有効であるはずなので、すなわちブロックBが有
効であると判定したとき)は、ステップS308に移行
して、ブロックBの領域管理部70に領域状態情報4を
書き込み、ステップS300に移行する。
In step S306, the area status information 4 is written in the area management unit 70 of the block A, and in step S3
Move to 00. On the other hand, if it is determined in step S304 that block A is invalid (No) (in this case, block B should be valid, that is, if it is determined that block B is valid), the process proceeds to step S308. Then, the area state information 4 is written to the area management unit 70 of the block B, and the process shifts to step S300.

【0066】一方、ステップS302で、上記ステップ
S128,S132によりブロック更新要求がないと判
定したとき(No)は、ステップS300に移行する。次
に、上記ステップS300の処理定義テーブルに基づく
処理を図16および図17を参照しながら詳細に説明す
る。図16および図17は、処理定義テーブルに基づく
処理を示すフローチャートである。
On the other hand, if it is determined in step S302 that there is no block update request in steps S128 and S132 (No), the process proceeds to step S300. Next, the process based on the process definition table in step S300 will be described in detail with reference to FIGS. FIGS. 16 and 17 are flowcharts showing processing based on the processing definition table.

【0067】処理定義テーブルに基づく処理は、上記ス
テップS300において実行されると、図16および図
17に示すように、まず、ステップS400に移行する
ようになっている。ステップS400では、ブロック
A,Bの領域状態情報を取得し、ステップS402に移
行して、図8に示す処理定義テーブルを参照して、取得
した領域状態情報からブロックA,Bに対する処理を選
択する。
When the process based on the process definition table is executed in step S300, as shown in FIGS. 16 and 17, the process first proceeds to step S400. In step S400, the area state information of the blocks A and B is acquired, and the process proceeds to step S402, and processing for the blocks A and B is selected from the acquired area state information with reference to the processing definition table shown in FIG. .

【0068】ステップS402の選択の結果、ブロック
Aを初期化する処理が選択されたとき()は、ステップ
S404に移行して、ブロックAを初期化し、ステップ
S406に移行して、ブロックAの初期化回数を「1」
加算してブロックAの領域管理部70にその初期化回数
情報を書き込み、ステップS408に移行して、ブロッ
クAの領域管理部70に領域状態情報1を書き込み、一
連の処理を終了して元の処理に復帰させる。
When the process for initializing the block A is selected as a result of the selection in the step S402 (), the process proceeds to step S404 to initialize the block A, and then proceeds to step S406 to initialize the block A. "1"
The addition is performed, and the initialization count information is written to the area management unit 70 of the block A, and the process proceeds to step S408, where the area state information 1 is written to the area management unit 70 of the block A. Return to processing.

【0069】一方、ステップS402の選択の結果、ブ
ロックBを初期化する処理が選択されたとき()は、ス
テップS410に移行して、ブロックBを初期化し、ス
テップS412に移行して、ブロックBの初期化回数を
「1」加算してブロックBの領域管理部70にその初期
化回数情報を書き込み、ステップS414に移行して、
ブロックBの領域管理部70に領域状態情報1を書き込
み、一連の処理を終了して元の処理に復帰させる。
On the other hand, when the process of initializing the block B is selected as a result of the selection in the step S402 (), the process shifts to the step S410 to initialize the block B, shifts to the step S412, and shifts to the step S412. Is added to the initialization number of the block B, the initialization number information is written to the area management unit 70 of the block B, and the process proceeds to step S414.
The area state information 1 is written in the area management unit 70 of the block B, and a series of processing is ended to return to the original processing.

【0070】一方、ステップS402の選択の結果、ブ
ロックBをブロックAに更新する処理が選択されたとき
()は、ステップS416に移行して、ブロックAの領
域管理部70に領域状態情報2を書き込み、ステップS
418に移行して、ブロックBの有効なパケットのデー
タを、その格納位置が整順されるように、ブロックAの
パケット部72に書き込み、ステップS420に移行す
る。具体的に、ステップS418では、ブロックBの有
効なパケットのデータを取得するのに、ブロックBのす
べてのパケットにアクセスし、それぞれが有効であるか
無効であるかを判定した上でそのデータを取得するので
はなく、パケットアドレス管理テーブル400を参照し
て有効なパケットにだけアクセスし、そのデータを取得
するようにする。これにより、ブロックBをブロックA
に更新する処理を比較的短時間で行うことができる。こ
のことは、ステップS426において同じである。
On the other hand, when the process of updating block B to block A is selected as a result of the selection in step S402
() Moves to step S416, writes the area state information 2 to the area management unit 70 of block A, and proceeds to step S416.
The flow shifts to 418, where the valid packet data of block B is written to the packet section 72 of block A so that the storage positions are ordered, and the flow shifts to step S420. Specifically, in step S418, in order to obtain data of a valid packet of the block B, all the packets of the block B are accessed, and it is determined whether each packet is valid or invalid. Instead of acquiring the data, access is made only to valid packets by referring to the packet address management table 400, and the data is acquired. As a result, block B is converted to block A
Can be performed in a relatively short time. This is the same in step S426.

【0071】ステップS420では、ブロックAの領域
管理部70に領域状態情報3を書き込み、ステップS4
22に移行して、ブロックBの領域管理部70に領域状
態情報5を書き込み、一連の処理を終了して元の処理に
復帰させる。一方、ステップS402の選択の結果、ブ
ロックAをブロックBに更新する処理が選択されたとき
()は、ステップS424に移行して、ブロックBの領
域管理部70に領域状態情報2を書き込み、ステップS
426に移行して、ブロックAの有効なパケットのデー
タを、その格納位置が整順されるように、ブロックBの
パケット部72に書き込み、ステップS428に移行し
て、ブロックBの領域管理部70に領域状態情報3を書
き込み、ステップS430に移行して、ブロックAの領
域管理部70に領域状態情報5を書き込み、一連の処理
を終了して元の処理に復帰させる。
In the step S420, the area state information 3 is written in the area management section 70 of the block A, and in the step S4
Then, the process goes to 22 to write the area state information 5 to the area management unit 70 of the block B, to end a series of processing and return to the original processing. On the other hand, when the process of updating block A to block B is selected as a result of the selection in step S402
() Moves to step S424, writes the area state information 2 to the area management unit 70 of block B, and proceeds to step S424.
The flow shifts to 426, where the valid packet data of block A is written to the packet section 72 of block B such that the storage positions are ordered, and the flow shifts to step S428, where the area management section 70 of block B is written. Then, the process moves to step S430, writes the region status information 5 to the region management unit 70 of the block A, ends a series of processing, and returns to the original processing.

【0072】一方、ステップS402の選択の結果、ブ
ロックAをデータ書込用領域とする処理が選択されたと
き()は、ステップS432に移行して、ブロックAを
データ書込領域とし、ステップS433に移行して、ブ
ロック更新要求を解除し、一連の処理を終了して元の処
理に復帰させる。一方、ステップS402の選択の結
果、ブロックBをデータ書込用領域とする処理が選択さ
れたとき()は、ステップS434に移行して、ブロッ
クBをデータ書込領域とし、ステップS435に移行し
て、ブロック更新要求を解除し、一連の処理を終了して
元の処理に復帰させる。
On the other hand, as a result of the selection in step S402, when the process of using the block A as the data write area is selected (), the flow shifts to step S432, where the block A is set as the data write area, and the process proceeds to step S433. Then, the block update request is released, a series of processing is ended, and the processing returns to the original processing. On the other hand, as a result of the selection in step S402, when the process of using the block B as the data write area is selected (), the process proceeds to step S434, the block B is used as the data write region, and the process proceeds to step S435. Then, the block update request is canceled, and a series of processing is ended to return to the original processing.

【0073】一方、ステップS402の選択の結果、ブ
ロックA,Bに対する初期化処理を行う処理が選択され
たとき()は、ステップS436に移行して、ブロック
A,Bを初期化し、ステップS438に移行して、ブロ
ックAの領域管理部70に領域状態情報1を書き込み、
一連の処理を終了して元の処理に復帰させる。一方、ス
テップS402の選択の結果、上記いずれの処理も選択
されないとき(×)は、一連の処理を終了して元の処理に
復帰させる。
On the other hand, as a result of the selection in step S402, when the processing for performing the initialization processing on the blocks A and B is selected (), the flow shifts to step S436 to initialize the blocks A and B, and then proceeds to step S438. Then, the area state information 1 is written to the area management unit 70 of the block A,
A series of processes is terminated and the process returns to the original process. On the other hand, if none of the above processes is selected as a result of the selection in step S402 (x), a series of processes is terminated and the process returns to the original process.

【0074】次に、上記実施の形態の動作を図面を参照
しながら説明する。まず、コンピュータ100が起動す
ると、CPU50により、ステップS10を経て、パケ
ットアドレス管理テーブル400がRAM54上に生成
され、パケットが有効なパケットであると判定される
と、ステップS16〜S20を経て、パケットのデータ
部82からデータが読み込まれ、参照インデックスが生
成され、生成された参照インデックス、パケットのフラ
ッシュROM52上のアドレス、パケットのデータ部8
2のデータ長およびデータの内容がパケットアドレス管
理テーブル400に登録される。
Next, the operation of the above embodiment will be described with reference to the drawings. First, when the computer 100 is started, the packet address management table 400 is generated on the RAM 54 by the CPU 50 through step S10, and if it is determined that the packet is a valid packet, the process proceeds to steps S16 to S20. Data is read from the data section 82, a reference index is generated, the generated reference index, the address of the packet on the flash ROM 52, and the data section 8 of the packet.
2 are registered in the packet address management table 400.

【0075】そして、ステップS22を繰り返し経て、
ステップS16〜S20,S12,S14の一連の処理
がパケット部72のすべてのパケットについて行われ、
パケットアドレス管理テーブル400の生成が完了する
と、ステップS24を経て、IDインデックス変換テー
ブル420がRAM54上に生成される。次に、ブロッ
クA,Bに対してデータの読込をパケット単位で行う場
合を説明する。
Then, after repeating step S22,
A series of processes in steps S16 to S20, S12, and S14 are performed for all packets in the packet unit 72,
When the generation of the packet address management table 400 is completed, the ID index conversion table 420 is generated on the RAM 54 via step S24. Next, a case where data is read from the blocks A and B in packet units will be described.

【0076】要求元処理からデータ読込要求を受ける
と、ブロックA,Bのうちデータ書込用領域となってい
るものに対してデータの読込が開始される。このとき、
データ読込要求と併せて、データを読み込むべきパケッ
トを特定するためのID情報が与えられる。データの読
込は、次のように行われる。CPU50により、ステッ
プS50〜S56を経て、与えられたID情報に対応す
る参照インデックスがIDインデックス変換テーブル4
20から取得され、取得された参照インデックスをもと
に、パケットのデータ部82のデータがパケットアドレ
ス管理テーブル400から取得される。そして、取得さ
れたデータが要求元処理に引き渡されることにより、デ
ータの読込が完了する。
When a data read request is received from the request source process, data reading is started for blocks A and B which are data write areas. At this time,
Along with the data read request, ID information for specifying a packet from which data is to be read is given. Reading of data is performed as follows. The CPU 50 passes the reference index corresponding to the given ID information through the steps S50 to S56 to the ID index conversion table 4.
20, the data of the data part 82 of the packet is acquired from the packet address management table 400 based on the acquired reference index. Then, the obtained data is transferred to the request source process, whereby the data reading is completed.

【0077】なお、要求元処理から与えられたID情報
により特定されるパケットが有効なパケットとして存在
しない場合は、ステップS50〜S54,S58を経
て、エラーが出力される。次に、ブロックA,Bに対し
てデータの新規書込をパケット単位で行う場合を説明す
る。
If the packet specified by the ID information given from the request source process does not exist as a valid packet, an error is output through steps S50 to S54 and S58. Next, a case where new writing of data to blocks A and B is performed in packet units will be described.

【0078】初期状態では、ブロックAをデータ書込用
領域とし、ブロックAに対してデータの書込が行われ
る。要求元処理からデータ新規書込要求を受けると、デ
ータ書込用領域となるブロックAに対してデータの新規
書込が開始される。このとき、データ新規書込要求と併
せて、記憶しようとするデータおよびデータを書き込む
べきパケットを特定するためのID情報が与えられる。
In the initial state, block A is used as a data write area, and data is written to block A. When a new data write request is received from the request source process, new writing of data to the block A that is a data write area is started. At this time, along with the new data write request, ID information for specifying the data to be stored and the packet in which the data is to be written are provided.

【0079】データの新規書込は、次のように行われ
る。CPU50により、ステップS60〜S66を経
て、データ新規書込処理が実行され、ステップS100
〜S110を経て、新規データを格納するためのパケッ
トがブロックAのパケット部72に生成される。このと
き、与えられたID情報、このパケットが生成される順
番を示す連続番号、および新規データのデータ長を示す
データ長情報がそれぞれ管理部80に書き込まれ、状態
情報が第1の状態(データ書込中)に設定される。そし
て、記憶しようとするデータが、生成されたパケットの
データ部82に書き込まれ、生成されたパケットの状態
情報が第2の状態(データ書込完了)に設定される。
The new writing of data is performed as follows. The CPU 50 performs a new data writing process through steps S60 to S66, and proceeds to step S100.
Through steps S110 to S110, a packet for storing new data is generated in the packet unit 72 of the block A. At this time, the given ID information, a serial number indicating the order in which this packet is generated, and data length information indicating the data length of the new data are written in the management unit 80, and the state information is stored in the first state (data (Writing). Then, the data to be stored is written into the data portion 82 of the generated packet, and the state information of the generated packet is set to the second state (data writing completed).

【0080】データの書込が中断されない通常の状態で
は、このようにブロックAのパケット部72にデータが
パケットとして書き込まれるのであるが、例えば、何ら
かの原因によりデータの書込が中断された場合は、次の
ように動作する。データの書込が中断された場合は、シ
ステムを再起動すると、ステップS10〜S24を経
て、パケットアドレス管理テーブル400およびIDイ
ンデックス変換テーブル420が生成される。このと
き、データの書込が中断される直前までデータの書込が
行われていたパケットは、状態情報が第1の状態となっ
ているので、ステップS16を経て、無効なパケットで
あると判定され、パケットアドレス管理テーブル400
には登録されない。
In a normal state in which data writing is not interrupted, data is written as a packet in the packet section 72 of the block A as described above. For example, when data writing is interrupted for some reason, It operates as follows. When the data writing is interrupted, when the system is restarted, the packet address management table 400 and the ID index conversion table 420 are generated through steps S10 to S24. At this time, since the state information is in the first state, the packet in which the data writing has been performed immediately before the interruption of the data writing is determined to be an invalid packet through step S16. And the packet address management table 400
Is not registered.

【0081】その後、要求元処理からデータ読込要求を
受けると、ここではまだブロックAがデータ書込用領域
となっているので、ブロックAに対してデータの読込が
開始される。このとき、データ読込要求と併せて、要求
元処理からは上記同一のID情報が与えられたとする。
しかし、与えられたID情報により特定されるパケット
は、有効なパケットとして存在しないこととなるので、
エラーが出力され、データの読込が行われない。
Thereafter, when a data read request is received from the request source process, data reading from block A is started because block A is still a data write area here. At this time, it is assumed that the same ID information is given from the request source process together with the data read request.
However, since the packet specified by the given ID information does not exist as a valid packet,
An error is output and data is not read.

【0082】なお、データの書込が中断されず、正常に
データの書込が完了した場合は、データ読込要求を受け
ると、ステップS50〜S56を経て、与えられたID
情報に基づいて、パケットのデータ部82のデータがパ
ケットアドレス管理テーブル400から取得される。そ
して、取得されたデータが要求元処理に引き渡されるこ
とにより、データの読込が完了する。
When the data writing is not interrupted and the data writing is completed normally, when the data read request is received, the given ID is passed through steps S50 to S56.
Based on the information, the data of the data portion 82 of the packet is obtained from the packet address management table 400. Then, the obtained data is transferred to the request source process, whereby the data reading is completed.

【0083】また、以上では、ブロックAに対してデー
タの新規書込を行う場合を説明したが、ブロックBに対
してデータの新規書込を行う場合も、上記同様の要領で
動作する。次に、ブロックA,Bに対してデータの更新
をパケット単位で行う場合を説明する。なお、ブロック
Aには、すでにいくつかのパケットが生成されており、
ここでは、それらのパケットのうちいずれかのデータを
更新する。
In the above description, the case where data is newly written to the block A has been described. However, the case where data is newly written to the block B operates in the same manner as described above. Next, a case in which data is updated for blocks A and B in packet units will be described. Note that some packets have already been generated in block A,
Here, any data of those packets is updated.

【0084】初期状態では、ブロックAをデータ書込用
領域とし、ブロックAに対してデータの書込が行われ
る。要求元処理からデータ更新要求を受けると、データ
書込用領域となるブロックAに対してデータの更新が開
始される。このとき、データ更新要求と併せて、更新後
のデータおよび更新対象となるパケットのID情報が与
えられる。
In the initial state, block A is used as a data write area, and data is written to block A. When a data update request is received from the request source process, data update is started for block A, which is a data write area. At this time, the updated data and the ID information of the packet to be updated are given together with the data update request.

【0085】データの更新は、次のように行われる。C
PU50により、ステップS60〜S64,S68を経
て、データ更新処理が実行され、ステップS113〜S
126を経て、更新後のデータを格納するための更新先
パケットがブロックAのパケット部72に生成される。
このとき、与えられたID情報、このパケットが生成さ
れる順番を示す連続番号、および更新後のデータのデー
タ長を示すデータ長情報がそれぞれ管理部80に書き込
まれ、状態情報が第1の状態(データ書込中)に設定さ
れ、更新元パケットの状態情報が第3の状態(データ更
新中)に設定される。そして、更新後のデータが更新先
パケットのデータ部82に書き込まれ、更新先パケット
の状態情報が第2の状態(データ書込完了)に設定され
るとともに更新元パケットの状態情報が第4の状態(デ
ータ更新完了)に設定される。
Updating of data is performed as follows. C
The data update process is executed by the PU 50 through steps S60 to S64 and S68, and
Through 126, an update destination packet for storing the updated data is generated in the packet unit 72 of the block A.
At this time, the given ID information, a serial number indicating the order in which this packet is generated, and data length information indicating the data length of the updated data are written in the management unit 80, and the state information is stored in the first state. (Data writing), and the status information of the update source packet is set to the third status (data updating). Then, the updated data is written to the data portion 82 of the update destination packet, the status information of the update destination packet is set to the second state (data writing completed), and the status information of the update source packet is set to the fourth state. Set to status (data update completed).

【0086】データの更新が中断されない通常の状態で
は、このようにブロックAのパケット部72にデータが
パケットとして書き込み更新されるのであるが、例え
ば、何らかの原因によりデータの更新が中断された場合
は、次のように動作する。データの更新が中断された場
合は、システムを再起動すると、ステップS10〜S2
4を経て、パケットアドレス管理テーブル400および
IDインデックス変換テーブル420が生成される。こ
のとき、更新先パケットよりも更新元パケットの方がパ
ケット部72の先頭アドレス側に格納されているので、
更新元パケットの格納位置が先に特定されるが、更新元
パケットは、先程データの更新が中断されたことから、
状態情報が第3の状態となっているので、ステップS1
6〜S20を経て、有効なパケットであると判定され、
パケットアドレス管理テーブル400に登録される。こ
れに対し、更新先パケットは、先程データの更新が中断
されたことから、状態情報が第1の状態となっているの
で、ステップS16を経て、無効なパケットであると判
定され、パケットアドレス管理テーブル400には登録
されない。
In a normal state in which data updating is not interrupted, data is written and updated as a packet in the packet section 72 of the block A. For example, if the data updating is interrupted for some reason, It operates as follows. If the update of data is interrupted, the system is restarted, and steps S10 to S2
4, a packet address management table 400 and an ID index conversion table 420 are generated. At this time, since the update source packet is stored at the start address side of the packet unit 72 rather than the update destination packet,
The storage location of the update source packet is specified first, but the update source packet has been
Since the state information is in the third state, step S1
Through 6 to S20, it is determined that the packet is a valid packet,
It is registered in the packet address management table 400. On the other hand, since the update of the data has been interrupted, the status information is in the first state, so that the packet is determined as an invalid packet through step S16, and the packet address management is performed. It is not registered in the table 400.

【0087】その後、要求元処理からデータ読込要求を
受けると、ここではまだブロックAがデータ書込用領域
となっているので、ブロックAに対してデータの読込が
開始される。このとき、データ読込要求と併せて、要求
元処理からは上記同一のID情報が与えられたとする。
すると、ステップS50〜S56を経て、与えられたI
D情報に基づいて、更新元パケットのデータ部82のデ
ータがパケットアドレス管理テーブル400から取得さ
れる。そして、取得されたデータが要求元処理に引き渡
されることにより、データの読込が完了する。
After that, when a data read request is received from the request source processing, data reading to block A is started because block A is still a data write area here. At this time, it is assumed that the same ID information is given from the request source process together with the data read request.
Then, through the steps S50 to S56, the given I
Based on the D information, the data of the data portion 82 of the update source packet is obtained from the packet address management table 400. Then, the obtained data is transferred to the request source process, whereby the data reading is completed.

【0088】なお、データの更新が中断されず、正常に
データの更新が完了した場合は、データ読込要求を受け
ると、ステップS50〜S56を経て、与えられたID
情報に基づいて、更新先パケットのデータ部82のデー
タがパケットアドレス管理テーブル400から取得され
る。そして、取得されたデータが要求元処理に引き渡さ
れることにより、データの読込が完了する。
When the data update is not interrupted and the data update is completed normally, when the data read request is received, the given ID is passed through steps S50 to S56.
Based on the information, the data of the data portion 82 of the update destination packet is obtained from the packet address management table 400. Then, the obtained data is transferred to the request source process, whereby the data reading is completed.

【0089】また、以上では、ブロックAに対してデー
タの更新を行う場合を説明したが、ブロックBに対して
データの更新を行う場合も、上記同様の要領で動作す
る。次に、ブロックA,Bを更新する場合を図18を参
照しながら説明する。図18は、ブロックAをブロック
Bに更新する場合を説明するための図である。ブロック
Aをデータ書込用領域として、ブロックAに対してデー
タの書込・更新を続けていくと、ブロックAのパケット
部72は、図18に示すように、有効なパケットと無効
なパケットが混在する状態となる。図18の例では、I
Dが「01」である有効なパケットとIDが「03」で
ある有効なパケットとの間には、データの更新により無
効となった2つのパケットが存在する。このようにブロ
ックAのパケット部72に無効なパケットが多数存在す
ると、データの新規書込・更新を行うことができなくな
る。
In the above, the case where data is updated for the block A has been described. However, the case where data is updated for the block B operates in the same manner as described above. Next, a case where the blocks A and B are updated will be described with reference to FIG. FIG. 18 is a diagram for explaining a case where block A is updated to block B. When data writing / updating is continuously performed on the block A using the block A as a data write area, as shown in FIG. It becomes a mixed state. In the example of FIG.
Between a valid packet whose D is “01” and a valid packet whose ID is “03”, there are two packets that have been invalidated due to data update. When a large number of invalid packets exist in the packet section 72 of the block A, new writing / updating of data cannot be performed.

【0090】そこで、要求元処理からデータ新規書込要
求またはデータ更新要求を受けたときに、記憶・更新し
ようとするデータを格納するためのパケットを生成する
領域がブロックAのパケット部72に不足していると、
ステップS128,S132において、ブロック更新要
求が出力される。ブロック更新要求を受けると、ブロッ
クAからブロックBへの更新が開始される。なお、ブロ
ックBは、すでに初期化されているものとし、すなわ
ち、ブロックBの領域管理部70には、領域状態情報1
(初期化完了)が書き込まれている。
Therefore, when a new data write request or a data update request is received from the request source processing, there is not enough space in the packet section 72 of the block A to generate a packet for storing data to be stored / updated. When you do
In steps S128 and S132, a block update request is output. Upon receiving the block update request, the update from block A to block B is started. It is assumed that the block B has already been initialized, that is, the area management unit 70 of the block B stores the area state information 1
(Initialization completed) is written.

【0091】ブロックAからブロックBへのブロックの
更新は、次のように行われる。CPU50により、ステ
ップS300〜S304を経て、処理定義テーブルが参
照されてブロックA,Bに対する処理が実行され、ブロ
ックAが有効であるか否かが判定される。このとき、ブ
ロックAが有効であるので、ステップS306におい
て、ブロックAの領域管理部70に領域状態情報4(デ
ータ移動中)が書き込まれる。
Updating of a block from block A to block B is performed as follows. Through steps S300 to S304, the CPU 50 refers to the processing definition table to execute processing for blocks A and B, and determines whether block A is valid. At this time, since the block A is valid, the area state information 4 (data is being moved) is written to the area management unit 70 of the block A in step S306.

【0092】次いで、ブロックAの領域管理部70に領
域状態情報4が、ブロックBの領域管理部70に領域状
態情報1が書き込まれると、ステップS300,S40
0,S402,S424〜S430を経て、処理定義テ
ーブルが参照されて、ブロックBの領域管理部70に領
域状態情報2(データ書込中)が書き込まれ、図18に
示すように、ブロックAの有効なパケットのデータが、
その格納位置が整順されるように、ブロックBのパケッ
ト部72に書き込まれ、ブロックBの領域管理部70に
領域状態情報3(データ書込完了)が書き込まれるとと
もにブロックAの領域管理部70に領域状態情報5(デ
ータ移動完了)が書き込まれる。このようにブロックの
更新が完了すると、ブロックAは、データ更新用領域と
なり、ブロックAに代わって今度はブロックBがデータ
書込用領域となる。
Next, when the area state information 4 is written in the area management section 70 of the block A and the area state information 1 is written in the area management section 70 of the block B, steps S300 and S40 are performed.
Through steps 0, S402, and S424 to S430, the processing definition table is referred to, the area state information 2 (data is being written) is written in the area management unit 70 of the block B, and as shown in FIG. Valid packet data is
The data is written in the packet section 72 of the block B so that the storage positions are arranged in order, the area state information 3 (data writing completed) is written in the area management section 70 of the block B, and the area management section 70 of the block A is written. Is written in the area status information 5 (data transfer completed). When the block update is completed in this way, block A becomes a data update area, and block B becomes a data write area instead of block A.

【0093】そして、ブロックAの領域管理部70に領
域状態情報5が、ブロックBの領域管理部70に領域状
態情報3が書き込まれると、ステップS300,S40
0,S402〜S408を経て、処理定義テーブルが参
照されて、ブロックAが初期化され、ブロックAの初期
化回数が「1」加算されてブロックAの領域管理部70
にその初期化回数情報が書き込まれ、ブロックAの領域
管理部70に領域状態情報1が書き込まれる。
When the area state information 5 is written in the area management section 70 of the block A and the area state information 3 is written in the area management section 70 of the block B, steps S300 and S40 are performed.
0, through steps S402 to S408, the processing definition table is referred to, the block A is initialized, the number of initializations of the block A is incremented by “1”, and the area management unit 70 of the block A is added.
The initialization number information is written in the area management unit 70, and the area state information 1 is written in the area management unit 70 of the block A.

【0094】ブロックの更新が中断されない通常の状態
では、このようにブロックAの有効なパケットのデータ
がブロックBのパケット部72に書き込まれるのである
が、例えば、何らかの原因によりブロックの更新が中断
された場合は、次のように動作する。まず、データの更
新のうちブロックBにデータを書き込んでいる最中に中
断された場合は、システムを再起動すると、ブロックA
の領域管理部70に領域状態情報4が、ブロックBの領
域管理部70に領域状態情報2が書き込まれているの
で、ステップS300,S400,S402,S410
〜S414を経て、処理定義テーブルが参照されて、ブ
ロックBが初期化され、ブロックBの初期化回数が
「1」加算されてブロックBの領域管理部70にその初
期化回数情報が書き込まれ、ブロックBの領域管理部7
0に領域状態情報1が書き込まれる。
In a normal state where the updating of the block is not interrupted, the data of the valid packet of the block A is written in the packet section 72 of the block B as described above. For example, the updating of the block is interrupted for some reason. In this case, the following operation is performed. First, if the update of data is interrupted while data is being written to block B, when the system is restarted, block A
Since the area status information 4 has been written in the area management unit 70 of the block B and the area status information 2 has been written in the area management unit 70 of the block B, steps S300, S400, S402, and S410 are performed.
Through S414, the process definition table is referred to, the block B is initialized, the number of initializations of the block B is incremented by "1", and the information on the number of initializations is written to the area management unit 70 of the block B, Block B area management unit 7
0 is written to the area state information 1.

【0095】そして、ブロックAの領域管理部70に領
域状態情報4が、ブロックBの領域管理部70に領域状
態情報1が書き込まれると、ステップS300,S40
0,S402,S424〜S430を経て、処理定義テ
ーブルが参照されて、ブロックBの領域管理部70に領
域状態情報2が書き込まれ、図18に示すように、ブロ
ックAの有効なパケットのデータが、その格納位置が整
順されるように、ブロックBのパケット部72に書き込
み直され、ブロックBの領域管理部70に領域状態情報
3が書き込まれるとともにブロックAの領域管理部70
に領域状態情報5が書き込まれる。その後は、ブロック
Aが初期化され、ブロックAの領域管理部70に領域状
態情報1が書き込まれる。
When the area state information 4 is written in the area management unit 70 of the block A and the area state information 1 is written in the area management unit 70 of the block B, steps S300 and S40 are performed.
0, S402, and S424 to S430, the processing definition table is referred to, the area state information 2 is written in the area management unit 70 of the block B, and as shown in FIG. Is rewritten into the packet section 72 of the block B so that the storage positions are arranged in order, the area state information 3 is written in the area management section 70 of the block B, and the area management section 70 of the block A is written.
Area status information 5 is written to the. Thereafter, the block A is initialized, and the area state information 1 is written in the area management unit 70 of the block A.

【0096】次に、データの更新のうちブロックAを初
期化している最中に中断された場合は、システムを再起
動すると、ブロックAの領域管理部70に領域状態情報
5が、ブロックBの領域管理部70に領域状態情報3が
書き込まれているので、ステップS300,S400,
S402〜S408を経て、処理定義テーブルが参照さ
れて、ブロックAが初期化し直され、ブロックAの初期
化回数が「1」加算されてブロックAの領域管理部70
にその初期化回数情報が書き込まれ、ブロックAの領域
管理部70に領域状態情報1が書き込まれる。
Next, if the update of the data is interrupted while the block A is being initialized, the system is restarted and the area status information 5 of the block A is stored in the area management unit 70 of the block A. Since the area state information 3 has been written in the area management unit 70, steps S300, S400,
After S402 to S408, the processing definition table is referred to, the block A is reinitialized, the number of initializations of the block A is incremented by “1”, and the area management unit 70 of the block A is added.
The initialization number information is written in the area management unit 70, and the area state information 1 is written in the area management unit 70 of the block A.

【0097】なお、以上では、ブロックAからブロック
Bへの更新を行う場合を説明したが、ブロックBからブ
ロックAへの更新を行う場合も、上記同様の要領で動作
する。このようにして、本実施の形態では、パケット部
72に格納されているパケットのうち有効なパケットに
アクセスするためのアクセス情報を登録したパケットア
ドレス管理テーブル400およびIDインデックス変換
テーブル420を起動時に生成し、生成したパケットア
ドレス管理テーブル400およびIDインデックス変換
テーブル420を参照して、パケットへのアクセスを行
うようになっている。
In the above, the case where the update from the block A to the block B is performed has been described. However, the operation when the update from the block B to the block A is performed in the same manner as described above. As described above, in the present embodiment, the packet address management table 400 and the ID index conversion table 420 in which access information for accessing a valid packet among the packets stored in the packet unit 72 are generated at the time of startup. The access to the packet is performed with reference to the generated packet address management table 400 and the ID index conversion table 420.

【0098】これにより、パケットへのアクセスを行う
ごとに、パケットが有効か無効かの判定を行う必要がな
くなる。したがって、従来に比して、パケットへのアク
セスを比較的高速化することができる。さらに、本実施
の形態では、パケットアドレス管理テーブル400は、
有効なパケットを含んでいる。
Thus, it is not necessary to determine whether the packet is valid or invalid each time the packet is accessed. Therefore, access to the packet can be made relatively faster than in the past. Further, in the present embodiment, the packet address management table 400
Contains a valid packet.

【0099】これにより、パケットからのデータ読込が
フラッシュROM52を介さずに行われるので、パケッ
トからのデータ読込を比較的高速化することができる。
さらに、本実施の形態では、パケットアドレス管理テー
ブル400およびIDインデックス変換テーブル420
をRAM54上に記憶した。これにより、RAM54へ
の電力供給が遮断されると、これに伴ってパケットアド
レス管理テーブル400およびIDインデックス変換テ
ーブル420が消滅するので、フラッシュROM52に
記憶する構成に比して、パケットアドレス管理テーブル
400およびIDインデックス変換テーブル420を初
期化する処理を行わなくてもすむ。
Thus, the data reading from the packet is performed without passing through the flash ROM 52, so that the speed of reading the data from the packet can be relatively increased.
Further, in the present embodiment, the packet address management table 400 and the ID index conversion table 420
Was stored on the RAM 54. As a result, when the power supply to the RAM 54 is cut off, the packet address management table 400 and the ID index conversion table 420 disappear along with this, so that the packet address management table 400 Further, it is not necessary to perform the process of initializing the ID index conversion table 420.

【0100】さらに、本実施の形態では、データを記憶
するときは、データを格納するためのパケットをブロッ
クのパケット部72に生成し、データ書込開始時にパケ
ットの状態情報を第1の状態に設定し、パケットのデー
タ部82にデータを書き込み、データ書込完了時にパケ
ットの状態情報を第2の状態に設定し、状態情報が第2
の状態であるパケットを有効なパケットであると判定
し、状態情報が第1の状態または第4の状態であるパケ
ットを無効なパケットであると判定するようにした。
Further, in the present embodiment, when storing data, a packet for storing data is generated in the packet portion 72 of the block, and the state information of the packet is set to the first state at the start of data writing. Is set, data is written to the data portion 82 of the packet, and when the data writing is completed, the status information of the packet is set to the second state.
Is determined to be a valid packet, and a packet whose status information is the first state or the fourth state is determined to be an invalid packet.

【0101】これにより、データの書込が完了するまで
は、有効なパケットとして識別されないので、データの
書込が完了するまでの間に何らかの原因によりデータの
書込が中断されても、データ書込途中のパケットのデー
タが正しいデータとして取り扱われることはない。ま
た、フラッシュROM52上でのデータの消去は、消去
対象となるデータが格納されているパケットの状態情報
を第4の状態に設定することにより行えばよいので、フ
ラッシュROM52の初期化回数が少なくなる。したが
って、従来に比して、フラッシュROM52の寿命の低
下を防止するとともにデータの書換を高速に行うことが
でき、しかもデータの書込を高い信頼性をもって行うこ
とができる。
As a result, the data is not identified as a valid packet until the data writing is completed. Therefore, even if the data writing is interrupted for some reason until the data writing is completed, the data writing is not performed. The data of the packet being loaded is not treated as correct data. In addition, since the erasure of data on the flash ROM 52 may be performed by setting the state information of the packet storing the data to be erased to the fourth state, the number of times of initialization of the flash ROM 52 is reduced. . Therefore, as compared with the related art, it is possible to prevent the life of the flash ROM 52 from being shortened and to rewrite data at high speed, and to write data with high reliability.

【0102】さらに、本実施の形態では、パケットのデ
ータを更新するときは、更新後のデータを格納するため
の更新先パケットをブロックのパケット部72に生成
し、データ書込開始時に更新元パケットの状態情報を第
3の状態に設定するとともに更新先パケットの状態情報
を第1の状態に設定し、更新先パケットのデータ部82
に更新後のデータを書き込み、データ書込完了時に更新
先パケットの状態情報を第2の状態に設定するとともに
更新元パケットの状態情報を第4の状態に設定し、状態
情報が第2の状態または第3の状態であるパケットを有
効なパケットであると判定し、状態情報が第1の状態ま
たは第4の状態であるパケットを無効なパケットである
と判定するようにした。
Furthermore, in the present embodiment, when updating the data of a packet, an update destination packet for storing the updated data is generated in the packet portion 72 of the block, and the update source packet is started when data writing is started. Is set to the third state and the state information of the update destination packet is set to the first state, and the data portion 82 of the update destination packet is set.
The updated data is written to the second packet, and when the data writing is completed, the status information of the update destination packet is set to the second status, and the status information of the update source packet is set to the fourth status. Alternatively, a packet in the third state is determined to be a valid packet, and a packet in the state information of the first state or the fourth state is determined to be an invalid packet.

【0103】これにより、データの更新が完了するまで
は、更新先パケットは、有効なパケットとして識別され
ないので、データの更新が完了するまでの間に何らかの
原因によりデータの更新が中断されても、データ書込途
中の更新先パケットのデータが正しいデータとして取り
扱われることはない。この場合は、更新元パケットのデ
ータが正しいデータとして取り扱われる。したがって、
従来に比して、データの更新を高い信頼性をもって行う
ことができる。
As a result, since the update destination packet is not identified as a valid packet until the data update is completed, even if the data update is interrupted for some reason until the data update is completed, The data of the update destination packet during data writing is not handled as correct data. In this case, the data of the update source packet is handled as correct data. Therefore,
Data can be updated with higher reliability than before.

【0104】さらに、本実施の形態では、データ長情報
に基づいて、パケットの格納位置を特定するようにし
た。これにより、パケット部72の記憶容量を超えない
任意のデータ長のデータを区分することなく一つのパケ
ットとしてブロックのパケット部72に記憶することが
できるので、可変長のデータの管理が容易になる。
Further, in the present embodiment, the storage position of the packet is specified based on the data length information. Thereby, data of an arbitrary data length that does not exceed the storage capacity of the packet section 72 can be stored as one packet in the packet section 72 of the block without being divided, so that variable-length data can be easily managed. .

【0105】さらに、本実施の形態では、ブロックを更
新するときは、データ書込開始時にブロックA,Bのう
ち一方のブロックの領域管理部70に領域状態情報4を
書き込むとともに他方のブロックの領域管理部70に領
域状態情報2を書き込み、一方のブロックのパケット部
72の有効なパケットのデータを他方のブロックのパケ
ット部72に書き込み、データ書込完了時に一方のブロ
ックの領域管理部70に領域状態情報5を書き込むとと
もに他方のブロックの領域管理部70に領域状態情報3
を書き込み、領域管理部70に領域状態情報3,4が書
き込まれているブロックを有効なブロックであると判定
し、領域管理部70に領域状態情報1,2,5が書き込
まれているブロックを無効なブロックであると判定する
ようにした。
Further, in this embodiment, when updating a block, the area status information 4 is written into the area management unit 70 of one of the blocks A and B at the start of data writing, and the area of the other block is written. The area status information 2 is written to the management unit 70, the valid packet data of the packet unit 72 of one block is written to the packet unit 72 of the other block, and the data is written to the area management unit 70 of one block when the data writing is completed. The state information 5 is written and the area state information 3 is stored in the area management unit 70 of the other block.
Is written, and the block in which the area status information 3, 4 is written in the area management unit 70 is determined to be a valid block, and the block in which the area status information 1, 2, 5 is written in the area management unit 70 is determined. It is determined that the block is invalid.

【0106】これにより、ブロックの更新が完了するま
では、更新先となる他方のブロックは、有効なブロック
として識別されないので、ブロックの更新が完了するま
での間に何らかの原因によりブロックの更新が中断され
ても、データ書込途中の他方のブロックのデータが正し
いデータとして取り扱われることはない。この場合は、
更新前の一方のブロックのデータが正しいデータとして
取り扱われる。したがって、データの更新をさらに高い
信頼性をもって行うことができる。
As a result, until the block update is completed, the other block to be updated is not identified as a valid block. Therefore, the block update is interrupted for some reason until the block update is completed. Even if the data is written, the data in the other block in the middle of data writing is not treated as correct data. in this case,
The data of one block before the update is handled as correct data. Therefore, data can be updated with higher reliability.

【0107】さらに、本実施の形態では、領域管理部7
0に領域状態情報1,2,5が書き込まれているブロッ
クをデータ更新用領域として用いるようにした。これに
より、ブロックを更新するたびに新たなブロックがデー
タ更新用領域となることがないので、フラッシュROM
52の記憶領域を有効に利用することができる。
Further, in this embodiment, the area management unit 7
A block in which the area status information 1, 2, 5 is written to 0 is used as a data update area. Thus, a new block does not become a data update area every time a block is updated.
52 storage areas can be used effectively.

【0108】さらに、本実施の形態では、ブロックA,
Bの領域状態情報の状態に応じてブロックA,Bに対す
る処理を割り当てた処理定義テーブルを参照して、ブロ
ックA,Bに対する処理を実行するようにした。これに
より、ブロックA,Bの領域状態情報の状態に応じて、
ブロックA,Bに対する処理を逐次判定する必要がなく
なるので、データの書換に関する処理を簡素化すること
ができる。
Further, in the present embodiment, blocks A,
The processing for the blocks A and B is executed by referring to the processing definition table to which the processing for the blocks A and B is assigned according to the state of the area state information of B. Thereby, according to the state of the area state information of blocks A and B,
Since there is no need to sequentially determine the processing for the blocks A and B, the processing related to data rewriting can be simplified.

【0109】さらに、本実施の形態では、ブロックは、
フラッシュROM52のデータ初期化単位からなる。こ
れにより、フラッシュROM52の初期化回数を最小限
に抑えることができる。さらに、本実施の形態では、一
方のブロックの領域管理部70に領域管理情報4が書き
込まれ、かつ、他方のブロックの領域管理部70に領域
管理情報2が書き込まれているときは、他方のブロック
を初期化するようにした。
Further, in the present embodiment, the block is
The flash ROM 52 is composed of data initialization units. Thereby, the number of times of initialization of the flash ROM 52 can be minimized. Furthermore, in this embodiment, when the area management information 4 is written in the area management unit 70 of one block and the area management information 2 is written in the area management unit 70 of the other block, Blocks are now initialized.

【0110】これにより、何らかの原因により他方のブ
ロックのパケット部72にデータを書き込んでいる最中
に中断された場合は、システムを再起動すると、他方の
ブロックが初期化され、他方のブロックのパケット部7
2にデータが書き込み直されるので、データの更新をさ
らに高い信頼性をもって行うことができる。さらに、本
実施の形態では、一方のブロックの領域管理部70に領
域管理情報5が書き込まれ、かつ、他方のブロックの領
域管理部70に領域管理情報1,2,3が書き込まれて
いるときは、一方のブロックを初期化するようにした。
Thus, if data is interrupted while writing data to the packet section 72 of the other block for some reason, when the system is restarted, the other block is initialized and the packet of the other block is initialized. Part 7
2, the data is rewritten, so that the data can be updated with higher reliability. Furthermore, in the present embodiment, when the area management information 5 is written in the area management unit 70 of one block and the area management information 1, 2, 3 is written in the area management unit 70 of the other block. Tried to initialize one block.

【0111】これにより、何らかの原因によりデータの
更新のうち一方のブロックを初期化している最中に中断
された場合は、システムを再起動すると、一方のブロッ
クが初期化し直されるので、データの更新をさらに高い
信頼性をもって行うことができる。上記実施の形態にお
いて、フラッシュROM52は、請求項1ないし5記載
のフラッシュメモリに対応し、パケットアドレス管理テ
ーブル400およびIDインデックス変換テーブル42
0は、請求項1、2または5記載のアクセス情報管理テ
ーブルに対応し、ID情報は、請求項3記載のパケット
識別情報に対応している。また、RAM54は、請求項
5記載の記憶媒体に対応している。
Thus, if the data update is interrupted during initialization of one block for some reason, when the system is restarted, one block is re-initialized. Can be performed with higher reliability. In the above embodiment, the flash ROM 52 corresponds to the flash memory according to any one of claims 1 to 5, and includes a packet address management table 400 and an ID index conversion table 42.
0 corresponds to the access information management table described in claim 1, 2 or 5, and the ID information corresponds to the packet identification information described in claim 3. The RAM 54 corresponds to the storage medium described in claim 5.

【0112】なお、上記実施の形態においては、ブロッ
クを、フラッシュROM52のデータ初期化単位から構
成したが、これに限らず、データ初期化単位を2以上組
み合わせて構成してもよい。このような構成であって
も、フラッシュROM52の初期化回数を最小限に抑え
ることができる。また、上記実施の形態においては、ス
テップS116からステップS118に移行する間にデ
ータの更新が中断された場合について特に説明しなかっ
たが、こうした場合に対応するため、状態情報が第2,
3の状態であるパケットおよび状態情報が第1の状態で
あるパケットが併存するときは、状態情報が第2,3の
状態であるパケットを有効なパケットであると判定する
ように構成してもよい。
In the above embodiment, the block is constituted by the data initialization unit of the flash ROM 52. However, the present invention is not limited to this. The block may be constituted by combining two or more data initialization units. Even with such a configuration, the number of times of initialization of the flash ROM 52 can be minimized. Further, in the above-described embodiment, the case where the data update is interrupted during the transition from step S116 to step S118 is not particularly described.
When a packet having the third state and a packet having the first state information coexist, the packet having the second or third state information may be determined to be a valid packet. Good.

【0113】また、上記実施の形態においては、ステッ
プS124からステップS126に移行する間にデータ
の更新が中断された場合について特に説明しなかった
が、こうした場合に対応するため、状態情報が第3の状
態であるパケットおよび状態情報が第2の状態であるパ
ケットが併存するときは、状態情報が第2の状態である
パケットを有効なパケットであると判定するように構成
してもよい。
Further, in the above embodiment, the case where the update of data is interrupted during the transition from step S124 to step S126 is not specifically described. When a packet having the status information of the second state and a packet having the status information of the second state coexist, the packet having the status information of the second state may be determined to be a valid packet.

【0114】また、上記実施の形態においては、ステッ
プS306からステップS424に移行する間、または
ステップS308からステップS416に移行する間に
ブロックの更新が中断された場合について特に説明しな
かったが、こうした場合に対応するため、領域管理部7
0に領域状態情報4が書き込まれているブロックおよび
領域管理部70に領域状態情報1が書き込まれているブ
ロックが併存するときは、領域管理部70に領域状態情
報4が書き込まれているブロックを有効なブロックであ
ると判定するように構成してもよい。
Further, in the above embodiment, the case where the update of the block is interrupted during the transition from step S306 to step S424 or the transition from step S308 to step S416 is not particularly described. To cope with the case, the area management unit 7
When a block in which the area state information 4 is written in the area 0 and a block in which the area state information 1 is written in the area management unit 70 coexist, the block in which the area state information 4 is written in the area management unit 70 is determined. You may comprise so that it may be determined that it is a valid block.

【0115】また、上記実施の形態においては、ステッ
プS428からステップS430に移行する間、または
ステップS420からステップS422に移行する間に
ブロックの更新が中断された場合について特に説明しな
かったが、こうした場合に対応するため、領域管理部7
0に領域状態情報3が書き込まれているブロックおよび
領域管理部70に領域状態情報4が書き込まれているブ
ロックが併存するときは、領域管理部70に領域状態情
報3が書き込まれているブロックを有効なブロックであ
ると判定するように構成してもよい。
Further, in the above embodiment, the case where the update of the block is interrupted during the transition from step S428 to step S430 or the transition from step S420 to step S422 is not particularly described. To cope with the case, the area management unit 7
When a block in which the area state information 3 is written in the area 0 and a block in which the area state information 4 is written in the area management unit 70 coexist, the block in which the area state information 3 is written in the area management unit 70 is determined. You may comprise so that it may be determined that it is a valid block.

【0116】また、上記実施の形態においては、データ
書込用領域としてのブロックおよびデータ更新用領域と
してのブロックをそれぞれ1つずつ用いて構成したが、
これに限らず、データ更新用領域としてのブロックを1
つ、データ書込用領域としてのブロックを複数用いて構
成してもよい。この場合は、ブロックの更新を同時に複
数行わないことが条件となる。ブロックの更新を同時に
複数行う場合は、データ更新用領域としてのブロック
を、記憶領域の更新を同時に行う数だけ用意すればよ
い。
In the above-described embodiment, each block is used as a data write area and one block as a data update area.
However, the present invention is not limited to this.
Alternatively, a plurality of blocks as a data write area may be used. In this case, the condition is that a plurality of blocks are not updated at the same time. When a plurality of blocks are updated at the same time, blocks as data update areas may be prepared in a number equal to the number at which the storage area is updated at the same time.

【0117】また、上記実施の形態においては、同一の
ID情報を有するパケットについて状態情報が第2の状
態であるパケットと状態情報が第3の状態であるパケッ
トが併存する場合があることを説明したが、厳密には、
同一のID情報を有するパケットがさらに複数存在する
場合もある。例えば、更新先パケットの状態情報を書き
換えた後であって更新元パケットの状態情報を書き換え
る前に、データの更新が中断されると、状態情報が第2
の状態であるパケットが有効であると判定されるが、状
態情報が第3の状態であるパケットはそのまま存続す
る。したがって、この状態が何度か続けば、状態情報が
第3の状態であるパケットが複数存在することになる。
これに対して、状態情報が第2の状態であるパケット
は、存在する場合は常に一つである。
Further, in the above-described embodiment, it is explained that, for packets having the same ID information, a packet having status information in the second state and a packet having status information in the third state may coexist. But strictly speaking,
There may be more than one packet having the same ID information. For example, if the data update is interrupted after rewriting the status information of the update destination packet and before rewriting the status information of the update source packet, the status information becomes the second status.
Is determined to be valid, but the packet whose status information is in the third status remains as it is. Therefore, if this state continues several times, there will be a plurality of packets whose state information is the third state.
On the other hand, the number of packets whose status information is in the second state is always one when present.

【0118】また、上記実施の形態において、図9、図
12ないし図17のフローチャートに示す動作処理を実
行するにあたっては、フラッシュROM52にあらかじ
め格納されているプログラムを実行する場合について説
明したが、これに限らず、これらの手順を示したプログ
ラムが記録された記録媒体から、そのプログラムをRA
M54に読み込んで実行するようにしてもよい。
Further, in the above embodiment, when executing the operation processing shown in the flowcharts of FIGS. 9 and 12 to 17, the case where a program stored in advance in the flash ROM 52 is executed has been described. The program is not limited to a program stored in a storage medium on which a program indicating these procedures is recorded.
The program may be read into M54 and executed.

【0119】ここで、記憶媒体とは、RAM、ROM等
の半導体記憶媒体、FD、HD等の磁気記憶型記憶媒
体、CD、CDV、LD、DVD等の光学的読取方式記
憶媒体、MO等の磁気記憶型/光学的読取方式記憶媒体
であって、電子的、磁気的、光学的等の読み取り方法の
いかんにかかわらず、コンピュータで読み取り可能な記
憶媒体であれば、あらゆる記憶媒体を含むものである。
Here, the storage medium is a semiconductor storage medium such as a RAM or a ROM, a magnetic storage type storage medium such as an FD or HD, an optical reading type storage medium such as a CD, CDV, LD, or DVD, or an MO storage medium. A magnetic storage type / optical readout type storage medium includes any storage medium that can be read by a computer irrespective of an electronic, magnetic, optical or other reading method.

【0120】また、上記実施の形態においては、本発明
に係るフラッシュメモリのデータ管理装置を、図1に示
すように、フラッシュROM52のデータ初期化単位か
らなるブロックに、コンピュータ100の設定に必要な
データを可変長のパケット単位で記憶する場合について
適用したが、これに限らず、本発明の主旨を逸脱しない
範囲で他の場合についても適用可能である。
Further, in the above embodiment, the flash memory data management device according to the present invention is used as a block of the flash ROM 52 composed of data initialization units as shown in FIG. Although the present invention has been applied to the case where data is stored in units of variable-length packets, the present invention is not limited to this, and can be applied to other cases without departing from the gist of the present invention.

【0121】[0121]

【発明の効果】以上説明したように、本発明に係る請求
項1記載のフラッシュメモリのデータ管理装置によれ
ば、データの更新が完了するまでは、更新先パケット
は、有効なパケットとして識別されないので、データの
更新が完了するまでの間に何らかの原因によりデータの
更新が中断されても、データ書込途中の更新先パケット
のデータが正しいデータとして取り扱われることはな
い。また、パケットへのアクセスを行うごとに、パケッ
トが有効か無効かの判定を行う必要がなくなる。したが
って、従来に比して、フラッシュメモリの寿命の低下を
防止するとともにデータの更新を高速に行うことがで
き、しかもデータの更新を高い信頼性をもって行うこと
ができるのに加えて、パケットへのアクセスを比較的高
速化することができるという効果が得られる。
As described above, according to the data management apparatus for a flash memory according to the first aspect of the present invention, the update destination packet is not identified as a valid packet until the data update is completed. Therefore, even if the data update is interrupted for some reason until the data update is completed, the data of the update destination packet during the data writing is not treated as correct data. Further, it is not necessary to determine whether the packet is valid or invalid each time the packet is accessed. Therefore, as compared with the related art, it is possible to prevent a decrease in the life of the flash memory and to update data at a high speed, and to update data with high reliability. The advantage is that access can be relatively speeded up.

【0122】さらに、本発明に係る請求項4記載のフラ
ッシュメモリのデータ管理装置によれば、パケットから
のデータ読込がフラッシュメモリを介さずに行われるの
で、パケットからのデータ読込を比較的高速化すること
ができるという効果も得られる。さらに、本発明に係る
請求項5記載のフラッシュメモリのデータ管理装置によ
れば、記憶媒体への電力供給が遮断されると、これに伴
ってアクセス情報管理テーブルが消滅するので、フラッ
シュメモリに記憶する構成に比して、アクセス情報管理
テーブルの内容を更新する必要がある場合に、アクセス
情報管理テーブルを初期化する処理を行わなくてもすむ
という効果も得られる。
Further, according to the flash memory data management device of the present invention, since the data reading from the packet is performed without passing through the flash memory, the data reading from the packet is relatively speeded up. The effect that can be performed is also obtained. Furthermore, according to the data management device for a flash memory according to the present invention, when the power supply to the storage medium is cut off, the access information management table disappears with the power supply, and the data is stored in the flash memory. As compared with the configuration in which the access information management table is updated, an effect that the processing for initializing the access information management table does not have to be performed when the content of the access information management table needs to be updated is obtained.

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

【図1】コンピュータ100の構成を示すブロック図で
ある。
FIG. 1 is a block diagram showing a configuration of a computer 100.

【図2】ブロックA,Bのデータ構造を示す図である。FIG. 2 is a diagram showing a data structure of blocks A and B.

【図3】領域管理部70のデータ構造を示す図である。FIG. 3 is a diagram showing a data structure of an area management unit 70.

【図4】領域状態情報の内容を示す図である。FIG. 4 is a diagram showing contents of area state information.

【図5】パケット部72のデータ構造を示す図である。FIG. 5 is a diagram showing a data structure of a packet unit 72.

【図6】管理部80のデータ構造を示す図である。FIG. 6 is a diagram showing a data structure of a management unit 80.

【図7】状態情報の内容を示す図である。FIG. 7 is a diagram showing the contents of state information.

【図8】処理定義テーブルのデータ構造を示す図であ
る。
FIG. 8 is a diagram showing a data structure of a process definition table.

【図9】テーブル生成処理を示すフローチャートであ
る。
FIG. 9 is a flowchart illustrating a table generation process.

【図10】パケットアドレス管理テーブル400のデー
タ構造を示す図である。
FIG. 10 is a diagram showing a data structure of a packet address management table 400.

【図11】IDインデックス変換テーブルのデータ構造
を示す図である。
FIG. 11 is a diagram showing a data structure of an ID index conversion table.

【図12】パケットアクセス処理を示すフローチャート
である。
FIG. 12 is a flowchart illustrating a packet access process.

【図13】データ新規書込処理を示すフローチャートで
ある。
FIG. 13 is a flowchart showing a data new writing process.

【図14】データ更新処理を示すフローチャートであ
る。
FIG. 14 is a flowchart illustrating a data update process.

【図15】ブロック更新処理を示すフローチャートであ
る。
FIG. 15 is a flowchart showing a block update process.

【図16】処理定義テーブルに基づく処理を示すフロー
チャートである。
FIG. 16 is a flowchart illustrating a process based on a process definition table.

【図17】処理定義テーブルに基づく処理を示すフロー
チャートである。
FIG. 17 is a flowchart illustrating a process based on a process definition table.

【図18】ブロックAをブロックBに更新する場合を説
明するための図である。
FIG. 18 is a diagram for describing a case where a block A is updated to a block B.

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

100 コンピュータ 50 CPU 52 ROM 54 RAM 55 VRAM 56 グラフィックチップ 57 RTC 58 I/F 59 バス 60 タッチパネル 70 領域管理部 72 パケット部 80 管理部 82 データ部 P1〜Pn パケット 400 パケットアドレス管理テー
ブル 420 IDインデックス変換テー
ブル
100 Computer 50 CPU 52 ROM 54 RAM 55 VRAM 56 graphic chip 57 RTC 58 I / F 59 bus 60 touch panel 70 area management unit 72 the packet 80 management unit 82 data portion P 1 to P n packets 400 packet address management table 420 ID Index Conversion table

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 フラッシュメモリの記憶領域にパケット
単位でデータを記憶するようになっており、 前記パケットは、当該パケットの管理に関する管理デー
タを格納するための管理部と、データを格納するための
データ部とからなり、 前記管理部には、前記管理データとして、前記パケット
の状態を示す状態情報が格納可能となっており、 前記パケットのデータを更新するときは、更新後のデー
タを格納するための更新先パケットを前記記憶領域に生
成し、データ書込開始時に、前記更新先パケットの状態
情報を第1の状態に且つ更新前のデータを格納している
更新元パケットの状態情報を第3の状態に設定し、前記
更新先パケットのデータ部に前記更新後のデータを書き
込み、データ書込完了時に、前記更新先パケットの状態
情報を第2の状態に且つ前記更新元パケットの状態情報
を第4の状態に設定し、 前記状態情報が前記第2の状態又は前記第3の状態であ
るパケットを有効なパケットであると判定し、前記状態
情報が前記第1の状態又は前記第4の状態であるパケッ
トを無効なパケットであると判定する装置において、 前記記憶領域に格納されているパケットのうち前記有効
なパケットにアクセスするためのアクセス情報を登録し
たアクセス情報管理テーブルを参照して、前記パケット
へのアクセスを行うようになっていることを特徴とする
フラッシュメモリのデータ管理装置。
1. A storage unit for storing data in packet units in a storage area of a flash memory, wherein the packet includes a management unit for storing management data related to management of the packet, and a storage unit for storing data. The management unit stores status information indicating the status of the packet as the management data. When updating the data of the packet, the updated data is stored. An update destination packet is generated in the storage area, and at the start of data writing, the status information of the update destination packet is set to the first state and the status information of the update source packet storing the data before update is stored in the first state. 3, the updated data is written in the data portion of the update destination packet, and when the data writing is completed, the status information of the update destination packet is changed to the second. State and the state information of the update source packet to a fourth state, the state information is determined to be a packet in the second state or the third state is a valid packet, the state information In an apparatus for determining that a packet in the first state or the fourth state is an invalid packet, the access information for accessing the valid packet among the packets stored in the storage area is determined. A data management device for a flash memory, wherein the packet is accessed by referring to a registered access information management table.
【請求項2】 請求項1において、 前記アクセス情報管理テーブルを起動時に生成するよう
になっていることを特徴とするフラッシュメモリのデー
タ管理装置。
2. The flash memory data management device according to claim 1, wherein the access information management table is generated at startup.
【請求項3】 請求項1及び2のいずれかにおいて、 前記アクセス情報は、前記パケットを識別するためのパ
ケット識別情報と、前記パケットの格納位置を特定する
ためのアドレスとを含んで構成されていることを特徴と
するフラッシュメモリのデータ管理装置。
3. The access information according to claim 1, wherein the access information includes packet identification information for identifying the packet, and an address for specifying a storage position of the packet. A data management device for a flash memory.
【請求項4】 請求項3において、 前記アクセス情報は、さらに、前記有効なパケットを含
んで構成されていることを特徴とするフラッシュメモリ
のデータ管理装置。
4. The flash memory data management device according to claim 3, wherein the access information further includes the valid packet.
【請求項5】 請求項1乃至4のいずれかにおいて、 前記アクセス情報管理テーブルを、データの保持に電力
を要する記憶媒体に記憶するようになっていることを特
徴とするフラッシュメモリのデータ管理装置。
5. The data management device for a flash memory according to claim 1, wherein the access information management table is stored in a storage medium that requires power to hold the data. .
JP2001029106A 2001-02-06 2001-02-06 Data management device of flash memory Pending JP2002229847A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001029106A JP2002229847A (en) 2001-02-06 2001-02-06 Data management device of flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2001029106A JP2002229847A (en) 2001-02-06 2001-02-06 Data management device of flash memory

Publications (1)

Publication Number Publication Date
JP2002229847A true JP2002229847A (en) 2002-08-16

Family

ID=18893491

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001029106A Pending JP2002229847A (en) 2001-02-06 2001-02-06 Data management device of flash memory

Country Status (1)

Country Link
JP (1) JP2002229847A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006011186A1 (en) * 2004-07-23 2006-02-02 Spansion Llc Controller, data storage system, data rewrite method, and computer program product
JP2012243143A (en) * 2011-05-20 2012-12-10 Tokai Rika Co Ltd Flash memory device
WO2013140516A1 (en) * 2012-03-19 2013-09-26 富士通株式会社 Recording method, recording device, and recording program

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006011186A1 (en) * 2004-07-23 2006-02-02 Spansion Llc Controller, data storage system, data rewrite method, and computer program product
JPWO2006011186A1 (en) * 2004-07-23 2008-05-01 スパンション エルエルシー Controller, data storage system, data rewriting method, and computer program product
US7558904B2 (en) 2004-07-23 2009-07-07 Spansion Llc Controller, data memory system, data rewriting method, and computer program product
JP4653747B2 (en) * 2004-07-23 2011-03-16 スパンション エルエルシー Controller, data storage system, data rewriting method, and computer program product
JP2012243143A (en) * 2011-05-20 2012-12-10 Tokai Rika Co Ltd Flash memory device
WO2013140516A1 (en) * 2012-03-19 2013-09-26 富士通株式会社 Recording method, recording device, and recording program

Similar Documents

Publication Publication Date Title
KR100449708B1 (en) Flash memory management method
US5040110A (en) Write once read many optical disc storage system having directory for storing virtual address and corresponding up-to-date sector address
US6996660B1 (en) Memory device and method for storing and reading data in a write-once memory array
JPH11126488A (en) Method and device for storing and controlling data of external memory using plural flash memories
US20060112215A1 (en) Apparatus and method for processing data of flash memory
JP6013626B2 (en) Non-volatile memory writing mechanism
JP2013532853A (en) Storage apparatus and data control method
JP2010186524A (en) Information storage device, and data recording and reproducing method
US20060085623A1 (en) Data processing apparatus and method for flash memory
JP2012022490A (en) Data processor, data processing method, data processing program and storage device
JP5469066B2 (en) Method and system for exchanging data
JP2004303238A (en) Flash memory access device and method
US20070118682A1 (en) Method and apparatus for interfacing and managing NAND flash memory
KR100757128B1 (en) Memory card using flash memory and controlling method thereof
JP3793868B2 (en) Flash memory management device and recording medium
JP3858538B2 (en) Flash memory data management device
US20070016739A1 (en) Data processing device and control method for the same
US6233664B1 (en) Apparatus and method for swapping contents between main memory and auxiliary memory and web video phone adopting the apparatus
JP2002229847A (en) Data management device of flash memory
JPH113287A (en) Storage device and storage area management method used for the device
JP2009053993A (en) File system management apparatus
CN111597076B (en) Method and device for operating data and method and device for managing persistent jump table
JP2001067881A (en) Associative storage and storage medium
JP5217729B2 (en) IC card, its program, and IC card issuing method
JPH10247165A (en) Method and device for data writing in write-compensation-frequency limited memory