JP2006031617A - Electronic device and random number generation method - Google Patents

Electronic device and random number generation method Download PDF

Info

Publication number
JP2006031617A
JP2006031617A JP2004213151A JP2004213151A JP2006031617A JP 2006031617 A JP2006031617 A JP 2006031617A JP 2004213151 A JP2004213151 A JP 2004213151A JP 2004213151 A JP2004213151 A JP 2004213151A JP 2006031617 A JP2006031617 A JP 2006031617A
Authority
JP
Japan
Prior art keywords
random number
microcomputer
vehicle
value
read
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
JP2004213151A
Other languages
Japanese (ja)
Inventor
Junko Tomita
純子 冨田
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.)
Denso Corp
Original Assignee
Denso Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Denso Corp filed Critical Denso Corp
Priority to JP2004213151A priority Critical patent/JP2006031617A/en
Publication of JP2006031617A publication Critical patent/JP2006031617A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Combined Controls Of Internal Combustion Engines (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To certainly generate a random number different in each electronic device. <P>SOLUTION: In an engine ECU controlling an engine of a vehicle, a microcomputer reads an indefinite value from a register before execution of an initialization process (S330) for writing an initial value into the register inside the microcomputer after a start of operation according to input of power (S310), calculates the random number that is collating data with a smart controller of a driver's own vehicle by use of the read value (S320), stores the random number into an EEPROM of the ECU itself (S360), and makes the smart controller store it (S350). Accordingly, regardless of a vehicle state, the random number different from the smart controller and the engine ECU of another vehicle can be certainly generated and stored. <P>COPYRIGHT: (C)2006,JPO&NCIPI

Description

本発明は、乱数を生成する技術に関するものである。   The present invention relates to a technique for generating a random number.

近年、自動車においては、エンジンを制御する電子制御装置(エンジン制御装置)が、盗難防止用装置と通信して、その盗難防止用装置が正規使用者の乗車を認識していることと、その盗難防止用装置が持っている照合用データと、自装置が持っている照合用データとが一致していることとを確認できたならば、燃料噴射及び点火を実施可能な状態となる、といった車両盗難防止システムが実用化されている。そして、上記照合用データは、車両毎に異なっている必要があるため、乱数を生成させるための演算で算出される。   In recent years, in an automobile, an electronic control device (engine control device) that controls an engine communicates with an anti-theft device so that the anti-theft device recognizes the ride of a legitimate user and the theft. A vehicle in which fuel injection and ignition can be performed if it is confirmed that the verification data held by the prevention device and the verification data held by the own device match. Anti-theft system has been put into practical use. And since the said data for collation needs to differ for every vehicle, it is calculated by the calculation for generating a random number.

ここで、従来より、エンジン制御装置においては、そのエンジン制御装置に入力されるセンサデータを用いて乱数を生成する方法が知られている(例えば、特許文献1参照)。
特表2001−507649号公報
Here, conventionally, in an engine control device, a method of generating a random number using sensor data input to the engine control device is known (for example, see Patent Document 1).
JP 2001-507649 A

しかしながら、センサデータから乱数を生成する方法では、ある特定の車両状態で乱数を生成してその値をデータ書込可能な不揮発性メモリ等に保存する場合、車両毎(詳しくは、その車両に設けられて乱数を生成する電子装置毎)に乱数の値を変化させたくても、生成される乱数が同じような値になってしまう。車両状態が同じであれば、各車両でセンサデータが同じような値になってしまい、その結果、各車両の電子装置で算出される乱数も同じような値になってしまうからである。   However, in the method of generating a random number from sensor data, when generating a random number in a specific vehicle state and storing the value in a nonvolatile memory or the like in which data can be written, each vehicle (specifically, provided in the vehicle) Even if it is desired to change the value of the random number for each electronic device that generates a random number), the generated random number becomes the same value. This is because, if the vehicle state is the same, the sensor data becomes the same value for each vehicle, and as a result, the random numbers calculated by the electronic device of each vehicle also become the same value.

このため、例えば、車両組立工場の組立ライン上で、各車両のエンジン制御装置が、自車両の盗難防止用装置と共有する照合用データを算出して、その算出した照合用データを自車両の盗難防止用装置にも記憶させる、といった照合用データの登録手法を採った場合、組立ライン上では、センサの入力データが各車両で同じような値となるため、別の車両と同じ照合用データが記憶されてしてしまう可能性がある。そして、照合用データの同じ車両が複数存在することになってしまうと、盗難防止用装置を別の車両のものに取り替えることでエンジンを不正に作動させる、といったことが可能になる虞があり、十分なセキュリティ性が得られなくなってしまう。   For this reason, for example, on the assembly line of the vehicle assembly plant, the engine control device of each vehicle calculates verification data shared with the antitheft device of the host vehicle, and the calculated verification data is If a registration method for verification data, such as storing it in an anti-theft device, is used, the sensor input data will be the same value for each vehicle on the assembly line, so the same verification data for other vehicles May be stored. And if there are multiple vehicles with the same collation data, it may be possible to operate the engine illegally by replacing the anti-theft device with another vehicle, Sufficient security cannot be obtained.

本発明は、こうした問題に鑑みなされたものであり、電子装置毎に異なる乱数を確実に生成できるようにすることを目的としている。   The present invention has been made in view of these problems, and an object thereof is to reliably generate different random numbers for each electronic device.

上記目的を達成するためになされた請求項1の乱数生成方法は、揮発性の半導体記憶手段に電源が投入されてから、その半導体記憶手段に初期値を書き込む初期化処理が実施される前に、その半導体記憶手段から値(詳しくは、その半導体記憶手段に記憶されている値)を読み出し、その読み出した値を用いて乱数を生成することを特徴としている。尚、揮発性の半導体記憶手段としては、マイコン(マイクロコンピュータ)内のレジスタや、マイコン内部又は外部のRAMなどを用いることができる。   According to a first aspect of the present invention, there is provided a random number generation method according to claim 1, wherein the volatile semiconductor memory means is powered on before an initialization process for writing an initial value to the semiconductor memory means is performed. The semiconductor memory means reads a value (specifically, a value stored in the semiconductor memory means), and generates a random number using the read value. As the volatile semiconductor storage means, a register in a microcomputer (microcomputer), an internal or external RAM, etc. can be used.

つまり、一般に、電子装置には揮発性の半導体記憶手段が備えられ、電子装置に電源が投入されると、その半導体記憶手段にも電源が投入(供給)される。そして、その半導体記憶手段の記憶値は、電源が投入された時点では不定であり、電源の投入毎に異なる値となるため、電子装置では、電源が投入されて動作を開始すると、まず、その半導体記憶手段に予め定められた初期値を書き込む初期化処理を実施し、その後、その半導体記憶手段を演算に用いるようになっている。   That is, generally, an electronic device is provided with volatile semiconductor memory means, and when the electronic device is turned on, the semiconductor memory means is also turned on (supplied). And since the stored value of the semiconductor memory means is indefinite when the power is turned on and becomes a different value every time the power is turned on, in the electronic device, when the power is turned on and the operation is started, An initialization process for writing a predetermined initial value in the semiconductor memory means is performed, and then the semiconductor memory means is used for calculation.

そこで、本発明では、初期化処理によって揮発性の半導体記憶手段に初期値が書き込まれる前は、その半導体記憶手段の値が不定であり、電子装置毎に異なった値になるであろうという点に着目して、初期化処理が実施される前に、その半導体記憶手段から不定な値を読み出し、その読み出した値を用いて乱数を生成するようにしている。   Therefore, in the present invention, before the initial value is written in the volatile semiconductor memory means by the initialization process, the value of the semiconductor memory means is indefinite and will be different for each electronic device. In particular, before the initialization process is performed, an indefinite value is read from the semiconductor memory means, and a random number is generated using the read value.

このような本発明の乱数生成方法によれば、センサデータから乱数を生成する場合の前述した問題がなく、電子装置毎に異なる乱数を確実に生成することができるようになる。
次に、請求項2の電子装置では、マイコンを備えており、そのマイコンは、電源の投入に伴い動作を開始してから、当該マイコン内のレジスタに初期値を書き込む初期化処理を実施する前に、そのレジスタから値を読み出し、その読み出した値を用いて乱数を生成する。
According to such a random number generation method of the present invention, there is no problem described above when generating random numbers from sensor data, and different random numbers can be generated reliably for each electronic device.
According to another aspect of the present invention, the electronic device includes a microcomputer, and the microcomputer starts operating when the power is turned on and before performing an initialization process for writing an initial value to a register in the microcomputer. Then, a value is read from the register, and a random number is generated using the read value.

つまり、マイコンに電源が投入されると、そのマイコン内のレジスタにも電源が投入(供給)されるが、その電源投入時のレジスタ値は不定である。そこで、マイコンは、請求項1の方法によって乱数を生成しており、詳しくは、電源の投入により動作を開始してからレジスタに初期値を書き込む初期化処理を実施する前に、そのレジスタから不定な値を読み出し、その読み出した値を用いて乱数を生成するようにしている。   That is, when power is turned on to a microcomputer, power is also turned on (supplied) to a register in the microcomputer, but the register value at the time of turning on the power is indefinite. Therefore, the microcomputer generates a random number according to the method of claim 1. Specifically, the microcomputer generates an indeterminate value from the register before the initialization process for writing the initial value to the register after the operation is started by turning on the power. A random value is read out and a random number is generated using the read out value.

このため、請求項2の電子装置によれば、センサデータから乱数を生成する場合の前述した問題がなく、電子装置毎に異なる乱数を確実に生成することができるようになる。
次に、請求項3の電子装置では、請求項2の電子装置において、マイコンは、上記初期化処理を実施する前に、複数のレジスタから値を読み出し、その読み出した各値を用いて乱数を生成する。
For this reason, according to the electronic device of the second aspect, there is no problem described above when the random number is generated from the sensor data, and a different random number can be surely generated for each electronic device.
Next, in the electronic device of claim 3, in the electronic device of claim 2, the microcomputer reads values from a plurality of registers before performing the initialization process, and uses each of the read values to generate a random number. Generate.

この電子装置によれば、不定な複数のレジスタ値から乱数を生成することとなるため、発散した乱数(つまり、電子装置毎に異なる乱数)を一層確実に生成することができる。また、複数のレジスタ値を加工することにより、様々なサイズや型の乱数を発生させることができるという利点もある。   According to this electronic device, since random numbers are generated from a plurality of indefinite register values, a divergent random number (that is, a different random number for each electronic device) can be generated more reliably. There is also an advantage that random numbers of various sizes and types can be generated by processing a plurality of register values.

以下に、本発明が適用された実施形態のエンジン制御装置(以下、エンジンECUという)について説明する。尚、本実施形態のエンジンECUは、車両に搭載されて、その車両のエンジンを制御するものである。   An engine control device (hereinafter referred to as an engine ECU) according to an embodiment to which the present invention is applied will be described below. The engine ECU of the present embodiment is mounted on a vehicle and controls the engine of the vehicle.

図1に示すように、本実施形態のエンジンECU11は、エンジンを制御するための各種処理を実行するマイコン13と、データ書換可能な不揮発性メモリ(本実施形態では、EEPROM)15と、電源回路17とを備えている。   As shown in FIG. 1, the engine ECU 11 of the present embodiment includes a microcomputer 13 that executes various processes for controlling the engine, a non-volatile memory (in the present embodiment, EEPROM) 15 that can rewrite data, and a power supply circuit. 17.

そして、マイコン13には、CPU21、ROM23、電源バックアップされない通常のRAM25、及び電源バックアップされるバックアップRAM27や、複数のレジスタ1〜nからなるレジスタ群29などが内蔵されている。   The microcomputer 13 includes a CPU 21, a ROM 23, a normal RAM 25 that is not backed up by a power source, a backup RAM 27 that is backed up by a power source, a register group 29 including a plurality of registers 1 to n, and the like.

また、電源回路17は、車両のイグニッションスイッチ31がオンされると供給される車載バッテリ33の電圧(バッテリ電圧)VBから、マイコン13を動作させるための一定の電源電圧Vd(例えば5Vの電圧)を生成して、その電源電圧Vdをマイコン13やEEPROM15に供給すると共に、車載バッテリ33から常時供給されるバッテリ電圧VBから上記バックアップRAM27がデータを保持するための一定の電源電圧Vs(例えば3Vの電圧)を生成して、マイコン13に供給する。そして、この電源電圧Vsは、バックアップRAM27に供給される。   The power supply circuit 17 is a constant power supply voltage Vd (for example, a voltage of 5V) for operating the microcomputer 13 from the voltage (battery voltage) VB of the in-vehicle battery 33 that is supplied when the ignition switch 31 of the vehicle is turned on. And the power supply voltage Vd is supplied to the microcomputer 13 and the EEPROM 15, and the backup RAM 27 holds a constant power supply voltage Vs (for example, 3V) from the battery voltage VB constantly supplied from the in-vehicle battery 33. Voltage) is generated and supplied to the microcomputer 13. The power supply voltage Vs is supplied to the backup RAM 27.

また更に、EEPROM15には、後述する乱数Aを始め、バッテリ上がりやバッテリ外れが起こっても継続して保存すべきデータが格納される。
一方、エンジンECU11は、同じ車両に搭載されたスマートコントローラ35と車両内の通信線37を介して接続されている。
Furthermore, the EEPROM 15 stores a random number A, which will be described later, and data to be stored continuously even if the battery runs out or the battery is removed.
On the other hand, the engine ECU 11 is connected to a smart controller 35 mounted on the same vehicle via a communication line 37 in the vehicle.

スマートコントローラ35は、車載送信機(図示省略)から車外の検知エリアに送信要求信号を送信させると共に、車両の使用者に携帯される電子キーとしての携帯機39がその送信要求信号を受信することで送信する返送信号を車載受信機(図示省略)によって受信し、その受信した返送信号に含まれているIDコードと予め記憶されている当該車両に固有のIDコードとが一致していると判定すると、その受信された返送信号が当該車両に専用の携帯機(以下、正規の携帯機という)から送信された返送信号であると判断して、その後、車両のドア外側に設けられているアンロック用スイッチが押されたことを検知するとドアをアンロック状態にする、といったスマートドアロック制御を行う。   The smart controller 35 transmits a transmission request signal from a vehicle-mounted transmitter (not shown) to a detection area outside the vehicle, and the portable device 39 as an electronic key carried by the user of the vehicle receives the transmission request signal. Is received by an in-vehicle receiver (not shown), and the ID code included in the received return signal is matched with the ID code unique to the vehicle stored in advance. Then, it is determined that the received return signal is a return signal transmitted from a portable device dedicated to the vehicle (hereinafter referred to as a regular portable device), and thereafter, an amplifier provided outside the door of the vehicle. When it detects that the lock switch has been pressed, smart door lock control is performed such that the door is unlocked.

更に、スマートコントローラ35は、車室内用送信機(図示省略)から車室内における運転席付近の検知エリアにも送信要求信号を送信させると共に、その送信要求信号を受信した携帯機39が送信する返送信号を車室内用受信機(図示省略)によって受信し、その受信した返送信号に含まれているIDコードと予め記憶されている当該車両に固有のIDコードとが一致していると判定すると、正規の携帯機39が車室内に存在しており、当該車両の正規の使用者が運転席に居ると認識する、といった車室内照合も行う。   Further, the smart controller 35 transmits a transmission request signal from a vehicle interior transmitter (not shown) to a detection area in the vicinity of the driver's seat in the vehicle interior, and a return transmitted by the portable device 39 that has received the transmission request signal. When the signal is received by the vehicle interior receiver (not shown) and it is determined that the ID code included in the received return signal matches the ID code unique to the vehicle stored in advance, Car interior verification is also performed such that the authorized portable device 39 is present in the passenger compartment and that the authorized user of the vehicle is in the driver's seat.

また、このスマートコントローラ35にも、当該コントローラ35の上記動作を司るマイコン41と、データ書換可能な不揮発性メモリ(本実施形態では、EEPROM)43とが備えられており、そのEEPROM43には、エンジンECU11のEEPROM15に格納される乱数Aと同じ乱数A’が格納される。   The smart controller 35 is also provided with a microcomputer 41 that controls the operation of the controller 35 and a non-volatile memory (in this embodiment, an EEPROM) 43 that can rewrite data. The same random number A ′ as the random number A stored in the EEPROM 15 of the ECU 11 is stored.

そして、エンジンECU11は、イグニッションスイッチ31がオンされた際に、スマートコントローラ35と通信線37を介して通信することにより、そのスマートコントローラ35が上記車室内照合でOKと判定していること(つまり、正規の携帯機39が車室内に存在していると認識していること)と、そのスマートコントローラ35のEEPROM43に格納されている照合用データとしての乱数A’と当該エンジンECU11のEEPROM15に格納されている照合用データとしての乱数Aとが一致していることとを確認し、その確認ができたならばエンジンに対する燃料噴射及び点火を実施可能なエンジン制御許可状態となる、といった車両盗難防止用の制御を行う。   Then, when the ignition switch 31 is turned on, the engine ECU 11 communicates with the smart controller 35 via the communication line 37, so that the smart controller 35 determines that the vehicle interior verification is OK (that is, And that the portable device 39 is recognized as being present in the passenger compartment), the random number A ′ as the verification data stored in the EEPROM 43 of the smart controller 35, and the EEPROM 15 of the engine ECU 11 The anti-theft of the vehicle that confirms that the random number A as the collation data is in agreement, and if the confirmation can be made, the engine control is permitted to perform fuel injection and ignition to the engine. Control.

そこで次に、このような車両盗難防止用の制御を行うために、エンジンECU11のマイコン13とスマートコントローラ35のマイコン41とのそれぞれで実行される処理について、図2に基づき説明する。尚、図2の処理は、エンジンECU11のEEPROM15とスマートコントローラ35のEEPROM43とに、乱数A,A’が既に格納されている通常の場合に実行される。そして、ここでは、それらEEPROM15,43に乱数A,A’が既に格納されているものとする。   Then, in order to perform such control for preventing vehicle theft, processing executed by the microcomputer 13 of the engine ECU 11 and the microcomputer 41 of the smart controller 35 will be described with reference to FIG. 2 is executed in a normal case where random numbers A and A 'are already stored in the EEPROM 15 of the engine ECU 11 and the EEPROM 43 of the smart controller 35. Here, it is assumed that random numbers A and A ′ have already been stored in these EEPROMs 15 and 43.

まず、エンジンECU11では、イグニッションスイッチ31がオンされて電源回路17から電源電圧Vdが出力されると、マイコン13が動作を開始する。
そして、図2(A)に示すように、エンジンECU11のマイコン13が動作を開始すると、まずS110にて、RAM23の所定領域とレジスタ1〜n(レジスタ群29)に予め定められた初期値を書き込む初期化処理を実行し、続くS120にて、EEPROM15から乱数Aを読み出す。
First, in the engine ECU 11, when the ignition switch 31 is turned on and the power supply voltage Vd is output from the power supply circuit 17, the microcomputer 13 starts its operation.
As shown in FIG. 2 (A), when the microcomputer 13 of the engine ECU 11 starts operating, first, in S110, predetermined values in the RAM 23 and registers 1 to n (register group 29) are set to predetermined initial values. The initialization process for writing is executed, and the random number A is read from the EEPROM 15 in the subsequent S120.

次に、S130にて、バックアップRAM27からキーコードBを読み出し、そのキーコードBと上記S120でEEPROM15から読み出した乱数Aとを所定の演算式に代入して、データCを作成する。   Next, in S130, the key code B is read from the backup RAM 27, and the data C is created by substituting the key code B and the random number A read from the EEPROM 15 in S120 into a predetermined arithmetic expression.

ここで、本実施形態において、マイコン13は、後述するS190における通常制御の処理中で、バッテリ電圧VBの値を読み取ると共に、その読み取った値を用いてキーコードBを算出し、その算出したキーコードBをバックアップRAM27に格納するようにしている。そして、S130では、そのキーコードB(即ち、イグニッションスイッチ31が前回オンされてからオフされるまでの動作中に算出しておいたキーコードB)をバックアップRAM27から読み出すのである。このため、キーコードBは、S130の処理が実行される毎に違う値となる。   Here, in the present embodiment, the microcomputer 13 reads the value of the battery voltage VB and calculates the key code B using the read value during the normal control process in S190 described later, and the calculated key. The code B is stored in the backup RAM 27. In S130, the key code B (that is, the key code B calculated during the operation from when the ignition switch 31 was turned on to when it was turned off) is read from the backup RAM 27. For this reason, the key code B becomes a different value every time the process of S130 is executed.

次に、S140にて、上記S130でバックアップRAM27から読み出した今回のキーコードBを、スマートコントローラ35に送信する。
そして、そのキーコードBがスマートコントローラ35に受信されると、スマートコントローラ35では、マイコン41が図2(B)の処理を開始する。
Next, in S140, the current key code B read from the backup RAM 27 in S130 is transmitted to the smart controller 35.
Then, when the key code B is received by the smart controller 35, the microcomputer 41 starts the processing of FIG.

即ち、スマートコントローラ35のマイコン41は、まずS210にて、エンジンECU11から受信したキーコードBを読み込む。
そして、続くS220にて、携帯機39との上記車室内照合でOKと判定済みか否かを判断し、OKと判定済みでなければ(S220:NO)、そのまま当該図2(B)の処理を終了するが、OKと判定済みであれば(つまり、正規の携帯機39が車室内に存在していると認識しているならば)、S230に進む。
That is, the microcomputer 41 of the smart controller 35 first reads the key code B received from the engine ECU 11 in S210.
Then, in subsequent S220, it is determined whether or not it is determined to be OK in the above-described vehicle interior matching with the portable device 39. If it is not determined to be OK (S220: NO), the processing of FIG. However, if it is determined as OK (that is, if it is recognized that the regular portable device 39 is present in the vehicle interior), the process proceeds to S230.

S230では、EEPROM43から乱数A’を読み出す。そして、次のS240にて、上記S210で読み込んだエンジンECU11からのキーコードBと、上記S230でEEPROM43から読み出した乱数A’とを、エンジンECU11側の上記S130と同じ演算式に代入して、データC’を作成する。次に、S250にて、上記S240で作成したデータC’をエンジンECU11へ送信し、その後、当該図2(B)の処理を終了する。   In S230, the random number A ′ is read from the EEPROM 43. In the next step S240, the key code B read from the engine ECU 11 read in step S210 and the random number A ′ read from the EEPROM 43 in step S230 are substituted into the same equation as in step S130 on the engine ECU 11 side. Data C ′ is created. Next, in S250, the data C 'created in S240 is transmitted to the engine ECU 11, and then the processing of FIG.

一方、図2(A)に示すように、エンジンECU11のマイコン13は、上記S140でキーコードBを送信した後、次のS150にて、規定時間以内にスマートコントローラ35からの上記データC’を受信したか否かを判定し、規定時間以内にデータC’を受信したと判定したならば、S160に進んで、スマートコントローラ35から受信したデータC’を読み込む。   On the other hand, as shown in FIG. 2A, the microcomputer 13 of the engine ECU 11 transmits the key code B in S140, and then receives the data C ′ from the smart controller 35 within a specified time in S150. It is determined whether or not the data C ′ has been received, and if it is determined that the data C ′ has been received within the specified time, the process proceeds to S160, and the data C ′ received from the smart controller 35 is read.

そして、マイコン13は、続くS170にて、上記S130で作成したデータCと、上記S160で読み込んだスマートコントローラ35からのデータC’とが一致しているか否かを判定し、データCとデータC’とが一致していれば、スマートコントローラ35が上記車室内照合でOKと判定しており、且つ、そのスマートコントローラ35のEEPROM43に格納されている乱数A’と当該エンジンECU11のEEPROM15に格納されている乱数Aとが一致しているということであることから、S180に進んで、エンジンに対する燃料噴射及び点火を許可する内部設定を行う。そして、その後、S190に進んで、エンジンを制御するための通常制御の処理を行う。   In step S170, the microcomputer 13 determines whether the data C created in step S130 matches the data C ′ read from the smart controller 35 read in step S160. If 'is in agreement, the smart controller 35 has determined that the vehicle interior verification is OK, and the random number A ′ stored in the EEPROM 43 of the smart controller 35 and the EEPROM 15 of the engine ECU 11 are stored. Therefore, the process proceeds to S180, and internal setting for permitting fuel injection and ignition for the engine is performed. Then, the process proceeds to S190, and normal control processing for controlling the engine is performed.

また、上記S150にて、規定時間以内にデータC’を受信しなかったと判定した場合(S150:NO)、或いは、上記S170にて、データCとデータC’とが一致していないと判定した場合(S170:NO)には、スマートコントローラ35が上記車室内照合でOKと判定していないか、或いは、スマートコントローラ35のEEPROM43に格納されている乱数A’と当該エンジンECU11のEEPROM15に格納されている乱数Aとが一致しておらず、通信相手のスマートコントローラ35が自車両用の正規品ではないということであることから、S185に移行して、エンジンに対する燃料噴射及び点火を禁止する内部設定を行い、その後、S190に進む。このため、S185の処理が行われた場合には、S190における通常制御の処理で燃料噴射及び点火が実施されず、エンジンの作動が禁止されることとなる。   In S150, when it is determined that the data C ′ is not received within the specified time (S150: NO), or in S170, it is determined that the data C and the data C ′ do not match. In this case (S170: NO), the smart controller 35 has not determined that the vehicle interior verification is OK, or is stored in the EEPROM 15 of the engine ECU 11 and the random number A ′ stored in the EEPROM 43 of the smart controller 35. The random number A does not match, and the smart controller 35 of the communication partner is not a genuine product for the own vehicle. Therefore, the process proceeds to S185 to prohibit the fuel injection and ignition for the engine. After setting, the process proceeds to S190. For this reason, when the process of S185 is performed, fuel injection and ignition are not performed in the normal control process of S190, and the operation of the engine is prohibited.

ところで、本実施形態では、エンジンECU11のEEPROM15に乱数Aが未だ格納されていない状態で、通信線37に外部装置を接続し、イグニッションスイッチ31をオンしてエンジンECU11を作動させると共に、その外部装置からエンジンECU11へ乱数登録要求を送信することにより、エンジンECU11のEEPROM15とスマートコントローラ35のEEPROM43とに同じ乱数を格納させることができるようになっている。   By the way, in this embodiment, an external device is connected to the communication line 37 in a state where the random number A is not yet stored in the EEPROM 15 of the engine ECU 11, the ignition switch 31 is turned on to operate the engine ECU 11, and the external device By transmitting a random number registration request from the engine ECU 11 to the engine ECU 11, the same random number can be stored in the EEPROM 15 of the engine ECU 11 and the EEPROM 43 of the smart controller 35.

そこで次に、このような乱数登録のためにエンジンECU11のマイコン13が実行する処理について、図3を用いて説明する。
図3に示すように、エンジンECU11のマイコン13は、EEPROM15に乱数Aが未だ格納されていない場合に、イグニッションスイッチ31のオンに伴い電源回路17からの電源電圧Vdを受けて動作を開始すると、まずS310にて、レジスタ1〜nの何れか(本実施形態では、例えばレジスタ1とレジスタ2であるとする)から値を読み出す。尚、この時点でレジスタ1〜nの値は不定である。
Then, the process which the microcomputer 13 of engine ECU11 performs for such random number registration is demonstrated using FIG.
As shown in FIG. 3, when the random number A is not yet stored in the EEPROM 15, the microcomputer 13 of the engine ECU 11 starts operating upon receiving the power supply voltage Vd from the power supply circuit 17 when the ignition switch 31 is turned on. First, in S310, a value is read from one of the registers 1 to n (in this embodiment, for example, register 1 and register 2). At this time, the values of the registers 1 to n are undefined.

次に、S320にて、上記S310で読み出したレジスタ1,2の各値を用いて乱数Aを生成する。例えば、読み出したレジスタ1,2の各値を、予め決められた乱数算出用の計算式に代入することで、乱数Aを算出する。   Next, in S320, a random number A is generated using each value of the registers 1 and 2 read in S310. For example, the random number A is calculated by substituting the read values of the registers 1 and 2 into a predetermined calculation formula for calculating random numbers.

そして、次のS330にて、図2(A)のS110と同じ初期化処理(つまり、RAM23の所定領域とレジスタ1〜nに初期値を書き込む処理)を実行し、続くS340にて、上記初期化処理を実行してから一定時間以内に前述の乱数登録要求を受信したか否かを判定する。   Then, in the next S330, the same initialization process as S110 in FIG. 2A (that is, the process of writing the initial values in the predetermined area of the RAM 23 and the registers 1 to n) is executed. It is determined whether or not the above-described random number registration request has been received within a predetermined time after executing the digitizing process.

そして、一定時間以内に外部装置からの乱数登録要求を受信しなかった場合(S340:NO)には、そのまま通常制御の処理へ移行するが、一定時間以内に乱数登録要求を受信した場合(S340:YES)には、S350に進んで、上記S320で算出した乱数Aをスマートコントローラ35へ送信する。   If a random number registration request is not received from an external device within a certain time (S340: NO), the process proceeds to normal control as it is, but if a random number registration request is received within a certain time (S340). : YES), the process proceeds to S350, and the random number A calculated in S320 is transmitted to the smart controller 35.

すると、スマートコントローラ35では、上記S350で送信された乱数Aを受信して、EEPROM43に前述の乱数A’として格納し、その格納が完了すると、エンジンECU11へ登録完了通知を送信することとなる。   Then, the smart controller 35 receives the random number A transmitted in S350 and stores it as the aforementioned random number A 'in the EEPROM 43. When the storage is completed, a registration completion notification is transmitted to the engine ECU 11.

そこで、エンジンECU11のマイコン13は、次のS355にて、スマートコントローラ35からの上記登録完了通知を受信し、その登録完了通知を受信できたならば、次のS360に進んで、上記S320で算出した乱数AをEEPROM15に格納する。そして、その後、通常制御の処理へ移行する。   Therefore, the microcomputer 13 of the engine ECU 11 receives the registration completion notification from the smart controller 35 in the next S355, and if the registration completion notification is received, proceeds to the next S360 and calculates in the S320. The random number A is stored in the EEPROM 15. Then, the process proceeds to normal control processing.

尚、本実施形態において、上記S340から通常制御の処理へ直接移行した場合、或いは、上記S360から通常制御の処理へ移行した場合には、エンジンに対する燃料噴射及び点火が許可されないため、エンジンが作動することはない。また、上記S360から通常制御の処理へ移行した場合には、エンジンECU11のEEPROM15とスマートコントローラ35のEEPROM43とに同じ乱数が格納されることとなるため、イグニッションスイッチ31を一旦オフしてから再度オンし、前述した図2(A)のS180で燃料噴射及び点火が許可されるようにすれば、エンジンを作動させることができる。   In this embodiment, when the process directly shifts from S340 to the normal control process or when the process shifts from S360 to the normal control process, fuel injection and ignition to the engine are not permitted, and the engine is activated. Never do. Further, when the process shifts from S360 to the normal control process, the same random number is stored in the EEPROM 15 of the engine ECU 11 and the EEPROM 43 of the smart controller 35. Therefore, the ignition switch 31 is turned off and then turned on again. If the fuel injection and ignition are permitted in S180 of FIG. 2A described above, the engine can be operated.

以上のような本実施形態のエンジンECU11では、マイコン13が、電源回路17による電源投入に伴い動作を開始してから、当該マイコン13内のレジスタ1〜nに初期値を書き込む初期化処理(S330)を実施する前に、そのレジスタ1〜nのうちのレジスタ1,2から値を読み出して(S310)、その読み出した値から乱数Aを算出し(S320)、その乱数Aを自ECU11のEEPROM15に格納すると共に(S360)、スマートコントローラ35のEEPROM43にも格納させるようにしている(S350)。   In the engine ECU 11 of the present embodiment as described above, after the microcomputer 13 starts its operation when the power supply circuit 17 turns on the power, the initialization process (S330) of writing initial values to the registers 1 to n in the microcomputer 13 is performed. ), The value is read from the registers 1 and 2 of the registers 1 to n (S310), the random number A is calculated from the read value (S320), and the random number A is stored in the EEPROM 15 of the own ECU 11. (S360) and also stored in the EEPROM 43 of the smart controller 35 (S350).

つまり、マイコン13に電源が投入されると、そのマイコン13内のレジスタ1〜nにも電源が投入されるが、その電源投入時のレジスタ値は不定である。そこで、マイコン13は、電源の投入により動作を開始してから初期化処理を実施する前に、レジスタ1,2から不定な値を読み出し、その読み出した不定な値を用いて乱数Aを算出するようにしている。   That is, when the microcomputer 13 is turned on, the registers 1 to n in the microcomputer 13 are also turned on, but the register value at the time of turning on the power is indefinite. Therefore, the microcomputer 13 reads an indefinite value from the registers 1 and 2 before starting the initialization process after the operation is started by turning on the power, and calculates the random number A using the read indeterminate value. I am doing so.

このため、本実施形態のエンジンECU11によれば、車両状態に関係なく、他の車両のエンジンECU11とは異なる乱数を確実に生成して、その乱数を自ECU11のEEPROM15と自車両におけるスマートコントローラ35のEEPROM43とに格納させることができる。そして、エンジンECU11とスマートコントローラ35との照合用データとして乱数が同じ車両が複数存在してしまうことを防止することができるため、スマートコントローラ35と携帯機39を別の車両のものにセットで交換してエンジンを不正に作動させる、といった窃盗行為を確実に防止することができる。   For this reason, according to the engine ECU 11 of the present embodiment, a random number different from the engine ECU 11 of other vehicles is reliably generated regardless of the vehicle state, and the random number is generated by the EEPROM 15 of the own ECU 11 and the smart controller 35 in the own vehicle. Can be stored in the EEPROM 43. In addition, since it is possible to prevent a plurality of vehicles having the same random number from being used as collation data between the engine ECU 11 and the smart controller 35, the smart controller 35 and the portable device 39 are exchanged as a set for another vehicle. Thus, it is possible to surely prevent theft such as illegally operating the engine.

また、本実施形態のエンジンECU11では、マイコン13が、複数のレジスタ1,2から読み出した各値を用いて乱数Aを算出するようにしているため、車両毎(ECU11毎)に異なる発散した乱数を一層確実に生成することができる。   Further, in the engine ECU 11 of the present embodiment, the microcomputer 13 calculates the random number A using each value read from the plurality of registers 1 and 2, so that a different random number is generated for each vehicle (for each ECU 11). Can be generated more reliably.

以上、本発明の一実施形態について説明したが、本発明はこうした実施形態に何等限定されるものではなく、本発明の要旨を逸脱しない範囲において、種々なる態様で実施し得ることは勿論である。   As mentioned above, although one Embodiment of this invention was described, this invention is not limited to such Embodiment at all, Of course, in the range which does not deviate from the summary of this invention, it can implement in a various aspect. .

例えば、上記実施形態では、複数のレジスタ値から乱数を算出したが、乱数を算出するのに用いるレジスタ値の数は1つでも良い。また、レジスタのビット長が大きい場合には、1つのレジスタ値の一部のビット列を用いて乱数を算出するようにしても良い。   For example, in the above embodiment, a random number is calculated from a plurality of register values, but the number of register values used to calculate a random number may be one. Further, when the bit length of the register is large, a random number may be calculated using a partial bit string of one register value.

一方、上記実施形態では、レジスタから読み出した不定な値を、乱数算出用の計算式に代入して乱数Aを算出したが、レジスタから読み出した不定な値を、そのまま乱数Aとして扱うようにしても良い。例えば、図3のS320では、レジスタ1,2から読み出した各値を直列につなげたデータを、乱数Aとして算出するようにしても良い。   On the other hand, in the above embodiment, the indeterminate value read from the register is substituted for the random number calculation formula to calculate the random number A. However, the indeterminate value read from the register is treated as the random number A as it is. Also good. For example, in S320 of FIG. 3, data obtained by connecting the values read from the registers 1 and 2 in series may be calculated as the random number A.

また、上記実施形態では、初期化処理を実施する前の不定なレジスタ値から乱数を生成したが、初期化処理を実行する前にRAM25から不定な値を読み出して、その値から乱数を生成するようにしても良い。   In the above embodiment, a random number is generated from an indefinite register value before the initialization process is performed. However, before executing the initialization process, an indeterminate value is read from the RAM 25 and a random number is generated from the value. You may do it.

また、本発明は、エンジンECUのような車載電子装置に限らず、他の様々な電子装置にも同様に適用することができる。   Further, the present invention is not limited to an on-vehicle electronic device such as an engine ECU, and can be similarly applied to various other electronic devices.

実施形態のエンジンECUをスマートコントローラと共に表す構成図である。It is a block diagram showing engine ECU of an embodiment with a smart controller. 車両盗難防止のために、エンジンECUのマイコンとスマートコントローラのマイコンとのそれぞれで実行される処理を表すフローチャートである。It is a flowchart showing the process performed by each of the microcomputer of engine ECU, and the microcomputer of a smart controller in order to prevent vehicle theft. エンジンECUのマイコンが乱数を算出するために実行する処理を表すフローチャートである。It is a flowchart showing the process performed in order for the microcomputer of engine ECU to calculate a random number.

符号の説明Explanation of symbols

1〜n…レジスタ、11…エンジンECU、13,41…マイコン、15,43…EEPROM、17…電源回路、21…CPU、23…ROM、25…RAM、27…バックアップRAM、29…レジスタ群、31…イグニッションスイッチ、33…車載バッテリ、35…スマートコントローラ、37…通信線、39…携帯機(電子キー)   DESCRIPTION OF SYMBOLS 1-n ... Register, 11 ... Engine ECU, 13, 41 ... Microcomputer, 15, 43 ... EEPROM, 17 ... Power supply circuit, 21 ... CPU, 23 ... ROM, 25 ... RAM, 27 ... Backup RAM, 29 ... Register group, 31 ... Ignition switch, 33 ... In-vehicle battery, 35 ... Smart controller, 37 ... Communication line, 39 ... Portable device (electronic key)

Claims (3)

乱数を生成するための乱数生成方法であって、
揮発性の半導体記憶手段に電源が投入されてから、その半導体記憶手段に初期値を書き込む初期化処理が実施される前に、その半導体記憶手段から値を読み出し、その読み出した値を用いて乱数を生成すること、
を特徴とする乱数生成方法。
A random number generation method for generating a random number,
After power is turned on to the volatile semiconductor storage means, the value is read from the semiconductor storage means before the initialization process for writing the initial value to the semiconductor storage means is performed, and a random number is used using the read value. Generating,
A random number generation method characterized by
マイコンを備えた電子装置において、
前記マイコンは、電源の投入に伴い動作を開始してから、当該マイコン内のレジスタに初期値を書き込む初期化処理を実施する前に、そのレジスタから値を読み出し、その読み出した値を用いて乱数を生成すること、
を特徴とする電子装置。
In an electronic device equipped with a microcomputer,
The microcomputer starts operation when the power is turned on, reads the value from the register before executing the initialization process to write the initial value to the register in the microcomputer, and uses the read value to generate a random number. Generating,
An electronic device characterized by the above.
請求項2に記載の電子装置において、
前記マイコンは、複数のレジスタから値を読み出し、その読み出した各値を用いて乱数を生成すること、
を特徴とする電子装置。
The electronic device according to claim 2.
The microcomputer reads values from a plurality of registers, generates random numbers using the read values,
An electronic device characterized by the above.
JP2004213151A 2004-07-21 2004-07-21 Electronic device and random number generation method Pending JP2006031617A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004213151A JP2006031617A (en) 2004-07-21 2004-07-21 Electronic device and random number generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004213151A JP2006031617A (en) 2004-07-21 2004-07-21 Electronic device and random number generation method

Publications (1)

Publication Number Publication Date
JP2006031617A true JP2006031617A (en) 2006-02-02

Family

ID=35897846

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004213151A Pending JP2006031617A (en) 2004-07-21 2004-07-21 Electronic device and random number generation method

Country Status (1)

Country Link
JP (1) JP2006031617A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2950201A1 (en) * 2014-05-28 2015-12-02 Continental Automotive GmbH Generation of random numbers from an unitialised memory unit

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2950201A1 (en) * 2014-05-28 2015-12-02 Continental Automotive GmbH Generation of random numbers from an unitialised memory unit

Similar Documents

Publication Publication Date Title
JP3191607B2 (en) Vehicle anti-theft device
JP4570974B2 (en) Start control device and start control method
JPH1081201A (en) Engine start controlling device
JP5604368B2 (en) Keyless entry device for vehicles
JP2008001133A (en) Security controller for vehicle
JP2915299B2 (en) Vehicle anti-theft device
JP2008084120A (en) Electronic control device
JP2007253730A (en) Vehicular security device and vehicular security system
JP2007153190A (en) Vehicular starting device
JP2000025574A (en) Engine control device and vehicle burglar preventing device
JPH08216839A (en) Engine control device with anti-theft function for vehicle
JP2001301572A (en) Method for imparting identification code of on-vehicle ecu and on-vehicle ecu
JP2000108848A (en) Immobilizer apparatus
JP2008149744A (en) Anti-theft system for vehicle
JP2006031617A (en) Electronic device and random number generation method
JP2008176487A (en) Data storage unit, and theft prevention unit having the same
KR100706448B1 (en) Engine ECU starting control method for anti-theft of immobilizer system vehicle
JP2003196755A (en) System for monitoring theft of on-vehicle component and on-vehicle component
JP3496547B2 (en) Vehicle anti-theft device
JPH08202963A (en) Engine controller for prevention of vehicle burglary
JP3722922B2 (en) Automotive immobilizer system
JP2008001134A (en) Security controller for vehicle
JP2007237798A (en) Information recording device for vehicle
CN114162080B (en) Anti-theft key matching method and device and computer equipment
JP2012234437A (en) In-vehicle communication system and control unit