JP7023440B1 - Programming support device, programming support method, and programming support program - Google Patents

Programming support device, programming support method, and programming support program Download PDF

Info

Publication number
JP7023440B1
JP7023440B1 JP2021573281A JP2021573281A JP7023440B1 JP 7023440 B1 JP7023440 B1 JP 7023440B1 JP 2021573281 A JP2021573281 A JP 2021573281A JP 2021573281 A JP2021573281 A JP 2021573281A JP 7023440 B1 JP7023440 B1 JP 7023440B1
Authority
JP
Japan
Prior art keywords
source code
template
setting
difference
programming support
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.)
Active
Application number
JP2021573281A
Other languages
Japanese (ja)
Other versions
JPWO2023281630A1 (en
Inventor
貴靖 松本
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Application granted granted Critical
Publication of JP7023440B1 publication Critical patent/JP7023440B1/en
Publication of JPWO2023281630A1 publication Critical patent/JPWO2023281630A1/ja
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

プログラミング支援装置(1)が、プログラミングソフトウェアに入力された作成途中のソースコードが入力されるソースコード入力部(60)と、第1のソースコードに対応するプログラムが使用される機器の情報である第1の使用機器設定、および機器が用いる機能の情報である第1の使用機能設定が入力される設定入力部(50)と、ソースコード、使用機器設定、および使用機能設定の組み合わせである組み合わせ情報から、ソースコードのテンプレートであるテンプレートソースコードを推論する学習済モデルを用いて、組み合わせ情報に対応するテンプレートソースコードを推論する推論装置(30)と、ソースコード入力部に入力されたソースコードとテンプレートソースコードとの差分を、差分ソースコードとして抽出する差分抽出装置(40)と、差分ソースコードを出力するソースコード出力部(70)と、を備える。The programming support device (1) is information on a source code input unit (60) in which a source code being created input to the programming software is input and a device in which a program corresponding to the first source code is used. A combination of the setting input unit (50) into which the first used device setting and the first used function setting, which is information on the function used by the device, are input, and the source code, the used device setting, and the used function setting. A inference device (30) that infers a template source code corresponding to combination information using a trained model that infers a template source code that is a source code template from information, and a source code input to the source code input unit. It is provided with a difference extraction device (40) that extracts the difference between the template source code and the template source code as a difference source code, and a source code output unit (70) that outputs the difference source code.

Description

本開示は、プログラムの作成を支援するプログラミング支援装置、プログラミング支援方法、およびプログラミング支援プログラムに関する。 The present disclosure relates to programming support devices, programming support methods, and programming support programs that support the creation of programs.

製造装置などが設計または開発される際には、製造装置内に組み込まれるプログラムのソースコードの作成が必要となる。このソースコードの作成時間および修正時間は、製造装置全体の開発工数の多くの部分を占めるので、ソースコードの作成時間および修正時間を減らすことで、開発工数を削減でき、また、製造装置の開発費も削減できる。 When a manufacturing device or the like is designed or developed, it is necessary to create the source code of the program to be incorporated in the manufacturing device. Since the source code creation time and modification time occupy a large part of the development man-hours of the entire manufacturing equipment, the development man-hours can be reduced by reducing the source code creation time and modification time, and the development of the manufacturing equipment can be reduced. Costs can also be reduced.

例えば、特許文献1のプログラミング装置は、プログラムの作成作業および保守作業の効率化を実現し、人為的ミスを排除するために、プログラムを作成する際に、プログラムのアルゴリズム、シーケンス等を入力することによって自動でプログラムまたはドキュメントを出力している。 For example, the programming device of Patent Document 1 realizes efficiency of program creation work and maintenance work, and inputs a program algorithm, sequence, etc. when creating a program in order to eliminate human error. Automatically outputs a program or document.

特開平9-73306号公報Japanese Unexamined Patent Publication No. 9-73306

しかしながら、上記特許文献1の技術では、プログラムのソースコードを作成する際には全ての仕様のアルゴリズム、シーケンス等を抜けなく入力しなければならないので、短時間で所望のソースコードを作成することは困難である。 However, in the technique of Patent Document 1, when creating the source code of the program, it is necessary to input all the algorithms, sequences, etc. of all specifications, so that it is not possible to create the desired source code in a short time. Have difficulty.

本開示は、上記に鑑みてなされたものであって、短時間で所望のソースコードを容易に作成することができるプログラミング支援装置を得ることを目的とする。 The present disclosure has been made in view of the above, and an object of the present invention is to obtain a programming support device capable of easily creating a desired source code in a short time.

上述した課題を解決し、目的を達成するために、本開示のプログラミング支援装置は、プログラミングソフトウェアに入力された作成途中のソースコードである第1のソースコードが入力されるソースコード入力部と、第1のソースコードに対応するプログラムが使用される機器の情報である第1の使用機器設定、および機器が用いる機能の情報である第1の使用機能設定が入力される設定入力部とを備える。また、本開示のプログラミング支援装置は、第1のソースコード、第1の使用機器設定、および第1の使用機能設定の組み合わせである組み合わせ情報から、第1のソースコードのテンプレートであるテンプレートソースコードを推論する学習済モデルを用いて、組み合わせ情報に対応するテンプレートソースコードを推論する推論装置を備える。また、本開示のプログラミング支援装置は、ソースコード入力部に入力された第1のソースコードと、推論装置が推論したテンプレートソースコードとの差分を、差分ソースコードとして抽出する差分抽出装置と、差分ソースコードを出力するソースコード出力部とを備える。 In order to solve the above-mentioned problems and achieve the object, the programming support device of the present disclosure includes a source code input unit in which a first source code, which is a source code in the process of being created, is input to the programming software. It includes a first device setting that is information on the device in which the program corresponding to the first source code is used, and a setting input unit in which the first function setting that is information on the function used by the device is input. .. Further, the programming support device of the present disclosure is a template source code which is a template of the first source code from the combination information which is a combination of the first source code, the first device used setting, and the first used function setting. It is provided with an inference device that infers the template source code corresponding to the combination information by using the trained model that infers. Further, the programming support device of the present disclosure includes a difference extraction device that extracts the difference between the first source code input to the source code input unit and the template source code inferred by the inference device as a difference source code, and a difference. It is equipped with a source code output unit that outputs source code.

本開示にかかるプログラミング支援装置は、短時間で所望のソースコードを容易に作成することができるという効果を奏する。 The programming support device according to the present disclosure has an effect that a desired source code can be easily created in a short time.

実施の形態1にかかるプログラミング支援装置の構成を示す図The figure which shows the structure of the programming support apparatus which concerns on Embodiment 1. 実施の形態1にかかる学習装置の構成を示す図The figure which shows the structure of the learning apparatus which concerns on Embodiment 1. 実施の形態1にかかる学習装置による学習処理の処理手順を示すフローチャートA flowchart showing a processing procedure of learning processing by the learning device according to the first embodiment. 実施の形態1にかかる推論装置の構成を示す図The figure which shows the structure of the inference apparatus which concerns on Embodiment 1. 実施の形態1にかかる推論装置による推論処理の処理手順を示すフローチャートA flowchart showing a processing procedure of inference processing by the inference device according to the first embodiment. 実施の形態1にかかるプログラミング支援装置によるプログラミング支援処理の処理手順を示すフローチャートA flowchart showing a processing procedure of programming support processing by the programming support device according to the first embodiment. 実施の形態1にかかるプログラミング支援装置を実現するハードウェア構成例を示す図The figure which shows the hardware configuration example which realizes the programming support apparatus which concerns on Embodiment 1.

以下に、本開示の実施の形態にかかるプログラミング支援装置、プログラミング支援方法、およびプログラミング支援プログラムを図面に基づいて詳細に説明する。 Hereinafter, the programming support device, the programming support method, and the programming support program according to the embodiment of the present disclosure will be described in detail with reference to the drawings.

実施の形態1.
図1は、実施の形態1にかかるプログラミング支援装置の構成を示す図である。プログラミング支援装置1は、ユーザがプログラミングソフトウェアであるエンジニアリングツールを用いてプログラミングを実行する際のプログラミングを支援するコンピュータである。
Embodiment 1.
FIG. 1 is a diagram showing a configuration of a programming support device according to the first embodiment. The programming support device 1 is a computer that supports programming when a user executes programming using an engineering tool that is programming software.

プログラミング支援装置1は、AI(人工知能、Artificial Intelligence)を活用し、ソースコードと、使用機器設定と、使用機能設定とから、プログラミングソフトウェアに入力されたソースコードを補完するための情報を提供する。 The programming support device 1 utilizes AI (Artificial Intelligence) to provide information for complementing the source code input to the programming software from the source code, the device used setting, and the function setting used. ..

使用機器設定は、プログラムが使用される機器の情報である。使用機能設定は、プログラムが使用される機器が用いる機能の情報である。ソースコードに対応するプログラムが使用される機器は、例えば、PLC(Programmable Logic Controller、プログラマブルロジックコントローラ)である。この場合、ユーザが用いるプログラミングソフトウェアは、PLC用のプログラムを作成するためのプログラミングソフトウェアである。 The device used setting is information on the device on which the program is used. The function setting used is information on the function used by the device in which the program is used. The device in which the program corresponding to the source code is used is, for example, a PLC (Programmable Logic Controller). In this case, the programming software used by the user is programming software for creating a program for PLC.

プログラムが使用される機器がPLCである場合、使用機器設定の例は、CPU(Central Processing Unit)ユニット、電源ユニット、入出力ユニット、アナログユニット、通信ユニットなどのPLCが用いるユニット名である。プログラムが使用される機器がPLCである場合、使用機能設定の例は、RS485通信、パルス出力などの機能名である。 When the device in which the program is used is a PLC, an example of the device setting used is a unit name used by the PLC such as a CPU (Central Processing Unit) unit, a power supply unit, an input / output unit, an analog unit, and a communication unit. When the device in which the program is used is PLC, an example of the function setting to be used is a function name such as RS485 communication and pulse output.

実施の形態1のプログラミング支援装置1は、例えば、教師なし学習といった機械学習によって作成された学習済モデルを用いて、プログラミングソフトウェアに入力された作成途中のソースコードを補完するソースコード(後述する差分ソースコード)を抽出し、ユーザに提示する。プログラミングソフトウェアに入力された作成途中のソースコードが第1のソースコードである。 The programming support device 1 of the first embodiment uses a trained model created by machine learning such as unsupervised learning, and uses a source code that complements the source code in the process of being created input to the programming software (difference described later). Source code) is extracted and presented to the user. The source code in the process of being created input to the programming software is the first source code.

プログラミング支援装置1が受け付ける作成途中のソースコードは、新規作成途中のソースコードであってもよいし、変更途中のソースコードであってもよい。実施の形態1では、プログラミング支援装置1が受け付ける作成途中のソースコードが、新規作成途中のソースコードである場合について説明する。 The source code in the process of being created received by the programming support device 1 may be a source code in the process of being newly created or a source code in the process of being changed. In the first embodiment, a case where the source code in the process of being created received by the programming support device 1 is the source code in the process of being newly created will be described.

プログラミング支援装置1は、ソースコード入力部60と、設定入力部50と、推論装置30と、差分抽出装置40と、ソースコード出力部70とを備えている。また、プログラミング支援装置1は、表示装置2に接続されている。 The programming support device 1 includes a source code input unit 60, a setting input unit 50, an inference device 30, a difference extraction device 40, and a source code output unit 70. Further, the programming support device 1 is connected to the display device 2.

ソースコード入力部60は、プログラミングソフトウェアに入力された作成途中のソースコード(第1のソースコード)を受付けて推論装置30、差分抽出装置40、およびソースコード出力部70に出力する。プログラミングソフトウェアは、ユーザによる操作に従ってソースコードを作成するソフトウェアである。プログラミングソフトウェアは、プログラミング支援装置1内でプログラミングを実行してもよいし、プログラミング支援装置1とは異なる別の装置(ソースコード作成装置)内でプログラミングを実行してもよい。ソースコード作成装置は、ユーザによる操作に従ってソースコードを作成するコンピュータである。プログラミングソフトウェアに入力された作成途中のソースコードは、設定入力部50に入力される。 The source code input unit 60 receives the source code (first source code) in the process of being created input to the programming software and outputs it to the inference device 30, the difference extraction device 40, and the source code output unit 70. Programming software is software that creates source code according to user operations. The programming software may execute programming in the programming support device 1, or may execute programming in another device (source code creation device) different from the programming support device 1. The source code creation device is a computer that creates source code according to the operation by the user. The source code in the process of being created input to the programming software is input to the setting input unit 50.

設定入力部50は、ユーザによって入力される、使用機能設定および使用機器設定を受付けて推論装置30に出力する。設定入力部50が受け付ける使用機能設定および使用機器設定は、ソースコード入力部60が受け付けるソースコードに対応する使用機能設定および使用機器設定である。 The setting input unit 50 receives the used function setting and the used device setting input by the user and outputs them to the inference device 30. The used function setting and the used device setting accepted by the setting input unit 50 are the used function setting and the used device setting corresponding to the source code received by the source code input unit 60.

なお、使用機能設定および使用機器設定は、外部装置から設定入力部50に入力されてもよい。実施の形態1における使用機能設定が第1の使用機能設定であり、実施の形態1における使用機器設定が第1の使用機器設定である。すなわち、プログラミングソフトウェアに入力された作成途中のソースコードに対応する使用機能設定が第1の使用機能設定であり、既存のソースコードに対応する使用機器設定が第1の使用機器設定である。 The used function setting and the used device setting may be input to the setting input unit 50 from an external device. The used function setting in the first embodiment is the first used function setting, and the used device setting in the first embodiment is the first used device setting. That is, the used function setting corresponding to the source code being created input to the programming software is the first used function setting, and the used device setting corresponding to the existing source code is the first used device setting.

推論装置30は、設定入力部50から送られてくる使用機能設定および使用機器設定と、ソースコード入力部60から送られてくるソースコードとの組み合わせである組み合わせ情報に基づいて、ソースコード入力部60から送られてくるソースコードのテンプレートソースコードを推論する。具体的には、推論装置30は、組み合わせ情報に基づいて、プログラムグループ番号を推論し、プログラムグループ番号に対応するテンプレートソースコードを抽出する。プログラムグループ番号は、ソースコードに対応するプログラムが属するグループの番号である。 The inference device 30 is a source code input unit based on combination information which is a combination of the function setting and the equipment setting used from the setting input unit 50 and the source code sent from the source code input unit 60. Source code template sent from 60 Infer the source code. Specifically, the inference device 30 infers the program group number based on the combination information, and extracts the template source code corresponding to the program group number. The program group number is the number of the group to which the program corresponding to the source code belongs.

例えば、ユーザによって作成されるプログラムには、ソケット通信のプログラム、RS485通信のプログラム、パルス出力のプログラムなどがある。また、ソケット通信のプログラムには、送信プログラム、受信プログラム、再送信プログラムなどがある。さらに、ソケット通信のプログラムには、ビットデータ送信、ワードデータ送信、複数データ送信などがある。推論装置30は、これらのビットデータ送信、ワードデータ送信、複数データ送信などの最下層のプログラムのソースコードに対してプログラムグループ番号を推論する。 For example, the program created by the user includes a socket communication program, an RS485 communication program, a pulse output program, and the like. Further, the socket communication program includes a transmission program, a reception program, a retransmission program, and the like. Further, socket communication programs include bit data transmission, word data transmission, and multiple data transmission. The inference device 30 infers the program group number for the source code of the lowest layer program such as bit data transmission, word data transmission, and multiple data transmission.

テンプレートソースコードは、ソースコードのテンプレートである。テンプレートソースコードは、使用機能設定および使用機器設定が用いられる場合に要求されるソースコードである。テンプレートソースコードは、例えば、後述するクラスタの中心Vjのソースコードである。 Template source code is a template of source code. The template source code is the source code required when the function setting and the device setting used are used. The template source code is, for example, the source code of the central Vj of the cluster described later.

推論装置30は、組み合わせ情報からプログラムグループ番号を推定する学習済モデルを用いて、組み合わせ情報に対応するプログラムグループ番号を推定し、プログラムグループ番号に対応するテンプレートソースコードを読み出す。これにより、推論装置30は、学習済モデルを用いて、組み合わせ情報に対応するテンプレートソースコードを推論する。 The inference device 30 estimates the program group number corresponding to the combination information by using the trained model that estimates the program group number from the combination information, and reads out the template source code corresponding to the program group number. As a result, the inference device 30 infers the template source code corresponding to the combination information using the trained model.

差分抽出装置40は、推論装置30から送られてくるテンプレートソースコードと、ソースコード入力部60から送られてくるソースコードとを比較し、これらの差分を差分ソースコードとしてソースコード出力部70に出力する。差分ソースコードは、ユーザによる作成途中のプログラムのソースコードを補完するソースコードである。換言すると、差分ソースコードは、使用機能設定および使用機器設定が用いられる場合に要求されるソースコードのうち、ソースコード入力部60が受け付けていないソースコードである。 The difference extraction device 40 compares the template source code sent from the inference device 30 with the source code sent from the source code input unit 60, and uses these differences as the difference source code in the source code output unit 70. Output. The difference source code is source code that complements the source code of the program being created by the user. In other words, the difference source code is a source code that is not accepted by the source code input unit 60 among the source codes required when the function setting and the device setting used are used.

ソースコード出力部70は、ソースコード入力部60から送られてくるソースコードと、差分抽出装置40から送られてくる差分ソースコードとを液晶モニタなどの表示装置2に出力する。ソースコード出力部70は、表示装置2に対し、ソースコードと、差分ソースコードとを同一画面上に表示させる。 The source code output unit 70 outputs the source code sent from the source code input unit 60 and the difference source code sent from the difference extraction device 40 to a display device 2 such as a liquid crystal monitor. The source code output unit 70 causes the display device 2 to display the source code and the difference source code on the same screen.

このように、プログラミング支援装置1は、機械学習によって作成された学習済モデルを用いて、作成途中のプログラムのソースコード、使用機能設定、および使用機器設定からテンプレートソースコードを推論する。そして、プログラミング支援装置1は、推論したテンプレートソースコードに基づいて差分ソースコードを抽出し、表示装置2に表示させる。これにより、プログラミング支援装置1は、作成途中のプログラムのソースコードを補完する差分ソースコードをユーザに提示する。プログラミング支援装置1は、差分ソースコードをユーザに提示することで、ユーザによるソースコードの作成時間を短縮させることができ、またプログラムが変更される際のソースコードの修正洩れを防止できる。 In this way, the programming support device 1 infers the template source code from the source code of the program being created, the function setting used, and the device setting used, using the trained model created by machine learning. Then, the programming support device 1 extracts the difference source code based on the inferred template source code and displays it on the display device 2. As a result, the programming support device 1 presents to the user a difference source code that complements the source code of the program being created. By presenting the difference source code to the user, the programming support device 1 can shorten the time for the user to create the source code, and can prevent the source code from being overcorrected when the program is changed.

プログラミング支援装置1が用いる学習済モデルは、後述する学習装置による学習処理によって作成される。また、プログラミング支援装置1は、推論装置30を備えており、推論装置30が学習済モデルを用いてプログラムグループ番号を推論する。ここで、学習装置によるプログラムグループ番号の学習処理と、推論装置30によるプログラムグループ番号の推論処理について説明する。 The trained model used by the programming support device 1 is created by a learning process by a learning device described later. Further, the programming support device 1 includes an inference device 30, and the inference device 30 infers the program group number using the trained model. Here, the learning process of the program group number by the learning device and the inference process of the program group number by the inference device 30 will be described.

<学習フェーズ>
図2は、実施の形態1にかかる学習装置の構成を示す図である。学習装置10は、データ取得部11と、モデル生成部12と、テンプレートソースコード生成部13とを備えている。モデル生成部12は、学習済モデル記憶部21に接続されており、テンプレートソースコード生成部13は、テンプレートソースコード記憶部22に接続されている。
<Learning phase>
FIG. 2 is a diagram showing a configuration of a learning device according to the first embodiment. The learning device 10 includes a data acquisition unit 11, a model generation unit 12, and a template source code generation unit 13. The model generation unit 12 is connected to the trained model storage unit 21, and the template source code generation unit 13 is connected to the template source code storage unit 22.

データ取得部11は、ソースコード、使用機能設定、および使用機器設定を学習用データとして取得し、モデル生成部12に出力する。 The data acquisition unit 11 acquires the source code, the function setting used, and the equipment setting used as learning data, and outputs the data to the model generation unit 12.

モデル生成部12は、データ取得部11から出力されるソースコード、使用機能設定、および使用機器設定の組み合わせ(組み合わせ情報)に基づいて作成される学習用データに基づいて、プログラムグループ番号を学習する。換言すると、モデル生成部12は、学習用データに基づいて、ソースコードを、ソースコードに対応するプログラムが属するプログラムグループに分類することで、ソースコードに対応するプログラムグループ番号を学習する。すなわち、モデル生成部12は、ソースコード、使用機能設定、および使用機器設定からプログラムグループ番号を推論する学習済モデルを生成する。学習用データは、ソースコードと、使用機能設定と、使用機器設定とが互いに関連付けされたデータである。 The model generation unit 12 learns the program group number based on the learning data created based on the combination (combination information) of the source code, the function setting used, and the device used setting output from the data acquisition unit 11. .. In other words, the model generation unit 12 learns the program group number corresponding to the source code by classifying the source code into the program group to which the program corresponding to the source code belongs based on the learning data. That is, the model generation unit 12 generates a trained model that infers the program group number from the source code, the function setting used, and the device setting used. The learning data is data in which the source code, the function setting used, and the device setting used are associated with each other.

モデル生成部12は、学習アルゴリズムとして、教師あり学習、教師なし学習、強化学習等の公知のアルゴリズムを用いることができる。一例として、モデル生成部12が教師なし学習であるK平均法(クラスタリング)を適用した場合について説明する。教師なし学習とは、結果(ラベル)を含まない学習用データを学習装置10などの学習装置に与えることで、それらの学習用データにある特徴を学習する手法をいう。 As the learning algorithm, the model generation unit 12 can use known algorithms such as supervised learning, unsupervised learning, and reinforcement learning. As an example, a case where the model generation unit 12 applies the K averaging method (clustering), which is learning without supervision, will be described. Unsupervised learning refers to a method of learning features in the learning data by giving learning data that does not include a result (label) to a learning device such as the learning device 10.

モデル生成部12は、例えば、K平均法によるグループ分け手法に従って、いわゆる教師なし学習により、プログラムグループ番号を学習する。K平均法は、非階層型クラスタリングのアルゴリズムであり、クラスタの平均を用い、与えられたクラスタ数をk個に分類する手法である。 The model generation unit 12 learns the program group number by so-called unsupervised learning according to the grouping method by the K-means method, for example. The K-means clustering method is a non-hierarchical clustering algorithm, and is a method of classifying a given number of clusters into k using the average of clusters.

具体的には、K平均法は以下のような流れで処理される。まず、モデル生成部12は、各データxi(ソースコード)に対してランダムにクラスタを割り振る。次いで、モデル生成部12は、割り振ったデータをもとに各クラスタの中心Vjを計算する。次いで、モデル生成部12は、各xiと各Vjとの距離を求め、xiを最も近い中心Vjのクラスタに割り当て直す。そして、上記の処理で全てのxiのクラスタの割り当てが変化しなかった場合、あるいは変化量が事前に設定した一定の閾値を下回った場合に、モデル生成部12は、収束したと判断してクラスタリングの処理を終了する。 Specifically, the K-means method is processed in the following flow. First, the model generation unit 12 randomly allocates clusters for each data xi (source code). Next, the model generation unit 12 calculates the center Vj of each cluster based on the allocated data. Next, the model generation unit 12 obtains the distance between each xi and each Vj, and reassigns the xi to the cluster of the nearest central Vj. Then, when the allocation of all xi clusters does not change in the above processing, or when the amount of change falls below a predetermined threshold value, the model generation unit 12 determines that the clusters have converged and clusters. Ends the processing of.

実施の形態1のモデル生成部12は、データ取得部11によって取得されたソースコード、使用機能設定、および使用機器設定の組み合わせに基づいて作成される学習用データに従って、いわゆる教師なし学習により、プログラムグループ番号を学習する。 The model generation unit 12 of the first embodiment is programmed by so-called unsupervised learning according to the learning data created based on the combination of the source code, the function setting used, and the equipment setting used acquired by the data acquisition unit 11. Learn the group number.

モデル生成部12は、以上のような学習を実行することで学習済モデルを生成し、生成した学習済モデルを学習済モデル記憶部21に出力する。モデル生成部12は、学習済モデルを生成するたびに、学習済モデル記憶部21が記憶している学習済モデルを最新の学習済モデルで更新する。 The model generation unit 12 generates a trained model by executing the above learning, and outputs the generated trained model to the trained model storage unit 21. Each time the model generation unit 12 generates a trained model, the model generation unit 12 updates the trained model stored in the trained model storage unit 21 with the latest trained model.

テンプレートソースコード生成部13は、モデル生成部12から出力される全てのプログラムグループ番号と、各プログラムグループ番号に分類されたクラスタの中心のソースコードとの組み合わせに基づいて、テンプレートソースコードを生成する。テンプレートソースコード生成部13は、例えば、プログラムグループ番号に分類されたクラスタの中心のソースコードを、テンプレートソースコードに設定する。テンプレートソースコード生成部13は、プログラムグループ番号毎にテンプレートソースコードを生成する。 The template source code generation unit 13 generates the template source code based on the combination of all the program group numbers output from the model generation unit 12 and the source code at the center of the cluster classified into each program group number. .. The template source code generation unit 13 sets, for example, the source code at the center of the cluster classified by the program group number in the template source code. The template source code generation unit 13 generates a template source code for each program group number.

テンプレートソースコード生成部13は、プログラムグループ番号に対応付けされたテンプレートソースコードを、テンプレートソースコード記憶部22に出力する。テンプレートソースコード生成部13は、テンプレートソースコードを生成するたびに、テンプレートソースコード記憶部22が記憶しているテンプレートソースコードを最新のテンプレートソースコードで更新する。すなわち、テンプレートソースコード生成部13は、プログラムグループ番号毎に、最新のテンプレートソースコードをテンプレートソースコード記憶部22に記憶させる。 The template source code generation unit 13 outputs the template source code associated with the program group number to the template source code storage unit 22. Each time the template source code generation unit 13 generates the template source code, the template source code stored in the template source code storage unit 22 is updated with the latest template source code. That is, the template source code generation unit 13 stores the latest template source code in the template source code storage unit 22 for each program group number.

学習済モデル記憶部21は、モデル生成部12から出力された学習済モデルを記憶する。テンプレートソースコード記憶部22は、テンプレートソースコード生成部13から出力されたテンプレートソースコードとプログラムグループ番号との対応関係を記憶する。 The trained model storage unit 21 stores the trained model output from the model generation unit 12. The template source code storage unit 22 stores the correspondence between the template source code output from the template source code generation unit 13 and the program group number.

つぎに、図3を用いて、学習装置10による学習処理について説明する。図3は、実施の形態1にかかる学習装置による学習処理の処理手順を示すフローチャートである。 Next, the learning process by the learning device 10 will be described with reference to FIG. FIG. 3 is a flowchart showing a processing procedure of learning processing by the learning device according to the first embodiment.

データ取得部11は、学習用のデータを取得する(ステップS10)。具体的には、データ取得部11は、ソースコード、使用機能設定、および使用機器設定を取得する。データ取得部11へは、例えば、ソースコードを作成するプログラミングソフトウェアから、ソースコード、使用機能設定、および使用機器設定が入力される。データ取得部11が取得するソースコードは、例えば、これまでに作成された完成品としてのソースコードである。 The data acquisition unit 11 acquires learning data (step S10). Specifically, the data acquisition unit 11 acquires the source code, the function used setting, and the device used device setting. For example, the source code, the function setting, and the device setting used are input to the data acquisition unit 11 from the programming software that creates the source code. The source code acquired by the data acquisition unit 11 is, for example, the source code as a finished product created so far.

なお、ここではデータ取得部11は、ソースコード、使用機能設定、および使用機器設定を同時に取得するものとしたが、異なるタイミングで取得してもよい。すなわち、データ取得部11へは、ソースコード、使用機能設定、および使用機器設定が関連づけて入力されればよく、データ取得部11は、ソースコード、使用機能設定、および使用機器設定のデータをそれぞれ別々のタイミングで取得してもよい。 Although the data acquisition unit 11 is supposed to acquire the source code, the function setting used, and the device setting used at the same time here, they may be acquired at different timings. That is, the source code, the function setting used, and the device used setting may be input to the data acquisition unit 11 in association with each other, and the data acquisition unit 11 inputs the data of the source code, the function setting used, and the device setting used, respectively. It may be acquired at different timings.

モデル生成部12は、学習処理を実行する(ステップS20)。具体的には、モデル生成部12は、データ取得部11によって取得されたソースコード、使用機能設定、および使用機器設定の組み合わせに基づいて作成される学習用データに従って、いわゆる教師なし学習により、プログラムグループ番号を学習し、学習済モデルを生成する。学習済モデル記憶部21は、モデル生成部12が生成した学習済モデルを記憶する(ステップS30)。 The model generation unit 12 executes the learning process (step S20). Specifically, the model generation unit 12 programs by so-called unsupervised learning according to the learning data created based on the combination of the source code, the function setting used, and the device setting used acquired by the data acquisition unit 11. Train the group number and generate a trained model. The trained model storage unit 21 stores the trained model generated by the model generation unit 12 (step S30).

テンプレートソースコード生成部13は、モデル生成部12から出力される全てのプログラムグループ番号と、各プログラムグループ番号に分類されたクラスタの中心のソースコードとの組み合わせに基づいて、テンプレートソースコードを生成する。テンプレートソースコード記憶部22は、テンプレートソースコード生成部13から出力されたテンプレートソースコードを記憶する。ここまでが学習フェーズである。 The template source code generation unit 13 generates the template source code based on the combination of all the program group numbers output from the model generation unit 12 and the source code at the center of the cluster classified into each program group number. .. The template source code storage unit 22 stores the template source code output from the template source code generation unit 13. This is the learning phase.

<活用フェーズ>
図4は、実施の形態1にかかる推論装置の構成を示す図である。推論装置30は、データ取得部31と、推論部32と、テンプレートソースコード取得部33とを備えている。
<Utilization phase>
FIG. 4 is a diagram showing a configuration of an inference device according to the first embodiment. The inference device 30 includes a data acquisition unit 31, an inference unit 32, and a template source code acquisition unit 33.

データ取得部31は、ソースコード、使用機能設定、および使用機器設定を取得する。データ取得部31へは、ソースコード入力部60からソースコードが入力され、設定入力部50から使用機能設定および使用機器設定が入力される。 The data acquisition unit 31 acquires the source code, the function setting used, and the device setting used. The source code is input to the data acquisition unit 31 from the source code input unit 60, and the function setting and the equipment setting to be used are input from the setting input unit 50.

推論部32は、学習済モデル記憶部21が記憶している学習済モデルを用いて、プログラムグループ番号を推論する。すなわち、推論部32は、データ取得部31が取得したデータ(推論用のデータ)を学習済モデルに入力し、プログラムグループ番号を推論する。具体的には、推論部32は、データ取得部31が取得したソースコード、使用機能設定、および使用機器設定を学習済モデルに入力することで、ソースコード、使用機能設定、および使用機器設定が何れのクラスタに属するかを推論する。推論部32は、推論結果のデータをプログラムグループ番号としてテンプレートソースコード取得部33に出力する。 The inference unit 32 infers the program group number using the trained model stored in the trained model storage unit 21. That is, the inference unit 32 inputs the data (data for inference) acquired by the data acquisition unit 31 into the trained model, and infers the program group number. Specifically, the inference unit 32 inputs the source code, the used function setting, and the used device setting acquired by the data acquisition unit 31 into the trained model, so that the source code, the used function setting, and the used device setting can be obtained. Infer which cluster it belongs to. The inference unit 32 outputs the inference result data as a program group number to the template source code acquisition unit 33.

テンプレートソースコード取得部33は、推論部32が推論したプログラムグループ番号を用いて、テンプレートソースコード記憶部22からテンプレートソースコードを取得し、テンプレートソースコードを差分抽出装置40に出力する。すなわち、テンプレートソースコード取得部33は、プログラムグループ番号に対応付けされているテンプレートソースコードを、テンプレートソースコード記憶部22から読み出す。 The template source code acquisition unit 33 acquires the template source code from the template source code storage unit 22 using the program group number inferred by the inference unit 32, and outputs the template source code to the difference extraction device 40. That is, the template source code acquisition unit 33 reads the template source code associated with the program group number from the template source code storage unit 22.

なお、実施の形態1では、推論部32が、学習装置10のモデル生成部12が学習した学習済モデルを用いてプログラムグループ番号を推論する場合について説明したが、推論部32は、他の学習装置が作成した学習済モデルを取得し、この学習済モデルに基づいてプログラムグループ番号を推論してもよい。 In the first embodiment, the case where the inference unit 32 infers the program group number using the learned model learned by the model generation unit 12 of the learning device 10 has been described, but the inference unit 32 has another learning. A trained model created by the device may be acquired and the program group number may be inferred based on the trained model.

このようにして、推論装置30は、ソースコード、使用機能設定、および使用機器設定に基づいて得られたプログラムグループ番号を用いて取得したテンプレートソースコードを差分抽出装置40に対して出力する。 In this way, the inference device 30 outputs the template source code acquired using the program group number obtained based on the source code, the function setting used, and the device setting used to the difference extraction device 40.

つぎに、図5を用いて、推論装置30によるテンプレートソースコードの推論処理について説明する。図5は、実施の形態1にかかる推論装置による推論処理の処理手順を示すフローチャートである。 Next, the inference processing of the template source code by the inference device 30 will be described with reference to FIG. FIG. 5 is a flowchart showing a processing procedure of inference processing by the inference device according to the first embodiment.

データ取得部31は、テンプレートソースコードを推論するためのデータを取得する(ステップS110)。具体的には、データ取得部31は、ソースコード、使用機能設定、および使用機器設定を取得する。データ取得部31が取得するソースコードは、ユーザの作成途中のプログラムに対応するソースコードである。 The data acquisition unit 31 acquires data for inferring the template source code (step S110). Specifically, the data acquisition unit 31 acquires the source code, the function used setting, and the device used device setting. The source code acquired by the data acquisition unit 31 is the source code corresponding to the program being created by the user.

推論部32は、学習済モデル記憶部21が記憶している学習済モデルを用いて、プログラムグループ番号を推論する。すなわち、推論部32は、データ取得部31が取得したデータを学習済モデルに入力し(ステップS120)、学習済モデルによってプログラムグループ番号を推論する。推論部32は、推論結果のデータをプログラムグループ番号として出力する(ステップS130)。 The inference unit 32 infers the program group number using the trained model stored in the trained model storage unit 21. That is, the inference unit 32 inputs the data acquired by the data acquisition unit 31 into the trained model (step S120), and infers the program group number by the trained model. The inference unit 32 outputs the inference result data as a program group number (step S130).

テンプレートソースコード取得部33は、推論部32が推論したプログラムグループ番号を用いて、テンプレートソースコード記憶部22からテンプレートソースコードを取得し、テンプレートソースコードを差分抽出装置40に出力する(ステップS140)。ここまでが推論フェーズである。 The template source code acquisition unit 33 acquires the template source code from the template source code storage unit 22 using the program group number inferred by the inference unit 32, and outputs the template source code to the difference extraction device 40 (step S140). .. This is the inference phase.

つぎに、図6を用いて実施の形態1にかかるプログラミング支援装置1の動作について説明する。図6は、実施の形態1にかかるプログラミング支援装置によるプログラミング支援処理の処理手順を示すフローチャートである。 Next, the operation of the programming support device 1 according to the first embodiment will be described with reference to FIG. FIG. 6 is a flowchart showing a processing procedure of programming support processing by the programming support device according to the first embodiment.

プログラミング支援装置1は、テンプレートソースコードを推論するためのデータを取得する(ステップS210)。具体的には、設定入力部50は、使用機能設定および使用機器設定を取得し、ソースコード入力部60は、ソースコードを取得する。ソースコード入力部60が取得するソースコードは、ユーザの作成途中のプログラムに対応するソースコードである。 The programming support device 1 acquires data for inferring the template source code (step S210). Specifically, the setting input unit 50 acquires the used function setting and the used device setting, and the source code input unit 60 acquires the source code. The source code acquired by the source code input unit 60 is the source code corresponding to the program being created by the user.

設定入力部50は、取得した使用機能設定および使用機器設定を推論装置30に入力し、ソースコード入力部60は、取得したソースコードを推論装置30に入力する(ステップS220)。また、ソースコード入力部60は、取得したソースコードを差分抽出装置40およびソースコード出力部70に入力する。 The setting input unit 50 inputs the acquired function settings and equipment settings to the inference device 30, and the source code input unit 60 inputs the acquired source code to the inference device 30 (step S220). Further, the source code input unit 60 inputs the acquired source code to the difference extraction device 40 and the source code output unit 70.

推論装置30は、ソースコード、使用機能設定、および使用機器設定を学習済モデルに入力することでプログラムグループ番号を推論し、プログラムグループ番号を用いてテンプレートソースコードを取得する。推論装置30は、プログラムグループ番号に対応するテンプレートソースコードをテンプレートソースコード記憶部22から抽出することで、テンプレートソースコードを取得する。推論装置30は、取得したテンプレートソースコードを出力する(ステップS230)。これにより、推論装置30は、テンプレートソースコードを差分抽出装置40に入力する(ステップS240)。 The inference device 30 infers the program group number by inputting the source code, the function setting, and the equipment setting used into the trained model, and acquires the template source code using the program group number. The inference device 30 acquires the template source code by extracting the template source code corresponding to the program group number from the template source code storage unit 22. The inference device 30 outputs the acquired template source code (step S230). As a result, the inference device 30 inputs the template source code to the difference extraction device 40 (step S240).

差分抽出装置40は、ソースコード入力部60から送られてきたソースコードと、推論装置30から送られてきたテンプレートソースコードとを比較することで差分ソースコードを算出する。差分抽出装置40は、算出した差分ソースコードをソースコード出力部70に出力する(ステップS250)。 The difference extraction device 40 calculates the difference source code by comparing the source code sent from the source code input unit 60 with the template source code sent from the inference device 30. The difference extraction device 40 outputs the calculated difference source code to the source code output unit 70 (step S250).

ソースコード出力部70は、表示装置2に、ソースコード入力部60から送られてきたソースコード、および差分抽出装置40から送られてきた差分ソースコードを出力する。表示装置2は、ユーザによる作成途中のプログラムのソースコードを補完する差分ソースコードを表示する(ステップS260)。 The source code output unit 70 outputs the source code sent from the source code input unit 60 and the difference source code sent from the difference extraction device 40 to the display device 2. The display device 2 displays the difference source code that complements the source code of the program being created by the user (step S260).

表示装置2が表示する差分ソースコードは、プログラムを作成する際にユーザが入力していないソースコードである。すなわち、表示装置2が表示する差分ソースコードは、プログラムの作成に必要な全ての仕様のアルゴリズム、シーケンス等のうち、ユーザが入力していないアルゴリズム、シーケンス等である。 The difference source code displayed by the display device 2 is a source code that the user has not input when creating the program. That is, the difference source code displayed by the display device 2 is an algorithm, a sequence, or the like that has not been input by the user among the algorithms and sequences of all the specifications necessary for creating the program.

このように、プログラミング支援装置1は、取得したソースコードと、テンプレートソースコードとの差分を抽出し、作成途中のプログラムのソースコードを補完するソースコードである差分ソースコードの提案を、表示装置2の画面に表示することができる。 In this way, the programming support device 1 extracts the difference between the acquired source code and the template source code, and proposes the difference source code, which is the source code that complements the source code of the program being created, in the display device 2. Can be displayed on the screen of.

ユーザは、プログラムのソースコードの作成時または修正時に途中までソースコードを入力すれば、表示装置2が、続きのソースコードまたは修正洩れ部分を補完するための差分ソースコードを表示する。これにより、プログラミング支援装置1は、ソースコードの作成時間を短縮できるとともに、プログラムの変更時のソースコードの修正洩れを防止できる。 If the user inputs the source code halfway at the time of creating or modifying the source code of the program, the display device 2 displays the subsequent source code or the difference source code for complementing the correction omission part. As a result, the programming support device 1 can shorten the time for creating the source code and prevent omission of correction of the source code when the program is changed.

なお、実施の形態1では、モデル生成部12および推論部32が用いる学習アルゴリズムに教師なし学習を適用した場合について説明したが、学習アルゴリズムは教師なし学習に限られるものではない。学習アルゴリズムについては、教師なし学習以外にも、強化学習、教師あり学習、又は半教師あり学習等を適用することも可能である。 In the first embodiment, the case where unsupervised learning is applied to the learning algorithms used by the model generation unit 12 and the inference unit 32 has been described, but the learning algorithm is not limited to unsupervised learning. As for the learning algorithm, it is also possible to apply reinforcement learning, supervised learning, semi-supervised learning, or the like, in addition to unsupervised learning.

また、学習装置10に用いられる学習アルゴリズムとしては、特徴量そのものの抽出を学習する、深層学習(Deep Learning)を用いることもでき、他の公知の方法が用いられてもよい。 Further, as the learning algorithm used in the learning device 10, deep learning, which learns the extraction of the feature amount itself, can be used, and other known methods may be used.

モデル生成部12が、実施の形態1における教師なし学習を実現する場合、上記のようなK平均(k-means)法による非階層型クラスタリングに限らず、クラスタリング可能な他の公知の方法が適用されてもよい。例えば、モデル生成部12は、最短距離法等の階層型クラスタリングを適用してもよい。 When the model generation unit 12 realizes unsupervised learning in the first embodiment, not only the non-hierarchical clustering by the K-means method as described above but also other known methods capable of clustering are applied. May be done. For example, the model generation unit 12 may apply hierarchical clustering such as the shortest distance method.

実施の形態1において、学習装置10、推論装置30、学習済モデル記憶部21、およびテンプレートソースコード記憶部22は、例えば、ネットワークを介してプログラミング支援装置1に接続された、このプログラミング支援装置1とは別個の装置であってもよい。また、学習装置10、推論装置30、学習済モデル記憶部21、およびテンプレートソースコード記憶部22は、プログラミング支援装置1に内蔵されていてもよい。さらに、学習装置10、推論装置30、学習済モデル記憶部21、およびテンプレートソースコード記憶部22は、クラウドサーバ上に存在していてもよい。 In the first embodiment, the learning device 10, the inference device 30, the trained model storage unit 21, and the template source code storage unit 22 are connected to the programming support device 1 via, for example, the programming support device 1. It may be a device separate from the device. Further, the learning device 10, the inference device 30, the learned model storage unit 21, and the template source code storage unit 22 may be built in the programming support device 1. Further, the learning device 10, the inference device 30, the learned model storage unit 21, and the template source code storage unit 22 may exist on the cloud server.

また、モデル生成部12は、複数のプログラミングソフトウェアに対して作成される学習用データに従って、プログラムグループ番号を学習するようにしてもよい。なお、モデル生成部12は、同一のエリアで使用される複数のプログラミングソフトウェアから学習用データを取得してもよいし、異なるエリアで独立して動作する複数のプログラミングソフトウェアから収集される学習用データを利用してプログラムグループ番号を学習してもよい。また、学習用データを収集するプログラミングソフトウェアを途中で対象に追加したり、対象から除去したりすることも可能である。さらに、あるプログラミングソフトウェアに関してプログラムグループ番号を学習した学習装置10を、これとは別のプログラミングソフトウェアに適用し、当該別のプログラミングソフトウェアに関してプログラムグループ番号を再学習して更新するようにしてもよい。また、モデル生成部12は、プログラミングソフトウェア以外の装置、例えば、ソースコードを記憶するソースコード記憶装置から学習用データを取得してもよい。 Further, the model generation unit 12 may learn the program group number according to the learning data created for the plurality of programming software. The model generation unit 12 may acquire learning data from a plurality of programming software used in the same area, or may acquire learning data from a plurality of programming software that operate independently in different areas. You may use to learn the program group number. It is also possible to add or remove programming software that collects learning data from the target on the way. Further, the learning device 10 that has learned the program group number for a certain programming software may be applied to another programming software, and the program group number may be relearned and updated for the other programming software. Further, the model generation unit 12 may acquire learning data from a device other than the programming software, for example, a source code storage device that stores the source code.

ここで、プログラミング支援装置1のハードウェア構成について説明する。図7は、実施の形態1にかかるプログラミング支援装置を実現するハードウェア構成例を示す図である。 Here, the hardware configuration of the programming support device 1 will be described. FIG. 7 is a diagram showing an example of a hardware configuration that realizes the programming support device according to the first embodiment.

プログラミング支援装置1は、プロセッサ100、メモリ200、入力装置300、および出力装置400により実現することができる。プロセッサ100の例は、CPU(中央処理装置、処理装置、演算装置、マイクロプロセッサ、マイクロコンピュータ、DSP(Digital Signal Processor)ともいう)またはシステムLSI(Large Scale Integration)である。メモリ200の例は、RAM(Random Access Memory)、ROM(Read Only Memory)である。 The programming support device 1 can be realized by the processor 100, the memory 200, the input device 300, and the output device 400. An example of the processor 100 is a CPU (central processing unit, processing unit, arithmetic unit, microprocessor, microprocessor, also referred to as DSP (Digital Signal Processor)) or system LSI (Large Scale Integration). Examples of the memory 200 are RAM (Random Access Memory) and ROM (Read Only Memory).

プログラミング支援装置1は、プロセッサ100が、メモリ200で記憶されているプログラミング支援装置1の動作を実行するための、コンピュータで実行可能な、プログラミング支援プログラムを読み出して実行することにより実現される。プログラミング支援装置1の動作を実行するためのプログラムであるプログラミング支援プログラムは、プログラミング支援装置1の手順または方法をコンピュータに実行させるものであるともいえる。 The programming support device 1 is realized by the processor 100 reading and executing a computer-executable programming support program for executing the operation of the programming support device 1 stored in the memory 200. It can be said that the programming support program, which is a program for executing the operation of the programming support device 1, causes the computer to execute the procedure or method of the programming support device 1.

プログラミング支援装置1で実行されるプログラミング支援プログラムは、推論装置30と、差分抽出装置40とを含むモジュール構成となっており、これらが主記憶装置上にロードされ、これらが主記憶装置上に生成される。 The programming support program executed by the programming support device 1 has a modular configuration including an inference device 30 and a difference extraction device 40, which are loaded on the main storage device and generated on the main storage device. Will be done.

入力装置300は、ユーザまたは外部装置からソースコード、使用機能設定、および使用機器設定を受付けてメモリ200に送る。すなわち、入力装置300は、設定入力部50およびソースコード入力部60の処理を実行する。 The input device 300 receives the source code, the function setting, and the device setting used from the user or an external device and sends them to the memory 200. That is, the input device 300 executes the processing of the setting input unit 50 and the source code input unit 60.

メモリ200は、ソースコード、使用機能設定、使用機器設定などを記憶する。ソースコード、使用機能設定、および使用機器設定は、プロセッサ100に送られる。また、メモリ200は、プロセッサ100が各種処理を実行する際の一時メモリに使用される。出力装置400は、差分ソースコードを表示装置2に出力する。すなわち、出力装置400は、ソースコード出力部70の処理を実行する。 The memory 200 stores source code, used function settings, used device settings, and the like. The source code, the function setting used, and the device setting used are sent to the processor 100. Further, the memory 200 is used as a temporary memory when the processor 100 executes various processes. The output device 400 outputs the difference source code to the display device 2. That is, the output device 400 executes the processing of the source code output unit 70.

プログラミング支援プログラムは、インストール可能な形式または実行可能な形式のファイルで、コンピュータが読み取り可能な記憶媒体に記憶されてコンピュータプログラムプロダクトとして提供されてもよい。また、プログラミング支援プログラムは、インターネットなどのネットワーク経由でプログラミング支援装置1に提供されてもよい。なお、プログラミング支援装置1の機能について、一部を専用回路などの専用のハードウェアで実現し、一部をソフトウェアまたはファームウェアで実現するようにしてもよい。 The programming assistance program may be provided as a computer program product in an installable or executable file, stored in a computer-readable storage medium. Further, the programming support program may be provided to the programming support device 1 via a network such as the Internet. It should be noted that some of the functions of the programming support device 1 may be realized by dedicated hardware such as a dedicated circuit, and some may be realized by software or firmware.

また、推論装置30および差分抽出装置40をそれぞれ別々のハードウェア構成によって実現してもよい。この場合、推論装置30は、テンプレートソースコードを推論するプログラムである推論プログラムを用いてテンプレートソースコードを推論する。また、差分抽出装置40は、ソースコードとテンプレートソースコードとの差分を抽出するプログラムである差分抽出プログラムを用いて差分ソースコードを生成する。なお、学習装置10も、プログラミング支援装置1と同様のハードウェア構成を有している。 Further, the inference device 30 and the difference extraction device 40 may be realized by different hardware configurations. In this case, the inference device 30 infers the template source code by using an inference program which is a program for inferring the template source code. Further, the difference extraction device 40 generates a difference source code by using a difference extraction program which is a program for extracting the difference between the source code and the template source code. The learning device 10 also has the same hardware configuration as the programming support device 1.

このように実施の形態1では、学習装置10が、ソースコード、使用機能設定、および使用機器設定に対応するテンプレートソースコードを学習することで学習済モデルを作成している。また、推論装置30が、学習済モデルにソースコード、使用機能設定、および使用機器設定を入力することでテンプレートソースコードを推論している。 As described above, in the first embodiment, the learning device 10 creates a trained model by learning the template source code corresponding to the source code, the function setting used, and the device setting used. Further, the inference device 30 infers the template source code by inputting the source code, the function setting used, and the device setting used into the trained model.

そして、プログラミング支援装置1は、ユーザが入力したソースコードと、テンプレートソースコードとの差分を差分ソースコードとして表示装置2に表示させている。これにより、ユーザは、ソースコードを抜けなく短時間で容易に入力することが可能となる。したがって、プログラミング支援装置1は、ユーザに、短時間で所望のソースコードを容易に作成させることが可能となる。 Then, the programming support device 1 displays the difference between the source code input by the user and the template source code on the display device 2 as a difference source code. As a result, the user can easily input the source code in a short time without missing the source code. Therefore, the programming support device 1 makes it possible for the user to easily create a desired source code in a short time.

実施の形態2.
つぎに、図1を用いて実施の形態2について説明する。実施の形態2では、プログラミング支援装置1のソースコード入力部60に変更途中のプログラムのソースコードが入力される。そして、プログラミング支援装置1の差分抽出装置40は、ソースコード入力部60が取得したソースコードと、推論装置30が推論したテンプレートソースコードとの差分を抽出する。これにより、プログラミング支援装置1は、変更途中のプログラムのソースコードを補完する差分ソースコードの提案を、表示装置2の画面に表示させることができる。
Embodiment 2.
Next, the second embodiment will be described with reference to FIG. In the second embodiment, the source code of the program being changed is input to the source code input unit 60 of the programming support device 1. Then, the difference extraction device 40 of the programming support device 1 extracts the difference between the source code acquired by the source code input unit 60 and the template source code inferred by the inference device 30. As a result, the programming support device 1 can display the proposal of the difference source code that complements the source code of the program being changed on the screen of the display device 2.

プログラムのソースコードが変更される際には、一般的に複数の箇所について修正が必要であるが、この場合、プログラミング支援装置1は、テンプレートソースコードとの複数の差分を差分ソースコードとして抽出する。この場合もプログラミング支援装置1は、プログラムのソースコードを補完する差分ソースコードを表示させることで、ソースコードの修正漏れを防止できる。 When the source code of the program is changed, it is generally necessary to modify a plurality of parts. In this case, the programming support device 1 extracts a plurality of differences from the template source code as the difference source code. .. In this case as well, the programming support device 1 can prevent omission of correction of the source code by displaying the difference source code that complements the source code of the program.

なお、プログラミング支援装置1のソースコード入力部60に、既存のソースコードが入力されてもよい。この場合も、差分抽出装置40は、ソースコード入力部60が取得したソースコードと、推論装置30が推論したテンプレートソースコードとの差分を抽出する。そして、ソースコード出力部70が、既存のソースコードを補完する差分ソースコードの提案を、表示装置2の画面に表示させる。既存のソースコードが第2のソースコードである。また、既存のソースコードに対応する使用機能設定が第2の使用機能設定であり、既存のソースコードに対応する使用機器設定が第2の使用機器設定である。 An existing source code may be input to the source code input unit 60 of the programming support device 1. In this case as well, the difference extraction device 40 extracts the difference between the source code acquired by the source code input unit 60 and the template source code inferred by the inference device 30. Then, the source code output unit 70 displays the proposal of the difference source code that complements the existing source code on the screen of the display device 2. The existing source code is the second source code. Further, the used function setting corresponding to the existing source code is the second used function setting, and the used device setting corresponding to the existing source code is the second used device setting.

このように実施の形態2によれば、プログラミング支援装置1は、変更途中または既存のソースコードと、テンプレートソースコードとの差分を差分ソースコードとして表示装置2に表示させている。したがって、プログラミング支援装置1は、変更途中または既存のソースコードを補完する差分ソースコードをユーザに提案することが可能となる。 As described above, according to the second embodiment, the programming support device 1 causes the display device 2 to display the difference between the source code being changed or the existing source code and the template source code as the difference source code. Therefore, the programming support device 1 can propose to the user a difference source code that is in the process of being changed or that complements the existing source code.

以上の実施の形態に示した構成は、一例を示すものであり、別の公知の技術と組み合わせることも可能であるし、実施の形態同士を組み合わせることも可能であるし、要旨を逸脱しない範囲で、構成の一部を省略、変更することも可能である。 The configuration shown in the above embodiments is an example, and can be combined with another known technique, can be combined with each other, and does not deviate from the gist. It is also possible to omit or change a part of the configuration.

1 プログラミング支援装置、2 表示装置、10 学習装置、11,31 データ取得部、12 モデル生成部、13 テンプレートソースコード生成部、21 学習済モデル記憶部、22 テンプレートソースコード記憶部、30 推論装置、32 推論部、33 テンプレートソースコード取得部、40 差分抽出装置、50 設定入力部、60 ソースコード入力部、70 ソースコード出力部、100 プロセッサ、200 メモリ、300 入力装置、400 出力装置。 1 Programming support device, 2 Display device, 10 Learning device, 11, 31 Data acquisition unit, 12 Model generation unit, 13 Template source code generation unit, 21 Learned model storage unit, 22 Template source code storage unit, 30 Inference device, 32 Inference unit, 33 Template source code acquisition unit, 40 Difference extraction device, 50 Setting input unit, 60 Source code input unit, 70 Source code output unit, 100 processor, 200 memory, 300 input device, 400 output device.

Claims (8)

プログラミングソフトウェアに入力された作成途中のソースコードである第1のソースコードが入力されるソースコード入力部と、
前記第1のソースコードに対応するプログラムが使用される機器の情報である第1の使用機器設定、および前記機器が用いる機能の情報である第1の使用機能設定が入力される設定入力部と、
前記第1のソースコード、前記第1の使用機器設定、および前記第1の使用機能設定の組み合わせである組み合わせ情報から、前記第1のソースコードのテンプレートであるテンプレートソースコードを推論する学習済モデルを用いて、前記組み合わせ情報に対応する前記テンプレートソースコードを推論する推論装置と、
前記ソースコード入力部に入力された前記第1のソースコードと、前記推論装置が推論した前記テンプレートソースコードとの差分を、差分ソースコードとして抽出する差分抽出装置と、
前記差分ソースコードを出力するソースコード出力部と、
を備える、
ことを特徴とするプログラミング支援装置。
The source code input section where the first source code, which is the source code in the process of being created, input to the programming software is input, and
A setting input unit for inputting a first used device setting which is information on a device in which a program corresponding to the first source code is used, and a first used function setting which is information on a function used by the device. ,
A trained model that infers a template source code that is a template of the first source code from the combination information that is a combination of the first source code, the first used device setting, and the first used function setting. With an inference device that infers the template source code corresponding to the combination information,
A difference extraction device that extracts the difference between the first source code input to the source code input unit and the template source code inferred by the inference device as a difference source code.
The source code output unit that outputs the difference source code and
To prepare
A programming support device characterized by that.
前記推論装置は、
前記組み合わせ情報を取得するデータ取得部と、
前記学習済モデルを用いて、前記組み合わせ情報に対応する前記テンプレートソースコードを推論する推論部と、
を有する、
ことを特徴とする請求項1に記載のプログラミング支援装置。
The inference device is
The data acquisition unit that acquires the combination information and
An inference unit that infers the template source code corresponding to the combination information using the trained model.
Have,
The programming support device according to claim 1.
前記ソースコード出力部は、前記差分ソースコードとともに前記第1のソースコードを出力する、
ことを特徴とする請求項1または2に記載のプログラミング支援装置。
The source code output unit outputs the first source code together with the difference source code.
The programming support device according to claim 1 or 2.
前記推論装置は、前記学習済モデルを用いて、前記組み合わせ情報から、前記第1のソースコードに対応するプログラムが属するグループの番号であるプログラムグループ番号を推論し、前記プログラムグループ番号に対応する前記差分ソースコードを抽出することで前記差分ソースコードを推論する、
ことを特徴とする請求項1から3の何れか1つに記載のプログラミング支援装置。
The inference device infers the program group number, which is the number of the group to which the program corresponding to the first source code belongs, from the combination information using the trained model, and the inference device corresponds to the program group number. Inferring the difference source code by extracting the difference source code,
The programming support device according to any one of claims 1 to 3, wherein the programming support device is characterized by the above.
前記ソースコード入力部へ作成済みの既存のソースコードである第2のソースコードが入力されるとともに、前記設定入力部へ前記第2のソースコードに対応する第2の使用機器設定、および前記第2のソースコードに対応する第2の使用機能設定が入力されると、
前記推論装置は、前記学習済モデルを用いて、前記第2のソースコード、前記第2の使用機器設定、および前記第2の使用機能設定の組み合わせに対応する前記テンプレートソースコードを推論する、
ことを特徴とする請求項1から4の何れか1つに記載のプログラミング支援装置。
A second source code, which is an existing source code created, is input to the source code input unit, and the second source code corresponding to the second source code is set to the setting input unit, and the second source code is set. When the second function setting corresponding to the source code of 2 is input,
The inference device infers the template source code corresponding to the combination of the second source code, the second used device setting, and the second used function setting by using the trained model.
The programming support device according to any one of claims 1 to 4, characterized in that.
前記第1のソースコードは、新規作成途中または変更途中のソースコードである、
ことを特徴とする請求項1から3の何れか1つに記載のプログラミング支援装置。
The first source code is a source code in the process of being newly created or changed.
The programming support device according to any one of claims 1 to 3, wherein the programming support device is characterized by the above.
プログラミングを支援するプログラミング支援装置が、プログラミングソフトウェアに入力された作成途中のソースコードである第1のソースコードを受け付けるソースコード入力ステップと、
前記プログラミング支援装置が、前記第1のソースコードに対応するプログラムが使用される機器の情報である第1の使用機器設定、および前記機器が用いる機能の情報である第1の使用機能設定を受け付ける設定入力ステップと、
前記プログラミング支援装置が、前記第1のソースコード、前記第1の使用機器設定、および前記第1の使用機能設定の組み合わせである組み合わせ情報から、前記第1のソースコードのテンプレートであるテンプレートソースコードを推論する学習済モデルを用いて、前記組み合わせ情報に対応する前記テンプレートソースコードを推論する推論ステップと、
前記プログラミング支援装置が、受け付けた前記第1のソースコードと、推論した前記テンプレートソースコードとの差分を、差分ソースコードとして抽出する差分抽出ステップと、
前記プログラミング支援装置が、前記差分ソースコードを出力するソースコード出力ステップと、
を含む、
ことを特徴とするプログラミング支援方法。
A source code input step in which the programming support device that supports programming accepts the first source code, which is the source code in the process of being created, input to the programming software.
The programming support device accepts a first used device setting which is information on a device in which a program corresponding to the first source code is used, and a first used function setting which is information on a function used by the device. Setting input step and
The template source code, which is a template of the first source code, from the combination information in which the programming support device is a combination of the first source code, the first used device setting, and the first used function setting. An inference step that infers the template source code corresponding to the combination information using a trained model that infers
A difference extraction step of extracting the difference between the first source code received by the programming support device and the inferred template source code as a difference source code.
The source code output step in which the programming support device outputs the difference source code, and
including,
A programming support method characterized by that.
プログラミングソフトウェアに入力された作成途中のソースコードである第1のソースコードを受け付けるソースコード入力ステップと、
前記第1のソースコードに対応するプログラムが使用される機器の情報である第1の使用機器設定、および前記機器が用いる機能の情報である第1の使用機能設定を受け付ける設定入力ステップと、
前記第1のソースコード、前記第1の使用機器設定、および前記第1の使用機能設定の組み合わせである組み合わせ情報から、前記第1のソースコードのテンプレートであるテンプレートソースコードを推論する学習済モデルを用いて、前記組み合わせ情報に対応する前記テンプレートソースコードを推論する推論ステップと、
受け付けた前記第1のソースコードと、推論した前記テンプレートソースコードとの差分を、差分ソースコードとして抽出する差分抽出ステップと、
前記差分ソースコードを出力するソースコード出力ステップと、
をコンピュータに実行させることを特徴とするプログラミング支援プログラム。
A source code input step that accepts the first source code, which is the source code in the process of being created, input to the programming software.
A setting input step for accepting a first used device setting which is information on a device in which a program corresponding to the first source code is used, and a first used function setting which is information on a function used by the device.
A trained model that infers a template source code that is a template of the first source code from the combination information that is a combination of the first source code, the first used device setting, and the first used function setting. Inference step to infer the template source code corresponding to the combination information using
A difference extraction step for extracting the difference between the received first source code and the inferred template source code as a difference source code.
The source code output step that outputs the difference source code, and
A programming support program characterized by having a computer execute.
JP2021573281A 2021-07-06 2021-07-06 Programming support device, programming support method, and programming support program Active JP7023440B1 (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2021/025484 WO2023281630A1 (en) 2021-07-06 2021-07-06 Programming support device, programming support method, and programming support program

Publications (2)

Publication Number Publication Date
JP7023440B1 true JP7023440B1 (en) 2022-02-21
JPWO2023281630A1 JPWO2023281630A1 (en) 2023-01-12

Family

ID=81076729

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2021573281A Active JP7023440B1 (en) 2021-07-06 2021-07-06 Programming support device, programming support method, and programming support program

Country Status (3)

Country Link
JP (1) JP7023440B1 (en)
CN (1) CN117581196A (en)
WO (1) WO2023281630A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013097451A (en) * 2011-10-28 2013-05-20 Mitsubishi Electric Corp Support system, support method and support program
JP6109997B1 (en) * 2016-07-26 2017-04-05 ネットエージェント株式会社 Software generation system, information processing apparatus, and program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013097451A (en) * 2011-10-28 2013-05-20 Mitsubishi Electric Corp Support system, support method and support program
JP6109997B1 (en) * 2016-07-26 2017-04-05 ネットエージェント株式会社 Software generation system, information processing apparatus, and program

Also Published As

Publication number Publication date
JPWO2023281630A1 (en) 2023-01-12
CN117581196A (en) 2024-02-20
WO2023281630A1 (en) 2023-01-12

Similar Documents

Publication Publication Date Title
US11568327B2 (en) Method for generating universal learned model
CN110705709B (en) Method and device for training neural network model of graph
US5761381A (en) Computer system using genetic optimization techniques
CN111684367B (en) Control device, control system, control method, and computer-readable storage medium
CN110339563B (en) Virtual object generation method and device, storage medium and electronic device
CN111832725B (en) Multi-robot multi-task allocation method and device based on improved genetic algorithm
US20160140452A1 (en) Methods and systems using a composition of autonomous self-learning software components for performing complex real time data-processing tasks
CN113011529B (en) Training method, training device, training equipment and training equipment for text classification model and readable storage medium
CN108399105B (en) Software and hardware partitioning method based on improved brainstorming algorithm
JP7023440B1 (en) Programming support device, programming support method, and programming support program
CN110780922B (en) Instruction generation method and device, electronic equipment and storage medium
WO2019207767A1 (en) Control device and control method
US20110161259A1 (en) System and method for simplification of a matrix based boosting algorithm
WO2021256135A1 (en) Control device, method, and program
Kusiak Data mining and decision making
JP2014229142A (en) Program, information processing apparatus, and information processing method
JP6694197B2 (en) Learning network generation device and learning network generation program
JP7211430B2 (en) Machine learning device, machine learning method, and program
JP7166505B1 (en) Image filter generation system, image filter generation device, inference device, inference method and program
JP7166506B1 (en) Image filter generation system, image filter generation device, learning device, learning method and program
JP7093527B2 (en) Information processing equipment, methods, programs and systems
CN115879544B (en) Neuron coding method and system for distributed brain-like simulation
JP2020179438A (en) Computing system and machine learning method
EP3788558A1 (en) Placement-aware acceleration of parameter optimization in a predictive model
JP7171520B2 (en) machine learning system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20211209

A871 Explanation of circumstances concerning accelerated examination

Free format text: JAPANESE INTERMEDIATE CODE: A871

Effective date: 20211209

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20220111

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220208

R150 Certificate of patent or registration of utility model

Ref document number: 7023440

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150