JP2014154039A - Sequence monitoring automatic programming device and automatic programming method - Google Patents

Sequence monitoring automatic programming device and automatic programming method Download PDF

Info

Publication number
JP2014154039A
JP2014154039A JP2013024893A JP2013024893A JP2014154039A JP 2014154039 A JP2014154039 A JP 2014154039A JP 2013024893 A JP2013024893 A JP 2013024893A JP 2013024893 A JP2013024893 A JP 2013024893A JP 2014154039 A JP2014154039 A JP 2014154039A
Authority
JP
Japan
Prior art keywords
monitoring
module
code
sequence
source code
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
JP2013024893A
Other languages
Japanese (ja)
Inventor
Toru Ito
徹 伊藤
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co 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 Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP2013024893A priority Critical patent/JP2014154039A/en
Publication of JP2014154039A publication Critical patent/JP2014154039A/en
Pending legal-status Critical Current

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a sequence monitoring automatic programming device capable of monitoring execution sequence between modules ranging over multiple task levels.SOLUTION: The sequence monitoring automatic programming device comprises: a source code input unit 1; an object module detection unit 2 for detecting modules to be monitored from the source code; a monitoring table reference unit 3 for referring to a sequence monitoring table in order to acquire information defining the modules to be monitored, and acquiring information necessary for the processing; a monitoring code creation unit 4 for creating monitoring code for monitoring execution sequence between modules ranging over multiple task levels, for the detected modules to be monitored, according to information of task levels where the respective modules are executed; a monitoring code insertion and source code output unit 5 for inserting the created monitoring code into source code of each module (performing edit) and outputting the source code; and a monitoring implementation table output unit 6 for outputting a sequence monitoring implementation table to refer to when the source code is executed.

Description

本発明は、マイクロプロセッサを使用した組込機器におけるプログラム実行状態を監視するシーケンス監視自動プログラミング装置および自動プログラミング方法に関する。   The present invention relates to a sequence monitoring automatic programming apparatus and an automatic programming method for monitoring a program execution state in an embedded device using a microprocessor.

従来、組込機器のプログラム実行状態を監視する技術について幾つかの提案がなされているのを見受けるが、監視機能を実行プログラムに組み入れる技術に関しては、ほとんど、作業員が監視対象となる各モジュールのソースコードに個別に監視機能を組み入れるようにしているのが現状である。   In the past, some proposals have been made regarding techniques for monitoring the program execution status of embedded devices. However, most of the techniques for incorporating monitoring functions into execution programs are for each module to be monitored. At present, the monitoring function is individually incorporated into the source code.

また下記特許文献1では、記憶部から読み出したプログラムの関数が監視対象の関数である場合には、監視対象の関数に対して監視処理が施されるように当該プログラムに監視コードを挿入し、プログラム実行部が監視コードの挿入された関数を実行することでプログラムの実行状態を監視する技術を開示している。   Further, in Patent Document 1 below, when the function of the program read from the storage unit is a function to be monitored, a monitoring code is inserted into the program so that the monitoring process is performed on the function to be monitored. A technique is disclosed in which a program execution unit monitors a program execution state by executing a function in which a monitoring code is inserted.

こうした中で作業員が個別に監視機能を組み入れる従来技術にあっては、モジュール個別に作業員が監視機能を組み入れる必要があるため、以下に示すような課題があった。すなわち、
作業員による手作業のためプログラミング誤りが発生する可能性がある。また組み入れる記述内容がモジュール毎に異なるため、プログラミング誤りが発生する可能性がある。さらに簡単な実行シーケンスの場合は、組み入れる監視機能も簡素であるが、監視対象となるモジュールの数が多くなり、構成が複雑になると、組み入れる監視機能の誤り、抜けなどが発生する可能性が高くなる。その結果、必要とする監視シーケンスと実際に各モジュールに組み込まれている監視機能の整合が取れているかどうか確認する必要があり、モジュールの構成、監視シーケンスが複雑になるほど確認の漏れ、誤りが発生する可能性が高くなる。そのうえ監視内容が変更になった場合、各モジュール本体の修正も必要となり、作業員による作業量がさらに増大する。
Under these circumstances, the conventional technique in which the worker individually incorporates the monitoring function has the following problems because it is necessary for the worker to incorporate the monitoring function for each module. That is,
Programming errors may occur due to manual work by workers. Moreover, since the description content to be incorporated differs for each module, a programming error may occur. In the case of a simple execution sequence, the monitoring function to be incorporated is also simple, but if the number of modules to be monitored increases and the configuration becomes complicated, there is a high possibility that errors or omissions in the monitoring function to be incorporated will occur. Become. As a result, it is necessary to check whether the required monitoring sequence matches the monitoring function that is actually built into each module. As the module configuration and monitoring sequence become more complicated, omissions and errors occur. Is more likely to do. In addition, when the monitoring contents are changed, it is necessary to correct each module body, which further increases the amount of work by workers.

また特許文献1に開示の従来技術では、記憶部から読み出したプログラムの関数が監視対象の関数である場合には、監視対象の関数に対して監視処理が施されるように当該プログラムに監視コードを挿入し、プログラム実行部が監視コードの挿入された関数を実行することでプログラムの実行状態を監視してプログラム実行時に監視用コードを埋め込む方式を提案しているものの、製品に複雑な処理機構を実装する必要があり、ROMベースで動作する簡素な組込機器製品には適用できない。   In the prior art disclosed in Patent Document 1, when the function of the program read from the storage unit is a function to be monitored, the monitoring code is added to the program so that the monitoring process is performed on the function to be monitored. Has been proposed, and the program execution section executes the function with the monitoring code inserted to monitor the execution state of the program and embed the monitoring code at the time of program execution. This is not applicable to simple embedded device products that operate on a ROM basis.

上記従来技術の課題を解決すべく下記特許文献2に記載のシーケンス監視自動プログラミング装置では、シーケンス監視の対象となるモジュール、その実行順序関係を記述したものから自動的に各モジュールのソースコードに監視機能を組み入れる機構を設けることを提案している。   In order to solve the above-described problems of the prior art, the sequence monitoring automatic programming device described in Patent Document 2 below automatically monitors the source code of each module from the module that is the target of sequence monitoring and the description of the execution order relationship. Proposes to provide a mechanism to incorporate functionality.

特開2004−287869号公報JP 2004-287869 A 特開2011−159115号公報JP 2011-159115 A

しかし特許文献2に記載のシーケンス監視自動プログラミング装置では、シーケンス監視の対象となるモジュール、その実行順序関係を記述したものから自動的に各モジュールのソースコードに監視機能を組み入れる機構を設けているが、複数のタスクレベルに跨るモジュール間の実行順序の監視ができない、という課題があった。   However, the sequence monitoring automatic programming device described in Patent Document 2 has a mechanism that automatically incorporates a monitoring function into the source code of each module from the modules that are subject to sequence monitoring and the descriptions of their execution order relationships. There is a problem that the execution order between modules across multiple task levels cannot be monitored.

そこで本発明は、上記の課題を解決するために、複数のタスクレベルに跨るモジュール間の実行順序を監視することが可能なシーケンス監視自動プログラミング装置および自動プログラミング方法を提供することを目的とする。   Accordingly, an object of the present invention is to provide a sequence monitoring automatic programming device and an automatic programming method capable of monitoring the execution order between modules across a plurality of task levels in order to solve the above-described problems.

上記課題を解決するために本発明のシーケンス監視自動プログラミング装置は、プログラムのソースコードを入力する手段と、入力されたソースコードから監視対象となるモジュールを検出する手段と、前記監視対象となるモジュールとその識別コード、タスクレベル、シーケンススタックの初期化の有無、及び、先行モジュール識別コードについて定義した情報を取得するためにシーケンス監視テーブルを参照する手段と、参照した前記シーケンス監視テーブルにおける各モジュールの実行されるタスクレベルの情報に従って前記検出した監視対象となるモジュールに対して複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを生成する手段と、生成した前記複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを各モジュールのソースコードに挿入して出力する手段と、実行コード生成時の参照のためにシーケンス監視実装テーブルを出力する手段と、を具備したことを特徴とする。   In order to solve the above problems, a sequence monitoring automatic programming apparatus according to the present invention includes a means for inputting a source code of a program, a means for detecting a module to be monitored from the input source code, and the module to be monitored. And the identification code, task level, presence / absence of initialization of the sequence stack, and means for referring to the sequence monitoring table to obtain information defined for the preceding module identification code, and for each module in the referenced sequence monitoring table Means for generating a monitoring code for monitoring an execution order between modules across a plurality of task levels for the detected monitoring target module according to information on a task level to be executed; and the generated plurality of task levels Supervises the execution order between modules It means for monitoring code is inserted into the source code of each module output that is characterized by comprising a means for outputting a sequence monitoring implementation tables for reference runtime code generation.

また本発明のシーケンス監視自動プログラミング方法は、プログラムのソースコードを入力する過程、入力されたソースコードから監視対象となるモジュールを検出する過程、
前記監視対象となるモジュールとその識別コード、タスクレベル、シーケンススタックの初期化の有無、及び、先行モジュール識別コードについて定義した情報を取得するためにシーケンス監視テーブルを参照する過程、参照した前記シーケンス監視テーブルにおける各モジュールの実行されるタスクレベルの情報に従って前記検出した監視対象となるモジュールに対して複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを生成する過程、生成した前記複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを各モジュールのソースコードに挿入して出力する過程、および、実行コード生成時の参照のためにシーケンス監視実装テーブルを出力する過程、を含むことを特徴とする
The sequence monitoring automatic programming method of the present invention includes a process of inputting a source code of a program, a process of detecting a module to be monitored from the input source code,
The module to be monitored and its identification code, task level, presence / absence of sequence stack initialization, and a process of referring to a sequence monitoring table to acquire information defined for a preceding module identification code, the sequence monitoring referred to The process of generating monitoring code for monitoring the execution order between modules across a plurality of task levels for the detected module to be monitored according to information on the task level executed by each module in the table, the generated plurality The process of outputting the monitoring code for monitoring the execution order between modules across the task level of each module and outputting it to the source code of each module, and the process of outputting the sequence monitoring implementation table for reference when generating the execution code, It is characterized by including

本発明によれば、監視対象となるモジュールの実行されるタスクレベルをシーケンス監視テーブルに定義し、それに基づいて複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを挿入したソースコードを自動的に出力することにより、複数のタスクレベルに跨るモジュール間の実行順序を監視する機能を誤りなく、少ない工数で実装することができる。   According to the present invention, the task level to be executed of the module to be monitored is defined in the sequence monitoring table, and the source code in which the monitoring code for monitoring the execution order between the modules across the plurality of task levels is inserted based on the defined task level. Is automatically output, and the function for monitoring the execution order between modules across multiple task levels can be implemented without error and with less man-hours.

本発明の実施形態に係るシーケンス監視自動プログラミング装置の構成概要を示すブロック図である。It is a block diagram which shows the structure outline | summary of the sequence monitoring automatic programming apparatus which concerns on embodiment of this invention. 本発明の実施形態に係るシーケンス監視自動プログラミング装置の実施例を示す図である。It is a figure which shows the Example of the sequence monitoring automatic programming apparatus which concerns on embodiment of this invention. 組込み機器における各モジュールの実行順番を示す図である。It is a figure which shows the execution order of each module in an embedded device. 本発明の実施形態に係るシーケンス監視自動プログラミング装置の実施例の処理フローを示す図である。It is a figure which shows the processing flow of the Example of the sequence monitoring automatic programming apparatus which concerns on embodiment of this invention. 図4に示した初期化処理「initial」の内容を示す図である。FIG. 5 is a diagram showing the contents of the initialization process “initial” shown in FIG. 4. 図4に示したシーケンス監視処理「check」の内容を示す図である。It is a figure which shows the content of the sequence monitoring process "check" shown in FIG.

以下、本発明の実施の形態について、詳細に説明する。
図1は、本発明の実施形態に係るシーケンス監視自動プログラミング装置の構成概要を示すブロック図である。図1において本発明の実施形態に係るシーケンス監視自動プログラミング装置(以下、自動プログラミング装置と略称する)は、プログラムのソースコードを入力するソースコード入力部1と、入力されたソースコードから監視対象となるモジュールを検出する対象モジュール検出部2と、監視対象となるモジュールとその識別コード、タスクレベル、シーケンススタックの初期化の有無、及び、先行モジュール識別コードについて定義した情報を取得するためにシーケンス監視テーブル(図2参照)を参照し、定義されている情報の中から処理に必要な情報を取得する監視テーブル参照部3と、参照した前記シーケンス監視テーブルにおける各モジュールの実行されるタスクレベルの情報に従って前記検出した監視対象となるモジュールに対して複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを生成する監視用コード生成部4と、生成した監視用コードを各モジュールのソースコードに挿入(編集)してソースコードを出力する監視用コード挿入・ソースコード出力部5と、出力されたソースコードを実行する際に参照するシーケンス監視実装テーブル(図2参照)を出力する監視実装テーブル出力部6とで構成されている。
Hereinafter, embodiments of the present invention will be described in detail.
FIG. 1 is a block diagram showing an outline of the configuration of a sequence monitoring automatic programming apparatus according to an embodiment of the present invention. 1, a sequence monitoring automatic programming device (hereinafter abbreviated as “automatic programming device”) according to an embodiment of the present invention includes a source code input unit 1 for inputting a source code of a program, and a monitoring target from the input source code. A target module detection unit 2 for detecting a module to be detected, and a sequence monitor to acquire information defined about the module to be monitored and its identification code, task level, sequence stack initialization, and preceding module identification code A monitoring table reference unit 3 that acquires information necessary for processing from the defined information with reference to the table (see FIG. 2), and information on the task level executed by each module in the referenced sequence monitoring table According to the detected module to be monitored A monitoring code generation unit 4 that generates a monitoring code that monitors the execution order between modules across multiple task levels, and outputs the source code by inserting (editing) the generated monitoring code into the source code of each module A monitoring code insertion / source code output unit 5 and a monitoring implementation table output unit 6 that outputs a sequence monitoring implementation table (see FIG. 2) to be referred to when the output source code is executed.

上記した自動プログラミング装置の機能ブロックを実現するハードウェア構成は、当業者によく知られているパソコン(personal computer)レベルのコンピュータで構成されているもので、キーボード,マウス,ポインティングデバイス等を有する入力装置、処理結果を出力する装置の外、入力中又は処理中の内容を確認するためディプレイに表示することが可能な出力装置、メモリに記憶されたプログラムに従って処理を実行するための中央処理装置(CPU(Central Processing Unit))、プログラム及びデータ等を記憶するためのメモリ(ROM(read only memory),RAM(random access memory),HDD(Hard Disk Device),USB(universal serial bus)メモリ等)、HDD等の記憶媒体を駆動するための記録媒体駆動装置、および、入出力装置へのインタフェースや外部の各種装置とデータ授受を行うためのインターフェース(IF)、等を備えている。また上記コンピュータは、インターネット等のネットワークに接続する機能を備えていても良い。   The hardware configuration for realizing the functional blocks of the automatic programming device described above is configured by a personal computer level computer well known to those skilled in the art, and has an input having a keyboard, a mouse, a pointing device, and the like. Outside of the device, the device for outputting the processing result, the output device capable of displaying on the display for confirming the contents being input or being processed, the central processing device for executing the processing according to the program stored in the memory (CPU (Central Processing Unit)), memory for storing programs and data (ROM (read only memory), RAM (random access memory), HDD (Hard Disk Device), USB (universal serial bus) memory, etc.)) , A recording medium driving device for driving a storage medium such as an HDD, and an interface to an input / output device And various external devices and interfaces for exchanging data (IF), and a like. The computer may have a function of connecting to a network such as the Internet.

上記においてソースコード入力部1は、上記コンピュータの入力装置の指示のもと、プログラムに基づいて処理を実行するCPUおよびインターフェース(IF)を介して、外部のソースコードが記憶された記憶媒体にアクセスして該記憶媒体からソースコードをコンピュータ内のメモリに取り込むことで実現可能である。また、対象モジュール検出部2、監視テーブル参照部3、および、監視用コード生成部4は、上記コンピュータのCPUが予め用意されたシーケンス監視テーブル(図2参照)を参照しながらプログラムに基づいて処理を実行し、処理結果をコンピュータ内のメモリに格納することで上記の各機能を実現可能である。なお詳細については後述する。また、監視用コード挿入・ソースコード出力部5および監視実装テーブル出力部6は、上記コンピュータのCPUがメモリに格納された処理結果を出力装置に出力することで実現可能である。なお出力装置に出力する際には必要に応じてインターフェース(IF)を使用することができる。   In the above, the source code input unit 1 accesses a storage medium storing external source code via a CPU and an interface (IF) that execute processing based on a program under the instruction of the input device of the computer. This can be realized by fetching the source code from the storage medium into the memory in the computer. The target module detection unit 2, the monitoring table reference unit 3, and the monitoring code generation unit 4 perform processing based on a program while referring to a sequence monitoring table (see FIG. 2) prepared in advance by the CPU of the computer. And the above-described functions can be realized by storing the processing result in the memory in the computer. Details will be described later. The monitoring code insertion / source code output unit 5 and the monitoring implementation table output unit 6 can be realized by the CPU of the computer outputting the processing result stored in the memory to the output device. When outputting to the output device, an interface (IF) can be used as necessary.

図2は、本発明の実施形態に係るシーケンス監視自動プログラミング装置の実施例を示す図である。図2に示す実施例において、シーケンス監視自動プログラミング装置100は、まずソースコードが記述された入力ファイル200からモジュール別にソースコードが含まれた入力モジュール210〜250の内容を読み取る。   FIG. 2 is a diagram showing an example of the sequence monitoring automatic programming apparatus according to the embodiment of the present invention. In the embodiment shown in FIG. 2, the sequence monitoring automatic programming apparatus 100 first reads the contents of the input modules 210 to 250 including the source code for each module from the input file 200 in which the source code is described.

次にシーケンス監視自動プログラミング装置100は、シーケンス監視テーブル300を参照し、その内容に従い、読み取った入力モジュール210〜250に含まれるソースコードを編集し、各モジュール別にソースコードにシーケンス監視機能、例えばinitial処理、check処理などのソフトウェア処理機能、が挿入された出力モジュール410〜450を出力ファイル400として出力する。また、出力されシーケンス監視機能がソースコードに挿入された出力モジュール410〜450のソースコードから実行コードを生成する時に参照するためのシーケンス監視実装テーブル500を出力する。   Next, the sequence monitoring automatic programming apparatus 100 refers to the sequence monitoring table 300, edits the source code included in the read input modules 210 to 250 according to the contents thereof, and adds a sequence monitoring function, for example, initial to each source code for each module. The output modules 410 to 450 into which software processing functions such as processing and check processing are inserted are output as the output file 400. In addition, a sequence monitoring implementation table 500 is output for reference when generating an execution code from the source code of the output modules 410 to 450 that is output and inserted into the source code by the sequence monitoring function.

以上でシーケンス監視自動プログラミング装置100の動作処理は終了するが、利用者(ユーザ)は、以降、出力ファイル400に出力されたソースコードを通常のソフトウェア開発と同様にソフトウェア開発環境においてコンパイル、ビルドを行うことにより実行コードを生成し、生成した実行コードをマイクロプロセッサ内蔵の組込み機器(図示せず)に実装することとなる。   The operation processing of the sequence monitoring automatic programming device 100 is thus completed, but the user (user) thereafter compiles and builds the source code output to the output file 400 in the software development environment in the same way as normal software development. As a result, an execution code is generated, and the generated execution code is mounted on an embedded device (not shown) with a built-in microprocessor.

なお、シーケンス監視テーブル300は、各モジュールについて、そのタスクレベル310、モジュール名称320、シーケンススタックの初期化の有無330、モジュールの識別コード340および先行モジュール識別コード350を保持する。このシーケンス監視テーブル300の作成方法については、一般的にはテキストファイルで作成するが、その作成方法、物理的なフォーマットは任意である。またシーケンス監視実装テーブル500は、シーケンス監視テーブル300と同様に、識別コード510、タスクレベル520及び先行モジュール識別コード530の各欄にデータが記述される。   The sequence monitoring table 300 holds, for each module, a task level 310, a module name 320, whether or not a sequence stack is initialized 330, a module identification code 340, and a preceding module identification code 350. The sequence monitoring table 300 is generally created as a text file, but the creation method and physical format are arbitrary. Similarly to the sequence monitoring table 300, the sequence monitoring implementation table 500 describes data in each column of the identification code 510, the task level 520, and the preceding module identification code 530.

また図2に示したシーケンス監視実装テーブル500は、図3に示すモジュールの実行状態を定義したものになる。図3は組込み機器(図示せず)における各モジュールの実行順番を示したものであり、module_A、module_Bおよびmodule_Cは、同一のタスクレベルxの一つの実行サイクルの中でこの順番で実行されると正常なシーケンスの実行が行われたものとみなされる例を示したもので、このような実行状態が正常に行われているかを後述するシーケンス監視により自動的に監視する。   The sequence monitoring implementation table 500 shown in FIG. 2 defines the execution status of the modules shown in FIG. FIG. 3 shows the execution order of modules in an embedded device (not shown). When module_A, module_B, and module_C are executed in this order in one execution cycle of the same task level x, FIG. An example in which a normal sequence is considered to have been executed is shown, and whether such an execution state is normally performed is automatically monitored by sequence monitoring described later.

すなわち、module_Aは、タスクレベルxにおける実行サイクルの中で最初に実行されるモジュールであり、その処理の中では監視用のシーケンススタック(図示せず)を初期化(図2のシーケンス監視テーブル300の初期化有無の欄330参照)することが必要であり、初期化後にシーケンススタックにmodule_Aを実施したことを示す識別子”A”を格納する。その内容をシーケンス監視テーブル300のmodule_Aの部分に記載する。識別子の”A”はここでは文字コードのAを示す。これは例であり、module_Aを一意に特定できるものであれば、任意の数値、他のコード系などを使用できる。   That is, module_A is the module that is executed first in the execution cycle at the task level x, and initializes a monitoring sequence stack (not shown) in the process (in the sequence monitoring table 300 of FIG. 2). The identifier “A” indicating that module_A has been implemented is stored in the sequence stack after initialization. The contents are described in the module_A portion of the sequence monitoring table 300. The identifier “A” indicates the character code A here. This is an example, and any numerical value or other code system can be used as long as module_A can be uniquely identified.

そしてmodule_Bは、module_Aの次に実行されるべきものであり、module_Bに挿入される監視機能としては、実行前にmodule_Aが実行されているかどうかを監視することになる。この内容がシーケンス監視テーブル300のmodule_Bの先行モジュール識別コード350に記載される。   Module_B is to be executed next to module_A. As a monitoring function inserted into module_B, it is monitored whether module_A is executed before execution. This content is described in the preceding module identification code 350 of module_B of the sequence monitoring table 300.

またmodule_Cでは、実行前にmodule_A, Bおよびタスクレベルyにおいて実行されるmodule_D, module_Eがこの順で実行されている必要があり、この内容がシーケンス監視テーブル300のmodule_Cの先行モジュール識別コード350に記載される。   In module_C, module_A, B and module_D, module_E executed at task level y must be executed in this order before execution, and this content is described in the preceding module identification code 350 of module_C in the sequence monitoring table 300 Is done.

またタスクレベルyにおいて実行されるmodule_Dは、タスクレベルyにおける実行サイクルの中で最初に実行されるモジュールであり、その処理の中では監視用のシーケンススタック(図示せず)を初期化(図2のシーケンス監視テーブル300の初期化有無の欄330参照)することが必要であり、初期化後にシーケンススタックにmodule_Dを実施したことを示す識別子”D”を格納する。その内容をシーケンス監視テーブル300のmodule_Dの部分に記載する。   The module_D executed at the task level y is a module executed first in the execution cycle at the task level y, and a monitoring sequence stack (not shown) is initialized in the processing (FIG. 2). The identifier “D” indicating that the module_D has been implemented is stored in the sequence stack after the initialization. The contents are described in the module_D portion of the sequence monitoring table 300.

またタスクレベルyにおいて実行されるmodule_Eは、module_Dの次に実行されるべきものであり、module_Eに挿入される監視機能としては、実行前にmodule_Dが実行されているかどうかを監視することになる。この内容がシーケンス監視テーブル300のmodule_Eの先行モジュール識別コード350に同様に記載する。   The module_E executed at the task level y is to be executed next to the module_D, and the monitoring function inserted into the module_E is to monitor whether the module_D is executed before execution. This content is similarly described in the preceding module identification code 350 of module_E of the sequence monitoring table 300.

図4は、本発明の実施形態に係るシーケンス監視自動プログラミング装置の実施例の処理フローを示す図である。図4において、最初に、まずシーケンス監視テーブル300を参照する環境を初期化する(ステップS41)。この後はシーケンス監視テーブル300を順に参照しながら処理を行うことができる。   FIG. 4 is a diagram showing a processing flow of an example of the sequence monitoring automatic programming apparatus according to the embodiment of the present invention. In FIG. 4, first, an environment for referring to the sequence monitoring table 300 is initialized (step S41). Thereafter, the processing can be performed while referring to the sequence monitoring table 300 in order.

次にシーケンス監視自動プログラミング装置100は、シーケンス監視テーブル300に記載のモジュール名が含まれたソースコードファイル200を検索する(ステップS42)。そして、シーケンス監視テーブル300の初期化有無330を参照し(ステップS43)、初期化ありであれば(ステップS43:Yes)、ソースコードに初期化の処理(call initial (引数))を挿入する(ステップS44)。初期化の処理の名前はここでは例としてinitialとしてある。処理に渡す引数は、シーケンス監視テーブル300に記載の識別コード340とする。   Next, the sequence monitoring automatic programming device 100 searches the source code file 200 including the module name described in the sequence monitoring table 300 (step S42). Then, the initialization presence / absence 330 of the sequence monitoring table 300 is referred to (step S43). If initialization is present (step S43: Yes), an initialization process (call initial (argument)) is inserted into the source code (step S43: Yes) Step S44). As an example, the name of the initialization process is “initial”. The argument passed to the process is the identification code 340 described in the sequence monitoring table 300.

一方、初期化ありでなければ(ステップS43:No)、ソースコードに監視の処理(call check (引数))を挿入する(ステップS45)。監視の処理の名前はここでは例としてcheckとしてある。処理に渡す引数は、上記した初期化ありの場合と同様に、シーケンス監視テーブル300にある識別コード340とする。これらのいずれかの処理が終了した場合には、編集した、つまり監視機能が挿入された、ソースコードを出力する(ステップS46)。   On the other hand, if there is no initialization (step S43: No), a monitoring process (call check (argument)) is inserted into the source code (step S45). In this example, the name of the monitoring process is “check”. The argument passed to the process is the identification code 340 in the sequence monitoring table 300, as in the case of initialization described above. When any of these processes is completed, the source code that has been edited, that is, the monitoring function is inserted, is output (step S46).

これでシーケンス監視テーブル300に記載の一つのモジュールについての処理を終了するので、以下、この処理をシーケンス監視テーブル300に記載があるモジュール分だけ繰り返す(ステップS47)。繰り返しの処理を終了したら、シーケンス監視実装テーブル500を出力して(ステップS48)、シーケンス監視自動プログラミング装置100の処理を終了する。   This completes the process for one module described in the sequence monitoring table 300, so that this process is repeated for the modules described in the sequence monitoring table 300 (step S47). When the repetitive processing is finished, the sequence monitoring mounting table 500 is output (step S48), and the processing of the sequence monitoring automatic programming device 100 is finished.

これにより、シーケンス監視の順番や対象となるモジュールを、監視対象となるモジュールの実行されるタスクレベルをシーケンス監視テーブルに定義し、それに基づいて監視処理を挿入したソースコードを自動的に出力することにより、複数のタスクレベルに跨るモジュール間の実行順序を監視する機能を誤りなく、少ない工数で実装することができる。   As a result, the sequence monitoring sequence and the modules to be monitored are defined in the sequence monitoring table as the task level to be executed by the modules to be monitored, and the source code in which the monitoring process is inserted is automatically output based on this Therefore, the function for monitoring the execution order between modules across a plurality of task levels can be implemented without error and with less man-hours.

図5は、図4に示したシーケンス監視の初期化処理(initial(“ ”))の内容を示す図である。図5において、引数(ここでは識別コード)で示されたモジュールの該当するタスクレベルの監視用のシーケンススタック(図示せず)を初期化する(ステップS51)。しかる後、引数で渡された識別コード340をシーケンススタックに格納する(ステップS52)。こうしてシーケンス監視の初期化処理(initial (“ ”))を終了する。   FIG. 5 is a diagram showing the contents of the sequence monitoring initialization process (initial (“”)) shown in FIG. In FIG. 5, a sequence stack (not shown) for monitoring the task level corresponding to the module indicated by the argument (here, the identification code) is initialized (step S51). Thereafter, the identification code 340 passed as an argument is stored in the sequence stack (step S52). Thus, the sequence monitoring initialization process (initial (“”)) is completed.

図6は、図4に示したシーケンス監視処理(check(“ ”))の内容を示す図である。図6において、まず引数の識別コード510に対応するモジュールの先行モジュール識別コード530をシーケンス監視実装テーブル500から抽出する(ステップS61)。   FIG. 6 is a diagram showing the contents of the sequence monitoring process (check (“”)) shown in FIG. In FIG. 6, first, the preceding module identification code 530 of the module corresponding to the argument identification code 510 is extracted from the sequence monitoring implementation table 500 (step S61).

次にシーケンススタック(図示せず)に格納されている識別コードがシーケンス監視実装テーブル500に記載されている先行モジュール識別コード530の内容と同じ順番に格納されているか確認する(ステップS62)。順番通りに格納されていれば(ステップS62:Yes)、シーケンスが正常であり、引数で渡された識別コード510を該当するタスクレベルのシーケンススタックに格納する(ステップS63)。   Next, it is confirmed whether the identification codes stored in the sequence stack (not shown) are stored in the same order as the contents of the preceding module identification code 530 described in the sequence monitoring implementation table 500 (step S62). If stored in order (step S62: Yes), the sequence is normal, and the identification code 510 passed as an argument is stored in the corresponding task level sequence stack (step S63).

一方、順番通りに格納されていない場合は(ステップS62:No)、異常処理(サブルーチン)を呼び出す(ステップS64)。異常処理の内容は組込み機器固有に記述する内容が含まれており、それにしたがって異常処理(サブルーチン)が実行される。   On the other hand, if they are not stored in order (step S62: No), an abnormal process (subroutine) is called (step S64). The contents of the abnormality process include the contents that are specific to the embedded device, and the abnormality process (subroutine) is executed accordingly.

異常処理の内容としては、一般的には、外部に異常発生を表示したり又は外部に警告を発する、さらに、異常が発生したことをしかるべき部署に通知する、或いは、処理を停止または処理を遷移する、などが適宜実施される。   In general, the contents of abnormality processing are to display the occurrence of abnormality or issue a warning to the outside, notify the appropriate department that abnormality has occurred, or stop or stop the processing. Transition is performed as appropriate.

本例の場合、異常処理(サブルーチン)が終了したら、通常の処理ルートに戻り、引数で渡された識別コードをシーケンススタックに格納する(ステップS63)。こうしてシーケンス監視処理(check (“ ”))を終了する。   In this example, when the abnormal process (subroutine) is completed, the process returns to the normal process route, and the identification code passed as an argument is stored in the sequence stack (step S63). Thus, the sequence monitoring process (check (“”)) is terminated.

このように本発明の実施形態に係るシーケンス監視自動プログラミング装置は、監視対象となるモジュールの実行されるタスクレベルをシーケンス監視テーブルに定義し、それに基づいて監視処理を挿入したソースコードを自動的に出力することにより、複数のタスクレベルに跨るモジュール間の実行順序を監視する機能を誤りなく、少ない工数で実装することができる。   As described above, the sequence monitoring automatic programming device according to the embodiment of the present invention defines the task level to be executed by the module to be monitored in the sequence monitoring table, and automatically inputs the source code into which the monitoring process is inserted based on the defined task level. By outputting, the function of monitoring the execution order between modules across multiple task levels can be implemented without error and with fewer man-hours.

1 ソースコード入力部
2 対象モジュール検出部
3 監視テーブル参照部
4 監視用コード生成部
5 監視用コード挿入・ソースコード出力部
6 監視実装テーブル出力部
100 シーケンス監視自動プログラミング装置
200 入力ソースコードファイル
210 ソースコード内容1が含まれた入力モジュール
220 ソースコード内容2が含まれた入力モジュール
230 ソースコード内容3が含まれた入力モジュール
240 ソースコード内容4が含まれた入力モジュール
250 ソースコード内容5が含まれた入力モジュール
300 シーケンス監視テーブル
310 タスクレベル
320 モジュール名称
330 初期化有無
340 識別コード
350 先行モジュール識別コード
400 監視機能が挿入された出力ソースコードファイル
410 ソースコードに監視機能1が挿入された出力モジュール
420 ソースコードに監視機能2が挿入された出力モジュール
430 ソースコードに監視機能3が挿入された出力モジュール
440 ソースコードに監視機能4が挿入された出力モジュール
450 ソースコードに監視機能5が挿入された出力モジュール
500 シーケンス監視実装テーブル
510 識別コード
520 タスクレベル
530 先行モジュール識別コード
1 Source code input unit 2 Target module detection unit 3 Monitoring table reference unit 4 Monitoring code generation unit 5 Monitoring code insertion / source code output unit 6 Monitoring implementation table output unit
100 Sequence monitoring automatic programming device
200 input source code file
210 Input module with source code content 1
220 Input module with source code contents 2
230 Input module with source code contents 3
240 Input module with source code contents 4
250 Input module with source code contents 5
300 Sequence monitoring table
310 task level
320 Module name
330 Initialization
340 identification code
350 Predecessor identification code
400 Output source code file with monitoring function inserted
410 Output module with monitoring function 1 inserted in source code
420 Output module with monitoring function 2 inserted in source code
430 Output module with monitoring function 3 inserted in source code
440 Output module with monitoring function 4 inserted in source code
450 Output module with monitoring function 5 inserted in source code
500 Sequence monitoring implementation table
510 ID code
520 task level
530 Predecessor module identification code

Claims (3)

プログラムのソースコードを入力する手段と、
入力されたソースコードから監視対象となるモジュールを検出する手段と、
前記監視対象となるモジュールとその識別コード、タスクレベル、シーケンススタックの初期化の有無、及び、先行モジュール識別コードについて定義した情報を取得するためにシーケンス監視テーブルを参照する手段と、
参照した前記シーケンス監視テーブルにおける各モジュールの実行されるタスクレベルの情報に従って前記検出した監視対象となるモジュールに対して複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを生成する手段と、
生成した前記複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを各モジュールのソースコードに挿入して出力する手段と、
実行コード生成時の参照のためにシーケンス監視実装テーブルを出力する手段と、
を具備したことを特徴とするシーケンス監視自動プログラミング装置。
Means for inputting the source code of the program;
Means for detecting the module to be monitored from the input source code;
Means for referring to a sequence monitoring table in order to obtain information defining the module to be monitored and its identification code, task level, presence / absence of sequence stack initialization, and preceding module identification code;
Means for generating monitoring code for monitoring the execution order between modules across a plurality of task levels for the detected module to be monitored in accordance with the information on the task level executed by each module in the referenced sequence monitoring table When,
Means for inserting and outputting monitoring code for monitoring the execution order between modules across the plurality of generated task levels into the source code of each module;
Means for outputting a sequence monitoring implementation table for reference during execution code generation;
A sequence monitoring automatic programming apparatus comprising:
プログラムのソースコードを入力する過程、
入力されたソースコードから監視対象となるモジュールを検出する過程、
前記監視対象となるモジュールとその識別コード、タスクレベル、シーケンススタックの初期化の有無、及び、先行モジュール識別コードについて定義した情報を取得するためにシーケンス監視テーブルを参照する過程、
参照した前記シーケンス監視テーブルにおける各モジュールの実行されるタスクレベルの情報に従って前記検出した監視対象となるモジュールに対して複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを生成する過程、
生成した前記複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コードを各モジュールのソースコードに挿入して出力する過程、および、
実行コード生成時の参照のためにシーケンス監視実装テーブルを出力する過程、
を含むことを特徴とするシーケンス監視自動プログラミング方法。
The process of entering the source code of the program,
The process of detecting the module to be monitored from the input source code,
The process of referring to the sequence monitoring table to obtain information defining the module to be monitored and its identification code, task level, presence / absence of sequence stack initialization, and preceding module identification code,
A process of generating monitoring code for monitoring an execution order between modules across a plurality of task levels for the detected monitoring target module according to information on a task level executed by each module in the referenced sequence monitoring table ,
A process of inserting and outputting monitoring code for monitoring the execution order between modules across the plurality of generated task levels into the source code of each module, and
The process of outputting the sequence monitoring implementation table for reference during execution code generation,
A sequence monitoring automatic programming method comprising:
シーケンス監視処理を定義したシーケンス監視テーブルを参照する手段を有する情報処理装置において監視用コードを挿入したソースコードを自動的に生成し出力するためのプログラムであって、
コンピュータに、
プログラムのソースコードを入力する機能、
入力されたソースコードから監視対象となるモジュールを検出する機能、
前記監視対象となるモジュールとその識別コード、タスクレベル、シーケンススタックの初期化の有無、及び、先行モジュール識別コードについて定義した情報を取得するためにシーケンス監視テーブルを参照する機能、
参照した前記シーケンス監視テーブルにおける各モジュールの実行されるタスクレベルの情報に従って前記検出した監視対象となるモジュールに対して複数のタスクレベルに跨るモジュール間の実行順序を監視する監視用コード監視用コードを生成する機能、
生成した前記監視用コードを各モジュールのソースコードに挿入して出力する機能、および、
実行コード生成時の参照のためにシーケンス監視実装テーブルを出力する機能、
を実現させるためのプログラム。
A program for automatically generating and outputting a source code in which a monitoring code is inserted in an information processing apparatus having means for referring to a sequence monitoring table defining a sequence monitoring process,
On the computer,
The ability to enter program source code,
A function to detect the module to be monitored from the input source code,
A function to refer to the sequence monitoring table to obtain information defining the module to be monitored and its identification code, task level, presence / absence of sequence stack initialization, and preceding module identification code;
Monitoring code monitoring code for monitoring the execution order between modules across a plurality of task levels with respect to the detected module to be monitored according to the information of the task level executed by each module in the referenced sequence monitoring table Function to generate,
A function for inserting and outputting the generated monitoring code into the source code of each module; and
A function to output a sequence monitoring implementation table for reference during execution code generation,
A program to realize
JP2013024893A 2013-02-12 2013-02-12 Sequence monitoring automatic programming device and automatic programming method Pending JP2014154039A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013024893A JP2014154039A (en) 2013-02-12 2013-02-12 Sequence monitoring automatic programming device and automatic programming method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013024893A JP2014154039A (en) 2013-02-12 2013-02-12 Sequence monitoring automatic programming device and automatic programming method

Publications (1)

Publication Number Publication Date
JP2014154039A true JP2014154039A (en) 2014-08-25

Family

ID=51575825

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013024893A Pending JP2014154039A (en) 2013-02-12 2013-02-12 Sequence monitoring automatic programming device and automatic programming method

Country Status (1)

Country Link
JP (1) JP2014154039A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108132782A (en) * 2017-12-21 2018-06-08 沈阳鼓风机集团自动控制系统工程有限公司 Automatic programming unit and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108132782A (en) * 2017-12-21 2018-06-08 沈阳鼓风机集团自动控制系统工程有限公司 Automatic programming unit and electronic equipment
CN108132782B (en) * 2017-12-21 2020-11-27 沈阳鼓风机集团自动控制系统工程有限公司 Automatic programming device and electronic equipment

Similar Documents

Publication Publication Date Title
EP3616066B1 (en) Human-readable, language-independent stack trace summary generation
CN104536810B (en) A kind of method for detecting abnormality and device based on stack
US20140033178A1 (en) Method and apparatus for reverse debugging source code using causal analysis
JP6477553B2 (en) Program development support apparatus, program development support program, and program development support method
US8489938B2 (en) Diagnostic data capture in a computing environment
US20110029953A1 (en) System and Method for Scalable Handling of Debug Information
US20150220733A1 (en) Apparatus and method for detecting a malicious code based on collecting event information
JP2009193335A (en) Automatic annotation insertion method of static verification tool
JP2014154039A (en) Sequence monitoring automatic programming device and automatic programming method
JP6665576B2 (en) Support device, support method, and program
US7448029B2 (en) Modification of array access checking in AIX
JP4870956B2 (en) Embedded program generation method, embedded program development system, and information table section
JP2011159115A (en) Automatic programming device, automatic programming method, and program for monitoring sequence
CN108614704B (en) Code compiling method and device
JP5811859B2 (en) Source code static analysis device, system, method, and program therefor
JP2009211622A (en) Contract definition function verification device, method thereof, and program thereof
JP2016057658A (en) Fault information management system and fault information management method
JP5024252B2 (en) Trace information acquisition device, trace information acquisition program, and trace information acquisition method
JP2011154465A (en) Management device, management method, and management program for information processor
JP2008052359A (en) Test case generation device, test case generation method, and test case generator
US9542182B2 (en) Standardization of variable names in an integrated development environment
CN113076084A (en) Resource file processing method, device, equipment and storage medium
JP6579022B2 (en) Generating program, generating method, and generating apparatus
JP6609216B2 (en) Apparatus and method for analyzing static analysis result of source code
JP2020502687A5 (en)