JPH1040177A - Program check system - Google Patents

Program check system

Info

Publication number
JPH1040177A
JPH1040177A JP8190586A JP19058696A JPH1040177A JP H1040177 A JPH1040177 A JP H1040177A JP 8190586 A JP8190586 A JP 8190586A JP 19058696 A JP19058696 A JP 19058696A JP H1040177 A JPH1040177 A JP H1040177A
Authority
JP
Japan
Prior art keywords
program
checksum
check
block
blocks
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
JP8190586A
Other languages
Japanese (ja)
Inventor
Takanori Miyahara
孝徳 宮原
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.)
NEC Mobile Communications Ltd
Original Assignee
NEC Mobile Communications 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 NEC Mobile Communications Ltd filed Critical NEC Mobile Communications Ltd
Priority to JP8190586A priority Critical patent/JPH1040177A/en
Publication of JPH1040177A publication Critical patent/JPH1040177A/en
Pending legal-status Critical Current

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

PROBLEM TO BE SOLVED: To take a speedy countermeasure if a program is destroyed by preventing the time for abnormality detection when abnormality of the program is detected from increasing with the program size. SOLUTION: A program check processing part 4a calculates the check sum of one program block specified by a check block specification part 3 and stores it in a check sum storage part 5 each time a timer interruption generation part 2 initiates a periodic interruption to store it in a check sum storage part 5a. Then the newly calculated check sum is used for the program block specified by the check block specification part 3 and check sums read out of the check sum storage part 5a is used for all other program blocks to calculate the cumulative value of the check sums of the program blocks. The cumulative value of the calculated check sums is collated with the check sum in the check sum storage part 6 and when they do not match each other, it is decided that the program is abnormal.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明はプログラムチェック
方式に関し、特にメモリ上に展開され中央処理装置を動
作させる、コンピュータシステムにおけるプログラムチ
ェック方式に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a program check method, and more particularly to a program check method in a computer system which is developed on a memory and operates a central processing unit.

【0002】[0002]

【従来の技術】読み出し専用メモリ(以下ROMとい
う)から読み出され、書き換え可能なメモリ(以下RA
Mという)上に展開されたプログラムを読み出して実行
する中央処理装置(以下CPUという)を用いたコンピ
ュータシステムにおいては、RAMが正常に動作してい
るかどうかをチェックするために、特開平4−542号
公報に示されるように、RAM上に展開されたプログラ
ムが壊れているか否かをチェックし、このプログラムチ
ェックにより間接的にRAMをチェックするする方法が
行われている。また、このプログラムチェックの方式と
しては、分割され複数のプログラムブロックとしてRA
M上に格納されたプログラムを、システムの動作中に周
期的なタイマ割り込みにより順次1ブロックずつチェッ
クする方式が行われている。
2. Description of the Related Art A rewritable memory (hereinafter referred to as RA) which is read from a read-only memory (hereinafter referred to as ROM).
M), a computer system using a central processing unit (hereinafter referred to as a CPU) for reading and executing a program developed on a computer is disclosed in Japanese Patent Laid-Open No. 4-542 in order to check whether the RAM is operating normally. As disclosed in Japanese Patent Application Laid-Open No. H10-157, a method of checking whether a program developed on a RAM is broken or not and indirectly checking the RAM by this program check is performed. As a method of this program check, RA is divided into a plurality of program blocks.
A system is used in which a program stored in M is checked one block at a time by a periodic timer interrupt during the operation of the system.

【0003】図4に上記に述べた従来のプログラムチェ
ック方式のブロック図を示す。図5は、図4のプログラ
ムチェック方式を有するコンピュータシステムの構成を
示すブロック図である。図4に示す従来のプログラムチ
ェック方式は、複数のプログラムブロックに分割された
チェック対象のプログラムを格納するチェック対象プロ
グラム格納部1と、システムの処理性能をあまり損なわ
ない程度の周期で割り込みを発生させるタイマ割込発生
部2と、チェックすべきプログラムブロックを指定する
チェックブロック指定部3と、指定されたプログラムブ
ロックのチェックサムを算出し、算出された各プログラ
ムブロックのチェックサムを加算した累計値を、あらか
じめ作成しておいたプログラム全体のチェックサムと照
合してプログラムの異常をチェックするプログラムチェ
ック処理部4bと、プログラムチェック処理部4bによ
り算出された各プログラムブロックのチェックサムをセ
ーブするチェックサム格納部5bと、あらかじめ作成さ
れた、プログラムのチェックサムを格納するチェックサ
ム格納部6と、プログラムの異常が検出された際の対応
処理を行うプログラム異常対応処理部7とから構成され
る。
FIG. 4 shows a block diagram of the above-mentioned conventional program check system. FIG. 5 is a block diagram showing a configuration of a computer system having the program check method of FIG. In the conventional program check method shown in FIG. 4, a check target program storage unit 1 that stores a check target program divided into a plurality of program blocks and an interrupt is generated at a cycle that does not significantly impair the processing performance of the system. A timer interrupt generating unit 2, a check block specifying unit 3 for specifying a program block to be checked, a checksum of the specified program block is calculated, and a cumulative value obtained by adding the calculated checksum of each program block is calculated. A program check processing unit 4b for checking a program abnormality by checking against a checksum of the entire program created in advance, and a checksum storage for saving a checksum of each program block calculated by the program check processing unit 4b. Part 5b Dimethyl created, the checksum storage unit 6 for storing a checksum of the program, and a program anomaly correction unit 7 for performing the corresponding processing when the abnormality of the program is detected.

【0004】また、図5に示した、図4のプログラムチ
ェック方式を有する上記コンピュータシステムは、図4
のタイマ割込発生部2,チェックブロック指定部3,プ
ログラムチェック処理部4bおよびプログラム異常対応
処理部7を内蔵したCPU12bと、メイン処理プログ
ラムおよびプログラムチェック用プログラムを格納する
領域とチェック対象プログラムについてあらかじめ算出
されたチェックサムを格納している領域すなわち図4の
チェックサム格納部6とを有しているROM13bと、
CPU12bがROM13bから読み出した、チェック
対象のプログラムであるメイン処理プログラムおよびプ
ログラムチェック用プログラムを格納する領域すなわち
図4のチェック対象プログラム格納部1を有するととも
に、プログラムブロックのチェックサムをセーブする領
域すなわち図4のチェックサム格納部5bを有するRA
M17bとから構成される。
The computer system having the program check method shown in FIG.
The CPU 12b having a built-in timer interrupt generation unit 2, check block designation unit 3, program check processing unit 4b, and program abnormality response processing unit 7, an area for storing a main processing program and a program check program, and a check target program A ROM 13b having an area for storing the calculated checksum, ie, the checksum storage unit 6 in FIG.
An area for storing a main processing program and a program check program, which are programs to be checked, read from the ROM 13b by the CPU 12b, that is, an area for storing the check target program storage unit 1 of FIG. RA having 4 checksum storage units 5b
M17b.

【0005】次に、動作を説明する。Next, the operation will be described.

【0006】まず最初にコンピュータシステムのメイン
動作を説明する。図6は、図4のプログラムチェック方
式を有するコンピュータシステムにおけるメイン動作を
示す流れ図である。図5のCPU12bに電源が投入さ
れるか、もしくはリセットが実行され、CPU12bが
ROM13bから読み出した、メイン処理プログラムお
よびプログラムチェック用プログラムを、あらかじめシ
ステムのメイン処理を圧迫しない程度の適当なサイズに
分割しブロック化し複数のプログラムブロックとして、
CPU12bはチェック対象プログラム格納部1上に格
納する(図5のステップ51)。チェック対象プログラ
ム格納部1上に格納されたメイン処理プログラムにより
CPU12bが起動し、所定のイニシャライズ処理を実
行する(ステップ52)。次に、プログラムのチェック
を周期的に行うためのタイマ割込発生部2の割り込み周
期の値が、オペレータによりシステムの動作を損わない
ような適切な値に設定されると(ステップ53)、CP
U12bはメイン処理プログラムによってメイン処理を
開始し、割り込みの発生時間を設定したタイマ割込発生
部2がタイムアウトをして割り込みが発生するまで繰り
返し与えられた処理を順次実行する(ステップ54)。
CPU12bのタイマ割込発生部2が、設定された周期
によりタイマ割り込みを発生させると、CPU12bは
メイン処理の実行を一時中断させ、プログラムチェック
処理が実行される(ステップ55)。プログラムチェッ
ク処理のルーチンの中でそのとき行われたプログラムチ
ェックの結果が判定され(ステップ56)、正常であれ
ばそのときのタイマ割り込み時に割り当てられたプログ
ラムチェック処理が終了し、ステップ54のメイン処理
の実行に戻る。チェック対象となるプログラムブロック
のチェックは一度のタイマ割り込み時に全てのプログラ
ムブロックについて行われるのではなく、周期的にタイ
マ割り込みが行われる都度、複数のブロックに分割され
たチェック対象のプログラムがブロックごとに順次チェ
ックされていく。また、ステップ56でプログラムチェ
ックの結果が異常であった場合はチェックエラーの表示
が行われてプログラムチェック処理が終了し(ステップ
57)、その後CPU12bは自らリセットを行って
(ステップ58)、再起動する。
First, the main operation of the computer system will be described. FIG. 6 is a flowchart showing a main operation in the computer system having the program check method of FIG. When the power is turned on or the CPU 12b in FIG. 5 is turned on or the reset is executed, the main processing program and the program check program read from the ROM 13b by the CPU 12b are divided into appropriate sizes in advance so as not to compress the main processing of the system. Into blocks and as multiple program blocks,
The CPU 12b stores it in the check target program storage 1 (step 51 in FIG. 5). The CPU 12b is started by the main processing program stored in the check target program storage 1, and executes a predetermined initialization process (step 52). Next, when the value of the interrupt cycle of the timer interrupt generation unit 2 for periodically checking the program is set to an appropriate value by the operator so as not to impair the operation of the system (step 53). CP
The U12b starts the main processing by the main processing program, and sequentially executes the processing repeatedly given until the timer interrupt generation unit 2 in which the interrupt generation time is set times out and an interrupt occurs (step 54).
When the timer interrupt generation unit 2 of the CPU 12b generates a timer interrupt at the set cycle, the CPU 12b temporarily suspends the execution of the main processing and executes the program check processing (Step 55). In the routine of the program check process, the result of the program check performed at that time is determined (step 56). If the result is normal, the program check process assigned at the time of the timer interrupt is terminated, and the main process of step 54 Return to execution. The check of the program block to be checked is not performed for all program blocks at the same time of one timer interrupt, but every time a timer interrupt is performed, the check target program divided into multiple blocks is checked for each block It is checked sequentially. If the result of the program check is abnormal in step 56, a check error is displayed and the program check process ends (step 57). Thereafter, the CPU 12b resets itself (step 58) and restarts. I do.

【0007】次に、プログラムチェック用プログラムの
動作を説明する。図7は図4のプログラムチェック方式
における動作を示す流れ図である。
Next, the operation of the program check program will be described. FIG. 7 is a flowchart showing the operation in the program check method of FIG.

【0008】図4のタイマ割込発生部2により図6に示
すタイマ割り込みが行われると(図7のステップ7
1)、まずタイマ割込発生部2がチェックブロック指定
部3を起動し、チェックブロック指定部3が、チェック
対象プログラム格納部1上に格納されている複数のプロ
グラムブロックのうちから、タイマによる割り込みの際
にチェック処理の対象となるプログラムブロックを指定
し、プログラムチェック処理部4bに通知する(ステッ
プ72)。図7では、n個のプログラムブロックのうち
の第i番目のプログラムブロックがチェックブロック指
定部3により指定された状態が示されている。プログラ
ムチェック処理部4bは、チェックサム格納部5bから
チェックサムを読み出すとともに(ステップ73)、チ
ェックブロック指定部3により指定されたプログラムブ
ロックについてのチェックサムを算出し、得られたその
プログラムブロックのチェックサムを、チェックサム格
納部5bから読み出したチェックサムに加算し(ステッ
プ74)、チェックサム格納部5bにセーブする(ステ
ップ75)。次に、プログラムチェック処理部4bは、
上記の処理が全てのプログラムブロックについて行われ
チェックサムの加算が終了したか否かをチェックし(ス
テップ76)、上記処理が全てのプログラムブロックに
ついては行われておらず、まだ上記処理が終了していな
いプログラムが残っているときは、そのときのプログラ
ムブロックについてのプログラムチェックとしては処理
を終了し、動作をメインルーチンに渡す。CPU12b
はプログラムチェック処理の終了により中断していたメ
イン処理を再開する。さらに、次のタイマの割り込みが
発生すると、前回プログラムチェックが行われたプログ
ラムブロックの次のプログラムブロックについて、また
ステップ72からの動作が前回と同様に繰り返される。
このようにプログラムチェック処理は、プログラムチェ
ックのための割り込みが行われる度に、あらかじめ決め
られた順序で各プログラムブロックについて1ブロック
ずつ各ブロックをチェックしそのブロックのチェックサ
ムを求め、それまでのチェックの終了したプログラムブ
ロックのチェックサムの累計値である、チェックサム格
納部5bから読み出したチェックサムに次々と加算して
メモリ5に格納することを繰り返す。最後のプログラム
ブロックのチェックサムが加算された後に、ステップ7
6で全てのブロックの加算を終了したか否かのチェック
が行われると、プログラムチェック処理部4bは、あら
かじめ作成しチェックサム格納部6に格納されているチ
ェックサムを読み出し(ステップ77)、このチェック
サムとチェックサム格納部5bに格納された上記の全て
のブロックのチェックサムの累計値とが一致するかどう
かのチェックを行う(ステップ78)。この照合の結
果、プログラムチェック処理部4bは、両者が一致すれ
ば異常なしと判定してチェックサムをクリア(ステップ
79)した後、動作をメインルーチンに渡し、タイマ割
り込みによるチェック処理を終了する。このタイマ割り
込みによるプログラムチェック処理の終了でメインルー
チンの動作は通常処理に復帰するが、周期的に行われる
タイマ割り込みによるプログラムチェック処理は継続す
る。また、両者が一致しなかった場合はプログラムチェ
ック処理部4bはプログラムが異常であるものと判定し
てプログラム異常対応処理部7を起動し、プログラム異
常対応処理部7は検出されたプログラムの異常に対し定
められた対応処理を行う(ステップ80)。
When the timer interrupt shown in FIG. 6 is performed by the timer interrupt generator 2 shown in FIG. 4 (step 7 in FIG. 7).
1) First, the timer interrupt generation unit 2 activates the check block designating unit 3, and the check block designating unit 3 performs an interrupt by the timer from among a plurality of program blocks stored in the check target program storage unit 1. At this time, a program block to be checked is specified and notified to the program check processing unit 4b (step 72). FIG. 7 shows a state in which the i-th program block of the n program blocks is specified by the check block specifying unit 3. The program check processing unit 4b reads the checksum from the checksum storage unit 5b (step 73), calculates the checksum for the program block specified by the check block specifying unit 3, and checks the obtained program block. The sum is added to the checksum read from the checksum storage 5b (step 74) and saved in the checksum storage 5b (step 75). Next, the program check processing unit 4b
It is checked whether or not the above processing has been performed on all the program blocks and the addition of the checksum has been completed (step 76). The above processing has not been performed on all the program blocks, and the above processing has been completed. If there is a program that has not been executed, the process ends as a program check for the program block at that time, and the operation is passed to the main routine. CPU 12b
Restarts the main processing that was interrupted by the end of the program check processing. Further, when an interrupt of the next timer occurs, the operation from step 72 on the program block next to the program block on which the previous program check was performed, and the operation from step 72 are repeated as before.
As described above, in the program check process, each time an interrupt for the program check is performed, each block is checked for each program block in a predetermined order, and a checksum of the block is obtained. Is repeated from the checksum read out from the checksum storage unit 5b, which is the total value of the checksums of the program blocks that have been completed, and stored in the memory 5. After the checksum of the last program block has been added, step 7
When it is determined in step 6 whether addition of all blocks has been completed, the program check processing unit 4b reads out a checksum created in advance and stored in the checksum storage unit 6 (step 77). It is checked whether the checksum matches the total value of the checksums of all the blocks stored in the checksum storage 5b (step 78). As a result of this collation, if they match, the program check processing unit 4b determines that there is no abnormality, clears the checksum (step 79), passes the operation to the main routine, and ends the check processing by the timer interrupt. The operation of the main routine returns to the normal processing at the end of the program check processing by the timer interrupt, but the periodic program check processing by the timer interrupt is continued. If they do not match, the program check processing unit 4b determines that the program is abnormal and activates the program error handling unit 7, and the program error handling unit 7 determines whether the detected program is abnormal. A predetermined response process is performed (step 80).

【0009】[0009]

【発明が解決しようとする課題】上述した従来のプログ
ラムチェック方式は、タイマ割り込みが行われるごと
に、分割された複数のプログラムブロックを1ブロック
ずつチェックしてそれぞれのチェックサムを求め、全て
のプログラムブロックのチェックを終了した後で、それ
ぞれのプログラムブロックのチェックサムを加算しプロ
グラム全体のチェックサムを求めてから、あらかじめ算
出してあったチェックサムとの照合を行うことになるの
で、プログラム領域の最後までプログラムチェック処理
を行わないとプログラムの異常を検出することができな
いことになり、プログラムのサイズが増加するに従って
プログラムの異常を検出するための時間が増大するとい
う欠点を有している。
In the above-mentioned conventional program check method, each time a timer interrupt is performed, a plurality of divided program blocks are checked one by one to obtain their respective checksums. After the block check is completed, the checksum of each program block is added to obtain the checksum of the entire program, and then it is compared with the checksum calculated in advance. Unless the program check processing is performed to the end, it is impossible to detect a program abnormality, and there is a disadvantage that the time required to detect the program abnormality increases as the size of the program increases.

【0010】本発明の目的は、プログラムの異常を検出
するための時間がプログラムサイズの増加により増大す
ることを防ぎ、プログラムの異常が検出されたときに迅
速な対応がとれることを可能にするプログラムチェック
方式を提供することにある。
[0010] An object of the present invention is to prevent a time required for detecting a program error from increasing due to an increase in the size of a program, and to enable a quick response when a program error is detected. It is to provide a check method.

【0011】[0011]

【課題を解決するための手段】本発明のプログラムチェ
ック方式は、CPUのプログラムの異常を検出するため
チェックサムを用いてプログラムチェックを行うとき
に、前記プログラムを複数のプログラムブロックに分割
してRAMに格納し、周期的に作動するタイマによる1
回の割り込みで1つのプログラムブロックのチェックサ
ムを算出して記憶保持し、前記タイマによる割り込みご
とにチェック対象となる前記プログラムブロックを順次
変えて、前記タイマによる複数回の割り込みで前記プロ
グラムブロック全てのチェックサムを算出し、前記複数
のプログラムブロックのチェックサムの累計値を算出し
て、前記累計値とあらかじめ算出しておいた前記プログ
ラムのチェックサムとを照合して前記プログラムの異常
の有無を判定するプログラムチェック方式において、前
記タイマによる割り込みごとに、そのときのチェック対
象の前記プログラムブロック1ブロックについて前記チ
ェックサムを新しく算出し新しく算出した前記チェック
サムでそれまで記憶保持していたチェックサムを更新
し、前記チェック対象のプログラムブロックの更新され
たチェックサムと残りの他の全てのプログラムブロック
のそれまで記憶保持されていたチェックサムとを加算し
前記複数のプログラムブロックのチェックサムの累計値
を算出して前記プログラムのチェックサムと照合し、前
記タイマによる割り込みごとに前記プログラムの異常の
有無を判定するように構成される。
According to the program check method of the present invention, when a program check is performed by using a checksum to detect an abnormality in a program of a CPU, the program is divided into a plurality of program blocks and the RAM is divided into a plurality of program blocks. And a timer that operates periodically
The checksum of one program block is calculated and stored in one interrupt, and the program block to be checked is sequentially changed for each interrupt by the timer. Calculating a checksum, calculating an accumulated value of the checksums of the plurality of program blocks, and comparing the accumulated value with a previously calculated checksum of the program to determine whether there is an abnormality in the program. In the program check method, for each interruption by the timer, the checksum is newly calculated for one block of the program block to be checked at that time, and the checksum previously stored and updated with the newly calculated checksum is updated. And said check Of the plurality of program blocks by adding the updated checksum of the program block and the checksums stored so far of all the remaining program blocks, and calculating the sum of the checksums of the plurality of program blocks. It is configured to collate with a checksum to determine the presence or absence of an abnormality in the program for each interruption by the timer.

【0012】また、本発明のプログラムチェック方式
は、(A)複数のプログラムブロックに分割されたチェ
ック対象のプログラムを格納する書き換え可能なチェッ
ク対象プログラム格納手段、(B)周期的な割り込みを
発生するタイマ割込発生手段、(C)あらかじめ算出し
た前記プログラムのチェックサムを格納する第1のチェ
ックサム格納手段、(D)前記タイマ割込発生手段の出
力により起動され、起動されるごとに前記チェック対象
プログラム格納手段に格納された複数のプログラムブロ
ックのうちの1つのプログラムブロックを順次指定する
チェックブロック指定手段、(E)前記チェックブロッ
ク指定手段により指定されたプログラムブロックを読み
出し前記プログラムブロックのチェックサムを算出した
後、前記プログラムブロックの全てのチェックサムの累
計値を算出して、前記累計値と前記第1のチェックサム
格納手段に格納されているチェックサムとを照合して、
両方の値が一致しないとき前記プログラムが異常である
と判定するプログラムチェック処理手段、(F)算出さ
れた前記プログラムブロックのチェックサムを格納する
第2のチェックサム格納手段、を備え、前記チェック対
象プログラム格納手段上に展開された前記プログラムを
実行するコンピュータシステムにおけるプログラムチェ
ック方式において、前記プログラムチェック処理手段
は、前記タイマ割込発生手段により周期的な割り込みが
行われるごとに、前記チェックブロック指定手段により
指定されたプログラムブロック1ブロックについてチェ
ックサムを算出して前記第2のチェックサム格納手段に
格納し、新しく算出された前記チェックサムと残りの他
の全てのプログラムブロックについて前記第2のチェッ
クサム格納手段から読み出したチェックサムとを加算し
て前記プログラムブロックのチェックサムの累計値を算
出し、前記第1のチェックサム格納手段のチェックサム
と照合して、前記タイマによる割り込みごとに前記プロ
グラムの異常の有無を判定するように構成される。
Further, the program check method of the present invention provides (A) a rewritable check target program storage means for storing a check target program divided into a plurality of program blocks, and (B) a periodic interrupt is generated. Timer interrupt generating means, (C) first checksum storing means for storing a checksum of the program calculated in advance, (D) activated by the output of the timer interrupt generating means, and each time it is activated, Check block designating means for sequentially designating one program block of a plurality of program blocks stored in the target program storage means; (E) reading the program block designated by the check block designating means, and checking the program block checksum After calculating It calculates the cumulative value of all the checksums of the lock, by matching the checksum stored in the said accumulated value first checksum storage means,
Program check processing means for determining that the program is abnormal when both values do not match; and (F) second checksum storage means for storing a calculated checksum of the program block, wherein the check target In a program check method in a computer system that executes the program expanded on a program storage means, the program check processing means includes a check block designating means each time a periodic interrupt is performed by the timer interrupt generating means. Calculates a checksum for one block of the program block designated by the above and stores the checksum in the second checksum storage means. The second checksum is calculated for the newly calculated checksum and all the remaining program blocks. From storage means The calculated checksum of the program block is added to the calculated checksum to calculate the total value of the checksum of the program block, and is compared with the checksum of the first checksum storage means. It is configured to determine the presence or absence.

【0013】[0013]

【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して説明する。
Next, embodiments of the present invention will be described with reference to the drawings.

【0014】図1は、本発明のプログラムチェック方式
の実施の一形態を示すブロック図である。図2は、図1
のプログラムチェック方式を有するコンピュータシステ
ムの構成を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a program check method according to the present invention. FIG. 2 shows FIG.
FIG. 2 is a block diagram showing a configuration of a computer system having the program check method.

【0015】図1に示す本実施の形態のプログラムチェ
ック方式は、複数のプログラムブロックに分割されたチ
ェック対象のプログラムを格納するチェック対象プログ
ラム格納部1と、システムの処理性能をあまり損なわな
い程度の周期で割り込みを発生させるタイマ割込発生部
2と、チェックすべきプログラムブロックを指定するチ
ェックブロック指定部3と、プログラムの正常性をチェ
ックするプログラムチェック処理部4aと、プログラム
チェック処理部4aにより算出された各プログラムブロ
ックのチェックサムをセーブするチェックサム格納部5
aと、あらかじめ作成された、プログラムのチェックサ
ムを格納するチェックサム格納部6と、プログラムの異
常が検出された際の対応処理を行うプログラム異常対応
処理部7とから構成される。
The program check method according to the present embodiment shown in FIG. 1 includes a check target program storage unit 1 for storing a check target program divided into a plurality of program blocks, and a check program storage unit 1 which does not significantly impair the processing performance of the system. Calculated by a timer interrupt generating unit 2 for generating an interrupt at a periodic interval, a check block specifying unit 3 for specifying a program block to be checked, a program check processing unit 4a for checking the normality of a program, and a program check processing unit 4a. Checksum storage 5 for saving the checksum of each program block
a, a checksum storage unit 6 that stores a checksum of the program created in advance, and a program error handling unit 7 that performs a process when an error of the program is detected.

【0016】また、図2に示した、図1のプログラムチ
ェック方式を有する上記コンピュータシステムは、図1
のタイマ割込発生部2,チェックブロック指定部3,プ
ログラムチェック処理部4aおよびプログラム異常対応
処理部7を内蔵したCPU12aと、メイン処理プログ
ラムおよびプログラムチェック用プログラムを格納する
領域とチェック対象のプログラムのチェックサムを格納
している領域すなわち図1のチェックサム格納部6とを
有しているROM13aと、CPU12aがROM13
aから読み出した、チェック対象のプログラムであるメ
イン処理プログラムおよびプログラムチェック用プログ
ラムを格納する領域すなわち図1のチェック対象プログ
ラム格納部1を有するとともに、複数のプログラムブロ
ックのチェックサムをセーブする領域すなわち図1のチ
ェックサム格納部5aを有したRAM17aとから構成
される。
The computer system shown in FIG. 2 and having the program check method of FIG.
CPU 12a having a built-in timer interrupt generation unit 2, check block designation unit 3, program check processing unit 4a, and program abnormality handling processing unit 7, an area for storing a main processing program and a program check program, and a A ROM 13a having an area for storing a checksum, that is, a checksum storage unit 6 shown in FIG.
a area for storing a main processing program and a program for checking programs, which are programs to be checked, read out from the storage area a, that is, an area for storing the checksums of a plurality of program blocks while having the check target program storage unit 1 of FIG. And a RAM 17a having one checksum storage unit 5a.

【0017】次に、動作を説明する。Next, the operation will be described.

【0018】まず、プログラムチェック用プログラムの
動作を説明する。図3は、図1のプログラムチェック方
式における動作の一例を示す流れ図である。
First, the operation of the program check program will be described. FIG. 3 is a flowchart showing an example of the operation in the program check method of FIG.

【0019】図1のタイマ割込発生部2により図6に示
すタイマ割り込みが行われると(図3のステップ2
1)、まずタイマ割込発生部2がチェックブロック指定
部3を起動し、チェックブロック指定部3が、チェック
対象プログラム格納部1上に格納されている複数のプロ
グラムブロックのうちから、タイマによる割り込みの際
にチェック処理の対象となるプログラムブロックを指定
し、プログラムチェック処理部4aに通知する(ステッ
プ22)。図3では、n個のプログラムブロックのうち
の第i番目のプログラムブロックがチェックブロック指
定部3により指定された状態が示されている。プログラ
ムチェック処理部4aは、チェックブロック指定部3に
より指定されたプログラムブロックについてのチェック
サムを算出し(ステップ23)、得られたそのプログラ
ムブロックのチェックサムにより、チェックサム格納部
5aにセーブされている該当するチェックサムを更新す
る(ステップ24)。次に、プログラムチェック処理部
4aは、チェックサム格納部5aにセーブされている第
1ブロック〜第nブロックの全てのチェックサムを加算
する(ステップ25)。プログラムチェック処理部4a
は、あらかじめ作成しチェックサム格納部6に格納され
ているチェックサムを読み出し(ステップ26)、この
チェックサムとチェックサム格納部5aにセーブされた
n個の全てのブロックのチェックサムの累計値とが一致
するかどうかのチェックを行う(ステップ27)。この
照合の結果、プログラムチェック処理部4aは、両者が
一致すれば異常なしと判定して各プログラムブロックの
チェックサムの累計値をクリアした後、動作をメインル
ーチンに渡し、タイマ割り込みによるチェック処理を終
了する。このタイマ割り込みによるチェック処理の終了
でメインルーチンの動作は通常処理に復帰するが、周期
的に行われるタイマ割り込みによるチェック処理は継続
する。また、両者が一致しなかった場合はプログラムチ
ェック処理部4aはプログラムが異常であるものと判定
してプログラム異常対応処理部7を起動し、プログラム
異常対応処理部7は検出されたプログラムの異常に対し
定められた対応処理を行う(ステップ28)。
When the timer interrupt shown in FIG. 6 is performed by the timer interrupt generation unit 2 in FIG. 1 (step 2 in FIG. 3).
1) First, the timer interrupt generation unit 2 activates the check block designating unit 3, and the check block designating unit 3 performs an interrupt by the timer from among a plurality of program blocks stored in the check target program storage unit 1. At this time, a program block to be checked is specified and notified to the program check processing unit 4a (step 22). FIG. 3 shows a state in which the i-th program block of the n program blocks is specified by the check block specifying unit 3. The program check processing unit 4a calculates a checksum for the program block specified by the check block specifying unit 3 (step 23), and saves the checksum in the checksum storage unit 5a using the obtained checksum of the program block. The corresponding checksum is updated (step 24). Next, the program check processing unit 4a adds all the checksums of the first block to the n-th block saved in the checksum storage unit 5a (step 25). Program check processing unit 4a
Reads out the checksum created in advance and stored in the checksum storage unit 6 (step 26), and checksums the sum of the checksum and the checksum of all n blocks saved in the checksum storage unit 5a. Is checked to see if they match (step 27). As a result of this comparison, if the two match, the program check processing unit 4a determines that there is no abnormality, clears the accumulated value of the checksum of each program block, passes the operation to the main routine, and executes the check processing by the timer interrupt. finish. The operation of the main routine returns to the normal processing at the end of the check processing by the timer interrupt, but the check processing by the timer interrupt that is periodically performed continues. If they do not match, the program check processing unit 4a determines that the program is abnormal and activates the program error handling unit 7, and the program error handling unit 7 determines whether the detected program is abnormal. A predetermined response process is performed (step 28).

【0020】上記の処理がn個の全てのプログラムブロ
ックについて行われる。プログラムチェックのための割
り込みが行われると、あらかじめ決められた順序でn個
のプログラムブロックのうち1ブロックが指定されてチ
ェックされ、そのプログラムブロックのチェックサムの
みが算出され、チェックサム格納部5aにセーブされて
いるn個のブロックのチェックサムのうち、上記のチェ
ックサムが算出されたプログラムブロックのチェックサ
ムのみが、上記の算出されたチェックサムで更新され
る。他のプログラムブロックのチェックサムは更新され
ず、それまでの値のままである。このような状態で、チ
ェックサム格納部5aにセーブされているn個全てのプ
ログラムブロックのチェックサムが加算され、あらかじ
め作成しチェックサム格納部6に格納されているチェッ
クサムと照合される。ただし、上記に述べたように、1
回の割り込みでは、n個あるプログラムブロックのう
ち、1つのプログラムブロックのみがチェックサムを算
出され、そのデータに該当する、チェックサム格納部5
aにセーブされているチェックサムのみが値を更新され
るようになっているので、システムが立ち上がったばか
りのとき、すなわちまだ割り込みの回数がn回に達して
おらず、従ってn個のプログラムブロックのうちの一部
のプログラムブロックがチェックサムを算出されていな
い状態のときは、チェックサム格納部6に格納されてい
るプログラム全体のチェックサムとの照合ができないの
で、n個のプログラムブロックのチェックサムが全て算
出された段階まで照合を待つ必要がある。
The above processing is performed for all n program blocks. When an interrupt for a program check is performed, one of the n program blocks is designated and checked in a predetermined order, only the checksum of the program block is calculated, and the checksum is stored in the checksum storage unit 5a. Of the saved checksums of the n blocks, only the checksum of the program block for which the above checksum has been calculated is updated with the above calculated checksum. The checksums of the other program blocks are not updated and remain as they were. In such a state, the checksums of all the n program blocks saved in the checksum storage unit 5a are added and compared with the checksums created in advance and stored in the checksum storage unit 6. However, as mentioned above, 1
In the first interrupt, only one of the n program blocks has its checksum calculated, and the checksum storage unit 5 corresponding to the data is calculated.
Since only the checksum saved in a is updated, the number of interrupts has not yet reached n when the system has just been started up, that is, the number of interrupts of n program blocks has not been reached. When the checksum has not been calculated for some of the program blocks, the checksum cannot be compared with the checksum of the entire program stored in the checksum storage unit 6, so that the checksum of the n program blocks is not obtained. It is necessary to wait for the collation until the stage where all have been calculated.

【0021】上記の説明ではタイマによる割り込みは周
期的に行われることで説明したが、任意の決められた時
間で行われることであってもよい。
In the above description, the interrupt by the timer is described as being performed periodically, but may be performed at an arbitrary determined time.

【0022】[0022]

【発明の効果】以上説明したように、本発明のプログラ
ムチェック方式は、タイマ割り込みが行われ、指定され
た1つのプログラムブロックのチェックサムが新しく算
出されたら、そのときのタイマ割り込みの処理では、他
のプログラムブロックのチェックサムについては以前の
ままのチェックサムを使用して各プログラムブロックの
チェックサムの累計値を算出しプログラム全体のチェッ
クサムを求めることにより、タイマ割り込みが行われる
ごとに、プログラム全体のチェックサムとあらかじめ算
出してあったチェックサムとの照合を行うことができる
ので、プログラムの異常を検出するための時間がプログ
ラムのサイズの増加に従って増大することを防ぐことが
でき、プログラムの異常が検出されたときに迅速な対応
がとれることを可能にし、プログラムの異常が検出され
たとき発生する様々な悪影響を最小限に抑制することが
できるという効果を有している。
As described above, according to the program check method of the present invention, when a timer interrupt is performed and the checksum of one designated program block is newly calculated, the processing of the timer interrupt at that time is as follows. For the checksums of other program blocks, the total checksum of each program block is calculated using the checksum as before, and the checksum of the entire program is obtained. Since the entire checksum can be compared with the checksum calculated in advance, the time required to detect a program error can be prevented from increasing as the size of the program increases. Allows quick response when anomalies are detected To have the advantage of being able to minimize the various adverse effects occur when abnormality of program is detected.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明のプログラムチェック方式の実施の一形
態を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a program check method according to the present invention.

【図2】図1のプログラムチェック方式を有するコンピ
ュータシステムの構成を示すブロック図である。
FIG. 2 is a block diagram showing a configuration of a computer system having the program check method of FIG.

【図3】本実施の形態のプログラムチェック方式におけ
る動作の一例を示す流れ図である。
FIG. 3 is a flowchart illustrating an example of an operation in the program check method according to the present embodiment.

【図4】従来のプログラムチェック方式のブロック図で
ある。
FIG. 4 is a block diagram of a conventional program check method.

【図5】図4のプログラムチェック方式を有するコンピ
ュータシステムの構成を示すブロック図である。
FIG. 5 is a block diagram showing a configuration of a computer system having the program check method of FIG.

【図6】図4のプログラムチェック方式を有するコンピ
ュータシステムにおけるメイン動作を示す流れ図であ
る。
6 is a flowchart showing a main operation in a computer system having the program check method of FIG.

【図7】図4のプログラムチェック方式における動作を
示す流れ図である。
FIG. 7 is a flowchart showing an operation in the program check method of FIG. 4;

【符号の説明】[Explanation of symbols]

1 チェック対象プログラム格納部 2 タイマ割込発生部 3 チェックブロック指定部 4a,4b プログラムチェック処理部 5a,5b チェックサム格納部 6 チェックサム格納部 7 プログラム異常対応処理部 12a,12b CPU 13a,13b ROM 17a,17b RAM 1 Check target program storage unit 2 Timer interrupt generation unit 3 Check block designation unit 4a, 4b Program check processing unit 5a, 5b Checksum storage unit 6 Checksum storage unit 7 Program abnormality handling processing unit 12a, 12b CPU 13a, 13b ROM 17a, 17b RAM

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】 CPUのプログラムの異常を検出するた
めチェックサムを用いてプログラムチェックを行うとき
に、前記プログラムを複数のプログラムブロックに分割
してRAMに格納し、周期的に作動するタイマによる1
回の割り込みで1つのプログラムブロックのチェックサ
ムを算出して記憶保持し、前記タイマによる割り込みご
とにチェック対象となる前記プログラムブロックを順次
変えて、前記タイマによる複数回の割り込みで前記プロ
グラムブロック全てのチェックサムを算出し、前記複数
のプログラムブロックのチェックサムの累計値を算出し
て、前記累計値とあらかじめ算出しておいた前記プログ
ラムのチェックサムとを照合して前記プログラムの異常
の有無を判定するプログラムチェック方式において、前
記タイマによる割り込みごとに、そのときのチェック対
象の前記プログラムブロック1ブロックについて前記チ
ェックサムを新しく算出し新しく算出した前記チェック
サムでそれまで記憶保持していたチェックサムを更新
し、前記チェック対象のプログラムブロックの更新され
たチェックサムと残りの他の全てのプログラムブロック
のそれまで記憶保持されていたチェックサムとを加算し
前記複数のプログラムブロックのチェックサムの累計値
を算出して前記プログラムのチェックサムと照合し、前
記タイマによる割り込みごとに前記プログラムの異常の
有無を判定することを特徴とするプログラムチェック方
式。
When a program check is performed using a checksum to detect an abnormality in a program of a CPU, the program is divided into a plurality of program blocks, stored in a RAM, and a timer that operates periodically.
The checksum of one program block is calculated and stored in one interrupt, and the program block to be checked is sequentially changed for each interrupt by the timer. Calculating a checksum, calculating an accumulated value of the checksums of the plurality of program blocks, and comparing the accumulated value with a previously calculated checksum of the program to determine whether there is an abnormality in the program. In the program check method, for each interruption by the timer, the checksum is newly calculated for one block of the program block to be checked at that time, and the checksum previously stored and updated with the newly calculated checksum is updated. And said check Of the plurality of program blocks by adding the updated checksum of the program block and the checksums stored so far of all the remaining program blocks, and calculating the sum of the checksums of the plurality of program blocks. A program check method, wherein a check is made against a checksum to determine whether or not the program is abnormal for each interruption by the timer.
【請求項2】(A)複数のプログラムブロックに分割さ
れたチェック対象のプログラムを格納する書き換え可能
なチェック対象プログラム格納手段、(B)周期的な割
り込みを発生するタイマ割込発生手段、(C)あらかじ
め算出した前記プログラムのチェックサムを格納する第
1のチェックサム格納手段、(D)前記タイマ割込発生
手段の出力により起動され、起動されるごとに前記チェ
ック対象プログラム格納手段に格納された複数のプログ
ラムブロックのうちの1つのプログラムブロックを順次
指定するチェックブロック指定手段、(E)前記チェッ
クブロック指定手段により指定されたプログラムブロッ
クを読み出し前記プログラムブロックのチェックサムを
算出した後、前記プログラムブロックの全てのチェック
サムの累計値を算出して、前記累計値と前記第1のチェ
ックサム格納手段に格納されているチェックサムとを照
合して、両方の値が一致しないとき前記プログラムが異
常であると判定するプログラムチェック処理手段、
(F)算出された前記プログラムブロックのチェックサ
ムを格納する第2のチェックサム格納手段、を備え、前
記チェック対象プログラム格納手段上に展開された前記
プログラムを実行するコンピュータシステムにおけるプ
ログラムチェック方式において、前記プログラムチェッ
ク処理手段は、前記タイマ割込発生手段により周期的な
割り込みが行われるごとに、前記チェックブロック指定
手段により指定されたプログラムブロック1ブロックに
ついてチェックサムを算出して前記第2のチェックサム
格納手段に格納し、新しく算出された前記チェックサム
と残りの他の全てのプログラムブロックについて前記第
2のチェックサム格納手段から読み出したチェックサム
とを加算して前記プログラムブロックのチェックサムの
累計値を算出し、前記第1のチェックサム格納手段のチ
ェックサムと照合して、前記タイマによる割り込みごと
に前記プログラムの異常の有無を判定することを特徴と
するプログラムチェック方式。
(A) a rewritable check target program storing means for storing a check target program divided into a plurality of program blocks; (B) a timer interrupt generating means for generating a periodic interrupt; A) first checksum storage means for storing a checksum of the program calculated in advance; (D) activated by an output of the timer interrupt generation means, and stored in the check target program storage means each time the program is activated. Check block designating means for sequentially designating one program block of a plurality of program blocks; (E) reading out the program block designated by the check block designating means and calculating the checksum of the program block, Calculate the cumulative value of all checksums of To, and collated with the check sum stored said accumulated value and said first checksum storing means, the program check processing means determines that the program is abnormal when both values do not match,
(F) a second checksum storing means for storing the calculated checksum of the program block, wherein the program check method in a computer system for executing the program developed on the check target program storing means comprises: The program check processing means calculates a checksum for one program block designated by the check block designation means every time a periodic interruption is performed by the timer interrupt generation means, and calculates the second checksum. The checksum stored in the storage means is added to the newly calculated checksum and the checksums read from the second checksum storage means for all the remaining program blocks. Is calculated, Serial first checksum storage means checksums and then matching the program check method, which comprises determining the presence or absence of an abnormality of the program for each interrupt by the timer.
JP8190586A 1996-07-19 1996-07-19 Program check system Pending JPH1040177A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP8190586A JPH1040177A (en) 1996-07-19 1996-07-19 Program check system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP8190586A JPH1040177A (en) 1996-07-19 1996-07-19 Program check system

Publications (1)

Publication Number Publication Date
JPH1040177A true JPH1040177A (en) 1998-02-13

Family

ID=16260536

Family Applications (1)

Application Number Title Priority Date Filing Date
JP8190586A Pending JPH1040177A (en) 1996-07-19 1996-07-19 Program check system

Country Status (1)

Country Link
JP (1) JPH1040177A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010282296A (en) * 2009-06-02 2010-12-16 Sanyo Electric Co Ltd Data check circuit
JP2018075309A (en) * 2016-11-11 2018-05-17 株式会社オリンピア Game machine
JP2020123137A (en) * 2019-01-30 2020-08-13 ラピスセミコンダクタ株式会社 Semiconductor device, peripheral device control system, and peripheral device control method
CN114764347A (en) * 2022-04-14 2022-07-19 重庆长安汽车股份有限公司 Program verification system and method of multi-core controller and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010282296A (en) * 2009-06-02 2010-12-16 Sanyo Electric Co Ltd Data check circuit
JP2018075309A (en) * 2016-11-11 2018-05-17 株式会社オリンピア Game machine
JP2020123137A (en) * 2019-01-30 2020-08-13 ラピスセミコンダクタ株式会社 Semiconductor device, peripheral device control system, and peripheral device control method
CN114764347A (en) * 2022-04-14 2022-07-19 重庆长安汽车股份有限公司 Program verification system and method of multi-core controller and storage medium

Similar Documents

Publication Publication Date Title
KR20230091660A (en) Method and apparatus for verify software integrity
JPH1040177A (en) Program check system
JP4135413B2 (en) MEMORY CHECK SYSTEM, MEMORY CHECK METHOD, SIGNAL PROCESSING DEVICE, SIGNAL PROCESSING DEVICE MEMORY CHECK METHOD, AND MEMORY CHECK PROGRAM
JP4952317B2 (en) Saved data discrimination method, saved data discrimination program, and saved data discrimination device
JPH04542A (en) Memory checking system
JP2011039667A5 (en)
JP2002063044A (en) Arithmetic unit and program-rewriting method
JP2006323494A (en) Failure recovery method and microcomputer
JP2988518B2 (en) Multiprocessor control method
JP2907114B2 (en) Method and apparatus for correcting 1-bit error in EEPROM
JP2000242528A (en) Device for monitoring cpu runaway
JP2870202B2 (en) Method and apparatus for mutual monitoring between processors
JPH07295670A (en) Starting method for computer system
JP2004046310A (en) Fault repair program application method, execution device of the same, and processing program of the same
JP2001051864A (en) Test conducting system for data processor
JPH064356A (en) Abnormal operation detecting system for software
JP4206161B2 (en) Storage medium verification device
JPH06222939A (en) Testing system for plural pipelines
JPS61846A (en) Test method for normalness of memory contents
JPH02281352A (en) Memory check method of controller for automobile
JPS62266637A (en) Error detection method for fixed memory device
JPS6125250A (en) Fault recovery method of information processor
JPS6156540B2 (en)
JP2004021527A (en) Method for detecting erroneous data of nonvolatile memory
JPH06309242A (en) Error detecting method

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 19991026