JP2019160080A - Controller and abnormality detection method - Google Patents
Controller and abnormality detection method Download PDFInfo
- Publication number
- JP2019160080A JP2019160080A JP2018048517A JP2018048517A JP2019160080A JP 2019160080 A JP2019160080 A JP 2019160080A JP 2018048517 A JP2018048517 A JP 2018048517A JP 2018048517 A JP2018048517 A JP 2018048517A JP 2019160080 A JP2019160080 A JP 2019160080A
- Authority
- JP
- Japan
- Prior art keywords
- data
- value
- volatile memory
- data area
- transferred
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 230000005856 abnormality Effects 0.000 title claims abstract description 54
- 238000001514 detection method Methods 0.000 title claims abstract description 36
- 238000000034 method Methods 0.000 claims description 15
- 230000004913 activation Effects 0.000 claims description 11
- 230000008569 process Effects 0.000 claims description 10
- 230000001186 cumulative effect Effects 0.000 claims description 8
- 230000004044 response Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 abstract description 13
- 238000013500 data storage Methods 0.000 description 16
- 230000005540 biological transmission Effects 0.000 description 7
- 230000002159 abnormal effect Effects 0.000 description 4
- 230000000717 retained effect Effects 0.000 description 4
- 230000006399 behavior Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000007423 decrease Effects 0.000 description 1
- 238000003745 diagnosis Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000011084 recovery Methods 0.000 description 1
Images
Landscapes
- Retry When Errors Occur (AREA)
Abstract
【課題】停止異常を検出すること。【解決手段】実施形態に係る記憶装置は、転送部と、更新部と、検出部とを備える。転送部は、起動時に不揮発性メモリから揮発性メモリへ読み出しデータを転送し、正常停止時に揮発性メモリから不揮発性メモリへ書き込みデータを転送する。更新部は、転送部によって読み出しデータが転送される場合に、不揮発性メモリ内の所定のデータ領域の値を更新し、書き込みデータが転送される場合に、不揮発性メモリ内の他のデータ領域の値を更新する。検出部は、所定のデータ領域の値と他のデータ領域の値とを比較することで、前回の停止時における揮発性メモリの停止異常を検出する。【選択図】図1PROBLEM TO BE SOLVED: To detect a stop abnormality. A storage device according to an embodiment includes a transfer unit, an update unit, and a detection unit. The transfer unit transfers read data from the non-volatile memory to the volatile memory at startup, and transfers write data from the volatile memory to the non-volatile memory at normal stop. The update unit updates the value of a predetermined data area in the non-volatile memory when the read data is transferred by the transfer unit, and when the write data is transferred, the update unit of another data area in the non-volatile memory. Update the value. The detection unit detects a stop abnormality of the volatile memory at the time of the previous stop by comparing the value of the predetermined data area with the value of another data area. [Selection diagram] Fig. 1
Description
本発明は、制御装置および異常検出方法に関する。 The present invention relates to a control device and an abnormality detection method.
従来、不揮発性メモリは書き込み回数に制限があるため、不揮発性メモリから揮発性メモリにデータを一旦転送し、揮発性メモリ上でデータの更新を行う制御装置がある(例えば、特許文献1参照)。 Conventionally, since a nonvolatile memory has a limited number of times of writing, there is a control device that once transfers data from the nonvolatile memory to the volatile memory and updates the data on the volatile memory (see, for example, Patent Document 1). .
かかる制御装置では、電源が正常に遮断される場合、揮発性メモリから不揮発性メモリにデータを転送することで、不揮発性メモリに遮断直前の最新のデータを格納させる。 In such a control device, when the power is normally shut off, the latest data immediately before the shut-off is stored in the non-volatile memory by transferring data from the volatile memory to the non-volatile memory.
しかしながら、従来技術では、電源瞬断等の停止異常を検出することができなかった。かかる停止異常では、前回正常に停止したときのデータを不揮発性メモリから揮発性メモリに転送するおそれがあり、停止異常前のデータを引き継ぐことができない。 However, in the prior art, a stop abnormality such as an instantaneous power failure cannot be detected. In such a stop abnormality, there is a risk of transferring data from the non-volatile memory to the volatile memory when it was normally stopped last time, and the data before the stop abnormality cannot be taken over.
本発明は、上記に鑑みてなされたものであって、停止異常を検出することができる制御装置および異常検出方法を提供することを目的とする。 The present invention has been made in view of the above, and an object thereof is to provide a control device and an abnormality detection method capable of detecting a stop abnormality.
上述した課題を解決し、目的を達成するために、実施形態に係る制御装置は、転送部と、更新部と、検出部とを備える。前記転送部は、起動時に不揮発性メモリから揮発性メモリへ読み出しデータを転送し、正常停止時に前記揮発性メモリから前記不揮発性メモリへ書き込みデータを転送する。前記更新部は、前記転送部によって前記読み出しデータが転送される場合に、前記不揮発性メモリ内の所定のデータ領域の値を更新し、前記書き込みデータが転送される場合に、前記不揮発性メモリ内の他のデータ領域の値を更新する。前記検出部は、前記起動時に前記所定のデータ領域の値と前記他のデータ領域の値とを比較することで、前回の停止時における前記揮発性メモリの停止異常を検出する。 In order to solve the above-described problems and achieve the object, the control device according to the embodiment includes a transfer unit, an update unit, and a detection unit. The transfer unit transfers read data from the nonvolatile memory to the volatile memory at startup, and transfers write data from the volatile memory to the nonvolatile memory at a normal stop. The update unit updates a value of a predetermined data area in the nonvolatile memory when the read data is transferred by the transfer unit, and updates the value in the nonvolatile memory when the write data is transferred. Update values in other data areas. The detection unit detects a stop abnormality of the volatile memory at the previous stop by comparing the value of the predetermined data area with the value of the other data area at the time of starting.
本発明によれば、停止異常を検出することができる。 According to the present invention, a stop abnormality can be detected.
以下、添付図面を参照して、実施形態に係る制御装置および異常検出方法について説明する。なお、以下に示す実施形態によりこの発明が限定されるものではない。 Hereinafter, a control device and an abnormality detection method according to embodiments will be described with reference to the accompanying drawings. In addition, this invention is not limited by embodiment shown below.
まず、図1を用いて実施形態に係る異常検出方法の概要について説明する。図1は、異常検出方法の概要を示す図である。本実施形態に係る異常検出方法は、後述する制御装置によって実行される。また、以下では、制御装置が車両の制御に用いられる各種データを記憶する場合について説明する。 First, an outline of the abnormality detection method according to the embodiment will be described with reference to FIG. FIG. 1 is a diagram showing an outline of an abnormality detection method. The abnormality detection method according to the present embodiment is executed by a control device described later. Moreover, below, the case where a control apparatus memorize | stores the various data used for control of a vehicle is demonstrated.
図1に示すように、実施形態に係る異常検出方法は、起動時(例えば、IG−ON)に書き換え可能な不揮発性メモリM1から揮発性メモリM2へ読み出しデータを転送する。そして、実施形態に係る異常検出方法は、正常停止時(例えば、IG−OFF)に揮発性メモリM2から不揮発性メモリM1へ書き込みデータを転送する。 As shown in FIG. 1, the abnormality detection method according to the embodiment transfers read data from a rewritable nonvolatile memory M1 to a volatile memory M2 at the time of activation (for example, IG-ON). In the abnormality detection method according to the embodiment, write data is transferred from the volatile memory M2 to the nonvolatile memory M1 during a normal stop (for example, IG-OFF).
これは、不揮発性メモリM1には、書き込み回数に上限があり、揮発性メモリM2よりも読み出し・書き込み処理に時間がかかるためである。すなわち、実施形態に係る制御装置1(図2参照)は、起動時に不揮発性メモリM1から揮発性メモリM2にデータを一旦転送し、揮発性メモリM2内で読み出し・書き込みを行う。 This is because the nonvolatile memory M1 has an upper limit in the number of times of writing, and the read / write processing takes longer than the volatile memory M2. That is, the control device 1 (see FIG. 2) according to the embodiment temporarily transfers data from the nonvolatile memory M1 to the volatile memory M2 at the time of activation, and performs reading / writing in the volatile memory M2.
そして、実施形態に係る制御装置1は、正常停止時に揮発性メモリM2に格納されたデータを不揮発性メモリM1へ転送する。このように、実施形態に係る制御装置1は、不揮発性メモリM1の書き込み・読み出し回数を最小限にとどめることで、不揮発性メモリM1の書き込み回数を削減しつつ、読み出し・書き込み処理の高速化を図ることができる。
And the
しかしながら、例えば、電源瞬断等の停止異常が発生した場合、揮発性メモリM2に格納されたデータを不揮発性メモリM1へ格納することができない場合がある。 However, for example, when a stop abnormality such as a momentary power interruption occurs, data stored in the volatile memory M2 may not be stored in the nonvolatile memory M1.
具体的には、実施形態に係る制御装置1は、IGスイッチに連動してバッテリから電源が供給され、IGスイッチOFFを検出すると、揮発性メモリM2に格納されたデータを不揮発性メモリM1へ格納する処理を行った後、電源を遮断する。例えば、バッテリ電圧が低下した場合、制御装置1に対する電源の供給が遮断され、電源瞬断が発生する。
Specifically, the
かかる電源瞬断の時間が所定時間以上続くと、揮発性メモリM2の書き込みデータを不揮発性メモリM1へ転送することなく、制御装置1が再起動する場合がある。
If the power interruption continues for a predetermined time or longer, the
かかる場合に、電源の回復に伴い制御装置1が、再起動すると、不揮発性メモリM1から揮発性メモリM2へ読み出しデータを転送するが、この読み出しデータは前回の起動時に読み出されたデータであって、瞬断直前に揮発性メモリM2に格納されていたデータと異なっている。
In such a case, when the
したがって、再起動前の揮発性メモリM2に格納されていた最新のデータと異なるデータが揮発性メモリM2に書き込まれる。つまり、停止異常時において、揮発性メモリM2は停止異常前のデータを引き継ぐことができない場合がある。 Therefore, data different from the latest data stored in the volatile memory M2 before the restart is written in the volatile memory M2. That is, in the case of a stop abnormality, the volatile memory M2 may not be able to take over the data before the stop abnormality.
そこで、実施形態に係る異常検出方法では、電源瞬断等の停止異常を検出することとした。つまり、実施形態に係る異常検出方法では、読み出しデータの転送時および書き込みデータの転送時で異なるデータ領域の値を更新し、かかる値を比較することで停止異常を検出することとした。 Therefore, in the abnormality detection method according to the embodiment, a stop abnormality such as an instantaneous power interruption is detected. In other words, in the abnormality detection method according to the embodiment, the value of the different data area is updated when the read data is transferred and the write data is transferred, and the stop abnormality is detected by comparing the values.
具体的には、図1に示すように、実施形態に係る異常検出方法では、起動時において不揮発性メモリM1内のデータ領域Ra1の値とデータ領域Ranの値とを比較する(ステップS11)。 Specifically, as shown in FIG. 1, in the abnormality detection method according to the embodiment, the value of the data area Ra1 in the nonvolatile memory M1 and the value of the data area Ran are compared at the time of activation (step S11).
後述するように、例えば、データ領域Ra1の値は、起動時に更新される値であり、データ領域Ranの値は、正常終了時に更新される値である。 As will be described later, for example, the value of the data area Ra1 is a value that is updated at startup, and the value of the data area Ran is a value that is updated at the normal end.
図1に示す例では、データ領域Ra1の値とデータ領域Ranの値とが共に「A」である場合について示している。例えば、実施形態に係る異常検出方法では、データ領域Ra1の値とデータ領域Ranの値とが一致する場合に、前回の停止が正常停止であることを識別することができる。 In the example illustrated in FIG. 1, the value of the data area Ra1 and the value of the data area Ran are both “A”. For example, in the abnormality detection method according to the embodiment, when the value of the data area Ra1 matches the value of the data area Ran, it can be identified that the previous stop is a normal stop.
続いて、実施形態に係る異常検出方法では、前回の停止が正常停止であった場合に、データ領域Ra1の値を更新する(ステップS12)。同図に示す例では、データ領域Ra1の値を「A→A+1」へ更新する場合について示している。 Subsequently, in the abnormality detection method according to the embodiment, when the previous stop is a normal stop, the value of the data area Ra1 is updated (step S12). In the example shown in the figure, the value of the data area Ra1 is updated from “A → A + 1”.
そして、実施形態に係る異常検出方法では、不揮発性メモリM1のデータ領域Ranに格納されたデータを揮発性メモリM2へ転送する(ステップS13)。 In the abnormality detection method according to the embodiment, the data stored in the data area Ran of the nonvolatile memory M1 is transferred to the volatile memory M2 (step S13).
その後、実施形態に係る異常検出方法では、揮発性メモリM2内でデータの読み出し・書き込みを行う。そして、実施形態に係る異常検出方法では、IGスイッチOFFを検出すると、終了動作へ移行する。 Thereafter, in the abnormality detection method according to the embodiment, data is read / written in the volatile memory M2. And in the abnormality detection method which concerns on embodiment, if IG switch OFF is detected, it will transfer to completion | finish operation | movement.
具体的には、実施形態に係る異常検出方法では、揮発性メモリM2に格納されたデータを不揮発性メモリM1のデータ領域Ranへ転送する(ステップS21)。実施形態に係る異常検出方法では、かかる転送が正常に完了した場合に、データ領域Ranの値を更新する(ステップS22)。 Specifically, in the abnormality detection method according to the embodiment, the data stored in the volatile memory M2 is transferred to the data area Ran of the nonvolatile memory M1 (step S21). In the abnormality detection method according to the embodiment, when the transfer is completed normally, the value of the data area Ran is updated (step S22).
同図に示す例では、データ領域Ranを「A→A+1」へ更新し、更新後のデータ領域Ranの値とデータ領域Ra1の値とが一致する場合について示している。 In the example shown in the figure, the data area Ran is updated from “A → A + 1”, and the updated value of the data area Ran matches the value of the data area Ra1.
一方、上述のように、異常終了時においては、揮発性メモリM2から不揮発性メモリM1へデータが転送されず、データ領域Ranの値は更新されない。 On the other hand, as described above, at the time of abnormal termination, data is not transferred from the volatile memory M2 to the nonvolatile memory M1, and the value of the data area Ran is not updated.
このため、次回の起動時においてデータ領域Ra1の値とデータ領域Ranの値とを比較すると、データ領域Ra1の値はA+1であり、データ領域Ranの値はAとなっており、両者は異なる値となる。 Therefore, when the value of the data area Ra1 and the value of the data area Ran are compared at the next start-up, the value of the data area Ra1 is A + 1, the value of the data area Ran is A, and both are different values. It becomes.
したがって、実施形態に係る異常検出方法では、データ領域Ra1の値とデータ領域Ranとの値を比較することで、停止異常を検出することが可能となる。 Therefore, in the abnormality detection method according to the embodiment, it is possible to detect a stop abnormality by comparing the value of the data area Ra1 and the value of the data area Ran.
なお、ここでは、起動時にデータ領域Ra1の値を更新し、正常終了時にデータ領域Ranの値を更新する場合について説明したが、これに限定されず、起動時にデータ領域Ranの値を更新し、正常終了時にデータ領域Ra1の値を更新することにしてもよい。 Here, a case has been described in which the value of the data area Ra1 is updated at startup and the value of the data area Ran is updated at the normal end. However, the present invention is not limited to this, and the value of the data area Ran is updated at startup. The value of the data area Ra1 may be updated at the normal end.
次に、図2を用いて実施形態に係る制御装置1の構成例について説明する。図2は、制御装置1のブロック図である。図2に示すように、制御装置1は、メモリ制御部2と、アプリ制御部3と、不揮発性メモリM1と、揮発性メモリM2とを備える。
Next, a configuration example of the
アプリ制御部3は、例えば、車両全体を制御する機能を備え、メモリ制御部2を介して揮発性メモリM2から各種制御に必要なデータを読み出す。また、アプリ制御部3は、各種制御の制御結果を揮発性メモリM2に書き込むことでかかる制御結果を揮発性メモリM2に記憶させる。
The
メモリ制御部2は、判定部21、転送部22と、更新部23と、検出部24とを備える。メモリ制御部2およびアプリ制御部3は、例えば、CPU(Central Processing Unit)、ROM(Read Only Memory)、RAM(Random Access Memory)、データフラッシュ、入出力ポートなどを有するコンピュータや各種の回路を含む。
The
コンピュータのCPUは、例えば、ROMに記憶されたプログラムを読み出して実行することによって、メモリ制御部2の判定部21、転送部22、更新部23、検出部24およびアプリ制御部3として機能する。
The CPU of the computer functions as the
また、メモリ制御部2の判定部21、転送部22、更新部23、検出部24およびアプリ制御部3の少なくともいずれか一つまたは全部をASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)等のハードウェアで構成することもできる。なお、制御装置1は、有線や無線のネットワークで接続された他のコンピュータや可搬型記録媒体を介して上記したプログラムや各種情報を取得することとしてもよい。
In addition, at least one or all of the
メモリ制御部2の判定部21は、起動時に揮発性メモリM2に記憶されたデータの総容量に基づき、データの破損の有無を判定し、判定結果に基づいて転送部22に対してデータの転送を指示する。
The
具体的には、まず、判定部21は、起動している期間に、揮発性メモリM2内に記憶されているデータのビット数の合計値(以下、SUM値という)を計算し、揮発性メモリM2内の所定領域に書き込む。
Specifically, first, the
その後、電源のオフ期間を介して、再度、起動したタイミングで、判定部21は、SUM値を計算し、かかるSUM値と所定領域に書き込んだSUM値とを比較する。
After that, at the time of activation again through the power-off period, the
このとき、電源のオフ期間が所定期間よりも長ければ、揮発性メモリM2に記憶されたデータは消失するので、揮発性メモリM2に書き込んだSUM値も消失する。 At this time, if the power-off period is longer than the predetermined period, the data stored in the volatile memory M2 is lost, so the SUM value written in the volatile memory M2 is also lost.
一方、電源のオフ期間が所定期間よりも短ければ、揮発性メモリM2に記憶されたデータは保持される。このため、再度算出したSUM値と揮発性メモリM2に書き込んだSUM値とが一致していれば、揮発性メモリM2に記憶されたデータは破損していないことを意味する。 On the other hand, if the power-off period is shorter than the predetermined period, the data stored in the volatile memory M2 is retained. For this reason, if the SUM value calculated again matches the SUM value written in the volatile memory M2, it means that the data stored in the volatile memory M2 is not damaged.
すなわち、かかる場合に、揮発性メモリM2に記憶されたデータは、前回停止直前のデータがそのまま保持されていることになる。このため、かかる場合に、判定部21は、転送部22に対して不揮発性メモリM1から揮発性メモリM2へのデータの転送を指示しない。
That is, in such a case, the data stored in the volatile memory M2 is retained as it is immediately before the previous stop. For this reason, in such a case, the
一方、再度算出したSUM値が揮発性メモリM2に書き込んだSUM値よりも小さい値である場合や、かかるSUM値が「0」である場合、一部または全てのデータが消失したことを意味する。かかる場合に、判定部21は、転送部22に対して不揮発性メモリM1から揮発性メモリM2へのデータの転送を指示する。
On the other hand, when the SUM value calculated again is smaller than the SUM value written in the volatile memory M2, or when the SUM value is “0”, it means that some or all of the data has been lost. . In such a case, the
つまり、判定部21は、揮発性メモリM2内に記憶されたデータの少なくとも一部が消失している場合のみ、転送部22に対して不揮発性メモリM1から揮発性メモリM2へのデータの転送を指示する。
That is, the
これにより、上述のように停止異常が発生した場合であっても、瞬断発生前の揮発性メモリM2の内容が保持されている限り不揮発性メモリM1から揮発性メモリM2へ転送を行わないので、瞬断発生前に揮発性メモリM2に記憶されたデータが上書きされることを抑制することが可能となる。 As a result, even if a stop abnormality occurs as described above, as long as the contents of the volatile memory M2 before the occurrence of the instantaneous interruption are retained, the transfer from the nonvolatile memory M1 to the volatile memory M2 is not performed. It becomes possible to prevent the data stored in the volatile memory M2 from being overwritten before the occurrence of the instantaneous interruption.
なお、判定部21は、例えば、揮発性メモリM2に記憶されたデータに対応付けられたパリティービットに基づいてデータの破損の有無を検出することにしてもよい。
Note that the
転送部22は、起動時に不揮発性メモリM1から揮発性メモリM2へ読み出しデータを転送し、揮発性メモリM2の正常停止時に揮発性メモリM2から不揮発性メモリM1へ書き込みデータを転送する。
The
転送部22は、例えば、車両のIG−ONを契機として不揮発性メモリM1から揮発性メモリM2へ読み出しデータを転送し、車両のIG−OFFを契機として揮発性メモリM2から不揮発性メモリM1へ書き込みデータを転送する。
For example, the
また、転送部22は、検出部24によって停止異常が検出された場合、不揮発性メモリM1から揮発性メモリM2へ転送した読み出しデータを図示せぬROMに予め格納されている代替値で上書きする。かかる点の詳細については、図5Aおよび図5Bを用いて後述する。
Further, when the
次に、メモリ制御部2の更新部23および検出部24の説明に先立って不揮発性メモリM1および揮発性メモリM2について説明しておく。
Next, the nonvolatile memory M1 and the volatile memory M2 will be described prior to the description of the
不揮発性メモリM1は、例えば、データフラッシュ(Data Flash)である。不揮発性メモリM1は、書き込み・消去が可能であり、電源が遮断されても記憶内容が保持される。 The non-volatile memory M1 is, for example, a data flash. The nonvolatile memory M1 can be written and erased, and the stored contents are retained even when the power is turned off.
ここで、図3を用いて実施形態に係る不揮発性メモリM1の構成例について説明する。図3は、不揮発性メモリM1の構成例を示す模式図である。図3に示すように、不揮発性メモリM1は、複数のデータ領域Ra1〜Ranを備える。 Here, a configuration example of the nonvolatile memory M1 according to the embodiment will be described with reference to FIG. FIG. 3 is a schematic diagram illustrating a configuration example of the nonvolatile memory M1. As shown in FIG. 3, the nonvolatile memory M1 includes a plurality of data areas Ra1 to Ran.
例えば、データ領域Ra1〜Ra3は、同一種類のデータが格納される。また、図2に示したアプリ制御部3の要求に応じてデータ領域Ra1〜Ra3のうち、いずれかのデータ領域のデータが更新される。
For example, the data areas Ra1 to Ra3 store the same type of data. Further, data in one of the data areas Ra1 to Ra3 is updated in response to a request from the
すなわち、データ領域Ra1〜Ra3は、要求に応じてデータが揮発性メモリM2へ転送されるとともに、揮発性メモリM2からデータが転送される。このため、以下では、データ領域Ra1〜Ra3について、要求データ領域Rrと記載する。 That is, in the data areas Ra1 to Ra3, data is transferred to the volatile memory M2 and data is transferred from the volatile memory M2 in response to a request. For this reason, hereinafter, the data areas Ra1 to Ra3 are described as request data areas Rr.
また、データ領域Ra1〜Ra3は、制御に使用するデータ等を記憶するデータ記憶領域Rd1〜Rd3と、それぞれ対応する識別領域Rs1〜Rs3からなる。識別領域Rs1〜Rs3には、要求データ領域Rrおよび揮発性メモリM2間でデータが更新された回数の累計値が書き込まれる。 The data areas Ra1 to Ra3 include data storage areas Rd1 to Rd3 for storing data used for control, and corresponding identification areas Rs1 to Rs3, respectively. In the identification areas Rs1 to Rs3, a cumulative value of the number of times data is updated between the request data area Rr and the volatile memory M2 is written.
すなわち、最新のデータであるほど、識別領域Rs1〜Rs3に書き込まれる累計値が大きくなる。このため、後述のアプリ制御部3は、識別領域Rs1〜Rs3に書き込まれた累計値を比較することで、どの識別領域Rs1〜Rs3が最新のデータを記憶しているかを容易に判定することができる。
That is, the cumulative value written in the identification areas Rs1 to Rs3 increases as the data is the latest. Therefore, the
そして、データを読出すときは、識別領域Rs1〜Rs3の値に基づき最新のデータが記憶されているデータ領域Raを判定して、そのデータ記憶領域Rdのデータを読み出す。なお、要求データ領域Rrは、2つ以上であってもよく、また、要求データ領域Rrは2つ以下や4つ以上のデータ領域Raを備えることにしてもよい。 When reading data, the data area Ra in which the latest data is stored is determined based on the values of the identification areas Rs1 to Rs3, and the data in the data storage area Rd is read. The request data area Rr may be two or more, and the request data area Rr may include two or less or four or more data areas Ra.
また、データ領域Ranは、データ記憶領域Rdnと、識別領域Rsnからなる。データ記憶領域Rdnは、起動時に揮発性メモリM2へデータが転送され、停止時に、揮発性メモリM2に格納されたデータが転送される領域である。 The data area Ran includes a data storage area Rdn and an identification area Rsn. The data storage area Rdn is an area in which data is transferred to the volatile memory M2 at the time of startup and data stored in the volatile memory M2 is transferred at the time of stop.
その後、データ記憶領域Rdnから揮発性メモリM2へ転送されたデータは、揮発性メモリM2内でアプリ制御部3によって更新され、正常停止時に更新後のデータがデータ領域Ranに転送される。
Thereafter, the data transferred from the data storage area Rdn to the volatile memory M2 is updated by the
識別領域Rsnは、揮発性メモリM2からデータが転送された回数が記憶される領域である。例えば、識別領域Rsnに記憶される値は、揮発性メモリM2からデータが転送された場合に、更新される。なお、以下、データ領域Ranについて更新データ領域Ranとも記載する。 The identification area Rsn is an area in which the number of times data has been transferred from the volatile memory M2 is stored. For example, the value stored in the identification area Rsn is updated when data is transferred from the volatile memory M2. Hereinafter, the data area Ran is also referred to as an update data area Ran.
図2の説明に戻り、揮発性メモリM2について説明する。揮発性メモリM2は、例えば、RAMであり、制御装置1の起動時において不揮発性メモリM1に記憶された所定の読み出しデータが転送される。
Returning to the description of FIG. 2, the volatile memory M2 will be described. The volatile memory M2 is, for example, a RAM, and predetermined read data stored in the nonvolatile memory M1 is transferred when the
すなわち、実施形態に係る制御装置1は、正常停止時の処理の一環として揮発性メモリM2の最新のデータを不揮発性メモリM1の更新データ領域Ranのデータ記憶領域Rdnへ転送する。
That is, the
そして、不揮発性メモリM1に書き込まれたかかる最新のデータは、次のIG−ON時に、揮発性メモリM2に書き込まれることとなる。これにより、アプリ制御部3は、IG−ON時に前回のIG−OFF時の制御結果を引き継いで、車両を制御することが可能となる。
The latest data written in the nonvolatile memory M1 is written in the volatile memory M2 at the next IG-ON. Thereby, the
メモリ制御部2の更新部23は、転送部22によってデータ記憶領域Rdnから読み出しデータが揮発性メモリM2に転送される場合に、不揮発性メモリM1内の所定のデータ領域Ra(例えば、データ領域Ra1〜Ra3のいずれかのデータ記憶領域Rd)の値を更新し、書き込みデータが転送される場合に、不揮発性メモリM1内の他のデータ領域Ra(例えば、データ領域Ranにおける識別領域Rsn)の値を更新する。
The
検出部24は、起動時に所定のデータ領域Raの値と他のデータ領域Raの値とを比較することで、前回の停止時における揮発性メモリM2の停止異常を検出する。
The detecting
ここで、図4を用いてメモリ制御部2による一連の動作について説明する。図4は、正常時におけるメモリ制御部2の処理の具体例を示す図である。また、ここでは、不揮発性メモリM1を簡略化して示す。
Here, a series of operations by the
図4に示すように、メモリ制御部2は、起動すると、要求データ領域Rrに記憶された値と、更新データ領域Ranに記憶されたデータとを比較する。
As shown in FIG. 4, when activated, the
同図に示す例では、要求データ領域Rrであるデータ領域Ra1のデータ記憶領域Rd1に記憶された値と、更新データ領域Ranの識別領域Rsnに記憶された値がともに「50」である。 In the example shown in the figure, the value stored in the data storage area Rd1 of the data area Ra1 which is the request data area Rr and the value stored in the identification area Rsn of the update data area Ran are both “50”.
したがって、メモリ制御部2は、双方の値が一致するため、前回の停止が正常だったことを認識する。続いて、更新部23は、データ領域Ra1の値を、更新データ領域Ranの識別領域Rsnに記憶されている値に1加算した値に更新、すなわち「50」を「50→51」へ更新し、転送部22は、更新データ領域Ranのデータ記憶領域Rdnに記憶されたデータ(ここでは、「100」)を揮発性メモリM2へ転送する。
Therefore, the
揮発性メモリM2に転送されたデータ「100」は、アプリ制御部3によって「70」へ更新され、IG−OFF時にデータ記憶領域Rdnへ転送される。
The data “100” transferred to the volatile memory M2 is updated to “70” by the
そして、データ記憶領域Rdnへのデータ転送が終わると、更新部23は、更新データ領域Ranの識別領域Rsnの値「50」を「50→51」へ更新する。すなわち、更新データ領域Ranの識別領域Rsnの値は、揮発性メモリM2から更新データ領域Ranへデータが転送された回数の累計値となる。
When the data transfer to the data storage area Rdn is completed, the updating
つまり、要求データ領域Rrの値が、更新データ領域Ranから揮発性メモリM2へデータが転送された回数の累計値となり、更新データ領域Ranの値が揮発性メモリM2から更新データ領域Ranへデータが転送された回数の累計値となる。 That is, the value of the request data area Rr is the cumulative value of the number of times data is transferred from the update data area Ran to the volatile memory M2, and the value of the update data area Ran is the data from the volatile memory M2 to the update data area Ran. Cumulative value of the number of transfers.
このため、正常停止時後に、双方の値を比較すると、双方の値が等しくなり、異常停止時後に、双方の値を比較すると、双方の値が等しくならず、更新データ領域Ranの識別領域Rsnの値が、要求データ領域Rrの値よりも少なくなる。 For this reason, when both values are compared after a normal stop, both values are equal. When both values are compared after an abnormal stop, both values are not equal, and the identification area Rsn of the update data area Ran. Is smaller than the value of the request data area Rr.
したがって、検出部24は、双方の値を比較することで、前回の停止が正常か異常かを容易に判定することが可能となる。
Therefore, the
次に、図5Aおよび図5Bを用いて異常対応処理の具体例について説明する。図5Aは、異常対応処理の具体例を示す図である。図5Bは、代替値の具体例を示す図である。 Next, a specific example of the abnormality handling process will be described with reference to FIGS. 5A and 5B. FIG. 5A is a diagram illustrating a specific example of the abnormality handling process. FIG. 5B is a diagram illustrating a specific example of an alternative value.
図5Aに示すように、検出部24は、起動時に更新データ領域Ranの値が、要求データ領域Ra1の値よりも少ない場合、前回の停止が停止異常であったことを検出する。
As illustrated in FIG. 5A, when the value of the update data area Ran is smaller than the value of the request data area Ra1 at the time of activation, the
このとき、更新部23は、要求データ領域Ra1のデータ記憶領域Rd1の値を更新データ領域Ranの識別領域Rsnに記憶されている値に1加算した値に更新する。同図に示す例では、起動時のデータ記憶領域Rd1の値が「51」であり、識別領域Rsnの値が「50」である。
At this time, the
このため、結果的に、データ記憶領域Rd1の値が「51」から「51」へ更新されたこととなる。続いて、転送部22は、データ記憶領域Rdnに記憶されたデータ(「100」)を揮発性メモリM2へ転送する。
As a result, the value of the data storage area Rd1 is updated from “51” to “51”. Subsequently, the
その後、転送部22は、揮発性メモリM2へ転送したデータを図示しないROMに記憶された代替値(「80」)で上書きする。例えば、図5Bに示すように、上記のROMには、変速機は、代替値が「xxx」として記憶されているものの、ダイアグ情報については、代替値が記憶されていない。例えば、変速機が、5段の変則ギアを備え、前回の正常停止時の変速機の状態が1段(低速走行)であり、停止異常前の変速機の状態が5段(高速走行)である場合を想定する。
Thereafter, the
かかる場合に、仮に、停止異常後の再起動時に、揮発性メモリM2に変速機が1段であることを示すデータが転送された場合、変速機が5段から1段に切り替えられる場合がある。かかる場合に、車両の急減速を招く恐れがあり、ドライバに違和感を与えるおそれがある。 In such a case, if the data indicating that the transmission is in the first stage is transferred to the volatile memory M2 during the restart after the stop abnormality, the transmission may be switched from the fifth stage to the first stage. . In such a case, the vehicle may be suddenly decelerated and the driver may feel uncomfortable.
このため、転送部22は、変速機の代替値として例えば、1〜5段の中間値である3段を揮発性メモリM2に上書きする。これにより、上記の急減速を抑制することができるので、ドライバに与える違和感を軽減することができる。すなわち、代替値は、車両の挙動が急激に変化することを防ぐフェールセーフ値である。なお、代替値については、任意に設定することが可能である。
For this reason, the
一方、転送部22は、ダイアグ情報等の現在の車両の制御に直結しない情報については、代替値に上書きせず、例えば、前回正常停止時の読み出しデータがそのまま使用される。このように、転送部22は、停止異常が検出された場合、車両の制御に直結するデータ項目について代替値で上書きする。
On the other hand, the
これにより、アプリ制御部3は、停止異常が生じた場合であっても、車両の挙動を急激に変えることなく制御することが可能となる。なお、代替値は、図示しないROMに格納されるが、不揮発性メモリM1の所定の領域に格納されていてもよく、その他の不揮発性メモリに格納されていてもよい。
Thereby, even if it is a case where stop abnormality arises, the
次に、図6および図7を用いて実施形態に係る制御装置1が実行する処理手順について説明する。図6および図7は、制御装置1が実行する処理手順を示すフローチャートである。
Next, a processing procedure executed by the
まず、図6を用いて起動時に行う処理手順について説明する。図6に示すように、まず、メモリ制御部2の判定部21は、揮発性メモリM2のデータに破損があるか否かを判定する(ステップS101)。ここで、データが破損していない場合(ステップS101、No)、電源の瞬断が発生したが揮発性メモリM2のデータは正常に記憶されていると判断し、要求データ領域Rrの値を更新して(ステップS104)、処理を終了する。
First, a processing procedure performed at startup will be described with reference to FIG. As shown in FIG. 6, first, the
一方、データが破損していた場合(ステップS101,Yes)、転送部22は、更新データ領域Ranから揮発性メモリM2へデータを転送する(ステップS102)。
On the other hand, when the data is damaged (step S101, Yes), the
続いて、検出部24は、要求データ領域Rrの値と識別領域Rsnの値とが一致しているか否かを判定する(ステップS103)。ここで、双方の値が一致していた場合(ステップS103,Yes)、更新部23は、前回の終了が正常であったと判断し、要求データ領域Rrの値を更新し(ステップS104)、処理を終了する。
Subsequently, the
一方、双方の値が一致していなかった場合(ステップS103,No)、転送部22は、前回の終了が異常終了であったと判断し、一旦、揮発性メモリM2へ一旦転送したデータを代替値で上書きする(ステップS105)。その後、要求データ領域Rrの値を更新し(ステップS104)、処理を終了する。
On the other hand, if both values do not match (No at Step S103), the
続いて、図7を用いて正常停止時における制御装置1の処理について説明する。図7に示すように、転送部22は、揮発性メモリM2の停止指示を取得すると(ステップS201)、揮発性メモリM2に記憶されたデータを不揮発性メモリM1の更新データ領域Ranへ転送する(ステップS202)。
Next, processing of the
なお、停止指示とは、例えば、車両のIG−OFFを意味する。続いて、更新部23は、更新データ領域Ranの識別領域Rsnの値を更新して(ステップS203)、処理を終了する。
In addition, a stop instruction | indication means IG-OFF of a vehicle, for example. Subsequently, the
上述したように、実施形態に係る制御装置1は、転送部22と、更新部23と、検出部24とを備える。転送部22は、起動時に不揮発性メモリM1から揮発性メモリM2へ読み出しデータを転送し、正常終了時に揮発性メモリM2から不揮発性メモリM1へ書き込みデータを転送する。
As described above, the
更新部23は、転送部22によって読み出しデータが転送される場合に、不揮発性メモリM1内の所定のデータ領域Raの値を更新し、書き込みデータが転送される場合に、不揮発性メモリM1内の他のデータ領域Raの値を更新する。
The
検出部24は、起動時に所定のデータ領域Raの値と他のデータ領域Raの値とを比較することで、前回の停止時における揮発性メモリM2の停止異常を検出する。したがって、実施形態に係る制御装置1によれば、停止異常を検出することができる。
The detecting
ところで、上述した実施形態では、制御装置1が車載用の制御装置である場合について説明したが、これに限定されず、その他の制御装置にも本発明を適用することが可能である。
By the way, although embodiment mentioned above demonstrated the case where the
また、上述した実施形態では、要求データ領域Rrの値と、更新データ領域Ranの値とが一致する場合に、停止異常を検出する場合について説明したが、これに限定されるものではない。 In the above-described embodiment, the case has been described in which a stop abnormality is detected when the value of the request data area Rr matches the value of the update data area Ran. However, the present invention is not limited to this.
すなわち、要求データ領域Rrの値と更新データ領域Ranの値とを所定の規則に則って更新することにすれば、要求データ領域Rrの値と更新データ領域Ranの値とが同じ場合に、停止異常を検出することにしてもよい。 That is, if the value of the request data area Rr and the value of the update data area Ran are updated according to a predetermined rule, the value is stopped when the value of the request data area Rr and the value of the update data area Ran are the same. An abnormality may be detected.
また、上述した実施形態では、要求データ領域Rrの値と更新データ領域Ranの値とをそれぞれ更新する場合について説明したが、かかる値を記憶するのは、要求データ領域Rrや更新データ領域Ranに限られず、不揮発性メモリM1内の任意の領域であってもよい。 In the above-described embodiment, the case where the value of the request data area Rr and the value of the update data area Ran are updated has been described, but the values are stored in the request data area Rr and the update data area Ran. It is not limited, and may be an arbitrary area in the nonvolatile memory M1.
また、上述した実施形態では、停止異常を検出したとき揮発性メモリM2のデータをROMに記憶された代替値で上書きするようにしたが、ROMではなくデータフラッシュに代替値を記憶しておき、データフラッシュから代替値を転送して上書きしてもよい。 In the above-described embodiment, the data in the volatile memory M2 is overwritten with the alternative value stored in the ROM when a stop abnormality is detected, but the alternative value is stored in the data flash instead of the ROM. Alternate values may be transferred from the data flash and overwritten.
さらなる効果や変形例は、当業者によって容易に導き出すことができる。このため、本発明のより広範な態様は、以上のように表しかつ記述した特定の詳細および代表的な実施形態に限定されるものではない。したがって、添付の特許請求の範囲およびその均等物によって定義される総括的な発明の概念の精神または範囲から逸脱することなく、様々な変更が可能である。 Further effects and modifications can be easily derived by those skilled in the art. Thus, the broader aspects of the present invention are not limited to the specific details and representative embodiments shown and described above. Accordingly, various modifications can be made without departing from the spirit or scope of the general inventive concept as defined by the appended claims and their equivalents.
1 制御装置
2 メモリ制御部
5 アプリ制御部
21 判定部
22 転送部
23 更新部
24 検出部
M1 不揮発性メモリ
M2 揮発性メモリ
DESCRIPTION OF
Claims (5)
前記転送部によって前記読み出しデータが転送される場合に、前記不揮発性メモリ内の所定のデータ領域の値を更新し、前記書き込みデータが転送される場合に、前記不揮発性メモリ内の他のデータ領域の値を更新する更新部と、
前記起動時に前記所定のデータ領域の値と前記他のデータ領域の値とを比較することで、前回の停止時における前記揮発性メモリの停止異常を検出する検出部と
を備えることを特徴とする制御装置。 A transfer unit that transfers read data from the nonvolatile memory to the volatile memory at startup, and transfers write data from the volatile memory to the nonvolatile memory at a normal stop; and
When the read data is transferred by the transfer unit, the value of a predetermined data area in the nonvolatile memory is updated, and when the write data is transferred, another data area in the nonvolatile memory An update unit for updating the value of
A detector that detects a stop abnormality of the volatile memory at the previous stop by comparing the value of the predetermined data area with the value of the other data area at the time of starting. Control device.
前記停止異常が検出された場合に、一旦、転送した前記読み出しデータを代替値で上書きすること
を特徴とする請求項1に記載の制御装置。 The transfer unit
The control device according to claim 1, wherein when the stop abnormality is detected, the transferred read data is once overwritten with an alternative value.
前記起動時に前記読み出しデータが転送され、前記正常停止時に前記書き込みデータが転送される更新データ領域と、前記更新データ領域に対応付けられた識別領域と、要求に応じて前記読み出しデータと前記書き込みデータが転送される要求データ領域と、を有し、
前記更新部は、
前記起動時に前記更新データ領域から前記読み出しデータが転送された転送回数の累計値を前記要求データ領域に書き込み、前記正常停止時に前記書き込みデータが前記更新データ領域へ転送された転送回数の累計値を前記識別領域に書き込むこと
を特徴とする請求項1または2に記載の制御装置。 The nonvolatile memory is
An update data area to which the read data is transferred at the time of startup and the write data is transferred at the time of normal stop, an identification area associated with the update data area, and the read data and the write data in response to a request A request data area to be transferred, and
The update unit
A cumulative value of the number of transfers of the read data transferred from the update data area at the time of activation is written to the request data area, and a cumulative value of the number of transfers of the write data transferred to the update data area at the time of normal stop The control device according to claim 1, wherein the control device writes in the identification area.
をさらに備え、
前記転送部は、
前記判定部によって前記データの破損がないと判定された場合に、前記読み出しデータの転送を行わないこと
を特徴とする請求項1、2または3に記載の制御装置。 A determination unit for determining whether or not the data is damaged based on a total capacity of the data stored in the volatile memory at the start-up;
The transfer unit
The control device according to claim 1, wherein the read data is not transferred when the determination unit determines that the data is not damaged.
前記転送工程によって前記読み出しデータが転送される場合に、前記不揮発性メモリ内の所定のデータ領域の値を更新し、前記書き込みデータが転送される場合に、前記不揮発性メモリ内の他のデータ領域の値を更新する更新工程と、
前記起動時に前記所定のデータ領域の値と前記他のデータ領域の値とを比較することで、前回の停止時における前記揮発性メモリの停止異常を検出する検出工程と
を含むことを特徴とする異常検出方法。 A transfer step of transferring read data from the nonvolatile memory to the volatile memory at startup, and transferring write data from the volatile memory to the nonvolatile memory at a normal stop; and
When the read data is transferred by the transfer step, the value of a predetermined data area in the nonvolatile memory is updated, and when the write data is transferred, another data area in the nonvolatile memory An update process for updating the value of
Detecting a stop abnormality of the volatile memory at the previous stop by comparing the value of the predetermined data area with the value of the other data area at the time of starting. Anomaly detection method.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2018048517A JP7007223B2 (en) | 2018-03-15 | 2018-03-15 | Control device and abnormality detection method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2018048517A JP7007223B2 (en) | 2018-03-15 | 2018-03-15 | Control device and abnormality detection method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2019160080A true JP2019160080A (en) | 2019-09-19 |
| JP7007223B2 JP7007223B2 (en) | 2022-01-24 |
Family
ID=67994859
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2018048517A Active JP7007223B2 (en) | 2018-03-15 | 2018-03-15 | Control device and abnormality detection method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7007223B2 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023195230A1 (en) * | 2022-04-08 | 2023-10-12 | ソニーセミコンダクタソリューションズ株式会社 | Semiconductor integrated circuit and electronic device |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012137034A (en) * | 2010-12-27 | 2012-07-19 | Bosch Corp | Control device of drive unit and control method |
| JP2016135657A (en) * | 2015-01-23 | 2016-07-28 | トヨタ自動車株式会社 | Vehicle data storage device |
| JP2017056847A (en) * | 2015-09-17 | 2017-03-23 | 日野自動車株式会社 | Vehicular electronic control device |
-
2018
- 2018-03-15 JP JP2018048517A patent/JP7007223B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2012137034A (en) * | 2010-12-27 | 2012-07-19 | Bosch Corp | Control device of drive unit and control method |
| JP2016135657A (en) * | 2015-01-23 | 2016-07-28 | トヨタ自動車株式会社 | Vehicle data storage device |
| JP2017056847A (en) * | 2015-09-17 | 2017-03-23 | 日野自動車株式会社 | Vehicular electronic control device |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2023195230A1 (en) * | 2022-04-08 | 2023-10-12 | ソニーセミコンダクタソリューションズ株式会社 | Semiconductor integrated circuit and electronic device |
Also Published As
| Publication number | Publication date |
|---|---|
| JP7007223B2 (en) | 2022-01-24 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4925301B2 (en) | Semiconductor memory system | |
| US9110842B2 (en) | Control device for vehicle and error processing method in control device for vehicle | |
| JP4227149B2 (en) | Information storage method for electronic control unit | |
| JP5981906B2 (en) | Image forming apparatus | |
| JP2016118815A (en) | Nonvolatile memory device | |
| US11314634B2 (en) | Electronic control unit and data protection method therefor | |
| US8225172B2 (en) | Error correction scheme for non-volatile memory | |
| JP2019160080A (en) | Controller and abnormality detection method | |
| JP5915490B2 (en) | Electronic control unit | |
| JP6011687B1 (en) | Storage device and control method thereof | |
| US9773562B2 (en) | Storage apparatus, flash memory control apparatus, and program | |
| JP6575157B2 (en) | Firmware download method and firmware embedded device | |
| JP4483876B2 (en) | Storage device control method in duplex system | |
| JP4950214B2 (en) | Method for detecting a power outage in a data storage device and method for restoring a data storage device | |
| JP6708596B2 (en) | Electronic control device and control program verification method | |
| JP2010176201A (en) | Data loss prevention device for flash memory, and data loss prevention method for flash memory | |
| JP7029366B2 (en) | Electronic control device for automobiles | |
| JP5872982B2 (en) | Vehicle control device | |
| JP2006018594A (en) | Information processing device | |
| JP6363044B2 (en) | Control device | |
| JP2008077135A (en) | Arithmetic processing device and counter value operation method | |
| JP2018063527A (en) | Electronic control apparatus | |
| JP2009083777A (en) | Vehicle control apparatus and program | |
| JP5413809B2 (en) | Data processing apparatus and data processing method | |
| JP6568826B2 (en) | Electronic control unit |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20201222 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20211119 |
|
| 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: 20211214 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20220106 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7007223 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |