JP2010049585A - Automatic program generating apparatus - Google Patents

Automatic program generating apparatus Download PDF

Info

Publication number
JP2010049585A
JP2010049585A JP2008214804A JP2008214804A JP2010049585A JP 2010049585 A JP2010049585 A JP 2010049585A JP 2008214804 A JP2008214804 A JP 2008214804A JP 2008214804 A JP2008214804 A JP 2008214804A JP 2010049585 A JP2010049585 A JP 2010049585A
Authority
JP
Japan
Prior art keywords
rule
learning
code
database
generation device
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
JP2008214804A
Other languages
Japanese (ja)
Inventor
Noriko Matsumoto
紀子 松本
Mayuko Tanaka
真愉子 田中
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 JP2008214804A priority Critical patent/JP2010049585A/en
Publication of JP2010049585A publication Critical patent/JP2010049585A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide an automatic program generating apparatus which eliminates the need for a user to explicitly set a rule change repetitively and also enables an automatic flexible rule change to automatically generate a program more smoothly and efficiently. <P>SOLUTION: The automatic program generating apparatus has a learning means for learning a user's rule change and rule addition and automatically achieves the rule change from the learned result so that the user enables the rule change without setting the rule change explicitly. <P>COPYRIGHT: (C)2010,JPO&INPIT

Description

本発明は、ソフトウェアのモデル記述からのプログラム生成を支援するプログラム自動生成装置に関するものである。   The present invention relates to an automatic program generation device that supports program generation from a software model description.

近年、大規模で複雑なソフトウェア開発において、製品が高機能化しているために、ソフトウェアが複雑化しており、開発工数の増加が問題となっている。   In recent years, in the development of large-scale and complicated software, the product has become highly functional, so the software has become complicated, and an increase in development man-hours has become a problem.

そこで、ソフトウェア設計をUML(Unified Modeling Language)などのモデルで設計することより、ソフトウェアの再利用性を高め、また、モデルからコーディングコードを自動生成することによりソフトウェアの開発効率の向上や品質の確保を行うプログラム自動生成装置がある。(例えば、特許文献1)
特開2007-280138公報
Therefore, by designing the software design with a model such as UML (Unified Modeling Language), software reusability is improved, and coding code is automatically generated from the model to improve software development efficiency and ensure quality. There is an automatic program generation device that performs (For example, Patent Document 1)
JP 2007-280138 A

ユーザが、モデルからプログラムコードに変換するには、どのようなモデルをどのようなコードに変換するかのルールを定める必要がある。   In order for a user to convert from a model to a program code, it is necessary to define a rule as to what model is converted into what code.

従来のプログラム自動生成装置では、モデルからプログラムコードに変換するためのルールは、プログラム自動生成装置に初期設定されているルールが使用される。初期設定と異なるルールを使用する場合には、ユーザが、プログラム自動生成装置に対して、どのようなルールを使うかをその都度、細かに設定する必要があった。また、プログラム自動生成装置で用意されていないルールを新規に設定したい場合にも、明示的にどのようなルールを新規に登録かをその都度行う必要があり、手間がかかっていた。   In a conventional automatic program generation device, a rule that is initially set in the automatic program generation device is used as a rule for converting a model into a program code. When using a rule different from the initial setting, it is necessary for the user to set in detail each rule to be used for the automatic program generation device. In addition, when it is desired to newly set a rule that is not prepared by the automatic program generation device, it is necessary to explicitly perform each time a new rule is registered, which is troublesome.

そこで、本発明は、従来技術の有する未解決の課題に注目してなされたものであって、ユーザがルール設定を意識することなく、ルール変更が自動的に行われ、ユーザのルール設定の手間が少なく、使い勝手の良いプログラム自動生成装置の提供を目的としている。   Therefore, the present invention has been made paying attention to the unresolved problems of the prior art, the rule change is automatically performed without the user being aware of the rule setting, and the user's trouble of rule setting The purpose is to provide an easy-to-use automatic program generator.

上記の目的を達成するために、本発明では、プログラム自動生成装置にて、ユーザのルール変更やルール追加を学習し、学習していくうちに、ユーザがルール変更を行わなくても、自動的に生成ルールを変更することを可能とする。   In order to achieve the above object, in the present invention, the automatic program generation device learns the user's rule change and rule addition and automatically learns the user without changing the rule. It is possible to change the generation rule.

これにより、ユーザは、明示的にルール変更を設定することなく自動的にルール変更が可能となり、よりスムーズに効率よくプログラムを自動生成可能なプログラム自動生成装置の提供をする。   Thus, the user can automatically change the rule without explicitly setting the rule change, and provides an automatic program generation device capable of automatically generating a program more smoothly and efficiently.

本発明によれば、ユーザは、明示的なルール変更やルール追加を毎回行う必要なく自動的にルール変更が可能となり、よりスムーズに効率よくプログラムを自動生成可能なプログラム自動生成装置の提供が可能となる。   According to the present invention, a user can automatically change a rule without having to explicitly change or add a rule every time, and an automatic program generation device capable of automatically generating a program more smoothly and efficiently can be provided. It becomes.

以下、図面を用いて、本発明の実施例を説明する。   Embodiments of the present invention will be described below with reference to the drawings.

本発明の第1の実施例について説明する。   A first embodiment of the present invention will be described.

図1はプログラム自動生成装置100の構成要素を示したものである。   FIG. 1 shows the components of the automatic program generation device 100.

プログラム自動生成装置100は、ユーザがモデルやコードを入力するための入力手段101、ユーザからの入力によりモデルを生成するモデル作成手段102、生成されたモデルからコードを生成するコード生成手段103、生成されたモデルやコードをユーザに表示する出力手段107、コード生成に使用されるルールを記憶しているルールデータベース(図1では、ルールDBと記載)105、ルールデータベース105から適用するルールを選択する適用ルール選択手段104、ユーザ操作から適用ルールや追加ルールの傾向を解析し学習するルール学習手段106、モデルやコードを表示する出力手段107から構成されている。   The automatic program generation apparatus 100 includes an input unit 101 for a user to input a model and a code, a model generation unit 102 for generating a model by an input from the user, a code generation unit 103 for generating a code from the generated model, An output means 107 for displaying the model and code displayed to the user, a rule database (indicated as rule DB in FIG. 1) 105 storing rules used for code generation, and a rule to be applied are selected from the rule database 105 An application rule selection unit 104, a rule learning unit 106 that analyzes and learns the tendency of application rules and additional rules from user operations, and an output unit 107 that displays models and codes are included.

次に、各機能のハードウェア構成を説明する。   Next, the hardware configuration of each function will be described.

入力手段101は、キーボードやボタンなどで構成され、ユーザによる操作の入力が可能である。その他に、マイクやカメラなどの外部装置からの入力を受け取っても良い。   The input unit 101 includes a keyboard, buttons, and the like, and can be input by a user. In addition, an input from an external device such as a microphone or a camera may be received.

モデル作成手段102やコード生成手段103、適用ルール選択手段104、ルール学習手段106、ルールデータベース15は、記録装置により記録される。例えば、ROM(Read Only Memory)やRAM(Random Access Memory)等で構成され、プログラム自動生成装置で扱うデータやソフトウェアなどは全て記憶する。通常、筐体内部に構成されるが、着脱可能なメモリカードや外部より接続された記憶装置等で実現してもよい。   The model creation means 102, the code generation means 103, the application rule selection means 104, the rule learning means 106, and the rule database 15 are recorded by a recording device. For example, it is composed of ROM (Read Only Memory), RAM (Random Access Memory), etc., and stores all data and software handled by the automatic program generation device. Usually, it is configured inside the housing, but it may be realized by a removable memory card or a storage device connected from the outside.

また、モデル作成手段102やコード生成手段103、適用ルール選択手段104、ルール学習手段106などの各機能を実行する手段は、記憶装置に記憶されたプログラムを中央制御装置、CPUが読取り、参照して、動作、処理、実行される。   The means for executing each function, such as the model creation means 102, the code generation means 103, the applied rule selection means 104, and the rule learning means 106, reads the program stored in the storage device and refers to it by the CPU. Operation, processing, and execution.

出力手段107は、例えば、LCD(Liquid Crystal Display)や有機EL等の表示装置で構成され、入力手段より入力された文字や操作、モデル作成手段により作成されたモデルや、コード生成手段により生成されたコードなどを表示する。   The output means 107 is composed of, for example, a display device such as an LCD (Liquid Crystal Display) or an organic EL, and is generated by a character or operation input from the input means, a model created by the model creation means, or a code generation means. Displayed code.

本実施例では、ソフトウェア開発支援装置はマウスやキーボードといった入力部をもつPC(Personal Computer)を想定して説明を行っているが、プログラムが入力可能で、表示可能であれば、携帯電話、 PHS(Personal Handy-phone System)、PDA(Personal Digital Assistant)等、いかなるものであってもかまわない。   In this embodiment, the software development support apparatus is described assuming a PC (Personal Computer) having an input unit such as a mouse and a keyboard. However, if the program can be input and displayed, a mobile phone, PHS, etc. (Personal Handy-phone System), PDA (Personal Digital Assistant), etc., it does not matter.

動作を詳細に説明する。   The operation will be described in detail.

図2は、本実施例におけるモデルからコードを自動生成する際の処理のフローチャートである。   FIG. 2 is a flowchart of a process when a code is automatically generated from a model in this embodiment.

処理が開始される(S201)と入力手段により、ユーザからの入力を受け付ける(S202)。入力手段からのユーザからの操作により、モデル作成手段ではモデルを作成する(S203)。作成したモデルや操作に対する結果などは、出力手段によりユーザに対して表示される(S204)。   When the process is started (S201), the input unit accepts an input from the user (S202). The model creation means creates a model by an operation from the input means by the user (S203). The created model and the result of the operation are displayed to the user by the output means (S204).

モデル作成後、ユーザが、入力手段より、コード自動生成を指示した場合(S205)、適用ルール選択手段は、プログラム自動生成装置が使用可能なルールを蓄積しているルールデータベースの中のルール一覧からどのルールを実際に適用してコードを生成するかを、ルール学習手段から解析結果により選択し、コード生成手段へ送信する(S206)。コード生成手段は、適用ルール選択手段より取得した適用ルールを使用して、モデル作成手段で作成されたモデルをコードに変換し、コードを生成する(S207)。   After the model is created, if the user instructs automatic code generation from the input means (S205), the applied rule selection means is selected from the rule list in the rule database storing the rules that can be used by the automatic program generation device. Which rule is actually applied to generate the code is selected from the rule learning unit based on the analysis result and transmitted to the code generation unit (S206). The code generation unit converts the model created by the model creation unit into a code using the application rule acquired from the application rule selection unit, and generates a code (S207).

生成されたコードは、出力手段により、ユーザに表示され(S208)、処理が終了される(S209)。   The generated code is displayed to the user by the output means (S208), and the process ends (S209).

図3は、ルール学習手段における処理のフローチャートである。   FIG. 3 is a flowchart of processing in the rule learning means.

処理が開始される(S301)と、ルール学習手段は、入力手段からのユーザによる適用ルールの変更を監視し、ユーザによる適用ルールの変更を検出する(S302)。ルール学習手段は内部に学習手段用のデータベースを持ち、検出された変更をデータベースに蓄積する(S303)。そして、学習手段用データベースに蓄積されたルール変更を学習し(S304)、ユーザの使用ルールの傾向を解析し、次にユーザがモデルからコードを生成する際に、どのルールを適用するかを決定し(S305)、処理を終了する(S306)。   When the processing is started (S301), the rule learning unit monitors the change of the application rule by the user from the input unit, and detects the change of the application rule by the user (S302). The rule learning means has a learning means database therein and accumulates detected changes in the database (S303). Then, it learns the rule changes accumulated in the database for learning means (S304), analyzes the tendency of the user's usage rules, and then decides which rule to apply when the user generates code from the model Then, the process is terminated (S306).

図2のS206で記載の適用ルール選択手段がルールデータベースの中のルール一覧からどのルールを実際に適用してコードを生成するかを決定する際、ルール学習手段は、解析して決定した次に使用すべきルールを適用ルール選択手段へ指定する。これにより適用ルール選択手段は、ユーザからの明示的な設定なしに、次に使用すべき設定が選択することが可能となる。   When the application rule selection unit described in S206 of FIG. 2 determines which rule is actually applied from the rule list in the rule database to generate the code, the rule learning unit analyzes and determines The rule to be used is designated to the application rule selection means. Thereby, the application rule selection means can select the setting to be used next without an explicit setting from the user.

図4は、ルール学習手段がルールを学習した例である。   FIG. 4 is an example in which the rule learning means has learned the rules.

int型の変数nameを持つクラスAというモデルがモデル作成手段において作成された例401である。   This is an example 401 in which a model called class A having an int type variable name is created by the model creation means.

ルール学習手段を持たない、あるいはルール学習前のプログラム自動生成装置では、初期状態では、ユーザがルール変更を明示的に設定しない場合、コード生成手段が自動生成するコードはクラスAの定義と、変数nameの定義、変数nameを取得するためのgetName関数、変数nameを設定するためのsetName関数が生成されるルールを使用してコード402が自動生成されるとする。   In the automatic program generation device that does not have rule learning means or before learning rules, in the initial state, if the user does not explicitly set the rule change, the code automatically generated by the code generation means is the definition of class A and the variable Assume that the code 402 is automatically generated using a rule that generates a definition of name, a getName function for acquiring a variable name, and a setName function for setting the variable name.

ルール学習手段を持つプログラム自動生成装置では、それまでにユーザがname取得関数getNameを自動生成しないルールを選択する動作を頻繁に行っている場合には、ユーザが次にモデルからコードを生成する場合にはgetNameを自動生成しないルールを取るべきであることをルール学習手段が学習し、適用ルール選択手段によりgetNameを自動生成しないルールが選択され、コード生成手段に指定するため、ユーザが明示的にルール変更をお子なくてもgetName関数のコードを生成しないコード403が自動的に生成される。   In the automatic program generation device with rule learning means, when the user frequently performs an operation to select a rule that does not automatically generate the name acquisition function getName, the user next generates code from the model. The rule learning means learns that a rule that does not automatically generate getName should be taken, and the rule that does not automatically generate getName is selected by the application rule selecting means and specified to the code generating means. The code 403 that does not generate the code of the getName function even if the rule change is not a child is automatically generated.

ルール学習手段106は、図5に示すように、コード修正検出手段501と学習手段502とで構成される。コード修正検出手段501は、コード生成手段により生成されたコードに対するユーザのコード修正を監視し、コード修正があった場合には、修正箇所の修正前のコードと修正後のコードを抽出し、修正箇所がコード生成手段により自動生成した箇所であれば、ルールデータベースの中のどのルールがどのルールに変更されたかを検出し、学習用データベースに蓄積する。学習手段502は学習のためのデータとして学習用データベースを使用する。   As shown in FIG. 5, the rule learning unit 106 includes a code correction detection unit 501 and a learning unit 502. The code correction detection unit 501 monitors the user's code correction to the code generated by the code generation unit, and if there is a code correction, extracts the code before the correction and the code after the correction, and corrects the code If the part is a part automatically generated by the code generation means, it is detected which rule in the rule database has been changed to which rule, and the rule is stored in the learning database. The learning means 502 uses a learning database as data for learning.

図6は、ルール学習手段が本構成で、ルールを学習した例である。モデル作成手段により、クラスAと、変数nameが定義されている例601である。   FIG. 6 shows an example in which the rule learning means has learned this rule with this configuration. This is an example 601 in which class A and variable name are defined by the model creation means.

このとき、ルール学習手段を持たないプログラム自動生成装置や学習前のプログラム自動生成装置のコード生成手段が自動生成するコードはクラスAの定義と、変数nameの定義、変数nameを取得するためのgetName関数、変数nameを設定するためのsetName関数が生成されるルールを適用ルール選択手段より取得してコード602が自動生成されるとする。   At this time, the code automatically generated by the code generation means of the program automatic generation apparatus that does not have the rule learning means or the program automatic generation apparatus before learning is the class A definition, the definition of the variable name, and the getName for acquiring the variable name. It is assumed that a rule for generating a setName function for setting a function and a variable name is acquired from the application rule selecting unit and a code 602 is automatically generated.

自動生成されたコードに対して、ユーザがgetName関数のコードを削除した場合、コード修正検出手段は修正が行われたことを検知し、コード修正前をコード修正後のコードの差分を抽出し、getName関数はコード自動生成した箇所であることを認識し、ルールデータベースの中のgetName関数を自動生成するルールが自動生成しないというルールに変更されたことを学習手段用データベースに蓄積し、学習する。   When the user deletes the code of the getName function for the automatically generated code, the code correction detection means detects that the correction has been performed, extracts the code difference after the code correction before the code correction, Recognizing that the getName function is a place where the code is automatically generated, the fact that the rule for automatically generating the getName function in the rule database has been changed to a rule that does not automatically generate is accumulated in the learning means database and learning is performed.

学習後であれば、ユーザが次にモデルからコードを生成する場合には、適用ルール選択手段によりgetNameを自動生成しないルールが選択され、コード生成手段に指定するため、getName関数のコードを自動生成しないコード603が生成される。   After learning, the next time the user generates code from the model, the rule that does not automatically generate getName is selected by the application rule selection means, and the code for the getName function is automatically generated for specification to the code generation means. A code 603 that is not to be generated is generated.

または、ルール学習手段106は、図7に示すように、ルール選択抽出手段701と学習手段702とで構成される。ルール選択抽出手段701は、モデルからコードを自動生成する際にユーザが明示的にプログラム自動生成装置の適用ルール選択手段に対して設定した適用ルールを監視し、適用されたルールを取得し、学習用データベースに蓄積する。学習手段702は学習のためのデータとして学習用データベースを使用する。   Alternatively, the rule learning unit 106 includes a rule selection / extraction unit 701 and a learning unit 702 as shown in FIG. The rule selection / extraction means 701 monitors the application rules set by the user with respect to the application rule selection means of the automatic program generation device when automatically generating code from the model, acquires the applied rules, and learns In the database. The learning means 702 uses a learning database as data for learning.

図8は、ルール学習手段が、本構成で、ルールを学習した例である。モデル作成手段により、クラスAと、変数nameが定義されている例801である。   FIG. 8 shows an example in which the rule learning means learns the rule with this configuration. This is an example 801 in which the class A and the variable name are defined by the model creation means.

このとき、ルール学習手段を持たないプログラム自動生成装置や学習前のプログラム自動生成装置のコード生成手段が自動生成するコードはクラスAの定義と、変数nameの定義、変数nameを取得するためのgetName関数、変数nameを設定するためのsetName関数が生成されるルールを適用ルール選択手段より取得してコード802が自動生成されるとする。   At this time, the code automatically generated by the code generation means of the program automatic generation apparatus that does not have the rule learning means or the program automatic generation apparatus before learning is the class A definition, the definition of the variable name, and the getName for acquiring the variable name. It is assumed that a code 802 is automatically generated by acquiring a rule for generating a setName function for setting a function and a variable name from the application rule selection unit.

コード生成手段がコードを自動生成する前に、ユーザがプログラム自動生成装置の適用ルール選択手段に対して、getName関数を自動生成しないルールを明示的に選択した場合、コード生成手段は、適用ルール選択手段により、getName関数のコードを自動生成しない。   If the user explicitly selects a rule that does not automatically generate the getName function for the application rule selection unit of the automatic program generation device before the code generation unit automatically generates the code, the code generation unit selects the application rule. The code of getName function is not automatically generated.

ルール学習手段が、ユーザが頻繁にgetName関数を自動生成しないルールを選択していることを学習すると、学習後は、ユーザが明示的にルール変更することなく、適用ルール選択手段によりgetNameを自動生成しないルールが選択され、コード生成手段に指定するため、getName関数のコードを生成しないコード803が自動生成される。   If the rule learning means learns that the user frequently selects a rule that does not automatically generate the getName function, then after learning, the applied rule selection means automatically generates getName without the user explicitly changing the rule. Since the rule to be not selected is selected and specified in the code generation means, the code 803 that does not generate the code of the getName function is automatically generated.

勿論、上記記載の構成や手法でなくとも、ユーザの適用ルールを学習可能であればどのようにデータを取得しても構わない。   Of course, data may be acquired in any way as long as it is possible to learn application rules of the user, even if the configuration and method described above are not used.

本実施例では、ルール学習手段では、プログラム自動生成装置により用意されたルールデータベースのルール一覧の中から、次にとるルールを学習し、選択することとしたが、どのような理由でルールを選択しているかを学習し、その内容によって、ルールを選択してもかまわない(図9)。   In this embodiment, the rule learning means learns and selects the next rule from the rule list in the rule database prepared by the automatic program generation device. For whatever reason, the rule is selected. You can select the rule depending on the content (Figure 9).

処理が開始される(S901)と、ルール学習手段は、入力手段からのユーザによる適用ルールの変更を監視し、検出する(S902)。次に、検出された変更を学習用データベースに蓄積する(S903)。   When the process is started (S901), the rule learning unit monitors and detects a change in the applied rule by the user from the input unit (S902). Next, the detected changes are accumulated in the learning database (S903).

そして、学習手段用データベースに蓄積されたルール変更を学習し、ユーザの変更ルールの傾向から変更要因を解析、学習する(S904)。次にユーザがモデルからコードを生成する際に、どのルールをどのような理由から適用するかを決定し(S905)、処理を終了する(S906)。   Then, the rule change accumulated in the learning means database is learned, and the change factor is analyzed and learned from the tendency of the change rule of the user (S904). Next, when the user generates a code from the model, which rule is applied for what reason is determined (S905), and the process is terminated (S906).

例えば、それまでにユーザがルール変更する際には、同一ファイル内のもの全てに対して、同じルール変更を行っている場合には、ユーザのルール変更はファイル内の全てのルールを変更したいのであることを学習し、適用範囲にルール変更を反映させたルールを選択するなどである。   For example, when the user changes the rule so far, if the same rule change is made for all the items in the same file, the user's rule change wants to change all the rules in the file. Learning a certain thing and selecting a rule reflecting the rule change in the application range.

また、ルール学習手段は、ユーザがプログラム自動生成装置のルールデータベースのルール一覧の中にないルールを追加した際に、ルールを自動追加し、学習対象に含め、新規追加ルールを適用ルールとして選択してもかまわない(図10)。   Also, the rule learning means automatically adds a rule when the user adds a rule that is not in the rule list of the rule database of the automatic program generation device, includes it as a learning target, and selects a newly added rule as an application rule. It does not matter (Figure 10).

処理が開始される(S1001)と、ルール学習手段は、入力手段からのユーザによる適用ルールの変更を監視し、ユーザによる適用ルールの追加を検出する(S1002)。ルール学習手段は内部に学習手段用のデータベースを持ち、検出された新規ルールをデータベースに蓄積する(S1003)。   When the process is started (S1001), the rule learning unit monitors the change of the application rule by the user from the input unit, and detects the addition of the application rule by the user (S1002). The rule learning means has a database for learning means inside, and accumulates the detected new rules in the database (S1003).

また、検出された新規ルールをルールデータベースへも登録する(S1004)。そして、学習手段用データベースに蓄積されたルール変更を学習し(S1005)、ユーザの使用ルールの傾向を解析し、次にユーザがモデルからコードを生成する際に、どのルールを適用するかを選択し(S1006)、処理を終了する(S1007)。   Also, the detected new rule is registered in the rule database (S1004). Then, learn the rule changes accumulated in the database for learning means (S1005), analyze the tendency of the user's usage rules, and then select which rule to apply when the user generates code from the model (S1006), and the process ends (S1007).

図11は、ルールを学習した例である。   FIG. 11 is an example in which rules are learned.

クラスAがクラスBのオブジェクトを3つ持つと言うモデルがモデル作成手段において作成された例1101である。   This is an example 1101 in which a model that class A has three objects of class B is created by the model creation means.

ルール学習手段を持たない、或いはルールを学習前のプログラム自動生成装置では、初期状態では、ユーザがルール変更を明示的に設定しない場合、コード生成手段が自動生成するコードはクラスAの定義と、クラスAの中で、クラスBの実体を生成するコード1行ずつ3行生成されるとする1102。   In the program automatic generation device that does not have rule learning means or before learning the rules, in the initial state, if the user does not explicitly set the rule change, the code automatically generated by the code generation means is the class A definition, 1102 suppose that three lines of code for generating the substance of class B are generated in class A, one line.

ルール学習手段を持つプログラム自動生成装置では、それまでにユーザが1つのクラスで同じクラスを複数生成する場合には、1行ずつクラス生成のコードを書かずに、for文によるクラス生成を行うというルールデータベースにはないルールを適用してコードを頻繁に修正していることを学習した場合は、ユーザが次にモデルからコードを生成する場合にfor文を使用してコードが生成される1103。   In the automatic program generation device with rule learning means, when the user generates the same class multiple times by one class, the class generation by for statement is performed without writing the class generation code line by line. If the user learns that the code is frequently modified by applying rules that are not in the rule database, the next time the user generates code from the model, the code is generated 1103 using the for statement.

また、本実施例では、プログラム自動生成装置100は、入力手段101、モデル作成手段102、コード生成手段103、出力手段107、ルールデータベース105、適用ルール選択手段104、ルール学習手段106、出力手段107から構成されるものとしたが、ルールデータベース105のルールから、ルール学習手段106が学習し、適用ルール選択手段104がルールを選択する構成であれば、入力手段101、モデル作成手段102、コード生成手段103、出力手段107と同等の手段はいかなる構成であっても構わない。   In this embodiment, the automatic program generation apparatus 100 includes an input unit 101, a model generation unit 102, a code generation unit 103, an output unit 107, a rule database 105, an applied rule selection unit 104, a rule learning unit 106, and an output unit 107. However, if the rule learning unit 106 learns from the rules in the rule database 105 and the application rule selection unit 104 selects a rule, the input unit 101, the model creation unit 102, and the code generation The means equivalent to the means 103 and the output means 107 may have any configuration.

また、モデル作成手段を持たず、入力手段により外部から入力されたモデルを使用しても構わない。   Further, a model input from the outside by the input unit may be used without the model creation unit.

従来のプログラム自動生成装置では、モデルからプログラムコードに変換するためのルールは、プログラム自動生成装置に初期設定されているルールが使用される。初期設定と異なるルールを使用する場合には、ユーザが、プログラム自動生成装置に対して、どのようなルールを使うかをその都度、細かな設定が必要であった。   In a conventional automatic program generation device, a rule that is initially set in the automatic program generation device is used as a rule for converting a model into a program code. When a rule different from the initial setting is used, it is necessary for the user to make detailed settings for each type of rule for the automatic program generation device.

しかし、上述の本発明の実施例により、ユーザは、明示的にルール変更を繰り返し設定することなく、自動的に柔軟にルール変更が可能となり、よりスムーズに効率よくプログラムを自動生成可能なプログラム自動生成装置の提供が可能となる。   However, according to the above-described embodiment of the present invention, the user can automatically and flexibly change the rule without explicitly setting the rule change repeatedly, and can automatically generate the program more smoothly and efficiently. A generation device can be provided.

本発明の第1の実施例におけるプログラム自動生成装置の一構成図である1 is a configuration diagram of an automatic program generation device according to a first embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のモデルからコードへの変換の際の処理のフローチャートを示した図であるFIG. 4 is a diagram illustrating a flowchart of processing when converting from a model to a code in the automatic program generation device according to the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の処理のフローチャートを示した図であるFIG. 5 is a diagram showing a flowchart of processing of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の学習例を示した図であるFIG. 5 is a diagram showing a learning example of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の一構成図を示した図であるFIG. 3 is a diagram showing a configuration diagram of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の学習例を示した図であるFIG. 5 is a diagram showing a learning example of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の一構成図を示した図であるFIG. 3 is a diagram showing a configuration diagram of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の学習例を示した図であるFIG. 5 is a diagram showing a learning example of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の処理のフローチャートを示した図であるFIG. 5 is a diagram showing a flowchart of processing of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の処理のフローチャートを示した図であるFIG. 5 is a diagram showing a flowchart of processing of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention. 本発明の第1の実施例におけるプログラム自動生成装置のルール学習手段の学習例を示した図であるFIG. 5 is a diagram showing a learning example of rule learning means of the automatic program generation device in the first exemplary embodiment of the present invention.

符号の説明Explanation of symbols

100:プログラム自動生成装置
101:入力手段
102:モデル作成手段
103:コード生成手段
104:適用ルール選択手段
105:ルールデータベース
106:ルール学習手段
107:出力手段
401:モデル例
402:生成コード
403:学習後の生成コード
501:コード修正検出手段
502:学習手段
601:モデル例
602:生成コード
603:学習後の生成コード
701:ルール選択抽出手段
702:学習手段
801:モデル例
802:生成コード
803:学習後の生成コード
1001:モデル例
1002:生成コード
1003:学習後の生成コード
100: automatic program generation apparatus 101: input means 102: model creation means 103: code generation means 104: applied rule selection means 105: rule database 106: rule learning means 107: output means 401: model example 402: generated code 403: learning Generated code 501 after: Code correction detecting means 502: Learning means 601: Model example 602: Generated code 603: Generated generated code 701: Rule selection extracting means 702: Learning means 801: Model example 802: Generated code 803: Learning Generated code 1001: Model example 1002: Generated code 1003: Generated code after learning

Claims (8)

モデル、またはソースコードを入力する入力手段と、
当該モデルからソースコードを生成するコード生成手段と、
当該コード生成手段が参照するルールが記憶されるルールデータベースと、
前記コード生成手段が適用するルールを前記ルールデータベースから選択する適用ルール選択手段と、
を有するプログラム自動生成装置において、
モデルの作成、変更から前記適用ルールの変更を検出、学習するルール学習手段を設け、
当該ルール学習手段が学習結果を前記適用ルール選択手段に設定する
ことを特徴とするプログラム自動生成装置。
An input means for inputting a model or source code;
Code generation means for generating source code from the model;
A rule database in which rules referred to by the code generation means are stored;
Application rule selection means for selecting a rule to be applied by the code generation means from the rule database;
In an automatic program generation device having
A rule learning means for detecting and learning the change of the applied rule from the creation and change of the model is provided,
The program automatic generation apparatus, wherein the rule learning unit sets a learning result in the application rule selection unit.
請求項1記載のプログラム自動生成装置において、
当該入力手段への入力によりモデルを作成、変更するモデル作成手段を設けた
ことを特徴とするプログラム生成装置。
In the automatic program generation device according to claim 1,
A program generation apparatus comprising model creation means for creating and changing a model by input to the input means.
請求項1乃至2記載のプログラム自動生成装置において、
前記モデル作成手段で作成されたモデル、または、前記コード生成手段で生成されたソースコードを表示する出力手段を設けた
ことを特徴とするプログラム自動生成装置。
The automatic program generation device according to claim 1 or 2,
An automatic program generation apparatus comprising an output means for displaying a model created by the model creation means or a source code generated by the code generation means.
請求項1乃至3記載のプログラム自動生成装置において、
前記ルール学習手段は、
学習した内容が記憶される学習用データベースと、
コードの修正を監視し、コードの修正から変更された適用ルールを検出するコード修正検出手段と、
前記適用ルールを学習する学習手段と
を有し、
前記コード修正検出手段は、前記コード生成手段によって生成されたコードの修正がコード生成手段による場合は、前記ルールデータベースから変更された適用ルールを検出し、
前記学習手段は当該検出された適用ルールからの学習結果を前記学習用データベースに記憶する
ことを特徴とするプログラム自動生成装置。
In the automatic program generation device according to claims 1 to 3,
The rule learning means is
A learning database that stores the learned content;
Code modification detection means for monitoring code modifications and detecting applied rules changed from code modifications;
Learning means for learning the application rule,
The code correction detection unit detects the changed application rule from the rule database when the code generation unit corrects the code generated by the code generation unit;
The automatic learning apparatus according to claim 1, wherein the learning means stores a learning result from the detected application rule in the learning database.
請求項1乃至3記載のプログラム自動生成装置において、
前記ルール学習手段は、
学習した内容が記憶される学習用データベースと、
前記適用ルール選択手段によって設定された適用ルールを抽出するルール選択抽出手段と、
前記適用ルールを学習する学習手段と
を有し、
前記ルール選択抽出手段は、前記適用ルール選択手段に設定された適用ルールを監視し、設定された適用ルールを抽出し、
前記学習手段は当該抽出された適用ルールからの学習結果を前記学習用データベースに記憶する
ことを特徴とするプログラム自動生成装置。
In the automatic program generation device according to claims 1 to 3,
The rule learning means is
A learning database that stores the learned content;
Rule selection extraction means for extracting application rules set by the application rule selection means;
Learning means for learning the application rule,
The rule selection extraction unit monitors the application rule set in the application rule selection unit, extracts the set application rule,
The automatic learning apparatus characterized in that the learning means stores a learning result from the extracted application rule in the learning database.
請求項1乃至5記載のプログラム自動生成装置において、
前記ルール学習手段は、
前記ルールデータベースのルール一覧の中から変更された適用ルールを学習し、選択する
ことを特徴とするプログラム自動生成装置。
The automatic program generation device according to any one of claims 1 to 5,
The rule learning means is
An automatic program generation device characterized by learning and selecting a changed application rule from a rule list in the rule database.
請求項1乃至5記載のプログラム自動生成装置において、
前記ルール学習手段は、
前記ルールデータベースのルール一覧の中から変更されたルールを検出し、変更された要因を学習する
ことを特徴とするプログラム自動生成装置。
The automatic program generation device according to any one of claims 1 to 5,
The rule learning means is
An automatic program generation device characterized by detecting a changed rule from a rule list of the rule database and learning a changed factor.
請求項1乃至5記載のプログラム自動生成装置において、
前記ルール学習手段は、
前記ルールデータベースのルール一覧の中にないルールをユーザが適用した場合には、適用ルールを前記ルールデータベースに追加し、
当該追加されたルールを学習する
ことを特徴とするプログラム自動生成装置。
The automatic program generation device according to any one of claims 1 to 5,
The rule learning means is
When a user applies a rule that is not in the rule list of the rule database, the application rule is added to the rule database,
A program automatic generation device characterized by learning the added rule.
JP2008214804A 2008-08-25 2008-08-25 Automatic program generating apparatus Pending JP2010049585A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2008214804A JP2010049585A (en) 2008-08-25 2008-08-25 Automatic program generating apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2008214804A JP2010049585A (en) 2008-08-25 2008-08-25 Automatic program generating apparatus

Publications (1)

Publication Number Publication Date
JP2010049585A true JP2010049585A (en) 2010-03-04

Family

ID=42066598

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2008214804A Pending JP2010049585A (en) 2008-08-25 2008-08-25 Automatic program generating apparatus

Country Status (1)

Country Link
JP (1) JP2010049585A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011192143A (en) * 2010-03-16 2011-09-29 Hitachi Solutions Ltd Automatic source code generation system
KR102349344B1 (en) * 2021-01-13 2022-01-11 주식회사 이노리브 Source code automatic generation system using dataized variable and source code automatic generation method thereof

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011192143A (en) * 2010-03-16 2011-09-29 Hitachi Solutions Ltd Automatic source code generation system
KR102349344B1 (en) * 2021-01-13 2022-01-11 주식회사 이노리브 Source code automatic generation system using dataized variable and source code automatic generation method thereof

Similar Documents

Publication Publication Date Title
CN108182069B (en) Program language conversion method, terminal device and computer readable medium
CN107943691B (en) Method and device for automatically generating function test page of intelligent contract
JP5757533B2 (en) Content input for applications via web browser
US20130036196A1 (en) Method and system for publishing template-based content
KR20140126702A (en) Extension activation for related documents
JP2017531849A (en) Character editing method and apparatus for screen display device
CN101957756A (en) System and method for rapidly generating intelligent mobile terminal program
TW201504947A (en) Method for transforming application codes in cross-platform and apparatus thereof
JP4740961B2 (en) Application program multilingual support system and method
US20190295532A1 (en) Remote Generation of Executable Code for a Client Application Based on Natural Language Commands Captured at a Client Device
CN113760276A (en) Method and device for generating page code
CN113268232B (en) Page skin generation method and device and computer readable storage medium
CN116569159A (en) Automatic depiction and extraction of tabular data in portable document format using a graph neural network
JP2010049585A (en) Automatic program generating apparatus
CN113094138A (en) Interface display method and device, electronic equipment and storage medium
CN111142871A (en) Front-end page development system, method, equipment and medium
US20180293211A1 (en) Producing formula representations of mathematical text
JP2008033913A (en) Program development support apparatus for plc
CN114489607A (en) Cross-stack application processing and page rendering method, device, equipment and storage medium
CN112988255B (en) Data processing method, device and computer readable storage medium
JP2006154993A (en) Web screen creating method, program, and server
CN109509467B (en) Code generation method and device
CN110058893B (en) Application control display method and device
CN113934959A (en) Program preview method and device, computer equipment and storage medium
JP2011022962A (en) Information processing terminal