JP2006215826A - Program code generation supporting device and method, and program for program code generation supporting method - Google Patents
Program code generation supporting device and method, and program for program code generation supporting method Download PDFInfo
- Publication number
- JP2006215826A JP2006215826A JP2005028122A JP2005028122A JP2006215826A JP 2006215826 A JP2006215826 A JP 2006215826A JP 2005028122 A JP2005028122 A JP 2005028122A JP 2005028122 A JP2005028122 A JP 2005028122A JP 2006215826 A JP2006215826 A JP 2006215826A
- Authority
- JP
- Japan
- Prior art keywords
- program code
- data
- code
- conversion
- unit
- 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.)
- Granted
Links
Images
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Devices For Executing Special Programs (AREA)
- Stored Programmes (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本発明はプログラムコードを生成するための支援を行うプログラムコード生成支援装置等に関するものである。特にそのプログラムコードを実行処理する装置等に合わせてプログラムコードを最適化するためのものである。 The present invention relates to a program code generation support apparatus that performs support for generating a program code. In particular, the program code is optimized in accordance with an apparatus for executing the program code.
家電機器(エアコン、冷蔵庫、洗濯機、放電灯点灯装置等)等においては、その動作を制御するため、プログラム実行装置を組み込んでいる(以下、このような家電機器、家電機器アダプタ等を組み込み機器という)。ここで、プログラム実行装置が実行処理を行うためには、あらかじめ定められたプログラムコードと呼ばれるデータを必要とする。このプログラムコードは、例えば組み込み機器内に設けられたROM(Read Only Memory)等の記憶手段にあらかじめ記憶されており、プログラム実行装置はROMに記憶されたプログラムコードを読み込んで(入力して)実行処理を行っている。そして、このようなプログラムコードを生成を支援するための装置も提案されている(例えば特許文献1参照)。
ここで、プログラムコードが用いられる環境は必ずしも一律ではなく、例えば、組み込み機器(特にプログラム実行装置)によって大きく異なるので、組み込み機器の特性等に合わせたプログラムコードを生成することが望ましい。特にプログラムコードに係るデータ量を少なくできれば、その分だけ、プログラム実行装置において、ROMや実行処理を行う際に一時的に記憶するためのバッファの記憶容量を減らすことができる。また、今後、組み込み機器がネットワークを介して相互に接続され、例えば、プログラムコードを含む信号を送受信するような場合にも都合がよい。しかしながら、上述のような支援装置では、単にプログラムコードを生成するだけであった。 Here, the environment in which the program code is used is not necessarily uniform. For example, it varies greatly depending on the embedded device (particularly, the program execution device). Therefore, it is desirable to generate the program code according to the characteristics of the embedded device. In particular, if the amount of data related to the program code can be reduced, the storage capacity of the ROM for temporarily storing the ROM or the execution process when the execution processing is performed in the program execution device can be reduced accordingly. In the future, it is also convenient when embedded devices are connected to each other via a network and, for example, signals including program codes are transmitted and received. However, the above-described support device simply generates a program code.
そこで本発明は、プログラムコードをさらに最適化して新たなプログラムコードを生成でき、特に組み込み機器に応じた生成を行えるプログラムコード生成支援装置、方法等を実現することを目的とする。 Accordingly, an object of the present invention is to realize a program code generation support apparatus, method, and the like that can generate a new program code by further optimizing the program code, and in particular can perform generation according to an embedded device.
本発明に係るプログラムコード生成支援装置は、プログラムコードのデータを変換するための変換条件と変換内容で構成される最適化規則をデータとして記憶する記憶手段と、プログラムコードを解析するコード解析部、解析したプログラムコードに基づいて、記憶手段に記憶された最適化規則との照合を行い、プログラムコードにおいて変換条件と合致する部分を検索する条件検索部及び変換内容に基づいて変換条件と合致する部分を変換し、新たなプログラムコードのデータを生成する最適化部を有するコード最適化手段とを備えるものである。 A program code generation support apparatus according to the present invention includes a storage unit that stores, as data, a conversion condition for converting program code data and conversion contents, a code analysis unit that analyzes the program code, Based on the analyzed program code, it matches with the optimization rules stored in the storage means, and searches for a portion that matches the conversion condition in the program code, and a portion that matches the conversion condition based on the conversion content And a code optimizing unit having an optimizing unit for generating new program code data.
本発明によれば、プログラムコードに対し、さらにコード最適化手段が、コード解析部が解析を行い、条件検索部が最適化規則に基づいて、条件に合致している部分があるかどうかを検索し、最適化部が最適化を行うための変換を行って新たな実行コード(プログラムコード)をさらに生成するようにしたので、組み込み機器が有するプログラム実行装置が実行処理等を行いやすいように最適化することができる。特に、同じコマンドに基づく実行コードが連続する部分をまとめて新たな実行コードを生成することにより、プログラムコード全体のデータ量を低減させ、また、実行処理においても、一度にまとめて行えるので処理速度を速くすることができる。 According to the present invention, the code optimization means further analyzes the program code by the code analysis unit, and the condition search unit searches whether there is a part matching the condition based on the optimization rule. In addition, since the optimization unit performs conversion for optimization and generates new execution code (program code), it is optimal for the program execution device of the embedded device to easily execute execution processing. Can be In particular, by creating a new execution code by combining the portions of execution code based on the same command, the data amount of the entire program code is reduced, and the execution process can be performed all at once, so the processing speed Can be faster.
実施の形態1.
図1は本発明の実施の形態1に係るプログラムコード生成支援装置を中心とするシステムを表す図である。プログラム生成支援装置は、仕様入力手段1、コード生成手段2、コード評価手段3、コード最適化手段4、出力手段5、記憶手段10、表示手段20及び入力手段30で構成される。
FIG. 1 is a diagram showing a system centering on a program code generation support apparatus according to
図2は仕様入力手段1が表示手段20に表示させた画面の例を表す図である。仕様入力手段1は、例えばオペレータに仕様を入力させるための画面を表示手段20に表示させ、仕様として、入力手段30から入力されたデータを処理する。処理したデータは、実行コードを構成する処理データとなる。ここで、ECHONET (Energy Conservation and Homecare Network:ECHONET はECHONET コンソーシアムの商標)とは、図1に示すように、家電機器同士を連携させつつ制御を行なうためのネットワーク(通信回線)の規格である。本実施の形態では、その規格により接続された機器、アダプタ等における実行処理を行うためのプログラムコードを生成するものとする。各仕様の要素(項目)と処理データとの関係は後述する。
FIG. 2 is a diagram illustrating an example of a screen displayed on the
図3は実行コードの一例を表す図である。コード生成手段2は、仕様入力手段1が処理したデータに基づいて、プログラムコードを生成する。図3ではテキストデータとして記述されている。プログラムコードは1又は複数の実行コードで構成される。実行コードは、例えば、組み込み機器が有するプログラム実行装置においてインタプリタにより逐次に実行処理を行う際の単位となる。本実施の形態においては、プログラムコードに用いる言語としてForth を用いる。Forth は構文解析が簡単又は不要な逆ポーランド記法に基づく言語である。本実施の形態において、実行コードは、プログラム実行装置が実行すべき処理を表すコマンド(命令)のデータ(以下、コマンドという。Forth ではwordという)とコマンドに基づく処理のためのデータ(以下、処理データという)で構成され、処理データ、コマンドの順に記述される。ここで、各コマンドとその処理内容のデータは、あらかじめ定義づけられて(関連づけられて)登録されている(これを辞書という)。そのため、実行コードに記述された文字列等のデータにおいては、辞書に登録されていればコマンドであり、登録されていなければ処理データとなる。また、コマンドはあらかじめ決められたものだけではなく、さらにコマンドの処理内容を定義して辞書として登録することができるものとする。この辞書については、本実施の形態では記憶手段10に辞書部10Aとして記憶されているものとする。ここでは、Forth を用いてプログラムコードを生成しているが、本発明が適用できるプログラムコードはこれに限定するものではない。
FIG. 3 is a diagram illustrating an example of an execution code. The
ここで、コード生成手段2は、後段のコード評価支援手段3による処理において、表示手段20にプログラムコードを表示させた際に、オペレータが評価を行いやすいような評価用のプログラムコードを生成する。例えば、実行コードの文字列が長くなりすぎないように生成したり、独自に定義したものではない、基本的なコマンドを用いて生成したりしてトレースしやすいようにする。
Here, the
コマンドRGST_EPCは組み込み機器のプロパティ情報を登録を実行処理するために記述される。オブジェクトid(obj_id)は組み込み機器のオブジェクトに対して付されるidである。ECHONET プロパティ(epc )は、組み込み機器に応じて設定可能なプロパティ(例えば、エアコンにおける風量設定状態等)のコードである。コードの値はECHONET の規格で定められている。また、プロパティのデータ型(type)として7種類が用意されている(組み込み機器とプロパティとが決まれば自動的に決定される)。アクセスルール(rule)は書き込み、読み出し、通知の可否を示すものである。状変時アナウンス有無(anno)はプロパティの状態が変化した際に、ネットワークを介して通知するか否かを表す指標(フラグ)である。データサイズ(size)は、プロパティのデータサイズを規定するためのものであり、ECHONET の規格ではその最大値を8640バイトとしている。 The command RGST_EPC is described to execute registration processing of property information of the embedded device. The object id (obj_id) is an id assigned to the object of the embedded device. The ECHONET property (epc) is a code of a property that can be set according to the embedded device (for example, the air volume setting state in the air conditioner). The code value is defined by the ECHONET standard. In addition, seven types of property data types (type) are prepared (automatically determined when the embedded device and the property are determined). The access rule (rule) indicates whether writing, reading, and notification are possible. Status change announcement presence / absence (anno) is an indicator (flag) indicating whether or not notification is made via the network when the property state changes. The data size (size) is for defining the data size of the property, and the maximum value is 8640 bytes in the ECHONET standard.
コード評価手段3は、コード生成手段2又はその他の手段が生成したプログラムコード(実行コード)をオペレータが評価するための支援を行う。例えば、オペレータが生成されたプログラムコードの確認、デバッグ等、プログラムコードの評価を行うため、プログラムコードを表示手段20の画面に表示させる。また、プログラム実行装置が実行処理を行う際に用いるインタプリタを有しており、生成された実行コードを実行処理することができる。これにより、オペレータがプログラムコード(実行コード)に基づいて行われる実行処理を確認することができる。 The code evaluation means 3 provides support for the operator to evaluate the program code (execution code) generated by the code generation means 2 or other means. For example, the program code is displayed on the screen of the display means 20 in order to evaluate the program code such as confirmation and debugging of the generated program code. Further, the program execution apparatus has an interpreter used when executing the execution process, and can execute the generated execution code. Thereby, the operator can confirm the execution process performed based on the program code (execution code).
コード最適化手段4は、記憶手段10の最適化規則記憶部10Bに記憶された最適化規則に基づいて、プログラムコードの最適化を図る。コード最適化手段4は、コード解析部4A、条件検索部4B及び最適化部4Cで構成される。最適化規則とは、例えば複数の実行コードをまとめ、新たな実行コードを生成する等、プログラム実行装置がプログラムコードに基づく実行処理を効率よくできるようにするための変換規則をデータ化したものである。最適化規則についてはさらに後に述べる。
The
コード解析部4Aは、入力されたプログラムコードを解析する。ここでコード解析部4Aはカウンタを有しており、同じコマンドを有し、同じ内容を実行処理する実行コードが連続している部分について、連続する回数をカウントする。条件検索部4Bは、変換条件に基づく検索を行う。つまり、解析したプログラムコードと最適化規則を構成する変換条件とを照合し、変換条件に合致している部分があるかどうかの判断を行う。その際、コード解析部4Aのカウントを参照する。最適化部4Cは、条件検索部4Bが変換条件に合致していると判断した部分について、最適化を行うための変換を行って新たな実行コード(ひいてはプログラムコード)を生成する。
The
ここで、コード解析部4A、条件検索部4B及び最適化部4Cについて、それぞれ物理的に独立した手段として構成してもよいが、ここでは、例えばCPUを中心とする制御処理装置がそれぞれの手段の処理を実行することで、各部の処理を実現する。なお、仕様入力手段1、コード生成手段2、コード評価手段3、コード最適化手段4、出力手段5の関係においても同様であり、各手段を独立させてもよいが、本実施の形態では、制御処理装置がそれぞれの手段の処理を実行することで、プログラムコード生成支援装置の処理を実現するものとする。
Here, the
出力手段5は、対応する出力デバイスに合わせた形式のデータにプログラムコードを変換し、出力デバイスに出力させる処理を行う。例えば、出力デバイスが印刷装置40である場合には、バーコード、QRコード(2次元バーコード:QRコードは株式会社デンソーウェーブの登録商標)等として印刷装置に印刷させるようなデータにプログラムコードを変換し、印刷媒体に印刷させる処理を行う。そのため、例えば組み込み機器専用に高価な通信装置を設け、直接的に通信回線に接続して信号の送信を行わなくても、携帯電話等が有しているカメラ、赤外線通信技術等を用いて、組み込み機器にデータを含む信号を送信し、プログラムコードを記憶させることができる。これにより、紙媒体等、低価格の媒体を用いても組み込み機器内に記憶されたプログラムコードを最新の状態に保つことができる。また、例えばメモリ読書装置50を出力デバイスとして用いて、電子記憶媒体によるデータ交換を行ってもよい。また、通信装置を出力デバイスとしてもよい。なお、記憶手段10には、辞書部10Aに記憶された辞書、最適化規則記憶部10Bに記憶された最適化規則の他にも、各手段が表示手段20に画面表示させるためのデータ等、プログラムコード生成支援を行うためのプログラム等が記憶されている。
The output means 5 performs processing for converting the program code into data in a format suitable for the corresponding output device and outputting the data to the output device. For example, when the output device is the
図4は最適化規則の一例を表す図である。例えば、図4(a)に示すように、「コマンドRGST_EPC(ECHONET プロパティの登録を処理内容とする)を複数回連続して実行処理するようにプログラムコードの記述がなされていれば、複数のECHONET プロパティの登録を一度に実行処理する処理内容のコマンドRGST_EPCS に置き換える」旨の規則が最適化規則として最適化規則記憶部10Bに記憶されている。その内容をスクリプト(記述)形式のデータとして表したものが図4(b)である。矢印の手前が条件検索部4Bが検索する際の変換条件を表し、矢印の先が最適化部4Cが変換する際の変換内容を表している(ここで、複数回連続するので、nは2以上とする。このnをコード解析部4Aがカウントする)。コマンドRGST_EPCS に関する実行コードにおいて、処理データは、登録するECHONET プロパティについて、オブジェクトid(obj_id)、ECHONET プロパティ(epc )、データ型(type)、状変時アナウンス有無(anno)及びデータサイズ(size)の組を、登録を繰り返す分だけ並べて、繰り返す回数を付したものとなる。このコマンドRGST_EPCS についても辞書部10Aに登録されている。このように、実行コードをまとめて別の実行コードにして、プログラムコードのデータ量を減らし最適化を図る。複数の実行コードをまとめて実行処理することになるため、処理速度を高めることができる。
FIG. 4 is a diagram illustrating an example of the optimization rule. For example, as shown in FIG. 4A, if a program code is written so that “command RGST_EPC (ECHONET property registration is the processing content) is executed multiple times in succession, a plurality of ECHONET The rule “replace property registration with the command RGST_EPCS having the processing contents to be executed at once” is stored as an optimization rule in the optimization
図5は最適化規則の別の一例を表す図である。例えば、図5では「同じ配列の異なる要素に対する代入の連続は、まとめて値を代入できるコマンドSET_C_ARRAY に置き換える」旨の規則が最適化規則として最適化規則記憶部10Bに記憶されている。その内容をスクリプト(記述)形式のデータとして表したものが図5(b)である。ここで、charは代入する値、c-addrは代入先のアドレス、offsetは先頭アドレスからのオフセットを表す。条件検索部4Bが検索する際の変換条件及び最適化部4Cが変換する際の変換内容のc-addrに付した[]は、c-addrの内容(文字列)が同じであることを表している。また、nは2以上とし、コード解析部4Aがカウントする。例えば、「1 BUF 0 + C!」は、アドレスBUF から0バイト目に1を代入する実行処理を行う。コマンドSET_C_ARRAY に関する実行コードにおいて、処理データは、代入する値(char)をn(繰り返す回数分)並べ、アドレスを示す「BUF 」、オフセットをn並べて、繰り返す回数を付したものとなる。コマンドSET_C_ARRAY についても辞書部10Aに登録されている。
FIG. 5 is a diagram illustrating another example of the optimization rule. For example, in FIG. 5, a rule that “sequential substitutions for different elements of the same array are replaced with a command SET_C_ARRAY that can assign values collectively” is stored as an optimization rule in the optimization
以上のように実施の形態1によれば、コード生成手段2が生成したプログラムコードに対し、さらにコード最適化手段4において、コード解析部4Aが解析を行い、条件検索部4Bが最適化規則記憶部10Bに記憶された最適化規則に基づいて、変換条件に合致している部分があるかどうかを検索し、最適化部4Cは、条件検索部4Bが変換条件に合致していると判断した部分について、最適化を行うための変換を行って新たな実行コード(プログラムコード)をさらに生成するようにしたので、組み込み機器が有するプログラム実行装置が実行処理等を行いやすいように最適化することができる。特に、同じコマンドに基づく実行コードが連続する部分をまとめて新たな実行コードを生成することにより、プログラムコード全体のデータ量を低減させ、また、実行処理においても、一度にまとめて行えるので処理速度を速くすることができる。その際、コード生成手段2の生成に係るプログラムコードは、コード評価支援手段3がプログラムコードを表示手段20に表示させた際に、オペレータが評価しやすいような形で生成しておくことにより、オペレータが、確認、修正等を行いやすくすることができる。さらに、出力手段5により、出力デバイスに合わせた形式のデータにプログラムコードを変換するようにしたので、様々な出力デバイスの形式に対応してプログラムコードを記録させておくことができる。特にバーコード、QRコード等を印刷するためのデータに変換し、印刷できるようにしておけば、プログラムコードの記録を低価格媒体に行っておくことができる。そして組み込み機器へのプログラムコードを含む信号送信には、例えば携帯電話等の汎用通信手段を用いることができる。
As described above, according to the first embodiment, the
実施の形態2.
図6は本発明の実施の形態2に係るプログラムコード生成支援装置を表す図である。プログラムコードを組み込み機器に格納(記憶)するための環境、組み込み機器が有するプログラム実行装置がプログラムコードに基づく実行処理をする環境は、機器の種類等により異なる。特にプログラムコード生成にあたり、プログラムコードを格納(記憶)するROMの記憶容量、実行処理時等におけるRAM(Random Access Memory)の使用可能な記憶容量が重要となる。そこで、本実施の形態では、組み込み機器の条件(プログラムコードに基づく実行処理環境)を設定し、プログラムコード生成の際に反映させる。図6において、図1のプログラムコード生成支援装置と同じ符号を付したものは、実施の形態1で説明した手段と同じような処理動作を行うので説明を省略する。
FIG. 6 shows a program code generation support apparatus according to
図7は組み込み機器条件入力手段6が表示手段20に表示させた画面の例を表す図である。組み込み機器条件入力手段6は、例えばオペレータに組み込み機器の特性、条件等を入力させるための画面を表示手段20に表示させ、入力手段30から入力された指示の信号を設定処理し、コード最適化手段4及び出力手段5に送信する。図7においては、プログラムコードを格納するためのROMの記憶容量(コード記憶容量)、RAMの使用可能な記憶容量(使用可能RAM容量)、プログラムコードの圧縮処理をするか否か(バイナリ圧縮)、プログラムコードを印刷用媒体として出力するか、メモリカード等の電子記憶媒体に出力するか(出力媒体)及び印刷媒体が選択された場合にQRコード(QRコードは株式会社デンソーウェーブの登録商標)に変換するか否か(QRコードへの変換)を設定することができる。
FIG. 7 is a diagram illustrating an example of a screen displayed on the
本実施の形態のコード最適化手段4−1は、最適化部4Cの処理に加え、組み込み機器条件入力手段6において入力された組み込み機器のROM及びRAMの記憶容量に基づいた判断を行う最適化部4Dを最適化部4Cの代わりに備えている点で最適化手段4と異なる。また、プログラムコードを圧縮するための処理データ・コマンド識別部4E及び変換部4Fを有している点でも異なる。本実施の形態では、処理データ・コマンド識別部4E及び変換部4Fをコード最適化手段4−1の機能の一部として構成しているが、独立したプログラムコード圧縮処理手段としてもよい。
The code optimizing means 4-1 according to the present embodiment performs optimization based on the storage capacity of the ROM and RAM of the embedded device input by the embedded device condition input means 6 in addition to the processing of the optimization unit 4C. It differs from the optimization means 4 in that the
最適化部4Dは、条件検索部4Bが変換条件に合致していると判断した部分について、最適化を行うための変換を行って新たな実行コードを生成するが、その際、まとめる実行コードが多くなると、処理データのデータ量が大きくなり、新たな実行コードのデータ量が大きくなる可能性がある。そのため、組み込み機器によっては、プログラム実行装置が実行処理を行う際、実行コード等を一時的に記憶させるRAMの記憶容量を越えることもある。そこで、最適化部4Dは、組み込み機器条件入力手段6を介して入力された使用可能RAM容量のデータに基づいて、その容量を越えると判断した場合には、各実行コードのデータ量が容量以下の複数の実行コードに分けて生成する。また、全体のプログラムコードのデータ量が、組み込み機器が有するプログラムコードを格納するためのROMの記憶容量を越える場合は、設定の有無に関わらず、処理データ・コマンド識別部4E及び変換部4Fに圧縮処理を行わせる。以上の判断等を行い、新たなプログラムコードを生成する。
The
図8は圧縮した実行データを表す図である。次に圧縮処理について図3に記載した実行コードに基づいて説明する。組み込み機器条件入力手段6でのバイナリ圧縮の入力、最適化部4Dでの判断に基づいて、圧縮処理を行う場合、データ・コマンド識別部4Eでは、プログラムコードの各実行コードについて、辞書部10Aに記憶されている辞書と照合し、辞書と合致しない文字列、数字等を処理データとし、合致した文字列(スクリプト)をコマンドとすることで、処理データとコマンドとを識別処理する。
FIG. 8 shows compressed execution data. Next, the compression process will be described based on the execution code shown in FIG. When compression processing is performed based on binary compression input by the embedded device condition input means 6 and determination by the
変換部4Fは、処理データとコマンドとをそれぞれバイナリデータで表す。ここで、オブジェクトidを表すために2ビット、ECHONET プロパティ(epc )に8ビット、プロパティのデータ型に3ビット、アクセスルールは3ビット、状変時アナウンス有無は1ビット、データサイズは14ビットを割り当てる。バイナリデータとして表した後、所定のデータ量毎に分けたデータを生成する。本実施の形態においては7ビットを所定のデータ量とする。例えば処理データが7で割り切れないデータ量の場合は、例えば残りのビットに“0”を補充する。そして、処理データを表すデータ(以下、このデータについても処理データという)については分けたそれぞれの先頭のビットに“0”を付し、コマンドを判別するためのデータ(以下、このデータについてもコマンドという)については“1”を付す。つまり、これが、処理データであるかコマンドであるかを判定するための判定用ビット(フラグ)となる。これにより、各実行コード(プログラムコード)は1バイト(8ビット)を単位として各バイトコードに分けられる。このように、各項目(要素)の文字列に分かれていた処理データをバイナリデータとしてまとめて処理してデータ量の低減を図る。 The conversion unit 4F represents the processing data and the command as binary data. Here, 2 bits are used to represent the object id, 8 bits are used for the ECHONET property (epc), 3 bits are used for the property data type, 3 bits are used for the access rule, 1 bit is used for the status announcement, and the data size is 14 bits. assign. After being expressed as binary data, data divided for each predetermined data amount is generated. In this embodiment, 7 bits are set as a predetermined data amount. For example, when the processing data has a data amount that is not divisible by 7, for example, “0” is supplemented to the remaining bits. For data representing processing data (hereinafter, this data is also referred to as processing data), “0” is added to each of the divided head bits, and data for determining a command (hereinafter, this data is also referred to as a command). "1" is attached to the above. That is, this is a determination bit (flag) for determining whether it is processing data or a command. Thereby, each execution code (program code) is divided into each byte code in units of 1 byte (8 bits). As described above, the processing data divided into the character strings of the respective items (elements) are collectively processed as binary data to reduce the data amount.
一方、コマンドについては、そのコマンドと1対1で対応するバイナリデータで表す。これにより、そのバイナリデータが表すコマンドを判別することができる。このコマンドとバイナリデータとの関係は関連づけられてデータとして記憶手段10に記憶されており、変換部4Fは生成に際してそのデータを参照する。ここで、コマンド数が128以下であればコマンドを判別するためには1バイトあれば足りる。例えばコマンド数がそれ以上となる等の場合には2バイト以上になるが、その場合でも、実行処理に使用(出現)する頻度の高いコマンド(例えばプロパティ関連等)は1バイトのコードデータでも判別できるようにすることで、プログラムコード全体のデータ量をさらに減らすことができる。なお、本実施の形態による方法によって生成したバイト単位のコードデータを、さらにランレングス法のような公知のビット列圧縮法によって圧縮するようにしてもよい。 On the other hand, a command is represented by binary data corresponding to the command on a one-to-one basis. Thereby, the command represented by the binary data can be determined. The relationship between the command and binary data is associated and stored in the storage means 10 as data, and the conversion unit 4F refers to the data at the time of generation. Here, if the number of commands is 128 or less, one byte is sufficient to determine the command. For example, when the number of commands is more than 2 bytes, it will be 2 bytes or more. Even in that case, commands that are frequently used (appears) for execution processing (eg property-related) are also identified by 1-byte code data. By making it possible, the data amount of the entire program code can be further reduced. The byte-unit code data generated by the method according to the present embodiment may be further compressed by a known bit string compression method such as a run length method.
また、組み込み機器条件入力手段6を介して入力された出力媒体のデータに基づいて、出力手段5は、変換を行う形式を決定し、変換を行う。その際、出力媒体として、電子記憶媒体が選択された場合は、QRコードへの変換は自動的に「しない」が選択される。また、出力媒体として、印刷媒体が選択された場合は、QRコードへの変換は「する」が選択される。 Further, based on the data of the output medium input via the built-in device condition input means 6, the output means 5 determines the format for conversion and performs the conversion. At this time, when an electronic storage medium is selected as the output medium, “not” is automatically selected for conversion to a QR code. When a print medium is selected as the output medium, “Yes” is selected for conversion to a QR code.
組み込み機器が有するプログラム実行装置では、記憶媒体等を介し、例えばROMプログラムコードが格納される。プログラムコードを1バイト単位で読み込み、コマンドを含むデータであるか処理データを含むデータであるかどうかを、判定用ビットに基づいて判定し、処理データを含むデータの場合は、RAMに一時的に記憶させていく。コマンドを含むデータであると判断すると、実行コードに伸張して実行処理を行う。 In the program execution device included in the embedded device, for example, ROM program code is stored via a storage medium or the like. The program code is read in 1-byte units, and it is determined whether the data includes a command or processing data based on the determination bit. If the data includes processing data, the program code is temporarily stored in the RAM. I will remember it. If it is determined that the data includes a command, it is expanded into an execution code and an execution process is performed.
以上のように実施の形態2によれば、組み込み機器(その組み込み機器が有するプログラム実行装置)のプログラムコード実行処理環境(ROM、RAMの記憶容量等)を入力設定するための組み込み機器条件入力手段6を設け、さらにその設定に基づいて、最適化部4Dが新たなプログラムコードを生成するようにしたので、組み込み機器の特性、条件等に応じた、きめ細かなプログラムコード生成を行うことができる。そして、処理データ・コマンド識別部4E及び変換部4Fを有し、プログラムコードの圧縮処理を行うことができるので、ROMの記憶容量削減を図ることができ、低コスト化を図ることができる。そして、圧縮処理において、各実行コードの処理データとコマンドとを識別し、処理データは各要素(項目)をまとめてバイナリデータとし、コマンドは対応する数値をバイナリデータとして、それぞれのデータを7ビットに分け、処理データを含むデータかコマンドを含むデータか判定するための判定用ビットを各データに付すようにして、1バイトのデータに分けるようにしたので、処理データとコマンドをそれぞれ圧縮できる。
As described above, according to the second embodiment, the built-in device condition input means for setting the program code execution processing environment (ROM, RAM storage capacity, etc.) of the built-in device (the program execution device included in the built-in device). 6 and the
1 仕様入力手段、2 コード生成手段、3 コード評価手段、4、4−1 コード最適化手段、4A コード解析部、4B 条件検索部、4C、4D 最適化部、4E 処理データ・コマンド識別部、4F 変換部、5 出力手段、6 組み込み機器条件入力手段、10 記憶手段、10A 辞書部、10B 最適化規則記憶部、20 表示手段、30 入力手段、40 印刷装置、50 メモリ読書装置。
1 specification input means, 2 code generation means, 3 code evaluation means, 4-1, 4-1 code optimization means, 4A code analysis section, 4B condition search section, 4C, 4D optimization section, 4E processing data / command identification section, 4F conversion unit, 5 output unit, 6 embedded device condition input unit, 10 storage unit, 10A dictionary unit, 10B optimization rule storage unit, 20 display unit, 30 input unit, 40 printing device, 50 memory reading device.
Claims (9)
前記プログラムコードを解析するコード解析部、解析した前記プログラムコードに基づいて、前記記憶手段に記憶された前記最適化規則との照合を行い、前記プログラムコードにおいて前記変換条件と合致する部分を検索する条件検索部及び前記変換内容に基づいて前記変換条件と合致する部分を変換し、新たなプログラムコードのデータを生成する最適化部を有するコード最適化手段と
を備えることを特徴とするプログラムコード生成支援装置。 Storage means for storing, as data, an optimization rule composed of conversion conditions and conversion contents for converting program code data;
A code analysis unit for analyzing the program code, and collating with the optimization rule stored in the storage unit based on the analyzed program code, and searching for a portion in the program code that matches the conversion condition Program code generation comprising: a condition search unit; and a code optimization unit having an optimization unit that converts a portion that matches the conversion condition based on the conversion content and generates data of a new program code Support device.
前記プログラムコードを解析し、前記連続する回数をカウントするコード解析部、解析した前記プログラムコードを前記記憶手段に記憶された前記最適化規則と照合し、前記カウントした数に基づいて前記プログラムコードにおいて前記変換条件と合致する部分を検索する条件検索部及び前記変換内容に基づいて前記変換条件と合致する部分を変換し、新たなプログラムコードのデータを生成する最適化部とを有するコード最適化手段と
を備えることを特徴とするプログラムコード生成支援装置。 Conversion conditions determined based on the number of times the execution code based on the same command continues for the processing code used for the execution process and the execution code consisting of the execution code consisting of the command representing the execution process content, and the conversion content Storage means for storing optimization rules composed of:
A code analysis unit that analyzes the program code and counts the number of consecutive times, compares the analyzed program code with the optimization rule stored in the storage unit, and in the program code based on the counted number Code optimization means comprising: a condition search unit that searches for a part that matches the conversion condition; and an optimization unit that converts a part that matches the conversion condition based on the conversion content and generates data of a new program code And a program code generation support apparatus.
記憶手段に記憶された、プログラムコードを変換するための変換条件のデータと、解析した前記プログラムコードとの照合を条件検索手段が行い、前記プログラムコードにおいて前記変換条件と合致する部分を検索する工程と、
変換手段において、前記変換条件と合致する部分を、前記記憶手段に記憶された変換内容のデータに基づいて変換し、新たなプログラムコードのデータを生成する工程と
を有することを特徴とするプログラムコード生成支援方法。 Analyzing the generated program code in an analysis means;
A step in which the condition search means collates the data of the conversion condition for converting the program code stored in the storage means with the analyzed program code, and searches for a portion in the program code that matches the conversion condition When,
And converting the portion that matches the conversion condition based on the conversion content data stored in the storage means to generate new program code data in the conversion means. Generation support method.
記憶手段に記憶された、プログラムコードを変換するための変換条件のデータと、解析した前記プログラムコードとの照合を行い、前記プログラムコードにおいて前記変換条件と合致する部分を検索する工程と、
前記変換条件と合致する部分を、前記記憶手段に記憶された変換内容のデータに基づいて変換し、新たなプログラムコードのデータを生成する工程と
をコンピュータに行わせることを特徴とするプログラムコード生成支援方法のプログラム。
Analyzing the generated program code;
A step of collating the conversion condition data for converting the program code stored in the storage means and the analyzed program code, and searching for a portion that matches the conversion condition in the program code;
A program code generation characterized by causing a computer to convert a portion that matches the conversion condition based on conversion content data stored in the storage means and generating new program code data Support method program.
Priority Applications (16)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005028122A JP4638250B2 (en) | 2005-02-03 | 2005-02-03 | Program code generation support apparatus and method, and program code generation support method program |
EP09014774.5A EP2161659B1 (en) | 2005-02-03 | 2006-02-02 | Program code generation support device and method, program execution device and method, and program code compression processing device and method and program thereof |
KR1020077016934A KR100902461B1 (en) | 2005-02-03 | 2006-02-02 | Program code generation support device and method, program execution device and method, program code compression device and method, program for the same |
CN 200810184954 CN101458620B (en) | 2005-02-03 | 2006-02-02 | Program execution device and method, program code compression device and method, and device |
EP10014002.9A EP2330502B1 (en) | 2005-02-03 | 2006-02-02 | Program code generation support device and method, program execution device and method, and program code compression processing device and method and program thereof |
EP06712888.4A EP1881401B1 (en) | 2005-02-03 | 2006-02-02 | Program code generation support device and method, program execution device and method, program code compression device and method, program for the same |
ES10014002T ES2708499T3 (en) | 2005-02-03 | 2006-02-02 | Device and method of supporting the generation of program code, device and method of execution of the program, and device and method of processing the compression of the program code and program for the same |
ES06712888.4T ES2687433T3 (en) | 2005-02-03 | 2006-02-02 | Device and method of support for the generation of program code, device and method of execution of the program, device and method of compression of the program code, program for the same |
PCT/JP2006/301745 WO2006082878A1 (en) | 2005-02-03 | 2006-02-02 | Program code generation support device and method, program execution device and method, program code compression device and method, program for the same |
CN2006800040337A CN101116054B (en) | 2005-02-03 | 2006-02-02 | Program code generation support device and method, program execution device and method, program code compression device and method, program for the same |
ES09014774T ES2728318T3 (en) | 2005-02-03 | 2006-02-02 | Device and method of support for the generation of program code, device and method of program execution, and device and method of processing the compression of the program and program code for the same |
US11/883,627 US8448158B2 (en) | 2005-02-03 | 2006-02-02 | Program code generation support device and method, program execution device and method, and program code compression processing device and method and program thereof |
TW095103700A TWI312482B (en) | 2005-02-03 | 2006-02-03 | Program codes generation supporting device and method, program execution device and method, program codes compressing processing device and method, and computer readable recording medium with its recorded program thereof |
HK09108809.5A HK1130916A1 (en) | 2005-02-03 | 2009-09-25 | Program execution device and method, and program code compression processing device and method and apparatus |
US13/195,073 US8572557B2 (en) | 2005-02-03 | 2011-08-01 | Program code generation support device and method, program execution device and method, and program code compression processing device and method and program thereof |
US13/195,107 US8527967B2 (en) | 2005-02-03 | 2011-08-01 | Program code compression processing device and method and program thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2005028122A JP4638250B2 (en) | 2005-02-03 | 2005-02-03 | Program code generation support apparatus and method, and program code generation support method program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2006215826A true JP2006215826A (en) | 2006-08-17 |
JP4638250B2 JP4638250B2 (en) | 2011-02-23 |
Family
ID=36979016
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2005028122A Expired - Fee Related JP4638250B2 (en) | 2005-02-03 | 2005-02-03 | Program code generation support apparatus and method, and program code generation support method program |
Country Status (2)
Country | Link |
---|---|
JP (1) | JP4638250B2 (en) |
CN (2) | CN101116054B (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007036937A (en) * | 2005-07-29 | 2007-02-08 | Mitsubishi Electric Corp | Device and program for supporting protocol conversion programming |
JP2008263497A (en) * | 2007-04-13 | 2008-10-30 | Mitsubishi Electric Corp | Gateway device, data setting device and gateway system |
JP2011129099A (en) * | 2009-12-18 | 2011-06-30 | Korea Electronics Telecommun | Robot service loading method in intelligent type service robot environment, and service loading device for the same |
JP6109997B1 (en) * | 2016-07-26 | 2017-04-05 | ネットエージェント株式会社 | Software generation system, information processing apparatus, and program |
JP6193460B1 (en) * | 2016-09-30 | 2017-09-06 | ネットエージェント株式会社 | Software providing method, information processing apparatus, and program |
JP6207782B1 (en) * | 2017-03-08 | 2017-10-04 | ネットエージェント株式会社 | Software generation system, information processing apparatus, and program |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2011257904A (en) * | 2010-06-08 | 2011-12-22 | Hitachi Ltd | Control apparatus and data processing method thereof |
JP5490170B2 (en) * | 2012-04-03 | 2014-05-14 | 三菱電機株式会社 | Program creation support apparatus and program creation support method |
CN107729147B (en) * | 2014-03-06 | 2021-09-21 | 华为技术有限公司 | Data processing method in stream computing system, control node and stream computing system |
JP6151729B2 (en) * | 2015-01-16 | 2017-06-21 | ファナック株式会社 | A control system with a function to optimize the control software of a numerical controller according to the machining program |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63139646U (en) * | 1987-02-28 | 1988-09-14 | ||
JPH0721032A (en) * | 1993-07-01 | 1995-01-24 | Mitsubishi Electric Corp | Program optimization processing system |
JPH10320172A (en) * | 1997-05-15 | 1998-12-04 | Seiko Epson Corp | Program compression method, program decryption method, and program storage device |
JP2000020318A (en) * | 1998-07-03 | 2000-01-21 | Fujitsu Ltd | Memory access instruction reduction device and recording medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5859982A (en) * | 1996-06-05 | 1999-01-12 | Sun Microsystems, Inc. | Computer system and method for executing methods of downloaded programs with reduced run-time memory space requirements |
WO1998011723A1 (en) * | 1996-09-11 | 1998-03-19 | Matsushita Electric Industrial Co., Ltd. | Program reception/execution apparatus which can start execution of program even when only part of program is received, and program transmitter for it |
CN1186987A (en) * | 1998-01-14 | 1998-07-08 | 英业达股份有限公司 | Information compression method and device thereof |
JP3956131B2 (en) * | 2002-12-26 | 2007-08-08 | インターナショナル・ビジネス・マシーンズ・コーポレーション | Program conversion apparatus, program conversion method, and program |
-
2005
- 2005-02-03 JP JP2005028122A patent/JP4638250B2/en not_active Expired - Fee Related
-
2006
- 2006-02-02 CN CN2006800040337A patent/CN101116054B/en not_active Expired - Fee Related
- 2006-02-02 CN CN 200810184954 patent/CN101458620B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS63139646U (en) * | 1987-02-28 | 1988-09-14 | ||
JPH0721032A (en) * | 1993-07-01 | 1995-01-24 | Mitsubishi Electric Corp | Program optimization processing system |
JPH10320172A (en) * | 1997-05-15 | 1998-12-04 | Seiko Epson Corp | Program compression method, program decryption method, and program storage device |
JP2000020318A (en) * | 1998-07-03 | 2000-01-21 | Fujitsu Ltd | Memory access instruction reduction device and recording medium |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2007036937A (en) * | 2005-07-29 | 2007-02-08 | Mitsubishi Electric Corp | Device and program for supporting protocol conversion programming |
JP4738086B2 (en) * | 2005-07-29 | 2011-08-03 | 三菱電機株式会社 | Protocol conversion program creation support apparatus and creation support program |
JP2008263497A (en) * | 2007-04-13 | 2008-10-30 | Mitsubishi Electric Corp | Gateway device, data setting device and gateway system |
JP4722076B2 (en) * | 2007-04-13 | 2011-07-13 | 三菱電機株式会社 | Gateway device, data setting device, gateway system |
JP2011129099A (en) * | 2009-12-18 | 2011-06-30 | Korea Electronics Telecommun | Robot service loading method in intelligent type service robot environment, and service loading device for the same |
US8793648B2 (en) | 2009-12-18 | 2014-07-29 | Electronics And Telecommunications Research Institute | Method and device for loading service application of robot based on ubiquitous robotic companion (URC) environment |
JP6109997B1 (en) * | 2016-07-26 | 2017-04-05 | ネットエージェント株式会社 | Software generation system, information processing apparatus, and program |
JP6193460B1 (en) * | 2016-09-30 | 2017-09-06 | ネットエージェント株式会社 | Software providing method, information processing apparatus, and program |
JP2018055629A (en) * | 2016-09-30 | 2018-04-05 | ネットエージェント株式会社 | Method for providing software, information processing device and program |
JP6207782B1 (en) * | 2017-03-08 | 2017-10-04 | ネットエージェント株式会社 | Software generation system, information processing apparatus, and program |
Also Published As
Publication number | Publication date |
---|---|
CN101116054A (en) | 2008-01-30 |
JP4638250B2 (en) | 2011-02-23 |
CN101458620B (en) | 2013-10-23 |
CN101116054B (en) | 2010-05-19 |
CN101458620A (en) | 2009-06-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8448158B2 (en) | Program code generation support device and method, program execution device and method, and program code compression processing device and method and program thereof | |
JP4638250B2 (en) | Program code generation support apparatus and method, and program code generation support method program | |
CN105808513B (en) | Conversion equipment and conversion method | |
US20160056839A1 (en) | Compression device, compression method, decompression device, decompression method, and computer-readable recording medium | |
US8572557B2 (en) | Program code generation support device and method, program execution device and method, and program code compression processing device and method and program thereof | |
JP5671320B2 (en) | Information processing apparatus, control method therefor, and program | |
CN100561464C (en) | The document transformation system | |
EP3385860A1 (en) | Compression of text using multiple dynamic dictionaries | |
JP4738086B2 (en) | Protocol conversion program creation support apparatus and creation support program | |
CN1825301B (en) | Method of character transition and system of the same | |
JP4316422B2 (en) | Measurement data communication device, health information communication device, information acquisition device, measurement data communication system, measurement data communication device control method, information acquisition device control method, measurement data communication device control program, and computer-readable recording medium | |
CN117614799B (en) | Sensor protocol adaptation method and device based on model hierarchical mapping | |
JP2004302849A (en) | Fa controller | |
JP2010282248A (en) | Programming language analysis execution program | |
JP4656960B2 (en) | Program execution device, method, program execution method program, program code compression device, method, and program code compression method program | |
JP2009064150A (en) | Wireless tag reader/writer apparatus, method of detecting drop-out of wireless tag, and wireless tag | |
JP5247791B2 (en) | Program code compression apparatus, method, and program code compression method program | |
JP2005333269A5 (en) | ||
EP2278448A2 (en) | Print apparatus and method of controlling printer | |
CN114327753A (en) | Method, device, equipment and medium for predicting container construction results | |
JPH01177241A (en) | Received data converter for different format data transmission system | |
JPH0796639A (en) | Printer device | |
JPH06202874A (en) | Microcomputer development supporting device | |
CN102736994A (en) | Data writing method and data writing device | |
JPH0451333A (en) | Dump program execution device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20070726 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20100921 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20101029 |
|
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: 20101116 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20101125 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20131203 Year of fee payment: 3 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 4638250 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
LAPS | Cancellation because of no payment of annual fees |