JP3184383B2 - Home controller - Google Patents

Home controller

Info

Publication number
JP3184383B2
JP3184383B2 JP29675993A JP29675993A JP3184383B2 JP 3184383 B2 JP3184383 B2 JP 3184383B2 JP 29675993 A JP29675993 A JP 29675993A JP 29675993 A JP29675993 A JP 29675993A JP 3184383 B2 JP3184383 B2 JP 3184383B2
Authority
JP
Japan
Prior art keywords
data
block
writing
control unit
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
JP29675993A
Other languages
Japanese (ja)
Other versions
JPH07154870A (en
Inventor
義治 林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Sharp Corp
Original Assignee
Sharp 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 Sharp Corp filed Critical Sharp Corp
Priority to JP29675993A priority Critical patent/JP3184383B2/en
Publication of JPH07154870A publication Critical patent/JPH07154870A/en
Application granted granted Critical
Publication of JP3184383B2 publication Critical patent/JP3184383B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Selective Calling Equipment (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、ホームオートメーショ
ン・システムに関し、詳しくは、不揮発性のメモリを備
えたホームコントローラに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a home automation system, and more particularly, to a home controller having a nonvolatile memory.

【0002】[0002]

【従来の技術】近年、家庭内の各種機器をネットワーク
で結び、システム化された様々なサービスを実現する、
いわゆるホームオートメーション・システムが普及して
いる。
2. Description of the Related Art In recent years, various devices in a home are connected by a network to realize various systemized services.
So-called home automation systems have become widespread.

【0003】図20は、ホームオートメーション・シス
テムの概念図であり、カメラ,アンテナ,テレビ等の映
像系端末、インターホン等の通話系端末、パーソナルコ
ンピュータ等の情報系端末、煙検知器,ガス検知器,防
犯スイッチ,電子キー等のセキュリティ端末、エアコ
ン,風呂,照明等の機器端末とホームコントローラとが
情報信号コネクタを介して、ホームバスに接続されてい
る。ホームコントローラには、電話回線等の外部からの
信号線も接続され、電話,インターホン,セキュリテ
ィ,機器制御,テレコントロール等の様々なサービス機
能を実現することができる。
FIG. 20 is a conceptual diagram of a home automation system, which includes a camera, an antenna, a video terminal such as a television, a communication terminal such as an interphone, an information terminal such as a personal computer, a smoke detector, and a gas detector. Security terminals such as security switches and electronic keys, and device terminals such as air conditioners, baths, and lights, and home controllers are connected to a home bus via information signal connectors. An external signal line such as a telephone line is also connected to the home controller, and various service functions such as telephone, intercom, security, device control, and telecontrol can be realized.

【0004】図21は、ホームオートメーション・シス
テムの心臓部に当たるホームコントローラの一般的な構
成例を示すブロック図である。ホームコントローラ50
1は、ホームバス502へのインタフェース部503,
制御部505,I/O(Input/Output)部506,メモ
リ部512を含む。I/O部506は、キー入力部,表
示部,音声入出力部等により構成されている。ホームコ
ントローラ501のメモリ部512は、ホームオートメ
ーション・システムのシステムプログラムやアプリケー
ションプログラムを内蔵するためのメモリ領域509
と、システムデータを内蔵するためのメモリ領域510
と、プログラムの実行時に作業用に使用するためのメモ
リ領域511とを含む。一般に、メモリ部512のメモ
リ領域509にはROM(Read Only Memory)が、メモ
リ領域511にはRAM(Random Access Memory)が用
いられる。また、メモリ領域510には、EEPROM
(Electrically Erasable and Programable Read Only
Memory)またはバッテリによりバックアップされたSR
AM(Static Random Access Memory )が用いられる。
FIG. 21 is a block diagram showing a general configuration example of a home controller corresponding to the heart of a home automation system. Home controller 50
1 is an interface unit 503 to the home bus 502,
It includes a control unit 505, an I / O (Input / Output) unit 506, and a memory unit 512. The I / O unit 506 includes a key input unit, a display unit, a voice input / output unit, and the like. The memory unit 512 of the home controller 501 has a memory area 509 for storing a system program and an application program of the home automation system.
And memory area 510 for storing system data
And a memory area 511 used for work when the program is executed. Generally, a ROM (Read Only Memory) is used for the memory area 509 of the memory unit 512, and a RAM (Random Access Memory) is used for the memory area 511. The memory area 510 includes an EEPROM.
(Electrically Erasable and Programmable Read Only
Memory) or battery-backed SR
AM (Static Random Access Memory) is used.

【0005】ところで、ホームオートメーション・シス
テムで実現できる機能に関しては、社会環境の変化、ユ
ーザニーズの動向、技術の進展に伴なう端末機器の充
実、通信ネットワークの整備等によって、将来において
ますます新規な技術が提案されると予想されている。一
方、ホームオートメーション・システムは、住宅設備で
あるために、一度設置すれば、その後長期間にわたって
使用されるものである。
[0005] By the way, with regard to the functions that can be realized by the home automation system, the social environment is changing, the needs of users are being increased, the terminal equipment is being enhanced with the development of technology, the communication network is being improved, etc. It is expected that new technologies will be proposed. On the other hand, a home automation system is a house facility, so once installed, it is used for a long time thereafter.

【0006】このように、ホームオートメーション・シ
ステムは、将来の機能の拡張性を備えつつ、長期間使用
できるように構成されていることが、必要である。これ
に対する提案として、従来、特開平2−265395号
公報において、システム設置後の変更や拡張を容易にす
るために、メモリカードを使って、前記図21に示した
従来例のメモリ部512のメモリ領域509,510,
511に対応するような記憶手段のいずれかまたはすべ
てを増設する機能を有したホームバス・システムが示さ
れている。
As described above, it is necessary that the home automation system be configured to be usable for a long period of time while having expandability of functions in the future. As a proposal for this, conventionally, in Japanese Patent Application Laid-Open No. 2-265395, in order to facilitate a change or expansion after system installation, a memory card of the conventional memory unit 512 shown in FIG. Regions 509, 510,
A home bus system having a function of adding any or all of storage means corresponding to 511 is shown.

【0007】[0007]

【発明が解決しようとする課題】しかし、特開平2−2
65395号公報に提案された技術においては、メモリ
カードというハードウェアを新規に追加する必要があ
る。したがって、ホームオートメーション・システムの
内容を変更したり、拡張したりすることに伴って、その
都度費用が発生する。ところで、昨今、大容量でかつビ
ット当たりの単価が安く、電気的に消去および書換が可
能な不揮発性のメモリとして、フラッシュメモリが注目
されている。このフラッシュメモリを前記図21に示し
たホームコントローラ501のメモリ部512のシステ
ムプログラムやアプリケーションプログラムを内蔵する
ためのメモリ領域509とシステムデータを内蔵するた
めのメモリ領域510に使用すれば、システムの内容を
変更または拡張するときに、従来のように別途ハードウ
ェアを追加することなく、メモリの内容を書換えるだけ
で、容易に行なうことができる。さらに、従来は、メモ
リ部512としてシステムプログラムやアプリケーショ
ンプログラムを格納するためのROMと、システムデー
タを格納するためのRAMとの2種類のメモリが必要で
あったが、両者を1つのフラッシュメモリにより構成す
ることにより、部品数を削減し、装置を小型化すること
ができる。
However, Japanese Patent Application Laid-Open No. Hei 2-2
In the technique proposed in Japanese Patent No. 65395, it is necessary to newly add hardware called a memory card. Accordingly, costs are incurred each time the contents of the home automation system are changed or expanded. By the way, in recent years, a flash memory has attracted attention as a nonvolatile memory having a large capacity, a low unit price per bit, and which can be electrically erased and rewritten. If this flash memory is used for the memory area 509 for storing the system program and the application program in the memory unit 512 of the home controller 501 and the memory area 510 for storing the system data shown in FIG. Can be easily changed or extended simply by rewriting the contents of the memory without adding additional hardware as in the conventional case. Further, conventionally, two types of memories, a ROM for storing a system program and an application program and a RAM for storing system data, are required as the memory unit 512, but both are stored in one flash memory. With this configuration, the number of components can be reduced and the device can be downsized.

【0008】また、ホームオートメーション・システム
は、設置する環境(個別の家庭)ごとに最適な構成が異
なり、それぞれの設置環境にあわせて製品を構成する必
要がある。このため、装置を生産する際には、必然的に
多品種少量生産となる。従来の装置は、ハードウェアの
構成が、個々の製品によって異なるため、組立コストの
上昇や、部品調達コストの上昇を招くおそれがある。し
かしながら、フラッシュメモリを用いて構成した装置の
場合は、メモリの記憶内容を個々に変更するだけで、個
々の家庭の設置環境に応じたデータを容易に設定するこ
とができる。
Further, the home automation system has a different optimum configuration for each installation environment (individual home), and it is necessary to configure a product according to each installation environment. For this reason, when producing an apparatus, it is inevitably a multi-product small-lot production. In the conventional device, since the hardware configuration differs depending on each product, there is a possibility that the assembly cost and the parts procurement cost will increase. However, in the case of an apparatus configured using a flash memory, it is possible to easily set data according to each home installation environment only by changing the storage contents of the memory individually.

【0009】ホームオートメーション・システムにおけ
るデータの変更(書換)について述べる。ホームオート
メーション・システムのシステムプログラムやアプリケ
ーションプログラムを記憶しているメモリ領域の書換
は、通常、製造時またはシステムの変更・拡張時に、専
門の作業員が行なう。したがって、書換作業の途中で何
らかの異常が発生した場合でも、作業者が専門知識を有
しているので比較的容易に障害に対応することが可能で
ある。一方、ホームオートメーション・システムのシス
テムデータについては、設置されている各家庭において
実際の使用者が目的や環境、好みにあわせて設定または
変更を行なう。この場合、ホームオートメーション・シ
ステムを使用するのは、機械操作に熟練した専門家では
なく、一般の家庭の主婦や子供、または老人のように機
械操作に不慣れな人々である。そのため、これら一般者
がシステムデータを書換えている途中で、たとえば、停
電などが発生し、装置が異常停止した場合でも、貴重な
データが失われることがないようにシステムの信頼性を
確保することが重要である。
The data change (rewrite) in the home automation system will be described. Rewriting of the memory area storing the system program and the application program of the home automation system is usually performed by a specialized worker at the time of manufacturing or at the time of changing or expanding the system. Therefore, even if any abnormality occurs during the rewriting operation, it is possible to relatively easily cope with the failure because the operator has the specialized knowledge. On the other hand, the system data of the home automation system is set or changed by an actual user in each installed home according to the purpose, environment, and preference. In this case, the home automation system is used by people unfamiliar with machine operation, such as housewives and children or elderly people in ordinary households, rather than experts in machine operation. For this reason, it is necessary to ensure the reliability of the system so that valuable data will not be lost even if a power failure occurs and the device stops abnormally while these general people are rewriting system data. is important.

【0010】ところで、フラッシュメモリは、データの
書換を行なう場合に所定の単位(ブロック単位)でしか
データの消去が行なえないという欠点を持っている。こ
の欠点に起因するフラッシュメモリを用いる上での問題
点について述べる。
The flash memory has a drawback that data can be erased only in a predetermined unit (block unit) when data is rewritten. Problems in using a flash memory due to this disadvantage will be described.

【0011】図22は、図21に示したホームコントロ
ーラ501のメモリ部512のメモリ領域509と51
0とにフラッシュメモリ507を使用する場合のメモリ
空間の構成例を示す模式図である。同図において、フラ
ッシュメモリ507はn個のブロックに分かれており、
n−2個のブロックがメモリ領域509に、2個のブロ
ックがメモリ領域510に使用されている。なお、メモ
リ領域510に含まれる2個のブロックを以下の説明で
はブロックaとブロックbという。
FIG. 22 shows the memory areas 509 and 51 of the memory section 512 of the home controller 501 shown in FIG.
5 is a schematic diagram showing a configuration example of a memory space when a flash memory 507 is used for 0. FIG. In the figure, the flash memory 507 is divided into n blocks,
n-2 blocks are used for the memory area 509, and two blocks are used for the memory area 510. Note that the two blocks included in the memory area 510 are referred to as a block a and a block b in the following description.

【0012】このように構成されたフラッシュメモリ5
07にシステムデータを格納する場合を考える。システ
ムデータは、製造時または設置時に専門家によってブロ
ックaに書込まれる。そして、システムデータの内容を
変更するときには、新しいシステムデータをブロックb
に書込む。その後、古いシステムデータとなったブロッ
クaの内容を消去する。また、再度、システムデータの
内容を変更する場合には、その新しいシステムデータを
ブロックaに書込み、その後、ブロックbの内容を消去
する。このように、フラッシュメモリにシステムデータ
を格納し、その内容を変更するときには、複数のブロッ
ク間で、書込と消去を交互に繰返す。なお、以下の説明
では、複数のブロックを用いてシステムデータの書込と
消去を交互に繰返し、あるブロックに格納している既存
のシステムデータを、別のブロックに新たなシステムデ
ータを書込むことにより置換えることを「ブロック間の
書換」という。
The flash memory 5 configured as described above
Consider a case where system data is stored in 07. The system data is written into block a by a specialist at the time of manufacture or installation. When changing the contents of the system data, the new system data is stored in the block b.
Write to. After that, the contents of the block a which has become the old system data are erased. When the contents of the system data are changed again, the new system data is written into the block a, and then the contents of the block b are deleted. As described above, when the system data is stored in the flash memory and its contents are changed, writing and erasing are alternately repeated between a plurality of blocks. In the following description, writing and erasing of system data are alternately repeated using a plurality of blocks, and existing system data stored in one block is written with new system data in another block. Is called "rewriting between blocks".

【0013】ここで問題となるのは、ブロックaまたは
ブロックbに新しいシステムデータを書込んでいるとき
に、停電等の異常事態が発生し、書換動作が途中で中断
された場合である。たとえば、ブロックbに変更前のシ
ステムデータが格納され、ブロックaに変更後のシステ
ムデータを格納する場合には、ブロック間の書換動作を
行なっている過程では、書込途中のブロックaと変更前
のシステムデータが書込まれているブロックbとの両方
のブロックにシステムデータが存在する。このような状
態で、停電等によりシステムの動作が中断すると、ホー
ムコントローラ501は、ブロックaとブロックbとの
どちらのブロックのデータが有効なシステムデータであ
るのか判別できないので、システムの信頼性が失われて
しまう。
Here, a problem arises when an abnormal situation such as a power failure occurs while writing new system data to the block a or the block b, and the rewriting operation is interrupted halfway. For example, when the system data before the change is stored in the block b and the system data after the change is stored in the block a, during the rewriting operation between the blocks, the block a being written and the block a before the change are stored. The system data exists in both the block b and the block b in which the system data is written. In such a state, if the operation of the system is interrupted due to a power failure or the like, the home controller 501 cannot determine which block data, block a or block b, is valid system data. Will be lost.

【0014】本発明は、上述したような問題点を解決す
るためになされたものであり、フラッシュメモリなどの
不揮発性のメモリを用いる場合に、データをブロック間
で書換えている途中において異常事態が発生したときの
復旧時においてブロック間の書換状態を検出することに
より用いるべき有効なデータを判別し、さらに、データ
が復元可能か否かを判定して復元可能な場合には極力デ
ータの復元を行なうようにすることが可能なホームコン
トローラを提供することを目的とする。
SUMMARY OF THE INVENTION The present invention has been made to solve the above-described problems. When a nonvolatile memory such as a flash memory is used, an abnormal situation may occur while data is being rewritten between blocks. When recovery occurs, valid data to be used is determined by detecting the state of rewriting between blocks, and further, it is determined whether data can be restored. It is an object of the present invention to provide a home controller capable of performing the operation.

【0015】[0015]

【課題を解決するための手段】上述の目的を達成するた
めに、請求項1記載の発明は、ホームバスを介して家庭
用機器を制御するためのホームコントローラであって、
不揮発性のメモリからなり、制御用データを格納するた
めの2つのブロックを含む制御用データ記憶手段と、
御用データの書込み指令に応答して、前記制御用データ
を前記2つのブロックのうちの選択された一つに書込む
ための書込手段とを含み、 前記2つのブロックの各々
は、 前記制御用データを記憶するための制御用データ記
憶領域と、第1のデータを格納するための第1のデータ
記憶領域と、第2のデータを格納するための第2のデー
タ記憶領域とを含み、 前記書込手段は、 前記指令に応答
して、前記2つのブロックの前記第1のデータに基づい
て前記2つのブロックのいずれか一方のブロックを選択
するための選択手段と、 前記2つのブロックのうちの他
方のブロックを所定の第1の値でクリアするための第1
のクリア手段と、 前記他方のブロックの前記制御用デー
タ記憶領域に制御用データを書込むための制御用データ
書込手段と、 前記制御用データ書込手段による書込の完
了後に、前記一方のブロックの前記第1のデータを前記
第2の値で書換えるための第1の書換手段と、 前記第1
の書換手段による書換の完了後に、前記他方のブロック
の前記第2のデータを前記第2の値で書き換えるための
第2の書換手段と、 前記第2の書換手段による書換の完
了後に、前記一方のブロックを前記第1の値でクリアす
るための第2のクリア手段とを含み、 前記ホームコント
ローラはさらに、前記2つの第1のデータと前記2つの
第2のデータとに基づいて選択されたブロックの前記制
御用データ記憶領域に格納されている制御用データに基
づいて前記家庭用機器を制御するための信号を生成す
信号生成手段を含むものである。
According to one aspect of the present invention, there is provided a home controller for controlling home appliances via a home bus, comprising:
A control data storage means comprising two blocks for a nonvolatile memory, for storing control data, control
In response to the command to write the control data, the control data
Write to a selected one of the two blocks
Writing means for each of the two blocks
Is a control data record for storing the control data.
A storage area, a first data storage area for storing first data, and a second data storage area for storing second data , wherein the writing means responds to the command.
And based on the first data of the two blocks
To select one of the two blocks
Selecting means for performing the operation and the other of the two blocks.
To clear the other block with a predetermined first value
And the control data of the other block.
Control data for writing control data to the data storage area
Writing means, and completion of writing by the control data writing means.
After completion, the first data of the one block is
A first rewriting means for rewriting the second value, the first
After the rewriting by the rewriting means is completed, the other block
For rewriting the second data with the second value
Second rewriting means, and completion of rewriting by the second rewriting means.
After completion, the one block is cleared with the first value.
Second clearing means for controlling the home control.
Laura further comprises the two first data and the two
The control of the block selected based on the second data.
Based on the control data stored in the control data storage area.
That generates a signal for controlling the household equipment Zui
It includes signal generation means .

【0016】請求項2記載の発明は、請求項1記載の発
明の構成に加えて、前記2つのブロックの各々は、第3
のデータを格納するための第3のデータ記憶領域をさら
に含み、 前記制御用データ書込手段は、 制御用データに
含まれる予め定められた一部のデータを前記他方のブロ
ックの前記制御用データ記憶領域に書込むための一部書
込手段と、 前記予め定められた一部のデータの書込の完
了後、前記他方のブロックの前記第3のデータを前記第
2の値で書き換えるための第3の書換手段と、 前記第3
の書換手段による書換の完了後、前記制御用データのう
ちの前記予め定められた一部以外を前記一方のブロック
の前記制御用データ記憶手段から読み出して前記他方の
ブロックの前記制御用データ記憶領域に書込むための読
出書込手段とを含むものである。
The invention according to claim 2 provides the invention according to claim 1.
In addition to the configuration described above, each of the two blocks
A third data storage area for storing the
The control data writing means includes a control data
The predetermined part of the included data is
For writing in the control data storage area of the
Writing means for completing writing of the predetermined part of the data.
After the completion, the third data of the other block is
And third rewrite means for rewriting at 2 values, the third
After the rewriting by the rewriting means is completed, the control data
Other than the predetermined part of the one of the blocks
Read from the control data storage means of the
A read for writing to the control data storage area of the block.
Output writing means.

【0017】請求項3記載の発明は、請求項2記載の発
明の構成に加えて、前記2つのブロックの各々はデータ
バッファ領域をさらに含み、 前記一部書込手段は、 制御
用データを前記一方のブロックのデータバッファ領域に
書込むためのバッファ書込手段と、 前記一方のブロック
の前記データバッファ領域に格納されているデータを読
出して前記他方のブロックの前記制御用データ記憶領域
に書込むためのバッファ読出手段とを含むものである。
The invention according to claim 3 provides the invention according to claim 2.
In addition to the configuration described above, each of said two blocks
A buffer area, wherein the partial writing means controls
Data to the data buffer area of the one block.
Buffer writing means for writing, and the one block
Read the data stored in the data buffer area of
The control data storage area of the other block
And buffer reading means for writing the data into the buffer.

【0018】請求項4記載の発明は、請求項3記載の発
明の構成に加えて、前記更新継続手段は、 異常発生によ
り前記一部書込手段による書込動作が中断されたこと
を、前記2つのブロックの前記第1、第2、および第3
の値に基づいて検出し、復旧のために、前記制御用デー
タのうちの前記他方のブロックの前記制御用データ記憶
領域に書込まれた部分を除く部分を前記一方のブロック
のデータバッファ領域から読出して前記他方のブロック
の前記制御用データ記憶領域に書込むための部分読出書
込手段を含むものである。
The invention according to claim 4 is the invention according to claim 3.
In addition to the Ming configuration, the continuously updated means, the occurrence of abnormality
The writing operation by the partial writing means is interrupted.
With the first, second and third of the two blocks
Of the control data for recovery.
The control data storage of the other of the blocks
The part excluding the part written in the area is the one block
Read from the data buffer area of the other block
Partial read-write for writing to the control data storage area
It includes a loading means.

【0019】請求項5記載の発明は、請求項1〜4のい
ずれかに記載の発明の構成に加えて、前記2つのブロッ
クの各々は、別個に一括消去可能である。
The invention according to claim 5 is the invention according to claims 1 to 4.
In addition to the configuration of the invention described in any of the above, the two blocks
Each of the blocks can be separately and collectively erased.

【0020】[0020]

【作用】請求項1記載の構成により、ホームコントロー
ラは、制御用データ記憶手段に格納されている制御用デ
ータに基づいて信号生成手段が生成した信号をホームバ
スを介して送ることにより、家庭用機器を制御する。制
御用データ記憶手段は、制御用データを格納するための
2つのブロックを含んでおり、信号生成手段は、そのう
ちのいずれか一方のブロックのデータを用いる。制御用
データを変更する場合には、既存の制御用データが格納
されている一方のブロックとは異なる他方のブロックに
書込手段により変更後の新たな制御用データを書込む。
書込手段による他方のブロックへの制御用データの書込
前には、第1のクリア手段により他方のブロックが第1
の値でクリアされる。この後制御用データが他方のブロ
ックの制御用データ記憶領域に書込まれる。この書込が
完了すると、第1の書換手段が、一方のブロックの第1
のデータを第2の値に書換える。その後、第2の書換手
段が他方のブロックの第2のデータを第2の値に書換
え、さらに第2のクリア手段が一方のブロックを第1の
値でクリアする。
According to the first aspect of the present invention, the home controller sends the signal generated by the signal generation means based on the control data stored in the control data storage means via the home bus to the home controller. Control the equipment. The control data storage means includes two blocks for storing control data, and the signal generation means uses data of one of the blocks. When changing the control data, it writes the new control data after the change by the writing means into different other blocks and one block existing control data is stored.
Writing control data to the other block by writing means
Before the first block, the first block clears the other block to the first
Cleared by the value of. After this, the control data is
The data is written to the control data storage area of the disk. This writing
Upon completion, the first rewriting means executes the first rewriting of one of the blocks.
Is rewritten to the second value. Then the second rewriter
The stage rewrites the second data of the other block to the second value
Further, the second clearing means sets one of the blocks to the first
Clear by value.

【0021】[0021]

【0022】ここで、停電等の異常が発生し、制御用デ
ータの変更処理が中断した場合を考える。ホームコント
ローラの復旧時には2つの第1のデータと2つの第2
のデータとに基づいて2つのブロックのうちのいずれの
ブロックが、用いるべき制御用データを格納しているか
を判定することができる。ここで、第2のデータは、対
応するブロックが制御用データの書込が完了した状態で
あるか否かを示す。したがって2つの第2のデータの
うちのいずれか一方のみが第2の値である場合には、第
2のデータを参照することによっていずれのブロック
が用いるべき制御用データを格納しているかを判定する
ことができる。
Here, consider a case where an abnormality such as a power failure occurs and the control data change process is interrupted. When the home controller is restored , two first data and two second data
It is possible to determine which of the two blocks stores the control data to be used, based on this data . Here, the second data indicates whether or not the corresponding block has completed the writing of the control data. Therefore , when only one of the two second data is the second value, by referring to the second data , which block stores the control data to be used. Can be determined.

【0023】また、一方のブロックに制御用データが既
に書込まれており、さらに、他方のブロックへの変更後
の新たな制御用データの書込手段による書込が完了して
いる場合であって一方のブロックのクリア前には、2つ
の第2のデータはともに第2の値である。この期間にお
いては第2のデータを参照するのみでは、いずれのブ
ロックの制御用データを用いるべきかを決定することが
できない。この期間は、2つの第1のデータのいずれか
一方が第2のになっている期間に包含され、かつ、第
1のデータのいずれが第2のとなっているかにより、
2つのブロックのうちのいずれのブロックが変更後の新
たな制御用データを格納しているかが示される。
Further, it has been written previously written control data into one block, further met if the writing has been completed by the writing means of new control data after the change to the other block Before the other block is cleared , the two second data are both the second value. In this period, the only reference to the second data, can not be determined should be used for control data in any block. This period is either one of the two first data is included in the period that is a second value, and by which of the first data has a second value,
Which of the two blocks stores the new control data after the change is shown.

【0024】第1のデータを参照して、2つの第1のデ
ータがともに第1のである場合には、第2のデータを
参照することによって用いるべき制御用データを格納し
ているブロックを決定することができる。また、第1の
データのいずれか一方が第2のである場合には、第2
のデータを参照することによって、用いるべき制御用デ
ータを格納しているブロックを決定することができる
Referring to the first data, if the two first data are both the first value , the block storing the control data to be used by referring to the second data. Can be determined. If one of the first data is the second value , the second data
By referring to this data, the block storing the control data to be used can be determined.

【0025】請求項2記載の構成により、書込手段が、
制御用データに含まれる予め定められた一部のデータ
、他方のブロックへの書込を完了した後に、第3の
手段が、第3のデータを第2の値へと書換える。読出
書込手段は、第3のデータの書換の完了後、制御用デー
タに含まれる書込が完了した一部のデータを除く他の部
分を他方のブロックから読出して当該ブロックへ書込
む。また、停電等の異常が発生した場合に、ホームコン
トローラを復旧するときには、予め定められた一部のデ
ータの書込が完了している状態であれば、読出書込手段
により、ブロックへの書込が完了した一部のデータを除
く他の部分を他方のブロックから読出して当該ブロック
へ書込み、変更後の新たな制御用データを制御用データ
記憶手段に書込むことができる。
According to the second aspect of the present invention, the writing means includes:
Some of predetermined data included in the control data, after completing the write to the other block, the third book
The rewriting means rewrites the third data to a second value . After the completion of the rewriting of the third data, the read / write means reads, from the other block, the other part of the control data except for the part of the data for which the writing has been completed, and writes the other part in the block. When the home controller is restored when an abnormality such as a power failure occurs, if the writing of some predetermined data has been completed, the writing to the block is performed by the read / write unit. The rest of the data other than the partially completed data can be read from the other block and written to the block, and new control data after the change can be written to the control data storage means.

【0026】請求項3記載の構成により、バッファ書込
手段が制御用データを一方のブロックのデータバッファ
領域に書込む。このデータバッファ領域に格納されてい
る制御用データをバッファ読出手段が読出して他方の
ロックの制御用データ記憶領域に書込む。停電等の異常
が発生し、書込手段による書込動作が中断された場合に
は、部分読出書込手段が実行される。部分読出書込手段
は、制御用データのうちの既にブロックに書込まれた部
分を除く部分を一方のデータバッファ領域から読出して
他方のブロックの制御用データ記憶領域に書込む。これ
により、制御用データのうちの、一方のブロックのデー
タバッファ領域に書込まれていた部分は、他方のブロッ
クの制御用データ記憶領域に書込まれ、その後の処理に
用いることが可能な状態になる。
According to the configuration of the third aspect, the buffer writing means writes the control data to the data buffer area of one of the blocks . It writes the control data stored in the data buffer area buffer readout means reads out the other blanking <br/> control data storage area of the lock. When an error such as a power failure occurs and the writing operation by the writing unit is interrupted, the partial reading and writing unit is executed. The partial read / write means reads a portion of the control data excluding a portion already written in the block from one data buffer area.
Write to the control data storage area of the other block . As a result, the portion of the control data that has been written in the data buffer area of one block is replaced by the other block.
The data is written to the control data storage area of the network, and becomes available for the subsequent processing.

【0027】請求項4記載の構成により、第1、第2お
よび第3の値に基づいて一部書込手段の書込動作が中断
されたことが検出できる。そして、復旧のために、他方
のブロックの制御用データ記憶領域に既に書込まれた部
分を除く部分が、一方のブロックのデータバッファ領域
から他方のブロックの制御用データ記憶領域に書込まれ
る。
According to the fourth aspect of the present invention, the first, the second and the second
Operation of partial writing means is interrupted based on and third value
Can be detected. And for recovery, the other
Already written to the control data storage area of the block
The part excluding the minute is the data buffer area of one block
Is written to the control data storage area of the other block from
You.

【0028】請求項5記載の構成により、2つのブロッ
クは別個に一括消去ができる。したがって第1の値をク
リアの状態と対応付ければ、メモリの一括消去によって
ブロックに格納されている制御用データの消去と、第1
のデータの第1の値への書換と、第2のデータの第1の
値への書換とを同時に行なうことができる。
According to the fifth aspect of the present invention, two blocks are provided.
Can be separately erased collectively. Therefore, the first value
If you associate it with the rear state,
Erasing control data stored in the block;
Of the second data to the first value and the first data of the second data
Rewriting to a value can be performed simultaneously.

【0029】[0029]

【実施例】以下、本発明を具体化した3つの実施例につ
いて図面を参照してそれぞれ説明する。また、各実施例
は、メモリとしてフラッシュメモリを用いた構成を例示
するが、本発明はフラッシュメモリを用いた場合に限ら
ず、その他の不揮発性のメモリ全般に同様に適用するこ
とができることを予め述べておく。
DESCRIPTION OF THE PREFERRED EMBODIMENTS Three embodiments of the present invention will be described below with reference to the drawings. In each embodiment, a configuration using a flash memory as a memory is exemplified. However, it is to be noted that the present invention is not limited to the case where a flash memory is used, and can be similarly applied to other non-volatile memories in general. Please note.

【0030】図1は、本発明の第1実施例によるホーム
コントローラの構成を示すブロック図である。ホームコ
ントローラ1は、家庭用機器(図示を省略)に接続され
たホームバス2とのデータの送受信を行なうためのイン
タフェース部3と、ホームコントローラ1全体の動作を
管理するための制御部5と、キー入力や表示・音声入出
力等を行なうためのI/O(Input/Output)部6と、ホ
ームコントローラ1の動作に必要な各種のデータを格納
するためのメモリ部12と、メモリ部12のデータの格
納を管理するためのメモリ制御部8とを含む。
FIG. 1 is a block diagram showing a configuration of a home controller according to a first embodiment of the present invention. The home controller 1 includes an interface unit 3 for transmitting and receiving data to and from a home bus 2 connected to a home device (not shown), a control unit 5 for managing the overall operation of the home controller 1, and An I / O (Input / Output) unit 6 for performing key input, display, voice input / output, and the like; a memory unit 12 for storing various data necessary for the operation of the home controller 1; And a memory control unit 8 for managing data storage.

【0031】メモリ部12は、ホームオートメーション
・システムのシステムプログラムやアプリケーションプ
ログラムを格納するための第1のメモリ領域9と、シス
テムデータを格納するための第2のメモリ領域10と、
システムプログラムやアプリケーションプログラムを制
御部5が実行するときに、制御部5の作業用の記憶領域
を提供するための第3のメモリ領域11とを含む。第2
のメモリ領域10のデータの書込と消去とは、メモリ制
御部8が行なう。
The memory section 12 includes a first memory area 9 for storing a system program and an application program of the home automation system, a second memory area 10 for storing system data,
When the control unit 5 executes a system program or an application program, the control unit 5 includes a third memory area 11 for providing a work storage area. Second
The writing and erasing of data in the memory area 10 are performed by the memory control unit 8.

【0032】本実施例では、第1のメモリ領域9と、第
2のメモリ領域10とをフラッシュメモリ7で構成して
いる。
In this embodiment, the first memory area 9 and the second memory area 10 are constituted by the flash memory 7.

【0033】第2のメモリ領域10は、システムデータ
を書込むためのシステムデータ領域14と、システムデ
ータのブロック間の書換動作(後述)が開始したことを
示すためのデータを格納する書換開始データ領域15
と、システムデータのブロック間の書換動作が終了した
ことを示すためのデータを格納する書換終了データ領域
16と、当該ブロックに格納されたデータが、書換前の
データであるか否かを示すためのデータを格納する新旧
表示データ領域17とを含む。なお、これらのシステム
データ領域14と、書換開始データ領域15と、書換終
了データ領域16と、新旧表示データ領域17とは、第
2のメモリ領域10に設けられた2個のブロックの各々
に設けられるものである。この2個のブロックの構成に
ついては、図2を参照して後述する。
The second memory area 10 includes a system data area 14 for writing system data and rewrite start data for storing data for indicating that a rewrite operation (described later) between blocks of system data has started. Area 15
And a rewriting end data area 16 for storing data for indicating that the rewriting operation between blocks of system data has been completed, and for indicating whether or not the data stored in the block is data before rewriting. And the new and old display data area 17 for storing the data of. The system data area 14, the rewrite start data area 15, the rewrite end data area 16, and the new / old display data area 17 are provided in each of the two blocks provided in the second memory area 10. It is something that can be done. The configuration of these two blocks will be described later with reference to FIG.

【0034】図2は、第2のメモリ領域10に設けられ
た2個のブロックa,bの構成を示す模式図である。ブ
ロックaは、システムデータを格納するためのシステム
データ領域14aと書換開始データ領域15aと書換終
了データ領域16aと新旧表示データ領域17aとを含
む。同様に、ブロックbは、システムデータ領域14b
と書換開始データ領域15bと書換終了データ領域16
bと新旧表示データ領域17bとを含む。
FIG. 2 is a schematic diagram showing the configuration of two blocks a and b provided in the second memory area 10. The block a includes a system data area 14a for storing system data, a rewrite start data area 15a, a rewrite end data area 16a, and a new and old display data area 17a. Similarly, the block b includes the system data area 14b
And rewrite start data area 15b and rewrite end data area 16
b and the new and old display data area 17b.

【0035】図3,4は、本実施例においてシステムデ
ータをブロック間の書換によって変更するときのホーム
コントローラ1の動作の手順を示すフローチャートであ
る。なお、以下の説明においては、前述の書換開始デー
タと書換終了データと新旧表示データとをそれぞれプロ
グラム上でセット/リセットを示すための「フラグ」と
して説明する。各フラグは、データ領域にデータを書込
むことによりセットされ、ブロックの記憶内容が消去さ
れることに伴って各フラグのデータ領域の記憶内容が消
去されることによりリセットされる。
FIGS. 3 and 4 are flowcharts showing the procedure of the operation of the home controller 1 when the system data is changed by rewriting between blocks in this embodiment. In the following description, the above-described rewrite start data, rewrite end data, and new / old display data are each described as a “flag” for indicating set / reset on a program. Each flag is set by writing data to the data area, and is reset by erasing the storage content of the data area of each flag as the storage content of the block is erased.

【0036】まず、ステップ(以下、単に「S」とい
う。)1において、制御部5からの指令に応答してメモ
リ制御部8が、ブロックaの書換開始フラグ15aがセ
ットされているか否かを調べる。メモリ制御部8は、書
換開始フラグ15aがセットされていれば(S1にてY
ES)、現在、システムデータがブロックaに書込まれ
ていると判断する。そして、メモリ制御部8は、新しい
システムデータをブロックbに書込まなければならない
と判断する。
First, in step (hereinafter simply referred to as "S") 1, in response to a command from the control unit 5, the memory control unit 8 determines whether or not the rewrite start flag 15a of the block a is set. Find out. If the rewrite start flag 15a is set (Y in S1)
ES), it is determined that the system data is currently written in block a. Then, the memory control unit 8 determines that new system data must be written to the block b.

【0037】次に、メモリ制御部8は、ブロックbの記
憶内容が消去されているか否かを調べ(S2)、ブロッ
クbの記憶内容が消去されていなければ(S2にてN
O)、ブロックbの記憶内容を消去する(S3)。この
とき、ブロックbに含まれるシステムデータ領域14b
と書換開始フラグ15bと書換終了フラグ16bと新旧
表示フラグ17bとのすべてが消去される。フラッシュ
メモリは、データの消去をブロックごとに行なうためで
ある。
Next, the memory control unit 8 checks whether or not the storage content of the block b has been erased (S2). If the storage content of the block b has not been erased (N in S2)
O), the stored contents of the block b are erased (S3). At this time, the system data area 14b included in the block b
, The rewrite start flag 15b, the rewrite end flag 16b, and the new / old display flag 17b are all deleted. The purpose of the flash memory is to erase data for each block.

【0038】次に、メモリ制御部8は、ブロックbの書
換開始フラグ15bをセットする(S4)。続いて、メ
モリ制御部8は、ブロックbへのすべての書込が終了す
れば(S5)、ブロックaの新旧表示フラグ17aをセ
ットする(S6)。その後、メモリ制御部8は、ブロッ
クbの書換終了フラグ16bをセットする(S7)。さ
らに、メモリ制御部8は、ブロックaの記憶内容を消去
して(S8)、ブロックaからブロックbへのシステム
データの書換処理を終了する。
Next, the memory control unit 8 sets the rewrite start flag 15b of the block b (S4). Subsequently, when all writing to the block b is completed (S5), the memory control unit 8 sets the new / old display flag 17a of the block a (S6). Thereafter, the memory control unit 8 sets the rewrite end flag 16b of the block b (S7). Further, the memory control unit 8 erases the storage content of the block a (S8), and ends the process of rewriting the system data from the block a to the block b.

【0039】一方、前述のS1において、ブロックaの
書換開始フラグ15aがセットされていなければ(S1
でNO)、メモリ制御部8は、現在、システムデータが
ブロックaに書込まれていないと判断し、続いて、ブロ
ックbの書換開始フラグ15bがセットされているか否
かを調べる(S9)。メモリ制御部8は、書換開始フラ
グ15bがセットされていれば(S9にてYES)、現
在、システムデータがブロックbのシステムデータ領域
14bに書込まれていると判断する。この場合、メモリ
制御部8は、新しいシステムデータをブロックaに書込
まなければならないと判断する。
On the other hand, if the rewriting start flag 15a of the block a is not set in S1 (S1).
NO), the memory control unit 8 determines that the system data is not currently written in the block a, and then checks whether or not the rewrite start flag 15b of the block b is set (S9). If rewrite start flag 15b is set (YES in S9), memory control unit 8 determines that the system data is currently written in system data area 14b of block b. In this case, the memory control unit 8 determines that new system data must be written to the block a.

【0040】次に、メモリ制御部8は、ブロックaの記
憶内容が消去されているか否かを調べ(S10)、消去
されていなければ(S10にてNO)、ブロックaの記
憶内容を消去する(S11)。次に、メモリ制御部8
は、ブロックaの書換開始フラグ15aをセットする
(S12)。そして、メモリ制御部8は、ブロックaの
システムデータ領域14aに新しいシステムデータを書
込む(S13)。メモリ制御部8は、ブロックaへのす
べての書込が終了すれば、ブロックbの新旧表示フラグ
17bをセットする(S14)。
Next, the memory control unit 8 checks whether or not the storage contents of the block a have been erased (S10), and if not (NO in S10), erases the storage contents of the block a. (S11). Next, the memory control unit 8
Sets the rewrite start flag 15a of the block a (S12). Then, the memory control unit 8 writes new system data into the system data area 14a of the block a (S13). When all the writing to the block a is completed, the memory control unit 8 sets the new / old display flag 17b of the block b (S14).

【0041】その後、メモリ制御部8は、ブロックaの
書換終了フラグ16aをセットする(S15)。そし
て、メモリ制御部8は、ブロックbの記憶内容を消去し
(S16)、ブロックbからブロックaへのシステムデ
ータの書換処理を終了する。
Thereafter, the memory control unit 8 sets the rewrite end flag 16a of the block a (S15). Then, the memory control unit 8 erases the storage content of the block b (S16), and ends the process of rewriting the system data from the block b to the block a.

【0042】また、前述のS9において、ブロックbの
書換開始フラグ15bがセットされていなければ(S9
にてNO)、メモリ制御部8は、現在、システムデータ
がブロックaにもブロックbにも書込まれていないと判
断する。このような状態は、通常、ホームコントローラ
1の製造時または設置時のようにシステムデータが未設
定である場合に発生する。この場合はメモリ制御部8
は、システムデータをブロックaに書込む。なお、シス
テムデータが未設定の場合にはじめにシステムデータを
書込むブロックは、ブロックaとブロックbのいずれで
あってもよい。
If the rewrite start flag 15b of the block b is not set in the above-mentioned S9 (S9
NO), the memory control unit 8 determines that the system data is not currently written in the block a or the block b. Such a state usually occurs when system data has not been set, such as when the home controller 1 is manufactured or installed. In this case, the memory control unit 8
Writes system data to block a. The block into which the system data is written first when the system data has not been set may be either the block a or the block b.

【0043】次に、メモリ制御部8は、ブロックaの内
容が消去されているか否かを調べ(S17)、消去され
ていなければ(S17にてNO)、ブロックaの内容を
消去する(S18)。次に、メモリ制御部8は、ブロッ
クaの書換開始フラグ15aをセットする(S19)。
そして、メモリ制御部8は、ブロックaに新しいシステ
ムデータを書込む(S20)。メモリ制御部8は、ブロ
ックaへのすべての書込が終了すれば、ブロックaの書
換終了フラグ16aをセットする(S21)。
Next, the memory control unit 8 checks whether or not the contents of the block a have been erased (S17), and if not (NO in S17), erases the contents of the block a (S18). ). Next, the memory control unit 8 sets the rewrite start flag 15a of the block a (S19).
Then, the memory control unit 8 writes new system data to the block a (S20). When all the writing to the block a is completed, the memory control unit 8 sets the rewrite end flag 16a of the block a (S21).

【0044】そして、メモリ制御部8は、ブロックbの
記憶内容が消去されているか否かを調べ(S22)、消
去されていなければ(S22にてNO)、ブロックbの
内容を消去し(S23)、システムデータの書換処理を
終了する。ただし、この場合には、書換前の旧いシステ
ムデータを格納したブロックが存在しなかったので、正
確には、システムデータの初回の書込処理である。
Then, the memory control unit 8 checks whether or not the storage contents of the block b have been erased (S22). If the storage contents have not been erased (NO in S22), the memory control unit 8 erases the contents of the block b (S23). ), The system data rewriting process ends. However, in this case, since there is no block storing the old system data before rewriting, it is exactly the first write processing of the system data.

【0045】前述したシステムデータのブロック間の書
換処理が実行されている途中で、たとえば停電などの異
常事態が発生すると、ホームコントローラ1は、システ
ムをリセットする。このとき、ブロック間の書換処理は
途中で中断される。このような異常事態からの復旧時に
おけるホームコントローラ1の動作について以下に説明
する。
If an abnormal situation such as a power failure occurs during the execution of the rewriting process between the blocks of the system data, the home controller 1 resets the system. At this time, the rewriting process between blocks is interrupted halfway. The operation of the home controller 1 at the time of recovery from such an abnormal situation will be described below.

【0046】図5,6は、ホームコントローラ1の復旧
時の動作手順を示すフローチャートである。始めに、S
24において、制御部5からの指令に応答してメモリ制
御部8が、ブロックaの書換開始フラグ15aがセット
されているか否かを調べる。メモリ制御部8は、書換開
始フラグ15aがセットされていなければ(S24にて
NO)、ブロックbの書換開始フラグ15bがセットさ
れているか否かを調べる(S25)。メモリ制御部8
は、書換開始フラグ15bがセットされていなければ
(S25にてNO)、ブロックaとブロックbとのいず
れにもシステムデータが存在しないと判断する(S2
6)。このような状態は、前述したようにコントローラ
1の製造時または設置時においてシステムデータが未設
定である場合に発生する。
FIGS. 5 and 6 are flowcharts showing the operation procedure when the home controller 1 is restored. First, S
At 24, in response to the command from the control unit 5, the memory control unit 8 checks whether the rewrite start flag 15a of the block a is set. If the rewrite start flag 15a is not set (NO in S24), the memory control unit 8 checks whether or not the rewrite start flag 15b of the block b is set (S25). Memory control unit 8
If the rewrite start flag 15b is not set (NO in S25), it is determined that the system data does not exist in any of the blocks a and b (S2).
6). Such a state occurs when the system data is not set at the time of manufacturing or installing the controller 1 as described above.

【0047】また、前述のS25においてブロックbの
書換開始フラグ15bがセットされていれば(S25に
てYES)、メモリ制御部8は、続いて、ブロックbの
書換終了フラグ16bがセットされているか否かを調べ
る(S27)。メモリ制御部8は、書換終了フラグ16
bがセットされていれば(S27にてYES)、現在、
システムデータがブロックbのシステムデータ領域14
bに書込まれていると判断する(S29)。
If the rewriting start flag 15b of the block b has been set in S25 (YES in S25), the memory control unit 8 then checks whether the rewriting end flag 16b of the block b has been set. It is checked whether or not it is (S27). The memory control unit 8 sets the rewrite end flag 16
If b is set (YES in S27),
System data is in the system data area 14 of the block b
It is determined that the data has been written in b (S29).

【0048】一方、前述のS24において、ブロックa
の書換開始フラグ15aがセットされていれば(S24
にてYES)、メモリ制御部8は、ブロックbの書換開
始フラグ15bがセットされているか否かを調べる(S
30)。メモリ制御部8は、書換開始フラグ15bがセ
ットされていなければ(S30にてNO)、次に、ブロ
ックaの書換終了フラグ16aがセットされているか否
かを調べる(S31)。
On the other hand, in the aforementioned S24, the block a
Is set (S24).
YES), the memory control unit 8 checks whether or not the rewrite start flag 15b of the block b is set (S).
30). If the rewrite start flag 15b is not set (NO in S30), the memory control unit 8 checks whether the rewrite end flag 16a of the block a is set (S31).

【0049】メモリ制御部8は、書換終了フラグ16a
がセットされていれば(S31にてYES)、現在、シ
ステムデータがブロックaのシステムデータ領域14a
に書込まれていると判断する(S33)。
The memory control unit 8 has a rewrite end flag 16a
Is set (YES in S31), the system data is currently stored in the system data area 14a of the block a.
(S33).

【0050】一方、メモリ制御部8は、ブロックaの書
換終了フラグ16aがセットされていなければ(S31
にてNO)、ブロックaの記憶内容を消去する(S3
2)。この動作は、前記図4に示したS20の処理が実
行されている途中で異常事態が発生した場合に対応する
処理である。このような処理が必要になるのは、コント
ローラ1の製造時または設置時に、専門家によってシス
テムデータを最初に書込んでいる場合である。この場
合、作業者である専門家は、コントローラ1を操作する
ための適正な知識を有するので、システムがリセットし
た後にホームコントローラ1を操作して容易にシステム
データをフラッシュメモリ7に書込ませる動作を行なわ
せることができる。
On the other hand, if the rewrite end flag 16a of the block a is not set (S31)
NO at step S3), and erases the storage contents of block a (S3).
2). This operation is a process corresponding to a case where an abnormal situation occurs during the execution of the process of S20 shown in FIG. Such processing is required when the system data is first written by an expert when the controller 1 is manufactured or installed. In this case, since the operator, who is an expert, has appropriate knowledge for operating the controller 1, the operation of operating the home controller 1 after the system is reset to easily write the system data into the flash memory 7 is performed. Can be performed.

【0051】また、前述のS27にてブロックbの書換
終了フラグ16bがセットされていなければ(S27に
てNO)、メモリ制御部8はブロックbの記憶内容を消
去する(S28)。ただし、本実施例では前記図4に示
したようにシステムデータが未設定のときには、システ
ムデータをまずブロックaに書込むようにしたので(図
4のS20参照)、通常は、S28の処理が必要となる
ような状態は発生しない。
If the rewrite end flag 16b of the block b has not been set in S27 (NO in S27), the memory control unit 8 deletes the stored contents of the block b (S28). However, in this embodiment, when the system data is not set as shown in FIG. 4, the system data is first written into the block a (see S20 in FIG. 4). There is no such condition as is required.

【0052】次に、前述のS30にてブロックaとブロ
ックbとの両方にシステムデータが存在する場合(S3
0にてYES)の処理について説明する。このような状
態は、前記図3に示したブロック間の書換処理の実行中
に異常事態が発生して書換処理が途中で中断された場合
に発生する。このとき、メモリ制御部8は、まずブロッ
クaの新旧表示フラグ17aがセットされているか否か
を調べる(S34)。新旧表示フラグ17aがセットさ
れていれば(S34にてYES)、メモリ制御部8は、
ブロックaからブロックbへのデータの書換処理の途中
で前記図3のS6の終了直後に動作が中断したと判断す
る。
Next, when the system data exists in both the block a and the block b in the aforementioned S30 (S3
(YES at 0) will be described. Such a state occurs when an abnormal situation occurs during the execution of the rewriting process between the blocks shown in FIG. 3 and the rewriting process is interrupted halfway. At this time, the memory control unit 8 first checks whether or not the new / old display flag 17a of the block a is set (S34). If new / old display flag 17a is set (YES in S34), memory control unit 8
It is determined that the operation has been interrupted immediately after the end of S6 in FIG. 3 during the data rewriting process from block a to block b.

【0053】続いて、メモリ制御部8は、ブロックbの
書換終了フラグ16bがセットされているか否かを調べ
る(S35)。書換終了フラグ16bがセットされてい
なければ(S35にてNO)、メモリ制御部8は、ブロ
ックbの書換終了フラグ16bをセットする(S3
6)。次に、メモリ制御部8は、ブロックaの内容を消
去する(S37)。この場合には、メモリ制御部8はシ
ステムデータがブロックbに書込まれていると判断し
(S29)、その旨を示す信号を制御部5へ送信する。
Subsequently, the memory control unit 8 checks whether or not the rewrite end flag 16b of the block b is set (S35). If the rewrite end flag 16b is not set (NO in S35), the memory control unit 8 sets the rewrite end flag 16b of the block b (S3).
6). Next, the memory control unit 8 erases the contents of the block a (S37). In this case, the memory control unit 8 determines that the system data has been written to the block b (S29), and transmits a signal to that effect to the control unit 5.

【0054】また、前述のS34においてブロックaの
新旧表示フラグ17aがセットされていなければ(S3
4にてNO)、メモリ制御部8は、ブロックbの新旧表
示フラグ17bがセットされているか否かを調べる(S
38)。新旧表示フラグ17bがセットされていれば
(S38にてYES)、メモリ制御部8は、ブロックb
からブロックaへのシステムデータの書換処理の途中
で、前記図3のS14の終了直後に動作が中断したと判
断する。そして、メモリ制御部8は、ブロックaの書換
終了フラグ16aがセットされているか否かを調べ(S
39)、書換終了フラグ16aがセットされていなけれ
ば(S39にてNO)、書換終了フラグ16aをセット
する(S40)。次に、メモリ制御部8は、ブロックb
の記憶内容を消去する(S41)。この場合には、メモ
リ制御部8は、システムデータがブロックaに書込まれ
ていると判断する(S33)。
If the new / old display flag 17a of the block a is not set in the above-mentioned S34 (S3
(NO at 4), the memory control unit 8 checks whether or not the new / old display flag 17b of the block b is set (S).
38). If new / old display flag 17b is set (YES in S38), memory control unit 8 proceeds to block b
It is determined that the operation was interrupted immediately after the end of S14 in FIG. Then, the memory control unit 8 checks whether the rewrite end flag 16a of the block a is set or not (S
39) If the rewrite end flag 16a is not set (NO in S39), the rewrite end flag 16a is set (S40). Next, the memory control unit 8 sets the block b
Is erased (S41). In this case, the memory control unit 8 determines that the system data has been written to the block a (S33).

【0055】前述のS38においてブロックbの新旧表
示フラグ17bがセットされていなれば(S38にてN
O)、メモリ制御部8は、ブロックaの書換終了フラグ
16aがセットされているか否かを調べる(S42)。
書換終了フラグ16aがセットされていれば(S42に
てYES)、メモリ制御部8は、ブロックaからブロッ
クbへのシステムデータの書換処理の途中で、前記図3
のS6の処理が実行される前に動作が中断したと判断す
る。この場合は、ブロックbのシステムデータ領域14
bに書込まれている途中のシステムデータは、そのまま
では不完全なデータであるので、メモリ制御部8は、ブ
ロックbの記憶内容を消去する(S41)。
If the new / old display flag 17b of the block b has not been set in the aforementioned S38 (N in S38)
O), the memory control unit 8 checks whether or not the rewrite end flag 16a of the block a is set (S42).
If the rewrite end flag 16a is set (YES in S42), the memory control unit 8 performs the process shown in FIG. 3 during the process of rewriting the system data from the block a to the block b.
It is determined that the operation is interrupted before the processing of S6 is executed. In this case, the system data area 14 of the block b
Since the system data being written to b is incomplete data as it is, the memory control unit 8 erases the storage contents of the block b (S41).

【0056】そして、メモリ制御部8は、システムデー
タがブロックaに書込まれていると判断し(S33)、
その旨を示す信号を制御部5へ送る。
Then, the memory control unit 8 determines that the system data has been written to the block a (S33),
A signal indicating this is sent to the control unit 5.

【0057】前述のS42において、ブロックaの書換
終了フラグ16aがセットされていなければ(S42に
てNO)、メモリ制御部8は、ブロックbの書換終了フ
ラグ16bがセットされているか否かを調べる(S4
3)。書換終了フラグ16bがセットされていれば(S
43にてYES)、メモリ制御部8は、ブロックbから
ブロックaへのシステムデータの書換処理の途中で、前
記図3のS14の処理が実行される前に動作が中断した
と判断する。この場合は、メモリ制御部8は、ブロック
aのシステムデータ領域14aへ書込まれている途中の
システムデータが不完全なデータであると判断し、ブロ
ックaの記憶内容を消去する(S37)。そして、メモ
リ制御部8は、システムデータがブロックbに書込まれ
ていると判断し(S29)、その旨を示す信号を制御部
5へ送る。
In S42, if the rewrite end flag 16a of the block a is not set (NO in S42), the memory control unit 8 checks whether or not the rewrite end flag 16b of the block b is set. (S4
3). If the rewrite end flag 16b is set (S
At YES in 43), the memory control unit 8 determines that the operation has been interrupted before the processing of S14 in FIG. 3 is executed during the process of rewriting the system data from the block b to the block a. In this case, the memory control unit 8 determines that the system data being written to the system data area 14a of the block a is incomplete data, and erases the stored contents of the block a (S37). Then, the memory control unit 8 determines that the system data has been written to the block b (S29), and sends a signal indicating that to the control unit 5.

【0058】なお、前述のS43において、ブロックb
の書換終了フラグ16bがセットされていないという状
態は、コントローラ1の製造時または設置時にフラッシ
ュメモリ7の初期化処理またはシステムデータの書込処
理が正常に行なわれていない場合に発生する。この場合
には、メモリ制御部8は、ブロックaとブロックbとの
両方の記憶内容を消去し(S44)、両方のブロック
a,bにシステムデータが存在しないという旨を示す信
号を制御部5へ送る。この信号を受けた制御部5は、シ
ステムデータ不在を示すメッセージを使用者に報知す
る。そして、使用者は、このメッセージに対応してシス
テムデータの入力を行なう。
In step S43, the block b
Is not set when the initialization process of the flash memory 7 or the process of writing the system data is not normally performed when the controller 1 is manufactured or installed. In this case, the memory control unit 8 erases the stored contents of both the block a and the block b (S44), and sends a signal indicating that there is no system data to both the blocks a and b. Send to The control unit 5 receiving this signal notifies the user of a message indicating the absence of system data. Then, the user inputs system data in response to this message.

【0059】以上の動作により、システムデータの書換
処理の実行中に異常事態が発生してブロック間の書換処
理が途中で中断された場合であっても、変更前のシステ
ムデータを格納しているブロックを判別することによ
り、コントローラ1が適正なシステムデータを使用する
ことが可能な状態に復旧することができる。
With the above operation, even if an abnormal situation occurs during the execution of the system data rewriting process and the rewriting process between blocks is interrupted in the middle, the system data before the change is stored. By determining the block, the controller 1 can be restored to a state where the appropriate system data can be used.

【0060】前記システムデータ領域14a,14b
より制御用データ記憶領域が構成されている。前記新旧
表示データ領域(フラグ)17a,17bにより第1の
記憶領域が構成されている。前記書換終了データ領域
(フラグ)16a,16bにより第2の記憶領域が構成
されている。前記制御部5により信号生成手段が構成さ
れている。
In the system data areas 14a and 14b ,
Thus, a control data storage area is configured. The old and new display data area (flag) 17a, the first memory area is constituted by 17b. The rewrite completion data area (flag) 16a, a second storage area is constituted by 16b. The signal generating means is constituted by the control unit 5.

【0061】また、前記メモリ制御部8と、このメモリ
制御部8に前述のS6,S14,S8,S16の処理を
行なわせるためのプログラムとにより第1の書換手段が
構成されている。前記メモリ制御部8と、このメモリ制
御部8に前述のS7,S8,S15,S16,S21,
S23の処理を実行させるためのプログラムとにより
2の書換手段が構成されている。
[0061] Further, with the memory controller 8, the first rewrite means is constituted by a program for causing the process of the memory controller 8 of the aforementioned S6, S14, S8, S16. The memory control unit 8 and the above-described S7, S8, S15, S16, S21,
The second rewriting means is constituted by the program for executing the processing of S23 .

【0062】次に、本発明の第2実施例について説明す
る。前述の第1実施例において、たとえば、前記図3に
示したS5またはS13の実行中に異常事態が発生した
場合には、変更前のシステムデータは保存されるが、新
たに書込もうとしていた変更後のシステムデータは失わ
れてしまう。この場合、使用者は、再度、ホームコント
ローラ1に変更後のシステムデータを入力する作業を行
なわなければならない。
Next, a second embodiment of the present invention will be described. In the first embodiment described above, for example, if an abnormal situation occurs during the execution of S5 or S13 shown in FIG. 3, the system data before the change is saved, but a new write is attempted. The changed system data will be lost. In this case, the user has to perform the work of inputting the changed system data to the home controller 1 again.

【0063】ところで、一般にシステムデータは、ホー
ムコントローラの製造時や設置時に専門家によって最初
に入力されてからは、その後、データの一部分が変更さ
れるだけで、その他の部分は変更されないでそのまま用
いられることが多い。したがって、システムデータを変
更するにあたっては、変更後の新たなシステムデータの
全体を入力することなく、その一部を入力することによ
り行なうことができる。本実施例は、この点に着目し、
前述の第1実施例を変形させて、さらに、容易にシステ
ムデータの変更が行なえるようにしたものである。
By the way, generally, after system data is first input by an expert at the time of manufacture or installation of a home controller, only a part of the data is changed, and other parts are used without being changed. Is often done. Therefore, the system data can be changed by inputting a part of the new system data after the change without inputting the whole. The present embodiment focuses on this point,
By modifying the first embodiment, the system data can be easily changed.

【0064】図7は、本実施例によるホームコントロー
ラの構成を示すブロック図である。なお、第1実施例と
同様の機能を有するものについては同一の符号を記して
いる。ホームコントローラ101は、インタフェース部
3と、制御部5と、I/O部6と、メモリ部12と、メ
モリ制御部108とを含む。メモリ部12は、第1実施
例と同様に、第1のメモリ領域9と、第2のメモリ領域
10と、第3のメモリ領域11とを含む。第1のメモリ
領域9と第2のメモリ領域10とは、フラッシュメモリ
7で構成されている。
FIG. 7 is a block diagram showing the configuration of the home controller according to the present embodiment. The components having the same functions as those of the first embodiment are denoted by the same reference numerals. Home controller 101 includes an interface unit 3, a control unit 5, an I / O unit 6, a memory unit 12, and a memory control unit 108. The memory unit 12 includes a first memory area 9, a second memory area 10, and a third memory area 11, as in the first embodiment. The first memory area 9 and the second memory area 10 are configured by the flash memory 7.

【0065】第2のメモリ領域10は、システムデータ
領域14と、書換開始データ領域15と、書換終了デー
タ領域16と、新旧表示データ領域17とを含む。そし
て、本実施例では、第2のメモリ領域10が、さらに、
システムデータのブロック間の書換を行なう際に、変更
部分の書込が完了したことを示すデータを格納するため
の変更終了データ領域18を含む。
The second memory area 10 includes a system data area 14, a rewrite start data area 15, a rewrite end data area 16, and a new / old display data area 17. In the present embodiment, the second memory area 10 further includes
When the system data is rewritten between blocks, it includes a change end data area 18 for storing data indicating that writing of the changed portion is completed.

【0066】図8は、第2のメモリ領域10の構成を示
す模式図である。前述の第1実施例のブロックaとブロ
ックbとの構成に加えて、本実施例では、ブロックaに
変更終了データ領域18aをさらに含ませ、ブロックb
に変更終了データ領域18bをさらに含ませている。
FIG. 8 is a schematic diagram showing the configuration of the second memory area 10. In the present embodiment, in addition to the configuration of the blocks a and b in the first embodiment described above, the block a further includes a change end data area 18a, and the block b
Further includes a change end data area 18b.

【0067】図9,10は、第2実施例におけるホーム
コントローラ101のシステムデータをブロック間の書
換によって変更するときの動作の手順を示すフローチャ
ートである。なお、図9,10において、前述の第1実
施例の前記図3,4に示した処理と同様の処理について
は、同一のステップ番号を示している。また、以下の説
明においては、説明を簡略化するために第1実施例の手
順を変形させた箇所のみを説明する。
FIGS. 9 and 10 are flowcharts showing an operation procedure when the system data of the home controller 101 is changed by rewriting between blocks in the second embodiment. In FIGS. 9 and 10, the same processes as those shown in FIGS. 3 and 4 of the first embodiment have the same step numbers. Further, in the following description, only portions obtained by modifying the procedure of the first embodiment will be described to simplify the description.

【0068】メモリ制御部108は、現在、システムデ
ータがブロックaのシステムデータ領域14aに書込ま
れており、新しいシステムデータをブロックbのシステ
ムデータ領域14bに書込む場合に、ブロックbの書換
開始フラグ15bをセットする(S4)。次に、メモリ
制御部108は、新しいシステムデータに含まれる新た
に変更された部分すなわちブロックaに書込まれている
古いシステムデータと異なる部分のデータのみをブロッ
クbのシステムデータ領域14bに書込む(S45)。
メモリ制御部108は、変更部分の書込処理が終了すれ
ば、ブロックbの変更終了フラグ18bをセットする
(S46)。
When the system data is currently written in the system data area 14a of the block a and the new system data is written in the system data area 14b of the block b, the memory control unit 108 starts rewriting the block b. The flag 15b is set (S4). Next, the memory control unit 108 writes only the newly changed part included in the new system data, that is, the data of the part different from the old system data written in the block a into the system data area 14b of the block b. (S45).
When the writing process of the changed portion is completed, the memory control unit 108 sets the change end flag 18b of the block b (S46).

【0069】次に、メモリ制御部108は、システムデ
ータにおける変更されない部分のデータをブロックbの
システムデータ領域14bに書込む(S47)。メモリ
制御部108は、ブロックbへのシステムデータの変更
されない部分の書込が終了すれば、ブロックaの新旧表
示フラグ17aをセットする(S6)。その後、メモリ
制御部108は、ブロックbの書換終了フラグ16bを
セットする(S7)。そして、メモリ制御部108は、
ブロックaの記憶内容を消去し(S8)、ブロックaか
らブロックbへのシステムデータの書換処理を終了す
る。
Next, the memory control unit 108 writes the data of the unchanged portion in the system data into the system data area 14b of the block b (S47). When the writing of the unchanged portion of the system data to the block b is completed, the memory control unit 108 sets the new / old display flag 17a of the block a (S6). Thereafter, the memory control unit 108 sets the rewrite end flag 16b of the block b (S7). Then, the memory control unit 108
The storage contents of the block a are erased (S8), and the process of rewriting the system data from the block a to the block b is completed.

【0070】一方、現在、システムデータがブロックb
に書込まれており、新しいシステムデータをブロックa
に書込む場合には、メモリ制御部108は、ブロックa
の書換開始フラグ15aをセットする(S12)。そし
て、メモリ制御部108は、システムデータに含まれる
変更部分のデータをブロックaに書込む(S48)。メ
モリ制御部108は、ブロックaへの変更部分の書込が
終了すれば、ブロックaの変更終了フラグ18aをセッ
トする(S49)。次に、メモリ制御部108は、シス
テムデータに含まれる変更されない部分のデータをブロ
ックaのシステムデータ領域14aに書込む(S5
0)。そして、メモリ制御部108は、ブロックaへの
変更されない部分のデータの書込が終了すれば、ブロッ
クbの新旧表示フラグ17bをセットする(S14)。
その後、メモリ制御部108は、ブロックaの書換終了
フラグ16aをセットする(S15)。そして、メモリ
制御部108は、ブロックbの記憶内容を消去し(S1
6)、ブロックbからブロックaへのシステムデータの
書換処理を終了する。
On the other hand, the system data is currently in block b
And new system data is written in block a.
When writing to the block a, the memory control unit 108
The rewriting start flag 15a is set (S12). Then, the memory control unit 108 writes the data of the changed portion included in the system data into the block a (S48). When the writing of the changed portion to the block a is completed, the memory control unit 108 sets the change end flag 18a of the block a (S49). Next, the memory control unit 108 writes the unchanged data included in the system data into the system data area 14a of the block a (S5).
0). Then, when the writing of the data of the unchanged portion to the block a is completed, the memory control unit 108 sets the new / old display flag 17b of the block b (S14).
Thereafter, the memory control unit 108 sets the rewrite end flag 16a of the block a (S15). Then, the memory control unit 108 deletes the storage content of the block b (S1
6) The rewriting process of the system data from the block b to the block a is completed.

【0071】図11,12は、第2実施例におけるホー
ムコントローラ101の復旧時の動作手順を示すフロー
チャートである。前記図9,10と同様に、第1実施例
と異なる部分についてのみ説明する。S38にて、ブロ
ックbの新旧表示フラグ17bがセットされていなけれ
ば(S38にてNO)、メモリ制御部108は、ブロッ
クaの書換終了フラグ16aがセットされているか否か
を調べる(S42)。書換終了フラグ16aがセットさ
れていれば(S42にてYES)、メモリ制御部108
は、前記図9のS6が実行される前に動作が中断したと
判断する。
FIGS. 11 and 12 are flowcharts showing the operation procedure at the time of restoration of the home controller 101 in the second embodiment. As in FIGS. 9 and 10, only the parts different from the first embodiment will be described. If the new / old display flag 17b of the block b is not set in S38 (NO in S38), the memory control unit 108 checks whether or not the rewrite end flag 16a of the block a is set (S42). If rewriting end flag 16a is set (YES in S42), memory control unit 108
Determines that the operation has been interrupted before S6 of FIG. 9 is executed.

【0072】ここで、前述の第1実施例の場合は、メモ
リ制御部8(図1)が、ブロックbに書込んでいる途中
のシステムデータは不完全なデータであると判断して、
ブロックbの記憶内容を消去した。一方、第2実施例の
場合は、メモリ制御部108は、システムデータの変更
部分の書込が完了しているか否かによって、新たに書込
んだシステムデータの変更部分を用いて完全なシステム
データを復元するか、または、システムデータの復旧が
不可能と判断して、ブロックbの記憶内容を消去するか
の2通りの動作を選択的に行なう。
Here, in the case of the first embodiment described above, the memory control unit 8 (FIG. 1) judges that the system data being written to the block b is incomplete data, and
The stored contents of block b were deleted. On the other hand, in the case of the second embodiment, the memory control unit 108 determines whether or not the writing of the changed part of the system data has been completed, by using the changed part of the newly written system data. Or the operation of restoring the system data is determined to be impossible, and the stored contents of the block b are erased.

【0073】メモリ制御部108は、ブロックbの変更
終了フラグ18bがセットされているか否かを調べる
(S51)。変更終了フラグ18bがセットされていれ
ば(S51にてYES)、メモリ制御部108は、ブロ
ックbに変更後のシステムデータに含まれる変更部分の
データの書込処理は完了していると判断する。そして、
メモリ制御部108は、システムデータにおける変更さ
れない部分のデータをブロックaのシステムデータ領域
14aから読出し、ブロックbのシステムデータ領域1
4bに書込む(S53)。
The memory control unit 108 checks whether or not the change end flag 18b of the block b has been set (S51). If the change end flag 18b is set (YES in S51), the memory control unit 108 determines that the writing process of the data of the changed portion included in the changed system data in the block b has been completed. . And
The memory control unit 108 reads the data of the unchanged portion of the system data from the system data area 14a of the block a, and reads the system data area 1 of the block b.
4b (S53).

【0074】メモリ制御部108は、ブロックbへのシ
ステムデータの書込処理が完了すれば、ブロックaの新
旧表示フラグ17aをセットし(S54)、さらに、ブ
ロックbの書換終了フラグ16bをセットする(S5
5)。そして、メモリ制御部108は、ブロックaの記
憶内容を消去し(S56)、ブロックaからブロックb
へのシステムデータの書換処理を終了する。そして、メ
モリ制御部108は、システムデータがブロックbに書
込まれていることを示す信号を制御部5へ送る。
When the process of writing the system data to the block b is completed, the memory control unit 108 sets the new / old display flag 17a of the block a (S54) and further sets the rewrite end flag 16b of the block b. (S5
5). Then, the memory control unit 108 erases the storage content of the block a (S56), and moves from the block a to the block b.
The rewriting process of the system data to is ended. Then, the memory control unit 108 sends a signal to the control unit 5 indicating that the system data has been written to the block b.

【0075】また、前述のS51において、ブロックb
の変更終了フラグ18bがセットされていなければ(S
51にてNO)、メモリ制御部108は、前記図9のS
45の実行中に異常が発生して書込処理が中断されたと
判断する。
In step S51, the block b
If the change end flag 18b is not set (S
NO at 51), the memory control unit 108
It is determined that an error has occurred during execution of step 45 and the writing process has been interrupted.

【0076】本実施例では、フラッシュメモリ7とし
て、8ビットまたは16ビット単位でデータの読出また
は書込を行なうものを用いている。システムデータのデ
ータ長がフラッシュメモリ7の読出/書込の単位と同じ
であれば、データの管理は比較的容易である。しかしな
がら、実際には、システムデータは、端末機器の接続の
有無を示すデータのように1ビットで構成されるものも
あれば、電話番号のように複数バイトを必要とするもの
もある。
In the present embodiment, a flash memory that reads or writes data in units of 8 bits or 16 bits is used. If the data length of the system data is the same as the read / write unit of the flash memory 7, data management is relatively easy. However, in reality, some system data is composed of one bit, such as data indicating the presence or absence of connection of a terminal device, and some data requires a plurality of bytes, such as a telephone number.

【0077】このように、システムデータに含まれるデ
ータの種類によってデータ長が異なっており、システム
データのデータ長がフラッシュメモリ7の読出/書込の
単位より大きいときは、そのデータを書込んでいる途中
で異常が発生し、書込処理が中断された場合には、途中
まで書込まれたデータを使用することはできない。した
がって、メモリ制御部108は、ブロックbの記憶内容
を消去する(S52)。そして、メモリ制御部108
は、システムデータがブロックaに書込まれているとし
(S33)、その旨を示す信号を制御部5へ送る。
As described above, the data length differs depending on the type of data included in the system data, and when the data length of the system data is larger than the read / write unit of the flash memory 7, the data is written. If an error occurs on the way and the writing process is interrupted, the data written halfway cannot be used. Therefore, the memory control unit 108 erases the storage content of the block b (S52). Then, the memory control unit 108
Sends a signal indicating that the system data has been written to the block a to the control unit 5 (S33).

【0078】一方、S42において、ブロックaの書換
終了フラグ16aがセットされていなければ(S42に
てNO)、メモリ制御部108は、ブロックbの書換終
了フラグ16bがセットされているか否かを調べる(S
43)。書換終了フラグ16bがセットされていれば
(S43にてYES)、前記図9のS14が実行する前
に動作が中断したと判断する。この場合、メモリ制御部
108は、続いて、ブロックaの変更終了フラグ18a
がセットされているか否かを調べる(S57)。
On the other hand, if the rewriting end flag 16a of the block a is not set in S42 (NO in S42), the memory control unit 108 checks whether or not the rewriting end flag 16b of the block b is set. (S
43). If the rewrite end flag 16b is set (YES in S43), it is determined that the operation was interrupted before the execution of S14 in FIG. In this case, the memory control unit 108 subsequently changes the end flag 18a of the block a.
It is determined whether or not is set (S57).

【0079】変更終了フラグ18aがセットされていれ
ば(S57にてYES)、メモリ制御部108は、ブロ
ックaにシステムデータの変更部分のデータの書込は完
了していると判断する。そして、メモリ制御部108
は、システムデータの変更されない部分のデータをブロ
ックbのシステムデータ領域14bから読出してブロッ
クaに書込む(S59)。
If change end flag 18a is set (YES in S57), memory control unit 108 determines that writing of the changed part of the system data to block a has been completed. Then, the memory control unit 108
Reads the data of the unchanged part of the system data from the system data area 14b of the block b and writes it to the block a (S59).

【0080】メモリ制御部108は、ブロックaへのす
べてのシステムデータの書込が終了すれば、ブロックb
の新旧表示フラグ17bをセットする(S60)。次
に、メモリ制御部108は、ブロックaの書換終了フラ
グ16aをセットする(S61)。さらに、メモリ制御
部108は、ブロックbの記憶内容を消去し(S6
2)、システムデータの書換処理を終了する。この場
合、メモリ制御部108は、システムデータがブロック
aに書込まれていると判断し(S33)、その旨を示す
信号を制御部5へ送る。
When writing of all system data to block a is completed, memory control unit 108
The old and new display flags 17b are set (S60). Next, the memory control unit 108 sets the rewrite end flag 16a of the block a (S61). Further, the memory control unit 108 deletes the storage content of the block b (S6).
2) End the system data rewriting process. In this case, the memory control unit 108 determines that the system data has been written to the block a (S33), and sends a signal to that effect to the control unit 5.

【0081】また、前述のS57にてブロックaの変更
終了フラグ18aがセットされていなければ(S57に
てNO)、メモリ制御部108は、前記図9のS48の
実行中に異常が発生して、書込が中断されたと判断す
る。この場合は、メモリ制御部108は、ブロックaの
記憶内容を消去する(S58)。そして、メモリ制御部
108は、システムデータがブロックbに書込まれてい
ると判断し(S29)、その旨を示す信号を制御部5へ
送る。
If the change end flag 18a of the block a is not set in S57 (NO in S57), the memory control unit 108 generates an abnormality during the execution of S48 in FIG. It is determined that writing has been interrupted. In this case, the memory control unit 108 deletes the storage content of the block a (S58). Then, the memory control unit 108 determines that the system data has been written to the block b (S29), and sends a signal to that effect to the control unit 5.

【0082】以上説明したように第2実施例によれば、
システムデータの書換処理の実行中に異常が発生し、書
換動作が途中で中断された場合であっても、システムデ
ータに含まれる変更部分の書込処理が完了していれば、
変更されない部分を既存のシステムデータから複写して
変更後のシステムデータの全体を復元する。これによ
り、使用者は、変更後のシステムデータの入力途中また
は入力が完了した後に、停電等の異常が発生して書換処
理が中断した場合であっても、変更部分のデータの書込
処理が完了していれば、再度、変更後のシステムデータ
を入力する必要がなくなり、復旧作業を簡略化すること
ができる。
As described above, according to the second embodiment,
Even if an error occurs during the execution of the system data rewriting process and the rewriting operation is interrupted halfway, if the writing process of the changed part included in the system data has been completed,
The part that is not changed is copied from the existing system data to restore the entire changed system data. As a result, even if an error such as a power failure occurs and the rewriting process is interrupted during the input of the changed system data or after the input is completed, the user can perform the writing process of the changed portion of the data. If it has been completed, it is not necessary to input the changed system data again, and the recovery work can be simplified.

【0083】前記変更終了データ領域(フラグ)18
a,18bにより第3の記憶領域が構成されている。前
記メモリ制御部108と、このメモリ制御部108に前
述のS46,S8,S49,S16の処理を行なわせる
ためのプログラムとにより第3の書換手段が構成されて
いる。前記メモリ制御部108と、このメモリ制御部1
08に前述のS53,S59の処理を実行させるための
プログラムとにより読出書込手段が構成されている。
The change end data area (flag) 18
a, a third storage area is constituted by 18b. And the memory control unit 108, the third rewrite means is constituted by a program for causing the process of the memory control unit 108 of the above S46, S8, S49, S16. The memory control unit 108 and the memory control unit 1
A read / write unit is constituted by a program for executing the processes of S53 and S59 in 08.

【0084】次に、本発明の第3実施例について説明す
る。本実施例では、システムデータに含まれる変更部分
を書込んでいる途中で異常が発生し、書込処理が中断さ
れた場合であっても、異常発生前までに書込まれた変更
データについては、使用可能な有効な状態にするように
ホームコントローラを構成している。
Next, a third embodiment of the present invention will be described. In this embodiment, even if an error occurs during the writing of the changed portion included in the system data and the writing process is interrupted, the changed data written before the occurrence of the error is not The home controller is configured to be in a usable and valid state.

【0085】図13は、第3実施例によるホームコント
ローラ201の構成を示すブロック図である。なお、前
述の第1実施例に示したものと同様の機能を有するもの
については同一の符号を印している。ホームコントロー
ラ201は、インタフェース部3と、制御部5とI/O
部6と、メモリ制御部208と、メモリ部12とを含
む。メモリ部12は、第1実施例と同様に第1のメモリ
領域9と、第2のメモリ領域10と、第3のメモリ領域
11とを含む。第1のメモリ領域9と第2のメモリ領域
10とは、フラッシュメモリ7により構成している。
FIG. 13 is a block diagram showing the configuration of the home controller 201 according to the third embodiment. The components having the same functions as those of the first embodiment are denoted by the same reference numerals. The home controller 201 includes an interface unit 3, a control unit 5, and an I / O
And a memory control unit 208 and a memory unit 12. The memory unit 12 includes a first memory area 9, a second memory area 10, and a third memory area 11, as in the first embodiment. The first memory area 9 and the second memory area 10 are configured by the flash memory 7.

【0086】さらに、第2のメモリ領域10は、システ
ムデータ領域14と、書換開始データ領域15と、書換
終了データ領域16と、新旧表示データ領域17と、変
更終了データ領域18とを含む。さらに、第2のメモリ
領域10は、第3実施例の特徴である変更用データバッ
ファ19を含む。
Further, the second memory area 10 includes a system data area 14, a rewrite start data area 15, a rewrite end data area 16, a new / old display data area 17, and a change end data area 18. Further, the second memory area 10 includes a change data buffer 19 which is a feature of the third embodiment.

【0087】従来は、システムデータの変更を行なう場
合に、プログラムの実行時に作業用の記憶領域として使
用する第3のメモリ領域11に変更部分のデータを書込
んでおき、すべての変更作業が終了した後に、システム
データをまとめてフラッシュメモリ7に書込むようにし
ていた。本実施例では、変更部分のデータを第3のメモ
リ領域11に書込むとともに、変更部分のデータを変更
用データバッファ19にも書込むように構成している。
Conventionally, when the system data is changed, the data of the changed part is written in the third memory area 11 used as a work storage area when the program is executed, and all the change work is completed. After that, the system data is collectively written into the flash memory 7. In the present embodiment, the data of the changed portion is written in the third memory area 11 and the data of the changed portion is also written in the changing data buffer 19.

【0088】図14は、本実施例における第2のメモリ
領域10の構成を示す模式図である。本実施例では、ブ
ロックa,bに前述の第2実施例に示した各種のデータ
領域14a〜18a,14b〜18bに加えて、それぞ
れに変更用データバッファ19a,19bを設けてい
る。
FIG. 14 is a schematic diagram showing the configuration of the second memory area 10 in the present embodiment. In this embodiment, in addition to the various data areas 14a to 18a and 14b to 18b shown in the above-described second embodiment, change data buffers 19a and 19b are provided in the blocks a and b, respectively.

【0089】図15は、ブロックaに設けられている変
更用データバッファ19aの構成を示す模式図である。
なお、ブロックbの変更用データバッファ19bについ
ても同図に示した構成と同様であるので、図示を省略す
る。図15において、変更用データバッファ19aは、
m個の変更データを格納している。各変更データは、各
データを識別するためのデータ番号と、フラッシュメモ
リ7(図13)で扱われるビット長を単位としたデータ
の長さを示すデータサイズと、データとで構成されてい
る。
FIG. 15 is a schematic diagram showing the configuration of the changing data buffer 19a provided in the block a.
The configuration of the change data buffer 19b of the block b is the same as that shown in FIG. In FIG. 15, the change data buffer 19a is
Stores m pieces of change data. Each change data includes a data number for identifying each data, a data size indicating a data length in units of a bit length handled in the flash memory 7 (FIG. 13), and data.

【0090】フラッシュメモリ7は、記憶内容が消去さ
れている状態では、ある一定の状態(通常はHighレ
ベルである)になっている。したがって、変更用データ
バッファ19aに書込がされておらず、未使用状態であ
るときには、変更用データバッファ19aの先頭のデー
タを読出すと、その値は、ある一定値になっている。た
とえば、フラッシュメモリ7が、1語が8ビットであ
り、消去状態がHighレベルになるように構成されて
いる場合には、未使用データの変更用データバッファ1
9aの先頭データの読出値はFFHになる。このような
特性を利用して、本実施例では、変更データが存在する
場合には、そのデータ番号を消去状態のときの一定値以
外の値に設定しておき、データ番号の値によって変更デ
ータの有無が判別できるようにしている。
The flash memory 7 is in a certain state (usually at a high level) when the stored contents are erased. Therefore, when data is not written in the change data buffer 19a and is in an unused state, when the head data of the change data buffer 19a is read, the value becomes a certain constant value. For example, when the flash memory 7 is configured such that one word is 8 bits and the erase state is at the High level, the data buffer 1 for changing unused data is used.
The read value of the first data of 9a is FFH. By utilizing such characteristics, in the present embodiment, when there is change data, the data number is set to a value other than a fixed value in the erased state, and the change data is set according to the value of the data number. Can be determined.

【0091】図16,17は、システムデータをブロッ
ク間の書換処理によって変更する際に、変更部分のデー
タ(以下、「変更データ」という。)を変更用データバ
ッファ19a,19bに書込むためのホームコントロー
ラ201の動作の手順を示すフローチャートである。こ
のフローチャートに示す手順は、1個の変更データにつ
いて1回実行される。前述の第1実施例および第2実施
例と同様に、システムデータの書換状態を示すデータを
フラグとして説明する。
FIGS. 16 and 17 are diagrams for writing data of a changed portion (hereinafter referred to as "change data") to the change data buffers 19a and 19b when the system data is changed by rewriting between blocks. 6 is a flowchart illustrating a procedure of an operation of the home controller 201. The procedure shown in this flowchart is executed once for one piece of change data. As in the first and second embodiments described above, a description will be given using data indicating the rewrite state of system data as a flag.

【0092】始めに、メモリ制御部208が、ブロック
aの書換開始フラグ15aがセットされているか否かを
調べる(S63)。書換開始フラグ15aがセットされ
ていなければ(S63にてNO)、メモリ制御部208
は、次に、ブロックbの書換開始フラグ15bがセット
されているか否かを調べる(S64)。書換開始フラグ
15bがセットされていなければ(S64にてNO)、
メモリ制御部208は、ホームコントローラ201の製
造時または設置時であり、システムデータが第2のメモ
リ領域10に設定されていない状態であると判断する。
この場合には、システムデータの変更処理ではないの
で、メモリ制御部208は、変更用データバッファ19
a,19bへの書込を行なわない。
First, the memory control unit 208 checks whether or not the rewrite start flag 15a of the block a is set (S63). If the rewrite start flag 15a is not set (NO in S63), the memory control unit 208
Checks whether the rewrite start flag 15b of the block b is set (S64). If the rewrite start flag 15b is not set (NO in S64),
The memory control unit 208 determines that the system data is not set in the second memory area 10 when the home controller 201 is manufactured or installed.
In this case, since it is not a system data change process, the memory control unit 208
a, 19b are not written.

【0093】S63において、ブロックaの書換開始フ
ラグ15aがセットされていれば(S63にてYE
S)、メモリ制御部208は、現在、システムデータが
ブロックaに書込まれていると判断する。このときは、
メモリ制御部208は、ブロックaの変更用データバッ
ファ19aに変更データを書込む。以下に変更用データ
バッファ19aへの書込処理の手順について説明する。
In S63, if the rewrite start flag 15a of the block a is set (YE in S63).
S), the memory control unit 208 determines that the system data is currently written in the block a. At this time,
The memory control unit 208 writes the change data into the change data buffer 19a of the block a. The procedure of the writing process to the change data buffer 19a will be described below.

【0094】メモリ制御部208が用いる変数として
は、データ数カウンタnと、データ値Ka(n)と、デ
ータ数サブカウンタjと、データ長カウンタkと、最大
データ容量nMAX とがある。データ数カウンタnは、変
更用データバッファ19aにおける先頭からのデータ数
を示すものである。そして、データ値Ka(n)は、変
更用データバッファ19aにおけるn番目のデータの値
を示す。また、データ数サブカウンタjは、データ数カ
ウンタnの値を別途加算するためのカウンタである。ま
た、データ長カウンタkは、変更データのデータ長を代
入するための変数である。
The variables used by the memory control unit 208 include a data number counter n, a data value Ka (n), a data number sub-counter j, a data length counter k, and a maximum data capacity n MAX . The data number counter n indicates the number of data from the head in the change data buffer 19a. The data value Ka (n) indicates the value of the n-th data in the change data buffer 19a. The data number sub-counter j is a counter for separately adding the value of the data number counter n. The data length counter k is a variable for substituting the data length of the change data.

【0095】始めに、メモリ制御部208は、変更用デ
ータバッファ19aの未使用領域を探す。メモリ制御部
208は、データ数カウンタnに1をセットする(S7
5)。次にメモリ制御部208は、Ka(n)の値を調
べる。このときのKa(n)の値は、変更用データバッ
ファ19aにおける先頭の変更データのデータ番号であ
る。メモリ制御部208は、前述したように読出したデ
ータ番号の値によって、その変更データの領域が使用状
態か未使用状態かを判別する(S76)。読出したデー
タ番号の値によりその領域が使用状態であると判定され
れば(S76にてNO)、メモリ制御部208は、次の
変更データのデータ番号を調べるために、データ数カウ
ンタnの値を式(1)に従って更新する(S77)。
First, the memory control unit 208 searches for an unused area of the change data buffer 19a. The memory control unit 208 sets 1 to the data number counter n (S7).
5). Next, the memory control unit 208 checks the value of Ka (n). The value of Ka (n) at this time is the data number of the first change data in the change data buffer 19a. The memory control unit 208 determines whether the area of the changed data is the used state or the unused state based on the value of the read data number as described above (S76). If it is determined that the area is in use according to the read data number value (NO in S76), memory control unit 208 determines the value of data number counter n to check the data number of the next change data. Is updated according to the equation (1) (S77).

【0096】 n←n+Ka(n+1)+2 …(1)N ← n + Ka (n + 1) +2 (1)

【0097】式(1)において、右辺のnは現時点での
変更用データバッファにおけるデータ数(アドレス)で
あり、記憶領域としては変更データのデータ番号の位置
を示している。このnにその変更データのデータサイズ
であるKa(n+1)を加算する。
In the equation (1), n on the right side is the current number of data (address) in the change data buffer, and the storage area indicates the position of the data number of the change data. Ka (n + 1) which is the data size of the changed data is added to n.

【0098】さらに、データサイズを格納している領域
のアドレスの部位として1を加算し、次に、カウンタを
次の変更データのデータ番号のアドレスを示すようにす
るために1を加算する。したがって、前回の変更データ
のデータ番号を示すアドレスから次回の変更データのデ
ータ番号を示すアドレスを計算するためには、式(1)
に記載した計算式に従ってデータ数カウンタnを更新す
る。このようにして、メモリ制御部208は、変更用デ
ータバッファ19aの未使用領域が見つかるまで、S7
6とS77とを繰返す。
Further, 1 is added as the address part of the area storing the data size, and then 1 is added so that the counter indicates the address of the data number of the next change data. Therefore, to calculate the address indicating the data number of the next change data from the address indicating the data number of the previous change data, the formula (1) is used.
The data number counter n is updated according to the calculation formula described in. In this manner, the memory control unit 208 proceeds to S7 until an unused area of the change data buffer 19a is found.
6 and S77 are repeated.

【0099】メモリ制御部208は、未使用領域が見つ
かれば(S76にてYES)、変更用データバッファ1
9aに変更データが書込めるだけの空き領域があるか否
かを調べる。すなわち、メモリ制御部208は、データ
数サブカウンタjにn+1をセットし、データ長カウン
タkに変更データのデータ長をセットする(S78)。
そして、メモリ制御部208は、変更データ書込後のデ
ータ数j+kが変更用データバッファ19aの最大デー
タ容量nMAX を越えないか否かを調べる(S79)。
If an unused area is found (YES in S76), memory control section 208 changes data buffer 1
It is checked whether or not 9a has a free area in which the change data can be written. That is, the memory control unit 208 sets n + 1 in the data number sub-counter j and sets the data length of the changed data in the data length counter k (S78).
Then, the memory control unit 208 checks whether or not the number of data j + k after writing the change data does not exceed the maximum data capacity n MAX of the change data buffer 19a (S79).

【0100】メモリ制御部208は、データ数j+kが
最大データ容量nMAX を越えるならば(S79にてN
O)、これ以上は変更用データバッファ19aに変更デ
ータを書込めないと判断し、この時点で、第2実施例に
示したブロック間の書換処理と同様に、前記図9,10
に示した処理手順によって、ブロックaからブロックb
へのシステムデータの書換処理を行なう(S84)。S
84の処理が終わればメモリ制御部208は、手順をS
63に戻し、変更データについての処理を実行する。
If the number of data j + k exceeds the maximum data capacity n MAX (N in S79),
O), it is determined that the change data cannot be written to the change data buffer 19a any more, and at this time, as in the rewrite process between the blocks shown in the second embodiment, FIGS.
According to the processing procedure shown in FIG.
The system data is rewritten to (S84). S
When the process of 84 is completed, the memory control unit 208 proceeds to S
The process returns to 63, and the process for the changed data is executed.

【0101】メモリ制御部208は、データ数j+kが
最大データ容量nMAX より小さく、変更データの書込が
可能であると判断すれば(S79にてYES)、変更デ
ータのデータ長を変更用データバッファ19aに書込む
(S80)。次に、メモリ制御部208は、変更データ
の内容を変更用データバッファ19aに書込む(S8
1,S82)。このとき、書込データのi番目のデータ
を変更用データバッファ19aのデータ値Ka(j)に
セットし、データ数の変数jと書込データの番号iとを
1ずつ加算し、iがkよりも大きくなった時点で、次の
処理へ進む。次に、メモリ制御部208は、変更データ
のデータ番号をデータ値Ka(n)にセットし、データ
番号を変更用データバッファ19aに書込む(S8
3)。
If memory control unit 208 determines that the number of data j + k is smaller than maximum data capacity n MAX and it is possible to write changed data (YES in S79), it changes the data length of the changed data to the changing data. Writing to the buffer 19a (S80). Next, the memory control unit 208 writes the contents of the change data into the change data buffer 19a (S8).
1, S82). At this time, the i-th data of the write data is set to the data value Ka (j) of the change data buffer 19a, and the variable j of the number of data and the number i of the write data are added by one, and i When it becomes larger, the process proceeds to the next process. Next, the memory control unit 208 sets the data number of the change data to the data value Ka (n), and writes the data number to the change data buffer 19a (S8).
3).

【0102】このように、メモリ制御部208は、処理
の最後にデータ番号を書込むので、S80〜S82の実
行の途中で異常事態が発生し、変更用データバッファ1
9aに書込まれたデータが不完全な状態となった場合
は、データ番号が変更用データバッファ19aに書込ま
れない。したがって、以降の処理においてデータ番号を
読出してその値を判定することにより、異常事態によっ
て不完全になった書込データを無効にすることができ
る。
As described above, since the memory control unit 208 writes the data number at the end of the processing, an abnormal situation occurs during the execution of S80 to S82, and the change data buffer 1
If the data written to 9a is incomplete, the data number is not written to the change data buffer 19a. Therefore, by reading the data number and determining the value in the subsequent processing, the incomplete write data due to the abnormal situation can be invalidated.

【0103】一方、S64にてブロックbの書換開始フ
ラグ15bがセットされていれば(S64にてYE
S)、メモリ制御部208は、現在、システムデータが
ブロックbに書込まれていると判断し、ブロックbの変
更用データバッファ19bに変更データを書込む処理を
行なう。なお、変更用データバッファ19bに変更デー
タを書込むときの処理手順は、上述した変更用データバ
ッファ19aと同様であり、上述のS75〜S83が、
変更用データバッファ19bの処理であるS65〜S7
3にそれぞれ対応する。そして、変更用データバッファ
19aにおけるデータの値を示す変数Kaが変更用デー
タバッファ19bでは、変数Kbとして示されている。
なお、変更用データバッファ19bに変更データを書込
む際の詳細な処理手順については説明を省略する。
On the other hand, if the rewrite start flag 15b of the block b is set in S64 (YE in S64).
S), the memory control unit 208 determines that the system data is currently written in the block b, and performs a process of writing the change data to the change data buffer 19b of the block b. The processing procedure for writing the change data to the change data buffer 19b is the same as that for the change data buffer 19a described above.
S65 to S7 which are the processing of the change data buffer 19b
3 respectively. The variable Ka indicating the value of the data in the change data buffer 19a is indicated as the variable Kb in the change data buffer 19b.
The detailed processing procedure when writing the change data to the change data buffer 19b will not be described.

【0104】以上の処理ですべての変更データが変更用
データバッファ19aまたは変更用データバッファ19
bに書込まれれば、それらのデータをS84,S74に
示したブロック間の書換処理と同様の手順によって、ブ
ロックbまたはブロックaに書込む。
In the above processing, all the changed data are stored in the changing data buffer 19a or the changing data buffer 19.
If the data is written to block b, the data is written to block b or block a by the same procedure as the rewriting process between blocks shown in S84 and S74.

【0105】図17,18は、ホームコントローラ20
1の復旧時の動作手順を示すフローチャートである。こ
のフローチャートは、前記図17,18に示したシステ
ムデータの書込処理中に異常事態が発生した場合の復旧
時の処理を示し、前記図11,12に示した第2実施例
の処理手順を変更用データバッファ19a,19bを用
いて変形させたものである。前記図11,12と同様の
処理内容については、同一のステップ番号を示してい
る。なお、以下の説明では前記図11,12の構成と異
なる部分についてのみ説明する。
FIGS. 17 and 18 show the home controller 20.
7 is a flowchart showing an operation procedure at the time of restoration of the first embodiment. This flowchart shows the processing at the time of recovery when an abnormal situation occurs during the writing processing of the system data shown in FIGS. 17 and 18. The processing procedure of the second embodiment shown in FIGS. This is modified using the change data buffers 19a and 19b. The same processing contents as those in FIGS. 11 and 12 have the same step numbers. In the following description, only portions different from the configurations of FIGS. 11 and 12 will be described.

【0106】メモリ制御部208は、S27にてシステ
ムデータがブロックbに書込まれていると判断した場合
は(S27にてYES)、ブロックbの変更用データバ
ッファ19bに変更用データが書込まれているか否かを
調べる(S85)。メモリ制御部208は、変更用デー
タバッファ19bにデータが書込まれていれば(S85
にてNO)、前記図16,17に示したフローチャート
においてブロックbの変更用データバッファ19bに変
更データを書込んでいる途中で動作が中断したと判断す
る。この場合、メモリ制御部208は、新しいシステム
データをブロックaに書込まなければならないと判断す
る。
If memory control unit 208 determines in S27 that the system data has been written to block b (YES in S27), the change data is written to change data buffer 19b of block b. It is checked whether or not it has been set (S85). If data has been written in the change data buffer 19b (S85)
NO), it is determined in the flowcharts shown in FIGS. 16 and 17 that the operation was interrupted while the change data was being written to the change data buffer 19b of the block b. In this case, the memory control unit 208 determines that new system data must be written to the block a.

【0107】そして、メモリ制御部208は、ブロック
aの記憶内容が消去されているか否かを調べ(S8
6)、ブロックaの記憶内容が消去されていなければ
(S86にてNO)、ブロックaの記憶内容を消去する
(S87)。次に、メモリ制御部208は、ブロックa
の書換開始フラグ15aをセットする(S88)。そし
て、メモリ制御部208は、変更用データバッファ19
bに書込まれた変更データをブロックaに書込み(S9
5)、変更終了フラグ18aをセットする(S96)。
Then, the memory control unit 208 checks whether or not the storage contents of the block a have been erased (S8).
6) If the stored content of block a has not been deleted (NO in S86), the stored content of block a is deleted (S87). Next, the memory control unit 208
The rewriting start flag 15a is set (S88). Then, the memory control unit 208 sends the change data buffer 19
Write the changed data written in block b to block a (S9).
5) The change end flag 18a is set (S96).

【0108】次に、メモリ制御部208は、システムデ
ータの中で変更されない部分のデータとしてブロックb
のシステムデータ領域に書込まれているデータを読出
し、そのデータをブロックaのシステムデータ領域に書
込む(S59)。
Next, the memory control unit 208 determines that the block b
The data written in the system data area is read, and the data is written in the system data area of block a (S59).

【0109】メモリ制御部208は、ブロックaへのシ
ステムデータの書込が終了すれば、ブロックbの新旧表
示フラグ17bをセットし(S60)、その後、ブロッ
クaの書換終了フラグ16aをセットする(S61)。
メモリ制御部208は、最後に、ブロックbの内容を消
去し(S62)、システムデータの書換処理を終了す
る。この場合、メモリ制御部208は、システムデータ
がブロックaに書込まれているとし(S33)、その旨
を示す信号を制御部5へ送る。
When the writing of the system data to the block a is completed, the memory control unit 208 sets the new / old display flag 17b of the block b (S60), and then sets the rewriting end flag 16a of the block a (S60). S61).
Finally, the memory control unit 208 erases the contents of the block b (S62), and ends the system data rewriting process. In this case, the memory control unit 208 determines that the system data has been written to the block a (S33), and sends a signal to that effect to the control unit 5.

【0110】メモリ制御部208は、S31にて、シス
テムデータがブロックaに書込まれていると判断した場
合は(S31にてYES)、ブロックaにある変更用デ
ータバッファ19aに変更用データが書込まれているか
否かを調べる(S89)。変更用データがブロックaに
書込まれていれば(S89にてNO)、メモリ制御部2
08は、前記図16,17に示した処理手順において、
ブロックaの変更用データバッファ19aに変更データ
を書込んでいる途中で動作が中断したと判断する。この
場合、メモリ制御部208は、新しいシステムデータを
ブロックbに書込まなければならないと判断する。
If the memory control unit 208 determines in S31 that the system data has been written to the block a (YES in S31), the change data is stored in the change data buffer 19a in the block a. It is checked whether or not the data has been written (S89). If the change data has been written to block a (NO in S89), memory control unit 2
08 is the processing procedure shown in FIGS.
It is determined that the operation has been interrupted while the change data is being written to the change data buffer 19a of the block a. In this case, the memory control unit 208 determines that new system data must be written to the block b.

【0111】次に、メモリ制御部208は、ブロックb
の記憶内容が消去されているか否かを調べ(S90)、
消去されていない場合は(S90にてNO)、ブロック
bの記憶内容を消去する(S91)。その後、メモリ制
御部208は、ブロックbの書換開始フラグ15bをセ
ットする(S92)。続いて、メモリ制御部208は、
変更用データバッファ19aに書込まれた変更データを
ブロックbに書込み(S93)、変更終了フラグ18b
をセットする(S94)。
Next, the memory control unit 208 sets the block b
It is determined whether or not the stored contents of (S90) have been deleted (S90).
If it has not been erased (NO in S90), the storage contents of block b are erased (S91). Thereafter, the memory control unit 208 sets the rewrite start flag 15b of the block b (S92). Subsequently, the memory control unit 208
The change data written in the change data buffer 19a is written in the block b (S93), and the change end flag 18b
Is set (S94).

【0112】次に、メモリ制御部208は、システムデ
ータの中の変更されない部分のデータをブロックaのシ
ステムデータ領域14aから読出して、ブロックbのシ
ステムデータ領域14bに書込む(S53)。
Next, the memory control unit 208 reads the data of the unchanged portion of the system data from the system data area 14a of the block a, and writes it in the system data area 14b of the block b (S53).

【0113】メモリ制御部208は、ブロックbへのシ
ステムデータの書込が終了すれば、ブロックaの新旧表
示フラグ17aをセットし(S54)、その後、ブロッ
クbの書換終了フラグ16bをセットする(S55)。
そして、メモリ制御部208は、最後にブロックaの内
容を消去して(S56)、システムデータの書換処理を
終了する。この場合、メモリ制御部208は、システム
データがブロックbに書込まれているとし(S29)、
その旨を示す信号を制御部5へ送る。
When the writing of the system data to the block b is completed, the memory control unit 208 sets the new / old display flag 17a of the block a (S54), and then sets the rewrite end flag 16b of the block b (S54). S55).
Then, the memory control unit 208 finally erases the contents of the block a (S56), and ends the system data rewriting process. In this case, the memory control unit 208 determines that the system data has been written to the block b (S29),
A signal indicating this is sent to the control unit 5.

【0114】メモリ制御部208は、S42にてブロッ
クaの書換終了フラグ16aがセットされているか否か
を調べる。メモリ制御部208は、書換終了フラグ16
aがセットされていれば(S42にてYES)、ブロッ
クaからブロックbへのシステムデータの書換処理の途
中で前記図9のS6の実行前に動作が中断したと判断す
る。
The memory control unit 208 checks in S42 whether the rewrite end flag 16a of the block a is set. The memory control unit 208 sets the rewrite end flag 16
If a is set (YES in S42), it is determined that the operation was interrupted before the execution of S6 in FIG. 9 during the process of rewriting the system data from block a to block b.

【0115】この場合、メモリ制御部208は、ブロッ
クbの変更終了フラグ18bがセットされているか否か
を調べる(S51)。メモリ制御部208は、変更終了
フラグ18bがセットされていなければ(S51にてN
O)、ブロックbに変更データを書込んでいる途中で前
記図9のS45の処理が実行されている途中で異常が発
生し、書込動作が中断されたと判断する。この場合、変
更用データバッファ19aに書込まれた変更データの一
部は、既にブロックbに書込まれているので、メモリ制
御部208は、ブロックbに書込まれていない変更デー
タを変更用データバッファ19aから探してブロックb
に書込む(S93)。
In this case, the memory control unit 208 checks whether or not the change end flag 18b of the block b is set (S51). If the change end flag 18b is not set (NO in S51)
O) It is determined that an abnormality has occurred while the process of S45 in FIG. 9 is being executed while the change data is being written to the block b, and the writing operation has been interrupted. In this case, since a part of the change data written in the change data buffer 19a has already been written in the block b, the memory control unit 208 replaces the change data not written in the block b with the change data. Block b searched from data buffer 19a
(S93).

【0116】その後、メモリ制御部208は、変更終了
フラグ18bをセットする(S94)。次に、メモリ制
御部208は、システムデータに含まれる変更されない
部分のデータをブロックaから読出してブロックbに書
込む(S53)。メモリ制御部208は、ブロックbへ
のすべてのシステムデータの書込が終了すれば、ブロッ
クaの新旧表示フラグ17aをセットし(S54)、そ
の後、ブロックbの書換終了フラグ16bをセットする
(S55)。最後に、メモリ制御部208は、ブロック
aの記憶内容を消去して(S56)、システムデータの
書換処理を終了する。この場合、メモリ制御部208
は、システムデータがブロックbに書込まれているとし
(S29)、その旨を示す信号を制御部5へ送る。
Thereafter, the memory control unit 208 sets the change end flag 18b (S94). Next, the memory control unit 208 reads the data of the unchanged portion included in the system data from the block a and writes it to the block b (S53). When the writing of all the system data to the block b is completed, the memory control unit 208 sets the new / old display flag 17a of the block a (S54), and then sets the rewrite end flag 16b of the block b (S55). ). Finally, the memory control unit 208 erases the storage content of the block a (S56), and ends the system data rewriting process. In this case, the memory control unit 208
Sends a signal indicating that the system data has been written to the block b to the control unit 5 (S29).

【0117】メモリ制御部208は、S42にてブロッ
クaの書換終了フラグ16aがセットされていなければ
(S42にてNO)、ブロックbの書換終了フラグ16
bがセットされているか否かを調べる(S43)。メモ
リ制御部208は、書換終了フラグ16bがセットされ
ていれば(S43にてYES)、ブロックbからブロッ
クaへのシステムデータの書換途中で前記図9のS14
の実行前に動作が中断したと判断する。
If the rewrite end flag 16a of the block a is not set in S42 (NO in S42), the memory control unit 208 sets the rewrite end flag 16 of the block b.
It is checked whether or not b is set (S43). If the rewrite end flag 16b has been set (YES in S43), the memory control unit 208 proceeds to S14 in FIG. 9 during the rewriting of the system data from block b to block a.
It is determined that the operation has been interrupted before the execution of.

【0118】この場合、メモリ制御部208は、ブロッ
クaの変更終了フラグ18aがセットされているか否か
を調べる(S57)。メモリ制御部208は、変更終了
フラグ18aがセットされていなければ(S57にてN
O)、ブロックaに変更データを書込んでいる途中で前
記図9のS48の実行途中で異常が発生し、書込動作が
中断されたと判断する。変更用データバッファ19bに
書込まれた変更データの一部は、既にブロックaに書込
まれているので、メモリ制御部208は、ブロックaに
書込まれていない変更データを探し、そのデータをブロ
ックaに書込む(S95)。
In this case, the memory control unit 208 checks whether or not the change end flag 18a of the block a has been set (S57). If the change end flag 18a is not set (NO in S57)
O) It is determined that an error has occurred during the execution of S48 in FIG. 9 while the change data is being written to the block a, and the write operation has been interrupted. Since a part of the change data written in the change data buffer 19b has already been written in the block a, the memory control unit 208 searches for the change data not written in the block a, and Write to block a (S95).

【0119】その後、メモリ制御部208は、ブロック
aの変更終了フラグ18aをセットする(S96)。次
に、メモリ制御部208は、システムデータに含まれる
変更されない部分のデータをブロックbから読出し、ブ
ロックaに書込む(S59)。メモリ制御部208は、
ブロックaへのシステムデータの書込が完了すれば、ブ
ロックbの新旧表示フラグ17bをセットし(S6
0)、その後、ブロックaの書換終了フラグ16aをセ
ットする(S61)。そして、メモリ制御部208は、
最後にブロックbの記憶内容を消去して(S62)、シ
ステムデータの書換処理を終了する。この場合、メモリ
制御部208は、システムデータがブロックaに書込ま
れているとし(S33)、その旨を示す信号を制御部5
へ送る。
Thereafter, the memory control unit 208 sets the change end flag 18a of the block a (S96). Next, the memory control unit 208 reads the data of the unchanged portion included in the system data from the block b and writes it into the block a (S59). The memory control unit 208
When the writing of the system data to the block a is completed, the new / old display flag 17b of the block b is set (S6).
0) Then, the rewriting end flag 16a of the block a is set (S61). Then, the memory control unit 208
Finally, the storage contents of the block b are erased (S62), and the system data rewriting process ends. In this case, the memory control unit 208 determines that the system data has been written to the block a (S33), and sends a signal indicating this to the control unit 5
Send to

【0120】以上説明したように第3実施例によれば、
システムデータの書換処理の実行中に異常事態が発生し
てフラッシュメモリ7のブロック間の書換処理が途中で
中断された場合であっても、変更用データバッファに書
込まれた変更データが使用できる状態であれば、そのデ
ータを用いてシステムデータ全体を復元することが可能
である。したがって、異常事態に対応するために使用者
が行なう復旧作業が軽減できる。
As described above, according to the third embodiment,
Even if an abnormal situation occurs during execution of the system data rewriting process and the rewriting process between the blocks of the flash memory 7 is interrupted on the way, the changed data written in the changing data buffer can be used. If so, it is possible to restore the entire system data using that data. Therefore, the recovery work performed by the user in response to an abnormal situation can be reduced.

【0121】前記変更用データバッファ19a,19b
によりデータバッファ領域が構成されている。前記メモ
リ制御部208と、このメモリ制御部208に前記図1
6,17のフローチャートに示した処理を実行させるた
めのプログラムとによりバッファ書込手段が構成されて
いる。
The change data buffers 19a and 19b
Form a data buffer area. The memory control unit 208 and the memory control unit 208 shown in FIG.
A buffer writing unit is configured by a program for executing the processes shown in the flowcharts of FIGS.

【0122】また、前記メモリ制御部208と、このメ
モリ制御部208に変更用データバッファ19aまたは
変更用データバッファ19bに書込まれたデータをブロ
ック間の書換処理と同様の手順によってブロックbまた
はブロックaに書込む処理を実行させるためのプログラ
とによりバッファ読出手段が構成されている。前記メ
モリ制御部208と、このメモリ制御部208に前述の
S93,S95の処理を実行させるためのプログラム
により部分読出書込手段が構成されている。
The memory control unit 208 and the data written in the data buffer 19a for change or the data buffer 19b for change in the memory control unit 208 are written in the block b or the block by the same procedure as the rewriting process between the blocks. The buffer reading means is constituted by a program for executing the process of writing into a. And the memory control unit 208, a program for causing the memory control unit 208 executes the above-described processing of S93, S95
Partial reading writing means is constituted by.

【0123】[0123]

【発明の効果】以上説明したように、請求項1記載の発
明によれば、不揮発性のメモリからなる制御用データ記
憶手段に格納され、家庭用機器を制御するための制御用
データを、新たにデータを書込むことにより変更する。
制御用データ記憶手段は、2つのブロックを含み、その
2つのブロックのうち既存の制御用データを格納してい
一方のブロックとは異なる他方のブロックに新たな制
御用データを書込む2つのブロックの制御用データ記
憶領域のそれぞれの書込状態は、第1の記憶領域と第2
の記憶領域とにそれぞれ格納されている第1のデータと
第2のデータとによって判別することができる。したが
って、制御用データの変更処理の途中で、停電等の異常
が発生し、変更処理が中断した場合であっても、その復
旧時に、第1のデータと第2のデータに基づいて2つの
ブロックのうちのいずれのブロックに格納されている制
御用データを用いるべきかを判定することが可能とな
る。
As described above, according to the first aspect of the present invention, the control data for controlling the home appliances stored in the control data storage means comprising a nonvolatile memory is newly stored. Change by writing data to
The control data storage means includes two blocks, and writes new control data to another block of the two blocks that is different from the one that stores the existing control data . Data record for control of two blocks
Each write state of 憶領zone, the first storage area and a second
Can be determined by the first data and the second data stored in the respective storage areas . Therefore, even if an abnormality such as a power failure occurs during the process of changing the control data and the change process is interrupted, two blocks based on the first data and the second data are restored upon recovery. It is possible to determine which of the blocks should use the control data stored in it.

【0124】請求項2記載の発明によれば、制御用デー
タに含まれる予め定められた一部のデータの書込が完了
したか否かを第3のデータによって判別することがで
き、また、その予め定められた一部のデータを除く他の
部分のデータを他方のブロックから読出して当該ブロッ
クに書込むことができる。したがって、新たな制御用デ
ータを制御用データ記憶手段に書込んで、制御用データ
を変更する場合には、制御用データのうちの一部のデー
タを書込手段によって書込み、他の部分のデータを既存
の制御用データを格納している他方のブロックから読出
すことにより、新たな制御用データの全体を書込むこと
ができる。また、停電等の異常が発生し、制御用データ
の変更処理が中断された場合であっても、処理が中断し
た時点で、予め定められた一部のデータの書込が完了し
ていれば、既存の制御用データから書込が完了した部分
を除く他の部分を読出して書込むことにより、予め定め
られた一部のデータを再度書込む処理を行なうことな
く、新たな制御用データを制御用データ記憶手段に書込
むことができる。
According to the second aspect of the present invention, it is possible to determine from the third data whether or not the writing of a part of the predetermined data included in the control data is completed. Except for the predetermined part of the data, the other part of the data can be read from the other block and written to the other block. Therefore, when writing new control data into the control data storage means and changing the control data, a part of the control data is written by the writing means and the other part of the data is written. Is read from the other block storing the existing control data, whereby the whole of the new control data can be written. Further, even if an abnormality such as a power failure occurs and the process of changing the control data is interrupted, at the time when the process is interrupted, if the writing of some predetermined data is completed. By reading and writing other portions of the existing control data except for the portion for which writing has been completed, new control data can be written without performing a process of writing predetermined data again. It can be written in the control data storage means.

【0125】請求項3記載の発明によれば、新たに制御
用データを制御用データ記憶手段に書込む際に、一旦、
制御用データをデータバッファ領域に書込み、その書込
んだデータを読出してブロックに書込む。この方法によ
り、実際の制御用データの書換の前に、制御用データの
書換に必要なデータを制御用データ記憶手段の他の領域
に前もって書込んでおくことができ、実際の書換がスム
ーズに行える。また、仮に書換時に何らかの異常が発生
して中断した場合でも、データバッファ領域にデータを
書込んだ後であれば、そのデータを用いて制御用データ
の書換の継続を容易に行うことができる。
According to the third aspect of the present invention, when new control data is written into the control data storage means,
The control data is written into the data buffer area, and the written data is read and written into the block. By this method
Before the actual rewriting of the control data,
The data necessary for rewriting is stored in another area of the control data storage means.
Can be written in advance, and the actual rewriting is
Can be done Also, if something abnormal occurs during rewriting
Even if interrupted by
After writing, use that data to control data
Can be easily rewritten.

【0126】請求項4記載の発明によれば、制御用デー
タのうちの他方のブロックに書込まれた部分を除く部分
を一方のブロックのデータバッファ領域から読出して他
方のブロックの制御用データ記憶領域に書込むための手
段を設けたので、停電等の異常が発生し、書込手段によ
る書込動作が中断された場合であっても、一方のデータ
バッファ領域に書込まれたデータは、以降の処理におい
て用いることが可能な状態に自動的にすることができ
る。
According to the fourth aspect of the present invention, the control data
Excluding the portion written to the other block of the data
From the data buffer area of one block and
For writing to the control data storage area of the other block
Because of the provision of a step, an error such as a power failure
Even if the write operation is interrupted,
The data written in the buffer area will be used in subsequent processing.
Can be automatically used and ready to use
You.

【0127】請求項5記載の発明によれば、2つのブロ
ックが個別に一括消去可能なメモリ上に設けられている
ので、制御用データを新たにブロックに書込む前など、
必要なときに、そのブロックの記憶領域に格納されてい
る既存の制御用データを一括して消去することができ
る。また、そのブロックの第1のデータ、第2のデータ
および第3のデータについても第1の値に同時に一度に
クリアできる。
According to the fifth aspect of the present invention, two blocks
Locks are provided on a memory that can be individually and collectively erased.
So before writing new control data to the block,
When necessary, it is stored in the block's storage area.
Existing control data can be erased collectively.
You. Also, the first data and the second data of the block
And the third data at the same time as the first value
I can clear it.

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

【図1】本発明の第1実施例によるホームコントローラ
の構成を示すブロック図である。
FIG. 1 is a block diagram showing a configuration of a home controller according to a first embodiment of the present invention.

【図2】第1実施例によるホームコントローラのメモリ
領域の構成を示す模式図である。
FIG. 2 is a schematic diagram showing a configuration of a memory area of a home controller according to the first embodiment.

【図3】第1実施例においてシステムデータをブロック
間の書換処理によって変更するときのホームコントロー
ラの動作の手順を示すフローチャートである。
FIG. 3 is a flowchart showing a procedure of an operation of a home controller when the system data is changed by a rewriting process between blocks in the first embodiment.

【図4】第1実施例においてシステムデータをブロック
間の書換処理によって変更するときのホームコントロー
ラの動作の手順を示すフローチャートである。
FIG. 4 is a flowchart showing a procedure of an operation of the home controller when the system data is changed by a rewriting process between blocks in the first embodiment.

【図5】第1実施例においてホームコントローラの復旧
時の動作の手順を示すフローチャートである。
FIG. 5 is a flowchart illustrating a procedure of an operation when the home controller is restored in the first embodiment.

【図6】第1実施例においてホームコントローラの復旧
時の動作の手順を示すフローチャートである。
FIG. 6 is a flowchart illustrating a procedure of an operation when the home controller is restored in the first embodiment.

【図7】本発明の第2実施例によるホームコントローラ
の構成を示すブロック図である。
FIG. 7 is a block diagram illustrating a configuration of a home controller according to a second embodiment of the present invention.

【図8】第2実施例によるホームコントローラのメモリ
領域の構成を示す模式図である。
FIG. 8 is a schematic diagram illustrating a configuration of a memory area of a home controller according to a second embodiment.

【図9】第2実施例においてシステムデータをブロック
間の書換処理によって変更するときのホームコントロー
ラの動作の手順を示すフローチャートである。
FIG. 9 is a flowchart showing a procedure of an operation of the home controller when the system data is changed by rewriting between blocks in the second embodiment.

【図10】第2実施例においてシステムデータをブロッ
ク間の書換処理によって変更するときのホームコントロ
ーラの動作の手順を示すフローチャートである。
FIG. 10 is a flowchart illustrating a procedure of an operation of the home controller when the system data is changed by rewriting between blocks in the second embodiment.

【図11】第2実施例においてホームコントローラの復
旧時の動作の手順を示すフローチャートである。
FIG. 11 is a flowchart illustrating a procedure of an operation when a home controller is restored in the second embodiment.

【図12】第2実施例においてホームコントローラの復
旧時の動作の手順を示すフローチャートである。
FIG. 12 is a flowchart illustrating a procedure of an operation when a home controller is restored in the second embodiment.

【図13】本発明の第3実施例によるホームコントロー
ラの構成を示すブロック図である。
FIG. 13 is a block diagram illustrating a configuration of a home controller according to a third embodiment of the present invention.

【図14】第3実施例によるホームコントローラのメモ
リ領域の構成を示す模式図である。
FIG. 14 is a schematic diagram illustrating a configuration of a memory area of a home controller according to a third embodiment.

【図15】第3実施例による変更用データバッファの構
成を示す模式図である。
FIG. 15 is a schematic diagram illustrating a configuration of a change data buffer according to a third embodiment.

【図16】第3実施例においてシステムデータをブロッ
ク間の書換処理によって変更するときに変更データを変
更用データバッファに書込むためのホームコントローラ
の動作の手順を示すフローチャートである。
FIG. 16 is a flowchart showing a procedure of an operation of a home controller for writing changed data to a changing data buffer when changing system data by rewriting processing between blocks in the third embodiment.

【図17】第3実施例においてシステムデータをブロッ
ク間の書換処理によって変更するときに変更データを変
更用データバッファに書込むためのホームコントローラ
の動作の手順を示すフローチャートである。
FIG. 17 is a flowchart illustrating an operation procedure of a home controller for writing change data to a change data buffer when system data is changed by rewriting processing between blocks in the third embodiment.

【図18】第3実施例においてホームコントローラの復
旧時の動作の手順を示すフローチャートである。
FIG. 18 is a flowchart illustrating a procedure of an operation when the home controller is restored in the third embodiment.

【図19】第3実施例においてホームコントローラの復
旧時の動作の手順を示すフローチャートである。
FIG. 19 is a flowchart illustrating an operation procedure at the time of restoration of the home controller in the third embodiment.

【図20】一般的なホームオートメーション・システム
の構成を示す概念図である。
FIG. 20 is a conceptual diagram showing a configuration of a general home automation system.

【図21】一般的な従来のホームコントローラの構成を
示すブロック図である。
FIG. 21 is a block diagram showing a configuration of a general conventional home controller.

【図22】一般的な従来のホームコントローラのメモリ
領域の構成を示す模式図である。
FIG. 22 is a schematic diagram showing a configuration of a memory area of a general conventional home controller.

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

1,101,201 ホームコントローラ 2 ホームバス 3 インタフェース部 5 制御部 7 フラッシュメモリ 8,108,208 メモリ制御部 10 第2のメモリ領域 15,15a,15b 書換開始データ領域 16,16a,16b 書換終了データ領域 17,17a,17b 新旧表示データ領域 18,18a,18b 変更終了データ領域 19,19a,19b 変更用データバッファ 1, 101, 201 Home controller 2 Home bus 3 Interface unit 5 Control unit 7 Flash memory 8, 108, 208 Memory control unit 10 Second memory area 15, 15a, 15b Rewrite start data area 16, 16a, 16b Rewrite end data Area 17, 17a, 17b New and old display data area 18, 18a, 18b Change end data area 19, 19a, 19b Change data buffer

Claims (5)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 ホームバスを介して家庭用機器を制御す
るためのホームコントローラであって、 不揮発性のメモリからなり、制御用データを格納するた
めの2つのブロックを含む制御用データ記憶手段と、制御用データの書込み指令に応答して、前記制御用デー
タを前記2つのブロックのうちの選択された一つに書込
むための書込手段とを含み、 前記2つのブロックの各々は、 前記制御用データを記憶するための制御用データ記憶領
域と、 第1のデータを格納するための第1のデータ記憶領域
と、 第2のデータを格納するための第2のデータ記憶領域と
を含み、 前記書込手段は、 前記指令に応答して、前記2つのブロックの内容に基づ
いて前記2つのブロックのいずれか一方のブロックを選
択するための選択手段と、 前記2つのブロックのうちの他方のブロックを所定の第
1の値でクリアするための第1のクリア手段と、 前記他方のブロックの前記制御用データ記憶領域に制御
用データを書込むための制御用データ書込手段と、 前記制御用データ書込手段による書込の完了後に、前記
一方のブロックの前記第1のデータを前記第2の値で書
換えるための第1の書換手段と、 前記第1の書換手段による書換の完了後に、前記他方の
ブロックの前記第2のデータを前記第2の値で書き換え
るための第2の書換手段と、 前記第2の書換手段による書換の完了後に、前記一方の
ブロックを前記第1の値でクリアするための第2のクリ
ア手段とを含み、 前記ホームコントローラはさらに、前記2つの第1のデ
ータと前記2つの第2のデータとに基づいて選択された
ブロックの前記制御用データ記憶領域に格納されている
制御用データに基づいて前記家庭用機器を制御するため
の信号を生成する信号生成手段 を含むホームコントロー
ラ。
1. A home controller for controlling home appliances via a home bus, comprising: a non-volatile memory, a control data storage means including two blocks for storing control data; The control data in response to the control data write command.
Write data to a selected one of the two blocks
Each of the two blocks includes a control data storage area for storing the control data.
Area and a first data storage area for storing first data
A second data storage area for storing second data ;
Wherein the said write means is responsive to said command, based on the contents of the two blocks
And select one of the two blocks
Selecting means for selecting, and the other of the two blocks
First clearing means for clearing with the value of 1 and control in the control data storage area of the other block
Control data writing means for writing the control data, and after completion of the writing by the control data writing means,
Writing the first data of one block with the second value
A first rewrite means for changing, after the completion of the rewriting by the first rewrite means, of the other
Rewrite the second data of the block with the second value
And second rewriting means because, after completion of the rewriting by the second rewriting unit, the one
A second clear for clearing the block with the first value.
Means, the home controller further comprising:
Data and the two second data
Stored in the control data storage area of the block
To control the home appliance based on the control data
A home controller including a signal generation unit that generates a signal of ( i).
【請求項2】 前記2つのブロックの各々は、第3のデ
ータを格納するための第3のデータ記憶領域をさらに含
み、 前記制御用データ書込手段は、 制御用データに含まれる予め定められた一部のデータを
前記他方のブロックの前記制御用データ記憶領域に書込
むための一部書込手段と、 前記予め定められた一部のデータの書込の完了後、前記
他方のブロックの前記第3のデータを前記第2の値で書
き換える ための第3の書換手段と、前記第3の書換手段による書換の完了後、前記制御用デ
ータのうちの前記予め定められた一部以外を前記一方の
ブロックの前記制御用データ記憶手段から読み出して前
記他方のブロックの前記制御用データ記憶領域に 書込む
ための読出書込手段とを含む、請求項1記載のホームコ
ントローラ。
2. Each of the two blocks further includes a third data storage area for storing third data.
In addition, the control data writing unit writes a part of predetermined data included in the control data.
Write to the control data storage area of the other block
Part writing means for reading the predetermined part of the data,
Writing the third data of the other block with the second value
And third rewrite means for changing come, the third after completion of the rewriting by the rewriting means, said control de
Data other than the predetermined part of the data
Before reading from the control data storage means of the block
2. The home controller according to claim 1, further comprising read / write means for writing the control data storage area of the other block .
【請求項3】 前記2つのブロックの各々はデータバッ
ファ領域をさらに含み、前記一部書込手段は、 制御用データを前記一方のブロックのデータバッファ領
域に書込むためのバッファ書込手段と、 前記一方のブロックの前記データバッファ領域に格納さ
れているデータを読出して前記他方のブロックの前記制
御用データ記憶領域に書込むためのバッファ読出手段と
を含む、請求項2記載のホームコントローラ。
3. Each of the two blocks further includes a data buffer area, the partial writing means includes a buffer writing means for writing control data into the data buffer area of the one block, The data stored in the data buffer area of the one block is read and the control of the other block is performed.
3. The home controller according to claim 2, further comprising: a buffer reading means for writing the data into the required data storage area .
【請求項4】 異常発生により前記一部書込手段による
書込動作が中断されたことを、前記2つのブロックの前
記第1、第2、および第3の値に基づいて検出し、復旧
のために、前記制御用データのうちの前記他方のブロッ
クの前記制御用データ記憶領域に書込まれた部分を除く
部分を前記一方のブロックのデータバッファ領域から読
出して前記他方のブロックの前記制御用データ記憶領域
に書込むための部分読出書込手段を含む、請求項3記載
のホームコントローラ。
4. The method according to claim 1, wherein when the abnormality occurs, the partial writing means is used.
Before the two blocks, the write operation was interrupted.
Detecting and recovering based on the first, second, and third values
The other block of the control data.
Excluding the portion written to the control data storage area
Part from the data buffer area of the one block.
The control data storage area of the other block
4. A partial read / write means for writing data to a memory.
Home controller.
【請求項5】 前記2つのブロックの各々は、別個に一
括消去可能である、請求項1〜4のいずれかに記載のホ
ームコントローラ。
5. Each of the two blocks is separately
The e-mail according to any one of claims 1 to 4, which can be collectively erased.
Controller.
JP29675993A 1993-11-26 1993-11-26 Home controller Expired - Fee Related JP3184383B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP29675993A JP3184383B2 (en) 1993-11-26 1993-11-26 Home controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP29675993A JP3184383B2 (en) 1993-11-26 1993-11-26 Home controller

Publications (2)

Publication Number Publication Date
JPH07154870A JPH07154870A (en) 1995-06-16
JP3184383B2 true JP3184383B2 (en) 2001-07-09

Family

ID=17837757

Family Applications (1)

Application Number Title Priority Date Filing Date
JP29675993A Expired - Fee Related JP3184383B2 (en) 1993-11-26 1993-11-26 Home controller

Country Status (1)

Country Link
JP (1) JP3184383B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100389867B1 (en) 2001-06-04 2003-07-04 삼성전자주식회사 Flash memory management method

Also Published As

Publication number Publication date
JPH07154870A (en) 1995-06-16

Similar Documents

Publication Publication Date Title
JP2019061690A (en) On-vehicle control device and program writing device
CN107943501A (en) Embedded device upgrade method, device, computer equipment and storage medium
US5901311A (en) Access key protection for computer system data
CN111258613A (en) Firmware upgrading method and device, electronic equipment and storage medium
US7590793B2 (en) Data access controlling method in flash memory and data access controlling program
CN112433739B (en) Firmware upgrading method
JP3184383B2 (en) Home controller
US5956480A (en) Terminal and online system for tracking version of data and program
US6351826B1 (en) Method and apparatus for automatically verifying communication software
JPH10240629A (en) Intra-memory information updating method
KR20060034076A (en) Data processing device and method for flash memory
JP2003036209A (en) Nonvolatile memory and data rewriting method thereof
JP2007052558A (en) Flash memory rewrite device, flash memory rewrite method and flash memory rewrite program
US10705743B2 (en) Memory control device, control method of flash memory, and method for generating security feature of flash memory
JP3497066B2 (en) Data write / read method in flash memory and storage device using flash memory
JP2002197890A (en) Nonvolatile semiconductor memory
JP2003150441A (en) Data management method, device thereof, data management program, and storage medium storing data management program
JPH0898268A (en) Home controller
JP3079782B2 (en) Master slave network system
CN117615376A (en) Intelligent terminal authorization and restoration method and device based on ESAM module
KR20060013820A (en) Method for upgrading a program of portable device
JPH03269633A (en) Terminal program rewriting system
CN114676071A (en) Data processing method and device, electronic equipment and storage medium
CN118626313A (en) Module upgrading method, device, equipment and medium
CN113917867A (en) Human-computer interaction controller and control method thereof

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20010417

LAPS Cancellation because of no payment of annual fees