JP2012236451A - Program - Google Patents
Program Download PDFInfo
- Publication number
- JP2012236451A JP2012236451A JP2011105305A JP2011105305A JP2012236451A JP 2012236451 A JP2012236451 A JP 2012236451A JP 2011105305 A JP2011105305 A JP 2011105305A JP 2011105305 A JP2011105305 A JP 2011105305A JP 2012236451 A JP2012236451 A JP 2012236451A
- Authority
- JP
- Japan
- Prior art keywords
- vehicle
- data
- stored
- program
- information
- 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
Images
Abstract
Description
本発明は、プログラムに関する。 The present invention relates to a program.
車両の電子制御ユニット(ECU: Electric Control Unit)では、イグニッションオフされたときに、揮発性メモリ上のユーザ設定や諸元等の車両情報を不揮発性メモリに記憶させ、再度イグニッションオンされた時に不揮発性メモリ上の車両情報を揮発性メモリに戻す。例えば下記特許文献1には、車両の情報を揮発性メモリから不揮発性メモリに短時間で移す技術が開示されている。
In an electronic control unit (ECU) of a vehicle, when ignition is turned off, vehicle information such as user settings and specifications on a volatile memory is stored in a nonvolatile memory, and when an ignition is turned on again, the vehicle information is stored in a nonvolatile memory. The vehicle information in the volatile memory is returned to the volatile memory. For example,
車載等の組み込みソフトではメモリ容量の制限が厳しく、不揮発性メモリに記憶できるデータ量は限られている。また車両の電子制御装置の場合、不揮発性メモリは通常のメモリとは別に搭載するため、コスト面の制約から容量のより大きな不揮発性メモリに変更することは容易ではない。 Embedded software such as in-vehicle has a severe memory capacity limitation, and the amount of data that can be stored in a nonvolatile memory is limited. In the case of an electronic control device for a vehicle, since the nonvolatile memory is mounted separately from the normal memory, it is not easy to change to a nonvolatile memory having a larger capacity due to cost limitations.
したがって、記憶すべきデータを圧縮する必要がある。一般にデータを圧縮する技術として、例えば画像圧縮技術のJPEGやファイル圧縮技術のzipが知られているが、処理負荷や必要なROMサイズが大きく、車載ソフトに用いるのは適当ではない。またJPEGやzipでは圧縮の必要のないデータまで圧縮する欠点も有している。 Therefore, it is necessary to compress the data to be stored. For example, JPEG which is an image compression technique and zip which is a file compression technique are known as techniques for compressing data. However, the processing load and the required ROM size are large, and it is not suitable for use in in-vehicle software. In addition, JPEG and zip also have a drawback of compressing even data that does not need to be compressed.
車載ソフトでは、機能やバリエーションの増加やソフトウェアの再利用性を向上させるための技術として例えばオブジェクト指向の導入が考えられるが、その場合記憶したいデータ量は今後ますます多くなる。よって、オブジェクト指向のソフトウェアを含む車載用のソフトウェアにおいて、不揮発性メモリに記憶するデータを効果的に圧縮する技術の開発が必要である。上記特許文献1では、車両故障時における揮発性メモリから不揮発性メモリへの情報移動のみを扱っており、車両故障時以外は対象外である。
For in-vehicle software, for example, the introduction of object orientation is considered as a technique for increasing functions and variations and improving the reusability of software. In that case, the amount of data to be stored will increase in the future. Therefore, in-vehicle software including object-oriented software, it is necessary to develop a technique for effectively compressing data stored in a nonvolatile memory. In
そこで本発明が解決しようとする課題は、上述の項目を鑑み、車両の電子制御装置の揮発性メモリに記憶された情報を不揮発性メモリに記憶する際に、従来技術における記憶手法よりも不揮発性メモリが小容量化でき、記憶処理の処理負荷や処理時間も低減できるプログラムを提供することにある。 In view of the above-mentioned items, the problem to be solved by the present invention is that the information stored in the volatile memory of the vehicle electronic control device is more nonvolatile than the storage technique in the prior art. An object of the present invention is to provide a program capable of reducing the memory capacity and reducing the processing load and processing time of storage processing.
上記課題を達成するために、本発明に係るプログラムは、車両に装備された電子制御装置が有する揮発性メモリに記憶された、前記車両の車載機器の制御状態を示す複数のデータのそれぞれに対して異なった2進数を割り当て、その2進数のビット数は全ての前記データに異なった2進数値を割り当てられる最小のビット数とする割り当てステップと、前記車両の駆動部の停止時に、前記車両に備えられた不揮発性メモリに、前記割り当てステップで求められた2進数値を記憶する記憶ステップと、を車両に装備されたコンピュータに実行させることを特徴とする。 In order to achieve the above object, a program according to the present invention is provided for each of a plurality of pieces of data indicating a control state of an in-vehicle device of a vehicle stored in a volatile memory included in an electronic control device installed in the vehicle. Assigning different binary numbers, the number of bits of the binary numbers being the minimum number of bits that can be assigned different binary values to all the data, and when stopping the drive unit of the vehicle, A storage step of storing the binary value obtained in the assigning step in a non-volatile memory provided is executed by a computer mounted on the vehicle.
これにより本発明に係るプログラムでは、車両の電子制御装置の揮発性メモリに記憶された、車載機器の制御状態を示す複数のデータに異なった2進数を最小のビット数で割り当て、車両の駆動部の停止時に不揮発性メモリにその2進数を記憶する。したがって従来技術のようにオブジェクトのポインタをそのまま記憶したり、データ全体をzip等で圧縮するのではなく、記憶すべきデータのうち圧縮する必要のあるデータのみを最小のビット数で記憶できる。よって不揮発性メモリに容量を低減でき、さらには記憶処理における処理負荷や処理時間も低減することができる。特に車載機器の場合、とり得る制御状態の数は相対的に少ない場合が多いため、少ないビット数の2進数に圧縮でき、メモリ容量の制約が厳しい車載組み込みソフトに対して本発明はきわめて有効である。 Thus, in the program according to the present invention, a different binary number is assigned to a plurality of data indicating the control state of the in-vehicle device stored in the volatile memory of the vehicle electronic control device with the minimum number of bits, and the vehicle drive unit The binary number is stored in the non-volatile memory when the operation is stopped. Therefore, instead of storing the object pointer as it is in the prior art or compressing the entire data by zip or the like, only the data that needs to be compressed among the data to be stored can be stored with the minimum number of bits. Therefore, the capacity of the nonvolatile memory can be reduced, and further, the processing load and processing time in the storage process can be reduced. In particular, in the case of in-vehicle devices, since the number of control states that can be taken is relatively small, the present invention is extremely effective for in-vehicle embedded software that can be compressed to a binary number with a small number of bits and has a severe memory capacity limitation. is there.
また前記車両の駆動部の始動時に、前記不揮発性メモリに記憶された前記2進数の情報を、その2進数に関連付けられた前記車載機器の制御状態を示すデータの情報に変換して、前記揮発性メモリに復元する復元ステップを、車両に装備されたコンピュータに実行させるとしてもよい。 Further, when starting the drive unit of the vehicle, the binary information stored in the nonvolatile memory is converted into data information indicating a control state of the in-vehicle device associated with the binary number, and the volatile The restoration step of restoring to the memory may be executed by a computer installed in the vehicle.
この発明によれば、車両の駆動部の停止時に不揮発性メモリに2進数として記憶されたデータを、駆動部の始動時に揮発性メモリに車載機器の制御情報として復元するので、最小ビット数の2進数の読み出しでよく、復元処理における処理負荷や処理時間が低減できる。 According to the present invention, data stored as a binary number in the nonvolatile memory when the drive unit of the vehicle is stopped is restored as control information of the in-vehicle device in the volatile memory when the drive unit is started. Reading of a decimal number is sufficient, and the processing load and processing time in the restoration process can be reduced.
また前記データの数に応じて、全ての前記異なった2進数値を記述できるビット数を算出する算出ステップを、車両に装備されたコンピュータに実行させるとしてもよい。 Further, a calculation step for calculating the number of bits that can describe all the different binary values in accordance with the number of the data may be executed by a computer installed in the vehicle.
この発明によれば、車両の電子制御装置の揮発性メモリに記憶された複数のデータに異なった2進数を最小のビット数で割り当てる際に、データの数に応じて最小ビット数を自動的に算出する。したがって車両における各種システム構成を変更してもプログラムを変更する必要がなく、システム変更に自動的に適切に対応するプログラムが実現できる。 According to the present invention, when assigning different binary numbers to a plurality of data stored in the volatile memory of the electronic control unit of the vehicle with the minimum number of bits, the minimum number of bits is automatically set according to the number of data. calculate. Therefore, it is not necessary to change the program even if various system configurations in the vehicle are changed, and a program that automatically and appropriately responds to the system change can be realized.
また前記割り当てステップは、車両に装備された電子制御装置が有する揮発性メモリに記憶された、前記車両の車載機器の複数の設定値のそれぞれに対して、異なった2進数を割り当て、その2進数のビット数は、不揮発性メモリに記憶すべき全ての設定値に異なった2進数値を割り当てられる最小のビット数とする設定値割り当てステップを含むとしてもよい。 The assigning step assigns a different binary number to each of a plurality of set values of the in-vehicle device of the vehicle stored in a volatile memory included in an electronic control device mounted on the vehicle, and the binary number The number of bits may include a set value assigning step in which a different binary value is assigned to all the set values to be stored in the nonvolatile memory.
この発明によれば、車両の駆動部の停止時に車載機器の制御状態を示すデータに最小ビット数の2進数を割り当てて不揮発性メモリに記憶するのみでなく、車載機器の設定値にも最小ビット数の2進数を割り当てて不揮発性メモリに記憶する。したがって駆動部停止時に記憶しておくべき重要な制御状態や設定値などの情報を最小ビット数で不揮発性メモリに記憶させることができ、不揮発性メモリの小容量化、記憶処理負荷、処理時間の低減を達成できる。 According to the present invention, not only the binary value of the minimum bit number is assigned to the data indicating the control state of the in-vehicle device when the driving unit of the vehicle is stopped, but also stored in the nonvolatile memory, the minimum bit is also set in the set value of the in-vehicle device. A binary number is assigned and stored in non-volatile memory. Therefore, information such as important control states and setting values that should be stored when the drive unit is stopped can be stored in the nonvolatile memory with the minimum number of bits, and the capacity of the nonvolatile memory, the storage processing load, and the processing time can be reduced. Reduction can be achieved.
またオブジェクト指向のプログラム言語で記述されたプログラムであり、前記制御状態を示すデータは、そのプログラムにおけるオブジェクトであるとしてもよい。 Further, the program may be written in an object-oriented programming language, and the data indicating the control state may be an object in the program.
この発明によれば、オブジェクト指向のプログラム言語で記述されたプログラムにおいて、車載機器の制御状態を示すオブジェクトに最小のビット数の2進数が割り当てられて、車両の駆動部の停止時に不揮発性メモリに記憶される。したがって車載ソフトウェアとして、機能やバリエーションの増加やソフトウェアの再利用性を向上させるための技術としてオブジェクト指向のプログラムが導入された状況において、従来技術のようにオブジェクトのポインタをそのまま記憶したり、データ全体をzip等で圧縮するのではなく、記憶すべきデータのうち圧縮する必要のあるデータのみを最小のビット数で記憶する。よって不揮発性メモリに容量を低減でき、さらには記憶処理における処理負荷や処理時間も低減することができる。特に車載機器の場合、とり得る制御状態の数は相対的に少ない場合が多いため、少ないビット数の2進数に圧縮でき、メモリ容量の制約が厳しい車載組み込みソフトに対して本発明はきわめて有効である。 According to the present invention, in a program written in an object-oriented programming language, a binary number having a minimum number of bits is assigned to an object indicating the control state of an in-vehicle device, and the nonvolatile memory is stored when the driving unit of the vehicle is stopped. Remembered. Therefore, in the situation where object-oriented programs were introduced as in-vehicle software as a technology for increasing functions and variations and improving software reusability, object pointers were stored as they were in the conventional technology, or the entire data Is not compressed with zip or the like, but only the data that needs to be compressed among the data to be stored is stored with the minimum number of bits. Therefore, the capacity of the nonvolatile memory can be reduced, and further, the processing load and processing time in the storage process can be reduced. In particular, in the case of in-vehicle devices, since the number of control states that can be taken is relatively small, the present invention is extremely effective for in-vehicle embedded software that can be compressed to a binary number with a small number of bits and has a severe memory capacity limitation. is there.
また前記2進数値の情報量は前記オブジェクトのポインタの情報量よりも小さいとしてもよい。 The information amount of the binary value may be smaller than the information amount of the object pointer.
この発明によれば、2進数値の情報量はオブジェクトのポインタの情報量よりも小さくするので、車両の電子制御装置の揮発性メモリに記憶された複数のオブジェクトを不揮発性メモリに記憶する際に、オブジェクトのポインタの情報量よりも小さい情報量の2進数で記憶する。したがって従来技術のようにオブジェクトのポインタをそのまま記憶する場合よりも不揮発性メモリに容量を低減でき、さらには記憶処理における処理負荷や処理時間も低減することができる。 According to the present invention, since the information amount of the binary value is made smaller than the information amount of the object pointer, when storing a plurality of objects stored in the volatile memory of the electronic control unit of the vehicle, The binary information having an information amount smaller than the information amount of the object pointer is stored. Therefore, the capacity can be reduced in the nonvolatile memory as compared with the case where the object pointer is stored as it is as in the prior art, and further, the processing load and processing time in the storage processing can be reduced.
以下、本発明の実施形態を図面を参照しつつ説明する。まず図1は、本発明に係る記憶制御システムの装置構成の概略図である。 Embodiments of the present invention will be described below with reference to the drawings. First, FIG. 1 is a schematic diagram of an apparatus configuration of a storage control system according to the present invention.
本発明に係る記憶制御システムは、車両2に、ECU2と、ECU2によって制御される車載装置3とを備える。また車両2はイグニッションスイッチ4と駆動部40を備える。駆動部40は例えばエンジンや電気的モータなどからなって車両の進行のために車輪を駆動する。ユーザがイグニッションスイッチ4をオン操作することにより駆動部40が始動する。
The storage control system according to the present invention includes an
ECU2は、通常のコンピュータと同様の構造を有し、CPU20、RAM21、不揮発性メモリ22を備える。CPU20は車載装置3の制御に関する情報処理を行い、RAM21はCPU20の作業領域として機能する揮発性の記憶部(メモリ)である。不揮発性メモリ22は、例えばEEPROMなどによる不揮発性の記憶部であり、車載装置3の制御に関する各種データやプログラムを記憶する。
The
不揮発性メモリ22は、制御プログラム23、保存プログラム24、保存データ25を記憶(保存、格納)している。制御プログラム23は、車載装置3の制御を司るプログラムである。保存プログラム24は、RAM21に記憶された車載装置3の制御に関係する情報(のうちの一部)を不揮発性メモリ22に保存する処理を司るプログラムである。制御プログラム23と保存プログラム24とはRAM21にロードされてCPU20によって自動的に実行されるとすればよい。保存データ25は保存プログラム24を実行することによってRAM21から不揮発性メモリ22に移されるデータ(情報)である(詳細は後述)。
The
制御プログラム23は、オブジェクト指向のプログラム言語(例えばJava(登録商標)、C++など)によって記述されたプログラムである。したがって制御プログラム23は、(複数の)オブジェクト230a、230b、230c、・・を含む。個々のオブジェクト230a、230b、230c等は具体的には、例えば車載装置3のコンポーネント(後述)や車載装置3そのものや、その機能(あるいは制御状態)をプログラム内で表現したものとすればよい。
The
また制御プログラム23は、例えばスタック231や設定値関数232a、232b等を含む。スタック231は、例えば車載装置3における特定のコンポーネントにおける操作(機能、制御状態)の履歴を記憶する。設定値関数232a、232b等は車載装置3における各種設定値を表すプログラム内の関数(例えばオブジェクトが属するクラスで定義されたメンバ関数)である。
The
スタック231の例が図3に示されている。同図の例においては、オブジェクト230aから230fを車載エアコン装置における機能A、機能B、機能C、機能D、機能E、機能Fとしている。機能Aなどは具体的には、例えばオート機能などとすればよい。
An example of the
スタック231はFILO(First In Last Out)の仕組みによって、機能A、機能B、機能C、機能D、機能E、機能Fのうちでユーザから選択された機能が、時間的に先のものほど図示下側に記憶されることにより例えば車載エアコン装置の制御状態の時間的推移が記憶される。図3の例ではユーザは順に機能A、機能D、機能Cを選択しており、その履歴がスタック231に記憶されている。
In the
図1に戻って、車載装置3は車両2に装備された各種装置である。車載装置3の1つの具体例として図2に示された車載エアコン装置3aがある。車載エアコン装置3aは、車両2の車室内の空調を制御する。車載エアコン装置3aは、その部分的な構成部位(コンポーネント)を有する。コンポーネント30、31、32等の例として、ユーザが所望の車内温度を設定する温度設定部33、内外気の切替を行う吸込口34などを備える。以上の構成は車内通信によって接続されて情報の受け渡しが可能となっている。
Returning to FIG. 1, the in-
図1の構成のもとで記憶制御システムは、車両1のイグニッションオフ時に、RAM21(揮発性メモリ)から不揮発性メモリ22に所定の車両情報を圧縮して保存データ25として移動して保存させる。そして再度イグニッションをオン操作したときに保存データ25をRAM21に復元して戻す。保存プログラム24が以上の保存、復元処理を実行する。保存プログラム24による処理手順例が図4から図9に示されている。
With the configuration of FIG. 1, the storage control system compresses predetermined vehicle information from the RAM 21 (volatile memory) to the
まず図4はマップ作成のための処理手順例を示す。ここでマップとは、不揮発性メモリ22への車両情報の記憶、不揮発性メモリ22からの車両情報の復元のために必要となる情報(の集まり)である。具体的には例えば、スタック231のサイズ、スタック231を使用するオブジェクト数、スタック231を使用する各オブジェクトに割り当てられた番号(あるいは指数)、不揮発性メモリ22における記憶開始場所(開始バイト位置とその中での開始ビット位置)等である。
First, FIG. 4 shows an example of a processing procedure for creating a map. Here, the map is information (collection) required for storing vehicle information in the
図4の処理ではまずS10で、不揮発性メモリ22に記憶させる1組の情報を指定する。ここで1組の情報とは、車両の情報、あるいは車載装置3に関する情報とすればよい。図1の例の場合、例えばスタック231の状態が1組の情報であり、設定値関数232a、232bの数値が別の1組の情報である。なお1組の情報は複数の情報を有するものには限定せず、1個の情報のみを有するものも含むとする。
In the process of FIG. 4, first, in S10, a set of information to be stored in the
次にS20で不揮発性メモリ22における記憶開始場所を指定する。記憶開始場所は具体的には、開始バイト位置と、そのなかでの開始ビット位置とすればよい。
Next, the storage start location in the
次にS30で記憶させる複数の情報に指数(番号)を割り振る。その例が図10から図12に示されている。図10の例では、スタック231に格納される可能性のある機能Aから機能Fに、指数1から6が割り振られている。図11の例では、設定値関数232aとしての設定温度において、摂氏16度から32度までに、指数1から17が割り振られている。図12の例では、設定値関数232bとしての吸込口状態において、内気、外気、半内気にそれぞれ指数1から3が割り振られている。
Next, an index (number) is assigned to a plurality of information stored in S30. Examples thereof are shown in FIGS. In the example of FIG. 10,
図4に戻って、次にS40で指数を2進数化する際のビット数を指定する。そしてS50で記憶する各情報の指数を2進数化(あるいは2進数に変換)する。その際、S40で指定したビット数の2進数とする。 Returning to FIG. 4, next, the number of bits for binarizing the exponent is designated in S40. Then, the exponent of each information stored in S50 is binarized (or converted into a binary number). At this time, the binary number having the number of bits designated in S40 is used.
図10の例では、機能Aから機能Fの指数1から6は、3ビットの2進数で表現できるので、001から110の2進数に変換されている。図11の例では、摂氏16度から32度までの指数1から17は5ビットの2進数で表現できるので、00001から10001の2進数に変換されている。図12の例では、内気、外気、半内気の指数1から3は2ビットの2進数で表現できるので、01から11の2進数に変換されている。
In the example of FIG. 10, the
以上が図4の処理手順である。図4の処理では1組の情報ごとに指数を割り振り、その指数の2進数表現の際のビット数(記憶ビット数)を決定している。したがって図10から図12の例のように、例えばスタックの状態に対しては記憶ビット数は3、設定温度に対しては記憶ビット数は5、吸込口状態に対しては記憶ビット数は2と設定される。 The above is the processing procedure of FIG. In the processing of FIG. 4, an exponent is assigned to each set of information, and the number of bits (the number of stored bits) in the binary representation of the exponent is determined. Accordingly, as in the examples of FIGS. 10 to 12, for example, the number of storage bits is 3 for the stack state, the storage bit number is 5 for the set temperature, and the storage bit number is 2 for the inlet state. Is set.
なお図10から図12の例は全てのデータに指数が割り振ってある例だが、本発明はこれに限定せず、例えば重要度が低く、不揮発性メモリ22に記憶する必要性が低い(記憶しない)データには指数を割り振らなくともよい。
Note that the examples in FIGS. 10 to 12 are examples in which indexes are assigned to all data, but the present invention is not limited to this. For example, the degree of importance is low and the necessity of storing in the
次に、図5の処理手順は図4におけるS40をS41からS44の手順に置き換えたものとなっている。図4では、保存プログラムを作成するプログラム側で、指数の2進数表現におけるビット数を指定したが、図5では、保存プログラム内で最小ビット数を算出する。以下で図4と異なる部分のみを説明する。 Next, the processing procedure in FIG. 5 is obtained by replacing S40 in FIG. 4 with the procedure from S41 to S44. In FIG. 4, the number of bits in the binary representation of the exponent is specified on the program creating the storage program, but in FIG. 5, the minimum number of bits is calculated in the storage program. Only the parts different from FIG. 4 will be described below.
具体的にまずS41では変数bitSizeを1に設定する。そしてS42で、2のbitSize乗から1を減算した数値が指数の最大値(例えば図10の例ならば6)以上であるか否かを判定する。指数の最大値以上の場合(S42:YES)はS44に進み、指数の最大値未満の場合(S42:NO)はS43に進む。S43に進んだら変数bitSizeの値を1増加させて、再びS42に戻り、S42がYESになるまで同じ手順を繰り返す。S44に進んだら、その時点での変数bitSizeの値を、記憶する2進数のビット数とする。 Specifically, first, in step S41, the variable bitSize is set to 1. Then, in S42, it is determined whether or not the numerical value obtained by subtracting 1 from 2 to the power of bitSize is equal to or larger than the maximum value of the exponent (for example, 6 in the example of FIG. 10). If it is equal to or greater than the maximum value of the index (S42: YES), the process proceeds to S44, and if it is less than the maximum value of the index (S42: NO), the process proceeds to S43. When the process proceeds to S43, the value of the variable bitSize is incremented by 1, the process returns to S42 again, and the same procedure is repeated until S42 becomes YES. After proceeding to S44, the value of the variable bitSize at that time is set as the number of binary bits to be stored.
以上が図5の処理手順である。図5の場合、例えばスタック231に記憶される機能数が変更された場合にも自動的に最小な記憶ビット数を算出するので、システム変更に対して自動的にかつ適切に対応できる。
The above is the processing procedure of FIG. In the case of FIG. 5, for example, even when the number of functions stored in the
次に、図6から図9を説明する。図6および図8には不揮発性メモリ22への圧縮保存処理の手順が、図7および図9には不揮発性メモリ22からの復元処理の手順が示されている。ただし、図6および図7においては記憶ビット数とデータ記憶位置をプログラム内で固定された数値とし、図8および図9においては記憶ビット数とデータ記憶位置を圧縮時に算出する。図6および図7は図4と組み合わされ、図8および図9は図5と組み合わされるとすればよい。
Next, FIGS. 6 to 9 will be described. 6 and 8 show the procedure of the compression and storage process in the
まず図6を説明する。図6には、イグニッションオフ時にRAM21内の所定の情報を不揮発性メモリ22へ記憶する処理の手順が示されている。図6の処理手順はイグニッションスイッチ4がオフされたら自動的に開始されるようにすればよい。
First, FIG. 6 will be described. FIG. 6 shows a procedure of processing for storing predetermined information in the
図6の処理ではまずS100でCPU20は保存データを0に初期化する。次にS110でCPU20は、保存データ25として記憶させる情報(上記の1組の情報)を取得する。次にS120でCPU20は、S110で取得した情報の不揮発性メモリ22における記憶開始場所を指定する。これは記憶する情報が何であるかに応じて予め決めておけばよい。
In the process of FIG. 6, first, the
次にS130でCPU20は、情報から1つのデータ(元データ)を取得する。1つの元データとは、例えば上述の例では、スタック231に格納された1個の機能(機能Cなど)である。下記の変換の前のデータを元データと呼称している。
Next, in S130, the
次にS140でCPU20は、元データに上述のS30で指数が割り当てられているか否かを判定する。指数が割り当てられている場合(S140:YES)はS150に進み、指数が割り当てられていない場合(S140:NO)はS160に進む。
Next, in S140, the
S150に進んだらCPU20は、不揮発性メモリ22に記憶するために元データを変換する。具体的には、元データに割り振られた指数を変換後のデータ(以下、変換データ)とする。そしてS170でCPU20は、変換データを記憶ビットサイズの2進数に圧縮する。この処理で取得される2進数は上述のS50で定めた2進数とすればよい。
After proceeding to S150, the
一方S160に進んだらCPU20は、指数が割り当てられていないデータを無視して、次のデータを詰めるか否かを判定する。次のデータを詰める場合(S160:YES)は、変換データに何の操作も施さずにS210へ進む。次のデータを詰めない場合(S160:NO)は、S180に進んで変換データをゼロとする。S180が終了したらS190へ進む。
On the other hand, when the process proceeds to S160, the
S190でCPU20は、保存データを記憶ビットサイズ分左にシフトする。そしてS200で、シフトの結果右側に空いたビットに、変換データが圧縮された2進数を代入する。そしてS210でCPU20は、圧縮していないデータがまだあるか否かを判定する。圧縮していないデータがまだある場合(S210:YES)はS130へ戻って上記手順を繰り返す。圧縮していないデータがない場合(S210:NO)はS220へ進む。
In S190, the
S220でCPU20は、以上の処理によりRAM21内で作成した保存データ25を不揮発性メモリ22に記憶させる。次にS230でCPU20は、圧縮していない情報(上述の1組の情報)がまだあるか否かを判定する。圧縮していない情報がまだある場合(S230:YES)はS100に戻って上記手順を繰り返す。圧縮していない情報がもうない場合(S230:NO)は図6の処理を終了する。
In S <b> 220, the
以上述べた図6の処理では、予めエンジニア(プログラマ)が保存プログラム24内に、設定された記憶ビットサイズを記述しておき、それにしたがって各データに2進数が指定されて、それが不揮発性メモリ22に記憶される。したがって予め記憶ビットサイズが設定されており、相対的に簡略化された処理となる。この場合、保存プログラム24は、図4と図6(と図7)を組み合わせて作成すればよい。
In the processing of FIG. 6 described above, an engineer (programmer) describes the set storage bit size in the
次に図7を説明する。図7には、再度イグニッションオンにした時に不揮発性メモリ22内の保存データ25を復元してRAM21へ戻す処理の手順が示されている。図7の処理はイグニッションスイッチ4がオンされたら自動的に開始されるようにすればよい。
Next, FIG. 7 will be described. FIG. 7 shows a procedure of processing for restoring the stored
図7の処理ではまずS300でCPU20は、保存データ25のなかの復元する情報(上述の1組の情報)を指定する。次にS310でCPU20は、S20で指定された情報の保存データ25内における記憶開始場所(開始バイト位置と、そのなかの開始ビット位置)の情報を取得する。
In the process of FIG. 7, first, in S300, the
次にS320でCPU20は、S310で取得された位置から記憶ビットサイズ分の2進数を取得する。そしてS330でCPU20は、取得した2進数に指数が割り振られている否かを判定する。指数が割り振られている場合(S330:YES)はS340に進み、指数が割り振られていない場合(S330:NO)はS350に進む。
Next, in S320, the
S340に進んだらCPU20は、取得したデータの指数から元データを復元する。具体的には例えば図10から図12に示されたような、データと2進数の関係からデータ(元データ)を復元する。S350に進んだ場合、CPU20は元データを0とする。続いてS360でCPU20は、元データをRAM21に戻す。
After proceeding to S340, the
そしてS370でCPU20は、復元するデータのうちで復元していない記憶ビットサイズ分の2進数がまだあるか否かを判定する。復元していない2進数データがまだある場合(S370:YES)は、S320に戻って上記処理を繰り返す。復元していない2進数データがもうない場合(S370:NO)は、S390に進む。
In S370, the
S390に進んだらCPU20は、不揮発性メモリ22内の保存データ25のなかに復元されていない情報(上述の1組の情報)がまだあるか否かを判定する。復元されていない情報がまだある場合(S390:YES)はS300に戻って上記処理を繰り返す。保存データ25がすべて復元された場合(S390:NO)は図7の処理を終了する。
After proceeding to S390, the
以上が図7の処理手順である。図7の処理では、予めエンジニア(プログラマ)が保存プログラム24内に、設定された記憶ビットサイズを記述しておき、それにしたがって不揮発性メモリ22に2進数として記憶された各データがRAM21に復元される。したがって予め記憶ビットサイズが設定されており、相対的に簡略化された処理となる。
The above is the processing procedure of FIG. In the processing of FIG. 7, an engineer (programmer) describes the set storage bit size in advance in the
次に図8を説明する。図8には記憶ビット数とデータ記憶位置を圧縮時に算出するタイプの、不揮発性メモリ22への圧縮保存処理の手順が示されている。図8の処理手順は、図6の処理手順においてS125およびS211、S212を付加したものである。以下で図6と異なる部分を説明する。
Next, FIG. 8 will be described. FIG. 8 shows the procedure of compression storage processing in the
図8のS125では、CPU20は指数の最大値(最大数)から記憶ビットサイズを算出する。この算出処理は、図5(におけるS41からS44)によって実行すればよい。
In S125 of FIG. 8, the
図8のS211、S212では、保存データ中における種類の異なる情報(図1の例では例えばスタック231と設定値関数232aと設定値関数232bとが種類の異なる情報である)の間に、間であることを示すしるしのビットデータを挿入するための処理を実行する。要するに保存プログラム24は、不揮発性メモリに記憶する情報において、1組の前記複数のオブジェクトと別の組の複数のオブジェクトの間に、間であることを示すビットデータを挿入する挿入ステップを備える。具体的には、まずS211でCPU20は、保存データをしるしのビットサイズ分左にシフトする。次にS212でCPU20は、しるしのビットデータを左シフトで右側に空いたビットに代入する。しるしのビットデータは具体的には、例えばビットサイズの桁数での最大値や、ビットサイズの桁数でゼロなどとすればよい。
In S211 and S212 of FIG. 8, between different types of information in the stored data (in the example of FIG. 1, for example, the
以上が図8の図6からの変更部分である。図8の処理では、不揮発性メモリ22に保存データ25を記憶する際に、記憶する情報(1組の情報)ごとにそのつど記憶ビット数を算出して、その記憶ビット数の2進数を記憶していくとともに、保存データ25内のある1組の情報と別の1組の情報の間にしるしを格納して、情報の区切りを明確化する。したがって車両1において各種システム変更を行っても保存プログラム24を書き換える必要はなく、システム変更に柔軟に対応して、最適な記憶ビット数を自動的に算出する。
The above is the change from FIG. 6 in FIG. In the process of FIG. 8, when storing the saved
次に図9を説明する。図9には、記憶ビット数とデータ記憶位置を圧縮時に算出するタイプの、不揮発性メモリ22からRAM21への復元処理の手順が示されている。図9の処理手順は、図7の処理手順においてS315を付加し、S370をS325に変更したものである。以下で図7と異なる部分を説明する。
Next, FIG. 9 will be described. FIG. 9 shows the procedure of the restoration process from the
図9のS315では、CPU20は指数の最大値(最大数)から記憶ビットサイズを算出する。この算出処理は、図5(におけるS41からS44)によって実行すればよい。
In S315 of FIG. 9, the
図9のS325は、S320の次に処理され、取得したデータがしるしであるか否かを判定する。取得したデータがしるしである場合(S325:YES)はS390に進み、取得したデータがしるしでない場合(S325:NO)はS330に進む。 S325 in FIG. 9 is processed next to S320, and it is determined whether or not the acquired data is an indication. If the acquired data is a sign (S325: YES), the process proceeds to S390, and if the acquired data is not a sign (S325: NO), the process proceeds to S330.
以上のとおり、図9の処理では、保存された情報の記憶ビットサイズの情報は用いず、異なった情報間の区切りとしてしるしを用いて、しるしを取得したら1つの情報の復元が終了したと認識する。したがって図8と同様、車両1において各種システム変更を行っても保存プログラム24を書き換える必要はなく、システム変更に柔軟に対応して、最適な記憶ビット数が自動的に算出されて、それに応じて復元処理が実行される。以上の場合、保存プログラム24は、図5、図8、図9を組み合わせて作成すればよい。
As described above, in the process of FIG. 9, the storage bit size information of the stored information is not used, but when the indicia is acquired as a delimiter between different pieces of information, it is recognized that the restoration of one information is completed. To do. Therefore, as in FIG. 8, it is not necessary to rewrite the
図14には、図10の2進数表現を用いて図3のスタックを保存した保存データ25の例が示されている。図3のスタック231の格納状態は、順に機能A、機能D、機能C、空、なので、図12に示されているように、順に「001」、「100」、「011」、「000」を記憶する。図12の例では空を「000」としているが、図10に示された2進数以外ならばよい。
FIG. 14 shows an example of saved
図15には、従来技術における図3のスタックの場合の保存データ25の例が示されている。従来技術では、図3のスタック231を記憶する場合、機能A、機能D、機能Cのポインタ(オブジェクト指向のプログラム言語においてオブジェクトのメモリ内のアドレスを示す変数)を保存データとするが、通常ポインタは4バイトの情報なので、図15のとおり、図3のスタックの状態の記憶のために合計16バイト必要となる。これに対して本発明の図14の例では、図3のスタックの状態の記憶のために合計12ビットしか使用しておらず、情報量が約10分の1となっている。したがって不揮発性メモリ22の小容量化や、保存処理の処理負荷、処理時間の低減が実現できる。
FIG. 15 shows an example of saved
なお保存データ25は図14ではなく図13のようにしてもよい。図13の例では、スタック231に格納された機能A、機能D、機能C、空、の指数を保存データ25内に順に記憶している(なおここでは空の指数を0としている)。通常、指数である整数値は1バイトの情報なので、図13の例では合計4バイト使用される。したがって図15の従来技術よりは情報量が4分の1に低減でき、不揮発性メモリ22を小容量化できる。(なお図13との比較においても図14は不揮発性メモリ22に記憶する情報量が低減される。すなわち図14における記憶ビット数の2進数の情報量はオブジェクトに割り振った指数(整数値)の情報量よりも小さい。要するに、この場合2進数の情報量はオブジェクトに番号付けられた整数値の情報量よりも小さい。)
The stored
発明者の知見によれば、各種の車載装置3に対して、上述の指数の最大数は大半は7以下、8から15は1割もなく、16から30はほとんどない。記憶ビット数で言えば、大半が3ビットであり、4ビットは1割もなく、5ビットはほとんどない。したがって本発明の手法で最小ビット数の2進数に圧縮した場合、良好な圧縮率が達成できる。
According to the inventor's knowledge, the maximum number of the above-mentioned indexes is almost 7 or less, 8 to 15 is not 10%, and 16 to 30 is hardly found for various on-
上記実施例では、制御プログラム23、保存プログラム24をオブジェクト指向のプログラム言語で記述されたプログラムとしたが、本発明はこうした実施形態に限定されない。本発明では、車両に装備された電子制御装置が有する揮発性メモリに記憶された、車両の車載機器の制御状態を示す複数のデータのそれぞれに対して異なった2進数を割り当て、その2進数のビット数は全てのデータに異なった2進数値を割り当てられる最小のビット数とする割り当てステップと、車両の駆動部の停止時に、車両に備えられた不揮発性メモリに、割り当てステップで求められた2進数値を記憶する記憶ステップと、を車両に装備されたコンピュータに実行させることを特徴とする。
In the above embodiment, the
当然オブジェクト指向のプログラム言語でない場合でも、上記のように図11、図12に示された設定温度や吸込口状態に対応する2進数表現をイグニッションオフ時に不揮発性メモリ22に記憶すればよい。またプログラム内で図10に示された各機能がオブジェクトとして記述されていない場合でも、イグニッションオフ時にスタック231の状態を記憶する際に、上記のようにスタック内の各機能の2進数表現を不揮発性メモリ22に記憶すればよい。
Naturally, even if it is not an object-oriented programming language, the binary expression corresponding to the set temperature and the suction port state shown in FIGS. 11 and 12 may be stored in the
1 車両
2 ECU(電子制御装置)
3 車載装置(車載機器)
21 RAM(揮発性メモリ)
22 不揮発性メモリ
23 制御プログラム
24 保存プログラム
25 保存データ
1
3 On-vehicle equipment (on-vehicle equipment)
21 RAM (volatile memory)
22
Claims (6)
前記車両の駆動部の停止時に、前記車両に備えられた不揮発性メモリに、前記割り当てステップで求められた2進数値を記憶する記憶ステップと、
を車両に装備されたコンピュータに実行させることを特徴とするプログラム。 A different binary number is assigned to each of a plurality of data stored in a volatile memory of an electronic control device installed in the vehicle and indicating the control state of the in-vehicle device of the vehicle, and the number of bits of the binary number is Assigning a minimum number of bits that can be assigned a different binary value to all the data to be stored in the non-volatile memory;
A storage step of storing the binary value obtained in the assigning step in a non-volatile memory provided in the vehicle when the driving unit of the vehicle is stopped;
Is executed by a computer installed in the vehicle.
前記制御状態を示すデータは、そのプログラムにおけるオブジェクトである請求項1乃至4のいずれか1項に記載のプログラム。 A program written in an object-oriented programming language
The program according to any one of claims 1 to 4, wherein the data indicating the control state is an object in the program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011105305A JP5585941B2 (en) | 2011-05-10 | 2011-05-10 | program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2011105305A JP5585941B2 (en) | 2011-05-10 | 2011-05-10 | program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2012236451A true JP2012236451A (en) | 2012-12-06 |
JP5585941B2 JP5585941B2 (en) | 2014-09-10 |
Family
ID=47459782
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2011105305A Expired - Fee Related JP5585941B2 (en) | 2011-05-10 | 2011-05-10 | program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5585941B2 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20140102962A (en) * | 2013-02-15 | 2014-08-25 | 콘티넨탈 오토모티브 시스템 주식회사 | Method for saving data when opening ignition key |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006193017A (en) * | 2005-01-12 | 2006-07-27 | Nissan Motor Co Ltd | Vehicle information recording device and vehicle information recording method |
JP2009227248A (en) * | 2008-03-25 | 2009-10-08 | Aisin Aw Co Ltd | Method of writing control data into on-vehicle control device, and on-vehicle control device |
-
2011
- 2011-05-10 JP JP2011105305A patent/JP5585941B2/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2006193017A (en) * | 2005-01-12 | 2006-07-27 | Nissan Motor Co Ltd | Vehicle information recording device and vehicle information recording method |
JP2009227248A (en) * | 2008-03-25 | 2009-10-08 | Aisin Aw Co Ltd | Method of writing control data into on-vehicle control device, and on-vehicle control device |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR20140102962A (en) * | 2013-02-15 | 2014-08-25 | 콘티넨탈 오토모티브 시스템 주식회사 | Method for saving data when opening ignition key |
Also Published As
Publication number | Publication date |
---|---|
JP5585941B2 (en) | 2014-09-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3252605B1 (en) | Vehicle-mounted control device, program writing device, program generating device and program | |
US20140108704A1 (en) | Data decompression method for a controller equipped with limited ram | |
EP2630573A2 (en) | Methods and devices for reducing compressed page loading time on page fault | |
CN107092560B (en) | Solid-state storage device and flash translation layer mapping table rebuilding method applied to same | |
US20090144512A1 (en) | Memory access control device, control method, and program | |
JP4629750B2 (en) | Embedded control unit | |
CN106990983B (en) | Singlechip programming method, device and system and singlechip | |
JP5585941B2 (en) | program | |
CN110597644B (en) | Data stream transmission method, transmission device, electronic equipment and storage medium | |
CN104035725A (en) | Electronic apparatus for data access and data access method therefor | |
CN107912063A (en) | A kind of method for recovering internal storage and device | |
CN113497627A (en) | Data compression and decompression method, device and system | |
CN116486510A (en) | Fault information processing method, device, computer equipment and storage medium | |
CN114020333B (en) | CUDA multithreading processing method, system and related equipment | |
US7676651B2 (en) | Micro controller for decompressing and compressing variable length codes via a compressed code dictionary | |
JP2010020416A (en) | Data transfer method and data transfer unit | |
JP2011158967A (en) | Electronic control device | |
CN114003309A (en) | Software module loading method and device based on microprocessor | |
CN115037570B (en) | Charging and discharging travel event status code and event number uploading method and system, computer readable storage medium and electronic equipment | |
CN112583415B (en) | Data compression storage method and system for ink cartridge chip | |
KR20120017686A (en) | Method for upgrading and recovering operating system of audio/video navigation system for automobile | |
CN113625953B (en) | Data processing method, device, equipment and storage medium | |
US6760834B2 (en) | Microprocessor for saving contextual data when switching to a test program | |
CN110651253A (en) | Memory management system, information processing apparatus, and memory management method | |
JP2008226082A (en) | Data compression/decompression device, program for making computer execute, and data compression/decompression method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20121017 |
|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20131114 |
|
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: 20140630 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5585941 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20140713 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |