JPH07154870A - Home controller - Google Patents

Home controller

Info

Publication number
JPH07154870A
JPH07154870A JP29675993A JP29675993A JPH07154870A JP H07154870 A JPH07154870 A JP H07154870A JP 29675993 A JP29675993 A JP 29675993A JP 29675993 A JP29675993 A JP 29675993A JP H07154870 A JPH07154870 A JP H07154870A
Authority
JP
Japan
Prior art keywords
data
block
control unit
state
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.)
Granted
Application number
JP29675993A
Other languages
Japanese (ja)
Other versions
JP3184383B2 (en
Inventor
Yoshiharu Hayashi
義治 林
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)

Abstract

PURPOSE:To provide a home controller capable of discriminating valid system data even when the rewriting processing of the system data is interrupted and further restoring the data to a usable state as much as possible. CONSTITUTION:A memory area is constituted of two blocks (a) and (b) and when the existing system data are stored in one of the blocks (a) and (b), the new system data are written in the system data area 14b or 14a of the other block (b) or (a). At the time of writing the data, respective data area 15a-18a and 15a-18b are changed by a prescribed procedure. When a write processing is interrupted, at the time of restoration, the data of the respective data areas 15a-18a and 15b-18b are referred to, a state in which a write operation is interrupted, is judged and the adandonment or preservation of the written data and the restoration of the entire system data are selectively performed.

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 non-volatile memory.

【0002】[0002]

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

【0003】図20は、ホームオートメーション・シス
テムの概念図であり、カメラ,アンテナ,テレビ等の映
像系端末、インターホン等の通話系端末、パーソナルコ
ンピュータ等の情報系端末、煙検知器,ガス検知器,防
犯スイッチ,電子キー等のセキュリティ端末、エアコ
ン,風呂,照明等の機器端末とホームコントローラとが
情報信号コネクタを介して、ホームバスに接続されてい
る。ホームコントローラには、電話回線等の外部からの
信号線も接続され、電話,インターホン,セキュリテ
ィ,機器制御,テレコントロール等の様々なサービス機
能を実現することができる。
FIG. 20 is a conceptual diagram of a home automation system, which is a video system terminal such as a camera, an antenna, a television, a communication system terminal such as an intercom, an information system terminal such as a personal computer, a smoke detector, and a gas detector. , Security terminals such as crime prevention switches and electronic keys, device terminals such as air conditioners, baths, and lighting, and a home controller are connected to a home bus via an information signal connector. A signal line from the outside 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 which is the heart of the home automation system. Home controller 50
1 is an interface unit 503 for the home bus 502.
A control unit 505, an I / O (Input / Output) unit 506, and a memory unit 512 are included. 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 a memory area 510 for storing system data
And a memory area 511 to be 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. Further, the memory area 510 has an EEPROM.
(Electrically Erasable and Programable Read Only
Memory) or SR backed up by battery
AM (Static Random Access Memory) is used.

【0005】ところで、ホームオートメーション・シス
テムで実現できる機能に関しては、社会環境の変化、ユ
ーザニーズの動向、技術の進展に伴なう端末機器の充
実、通信ネットワークの整備等によって、将来において
ますます新規な技術が提案されると予想されている。一
方、ホームオートメーション・システムは、住宅設備で
あるために、一度設置すれば、その後長期間にわたって
使用されるものである。
By the way, regarding the functions that can be realized by home automation systems, they will become more and more new in the future due to changes in the social environment, trends in user needs, enhancement of terminal equipment accompanying technological advances, and maintenance of communication networks. It is expected that various technologies will be proposed. On the other hand, the home automation system, which is a residential facility, is installed once and then used for a long period of time thereafter.

【0006】このように、ホームオートメーション・シ
ステムは、将来の機能の拡張性を備えつつ、長期間使用
できるように構成されていることが、必要である。これ
に対する提案として、従来、特開平2−265395号
公報において、システム設置後の変更や拡張を容易にす
るために、メモリカードを使って、前記図21に示した
従来例のメモリ部512のメモリ領域509,510,
511に対応するような記憶手段のいずれかまたはすべ
てを増設する機能を有したホームバス・システムが示さ
れている。
As described above, it is necessary for the home automation system to be configured so that it can be used for a long period of time while having the expandability of future functions. As a proposal for this, in the related art, in Japanese Patent Laid-Open No. 2-265395, a memory of a memory unit 512 of the conventional example shown in FIG. Areas 509, 510,
A home bus system having the function of adding any or all of the 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 Laid-Open No. 2-2
In the technique proposed in Japanese Patent No. 65395, it is necessary to newly add hardware called a memory card. Therefore, there are costs associated with changing or expanding the contents of the home automation system. By the way, recently, a flash memory has attracted attention as a nonvolatile memory that has a large capacity, a low unit price per bit, and is electrically erasable and rewritable. If this flash memory is used as the memory area 509 for storing the system program and application program of the memory unit 512 of the home controller 501 shown in FIG. 21 and the memory area 510 for storing the system data, the contents of the system will be improved. Can be easily performed by rewriting the contents of the memory without adding additional hardware as in the conventional case when changing or expanding. Further, conventionally, two types of memories, a ROM for storing a system program and an application program, and a RAM for storing system data, were required as the memory unit 512, but both of them are provided by one flash memory. By configuring, the number of parts can be reduced and the device can be downsized.

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

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

【0010】ところで、フラッシュメモリは、データの
書換を行なう場合に所定の単位(ブロック単位)でしか
データの消去が行なえないという欠点を持っている。こ
の欠点に起因するフラッシュメモリを用いる上での問題
点について述べる。
Meanwhile, the flash memory has a drawback that data can be erased only in a predetermined unit (block unit) when rewriting the data. Problems in using the flash memory due to this drawback 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 memory areas 509 and 51 of the memory unit 512 of the home controller 501 shown in FIG.
3 is a schematic diagram showing a configuration example of a memory space when the flash memory 507 is used for 0. FIG. In the figure, the flash memory 507 is divided into n blocks,
The n−2 blocks are used in the memory area 509, and the two blocks are used in the memory area 510. The two blocks included in the memory area 510 are referred to as block a and block b in the following description.

【0012】このように構成されたフラッシュメモリ5
07にシステムデータを格納する場合を考える。システ
ムデータは、製造時または設置時に専門家によってブロ
ックaに書込まれる。そして、システムデータの内容を
変更するときには、新しいシステムデータをブロックb
に書込む。その後、古いシステムデータとなったブロッ
クaの内容を消去する。また、再度、システムデータの
内容を変更する場合には、その新しいシステムデータを
ブロックaに書込み、その後、ブロックbの内容を消去
する。このように、フラッシュメモリにシステムデータ
を格納し、その内容を変更するときには、複数のブロッ
ク間で、書込と消去を交互に繰返す。なお、以下の説明
では、複数のブロックを用いてシステムデータの書込と
消去を交互に繰返し、あるブロックに格納している既存
のシステムデータを、別のブロックに新たなシステムデ
ータを書込むことにより置換えることを「ブロック間の
書換」という。
The flash memory 5 configured in this way
Consider the case of storing system data in 07. The system data is written in the block a by a specialist at the time of manufacturing 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 in the block a, and then the contents of the block b are erased. As described above, when the system data is stored in the flash memory and the content thereof is changed, writing and erasing are alternately repeated between the 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. Replacing with is called "rewriting between blocks".

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

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

【0015】[0015]

【課題を解決するための手段】上述の目的を達成するた
めに、請求項1記載の発明は、ホームバスを介して家庭
用機器を制御するためのホームコントローラであって、
不揮発性のメモリからなり、制御用データを格納するた
めの2つのブロックを含む制御用データ記憶手段と、不
揮発性メモリからなり、前記2つのブロックのそれぞれ
に対応させた2つの第1のデータを格納するための第1
のデータ記憶手段と、不揮発性メモリからなり、前記2
つのブロックのそれぞれに対応させた2つの第2のデー
タを格納するための第2のデータ記憶手段と、前記2つ
のブロックのいずれか一方のブロックに格納されている
制御用データに基づいて前記家庭用機器を制御するため
の信号を生成する信号生成手段と、前記制御用データを
前記2つのブロックの1つずつに書込むための書込手段
と、前記書込手段による前記2つのブロックのうちの1
つのブロックへの制御用データの書込が完了した後に、
前記1つのブロックに対応する前記第1のデータを第1
の状態から第2の状態へ切換え、その後、前記第2の状
態から前記第1の状態へ切換えるための第1のデータ切
換手段と、前記第1のデータが前記第1の状態から第2
の状態に切換えられた後であって、かつ、さらに前記第
2の状態に切換えられる前に、前記2つの第2のデータ
のうちのいずれか一方の第2のデータを第3の状態から
第4の状態へ切換え、他方の第2のデータを前記第4の
状態から前記第3の状態へ切換えるための第2のデータ
切換手段と、前記2つの第1のデータと前記2つの第2
のデータとに基づいて前記2つのブロックのうちのいず
れを前記いずれか一方のブロックとするかを判定するた
めの判定手段とを含むものである。
In order to achieve the above-mentioned object, the invention according to claim 1 is a home controller for controlling household appliances via a home bus.
A control data storage unit including a non-volatile memory and including two blocks for storing control data; and two first data corresponding to each of the two blocks, including a non-volatile memory. First to store
And a non-volatile memory.
Second data storage means for storing two second data corresponding to each of the two blocks, and the household based on the control data stored in any one of the two blocks. Of the two blocks by the writing means, a signal generating means for generating a signal for controlling a device for use, a writing means for writing the control data in each of the two blocks, Of 1
After writing the control data to one block,
The first data corresponding to the one block
From the first state to the second state, and then the first data switching means for switching from the second state to the first state, and the first data from the first state to the second state.
After switching to the second state, and before switching to the second state, the second data of either one of the two second data is changed from the third state to the third state. No. 4 state, and second data switching means for switching the other second data from the fourth state to the third state, the two first data and the two second data.
And a determination means for determining which of the two blocks is to be the one of the two blocks based on the data.

【0016】請求項2記載の発明は、不揮発性メモリか
らなり、第3のデータを格納するための第3のデータ記
憶手段と、制御用データに含まれる予め定められた一部
のデータの前記1つのブロックへの前記書込手段による
書込が完了した後に前記第3のデータを第5の状態から
第6の状態へと切換え、その後、前記第6の状態から前
記第5の状態へと切換えるための第3のデータ切換手段
と、前記第3のデータを参照して制御用データに含まれ
る前記一部のデータを除く他の部分を前記1つのブロッ
クとは異なるもう1つのブロックから読出して前記1つ
のブロックへ書込むための読出書込手段とをさらに含む
ものである。
According to a second aspect of the present invention, a non-volatile memory is provided, and a third data storage means for storing the third data and a part of the predetermined data included in the control data are stored. After the writing by the writing means to one block is completed, the third data is switched from the fifth state to the sixth state, and then from the sixth state to the fifth state. Third data switching means for switching, and other part except the part of the data included in the control data is read from another block different from the one block by referring to the third data. Read / write means for writing to the one block.

【0017】請求項3記載の発明は、不揮発性のメモリ
からなるデータバッファ領域をさらに含み、前記書込手
段は、制御用データを前記データバッファ領域に書込む
ためのバッファ書込手段と、前記バッファ書込手段に格
納されているデータを読出して前記ブロックに書込むた
めのバッファ読出手段とを含み、前記ホームコントロー
ラは、さらに、異常発生により前記書込手段による書込
動作が中断された際の復旧のために、前記制御用データ
のうちの前記ブロックに書込まれた部分を除く部分を前
記データバッファ領域から読出して前記ブロックに書込
むための部分読出書込手段をさらに含むものである。
The invention according to claim 3 further includes a data buffer area formed of a non-volatile memory, wherein the writing means includes buffer writing means for writing control data in the data buffer area, and Buffer read means for reading the data stored in the buffer write means and writing the data in the block, wherein the home controller further includes: when the write operation by the write means is interrupted due to an abnormality. In order to recover the data, a part of the control data other than the part written in the block is read from the data buffer area and written in the block.

【0018】請求項4記載の発明は、前記2つのブロッ
クの各々は、一括消去可能な記憶領域を含むものであ
る。
According to a fourth aspect of the present invention, each of the two blocks includes a storage area that can be collectively erased.

【0019】請求項5記載の発明は、前記制御用データ
記憶手段に含まれる2つのブロックと、前記第1のデー
タ記憶手段に含まれる2つの第1のデータを格納する領
域と、前記第2のデータ記憶手段に含まれる2つの第2
のデータを格納する領域との一方ずつが一括消去可能な
メモリ上に設けられているものである。
According to a fifth aspect of the present invention, two blocks included in the control data storage means, two areas for storing the first data included in the first data storage means, and the second block. Two second data storage means included in
One of the areas for storing the data and the other is provided on the memory that can be collectively erased.

【0020】[0020]

【作用】請求項1記載の構成により、ホームコントロー
ラは、制御用データ記憶手段に格納されている制御用デ
ータに基づいて信号生成手段が生成した信号をホームバ
スを介して送ることにより、家庭用機器を制御する。制
御用データ記憶手段は、制御用データを格納するための
2つのブロックを含んでおり、信号生成手段は、そのう
ちのいずれか一方のブロックのデータを用いる。制御用
データを変更する場合には、既存の制御用データが格納
されているブロックとは異なる他方のブロックに書込手
段により変更後の新たな制御用データを書込む。書込手
段による1つのブロックへの制御用データの書込が完了
すると、第1のデータ切換手段が、その書込が完了した
ブロックとは異なる他方のブロックに対応する第1のデ
ータを第1の状態から第2の状態に切換え、その後、第
2の状態から第1の状態へと切換える。
According to the structure of claim 1, the home controller sends the signal generated by the signal generation means based on the control data stored in the control data storage means through the home bus, so that the home controller Control the equipment. The control data storage means includes two blocks for storing the control data, and the signal generation means uses the data of either one of the blocks. When changing the control data, the writing means writes the changed new control data in the other block different from the block in which the existing control data is stored. When the writing of the control data into one block by the writing unit is completed, the first data switching unit sets the first data corresponding to the other block different from the block in which the writing is completed to the first data. The state is switched to the second state, and then the second state is switched to the first state.

【0021】一方、第2のデータ切換手段は、第1のデ
ータ切換手段により第1のデータが第1の状態から第2
の状態へと切換えられた後であって、かつ、さらに第2
の状態から第1の状態へと切換えられる前に、2つの第
2のデータのうちのいずれか一方の第2のデータを第3
の状態から第4の状態へと切換え、他方の第2のデータ
を第4の状態から第3の状態へと切換える。
On the other hand, the second data switching means changes the first data from the first state to the second data by the first data switching means.
After being switched to the state of
Before switching from the first state to the third state, the second data of either one of the two second data is changed to the third data.
State is switched to the fourth state, and the other second data is switched from the fourth state to the third state.

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

【0023】また、一方のブロックに制御用データが既
に書込まれており、さらに、もう一方のブロックへの変
更後の新たな制御用データの書込手段による書込が完了
している場合には、2つの第2のデータはともに第4の
状態にある。この期間においては、判定手段は、第2の
データを参照するのみでは、いずれのブロックの制御用
データを用いるべきかを決定することができない。この
期間は、2つの第1のデータのいずれか一方が第2の状
態になっている期間に包含され、かつ、第1のデータの
いずれが第2の状態となっているかにより、2つのブロ
ックのうちのいずれのブロックが変更後の新たな制御用
データを格納しているかが示される。
Further, when the control data is already written in one block and the writing of the new control data after the change in the other block is completed by the writing means. Both of the two second data are in the fourth state. During this period, the determination unit cannot determine which block of control data to use by only referring to the second data. This period is included in the period in which either one of the two first data is in the second state, and is divided into two blocks depending on which of the first data is in the second state. Which of the blocks stores the new control data after the change is indicated.

【0024】判定手段は、第1のデータを参照して、2
つの第1のデータがともに第1の状態である場合には、
第2のデータを参照することによって用いるべき制御用
データを格納しているブロックを判定し、また、第1の
データのいずれか一方が第2の状態である場合には、第
2のデータを参照することによって、用いるべき制御用
データを格納しているブロックを決定する。
The determination means refers to the first data, and determines 2
If both first data are in the first state,
The block storing the control data to be used is determined by referring to the second data, and if either one of the first data is in the second state, the second data is By referring, the block storing the control data to be used is determined.

【0025】請求項2記載の構成により、書込手段が、
制御用データに含まれる予め定められた一部のデータの
2つのブロックのうちの1つのブロックへの書込を完了
した後に、第3のデータ切換手段が、第3のデータを第
5の状態から第6の状態へと切換え、その後、第6の状
態から第5の状態へと切換える。読出書込手段は、第3
のデータを参照して、制御用データに含まれる予め定め
られた一部のデータの書込が完了している状態であると
判断すれば、制御用データに含まれる書込が完了した一
部のデータを除く他の部分を他方のブロックから読出し
て当該ブロックへ書込む。また、停電等の異常が発生し
た場合に、ホームコントローラを復旧するときには、予
め定められた一部のデータの書込が完了している状態で
あれば、読出書込手段により、ブロックへの書込が完了
した一部のデータを除く他の部分を他方のブロックから
読出して当該ブロックへ書込み、変更後の新たな制御用
データを制御用データ記憶手段に書込むことができる。
According to the structure of claim 2, the writing means is
After the writing of a part of the predetermined data included in the control data into one of the two blocks is completed, the third data switching means sets the third data to the fifth state. To the sixth state, and then from the sixth state to the fifth state. The read / write means is the third
If it is determined that the writing of some of the predetermined data included in the control data is completed by referring to the data of, the part of the writing included in the control data is completed. Other parts except the data of are read from the other block and written into the block. Further, when an error such as a power failure occurs, when the home controller is restored, if writing of a part of predetermined data is completed, the read / write means writes the block. It is possible to read the other part from the other block except the part of the data which has been completely written, write it to the block, and write the new control data after the change to the control data storage means.

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

【0027】請求項4記載の構成により、2つのブロッ
クの各々の記憶領域のデータは、変更後の新たな制御用
データを書込む前に、一括して消去される。
According to the structure of the fourth aspect, the data in the storage areas of the two blocks are collectively erased before writing the new control data after the change.

【0028】請求項5記載の構成により、2つのブロッ
クと2つの第1のデータと2つの第2のデータとの一方
ずつが、一括消去可能な同一のメモリ上に格納されてい
るので、それらの一方ずつを一括して消去することがで
きる。また、第1のデータの第1の状態または第2の状
態と、第2のデータの第3の状態または第4の状態と、
メモリの消去状態とを対応づければ、メモリの一括消去
によってブロックに格納されている制御用データの消去
と、第1のデータの状態の切換と、第2のデータの状態
の切換とを同時に行なうことができる。
According to the structure of claim 5, one of the two blocks, one of the two first data and one of the two second data are stored in the same erasable memory. One of them can be erased collectively. Also, a first state or a second state of the first data, and a third state or a fourth state of the second data,
If the erase state of the memory is associated with each other, the erase of the control data stored in the block by the batch erase of the memory, the switching of the state of the first data, and the switching of the state of the second data are performed at the same time. Can be done.

【0029】[0029]

【実施例】以下、本発明を具体化した3つの実施例につ
いて図面を参照してそれぞれ説明する。また、各実施例
は、メモリとしてフラッシュメモリを用いた構成を例示
するが、本発明はフラッシュメモリを用いた場合に限ら
ず、その他の不揮発性のメモリ全般に同様に適用するこ
とができることを予め述べておく。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Three embodiments embodying the present invention will be described below with reference to the drawings. Further, each embodiment exemplifies a configuration using a flash memory as a memory, but the present invention is not limited to the case of using a flash memory, and it can be similarly applied to other nonvolatile 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 the configuration of a home controller according to the 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 operation of the home controller 1 as a whole, An I / O (Input / Output) unit 6 for performing key input, display / voice input / output, etc., a memory unit 12 for storing various data necessary for the operation of the home controller 1, and a memory unit 12 And a memory control unit 8 for managing storage of data.

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

【0032】本実施例では、第1のメモリ領域9と、第
2のメモリ領域10とをフラッシュメモリ7で構成して
いる。
In this embodiment, the first memory area 9 and the second memory area 10 are composed of 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 stores the system data area 14 for writing the system data and the rewriting start data for storing the data for indicating that the rewriting operation between the blocks of the system data (described later) has started. Area 15
And a rewriting end data area 16 for storing data for indicating that the rewriting operation between the blocks of the system data has ended, and for indicating whether or not the data stored in the block is data before rewriting. And the old and new display data area 17 for storing the data. The system data area 14, the rewriting start data area 15, the rewriting end data area 16, and the old and new display data area 17 are provided in each of the two blocks provided in the second memory area 10. It is what is 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 display data area 17a. Similarly, the block b is the system data area 14b.
And rewriting start data area 15b and rewriting end data area 16
b and the old and new display data area 17b are included.

【0035】図3,4は、本実施例においてシステムデ
ータをブロック間の書換によって変更するときのホーム
コントローラ1の動作の手順を示すフローチャートであ
る。なお、以下の説明においては、前述の書換開始デー
タと書換終了データと新旧表示データとをそれぞれプロ
グラム上でセット/リセットを示すための「フラグ」と
して説明する。各フラグは、データ領域にデータを書込
むことによりセットされ、ブロックの記憶内容が消去さ
れることに伴って各フラグのデータ領域の記憶内容が消
去されることによりリセットされる。
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 rewriting start data, the rewriting end data, and the old and new display data will be described as "flags" for indicating set / reset on the program. Each flag is set by writing data in the data area, and is reset by erasing the memory content of each flag as the memory 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 rewriting start flag 15a of the block a is set. Find out. If the rewrite start flag 15a is set, the memory control unit 8 returns (Y in S1).
ES), it is determined that the system data is currently written in the block a. Then, the memory control unit 8 determines that new system data should be written in 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), and if the storage content of the block b has not been erased (N in S2).
O), the stored contents of block b are erased (S3). At this time, the system data area 14b included in the block b
The rewriting start flag 15b, the rewriting end flag 16b, and the old and new display flag 17b are all erased. This is because the flash memory erases 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 controller 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 old / new display flag 17a of the block a (S6). After that, the memory control unit 8 sets the rewrite end flag 16b of the block b (S7). Further, the memory control unit 8 erases the stored contents of the block a (S8), and finishes 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 subsequently checks whether or not the rewrite start flag 15b of the block b is set (S9). If the rewrite start flag 15b is set (YES in S9), the memory control unit 8 determines that the system data is currently written in the system data area 14b of the block b. In this case, the memory control unit 8 determines that new system data should be written in 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 stored contents of the block a are erased (S10). If not erased (NO in S10), the stored contents of the block a are erased. (S11). Next, the memory control unit 8
Sets the rewrite start flag 15a of block a (S12). Then, the memory control unit 8 writes new system data in 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 old and new display flags 17b of the block b (S14).

【0041】その後、メモリ制御部8は、ブロックaの
書換終了フラグ16aをセットする(S15)。そし
て、メモリ制御部8は、ブロックbの記憶内容を消去し
(S16)、ブロックbからブロックaへのシステムデ
ータの書換処理を終了する。
Thereafter, the memory control unit 8 sets the rewriting end flag 16a of the block a (S15). Then, the memory control unit 8 erases the stored contents of the block b (S16), and finishes 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 rewriting start flag 15b of the block b is not set in 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 the system data is not set, such as when the home controller 1 is manufactured or installed. In this case, the memory control unit 8
Writes the system data in block a. The block to which the system data is first written when the system data is not 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 are erased (S17). If not erased (NO in S17), the contents of the block a are erased (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 in the block a (S20). When all the writing to the block a is completed, the memory control unit 8 sets the rewriting 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 stored contents of the block b are erased (S22), and if not (NO at S22), the contents of the block b are erased (S23). ), The rewriting process of the system data ends. However, in this case, since there is no block in which old system data before rewriting is stored, to be precise, the system data is first written.

【0045】前述したシステムデータのブロック間の書
換処理が実行されている途中で、たとえば停電などの異
常事態が発生すると、ホームコントローラ1は、システ
ムをリセットする。このとき、ブロック間の書換処理は
途中で中断される。このような異常事態からの復旧時に
おけるホームコントローラ1の動作について以下に説明
する。
If an abnormal situation such as a power failure occurs while the above-described rewriting process between blocks of system data is being executed, the home controller 1 resets the system. At this time, the rewriting process between blocks is interrupted midway. 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の製造時または設置時においてシステムデータが未設
定である場合に発生する。
5 and 6 are flow charts 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 or not 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 controller 8
If the rewrite start flag 15b is not set (NO in S25), it is determined that there is no system data in either block a or block 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 rewrite start flag 15b of the block b is set in S25 (YES in S25), the memory control unit 8 subsequently determines whether the rewrite end flag 16b of the block b is set. It is checked whether or not (S27). The memory control unit 8 uses the rewrite end flag 16
If b is set (YES in S27), currently,
System data is a block b system data area 14
It is determined that it is 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 step S24 described above, block a
If the rewriting start flag 15a is set (S24
In 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 next checks whether or not the rewrite end flag 16a of the block a is set (S31).

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

【0050】一方、メモリ制御部8は、ブロックaの書
換終了フラグ16aがセットされていなければ(S31
にてNO)、ブロックaの記憶内容を消去する(S3
2)。この動作は、前記図4に示したS20の処理が実
行されている途中で異常事態が発生した場合に対応する
処理である。このような処理が必要になるのは、コント
ローラ1の製造時または設置時に、専門家によってシス
テムデータを最初に書込んでいる場合である。この場
合、作業者である専門家は、コントローラ1を操作する
ための適正な知識を有するので、システムがリセットし
た後にホームコントローラ1を操作して容易にシステム
データをフラッシュメモリ7に書込ませる動作を行なわ
せることができる。
On the other hand, the memory control unit 8 does not set the rewriting end flag 16a of the block a (S31).
No), the stored contents of block a are erased (S3).
2). This operation is a process corresponding to the case where an abnormal situation occurs while the process of S20 shown in FIG. 4 is being executed. 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 an expert who is an operator has proper knowledge for operating the controller 1, an operation of operating the home controller 1 to easily write the system data in the flash memory 7 after the system is reset. Can be done.

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

【0052】次に、前述のS30にてブロックaとブロ
ックbとの両方にシステムデータが存在する場合(S3
0にてYES)の処理について説明する。このような状
態は、前記図3に示したブロック間の書換処理の実行中
に異常事態が発生して書換処理が途中で中断された場合
に発生する。このとき、メモリ制御部8は、まずブロッ
クaの新旧表示フラグ17aがセットされているか否か
を調べる(S34)。新旧表示フラグ17aがセットさ
れていれば(S34にてYES)、メモリ制御部8は、
ブロックaからブロックbへのデータの書換処理の途中
で前記図3のS6の終了直後に動作が中断したと判断す
る。
Next, if system data exists in both block a and block b in S30 (S3).
The process of (YES at 0) will be described. Such a state occurs when an abnormal situation occurs during the rewriting process between blocks shown in FIG. 3 and the rewriting process is interrupted midway. At this time, the memory control unit 8 first checks whether or not the old / new display flag 17a of the block a is set (S34). If old and new display flag 17a is set (YES in S34), memory control unit 8
It is determined that the operation is interrupted immediately after the end of S6 of FIG. 3 during the process of rewriting the data from the block a to the 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 rewriting end flag 16b of the block b is set (S35). If the rewriting end flag 16b is not set (NO in S35), the memory control unit 8 sets the rewriting 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 is written in the block b (S29), and sends 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 old / new display flag 17a of the block a is not set in S34 (S3).
4, the memory control unit 8 checks whether or not the old / new display flag 17b of the block b is set (S).
38). If the old / new display flag 17b is set (YES in S38), the memory control unit 8 determines that the block b
During the process of rewriting the system data from the block to the block a, it is determined that the operation is interrupted immediately after the end of S14 of FIG. Then, the memory control unit 8 checks whether or not the rewrite end flag 16a of the block a is set (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 uses the block b.
The stored contents of are deleted (S41). In this case, the memory control unit 8 determines that the system data is written in 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 old / new display flag 17b of the block b is not set in 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 has been set (YES in S42), the memory control unit 8 returns to the state 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 has been interrupted before the processing of S6 is executed. In this case, the system data area 14 of block b
Since the system data in the middle of being written in b is incomplete as it is, the memory control unit 8 erases the stored contents of the block b (S41).

【0056】そして、メモリ制御部8は、システムデー
タがブロックaに書込まれていると判断し(S33)、
その旨を示す信号を制御部5へ送る。
Then, the memory control unit 8 judges that the system data is written in the block a (S33),
A signal indicating that 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へ送る。
If the rewriting end flag 16a of the block a is not set in S42 (NO in S42), the memory control section 8 checks whether or not the rewriting end flag 16b of the block b is set. (S4
3). If the rewriting end flag 16b is set (S
(YES in 43), the memory control unit 8 determines that the operation is interrupted during the process of rewriting the system data from the block b to the block a before the process of S14 of FIG. 3 is executed. In this case, the memory control unit 8 determines that the system data being written in the system data area 14a of the block a is incomplete, and erases the stored contents of the block a (S37). Then, the memory control unit 8 determines that the system data is written in the block b (S29), and sends a signal to that effect to the control unit 5.

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

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

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

【0061】また、前記メモリ制御部8と、このメモリ
制御部8に前述のS6,S14,S8,S16の処理を
行なわせるためのプログラムとにより請求項記載の第1
のデータ切換手段が構成されている。前記メモリ制御部
8と、このメモリ制御部8に前述のS7,S8,S1
5,S16,S21,S23の処理を実行させるための
プログラムとにより請求項記載の第2のデータ切換手段
が構成されている。さらに、前記メモリ制御部8と、こ
のメモリ制御部8に前記図5,6のフローチャートに示
した処理を実行させるためのプログラムとにより請求項
記載の判定手段が構成されている。
According to a first aspect of the present invention, there is provided a memory control section 8 and a program for causing the memory control section 8 to perform the above-described steps S6, S14, S8 and S16.
Data switching means. The memory control unit 8 and the above-mentioned S7, S8, S1
A second data switching means is defined by the program for executing the processing of 5, S16, S21 and S23. Further, the memory control unit 8 and a program for causing the memory control unit 8 to execute the processes shown in the flowcharts of FIGS.

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

【0063】ところで、一般にシステムデータは、ホー
ムコントローラの製造時や設置時に専門家によって最初
に入力されてからは、その後、データの一部分が変更さ
れるだけで、その他の部分は変更されないでそのまま用
いられることが多い。したがって、システムデータを変
更するにあたっては、変更後の新たなシステムデータの
全体を入力することなく、その一部を入力することによ
り行なうことができる。本実施例は、この点に着目し、
前述の第1実施例を変形させて、さらに、容易にシステ
ムデータの変更が行なえるようにしたものである。
By the way, in general, system data is used as it is after only a part of the data is changed after being first input by an expert at the time of manufacturing or installing the home controller, and the other parts are not changed. It 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 entire new system data. In this embodiment, focusing on this point,
The first embodiment described above is modified so that 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 this embodiment. The same symbols are given to those having the same functions as in the first embodiment. The 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 the first memory area 9, the second memory area 10, and the third memory area 11 as in the first embodiment. The first memory area 9 and the second memory area 10 are composed of 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 and old display data area 17. Then, in the present embodiment, the second memory area 10 is further
It includes a change end data area 18 for storing data indicating that writing of a changed portion is completed when rewriting between blocks of system data.

【0066】図8は、第2のメモリ領域10の構成を示
す模式図である。前述の第1実施例のブロックaとブロ
ックbとの構成に加えて、本実施例では、ブロックaに
変更終了データ領域18aをさらに含ませ、ブロックb
に変更終了データ領域18bをさらに含ませている。
FIG. 8 is a schematic diagram showing the structure of the second memory area 10. In addition to the configuration of the block a and the block b of the first embodiment described above, in this embodiment, 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実施例の手
順を変形させた箇所のみを説明する。
9 and 10 are flowcharts showing the procedure of the operation when the system data of the home controller 101 in the second embodiment is changed by rewriting between blocks. 9 and 10, the same steps as those shown in FIGS. 3 and 4 of the first embodiment described above have the same step numbers. Further, in the following description, only the part obtained by modifying the procedure of the first embodiment will be described in order 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 the rewriting of the block b. The flag 15b is set (S4). Next, the memory control unit 108 writes only the newly changed portion included in the new system data, that is, the data 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 of the system data in 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 old and new display flags 17a of the block a (S6). After that, the memory control unit 108 sets the rewrite end flag 16b of the block b (S7). Then, the memory control unit 108
The stored contents of the block a are erased (S8), and the rewriting process of 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, currently, the system data is block b.
Has been written to the new system data block a.
When writing to the memory, the memory control unit 108
The rewrite start flag 15a is set (S12). Then, the memory control unit 108 writes the changed data included in the system data in 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 data of the unchanged portion included in the system data in the system data area 14a of the block a (S5).
0). Then, the memory control unit 108 sets the old and new display flags 17b of the block b when the writing of the data of the unchanged portion into the block a is completed (S14).
After that, the memory control unit 108 sets the rewriting end flag 16a of the block a (S15). Then, the memory control unit 108 erases the stored contents of the block b (S1
6) The system data rewriting process from block b to 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が実行される前に動作が中断したと
判断する。
11 and 12 are flow charts showing the operation procedure at the time of restoration of the home controller 101 in the second embodiment. Similar to FIGS. 9 and 10, only parts different from the first embodiment will be described. If the old / new 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 is interrupted before S6 of FIG. 9 is executed.

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

【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 is 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 changed portion data included in the changed system data in the block b is completed. . And
The memory control unit 108 reads the data of the unaltered portion of the system data from the system data area 14a of the block a and the system data area 1 of the block b
Write to 4b (S53).

【0074】メモリ制御部108は、ブロックbへのシ
ステムデータの書込処理が完了すれば、ブロックaの新
旧表示フラグ17aをセットし(S54)、さらに、ブ
ロックbの書換終了フラグ16bをセットする(S5
5)。そして、メモリ制御部108は、ブロックaの記
憶内容を消去し(S56)、ブロックaからブロックb
へのシステムデータの書換処理を終了する。そして、メ
モリ制御部108は、システムデータがブロックbに書
込まれていることを示す信号を制御部5へ送る。
When the writing process of the system data to the block b is completed, the memory control unit 108 sets the old / new 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 stored contents of the block a (S56), and the blocks a to b are deleted.
The rewriting process of the system data to the. Then, the memory control unit 108 sends to the control unit 5 a signal indicating that the system data is written in 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 in 51), the memory control unit 108 returns to S in FIG.
It is determined that an abnormality occurred during the execution of 45 and the writing process was interrupted.

【0076】本実施例では、フラッシュメモリ7とし
て、8ビットまたは16ビット単位でデータの読出また
は書込を行なうものを用いている。システムデータのデ
ータ長がフラッシュメモリ7の読出/書込の単位と同じ
であれば、データの管理は比較的容易である。しかしな
がら、実際には、システムデータは、端末機器の接続の
有無を示すデータのように1ビットで構成されるものも
あれば、電話番号のように複数バイトを必要とするもの
もある。
In the present embodiment, as the flash memory 7, one for reading or writing 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 1 bit like data indicating whether or not a terminal device is connected, and some system 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 during the writing and the writing process is interrupted, the data written halfway cannot be used. Therefore, the memory control unit 108 erases the stored contents of the block b (S52). Then, the memory control unit 108
Determines that the system data has been written in the block a (S33), and sends a signal to that effect to the control unit 5.

【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 rewrite end flag 16a of the block a is not set in S42 (NO in S42), the memory control unit 108 checks whether the rewrite end flag 16b of the block b is set. (S
43). If the rewriting end flag 16b is set (YES in S43), it is determined that the operation is interrupted before the execution of S14 of FIG. In this case, the memory control unit 108 then continues to the change end flag 18a of the block a.
It is checked 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 at S57), memory control unit 108 determines that writing of the changed portion 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 in the block a (S59).

【0080】メモリ制御部108は、ブロックaへのす
べてのシステムデータの書込が終了すれば、ブロックb
の新旧表示フラグ17bをセットする(S60)。次
に、メモリ制御部108は、ブロックaの書換終了フラ
グ16aをセットする(S61)。さらに、メモリ制御
部108は、ブロックbの記憶内容を消去し(S6
2)、システムデータの書換処理を終了する。この場
合、メモリ制御部108は、システムデータがブロック
aに書込まれていると判断し(S33)、その旨を示す
信号を制御部5へ送る。
When the writing of all the system data to the block a is completed, the memory control unit 108 will block b.
The old and new display flag 17b is set (S60). Next, the memory control unit 108 sets the rewriting end flag 16a of the block a (S61). Further, the memory control unit 108 erases the stored contents of the block b (S6
2) The system data rewriting process ends. In this case, the memory control unit 108 determines that the system data is written in 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 has an abnormality during the execution of S48 in FIG. , Judge that the writing has been interrupted. In this case, the memory control unit 108 erases the stored contents of the block a (S58). Then, the memory control unit 108 determines that the system data is written in 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 rewriting process of system data and the rewriting operation is interrupted midway, if the writing process of the changed part included in the system data is completed,
Copy the unchanged part from the existing system data and restore the entire modified system data. This allows the user to write the changed data even if an error such as a power failure occurs and the rewriting process is interrupted during or after the input of the changed system data. If completed, there is no need 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と、このメモリ制御部108に前述のS
53,S59の処理を実行させるためのプログラムとに
より請求項記載の読出書込手段が構成されている。
The change end data area (flag) 18
The third data storage means described in the claims is constituted by a and 18b. The memory control unit 108 and the above-mentioned S46, S8, S49, S16
And a program for performing the processing described in (3) above constitutes a third data switching means. The memory control unit 108 and the above-mentioned S
53 and the program for executing the processing of S59 constitute the reading / writing means.

【0084】次に、本発明の第3実施例について説明す
る。本実施例では、システムデータに含まれる変更部分
を書込んでいる途中で異常が発生し、書込処理が中断さ
れた場合であっても、異常発生前までに書込まれた変更
データについては、使用可能な有効な状態にするように
ホームコントローラを構成している。
Next, a third embodiment of the present invention will be described. In this embodiment, even if an abnormality occurs while writing the changed portion included in the system data and the writing process is interrupted, the change data written before the abnormality occurs , Have configured the home controller to be in a usable and enabled 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 structure of the home controller 201 according to the third embodiment. The same reference numerals are given to those having the same functions as those shown in the first embodiment. The home controller 201 includes an interface unit 3, a control unit 5 and an I / O unit.
The unit 6, the memory control unit 208, and the memory unit 12 are included. 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 composed of 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 changed portion data is written in the third memory area 11 used as a working storage area when the program is executed, and all the changing work is completed. After that, the system data is collectively written in the flash memory 7. In this 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 change data buffer 19.

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

【0089】図15は、ブロックaに設けられている変
更用データバッファ19aの構成を示す模式図である。
なお、ブロックbの変更用データバッファ19bについ
ても同図に示した構成と同様であるので、図示を省略す
る。図15において、変更用データバッファ19aは、
m個の変更データを格納している。各変更データは、各
データを識別するためのデータ番号と、フラッシュメモ
リ7(図13)で扱われるビット長を単位としたデータ
の長さを示すデータサイズと、データとで構成されてい
る。
FIG. 15 is a schematic diagram showing the structure of the changing data buffer 19a provided in the block a.
Since the changing data buffer 19b of the block b has the same configuration as that shown in FIG. In FIG. 15, the change data buffer 19a is
It stores m pieces of change data. Each change data is composed of a data number for identifying each data, a data size indicating the length of the data handled in the flash memory 7 (FIG. 13) as a unit, 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 the head data of the changing data buffer 19a is read when it is not written in the changing data buffer 19a and is in the unused state, its value becomes a certain constant value. For example, when the flash memory 7 is configured such that one word has 8 bits and the erased state is the high level, the data buffer 1 for changing unused data is used.
The read value of the head data of 9a becomes FFH. By utilizing such a characteristic, in the present embodiment, when the change data exists, the data number is set to a value other than the constant value in the erased state, and the change data is changed according to the value of the data number. It is possible to determine the presence or absence of.

【0091】図16,17は、システムデータをブロッ
ク間の書換処理によって変更する際に、変更部分のデー
タ(以下、「変更データ」という。)を変更用データバ
ッファ19a,19bに書込むためのホームコントロー
ラ201の動作の手順を示すフローチャートである。こ
のフローチャートに示す手順は、1個の変更データにつ
いて1回実行される。前述の第1実施例および第2実施
例と同様に、システムデータの書換状態を示すデータを
フラグとして説明する。
16 and 17 are for writing the data of the changed portion (hereinafter referred to as "changed data") into the change data buffers 19a and 19b when the system data is changed by the rewriting process between blocks. 6 is a flowchart showing a procedure of an operation of home controller 201. The procedure shown in this flowchart is executed once for each piece of changed data. Similar to the first and second embodiments described above, the data indicating the rewriting state of the system data will be described 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 rewriting start flag 15a of the block a is set (S63). If the rewriting start flag 15a is not set (NO in S63), the memory control unit 208
Next checks whether or not 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 the system data change process, the memory control unit 208 causes the change data buffer 19 to change.
Writing to a and 19b is not performed.

【0093】S63において、ブロックaの書換開始フ
ラグ15aがセットされていれば(S63にてYE
S)、メモリ制御部208は、現在、システムデータが
ブロックaに書込まれていると判断する。このときは、
メモリ制御部208は、ブロックaの変更用データバッ
ファ19aに変更データを書込む。以下に変更用データ
バッファ19aへの書込処理の手順について説明する。
If the rewrite start flag 15a of the block a is set in S63 (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 in 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は、変更データのデータ長を代
入するための変数である。
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 beginning in the change data buffer 19a. The data value Ka (n) indicates the value of the nth data in the changing data buffer 19a. The data number sub-counter j is a counter for adding the value of the data number counter n separately. The data length counter k is a variable for substituting the data length of the changed 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 in 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 top change data in the change data buffer 19a. The memory control unit 208 determines whether the area of the changed data is in the used state or the unused state based on the value of the read data number as described above (S76). If the read data number value determines that the area is in use (NO in S76), the memory control unit 208 checks the value of the 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 number of data (address) in the change data buffer at the present time, and shows the position of the data number of the change data as the storage area. Ka (n + 1) which is the data size of the changed data is added to this n.

【0098】さらに、データサイズを格納している領域
のアドレスの部位として1を加算し、次に、カウンタを
次の変更データのデータ番号のアドレスを示すようにす
るために1を加算する。したがって、前回の変更データ
のデータ番号を示すアドレスから次回の変更データのデ
ータ番号を示すアドレスを計算するためには、式(1)
に記載した計算式に従ってデータ数カウンタnを更新す
る。このようにして、メモリ制御部208は、変更用デ
ータバッファ19aの未使用領域が見つかるまで、S7
6とS77とを繰返す。
Furthermore, 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, in order to calculate the address indicating the data number of the next changed data from the address indicating the data number of the previous changed data, the formula (1) is used.
The data number counter n is updated according to the calculation formula described in. In this way, the memory control unit 208 continues 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 the unused area is found (YES in S76), memory control unit 208 changes data buffer 1
It is checked whether or not there is a free area in which the changed data can be written in 9a. That is, the memory control unit 208 sets the data number sub-counter j to n + 1 and the data length counter k to the data length of the changed data (S78).
Then, the memory control unit 208 checks whether or not the number of data j + k after writing the changed data does not exceed the maximum data capacity n MAX of the changing data buffer 19a (S79).

【0100】メモリ制御部208は、データ数j+kが
最大データ容量nMAX を越えるならば(S79にてN
O)、これ以上は変更用データバッファ19aに変更デ
ータを書込めないと判断し、この時点で、第2実施例に
示したブロック間の書換処理と同様に、前記図9,10
に示した処理手順によって、ブロックaからブロックb
へのシステムデータの書換処理を行なう(S84)。S
84の処理が終わればメモリ制御部208は、手順をS
63に戻し、変更データについての処理を実行する。
The memory control unit 208 determines that the data number j + k exceeds the maximum data capacity n MAX (N in S79).
O), it is determined that the change data cannot be written in the change data buffer 19a any more, and at this point, similar to the rewriting process between blocks shown in the second embodiment, the above-described steps shown in FIGS.
According to the processing procedure shown in FIG.
The system data is rewritten to (S84). S
When the processing of 84 is completed, the memory control unit 208 executes the procedure S
Returning to 63, the processing 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)。
When the memory control unit 208 determines that the number of data j + k is smaller than the maximum data capacity n MAX and the change data can be written (YES in S79), the data length of the change data is set to the change data. The data is written in the buffer 19a (S80). Next, the memory control unit 208 writes the contents of the change data in 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, the variable j of the number of data and the write data number i are incremented by 1, and i is k. When it becomes larger than the above, 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 in 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 process, an abnormal situation occurs during the execution of S80 to S82, and the change data buffer 1
When the data written in 9a becomes incomplete, the data number is not written in the changing data buffer 19a. Therefore, by reading the data number and determining the value in the subsequent processing, it is possible to invalidate the write data that has become incomplete due to an abnormal situation.

【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 the process of writing the change data in the change data buffer 19b of the block b. The processing procedure when writing the change data to the change data buffer 19b is the same as that of the change data buffer 19a described above.
S65 to S7, which are the processes of the change data buffer 19b
Corresponds to 3 respectively. The variable Ka indicating the value of the data in the changing data buffer 19a is shown as the variable Kb in the changing data buffer 19b.
The detailed processing procedure for writing the change data in the change data buffer 19b will be omitted.

【0104】以上の処理ですべての変更データが変更用
データバッファ19aまたは変更用データバッファ19
bに書込まれれば、それらのデータをS84,S74に
示したブロック間の書換処理と同様の手順によって、ブ
ロックbまたはブロックaに書込む。
Through the above processing, all the change data are changed data buffer 19a or change data buffer 19
If it is written in b, those data are written in 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の構成と異
なる部分についてのみ説明する。
17 and 18 show the home controller 20.
6 is a flowchart showing an operation procedure at the time of restoration of No. 1; This flowchart shows the process at the time of restoration when an abnormal situation occurs during the writing process of the system data shown in FIGS. 17 and 18, and the process procedure of the second embodiment shown in FIGS. This is modified by using the change data buffers 19a and 19b. The same step numbers are shown for the same processing contents as those in FIGS. In the following description, only the parts 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に書込まなければならないと判断す
る。
When the memory control unit 208 determines in S27 that the system data is written in the block b (YES in S27), the change data is written in the change data buffer 19b in the block b. It is checked whether it is rare (S85). If the data has been written in the change data buffer 19b (S85).
NO), it is determined that the operation is interrupted while the change data is being written in the change data buffer 19b of the block b in the flowcharts shown in FIGS. In this case, the memory control unit 208 determines that new system data should be written in 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 stored contents of the block a are erased (S8).
6) If the memory content of block a has not been erased (NO in S86), the memory content of block a is erased (S87). Next, the memory control unit 208 determines that the block a
The rewriting start flag 15a is set (S88). The memory control unit 208 then changes the data buffer 19 for change.
The change data written in b is written in block a (S9
5), the change end flag 18a is set (S96).

【0108】次に、メモリ制御部208は、システムデ
ータの中で変更されない部分のデータとしてブロックb
のシステムデータ領域に書込まれているデータを読出
し、そのデータをブロックaのシステムデータ領域に書
込む(S59)。
Next, the memory control unit 208 uses the block b as the data of the part which is not changed in the system data.
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 old and new display flags 17b of the block b (S60), and then sets the rewrite end flag 16a of the block a ( 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 is written in 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に書込まなければならないと判断する。
When the memory control unit 208 determines in S31 that the system data is written in 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 it has been written (S89). If the change data is written in block a (NO in S89), memory control unit 2
08, in the processing procedure shown in FIGS.
It is determined that the operation is interrupted while the change data is being written in the change data buffer 19a of the block a. In this case, the memory control unit 208 determines that new system data should be written in 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 determines that the block b
It is checked whether or not the memory content of is deleted (S90),
If not erased (NO in S90), the stored contents of block b are erased (S91). After that, the memory control unit 208 sets the rewrite start flag 15b of the block b (S92). Then, 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 unaltered 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 old and new display flags 17a of the block a (S54), and then sets the rewrite end flag 16b of the block b ( S55).
Then, the memory control unit 208 finally erases the contents of the block a (S56) and ends the rewriting process of the system data. In this case, the memory control unit 208 determines that the system data is written in the block b (S29),
A signal indicating that 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 or not the rewriting end flag 16a of the block a is set. The memory control unit 208 uses the rewrite end flag 16
If a is set (YES in S42), it is determined that the operation is interrupted during the process of rewriting the system data from block a to block b before the execution of S6 in FIG.

【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). The memory control unit 208 determines that the change end flag 18b is not set (N in S51).
O), it is determined that an error has occurred while the process of S45 of 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 changes the change data not written in the block b. 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 unaltered portion included in the system data from the block a and writes it in 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 old and new display flags 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 stored contents of the block a (S56), and ends the system data rewriting process. In this case, the memory control unit 208
Judges that the system data has been written in the block b (S29), and sends a signal to that effect to the control unit 5.

【0117】メモリ制御部208は、S42にてブロッ
クaの書換終了フラグ16aがセットされていなければ
(S42にてNO)、ブロックbの書換終了フラグ16
bがセットされているか否かを調べる(S43)。メモ
リ制御部208は、書換終了フラグ16bがセットされ
ていれば(S43にてYES)、ブロックbからブロッ
クaへのシステムデータの書換途中で前記図9のS14
の実行前に動作が中断したと判断する。
If the rewriting end flag 16a of block a is not set in S42 (NO in S42), the memory control unit 208 rewrite end flag 16 of block b.
It is checked whether or not b is set (S43). If the rewrite end flag 16b is set (YES in S43), the memory control unit 208 is in the process of rewriting the system data from the block b to the block a and, in step S14 of FIG.
It is determined that the operation was interrupted before 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 is set (S57). The memory control unit 208 determines that the change end flag 18a is not set (N in S57).
O), it is determined that an error occurred during the execution of S48 of FIG. 9 while the change data was being written to the block a, and the write operation was 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 retrieves that data. 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 part that is not changed and is included in the system data from the block b and writes the data in the block a (S59). The memory control unit 208
When the writing of the system data to the block a is completed, the old and new display flag 17b of the block b is set (S6
0) and thereafter, the rewriting end flag 16a of the block a is set (S61). Then, the memory control unit 208
Finally, the stored contents of the block b are erased (S62), and the rewriting process of the system data ends. In this case, the memory control unit 208 determines that the system data is written in the block a (S33), and sends a signal indicating that fact to the control unit 5.
Send to.

【0120】以上説明したように第3実施例によれば、
システムデータの書換処理の実行中に異常事態が発生し
てフラッシュメモリ7のブロック間の書換処理が途中で
中断された場合であっても、変更用データバッファに書
込まれた変更データが使用できる状態であれば、そのデ
ータを用いてシステムデータ全体を復元することが可能
である。したがって、異常事態に対応するために使用者
が行なう復旧作業が軽減できる。
As described above, according to the third embodiment,
Even when an abnormal situation occurs during execution of the system data rewriting process and the rewriting process between blocks of the flash memory 7 is interrupted midway, the change data written in the change 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 to deal with an abnormal situation can be reduced.

【0121】前記変更用データバッファ19a,19b
により請求項記載のデータバッファ領域が構成されてい
る。前記メモリ制御部208と、このメモリ制御部20
8に前記図16,17のフローチャートに示した処理を
実行させるためのプログラムとにより請求項記載のバッ
ファ書込手段が構成されている。
The change data buffers 19a, 19b
The data buffer area described in the claims is constituted by. The memory control unit 208 and the memory control unit 20
A buffer writing means is constituted by a program for causing the CPU 8 to execute the processing shown in the flowcharts of FIGS.

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

【0123】[0123]

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

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

【0125】請求項3記載の発明によれば、新たに制御
用データを制御用データ記憶手段に書込む際に、一旦、
制御用データをデータバッファ領域に書込み、その書込
んだデータを読出してブロックに書込む。さらに、制御
用データのうちのブロックに書込まれた部分を除く部分
をデータバッファ領域から読出してブロックに書込むた
めの手段を設けたので、停電等の異常が発生し、書込手
段による書込動作が中断された場合であっても、データ
バッファ領域に書込まれたデータは、以降の処理におい
て用いることが可能な状態にすることができる。
According to the third aspect of the invention, when newly writing the control data in the control data storage means,
The control data is written in the data buffer area, and the written data is read and written in the block. Further, since the means for reading the portion of the control data excluding the portion written in the block from the data buffer area and writing it in the block is provided, an abnormality such as a power failure occurs, and the writing by the writing means occurs. Even when the writing operation is interrupted, the data written in the data buffer area can be made ready for use in the subsequent processing.

【0126】請求項4記載の発明によれば、制御用デー
タ記憶手段の2つのブロックの各々に含まれる記憶領域
のデータを一括して消去することができるので、制御用
データを新たにブロックに書込む前に、そのブロックの
記憶領域に格納されている既存の制御用データを一括し
て消去することができる。
According to the fourth aspect of the present invention, since the data in the storage area included in each of the two blocks of the control data storage means can be erased at once, the control data is newly stored in the block. Before writing, the existing control data stored in the storage area of the block can be collectively erased.

【0127】請求項5記載の発明によれば、2つのブロ
ックと2つの第1のデータと2つの第2のデータとの一
方ずつが一括消去可能な同一のメモリ上に格納されてい
るので、これら三者の一方ずつを一括して消去すること
ができる。そして、第1のデータの第1の状態または第
2の状態と、第2のデータの第3の状態または第4の状
態とをメモリの消去状態と対応させることにより、ブロ
ックに格納されている制御用データの消去と、第1のデ
ータの状態の切換と第2のデータの状態の切換とを同時
に行なうことができる。
According to the invention described in claim 5, one of the two blocks, the two first data and the two second data are stored in the same erasable memory. One of these three can be erased at once. Then, the first state or the second state of the first data and the third state or the fourth state of the second data are stored in the block by making them correspond to the erased state of the memory. It is possible to simultaneously erase the control data, switch the state of the first data and switch the state of the second data.

【図面の簡単な説明】[Brief description of 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 the home controller according to the first embodiment.

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

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

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

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

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

【図8】第2実施例によるホームコントローラのメモリ
領域の構成を示す模式図である。
FIG. 8 is a schematic diagram showing 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 operation of a home controller when system data is changed by rewriting processing between blocks in the second embodiment.

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

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

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

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

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

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

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

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

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

【図19】第3実施例においてホームコントローラの復
旧時の動作の手順を示すフローチャートである。
FIG. 19 is a flowchart showing the procedure of an operation when the home controller is restored 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 section 5 Control section 7 Flash memory 8, 108, 208 Memory control section 10 Second memory area 15, 15a, 15b Rewriting start data area 16, 16a, 16b Rewriting end data Area 17, 17a, 17b Old and new display data area 18, 18a, 18b Change end data area 19, 19a, 19b Change data buffer

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 ホームバスを介して家庭用機器を制御す
るためのホームコントローラであって、 不揮発性のメモリからなり、制御用データを格納するた
めの2つのブロックを含む制御用データ記憶手段と、 不揮発性メモリからなり、前記2つのブロックのそれぞ
れに対応させた2つの第1のデータを格納するための第
1のデータ記憶手段と、 不揮発性メモリからなり、前記2つのブロックのそれぞ
れに対応させた2つの第2のデータを格納するための第
2のデータ記憶手段と、 前記2つのブロックのいずれか一方のブロックに格納さ
れている制御用データに基づいて前記家庭用機器を制御
するための信号を生成する信号生成手段と、 前記制御用データを前記2つのブロックの1つずつに書
込むための書込手段と、 前記書込手段による前記2つのブロックのうちの1つの
ブロックへの制御用データの書込が完了した後に、前記
1つのブロックに対応する前記第1のデータを第1の状
態から第2の状態へ切換え、その後、前記第2の状態か
ら前記第1の状態へ切換えるための第1のデータ切換手
段と、 前記第1のデータが前記第1の状態から第2の状態に切
換えられた後であって、かつ、さらに前記第2の状態に
切換えられる前に、前記2つの第2のデータのうちのい
ずれか一方の第2のデータを第3の状態から第4の状態
へ切換え、他方の第2のデータを前記第4の状態から前
記第3の状態へ切換えるための第2のデータ切換手段
と、 前記2つの第1のデータと前記2つの第2のデータとに
基づいて前記2つのブロックのうちのいずれを前記いず
れか一方のブロックとするかを判定するための判定手段
とを含むホームコントローラ。
1. A home controller for controlling household equipment via a home bus, comprising a non-volatile memory, and control data storage means including two blocks for storing control data. A first data storage unit, which is composed of a non-volatile memory and stores two first data corresponding to each of the two blocks, and a non-volatile memory, which corresponds to each of the two blocks Second data storage means for storing the two second data, and for controlling the household appliance based on the control data stored in one of the two blocks Signal generating means for generating the signal, write means for writing the control data in each of the two blocks, and After the writing of the control data to one of the two blocks is completed, the first data corresponding to the one block is switched from the first state to the second state, and then the first data is switched to the second state. First data switching means for switching from the second state to the first state; and after the first data has been switched from the first state to the second state, and further Before being switched to the second state, the second data of either one of the two second data is switched from the third state to the fourth state, and the other second data is switched to the second state. Second data switching means for switching from the fourth state to the third state, and which one of the two blocks is based on the two first data and the two second data. Decide which block to use Home controller comprising a determining means for.
【請求項2】 前記ホームコントローラは、 不揮発性メモリからなり、第3のデータを格納するため
の第3のデータ記憶手段と、 制御用データに含まれる予め定められた一部のデータの
前記1つのブロックへの前記書込手段による書込が完了
した後に前記第3のデータを第5の状態から第6の状態
へと切換え、その後、前記第6の状態から前記第5の状
態へと切換えるための第3のデータ切換手段と、 前記第3のデータを参照して制御用データに含まれる前
記一部のデータを除く他の部分を前記1つのブロックと
は異なるもう1つのブロックから読出して前記1つのブ
ロックへ書込むための読出書込手段とをさらに含む、請
求項1記載のホームコントローラ。
2. The home controller comprises a non-volatile memory, a third data storage means for storing third data, and a part of the predetermined data included in the control data. After the writing by the writing means to one block is completed, the third data is switched from the fifth state to the sixth state, and then, the sixth state is switched to the fifth state. And a third data switching unit for reading the other part other than the part of the data included in the control data from another block different from the one block with reference to the third data. The home controller according to claim 1, further comprising read / write means for writing to said one block.
【請求項3】 前記ホームコントローラは、 不揮発性のメモリからなるデータバッファ領域をさらに
含み、 前記書込手段は、 制御用データを前記データバッファ領域に書込むための
バッファ書込手段と、 前記バッファ書込手段に格納されているデータを読出し
て前記ブロックに書込むためのバッファ読出手段とを含
み、 前記ホームコントローラは、さらに、 異常発生により前記書込手段による書込動作が中断され
た際の復旧のために、前記制御用データのうちの前記ブ
ロックに書込まれた部分を除く部分を前記データバッフ
ァ領域から読出して前記ブロックに書込むための部分読
出書込手段をさらに含む、請求項1または2記載のホー
ムコントローラ。
3. The home controller further includes a data buffer area formed of a non-volatile memory, the writing means includes: buffer writing means for writing control data in the data buffer area; and the buffer. Buffer read means for reading the data stored in the write means and writing the data in the block, wherein the home controller is further provided when the write operation by the write means is interrupted due to an abnormality. 2. The read / write means for reading the part of the control data excluding the part written in the block from the data buffer area and writing the read data in the block for recovery. Alternatively, the home controller described in 2.
【請求項4】 前記2つのブロックの各々は、一括消去
可能な記憶領域を含む、請求項1,2または3記載のホ
ームコントローラ。
4. The home controller according to claim 1, wherein each of the two blocks includes a storage area that can be collectively erased.
【請求項5】 前記制御用データ記憶手段に含まれる2
つのブロックと、前記第1のデータ記憶手段に含まれる
2つの第1のデータを格納する領域と、前記第2のデー
タ記憶手段に含まれる2つの第2のデータを格納する領
域との一方ずつが一括消去可能なメモリ上に設けられて
いる、請求項1,2または3記載のホームコントロー
ラ。
5. Included in the control data storage means 2
One block, one area for storing two first data included in the first data storage means, and one area for storing two second data included in the second data storage means 4. The home controller according to claim 1, wherein the home controller is provided on a memory that can be collectively erased.
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 true JPH07154870A (en) 1995-06-16
JP3184383B2 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366423A (en) * 2001-06-04 2002-12-20 Samsung Electronics Co Ltd Method for managing flash memory

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002366423A (en) * 2001-06-04 2002-12-20 Samsung Electronics Co Ltd Method for managing flash memory
US6938116B2 (en) * 2001-06-04 2005-08-30 Samsung Electronics Co., Ltd. Flash memory management method
USRE44052E1 (en) 2001-06-04 2013-03-05 Samsung Electronics Co., Ltd. Flash memory management method
USRE45222E1 (en) 2001-06-04 2014-10-28 Samsung Electronics Co., Ltd. Method of writing of writing to a flash memory including data blocks and log blocks, using a logical address having a block address portion and page identifying portion, a block address table and a page table
USRE45577E1 (en) * 2001-06-04 2015-06-23 Samsung Electronics Co., Ltd. Method of writing to a flash memory including data blocks and log blocks
USRE46404E1 (en) * 2001-06-04 2017-05-16 Samsung Electronics Co., Ltd. Flash memory management method

Also Published As

Publication number Publication date
JP3184383B2 (en) 2001-07-09

Similar Documents

Publication Publication Date Title
JPH06276249A (en) Transmission control system
CN1963758A (en) Method and apparatus for securely updating and boot code image
CN111736873B (en) Program updating method, device, equipment and storage medium of electronic control unit
KR100342020B1 (en) Remote controlled computer system having identification number and management method of the same
CN107943501A (en) Embedded device upgrade method, device, computer equipment and storage medium
US5901311A (en) Access key protection for computer system data
US7590793B2 (en) Data access controlling method in flash memory and data access controlling program
KR20070008908A (en) Data processing device and control method of the same
JPH11328982A (en) Data management system for flash memory
JP3184383B2 (en) Home controller
US5956480A (en) Terminal and online system for tracking version of data and program
JPH10240629A (en) Intra-memory information updating method
WO2003085889A1 (en) Method for recognizing electronic appliance in multiple control system
US6832336B2 (en) Method and apparatus for maintaining consistent data
CN105659174A (en) Control device for distributed control system
JP2007310571A (en) Control program creating device, editing program and program creating method
JPS59174912A (en) Programming device
US10705743B2 (en) Memory control device, control method of flash memory, and method for generating security feature of flash memory
JPH10187454A (en) Bios reloading system
JP3854273B2 (en) Apparatus and method for setting communication packet
JPH09237182A (en) Communication equipment
JP3079782B2 (en) Master slave network system
JPH10149968A (en) Communication controller for semiconductor manufacturing equipment
JPH11184833A (en) Discrimination method for write termination of microcomputer
JP2002024044A (en) Controller

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