JP5074104B2 - Data storage device - Google Patents

Data storage device Download PDF

Info

Publication number
JP5074104B2
JP5074104B2 JP2007151638A JP2007151638A JP5074104B2 JP 5074104 B2 JP5074104 B2 JP 5074104B2 JP 2007151638 A JP2007151638 A JP 2007151638A JP 2007151638 A JP2007151638 A JP 2007151638A JP 5074104 B2 JP5074104 B2 JP 5074104B2
Authority
JP
Japan
Prior art keywords
storage
address
data
stored
time
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.)
Active
Application number
JP2007151638A
Other languages
Japanese (ja)
Other versions
JP2008305161A5 (en
JP2008305161A (en
Inventor
裕政 久保
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Daihen Corp
Original Assignee
Daihen 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 Daihen Corp filed Critical Daihen Corp
Priority to JP2007151638A priority Critical patent/JP5074104B2/en
Publication of JP2008305161A publication Critical patent/JP2008305161A/en
Publication of JP2008305161A5 publication Critical patent/JP2008305161A5/ja
Application granted granted Critical
Publication of JP5074104B2 publication Critical patent/JP5074104B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Description

本発明は、計測データを保存するためのデータ保存装置であって、特に、記憶媒体としてNAND型フラッシュメモリを使用したデータ保存装置に関する。   The present invention relates to a data storage device for storing measurement data, and more particularly to a data storage device using a NAND flash memory as a storage medium.

太陽電池により直流電力を発電し、パワーコンディショナにより直流電力を交流電力に変換して商用電力系統に連系させて電力を供給する太陽光発電システムがある。この太陽光発電システムにおいて発電状況を管理するために、パワーコンディショナの動作状況を示す発電データが計測される。また、気象状況と発電効率との関係を分析するために、日射量などの気象データも計測される。これらの計測データは所定時間ごと(例えば1分ごと)に、管理用のコンピュータに送信され、蓄積されて、気象状況と発電効率との関係を分析するために使用される。この計測データの送信にトラブルが発生した場合(例えば、管理用のコンピュータの不安定動作により計測データの受信ができていなかった場合など)に備えて、太陽光発電システムのデータ保存装置に所定期間(例えば3ヶ月間)の計測データを保存しておく必要がある。このため、太陽光発電システムのデータ保存装置は、大量のデータを保存できるだけの記憶容量が必要とされる。   There is a solar power generation system that generates DC power using a solar battery, converts DC power into AC power using a power conditioner, and connects the power to a commercial power system to supply the power. In order to manage the power generation status in this solar power generation system, power generation data indicating the operation status of the power conditioner is measured. In addition, weather data such as solar radiation is also measured to analyze the relationship between weather conditions and power generation efficiency. These measurement data are transmitted to a management computer every predetermined time (for example, every minute), accumulated, and used for analyzing the relationship between the weather condition and the power generation efficiency. In the event that trouble occurs in transmission of this measurement data (for example, measurement data could not be received due to an unstable operation of the management computer), the data storage device of the photovoltaic power generation system has a predetermined period. It is necessary to save measurement data (for example, for 3 months). For this reason, the data storage device of the photovoltaic power generation system requires a storage capacity that can store a large amount of data.

例えば、太陽光発電システムに20台のパワーコンディショナが接続されており、各パワーコンディショナから入力される発電データを記憶するために必要な記憶容量が各14byteであり、気象データを記憶するために必要な記憶容量が32byteだとすると、1分につき20×14+32=312byte、3か月分だと312byte×60分×24時間×30日×3月≒40MBの記憶容量が必要とされる。   For example, 20 power conditioners are connected to a photovoltaic power generation system, and each storage capacity necessary for storing power generation data input from each power conditioner is 14 bytes, and weather data is stored. If the required storage capacity is 32 bytes, the storage capacity of 20 × 14 + 32 = 312 bytes per minute, 312 bytes × 60 minutes × 24 hours × 30 days × March≈40 MB is required for 3 months.

また、蓄積されたデータが停電により消失しないようにする必要もある。補助電源としてバッテリを設ける方法があるが、メンテナンスが必要となるので、維持コストが上昇する。メンテナンスを不要とするために、停電時に電源を供給できるようにするのではなく、電源が供給されなくても記憶されているデータが消失しないフラッシュメモリなどの不揮発性メモリを使用することが好ましい。   It is also necessary to prevent the stored data from being lost due to a power failure. Although there is a method of providing a battery as an auxiliary power source, maintenance is required, and the maintenance cost increases. In order to eliminate the need for maintenance, it is preferable to use a non-volatile memory such as a flash memory in which stored data is not lost even if power is not supplied, instead of enabling power to be supplied in the event of a power failure.

フラッシュメモリにはNOR型フラッシュメモリとNAND型フラッシュメモリがある。NOR型フラッシュメモリは、1バイト単位のランダムアクセスが可能であるが、大容量化には向いておらず、書き込み速度が遅い。NOR型フラッシュメモリを上記の太陽光発電システムのデータ保存装置に使用する場合、40MBの記憶容量を確保するために、2MBのNOR型フラッシュメモリが20個必要となる。20個のNOR型フラッシュメモリを搭載するとデータ保存装置が大型化、重量化することになり好ましくない。また、コストの面でも現実的でない。   The flash memory includes a NOR flash memory and a NAND flash memory. The NOR type flash memory can perform random access in units of 1 byte, but is not suitable for increasing the capacity and the writing speed is slow. When a NOR flash memory is used in the data storage device of the above-described photovoltaic power generation system, 20 2 MB NOR flash memories are required to secure a storage capacity of 40 MB. If 20 NOR-type flash memories are installed, the data storage device is undesirably increased in size and weight. Also, it is not realistic in terms of cost.

一方、NAND型フラッシュメモリは、大容量化が可能で書き込み速度が速い。従って、大きな記憶容量が必要とされるデータ保存装置には、NAND型フラッシュメモリの方が適している。しかし、一般的なNAND型フラッシュメモリの各記憶領域における書き換え可能回数は10万回程度である。また、FATなどのファイル形式でデータを保存すると、データの書き換えごとにメモリの管理領域の書き換えが行われる。従って、NAND型フラッシュメモリ全体としても書き換え可能回数は10万回程度となる。従って、NAND型フラッシュメモリをデータ保存装置に搭載する場合、データの書き換え回数を可及的に減少させることが望ましく、データの書き換え回数を削減するための方法が開発されている。   On the other hand, the NAND flash memory can be increased in capacity and has a high writing speed. Therefore, the NAND flash memory is more suitable for a data storage device that requires a large storage capacity. However, the number of rewritable times in each storage area of a general NAND flash memory is about 100,000 times. When data is saved in a file format such as FAT, the memory management area is rewritten every time the data is rewritten. Accordingly, the number of times that the NAND flash memory can be rewritten is about 100,000 times. Therefore, when a NAND flash memory is mounted on a data storage device, it is desirable to reduce the number of data rewrites as much as possible, and a method for reducing the number of data rewrites has been developed.

例えば、特表2005−524156号公報には、計測データを格納するためにNAND型フラッシュメモリを使用する方法が記載されている。この公報に記載の方法によると、新たに取得されたデータをNAND型フラッシュメモリに格納されているデータと比較して変更が必要な場合にのみ書き換えを行う。これにより、NAND型フラッシュメモリの書き換え回数が削減される。   For example, Japanese Translation of PCT International Publication No. 2005-524156 describes a method of using a NAND flash memory to store measurement data. According to the method described in this publication, the newly acquired data is compared with the data stored in the NAND flash memory and is rewritten only when a change is necessary. Thereby, the number of times of rewriting of the NAND flash memory is reduced.

特表2005‐524156号公報JP 2005-524156 A

しかしながら、データが新たに取得される毎にデータを書き換える必要がある場合には、上記公報に記載の方法による書き換え回数の削減効果は働かない。例えば、上記太陽光発電システムのデータ保存装置の場合、1分ごとに新たなデータが取得される。データ取得からメモリへの保存までの間に停電が発生すると取得されたデータが失われてしまうので、取得されたデータはその都度記憶されるのが望ましい。従って、データの書き換えが1分毎に行われ、メモリの管理領域は1分ごとに書き換えられることになる。そうすると、10万回÷(60分×24時間)≒70日でメモリの管理領域の書き換え回数が保証された回数を超えることになる。すなわち、NAND型フラッシュメモリの寿命の実用的な期間の保証ができない。 However, when it is necessary to rewrite data every time data is newly acquired, the effect of reducing the number of rewrites by the method described in the above publication does not work. For example, in the case of the data storage device of the solar power generation system, new data is acquired every minute. If a power failure occurs between data acquisition and storage in memory, the acquired data will be lost, so it is desirable to store the acquired data each time. Therefore, data is rewritten every minute, and the management area of the memory is rewritten every minute. Then, the number of rewrites of the management area of the memory exceeds the guaranteed number of times in 100,000 times ÷ (60 minutes × 24 hours) ≈70 days. That is, it is impossible to guarantee a practical period of the lifetime of the NAND flash memory.

本発明は上記した事情のもとで考え出されたものであって、使用されるメモリの一部にデータ書き換えが集中することを防ぎ、メモリの実用的な寿命を保証できるデータ保存装置を提供することをその目的としている。   The present invention has been conceived under the circumstances described above, and provides a data storage device capable of preventing data rewriting from being concentrated on a part of a memory used and guaranteeing a practical life of the memory. Its purpose is to do.

上記課題を解決するため、本発明では、次の技術的手段を講じている。   In order to solve the above problems, the present invention takes the following technical means.

本発明の第1の側面によって提供されるデータ保存装置は、複数の記憶領域に分割され、各記憶領域にアドレスが順番に付されている第1の記憶手段と、データを記憶すべき前記第1の記憶手段の記憶領域のアドレスを記憶する、当該第1の記憶手段とは異なる揮発性の第2の記憶手段と、現在の時刻を計時する計時手段と、データの保存が指令される毎に、当該データを前記計時手段により計時される保存時の時刻データとともに、前記第1の記憶手段の、前記第2の記憶手段に記憶されたアドレスの記憶領域に記憶させる記憶制御手段と、前記第1の記憶手段に前記データが記憶される毎に、前記第2の記憶手段に記憶された前記アドレスを、前記第1の記憶手段に付された複数のアドレスが循環するように次のアドレスに変更するアドレス変更手段と、前記第2の記憶手段に記憶された前記アドレスが消失しているか否かを判別する判別手段と、前記判別手段により前記アドレスが消失していると判別されると、前記第1の記憶手段の各記憶領域に記憶されている前記時刻データと前記計時手段により計時される判別時の時刻データとを用いて、当該判別後に保存が指令されるデータに対する前記第1の記憶手段の記憶領域のアドレスを決定し、そのアドレスを前記第2の記憶手段に記憶させるアドレス記憶制御手段とを備えたことを特徴とする(請求項1)。 Data storage device to a first aspect of the present invention is divided into a plurality of storage areas, address to each storage area to be stored in the first storage means are assigned sequentially, the data The storage area address of the first storage means is stored, a volatile second storage means different from the first storage means, a time measuring means for measuring the current time, and data saving are instructed. Storage control means for storing the data together with time data at the time of storage timed by the time measuring means in the storage area of the address stored in the second storage means of the first storage means; the next each time the data in the first storage means is stored, said the address stored in the second storage means, so that said first plurality of address attached to the storage means is circulated Change the address to A change means, and determination means for determining whether said second of said address stored in the storage unit is lost, when it is judged the address has disappeared by the determination means, the first Using the time data stored in each storage area of one storage means and the time data at the time of determination determined by the time measuring means, the first storage means for data commanded to be stored after the determination Address storage control means for determining the address of the storage area and storing the address in the second storage means (claim 1).

この構成によると、第2の記憶手段には、第1の記憶手段においてデータが記憶されるべき記憶領域を指定するアドレスが記憶されている。このアドレスはその指定する第1の記憶手段の記憶領域にデータが記憶されると、次の記憶領域が有る場合は次の記憶領域を、次の記憶領域が無い場合は先頭の記憶領域を指定するアドレスに更新される。データの記憶のたびに書き換えられるメモリの管理領域が第1の記憶手段の中に無いので、第1の記憶手段において一部の記憶領域にデータの書き換えが集中することが防止される。また、データの記憶がアドレスの順に行われるので、各記憶領域の書き換えが均一化され記憶領域毎のデータ書き換え回数は緩和される。従って、頻繁にデータの書き換えが必要であっても、同じ記憶領域に書き換えが集中せず、書き換えによる劣化が抑制されるので、第1の記憶手段の実用的な寿命を保証することができる。   According to this configuration, the second storage unit stores an address that designates a storage area in which data is to be stored in the first storage unit. When the data is stored in the storage area of the specified first storage means, this address specifies the next storage area if there is a next storage area, and the first storage area if there is no next storage area Is updated to the address you want. Since there is no memory management area in the first storage means that is rewritten each time data is stored, it is possible to prevent data rewriting from being concentrated in some storage areas in the first storage means. In addition, since data is stored in the order of addresses, the rewrite of each storage area is made uniform, and the number of data rewrites for each storage area is reduced. Therefore, even if data rewriting is necessary frequently, rewriting does not concentrate on the same storage area, and deterioration due to rewriting is suppressed, so that the practical life of the first storage means can be guaranteed.

また、この構成によると、第1の記憶手段にはデータに対応付けて時刻データが記憶されている。第2の記憶手段に記憶されたアドレスが消失した場合、各記憶領域に記憶されている時刻データと現在時刻とから、次にデータが記憶されるべき記憶領域を指定するアドレスが決定されるので、停電などで第2の記憶手段の記憶が消失した場合でも、記憶再開時にデータを記憶すべき記憶領域が不明となることを防ぐことができる。 Further, according to this configuration, the time data is stored in association with the data in the first storage means. When the address stored in the second storage means disappears, the address specifying the storage area where the data is to be stored next is determined from the time data stored in each storage area and the current time. Even when the storage of the second storage means disappears due to a power failure or the like, it is possible to prevent the storage area in which data is stored from being unknown when the storage is resumed.

また、請求項に記載のデータ保存装置において、前記アドレス記憶制御手段は、前記第1の記憶手段の先頭の記憶領域に記憶されている前記時刻データと前記計時手段により計時される前記判別時の時刻データの差から仮のアドレスを設定する仮アドレス設定手段と、前記仮アドレス設定手段によって設定された前記仮のアドレスの記憶領域に前記データが記憶されていないか、若しくは前記先頭の記憶領域に記憶された前記データの保存時刻よりも前の保存時刻を示す時刻データが記憶されている場合であって、前記仮のアドレスの1つ前のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも後の保存時刻を示す時刻データが記憶されているとの第1の条件を満たすか否かを判別する第1の判別手段と、前記第1の判別手段により前記第1の条件を満たすと判別されると、前記仮のアドレスを前記第2の記憶手段に記憶する記憶処理手段と、前記第1の判別手段により前記第1の条件を満たさないと判別されると、前記仮のアドレスの記憶領域に前記データが記憶されていないか、若しくは当該仮のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも前の保存時刻を示す時刻データが記憶されているとの第2の条件と、前記仮のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも後の保存時刻を示す時刻データが記憶されているとの第3の条件のいずれが満たされるかを判別する第2の判別手段と、前記第2の判別手段により前記第2の条件を満たすと判別されると、前記第1の判別手段の処理における前記仮のアドレスを当該仮のアドレスと前記先頭の記憶領域のアドレスの間の所定のアドレスに変更し、前記第2の判別手段により前記第3の条件を満たすと判別されると、前記第1の判別手段の処理における前記仮のアドレスを当該仮のアドレスの次のアドレスに変更する仮アドレス変更手段と、前記記憶処理手段が前記仮のアドレスを前記第2の記憶手段に記憶するまで、前記第1の判別手段、前記第2の判別手段および前記仮アドレス変更手段による処理を繰り返す繰返制御手段と、からなるとよい(請求項)。 The data storage device according to claim 1 , wherein the address storage control unit is configured to perform the determination time measured by the time data stored in the first storage area of the first storage unit and the time measuring unit. Temporary address setting means for setting a temporary address from the difference between the time data, and whether the data is stored in the temporary address storage area set by the temporary address setting means, or the leading storage area Is stored in the first storage area in the storage area of the address immediately before the temporary address, in which case the time data indicating the storage time before the storage time of the data stored in is stored. First determination means for determining whether or not a first condition that time data indicating a storage time later than the storage time of the data stored is stored is satisfied, When it is determined that the first condition is satisfied by the first determination means, the first determination means stores the temporary address in the second storage means, and the first determination means determines the first If it is determined that the condition is not satisfied, the data is not stored in the temporary address storage area, or the storage time of the data stored in the first storage area in the temporary address storage area A second condition that time data indicating a previous storage time is stored, and a storage after the storage time of the data stored in the first storage area in the temporary address storage area It is determined by the second determination unit that determines which of the third conditions that the time data indicating the time is stored is satisfied, and the second determination unit satisfies the second condition And the first The temporary address in the processing of the determination means is changed to a predetermined address between the temporary address and the address of the head storage area, and the second determination means determines that the third condition is satisfied. And a temporary address changing means for changing the temporary address in the processing of the first determining means to an address next to the temporary address; and the storage processing means sends the temporary address to the second storage means. until memory, said first determination means, and repeat control means for repeating the processing by the second discriminating means and said temporary address change means may consist of (claim 2).

この構成によると、停電などで第2の記憶手段の記憶が消失した場合でも、時刻データを利用して第1の記憶手段の記憶領域の探索を行うことにより、早急に、次にデータが記憶されるべき記憶領域を指定するアドレスを決定することができる。   According to this configuration, even if the storage of the second storage unit is lost due to a power failure or the like, the next data is stored immediately by searching the storage area of the first storage unit using the time data. An address specifying a storage area to be performed can be determined.

なお、請求項1または2に記載のデータ保存装置において、前記第1の記憶手段は、不揮発性メモリであるとよい(請求項)。 In the data storage device according to claim 1 or 2 , the first storage means may be a non-volatile memory (claim 3 ).

この構成によると、第1の記憶手段に記憶されたデータは停電などの電源供給停止により失われることが無いので、データ保存装置に補助電源を設ける必要が無い。   According to this configuration, the data stored in the first storage means is not lost due to a power supply stop such as a power failure, so there is no need to provide an auxiliary power source in the data storage device.

また、請求項に記載のデータ保存装置において、前記第1の記憶手段は、NAND型フラッシュメモリであるとよい(請求項)。 Further, in the data storage device according to claim 3 , the first storage means may be a NAND flash memory (claim 4 ).

この構成によると、NAND型フラッシュメモリは大容量化に適しているので、大型化やコストを増大することなしに、データ保存装置の記憶容量の大容量化を図ることができる。   According to this configuration, since the NAND flash memory is suitable for increasing the capacity, the storage capacity of the data storage device can be increased without increasing the size and cost.

なお、請求項1〜のいずれかに記載のデータ保存装置において、前記第1の記憶手段の各記憶領域に記憶される複数のデータは、太陽光発電システムにおいて周期的に計測される当該システムの動作を制御するデータと気象に関するデータであるとよい(請求項)。 The data storage device according to any one of claims 1 to 4 , wherein the plurality of data stored in each storage area of the first storage unit are periodically measured in a solar power generation system. may is data about data and weather for controlling the operation (claim 5).

この構成によると、周期的に計測される当該システムの動作を制御するデータと気象に関するデータは頻繁に書き換えられるものであるが、この書き換えによっても第1の記憶手段の実用的な寿命を保証することができる。   According to this configuration, the data for controlling the operation of the system and the data related to the weather, which are periodically measured, are frequently rewritten, but the practical life of the first storage means is also guaranteed by this rewriting. be able to.

本発明の第2の側面によって提供されるプログラムは、コンピュータを、複数の記憶領域に分割され、各記憶領域にアドレスが順番に付されている不揮発性の第1の記憶装置のデータを記憶すべきアドレスを、当該第1の記憶装置とは異なる揮発性の第2の記憶装置に記憶させるアドレス記憶制御手段と、データの保存が指令される毎に、当該データを計時装置により計時される保存時の時刻データとともに、前記第1の記憶装置の、前記第2の記憶装置に記憶されたアドレスの記憶領域に記させるデータ記憶制御手段と、前記第1の記憶装置に前記データ記憶される毎に、前記第2の記憶装置に記憶された前記アドレスを、前記第1の記憶装置に付された複数のアドレスが循環するように次のアドレスに変更するアドレス変更手段と、前記第2の記憶装置に記憶された前記アドレスが消失しているか否かを判別する判別手段と、前記判別手段により前記アドレスが消失していると判別されると、前記第1の記憶装置の各記憶領域に記憶されている前記時刻データと前記計時装置により計時される判別時の時刻データとを用いて、当該判別後に保存が指令されるデータに対する前記第1の記憶装置の記憶領域のアドレスを決定し、そのアドレスを前記第2の記憶装置に記憶させる第2のアドレス記憶制御手段として機能させることを特徴とする(請求項)。この構成によると、上記請求項1の発明と同様の作用効果を奏する。 The program provided by the second aspect of the present invention stores the data of the nonvolatile first storage device in which the computer is divided into a plurality of storage areas, and addresses are assigned to the storage areas in order. an address to a said first second address storage control means Ru stored in the storage devices of different volatile storage device, each time the storage of the data is commanded, measured by the time measuring device the data together with time data at the time of saving to be, said first storage device, said second data storage control means to the storage area of the stored address Ru is memorize in the memory device, the said first storage device each data Ru stored, the second of said address stored in the storage device, and an address changing means for changing to the next address as said first plurality of address attached to the storage device circulates , Determining means for determining whether or not the address stored in the second storage device is lost; and when the determination means determines that the address is lost, the first storage device Using the time data stored in each storage area and the time data at the time of determination determined by the time measuring device, the address of the storage area of the first storage device for the data to be stored after the determination It determines, characterized in that to function as the second address storage control means for storing the address in the second storage device (claim 6). According to this structure, there exists an effect similar to invention of the said Claim 1.

また、請求項に記載のプログラムにおいて、前記第2のアドレス記憶制御手段は、前記第1の記憶装置の先頭の記憶領域に記憶されている前記時刻データと前記計時装置により計時される前記判別時の時刻データの差から仮のアドレスを設定する仮アドレス設定手段と、前記仮アドレス設定手段によって設定された前記仮のアドレスの記憶領域に前記データが記憶されていないか、若しくは前記先頭の記憶領域に記憶された前記データの保存時刻よりも前の保存時刻を示す時刻データが記憶されている場合であって、前記仮のアドレスの1つ前のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも後の保存時刻を示す時刻データが記憶されているとの第1の条件を満たすか否かを判別する第1の判別手段と、前記第1の判別手段により前記第1の条件を満たすと判別されると、前記仮のアドレスを前記第2の記憶手段に記憶する記憶処理手段と、前記第1の判別手段により前記第1の条件を満たさないと判別されると、前記仮のアドレスの記憶領域に前記データが記憶されていないか、若しくは当該仮のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも前の保存時刻を示す時刻データが記憶されているとの第2の条件と、前記仮のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも後の保存時刻を示す時刻データが記憶されているとの第3の条件のいずれが満たされるかを判別する第2の判別手段と、前記第2の判別手段により前記第2の条件を満たすと判別されると、前記第1の判別手段の処理における前記仮のアドレスを当該仮のアドレスと前記先頭の記憶領域のアドレスの間の所定のアドレスに変更し、前記第2の判別手段により前記第3の条件を満たすと判別されると、前記第1の判別手段の処理における前記仮のアドレスを当該仮のアドレスの次のアドレスに変更する仮アドレス変更手段と、前記記憶処理手段が前記仮のアドレスを前記第2の記憶手段に記憶するまで、前記第1の判別手段、前記第2の判別手段および前記仮アドレス変更手段による処理を繰り返す繰返制御手段と、からなり、前記コンピュータを、前記仮アドレス設定手段、前記第1の判別手段、前記記憶処理手段、前記第2の判別手段、前記仮アドレス変更手段及び繰返制御手段として機能させるとよい(請求項)。この構成によると、上記請求項の発明と同様の作用効果を奏する。 The program according to claim 6 , wherein the second address storage control unit is configured to measure the time data stored in the first storage area of the first storage device and the time measured by the timing device. Temporary address setting means for setting a temporary address from the difference in time data, and whether the data is stored in the temporary address storage area set by the temporary address setting means, or the first storage In the case where time data indicating a storage time before the storage time of the data stored in the area is stored, the storage area of the address immediately before the temporary address is stored in the first storage area. First determination means for determining whether or not a first condition that time data indicating a storage time later than the storage time of the stored data is stored is satisfied. When it is determined by the first determination means that the first condition is satisfied, a storage processing means for storing the temporary address in the second storage means, and the first determination means by the first determination means If it is determined that the condition is not satisfied, the data is not stored in the temporary address storage area, or the storage time of the data stored in the first storage area in the temporary address storage area A second condition that time data indicating a previous storage time is stored, and a storage after the storage time of the data stored in the first storage area in the temporary address storage area It is determined by the second determination unit that determines which of the third conditions that the time data indicating the time is stored is satisfied, and the second determination unit satisfies the second condition And the above The temporary address in the processing of the determining means is changed to a predetermined address between the temporary address and the address of the first storage area, and the second determining means determines that the third condition is satisfied. Then, a temporary address changing unit that changes the temporary address in the process of the first determining unit to an address next to the temporary address, and the storage processing unit converts the temporary address to the second storage unit. And repeating control means for repeating the processing by the first determining means, the second determining means and the temporary address changing means until the information is stored in the computer, the computer is connected to the temporary address setting means, discriminating means, the storage processing unit, the second determining means, may function as the temporary address change means and repetition control means (claim 7). According to this structure, there exists an effect similar to invention of the said Claim 2 .

本発明の第3の側面によって提供される記録媒体は、請求項6または7に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体であることを特徴とする(請
求項)。
The recording medium provided by the third aspect of the present invention is a computer-readable recording medium in which the program according to claim 6 or 7 is recorded (claim 8 ).

本発明のその他の特徴および利点は、添付図面を参照して以下に行う詳細な説明によって、より明らかとなろう。   Other features and advantages of the present invention will become more apparent from the detailed description given below with reference to the accompanying drawings.

以下、本発明の好ましい実施の形態を、太陽光発電システムのデータ保存装置として適用した場合を例に、図面を参照して具体的に説明する。   Hereinafter, a case where a preferred embodiment of the present invention is applied as a data storage device of a solar power generation system will be specifically described with reference to the drawings.

図1は、太陽光発電システムのデータ保存装置の内部構成を示すブロック図である。図1に示すように、太陽光発電システムは、複数のパワーコンディショナ20、気象データの計測装置40〜44、パワーコンディショナ20の動作状況を示す発電データと気象データとを保存するデータ保存装置1、太陽光発電システムの稼働状況及び気象と発電効率との関係を分析するための管理用コンピュータ5、及び図示しない系統と太陽電池とで構成されている。各パワーコンディショナ20の電力出力端は系統の電力入力端に並列に接続されている。各パワーコンディショナ20の電圧/電流の計測値の出力端と各計測装置40〜44の出力端はデータ保存装置1に接続されている。データ保存装置1には管理用コンピュータ5が接続されている。 FIG. 1 is a block diagram showing an internal configuration of a data storage device of a photovoltaic power generation system. As shown in FIG. 1, the photovoltaic power generation system includes a plurality of power conditioners 20, meteorological data measuring devices 40 to 44, and a data storage device that stores power generation data and weather data indicating the operation status of the power conditioner 20. 1. It is composed of a management computer 5 for analyzing the operational status of the photovoltaic power generation system and the relationship between weather and power generation efficiency, and a system and a solar cell (not shown). The power output terminal of each power conditioner 20 is connected in parallel to the power input terminal of the system. The output terminals of the measured values of the voltage / current of each power conditioner 20 and the output terminals of the measuring devices 40 to 44 are connected to the data storage device 1. A management computer 5 is connected to the data storage device 1.

データ保存装置1は、発電データと気象データとを収集して蓄積し、外部の管理用コンピュータからの指示によりデータを当該管理用コンピュータに送信するものである。データ保存装置1は、CPU11、ROM12、RAM13、NAND型フラッシュメモリ14、パワーコンディショナ入出力I/F15、計測装置入出力I/F16、及び入出力I/F17、タイマ18を備えており、各部はバス(BUS)19によって相互に接続されている。 Data storage device 1 collects the power data and weather data stored, and transmits the data according to an instruction from an external management computer 5 to the management computer 5. The data storage device 1 includes a CPU 11, a ROM 12, a RAM 13, a NAND flash memory 14, a power conditioner input / output I / F 15, a measurement device input / output I / F 16, an input / output I / F 17, and a timer 18. Are connected to each other by a bus (BUS) 19.

パワーコンディショナ入出力I/F15には、20台のパワーコンディショナ20が接続されている。また、計測装置入出力I/F16には、気象データを計測するための複数種類の計測装置(本実施形態では5種類の計測装置)、すなわち、日射計40、気温計41、風向計42、風速計43、雨量計44が接続されている。また、入出力I/F17には、通信回線を介して、外部の管理用コンピュータ5が接続されている。   Twenty power conditioners 20 are connected to the power conditioner input / output I / F 15. The measurement device input / output I / F 16 includes a plurality of types of measurement devices (in this embodiment, five types of measurement devices) for measuring meteorological data, that is, a pyranometer 40, a thermometer 41, an anemometer 42, An anemometer 43 and a rain gauge 44 are connected. An external management computer 5 is connected to the input / output I / F 17 via a communication line.

データ保存装置1は、各パワーコンディショナ20及び各計測装置40〜44から入力される各計測値から計測項目毎に算出された計測データを、管理用コンピュータ5に送信し、NAND型フラッシュメモリ14に記憶する。各計測値は、CPU11からの6秒毎の計測指示に対して入力され、10個の計測値が入力される毎に平均値が算出されるので、各計測データは1分毎に算出される。なお、各計測項目の計測値の入力及び計測データの算出は同じタイミングで行われる。計測項目毎に算出された計測データはまとめて、その記憶される時刻を示すデータであるタイムスタンプとともに、NAND型フラッシュメモリ14の1つのセクタに記憶される。なお、CPU11による計測指示から計測値の入力までの時間はごく短い時間であり、CPU11による計測データの算出もごく短い時間である。従って、タイムスタンプが示す計測データの記憶された時刻は、10個目の計測値が計測された時刻と同一と考えることができる。   The data storage device 1 transmits measurement data calculated for each measurement item from each measurement value input from each power conditioner 20 and each measurement device 40 to 44 to the management computer 5, and the NAND flash memory 14. To remember. Each measurement value is input in response to a measurement instruction every 6 seconds from the CPU 11, and an average value is calculated every time 10 measurement values are input. Therefore, each measurement data is calculated every minute. . In addition, the input of the measurement value of each measurement item and the calculation of measurement data are performed at the same timing. The measurement data calculated for each measurement item is collectively stored in one sector of the NAND flash memory 14 together with a time stamp which is data indicating the stored time. Note that the time from the measurement instruction by the CPU 11 to the input of the measurement value is a very short time, and the calculation of the measurement data by the CPU 11 is also a very short time. Therefore, the time when the measurement data indicated by the time stamp is stored can be considered to be the same as the time when the tenth measurement value is measured.

なお、各パワーコンディショナ20からは、計測値として、その接続されている太陽電池が発電した直流電力の電流値と電圧値、当該パワーコンディショナ20により変換された交流電力の電流値と電圧値が入力される。それぞれ算出された計測データが発電データとして記憶される。本実施形態では、20台のパワーコンディショナ20が設けられているので、1分毎に算出される発電データは80個の計測データとなる。日射計40、気温計41、風向計42、風速計43、雨量計44からは、計測値として、それぞれ日射量、気温、風向、風速、雨量が入力され、それぞれ算出された日射量データ、気温データ、風向データ、風速データ、雨量データが気象データとして記憶される。 In addition, from each power conditioner 20, the current value and voltage value of the direct-current power which the connected solar cell generated as a measured value, the current value and voltage value of the alternating current power converted by the said power conditioner 20 are measured. Is entered. The calculated measurement data is stored as power generation data. In this embodiment, since 20 power conditioners 20 are provided, the power generation data calculated every minute is 80 pieces of measurement data. The solar radiation meter 40, the air temperature meter 41, the wind vane meter 42, the anemometer 43, and the rain gauge 44 are respectively input with the solar radiation amount, the temperature, the wind direction, the wind speed, and the rain amount. Data, wind direction data, wind speed data, and rainfall data are stored as weather data.

CPU11は、データ保存装置1の制御の中枢となるものであり、ROM12に記憶されている制御プログラムに従って制御を行う。具体的には、CPU11はタイマ18が計時する時刻に従って6秒ごとに、パワーコンディショナ入出力I/F15を介して各パワーコンディショナ20に計測指示を出し、計測装置入出力I/F16を介して各計測装置40〜44に計測指示を出す。また、CPU11は、入力された計測値の平均値を計測データとして算出する。更に、CPU11は、算出した計測データを管理用コンピュータ5に送信し、NAND型フラッシュメモリ14に記憶する。また、CPU11は、管理用コンピュータ5からの要求に基づき、保存されている計測データを管理用コンピュータ5へ送信する。   The CPU 11 is the center of control of the data storage device 1 and performs control according to a control program stored in the ROM 12. Specifically, the CPU 11 issues a measurement instruction to each power conditioner 20 via the power conditioner input / output I / F 15 every 6 seconds according to the time counted by the timer 18, and via the measurement device input / output I / F 16. Then, a measurement instruction is issued to each measurement device 40-44. Further, the CPU 11 calculates an average value of the input measurement values as measurement data. Further, the CPU 11 transmits the calculated measurement data to the management computer 5 and stores it in the NAND flash memory 14. Further, the CPU 11 transmits the stored measurement data to the management computer 5 based on a request from the management computer 5.

ROM12は、データ保存装置1を制御するための制御プログラムを記憶するものである。   The ROM 12 stores a control program for controlling the data storage device 1.

NAND型フラッシュメモリ14は、CPU11が算出した計測データを保存するためのものである。NAND型フラッシュメモリ14は、データの書き換えの度に管理領域の書き換えが行われるファイル形式を採用せず、全てのメモリ領域をセクタに分割し、RAM13に記憶されたアドレスに基づいて、計測データを記憶する方法を採用している。この記憶方法については後述する。   The NAND flash memory 14 is for storing measurement data calculated by the CPU 11. The NAND flash memory 14 does not employ a file format in which the management area is rewritten each time data is rewritten, divides all memory areas into sectors, and stores measurement data based on addresses stored in the RAM 13. The method of memorizing is adopted. This storage method will be described later.

RAM13は、CPU11に対して作業領域を提供するものであり、計算データ等を一時的に記憶する。また、RAM13には、NAND型フラッシュメモリ14内の、次に計測データを記憶するセクタ(以下、「保存先セクタ」という。)のアドレス(以下、「保存先セクタアドレス」という。)が記憶されている。   The RAM 13 provides a work area for the CPU 11 and temporarily stores calculation data and the like. In addition, the RAM 13 stores an address (hereinafter referred to as “save destination sector address”) of a sector (hereinafter referred to as “save destination sector”) in the NAND flash memory 14 where measurement data is stored next. ing.

パワーコンディショナ入出力I/F15は、各パワーコンディショナ20とのインターフェースを司るものである。各パワーコンディショナ20は、太陽電池が発電した直流電力を交流電力に変換して商用電力系統に連系させて電力を供給するものであり、商用電力系統に対して並列に接続されている。各パワーコンディショナ20は、CPU11からの計測指示を受けると、その計測指示に応じて太陽電池が発電した直流電力の電流値と電圧値、変換された交流電力の電流値と電圧値を計測し、その計測値をCPU11に返送する。本実施形態では20台のパワーコンディショナ20が接続されている場合を説明したがこれに限られず、1台以上の任意の台数が接続されていればよい。   The power conditioner input / output I / F 15 serves as an interface with each power conditioner 20. Each power conditioner 20 converts the DC power generated by the solar cell into AC power and connects it to the commercial power system to supply power, and is connected in parallel to the commercial power system. When each power conditioner 20 receives a measurement instruction from the CPU 11, it measures the current value and voltage value of the DC power generated by the solar cell and the current value and voltage value of the converted AC power according to the measurement instruction. The measurement value is returned to the CPU 11. Although this embodiment demonstrated the case where 20 power conditioners 20 were connected, it is not restricted to this, What is necessary is just to connect one or more arbitrary numbers.

計測装置入出力I/F16は、各計測装置40〜44とのインターフェースを司るものである。日射計40、気温計41、風向計42、風速計43、雨量計44は、CPU11からの計測指示を受けると、その計測指示に応じてそれぞれ日射量、気温、風向、風速、雨量を計測し、その計測値をCPU11に返送する。計測装置入出力I/F16に接続される計測装置は上記に限られず、太陽光発電の発電効率の分析のために必要とされるデータを計測するための計測装置が接続される。   The measuring device input / output I / F 16 serves as an interface with each measuring device 40-44. When receiving a measurement instruction from the CPU 11, the solar radiation meter 40, the air temperature meter 41, the anemometer 42, the anemometer 43, and the rain gauge 44 measure the solar radiation amount, the temperature, the wind direction, the wind speed, and the rainfall according to the measurement instructions. The measurement value is returned to the CPU 11. The measuring device connected to the measuring device input / output I / F 16 is not limited to the above, and a measuring device for measuring data required for analyzing the power generation efficiency of solar power generation is connected.

入出力I/F17は、外部の管理用コンピュータ5とのインターフェースを司るものである。CPU11は、計測データを算出すると、算出された計測データを管理用コンピュータ5に送信する。管理用コンピュータ5は、受信した計測データにより太陽光発電システムの稼働状況を監視し、蓄積した計測データを用いて気象条件に対する発電量の関係を分析する。また、蓄積した計測データにデータの欠損が生じた場合、当該欠損データを送信させるために、管理用コンピュータ5は、データ保存装置1に対して要求を行い、NAND型フラッシュメモリ14に保存されている計測データを送信させる。   The input / output I / F 17 serves as an interface with the external management computer 5. When calculating the measurement data, the CPU 11 transmits the calculated measurement data to the management computer 5. The management computer 5 monitors the operating status of the photovoltaic power generation system based on the received measurement data, and analyzes the relationship between the power generation amount and the weather conditions using the accumulated measurement data. In addition, when data loss occurs in the accumulated measurement data, the management computer 5 makes a request to the data storage device 1 to transmit the data loss, and is stored in the NAND flash memory 14. Send the measured data.

タイマ18は、計測値を計測する時刻を計時するものである。タイマ18は、いわゆるRTC(Real Time Clock)であって、現在時刻を計時するものであり、その計時する時
刻には年月日の情報も含まれる。CPU11は、タイマ18が計時する時刻に従い6秒ごとに計測指示を行う。また、タイマ18が計時する、計測データが記憶された時刻はタイムスタンプとして、計測データとともにNAND型フラッシュメモリ14に記憶される。
The timer 18 measures the time when the measurement value is measured. The timer 18 is a so-called RTC (Real Time Clock) and measures the current time, and the time to be measured includes date information. The CPU 11 issues a measurement instruction every 6 seconds according to the time measured by the timer 18. Further, the time when the measurement data is stored which is measured by the timer 18 is stored in the NAND flash memory 14 together with the measurement data as a time stamp.

以下に、本実施形態におけるNAND型フラッシュメモリ14の各セクタのデータ構造及び、記憶方法について説明する。   Hereinafter, the data structure and storage method of each sector of the NAND flash memory 14 according to the present embodiment will be described.

図2は、NAND型フラッシュメモリ14の各セクタのデータ構造を説明するための図である。図3は、NAND型フラッシュメモリ14に記憶されたデータの例を示す図である。   FIG. 2 is a diagram for explaining the data structure of each sector of the NAND flash memory 14. FIG. 3 is a diagram illustrating an example of data stored in the NAND flash memory 14.

図2に示すように、各セクタは、アドレス領域101、計測データ領域102、タイムスタンプ領域103、データフラグ領域104からなる。1つのセクタは512Byteの記憶領域を有しており、NAND型フラッシュメモリ14は各セクタ単位で書き換えられる。   As shown in FIG. 2, each sector includes an address area 101, a measurement data area 102, a time stamp area 103, and a data flag area 104. One sector has a 512-byte storage area, and the NAND flash memory 14 is rewritten in units of sectors.

アドレス領域101には、セクタを特定するためのアドレスが記憶されている。本実施形態では、先頭セクタのアドレスは‘0’とされ、以下のセクタのアドレスは‘1’ずつ増加されている(図3参照)。   The address area 101 stores an address for specifying a sector. In this embodiment, the address of the first sector is “0”, and the addresses of the following sectors are incremented by “1” (see FIG. 3).

計測データ領域102には、各パワーコンディショナ20より入力された計測値からCPU11が算出した発電データと各計測装置40〜44より入力された計測値からCPU11が算出した気象データとが計測データとして記憶される。   In the measurement data area 102, the power generation data calculated by the CPU 11 from the measurement values input from the power conditioners 20 and the weather data calculated by the CPU 11 from the measurement values input from the measurement devices 40 to 44 are measured data. Remembered.

各パワーコンディショナ20の発電データは14Byteからなり、気象データは32Byteからなるので、合計として20×14+32=312Byteが計測データ領域として割り当てられている。   Since the power generation data of each power conditioner 20 consists of 14 bytes and the meteorological data consists of 32 bytes, a total of 20 × 14 + 32 = 312 bytes is allocated as a measurement data area.

タイムスタンプ領域103には、計測データを記憶した時刻を示すデータであるタイムスタンプが記憶される。この時刻はタイマ18により計時されている年月日及び時分が用いられる(図3参照)。なお、上述したように、タイムスタンプが示す計測データを記憶した時刻は、計測データの算出のための計測値のうち最後の計測値が計測された時刻を示す。   The time stamp area 103 stores a time stamp that is data indicating the time when the measurement data is stored. As this time, the date, time, and minute measured by the timer 18 are used (see FIG. 3). As described above, the time when the measurement data indicated by the time stamp is stored indicates the time when the last measurement value among the measurement values for calculating the measurement data is measured.

データフラグ領域104には、当該セクタに計測データが記憶されているか否かを示す情報が記憶されている。当該セクタに計測データが記憶されていない場合は“0”が記憶されており、当該セクタに計測データが記憶されると“1”に書き換えられる(図3参照)。   The data flag area 104 stores information indicating whether or not measurement data is stored in the sector. When the measurement data is not stored in the sector, “0” is stored, and when the measurement data is stored in the sector, it is rewritten to “1” (see FIG. 3).

NAND型フラッシュメモリ14の記憶領域は、512Byteのセクタ毎に分けられている。例えば、本実施形態のNAND型フラッシュメモリ14の記憶容量は70MBなので、70000000÷512≒136718個のセクタを含んでいる。各セクタはアドレスによりその順番が決められている。   The storage area of the NAND flash memory 14 is divided into 512-byte sectors. For example, since the storage capacity of the NAND flash memory 14 of this embodiment is 70 MB, it includes 70000000 ÷ 512≈136718 sectors. The order of each sector is determined by the address.

本実施形態において、計測データはNAND型フラッシュメモリ14にリング形式で記憶される。すなわち、アドレスの順に各セクタに計測データが記憶されてゆき、最後のアドレスのセクタに計測データが記憶されると、次は先頭のアドレスのセクタに計測データが記憶される。   In the present embodiment, the measurement data is stored in the NAND flash memory 14 in a ring format. That is, measurement data is stored in each sector in the order of addresses, and when measurement data is stored in the sector at the last address, the measurement data is stored in the sector at the top address next.

図4は計測データがNAND型フラッシュメモリ14に記憶される形式を説明するための図である。簡略化のためセクタ数が10個の場合で説明している。時刻12:00に計測された計測データはアドレス0のセクタに記憶される。計測されるごとに、アドレスの順に各セクタに計測データが記憶される。途中、計測されなかった場合はその時刻の計測データは記憶されず、次の計測された計測データが記憶される(図4において、時刻12:04〜12:06には計測されなかったので、アドレス4のセクタには時刻12:07の計測データが記憶されている)。アドレス9のセクタに時刻12:12の計測データが記憶されると、次の時刻12:13の計測データは先頭のアドレス0のセクタに記憶される。 FIG. 4 is a diagram for explaining a format in which measurement data is stored in the NAND flash memory 14. For simplicity, the case where the number of sectors is 10 is described. The measurement data measured at time 12:00 is stored in the sector at address 0 . Each time it is measured in total, measurement data to each sector in order of address is stored. Middle, meter if none was measured measurement data for that time is not stored, in (Fig. 4 following measured measurement data are stored, time 12: 04-12: The 06 was not measured total Therefore, the measurement data at time 12:07 is stored in the sector at address 4). When the measurement data at time 12:12 is stored in the sector at address 9, the next measurement data at time 12:13 is stored in the sector at address 0 at the head.

このリング形式の記憶方法により、NAND型フラッシュメモリ14内のデータの書き換えは、常に1番古い計測データに対して行われることになる。従って、NAND型フラッシュメモリ14には、古い計測データから順に最新の計測データまで、セクタ数に応じた数の計測データが記憶されることになる。例えば、本実施形態においては、セクタ数が136718個なので、136718分前(すなわち、94日と22時間38分前)から現在までの計測データが記憶されることになり、3か月分の計測データを記憶することができる。   With this ring-type storage method, rewriting of data in the NAND flash memory 14 is always performed on the oldest measurement data. Therefore, the NAND flash memory 14 stores the number of measurement data corresponding to the number of sectors from the old measurement data to the latest measurement data in order. For example, in this embodiment, since the number of sectors is 136718, measurement data from 136718 minutes before (that is, 94 days and 22 hours and 38 minutes before) to the present is stored, and measurement for three months is performed. Data can be stored.

例えば、図3においては、アドレス1002のセクタに2007年1月27日6時3分に記憶された計測データから、アドレス1001のセクタに2007年5月2日4時41分に記憶された計測データまで、約3か月分の計測データが記憶されている。   For example, in FIG. 3, from the measurement data stored at 6:03 on January 27, 2007 in the sector of address 1002, the measurement stored at 4:41 on May 2, 2007 in the sector of address 1001. Up to about 3 months of measurement data is stored.

また、1分ごとのデータの保存の都度、保存先のセクタをサーチする手間を省き、同時にそのサーチにかかる時間のためにデータが保存できなくなるという問題を確実に回避するために、本実施形態では、RAM13に保存先セクタアドレス(次に計測データを保存するセクタのアドレス)が記憶されている。この保存先セクタアドレスは、NAND型フラッシュメモリ14内の保存先セクタに計測データが記憶されると、次のセクタのアドレスに更新される。また、保存先セクタアドレスは、最後のセクタに計測データが記憶されると、先頭のセクタのアドレスに更新される。これにより、最後のセクタに計測データが記憶されると、次は先頭のセクタに計測データが記憶されることになる。   In addition, in order to save the trouble of searching for a storage destination sector every time data is saved every minute, and to avoid the problem that data cannot be saved due to the time required for the search, this embodiment In the RAM 13, the storage destination sector address (the address of the sector where measurement data is stored next) is stored. When the measurement data is stored in the storage destination sector in the NAND flash memory 14, the storage destination sector address is updated to the address of the next sector. The storage sector address is updated to the address of the head sector when the measurement data is stored in the last sector. Thus, when the measurement data is stored in the last sector, the measurement data is stored in the next sector.

RAM13に保存先セクタアドレスを記憶しているので、NAND型フラッシュメモリ14にメモリの管理領域を設ける必要がない。よって、ファイル形式の様に管理領域に対する書き換えが集中することがない。従って、NAND型フラッシュメモリ14が10万回の書き換えを保証されていた場合、各記憶領域は3月ごとに計測データが書き換えられるので、計算上25000年(=100000÷4)の書き換え寿命が保証される。 Since the storage sector address is stored in the RAM 13, it is not necessary to provide a memory management area in the NAND flash memory 14. Therefore, rewriting to the management area does not concentrate like the file format. Therefore, when the NAND flash memory 14 is guaranteed to be rewritten 100,000 times, the measurement data is rewritten every three months in each storage area, so that the rewrite life of 25000 years (= 100,000 / 4) is guaranteed in the calculation. Is done.

なお、RAM13に保存先セクタアドレスを記憶しているので、停電時などの電源供給が停止された場合には保存先セクタアドレスがRAM13から消失する。従って、電源供給が再開され計測データの記憶を再開するときに、計測データを記憶するセクタが不明となる。これを回避するために、直近にデータが保存されたセクタを見つけ出し、その次のセクタを保存先セクタアドレスとする処理を、電源供給が再開されるとすぐに行う必要がある。   Since the storage destination sector address is stored in the RAM 13, the storage destination sector address disappears from the RAM 13 when power supply is stopped such as during a power failure. Therefore, when the power supply is resumed and the storage of the measurement data is resumed, the sector in which the measurement data is stored becomes unknown. In order to avoid this, it is necessary to find a sector in which data is most recently saved and to set the next sector as a save destination sector address as soon as power supply is resumed.

本実施形態において、この電源再供給時又はリセット時の保存先セクタアドレスは、先頭セクタに記憶されているタイムスタンプと現在時刻とから探索される。以下に、保存先セクタアドレス探索の処理手順について、図6に示すフローチャートと図5を参照して説明する。   In the present embodiment, the storage destination sector address at the time of power resupply or reset is searched from the time stamp stored in the head sector and the current time. Hereinafter, the processing procedure of the search for the storage destination sector address will be described with reference to the flowchart shown in FIG. 6 and FIG.

図5は、保存先セクタアドレス探索の処理手順を説明するための、NAND型フラッシュメモリ14に記憶されたデータの例である。簡略化のため、タイムスタンプ領域103のタイムスタンプについては年月日の要素を省略し、時分の要素のみを12:00のように時刻の形式で記載している。図5(a)は、未記憶状態のNAND型フラッシュメモリ14に時刻12:00から計測データの記憶を開始して、アドレス101のセクタに13:41のタイムスタンプと計測データを記憶したところで計測データの記憶が中断された状態である。従って、アドレス102以降のセクタには計測データ及びタイムスタンプが記憶されていない。図5(b)は、3ヶ月以上前から計測データの記憶が継続されていて、アドレス101に13:41のタイムスタンプと計測データを記憶したところで計測データの記憶が中断された状態である。従って、アドレス102以降のセクタには、約3ヶ月前に記憶された計測データ及びタイムスタンプが記憶されている。 FIG. 5 is an example of data stored in the NAND flash memory 14 for explaining the processing procedure of the storage destination sector address search. For simplification, the time and date elements of the time stamp area 103 are omitted, and only the hour and minute elements are described in a time format such as 12:00. FIG. 5 (a) shows a case where measurement data is stored in the NAND flash memory 14 in an unstored state from time 12:00 and a time stamp of 13:41 and measurement data are stored in the sector of address 101. Data storage is suspended. Accordingly, the measurement data and the time stamp are not stored in the sector after the address 102. FIG. 5B shows a state in which the storage of measurement data has been continued for three months or more, and the storage of the measurement data is interrupted when the time stamp of 13:41 and the measurement data are stored in the address 101. Therefore, the measurement data and the time stamp stored about three months ago are stored in the sector after the address 102.

図6は、保存先セクタアドレス探索の処理手順を示すフローチャートである。   FIG. 6 is a flowchart showing the processing procedure of the storage destination sector address search.

この処理は、停電時などの電源供給が停止された後に電源供給が再開された時に行われ、RAM13から消失した保存先セクタアドレス(図5の状態においては、アドレス102)の探索を行うものである。   This process is performed when the power supply is resumed after the power supply is stopped, such as during a power failure, and searches for the storage destination sector address (address 102 in the state of FIG. 5) that has disappeared from the RAM 13. is there.

まず、現在時刻を絶対時刻Tpに変換する(S1)。ここで、絶対時刻とは、任意に設
定した基準時刻から現在時刻までの経過時間を分単位で表したもので、時刻を比較する処理を簡略化するために使用される。例えば、2007年1月1日午前0時0分を基準時刻とし、現在時刻を2007年5月1日午後4時10分とすると、2007年1月1日午前0時0分から2007年5月1日午後4時10分までの経過時間は、31日+28日+31日+30日+16時間+10分であるから、これを分単位に変換すると、173770(=(31+28+31+30)×24+16)×60+10)となる。なお、基準時刻は、任意に設定され、例えば、データ保存装置1の設置日や製造日の属する年の1月1日午前0時0分としてもよい。
First, the current time is converted to an absolute time Tp (S1). Here, the absolute time represents an elapsed time from an arbitrarily set reference time to the current time in minutes, and is used to simplify the process of comparing the times. For example, if 0:00 am on January 1, 2007 is the base time and the current time is 4:10 pm on May 1, 2007, then from 0:00 am on January 1, 2007 to May 2007 elapsed time up to 10 minutes 1:00 pm 4, because it is +10 minutes 31 + 28 + 31 + 30 + 16 hours, converting it to minutes, 173,770 and (= (31 + 28 + 31 + 30) × 24 + 16) × 60 + 10) Become. Note that the reference time is arbitrarily set, and may be, for example, 0:00 on January 1 of the year to which the data storage device 1 is installed or manufactured.

次に、先頭セクタに計測データがあるか否かが判別される(S2)。すなわち、アドレス“0”のセクタのデータフラグ領域104の情報が読み出され、“0”であるか“1”であるかが判別される。以下の処理における、計測データがあるか否かの判別も同様である。先頭セクタに計測データがないと判別されると(すなわち、データフラグ領域104から読み出された情報が“0”である場合)(S2:NO)、NAND型フラッシュメモリ14にまだ計測データが入力されていない状態なので、“0”が保存先セクタアドレスとしてRAM13に記憶され(S3)、処理が終了される。これは、データ保存装置1が設置されて初めて電源が入力された状態、または、NAND型フラッシュメモリ14の記憶が全て消去されてリセットされた直後である。   Next, it is determined whether or not there is measurement data in the head sector (S2). That is, the information in the data flag area 104 of the sector with the address “0” is read out, and it is determined whether it is “0” or “1”. The same is true for determining whether there is measurement data in the following processing. When it is determined that there is no measurement data in the first sector (that is, when the information read from the data flag area 104 is “0”) (S2: NO), the measurement data is still input to the NAND flash memory 14. Since it has not been performed, “0” is stored in the RAM 13 as the storage destination sector address (S3), and the process is terminated. This is a state in which power is input for the first time after the data storage device 1 is installed, or immediately after all the storage in the NAND flash memory 14 is erased and reset.

先頭セクタに計測データがあると判別されると(すなわち、データフラグ領域104から読み出された情報が“1”である場合)(S2:YES)、先頭セクタのタイムスタンプが読み出され、絶対時刻Taに変換される(S4)。すなわち、アドレス“0”のセクタのタイムスタンプ領域103からタイムスタンプ情報が読み出されて、絶対時刻Taに変換される。   When it is determined that there is measurement data in the first sector (that is, when the information read from the data flag area 104 is “1”) (S2: YES), the time stamp of the first sector is read and absolute Time Ta is converted (S4). That is, the time stamp information is read from the time stamp area 103 of the sector with the address “0” and converted to the absolute time Ta.

次に、TpとTaの差としてX(=Tp−Ta)が算出され(S5)、Xが全セクタ数Xt(例えば、本実施形態では136718個)より大きいか否かが判別される(S6)。XがXtより大きい場合(S6:YES)は、XからXtが減じられて(S7)、ステップS6に戻る。XがXt以下の場合(S6:NO)は、ステップS8に進む。   Next, X (= Tp−Ta) is calculated as the difference between Tp and Ta (S5), and it is determined whether or not X is larger than the total number of sectors Xt (for example, 136718 in this embodiment) (S6). ). When X is larger than Xt (S6: YES), Xt is subtracted from X (S7), and the process returns to step S6. If X is less than or equal to Xt (S6: NO), the process proceeds to step S8.

Xは先頭セクタのタイムスタンプが示す時刻から現在時刻までの経過時間を分単位で示したものである。ここで、先頭セクタのアドレスは“0”であり、各セクタには順に1分
ごとに計測データが記憶され、そのアドレスは1ずつ増加する。従って、計測データの記憶が中断することなく連続して継続していたならば、Xは現在時刻の計測データが記憶されるべきセクタのアドレスとなる。しかし、計測データの記憶が中断されていたので、Xを計測データの記憶再開時に計測データが記憶されるセクタのアドレスとするのは適切でない。なぜなら、アドレスXのセクタから計測データの記憶が再開されると、計測データの記憶中断期間に該当するセクタには前回記憶された計測データ(約3ヵ月前の計測デー
タ)が残ることになるか、あるいは計測データが記憶されていないセクタが続くことになるからである。これを防ぐために、計測データの記憶再開時の計測データは、計測データの記憶中断前に計測データが記憶されたセクタの次のセクタに記憶される必要がある。
X indicates the elapsed time from the time indicated by the time stamp of the first sector to the current time in minutes. Here, the address of the head sector is “0”, and measurement data is stored in each sector in order every one minute, and the address is incremented by one. Therefore, if measurement data storage continues continuously without interruption, X is the address of the sector where the measurement data at the current time is to be stored. However, since the storage of the measurement data has been interrupted, it is not appropriate to set X as the address of the sector where the measurement data is stored when the measurement data storage is resumed. Because, when measurement data storage is resumed from the sector at address X, does the measurement data stored in the previous measurement data (measurement data about three months ago) remain in the sector corresponding to the measurement data storage interruption period? This is because a sector in which measurement data is not stored continues. In order to prevent this, the measurement data at the time when the measurement data storage is resumed needs to be stored in the sector next to the sector in which the measurement data is stored before the measurement data storage is interrupted.

例えば、図5(a)に示す状態で、13:44に計測データの記憶が再開された場合、Xは104(12:00から13:44までの経過分数)となるが、次に計測データが記憶されるべきセクタのアドレスは102とすべきであり、このアドレスの探索がステップS8以降で行われる。   For example, in the state shown in FIG. 5A, when measurement data storage is resumed at 13:44, X becomes 104 (elapsed fraction from 12:00 to 13:44). The address of the sector to be stored should be 102, and this address search is performed in step S8 and subsequent steps.

なお、計測データの記憶中断が3ヶ月以上継続していた場合、TpとTaの差として算出されたXはNAND型フラッシュメモリ14のセクタのアドレスの最大値を上回ることになる。従って、その場合は、ステップS6、S7で、Xから全セクタ数Xtを減ずることで、Xを範囲内のアドレスにしている。   If the measurement data storage has been interrupted for three months or more, X calculated as the difference between Tp and Ta exceeds the maximum value of the sector address of the NAND flash memory 14. Therefore, in this case, in steps S6 and S7, X is made an address within the range by subtracting the total number of sectors Xt from X.

ステップS8からは、ステップS1〜S7で演算されたXを仮のアドレスとして、保存先セクタアドレスの探索を行っている。すなわち、アドレスXが保存先セクタアドレスより大きい場合(図5(a),(b)においてはアドレス103以上)は保存先セクタアドレス以下となるようにアドレスXを変更する。アドレスXが保存先セクタアドレスより小さい場合(同101以下)はアドレスXを1ずつ増加させる。これらの処理をアドレスXが保存先セクタアドレスと一致するまで繰り返す。なお、データ保存装置1が初めて起動されてからの3ヶ月間は、計測データが記憶されていないセクタが存在する(図5(a)参照)。この場合は、アドレスXのセクタのデータを読み出すことができない場合があるので、場合を分けて処理が行われる。具体的な処理について、以下に説明する。   From step S8, the storage destination sector address is searched using X calculated in steps S1 to S7 as a temporary address. That is, when the address X is larger than the storage destination sector address (the addresses 103 and higher in FIGS. 5A and 5B), the address X is changed so as to be equal to or lower than the storage destination sector address. When the address X is smaller than the storage destination sector address (101 or less), the address X is incremented by one. These processes are repeated until the address X matches the storage destination sector address. Note that there are sectors in which measurement data is not stored for three months after the data storage device 1 is activated for the first time (see FIG. 5A). In this case, since the data of the sector at the address X may not be read, the processing is performed separately. Specific processing will be described below.

まず、アドレスXのセクタに計測データが有るか否かが判別される(S8)。アドレスXのセクタに計測データが無い場合(S8:NO)、アドレス(X−1)のセクタに計測データが有るか否かが判別される(S9)。アドレス(X−1)のセクタに計測データが有る場合(S9:YES)、アドレスXが保存先セクタアドレスとしてRAM13に記憶され(S10)、処理が終了される。   First, it is determined whether or not there is measurement data in the sector at address X (S8). If there is no measurement data in the sector at address X (S8: NO), it is determined whether or not there is measurement data in the sector at address (X-1) (S9). When there is measurement data in the sector at the address (X-1) (S9: YES), the address X is stored in the RAM 13 as a storage destination sector address (S10), and the process is terminated.

すなわち、アドレスXのセクタに計測データが記憶されておらず、1つ前のアドレス(X−1)のセクタに計測データが記憶されている場合(図5(a)において、アドレスXがアドレス102である場合)、アドレスXのセクタが次に計測データが保存されるべきセクタなので、アドレスXがRAM13に記憶される。   That is, when measurement data is not stored in the sector at address X and measurement data is stored in the sector at the previous address (X-1) (in FIG. 5A, address X is address 102). The address X is stored in the RAM 13 since the sector at the address X is the sector where the measurement data is to be stored next.

アドレス(X−1)のセクタに計測データが無い場合(S9:NO)、“0”とXの中間のアドレスがアドレスXとされ(S11)、ステップ8に戻る。すなわち、アドレスXのセクタに計測データが記憶されておらず、1つ前のアドレス(X−1)のセクタにも計測データが記憶されていない場合(図5(a)において、アドレスXがアドレス103以上である場合)、アドレスXを保存先セクタアドレス以下とするために、“0”とXの中間のアドレスをアドレスXとする。アドレスXが保存先セクタアドレス以下となるまでステップS8、S9、S11が繰り返される。なお、“0”とXの中間のアドレスは、Xが偶数の場合は2で割った値、Xが奇数の場合は(X−1)を2で割った値としている。例えば、図5(a)において、アドレスXが335の場合、アドレスXは167(=334÷2)となる。しかし、まだ103以上なので再度中間のアドレスが算出されて84(=(167−1)÷2)となる。 If there is no measurement data in the sector at address (X-1) (S9: NO), an address between “0” and X is set as address X (S11), and the process returns to step 8. That is, when the measurement data is not stored in the sector at the address X and the measurement data is not stored in the sector at the previous address (X-1) (in FIG. 5A, the address X is the address). If the address X is equal to or greater than 103, the address X is set to an intermediate address between “0” and X in order to make the address X equal to or lower than the storage destination sector address. Steps S8, S9, and S11 are repeated until the address X becomes equal to or less than the storage destination sector address. The intermediate address between “0” and X is a value obtained by dividing by 2 when X is an even number, and a value obtained by dividing (X−1) by 2 when X is an odd number. For example, in FIG. 5A, when the address X is 335, the address X is 167 (= 334/2). However, since it is still 103 or more, the intermediate address is calculated again to 84 (= (167-1) / 2).

ステップS8において計測データが有る場合(S8:YES)、アドレスXのセクタのタイムスタンプが読み出され、絶対時刻Tに変換される(S12)。この絶対時刻Tが先頭セクタのタイムスタンプの絶対時刻Taより小さいか否かが判別される(S13)。すなわち、アドレスXのセクタに記憶されている計測データが先頭セクタに記憶されている計測データより古いか否かが判別される。   If there is measurement data in step S8 (S8: YES), the time stamp of the sector at address X is read and converted to absolute time T (S12). It is determined whether or not the absolute time T is smaller than the absolute time Ta of the time stamp of the first sector (S13). That is, it is determined whether or not the measurement data stored in the sector at the address X is older than the measurement data stored in the head sector.

TがTaより小さい場合(S13:YES)、アドレス(X−1)のセクタのタイムスタンプが読み出され、絶対時刻T’に変換される(S14)。この絶対時刻T’がTa以上であるか否かが判別される(S15)。T’がTa以上の場合(S15:YES)、アドレスXが保存先セクタアドレスとしてRAM13に記憶され(S16)、処理が終了される。   If T is smaller than Ta (S13: YES), the time stamp of the sector at the address (X-1) is read and converted to the absolute time T '(S14). It is determined whether or not the absolute time T 'is equal to or greater than Ta (S15). If T 'is equal to or greater than Ta (S15: YES), the address X is stored in the RAM 13 as the storage destination sector address (S16), and the process is terminated.

すなわち、アドレスXのセクタに記憶されている計測データが先頭セクタに記憶されている計測データより古く、1つ前のアドレス(X−1)のセクタに記憶されている計測データが先頭セクタに記憶されている計測データより新しい場合(図5(b)において、アドレスXがアドレス102である場合)、アドレスXのセクタが次に計測データが保存されるべきセクタなので、アドレスXがRAM13に記憶される。   That is, the measurement data stored in the sector at the address X is older than the measurement data stored in the head sector, and the measurement data stored in the sector at the previous address (X-1) is stored in the head sector. If the measured data is newer (in the case of FIG. 5B, the address X is the address 102), the address X is stored in the RAM 13 because the sector of the address X is the sector where the measured data is to be stored next. The

ステップS15でT’がTaより小さい場合(S15:NO)、ステップS11に進む。すなわち、セクタに記憶されている計測データが先頭セクタに記憶されている計測データより古く、1つ前のアドレス(X−1)のセクタに記憶されている計測データも先頭セクタに記憶されている計測データより古い場合(図5(b)において、アドレスXがアドレス103以上である場合)、アドレスXを保存先セクタアドレス以下とするために、“0”とXの中間のアドレスをアドレスXとする。アドレスXが保存先セクタアドレス以下となるまでステップS8、S12〜S15、S11が繰り返される。   If T ′ is smaller than Ta in step S15 (S15: NO), the process proceeds to step S11. That is, the measurement data stored in the sector is older than the measurement data stored in the head sector, and the measurement data stored in the sector at the previous address (X-1) is also stored in the head sector. If it is older than the measured data (in FIG. 5B, the address X is equal to or greater than the address 103), an address between “0” and X is set to the address X in order to make the address X equal to or less than the storage destination sector address To do. Steps S8, S12 to S15, and S11 are repeated until the address X becomes equal to or less than the storage destination sector address.

ステップS13でTがTa以上の場合(S13:NO)、アドレスXが1増加される(S17)。すなわち、アドレスXは保存先アドレスより小さいので(図5(a),(b)において、アドレスXはアドレス0〜101である)、アドレスXを次のアドレスにする。   If T is greater than or equal to Ta in step S13 (S13: NO), the address X is incremented by 1 (S17). That is, since the address X is smaller than the storage destination address (the addresses X are addresses 0 to 101 in FIGS. 5A and 5B), the address X is set to the next address.

アドレスXのセクタに計測データがあるか否か判別され(S18)、計測データが無い場合(S18:NO)、ステップS16に進む。計測データが有る場合(S18:YES)、アドレスXのセクタのタイムスタンプが読み出され、絶対時刻Tに変換される(S19)。この絶対時刻TがTaより小さいか否かが判別される(S20)。TがTaより小さい場合(S20:YES)、ステップS16に進み、TがTa以上の場合(S20:NO)、ステップS17に戻る。   It is determined whether or not there is measurement data in the sector at address X (S18). If there is no measurement data (S18: NO), the process proceeds to step S16. If there is measurement data (S18: YES), the time stamp of the sector at address X is read and converted to absolute time T (S19). It is determined whether or not the absolute time T is smaller than Ta (S20). When T is smaller than Ta (S20: YES), the process proceeds to step S16, and when T is equal to or greater than Ta (S20: NO), the process returns to step S17.

すなわち、アドレスXのセクタに計測データが存在しなくなる(図5(a)において、アドレスXがアドレス102となる)か、アドレスXのセクタに記憶されている計測データが先頭セクタに記憶されている計測データより古くなる(図5(b)において、アドレスXがアドレス102となる)まで、アドレスXを1ずつ増加させる。アドレスXのセクタに計測データが存在しなくなるか、アドレスXのセクタに記憶されている計測データが先頭セクタに記憶されている計測データより古くなると、アドレスXのセクタが次に計測データが保存されるべきセクタなので、ステップS16でアドレスXがRAM13に記憶される。   That is, the measurement data does not exist in the sector of address X (in FIG. 5A, address X becomes address 102), or the measurement data stored in the sector of address X is stored in the head sector. The address X is incremented by 1 until it becomes older than the measurement data (in FIG. 5B, the address X becomes the address 102). If no measurement data exists in the sector at address X, or if the measurement data stored in the sector at address X is older than the measurement data stored in the first sector, the measurement data is stored next in the sector at address X. Since this is a sector to be used, the address X is stored in the RAM 13 in step S16.

なお、保存先セクタアドレスの探索は上記方法に限られず、他の方法で行っても構わない。例えば、上記図6のフローチャートにおいて、ステップS13がNOの場合にステップS17〜S20を繰り返すのでなく、ステップS17の後、ステップS8に戻るようにしてもよい。また、CPU11の処理速度が速く探索処理に時間がかからないのであれば、先頭セクタから順に探索を行ってもよい。 The search for the storage destination sector address is not limited to the above method, and may be performed by another method. For example, in the flowchart of FIG. 6 described above, when Step S13 is NO, Steps S17 to S20 may not be repeated, but after Step S17, the process may return to Step S8. If the processing speed of the CPU 11 is fast and the search process does not take time, the search may be performed in order from the first sector.

次に、管理用コンピュータ5から要求された計測データを送信するために、要求されている計測データをNAND型フラッシュメモリ14から読出す処理について、図8及び図9に示すフローチャートと図7を参照して説明する。管理用コンピュータ5は、要求する計測データのうち先頭の計測データの計測時刻(以下、「指定時刻」という。)と最後の計測データの計測時刻とを指定して送信要求を送信する。CPU11は、計測データの送信要求を受信すると、指定時刻から最後の計測データの計測時刻までの期間(以下、「指定期間」という。)に該当する計測データをNAND型フラッシュメモリ14から読み出し、RAM13内の送信バッファに蓄積してから、入出力I/F17を介して管理用コンピュータ5に送信する。なお、指定時刻として3ヵ月以上前が指定された場合、CPU11は、計測データがない旨を送信する。   Next, referring to the flowcharts shown in FIGS. 8 and 9 and FIG. 7 for the process of reading the requested measurement data from the NAND flash memory 14 in order to transmit the measurement data requested from the management computer 5. To explain. The management computer 5 designates the measurement time of the first measurement data (hereinafter referred to as “designated time”) and the measurement time of the last measurement data among the requested measurement data, and transmits a transmission request. When the CPU 11 receives the measurement data transmission request, the CPU 11 reads the measurement data corresponding to the period from the designated time to the measurement time of the last measurement data (hereinafter referred to as “designated period”) from the NAND flash memory 14, and the RAM 13. Then, it is transmitted to the management computer 5 via the input / output I / F 17. In addition, when 3 months or more ago is designated as the designated time, the CPU 11 transmits that there is no measurement data.

図7は、計測データ読出しの処理手順を説明するための、NAND型フラッシュメモリ14に記憶されたデータの例である。図5同様、タイムスタンプ領域103のタイムスタンプについては時分の要素のみを時刻の形式で記載している。図示しないがアドレス0に10:20の計測データが記憶され、その後計測データが記憶されており、管理用コンピュータ5から12:00〜12:03の計測データを要求された状況を例にしている。なお、図7(d),(e)においては、11:56〜12:04の計測データが記憶されていない。また、図7(f)においては12:02以降、図7(g)においては12:01以降の計測データが記憶されていない。また、図7(h)においてはアドレス101以降のセクタに再度11:55からの計測データが記憶されており、図7(i)においては12:01〜12:02の計測データが記憶されていない。 FIG. 7 is an example of data stored in the NAND flash memory 14 for explaining the processing procedure for reading measurement data. As in FIG. 5, only the hour and minute elements are described in the time format for the time stamp in the time stamp area 103 . Although not shown, 10:20 measurement data is stored at address 0, and then the measurement data is stored, and a situation in which measurement data of 12: 0 to 12:03 is requested from the management computer 5 is taken as an example. . In FIGS. 7D and 7E, measurement data of 11:56 to 12:04 is not stored. Further, measurement data after 12:02 is not stored in FIG. 7F, and measurement data after 12:01 is not stored in FIG. 7G. In FIG. 7H, the measurement data from 11:55 is stored again in the sector after address 101, and in FIG. 7I, the measurement data from 12:01 to 12:02 is stored. Absent.

図8及び図9は、計測データ読出しの処理手順を示すフローチャートである。   8 and 9 are flowcharts showing the measurement data reading processing procedure.

指定時刻が絶対時刻Trに変換され(S31)、先頭セクタのタイムスタンプが読み出されて絶対時刻Taに変換される(S32)。なお、先頭セクタにデータが無い場合は、データを読み出すことが不可能なので、送信バッファには指定期間分の空データが入力され、計測データ読出しの処理が終了される。   The designated time is converted to absolute time Tr (S31), and the time stamp of the first sector is read and converted to absolute time Ta (S32). Note that when there is no data in the head sector, it is impossible to read data, so empty data for a specified period is input to the transmission buffer, and the measurement data reading process is terminated.

次に、TrとTaの差としてX(=Tr−Ta)が算出される(S33)。先頭セクタから順に途切れなく計測データが記憶されていた場合は、このXが指定時刻の計測データを記憶するセクタのアドレスとなっている。例えば、図7(a)において、Xは100(10:20から12:00までの経過分数)となり、アドレス100のセクタには12:00の計測データが記憶されている。   Next, X (= Tr−Ta) is calculated as the difference between Tr and Ta (S33). When the measurement data is stored in order from the first sector without interruption, X is the address of the sector that stores the measurement data at the specified time. For example, in FIG. 7A, X is 100 (elapsed minutes from 10:20 to 12:00), and measurement data of 12:00 is stored in the sector of address 100.

しかし、途中、停電などにより計測データが記憶されなかった場合や、タイマ18が調整された場合には、Xが指定時刻の計測データが記憶されているセクタのアドレスとならない。従って、ステップS34〜S44において、Xを仮のアドレスとして、指定時刻の計測データが記憶されているセクタの探索が行われる。   However, when measurement data is not stored due to a power failure during the process, or when the timer 18 is adjusted, X does not become the address of the sector where the measurement data at the specified time is stored. Accordingly, in steps S34 to S44, a search for a sector in which measurement data at a specified time is stored is performed using X as a temporary address.

まず、アドレスXのセクタに計測データが有るか否かが判別される(S34)。計測データが無い場合(S34:NO)、アドレスXが1減少され(S35)、ステップS34に戻る。すなわち、計測データが記憶されているセクタまでアドレスを減少させる。例えば、図7(f)において、アドレスX(=100)のセクタにはデータが記憶されていないので、Xは1減少されて99とされ、再度探索が行われる。   First, it is determined whether or not measurement data exists in the sector at address X (S34). When there is no measurement data (S34: NO), the address X is decremented by 1 (S35), and the process returns to step S34. That is, the address is decreased to the sector where the measurement data is stored. For example, in FIG. 7F, since no data is stored in the sector at address X (= 100), X is decreased by 1 to 99, and the search is performed again.

ステップS34でデータが有る場合(S34:YES)、アドレスXのセクタのタイムスタンプが読み出され、絶対時刻Tに変換される(S36)。この絶対時刻Tと指定時刻の絶対時刻Trとが比較される(S37)。   If there is data in step S34 (S34: YES), the time stamp of the sector at address X is read and converted to absolute time T (S36). This absolute time T is compared with the absolute time Tr of the designated time (S37).

ステップS37においてT=Trの場合、すなわち、アドレスXのセクタのタイムスタンプが指定時刻と一致した場合、アドレスXのセクタが指定時刻の計測データが記憶されているセクタである。従って、アドレスXのセクタに記憶されている計測データが指定時刻の計測データとして、送信バッファに記憶され(S38)、ステップS51に進む。例えば、図7(a)において、アドレスX(=100)のセクタのタイムスタンプは12:00であり、指定時刻と一致するのでアドレス100のセクタに記憶された計測データが送信バッファに記憶される。   If T = Tr in step S37, that is, if the time stamp of the sector at address X matches the specified time, the sector at address X is the sector in which the measurement data at the specified time is stored. Accordingly, the measurement data stored in the sector at the address X is stored in the transmission buffer as measurement data at the designated time (S38), and the process proceeds to step S51. For example, in FIG. 7A, the time stamp of the sector at address X (= 100) is 12:00 and matches the specified time, so the measurement data stored in the sector at address 100 is stored in the transmission buffer. .

ステップS37においてT>Trの場合、すなわち、アドレスXのセクタのタイムスタンプが指定時刻より後の場合、アドレスXを1減少させて(S39)、ステップS34に戻る。すなわち、1つ前のアドレス(X−1)をアドレスXとして再度探索が行われる。例えば、図7(b),(d)において、アドレスX(=100)のセクタのタイムスタンプは指定時刻より後なので、Xは1減少されて99とされ、再度探索が行われる。   If T> Tr in step S37, that is, if the time stamp of the sector at address X is after the specified time, address X is decremented by 1 (S39), and the process returns to step S34. That is, the search is performed again using the previous address (X-1) as the address X. For example, in FIGS. 7B and 7D, since the time stamp of the sector at the address X (= 100) is after the specified time, X is decreased by 1 to 99, and the search is performed again.

ステップS37においてT<Trの場合、すなわち、アドレスXのセクタのタイムスタンプが指定時刻より前の場合、アドレス(X+1)に計測データが有るか否かが判別され(S40)、計測データが有る場合(S40:YES)、アドレス(X+1)のセクタのタイムスタンプが読み出され、絶対時刻T’に変換される(S41)。この絶対時刻T’が指定時刻の絶対時刻Tr以下であるか否かが判別され(S42)、T’≦Trの場合(S42:YES)、アドレスXを1増加させて(S43)、ステップS34に戻る。   If T <Tr in step S37, that is, if the time stamp of the sector at address X is before the specified time, it is determined whether or not there is measurement data at address (X + 1) (S40), and there is measurement data. (S40: YES), the time stamp of the sector at the address (X + 1) is read and converted to the absolute time T ′ (S41). It is determined whether or not the absolute time T ′ is less than or equal to the absolute time Tr of the designated time (S42). If T ′ ≦ Tr (S42: YES), the address X is incremented by 1 (S43), and step S34 is performed. Return to.

すなわち、アドレスXとその次のアドレス(X+1)のタイムスタンプが、ともに指定時刻の絶対時刻Tr以下である場合は、次のアドレス(X+1)をアドレスXとして再度探索が行われる。例えば、図7(c)において、アドレスX(=100)のセクタのタイムスタンプは11:59であり指定時刻より前で、次のアドレス101のタイムスタンプが12:00であり指定時刻以前なので、Xは1増加されて101とされ、再度探索が行われる。   That is, when the time stamps of the address X and the next address (X + 1) are both less than or equal to the absolute time Tr of the designated time, the next address (X + 1) is used as the address X to search again. For example, in FIG. 7C, the time stamp of the sector at address X (= 100) is 11:59 before the specified time, and the time stamp of the next address 101 is 12:00 and before the specified time. X is incremented by 1 to 101, and the search is performed again.

ステップS40において計測データが無い場合(S40:NO)、および、ステップS42においてT’>Trの場合(S42:NO)、指定時刻の計測データは記憶されていないので、指定時刻の計測データとして空データが送信バッファに記憶され(S44)、ステップS51に進む。例えば、図7(e)において、アドレスX(=100)のセクタのタイムスタンプは11:55であり指定時刻より前で、次のアドレス101のタイムスタンプが12:05であり指定時刻より後なので、指定時刻の計測データとして空データが送信バッファに記憶される。   If there is no measurement data in step S40 (S40: NO), and if T ′> Tr in step S42 (S42: NO), the measurement data at the specified time is not stored, so the measurement data at the specified time is empty. The data is stored in the transmission buffer (S44), and the process proceeds to step S51. For example, in FIG. 7E, the time stamp of the sector at address X (= 100) is 11:55 before the specified time, and the time stamp of the next address 101 is 12:05 after the specified time. The empty data is stored in the transmission buffer as the measurement data at the designated time.

以上のように、指定時刻の計測データが記憶されているセクタの探索が行われ、指定時刻の計測データ、又は、空データが送信バッファに記憶されると、続いて以下の処理で、指定期間内の計測データを読み出す。   As described above, when the sector in which the measurement data at the designated time is stored is searched and the measurement data at the designated time or the empty data is stored in the transmission buffer, the following processing is performed for the designated period. Read the measurement data in

まず、指定期間内の次の時刻(以下、「探索時刻」という。)として、Trが1増加され(S51)、アドレスXが1増加される(S52)。順に途切れなく計測データが記憶されていた場合は、このXが探索時刻の計測データを記憶するセクタのアドレスとなっている(図7(a)アドレス101のセクタ参照)。   First, as the next time within the specified period (hereinafter referred to as “search time”), Tr is incremented by 1 (S51), and address X is incremented by 1 (S52). When the measurement data is stored in order without interruption, this X is the address of the sector that stores the measurement data of the search time (see the sector at address 101 in FIG. 7A).

しかし、探索時刻が現在時刻を超えてしまった場合、アドレスXのセクタにはまだ計測データが記憶されていない状態となる(図7(g)アドレス101のセクタ参照)。また、指定期間に該当する期間の途中でタイマ18を時間調整のため戻した場合には、アドレスXのセクタには探索時刻より前の時刻の計測データが記憶されている場合がある(図7(h)アドレス101のセクタ参照)。また、同様にタイマ18を進めた場合や、停電などにより計測データが記憶されなかった場合、アドレスXのセクタには探索時刻より後の時刻の計測データが記憶されている場合がある(図7(i)アドレス101のセクタ参照)。   However, if the search time exceeds the current time, the measurement data is not yet stored in the sector at address X (see the sector at address 101 in FIG. 7 (g)). Further, when the timer 18 is returned for time adjustment in the middle of the period corresponding to the designated period, measurement data at a time before the search time may be stored in the sector of the address X (FIG. 7). (H) See sector at address 101). Similarly, when the timer 18 is advanced or measurement data is not stored due to a power failure or the like, measurement data at a time later than the search time may be stored in the sector of the address X (FIG. 7). (I) See sector at address 101).

従って、ステップS51〜S63において、Xを仮のアドレスとして、探索時刻の計測データが記憶されているセクタの探索が行われる。   Accordingly, in steps S51 to S63, a search is performed for a sector in which measurement data of the search time is stored using X as a temporary address.

まず、指定期間内の計測データ(空データを含む)が全て送信バッファに記憶されたか否かが判別される(S53)。全て記憶されていた場合(S53:YES)、計測データ読出し処理が終了される。全て記憶されていない場合(S53:NO)は、アドレスXのセクタに計測データが有るか否かが判別される(S54)。   First, it is determined whether or not all measurement data (including empty data) within a specified period has been stored in the transmission buffer (S53). If all of them are stored (S53: YES), the measurement data reading process is terminated. If not all are stored (S53: NO), it is determined whether or not there is measurement data in the sector of address X (S54).

計測データが無い場合(S54:NO)、残りの指定期間分の計測データとして空データが送信バッファに記憶され(S55)、計測データ読出しの処理が終了される。例えば、図7(g)において、アドレス100のセクタの計測データが指定時刻12:00の計測データとして送信バッファに記憶された後、1増加されたアドレス101のセクタに計測データが記憶されていないので、残りの指定期間内、すなわち、12:01,12:02,12:03の計測データとして空データが送信バッファに記憶される。   When there is no measurement data (S54: NO), empty data is stored in the transmission buffer as measurement data for the remaining specified period (S55), and the measurement data reading process is terminated. For example, in FIG. 7G, after the measurement data of the sector at the address 100 is stored in the transmission buffer as the measurement data at the designated time 12:00, the measurement data is not stored in the sector at the address 101 increased by one. Therefore, empty data is stored in the transmission buffer within the remaining designated period, that is, as measurement data of 12:01, 12:02, and 12:03.

計測データが有る場合(S54:YES)、アドレスXのセクタのタイムスタンプが読み出され、絶対時刻Tに変換される(S56)。この絶対時刻Tと絶対時刻Trとが比較される(S57)。   If there is measurement data (S54: YES), the time stamp of the sector at address X is read and converted to absolute time T (S56). The absolute time T and the absolute time Tr are compared (S57).

ステップS57においてT=Trの場合、すなわち、アドレスXのセクタのタイムスタンプが探索時刻と一致した場合、アドレスXのセクタが探索時刻の計測データが記憶されているセクタである。従って、アドレスXのセクタに記憶されている計測データが探索時刻の計測データとして、送信バッファに記憶され(S58)、次の探索時刻としてTrが1増加され(S59)、アドレスXが1増加され(S60)、ステップ53に戻る。例えば、図7(a)において、アドレス100のセクタの計測データが指定時刻12:00の計測データとして送信バッファに記憶された後、1増加されたアドレス101のセクタのタイムスタンプは12:01で探索時刻12:01と一致する。従って、アドレス101のセクタの計測データが探索時刻12:01の計測データとして送信バッファに記憶され、次の探索時刻が12:02、アドレスが102とされ、再度探索が行われる。   If T = Tr in step S57, that is, if the time stamp of the sector at address X matches the search time, the sector at address X is the sector in which the measurement data for the search time is stored. Therefore, the measurement data stored in the sector at address X is stored in the transmission buffer as measurement data for the search time (S58), Tr is incremented by 1 as the next search time (S59), and address X is incremented by 1. (S60), the process returns to step 53. For example, in FIG. 7A, after the measurement data of the sector at the address 100 is stored in the transmission buffer as the measurement data at the designated time 12:00, the time stamp of the sector at the address 101 increased by 1 is 12:01. It matches the search time 12:01. Therefore, the measurement data of the sector at the address 101 is stored in the transmission buffer as the measurement data at the search time 12:01, the next search time is set to 12:02, the address is set to 102, and the search is performed again.

ステップS57においてT<Trの場合、すなわち、アドレスXのセクタのタイムスタンプが指定時刻より前の場合、アドレスXを1増加させて(S61)、ステップS53に戻る。すなわち、次のアドレス(X+1)をアドレスXとして再度探索が行われる。例えば、図7(h)において、アドレス100のセクタの計測データが指定時刻12:00の計測データとして送信バッファに記憶された後、1増加されたアドレス101のセクタのタイムスタンプは11:55で探索時刻12:01より前である。従って、アドレスを1増加させて102とし、再度探索が行われる。   If T <Tr in step S57, that is, if the time stamp of the sector at address X is before the specified time, address X is incremented by 1 (S61), and the process returns to step S53. That is, the search is performed again with the next address (X + 1) as the address X. For example, in FIG. 7H, after the measurement data of the sector at the address 100 is stored in the transmission buffer as the measurement data at the designated time 12:00, the time stamp of the sector at the address 101 increased by 1 is 11:55. The search time is before 12:01. Therefore, the address is incremented by 1 to 102, and the search is performed again.

ステップS57においてT>Trの場合、すなわち、アドレスXのセクタのタイムスタンプが指定時刻より後の場合、探索時刻の計測データは記憶されていないとして空データが送信バッファに記憶され(S62)、次の探索時刻としてTrが1増加され(S63)、ステップ53に戻る。すなわち、次の探索時刻の計測データの探索が行われる。例えば、図7(i)において、アドレス100のセクタの計測データが指定時刻12:00の計測データとして送信バッファに記憶された後、1増加されたアドレス101のセクタのタイムスタンプは12:03で探索時刻12:01より後である。従って、探索時刻12:01の計測データとして空データが送信バッファに記憶され、探索時刻を1分増加させて12:02とし、次の探索時刻の探索が行われる。   If T> Tr in step S57, that is, if the time stamp of the sector at the address X is later than the specified time, empty data is stored in the transmission buffer on the assumption that the measurement data of the search time is not stored (S62). Tr is incremented by 1 as the search time (S63), and the process returns to step 53. That is, the measurement data at the next search time is searched. For example, in FIG. 7 (i), after the measurement data of the sector at the address 100 is stored in the transmission buffer as the measurement data at the designated time 12:00, the time stamp of the sector at the address 101 increased by 1 is 12:03. It is after the search time 12:01. Accordingly, empty data is stored in the transmission buffer as measurement data at the search time 12:01, the search time is increased by 1 minute to 12:02, and a search for the next search time is performed.

指定期間内の全ての計測データ(空データを含む)が送信バッファに記憶されるか(S53:YES)、探索時刻が現在時刻を超えてしまう(S54:NO)まで、ステップS53〜S63が繰り返されて、指定期間内の計測データが送信バッファに蓄積される。計測データ読出しの処理が終了されると、送信バッファに蓄積された計測データが管理用コンピュータ5に送信される。   Steps S53 to S63 are repeated until all measurement data (including empty data) within the specified period is stored in the transmission buffer (S53: YES) or the search time exceeds the current time (S54: NO). Thus, measurement data within the specified period is accumulated in the transmission buffer. When the measurement data reading process is completed, the measurement data stored in the transmission buffer is transmitted to the management computer 5.

なお、計測データの読出しは、上記方法に限られず、他の方法で行っても構わない。例えば、CPU11の処理速度が速く探索処理に時間がかからないのであれば、先頭セクタから順に記憶されているタイムスタンプを参照して、指定期間内の計測データを送信バッファに記憶していくようにしてもよい。 Note that reading of measurement data is not limited to the above method, and other methods may be used. For example, if the processing speed of the CPU 11 is fast and the search process does not take a long time, the measurement data within the specified period is stored in the transmission buffer by referring to the time stamps stored in order from the first sector. May be.

上記のように、本実施形態に係るデータ保存装置では保存先セクタアドレスをRAM13に記憶するので、計測データを記憶するNAND型フラッシュメモリ14において一部の記憶領域に対する書き換えが集中することがなく、NAND型フラッシュメモリ14の実用的な寿命を保証することができる。また、計測データとともにタイムスタンプを記憶しているので、計測データの記憶中断後に再開される場合に、このタイムスタンプを利用して次に計測データが記憶されるべきセクタの探索を行うことができる。更に、計測データを読み出す場合にもタイムスタンプを利用して、必要な計測データを早急に読み出すことができる。 As described above, in the data storage device according to the present embodiment, since the storage destination sector address is stored in the RAM 13 , rewriting to a part of the storage area is not concentrated in the NAND flash memory 14 storing the measurement data. The practical life of the NAND flash memory 14 can be guaranteed. Further, since the time stamp is stored together with the measurement data, when the measurement data is resumed after the storage interruption, it is possible to search for the sector where the measurement data should be stored next by using this time stamp. . Furthermore, when reading measurement data, the necessary measurement data can be read quickly using the time stamp.

なお、上記実施形態では、本発明を太陽光発電システムのデータ保存装置として適用した場合を例に説明したがこれに限られず、本発明は、大量のデータを保存し書き換える必要があるデータ保存装置において適用することができる。   In the above embodiment, the case where the present invention is applied as a data storage device of a photovoltaic power generation system has been described as an example. However, the present invention is not limited thereto, and the present invention is a data storage device that needs to store and rewrite a large amount of data. Can be applied.

本発明に係るデータ保存装置を太陽光発電システムのデータ保存装置として適用した場合のデータ保存装置の内部構成を示すブロック図である。It is a block diagram which shows the internal structure of the data storage apparatus at the time of applying the data storage apparatus which concerns on this invention as a data storage apparatus of a photovoltaic power generation system. NAND型フラッシュメモリの各セクタのデータ構造を説明するための図である。It is a figure for demonstrating the data structure of each sector of NAND type flash memory. NAND型フラッシュメモリに記憶されたデータの例を示す図である。It is a figure which shows the example of the data memorize | stored in NAND flash memory. NAND型フラッシュメモリの記憶形式を説明するための図である。It is a figure for demonstrating the storage format of a NAND type flash memory. 保存先セクタアドレス探索の処理手順を説明するための、NAND型フラッシュメモリに記憶されたデータの例である。It is an example of the data memorize | stored in the NAND type flash memory for demonstrating the process sequence of a preservation | save destination sector address. 保存先セクタアドレス探索の処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of a storage destination sector address search. 計測データ読出しの処理手順を説明するための、NAND型フラッシュメモリに記憶されたデータの例である。It is an example of the data memorize | stored in the NAND type flash memory for demonstrating the process sequence of measurement data reading. 計測データ読出しの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of measurement data reading. 計測データ読出しの処理手順を示すフローチャートである。It is a flowchart which shows the process sequence of measurement data reading.

1 データ保存装置
11 CPU
12 ROM
13 RAM
14 NAND型フラッシュメモリ
15 パワーコンディショナ入出力I/F
16 計測装置入出力I/F
17 入出力I/F
18 タイマ
19 BUS
20 パワーコンディショナ
40〜44 計測装置
5 管理用コンピュータ
101 アドレス領域
102 データ領域
103 タイムスタンプ領域
104 データフラグ領域
1 Data storage device 11 CPU
12 ROM
13 RAM
14 NAND flash memory 15 Power conditioner I / O I / F
16 Measuring device input / output I / F
17 Input / output I / F
18 Timer 19 BUS
20 Power conditioner 40 to 44 Measuring device 5 Management computer 101 Address area 102 Data area 103 Time stamp area 104 Data flag area

Claims (8)

複数の記憶領域に分割され、各記憶領域にアドレスが順番に付されている第1の記憶手段と
ータを記憶すべき前記第1の記憶手段の記憶領域のアドレスを記憶する、当該第1の記憶手段とは異なる揮発性の第2の記憶手段と、
現在の時刻を計時する計時手段と、
データの保存が指令される毎に、当該データを前記計時手段により計時される保存時の時刻データとともに、前記第1の記憶手段の、前記第2の記憶手段に記憶されたアドレスの記憶領域に記憶させる記憶制御手段と、
前記第1の記憶手段に前記データが記憶される毎に、前記第2の記憶手段に記憶された前記アドレスを、前記第1の記憶手段に付された複数のアドレスが循環するように次のアドレスに変更するアドレス変更手段と
前記第2の記憶手段に記憶された前記アドレスが消失しているか否かを判別する判別手段と、
前記判別手段により前記アドレスが消失していると判別されると、前記第1の記憶手段の各記憶領域に記憶されている前記時刻データと前記計時手段により計時される判別時の時刻データとを用いて、当該判別後に保存が指令されるデータに対する前記第1の記憶手段の記憶領域のアドレスを決定し、そのアドレスを前記第2の記憶手段に記憶させるアドレス記憶制御手段と、
を備えたことを特徴とするデータ保存装置。
First storage means that is divided into a plurality of storage areas, and addresses are sequentially assigned to the storage areas ;
Stores the address of the storage area of the to be stored data first storage means, second storage means of different volatility with the first storage means,
A time measuring means for measuring the current time;
Each time data storage is commanded, the data is stored in the storage area of the address stored in the second storage means of the first storage means together with the time data at the time of storage timed by the time measuring means. Storage control means for storing;
Each time the data is stored in the first storage means, the address stored in the second storage means is circulated through a plurality of addresses attached to the first storage means. An address changing means for changing to an address ;
Determining means for determining whether or not the address stored in the second storage means has disappeared;
When it is determined by the determining means that the address is lost, the time data stored in each storage area of the first storage means and the time data at the time of determination timed by the time measuring means are An address storage control means for determining an address of a storage area of the first storage means for data to be stored after the determination, and storing the address in the second storage means;
Data storage apparatus comprising the.
前記アドレス記憶制御手段は、
前記第1の記憶手段の先頭の記憶領域に記憶されている前記時刻データと前記計時手段により計時される前記判別時の時刻データの差から仮のアドレスを設定する仮アドレス設定手段と、
前記仮アドレス設定手段によって設定された前記仮のアドレスの記憶領域に前記データが記憶されていないか、若しくは前記先頭の記憶領域に記憶された前記データの保存時刻よりも前の保存時刻を示す時刻データが記憶されている場合であって、前記仮のアドレスの1つ前のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも後の保存時刻を示す時刻データが記憶されているとの第1の条件を満たすか否かを判別する第1の判別手段と、
前記第1の判別手段により前記第1の条件を満たすと判別されると、前記仮のアドレスを前記第2の記憶手段に記憶する記憶処理手段と、
前記第1の判別手段により前記第1の条件を満たさないと判別されると、前記仮のアドレスの記憶領域に前記データが記憶されていないか、若しくは当該仮の アドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも前の保存時刻を示す時刻データが記憶されているとの第2の条件と、前記仮のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも後の保存時刻を示す時刻データが記憶されているとの第3の条件のいずれが満たされるかを判別する第2の判別手段と、
前記第2の判別手段により前記第2の条件を満たすと判別されると、前記第1の判別手段の処理における前記仮のアドレスを当該仮のアドレスと前記先頭の記憶領域のアドレスの間の所定のアドレスに変更し、前記第2の判別手段により前記第3の条件を満たすと判別されると、前記第1の判別手段の処理における前記仮のアドレスを当該仮のアドレスの次のアドレスに変更する仮アドレス変更手段と、
前記記憶処理手段が前記仮のアドレスを前記第2の記憶手段に記憶するまで、前記第1の判別手段、前記第2の判別手段および前記仮アドレス変更手段による処理を繰り返す繰返制御手段と、
からなることを特徴とする請求項に記載のデータ保存装置。
The address storage control means includes
Temporary address setting means for setting a temporary address from the difference between the time data stored in the first storage area of the first storage means and the time data at the time of determination measured by the time measuring means;
The time indicating whether the data is not stored in the storage area of the temporary address set by the temporary address setting means or the storage time before the storage time of the data stored in the head storage area Time data indicating a storage time later than the storage time of the data stored in the head storage area in the storage area of the address immediately before the temporary address is stored. First determination means for determining whether or not the first condition of being stored is satisfied;
A storage processing unit for storing the temporary address in the second storage unit when the first determination unit determines that the first condition is satisfied;
If it is determined by the first determination means that the first condition is not satisfied, the data is not stored in the temporary address storage area, or the first address is stored in the temporary address storage area. The second condition that time data indicating a storage time before the storage time of the data stored in the storage area is stored, and the storage area of the temporary address is stored in the top storage area. Second determination means for determining which of the third conditions that time data indicating a storage time later than the storage time of the data is stored is satisfied;
When it is determined by the second determination means that the second condition is satisfied, the temporary address in the processing of the first determination means is determined between the temporary address and the address of the head storage area. If the second determination means determines that the third condition is satisfied, the temporary address in the processing of the first determination means is changed to the next address of the temporary address. Temporary address changing means for
Repetitive control means for repeating the processing by the first determination means, the second determination means and the temporary address change means until the storage processing means stores the temporary address in the second storage means;
The data storage device according to claim 1 , comprising:
前記第1の記憶手段は、不揮発性メモリであることを特徴とする、請求項1または2に記載のデータ保存装置。 It said first storage means, characterized in that it is a non-volatile memory, data storage device according to claim 1 or 2. 前記第1の記憶手段は、NAND型フラッシュメモリであることを特徴とする、請求項に記載のデータ保存装置。 4. The data storage device according to claim 3 , wherein the first storage means is a NAND flash memory. 前記第1の記憶手段の各記憶領域に記憶される複数のデータは、太陽光発電システムにおいて周期的に計測される当該システムの動作を制御するデータと気象に関するデータであることを特徴とする、請求項1〜のいずれかに記載のデータ保存装置。 The plurality of data stored in each storage area of the first storage means are data for controlling the operation of the system periodically measured in a photovoltaic power generation system and data on weather, The data storage device according to any one of claims 1 to 4 . コンピュータを、
複数の記憶領域に分割され、各記憶領域にアドレスが順番に付されている不揮発性の第1の記憶装置のデータを記憶すべきアドレスを、当該第1の記憶装置とは異なる揮発性の第2の記憶装置に記憶させるアドレス記憶制御手段と
ータの保存が指令される毎に、当該データを計時装置により計時される保存時の時刻データとともに、前記第1の記憶装置の、前記第2の記憶装置に記憶されたアドレスの記憶領域に記させるデータ記憶制御手段と、
前記第1の記憶装置に前記データ記憶される毎に、前記第2の記憶装置に記憶された前記アドレスを、前記第1の記憶装置に付された複数のアドレスが循環するように次のアドレスに変更するアドレス変更手段と、
前記第2の記憶装置に記憶された前記アドレスが消失しているか否かを判別する判別手段と、
前記判別手段により前記アドレスが消失していると判別されると、前記第1の記憶装置の各記憶領域に記憶されている前記時刻データと前記計時装置により計時される判別時の時刻データとを用いて、当該判別後に保存が指令されるデータに対する前記第1の記憶装置の記憶領域のアドレスを決定し、そのアドレスを前記第2の記憶装置に記憶させる第2のアドレス記憶制御手段と、
して機能させることを特徴とするプログラム。
Computer
An address for storing data of the nonvolatile first storage device that is divided into a plurality of storage areas and in which the addresses are assigned in order to each storage area is designated as a volatile first that is different from the first storage device. an address storage control unit Ru is stored in the second storage device,
Each time saving of data is commanded, together with time data during storage which is clocked by the data timing device, said first storage device, the storage area of the address stored in the second storage device a data storage control means to Ru is memorize,
Wherein for each of the data is Ru stored in the first storage device, said second of said address stored in the storage device, said first plurality of address attached to the storage device of the next to circulate An address changing means for changing to an address;
Determining means for determining whether or not the address stored in the second storage device is lost;
If it is determined by the determining means that the address is lost, the time data stored in each storage area of the first storage device and the time data at the time of determination timed by the time measuring device are obtained. A second address storage control means for determining an address of a storage area of the first storage device for data to be stored after the determination, and storing the address in the second storage device;
A program characterized by making it function.
前記第2のアドレス記憶制御手段は、
前記第1の記憶装置の先頭の記憶領域に記憶されている前記時刻データと前記計時装置により計時される前記判別時の時刻データの差から仮のアドレスを設定する仮アドレス設定手段と、
前記仮アドレス設定手段によって設定された前記仮のアドレスの記憶領域に前記データが記憶されていないか、若しくは前記先頭の記憶領域に記憶された前記データの保存時刻よりも前の保存時刻を示す時刻データが記憶されている場合であって、前記仮のアドレスの1つ前のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも後の保存時刻を示す時刻データが記憶されているとの第1の条件を満たすか否かを判別する第1の判別手段と、
前記第1の判別手段により前記第1の条件を満たすと判別されると、前記仮のアドレスを前記第2の記憶手段に記憶する記憶処理手段と、
前記第1の判別手段により前記第1の条件を満たさないと判別されると、前記仮のアドレスの記憶領域に前記データが記憶されていないか、若しくは当該仮のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも前の保存時刻を示す時刻データが記憶されているとの第2の条件と、前記仮のアドレスの記憶領域に前記先頭の記憶領域に記憶された前記データの保存時刻よりも後の保存時刻を示す時刻データが記憶されているとの第3の条件のいずれが満たされるかを判別する第2の判別手段と、
前記第2の判別手段により前記第2の条件を満たすと判別されると、前記第1の判別手段の処理における前記仮のアドレスを当該仮のアドレスと前記先頭の記憶領域のアドレスの間の所定のアドレスに変更し、前記第2の判別手段により前記第3の条件を満たすと判別されると、前記第1の判別手段の処理における前記仮のアドレスを当該仮のアドレスの次のアドレスに変更する仮アドレス変更手段と、
前記記憶処理手段が前記仮のアドレスを前記第2の記憶手段に記憶するまで、前記第1の判別手段、前記第2の判別手段および前記仮アドレス変更手段による処理を繰り返す繰返制御手段と、
からなり、
前記コンピュータを、前記仮アドレス設定手段、前記第1の判別手段、前記記憶処理手段、前記第2の判別手段、前記仮アドレス変更手段及び繰返制御手段として機能させることを特徴とする請求項に記載のプログラム。
The second address storage control means includes:
Temporary address setting means for setting a temporary address from a difference between the time data stored in the first storage area of the first storage device and the time data at the time of determination determined by the time measuring device;
The time indicating whether the data is not stored in the storage area of the temporary address set by the temporary address setting means or the storage time before the storage time of the data stored in the head storage area Time data indicating a storage time later than the storage time of the data stored in the head storage area in the storage area of the address immediately before the temporary address is stored. First determination means for determining whether or not the first condition of being stored is satisfied;
A storage processing unit for storing the temporary address in the second storage unit when the first determination unit determines that the first condition is satisfied;
If it is determined by the first determination means that the first condition is not satisfied, the data is not stored in the temporary address storage area or the first address is stored in the temporary address storage area. The second condition that time data indicating a storage time before the storage time of the data stored in the storage area is stored, and the storage area of the temporary address is stored in the top storage area. Second determination means for determining which of the third conditions that time data indicating a storage time later than the storage time of the data is stored is satisfied;
When it is determined by the second determination means that the second condition is satisfied, the temporary address in the processing of the first determination means is determined between the temporary address and the address of the head storage area. If the second determination means determines that the third condition is satisfied, the temporary address in the processing of the first determination means is changed to the next address of the temporary address. Temporary address changing means for
Repetitive control means for repeating the processing by the first determination means, the second determination means and the temporary address change means until the storage processing means stores the temporary address in the second storage means;
Consists of
Said computer, said temporary address setting means, said first determination means, the storage processing unit, according to claim 6, wherein the second determining means, characterized in that function as the temporary address change means and repeat control means The program described in.
請求項6または7に記載のプログラムを記録したコンピュータ読み取り可能な記録媒体。 A computer-readable recording medium in which the program according to claim 6 or 7 is recorded.
JP2007151638A 2007-06-07 2007-06-07 Data storage device Active JP5074104B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007151638A JP5074104B2 (en) 2007-06-07 2007-06-07 Data storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007151638A JP5074104B2 (en) 2007-06-07 2007-06-07 Data storage device

Publications (3)

Publication Number Publication Date
JP2008305161A JP2008305161A (en) 2008-12-18
JP2008305161A5 JP2008305161A5 (en) 2010-06-03
JP5074104B2 true JP5074104B2 (en) 2012-11-14

Family

ID=40233838

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007151638A Active JP5074104B2 (en) 2007-06-07 2007-06-07 Data storage device

Country Status (1)

Country Link
JP (1) JP5074104B2 (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH07147097A (en) * 1993-11-24 1995-06-06 Mitsubishi Electric Corp Method of writing eeprom data
JPH07182246A (en) * 1993-11-25 1995-07-21 Sanyo Electric Co Ltd Device and method for controlling non-volatile memory
JP2005071068A (en) * 2003-08-25 2005-03-17 Renesas Technology Corp Storage device
JP4097649B2 (en) * 2004-12-09 2008-06-11 ファナック株式会社 Numerical controller
JP5162846B2 (en) * 2005-07-29 2013-03-13 ソニー株式会社 Storage device, computer system, and storage system

Also Published As

Publication number Publication date
JP2008305161A (en) 2008-12-18

Similar Documents

Publication Publication Date Title
JP5629391B2 (en) Semiconductor memory device and method for controlling semiconductor memory device
KR101718646B1 (en) Monitoring device, control device and control system
US9063181B2 (en) Memory management for an intelligent electronic device
US7065608B2 (en) Apparatus for recording data and method for writing data to flash memory
US7962807B2 (en) Semiconductor storage apparatus managing system, semiconductor storage apparatus, host apparatus, program and method of managing semiconductor storage apparatus
CN100447749C (en) Method of using flash memory for storing metering data
US7596656B2 (en) Memory cards with end of life recovery and resizing
US20110153917A1 (en) Storage apparatus and its control method
JP2008511832A (en) Firmware power cycle routine
JP2008515054A (en) How to store weighing data using flash memory
US9711987B2 (en) Apparatus and method for managing energy in building based on state of health of energy storage system
CN109470918B (en) Electric quantity data processing method of IR46 electric energy meter and IR46 electric energy meter
US7839123B1 (en) Apparatus and implementation of a battery in a non volatile memory subsystem
JP2008269473A (en) Data remaining period managing device and method
CN111176575A (en) SSD (solid State disk) service life prediction method, system, terminal and storage medium based on Prophet model
CN112181303A (en) Data storage method and device, computer equipment and storage medium
CN102929794A (en) Storage method for electrically erasable programmable read only memory (EEPROM)
JP5074104B2 (en) Data storage device
US7921340B2 (en) Nonvolatile memory device, nonvolatile memory system, and defect management method for nonvolatile memory device
BR0006867B1 (en) METHODS AND ELECTRIC METER FOR MEASURING ENERGY CONSUMPTION
JP5088479B2 (en) Data recording device
JP2008305161A5 (en)
JP6997555B2 (en) Information processing equipment, communication systems, information processing methods, and programs
JP6012869B2 (en) Information management system, information management apparatus, information management method, and program
JP2004325314A (en) Measuring instrument

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100420

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20100420

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20120706

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20120717

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120724

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20120821

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20120823

R150 Certificate of patent or registration of utility model

Ref document number: 5074104

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20150831

Year of fee payment: 3

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250