JPH11288367A - Automatic program generation system and method - Google Patents

Automatic program generation system and method

Info

Publication number
JPH11288367A
JPH11288367A JP9024998A JP9024998A JPH11288367A JP H11288367 A JPH11288367 A JP H11288367A JP 9024998 A JP9024998 A JP 9024998A JP 9024998 A JP9024998 A JP 9024998A JP H11288367 A JPH11288367 A JP H11288367A
Authority
JP
Japan
Prior art keywords
state
transition
event
program
lock
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
JP9024998A
Other languages
Japanese (ja)
Inventor
Akihiko Koga
明彦 古賀
Hirotaka Mizuno
浩孝 水野
Takumi Sanada
巧 真田
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP9024998A priority Critical patent/JPH11288367A/en
Publication of JPH11288367A publication Critical patent/JPH11288367A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To effectively generate a program that is used for organization of a system where a single terminal must react to many events by enlarging the description system of a state transition automaton and building in the transition of a lock state into the automaton. SOLUTION: The description system of a state transition automaton is enlarged, and the transition of a lock state which performs a prescribed exclusive control operation is built in into the automaton. Then an operation which controls the lock state transition is described on the automaton in a lock state transition mode, and the user detects this description and generates a program to return an event showing a locked state to an external event in a lock state mode. In this system, the system description 1 is described on the automaton by the user and inputted to an information processor. A program generation part 2 generates a prescribed program in a process that is carried out based on the contents of the description 1.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、状態遷移オートマ
トン、すなわち、状態遷移と各状態における動作定義か
らなるモジュールの記述の集まりで表現されたシステム
の記述に基づき、コンピュータ処理により、対応するプ
ログラムを自動生成(作成)する技術に係わり、特に、
金融/公共などの分野でネットワークを経由して遠隔の
顧客/住民にサービスを提供するシステムのように、1
つの端末が、その端末に装備されているプリンタ、スキ
ャナ、現金発行機、カードリーダ等から送られるイベン
トや、相手の端末からの要求を表すイベントなど、多く
のイベントに反応しなければならないシステムの構築に
用いるプログラムを効率的に生成するのに好適なプログ
ラム自動生成システムと方法に関するものである。
BACKGROUND OF THE INVENTION The present invention relates to a state transition automaton, that is, a computer program for generating a corresponding program by computer processing based on a system description expressed as a set of module descriptions including state transitions and operation definitions in each state. Regarding the technology of automatic generation (creation),
In systems such as providing services to remote customers / residents via networks in fields such as finance / public,
A system in which one terminal must respond to many events, such as an event sent from a printer, scanner, cash dispenser, card reader, etc., mounted on that terminal, or an event representing a request from the other terminal. The present invention relates to an automatic program generation system and method suitable for efficiently generating a program used for construction.

【0002】[0002]

【従来の技術】従来、複数の機器や通信相手のイベント
を処理するシステムのプログラムの開発技術として、例
えば、水野忠則監修「プロトコル言語」(1994年、(株)
カットシステム出版)に記載の「Estelle」や「SDL」が
ある。特に、その第63〜85頁に記載のEstelleはプ
ロトコル記述のための言語であり、このEstelleでは、
ユーザは、そのようなシステムを、お互いにイベントを
送り合う有限状態オートマトンの集まり(以下、モジュ
ールと呼ぶ)として記述し、Estelle用に提供されている
ツールを使って、コンピュータにより、その記述からプ
ログラムを自動生成することができる。
2. Description of the Related Art Conventionally, as a technique for developing a program of a system for processing events of a plurality of devices and communication partners, for example, "Protocol Language" supervised by Tadanori Mizuno (1994, Inc.)
Cut System Publishing), "Estelle" and "SDL". In particular, Estelle on pages 63-85 is a language for protocol description.
Users describe such a system as a collection of finite state automata (hereafter referred to as modules) that send events to each other, and programmatically derive from the description using a tool provided for Estelle. Can be automatically generated.

【0003】このようなEstelleの機能を、上述の文献
の第68頁における記述例を用いて説明する。ここで
は、2つのチャンネルを持ち、内部に4つの状態を持
ち、外部とイベントのやり取りを行うモジュールEを定
義している。
[0003] The function of such Estelle will be described using a description example on page 68 of the above-mentioned document. Here, a module E that has two channels, has four internal states, and exchanges events with the outside is defined.

【0004】 Specification Example; default individual queue; channel ChU(R1, R2); by R1: put; channel ChS(Ra, Rb); by Ra: dt0; dt1; by Rb: ak0; ak1; module E systemprocess; ip U: ChU(R2); S: ChS(Ra); end; body E1 for E; state s0, s1, s2, s4; ................. (1) initialize to s0 begin end; ................ (2) trans ...................................... (3) when U.put ............................. (4) from s0 to s1 ........................ (5) begin output S.dt0 end; ............ (6) from s2 to s3 ........................ (7) begin output S.dt1 end; ............ (8) when S.ak0 ............................. (9) : : end; end;Specification Example; default individual queue; channel ChU (R1, R2); by R1: put; channel ChS (Ra, Rb); by Ra: dt0; dt1; by Rb: ak0; ak1; module E systemprocess; ip U: ChU (R2); S: ChS (Ra); end; body E1 for E; state s0, s1, s2, s4; .. (1) initialize to s0 begin end; .. (2) trans .............. .............. (3) when U.put ............. (4) from s0 to s1 ..... (5) begin output S.dt0 end; ... (6) from s2 to s3 ... (7) begin output S.dt1 end; ...... (8) when S.ak0 ............. (9):: end; end ;

【0005】上記(1)の行は、モジュールEが4つの
状態「S0,S1,S2,S3」を持っていることを表す。(2)
の行は、システムが起動された時、モジュールEが「s
0」の状態にあることを示す。その行の「begin end;」
は、システムが起動された時に実行するプログラムが
「begin」と「end」の間に記述するためのものだが、こ
の例では何も行わないので、空になっている。
The line (1) indicates that the module E has four states "S0, S1, S2, S3". (2)
Line indicates that when the system is started, module E
0 ". "Begin end;" on that line
Is for the program to run between the "begin" and "end" when the system boots, but is empty because it does nothing in this example.

【0006】また、(3)の行の「trans」以降には、
イベントに対する状態の遷移が記述されている。すなわ
ち、行(4)の「when U.put」は、「U」というチャン
ネルから、「put」というイベントがきた時の状態遷移
の記述がその行以降に記述されることを表し、行(5)
の「from s0 to s1」は、そのイベントが来た時、状態
「s0」から状態「s1」へ遷移することを表し、行(6)
の「begin output S.dt0 end;」は、状態遷移の時の動
作を記述しており、ここでは、チャンネルSにイベント
「dt0」を送る動作が記述されている。
[0006] Also, after "trans" in the line (3),
State transitions for events are described. That is, “when U.put” in line (4) indicates that the description of the state transition when the event “put” comes from the channel “U” is described after that line. )
"From s0 to s1" indicates that when the event arrives, transition from state "s0" to state "s1" is made, and line (6)
“Begin output S.dt0 end;” describes the operation at the time of the state transition. Here, the operation of sending the event “dt0” to the channel S is described.

【0007】このように、「Estelle」などでは、モジ
ュールの並列的な動作を、状態遷移と、その時のイベン
トのやり取りなどの動作で記述するので、直感的でわか
りやすい。また、「Estelle」では、状態遷移はテキス
トで表されるが、上記文献に同じく記載の「SDL」で
は、グラフィカルな記述方式が開発されており、ユーザ
は、各モジュールの状態遷移をさらにわかりやすく定義
できる。
As described above, in "Estelle" and the like, the parallel operation of the module is described by the operation such as the state transition and the event exchange at that time, so that it is intuitive and easy to understand. Also, in "Estelle", the state transition is represented by text, but in "SDL", which is also described in the above document, a graphical description method has been developed, and the user can understand the state transition of each module more easily. Can be defined.

【0008】以下、このような、状態遷移と各状態にお
ける動作定義からなるモジュールの記述の集まりでシス
テムを記述してプログラムを作成する技術における、シ
ステムの記述例を説明する。図16は、各状態における
動作定義の記述例を示す説明図であり、図17は、各状
態における状態遷移の記述例を示す説明図である。
An example of a system description in a technique for creating a program by describing the system with such a group of module descriptions including state transitions and operation definitions in each state will be described below. FIG. 16 is an explanatory diagram showing a description example of an operation definition in each state, and FIG. 17 is an explanatory diagram showing a description example of a state transition in each state.

【0009】本図16,17で示す例では、状態定義1
61と状態遷移定義171でシステムを定義しており、
図16の状態定義161では、そのモジュールにどのよ
うな状態があるかの指定を状態名162のフィールド
に、その内どの状態がシステムが起動された時の状態
(この状態を初期状態と呼ぶ)かの指定を初期状態16
3のフィールドに、また、各状態に遷移した時に実行さ
れるコマンドの定義(これを状態の動作定義と呼ぶ)を
動作定義164のフィールドに記述する。
[0009] In the example shown in FIGS.
61 and the state transition definition 171 define the system,
In the state definition 161 of FIG. 16, the specification of what state the module has is stored in the field of the state name 162, and which state is the state when the system is started (this state is called the initial state). Specify the initial state 16
In the field of the operation definition 164, the definition of a command to be executed at the time of transition to each state (this is called the operation definition of the state) is described in the field of the operation definition 164.

【0010】図16で記述されるモジュールは、「IDO
L」という状態が初期状態で、システムが起動された
時、その動作定義に記述されている send(モジュールA,初期化) send(モジュールB,初期化) send(モジュールC,初期化) send(モジュールD,初期化) が実行される。また、状態「IDOL」の他に、状態「Prin
ting」、状態「Completed」、状態「Incompleted」など
がある。
[0010] The module described in FIG.
The state "L" is an initial state, and when the system is started, send (module A, initialization) send (module B, initialization) send (module C, initialization) send (module C) described in its operation definition Module D, initialization) is executed. In addition to the state “IDOL”, the state “Prin
ting ", state" Completed ", state" Incompleted ", and the like.

【0011】図17において、状態の遷移は状態遷移定
義171のような表で表現される。この表は、状態名1
72、イベント名173、および、次の状態名174の
各フィールドからなり、各状態について、イベントが送
られてきた時、どの状態に遷移するかが記述されてい
る。上記2つの表、図16の状態定義161と図17の
状態遷移定義171で表現されるモジュールを図式言語
で表現したものを図18に示す。
In FIG. 17, a state transition is represented by a table such as a state transition definition 171. This table shows the status name 1
72, each field of an event name 173, and a next state name 174, which state is described for each state when an event is sent. FIG. 18 shows the two tables, the module represented by the state definition 161 in FIG. 16 and the module represented by the state transition definition 171 in FIG.

【0012】図18は、図16および図17における状
態定義と状態遷移定義で表現されるモジュールを図式で
表現する図式言語例を示す説明図である。図18におい
て、モジュール181の「状態」は丸の中に状態名を記
述して表現され、特に、初期状態は2重丸で記述してい
る。また、「状態遷移」は、「状態」から「状態」への
エッジにイベント名を記述して表現する。そして、各状
態の「動作定義」は、「状態」に四角を対応付けて表現
している。例えば、状態「IDOL」182に対しては動作
定義183が記述されている。
FIG. 18 is an explanatory diagram showing an example of a diagram language in which modules expressed by the state definition and the state transition definition in FIGS. 16 and 17 are expressed graphically. In FIG. 18, the “state” of the module 181 is represented by describing the state name in a circle, and particularly, the initial state is described by a double circle. “State transition” is expressed by describing an event name at an edge from “state” to “state”. The “operation definition” of each state is expressed by associating a square with the “state”. For example, an operation definition 183 is described for the state “IDOL” 182.

【0013】この状態「IDOL」182から状態「Printi
ng」184にエッジ「資料印刷」が出ているが、これ
は、モジュールが状態「IDOL」182の時に、イベント
「資料印刷」がこのモジュールに送られてきた時は、状
態「Printing」184に遷移して、動作定義185で示
される動作を行うものである。状態「Printing」18
4、および、状態「Completed」186、状態「Incompl
eted」187等に関しても同様である。このような図式
表現の方が直感的にわかりやすいので、以下、この図式
表現を用いて説明を続ける。
From this state "IDOL" 182, the state "Printi"
ng) 184 has an edge “material printing”, which means that when the module is in the state “IDOL” 182 and the event “material printing” is sent to this module, the state is “printing” 184. The transition is made and the operation indicated by the operation definition 185 is performed. State "Printing" 18
4 and state "Completed" 186, state "Incompl"
The same applies to “eted” 187 and the like. Since such a graphical representation is easier to understand intuitively, the description will be continued using this graphical representation.

【0014】遠隔サービス窓口システムでは、種々のデ
バイスの制御や複数の通信相手との同期を行うための複
雑な排他制御(ロック制御)が必要である。すなわち、
一つのモジュールは、多くのデバイス制御モジュール
と、イベントを送り合うので、ロック中に送られる可能
性のある全てのイベントに対して状態遷移を書かねばな
らず、例えば、次の図19で示すように、記述が大変煩
雑になる。
In the remote service window system, complicated exclusive control (lock control) for controlling various devices and synchronizing with a plurality of communication partners is required. That is,
Since one module sends events to and from many device control modules, state transitions must be written for all events that may be sent during lock, for example, as shown in FIG. 19 below. In addition, the description becomes very complicated.

【0015】図19は、従来技術によるロック制御に対
する状態遷移の記述例を示す説明図である。本例では、
あるシステムのメインモジュールの状態遷移の一部分を
表現している。ここでは、メインモジュールは、最初、
「IDOL」状態191にあり、メインモジュールに「資料
プリント」のイベントが来ると「Printing」状態192
に推移し、プリンタ制御モジュールにプリントのイベン
トを送った後、プリンタが印刷完了するのを待つ。
FIG. 19 is an explanatory diagram showing a description example of a state transition for lock control according to the prior art. In this example,
It represents a part of the state transition of the main module of a certain system. Here, the main module is first,
In the “IDOL” state 191, when the “material print” event comes to the main module, the “Printing” state 192
And sends a print event to the printer control module, and then waits for the printer to complete printing.

【0016】この間、メインモジュールは、プリンタ以
外の要求を受け付けないようにするためには、本図に示
すように、メインモジュールに送られる可能性がある全
てのイベントに対して、ロックされていることを表すイ
ベントを送り返すための状態遷移(「Answering LockSt
atus A」状態193、「Answering LockStatus B」状態
194、動作定義195,196)を書かなければなら
ない。
During this time, the main module is locked for all events that may be sent to the main module, as shown in the figure, so as not to accept requests other than the printer. State transition ("Answering LockSt
atus A "state 193," Answering LockStatus B "state 194, and operation definitions 195 and 196).

【0017】[0017]

【発明が解決しようとする課題】解決しようとする問題
点は、従来の技術では、ロック制御が必要なシステムの
記述においては、送られてくる可能性のある全てのイベ
ントに対して、ロックされていることを表すイベントを
送り返すための状態遷移をユーザが一々書かなければな
らない点である。本発明の目的は、これら従来技術の課
題を解決し、金融や公共などの分野における、ネットワ
ーク経由で遠隔の顧客/住民にサービスを提供するシス
テムのように、1つの端末が多くのイベントに反応しな
ければならないシステムの構築に用いるプログラムを効
率的に生成することを可能とするプログラム自動生成シ
ステムと方法を提供することである。
The problem to be solved is that, in the prior art, in the description of a system that requires lock control, all the events that may be sent are locked. The point is that the user must write a state transition for sending back an event indicating that the event is being performed. An object of the present invention is to solve these problems of the prior art, and one terminal responds to many events, such as a system for providing services to remote customers / residents via a network in fields such as finance and public services. It is an object of the present invention to provide a program automatic generation system and a method capable of efficiently generating a program used for constructing a system to be performed.

【0018】[0018]

【課題を解決するための手段】上記目的を達成するた
め、本発明のプログラム自動生成システムと方法は、イ
ベントに従って内部状態を遷移し、この遷移した状態に
従って、外部や内部へのイベントの送信、コマンドの実
行等の動作を状態遷移オートマトンの集まりとしてユー
ザがシステムを記述し、このような記述からコンピュー
タ処理によりシステムのプログラムを自動生成するもの
であり、状態遷移オートマトンの記述体系を拡大し、状
態遷移オートマトンに、所定の排他制御動作を行うロッ
ク状態の遷移を組み込んでおく。そして、ユーザが、ロ
ック状態に遷移した時のこのロック状態の遷移を制御す
る動作を状態遷移オートマトンに記述すると、この記述
を検出して、ロック状態の時は外部のイベントに対し
て、ロックされていることを表すイベントを返すよう
に、プログラムを生成する。また、状態遷移オートマト
ンがとり得るロック状態として、「ロック」と「アンロ
ック」の2つの状態だけでなく、さらに、「短時間ロッ
ク」の3つ目の状態を設ける。そして、「短時間ロック
状態」の状態遷移オートマトンは、送信されたイベント
に対して、「短時間ロック状態」であるということを表
すイベントを送り主に送り返し、送り主の状態遷移オー
トマトンは、「短時間ロック状態」であれば、ロックが
はずれるのを待つ動作を行うものとして、プログラムを
生成する。このように、状態遷移オートマトンの記述体
系を拡大し、ロック状態の遷移を組み込むことにより、
ユーザが一々複雑なロック制御の状態遷移を書かなくて
もロック制御を実現したプログラムを自動生成すること
ができる。
In order to achieve the above object, an automatic program generation system and method according to the present invention transitions an internal state according to an event, and transmits an event to the outside or inside according to the transitioned state. The user describes the system as a group of state transition automata, such as the execution of commands, and automatically generates a system program by computer processing from such a description.The description system of the state transition automaton is expanded, A lock state transition for performing a predetermined exclusive control operation is incorporated in the transition automaton. Then, when the user describes an operation for controlling the transition of the lock state when the state transits to the lock state in the state transition automaton, this description is detected, and when the state is the lock state, the operation is locked against an external event. Generate a program to return an event indicating that Further, as a lock state that the state transition automaton can take, not only two states of “lock” and “unlock” but also a third state of “short-time lock” is provided. Then, in response to the transmitted event, the state transition automaton of the “short-time lock state” sends an event indicating that the state is “short-time lock state” back to the sender, and the state transition automaton of the sender transmits the “short-time lock state” If it is in the "locked state", the program is generated as an operation for waiting for the lock to be released. In this way, by expanding the description system of the state transition automaton and incorporating the transition of the lock state,
A program that realizes lock control can be automatically generated without requiring the user to write complicated lock control state transitions.

【0019】[0019]

【発明の実施の形態】以下、本発明の実施例を、図面に
より詳細に説明する。図1は、本発明のプログラム自動
生成システムの本発明に係る構成の一実施例を示すブロ
ック図であり、図2は、図1におけるプログラム自動生
成システムの装置構成例を示すブロック図である。
Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a block diagram showing an embodiment of the configuration of the automatic program generation system of the present invention according to the present invention, and FIG. 2 is a block diagram showing an example of the device configuration of the automatic program generation system in FIG.

【0020】図2において、21はCRT(Cathode Ra
y Tube)等からなる表示装置、22はキーボードやマウ
ス等からなる入力装置、23はCPU(Central Proces
singUnit)とメインメモリ等を具備して蓄積プログラム
方式によるコンピュータ処理を行う情報処理装置、24
はハードディスク装置等からなる補助記憶装置、25は
本発明のプログラム自動生成方法の手順プログラムを記
録した光ディスク、26は光ディスク25からプログラ
ムおよびデータを読み取る光ディスク駆動装置である。
In FIG. 2, reference numeral 21 denotes a CRT (Cathode Ra).
y, a display device comprising a keyboard, a mouse, etc., and a CPU (Central Processes) 23.
singUnit) and an information processing apparatus which includes a main memory and the like and performs computer processing by a storage program method, 24
Is an auxiliary storage device such as a hard disk device, 25 is an optical disk on which a procedure program of the automatic program generation method of the present invention is recorded, and 26 is an optical disk drive for reading programs and data from the optical disk 25.

【0021】情報処理装置23は、光ディスク駆動装置
26を介して光ディスク25に記録されたプログラムを
メインメモリや補助記憶装置24上に読み込み、図1に
示すプログラム生成部2の各機能を構築する。
The information processing device 23 reads a program recorded on the optical disk 25 via the optical disk drive device 26 into the main memory or the auxiliary storage device 24, and constructs each function of the program generating section 2 shown in FIG.

【0022】図1において、1はユーザが図2の入力装
置22を介して表示装置21の画面上に状態遷移オート
マトンで記述し情報処理装置23に入力されるシステム
記述、2はシステム記述1の記述内容に基づくコンピュ
ータ処理により所定のプログラムを生成するプログラム
生成部、3はプログラム生成部2で生成されたプログラ
ムである。
In FIG. 1, reference numeral 1 denotes a system description which is described by a user on a screen of a display device 21 via an input device 22 of FIG. 2 using a state transition automaton and is input to an information processing device 23; A program generation unit 3 for generating a predetermined program by computer processing based on the description content is a program generated by the program generation unit 2.

【0023】システム記述1は、ユーザにより、システ
ムをお互いにイベントと呼ばれる信号をやり取りするモ
ジュール(モジュール定義1a)の集まりとして記述さ
れている。そして、各モジュール定義1aは、そのモジ
ュール定義1aが取り得る状態の集合、および、各状態
で実行するコマンドの記述からなる状態定義1bと、各
状態に対してイベントが送られた時の状態の遷移(状態
と状態の間のエッジ)を表す状態遷移定義1cで記述さ
れる。尚、これらの状態定義1bと状態遷移定義1cの
詳細は、図3,4で後述する。
The system description 1 is described by a user as a group of modules (module definition 1a) for exchanging signals called events with each other in the system. Each module definition 1a includes a set of states that the module definition 1a can take, a state definition 1b including a description of a command to be executed in each state, and a state definition 1b when an event is sent to each state. It is described in a state transition definition 1c representing a transition (an edge between states). The details of the state definition 1b and the state transition definition 1c will be described later with reference to FIGS.

【0024】プログラム生成部2は、プログラム3の固
定部分としてイベント管理エンジンのコード3aとイベ
ントキュー格納領域3bを生成するイベント管理エンジ
ンおよびイベントキュー生成部2aと、システム記述1
の各モジュール定義1aに対応してそのモジュールの機
能をプログラム3において実現する関数のコード(モジ
ュール対応関数コード3cを生成するモジュール対応関
数コード生成部2bとを有している。生成されたプログ
ラム3では、各モジュールがイベントを送ると、それが
イベントキュー格納領域3bに入り、イベント管理エン
ジンのコード3aは、イベントキュー格納領域3bに入
っているイベントを引数にして、送信先のモジュールの
関数を順次呼出す。
The program generation unit 2 includes an event management engine and an event queue generation unit 2a for generating a code 3a of the event management engine and an event queue storage area 3b as fixed parts of the program 3, and a system description 1
And a module code corresponding to each of the module definitions 1a in the program 3 (a module corresponding function code generator 2b for generating a module corresponding function code 3c. Then, when each module sends an event, it enters the event queue storage area 3b, and the code 3a of the event management engine uses the event stored in the event queue storage area 3b as an argument to execute the function of the transmission destination module. Call sequentially.

【0025】プログラム生成部2におけるモジュール対
応関数コード生成部2bは、プログラム3のモジュール
対応関数コード3cにおける状態・ロック状態格納領域
3dを生成する状態格納領域生成部2cと、ロック状態
中に他のモジュールからイベントが送られた時、そのモ
ジュールがロックされていることを表すイベントを送る
プログラム3におけるロック時イベント処理コード3e
を生成するロック時コード生成部2dと、システム記述
1における状態遷移定義1bに基づき、プログラム3に
おける状態遷移コード(送られてきたイベントの種類に
従って状態を遷移するコード)3fを生成する状態遷移
コード生成部2eと、システム記述1における状態定義
1cに基づき、プログラム3における動作コード3g
(各状態に遷移した時実行されるコード)を生成する動
作コード生成部2fからなる。
The module corresponding function code generator 2b in the program generator 2 includes a state storage area generator 2c for generating the state / lock state storage area 3d in the module corresponding function code 3c of the program 3, and another module in the locked state. When an event is sent from a module, a lock event processing code 3e in the program 3 for sending an event indicating that the module is locked
And a state transition code for generating a state transition code (a code for transitioning the state according to the type of the sent event) 3f in the program 3 based on the state transition definition 1b in the system description 1. The operation code 3g in the program 3 based on the generation unit 2e and the state definition 1c in the system description 1.
(A code to be executed upon transition to each state).

【0026】さらに、動作コード生成部2fは、システ
ム記述1におけるロックの指定1dに基づき、プログラ
ム3におけるロックのコード3hを生成するロックコー
ド生成部2gを有している。このように、本例のプログ
ラム自動生成システムでは、システム記述1において、
状態の動作定義(状態定義1c)の中でロックの指定1
dがされていれば、動作コード3gの中に、ロックを掛
けるコード(ロックのコード3h)を生成する。
Further, the operation code generation unit 2f has a lock code generation unit 2g that generates a lock code 3h in the program 3 based on the lock specification 1d in the system description 1. Thus, in the automatic program generation system of the present example, in the system description 1,
Lock specification 1 in the state operation definition (state definition 1c)
If d is performed, a code for locking (lock code 3h) is generated in the operation code 3g.

【0027】以下、ユーザによるシステム記述1から生
成されるプログラム3の記述に用いられている言語(C
やPASCAL、Basic、Lispなどのプログラミング言語)を
ターゲット言語、また、ユーザがシステム記述1に用い
る言語をソース言語として、上述の構成からなるプログ
ラム自動生成システムの動作を説明する。
Hereinafter, the language (C) used to describe the program 3 generated from the system description 1 by the user
And a programming language such as PASCAL, Basic, and Lisp) as a target language, and a language used by the user for the system description 1 as a source language.

【0028】本例のプログラム自動生成システムでは、
ソース言語でのシステム記述1に用いる状態定義1bと
状態遷移定義1cの内、状態定義1bの中で、 LockMeWithout(モジュール名1, ..., モジュール名n) という記述および UnlockMe というロックの指定1dの記述を許し、それをターゲッ
ト言語に変換してプログラム3を生成する。
In the automatic program generation system of this embodiment,
Of the state definition 1b and the state transition definition 1c used for the system description 1 in the source language, in the state definition 1b, a description of LockMeWithout (module name 1,..., Module name n) and a specification 1d of a lock called UnlockMe Is converted to a target language to generate a program 3.

【0029】すなわち、プログラム3における固定部分
として、イベント管理エンジンのコード3aとイベント
キュー格納領域3bを生成し、また、各モジュール定義
1aに対して、そのモジュールの機能を実現する関数の
コード(モジュール対応関数3c)を生成し、各モジュ
ールがイベントを送るとそれをイベントキュー格納領域
3bに入れ、イベント管理エンジンのコード3aは、イ
ベントキュー格納領域3bに入っているイベントを引数
にして、送信先のモジュールの関数を順次呼出す。
That is, the code 3a of the event management engine and the event queue storage area 3b are generated as fixed parts in the program 3, and the code (function module) for realizing the function of the module is defined for each module definition 1a. A corresponding function 3c) is generated, and when each module sends an event, the event is stored in the event queue storage area 3b. The event management engine code 3a uses the event stored in the event queue storage area 3b as an argument and Function of each module is sequentially called.

【0030】プログラム3において、各モジュールの機
能を実現する関数は、(1)状態、および、ロック状態
を格納する領域(状態・ロック状態格納領域3d)、
(2)ロック状態の時に他のモジュールからイベントが
送られた時、そのモジュールがロックされていることを
表すイベントを送るコード(ロック時イベント処理コー
ド3e)、(3)送られてきたイベントの種類に従っ
て、状態を遷移するコード(状態遷移コード3f)、
(4)各状態に遷移した時実行されるコード(動作コー
ド3g)からなる。
In the program 3, functions for realizing the function of each module include (1) an area for storing a state and a lock state (state / lock state storage area 3d),
(2) When an event is sent from another module in the locked state, a code for sending an event indicating that the module is locked (locked event processing code 3e), and (3) a code for the sent event A code that changes states according to the type (state transition code 3f),
(4) It consists of a code (operation code 3g) that is executed when a transition is made to each state.

【0031】そして、システム記述1における状態の動
作定義(状態定義1c)の中で、ロックを掛けたり外し
たりする指定(ロックの指定1d)がされていれば、ロ
ックコード生成部2gにより、動作コード3gの中に、
ロックを掛けたり外したりするコード(ロックのコード
3h)を生成する。
If the operation definition (state definition 1c) of the state in the system description 1 specifies that the lock is to be locked or unlocked (lock specification 1d), the operation is performed by the lock code generation unit 2g. In code 3g,
A code for locking or unlocking (lock code 3h) is generated.

【0032】これにより、本例のプログラム自動生成シ
ステムでは、ユーザが、従来のようにロック状態を状態
遷移定義1bで一つ一つ表現しなくても、状態の動作指
定(状態定義1c)の中で、例えば、 LockMeWithout(MODULE1, ..., MODULEn) と記述すれば、その関数のロック状態を表す変数をロッ
ク状態にし、モジュール名、 MODULE1, ..., MODULEn が「ロックの対象外となるモジュール名を記憶する変
数」を記録し、これにより、ロック時イベント処理コー
ド3eで、送り元にイベント「LOCKED」を送ることがで
きる。
Thus, in the automatic program generation system of this embodiment, the user can specify the operation of the state (state definition 1c) without expressing the lock state one by one in the state transition definition 1b as in the conventional case. For example, if LockMeWithout (MODULE1, ..., MODULEn) is described, the variable indicating the lock state of the function is locked, and the module name, MODULE1, ..., MODULEn is displayed In this case, the event "LOCKED" can be sent to the sender by the lock event processing code 3e.

【0033】また、ロック状態を、「非ロック状態」と
「ロック状態」、および、「短いロック状態(短時間ロ
ック状態)」の3種類にし、ソース言語における、状態
での動作指定を「LockMeWithout」の他に LockMeShortWithout(モジュール名1, ..., モジュール
名n) も記述可能にする。
The lock state is set to three types of "unlocked state", "locked state", and "short locked state (short-time locked state)", and the operation designation in the state in the source language is "LockMeWithout". ”, LockMeShortWithout (module name 1, ..., module name n) can be described.

【0034】この記述に対しては、ロック状態を表す変
数を、短時間ロック状態にするコードを生成し、短時間
ロック状態であるモジュールに対応する関数に対して、
ロック除外されたモジュール以外からイベントが送られ
た時は、イベントキュー格納領域3bの管理機能により
そのことを判定し、送られる先のモジュールのロック状
態が解除されるまで、そのイベントをイベントキュー格
納領域3bに保持することにより、短時間ロック状態で
の待ち合わせの機能が実現できる。
In response to this description, a code for setting the variable indicating the lock state to the lock state for a short time is generated, and a function corresponding to the module in the lock state for a short time is generated.
When an event is sent from a module other than the module whose lock has been excluded, the management function of the event queue storage area 3b determines that event, and stores the event in the event queue until the lock state of the module to which the event is sent is released. By holding in the area 3b, a function of waiting in the locked state for a short time can be realized.

【0035】以下、図3〜図15を用いて、このような
プログラム自動生成システムを、さらに詳細に説明す
る。まず、ユーザが記述するシステム記述1の詳細につ
いて、図3〜図5を用いて説明する。
Hereinafter, such a program automatic generation system will be described in more detail with reference to FIGS. First, details of the system description 1 described by the user will be described with reference to FIGS.

【0036】図3は、図1における状態定義の詳細例を
示す説明図である。本例の状態定義1cでは、該当する
モジュールにどのような状態があるかを指定する状態名
31と、その内どの状態がシステムが起動された時の状
態かを指定する初期状態32、および、各状態に遷移し
た時に実行されるコマンドを定義する動作定義33が記
述される。
FIG. 3 is an explanatory diagram showing a detailed example of the state definition in FIG. In the state definition 1c of this example, a state name 31 that specifies what state the corresponding module has, an initial state 32 that specifies which state is the state when the system is started, and An operation definition 33 that defines a command to be executed when transitioning to each state is described.

【0037】本例の状態定義1cでは、動作定義33と
して、 send(モジュール名, イベント名, 引数1, ...) LockMeWithout(モジュール名1, モジュール名2, ...) UnlockMe の3つの動作の列が記述できる。
In the state definition 1c of this example, three operations of send (module name, event name, argument 1, ...) LockMeWithout (module name 1, module name 2, ...) UnlockMe are used as the operation definition 33. Can be described.

【0038】尚、「send(モジュール名, イベント名,
引数1, ...)」は、「モジュール名」で指定されるモジ
ュールに「イベント名」で指定されるイベントを、「引
数1」,「引数2」,...を引数として送る動作であ
る。また、「LockMeWithout(モジュール名1, モジュー
ル名2, ...)」は、この動作指定を行ったモジュール
を、「モジュール名1」,...で指定されるモジュール以
外からロックする動作であり、ここでロックするという
のは、送られて来た任意のイベントに対して、LOCKEDと
いうイベントを送り返すことである。また、「UnlockM
e」は、ロックの状態を解除する動作である。
Note that "send (module name, event name,
Arguments 1,...) ”Include the event specified by the“ event name ”in the module specified by the“ module name ”. . . Is sent as an argument. “LockMeWithout (module name 1, module name 2,...)” Is an operation of locking the module for which this operation is specified from a module other than the module specified by “module name 1”,. Locking here means sending back an event called LOCKED for any event sent. Also, "UnlockM
"e" is an operation for releasing the locked state.

【0039】本図3の例で記述されているモジュールで
は、「IDOL」という状態が初期状態で、システムが起動
された時、その動作定義に記述されている「send(モジ
ュールA,初期化)」が実行される。そして、次の状態
「Printing」では、「LockMeWithout(プリンタ, U
L)」と、「writeMessage(プリントしています)」、お
よび、「send(プリンタ, Print,資料A)」が実行され
る。さらに、状態「Completed」では、「writeMessage
(プリントが終了しました)」、および、「unLockMe」が
実行され、状態「Incompleted」では、「writeMessage
(キャンセルされました)」、および、「unLockMe」が実
行される。
In the module described in the example of FIG. 3, the state "IDOL" is an initial state, and when the system is started, "send (module A, initialization)" described in the operation definition is performed. Is executed. Then, in the next state “Printing”, “LockMeWithout (printer, U
L), "writeMessage (printing)", and "send (printer, Print, document A)". Furthermore, in the state "Completed", "writeMessage
(Print completed) "and" unLockMe "are executed, and in the state" Incompleted "," writeMessage
(Cancelled) "and" unLockMe "are executed.

【0040】図4は、図1における状態遷移定義の詳細
例を示す説明図である。本例の状態遷移定義1bは、状
態名41、イベント名42、および、次の状態名43の
各フィールドからなり、各状態について、イベントが送
られてきた時、どの状態に遷移するかが記述されてい
る。尚、ここで、特殊なイベント「*immediate*」を設
けておいて、これ(「*immediate*」)は、イベントを
受けなくても直ぐ次の状態に遷移することを表すものと
する。例えば、本例の状態遷移定義1bでは、状態「Co
mpleted」からイベント名「*immediate*」で「IDOL」に
遷移しているが、これは、「Completed」に遷移し、そ
こでの動作を終えた後、直ぐに「IDOL」に遷移すること
を意味する。
FIG. 4 is an explanatory diagram showing a detailed example of the state transition definition in FIG. The state transition definition 1b of this example is composed of fields of a state name 41, an event name 42, and a next state name 43, and describes which state to transition to when each event is sent. Have been. Here, a special event “* immediate *” is provided, and this (“* immediate *”) indicates that the state immediately transits to the next state without receiving the event. For example, in the state transition definition 1b of this example, the state “Co
From "mpleted" to "IDOL" with the event name "* immediate *", this means transition to "Completed", and after completing the operation there, immediately transition to "IDOL" .

【0041】図3と図4で示す2つの表、すなわち、図
3の状態定義1cと図4の状態遷移定義1bで表現され
るモジュールを図式言語で表現したものを図5に示す。
図5は、図3および図4における状態定義と状態遷移定
義で表現されるモジュールを図式で表現する図式言語例
を示す説明図である。本例のモジュール定義1aの記述
においては、各「状態」は丸の中に状態名を記述して表
現され、特に、初期状態は2重丸で記述している。
FIG. 5 shows two tables shown in FIG. 3 and FIG. 4, that is, the module expressed by the state definition 1c of FIG. 3 and the state transition definition 1b of FIG.
FIG. 5 is an explanatory diagram showing an example of a diagram language for graphically expressing modules represented by the state definition and the state transition definition in FIGS. 3 and 4. In the description of the module definition 1a of this example, each “state” is represented by describing a state name in a circle, and particularly, the initial state is described by a double circle.

【0042】また、「状態遷移」は、「状態」から「状
態」へのエッジにイベント名を記述して表現する。そし
て、各状態の「動作定義」は、「状態」に四角を対応付
けて表現している。すなわち、本例では、モジュール定
義1aは、最初に「IDOL」の状態で停止している。そし
て、初期状態「IDOL」51から状態「Printing」52に
エッジ「資料印刷」が出ているので、初期状態「IDOL」
51の時に、他のモジュールからイベント「資料印刷」
が送られてくると、モジュール定義1aは、状態「Prin
ting」52に遷移する。
The “state transition” is expressed by describing an event name on an edge from “state” to “state”. The “operation definition” of each state is expressed by associating a square with the “state”. That is, in this example, the module definition 1a is initially stopped in the “IDOL” state. Then, since the edge “material printing” appears from the initial state “IDOL” 51 to the state “Printing” 52, the initial state “IDOL”
At the time of 51, the event "print material" from another module
Is sent, the module definition 1a changes the state “Prin
ting ”52.

【0043】そして、状態「Printing」52では、自分
自身をプリンタとUI以外からロックし、「プリンタ」
にイベント「資料Aをプリント」というメッセージを送
り、再度停止している。すなわち、動作定義53に従っ
て、「LockMeWithout(プリンタ, UL)」と、「send(プ
リンタ, Print, 資料A)」、および、図示していない
が、「LockMeWithout(プリンタ, UI)」で指定されて
いるプリンタとUI以外のイベントに対する「writeMes
sage(プリントしています)」を実行する。
Then, in the state "Printing" 52, the user locks himself / herself except from the printer and the UI.
To the event "Print material A" and stop again. That is, in accordance with the operation definition 53, "LockMeWithout (printer, UL)", "send (printer, Print, document A)", and "LockMeWithout (printer, UI)" (not shown) are specified. "WriteMes" for events other than printer and UI
sage (printing). "

【0044】同様にして、モジュール定義1aが状態
「Printing」52の時に、エッジ「印刷終了」が送られ
てくると、状態「Completed」54に遷移し、この状態
「Completed」54では、動作定義55に従って、「Unl
ockMe」を実行する。また、「プリンタ」から「印刷終
了」というイベントが送られれば、状態「Completed」
54に遷移し、「Unlocked」との動作定義55により、
そこでロックを解除する。また、状態「Printing」52
の時に、「キャンセル」というイベントが来れば、状態
「Incompleted」56に遷移する。
Similarly, when the edge “printing completed” is sent when the module definition 1 a is in the state “Printing” 52, the state transits to the state “Completed” 54. According to 55, "Unl
ockMe ". Also, if the event "printing complete" is sent from the "printer", the status "Completed"
54, and according to the operation definition 55 of "Unlocked",
Then the lock is released. The state “Printing” 52
At this time, if an event “cancel” comes, the state transits to the state “Incompleted” 56.

【0045】このように、本例では、排他制御を行なう
場合には、所望のモジュールに、「LockMeWithout(モジ
ュール名1, モジュール名2, ...)」との動作指定を行
なうことにより、「モジュール名1」,...で指定される
モジュール以外から送られて来た各イベントに対して、
LOCKEDというイベントを送り返すことができるので、例
えば、遠隔サービス窓口システムのように、種々のデバ
イスの制御や複数の通信相手との同期を行うための複雑
な排他制御(ロック制御)が必要なシステムのプログラ
ムを簡素なシステム記述で生成することができる。
As described above, in this example, when exclusive control is performed, the operation designation of “LockMeWithout (module name 1, module name 2,...)” Is performed for a desired module, thereby For each event sent from a module other than the module specified by "module name 1", ...
Since an event called LOCKED can be sent back, for example, a system that requires complicated exclusive control (lock control) to control various devices and synchronize with multiple communication partners, such as a remote service window system Programs can be generated with simple system descriptions.

【0046】次に、図1において、ソース言語によるシ
ステム記述1で記述されたシステムと等価な動作を行う
ターゲット言語のプログラム3について説明する。ター
ゲット言語のプログラム3は、ソース言語の内容によら
ず共通に存在するイベントキュー格納領域3bとイベン
ト管理エンジンのコード3a、および、各モジュール毎
に存在する、その機能を実現する関数であるモジュール
対応関数コード3cの集まりで構成される。
Next, referring to FIG. 1, a description will be given of a target language program 3 which performs an operation equivalent to the system described in the system description 1 in the source language. The target language program 3 includes an event queue storage area 3b and an event management engine code 3a which are commonly present irrespective of the contents of the source language, and a module which is a function that realizes its function and exists for each module It consists of a group of function codes 3c.

【0047】モジュール対応関数コード3cは、「モジ
ュールの状態」と「ロックの状態」および「ロックが除
外される対象のモジュール名のリスト」を格納する状態
・ロック状態格納領域3dと、イベントとそのイベント
がどのモジュールから来たか、および、イベントの引数
の3つをパラメータとして取り、そのイベントがそのモ
ジュールに送られた時の動作を実行する関数であり、ロ
ックされた状態でのイベント処理を行うロック時イベン
ト処理コード3eと、状態遷移を実行する状態遷移コー
ド3f、および、各状態に対応する動作を実行する動作
コード3gから構成される。
The module-corresponding function code 3c includes a status / lock status storage area 3d for storing “module status”, “lock status”, and “list of module names from which locks are excluded”, an event and its status. A function that takes three parameters, the module from which the event came and the argument of the event, and executes the operation when the event is sent to the module, and performs the event processing in a locked state It is composed of a lock event processing code 3e, a state transition code 3f for executing a state transition, and an operation code 3g for executing an operation corresponding to each state.

【0048】ロック時イベント処理コード3eは、ロッ
ク除外対象モジュール以外のモジュールから送られたイ
ベントに対して「LOCKED」というイベントを返送する処
理である。状態遷移コード3fは、モジュール毎の状態
・ロック状態格納領域3dに格納されているモジュール
の状態とイベントから次の状態を求め、次の状態に遷移
するコードである。実際のモジュールの状態・ロック状
態格納領域3dの書き換えや、状態に遷移した時の動作
は、各状態での動作に対応するコードである動作コード
3gで行われる。
The lock event processing code 3e is a process for returning an event "LOCKED" to an event sent from a module other than the lock exclusion target module. The state transition code 3f is a code for obtaining the next state from the module state and the event stored in the state / lock state storage area 3d for each module and transitioning to the next state. The actual rewriting of the state / lock state storage area 3d of the module and the operation at the time of transition to the state are performed by the operation code 3g which is a code corresponding to the operation in each state.

【0049】次に、このようなターゲット言語で記述さ
れたプログラム3の動作を簡単に説明する。イベント管
理エンジンのコード3aは、イベントキュー格納領域3
bに何かイベントがあれば、それを取り出して、どのモ
ジュールからどのモジュールへ向けたイベントかを調
べ、宛先のモジュールに対応する関数のコードである、
モジュール対応関数コード3cを呼出す。
Next, the operation of the program 3 described in such a target language will be briefly described. The event management engine code 3a is stored in the event queue storage area 3
If there is any event in b, take out the event, check which module is directed to which module, and find the function code corresponding to the destination module.
Call the module corresponding function code 3c.

【0050】このモジュール対応関数コード3cでは、
ロックされていれば、ロック時イベント処理コード3e
で、送り元に「LOCK」というイベントを返す。そうでな
ければ、状態遷移コード3fで状態遷移を行い、動作コ
ード3g内で、遷移した先の状態の動作を行う。
In the module corresponding function code 3c,
If locked, lock event processing code 3e
And return the event "LOCK" to the sender. If not, the state transition is performed with the state transition code 3f, and the operation of the state to which the transition is made is performed within the operation code 3g.

【0051】この動作コード3g中で別のモジュールへ
のイベント送信が記述してあれば、動作コード3gでイ
ベントをイベントキュー格納領域3bに追加し、また、
イベント管理エンジンのコード3aが、イベントキュー
格納領域3bからイベントを取り出して、モジュール対
応関数コード3cを呼び出す。
If an event transmission to another module is described in the operation code 3g, the event is added to the event queue storage area 3b by the operation code 3g.
The code 3a of the event management engine retrieves the event from the event queue storage area 3b and calls the module corresponding function code 3c.

【0052】また、遷移した先の状態の動作に、ロック
を掛けたり外したりする記述があれば、ロックのコード
3hで、関数の状態をロックしたり、外したりする。こ
の動作を繰り返すことにより、ソース言語によるシステ
ム記述1に記述してあるシステムの振る舞いを実現する
ことができる。
Further, if there is a description to lock or unlock the operation of the state after the transition, the state of the function is locked or unlocked by the lock code 3h. By repeating this operation, the behavior of the system described in the system description 1 in the source language can be realized.

【0053】次に、ソース言語によるシステム記述1か
らターゲット言語で記述されたプログラム3を生成する
プログラム生成部2の動作を説明する。まず、イベント
管理エンジンおよびイベントキュー生成部2aで、どん
なモジュール記述にも共通な、イベント管理エンジンの
コード3aとイベントキュー格納領域3bを生成する。
Next, the operation of the program generator 2 for generating the program 3 described in the target language from the system description 1 in the source language will be described. First, the event management engine and event queue generation unit 2a generates an event management engine code 3a and an event queue storage area 3b that are common to any module description.

【0054】そして、モジュール対応関数コード生成部
2bにおいて、各モジュール毎に、状態格納領域生成部
2c以下の各処理を繰り返し、モジュール対応関数コー
ド3c、および、モジュールの状態格納領域やロック状
態格納領域およびロック除外対象モジュール格納領域か
らなる状態・ロック状態格納領域3dを生成する。
Then, in the module-corresponding function code generating unit 2b, each processing from the state storage area generating unit 2c is repeated for each module, and the module-corresponding function code 3c and the module state storing area and the lock state storing area are repeated. Then, a state / lock state storage area 3d including the lock exclusion target module storage area is generated.

【0055】すなわち、まず、状態格納領域生成部2c
で、各関数に対してモジュールの状態を格納する領域を
生成する。次に、ロック時コード生成部2dで、各関数
に対してロック状態を格納する領域およびどのモジュー
ルに対してロックを除外するかを格納する領域を生成
し、関数の先頭に、ロック状態の処理部分であるロック
時イベント処理コード3eを埋め込む。
That is, first, the state storage area generation unit 2c
Then, an area for storing the state of the module is generated for each function. Next, the lock-time code generation unit 2d generates an area for storing a lock state for each function and an area for storing which module is to be excluded from the lock. The lock event processing code 3e as a part is embedded.

【0056】さらに、状態遷移コード生成部2eで、ソ
ース言語でのイベントと状態から次の状態へ遷移するた
めの状態遷移コード3fを生成する。そして、最後に、
動作コード生成部2fにより、各状態での動作に対応す
る動作コード3gを生成して、各モジュールに対応する
モジュール対応関数コード3cを完成させる。
Further, the state transition code generator 2e generates a state transition code 3f for transitioning from the event and state in the source language to the next state. And finally,
The operation code generation unit 2f generates an operation code 3g corresponding to the operation in each state, and completes a module corresponding function code 3c corresponding to each module.

【0057】以上でソース言語、ターゲット言語および
プログラム生成方法の概要を述べた。以下、各々につい
てさらに詳細に説明していく。まず、図6を用いて、タ
ーゲット言語で記述されたプログラムの構造の詳細な説
明を行う。
The outline of the source language, the target language, and the program generation method has been described above. Hereinafter, each will be described in more detail. First, the structure of a program described in a target language will be described in detail with reference to FIG.

【0058】図6は、図1におけるプログラム自動生成
システムで生成されたプログラムの全体構成例を示す説
明図である。プログラム3のイベントキュー格納領域3
bは、4つのフィールド「送り先モジュール」、「イベ
ント」、「送り元モジュール」、「引数」からなるテー
ブルであり、FIFO(First-In-First-Out)形式で出し入
れされる。すなわち、最初に入れられたデータが最初に
取り出される。
FIG. 6 is an explanatory diagram showing an example of the overall configuration of a program generated by the automatic program generation system in FIG. Event queue storage area 3 for program 3
b is a table including four fields “destination module”, “event”, “source module”, and “argument”, and is put in and out in a FIFO (First-In-First-Out) format. That is, the first entered data is retrieved first.

【0059】モジュール対応関数コード3cは、「MODU
LE(event, fromWhom, args)」のように、3つのパラメ
ータの関数として実現する。ここで、パラメータ「even
t」はイベント、パラメータ「fromWhom」は、そのイベ
ントを送ったモジュール、パラメータ「args:」は、そ
のイベント送信の時の引数を配列にして一つのデータに
まとめたもの意味である。
The module corresponding function code 3c is “MODU
It is implemented as a function of three parameters, such as LE (event, fromWhom, args). Where the parameter "even
“t” means an event, parameter “fromWhom” means the module that sent the event, and parameter “args:” means that the arguments at the time of sending the event are arranged in an array and collected into one data.

【0060】イベント管理エンジンのコード3aは、図
6内に記述されているPAD図のように動作する。すなわ
ち、まず、ステップ600の処理で、全てのモジュール
の関数を初期化する。この実施例では、初期化の方法と
しては、各関数に特殊なイベント名「_init_」を送り、
呼出すものとする。後で述べるように、各モジュールの
関数はイベント「_init_」が送られると、初期化処理、
すなわち初期状態へ遷移する動作を行うように生成され
る。
The code 3a of the event management engine operates as shown in the PAD diagram described in FIG. That is, first, in the process of step 600, the functions of all modules are initialized. In this embodiment, the initialization method is to send a special event name "_init_" to each function,
Shall be called. As will be described later, the function of each module will execute initialization processing when the event "_init_" is sent.
That is, it is generated so as to perform an operation of transitioning to the initial state.

【0061】次に、ステップ602の処理で、キューに
何かイベントがあるか調べ、もしあれば、ステップ60
3の処理でそれを取り出し、 toWhom : 送り先のモジュール event : イベント名 fromWhom : 送り元のモジュール args : 引数 を設定する。
Next, in step 602, it is checked whether there is any event in the queue.
Take it out in process 3 and set toWhom: destination module event: event name fromWhom: source module args: argument.

【0062】次に、ステップ604の処理で、モジュー
ル「toWhom」に対応する関数を求め、「event」と「fro
mWhom」および「args」を引数として、その関数を呼出
す。呼出された関数コード3cは、内部で状態遷移およ
び状態へ遷移した時の動作を行い、その過程として send(MODULEi, EVENTA, args) などのイベント発信の動作を行うので、再度、イベント
キューにイベントが追加され、イベント管理エンジンの
コード3aは、再度そのイベントを取り出し、モジュー
ルに対応する関数を呼出す。
Next, in the process of step 604, a function corresponding to the module “toWhom” is obtained, and “event” and “fro” are obtained.
Call the function with "mWhom" and "args" as arguments. The called function code 3c performs an internal state transition and an operation at the time of transition to the state, and performs an operation of sending an event such as send (MODULEi, EVENTA, args) as a process thereof. Is added, and the event management engine code 3a retrieves the event again and calls the function corresponding to the module.

【0063】このようにして生成されたモジュール対応
関数コード3cの構造の詳細を、次の図7を用いて説明
する。図7は、図1におけるモジュール対応関数の詳細
構成例を示す説明図である。生成されたモジュール対応
関数コード3cは、ヘッダ部分71のように、「MainMo
dule(event, fromWhom, args)」の形をしている。すな
わち、イベントの種別(event)と、どのモジュールか
ら送られたものか(fromWhom)、および、その時の引数
を配列にして一つにまとめたもの(args)の3つの情報
を受け取る関数として実現される。
The details of the structure of the module corresponding function code 3c generated in this manner will be described with reference to FIG. FIG. 7 is an explanatory diagram showing a detailed configuration example of the module corresponding function in FIG. The generated module-corresponding function code 3 c includes “MainMo
dule (event, fromWhom, args) ". That is, it is implemented as a function that receives three types of information: the type of event (event), the module from which the event was sent (fromWhom), and the arguments at that time arranged in an array (args). You.

【0064】そして、状態やロック状態、ロック除外対
象モジュール格納領域の宣言と、初期化処理部分からな
る状態・ロック状態格納領域3dを有する。この部分の
詳細を図9に示す。図9は、図1における状態・ロック
状態格納領域の詳細構成例を示す説明図である。本例で
は、ターゲットの言語は、明示的に代入を行うまでは恒
久的に値を保存できる変数を関数に対して定義できる機
能を持っているものとする。
Further, there is a state / lock state storage area 3d including a state, a lock state, a declaration of a lock exclusion target module storage area, and an initialization processing part. FIG. 9 shows details of this part. FIG. 9 is an explanatory diagram showing a detailed configuration example of the state / lock state storage area in FIG. In this example, it is assumed that the target language has a function capable of defining a variable that can permanently store a value for a function until an explicit assignment is made.

【0065】そして、ここでは、その機能を使って宣言
部91において、モジュールの状態格納領域を「userSt
atus」、ロック状態格納領域を「lockStatus」、ロック
除外対象モジュール格納領域を「moduleList」として実
現している。また、ここでは、状態の初期化コードとし
て、 という記述が置かれている。図1におけるイベント管理
エンジンのコード3aは、システムが立ち上がると同時
に各モジュールの関数にイベント「_init_」を送ること
により、初期状態に遷移させる。
Here, in the declaration section 91 using the function, the state storage area of the module is set to “userStd”.
atus ", the lock status storage area is" lockStatus ", and the lock exclusion target module storage area is" moduleList ". Here, as the state initialization code, Is described. The code 3a of the event management engine in FIG. 1 makes the transition to the initial state by sending the event "_init_" to the function of each module at the same time when the system starts up.

【0066】図7において、次にロック時イベント処理
コード3eとして、ロック状態の時にロック除外の対象
になっていないモジュールからイベント送信があった場
合に「toWhom」にイベント「LOCKED」を返す処理が埋め
込まれる。このコードのアルゴリズムを図8に示す。
In FIG. 7, next, as a lock event processing code 3e, a process of returning an event "LOCKED" to "toWhom" when an event is transmitted from a module which is not a lock exclusion target in a locked state. Embedded. The algorithm of this code is shown in FIG.

【0067】図8は、図1におけるロック時イベント処
理の手順例を示すPAD図である。図7の状態・ロック
状態格納領域3dにおける変数「lockStatus」が「Lock
ed」であり(ステップ801)、変数「fromWhom」が変
数「moduleList」に入っていなければ(ステップ80
2)、イベントの送り主(fromWhom)にロック状態(Lo
cked)を返す(ステップ803)。
FIG. 8 is a PAD diagram showing an example of the procedure of the lock event process in FIG. The variable “lockStatus” in the status / lock status storage area 3d in FIG.
ed ”(step 801) and the variable“ fromWhom ”is not included in the variable“ moduleList ”(step 80).
2) The event sender (fromWhom) is locked (Lo)
cked) is returned (step 803).

【0068】図7のモジュール対応関数コード3cにお
いては、次に、状態遷移コード3fで、現在の状態「us
erStatus」とイベント「event」の組みで場合分けし、
次のイベントへ遷移するコードへジャンプするコードが
埋め込まれる。そして、各状態に遷移するためのコード
が、それぞれラベル72,73が付けられて埋め込ま
れ、状態遷移コード3fの処理からジャンプできるよう
になっている。
In the module-corresponding function code 3c of FIG. 7, next, the current state "us
erStatus "and event" event "
The code that jumps to the code that transitions to the next event is embedded. Then, codes for transitioning to the respective states are embedded with labels 72 and 73, respectively, so that jumping can be performed from the processing of the state transition code 3f.

【0069】ラベル72において示されるように、各状
態への遷移は、まず、フィールド74で、変数「userSt
atus」を、その状態を表す値にし、次に、状態遷移した
時の動作をターゲット言語に生成したもの(動作コード
3g)が埋め込まれる。ここで、 send(MODULE, event, arg1, ...) に対しては、イベントキューにこのイベント送信を追加
するランタイムルーティンの呼出し処理75が埋め込ま
れる。
As shown by the label 72, the transition to each state is performed by first setting the variable “userSt
"atus" is set to a value representing the state, and then an operation (operation code 3g) generated in the target language when the state has transitioned is embedded. Here, for send (MODULE, event, arg1,...), A runtime routine call process 75 for adding this event transmission to the event queue is embedded.

【0070】また、 LockMeWithout(MODULE1, ..., MODULEn) に対しては、 lockStatus = LOCKED; moduleList にMODULE1, ..., MODULEn を設定 を行い、ロックされた状態と除外するモジュールのリス
トを記録する処理76が埋め込まれる。
For LockMeWithout (MODULE1,..., MODULEn), MODULE1,..., MODULEn are set in lockStatus = LOCKED; moduleList, and a locked state and a list of modules to be excluded are recorded. The processing 76 is embedded.

【0071】また、 Unlock に対しては、 lockStatus = UNLOCK でロック状態を解除する処理77が埋め込まれる。ま
た、その他の動作については、ターゲット言語の対応す
るランタイムルーティンの呼出しが埋め込まれる。
For Unlock, a process 77 for releasing the locked state with lockStatus = UNLOCK is embedded. For other operations, calls to the corresponding runtime routines of the target language are embedded.

【0072】このように、動作コード3gにおいて、状
態に遷移した時の動作に書かれているもの全てがこのよ
うに変換され埋め込まれた後、 return の命令78が置かれ、この関数を終了する。
As described above, in the operation code 3g, after everything described in the operation at the time of transition to the state is converted and embedded in this way, a return instruction 78 is placed, and this function ends. .

【0073】ただし、この状態からイベント *immediate* で別の状態へエッジが定義されていれば、これは、新た
なイベントを待たずにすぐその状態に遷移することを意
味するので、「return」の代わりに、goto 次の状態の
ラベル名;を埋め込み、即座にその状態に遷移するコー
ドを生成する。
However, if an edge is defined from this state to another state by the event * immediate *, this means that the state immediately transits to that state without waiting for a new event. Instead of goto, embed the label name of the next state; and generate code that immediately transitions to that state.

【0074】以下、図1における状態遷移定義1bから
状態遷移コード3fを生成する方法、および、状態定義
1cから各動作コード3gを生成する方法を詳細に述べ
る。まず、図10を使って、状態遷移に対応するコード
(状態遷移コード3f)の生成処理を詳細に説明する。
尚、ここでは、ターゲット言語をプログラミング言語C
とした場合で説明する。
Hereinafter, a method of generating the state transition code 3f from the state transition definition 1b and a method of generating each operation code 3g from the state definition 1c in FIG. 1 will be described in detail. First, the generation process of the code corresponding to the state transition (state transition code 3f) will be described in detail with reference to FIG.
Here, the target language is the programming language C
Will be described.

【0075】図10は、図1における状態遷移コード生
成部の処理手順例を示すPAD図である。まず、ステッ
プ1001の処理で、「Slist」に、そのモジュールの
全ての状態の集合を入れ、次に、ステップ1002の処
理で、「switch(userStatus) {」というコードの生成を
行ない、場合分けの開始を宣言する。
FIG. 10 is a PAD diagram showing an example of the processing procedure of the state transition code generation unit in FIG. First, in step 1001, a set of all states of the module is put in “Slist”. Next, in step 1002, a code “switch (userStatus) {” is generated. Declare the start.

【0076】そして、次のステップ1003の処理で、
「Slist」の中の全ての状態「S」に対して、ステップ1
004以下の一連の処理を繰り返し、それぞれの状態に
対して、各イベントが来たとき次の状態に遷移するため
のジャンプ命令を生成する。まず、ステップ1004の
処理で、「case Sの名前:」 というコードを生成し、状
態「S」の時の動作指定開始を宣言する。次に、「even
t」で場合分けするためにステップ1005の処理で、
「switch(event) {」 というコードを生成する。
Then, in the processing of the next step 1003,
Step 1 for all states "S" in "Slist"
A series of processes from 004 onward is repeated, and a jump instruction for transitioning to the next state is generated for each state when each event comes. First, in the process of step 1004, a code “name of case S:” is generated, and the operation designation start in the state “S” is declared. Next, "even
In step 1005 in order to divide by “t”,
Generates the code "switch (event) {".

【0077】さらに、次のステップ1006の処理で、
「Elist」に、状態「S」に定義されている全てのイベン
トの集合を入れ、ステップ1007の処理で、「Elis
t」の全てのイベント「E」に対して、ステップ1008
以下の一連の処理を繰り返し、それぞれジャンプ文を生
成する。尚、ここで、イベント「*immediate*」は、即
時の遷移と解釈しているので、イベントの集合を格納す
る変数「Elist」には加えない。
Further, in the next step 1006,
A set of all the events defined in the state “S” is put in “Elist”, and “Elis”
Step 1008 for all events "E" of "t"
The following series of processing is repeated to generate jump statements. Here, since the event “* immediate *” is interpreted as an immediate transition, it is not added to the variable “Elist” that stores a set of events.

【0078】ステップ1008の処理では、「case Eの
名前:」 というコードを生成し、次に、ステップ100
9の処理で、「Next」を状態「S」から、「E」で遷移す
る先の状態のラベルとし、ステップ1010の処理で、
「goto Nextの名前;」というコードの生成を行なう。そ
して、最後に、2つの場合分けを終了するために、ステ
ップ1011の処理で、「}」を生成し、ステップ10
12の処理で、「}」を生成する。このようにして生成
された結果のコードを図11に示す。
In the process of step 1008, a code “name of case E:” is generated.
In the process of step 9, “Next” is set as the label of the state to which the transition is made from the state “S” by “E”.
Generate the code "goto Next name;" Finally, in order to end the two cases, “}” is generated in the processing of step 1011, and
In step 12, "}" is generated. FIG. 11 shows the resulting code generated in this manner.

【0079】図11は、図1における状態遷移コードの
生成例を示す説明図である。「switch」および「case」
等により、各状態「IDOL」,「PRINTING」の動作分けが
実行されるコードが生成されている。尚、状態「Comple
ted」や状態「Incompleted」からは「*Immediate*」の
遷移しか無いので、この状態遷移コードの中には、場合
分けとして現れていない。
FIG. 11 is an explanatory diagram showing an example of generating the state transition code in FIG. "Switch" and "case"
As a result, a code for executing the operation of each of the states “IDOL” and “PRINTING” is generated. The state "Comple
Since there is only a transition of “* Immediate *” from “ted” or the state “Incompleted”, this state transition code does not appear as a case.

【0080】次に、図12を用いて、図1の動作コード
生成部2fによる各状態での動作コードの生成動作を説
明する。図12は、図1におけるプログラム自動生成シ
ステムの本発明に係わる第1の処理動作例を示すPAD
図である。本例は、図1における各状態での動作コード
生成部の処理手順例を示すものであり、まず、ステップ
1201の処理で、「Slist」にそのモジュールの全て
の状態の集合を設定する。
Next, the operation of generating the operation code in each state by the operation code generation unit 2f of FIG. 1 will be described with reference to FIG. FIG. 12 is a PAD showing a first processing operation example of the automatic program generation system in FIG. 1 according to the present invention.
FIG. This example shows an example of a processing procedure of the operation code generation unit in each state in FIG. 1. First, in step 1201, a set of all states of the module is set in “Slist”.

【0081】次に、ステップ1202の処理で、「Slis
t」の全ての状態「S」に対して、ステップ1203以下
の一連の処理を繰り返し、状態に遷移したときの動作を
実現するコードを生成する。まず、ステップ1203の
処理で、状態「S」の名前のラベルを作る。次に、ステ
ップ1204の処理で、「userStatus = S」というコー
ドを生成し、モジュールの状態を表す変数に、遷移した
先の状態を記憶する。
Next, in the processing of step 1202, “Slis
A series of processes from step 1203 is repeated for all states “S” of “t” to generate a code that realizes the operation when the state transits to the state. First, in the process of step 1203, a label with the name of the state “S” is created. Next, in the processing of step 1204, a code “userStatus = S” is generated, and the state of the transition destination is stored in a variable representing the state of the module.

【0082】そして、ステップ1205の処理で、「Ac
ts」に、状態「S」で定義されている動作の列を入れ、
ステップ1206の処理で、「Acts」の中の動作「A」
に対して、ステップ1207の処理で場合分けを行な
い、それぞれ適切なコードを生成する。
Then, in the processing of step 1205, “Ac
ts ", put the sequence of actions defined in state" S ",
In the processing of step 1206, the operation “A” in “Acts”
In step 1207, appropriate code is generated.

【0083】このステップ1207の場合分け処理で、
動作「A」が「send(M1, E1, ARG1,...)」の形の時に
は、まず、ステップ1208の処理で、このモジュール
の名前を「M2」とし、次に、ステップ1209の処理
で、「ARGS1, ..., ARGSn」を構造体「args」に入れる
コードを生成し、最後に、ステップ1210の処理で、
「send(M1, E1, M2, args)」というコードを生成する。
In the case dividing process of step 1207,
When the operation “A” is in the form of “send (M1, E1, ARG1,...)”, First, in step 1208, the name of this module is “M2”, and then, in step 1209, , “ARGS1,..., ARGSn” into the structure “args”, and finally, in the process of step 1210,
Generate the code "send (M1, E1, M2, args)".

【0084】また、ステップ1207の場合分け処理
で、動作「A」が「LockMeWithout(M1,...)」の形の時に
は、次のような一連の処理を行なう。まず、ステップ1
211の処理で、「lockStatus = LOCKED」というコー
ドを生成し、次に、ステップ1212の処理で、「M1,
..., Mn」を「moduleList」に入れるコードを生成す
る。これにより、ロック状態の設定と、ロック対象から
除外したモジュールの設定ができる。
When the operation “A” is in the form of “LockMeWithout (M1,...)” In step 1207, the following series of processing is performed. First, step 1
In the process of 211, a code “lockStatus = LOCKED” is generated, and then in the process of step 1212, “M1,
..., Mn "is generated into" moduleList ". As a result, it is possible to set the lock state and set the module excluded from the lock target.

【0085】さらに、ステップ1207の場合分け処理
で、動作「A」が「UnlockMe」の形の時には、ステップ
1213の処理で、「lockStatus = UNLOCKED」という
コードを生成し、ロックを外す。
Further, when the operation "A" is in the form of "UnlockMe" in the case dividing process in step 1207, a code "lockStatus = UNLOCKED" is generated in step 1213 to release the lock.

【0086】以上の例では、説明を簡単にするために、
状態での動作指定を「send」,「LockMeWithout」,「Unl
ock」の3つに限った。ここでの動作指定種類を増やし
たい場合は、ステップ1207の場合分け処理に、その
動作指定の場合を追加し、コードの生成方法を組み込め
ば良い。例えば、ターゲット言語で提供される関数を呼
出す動作 call 関数名(引数1, ..., 引数n) を追加しておくと、ターゲット言語で提供されている機
能を利用することができ、便利である。
In the above example, in order to simplify the explanation,
Specify "send", "LockMeWithout", "Unl
ock ". If it is desired to increase the types of operation designation here, the case of the operation designation may be added to the case classification process of step 1207, and a code generation method may be incorporated. For example, by adding a function that calls the function provided in the target language call function name (argument 1, ..., argument n), the function provided in the target language can be used, which is convenient and convenient. is there.

【0087】また、これを追加したい場合は、場合分け
として、この形の識別を、ステップ1207の場合分け
処理に追加し、生成するコードとしては、ターゲット言
語のこの関数を呼出すコードを生成すれば良い。このよ
うにして、図3,4および図5の状態定義から、図13
に示す動作コードが生成される。図13は、図1におけ
る動作コードの具体例を示す説明図である。「IDOL」、
「Printing」、「Completed」、「Incompleted」の各状
態別に、それぞれの動作を行うコード(動作コード3
g)が生成されている。
If it is desired to add this, the identification of this form is added to the case classification process in step 1207 as a case classification, and the generated code is a code for calling this function in the target language. good. In this way, from the state definitions of FIGS. 3, 4 and 5, FIG.
Is generated. FIG. 13 is an explanatory diagram showing a specific example of the operation code in FIG. "IDOL",
A code that performs each operation for each state of “Printing”, “Completed”, and “Incompleted” (operation code 3
g) has been generated.

【0088】次に、図14を用いて、ロック状態を3値 UNLOCKED .......ロックが掛かっていない。どんなモ
ジュールからのイベントにも応答する。 LOCKED ...........ロックが掛かっており、限定された
モジュールからのイベントのみに応答する。それ以外の
モジュールにはLOCKEDを返す。 LOCKEDSHORT ......短い時間のロックが掛かっている。
限定されたモジュールにはすぐ答える。それ以外のモジ
ュールからのイベントはロックが解除するまで待たされ
る。 に拡張したときの、図1のイベントキュー格納領域3b
におけるイベントキュー管理のアルゴリズムを説明す
る。
Next, referring to FIG. 14, the lock state is set to three values UNLOCKED... No lock is applied. Respond to events from any module. LOCKED ........... Locked and responds only to events from a limited number of modules. LOCKED is returned to other modules. LOCKEDSHORT ...... Locked for a short time.
We will respond to limited modules immediately. Events from other modules wait until the lock is released. Event queue storage area 3b in FIG.
Will be described below.

【0089】図14は、図1におけるプログラムによる
イベントキュー格納領域の管理手順例を示す説明図であ
る。イベントキュー管理では、システムが起動される
と、ステップ1401で繰り返し処理を行い、モジュー
ルに対応する関数を呼出す処理を繰り返す。
FIG. 14 is an explanatory diagram showing an example of a procedure for managing the event queue storage area by the program in FIG. In the event queue management, when the system is started, the process is repeatedly performed in step 1401, and the process of calling the function corresponding to the module is repeated.

【0090】すなわち、ステップ1402の処理で、ま
ず、図1のイベントキュー格納領域3bから1行取り出
し、 toWhom:送り先 event :イベント fromWhom:送り元 args:引数 とする。
That is, in the process of step 1402, first, one line is fetched from the event queue storage area 3b in FIG. 1, and is set as toWhom: destination event: event fromWhom: source args: argument.

【0091】次に、ステップ1403の条件判定処理
で、「toWhom」のロック状態が「LOCKEDSHORT」でかつ
「fromWhom」が除外リストに入っていないかどうかを調
べ、この条件が成立する時は、短時間ロックが掛かって
いるので、ステップ1404の処理で、「(toWhom,even
t,fromWhom,args)」をキューの後ろに戻し、イベントの
処理を待たせる。
Next, in the condition judgment processing of step 1403, it is checked whether or not the locked state of “toWhom” is “LOCKEDSHORT” and “fromWhom” is not included in the exclusion list. Since the time is locked, in the processing of step 1404, "(toWhom, even
t, fromWhom, args) "back to the back of the queue, waiting for the event to be processed.

【0092】また、ステップ1403の条件判定処理で
条件が成立しない時、すなわち、短時間ロックの対象で
はない時には、ステップ1405の処理で、「toWhom」
に対応する関数を「f」とし、「f(event, fromWhom, ar
gs)」を呼び出す。これを繰り返すことにより、短時間
ロックにおいては、それが外れたら、イベントキューに
溜まっていたイベントが、そのモジュールに対応する関
数で実行される。
When the condition is not satisfied in the condition determination processing of step 1403, that is, when the condition is not the object of the short-time lock, “toWhom” is determined in the processing of step 1405.
Is defined as “f”, and “f (event, fromWhom, ar
gs) ". By repeating this, in the short-time lock, if the lock is released, the event stored in the event queue is executed by the function corresponding to the module.

【0093】このような、短時間ロックコマンドを含ん
だ状態の動作生成法の処理を、次の図15を用いて詳細
に説明する。図15は、図1におけるプログラム自動生
成システムの本発明に係わる第2の処理動作例を示すP
AD図である。本例は、図12で示した、図1における
動作コード生成部2fの他の処理手順例を示すもので、
短時間ロックコマンドを含んだ状態の動作生成手順であ
り、図12におけるステップ1206の処理でのループ
を、この図15のものに置き換える。
The processing of the action generation method including the short-time lock command will be described in detail with reference to FIG. FIG. 15 is a flowchart showing a second processing operation example of the automatic program generation system in FIG. 1 according to the present invention.
It is an AD diagram. This example shows another processing procedure example of the operation code generation unit 2f in FIG. 1 shown in FIG.
This is an action generation procedure including a short-time lock command, and the loop in the processing of step 1206 in FIG. 12 is replaced with the one in FIG.

【0094】すなわち、変数「Acts」を状態に記述され
た全ての動作のリストとし、その全ての動作「A」に対
して、ステップ1502の処理でコードを生成する。本
例が、図12の例と異なるのは、動作「A」の形の場合
わけで、動作「A」がLockShortMeWithout(M1, ...)の場
合が追加されていることである。この場合は、ステップ
1508の処理で、「lockStatus = LOCKEDSHORT」とい
うコードを生成し、次に、ステップ1509の処理で、
「M1, ..., Mn」を「moduleList」に入れるコードを生
成する。
That is, the variable “Acts” is used as a list of all the operations described in the state, and a code is generated for all the operations “A” in the process of step 1502. This example is different from the example in FIG. 12 in the case of the operation “A”, and in that the case where the operation “A” is LockShortMeWithout (M1,...) Is added. In this case, in step 1508, a code “lockStatus = LOCKEDSHORT” is generated, and then, in step 1509,
Generate code to put "M1, ..., Mn" into "moduleList".

【0095】以上、図1〜図15を用いて説明したよう
に、本実施例のプログラム自動生成システムと方法で
は、状態遷移オートマトンの記述体系を拡大し、予めオ
ートマトンにロックの状態を組み込み、オートマトンの
ロック状態を変更する動作指定をユーザに許し、ロック
されているオートマトンにイベントが送られると、今ロ
ックされているというイベントを送り返すプログラムを
生成するので、ユーザは、ロックによる排他制御を、コ
マンドを一つ発行する記述で表現できる。
As described above with reference to FIGS. 1 to 15, in the automatic program generation system and method of the present embodiment, the description system of the state transition automaton is expanded, the lock state is incorporated in the automaton in advance, and the automaton is generated. When an event is sent to a locked automaton, a program that sends back an event indicating that it is currently locked is generated. Can be expressed by a description that issues one.

【0096】これにより、多くの機器や複数の端末と接
続され、複数の機器のイベントや別のシステムからのイ
ベントに対して反応する分散システム等のソフトウエア
を、状態遷移オートマトンの記述で構築する場合にも、
ユーザ(システム開発者)は、簡単な記述で、複雑なロ
ック制御(排他制御:1つの仕事をしているとき他の機
器や端末の依頼を受けないための制御)を実現できる。
Thus, software such as a distributed system which is connected to many devices and a plurality of terminals and reacts to events of the plurality of devices and events from another system is constructed by describing the state transition automaton. In some cases,
The user (system developer) can realize complicated lock control (exclusive control: control for not receiving a request from another device or terminal while performing one job) with a simple description.

【0097】尚、本発明は、図1〜図15を用いて説明
した実施例に限定されるものではなく、その要旨を逸脱
しない範囲において種々変更可能である。例えば、本例
では、光ディスクからプログラムを提供する構成として
いるが、FD(フレキスブルディスク)等、他のコンピ
ュータ読み取り可能な記録媒体を用いることでも良い。
The present invention is not limited to the embodiment described with reference to FIGS. 1 to 15, and can be variously modified without departing from the gist thereof. For example, in this example, the program is provided from an optical disk, but another computer-readable recording medium such as an FD (flexible disk) may be used.

【0098】[0098]

【発明の効果】本発明によれば、ロック制御が必要なシ
ステムの記述においても、送られてくる可能性のある全
てのイベントに対して、ロックされていることを表すイ
ベントを送り返すための状態遷移をユーザが一々書く必
要がなくなり、金融や公共などの分野における、ネット
ワーク経由で遠隔の顧客/住民にサービスを提供するシ
ステムのように、1つの端末が多くのイベントに反応し
なければならないシステムの構築に用いるプログラムを
効率的に生成することが可能である。
According to the present invention, even in the description of a system requiring lock control, a state for sending back an event indicating that the event is locked with respect to all events that may be sent. A system in which one terminal has to respond to many events, such as a system for providing services to remote customers / residents via a network in a field such as finance or public, in which a user does not have to write each transition. Can be efficiently generated.

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

【図1】本発明のプログラム自動生成システムの本発明
に係る構成の一実施例を示すブロック図である。
FIG. 1 is a block diagram showing an embodiment of a configuration according to the present invention of an automatic program generation system of the present invention.

【図2】図1におけるプログラム自動生成システムの装
置構成例を示すブロック図である。
FIG. 2 is a block diagram illustrating an example of a device configuration of an automatic program generation system in FIG. 1;

【図3】図1における状態定義の詳細例を示す説明図で
ある。
FIG. 3 is an explanatory diagram showing a detailed example of a state definition in FIG. 1;

【図4】図1における状態遷移定義の詳細例を示す説明
図である。
FIG. 4 is an explanatory diagram showing a detailed example of a state transition definition in FIG. 1;

【図5】図3および図4における状態定義と状態遷移定
義で表現されるモジュールを図式で表現する図式言語例
を示す説明図である。
FIG. 5 is an explanatory diagram showing an example of a diagram language for graphically expressing a module expressed by a state definition and a state transition definition in FIGS. 3 and 4;

【図6】図1におけるプログラム自動生成システムで生
成されたプログラムの全体構成例を示す説明図である。
FIG. 6 is an explanatory diagram showing an example of the entire configuration of a program generated by the automatic program generation system in FIG. 1;

【図7】図1におけるモジュール対応関数の詳細構成例
を示す説明図である。
FIG. 7 is an explanatory diagram showing a detailed configuration example of a module corresponding function in FIG. 1;

【図8】図1におけるロック時イベント処理の手順例を
示すPAD図である。
FIG. 8 is a PAD diagram showing an example of a procedure of a lock event process in FIG. 1;

【図9】図1における状態・ロック状態格納領域の詳細
構成例を示す説明図である。
FIG. 9 is an explanatory diagram showing a detailed configuration example of a state / lock state storage area in FIG. 1;

【図10】図1における状態遷移コード生成部の処理手
順例を示すPAD図である。
FIG. 10 is a PAD illustrating an example of a processing procedure of a state transition code generation unit in FIG. 1;

【図11】図1における状態遷移コードの生成例を示す
説明図である。
FIG. 11 is an explanatory diagram showing an example of generating a state transition code in FIG. 1;

【図12】図1におけるプログラム自動生成システムの
本発明に係わる第1の処理動作例を示すPAD図であ
る。
FIG. 12 is a PAD diagram showing a first processing operation example of the automatic program generation system in FIG. 1 according to the present invention;

【図13】図1における動作コードの具体例を示す説明
図である。
FIG. 13 is an explanatory diagram showing a specific example of an operation code in FIG. 1;

【図14】図1におけるプログラムによるイベントキュ
ー格納領域の管理手順例を示す説明図である。
FIG. 14 is an explanatory diagram showing an example of a procedure for managing an event queue storage area by the program in FIG. 1;

【図15】図1におけるプログラム自動生成システムの
本発明に係わる第2の処理動作例を示すPAD図であ
る。
FIG. 15 is a PAD diagram showing a second processing operation example of the automatic program generation system in FIG. 1 according to the present invention;

【図16】各状態における動作定義の記述例を示す説明
図である。
FIG. 16 is an explanatory diagram showing a description example of an operation definition in each state.

【図17】各状態における状態遷移の記述例を示す説明
図である。
FIG. 17 is an explanatory diagram showing a description example of a state transition in each state.

【図18】図16および図17における状態定義と状態
遷移定義で表現されるモジュールを図式で表現する図式
言語例を示す説明図である。
FIG. 18 is an explanatory diagram showing an example of a diagram language for graphically expressing modules represented by the state definition and the state transition definition in FIGS. 16 and 17;

【図19】従来技術によるロック制御に対する状態遷移
の記述例を示す説明図である。
FIG. 19 is an explanatory diagram showing a description example of a state transition for lock control according to the related art.

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

1:システム記述、1a:モジュール定義、1b:状態
遷移定義、1c:状態定義、1d:ロックの指定、2:
プログラム生成部、2a:イベント管理エンジンおよび
イベントキュー生成部、2b:モジュール対応関数コー
ド生成部、2c:状態格納領域生成部、2d:ロック時
コード生成部、2e:状態遷移コード生成部、2f:動
作コード生成部、2g:ロックコード生成部、3:プロ
グラム、3a:イベント管理エンジンのコード、3b:
イベントキュー格納領域、3c:モジュール対応関数コ
ード、3d:状態・ロック状態格納領域、3e:ロック
時イベント処理コード、3f:状態遷移コード、3g:
動作コード、3h:ロックのコード、21:表示装置、
22:入力装置、23:情報処理装置、24:補助記憶
装置、25:光ディスク、26:光ディスク駆動装置、
31:状態名(フィールド)、32:初期状態(フィー
ルド)、33:動作定義(フィールド)、41:状態名
(フィールド)、42:イベント名(フィールド)、4
3:次の状態名(フィールド)、51:初期状態「IDO
L」、52:状態「Printing」、53:動作定義、5
4:状態「Completed」、55:動作定義、56:状態
「Incompleted」、71:ヘッダ部分、72,73:ラ
ベル、74:フィールド、75:ランタイムルーティン
の呼出し処理、76:ロックされた状態と除外するモジ
ュールのリストを記録する処理、77:ロック状態を解
除する処理、78:命令(return)、91:宣言部、1
61:状態定義、162:状態名(フィールド)、16
3:初期状態(フィールド)、164:動作定義(フィ
ールド)、171:状態遷移定義、172:状態名(フ
ィールド)、173:イベント名(フィールド)、17
4:次の状態名(フィールド)、181:モジュール、
182:状態「IDOL」、183:動作定義、184:状
態「Printing」、185:動作定義、186:状態「Co
mpleted」、187:状態「Incompleted」、191:
「IDOL」状態、192:「Printing」状態、193:
「Answering LockStatus A」状態、194:「Answerin
g LockStatus B」状態、195,196:動作定義。
1: System description, 1a: Module definition, 1b: State transition definition, 1c: State definition, 1d: Lock designation, 2:
Program generation unit, 2a: event management engine and event queue generation unit, 2b: module corresponding function code generation unit, 2c: state storage area generation unit, 2d: lock time code generation unit, 2e: state transition code generation unit, 2f: Operation code generator, 2g: lock code generator, 3: program, 3a: event management engine code, 3b:
Event queue storage area, 3c: module corresponding function code, 3d: state / lock state storage area, 3e: locked event processing code, 3f: state transition code, 3g:
Operation code, 3h: lock code, 21: display device,
22: input device, 23: information processing device, 24: auxiliary storage device, 25: optical disk, 26: optical disk drive device,
31: state name (field), 32: initial state (field), 33: operation definition (field), 41: state name (field), 42: event name (field), 4
3: Next state name (field), 51: Initial state "IDO
L ", 52: state" Printing ", 53: operation definition, 5
4: state “Completed”, 55: operation definition, 56: state “Incompleted”, 71: header part, 72, 73: label, 74: field, 75: call processing of runtime routine, 76: locked state and exclusion Processing for recording a list of modules to be locked, 77: processing for releasing a locked state, 78: instruction (return), 91: declaration section, 1
61: state definition, 162: state name (field), 16
3: initial state (field), 164: operation definition (field), 171: state transition definition, 172: state name (field), 173: event name (field), 17
4: next state name (field), 181: module,
182: state “IDOL”, 183: operation definition, 184: state “Printing”, 185: operation definition, 186: state “Co”
mpleted ", 187: state" Incompleted ", 191:
"IDOL" state, 192: "Printing" state, 193:
"Answering LockStatus A" status, 194: "Answerin
g LockStatus B "state, 195, 196: operation definition.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 状態遷移オートマトンの記述に基づきコ
ンピュータ処理して、対応するプログラムを自動生成す
るプログラム自動生成システムにおいて、上記状態遷移
オートマトンの記述から、所定の排他制御動作を行うロ
ック状態の遷移を検出し、該検出したロック状態の遷移
に対応して、ロックされていることを表すイベントを外
部のイベントに対して返すプログラムを生成するロック
コード生成手段を設け、上記状態遷移オートマトンに予
め組み込まれた上記ロック状態の遷移に基づき、上記所
定の排他制御動作を行なうプログラムを生成することを
特徴とするプログラム自動生成システム。
1. A program automatic generation system for automatically generating a corresponding program by computer processing based on a description of a state transition automaton, wherein a transition of a lock state for performing a predetermined exclusive control operation is described from the description of the state transition automaton. Lock code generation means for generating a program that detects and, in response to the detected transition of the lock state, returns an event indicating that it is locked to an external event is provided, and is incorporated in the state transition automaton in advance. An automatic program generation system for generating a program for performing the predetermined exclusive control operation based on the transition of the lock state.
【請求項2】 請求項1のプログラム自動生成システム
において、上記状態遷移オートマトンに予め組み込まれ
るロック状態には、所定の外部イベントを特定する記述
が含まれ、上記ロックコード生成手段は、上記特定の外
部イベントを除く外部のイベントに対して、上記ロック
されていることを表すイベントを返すプログラムを生成
する手段を有することを特徴とするプログラム自動生成
システム。
2. The program automatic generation system according to claim 1, wherein the lock state pre-installed in the state transition automaton includes a description for specifying a predetermined external event, and the lock code generation means includes: An automatic program generation system comprising: means for generating a program for returning an event indicating that the event is locked with respect to an external event other than an external event.
【請求項3】 請求項1、もしくは、請求項2のいずれ
かに記載のプログラム自動生成システムにおいて、上記
ロック状態の解除を待つ動作を指定した短時間ロック状
態の遷移を上記状態遷移オートマトンの記述から検出す
る手段と、該検出した短時間ロック状態の遷移の記述に
対応して、上記外部イベントの送信元の状態遷移オート
マトンに、上記短時間ロックされていることを表すイベ
ントを送り返し、上記送信元の状態遷移オートマトンに
上記短時間ロック状態の解除を待つよう動作させるプロ
グラムを生成する手段とを有することを特徴とするプロ
グラム自動生成システム。
3. The automatic program generation system according to claim 1, wherein the transition of the short-time lock state specifying an operation to wait for release of the lock state is described by the state transition automaton. Means for detecting the short-time lock state, and transmitting the event indicating that the external event is transmitted to the state transition automaton of the source of the external event in response to the description of the transition of the detected short-time lock state. Means for generating a program that causes the original state transition automaton to wait for the short-time lock state to be released.
【請求項4】 請求項1から請求項3のいずれかに記載
のプログラム自動生成システムにおいて、上記ロック状
態を解除するためのアンロック状態の遷移を上記状態遷
移オートマトンの記述から検出する手段と、該検出した
アンロック状態の遷移の記述に対応して、上記ロック状
態を解除するプログラムを生成する手段とを有すること
を特徴とするプログラム自動生成システム。
4. A program automatic generation system according to claim 1, wherein a transition of an unlock state for releasing the lock state is detected from a description of the state transition automaton; Means for generating a program for releasing the locked state in accordance with the description of the detected transition of the unlocked state.
【請求項5】 状態遷移オートマトンを用いたシステム
の記述に基づきコンピュータ処理して、上記システムの
プログラムを自動生成するプログラム自動生成方法にお
いて、上記状態遷移オートマトンの記述から、所定の排
他制御動作を行うロック状態の遷移を検出するステップ
と、該検出したロック状態の遷移に含まれて記述されて
いる、所定の外部イベントを特定するステップと、該特
定した上記所定の外部イベントを除く外部イベントに対
して、上記ロック状態を表すイベントを返すプログラム
を生成するステップと、上記状態遷移オートマトンの記
述から、上記ロック状態の解除を待つ動作を指定した短
時間ロック状態の遷移を検出するステップと、該検出し
た短時間ロック状態の遷移の記述に対応して、上記外部
イベントの送信元の状態遷移オートマトンに、上記短時
間ロックされていることを表すイベントを送り返すプロ
グラムと、上記送信元の状態遷移オートマトンに上記短
時間ロック状態の解除を待たせるプログラムを生成する
ステップと、上記状態遷移オートマトンの記述から、上
記ロック状態を解除するためのアンロック状態の遷移を
検出するステップと、該検出したアンロック状態の遷移
の記述に対応して、上記ロック状態を解除するプログラ
ムを生成するステップとを有し、上記状態遷移オートマ
トンに予め組み込まれた上記ロック状態の遷移の記述に
基づき、上記所定の排他制御動作の制御を行なうプログ
ラムを生成することを特徴とするプログラム自動生成方
法。
5. A program automatic generation method for automatically generating a program of the system by performing computer processing based on a description of a system using a state transition automaton and performing a predetermined exclusive control operation from the description of the state transition automaton. Detecting a transition of the lock state, identifying the predetermined external event included in the detected transition of the lock state, and specifying the external event excluding the specified external event. Generating a program that returns an event representing the lock state; and detecting, from the description of the state transition automaton, a transition of a short-time lock state designating an operation to wait for release of the lock state. Corresponding to the short-time lock state transition described above, Generating a program for sending back to the state transition automaton an event indicating that the state is locked for a short time, generating a program for causing the state transition automaton of the transmission source to wait for the release of the short-time lock state, and Detecting a transition of an unlock state for releasing the locked state from the description of the above, and generating a program for releasing the locked state corresponding to the description of the detected transition of the unlock state. And generating a program for controlling the predetermined exclusive control operation based on a description of the transition of the lock state previously incorporated in the state transition automaton.
JP9024998A 1998-04-02 1998-04-02 Automatic program generation system and method Pending JPH11288367A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9024998A JPH11288367A (en) 1998-04-02 1998-04-02 Automatic program generation system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9024998A JPH11288367A (en) 1998-04-02 1998-04-02 Automatic program generation system and method

Publications (1)

Publication Number Publication Date
JPH11288367A true JPH11288367A (en) 1999-10-19

Family

ID=13993236

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9024998A Pending JPH11288367A (en) 1998-04-02 1998-04-02 Automatic program generation system and method

Country Status (1)

Country Link
JP (1) JPH11288367A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010125960A1 (en) * 2009-04-28 2010-11-04 インターナショナル・ビジネス・マシーンズ・コーポレーション Method for converting program code of program running in multithreaded environment to program code having fewer lock conflicts, and computer program and computer system therefor
JP2015204014A (en) * 2014-04-15 2015-11-16 三菱電機株式会社 Software generation method, software generation device, and software execution device
CN107943470A (en) * 2017-11-23 2018-04-20 四川长虹电器股份有限公司 Cloud management platform code generates the System and method for recycling

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010125960A1 (en) * 2009-04-28 2010-11-04 インターナショナル・ビジネス・マシーンズ・コーポレーション Method for converting program code of program running in multithreaded environment to program code having fewer lock conflicts, and computer program and computer system therefor
CN102292709A (en) * 2009-04-28 2011-12-21 国际商业机器公司 Method of converting program code of program running in multi-thread to program code causing less lock collisions, computer program and computer system for the same
JP5204300B2 (en) * 2009-04-28 2013-06-05 インターナショナル・ビジネス・マシーンズ・コーポレーション Method for converting program code of program operating on multithread to program code with less lock collision, and computer program and computer system thereof
US8972959B2 (en) 2009-04-28 2015-03-03 International Business Machines Corporation Method of converting program code of program running in multi-thread to program code causing less lock collisions, computer program and computer system for the same
JP2015204014A (en) * 2014-04-15 2015-11-16 三菱電機株式会社 Software generation method, software generation device, and software execution device
CN107943470A (en) * 2017-11-23 2018-04-20 四川长虹电器股份有限公司 Cloud management platform code generates the System and method for recycling
CN107943470B (en) * 2017-11-23 2020-10-23 四川长虹电器股份有限公司 System and method for generating and recovering cloud management platform codes

Similar Documents

Publication Publication Date Title
CN110768833B (en) Application arrangement and deployment method and device based on kubernets
JP2874032B2 (en) Software work tools
JP3439337B2 (en) Network management system
JP4701148B2 (en) Failure recovery system and server
US6324576B1 (en) Management interworking unit and a method for producing such a unit
US20070157155A1 (en) System and method for software generation and execution
JPH0512025A (en) Method for realizing interface between object-oriented languages
KR20040051738A (en) XML based network management system and method for configuration management of heterogeneous network devices
JP4336363B2 (en) Business process execution method, business process execution system, and program
WO2024002299A1 (en) Application management method, application subscription method, and related device
CN115248692A (en) Device and method for supporting cloud deployment of multiple deep learning framework models
US7092984B2 (en) Method and apparatus for determining dynamic flow and computer-readable medium storing a program for performing the method
JPH11288367A (en) Automatic program generation system and method
CN112367205B (en) Processing method and scheduling system for HTTP scheduling request
JP2001005652A (en) Inter-program binding method
JPH09160847A (en) Client server-type distribution processing system
JPH11102395A (en) Operation map display device and storage medium
JPH06259302A (en) Data update processing system of decentralized computer
JP2002297402A (en) Digital device, task management method and program therefor
JP2000172462A (en) Schedule data base linked print system
JP2009157847A (en) Program development device, and program development program
Gregory et al. Interclient Communication
CN112988422A (en) Asynchronous message processing method and device, electronic equipment and storage medium
JPH0635869A (en) Application cooperative operation system
CN102567085B (en) Method and device for multi-user cross-task coordination work of printing flow software