JP2009129026A - Data management device, information processor, and program - Google Patents

Data management device, information processor, and program Download PDF

Info

Publication number
JP2009129026A
JP2009129026A JP2007300920A JP2007300920A JP2009129026A JP 2009129026 A JP2009129026 A JP 2009129026A JP 2007300920 A JP2007300920 A JP 2007300920A JP 2007300920 A JP2007300920 A JP 2007300920A JP 2009129026 A JP2009129026 A JP 2009129026A
Authority
JP
Japan
Prior art keywords
data
unit
stored
page
cpu
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2007300920A
Other languages
Japanese (ja)
Inventor
Tetsuaki Daihi
哲明 大朏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Seiko Epson Corp
Original Assignee
Seiko Epson Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Seiko Epson Corp filed Critical Seiko Epson Corp
Priority to JP2007300920A priority Critical patent/JP2009129026A/en
Publication of JP2009129026A publication Critical patent/JP2009129026A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To shorten a time required for saving of data when a state is shifted to a power non-supply state. <P>SOLUTION: When receiving an instruction to start data saving processing from a memory access monitoring device 70, a CPU 10 refers to access frequency of only records whose saving completion flags are "0" in an access management table 71, and stores the page ID in an RAM 30 in the order of record whose access frequency is small. The sequence of page ID stored on the RAM 30 is defined as a saving queue. Then, the CPU 10 reads the page ID at the leading of the saving queue created by the RAM 30, and specifies a memory address by referring to the access management table 71, and saves the page corresponding to the page ID to a flash memory 40. Then, the CPU 10 erases the page ID of the saved page from the saving queue, and sets the corresponding saving completion flag of the access management table to "1". <P>COPYRIGHT: (C)2009,JPO&INPIT

Description

本発明は、電力供給を受けてデータを記憶した状態を維持する記憶手段と、電力供給を受けずにデータを記憶した状態を維持する記憶手段との間でデータを移動させる技術に関する。   The present invention relates to a technique for moving data between a storage unit that maintains a state in which data is stored by receiving power supply and a storage unit that maintains a state in which data is stored without receiving power supply.

コンピュータの電源を投入したときにそれ以前に電源を切った時の作業内容が復元される、ハイバネーションという技術が知られている。例えば、特許文献1には、電源を切る前に揮発性メモリ内のデータを不揮発性メモリに書き込んでおいてから、電源オフの電力非供給状態に移行し、電源が再度投入されたときには、不揮発性メモリに書き込まれたデータを揮発性メモリに書き戻す技術が開示されている。また、特許文献2には、スリープモードに移行する前に、揮発性メモリ内のデータのうち、データ領域とバックアップ領域に保存されているデータのみを不揮発性メモリに書き込む技術が開示されている。特許文献2に開示された技術によれば、揮発性メモリ内の全てのデータを書き戻す場合と比べて、不揮発性メモリに書き込むデータの量が少なくなるため、不揮発性メモリに記憶されているデータを短時間で揮発性メモリに書き戻すことができる。
特開2005−115720号公報 特開2007−38580号公報
A technique called hibernation is known in which when a computer is turned on, the work contents when the power is turned off are restored. For example, Patent Document 1 describes that when data in a volatile memory is written in a nonvolatile memory before turning off the power, the power is turned off and the power is turned off, and the power is turned on again. A technique for writing back data written in a volatile memory to a volatile memory is disclosed. Patent Document 2 discloses a technique for writing only data stored in a data area and a backup area, out of data in a volatile memory, into a nonvolatile memory before shifting to a sleep mode. According to the technique disclosed in Patent Document 2, since the amount of data to be written to the nonvolatile memory is smaller than when all the data in the volatile memory is written back, the data stored in the nonvolatile memory is reduced. Can be written back to the volatile memory in a short time.
JP 2005-115720 A JP 2007-38580 A

上記のように電力非供給状態に移行するときには、揮発性メモリに記憶された全てのデータを不揮発性メモリに書き込むようになっている。一般に、不揮発性メモリに対するデータの読み書きに要する時間は、揮発性メモリに対するデータの読み書きに要する時間よりも長いため、揮発性メモリに記憶された全てのデータを不揮発性メモリに書き込むのには相当の時間を要するという問題がある。特に携帯端末のように小型の電源を搭載している装置の場合には、電力の残量に余裕がないため、電力非供給状態に移行するときに揮発性メモリに記憶された全てのデータを不揮発性メモリに書き込むことができなかった、という事態を招く虞もある。   When shifting to the non-power supply state as described above, all data stored in the volatile memory is written into the nonvolatile memory. In general, the time required to read / write data from / to a nonvolatile memory is longer than the time required to read / write data from / to a volatile memory, so it is quite appropriate to write all the data stored in the volatile memory to the nonvolatile memory. There is a problem that it takes time. In particular, in the case of a device equipped with a small power source such as a portable terminal, since there is no room for the remaining amount of power, all data stored in the volatile memory is stored when the power is not supplied. There is also a possibility that a situation in which data could not be written to the nonvolatile memory could be caused.

本発明は、このような背景に鑑みてなされたものであり、その目的は、電力非供給状態に移行するのに要する時間を短縮することにある。   The present invention has been made in view of such a background, and an object thereof is to shorten the time required to shift to a power non-supply state.

上述した課題を解決するため、本発明に係るデータ管理装置は、電力供給を受けて、データを記憶した状態を維持する第1の記憶手段と、電力供給を受けずに、データを記憶した状態を維持する第2の記憶手段と、前記第1の記憶手段に電力を供給する電力供給状態、又は、前記第1の記憶手段に電力を供給しない電力非供給状態のいずれかに移行させる状態移行手段と、前記電力供給状態において、前記第1の記憶手段に記憶されているデータを用いて処理を実行する処理実行手段と、前記電力供給状態から前記電力非供給状態に移行する指示があるまでに、前記第1の記憶手段に記憶されているデータを一部分ずつ、それぞれ異なる時期に読み出して前記第2の記憶手段に記憶させる退避処理を行う退避手段とを備え、前記状態移行手段は、前記第1の記憶手段に記憶されているデータに対して前記退避手段による前記退避処理が行われてから、前記電力供給状態から前記電力非供給状態に移行させることを特徴とする。
本発明によれば、電力供給状態から電力非供給状態に移行する指示があるまでに、第1の記憶手段に記憶されているデータを一部分ずつ、それぞれ異なる時期に読み出して第2の記憶手段に記憶させる退避処理を行うので、電力非供給状態に移行するのに要する時間を短縮することができる。
In order to solve the above-described problems, a data management device according to the present invention is configured to receive a power supply and maintain a state in which the data is stored, and a state in which the data is stored without receiving the power supply. The second storage means for maintaining the power and the state transition for shifting to either the power supply state for supplying power to the first storage means or the power non-supply state for not supplying power to the first storage means Means, processing execution means for executing processing using data stored in the first storage means in the power supply state, and an instruction to shift from the power supply state to the power non-supply state And a retreating unit for performing retreat processing for reading out data stored in the first storage unit part by part at different times and storing them in the second storage unit, The from the saving processing being performed by the saving means, and wherein the shifting from the power supply state to the power non-supply state to the data stored in the first storage unit.
According to the present invention, data stored in the first storage means is read out part by part at different times until an instruction to shift from the power supply state to the power non-supply state is given to the second storage means. Since the save processing to be stored is performed, the time required to shift to the power non-supply state can be shortened.

前記退避手段は、前記処理実行手段による実行の単位となる処理が完了するたびに前記退避処理を開始してもよく、前記処理実行手段により処理が実行されていない期間に当該退避処理を行うとしてもよい。このようにすると、退避処理がその退避処理以外の処理に対して負荷をかけないようにすることができる。   The saving unit may start the saving process every time processing as a unit of execution by the processing execution unit is completed, and performs the saving process during a period when the process is not executed by the processing execution unit. Also good. In this way, it is possible to prevent the save process from applying a load to processes other than the save process.

また、前記処理実行手段は、実行の単位となる処理を開始してから完了するまでに、当該処理の実行を一時中断し、前記退避手段は、前記処理実行手段が前記処理の実行を一時中断している期間に、前記退避処理を行ってもよい。このようにすると、退避処理以外の処理が実行されている期間であっても、退避処理を行うことができる。   Further, the process execution means temporarily suspends execution of the process from the start to completion of the process as a unit of execution, and the save means temporarily suspends execution of the process by the process execution means The evacuation process may be performed during the period of time. In this way, the save process can be performed even during a period in which a process other than the save process is being executed.

また、上述の態様において、前記処理実行手段は、プログラムに記述された手順に従って処理を実行するCPUであり、前記処理実行手段による実行の単位となる処理は、前記プログラムに記述された手順に従ってCPUが実行する処理の単位となるタスクであることが望ましい。   In the above-described aspect, the process execution unit is a CPU that executes a process according to a procedure described in a program, and a process that is a unit of execution by the process execution unit is a CPU according to a procedure described in the program. It is desirable that the task is a unit of processing to be executed.

また、好ましくは、前記データが複数の部分データに区分されている場合に、前記処理実行手段が前記第1の記憶手段に記憶された前記部分データを用いた回数を、当該部分データ毎に記憶する回数記憶手段を備え、前記退避手段は、前記回数記憶手段によって記憶されている回数が少ない部分データに対して、当該回数が多い部分データよりも先に前記退避処理を行うとよい。このようにすると、部分データの利用回数から、退避の優先順位を決定することができるため、より効率的な退避処理を行うことができる。   Preferably, when the data is divided into a plurality of partial data, the number of times the processing execution unit uses the partial data stored in the first storage unit is stored for each partial data. It is preferable that the save unit performs the save process on the partial data stored in the number storage unit before the partial data with the high number of times. In this way, since the priority of saving can be determined from the number of times partial data is used, more efficient saving processing can be performed.

また、好ましくは、前記退避手段は、前記回数記憶手段によって記憶されている前記回数の合計が第1の閾値以上である場合に、前記退避処理を行うとよい。このようにすると、データの利用回数の合計が閾値以下の場合に、不揮発性記憶装置へ記憶することがないため、退避処理によって、その退避処理以外の処理の実行速度を低下させないようにできる。   Preferably, the save unit performs the save process when the total number of times stored in the number storage unit is equal to or greater than a first threshold value. In this way, when the total number of times data is used is less than or equal to the threshold value, the data is not stored in the nonvolatile storage device, so that the execution speed of processes other than the save process can be prevented from being reduced by the save process.

また、好ましくは、前記退避手段は、前記回数記憶手段によって記憶されている前記回数の合計が第1の閾値以上である場合には、前記処理実行手段により処理が実行されていない期間において前記退避処理を行い、前記回数記憶手段によって記憶されている前記回数の合計が、前記第1の閾値よりも大きい第2の閾値以上である場合には、前記処理実行手段により処理が実行されている期間においても前記退避処理を行うとよい。このようにすると、データの利用回数の合計に応じて、その値が第1の閾値になるまでは「退避の必要のない状態」、第1の閾値から第2の閾値までは「処理実行手段による処理が行われていない場合には退避処理を行う状態」、第2の閾値以上では「処理実行手段による処理が行われている場合であっても強制的に退避処理を行う状態」に分けることができ、データの利用回数の合計に応じた適切な退避処理をさせることができる。   Preferably, the save unit saves the save during a period when the process is not executed by the process execution unit when the total number of times stored in the number storage unit is equal to or greater than a first threshold. A period during which processing is executed by the processing execution means when the total number of times stored in the number storage means is equal to or greater than a second threshold value greater than the first threshold value. Also in the above, it is preferable to perform the saving process. In this way, according to the total number of times of data use, “a state in which saving is not necessary” is performed until the value reaches the first threshold, and “processing execution means” is performed from the first threshold to the second threshold. If the process is not performed, the save process is performed ", and if the process is greater than or equal to the second threshold value, the process is forcibly performed even if the process is being performed by the process execution unit. Therefore, it is possible to perform an appropriate saving process according to the total number of times data is used.

また、好ましくは、前記退避手段は、前記電力供給状態から前記電力非供給状態に移行する指示があるまでに、前記第1の記憶手段に記憶されているデータを全て退避することができなかった場合には、当該指示があった後に、退避していないデータを前記第1の記憶手段から読み出して前記第2の記憶手段に記憶させるとよい。このようにすると、電力非供給状態への移行指示があってから、第1の記憶手段の記憶内容が変更されても、その変更を反映した退避処理を行うことができる。   Further, preferably, the saving unit has not been able to save all the data stored in the first storage unit until there is an instruction to shift from the power supply state to the power non-supply state. In this case, after the instruction is given, the data that has not been saved may be read from the first storage unit and stored in the second storage unit. In this way, even if the storage content of the first storage unit is changed after the instruction to shift to the power non-supply state is issued, the saving process reflecting the change can be performed.

また、好ましくは、前記電力供給状態において、前記処理実行手段が実行する処理に用いるデータが前記第1の記憶手段に記憶されていない場合に、前記第2の記憶手段に記憶されている当該データを読み出し、前記第1の記憶手段に記憶させる復元処理を行うとともに、前記第2の記憶手段において、当該データに関連した関連データの復元順を記憶する第1の復元手段と、前記処理実行手段により処理が実行されていない期間において、前記第1の復元手段が記憶した復元順に基づいて、前記第2の記憶手段に記憶されている前記関連データを読み出し、前記第1の記憶手段に記憶させる第2の復元手段とを備えるとよい。このようにすると、電力非供給状態から電力供給状態へ移行したときに、迅速に復元すべきデータを復元するとともに、復元したデータに基づいて、次に復元が必要となるデータを類推して関連データとして記憶しておき、これを優先的に復元させるので、データ復元処理を効率的に分散化することができる。   Preferably, in the power supply state, when data used for processing executed by the processing execution unit is not stored in the first storage unit, the data stored in the second storage unit Is read out and stored in the first storage means, and in the second storage means, a first restoration means for storing a restoration order of related data related to the data, and the process execution means Based on the restoration order stored by the first restoration unit, the related data stored in the second storage unit is read out and stored in the first storage unit during a period when the processing is not executed by It is good to provide a 2nd decompression | restoration means. In this way, when moving from the non-power supply state to the power supply state, the data that should be restored quickly is restored, and the data that needs to be restored next is inferred based on the restored data. Since it is stored as data and restored preferentially, the data restoration process can be efficiently distributed.

また、好ましくは、前記関連データのデータサイズは、前記処理実行手段が実行する処理毎に定められているとよい。処理ごとに、関連データのサイズが異なっている場合もあるからである。   Preferably, the data size of the related data is determined for each process executed by the process execution unit. This is because the size of the related data may be different for each process.

また、本発明に係る情報処理装置は、上述のデータ管理装置と、前記処理実行手段によって処理された結果を出力する出力手段とを具備することを特徴とする。   An information processing apparatus according to the present invention includes the data management apparatus described above and an output unit that outputs a result processed by the process execution unit.

また、本発明に係るプログラムは、電力供給を受けてデータを記憶した状態を維持する第1の記憶手段と、電力供給を受けずにデータを記憶した状態を維持する第2の記憶手段とを備えたコンピュータを、前記第1の記憶手段に電力を供給する電力供給状態、又は、前記第1の記憶手段に電力を供給しない電力非供給状態のいずれかに移行させる状態移行手段と、前記電力供給状態において、前記第1の記憶手段に記憶されているデータを用いて処理を実行する処理実行手段と、前記電力供給状態において、前記第1の記憶手段に記憶されているデータを一部分ずつ、それぞれ異なる時期に読み出して前記第2の記憶手段に記憶させる退避処理を行う退避手段として機能させ、さらに前記状態移行手段は、前記第1の記憶手段に記憶されているデータに対して前記退避手段による前記退避処理が行われてから、前記電力供給状態から前記電力非供給状態に移行させるプログラムである。
本発明によれば、電力供給状態から電力非供給状態に移行する指示があるまでに、第1の記憶手段に記憶されているデータを一部分ずつ、それぞれ異なる時期に読み出して第2の記憶手段に記憶させる退避処理を行うので、電力非供給状態に移行するのに要する時間を短縮することができる。
In addition, the program according to the present invention includes a first storage unit that maintains a state in which data is stored by receiving power supply, and a second storage unit that maintains a state in which data is stored without receiving power supply. A state transition unit that shifts the computer provided to either a power supply state that supplies power to the first storage unit or a power non-supply state that does not supply power to the first storage unit; and the power In a supply state, a process execution means for executing processing using data stored in the first storage means, and in the power supply state, data stored in the first storage means in part Each of the state transition means is stored in the first storage means and functions as a save means for performing a save process that is read at different times and stored in the second storage means. From said save processing is performed by the saving means to the data, a program for transition to the power non-supply state from the power supply state.
According to the present invention, data stored in the first storage means is read out part by part at different times until an instruction to shift from the power supply state to the power non-supply state is given to the second storage means. Since the save processing to be stored is performed, the time required to shift to the power non-supply state can be shortened.

[A:構成]
[A−1:表示装置の全体構成]
図1は、本実施形態に係る表示装置1の構成を示す図である。同図に示すように、表示装置1は、CPU(Central Processing Unit)10と、ROM(Read Only Memory)20と、RAM(Random Access Memory)30と、フラッシュメモリ40と、操作部50と、表示部60と、メモリアクセス監視装置70と、電源部80とを備えている。CPU10と、ROM20と、RAM30と、フラッシュメモリ40と、操作部50と、表示部60と、メモリアクセス監視装置70は、バス90を介して接続されている。また、これらの各部10〜70と電源部80とは図示せぬ電源線を介して接続されている。電源部80は、例えば充電可能な電池や電源制御回路を備えており、表示装置1を構成する各部に対し、上記電源線を介して電力を供給する。
[A: Configuration]
[A-1: Overall configuration of display device]
FIG. 1 is a diagram illustrating a configuration of a display device 1 according to the present embodiment. As shown in the figure, the display device 1 includes a CPU (Central Processing Unit) 10, a ROM (Read Only Memory) 20, a RAM (Random Access Memory) 30, a flash memory 40, an operation unit 50, and a display. Unit 60, memory access monitoring device 70, and power supply unit 80. The CPU 10, ROM 20, RAM 30, flash memory 40, operation unit 50, display unit 60, and memory access monitoring device 70 are connected via a bus 90. Further, these units 10 to 70 and the power supply unit 80 are connected via a power supply line (not shown). The power supply unit 80 includes, for example, a rechargeable battery and a power supply control circuit, and supplies power to each unit constituting the display device 1 through the power supply line.

ROM20は、読み出し専用のメモリであり、表示装置1の起動処理を司るブートプログラムやOS(Operation System)などの各種制御プログラムなどを記憶している。CPU10は、ROM20に記憶されている制御プログラムや、フラッシュメモリ40に記憶されている各種処理プログラムを実行することにより、表示装置1の動作を制御したり、各種の処理を行ってその処理結果を表示部60によって出力したりする。   The ROM 20 is a read-only memory, and stores a boot program that controls the startup process of the display device 1 and various control programs such as an OS (Operation System). The CPU 10 executes the control program stored in the ROM 20 and various processing programs stored in the flash memory 40 to control the operation of the display device 1 and perform various processes and obtain the processing results. Or output by the display unit 60.

RAM30は、電源部80から電力供給を受けて、データを記憶した状態を維持する揮発性メモリである。すなわち、RAM30に記憶されたデータは、電源部80からRAM30に電力が供給されている期間にわたっては記憶され続けるが、電源部80からの電力供給がなくなると消去される。このRAM30は、CPU10のワークエリアとして使用され、例えばCPU10が実行中の処理において用いられるデータを記憶する。このデータには、ROM20やフラッシュメモリ40から読み出されてRAM30にロードされた各種のプログラムや関数のほか、実行中の処理で用いられている各種の値や引数などが含まれている。以下では、RAM30に記憶されているこれらのデータを「処理データ」と総称する。   The RAM 30 is a volatile memory that receives power supply from the power supply unit 80 and maintains a state in which data is stored. In other words, the data stored in the RAM 30 continues to be stored for a period during which power is supplied from the power supply unit 80 to the RAM 30, but is erased when the power supply from the power supply unit 80 is lost. The RAM 30 is used as a work area for the CPU 10, and stores data used in processing being executed by the CPU 10, for example. This data includes various programs and functions read from the ROM 20 and the flash memory 40 and loaded into the RAM 30, as well as various values and arguments used in the processing being executed. Hereinafter, these data stored in the RAM 30 are collectively referred to as “process data”.

フラッシュメモリ40は、電源部80から電力供給を受けなくても、データを記憶した状態を維持し得る不揮発性メモリである。このフラッシュメモリ40には、上述した処理プログラムが記憶されているほか、CPU10が処理実行中のRAM30上の処理データを記憶するための記憶領域が設けられている。このように、RAM30は、電力供給を受けて、処理データを記憶した状態を維持する第1の記憶手段として機能するの対し、フラッシュメモリ40は、電力供給を受けずに、処理データを記憶した状態を維持する第2の記憶手段として機能する。   The flash memory 40 is a non-volatile memory that can maintain a state in which data is stored without receiving power supply from the power supply unit 80. In addition to storing the above-described processing program, the flash memory 40 is provided with a storage area for storing processing data on the RAM 30 being processed by the CPU 10. As described above, the RAM 30 receives power supply and functions as a first storage unit that maintains the state in which processing data is stored, whereas the flash memory 40 stores processing data without receiving power supply. It functions as second storage means for maintaining the state.

操作部50は、例えばペンデバイスやジョイスティックなどを備え、利用者の操作に応じた操作信号をCPU10に供給する。表示部60は、例えばコレステリック液晶や電気泳動などを利用した記憶性液晶表示体や表示制御回路を備え、CPU10による指示の下で各種の画像を表示する。メモリアクセス監視装置70は、CPU10のRAM30に対するアクセス状況を監視する装置であり、自身が備える揮発性メモリにアクセス管理テーブル71を記憶している。このアクセス管理テーブル71は、上記の監視結果が記述されたテーブルである。   The operation unit 50 includes, for example, a pen device or a joystick, and supplies an operation signal corresponding to a user operation to the CPU 10. The display unit 60 includes, for example, a storage liquid crystal display using a cholesteric liquid crystal or electrophoresis, and a display control circuit, and displays various images under instructions from the CPU 10. The memory access monitoring device 70 is a device that monitors the access status of the CPU 10 to the RAM 30, and stores an access management table 71 in a volatile memory included in the memory access monitoring device 70. The access management table 71 is a table in which the above monitoring result is described.

[A−2:アクセス管理テーブルの構成]
図2は、このアクセス管理テーブル71の一例を示した図である。
図2に示すように、アクセス管理テーブル71は、退避済フラグ、復元済フラグ、処理データの記憶場所を表すRAM30のメモリアドレス、アクセス頻度、およびページIDといった各フィールドを有するテーブルである。さらに、このアクセス管理テーブル71には、上記アクセス頻度の総計が記述されるアクセス頻度総数のフィールドを備えている。この表示装置1においては、RAM30とフラッシュメモリ40との間では「ページ」と呼ばれる単位でデータが遣り取りされる。アクセス管理テーブル71の「メモリアドレス」とは、これらの各ページが処理データとしてRAM30に記憶されているときのその記憶領域の先頭アドレスである。また、「アクセス頻度」とは、CPU10が、そのメモリアドレスで示されるページにアクセスした回数である。この回数は、メモリアクセス監視装置70によって常時、計数され、該当ページに対応するアクセス頻度のフィールドに記述される。「ページID」は、各ページに割り当てられた識別情報である。「退避済フラグ」は、RAM30に記憶されている各ページをフラッシュメモリ40に記憶させること、つまりページの退避が行われた否かを示す情報であり、「1」が退避済みで「0」が未退避を意味している。また、「復元済フラグ」は、フラッシュメモリ40に記憶されている各ページをRAM30に記憶させること、つまりページの復元が行われた否かを示す情報であり、「1」が復元済みで「0」が未復元を意味している。
[A-2: Configuration of access management table]
FIG. 2 is a diagram showing an example of the access management table 71.
As shown in FIG. 2, the access management table 71 is a table having fields such as a saved flag, a restored flag, a memory address of the RAM 30 indicating a storage location of processing data, an access frequency, and a page ID. Further, the access management table 71 has a field of total access frequency in which the total access frequency is described. In the display device 1, data is exchanged between the RAM 30 and the flash memory 40 in units called “pages”. The “memory address” in the access management table 71 is the top address of the storage area when each of these pages is stored as processing data in the RAM 30. The “access frequency” is the number of times the CPU 10 has accessed the page indicated by the memory address. This number of times is always counted by the memory access monitoring device 70 and described in the access frequency field corresponding to the page. “Page ID” is identification information assigned to each page. The “saved flag” is information indicating whether each page stored in the RAM 30 is stored in the flash memory 40, that is, whether or not the page has been saved, and “1” is saved and “0”. Means not saved. The “restored flag” is information indicating whether each page stored in the flash memory 40 is stored in the RAM 30, that is, whether or not the page has been restored. “1” is restored and “ “0” means not restored.

[A−3:表示装置の起動状態]
ここで、表示装置1の起動状態について説明する。表示装置1は、「オン状態」、「スリープ状態」、「オフ状態」の3つの起動状態を有しており、これらのうちのいずれかの1つの起動状態をとるようになっている。まず、「オン状態」は、表示装置1の各部に電力が供給される電力供給状態であり、表示装置1が通常の動作を行う状態である。この「オン状態」では、CPU10によって各種の処理が行われることになる。次に、「スリープ状態」は、表示装置1の限られた部品のみに電力が供給され、表示装置1の一部が動作しない状態である。この「スリープ状態」では、CPU10や表示部60には電力が供給されないが、それ以外の部品(RAM30を含む)には電力が供給される。よって、「オン状態」は、消費電力が多い第1の電力供給状態であるし、「スリープ状態」は、消費電力が少ない第2の電力供給状態であると言える。そして、「オフ状態」は、電源部80がオフになったときの状態である。この「オフ状態」では、表示装置1の各部に電力が供給されないので、表示装置1はいっさい動作しない。上述した「オン状態」から「スリープ状態」への移行は、例えば「オン状態」においてCPU10が処理を行わない待機時間が所定時間以上になった時に行われる。また、「スリープ状態」から「オン状態」への移行は、例えば操作部50が操作された時に行われる。このように、「オン状態」及び「スリープ状態」は、表示装置1の各部のうち少なくともRAM30に電力を供給する「電力供給状態」であるのに対し、「オフ状態」はRAM30に電力を供給しない「電力非供給状態」である。
[A-3: Activation state of display device]
Here, the activation state of the display device 1 will be described. The display device 1 has three activation states of “on state”, “sleep state”, and “off state”, and takes one of these activation states. First, the “on state” is a power supply state in which power is supplied to each part of the display device 1, and the display device 1 performs a normal operation. In the “on state”, the CPU 10 performs various processes. Next, the “sleep state” is a state in which power is supplied to only a limited part of the display device 1 and a part of the display device 1 does not operate. In this “sleep state”, power is not supplied to the CPU 10 or the display unit 60, but power is supplied to other components (including the RAM 30). Therefore, it can be said that the “on state” is a first power supply state with high power consumption, and the “sleep state” is a second power supply state with low power consumption. The “off state” is a state when the power supply unit 80 is turned off. In this “off state”, power is not supplied to each part of the display device 1, so the display device 1 does not operate at all. The above-described transition from the “on state” to the “sleep state” is performed, for example, when the standby time during which the CPU 10 does not perform processing in the “on state” is a predetermined time or more. The transition from the “sleep state” to the “on state” is performed, for example, when the operation unit 50 is operated. As described above, the “on state” and the “sleep state” are “power supply states” that supply power to at least the RAM 30 among the respective units of the display device 1, whereas the “off state” supplies power to the RAM 30. It is a “no power supply state”.

[B:動作]
次に、表示装置1の動作について説明する。
[B−1:アクセス頻度集計処理]
図3は、メモリアクセス監視装置70が実行するアクセス頻度集計処理の流れを示すフローチャートである。この図3を参照して、RAM30に記憶されているデータを退避させる優先順位を決定するためのアクセス頻度集計処理について説明する。例えば表示装置1が「オン状態」の時に、利用者が操作部50を操作して、文書データによって表わされる文書を閲覧している場合を想定する。CPU10は、この操作に応じて、各々の処理に用いる処理データを生成したり又はフラッシュメモリ40から読み出したりしてRAM30に記憶し、これらの処理データを用いて、文書を表示する処理を実行する。このとき、CPU10は、タスクと呼ばれる単位で処理を実行する。
[B: Operation]
Next, the operation of the display device 1 will be described.
[B-1: Access frequency counting process]
FIG. 3 is a flowchart showing a flow of access frequency counting processing executed by the memory access monitoring device 70. With reference to FIG. 3, the access frequency totaling process for determining the priority order for saving the data stored in the RAM 30 will be described. For example, it is assumed that when the display device 1 is in the “on state”, the user operates the operation unit 50 to browse a document represented by document data. In response to this operation, the CPU 10 generates processing data used for each processing or reads it from the flash memory 40 and stores it in the RAM 30, and executes processing for displaying a document using these processing data. . At this time, the CPU 10 executes processing in units called tasks.

CPU10が例えば上記のような表示処理を実行したときに、フラッシュメモリ40から読み出されたデータ(ページデータの集合)が処理データとしてRAM30に記憶されるが、このとき、メモリアクセス監視装置70は、図2に示すようなフォーマットのアクセス管理テーブル71を生成して自身の揮発性メモリに記憶する。ただし、初期の状態では、各メモリアドレスに対応するアクセス頻度およびアクセス頻度総数には0が記述されている。   For example, when the CPU 10 executes display processing as described above, data (a set of page data) read from the flash memory 40 is stored in the RAM 30 as processing data. At this time, the memory access monitoring device 70 The access management table 71 having a format as shown in FIG. 2 is generated and stored in its own volatile memory. However, in the initial state, 0 is described in the access frequency and the total access frequency corresponding to each memory address.

メモリアクセス監視装置70は、これらのメモリアドレスが示すページを監視して、CPU10によるメモリアクセスが発生したか否かを判断する(ステップSa11)。ここで、メモリアクセスとは、CPU10がページを読み出したり、書き込んだりする両方の動作のことをいうが、特に書き込みがあったときに限定してメモリアクセスとしてもよい。ページの読み出しのみを行った場合には、当該ページの内容は変化せず、これを新たに退避する必要が生じないからである。メモリアクセスの発生がない間は(ステップSa11;NO)、メモリアクセス監視装置70は、ページの監視を続ける(ステップSa11)。一方、CPU10がいずれかのページにアクセスすると、メモリアクセス監視装置70は、メモリアクセスが発生したと判断して(ステップSa11;YES)、アクセスされたページに対応する退避済フラグを「0」にし(ステップSa12)、アクセス頻度を1増加させ(ステップSa13)、アクセス頻度総数を1増加させる(ステップSa14)。   The memory access monitoring device 70 monitors the pages indicated by these memory addresses, and determines whether or not a memory access has occurred by the CPU 10 (step Sa11). Here, “memory access” refers to both operations in which the CPU 10 reads and writes a page. However, the memory access may be limited to when the page is written. This is because when only reading a page, the content of the page does not change, and it is not necessary to newly save it. While there is no memory access (step Sa11; NO), the memory access monitoring device 70 continues to monitor the page (step Sa11). On the other hand, when the CPU 10 accesses any page, the memory access monitoring device 70 determines that a memory access has occurred (step Sa11; YES), and sets the saved flag corresponding to the accessed page to “0”. (Step Sa12) The access frequency is increased by 1 (Step Sa13), and the total access frequency is increased by 1 (Step Sa14).

次に、メモリアクセス監視装置70は、アクセス頻度総数と予め定められた閾値Lim1(例えば1000回)とを比較し、アクセス頻度総数が閾値Lim1以上であるか否かを判断する(ステップSa15)。アクセス頻度総数が閾値Lim1以上でない場合には(ステップSa15;NO)、メモリアクセス監視装置70は、ページの監視を続ける(ステップSa11)。これにより、アクセス頻度総数が閾値Lim1以上になるまでの間は、各ページのアクセス頻度が逐一集計されることになる。   Next, the memory access monitoring device 70 compares the total access frequency with a predetermined threshold Lim1 (for example, 1000 times), and determines whether the total access frequency is equal to or greater than the threshold Lim1 (step Sa15). If the total access frequency is not equal to or greater than the threshold value Lim1 (step Sa15; NO), the memory access monitoring device 70 continues to monitor the page (step Sa11). As a result, the access frequency of each page is tabulated one by one until the total access frequency reaches the threshold value Lim1 or more.

一方、アクセス頻度総数が閾値Lim1以上である場合には(ステップSa15;YES)、メモリアクセス監視装置70は、CPU10がアイドル状態か否かを判断する(ステップSa16)。アイドル状態とはCPU10がいずれのタスクも実行していない状態を言う。CPU10がアイドル状態ではないと判断すると(ステップSa16;NO)、メモリアクセス監視装置70は、アクセス頻度総数と予め定められた閾値Lim2(閾値Lim1より大きい数値であり、例えば2000回)とを比較し、アクセス頻度総数が閾値Lim2以上であるか否かを判断する(ステップSa17)。アクセス頻度総数が閾値Lim2以上でない場合には(ステップSa17;NO)、メモリアクセス監視装置70は、ページの監視を続ける(ステップSa11)。これにより、アクセス頻度総数が閾値Lim1以上になったとしても、CPU10によりタスクが実行されていれば、CPU10は、退避処理よりもそのタスクの処理を優先して、そのタスクの処理を継続することになる。ただし、これはアクセス頻度総数が閾値Lim2以上になるまでの間である。   On the other hand, if the total access frequency is greater than or equal to the threshold Lim1 (step Sa15; YES), the memory access monitoring device 70 determines whether the CPU 10 is in an idle state (step Sa16). The idle state is a state where the CPU 10 is not executing any task. If the CPU 10 determines that it is not in the idle state (step Sa16; NO), the memory access monitoring device 70 compares the total access frequency with a predetermined threshold value Lim2 (a numerical value greater than the threshold value Lim1, for example, 2000 times). Then, it is determined whether or not the total access frequency is greater than or equal to the threshold value Lim2 (step Sa17). If the total access frequency is not equal to or greater than the threshold value Lim2 (step Sa17; NO), the memory access monitoring device 70 continues to monitor the page (step Sa11). As a result, even if the total access frequency is equal to or higher than the threshold value Lim1, if the task is executed by the CPU 10, the CPU 10 prioritizes the processing of the task over the save processing and continues the processing of the task. become. However, this is until the total access frequency reaches the threshold value Lim2.

一方、CPU10がアイドル状態であると判断されたとき(ステップSa16;YES)、および、アクセス頻度総数が閾値Lim2以上であると判断されたとき(ステップSa17;YES)には、メモリアクセス監視装置70は、CPU10にデータ退避処理の開始を指示する(ステップSa18)。よって、アクセス頻度総数が閾値Lim2以上であって退避の必要性が増した状態にあっては、CPU10によってタスクが実行されていても、これを中断して、退避処理にCPU10の計算資源を割り当てることになる。   On the other hand, when it is determined that the CPU 10 is in the idle state (step Sa16; YES) and when the total access frequency is determined to be equal to or greater than the threshold Lim2 (step Sa17; YES), the memory access monitoring device 70 Instructs the CPU 10 to start the data saving process (step Sa18). Therefore, in a state where the total access frequency is equal to or greater than the threshold Lim2 and the necessity of saving increases, even if a task is being executed by the CPU 10, this is interrupted and the computing resources of the CPU 10 are allocated to the saving process. It will be.

[B−2:データ退避処理]
次に、CPU10によるデータ退避処理について、図4を参照しながら説明する。ここでいうデータの退避とは、RAM30に記憶されているデータをフラッシュメモリ40に記憶させることである。図4は、データ退避処理の流れを示すフローチャートである。CPU10は、メモリアクセス監視装置70からデータ退避処理を開始する旨の指示を受けると、アクセス管理テーブル71に基づいて、退避すべきページの順序を記述する退避キューを、RAM30に作成する(ステップSb11)。具体的には、CPU10は、アクセス管理テーブル71のうち退避済フラグが「0」のレコードについて、そのアクセス頻度を参照し、アクセス頻度の少ないレコードから順に、そのページIDをRAM30に記憶する。このRAM30上に記憶されたページIDの順列が退避キューである。
[B-2: Data saving process]
Next, data saving processing by the CPU 10 will be described with reference to FIG. The term “saving data” as used herein means that the data stored in the RAM 30 is stored in the flash memory 40. FIG. 4 is a flowchart showing the flow of the data saving process. When the CPU 10 receives an instruction to start the data saving process from the memory access monitoring device 70, the CPU 10 creates a save queue describing the order of pages to be saved in the RAM 30 based on the access management table 71 (step Sb11). ). Specifically, the CPU 10 refers to the access frequency of the record whose saved flag is “0” in the access management table 71 and stores the page ID in the RAM 30 in order from the record with the lowest access frequency. A permutation of page IDs stored on the RAM 30 is a save queue.

図5は、この退避キューの一例を示す図である。
図2において、ページA1、ページA2およびページA3の退避済フラグは「0」であるから、これらは全てCPU10による退避の対象として扱われる。そして、ページA1のアクセス頻度は15回、ページA2のアクセス頻度は0回、ページA3のアクセス頻度は12回であるから、これらのデータをアクセス頻度の少ない方から並べると、ページA2→ページA3→ページA1となる。したがって、CPU10は、図5に示すような順序の退避キューをRAM30に作成する。この退避キューにおけるページIDの順番が、そのページIDのページの退避順を意味している
FIG. 5 is a diagram illustrating an example of the save queue.
In FIG. 2, the saved flags for page A1, page A2, and page A3 are “0”, and therefore all of these are treated as objects to be saved by the CPU 10. Since the access frequency of the page A1 is 15, the access frequency of the page A2 is 0, and the access frequency of the page A3 is 12, the page A2 → the page A3 when these data are arranged from the one with the lower access frequency. → Page A1 Therefore, the CPU 10 creates an evacuation queue in the order as shown in FIG. The order of page IDs in this save queue means the save order of pages with that page ID.

次に、CPU10は、RAM30に作成された退避キューの先頭にあるページIDを読み出し、アクセス管理テーブル71を参照してメモリアドレスを特定して、そのページIDに対応するページをフラッシュメモリ40に退避させる(ステップSb12)。そしてCPU10は、退避したページのページIDを退避キューから削除し(ステップSb13)、アクセス管理テーブル71においてそのページIDに対応する退避済フラグを「1」にする(ステップSb14)。例えば、図5に示す退避キューの場合には、ステップSb12において、CPU10は、ページA2が記憶されているメモリアドレス「1A80」で示されるページをフラッシュメモリ40に退避する。退避が完了すると、CPU10は、ステップSb13において、退避キューからページID「ページA2」を削除し、ステップSb14において、アクセス管理テーブルのうちページID「ページA2」に対応する退避済フラグを「1」にする。   Next, the CPU 10 reads the page ID at the head of the save queue created in the RAM 30, identifies the memory address with reference to the access management table 71, and saves the page corresponding to the page ID in the flash memory 40. (Step Sb12). Then, the CPU 10 deletes the page ID of the saved page from the save queue (step Sb13), and sets the saved flag corresponding to the page ID in the access management table 71 to “1” (step Sb14). For example, in the save queue shown in FIG. 5, in step Sb12, the CPU 10 saves the page indicated by the memory address “1A80” in which the page A2 is stored in the flash memory 40. When the saving is completed, the CPU 10 deletes the page ID “page A2” from the saving queue in step Sb13, and sets the saved flag corresponding to the page ID “page A2” in the access management table to “1” in step Sb14. To.

次に、CPU10は、退避キューが空か否かを判断する(ステップSb15)。退避キューが空でない場合(ステップSb15;NO)には、CPU10は、割り込み処理が有るか否かを判断する(ステップSb16)。ここでいう割り込み処理とは、この退避処理とは別の処理ことであり、例えば利用者の何らかの操作に応じた処理などが含まれる。割り込み処理がない場合(ステップSb16;NO)には、CPU10は、上述した退避キューを参照して、データ退避処理を続ける(ステップSb12)。一方、退避キューが空である場合(ステップSb15;YES)、および割り込み処理がある場合(ステップSb16;YES)には、CPU10はデータ退避処理を中断し、処理待ち状態に移行するか、または割り込み処理の実行に移行する。
このような退避処理を行うことにより、CPU10は、RAM30に記憶されている処理データを、その処理データに含まれるページ単位ずつ、それぞれ異なる読み出しタイミングで読み出してフラッシュメモリ40に記憶させることができる。
Next, the CPU 10 determines whether or not the save queue is empty (step Sb15). If the save queue is not empty (step Sb15; NO), the CPU 10 determines whether or not there is an interrupt process (step Sb16). The interrupt process here is a process different from the save process, and includes, for example, a process according to some user operation. If there is no interrupt process (step Sb16; NO), the CPU 10 refers to the above-described save queue and continues the data save process (step Sb12). On the other hand, when the save queue is empty (step Sb15; YES), and when there is an interrupt process (step Sb16; YES), the CPU 10 interrupts the data save process and shifts to a processing wait state, or interrupts. Transition to execution of processing.
By performing such a saving process, the CPU 10 can read out the processing data stored in the RAM 30 for each page included in the processing data at different reading timings and store them in the flash memory 40.

[B−3:状態移行処理]
次に、CPU10による状態移行処理について、図6を参照しながら説明する。図6は、電源供給状態から電源非供給状態に移行する処理の流れを説明するためのフローチャートである。
CPU10は、所定の割り込み処理により、電源非供給状態への移行が指示されているか否かを判断する(ステップSc11)。ここで電源非供給状態へ移行する旨の指示には、様々な態様がある。例えば、CPU10が、利用者から操作部50を介して移行の指示を受けた場合や、所定の条件を自動的に検知したときに、CPU10自身が上記移行の指示を発生させる場合などである。後者の所定の条件としては、例えば、上述した退避処理が終了してから、所定時間以上CPU10がアイドル状態に置かれた場合などが挙げられる。上記の移行が指示されていないときは(ステップSc11;NO)、CPU10はこの判断を継続する(ステップSc11)。
[B-3: State transition processing]
Next, the state transition process by the CPU 10 will be described with reference to FIG. FIG. 6 is a flowchart for explaining the flow of processing for shifting from a power supply state to a power non-supply state.
The CPU 10 determines whether or not an instruction to shift to the power supply non-supply state is given by a predetermined interrupt process (step Sc11). Here, there are various modes for the instruction to shift to the power supply non-supply state. For example, when the CPU 10 receives a migration instruction from the user via the operation unit 50, or when the CPU 10 itself generates the above-described migration instruction when a predetermined condition is automatically detected. Examples of the latter predetermined condition include a case where the CPU 10 has been in an idle state for a predetermined time or more after the above-described saving process is completed. When the above transition is not instructed (step Sc11; NO), the CPU 10 continues this determination (step Sc11).

一方、上記の移行が指示されたときは(ステップSc11;YES)、CPU10は、アクセス管理テーブル71を参照して、RAM30上の全てのページが退避済であるか否かを判断する(ステップSc12)。アクセス管理テーブル71における退避済フラグのうち少なくともいずれか1つが「0」であれば、CPU10は、退避済でないページが1つ以上あると判断して(ステップSc12;NO)、図4に示した処理を実行する。一方、アクセス管理テーブル71における退避済フラグが全て「1」であれば、CPU10は、全てのページが退避済であると判断して(ステップSc12;YES)、メモリアクセス監視装置70に指示して、アクセス管理テーブル71をフラッシュメモリ40に退避させる(ステップSc13)。そして、CPU10はアクセス管理テーブル71のハッシュ値を計算し、これをフラッシュメモリ40に記憶する(ステップSc14)。これは、フラッシュメモリ40に記憶されたアクセス管理テーブル71の信頼性を、後述するデータ復元処理の際に確認するためである。以上の処理に続いてCPU10は、電源部80の電力供給を停止させ、電源非供給状態に移行する(ステップSc15)。   On the other hand, when the above migration is instructed (step Sc11; YES), the CPU 10 refers to the access management table 71 and determines whether all pages on the RAM 30 have been saved (step Sc12). ). If at least one of the saved flags in the access management table 71 is “0”, the CPU 10 determines that there is one or more pages that have not been saved (step Sc12; NO), as shown in FIG. Execute the process. On the other hand, if all the saved flags in the access management table 71 are “1”, the CPU 10 determines that all pages have been saved (step Sc12; YES), and instructs the memory access monitoring device 70. The access management table 71 is saved in the flash memory 40 (step Sc13). Then, the CPU 10 calculates a hash value of the access management table 71 and stores it in the flash memory 40 (step Sc14). This is for confirming the reliability of the access management table 71 stored in the flash memory 40 at the time of data restoration processing described later. Following the above processing, the CPU 10 stops the power supply of the power supply unit 80 and shifts to the power supply non-supply state (step Sc15).

ここで、状態移行指示の具体的な例を挙げて、上述した退避処理および状態移行処理の具体例を説明する。図7は、利用者から操作部50を介して移行の指示を受けた場合のタイムチャートである。図7の上段は割り込み処理を、中段は一般のタスクを、下段は退避処理をそれぞれ表している。
まず、CPU10は、或るタスクAを時刻t1から時刻t2までの間に実行する。この間に、メモリアクセス監視装置70は、CPU10のメモリアクセスが発生したか否かを判断し(図3のステップSa11)、上記タスクAにおいてメモリアクセスが発生するたびに(図3のステップSa11;YES)、アクセスされたページに対応する退避済フラグを「0」にし(図3のステップSa12)、アクセス頻度を1増加させ(図3のステップSa13)、さらにアクセス頻度総数を1増加させる(図3のステップSa14)。次に、メモリアクセス監視装置70は、アクセス頻度総数と予め定められた閾値Lim1とを比較し、アクセス頻度総数が閾値Lim1以上であるか否かを判断する(図3のステップSa15)。ここで、時刻t1から時刻t2までの間には、アクセス頻度総数はLim1(例えば1000回)以上になっていないものとする。よって、時刻t2では退避処理は開始されない。
Here, a specific example of the state transition instruction will be described, and a specific example of the above-described saving process and state transition process will be described. FIG. 7 is a time chart when a shift instruction is received from the user via the operation unit 50. The upper part of FIG. 7 represents an interrupt process, the middle part represents a general task, and the lower part represents a save process.
First, the CPU 10 executes a certain task A from time t1 to time t2. During this time, the memory access monitoring device 70 determines whether or not a memory access of the CPU 10 has occurred (step Sa11 in FIG. 3), and whenever a memory access occurs in the task A (step Sa11 in FIG. 3; YES) ), The saved flag corresponding to the accessed page is set to “0” (step Sa12 in FIG. 3), the access frequency is increased by 1 (step Sa13 in FIG. 3), and the total access frequency is further increased by 1 (FIG. 3). Step Sa14). Next, the memory access monitoring device 70 compares the total access frequency with a predetermined threshold value Lim1, and determines whether or not the total access frequency is equal to or greater than the threshold value Lim1 (step Sa15 in FIG. 3). Here, it is assumed that the total access frequency does not exceed Lim1 (for example, 1000 times) between time t1 and time t2. Therefore, the saving process is not started at time t2.

続いてCPU10は、別のタスクBを時刻t3から時刻t5までの間に実行する。上述と同様に、CPU10は、このタスクBが実行されている期間においてもメモリアクセスの発生を判断して、図3のステップSa12〜Sa14の処理を行う。ここで、時刻t3から時刻t5までの間の或る時刻t4において、アクセス頻度総数がLim1以上になったとする。メモリアクセス監視装置70は、時刻t4において、これを検知すると(図3のステップSa15;YES)、CPU10がアイドル状態か否かを判断する(図3のステップSa16)。CPU10は時刻t5になるまでタスクBを実行しており、アイドル状態ではないため、メモリアクセス監視装置70は、時刻t4から時刻t5までの間、CPU10がアイドル状態ではないと判断し(図3のステップSa16;NO)、アクセス頻度総数が閾値Lim2以上であるか否かを判断する(図3のステップSa17)。ここで、時刻t5までの間にアクセス頻度総数は閾値Lim2以上にならないとすると、メモリアクセス監視装置70は、CPU10がアイドル状態になる(図3のステップSa16;YES)時刻t5になった時点で、CPU10にデータ退避処理の開始を指示する(図3のステップSa18)。この退避処理は、退避キューが空になる時刻t6において完了する。   Subsequently, the CPU 10 executes another task B from time t3 to time t5. Similarly to the above, the CPU 10 determines the occurrence of memory access even during the period in which the task B is being executed, and performs the processes of steps Sa12 to Sa14 in FIG. Here, it is assumed that the total access frequency becomes equal to or higher than Lim1 at a certain time t4 between time t3 and time t5. When detecting this at time t4 (step Sa15 in FIG. 3; YES), the memory access monitoring device 70 determines whether the CPU 10 is in an idle state (step Sa16 in FIG. 3). Since CPU 10 is executing task B until time t5 and is not in an idle state, memory access monitoring device 70 determines that CPU 10 is not in an idle state from time t4 to time t5 (FIG. 3). Step Sa16; NO), it is determined whether or not the total access frequency is equal to or greater than the threshold value Lim2 (Step Sa17 in FIG. 3). Here, if the total access frequency does not become the threshold value Lim2 or more by the time t5, the memory access monitoring device 70 has the CPU 10 in the idle state (step Sa16 in FIG. 3; YES) at the time t5. Then, the CPU 10 is instructed to start the data saving process (step Sa18 in FIG. 3). This save process is completed at time t6 when the save queue becomes empty.

続いてCPU10は、さらに別のタスクCを時刻t7から時刻t10までの間に実行する。上述と同様に、CPU10は、このタスクCが実行されている期間においてもメモリアクセスの発生を判断して、図3のステップSa12〜Sa14の処理を行う。ここで、時刻t7から時刻t10までの間の或る時刻t8において、アクセス頻度総数がLim2以上になったとする。メモリアクセス監視装置70は、時刻t8において、これを検知すると(図3のステップSa17;YES)、CPU10がアイドル状態でないにも関わらず、すぐにタスクCを中断して、データ退避処理を開始するようCPU10に指示する(図3のステップSa18)。この指示に応じて、CPU10は、直ちにタスクCを中断し、退避処理に移行する。そしてCPU10は、時刻t8から時刻t9までの間に退避処理を完了すると、中断していたタスクCを再開する。そして、時刻t10においてタスクCが終了すると、CPU10は、時刻t9から時刻t10までの間にタスクCにおいて発生したメモリアクセスに対する退避処理を開始し、これを時刻t11に完了する。   Subsequently, the CPU 10 executes another task C from time t7 to time t10. Similarly to the above, the CPU 10 determines the occurrence of memory access even during the period in which the task C is being executed, and performs the processes of steps Sa12 to Sa14 in FIG. Here, it is assumed that the total access frequency becomes Lim2 or more at a certain time t8 between time t7 and time t10. When detecting this at time t8 (step Sa17 in FIG. 3; YES), the memory access monitoring device 70 immediately suspends the task C and starts the data saving process even though the CPU 10 is not in the idle state. The CPU 10 is instructed (step Sa18 in FIG. 3). In response to this instruction, the CPU 10 immediately suspends the task C and proceeds to the saving process. When the CPU 10 completes the save process between time t8 and time t9, it resumes the suspended task C. When task C ends at time t10, CPU 10 starts saving processing for the memory access generated in task C between time t9 and time t10, and completes this at time t11.

そして、時刻t12において、利用者が操作部50を介して、電力供給状態から電力非供給状態への移行を指示したとする。CPU10は、電力供給状態から電源非供給状態への移行が指示されているか否かを判断しているから(図6のステップSc11)、時刻t12に上記指示を受けると(図6のステップSc11;YES)、アクセス管理テーブル71を参照して、全てのページが退避済であるか否かを判断する(図6のステップSc12)。この場合には、全ての退避処理は時刻t11において終了しており、時刻t12までの間にメモリアクセスを発生させるタスクは行われていない。よって、CPU10は、アクセス管理テーブル71をフラッシュメモリ40に退避させる(図6のステップSc13)。そしてCPU10は、アクセス管理テーブル71のハッシュ値を計算し、これをフラッシュメモリ40に記憶する(図6のステップSc14)。最後にCPU10は、電源部80の電力供給を停止させ、電源非供給状態に移行する(図6のステップSc15)。   Then, it is assumed that at time t <b> 12, the user instructs to shift from the power supply state to the power non-supply state via the operation unit 50. Since the CPU 10 determines whether or not an instruction to shift from the power supply state to the power supply non-supply state is given (step Sc11 in FIG. 6), when the instruction is received at time t12 (step Sc11 in FIG. 6; YES), referring to the access management table 71, it is determined whether or not all pages have been saved (step Sc12 in FIG. 6). In this case, all the saving processes are completed at time t11, and no task for generating memory access is performed until time t12. Therefore, the CPU 10 saves the access management table 71 in the flash memory 40 (step Sc13 in FIG. 6). Then, the CPU 10 calculates a hash value of the access management table 71 and stores it in the flash memory 40 (step Sc14 in FIG. 6). Finally, the CPU 10 stops the power supply of the power supply unit 80 and shifts to a power supply non-supply state (step Sc15 in FIG. 6).

このように、CPU10は、RAM30に記憶されている処理データを一部分ずつ時間的に分散して退避させているので、電力非供給状態に移行するときまでには、RAM30に記憶されている処理データの少なくとも一部を退避済みにしておくことができる。よって、電力非供給状態に移行するときに退避させるデータの量をより少なくすることができ、状態移行に要する時間を短縮することが可能となる。
なお、電力供給状態から電力非供給状態に移行する指示があるまでに、RAM30に記憶されているデータを全てフラッシュメモリ40に退避することができなかった場合には、CPU10は、その指示があった後に、まだ退避していないデータをRAM30から読み出してフラッシュメモリ40に退避させればよい。
Thus, since the CPU 10 evacuates and saves the processing data stored in the RAM 30 in portions, the processing data stored in the RAM 30 is shifted to the power non-supply state. It is possible to keep at least a part of the evacuated. Therefore, the amount of data to be saved when shifting to the power non-supply state can be reduced, and the time required for the state transition can be shortened.
If all the data stored in the RAM 30 cannot be saved in the flash memory 40 before the instruction to shift from the power supply state to the power non-supply state is received, the CPU 10 receives the instruction. After that, data that has not yet been saved may be read from the RAM 30 and saved in the flash memory 40.

次に、図8は、電力非供給状態への移行の別の例を示すタイムチャートである。CPU10は、時刻t14から時刻t15の間に或るタスクDを実行する。上述したタスクBやタスクCの場合と同様に、タスクDが終了する時刻t15から、CPU10は退避処理を開始し、時刻t16に、その退避処理を完了する。そして、CPU10は、この時刻t16の時点からの経過時間を計測し、これが所定時間Δt(例えば1分など)以上になったことを検知すると、アクセス管理テーブル71の退避処理(図6のステップSc12,ステップSc13,およびステップSc14)を行う。そして、上述と同様に最後にCPU10は、電源部80の電力供給を停止させ、電力非供給状態に移行する(ステップSc15)。
このように、CPU10は、電力非供給状態に移行するときまでには、RAM30に記憶されている処理データを退避済みにしておくことで、電力非供給状態に移行するときに退避させるデータの量をより少なくすることができる。よって、状態移行に要する時間を短縮することが可能となる。
Next, FIG. 8 is a time chart showing another example of the transition to the power non-supply state. The CPU 10 executes a certain task D between time t14 and time t15. As in the case of task B and task C described above, the CPU 10 starts the save process from time t15 when the task D ends, and completes the save process at time t16. Then, the CPU 10 measures the elapsed time from the time t16, and when detecting that the time has exceeded a predetermined time Δt (for example, 1 minute), the CPU 10 saves the access management table 71 (step Sc12 in FIG. 6). , Step Sc13, and Step Sc14). Then, similarly to the above, the CPU 10 finally stops the power supply of the power supply unit 80 and shifts to the power non-supply state (step Sc15).
As described above, the CPU 10 saves the processing data stored in the RAM 30 by the time it shifts to the power non-supply state, so that the amount of data to be saved when it shifts to the power non-supply state. Can be reduced. Therefore, it is possible to shorten the time required for state transition.

[B−4:データ復元処理]
続いて、図9を参照して、表示装置1の起動状態が「オフ状態」から「オン状態」に復帰させられたときに、フラッシュメモリ40に退避させていたデータを復元させるデータ復元処理について説明する。ここでいう起動状態の復帰とは、表示装置1の起動状態が、「電力供給状態」から「電力非供給状態」に移行させられた後に、「電力非供給状態」から再び「電力供給状態」に移行させられることをいう。また、データの復元とは、前述のとおり、RAM30からフラッシュメモリ40に退避させていたデータを再びRAM30に記憶させることである。
[B-4: Data restoration processing]
Subsequently, referring to FIG. 9, a data restoration process for restoring the data saved in the flash memory 40 when the activation state of the display device 1 is returned from the “off state” to the “on state”. explain. The restoration of the activated state here means that after the activated state of the display device 1 is shifted from the “power supply state” to the “power non-supply state”, the “power supply state” again from the “power non-supply state”. It means to be transferred to. The data restoration is to store the data saved in the flash memory 40 from the RAM 30 again in the RAM 30 as described above.

利用者によって操作部50の電源ボタンがオンにされると(ステップSd11)、CPU10は、ROM20に記憶されている制御プログラムを実行して、表示装置1を起動させる(ステップSd12)。これにより、表示装置1の起動状態が「オフ状態」から「オン状態」に移行させられる。表示装置1が「オン状態」になると、利用者は、操作部50を操作して、所望するプログラムを指定し、それを実行するよう指示する。   When the power button of the operation unit 50 is turned on by the user (step Sd11), the CPU 10 executes the control program stored in the ROM 20 and activates the display device 1 (step Sd12). As a result, the activation state of the display device 1 is shifted from the “off state” to the “on state”. When the display device 1 is in the “on state”, the user operates the operation unit 50 to specify a desired program and instruct to execute it.

CPU10は、フラッシュメモリ40に記憶されたアクセス管理テーブル71を読み出してメモリアクセス監視装置70の揮発性メモリに記憶させる(ステップSd13)。これをアクセス管理テーブル71の復元という。そして、CPU10は、復元したアクセス管理テーブル71からハッシュ値を計算し(ステップSd14)、フラッシュメモリ40に記憶されているハッシュ値と比較する(ステップSd15)。このハッシュ値が等しくない場合(ステップSd15;NO)には、CPU10は、利用者に注意を促す警告処理を行う(ステップSd16)。このような場合には、図6で説明したデータ退避処理のうち、ステップSc13からステップSc14までの間に何らかの障害が発生し、正しくアクセス管理テーブル71が退避されなかった可能性があるからである。   The CPU 10 reads the access management table 71 stored in the flash memory 40 and stores it in the volatile memory of the memory access monitoring device 70 (step Sd13). This is called restoration of the access management table 71. Then, the CPU 10 calculates a hash value from the restored access management table 71 (step Sd14) and compares it with the hash value stored in the flash memory 40 (step Sd15). If the hash values are not equal (step Sd15; NO), the CPU 10 performs a warning process to alert the user (step Sd16). In such a case, there is a possibility that some failure has occurred between step Sc13 and step Sc14 in the data saving process described in FIG. 6, and the access management table 71 may not have been saved correctly. .

一方、この比較したハッシュ値同士が等しい場合(ステップSd15;YES)には、CPU10は復元したアクセス管理テーブル71の復元済フラグを全て「0」にする(ステップSd17)。図10は、復元したアクセス管理テーブル71の一例を示す図である。アクセス管理テーブル71は、図に示すように「データB3」、「データB4」、および「データB5」を記憶したページについて、それぞれ退避済フラグ、復元済フラグ、メモリアドレス及びアクセス頻度を記憶している。なお、このデータ復元処理においては、復元済フラグ、メモリアドレスおよびページID以外のデータは利用しない。以下、この図10に示したアクセス管理テーブル71がメモリアクセス監視装置70に復元されていることを想定して、説明を続ける。   On the other hand, if the compared hash values are equal (step Sd15; YES), the CPU 10 sets all the restored flags of the restored access management table 71 to “0” (step Sd17). FIG. 10 is a diagram illustrating an example of the restored access management table 71. As shown in the figure, the access management table 71 stores a saved flag, a restored flag, a memory address, and an access frequency for each page storing “data B3”, “data B4”, and “data B5”. Yes. In this data restoration process, data other than the restored flag, memory address, and page ID are not used. Hereinafter, the description will be continued on the assumption that the access management table 71 shown in FIG.

図9の説明に戻る。利用者が操作部50を介して、処理を指示すると、CPU10は指示された処理のタスクを開始する(ステップSd18)。タスクが開始されると、メモリアクセス監視装置70は、CPU10のメモリアクセスが発生したか否かを判断する(ステップSd19)。CPU10のメモリアクセスが発生していないうちは(ステップSd19;NO)、メモリアクセス監視装置70は、この判断を継続する(ステップSd19)。   Returning to the description of FIG. When the user instructs processing via the operation unit 50, the CPU 10 starts a task of the instructed processing (step Sd18). When the task is started, the memory access monitoring device 70 determines whether or not a memory access of the CPU 10 has occurred (step Sd19). While the memory access of the CPU 10 has not occurred (step Sd19; NO), the memory access monitoring device 70 continues this determination (step Sd19).

一方、CPU10のメモリアクセスが発生すると、メモリアクセス監視装置70は、アクセス管理テーブルにおいて、アクセスが発生したページに対応する復元済フラグが「0」であるか否かを判断する(ステップSd20)。ここで、上記の復元済フラグが「0」でない、すなわち「1」である場合(ステップSd20;NO)には、アクセスが発生したページは既に復元されているため、メモリアクセス監視装置70は、CPU10によるメモリアクセス発生の監視を継続する(ステップSd19)。   On the other hand, when the memory access of the CPU 10 occurs, the memory access monitoring device 70 determines whether or not the restored flag corresponding to the accessed page is “0” in the access management table (step Sd20). Here, when the restored flag is not “0”, that is, “1” (step Sd20; NO), the page in which the access has occurred is already restored. Monitoring of the occurrence of memory access by the CPU 10 is continued (step Sd19).

一方、上記の復元済フラグが「0」である場合(ステップSd20;YES)には、メモリアクセス監視装置70は、ページフォールト信号を発生する(ステップSd21)。この信号を受けてCPU10は、アクセス管理テーブル71を参照して、アクセスが発生したページのメモリアドレスを特定し、当該ページをフラッシュメモリ40からRAM30へ復元する(ステップSd22)。そして、メモリアクセス監視装置70は、アクセス管理テーブル71の対応する復元済フラグを「1」に書き換え(ステップSd23)、後述する復元キューに、上記のアクセスが発生したページの周辺に記憶されているページのページIDを追加する(ステップSd24)。   On the other hand, if the restored flag is “0” (step Sd20; YES), the memory access monitoring device 70 generates a page fault signal (step Sd21). In response to this signal, the CPU 10 refers to the access management table 71, identifies the memory address of the page where the access has occurred, and restores the page from the flash memory 40 to the RAM 30 (step Sd22). Then, the memory access monitoring device 70 rewrites the corresponding restored flag in the access management table 71 to “1” (step Sd23), and is stored in the restoration queue, which will be described later, around the page where the access has occurred. The page ID of the page is added (step Sd24).

例えば、CPU10がタスクを実行することにより、図10に示すページB4に対して、メモリアクセスが発生したことを想定する。すると、CPU10は、ページB4に対応する復元済フラグが「0」であるか否かを判断する(ステップSd20)。ページB4に対応する復元済フラグは「0」であるから(ステップSd20;YES)、メモリアクセス監視装置70は、ページフォールト信号を発生する(ステップSd21)。そしてCPU10は、ページB4が記憶されたページをフラッシュメモリ40から読み出し、ページB4に対応するRAM30のメモリアドレス「2A80」に復元する(ステップSd22)。   For example, it is assumed that a memory access has occurred for the page B4 shown in FIG. 10 when the CPU 10 executes a task. Then, the CPU 10 determines whether or not the restored flag corresponding to the page B4 is “0” (step Sd20). Since the restored flag corresponding to page B4 is “0” (step Sd20; YES), the memory access monitoring device 70 generates a page fault signal (step Sd21). Then, the CPU 10 reads the page in which the page B4 is stored from the flash memory 40 and restores the page to the memory address “2A80” of the RAM 30 corresponding to the page B4 (step Sd22).

そして、メモリアクセス監視装置70は、ページB4に対応する復元済フラグを「1」に書き換え(ステップSd23)、さらに、そのページB4のメモリアドレスの前後のメモリアドレスに記憶されているページである「ページB3」と「ページB5」のページIDを、RAM30上の所定の位置に記憶した復元キューに追加する(ステップSd24)。図11は、このようにして作成された復元キューを示す図である。復元キューは、図中左側ほど復元の優先順位の高い。優先順位が高いページは、優先順位が低いページよりも先に復元される。したがって、図11に示す復元キューにおいては、「ページB3」の方が「ページB5」よりも先に復元されることになる。
ページフォールト信号が発生した瞬間にRAM30上に必要なページは「ページB4」のみであるが、「ページB4」が要求されたことから、「ページB3」および「ページB5」もこの後、要求される可能性が高い。なぜなら、ユーザが利用するデータの位置は特定の箇所に集中する傾向があるからである。このようにすれば、「ページB3」または「ページB5」を要求するページフォールト信号を発生させることなく、先回りしてこれらのページを復元させておくことができるので、表示装置1は、迅速な復帰を行うことができる。なお、「ページB3」と「ページB5」のどちらを優先的に復元されるべきかについては、任意に定めることができるが、例えばアクセス管理テーブル71のそれぞれのアクセス頻度に基づいて定めてもよい。この場合、図10に示すように、「ページB3」のアクセス頻度は「12」であり、「ページB5」のアクセス頻度は「3」であるから、「ページB3」の方が「ページB5」よりもアクセス頻度が多い。CPU10は、これを判断して、「ページB3」の優先順位が「ページB5」よりも高くなるように復元キューを作成すればよい。退避前までにアクセスが頻繁に行われたページは、復帰後にも頻繁にアクセスされる可能性が高く、優先して復元すべきだからである。
Then, the memory access monitoring device 70 rewrites the restored flag corresponding to the page B4 to “1” (step Sd23), and is the page stored in the memory addresses before and after the memory address of the page B4. The page IDs of “page B3” and “page B5” are added to the restoration queue stored at a predetermined position on the RAM 30 (step Sd24). FIG. 11 is a diagram showing the restoration queue created in this way. The restoration queue has a higher restoration priority in the left side of the figure. A page with a high priority is restored before a page with a low priority. Therefore, in the restoration queue shown in FIG. 11, “page B3” is restored before “page B5”.
The only page required on the RAM 30 at the moment when the page fault signal is generated is “page B4”. However, since “page B4” is requested, “page B3” and “page B5” are also requested thereafter. There is a high possibility. This is because the position of data used by the user tends to concentrate on a specific location. In this way, these pages can be restored in advance without generating a page fault signal for requesting “page B3” or “page B5”. A return can be made. Note that which of “page B3” and “page B5” should be preferentially restored can be arbitrarily determined, but may be determined based on the access frequency of the access management table 71, for example. . In this case, as shown in FIG. 10, the access frequency of “page B3” is “12”, and the access frequency of “page B5” is “3”, so that “page B3” is “page B5”. More frequently accessed. The CPU 10 may determine this and create a restoration queue so that the priority of “page B3” is higher than that of “page B5”. This is because a page that has been frequently accessed before evacuation is likely to be frequently accessed even after restoration, and should be restored preferentially.

ここで、図12は、CPU10がデータ復元処理を実行するときの処理の手順を示したフローチャートである。この図12を参照して、CPU10が所定の周期で、一般の処理に割り込んで実行するデータ復元処理について説明する。
CPU10は、アイドル期間中に所定の周期で、図11に示したような復元キューに基づいてデータ復元処理を実行する。具体的には、CPU10は、復元キューの先頭のデータIDが示すデータを復元し(ステップSe11)、そのデータIDを復元キューから削除する(ステップSe12)。この場合、先頭は「ページB3」であるから、RAM30のメモリアドレス「2A00」には「ページB3」が記憶されたページが、フラッシュメモリ40から復元される。次にCPU10は、アクセス管理テーブルの「ページB3」に対応する復元済フラグを「1」にする(ステップSe13)。そして、CPU10はRAM30の所定の領域に作成された復元キューが空であるか否かを判断する(ステップSe14)。復元キューが空でない場合(ステップSe14;NO)には、CPU10は、割り込み処理が存在するか否かを判断する(ステップSe15)。そして、割り込み処理が存在しない場合(ステップSe15;NO)には、データ復元処理を繰り返す(ステップSe11)。一方、復元キューが空である場合(ステップSe14;YES)、および割り込み処理が存在する場合(ステップSe15;YES)には、CPU10は、このデータ復元処理を終了する。
Here, FIG. 12 is a flowchart showing a processing procedure when the CPU 10 executes the data restoration processing. With reference to this FIG. 12, the data restoration process which CPU10 interrupts and performs a general process with a predetermined period is demonstrated.
The CPU 10 executes data restoration processing based on the restoration queue as shown in FIG. 11 at a predetermined cycle during the idle period. Specifically, the CPU 10 restores the data indicated by the top data ID of the restoration queue (step Se11), and deletes the data ID from the restoration queue (step Se12). In this case, since the top is “page B3”, the page in which “page B3” is stored in the memory address “2A00” of the RAM 30 is restored from the flash memory 40. Next, the CPU 10 sets the restored flag corresponding to “page B3” in the access management table to “1” (step Se13). Then, the CPU 10 determines whether or not the restoration queue created in the predetermined area of the RAM 30 is empty (step Se14). If the restoration queue is not empty (step Se14; NO), the CPU 10 determines whether or not interrupt processing exists (step Se15). If no interrupt process exists (step Se15; NO), the data restoration process is repeated (step Se11). On the other hand, when the restoration queue is empty (step Se14; YES) and when there is an interrupt process (step Se15; YES), the CPU 10 ends this data restoration process.

以上説明したように、実施形態の表示装置1は、電力非供給状態に移行する前に一部の退避処理が既に行われているため、電力非供給状態に移行するときの退避処理による負荷を低減し、電力非供給状態に移行するのに要する時間を短縮することができる。
また、ページに対するアクセス頻度(部分データの利用回数)から、退避の優先順位を決定することができるため、より効率的な退避処理を行うことができる。そして、アクセス頻度総数から、退避処理以外のタスクと退避処理とのいずれを優先すべきかを決定することができる。
また、電力供給状態に移行する際に、復元したデータに基づいて、次に復元が必要となるデータを類推し、これを優先的に復元させるので、データ復元処理を効率的に分散化することができる。
As described above, the display device 1 according to the embodiment has already performed a part of the evacuation process before shifting to the power non-supply state, so the load caused by the evacuation process when shifting to the power non-supply state is reduced. It is possible to reduce the time required for shifting to the non-power supply state.
Further, since the priority of saving can be determined from the access frequency to the page (the number of times partial data is used), more efficient saving processing can be performed. Then, it is possible to determine which of the tasks other than the save process and the save process should be prioritized from the total access frequency.
In addition, when shifting to the power supply state, the data that needs to be restored next is inferred based on the restored data, and this is preferentially restored, so that the data restoration process can be efficiently distributed. Can do.

[C:変形例]
以上が実施形態の説明であるが、この実施形態の内容は以下のように変形し得る。また、以下の変形例を適宜組み合わせてもよい。
(変形例1)
上述した実施形態では、CPU10とメモリアクセス監視装置70とは別のプロセッサであり、メモリアクセスの監視は、CPU10とは別体のハードウェアにより実現されていた。このメモリアクセスの監視は、CPU10において行ってもよい。すなわち、CPU10に読み込むプログラムに上述したメモリアクセスの監視の手続を記述し、CPU10がこれを実行すればよい。
[C: Modification]
The above is the description of the embodiment, but the contents of this embodiment can be modified as follows. Further, the following modifications may be combined as appropriate.
(Modification 1)
In the embodiment described above, the CPU 10 and the memory access monitoring device 70 are separate processors, and the memory access monitoring is realized by hardware separate from the CPU 10. This memory access monitoring may be performed by the CPU 10. That is, the above-described memory access monitoring procedure may be described in a program read into the CPU 10 and executed by the CPU 10.

(変形例2)
上述した実施形態では、RAM30に記憶されている処理データを、ページと呼ばれる単位で区分して退避及び復元を行っていた。このようにRAM30とフラッシュメモリ40との間で遣り取りされる処理データの単位は、ページと呼ばれるものに限らず、CPU10の1つのタスクで取り扱われるデータ単位であってもよいし、それよりも小さな単位、例えば処理を実現する処理プログラムのプロセス単位や関数単位であってもよい。要するに、処理データを複数に区分した部分データであればよい。
(Modification 2)
In the above-described embodiment, the processing data stored in the RAM 30 is divided and saved in units called pages. Thus, the unit of processing data exchanged between the RAM 30 and the flash memory 40 is not limited to what is called a page, and may be a data unit handled by one task of the CPU 10 or smaller. It may be a unit, for example, a process unit or a function unit of a processing program for realizing processing. In short, any partial data may be used as long as the processing data is divided into a plurality of pieces.

(変形例3)
上述した実施形態では、アクセス管理テーブル71に記憶されたアクセス頻度総数が、閾値Lim1以上にならない限り退避処理は行われなかったが、このような閾値は設けなくてもよい。すなわち、CPU10はタスクが完了するたびに、退避処理を開始してもよい。
(Modification 3)
In the embodiment described above, the saving process is not performed unless the total access frequency stored in the access management table 71 is equal to or greater than the threshold value Lim1, but such a threshold value may not be provided. That is, the CPU 10 may start the save process every time the task is completed.

(変形例4)
上述した実施形態では、ハッシュ値を計算して、退避前のアクセス管理テーブル71と復元後のアクセス管理テーブル71が一致するか否かを確認したが、この確認には、ハッシュ値を計算する以外の方法(パリティビットやチェックサム等)を用いてもよい。また、この確認を行わなくてもよい。
(Modification 4)
In the above-described embodiment, the hash value is calculated and it is confirmed whether or not the access management table 71 before saving matches the access management table 71 after restoration. For this confirmation, the hash value is not calculated. The above method (parity bit, checksum, etc.) may be used. Further, this confirmation need not be performed.

(変形例5)
上述した実施形態では、ページフォールト信号に伴って、これを発生させたページを復元する際に、そのページの前後のメモリアドレスに記憶された1つずつのページを関連ページとして、復元キューに追加した。しかし、関連ページとして復元キューに追加するページの数はこれに限られない。例えば、2つずつ、3つずつなどでもよい。また、当該ページフォールト信号を発生させたときにCPU10が実行しているタスクに応じて、この関連ページの数を決定してもよい。この場合には、予め、タスク毎に関連ページとして復元キューに追加するページの数が定められており、この数が記述されたテーブルをフラッシュメモリ40から読み出して、当該数を決定すればよい。
(Modification 5)
In the above-described embodiment, when the page that generated this is restored in accordance with the page fault signal, one page stored in the memory address before and after the page is added to the restoration queue as a related page. did. However, the number of pages added to the restoration queue as related pages is not limited to this. For example, two, three, etc. may be used. Further, the number of related pages may be determined in accordance with the task executed by the CPU 10 when the page fault signal is generated. In this case, the number of pages to be added to the restoration queue as related pages for each task is determined in advance, and a table describing this number may be read from the flash memory 40 to determine the number.

図13は、この変形例におけるタスクごとの関連ページ数を記述したテーブルの一例を示す図である。図に示すように、ROM20から読み込まれるOSには、予めタスクごとに関連ページ数(つまり関連データのデータサイズ)が定められたテーブルが含まれており、このOSがRAM30に読み込まれることにより、このテーブルはRAM30上に記憶される。ここで「前方」とは、ページのメモリアドレスが小さい方向を意味し、「後方」とはページのメモリアドレスが大きい方向を意味する。したがって、例えば、タスクAの場合は、当該ページよりメモリアドレスが小さい方向の1ページと大きい方向の4ページが関連ページである。CPU10は、ページフォールト信号が発生したときには、このテーブルにおいて、ページフォールト信号の発生時に要求されたタスクに対応する関連ページ数を参照し、その関連ページ数に基づいて上述の復元キューに追加すべき関連ページを特定すればよい。
また、図13はタスク毎に関連ページ数を定義した例であったが、これらのタスクの手順の集合とも言えるプログラム毎に関連ページ数を定義してもよい。この場合、CPU10は、ページフォールト信号が発生したときには、このテーブルにおいて、ページフォールト信号の発生時に実行されているプログラムに対応する関連ページ数を参照し、その関連ページ数に基づいて上述の復元キューに追加すべき関連ページを特定する。
タスク毎であってもプログラム毎であっても、いずれにせよ関連データのデータサイズはCPUが実行する処理毎に定められていればよい。
FIG. 13 is a diagram showing an example of a table describing the number of related pages for each task in this modification. As shown in the figure, the OS read from the ROM 20 includes a table in which the number of related pages (that is, the data size of related data) is previously determined for each task, and when this OS is read into the RAM 30, This table is stored on the RAM 30. Here, “front” means the direction in which the memory address of the page is smaller, and “rear” means the direction in which the memory address of the page is larger. Therefore, for example, in the case of task A, one page with a smaller memory address than that page and four pages with a larger direction are related pages. When the page fault signal is generated, the CPU 10 refers to the number of related pages corresponding to the task requested when the page fault signal is generated in this table, and should be added to the above restoration queue based on the number of related pages. What is necessary is just to specify a related page.
FIG. 13 shows an example in which the number of related pages is defined for each task. However, the number of related pages may be defined for each program that can be said to be a set of procedures of these tasks. In this case, when the page fault signal is generated, the CPU 10 refers to the number of related pages corresponding to the program being executed when the page fault signal is generated in this table, and based on the number of related pages, the restoration queue described above. Identify related pages that should be added to.
Regardless of the task or the program, the data size of the related data only needs to be determined for each process executed by the CPU.

また、実施形態では、ページを1単位としていたため、その関連ページは、そのページの前後のページであった。要するに、復元したデータに関連したデータであれば、復元したデータの後にアクセスがなされる可能性が高いから、CPU10は、復元したデータに何らかのルールに従って関連すると思われる関連データの復元順を復元キューに記憶すればよい。   In the embodiment, since the page is a unit, the related page is the page before and after the page. In short, since data related to the restored data is likely to be accessed after the restored data, the CPU 10 sets the restoration order of the related data that seems to be related to the restored data according to some rule. You can memorize it.

(変形例6)
上述した実施形態では、電力供給を受けてデータを記憶した状態を維持する第1の記憶手段としてRAM30を例示し、電力供給を受けずにデータを記憶した状態を維持する第2の記憶手段としてフラッシュメモリ40を例示していたが、これら記憶手段の具体例は、実施形態の例示に限定されることはない。
(Modification 6)
In the above-described embodiment, the RAM 30 is exemplified as the first storage unit that maintains the state where the data is stored by receiving the power supply, and the second storage unit maintains the state where the data is stored without receiving the power supply. Although the flash memory 40 has been illustrated, specific examples of these storage means are not limited to the illustration of the embodiment.

(変形例7)
上述の実施形態では、表示装置1に備えられた不揮発性メモリは、フラッシュメモリ40のみの1種類だけであったが、表示装置1は2種類以上の不揮発性メモリを備えていてもよい。また、この2種類以上の不揮発性メモリにおいて、記憶内容の読み書きの速度に差がある場合には、RAM30上の処理データの退避先を異ならせてもよい。例えばアクセス管理テーブル71に記憶されたページのうち、アクセス頻度が少ないページは、読み書きの速度の遅い不揮発性メモリに記憶し、アクセス頻度が多いページは読み書きの速度の速い不揮発性メモリに記憶してもよい。このようにすると、頻繁にアクセスするページは、より読み書きの速度の速い不揮発性メモリに記憶されるので、退避処理および復元処理を迅速に行うことができる。なお、このアクセス頻度が多いか少ないかの判断には、予め閾値を定めておいてもよいし、集計したアクセス頻度の平均値等(相加平均、相乗平均、最頻値)と比較してもよい。
(Modification 7)
In the above-described embodiment, the display device 1 has only one type of nonvolatile memory, the flash memory 40, but the display device 1 may include two or more types of nonvolatile memory. Further, in these two or more types of nonvolatile memories, when there is a difference in the reading / writing speed of the stored contents, the save destination of the processing data on the RAM 30 may be different. For example, out of the pages stored in the access management table 71, pages with low access frequency are stored in a nonvolatile memory with low read / write speed, and pages with high access frequency are stored in non-volatile memory with high read / write speed. Also good. In this way, frequently accessed pages are stored in the non-volatile memory having a faster read / write speed, so that save processing and restoration processing can be performed quickly. In order to determine whether the access frequency is high or low, a threshold value may be set in advance, or compared with the average value of the access frequency (arithmetic average, geometric average, mode value), etc. Also good.

(変形例8)
上述の実施形態では、アクセス管理テーブル71の全てのフィールドを退避させていたが、メモリアドレスとページIDのみを退避させてもよい。退避済フラグは退避時にのみ用いており、復元済フラグは復元時に初期化し、アクセス頻度およびアクセス頻度総数は復元時には用いないからである。
(Modification 8)
In the above embodiment, all the fields of the access management table 71 are saved, but only the memory address and the page ID may be saved. This is because the saved flag is used only at the time of saving, the restored flag is initialized at the time of restoration, and the access frequency and the total access frequency are not used at the time of restoration.

(変形例9)
実施形態では、CPU10がアイドル時になったときに退避処理を開始していたが、その開始タイミングは、アイドル時になったタイミングには限定されない。要するに、CPU10のアイドル時である期間に退避処理を行えばよく、その退避開始のタイミングは、アイドル時になったタイミングから遅れてもよい。
(Modification 9)
In the embodiment, the save process is started when the CPU 10 is idle, but the start timing is not limited to the timing when the CPU 10 is idle. In short, the save process may be performed during a period when the CPU 10 is idle, and the timing of the save start may be delayed from the timing when the CPU 10 is idle.

(変形例10)
また、上述した表示装置1のCPU10が実行するプログラムは、磁気テープ、磁気ディスク、フレキシブルディスク、光記録媒体、光磁気記録媒体、CD(Compact Disk)、DVD(Digital Versatile Disk)、RAMなどの記録媒体に記録した状態で提供し得る。また、インターネットなどのネットワーク経由で表示装置1にダウンロードさせることも可能である。即ち、本発明をプログラムとして実現することもできる。
(Modification 10)
The program executed by the CPU 10 of the display device 1 described above is a recording such as a magnetic tape, a magnetic disk, a flexible disk, an optical recording medium, a magneto-optical recording medium, a CD (Compact Disk), a DVD (Digital Versatile Disk), and a RAM. It can be provided as recorded on the medium. Moreover, it is also possible to make the display device 1 download via a network such as the Internet. That is, the present invention can be realized as a program.

本実施形態に係る表示装置の構成を示す図である。It is a figure which shows the structure of the display apparatus which concerns on this embodiment. アクセス管理テーブルの一例を示した図である。It is the figure which showed an example of the access management table. アクセス頻度集計処理の流れを示すフローチャートである。It is a flowchart which shows the flow of an access frequency total process. データ退避処理の流れを示すフローチャートである。It is a flowchart which shows the flow of a data saving process. 退避キューの一例を示す図である。It is a figure which shows an example of an evacuation queue. 電源供給状態から電源非供給状態に移行する処理の流れを説明するためのフローチャートである。It is a flowchart for demonstrating the flow of the process which transfers to a power supply non-supply state from a power supply state. 利用者から操作部を介して移行の指示を受けた場合のタイムチャートである。It is a time chart when the instruction | indication of transfer is received from the user via the operation part. 電源非供給状態への移行の別の例を示すタイムチャートである。It is a time chart which shows another example of transfer to a power supply non-supply state. 表示装置の復帰時に、フラッシュメモリに退避させていたデータを復元させるデータ復元処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the data restoration process which restores the data evacuated to the flash memory when the display device is restored. 復元したアクセス管理テーブルの一例を示す図である。It is a figure which shows an example of the restored access management table. 復元キューを示す図である。It is a figure which shows a decompression | restoration queue. CPUが所定の周期で一般の処理に割り込んで実行するデータ復元処理の流れを示すフローチャートである。It is a flowchart which shows the flow of the data restoration process which CPU interrupts and performs a general process with a predetermined period. 変形例におけるタスクごとの関連ページ数を記述したテーブルの一例を示す図である。It is a figure which shows an example of the table which described the related page number for every task in a modification.

符号の説明Explanation of symbols

1…表示装置、10…CPU、20…ROM、30…RAM、40…フラッシュメモリ、50…操作部、60…表示部、70…メモリアクセス監視装置、71…アクセス管理テーブル、80…電源部、90…バス DESCRIPTION OF SYMBOLS 1 ... Display apparatus, 10 ... CPU, 20 ... ROM, 30 ... RAM, 40 ... Flash memory, 50 ... Operation part, 60 ... Display part, 70 ... Memory access monitoring apparatus, 71 ... Access management table, 80 ... Power supply part, 90 ... Bus

Claims (13)

電力供給を受けて、データを記憶した状態を維持する第1の記憶手段と、
電力供給を受けずに、データを記憶した状態を維持する第2の記憶手段と、
前記第1の記憶手段に電力を供給する電力供給状態、又は、前記第1の記憶手段に電力を供給しない電力非供給状態のいずれかに移行させる状態移行手段と、
前記電力供給状態において、前記第1の記憶手段に記憶されているデータを用いて処理を実行する処理実行手段と、
前記電力供給状態から前記電力非供給状態に移行する指示があるまでに、前記第1の記憶手段に記憶されているデータを一部分ずつ、それぞれ異なる時期に読み出して前記第2の記憶手段に記憶させる退避処理を行う退避手段とを備え、
前記状態移行手段は、前記第1の記憶手段に記憶されているデータに対して前記退避手段による前記退避処理が行われてから、前記電力供給状態から前記電力非供給状態に移行させる
ことを特徴とするデータ管理装置。
First storage means for receiving a power supply and maintaining a state of storing data;
Second storage means for maintaining a state of storing data without receiving power supply;
State transition means for shifting to either a power supply state for supplying power to the first storage means or a power non-supply state for not supplying power to the first storage means;
Processing execution means for executing processing using data stored in the first storage means in the power supply state;
Until there is an instruction to shift from the power supply state to the power non-supply state, the data stored in the first storage unit is read out in portions at different times and stored in the second storage unit. Evacuation means for performing evacuation processing,
The state transition unit shifts the data stored in the first storage unit from the power supply state to the power non-supply state after the save process by the save unit is performed. Data management device.
前記退避手段は、前記処理実行手段による実行の単位となる処理が完了するたびに前記退避処理を開始する
ことを特徴とする請求項1記載のデータ管理装置。
The data management apparatus according to claim 1, wherein the save unit starts the save process every time processing that is a unit of execution by the process execution unit is completed.
前記退避手段は、前記処理実行手段により処理が実行されていない期間に当該退避処理を行う
ことを特徴とする請求項2に記載のデータ管理装置。
The data management apparatus according to claim 2, wherein the save unit performs the save process during a period when the process is not executed by the process execution unit.
前記処理実行手段は、実行の単位となる処理を開始してから完了するまでに、当該処理の実行を一時中断し、
前記退避手段は、前記処理実行手段が前記処理の実行を一時中断している期間に、前記退避処理を行う
ことを特徴とする請求項1記載のデータ管理装置。
The process execution means temporarily suspends execution of the process from the start of the process as a unit of execution until completion.
The data management apparatus according to claim 1, wherein the save unit performs the save process during a period in which the process execution unit temporarily suspends execution of the process.
前記処理実行手段は、プログラムに記述された手順に従って処理を実行するCPUであり、
前記処理実行手段による実行の単位となる処理は、前記プログラムに記述された手順に従ってCPUが実行する処理の単位となるタスクである
ことを特徴とする請求項2〜4のいずれか1項に記載のデータ管理装置。
The process execution means is a CPU that executes a process according to a procedure described in a program,
5. The process as a unit of execution by the process execution unit is a task as a unit of a process executed by the CPU according to a procedure described in the program. 6. Data management device.
前記データが複数の部分データに区分されている場合に、前記処理実行手段が前記第1の記憶手段に記憶された前記部分データを用いた回数を、当該部分データ毎に記憶する回数記憶手段を備え、
前記退避手段は、前記回数記憶手段によって記憶されている回数が少ない部分データに対して、当該回数が多い部分データよりも先に前記退避処理を行う
ことを特徴とする請求項1に記載のデータ管理装置。
When the data is divided into a plurality of partial data, a number of times storage means for storing the number of times the processing execution means uses the partial data stored in the first storage means for each partial data Prepared,
2. The data according to claim 1, wherein the saving unit performs the saving process on partial data stored in the frequency storage unit before the partial data having a high number of times. Management device.
前記退避手段は、前記回数記憶手段によって記憶されている前記回数の合計が第1の閾値以上である場合に、前記退避処理を行う
ことを特徴とする請求項6に記載のデータ管理装置。
The data management apparatus according to claim 6, wherein the save unit performs the save process when the total number of times stored by the number storage unit is equal to or greater than a first threshold value.
前記退避手段は、前記回数記憶手段によって記憶されている前記回数の合計が第1の閾値以上である場合には、前記処理実行手段により処理が実行されていない期間において前記退避処理を行い、前記回数記憶手段によって記憶されている前記回数の合計が、前記第1の閾値よりも大きい第2の閾値以上である場合には、前記処理実行手段により処理が実行されている期間においても前記退避処理を行う
ことを特徴とする請求項6に記載のデータ管理装置。
The saving unit performs the saving process in a period in which the process is not executed by the process execution unit when the total number of times stored by the number storage unit is equal to or greater than a first threshold, When the total number of times stored by the number storage unit is equal to or greater than a second threshold value that is greater than the first threshold value, the save processing is performed even during a period in which the process is being executed by the process execution unit. The data management device according to claim 6, wherein:
前記退避手段は、前記電力供給状態から前記電力非供給状態に移行する指示があるまでに、前記第1の記憶手段に記憶されているデータを全て退避することができなかった場合には、当該指示があった後に、退避していないデータを前記第1の記憶手段から読み出して前記第2の記憶手段に記憶させる
ことを特徴とする請求項1に記載のデータ管理装置。
If the save means cannot save all the data stored in the first storage means until there is an instruction to shift from the power supply state to the power non-supply state, The data management apparatus according to claim 1, wherein after being instructed, unsaved data is read from the first storage unit and stored in the second storage unit.
前記電力供給状態において、前記処理実行手段が実行する処理に用いるデータが前記第1の記憶手段に記憶されていない場合に、前記第2の記憶手段に記憶されている当該データを読み出し、前記第1の記憶手段に記憶させる復元処理を行うとともに、前記第2の記憶手段において、当該データに関連した関連データの復元順を記憶する第1の復元手段と、
前記処理実行手段により処理が実行されていない期間において、前記第1の復元手段が記憶した復元順に基づいて、前記第2の記憶手段に記憶されている前記関連データを読み出し、前記第1の記憶手段に記憶させる第2の復元手段と
を備えることを特徴とする請求項1に記載のデータ管理装置。
In the power supply state, when the data used for the process executed by the process execution unit is not stored in the first storage unit, the data stored in the second storage unit is read, and the second storage unit Performing a restoration process to be stored in one storage unit, and storing a restoration order of related data related to the data in the second storage unit;
Based on the restoration order stored by the first restoration unit, the related data stored in the second storage unit is read out during the period when the process is not performed by the process execution unit, and the first storage The data management apparatus according to claim 1, further comprising: a second restoration unit that is stored in the unit.
前記関連データのデータサイズは、前記処理実行手段が実行する処理毎に定められている
ことを特徴とする請求項10に記載のデータ管理装置。
The data management apparatus according to claim 10, wherein the data size of the related data is determined for each process executed by the process execution unit.
請求項1ないし11のいずれか1項に記載のデータ管理装置と、
前記処理実行手段によって処理された結果を出力する出力手段と
を具備することを特徴とする情報処理装置。
A data management device according to any one of claims 1 to 11,
An information processing apparatus comprising: output means for outputting a result processed by the process execution means.
電力供給を受けてデータを記憶した状態を維持する第1の記憶手段と、電力供給を受けずにデータを記憶した状態を維持する第2の記憶手段とを備えたコンピュータを、
前記第1の記憶手段に電力を供給する電力供給状態、又は、前記第1の記憶手段に電力を供給しない電力非供給状態のいずれかに移行させる状態移行手段と、
前記電力供給状態において、前記第1の記憶手段に記憶されているデータを用いて処理を実行する処理実行手段と、
前記電力供給状態において、前記第1の記憶手段に記憶されているデータを一部分ずつ、それぞれ異なる時期に読み出して前記第2の記憶手段に記憶させる退避処理を行う退避手段として機能させ、
さらに前記状態移行手段は、前記第1の記憶手段に記憶されているデータに対して前記退避手段による前記退避処理が行われてから、前記電力供給状態から前記電力非供給状態に移行させるプログラム。
A computer comprising first storage means for maintaining a state in which data is stored upon receiving power supply, and second storage means for maintaining a state in which data is stored without receiving power supply,
State transition means for shifting to either a power supply state for supplying power to the first storage means or a power non-supply state for not supplying power to the first storage means;
Processing execution means for executing processing using data stored in the first storage means in the power supply state;
In the power supply state, the data stored in the first storage unit is functioned as a saving unit that performs a saving process of reading data in portions at different times and storing them in the second storage unit,
Furthermore, the state transition unit is a program for shifting from the power supply state to the power non-supply state after the save process by the save unit is performed on the data stored in the first storage unit.
JP2007300920A 2007-11-20 2007-11-20 Data management device, information processor, and program Pending JP2009129026A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007300920A JP2009129026A (en) 2007-11-20 2007-11-20 Data management device, information processor, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007300920A JP2009129026A (en) 2007-11-20 2007-11-20 Data management device, information processor, and program

Publications (1)

Publication Number Publication Date
JP2009129026A true JP2009129026A (en) 2009-06-11

Family

ID=40819914

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007300920A Pending JP2009129026A (en) 2007-11-20 2007-11-20 Data management device, information processor, and program

Country Status (1)

Country Link
JP (1) JP2009129026A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010124076A (en) * 2008-11-17 2010-06-03 Ricoh Co Ltd Image processor, control method for image processor, and program of the same
JP2012058840A (en) * 2010-09-06 2012-03-22 Fujitsu Ltd Saving processing equipment, saving processing method and saving processing program
JPWO2013088782A1 (en) * 2011-12-13 2015-04-27 株式会社ソニー・コンピュータエンタテインメント Information processing apparatus, information processing method, program, and information storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010124076A (en) * 2008-11-17 2010-06-03 Ricoh Co Ltd Image processor, control method for image processor, and program of the same
JP2012058840A (en) * 2010-09-06 2012-03-22 Fujitsu Ltd Saving processing equipment, saving processing method and saving processing program
JPWO2013088782A1 (en) * 2011-12-13 2015-04-27 株式会社ソニー・コンピュータエンタテインメント Information processing apparatus, information processing method, program, and information storage medium
US9513841B2 (en) 2011-12-13 2016-12-06 Sony Corporation Information processing device, information processing method, program, and information storage medium for managing and reproducing program execution condition data

Similar Documents

Publication Publication Date Title
CN109739563B (en) Terminal control method, device, system and storage medium
JP4175838B2 (en) Information processing apparatus with standby mode, standby mode start method and standby mode cancel method
JP4515093B2 (en) CPU power-down method and apparatus therefor
TWI436199B (en) Method and controller for power management
TWI298436B (en) An operation method in an apparatus, an electronic system therefor, and a computer readable medium therefor
US20070150760A1 (en) Reducing the amount of memory contents saved to non-volatile storage
US6438708B1 (en) Information processing apparatus that can hold internal information
JPH077317B2 (en) System restart device
US20070283187A1 (en) Bios for saving and restoring operational state in the absence of ac power
JP2007219581A (en) Memory controller, and electronic equipment mounted therewith
JPH10207588A (en) Information processor
JP2009129026A (en) Data management device, information processor, and program
JP5622429B2 (en) Microcomputer
JP3525070B2 (en) Access control device and access method
JP2004078772A (en) Microcomputer device processing method during standby, and microcomputer device
JP2006350930A (en) Control circuit and information processor
JP4334312B2 (en) Start-up time reduction computing device and data loading method
JP2006127407A (en) Semiconductor integrated circuit
JP2009093270A (en) Computer system and startup method therefor
JPH0876876A (en) Clock supply control circuit of microprocessor
JP2000056984A (en) Micro computer with built-in memory and resetting method for micro computer
JP5823000B2 (en) Microcomputer
JPS6381537A (en) Computer system
JP5194360B2 (en) Information processing apparatus and control method thereof
JP2002149262A (en) Program executing method