JP2004210183A - In-vehicle program rewrite control device - Google Patents

In-vehicle program rewrite control device Download PDF

Info

Publication number
JP2004210183A
JP2004210183A JP2003001214A JP2003001214A JP2004210183A JP 2004210183 A JP2004210183 A JP 2004210183A JP 2003001214 A JP2003001214 A JP 2003001214A JP 2003001214 A JP2003001214 A JP 2003001214A JP 2004210183 A JP2004210183 A JP 2004210183A
Authority
JP
Japan
Prior art keywords
program
vehicle
rewriting
storage area
new
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
JP2003001214A
Other languages
Japanese (ja)
Inventor
Toshihiko Kanda
俊彦 神田
Yoshihiko Nakakawaji
良彦 中川路
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.)
Komatsu Ltd
Original Assignee
Komatsu Ltd
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 Komatsu Ltd filed Critical Komatsu Ltd
Priority to JP2003001214A priority Critical patent/JP2004210183A/en
Publication of JP2004210183A publication Critical patent/JP2004210183A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)
  • Retry When Errors Occur (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an in-vehicle program rewrite control device capable of reliably completing rewrite even if a voltage to normally operate an in-vehicle controller is not supplied from a battery in a vehicle body. <P>SOLUTION: A reset timing determination program 61a stored in a head storage area 22a of a flash memory 22 starts when getting into a reset state. Therefore, a CPU 21 determines that rewrite processing (A) is completed if a rewrite processing flag 23a is in a cleared state according to the reset timing determination program 61a, and performs the processing according to a new in-vehicle program 60 transferred to an in-vehicle program storage area 22b of the flash memory 22. However, if the rewrite processing flag 23a is set when getting into the reset condition, the CPU determines that the rewrite processing is not completed, and a rewrite control program 61b is re-executed. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は車載プログラムを書き換える制御を行う装置に関するものである。
【0002】
【従来の技術】
近年開発されている建設機械には、車体の現在位置、サービスメータの計時値などの車両状態の情報を収集するコントローラなどの各種コントローラが搭載されている。こうした車載コントローラ内には、CPUが設けられており、フラッシュメモリなどのEEPROM(電気的に消去可能なROM)に記憶された車載プログラムにしたがい演算処理を実行し車両状態情報の収集、外部との送受信等の処理を行う。たとえば車載のコントローラと外部のサーバとはインターネット等の通信手段を介して通信自在に接続されており、車載コントローラで収集された車両状態情報がサーバに送信される。あるいはサービスマンが建設機械まで出向き車載コントローラにパーソナルコンピュータを接続して車両状態情報をパーソナルコンピュータに取り込む。
【0003】
車載プログラムをバージョンアップした場合や車両ごとに異常判断のためのしきい値等を変更したい場合には、上記フラッシュメモリに記憶された旧い車載プログラムを新しい車載プログラムに書き換える必要がある。
【0004】
(従来技術1)
特許文献1(特開平7−162547号公報)には、通信端末装置のプログラムの変更をセンタ装置からの要求に応じて行うという遠隔プログラム書き換え方式の発明が記載されている。すなわち通信端末装置には、書き換え制御プログラムが記憶された電気的な消去不可能なROMと、メインプログラムが記憶された電気的に消去可能なフラッシュROMと、RAMとが設けられ、センタ装置から送られてくるキーデータを通信端末装置で受けることを条件としてフラッシュROMのメインプログラムを消去することで誤書き換えを防止するようにしている。キーデータはキー回路で解析され書き込み禁止、許可が判断される。センタ装置から新しいメインプログラムが送られてくると、ROM上の書き換え制御プログラムが起動し、書き換え処理が開始され、新しいメインプログラムが一旦RAMに格納される。そして、その後RAMからフラッシュROMに新しいメインプログラムが転写され、新しいメインプログラムにシステム制御権が移される。
【0005】
(従来技術2)
特許文献2(特開平10−212739号公報)には、建設機械に関し、その稼動データ収集用のコントローラを設けるとともに、遠隔地に監視装置を設けて、これら稼動データ収集用コントローラと監視装置とを通信装置によって接続して、監視装置からの要求に応じて稼動データ収集用コントローラ内の稼動データ処理プログラムを書き換えるという発明が記載されている。すなわち稼動データ収集用コントローラには、書き換え制御プログラムが記憶された電気的な消去不可能なROMと、稼動データ処理プログラムが記憶された電気的に消去可能なROM(EEPROM)と、RAMとが設けられ、監視装置と稼動データ収集用コントローラとの間で、「書き換え要求」、「書き換え許可」、「書き換え開始」、「書き換え禁止」、「書き換え終了」の各コマンドを送受信して、EEPROMを書き込み可、不可の状態にして誤書き換えを防止するようにしている。上記各コマンドに応じてEEPROMを書き込み可、不可の状態にするためにCPUとEEPROMとの間にラッチ回路、ゲート回路が設けられる。EEPROMが書き込み可な状態では、監視装置から新しい稼動データ処理プログラムが送られてくると、ROM上の書き換え制御プログラムが起動し、書き換え処理が開始され、新しい稼動データ処理プログラムが一旦RAMに格納される。そして、その後RAMからEEPROMに新しい稼動データ処理プログラムが転写され、新しい稼動データ処理プログラムにシステム制御権が移される。
【0006】
【発明が解決しようとする課題】
建設機械などの車両では、スタータ装置等の電源と、上述した車載コントローラの電源とが共通になっている。このためエンジン始動時にスタータ装置を作動させると、共通の電源であるバッテリの端子電圧は車載コントローラ(CPU)の動作電圧よりも一時的に低下することがある。また、その他の原因によってもバッテリから車載コントローラ(CPU)にこれを正常に動作させる電圧が印加されないときがある。このようなときに車載プログラムの書き換え処理中であれば書き換えが正常に完了しないままリセット状態になってしまうおそれがある。
【0007】
ところが上述した従来技術1、従来技術2は共に電源が正常であることを想定しており、電源低下によって書き換えが正常に完了しないままリセット状態になった場合の対処については何ら記載されていない。
【0008】
また上記従来技術1にあっては、書き換えを行うために記憶媒体として2つのROMと1つのRAMを必要とする。また誤書き換えを防止するためにキー回路を必要とする。同様に従来技術2についても、書き換えを行うために記憶媒体として2つのROMと1つのRAMを必要とし、誤書き換えを防止するためにラッチ回路、ゲート回路を必要とする。
【0009】
こうした記憶媒体や誤書き換え防止用の回路の増加は、車体内で大きな場積をとり、コストを上昇させる要因となる。
【0010】
本発明はこうした実状に鑑みてなされたものであり、車体内のバッテリから車載コントローラを正常に動作させる電圧が供給されないような状況になったとしても、その後確実に書き換えを完了できるようにすることを解決課題とするものである。
【0011】
【課題を解決するための手段および作用、効果】
第1発明は、
CPU(21)と、
書き込みおよび読み出しが可能な第1の記憶媒体(22)と、
書き込みおよび読み出しが可能な第2の記憶媒体(23)とが、
車載コントローラ(20)に備えられている車載プログラムの書き換え制御装置であって、
第1の記憶媒体(22)には、
車載プログラム記憶領域(22b)に、車載プログラム(60)が記憶され、その他の領域に、車載プログラムを書き換える書き換え制御プログラム(61b)と、
リセット(再始動)時判断プログラム(61a)が記憶され、
第2の記憶媒体(23)には、
新しい車載プログラム(60)を一時記憶する、新車載プログラム一時記憶領域(23a)と、
車載プログラムを書き換えて実行中であることを示す書き換え実行中フラグ(23c)を記憶させる実行中フラグ記憶領域が設けられており、
書き換え制御プログラム(61b)は、
外部から新しい車載プログラム(60)に書き換える指令を受けたとき、
新しい車載プログラム(60)を、新車載プログラム一時記憶領域(23a)へ一時記憶させ、
書き換え実行中フラグ(23c)を、実行中フラグ記憶領域へ記憶させる第1の機能と、
新車載プログラム一時記憶領域(23a)に記憶されている新車載プログラムを、第1の記憶媒体(22)に記憶されている車載プログラム上に転写する(書き換える)第2の機能と、
書き換え終了時、
書き換え実行中フラグ(23c)を、実行中フラグ記憶領域から消去する第3の機能と、
リセット(再始動)後、
リセット(再始動)時判断プログラム61aを起動する第4の機能をもち、
リセット(再始動)時判断プログラム61aは、
実行中フラグ記憶領域に、書き換え実行中フラグ(23c)があるか否かの判断をする第5の機能と、
書き換え実行中フラグ(23c)がない場合には、書き換え処理が完了したと判断して、第1の記憶媒体(22)の車載プログラム記憶領域(22b)に記憶されている車載プログラム(60)を実行させる第6の機能と、
書き換え実行中フラグ(23c)がある場合には、書き換え処理が完了していないと判断して、書き換え制御プログラム(61b)を実行させる第7の機能をもつこと
を特徴とする。
【0012】
第2発明は、第1発明において、
車両(50)の外部には、車両(50)内の車載コントローラ(20)と通信手段(15、8、9、10、11)によって通信自在に接続されているサーバ(3)を設け、
前記サーバ(3)は、前記通信手段(15、8、9、10、11)を介して、前記車載コントローラ(20)に、新しい車載プログラム(60)を書き換える指令を与える機能をもつこと
を特徴とする。
【0013】
第1発明、第2発明によれば、図2、図3、図4に示すように、外部から新しい車載プログラム60に書き換える指令が与えられると、CPU21は、書き換え制御プログラム61bにしたがい、第2の記憶媒体であるRAM23上の所定領域23aに新しい車載プログラム60を一旦保持させるバッファ処理を行う(図2(a)、図3のステップ101)。そして第1の記憶媒体であるフラッシュメモリ23の先頭記憶領域22aにリセット時判断プログラム61aを残したままRAM23上に一旦保持された新しい車載プログラム60をフラッシュメモリ22上の車載プログラム記憶領域22bに転写(コピー)させる書き換え処理(A)を実行する(図2(d)、図3のステップ106)。
【0014】
当該書き換え処理(A)の実行中は、書き換え実行中であることを示す書き換え実行中フラグ23aがRAM23上の所定領域に設定されている(図2(b)、図3のステップ102)。
【0015】
書き換え処理(A)が終了すると書き換え実行中フラグ23aをクリア状態にするとともに(図2(e)、図3のステップ107)、リセット状態にする(図2(f)、図3のステップ108)。
【0016】
リセット状態になった時点で、フラッシュメモリ22の先頭記憶領域22aに記憶されているリセット時判断プログラム61aが起動する。
【0017】
このためCPU21は当該リセット時判断プログラム61aにしたがい、書き換え実行中フラグ23aがクリア状態になっている場合には、書き換え処理(A)が完了したと判断して、フラッシュメモリ22の車載プログラム記憶領域22bに転写された新しい車載プログラム60にしたがい処理を実行する(図2(f)、図3のステップ109)。
【0018】
しかしリセット状態になった時点で、書き換え実行中フラグ23aが設定されている場合には、書き換え処理が完了していないと判断して、書き換え制御プログラム61bを再度実行する(図4のステップ201、202〜205)。
【0019】
このため本発明によれば、車体内のバッテリ53から車載コントローラ20を正常に動作させる電圧が供給されないような状況になったとしても、その後確実に書き換えを完了できるようにすることができる。
【0020】
しかも記憶媒体としてはフラッシュメモリ(第1の記憶媒体)22とRAM(第2の記憶媒体)23だけで済むので、車体内での場積が嵩むことがなく、またコストを低減させることができる。
【0021】
第1発明、第2の発明のうち第2発明は、特にサーバ3からの要求に応じて建設機械50内の車載プログラム60を通信手段を介してリモートで書き換える場合に適用される。
【0022】
【発明の実施の形態】
図1は実施形態の全体の装置構成を示している。なお以下の実施形態では車両として建設機械50を想定し、この建設機械50内の車載プログラム60を書き換え専用サーバ3からの要求に応じてリモートで書き換える場合を想定する。
【0023】
本実施形態のシステムでは、建設機械50が通常運用サーバ2、書き換え専用サーバ3とにそれぞれ通信手段(無線通信11、アンテナ10、専用線9、地上波基地局8、専用線14、15)より相互に送受信自在に接続されている。
【0024】
通常運用サーバ2は、イントラネット4の中に位置し、インターネット7に接続している。これにより通常運用サーバ2は、インターネット7、イントラネット4の各クライアント端末のサーバとして機能する。この通常運用サーバ2には、ネットワーク中の自己を識別するID(サーバ識別ID)であるIPアドレス「ID1」が付与されている。建設機械50には通常運用サーバ2と通信可能な後述する通信端末(通信コントローラ30)が搭載されており、この通信端末にはサーバ識別ID「ID1」に対応するIPアドレス「ID3」が付与されている。
【0025】
書き換え専用サーバ3は、イントラネット5の中に位置し、インターネット7に接続している。これにより書き換え専用サーバ3は、インターネット7、イントラネット5の各クライアント端末のサーバとして機能する。この書き換え専用サーバ3には、ネットワーク中の自己を識別するID(サーバ識別ID)であるIPアドレス「ID2」が付与されている。建設機械50には書き換え専用サーバ3と通信可能な通信端末(通信コントローラ30)が搭載されており、この通信端末にはサーバ識別ID「ID2」に対応するIPアドレス「ID4」が付与されている。
【0026】
建設機械50の車体内には、パケットデータ通信用の無線機を内蔵した通信コントローラ30が設けられている。通信コントローラ30のアンテナ31と地上波用のアンテナ10との間でパケット通信による無線通信11が行われる。アンテナ10は専用線9を介して地上波基地局8に接続している。地上波基地局8は、たとえば携帯電話基地局である。地上波基地局8は、専用線14、15を介してイントラネット4、5にそれぞれ接続している。
【0027】
建設機械50の車体内には、通信コントローラ30以外に情報収集コントローラ20、エンジンコントローラ40等の各コントローラが設けられており、これら各コントローラは、所定の通信プロトコルにしたがって通信が行われる車体内通信回線51によって相互に通信可能に接続されている。
【0028】
建設機械50の車体の各部には、エンジン57の冷却水、バッテリ53の電圧、GPSセンサなどが配設されており、これら各センサはセンサ群52を構成している。なおGPSセンサはGPS衛星から送信される電波を受信して、自己の建設機械50の絶対位置を検出する。また建設機械50の車体内には、カレンダ、タイマが設けられている。カレンダ、タイマは、年、月、日、時刻(時、分、秒)を計時する。また建設機械50の車体内にはサービスメータSMRが設けられている。サービスメータSMRはエンジン57の稼動時間を計時する。
【0029】
情報収集コントローラ20内では、バス線24を介して、CPU21とフラッシュメモリ22とRAM(随時書き込み読み出しメモり)23とが相互にデータの入出力が自在に接続されている。なおフラッシュメモリ22は、EEPROM(電気的に消去可能なROM)の一種である。またRAM23の代わりにフラッシュメモリなどのEEPROMを用いてもよい。フラッシュメモリ22の所定記憶領域には、後述するように、サービスメータSMRの計時値、センサ群52の各検出値、カレンダ、タイマの計時値を取り込んで、当該建設機械50が異常か否かの判断をしたり、設定された始動ロック時間帯になると始動ロック設定指令を出力して後述する始動ロックを行い始動ロック時間帯外の時間になると始動ロック解除指令を出力する等の処理を行う車載プログラム60が記憶されている。またフラッシュメモリ22の先頭の記憶領域には、後述するようにリセット時判断プログラム61aと書き換え制御プログラム61bとからなる先頭プログラム61が記憶されている。RAM23の所定記憶領域には、以下のような車両状態データが記憶される。
【0030】
・自己のIPアドレス(ID3、ID4)
・建設機械50の機種、型式、機番などの建設機械50を特定する情報
・現在のサービスメータSMRの計時値などの情報収集コントローラ20で収集された情報あるいは収集された情報を加工した情報
・建設機械50で異常等のイベントが発生した場合にそのイベント内容を示す情報
・後述するように現在始動ロックが有効か無効であるか、現在設定されている始動ロックの時間帯などの始動ロック情報
上記車両状態データは車載プログラム60が動作するにしたがい生成される。
【0031】
バス線24は情報収集コントローラ20外のサービスメータSMR、センサ群52にインターフェースを介して接続しており、またバス線24はコントローラ20外の車体内通信回線51にインターフェースを介して接続している。
【0032】
なお本実施形態では、通信コントローラ30と情報収集コントローラ20とを別体としているが、これらを1つのコントローラで構成してもよい。
【0033】
建設機械50の車体内には、始動ロック回路55が組み込まれている。
【0034】
この始動ロック回路55はリレー等で構成されキースイッチ54と、エンジン57を始動するスタータ56との間に介在されている。スタータ56の電源は車載のバッテリ53であり、このバッテリ53は各コントローラ20、30、40の電源でもある。
【0035】
始動ロック設定指令がエンジンコントローラ40から出力されると、始動ロック回路55のリレーが付勢されて始動ロック設定状態になる。すなわちキースイッチ54がオン(ACC位置)されたとしても、バッテリ53の端子電圧がスタータ56には印加されなくなる。これによりスタータ56が作動不能の状態となりエンジン57を始動することができなくなる。これに対してエンジンコントローラ40から始動ロック解除指令が出力されると始動ロック回路55のリレーが消勢されて始動ロック解除状態になる。すなわちキースイッチ54をオン(ACC位置)にすることによってスタータ56が作動してエンジン57を始動することができる。上記始動ロック設定指令、始動ロック解除指令は、車載プログラム60にしたがい情報収集コントローラ20から車体内通信回線51を介してエンジンコントローラ40に与えられる。始動ロック設定指令、始動ロック解除指令は、現在始動ロックが「有効」と設定されている場合に、情報収集コントローラ20から出力される。なお始動ロック時間帯に入ったか否かは情報収集コントローラ20内のカレンダ、タイマの計時値に基づき判断される。
【0036】
またキースイッチ54がオンされた(ACC位置にある)という情報は、エンジンコントローラ40から車体内通信回線51を介して情報収集コントローラ20内に取り込まれる。
【0037】
通常運用サーバ2は、建設機械50を含む複数の建設機械内の車両状態データを管理している。
【0038】
書き換え専用サーバ3は、車載プログラム60の書き換えをリモートで行うサーバである。
【0039】
通常運用サーバ2は、マスターファイル6を備えている。通常運用サーバ2に取り込まれた最新の車両状態データはマスターファイル6に格納される。
【0040】
一方、書き換え専用サーバ3は、マスターファイル6′を備えている。通常運用サーバ2内のマスターファイル6の記憶データは、インターネット7を介して書き換え専用サーバ3内に取り込まれ、マスターファイル6と同記憶内容つまり「レプリカ」としてのマスターファイル6′が作成される。
【0041】
通常運用サーバ2から建設機械50の車両状態データを要求する指令が、専用線14、地上波基地局8、専用線9、アンテナ10を介して無線通信11として建設機械50に送信されると、建設機械50のアンテナ31で受信され、このデータは通信コントローラ30に取り込まれる。通常運用サーバ2から送信されるデータ中には、サーバ識別ID「ID1」を含んでいる。通信コントローラ30ではIPアドレス「ID3」が設定されており、受信したデータではサーバ識別ID「ID1」が含まれているので、両者は対応している(「ID1」、「ID3」は同一ネットワークである)と判断して、通信接続を確立し、建設機械50側から車両状態データの送信が可能な状態にする。
【0042】
このため車両状態データを要求する指令が通信コントローラ30から車体内通信回線51を介して情報収集コントローラ20内に取り込まれる。たとえば現在のサービスメータSMRの計時値を要求する指令が情報収集コントローラ20内に取り込まれると、RAM23に記憶されている現在のサービスメータSMRの計時値が情報収集コントローラ20から車体通信回線51を介して通信コントローラ30内に取り込まれ、通信コントローラ30のアンテナ31から無線通信11として送信され、アンテナ10、専用線9、地上波基地局8、専用線14を介して通常運用サーバ2に取り込まれる。
【0043】
また始動ロックの有効、無効、始動ロック時間帯を設定する指令が通常運用サーバ2から建設機械50に送信された場合についても同様な経路で、情報収集コントローラ20に、その指令された内容が設定される。
【0044】
なお通常運用サーバ2の各クライアント端末から通常運用サーバ2を介して建設機械50に対して同様な指令を与えるようにしてもよい。
【0045】
また建設機械50で特定の異常が発生したり、特定の時刻になるなど特定のイベントが発生した場合には、そのイベント発生時点でRAM23に記憶されている異常内容や定期的に送信すべき車両状態データなどが情報収集コントローラ20から車体通信回線51を介して通信コントローラ30内に取り込まれ、通信コントローラ30のアンテナ31から無線通信11として送信される(自動発信)。自動発信されたデータは、アンテナ10、専用線9、地上波基地局8、専用線14を介して通常運用サーバ2に取り込まれる。
【0046】
通常運用サーバ2に取り込まれた建設機械50の車両状態データは、通常運用サーバ2に属するネットワーク、つまりインターネット7、イントラネット4に接続されている各クライアント端末から通常運用サーバ2にアクセスすることにより各クライアント端末の表示画面に表示される。
【0047】
通常運用サーバ2に取り込まれた最新の車両状態データはマスターファイル6に格納されるとともに、インターネット7を介してマスターファイル6′に格納される。
【0048】
車載プログラム60をバージョンアップした場合や建設機械ごとにエラーコード生成や異常判断のためのしきい値等を変更したい場合には、上記フラッシュメモリ22に記憶されている旧い車載プログラム60′が新しい車載プログラム60に書き換えられる。
【0049】
書き換え専用サーバ3から建設機械50の車載プログラム60を書き換える指令が専用線15、地上波基地局8、専用線9、アンテナ10を介して無線通信11として建設機械50に送信されると、建設機械50のアンテナ31で受信され、このデータは通信コントローラ30内に取り込まれる。
【0050】
書き換え専用サーバ3から送信されるデータ中には、サーバ識別ID「ID2」を含んでいる。通信コントローラ30では現在IPアドレス「ID3」が設定されており、受信したデータにはサーバ識別ID「ID2」が含まれているので、両者は対応していない(「ID2」、「ID3」であり同一のネットワークではない)と判断して、通信接続を切断する。
【0051】
識別IDが不一致により通信接続が切断されたという情報は通信コントローラ30から車体内通信回線51を介して情報収集コントローラ20内に取り込まれる。これを受けて情報収集コントローラ20では、書き換え専用サーバ3のサーバ識別ID「ID2」に対応する自己のIPアドレス「ID4」が「有効」に切り換えられ、通常運用サーバ2のサーバ識別ID「ID1」に対応する自己のIPアドレス「ID3」が「無効」に切り換えられる(書き換えモード)。情報収集コントローラ20で「有効」と設定された自己のIPアドレスのデータ「ID4」は、情報収集コントローラ20から車体内通信回線51を介して通信コントローラ30内に取り込まれる。
【0052】
書き換え専用サーバ3は、通信接続が切断されたことを受けて書き換え指令を建設機械50に対して再度送信する。書き換え専用サーバ3から送信されるデータ中には、サーバ識別ID「ID2」を含んでいる。通信コントローラ30では現在IPアドレス「ID4」が設定されており、受信したデータにはサーバ識別ID「ID2」が含まれているので、両者は対応している(「ID2」、「ID4」であり同一ネットワークである)と判断して、通信接続を確立する。
【0053】
以後、書き換え専用サーバ3からの指令に応じて情報収集コントローラ20で車載プログラム60を書き換える処理が行われる。
【0054】
つぎに図2、図3、図4を参照して車載プログラム60を書き換える処理について説明する。図2(a)〜(f)はフラッシュメモリ22、RAM23の状態の遷移を示す図で、図3は正常時の書き換え処理の手順を示すフローチャートで、図4は書き換え中にリセットが発生した場合の書き換え処理の手順を示すフローチャートである。なお以下の説明では旧い車載プログラム60にダッシュを付与して新しい車載プログラム60と区別する。
【0055】
図2(f)に示すように、フラッシュメモリ22の先頭の記憶領域、つまりリセット時に最初に実行される記憶領域22aには、先頭プログラム61が記憶されている。先頭プログラム61は前述したようにリセット時判断プログラム61aと書き換え制御プログラム61bとからなる。リセット時判断プログラム61aは後述する書き換え実行中フラグ23cの状態に応じて書き換え処理が完了しているか否かを判断し、その判断結果に応じてつぎの処理を選択するプログラムである。書き換え制御プログラム61bは、旧い車載プログラム60′を新しい車載プログラム60に書き換える処理を行うプログラムである。フラッシュメモリ22の先頭記憶領域22aに続く所定の記憶領域22bには旧い車載プログラム60′が記憶されている。
【0056】
書き換え専用サーバ3から建設機械50の車載プログラム60を書き換える指令が新しい車載プログラム60とともに、専用線15、地上波基地局8、専用線9、アンテナ10を介して無線通信11として建設機械50に送信されると、建設機械50のアンテナ31で受信され、このデータは通信コントローラ30から車体内通信回線51を介して情報収集コントローラ20内に取り込まれる。
【0057】
書き換え指令が情報収集コントローラ20内に取り込まれると、フラッシュメモリ22上の書き換え制御プログラム61bにしたがい処理がすすめられる。まず図2(a)に示すように、CPU21は受信した新しい車載プログラム60をRAM23の所定の記憶領域23aにバッファする(図3のステップ101)。つぎに図2(b)に示すように、CPU21はRAM23の所定の記憶領域に、書き換え処理が実行中であることを示す書き換え実行中フラグ23cを立てる処理を行う(図3のステップ102)。
【0058】
つぎに図2(c)に示すように、フラッシュメモリ22に記憶されている先頭プログラム61がRAM23の所定の記憶領域23bにコピー(転写)される(図3のステップ103)。これによりコピーされたRAM23上の先頭プログラム61にシステム制御権が移される(図3のステップ104)。
【0059】
これによりフラッシュメモリ22が書き込みモードとなり、RAM23上の書き込み制御プログラム61bにしたがい、フラッシュメモリ22上の旧い車載プログラム60′をRAM23上の新しい車載プログラム60によって書き換える書き換え処理(A)が開始される(図3のステップ105)。
【0060】
書き換え処理(A)が実行されると、図2(d)に示すようにRAM23の記憶領域23aにバッファされていた新しい車載プログラム60がフラッシュメモリ22の記憶領域22b、つまり旧い車載プログラム60′が記憶されている領域22bにコピー(転写)され、旧い車載プログラム60′が新しい車載プログラム60に書き換えられる。ただしフラッシュメモリ22の先頭記憶領域22aにある先頭プログラム61については書き換えられないまま残される(図3のステップ106)。
【0061】
書き換え処理(A)が正常に完了すると、図2(e)に示すように、書き換え実行中フラグ23cがクリアされる(図3のステップ107)。
【0062】
つぎにCPU21は自己リセット処理を行う。このためシステム制御権がフラッシュメモリ22に移され、フラッシュメモリ22の先頭記憶領域22aに記憶されている先頭プログラム61が起動される。この場合、先頭プログラム61の最初のプログラムであるリセット時判断プログラム61aが実行される(図3のステップ108)。
【0063】
リセット時判断プログラム61aはつぎの処理を行う。
【0064】
1)リセット時に書き換え実行中フラグ23cがクリア状態である場合には、フラッシュメモリ22を通常モードにして、フラッシュメモリ22の記憶領域22bに記憶されている新しい車載プログラム60を実行させる。
【0065】
2)リセット時に書き換え実行中フラグ23cが立っている状態である場合には、システム制御権をRAM23に移しフラッシュメモリ22を再度、書き込みモードにして、RAM23上の書き込み制御プログラム61bにしたがい、フラッシュメモリ22上の旧い車載プログラム60′をRAM23上の新しい車載プログラム60によって書き換える書き換え処理(A)を再度実行させる。
【0066】
正常に書き換え処理(A)が完了している場合には、リセット時に書き換え実行中フラグ23cがクリアされているので、上記1)の処理が実行される。これにより図2(f)に示すように、フラッシュメモリ22の記憶領域22bに記憶されている新しい車載プログラム60が起動され、サービスメータSMRの計時値を取り込む等の通常運用の処理が実行される(図3のステップ109)。
【0067】
図4は書き換え処理中(A)にリセットが発生した場合の書き換え処理の手順を示す。すなわちエンジン57の始動時にスタータ56を作動させると、バッテリ53の端子電圧がCPU21の動作電圧よりも一時的に低下することがある。またその他の原因によってもバッテリ53からCPU21にこれを正常に動作させる電圧が印加されないときがある。このようなときに書き換え処理(A)の実行中であれば書き換え処理(A)が正常に完了しないままリセット状態になってしまうことがある。
【0068】
図2(d)に示す書き換え処理(A)中にリセットが発生すると、フラッシュメモリ22の先頭記憶領域22aに記憶されている先頭プログラム61が起動される。この場合、先頭プログラム61の最初のプログラムであるリセット時判断プログラム61aが実行される(図4のステップ201)。
【0069】
書き換え処理(A)が正常に完了していない場合には、書き換え実行中フラグ23cがクリアされないまま立っている状態であるので、前述した2)の処理が実行される。すなわち、リセット時に書き換え実行中フラグ23cが立っている状態である場合には、システム制御権をRAM23に移しフラッシュメモリ22を再度、書き込みモードにして、RAM23上の書き込み制御プログラム61bにしたがい、フラッシュメモリ22上の旧い車載プログラム60′をRAM23上の新しい車載プログラム60によって書き換える書き換え処理(A)を再度実行させる(図4のステップ202)。
【0070】
書き換え処理(A)が正常に完了すると、図2(e)に示すように、書き換え実行中フラグ23cがクリアされる(図4のステップ203)。
【0071】
つぎにCPU21は自己リセット処理を行う。このためシステム制御権がフラッシュメモリ22に移され、フラッシュメモリ22の先頭記憶領域22aに記憶されている先頭プログラム61が起動される。この場合、先頭プログラム61の最初のプログラムであるリセット時判断プログラム61aが実行される(図4のステップ204)。
【0072】
正常に書き換え処理(A)が完了している場合には、リセット時に書き換え実行中フラグ23cがクリアされているので、上記1)の処理が実行される。これにより図2(f)に示すように、フラッシュメモリ22の記憶領域22bに記憶されている新しい車載プログラム60が起動され、サービスメータSMRの計時値を取り込む等の通常の運用処理が実行される(図4のステップ205)。
【0073】
以上のように本実施形態によれば、車体内のバッテリ53から車載コントローラ20を正常に動作させる電圧が供給されないような状況になったとしても、その後確実に書き換えを完了できるようにすることができる。
【0074】
しかも記憶媒体としてはフラッシュメモリ22とRAM23だけで済むので、車体内での場積が嵩むことがなく、またコストを低減させることができる。
【0075】
なお本実施形態では、情報収集コントローラ20内の車載プログラム60を書き換える場合を想定しているが、他のコントローラ30、40…内の車載プログラムを書き換える場合にも同様に適用することができる。
【0076】
また本実施形態では、先頭プログラム61をフラッシュメモリ22の先頭記憶領域22aに記憶させるようにしているが、先頭プログラム61のうち少なくともリセット時判断プログラム61aがフラッシュメモリ22の先頭記憶領域22aに記憶されていればよい。
【0077】
また本実施形態では、リセット時判断プログラム61aと書き換え制御プログラム61bを別のプログラムとして説明したが、書き換え制御プログラム61bの中にリセット時判断プログラム61aの機能を組み込むように構成してもよい。
【0078】
また本実施形態では、新しい車載プログラム60を建設機械50の外部から送信して建設機械50内のRAM23にバッファしてこれによって旧い車載プログラム60′を書き換える場合を想定して説明したが、リセット時判断プログラム61aと書き換え制御プログラム61bと車載プログラム60とが一体となった新しいプログラムを送信して、新しい車載プログラム60によって旧い車載プログラム60′を書き換えるようにしてもよい。
【0079】
またリセット時判断プログラム61aと書き換え制御プログラム61bと車載プログラム60とが一体となった新しいプログラムを送信して、送信された新しい車載プログラム60によって旧い車載プログラム60′を書き換えるとともに、送信された新しい書き換え制御プログラム61bによって、旧い書き換え制御プログラムを書き換えるようにしてもよい。書き換え制御プログラムの書き換えは、通信プロトコルが変更された場合に行われることがある。
【0080】
上述した実施形態では、情報収集コントローラ20内の車載プログラム60あるいは通信コントローラ30内の車載プログラム60あるいは情報収集コントローラ20と通信コントローラ30が一体に構成されている場合にこの一体となっているコントローラ内の車載プログラム60を書き換える場合を想定して説明した。つぎにこれらコントローラ以外のエンジンコントローラ40、図1では図示していないが作業機コントローラ、モニタパネルコントローラ等々の各コントローラ内の車載プログラム60を書き換える場合に好適な実施形態について説明する。なお作業機コントローラは、建設機械50に備えられている作業機を動作させるためのコントローラであり、モニタパネルコントローラは、建設機械50の運転室に設けられたモニタパネル上に車両状態を表示させる等の処理を行うコントローラである。
【0081】
これらエンジンコントローラ40、作業機コントローラ、モニタパネルコントローラなどは、キースイッチ54がオン、つまり建設機械50が稼動している状態では、車載プログラム60が実行されることにより通常に動作している必要がある。したがってキースイッチ54がオンの状態では、車載プログラム60を書き換える処理を実行させないかその処理を中断させて、車載プログラム60を実行させる必要がある。
【0082】
図5は書き換え処理の手順を示すフローチャートであり、図6はリセット時の処理手順を示すフローチャートである。以下エンジンコントローラ40内に、情報収集コントローラ20と同様なCPU21、フラッシュメモリ22、RAM23が搭載されているものとして、エンジンコントローラ40内の車載プログラム60を書き換える処理について、図2を併せ参照して説明する。
【0083】
なお以下の説明では、キースイッチ54の切り換え位置を示す信号がエンジンコントローラ40に取り込まれ、キースイッチ54がオフされているか(ACC位置オフ)か否かによって、建設機械50が稼働中でないか稼働中であるかを判断するものとする。しかし建設機械50が稼働中でないか稼働中であるかは、オルタネータの端子電圧を検出したり、エンジン57の回転数を検出したりすることによっても、判断することができる。
【0084】
書き換え専用サーバ3から建設機械50の車載プログラム60を書き換える指令が新しい車載プログラム60とともに、専用線15、地上波基地局8、専用線9、アンテナ10を介して無線通信11として建設機械50に送信されると、建設機械50のアンテナ31で受信され、このデータは通信コントローラ30から車体内通信回線51を介してエンジンコントローラ40内に取り込まれる。
【0085】
書き換え指令がエンジンコントローラ40内に取り込まれると、フラッシュメモリ22上の書き換え制御プログラム61bにしたがい処理がすすめられる。
【0086】
まずキースイッチ54がオフされているかが判断される(図5のステップ301)。この結果、キースイッチ54がオフの場合つまりエンジン57が稼働中でない場合には書き換え処理を実行すべきと判断して(ステップ301の判断Yes)、図2(a)に示すように、CPU21は受信した新しい車載プログラム60をRAM23の所定の記憶領域23aにバッファする(図5のステップ302)。新しい車載プログラム60の受信処理、記憶領域23aへのバッファリング処理が終了していない限りは(ステップ303の判断No)、再度ステップ301に移行され同様な処理が繰り返されるが(ステップ301〜303)、バッファリング処理が終了すると(ステップ303の判断Yes)、図2(b)に示すように、CPU21はRAM23の所定の記憶領域に、書き換え処理が実行中であることを示す書き換え実行中フラグ23cを立てる処理を行う(図5のステップ304)。
【0087】
以下図3のステップ103、104、105と同様の処理が図5のステップ305、306、307で行われる。
【0088】
すなわち図2(c)に示すように、フラッシュメモリ22に記憶されている先頭プログラム61がRAM23の所定の記憶領域23bにコピー(転写)される(図5のステップ305)。これによりコピーされたRAM23上の先頭プログラム61にシステム制御権が移される(図5のステップ306)。
【0089】
これによりフラッシュメモリ22が書き込みモードとなり、RAM23上の書き込み制御プログラム61bにしたがい、フラッシュメモリ22上の旧い車載プログラム60′をRAM23上の新しい車載プログラム60によって書き換える書き換え処理(A)が開始される(図5のステップ307)。
【0090】
書き換え処理(A)が実行されると、図2(d)に示すようにRAM23の記憶領域23aにバッファされていた新しい車載プログラム60がフラッシュメモリ22の記憶領域22b、つまり旧い車載プログラム60′が記憶されている領域22bにコピー(転写)され、旧い車載プログラム60′が新しい車載プログラム60に書き換えられる。ただしフラッシュメモリ22の先頭記憶領域22aにある先頭プログラム61については書き換えられないまま残される(図5のステップ308)。
【0091】
書き換え処理(A)中には、ステップ301と同様に、キースイッチ54がオフされているかが判断され(図5のステップ309)、この結果、キースイッチ54がオフの場合つまりエンジン57が稼働中でない場合には、書き換え処理を継続すべきと判断して(ステップ309の判断Yes)、新しい車載プログラム60の領域22bへのコピー(転写)が終了していない限りは(ステップ310の判断No)、再度ステップ308に移行され、書き換え処理(A)を継続させる(ステップ308〜310)。しかし新しい車載プログラム60の領域22bへのコピー(転写)が終了した場合、つまり書き換え処理(A)が正常に完了した場合には(ステップ310の判断Yes)、以下、図3のステップ107、108、109と同様な処理が、図5のステップ311、312、313で行われる。
【0092】
すなわち図2(e)に示すように、書き換え実行中フラグ23cがクリアされ(図5のステップ311)、その後CPU21は自己リセット処理を行う。このためシステム制御権がフラッシュメモリ22に移され、フラッシュメモリ22の先頭記憶領域22aに記憶されている先頭プログラム61が起動される。この場合、先頭プログラム61の最初のプログラムであるリセット時判断プログラム61aが実行される(図5のステップ312)。
【0093】
図6はリセット時判断プログラム61aの処理内容を示している。
【0094】
11)リセット時に書き換え実行中フラグ23cがクリア状態である場合、またはキースイッチ54がオンの場合には(図6のステップ401の判断No)、車載プログラムを実行させる。書き換え実行中フラグ23cがクリア状態である場合には、フラッシュメモリ22の記憶領域22bに記憶されている新しい車載プログラム60を実行させる。しかし書き換え実行中フラグ23cが立っている状態であり、キースイッチ54がオンとなっている場合には、記憶領域22bに記憶されている旧い車載プログラム60′を実行させず、RAM23の記憶領域23aにバッファされている新しい車載プログラム60を実行させる(図6のステップ403)。
【0095】
12)リセット時に書き換え実行中フラグ23cが立っている状態であり、かつキースイッチ54がオフの場合には(図6のステップ401の判断Yes)、書き換え処理を実行(継続)すべきものと判断して、システム制御権をRAM23に移しフラッシュメモリ22を再度、書き込みモードにして、RAM23上の書き込み制御プログラム61bにしたがい、フラッシュメモリ22上の旧い車載プログラム60′をRAM23上の新しい車載プログラム60によって書き換える書き換え処理(A)を再度実行させる(図6のステップ402)。
【0096】
正常に書き換え処理(A)が完了している場合には、リセット時に書き換え実行中フラグ23cがクリアされているので、上記11)の処理が実行される。これにより図2(f)に示すように、フラッシュメモリ22の記憶領域22bに記憶されている新しい車載プログラム60が起動され、サービスメータSMRの計時値を取り込む等の通常運用の処理が実行される(図5のステップ313)。
【0097】
図5の処理開始の時点で既にキースイッチ54がオンになっている場合若しくは書き換え処理(A)の途中でキースイッチ54がオンになった場合には(ステップ301の判断Noあるいはステップ309の判断No)、エンジンコントローラ40を通常に動作させるべく、ステップ314に移行し、CPU21は自己リセット処理を行う。自己リセット処理が行われると、リセット時判断プログラム61aが起動されて図6に示す処理が実行される。キースイッチ54がオン状態であるため、上記11)の処理が実行される。このためステップ401の判断処理を経た後(キースイッチ54がオンでありステップ401の判断No)、書き換え処理(A)中でなければ(書き換え実行中フラグ23cがクリア状態である場合には)、フラッシュメモリ22の記憶領域22bに記憶されている車載プログラムが実行され、書き換え処理(A)中であり(書き換え実行中フラグ23cが立っている状態である場合には)、キースイッチ54がオンとなっている場合には、RAM23の記憶領域23aにバッファされている新しい車載プログラム60を実行させる(ステップ403)。またCPU21は自己リセット処理を行うことなく、直接、フラッシュメモリ22の記憶領域22b若しくはRAM23の記憶領域23aにバッファされている車載プログラムを起動させてもよい(図5のステップ314)。
【0098】
書き換え処理中(A)に、バッテリ53の電圧低下等によりリセットが発生した場合には、リセット時判断プログラム61aが起動して図6に示す手順で処理が進められるものとする。
【0099】
上述した実施形態では、第1の記憶媒体がフラッシュメモリ22であり、第2の記憶媒体がRAM23である場合を想定して説明したが、第1の記憶媒体、第2の記憶媒体は下記に示す同一の記憶媒体または下記に示す異なる記憶媒体であってもよい。
【0100】
・EEPROM(電気的に消去可能なROM)
・コントローラ外部のバッテリでバックアップされているRAM
・コントローラ内部のバッテリでバックアップされているRAM
・FRAM等のバックアップ電源不要な不揮発性RAM
・ワンチップマイコン内部に設けられたフラッシュメモリ22
上述した実施形態では、RAM23にバッファされた新しい車載プログラム60をフラッシュメモリ22にコピー(転写)させる書き換え処理を行うようにしているが、このような書き換え処理を行うことなくバッファされた新しい車載プログラム60をそのまま実行させる実施も可能である。
【0101】
この実施形態に好適な記憶媒体を図9に示す。同図9に示すように、ワンチップマイコン内部には、CPU21、フラッシュメモリ22、RAM23が設けられており、フラッシュメモリ22の先頭記憶領域22aには、リセット時判断プログラム61aと書き換え制御プログラム61bとからなる先頭プログラム61が記憶されている。フラッシュメモリ22上には、車載プログラム60をバッファする第1の記憶領域22d、第2の記憶領域22eが設けられている。
【0102】
第1の記憶領域22dで、バッファ処理中であれば書き換え実行中であることを示す書き換え実行フラグ22f1が立ち、バッファ処理が終了すると書き換え実行中フラグ23f1がクリアされる。同様に第2の記憶領域22eで、バッファ処理中であれば書き換え実行中であることを示す書き換え実行フラグ22f2が立ち、バッファ処理が終了すると書き換え実行中フラグ23f2がクリアされる。
【0103】
また第1の記憶領域22dで、バッファ処理中であれば、当該第1の記憶領域22dの車載プログラムが実行可能であることを示すプログラム実行可能フラグ22g1がクリアされ、バッファ処理が終了するとプログラム実行可能フラグ22g1が立つ。同様に第2記憶領域22eで、バッファ処理中であれば、当該第2の記憶領域22eの車載プログラムが実行可能であることを示すプログラム実行可能フラグ22g2がクリアされ、バッファ処理が終了するとプログラム実行可能フラグ22g2が立つ。
【0104】
また車載プログラム60がバッファされた際には、バッファされた日時を示す日付情報が各記憶領域22d、22eに記憶されるものとする。なお車載プログラム60自体にバージョンアップされた日時の情報を持たせ、これを日付情報としてバッファ処理が行われた各記憶領域22d、22eに記憶させてもよい。
【0105】
図7は書き換え処理の手順を示すフローチャートであり、図8はリセット時の処理手順を示すフローチャートである。以下エンジンコントローラ40内の車載プログラム60を書き換える処理について、図9を併せ参照して説明する。
【0106】
書き換え専用サーバ3から建設機械50の車載プログラム60を書き換える指令が新しい車載プログラム60とともに、専用線15、地上波基地局8、専用線9、アンテナ10を介して無線通信11として建設機械50に送信されると、建設機械50のアンテナ31で受信され、このデータは通信コントローラ30から車体内通信回線51を介してエンジンコントローラ40内に取り込まれる。
【0107】
書き換え指令がエンジンコントローラ40内に取り込まれると、フラッシュメモリ22上の書き換え制御プログラム61bにしたがい処理がすすめられる。
【0108】
まず、第1の記憶領域22d、第2の記憶領域22eのうちいずれの記憶媒体(記憶領域)にバッファするかが判断される。この判断基準は、つぎのとおりである。
【0109】
判断基準1) 記憶領域22d、22eのプログラム実行可能フラグ22g1、22g2のうち一方がクリアされている状態である場合には、プログラム実行可能フラグがクリアされている方の記憶領域に、新しい車載プログラム60をバッファする。また記憶領域22d、22eの書き換え実行中フラグ22f1、22f2のうち一方が立っている状態である場合には、書き換え実行中フラグが立っている方の記憶領域(書き換え処理実行中の記憶領域)に、新しい車載プログラム60をバッファする。
【0110】
判断基準2) 両記憶領域22d、22eのプログラム実行可能フラグ22g1、22g2が立っている状態であり両方の記憶領域22d、22eに記憶されている車載プログラム60を実行させることが可能である場合には、予め定めた特定の記憶領域たとえば第2の記憶領域22eに、新しい車載プログラム60をバッファする。
【0111】
また判断基準2の代わりにつぎの判断基準3を適用してもよい。
【0112】
判断基準3) 両記憶領域22d、22eのプログラム実行可能フラグ22g1、22g2が立っている状態であり両方の記憶領域22d、22eに記憶されている車載プログラム60を実行させることが可能である場合には、日付情報に示される日時のうち旧い方の日時の記憶領域に、新しい車載プログラム60をバッファする(図7のステップ501)。
【0113】
CPU21は、バッファすべきと判断された記憶領域22dまたは22eに、書き換え実行中フラグ22f1または22f2を立てる処理を行う(図7のステップ502)。
【0114】
つぎにフラッシュメモリ22に記憶されている先頭プログラム61がRAM23の所定の記憶領域にコピー(転写)される(図7のステップ503)。これによりコピーされたRAM23上の先頭プログラム61にシステム制御権が移される(図7のステップ504)。
【0115】
これによりフラッシュメモリ22が書き込みモードとなり、RAM23上の書き込み制御プログラム61bにしたがい、フラッシュメモリ22上の記憶領域22dまたは22eに新しい車載プログラム60を書き込み、旧い車載プログラム60′を新しい車載プログラム60によって書き換える書き換え処理が開始される(図7のステップ505)。
【0116】
書き換え処理の開始にあたり、キースイッチ54がオフされているかが判断され(図7のステップ506)、この結果、キースイッチ54がオフの場合つまりエンジン57が稼働中でない場合には、書き換え処理を継続すべきと判断して(ステップ506の判断Yes)、つぎのステップ507に移行して、CPU21は、受信した新しい車載プログラム60を、フラッシュメモリ22上のバッファすべき記憶領域22dまたは22eにバッファし書き込み、旧い車載プログラム60′を新しい車載プログラム60に書き換える処理を実行する(図7のステップ507)。
【0117】
新しい車載プログラム60の受信処理、記憶領域22d、22eへのバッファリング処理(書き込み処理)が終了していない限りは(ステップ508の判断No)、同様な処理が繰り返されるが(ステップ506〜508)、書き換え処理が終了すると(ステップ508の判断Yes)、CPU21は書き換え処理が終了した記憶領域22dまたは22eの書き換え実行中フラグ22f1または22f2をクリアするとともに、書き換え処理が終了した記憶領域22dまたは22eのプログラム実行可能フラグ22g1または22g2を立てる処理を行う。同時に書き換え処理の対象でない方の記憶領域22dまたは22eのプログラム実行可能フラグ22g1または22g2がクリアされる。たとえば第2の記憶領域22eで書き換え処理が終了すると、第2の記憶領域22eの書き換え実行中フラグ2222f2をクリアするとともに、第2の記憶領域22eのプログラム実行可能フラグ22g2を立てる処理を行う。同時に第1の記憶領域22dのプログラム実行可能フラグ22g1がクリアされる(図5のステップ509)。
【0118】
その後CPU21は自己リセット処理を行う。このためシステム制御権がフラッシュメモリ22に移され、フラッシュメモリ22の先頭記憶領域22aに記憶されている先頭プログラム61が起動される。この場合、先頭プログラム61の最初のプログラムであるリセット時判断プログラム61aが実行される(図5のステップ510)。
【0119】
図8はリセット時判断プログラム61aの処理内容を示している。
【0120】
すなわちリセット時判断プログラム61aが起動すると、つぎの判断基準にしたがい実行可能な車載プログラムを起動させる。
【0121】
判断基準11) 記憶領域22d、22eのプログラム実行可能フラグ22g1、22g2のうち一方が立っている状態である場合には、プログラム実行可能フラグが立っている方の記憶領域の新しい車載プログラム60を起動させる。
【0122】
判断基準12)両記憶領域22d、22eのプログラム実行可能フラグ22g1、22g2が立っている状態であり両方の記憶領域22d、22eに記憶されている車載プログラム60を実行させることが可能である場合には、予め定めた特定の記憶領域たとえば第1の記憶領域22dの新しい車載プログラム60を起動させる。
【0123】
また判断基準12の代わりにつぎの判断基準13を適用してもよい。
【0124】
判断基準13) 両記憶領域22d、22eのプログラム実行可能フラグ22g1、22g2が立っている状態であり両方の記憶領域22d、22eに記憶されている車載プログラム60を実行させることが可能である場合には、日付情報に示される日時のうち新しい方の日時の記憶領域の新しい車載プログラム60を起動させる。
【0125】
正常に書き換え処理が終了した場合には、書き換え処理が終了した記憶領域22dまたは22eのプログラム実行可能フラグ22g1または22g2を立てる処理が行われ、同時に書き換え処理の対象でない方の記憶領域22dまたは22eのプログラム実行可能フラグ22g1または22g2がクリアされている。たとえば第2の記憶領域22eで書き換え処理が終了すると、第2の記憶領域22eのプログラム実行可能フラグ22g2が立てられ、同時に第1の記憶領域22dのプログラム実行可能フラグ22g1がクリアされる。このため上記判断基準11にしたがい第2の記憶領域22eの最新の車載プログラム60が起動され実行されることになる(図7のステップ511)。
【0126】
図7の書き換え処理の途中でキースイッチ54がオンになった場合には(ステップ506の判断No)、エンジンコントローラ40を通常に動作させるべく、ステップ512に移行し、CPU21は自己リセット処理を行う。自己リセット処理が行われると、リセット時判断プログラム61aが起動されて図8に示す処理が実行される。このため上記判断基準11、12、13にしたがい、プログラム実行フラグが立っている記憶領域の車載プログラム60を起動させる。またCPU21は自己リセット処理を行うことなく、直接、フラッシュメモリ22の記憶領域22d、22eの車載プログラムを起動させてもよい(図7のステップ512)。
【0127】
書き換え処理中にバッテリ53の電圧低下等によりリセットが発生した場合には、リセット時判断プログラム61aが起動して図8に示す手順で処理が進められるものとする。
【0128】
図9ではフラッシュメモリ上に第1の記憶領域22d、第2の記憶領域22eを設けているが、EEPROMであればフラッシュメモリに限定されるわけではない。またFRAM等のバックアップ電源が不要な不揮発性のRAM上に第1の記憶領域22d、第2の記憶領域22eを設けてもよい。
【0129】
また以上説明した本実施形態では、書き換え専用サーバ3からの指令に応じて車載プログラム60を書き換えるようにしているが、通常運用サーバ2からの指令に応じて車載プログラム60を書き換えるようにしてもよい。
【0130】
また以上説明した実施形態では、サーバからの要求に応じて建設機械50内の車載プログラム60をリモートで書き換える場合を想定しているが、サービスマンが建設機械50まで出向きコントローラにパーソナルコンピュータを接続することにより車載プログラム60を書き換える場合にも本発明を適用することができる。
【0131】
また以上説明した実施形態では、車両として建設機械50を想定しているが、本発明は一般自動車等、任意の車両の車載プログラムを書き換える場合に適用することができる。
【図面の簡単な説明】
【図1】図1は本実施形態のシステムの全体構成を示す図である。
【図2】図2(a)〜(f)はフラッシュメモリ、RAMの状態遷移を示す図である。
【図3】図3は図3は正常時の書き換え処理の手順を示すフローチャートである。
【図4】図4は書き換え中にリセットが発生した場合の書き換え処理の手順を示すフローチャートである。
【図5】図5は書き換え処理の手順を示すフローチャートである。
【図6】図6は図5に関連しリセット時の処理の手順を示すフローチャートである。
【図7】図7は書き換え処理の手順を示すフローチャートである。
【図8】図8は図7に関連しリセット時の処理の手順を示すフローチャートである。
【図9】図9はフラッシュメモリ上に車載プログラムを記憶する2つの記憶領域を設けた記憶媒体の構成例を示す図である。
【符号の説明】
21 CPU
22 フラッシュメモリ
23 RAM
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to an apparatus for performing control for rewriting an in-vehicle program.
[0002]
[Prior art]
Various types of controllers such as a controller that collects information on a vehicle state such as a current position of a vehicle body and a time value of a service meter are mounted on construction machines that have been developed in recent years. A CPU is provided in such an in-vehicle controller, and executes arithmetic processing in accordance with an in-vehicle program stored in an EEPROM (electrically erasable ROM) such as a flash memory to collect vehicle state information and to communicate with an external device. Performs processing such as transmission and reception. For example, a vehicle-mounted controller and an external server are communicably connected via communication means such as the Internet, and vehicle state information collected by the vehicle-mounted controller is transmitted to the server. Alternatively, a service person goes to the construction machine, connects a personal computer to the onboard controller, and takes in the vehicle state information into the personal computer.
[0003]
When the in-vehicle program is upgraded, or when it is desired to change the threshold value or the like for abnormality determination for each vehicle, it is necessary to rewrite the old in-vehicle program stored in the flash memory with a new in-vehicle program.
[0004]
(Prior art 1)
Patent Literature 1 (Japanese Patent Application Laid-Open No. 7-162547) describes an invention of a remote program rewriting system in which a program of a communication terminal device is changed in response to a request from a center device. That is, the communication terminal device is provided with an electrically non-erasable ROM in which a rewrite control program is stored, an electrically erasable flash ROM in which a main program is stored, and a RAM. Erroneous rewriting is prevented by erasing the main program in the flash ROM on condition that the received key data is received by the communication terminal device. The key data is analyzed by the key circuit to determine whether writing is prohibited or permitted. When a new main program is sent from the center device, the rewriting control program on the ROM is started, the rewriting process is started, and the new main program is temporarily stored in the RAM. Then, the new main program is transferred from the RAM to the flash ROM, and the system control right is transferred to the new main program.
[0005]
(Prior art 2)
Patent Document 2 (Japanese Patent Application Laid-Open No. 10-212739) relates to a construction machine with a controller for collecting operation data and a monitoring device provided at a remote place. The invention describes that the operation data processing program in the operation data collection controller is rewritten in response to a request from a monitoring device by connecting with a communication device. That is, the operation data collection controller includes an electrically non-erasable ROM storing a rewrite control program, an electrically erasable ROM (EEPROM) storing an operation data processing program, and a RAM. The command “rewrite request”, “rewrite permission”, “rewrite start”, “rewrite prohibition” and “rewrite end” are transmitted and received between the monitoring device and the operation data collection controller, and the EEPROM is written. The state is set to “OK” or “OFF” to prevent erroneous rewriting. A latch circuit and a gate circuit are provided between the CPU and the EEPROM in order to make the EEPROM writable or unwritable in accordance with each of the above commands. In a state where the EEPROM is writable, when a new operating data processing program is sent from the monitoring device, the rewriting control program on the ROM is started, the rewriting process is started, and the new operating data processing program is temporarily stored in the RAM. You. Then, the new operation data processing program is transferred from the RAM to the EEPROM, and the system control right is transferred to the new operation data processing program.
[0006]
[Problems to be solved by the invention]
In a vehicle such as a construction machine, the power supply of the starter device and the like and the power supply of the above-described in-vehicle controller are common. Therefore, when the starter device is operated at the time of starting the engine, the terminal voltage of the battery, which is a common power supply, may temporarily drop below the operating voltage of the onboard controller (CPU). In some cases, a voltage that causes the battery to operate normally may not be applied from the battery to the in-vehicle controller (CPU) due to other causes. In such a case, if the in-vehicle program is being rewritten, there is a possibility that the in-vehicle program may be reset without the rewriting being completed normally.
[0007]
However, both the above-described prior art 1 and prior art 2 assume that the power supply is normal, and do not describe at all how to cope with the case where the reset state occurs without rewriting being completed normally due to the power supply drop.
[0008]
Further, in the above-mentioned prior art 1, two ROMs and one RAM are required as storage media for performing rewriting. Further, a key circuit is required to prevent erroneous rewriting. Similarly, the prior art 2 also requires two ROMs and one RAM as storage media to perform rewriting, and requires a latch circuit and a gate circuit to prevent erroneous rewriting.
[0009]
Such an increase in the number of storage media and circuits for preventing erroneous rewriting takes a large space in the vehicle body, and causes a rise in cost.
[0010]
The present invention has been made in view of such circumstances, and it is intended to ensure that rewriting can be completed afterwards even when a voltage in a vehicle body does not supply a voltage for operating an onboard controller normally. Is to be solved.
[0011]
Means, actions, and effects for solving the problem
The first invention is
A CPU (21);
A writable and readable first storage medium (22);
A writable and readable second storage medium (23);
An onboard program rewriting control device provided in the onboard controller (20),
The first storage medium (22) includes:
An in-vehicle program (60) is stored in the in-vehicle program storage area (22b), and a rewrite control program (61b) for rewriting the in-vehicle program is stored in other areas.
A reset (restart) time determination program (61a) is stored,
In the second storage medium (23),
A new in-vehicle program temporary storage area (23a) for temporarily storing a new in-vehicle program (60);
An in-execution flag storage area for storing a rewriting execution flag (23c) indicating that the in-vehicle program is being rewritten and being executed is provided.
The rewrite control program (61b)
When receiving a command to rewrite a new in-vehicle program (60) from outside,
The new in-vehicle program (60) is temporarily stored in the new in-vehicle program temporary storage area (23a),
A first function of storing a rewriting execution flag (23c) in an execution flag storage area;
A second function of transferring (rewriting) the new vehicle-mounted program stored in the new vehicle-mounted program temporary storage area (23a) onto the vehicle-mounted program stored in the first storage medium (22);
At the end of rewriting,
A third function of deleting the rewriting execution flag (23c) from the execution flag storage area;
After reset (restart),
It has a fourth function of activating the reset (restart) time determination program 61a,
The reset (restart) time determination program 61a
A fifth function of determining whether or not a rewriting execution flag (23c) exists in the execution flag storage area;
If there is no rewriting execution flag (23c), it is determined that the rewriting process has been completed, and the in-vehicle program (60) stored in the in-vehicle program storage area (22b) of the first storage medium (22) is deleted. A sixth function to be executed,
If there is a rewriting execution flag (23c), it is determined that the rewriting process is not completed, and a seventh function for executing the rewriting control program (61b) is provided.
It is characterized by.
[0012]
The second invention is based on the first invention,
Outside the vehicle (50), there is provided a server (3) communicably connected to an on-vehicle controller (20) in the vehicle (50) by communication means (15, 8, 9, 10, 11),
The server (3) has a function of giving an instruction to rewrite a new in-vehicle program (60) to the in-vehicle controller (20) via the communication means (15, 8, 9, 10, 11).
It is characterized by.
[0013]
According to the first invention and the second invention, as shown in FIGS. 2, 3 and 4, when a command for rewriting to a new in-vehicle program 60 is given from outside, the CPU 21 causes the second rewriting control program 61b to execute the second rewriting control program 61b. A buffer process is performed to temporarily store the new in-vehicle program 60 in the predetermined area 23a on the RAM 23, which is a storage medium (FIG. 2A, step 101 in FIG. 3). Then, the new in-vehicle program 60 once stored in the RAM 23 is transferred to the in-vehicle program storage area 22b on the flash memory 22 while the reset determination program 61a remains in the head storage area 22a of the flash memory 23 as the first storage medium. A rewriting process (A) for (copying) is executed (FIG. 2D, step 106 in FIG. 3).
[0014]
During the execution of the rewriting process (A), a rewriting execution flag 23a indicating that the rewriting is being executed is set in a predetermined area on the RAM 23 (FIG. 2B, step 102 in FIG. 3).
[0015]
When the rewriting process (A) is completed, the rewriting in progress flag 23a is set to a clear state (FIG. 2E, step 107 in FIG. 3), and a reset state (FIG. 2F, step 108 in FIG. 3). .
[0016]
At the time of the reset state, the reset determination program 61a stored in the head storage area 22a of the flash memory 22 starts.
[0017]
Therefore, according to the reset determination program 61a, if the rewriting in progress flag 23a is in the clear state, the CPU 21 determines that the rewriting process (A) has been completed, and the in-vehicle program storage area of the flash memory 22 The process is executed according to the new in-vehicle program 60 transferred to 22b (FIG. 2 (f), step 109 in FIG. 3).
[0018]
However, when the reset state is reached, if the rewriting in progress flag 23a is set, it is determined that the rewriting process has not been completed, and the rewriting control program 61b is executed again (step 201 in FIG. 4, 202-205).
[0019]
Therefore, according to the present invention, rewriting can be reliably completed afterwards even if a situation occurs in which a voltage for normally operating the on-vehicle controller 20 is not supplied from the battery 53 in the vehicle body.
[0020]
Moreover, since only the flash memory (first storage medium) 22 and the RAM (second storage medium) 23 are required as storage media, the space in the vehicle body does not increase, and the cost can be reduced. .
[0021]
The second invention of the first invention and the second invention is particularly applied to a case where the in-vehicle program 60 in the construction machine 50 is remotely rewritten via a communication unit in response to a request from the server 3.
[0022]
BEST MODE FOR CARRYING OUT THE INVENTION
FIG. 1 shows the overall apparatus configuration of the embodiment. In the following embodiment, a construction machine 50 is assumed as a vehicle, and a case is assumed in which the in-vehicle program 60 in the construction machine 50 is remotely rewritten in response to a request from the rewrite server 3.
[0023]
In the system of this embodiment, the construction machine 50 communicates with the normal operation server 2 and the dedicated rewrite server 3 via communication means (wireless communication 11, antenna 10, dedicated line 9, terrestrial base station 8, dedicated lines 14, 15). They are connected to each other so that they can be sent and received freely.
[0024]
The normal operation server 2 is located in the intranet 4 and is connected to the Internet 7. Thereby, the normal operation server 2 functions as a server for each client terminal of the Internet 7 and the intranet 4. The normal operation server 2 is provided with an IP address “ID1” which is an ID (server identification ID) for identifying itself in the network. The construction machine 50 is equipped with a communication terminal (communication controller 30), which will be described later, which can communicate with the normal operation server 2, and this communication terminal is assigned an IP address "ID3" corresponding to the server identification ID "ID1". ing.
[0025]
The rewritable server 3 is located in the intranet 5 and is connected to the Internet 7. Thus, the rewrite-only server 3 functions as a server for each client terminal of the Internet 7 and the intranet 5. This rewrite-only server 3 is given an IP address “ID2” which is an ID (server identification ID) for identifying itself in the network. The construction machine 50 has a communication terminal (communication controller 30) capable of communicating with the rewrite-only server 3, and this communication terminal is assigned an IP address "ID4" corresponding to the server identification ID "ID2". .
[0026]
A communication controller 30 having a built-in wireless device for packet data communication is provided in the vehicle body of the construction machine 50. Wireless communication 11 by packet communication is performed between the antenna 31 of the communication controller 30 and the terrestrial antenna 10. The antenna 10 is connected to a terrestrial base station 8 via a dedicated line 9. The terrestrial base station 8 is, for example, a mobile phone base station. The terrestrial base station 8 is connected to intranets 4 and 5 via dedicated lines 14 and 15, respectively.
[0027]
In the vehicle body of the construction machine 50, in addition to the communication controller 30, controllers such as the information collection controller 20 and the engine controller 40 are provided. These controllers communicate with each other in accordance with a predetermined communication protocol. They are communicably connected to each other by a line 51.
[0028]
In each part of the vehicle body of the construction machine 50, a cooling water for the engine 57, a voltage of the battery 53, a GPS sensor, and the like are arranged, and these sensors constitute a sensor group 52. The GPS sensor receives a radio wave transmitted from a GPS satellite and detects the absolute position of its own construction machine 50. A calendar and a timer are provided in the vehicle body of the construction machine 50. The calendar and timer measure the year, month, day, and time (hour, minute, second). A service meter SMR is provided in the vehicle body of the construction machine 50. The service meter SMR measures the operating time of the engine 57.
[0029]
In the information collection controller 20, a CPU 21, a flash memory 22, and a random access memory (RAM) 23 are mutually connected via a bus line 24 so that data can be freely input and output. The flash memory 22 is a type of EEPROM (electrically erasable ROM). Further, an EEPROM such as a flash memory may be used instead of the RAM 23. As will be described later, the predetermined storage area of the flash memory 22 captures the time value of the service meter SMR, each detection value of the sensor group 52, the time value of the calendar, and the time value of the timer to determine whether the construction machine 50 is abnormal. A vehicle that performs a determination or outputs a start lock setting command when the set start lock time zone is reached, performs a start lock described later, and outputs a start lock release command when the time is outside the start lock time zone. A program 60 is stored. In addition, in the head storage area of the flash memory 22, a head program 61 including a reset determination program 61a and a rewrite control program 61b is stored as described later. The following vehicle state data is stored in the predetermined storage area of the RAM 23.
[0030]
-Your own IP address (ID3, ID4)
Information that specifies the construction machine 50, such as the model, model, and machine number of the construction machine 50
Information collected by the information collection controller 20 such as the current time value of the service meter SMR or information obtained by processing the collected information.
-Information indicating the content of the event when an event such as an abnormality occurs in the construction machine 50
-Start lock information such as whether the current start lock is valid or invalid as described later, and the currently set start lock time zone
The vehicle status data is generated as the on-board program 60 operates.
[0031]
The bus line 24 is connected to the service meter SMR and the sensor group 52 outside the information collection controller 20 via an interface, and the bus line 24 is connected to the in-vehicle communication line 51 outside the controller 20 via the interface. .
[0032]
In the present embodiment, the communication controller 30 and the information collection controller 20 are provided separately, but they may be constituted by one controller.
[0033]
A starting lock circuit 55 is incorporated in the vehicle body of the construction machine 50.
[0034]
The start lock circuit 55 is constituted by a relay or the like and is interposed between the key switch 54 and a starter 56 for starting the engine 57. The power supply of the starter 56 is a battery 53 mounted on the vehicle.
[0035]
When the start lock setting command is output from the engine controller 40, the relay of the start lock circuit 55 is energized to enter the start lock setting state. That is, even if the key switch 54 is turned on (ACC position), the terminal voltage of the battery 53 is not applied to the starter 56. As a result, the starter 56 becomes inoperable and the engine 57 cannot be started. On the other hand, when a start lock release command is output from the engine controller 40, the relay of the start lock circuit 55 is deenergized and the start lock is released. That is, when the key switch 54 is turned on (ACC position), the starter 56 operates and the engine 57 can be started. The start lock setting command and the start lock release command are given from the information collection controller 20 to the engine controller 40 via the in-vehicle communication line 51 in accordance with the in-vehicle program 60. The start lock setting command and the start lock release command are output from the information collection controller 20 when the start lock is currently set to “valid”. Whether or not the start lock time zone has been entered is determined based on the values of the calendar and the timer in the information collection controller 20.
[0036]
The information that the key switch 54 is turned on (is in the ACC position) is taken into the information collection controller 20 from the engine controller 40 via the vehicle body communication line 51.
[0037]
The normal operation server 2 manages vehicle state data in a plurality of construction machines including the construction machine 50.
[0038]
The rewrite-only server 3 is a server that remotely rewrites the in-vehicle program 60.
[0039]
The normal operation server 2 has a master file 6. The latest vehicle state data taken into the normal operation server 2 is stored in the master file 6.
[0040]
On the other hand, the rewritable server 3 has a master file 6 '. The storage data of the master file 6 in the normal operation server 2 is taken into the rewritable server 3 via the Internet 7, and the same storage contents as the master file 6, that is, a master file 6 'as a "replica" is created.
[0041]
When a command for requesting vehicle state data of the construction machine 50 from the normal operation server 2 is transmitted to the construction machine 50 as the wireless communication 11 via the dedicated line 14, the terrestrial base station 8, the dedicated line 9, and the antenna 10, The data is received by the antenna 31 of the construction machine 50, and this data is taken into the communication controller 30. The data transmitted from the normal operation server 2 includes the server identification ID “ID1”. Since the communication controller 30 has set the IP address “ID3” and the received data includes the server identification ID “ID1”, both correspond (“ID1” and “ID3” are the same network). Is established), a communication connection is established, and the construction machine 50 is set to be able to transmit vehicle state data.
[0042]
Therefore, a command for requesting vehicle state data is fetched from the communication controller 30 into the information collection controller 20 via the vehicle body communication line 51. For example, when a command requesting the current time value of the service meter SMR is fetched into the information collection controller 20, the current time value of the service meter SMR stored in the RAM 23 is transmitted from the information collection controller 20 via the vehicle body communication line 51. The data is transmitted to the communication controller 30 and transmitted from the antenna 31 of the communication controller 30 as wireless communication 11, and is received by the normal operation server 2 via the antenna 10, the dedicated line 9, the terrestrial base station 8, and the dedicated line 14.
[0043]
Also, when a command for setting the start lock validity, invalidity, and start lock time period is transmitted from the normal operation server 2 to the construction machine 50, the information collected by the information collection controller 20 is set to the information collection controller 20 by the same route. Is done.
[0044]
Note that a similar command may be given from each client terminal of the normal operation server 2 to the construction machine 50 via the normal operation server 2.
[0045]
When a specific event occurs in the construction machine 50, such as when a specific abnormality occurs or at a specific time, the details of the abnormality stored in the RAM 23 at the time of the event and the vehicle to be transmitted periodically State data and the like are taken into the communication controller 30 from the information collection controller 20 via the vehicle body communication line 51, and transmitted as wireless communication 11 from the antenna 31 of the communication controller 30 (automatic transmission). The automatically transmitted data is taken into the normal operation server 2 via the antenna 10, the dedicated line 9, the terrestrial base station 8, and the dedicated line 14.
[0046]
The vehicle status data of the construction machine 50 taken into the normal operation server 2 is obtained by accessing the normal operation server 2 from each client terminal connected to the network belonging to the normal operation server 2, ie, the Internet 7 and the intranet 4. It is displayed on the display screen of the client terminal.
[0047]
The latest vehicle state data taken into the normal operation server 2 is stored in the master file 6 and also stored in the master file 6 ′ via the Internet 7.
[0048]
When the in-vehicle program 60 'is upgraded, or when it is desired to change the threshold for generating an error code or determining an abnormality for each construction machine, the old in-vehicle program 60' stored in the flash memory 22 is replaced with a new in-vehicle program. Rewritten into the program 60.
[0049]
When a command to rewrite the in-vehicle program 60 of the construction machine 50 is transmitted from the rewrite dedicated server 3 to the construction machine 50 as the wireless communication 11 via the dedicated line 15, the terrestrial base station 8, the dedicated line 9, and the antenna 10, The data is received by the antenna 31 of 50, and this data is taken into the communication controller 30.
[0050]
The data transmitted from the rewrite-only server 3 includes the server identification ID “ID2”. In the communication controller 30, the IP address “ID3” is currently set, and the received data includes the server identification ID “ID2”. Therefore, the two do not correspond (“ID2” and “ID3”). It is not the same network) and disconnects the communication connection.
[0051]
Information that the communication connection has been disconnected due to the mismatch of the IDs is taken into the information collection controller 20 from the communication controller 30 via the in-vehicle communication line 51. In response, the information collection controller 20 switches its own IP address “ID4” corresponding to the server identification ID “ID2” of the rewrite-only server 3 to “valid”, and the server identification ID “ID1” of the normal operation server 2. Is switched to “invalid” (rewrite mode). The data “ID4” of the own IP address set as “valid” by the information collection controller 20 is taken into the communication controller 30 from the information collection controller 20 via the in-vehicle communication line 51.
[0052]
The rewrite-only server 3 transmits the rewrite command to the construction machine 50 again in response to the disconnection of the communication connection. The data transmitted from the rewrite-only server 3 includes the server identification ID “ID2”. Since the communication controller 30 is currently set with the IP address “ID4” and the received data includes the server identification ID “ID2”, both correspond (“ID2” and “ID4”). It is determined to be the same network) and a communication connection is established.
[0053]
Thereafter, a process of rewriting the in-vehicle program 60 by the information collection controller 20 in accordance with a command from the rewrite-only server 3 is performed.
[0054]
Next, a process of rewriting the vehicle-mounted program 60 will be described with reference to FIGS. FIGS. 2A to 2F are diagrams showing transitions of the states of the flash memory 22 and the RAM 23. FIG. 3 is a flowchart showing a procedure of a rewriting process in a normal state. FIG. 4 shows a case where a reset occurs during rewriting. 9 is a flowchart showing the procedure of a rewriting process of the first embodiment. In the following description, a dash is given to the old in-vehicle program 60 to distinguish it from the new in-vehicle program 60.
[0055]
As shown in FIG. 2F, a leading program 61 is stored in a leading storage area of the flash memory 22, that is, a storage area 22a to be executed first upon reset. As described above, the head program 61 includes the reset judgment program 61a and the rewrite control program 61b. The reset-time determination program 61a is a program that determines whether or not the rewriting process has been completed according to the state of a rewriting execution flag 23c described later, and selects the next process according to the determination result. The rewrite control program 61b is a program for performing a process of rewriting the old in-vehicle program 60 'with the new in-vehicle program 60. An old in-vehicle program 60 'is stored in a predetermined storage area 22b following the head storage area 22a of the flash memory 22.
[0056]
A command to rewrite the in-vehicle program 60 of the construction machine 50 from the rewriting dedicated server 3 is transmitted to the construction machine 50 as the wireless communication 11 via the dedicated line 15, the terrestrial base station 8, the dedicated line 9, and the antenna 10 together with the new in-vehicle program 60. Then, the data is received by the antenna 31 of the construction machine 50, and this data is taken into the information collection controller 20 from the communication controller 30 via the in-vehicle communication line 51.
[0057]
When the rewrite command is fetched into the information collection controller 20, the process proceeds according to the rewrite control program 61b on the flash memory 22. First, as shown in FIG. 2A, the CPU 21 buffers the received new in-vehicle program 60 in a predetermined storage area 23a of the RAM 23 (Step 101 in FIG. 3). Next, as shown in FIG. 2B, the CPU 21 performs a process of setting a rewrite execution flag 23c in a predetermined storage area of the RAM 23 to indicate that the rewrite process is being executed (step 102 in FIG. 3).
[0058]
Next, as shown in FIG. 2C, the leading program 61 stored in the flash memory 22 is copied (transferred) to a predetermined storage area 23b of the RAM 23 (Step 103 in FIG. 3). This transfers the system control right to the copied top program 61 on the RAM 23 (step 104 in FIG. 3).
[0059]
As a result, the flash memory 22 enters the write mode, and the rewrite processing (A) for rewriting the old vehicle-mounted program 60 'on the flash memory 22 with the new vehicle-mounted program 60 on the RAM 23 is started according to the write control program 61b on the RAM 23 (FIG. Step 105 in FIG. 3).
[0060]
When the rewriting process (A) is executed, the new in-vehicle program 60 buffered in the storage area 23a of the RAM 23 is replaced with the storage area 22b of the flash memory 22, ie, the old in-vehicle program 60 'as shown in FIG. The data is copied (transferred) to the stored area 22b, and the old vehicle-mounted program 60 'is rewritten with the new vehicle-mounted program 60. However, the head program 61 in the head storage area 22a of the flash memory 22 remains without being rewritten (step 106 in FIG. 3).
[0061]
When the rewriting process (A) is completed normally, the rewriting in progress flag 23c is cleared as shown in FIG. 2E (step 107 in FIG. 3).
[0062]
Next, the CPU 21 performs a self-reset process. Therefore, the system control right is transferred to the flash memory 22, and the head program 61 stored in the head storage area 22a of the flash memory 22 is activated. In this case, the reset-time determination program 61a, which is the first program of the head program 61, is executed (Step 108 in FIG. 3).
[0063]
The reset determination program 61a performs the following processing.
[0064]
1) If the rewriting execution flag 23c is in the clear state at the time of reset, the flash memory 22 is set to the normal mode, and the new in-vehicle program 60 stored in the storage area 22b of the flash memory 22 is executed.
[0065]
2) If the rewriting execution flag 23c is set at the time of reset, the system control right is transferred to the RAM 23, the flash memory 22 is again set in the write mode, and the flash memory 22 is written in accordance with the write control program 61b on the RAM 23. The rewriting process (A) for rewriting the old vehicle-mounted program 60 'on the RAM 22 with the new vehicle-mounted program 60 on the RAM 23 is executed again.
[0066]
When the rewriting process (A) has been completed normally, the rewriting execution flag 23c is cleared at the time of reset, and thus the process 1) is executed. As a result, as shown in FIG. 2 (f), a new in-vehicle program 60 stored in the storage area 22b of the flash memory 22 is started, and normal operation processing such as taking in the time value of the service meter SMR is executed. (Step 109 in FIG. 3).
[0067]
FIG. 4 shows a procedure of the rewriting process when a reset occurs during the rewriting process (A). That is, when the starter 56 is operated at the time of starting the engine 57, the terminal voltage of the battery 53 may temporarily drop below the operating voltage of the CPU 21. In some cases, a voltage that causes the battery 53 to operate normally may not be applied from the battery 53 to the CPU 21 due to other causes. In such a case, if the rewriting process (A) is being executed, the rewriting process (A) may be in a reset state without being completed normally.
[0068]
When a reset occurs during the rewriting process (A) shown in FIG. 2D, the head program 61 stored in the head storage area 22a of the flash memory 22 is started. In this case, the reset-time determination program 61a, which is the first program of the head program 61, is executed (Step 201 in FIG. 4).
[0069]
When the rewriting process (A) is not completed normally, the rewriting in progress flag 23c is in a standing state without being cleared, so that the process 2) described above is executed. That is, when the rewriting in progress flag 23c is set at the time of reset, the system control right is transferred to the RAM 23, the flash memory 22 is again set in the write mode, and the flash memory 22 is written in accordance with the write control program 61b on the RAM 23. The rewriting process (A) for rewriting the old vehicle-mounted program 60 'on the RAM 22 with the new vehicle-mounted program 60 on the RAM 23 is executed again (step 202 in FIG. 4).
[0070]
When the rewriting process (A) is completed normally, the rewriting in progress flag 23c is cleared as shown in FIG. 2E (step 203 in FIG. 4).
[0071]
Next, the CPU 21 performs a self-reset process. Therefore, the system control right is transferred to the flash memory 22, and the head program 61 stored in the head storage area 22a of the flash memory 22 is activated. In this case, the reset-time determination program 61a, which is the first program of the head program 61, is executed (Step 204 in FIG. 4).
[0072]
When the rewriting process (A) has been completed normally, the rewriting execution flag 23c is cleared at the time of reset, and thus the process 1) is executed. As a result, as shown in FIG. 2 (f), a new in-vehicle program 60 stored in the storage area 22b of the flash memory 22 is started, and normal operation processing such as taking in the time value of the service meter SMR is executed. (Step 205 in FIG. 4).
[0073]
As described above, according to the present embodiment, even if a situation occurs in which a voltage for operating the on-vehicle controller 20 is not supplied from the battery 53 in the vehicle body, the rewriting can be reliably completed thereafter. it can.
[0074]
In addition, since only the flash memory 22 and the RAM 23 are required as storage media, the space in the vehicle body does not increase, and the cost can be reduced.
[0075]
In this embodiment, it is assumed that the in-vehicle program 60 in the information collection controller 20 is rewritten. However, the present invention can be similarly applied to the case in which the in-vehicle program in the other controllers 30, 40,.
[0076]
In the present embodiment, the head program 61 is stored in the head storage area 22a of the flash memory 22. However, at least the reset determination program 61a of the head program 61 is stored in the head storage area 22a of the flash memory 22. It should just be.
[0077]
In the present embodiment, the reset-time determination program 61a and the rewrite control program 61b have been described as separate programs. However, the function of the reset-time determination program 61a may be incorporated in the rewrite control program 61b.
[0078]
Further, in the present embodiment, the description has been made on the assumption that the new in-vehicle program 60 is transmitted from outside the construction machine 50 and buffered in the RAM 23 in the construction machine 50, thereby rewriting the old in-vehicle program 60 ′. A new program in which the determination program 61a, the rewrite control program 61b, and the in-vehicle program 60 are integrated may be transmitted, and the old in-vehicle program 60 'may be rewritten by the new in-vehicle program 60.
[0079]
Further, a new program in which the reset determination program 61a, the rewrite control program 61b, and the in-vehicle program 60 are integrated is transmitted, and the transmitted in-vehicle program 60 rewrites the old in-vehicle program 60 ', and transmits the new rewrite. The old rewrite control program may be rewritten by the control program 61b. Rewriting of the rewriting control program may be performed when the communication protocol is changed.
[0080]
In the above-described embodiment, when the in-vehicle program 60 in the information collection controller 20 or the in-vehicle program 60 in the communication controller 30 or the information collection controller 20 and the communication controller 30 are integrally formed, the integrated controller The description has been made on the assumption that the vehicle-mounted program 60 is rewritten. Next, an embodiment suitable for rewriting the in-vehicle program 60 in each controller such as the engine controller 40 other than these controllers and the work implement controller, the monitor panel controller, etc., which are not shown in FIG. 1, will be described. The work machine controller is a controller for operating the work machine provided in the construction machine 50, and the monitor panel controller is configured to display a vehicle state on a monitor panel provided in a cab of the construction machine 50. Controller.
[0081]
When the key switch 54 is turned on, that is, when the construction machine 50 is operating, the engine controller 40, the work equipment controller, the monitor panel controller, and the like need to operate normally by executing the in-vehicle program 60. is there. Therefore, when the key switch 54 is on, it is necessary to execute the in-vehicle program 60 by not executing or interrupting the process of rewriting the in-vehicle program 60.
[0082]
FIG. 5 is a flowchart showing the procedure of the rewriting process, and FIG. 6 is a flowchart showing the procedure at the time of reset. Hereinafter, assuming that the same CPU 21, flash memory 22, and RAM 23 as the information collection controller 20 are mounted in the engine controller 40, the process of rewriting the in-vehicle program 60 in the engine controller 40 will be described with reference to FIG. I do.
[0083]
In the following description, a signal indicating a switching position of the key switch 54 is taken into the engine controller 40, and whether the construction machine 50 is operating or not depends on whether the key switch 54 is turned off (ACC position off). It shall be determined whether or not it is inside. However, whether the construction machine 50 is not operating or is operating can also be determined by detecting the terminal voltage of the alternator or detecting the number of revolutions of the engine 57.
[0084]
A command to rewrite the in-vehicle program 60 of the construction machine 50 from the rewriting dedicated server 3 is transmitted to the construction machine 50 as the wireless communication 11 via the dedicated line 15, the terrestrial base station 8, the dedicated line 9, and the antenna 10 together with the new in-vehicle program 60. Then, the data is received by the antenna 31 of the construction machine 50, and this data is taken into the engine controller 40 from the communication controller 30 via the in-vehicle communication line 51.
[0085]
When the rewrite command is fetched into the engine controller 40, the process proceeds according to the rewrite control program 61b on the flash memory 22.
[0086]
First, it is determined whether the key switch 54 is turned off (step 301 in FIG. 5). As a result, when the key switch 54 is off, that is, when the engine 57 is not operating, it is determined that the rewriting process should be executed (determination Yes in step 301), and as shown in FIG. The received new in-vehicle program 60 is buffered in a predetermined storage area 23a of the RAM 23 (Step 302 in FIG. 5). Unless the receiving process of the new vehicle-mounted program 60 and the buffering process to the storage area 23a have been completed (No in step 303), the process returns to step 301 and the same process is repeated (steps 301 to 303). When the buffering process is completed (Yes in step 303), as shown in FIG. 2B, the CPU 21 stores the rewrite execution flag 23c in a predetermined storage area of the RAM 23 indicating that the rewrite process is being executed. (Step 304 in FIG. 5).
[0087]
Hereinafter, processing similar to steps 103, 104, and 105 in FIG. 3 is performed in steps 305, 306, and 307 in FIG.
[0088]
That is, as shown in FIG. 2C, the leading program 61 stored in the flash memory 22 is copied (transferred) to a predetermined storage area 23b of the RAM 23 (Step 305 in FIG. 5). As a result, the system control right is transferred to the copied top program 61 on the RAM 23 (step 306 in FIG. 5).
[0089]
As a result, the flash memory 22 enters the write mode, and the rewrite processing (A) for rewriting the old vehicle-mounted program 60 'on the flash memory 22 with the new vehicle-mounted program 60 on the RAM 23 is started according to the write control program 61b on the RAM 23 (FIG. Step 307 in FIG. 5).
[0090]
When the rewriting process (A) is executed, the new in-vehicle program 60 buffered in the storage area 23a of the RAM 23 is replaced with the storage area 22b of the flash memory 22, ie, the old in-vehicle program 60 'as shown in FIG. The data is copied (transferred) to the stored area 22b, and the old vehicle-mounted program 60 'is rewritten with the new vehicle-mounted program 60. However, the head program 61 in the head storage area 22a of the flash memory 22 remains without being rewritten (step 308 in FIG. 5).
[0091]
During the rewriting process (A), similarly to step 301, it is determined whether the key switch 54 is turned off (step 309 in FIG. 5). As a result, when the key switch 54 is off, that is, the engine 57 is operating. If not, it is determined that the rewriting process should be continued (Yes in step 309), and the copy (transfer) of the new in-vehicle program 60 to the area 22b has not been completed (No in step 310). Then, the process returns to step 308 to continue the rewriting process (A) (steps 308 to 310). However, when the copy (transfer) of the new in-vehicle program 60 to the area 22b is completed, that is, when the rewriting process (A) is normally completed (Yes in step 310), the steps 107 and 108 in FIG. , 109 are performed in steps 311, 312, and 313 in FIG.
[0092]
That is, as shown in FIG. 2E, the rewriting execution flag 23c is cleared (step 311 in FIG. 5), and then the CPU 21 performs a self-reset process. Therefore, the system control right is transferred to the flash memory 22, and the head program 61 stored in the head storage area 22a of the flash memory 22 is activated. In this case, the reset-time determination program 61a, which is the first program of the head program 61, is executed (step 312 in FIG. 5).
[0093]
FIG. 6 shows the processing contents of the reset determination program 61a.
[0094]
11) If the rewriting execution flag 23c is in the clear state at the time of reset, or if the key switch 54 is ON (No in step 401 in FIG. 6), the in-vehicle program is executed. When the rewriting execution flag 23c is in the clear state, the new vehicle-mounted program 60 stored in the storage area 22b of the flash memory 22 is executed. However, when the rewriting execution flag 23c is on and the key switch 54 is on, the old in-vehicle program 60 'stored in the storage area 22b is not executed, and the storage area 23a of the RAM 23 is not executed. Is executed (step 403 in FIG. 6).
[0095]
12) If the rewriting in progress flag 23c is set at the time of reset and the key switch 54 is off (Yes in step 401 of FIG. 6), it is determined that the rewriting process should be executed (continued). Then, the system control right is transferred to the RAM 23, the flash memory 22 is again set in the write mode, and the old in-vehicle program 60 'in the flash memory 22 is rewritten by the new in-vehicle program 60 in the RAM 23 according to the write control program 61b on the RAM 23. The rewriting process (A) is executed again (step 402 in FIG. 6).
[0096]
When the rewriting process (A) is completed normally, the rewriting in progress flag 23c is cleared at the time of reset, and thus the process of the above 11) is executed. As a result, as shown in FIG. 2 (f), a new in-vehicle program 60 stored in the storage area 22b of the flash memory 22 is started, and normal operation processing such as taking in the time value of the service meter SMR is executed. (Step 313 in FIG. 5).
[0097]
If the key switch 54 has already been turned on at the start of the processing in FIG. 5 or if the key switch 54 has been turned on in the middle of the rewriting processing (A) (No in step 301 or no in step 309) No), the process proceeds to step 314 to operate the engine controller 40 normally, and the CPU 21 performs a self-reset process. When the self-reset process is performed, the reset-time determination program 61a is started, and the process shown in FIG. 6 is executed. Since the key switch 54 is in the ON state, the processing of the above 11) is executed. For this reason, after the judgment processing of step 401 (the key switch 54 is on and the judgment of step 401 is No), if the rewriting processing (A) is not being performed (if the rewriting execution flag 23c is in a clear state), The in-vehicle program stored in the storage area 22b of the flash memory 22 is executed, the rewriting process (A) is being performed (if the rewriting in progress flag 23c is on), and the key switch 54 is turned on. If so, the new in-vehicle program 60 buffered in the storage area 23a of the RAM 23 is executed (step 403). Alternatively, the CPU 21 may directly activate the in-vehicle program buffered in the storage area 22b of the flash memory 22 or the storage area 23a of the RAM 23 without performing the self-reset process (Step 314 in FIG. 5).
[0098]
If a reset occurs due to a drop in the voltage of the battery 53 or the like during the rewriting process (A), the reset determination program 61a is activated and the process proceeds according to the procedure shown in FIG.
[0099]
In the above-described embodiment, the case where the first storage medium is the flash memory 22 and the second storage medium is the RAM 23 has been described. However, the first storage medium and the second storage medium are described below. The storage media may be the same storage media shown or different storage media shown below.
[0100]
・ EEPROM (electrically erasable ROM)
・ RAM backed up by a battery outside the controller
・ RAM backed up by battery inside controller
・ Non-volatile RAM such as FRAM that does not require a backup power supply
.Flash memory 22 provided inside the one-chip microcomputer
In the above-described embodiment, the rewriting process for copying (transferring) the new in-vehicle program 60 buffered in the RAM 23 to the flash memory 22 is performed, but the new in-vehicle program buffered without performing such rewriting process is performed. It is also possible to execute 60 as it is.
[0101]
FIG. 9 shows a storage medium suitable for this embodiment. As shown in FIG. 9, a CPU 21, a flash memory 22, and a RAM 23 are provided inside the one-chip microcomputer, and a reset-time determination program 61a and a rewrite control program 61b are stored in a head storage area 22a of the flash memory 22. Is stored. On the flash memory 22, a first storage area 22d and a second storage area 22e for buffering the vehicle-mounted program 60 are provided.
[0102]
In the first storage area 22d, a rewriting execution flag 22f1 is set to indicate that rewriting is being performed if buffer processing is being performed, and the rewriting execution flag 23f1 is cleared when the buffer processing is completed. Similarly, in the second storage area 22e, if a buffer process is being performed, a rewrite execution flag 22f2 is set to indicate that rewrite is being performed, and when the buffer process is completed, a rewrite execution flag 23f2 is cleared.
[0103]
If buffer processing is being performed in the first storage area 22d, the program executable flag 22g1 indicating that the in-vehicle program in the first storage area 22d is executable is cleared, and when the buffer processing is completed, the program is executed. The possible flag 22g1 is set. Similarly, if buffer processing is being performed in the second storage area 22e, the program executable flag 22g2 indicating that the in-vehicle program in the second storage area 22e is executable is cleared. The possible flag 22g2 is set.
[0104]
When the in-vehicle program 60 is buffered, date information indicating the buffered date and time is stored in each of the storage areas 22d and 22e. The in-vehicle program 60 itself may be provided with information on the date and time of the version upgrade, and this may be stored as date information in the buffered storage areas 22d and 22e.
[0105]
FIG. 7 is a flowchart showing the procedure of the rewriting process, and FIG. 8 is a flowchart showing the procedure at the time of reset. Hereinafter, the process of rewriting the in-vehicle program 60 in the engine controller 40 will be described with reference to FIG.
[0106]
A command to rewrite the in-vehicle program 60 of the construction machine 50 from the rewriting dedicated server 3 is transmitted to the construction machine 50 as the wireless communication 11 via the dedicated line 15, the terrestrial base station 8, the dedicated line 9, and the antenna 10 together with the new in-vehicle program 60. Then, the data is received by the antenna 31 of the construction machine 50, and this data is taken into the engine controller 40 from the communication controller 30 via the in-vehicle communication line 51.
[0107]
When the rewrite command is fetched into the engine controller 40, the process proceeds according to the rewrite control program 61b on the flash memory 22.
[0108]
First, it is determined which of the first storage area 22d and the second storage area 22e is to be buffered in which storage medium (storage area). This criterion is as follows.
[0109]
Criteria 1) If one of the program executable flags 22g1 and 22g2 of the storage areas 22d and 22e is cleared, the new in-vehicle program is stored in the storage area where the program executable flag is cleared. Buffer 60. When one of the rewriting execution flags 22f1 and 22f2 of the storage areas 22d and 22e is in the on state, the storage area in which the rewriting execution flag is on (the storage area in which the rewriting process is being executed) is stored. Buffer the new in-vehicle program 60.
[0110]
Judgment criterion 2) When the program executable flags 22g1 and 22g2 of both storage areas 22d and 22e are set and the in-vehicle program 60 stored in both storage areas 22d and 22e can be executed. Buffers the new in-vehicle program 60 in a predetermined specific storage area, for example, the second storage area 22e.
[0111]
The following criterion 3 may be applied instead of criterion 2.
[0112]
Judgment criterion 3) When the program executable flags 22g1 and 22g2 of both storage areas 22d and 22e are on and the on-board program 60 stored in both storage areas 22d and 22e can be executed. Buffers the new in-vehicle program 60 in the storage area of the earlier date and time of the date and time indicated in the date information (step 501 in FIG. 7).
[0113]
The CPU 21 performs a process of setting the rewriting execution flag 22f1 or 22f2 in the storage area 22d or 22e determined to be buffered (step 502 in FIG. 7).
[0114]
Next, the top program 61 stored in the flash memory 22 is copied (transferred) to a predetermined storage area of the RAM 23 (Step 503 in FIG. 7). As a result, the system control right is transferred to the copied top program 61 on the RAM 23 (step 504 in FIG. 7).
[0115]
As a result, the flash memory 22 enters the write mode, and the new vehicle-mounted program 60 is written in the storage area 22d or 22e on the flash memory 22 according to the write control program 61b on the RAM 23, and the old vehicle-mounted program 60 'is rewritten by the new vehicle-mounted program 60. The rewriting process is started (Step 505 in FIG. 7).
[0116]
At the start of the rewriting process, it is determined whether the key switch 54 is turned off (step 506 in FIG. 7). As a result, when the key switch 54 is off, that is, when the engine 57 is not operating, the rewriting process is continued. The CPU 21 determines that the process should be performed (Yes in step 506), and proceeds to the next step 507, where the CPU 21 buffers the received new in-vehicle program 60 in the storage area 22d or 22e of the flash memory 22 to be buffered. A process of writing and rewriting the old in-vehicle program 60 'with the new in-vehicle program 60 is executed (step 507 in FIG. 7).
[0117]
Unless the receiving process of the new in-vehicle program 60 and the buffering process (writing process) to the storage areas 22d and 22e have been completed (No in step 508), the same process is repeated (steps 506 to 508). When the rewriting process is completed (Yes in step 508), the CPU 21 clears the rewriting execution flag 22f1 or 22f2 of the storage region 22d or 22e for which the rewriting process has been completed, and clears the storage region 22d or 22e for which the rewriting process has been completed. A process for setting the program executable flag 22g1 or 22g2 is performed. At the same time, the program executable flag 22g1 or 22g2 of the storage area 22d or 22e which is not the target of the rewriting process is cleared. For example, when the rewriting process is completed in the second storage area 22e, a process of clearing the rewriting execution flag 2222f2 of the second storage area 22e and setting a program executable flag 22g2 of the second storage area 22e is performed. At the same time, the program executable flag 22g1 of the first storage area 22d is cleared (Step 509 in FIG. 5).
[0118]
Thereafter, the CPU 21 performs a self-reset process. Therefore, the system control right is transferred to the flash memory 22, and the head program 61 stored in the head storage area 22a of the flash memory 22 is activated. In this case, the reset-time determination program 61a, which is the first program of the head program 61, is executed (Step 510 in FIG. 5).
[0119]
FIG. 8 shows the processing contents of the reset determination program 61a.
[0120]
That is, when the reset-time determination program 61a is activated, an executable in-vehicle program is activated according to the following criteria.
[0121]
Judgment Criteria 11) If one of the program executable flags 22g1 and 22g2 of the storage areas 22d and 22e is on, the new in-vehicle program 60 in the storage area on which the program executable flag is on is activated. Let it.
[0122]
Judgment criterion 12) When the program executable flags 22g1 and 22g2 of both storage areas 22d and 22e are on and the vehicle-mounted program 60 stored in both storage areas 22d and 22e can be executed. Starts a new in-vehicle program 60 in a predetermined specific storage area, for example, the first storage area 22d.
[0123]
The following criterion 13 may be applied instead of the criterion 12.
[0124]
Judgment Criteria 13) When the program executable flags 22g1 and 22g2 of both storage areas 22d and 22e are set and the in-vehicle program 60 stored in both storage areas 22d and 22e can be executed. Starts a new in-vehicle program 60 in the storage area of the newer date and time of the date and time indicated in the date information.
[0125]
When the rewriting process is normally completed, a process of setting the program executable flag 22g1 or 22g2 of the storage region 22d or 22e where the rewriting process is completed is performed, and at the same time, the storage region 22d or 22e which is not the target of the rewriting process is set. The program executable flag 22g1 or 22g2 has been cleared. For example, when the rewriting process is completed in the second storage area 22e, the program executable flag 22g2 of the second storage area 22e is set, and at the same time, the program executable flag 22g1 of the first storage area 22d is cleared. Therefore, the latest in-vehicle program 60 in the second storage area 22e is activated and executed according to the criterion 11 (step 511 in FIG. 7).
[0126]
If the key switch 54 is turned on during the rewriting process of FIG. 7 (No in step 506), the process proceeds to step 512 so that the engine controller 40 operates normally, and the CPU 21 performs a self-reset process. . When the self-reset process is performed, the reset-time determination program 61a is started, and the process shown in FIG. 8 is executed. For this reason, according to the criteria 11, 12, and 13, the in-vehicle program 60 in the storage area where the program execution flag is set is activated. Further, the CPU 21 may directly activate the in-vehicle program in the storage areas 22d and 22e of the flash memory 22 without performing the self-reset process (Step 512 in FIG. 7).
[0127]
If a reset occurs due to a drop in the voltage of the battery 53 or the like during the rewriting process, the reset determination program 61a is activated and the process proceeds according to the procedure shown in FIG.
[0128]
In FIG. 9, the first storage area 22d and the second storage area 22e are provided on the flash memory. However, the EEPROM is not limited to the flash memory. The first storage area 22d and the second storage area 22e may be provided on a non-volatile RAM such as an FRAM which does not require a backup power supply.
[0129]
In the present embodiment described above, the in-vehicle program 60 is rewritten in response to a command from the rewrite-only server 3. However, the in-vehicle program 60 may be rewritten in response to a command from the normal operation server 2. .
[0130]
Further, in the above-described embodiment, it is assumed that the in-vehicle program 60 in the construction machine 50 is remotely rewritten in response to a request from the server. However, a service person goes to the construction machine 50 and connects a personal computer to the controller. Thus, the present invention can be applied to the case where the on-board program 60 is rewritten.
[0131]
In the embodiments described above, the construction machine 50 is assumed as a vehicle. However, the present invention can be applied to a case where an in-vehicle program of an arbitrary vehicle such as a general automobile is rewritten.
[Brief description of the drawings]
FIG. 1 is a diagram illustrating an overall configuration of a system according to an embodiment.
FIGS. 2A to 2F are diagrams showing state transitions of a flash memory and a RAM.
FIG. 3 is a flowchart showing a procedure of a rewriting process in a normal state in FIG. 3;
FIG. 4 is a flowchart illustrating a procedure of a rewriting process when a reset occurs during rewriting.
FIG. 5 is a flowchart illustrating a procedure of a rewriting process;
FIG. 6 is a flowchart related to FIG. 5 and showing a procedure of a process at the time of reset;
FIG. 7 is a flowchart illustrating a procedure of a rewriting process;
FIG. 8 is a flowchart related to FIG. 7 and showing a procedure of processing at the time of reset.
FIG. 9 is a diagram showing a configuration example of a storage medium provided with two storage areas for storing a vehicle-mounted program on a flash memory.
[Explanation of symbols]
21 CPU
22 Flash memory
23 RAM

Claims (2)

CPU(21)と、
書き込みおよび読み出しが可能な第1の記憶媒体(22)と、
書き込みおよび読み出しが可能な第2の記憶媒体(23)とが、
車載コントローラ(20)に備えられている車載プログラムの書き換え制御装置であって、
第1の記憶媒体(22)には、
車載プログラム記憶領域(22b)に、車載プログラム(60)が記憶され、その他の領域に、車載プログラムを書き換える書き換え制御プログラム(61b)と、
リセット(再始動)時判断プログラム(61a)が記憶され、
第2の記憶媒体(23)には、
新しい車載プログラム(60)を一時記憶する、新車載プログラム一時記憶領域(23a)と、
車載プログラムを書き換えて実行中であることを示す書き換え実行中フラグ(23c)を記憶させる実行中フラグ記憶領域が設けられており、
書き換え制御プログラム(61b)は、
外部から新しい車載プログラム(60)に書き換える指令を受けたとき、
新しい車載プログラム(60)を、新車載プログラム一時記憶領域(23a)へ一時記憶させ、
書き換え実行中フラグ(23c)を、実行中フラグ記憶領域へ記憶させる第1の機能と、
新車載プログラム一時記憶領域(23a)に記憶されている新車載プログラムを、第1の記憶媒体(22)に記憶されている車載プログラム上に転写する(書き換える)第2の機能と、
書き換え終了時、
書き換え実行中フラグ(23c)を、実行中フラグ記憶領域から消去する第3の機能と、
リセット(再始動)後、
リセット(再始動)時判断プログラム61aを起動する第4の機能をもち、
リセット(再始動)時判断プログラム61aは、
実行中フラグ記憶領域に、書き換え実行中フラグ(23c)があるか否かの判断をする第5の機能と、
書き換え実行中フラグ(23c)がない場合には、書き換え処理が完了したと判断して、第1の記憶媒体(22)の車載プログラム記憶領域(22b)に記憶されている車載プログラム(60)を実行させる第6の機能と、
書き換え実行中フラグ(23c)がある場合には、書き換え処理が完了していないと判断して、書き換え制御プログラム(61b)を実行させる第7の機能をもつこと
を特徴とする車載プログラムの書き換え制御装置。
A CPU (21);
A writable and readable first storage medium (22);
A writable and readable second storage medium (23);
An onboard program rewriting control device provided in the onboard controller (20),
The first storage medium (22) includes:
An in-vehicle program (60) is stored in the in-vehicle program storage area (22b), and a rewrite control program (61b) for rewriting the in-vehicle program is stored in other areas.
A reset (restart) time determination program (61a) is stored,
In the second storage medium (23),
A new in-vehicle program temporary storage area (23a) for temporarily storing a new in-vehicle program (60);
An in-execution flag storage area for storing a rewriting execution flag (23c) indicating that the in-vehicle program is being rewritten and being executed is provided.
The rewrite control program (61b)
When receiving a command to rewrite a new in-vehicle program (60) from outside,
The new in-vehicle program (60) is temporarily stored in the new in-vehicle program temporary storage area (23a),
A first function of storing a rewriting execution flag (23c) in an execution flag storage area;
A second function of transferring (rewriting) the new vehicle-mounted program stored in the new vehicle-mounted program temporary storage area (23a) onto the vehicle-mounted program stored in the first storage medium (22);
At the end of rewriting,
A third function of deleting the rewriting execution flag (23c) from the execution flag storage area;
After reset (restart),
It has a fourth function of activating the reset (restart) time determination program 61a,
The reset (restart) time determination program 61a
A fifth function of determining whether or not a rewriting execution flag (23c) exists in the execution flag storage area;
If there is no rewriting execution flag (23c), it is determined that the rewriting process has been completed, and the in-vehicle program (60) stored in the in-vehicle program storage area (22b) of the first storage medium (22) is deleted. A sixth function to be executed,
When there is a rewriting execution flag (23c), it is determined that the rewriting process has not been completed, and a seventh function for executing the rewriting control program (61b) is provided. apparatus.
車両(50)の外部には、車両(50)内の車載コントローラ(20)と通信手段(15、8、9、10、11)によって通信自在に接続されているサーバ(3)を設け、
前記サーバ(3)は、前記通信手段(15、8、9、10、11)を介して、前記車載コントローラ(20)に、新しい車載プログラム(60)を書き換える指令を与える機能をもつこと
を特徴とする請求項1記載の車載プログラムの書き換え制御装置。
Outside the vehicle (50), there is provided a server (3) communicably connected to an on-vehicle controller (20) in the vehicle (50) by communication means (15, 8, 9, 10, 11),
The server (3) has a function of giving a command to rewrite a new vehicle-mounted program (60) to the vehicle-mounted controller (20) via the communication means (15, 8, 9, 10, 11). The rewrite control device for an in-vehicle program according to claim 1, wherein
JP2003001214A 2003-01-07 2003-01-07 In-vehicle program rewrite control device Pending JP2004210183A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003001214A JP2004210183A (en) 2003-01-07 2003-01-07 In-vehicle program rewrite control device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003001214A JP2004210183A (en) 2003-01-07 2003-01-07 In-vehicle program rewrite control device

Publications (1)

Publication Number Publication Date
JP2004210183A true JP2004210183A (en) 2004-07-29

Family

ID=32819296

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003001214A Pending JP2004210183A (en) 2003-01-07 2003-01-07 In-vehicle program rewrite control device

Country Status (1)

Country Link
JP (1) JP2004210183A (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006298261A (en) * 2005-04-22 2006-11-02 Denso Corp Control unit for automobile
SG138510A1 (en) * 2006-07-06 2008-01-28 Sin Etke Technology Co Ltd In-vehicle computer system
WO2010113348A1 (en) * 2009-03-31 2010-10-07 トヨタ自動車株式会社 Device for updating software mounted on vehicle
JP2010272971A (en) * 2009-05-19 2010-12-02 Nagoya Univ Control system and method for rewriting control program
JP2012035663A (en) * 2010-08-03 2012-02-23 Honda Motor Co Ltd Vehicular program rewriting system
JP2013192092A (en) * 2012-03-14 2013-09-26 Denso Corp On-vehicle device
US8607215B2 (en) 2005-04-20 2013-12-10 Denso Corporation Electronic control system for rewriting control software in an automobile
JP2016024642A (en) * 2014-07-22 2016-02-08 京セラドキュメントソリューションズ株式会社 Electronic device
JP2017228319A (en) * 2017-09-21 2017-12-28 日立オートモティブシステムズ株式会社 Electronic control device for automobile
JP2019040633A (en) * 2018-11-29 2019-03-14 日立オートモティブシステムズ株式会社 Electronic control device for automobile
WO2020095645A1 (en) * 2018-11-06 2020-05-14 株式会社オートネットワーク技術研究所 Program update system and update processing program

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8607215B2 (en) 2005-04-20 2013-12-10 Denso Corporation Electronic control system for rewriting control software in an automobile
JP4577075B2 (en) * 2005-04-22 2010-11-10 株式会社デンソー Automotive control unit
JP2006298261A (en) * 2005-04-22 2006-11-02 Denso Corp Control unit for automobile
SG138510A1 (en) * 2006-07-06 2008-01-28 Sin Etke Technology Co Ltd In-vehicle computer system
WO2010113348A1 (en) * 2009-03-31 2010-10-07 トヨタ自動車株式会社 Device for updating software mounted on vehicle
US8875123B2 (en) 2009-03-31 2014-10-28 Toyota Jidosha Kabushiki Kaisha Vehicle-mounted software updating apparatus
CN102378966A (en) * 2009-03-31 2012-03-14 丰田自动车株式会社 Device for updating software mounted on vehicle
JPWO2010113348A1 (en) * 2009-03-31 2012-10-04 トヨタ自動車株式会社 In-vehicle software update device
JP5273242B2 (en) * 2009-03-31 2013-08-28 トヨタ自動車株式会社 In-vehicle software update device
JP2010272971A (en) * 2009-05-19 2010-12-02 Nagoya Univ Control system and method for rewriting control program
JP2012035663A (en) * 2010-08-03 2012-02-23 Honda Motor Co Ltd Vehicular program rewriting system
JP2013192092A (en) * 2012-03-14 2013-09-26 Denso Corp On-vehicle device
JP2016024642A (en) * 2014-07-22 2016-02-08 京セラドキュメントソリューションズ株式会社 Electronic device
JP2017228319A (en) * 2017-09-21 2017-12-28 日立オートモティブシステムズ株式会社 Electronic control device for automobile
WO2020095645A1 (en) * 2018-11-06 2020-05-14 株式会社オートネットワーク技術研究所 Program update system and update processing program
JP2020075580A (en) * 2018-11-06 2020-05-21 株式会社オートネットワーク技術研究所 Program update system and update processing program
JP7192415B2 (en) 2018-11-06 2022-12-20 株式会社オートネットワーク技術研究所 Program update system and update processing program
JP2019040633A (en) * 2018-11-29 2019-03-14 日立オートモティブシステムズ株式会社 Electronic control device for automobile

Similar Documents

Publication Publication Date Title
US11693645B2 (en) Vehicle information communication system
CN109643254B (en) Vehicle-mounted updating system, vehicle-mounted updating device and updating method of communication device
US11671498B2 (en) Vehicle master device, update data verification method and computer program product
WO2018025685A1 (en) On-board update device, on-board update system, and communication device update method
US8406951B2 (en) Electronic control system for vehicles
US8180521B2 (en) Electronic control system for vehicle
US10625754B2 (en) Control apparatus, control method, and computer program
JPWO2012056773A1 (en) Program rewriting system for vehicles
JP2012091755A (en) Program rewriting system for vehicle
US20210155173A1 (en) Vehicle master device, vehicle electronic control system, activation request instruction method and computer program product
US11467821B2 (en) Vehicle master device, installation instruction determination method and computer program product
US7054728B2 (en) Rewrite control apparatus for onboard program
US11928459B2 (en) Electronic control unit, retry point specifying method and computer program product for specifying retry point
JP4599953B2 (en) Program rewriting system and vehicle computer system
JP2004210183A (en) In-vehicle program rewrite control device
JP4264254B2 (en) In-vehicle program rewrite control system
US11926270B2 (en) Display control device, rewrite progress display control method and computer program product
JP4487007B2 (en) In-vehicle program rewrite control system
JP2004199490A (en) Rewriting control device of onboard program
JP4412390B2 (en) Electronic control device, method for permitting storage of diagnostic results in nonvolatile memory, information processing device, system for permitting storage of diagnostic results in nonvolatile memory
JP5551045B2 (en) Program rewriting system for vehicles
US11907697B2 (en) Vehicle electronic control system, center device, vehicle master device, display control information transmission control method, display control information reception control method, display control information transmission control program, and display control information reception control program
JP4026495B2 (en) Server switching control device
JP2004199491A (en) Rewriting control device of onboard program
JP4414471B2 (en) In-vehicle program rewrite control system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051114

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080303

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080304

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080428

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080624

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20081111