JP2004234405A - Protocol encoder/decoder - Google Patents

Protocol encoder/decoder Download PDF

Info

Publication number
JP2004234405A
JP2004234405A JP2003023060A JP2003023060A JP2004234405A JP 2004234405 A JP2004234405 A JP 2004234405A JP 2003023060 A JP2003023060 A JP 2003023060A JP 2003023060 A JP2003023060 A JP 2003023060A JP 2004234405 A JP2004234405 A JP 2004234405A
Authority
JP
Japan
Prior art keywords
protocol
program routine
type
interface structure
template
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2003023060A
Other languages
Japanese (ja)
Inventor
Toshitatsu Noda
敏達 野田
Masahiro Komura
昌弘 小村
Nobuyuki Kanetani
延幸 金谷
Hiroko Nakayama
裕子 中山
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2003023060A priority Critical patent/JP2004234405A/en
Publication of JP2004234405A publication Critical patent/JP2004234405A/en
Pending legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a protocol encoding/decoding system for reflecting customization, when a program routine for performing the mutual conversion of data structures in an abstract syntax notation message and a C language, etc., is automatically generated from a protocol which is described by abstract syntax. <P>SOLUTION: A protocol encoder/decoder includes: a means for receiving the customizing rule of processing contents in an interface structure body defined by a user and the program routine; a customizing rule analyzing means for analyzing the received customizing rule together with a protocol specification; a customizing rule processing means for processing an application to the protocol specification concerning the analyzed customizing rule; a program routine generating means for generating the interface structure body and the program routine, based on the customizing rule; and a result output means for outputting a result which is obtained by the program routine generating means. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、抽象構文記法メッセージとC言語等処理系のデータ構造との相互変換を行うプログラムルーチンを抽象構文で記述されたプロトコルから自動生成するにあたり、カスタマイズを反映させるプロトコル符号化/復号化システムの技術分野に関する。
【0002】
【従来の技術】
コンピュータ間の送受信のプロトコルは、抽象構文記法1(ASN.1:Abstract Syntax Notation1)による抽象構文で記述されている。これは、MHS(Message Handling System 電子メールシステム)やSNMP(Simple Network Protocol簡易ネットワークプロトコル)等のプロトコルの構文規定をするための言語である。その手順については、ISO(International Organization for Standardization 国際標準化機構)によって定められた標準に基づいている。そして、抽象構文記法メッセージは、MHS、SNMPなどで実際に扱われるデータであり、BER方式(Basic Encoding Rule) やDER方式(Distributed Encoding Rule) で符号化したデータにより、送受信されるのが一般的となっている。
【0003】
上記抽象構文記法メッセージはそのままでは扱いにくいため、一般的にC言語等の処理系のデータ構造に変換して扱う。プロトコル毎に構文規定は異なるため、プログラムルーン(デコーダ/エンコーダ)、インターフェース用構造体もプロトコル毎に作成する必要があるが、大変な作業となるため、ASN.1コンパイラが、抽象構文記法で記述されたプロトコルの構文規定からデコーダ、エンコーダ、インターフェース用構造体を作成するためのツールとして提供される現状にある。
【0004】
ここで、以下に使用するキーの用語について具体例をもって説明しておく。
抽象構文記法「ASN.1」:
例1(ASN.1による構文規定)

Figure 2004234405
ASN.1を用いて上記のように構文規定が行われている場合、以下の意味をもつ。TypeA 型はTypeB 型であるb とTypeC 型であるc をデータとしてもつ型である。TypeB 型はINTEGER 型すなわち整数値をもつ型であり、TypeC 型はOCTET STRING型すなわちバイト列をもつ型である。
抽象構文記法メッセージ:
例2(「DER」方式符号化)
0000: 30 SEQUENCEの型番号
0001: 08 データサイズ (0002〜0009の8 バイト)
0002: 02 INTEGER (= TypeB) の型番号
0003: 01 b のデータサイズ (0005の1 バイト)
0004: 05 b のデータ
0005: 04 OCTET STRING (= TypeC)の型番号
0006: 03 c のデータサイズ(0007 〜0009の3 バイト)
0007: 03 02 03 c のデータ
( 注) データは16進数で記述している。
【0005】
「型番号」「データサイズ」「データ」の構成となっており、上記例1の構文規定において、b が5という整数値、c が3、2、3というバイト列をデータとしてもつTypeA 型のデータを扱う場合、「DER」方式で符号化したデータは上記10バイトのデータとなる。
デコーダ、エンコーダ、インターフェース用構造体:
例3(例1の構文規定に対応したインターフェース用構造体)
Figure 2004234405
typeA は、b 値をもつtypeB と c値をもつtypeC で構成され、typeB は int型、typeC は char型へのポインタを示している。
【0006】
上記のように、抽象構文記法メッセージは、一般にC言語等の処理系のデータ構造に変換して扱いやすい形式にして使用する。デコーダは、抽象構文記法メッセージから処理系のデータ構造に変換する処理を行うプログラムルーチンであり、エンコーダは、処理系のデータ構造から抽象構文記法メッセージに変換する処理を行うプログラムルーチンである。そして、インターフェース用構造体は、処理系のデータ構造を構築するためのものである。
【0007】
従来、ASN.1等の抽象構文記法で記述されたプロトコル仕様を入力として、インターフェース用構造体およびデコーダ (BER、DER等の抽象構文記法メッセージをインターフェース用構造体に格納するためのC言語等で記述されたプログラムルーチン) /エンコーダ (インターフェース用構造体に格納されたデータから抽象構文記法メッセージを生成するためのC言語等で記述されたプログラムルーチン) を生成、出力するシステムが提案されてきた(例えば、特許文献1参照)。
【0008】
さらに、上記従来例について、図15に示す従来のプロトコル符号化/復号化のフローチャートを用いて説明する。ユーザの入力になるプロトコル仕様のデータを受けて(ステップS11)、プロトコル仕様の内容を解析し(ステップS12)、解析結果にしたがってインターフェース用構造体およびデコーダ/エンコーダのプログラムルーチンを生成し(ステップS13)、その結果を出力する(ステップS14)システムとなっている。
【0009】
【特許文献1】
特開平7−168772号公報(第2〜9頁)
【0010】
【発明が解決しようとする課題】
プロトコルを処理するアプリケーションを開発する上で、インターフェース用構造体の構造はアプリケーション毎に最適な構造であることが望ましい。しかしながら、従来技術では、生成できるインターフェース用構造体の構造、デコーダ、エンコーダの形式は固定されており、インターフェース用構造体の構成、デコーダ、エンコーダをアプリケーション毎に変えて生成するには、相当な手作業が入り、大変使い勝手の悪いものとなっていた。
【0011】
また、多種のアプリケーションと接続する通信環境下では、既存のASN.1コンパイラを使用して,インターフェース用構造体およびデコーダ、エンコーダをアプリケーション毎にカスタマイズするには、自動生成されたインターフェース用構造体およびデコーダ、エンコーダを人手で修正するため、バグも発生しやすく多大の工数を必要としていた。
【0012】
そこで、アプリケーション開発において、抽象構文のメッセージを変換 (デコードおよびエンコード) するためのプログラムルーチンおよびインターフェース用構造体の構成を、ユーザが使いやすいようにカスタマイズすることが求められる。本発明では、上記欠点を補うため、デコーダ/エンコーダのプログラムルーチンが処理しやすい形式のデータ構造を実現し、かつ、これらプログラムルーチンのサイズのコンパクト化および処理の高速化を図ることを目的とする。
【0013】
【課題を解決するための手段】
第一の発明は、プロトコル仕様の入力を受けて抽象構文記法メッセージと言語処理系のデータ構造との間の変換を行うプログラムルーチンをカスタマイズして生成するプロトコル符号化/復号化装置であって、ユーザによって定義され入力されたインタフェース用構造体およびプログラムルーチンの処理内容に関するカスタマイズルールを受け付けるカスタマイズルール受付手段と、受け付けた前記カスタマイズルールを前記プロトコル仕様とともに解析するカスタマイズルール解析手段と、解析された前記カスタマイズルールについて前記プロトコル仕様への適用を処理するカスタマイズルール処理手段と、前記カスタマイズルールにしたがってインタフェース用構造体およびプログラムルーチンを生成するプログラムルーチン生成手段と、前記プログラムルーチン生成手段によって得られた結果を出力する結果出力手段とを有することを特徴とするプロトコル符号化/復号化装置に関する。
【0014】
すなわち、第一の発明によれば、インターフェース用構造体の構造の変更、あるいはプログラムルーチン(デコーダ/エンコーダ)の処理内容の変更、追加を行うために、カスタマイズルール受付手段、カスタマイズルール解析手段、およびカスタマイズルール処理手段を持つことによって、利用者が意図するようなインターフェース用構造体の構造、およびプログラムルーチン(デコーダ/エンコーダ)を生成、出力するシステムが実現できる。
【0015】
第二の発明は、前記インタフェース用構造体およびプログラムルーチンに関するカスタマイズにおいて、前記プロトコル符号化/復号化装置は、現在処理中の型の出現位置に関する型依存関係の情報を記憶装置に逐次格納しておく型依存情報格納手段を有し、該位置における任意の型あるいはその任意の要素の変更を行うことを特徴とする上記第一の発明に記載のプロトコル符号化/復号化装置に関する。
【0016】
すなわち、第二の発明によれば、プロトコル符号化/復号化装置に型依存関係を記憶させておくことで、同じ型でも登場する位置によって、別の型に対応させたり、処理を行わせたりすることを可能にしている。
第三の発明は、前記カスタマイズルール処理手段は、型あるいは型依存関係に対し、任意のインタフェース用構造体およびプログラムルーチンが新たに定義される新規定義手段を有することを特徴とする上記第一あるいは第二の発明に記載のプロトコル符号化/復号化装置。
【0017】
すなわち、第三の発明によれば、新規定義手段によって各々のASN.1型および型依存関係を新たに定義しておくことで、任意のインターフェース用構造体およびプログラムルーチン(デコーダ/エンコーダ)を生成することが可能となる。
第四の発明は、前記インタフェース用構造体およびプログラムルーチンに関するカスタマイズにおいて、前記プロトコル符号化/復号化装置は、使用頻度の多いものについてテンプレートとして保存しておくテンプレート登録手段と、そのテンプレートを選択可能とするテンプレート選択手段とを有することを特徴とする上記第一乃至第三の発明に記載のプロトコル符号化/復号化装置に関する。
【0018】
すなわち、第四の発明によれば、テンプレート格納手段およびテンプレート選択手段によって、インターフェース用構造体、プログラムルーチン(デコーダ/エンコーダ)に関して、よく実行されそうなカスタマイズについて予めいくつかのテンプレートを記憶させておくことで、使用時に記憶されたテンプレートを取り出して選択することが可能となる。
【0019】
第五の発明は、前記インタフェース用構造体の構造およびプログラムルーチンのカスタマイズにおいて、前記プロトコル符号化/復号化装置は、新規定義が行われない場合で、かつ、前記テンプレートが選択されない場合、前記インタフェース用構造体およびプログラムルーチンが採用するデフォルトを登録しておくデフォルト登録手段を有することを特徴とする上記第三あるいは第四の発明に記載のプロトコル符号化/復号化装置に関する。
【0020】
すなわち、第五の発明によれば、デフォルト格納手段によって、カスタマイズルールにて新規定義がなく、かつ、テンプレートの選択がない場合において、インターフェース用構造体、プログラムルーチン(デコーダ/エンコーダ)にデフォルトを使用することを可能としている。
【0021】
【発明の実施の形態】
以下、図面にもとづいて本発明の実施形態を説明する。
図1に本発明の実施の形態になる基本システム構成を示す。プロトコル符号化/復号化装置1は、プロトコル処理装置2とカスタマイズ処理装置3および記憶装置4で構成される。
【0022】
プロトコル処理装置2は、ユーザからのプロトコル仕様の入力を受け付けるプロトコル仕様受付手段21、プロトコル仕様解析手段22、現在処理中である型の依存関係の情報を格納する型依存情報格納手段23、インターフェース用構造体およびデコーダ/エンコーダのプログラムルーチンを生成するプログラムルーチン生成手段24、および結果出力手段25を有する。
【0023】
カスタマイズ処理装置3は、カスタマイズルール受付手段31、カスタマイズルール処理手段32、そのサブセットとして、カスタマイズの処理機能を追加する処理追加手段32a、新しくカスタマイズの定義を規定する新規定義手段32b、予め登録されたテンプレートを選択するテンプレート選択手段32c、カスタマイズルール解析手段33、およびテンプレート/デフォルトの入力を受付けてカタマイズルール記憶装置4に予め登録しておくテンプレート登録手段34/デフォルト登録手段35を有する。
【0024】
記憶装置4には、現在処理中の型データを示す型依存情報41、テンプレート42、およびデフォルトテーブル43が格納されている。
ここで、プロトコル符号化/復号化装置1はコンピュータであり、予め内蔵されたプロトコル処理およびカスタマイズ処理のプログラムが内蔵されており、プロトコル処理装置2およびカスタマイズ処理装置3における各手段によってコンピュータ上でそれらの処理が実行される。当該プログラムは、フロッピーディスク、コンパクトディスク、CD−ROM等のコンピュータ読取可能な記録媒体に記録され、図には示していないが、内蔵あるいは、外部接続された媒体読取装置にセットしインストールすることによって実行可能な状態としてもよい。
【0025】
つぎに、本発明の基本的な動作について、図2、図3のフローチャートを用いて以下に説明する。
図2は、本発明の実施の形態になるテンプレート/デフォルト登録のフローチャートを示す。ユーザによって入力されたテンプレート/デフォルトのデータを受付けて(ステップS11)、そのテンプレート/デフォルトに関する入力情報は、テンプレート42およびデフォルトテーブル43として記憶装置4に初期登録される(ステップS12)。
【0026】
図3は、本発明の実施の形態になるプロトコル符号化/複号化のフローチャートを示す。プロトコル符号化/複号化1において、まず、プロトコル仕様受付手段21が、ユーザからのプロトコル仕様の入力を受け付け(ステップS21)、同時に、カスタマイズルール受付手段31が、ユーザが定義し入力したカスタマイズルールを受け付け(ステップS22)、カスタマイズルール解析手段33およびプロトコル仕様解析手段22によって、その受け付けたカスタマイズルールおよびプロトコル仕様が解析され(ステップS23)、その解析されたカスタマイズルールに基づき、カスタマイズルール処理手段32およびプログラムルーチン生成手段24によって、該カスタマイズルールが適用処理され、カスタマイズを反映したインターフェース用構造体およびプログラムルーチンが自動生成され(ステップS24)、結果出力手段25によってその結果が出力される(ステップS25)。
【0027】
図4は、プロトコル仕様の例を示す。抽象構文記法で記述されたプロトコルの例で、SEQUENCEは複数の値を持たせる型を意味し、SampleA は、SampleA.b1.i型やSampleA.b2.i型などはINTEGER 型であることを示している。このようなINTEGER 型のうち、SampleA.b1.i型のみdouble型 (C)とし、それ以外のINTEGER 型をint 型 (C)にしたり、SampleA.b2.i型もint 型 (C)にしたりというように、同じ型でも登場する位置によって対応する型 (C)や処理 (C)を変えたい場合が生じることがあるが、従来はそれへの対応は不可能であった(ここで、 (C)は、C言語適用の場合を示す)。そこで、以下に述べるカスタマイズの導入を行った。
【0028】
図5は、本発明の実施の形態になるカスタマイズルールの例(その1)を示す。本発明では、システムに型依存関係を記憶させておくことで、同じ型でも登場する位置によって、別の型 (C)に対応させたり、処理 (C)を行わせたりすることを可能にしている。実施例において、SampleA.b1.i型を処理する際にこの型がINTEGER 型、かつ SampleB.i型、SampleA.b1.i型であることを型依存情報41として記憶装置4に記憶しているため、本図のようなカスタマイズルールを記述することによって、SampleA.b1.i型はdouble型 (C)、それ以外のINTEGER 型は、int 型 (C)として処理するようなインターフェース用構造体、デコーダ、エンコーダを生成することが可能となる(コード生成例は図14の▲1▼に示す)。
【0029】
図6は、本発明の実施の形態になるカスタマイズルールの例(その2)を示す。本例は、型あるいは型依存関係に対して、任意のインターフェース用構造体、デコーダ、エンコーダを新規定義するための新規定義手段32bを有することで、カスタマイズルールに記述された新規定義を反映させた例を示す。図4のプロトコル仕様において、図6のようなカスタマイズルールにコードを埋め込むことによって、SampleC 型に対応する任意のインターフェース用構造体、デコーダ、エンコーダの生成を可能にしている(コード生成例は図14の▲2▼に示す)。
【0030】
図7は、本発明の実施の形態になるカスタマイズルールの例(その3)を示す。図5のプロトコル仕様において、構造体をポインタ形式とするか、実体埋め込みとするのかのテンプレート (図11)を用意しておき、図7のようにカスタマイズルールを記述することによって、自動的にSampleA.b2型に対応する構造体はポインタ参照形式、それ以外は実体埋め込み形式となるようなインターフェース用構造体、デコーダ、エンコーダを生成させることができる(コード生成例は図14の▲3▼に示す)。
【0031】
図8は、本発明の実施の形態になるカスタマイズルールの例(その4)を示す。ここでは、生成するデコーダあるいはエンコーダについて、その要素を処理する際に、インライン展開形式にしたい場合、あるいは関数呼び出し形式にしたいという場合示している。実施例では、図4のプロトコル仕様において、インライン展開か、関数呼び出しかのテンプレート(図11)を用意しておき、図8のようなカスタマイズルールを記述することにより、自動的にSampleA.b1型に対応する処理はインライン展開形式、それ以外は関数呼び出し形式となるようなデコーダ、エンコーダを生成することを可能としている(コード生成例は図14の▲4▼に示す)。
【0032】
図9は、本発明の実施の形態になるカスタマイズルールの例(その5)を示す。本例では、生成したデコーダもしくはエンコーダに任意の追加処理を付与するための処理追加手段32aを有することで、デコーダ、エンコーダにカスタマイズルールに記述された追加処理を付与可能としている。ここでは、生成されたデコーダ、エンコーダに対して、アプリケーションに特化した処理を追加したい場合を扱っている。図5のプロトコル仕様において、図10のようなカスタマイズルールにコードを埋め込むことで、SampleA 型およびSampleA.b2型に対応するデコーダ、エンコーダに追加処理を付与したデコーダ、エンコーダが生成される(コード生成例は図14の▲5▼に示す)。
【0033】
本実施例では、SampleA やSampleA.の中のC をデコードする前および後に出力処理させる例を示している。
図10は、本発明の実施の形態になるテンプレートの例(その1)を示す。インターフェース用構造体、デコーダ、エンコーダを生成するにあたり、その全てのASN.1型に対応するインターフェース用構造体、デコーダ、エンコーダをカスタマイズルールで定義するのは大変な作業である。しかし、例えば、INTEGER 型をC の型に変換するにあたり、int 型 (C)やdouble型 (C)などのある程度決まった型に変換される。そこで、INTEGER 型をint 型 (C)に変換するdecode_int 関数や、int 型 (C)をINTEGER 型に変換するencode_int 関数、INTEGER 型をdouble型 (C)に変換するdecode_double_for _real関数や、double型 (C)を INTEGER型に変換するencode_double_for _real関数等について、例えば、本図のようなテンプレートを用意しておくことでASN.1型に対応した変換を容易に行うことができる。
【0034】
本例のテンプレート42は、ASN.1型101、生成型102、Cの型103、デコーダ104、およびエンコーダ105の項目を有する複数のレコードで構成されている。ASN.1型101は、抽象構文記法による型であり、生成型102は、テンプレートとしての型名を表し、Cの型103は、インタフェース用構造体の型を含むC言語における型を示している。デコーダ104、エンコーダ105は、それぞれのプログラムルーチンにおける各関数を示している。
【0035】
図11は、本発明の実施の形態になるテンプレートの例(その2)を示す。生成するインターフェース用構造体の要素をポインタ参照形式にしたい場合や、実体埋め込み形式にしたい場合に本テンプレートが用意される。
図12は、本発明の実施の形態になるテンプレートの例(その3)を示す。生成するデコーダあるいはエンコーダについて、要素を処理する際にインライン展開形式にしたい場合、あるいは関数呼び出し形式にしたい場合に適用される。
【0036】
図13は、本発明の実施の形態になるデフォルトの例を示す。カスタマイズルールにて新規定義が行われていない場合で、かつ、テンプレートが選択されない場合に本デフォルトが適用される。
本デフォルトテーブル43は、ASN.1型101、構造体103、デコーダ104、エンコーダ105、ポインタ/埋込106、およびインライン/関数107の項目を有する複数のレコードで構成されている。図10と同様に、ASN.1型101は、抽象構文記法による型であり、構造体103は、C言語によるインタフェース用構造体を示しており、デコーダ104、エンコーダ105は、それぞれのプログラムルーチンにおける型を示している。ポインタ/埋込106は、データはポインタ参照型形式とするか、実体埋め込み型形式とするかを示しており、また、インライン/関数107は、インライン展開形式とするか、関数呼び出し形式とするかを示しており、本実施例では、REAL、INTEGER とも「実体埋め込み形式」、「関数呼び出し形式」としている。
【0037】
図14は、本発明の実施の形態になるプログラムルーチンの生成例を示す。本実施例では、デコーダのみの例で示している。これまで述べてきたカスタマイズルール例(その1)〜(その5)が適用された場合のプログラムルーチン(デコーダのケース)を示しており、それぞれの適用箇所については、図中に▲1▼〜▲5▼のマークを挿入して示した。
【0038】
以上述べてきた発明の中で、さらに、プロトコル仕様の入力とカスタマイズルールの入力を分離し、カスタマイズルールでは、型依存関係とカスタマイズルールの組として記述することによって、同じプロトコルを処理するアプリケーションであっても、各々別のカスタマイズルールを採用したい場合に対する解決を与えるものとなる。
【0039】
(付記1) プロトコル仕様の入力を受けて抽象構文記法メッセージと言語処理系のデータ構造との間の変換を行うプログラムルーチンをカスタマイズして生成するプロトコル符号化/復号化装置であって、
ユーザによって定義され入力されたインタフェース用構造体およびプログラムルーチンの処理内容に関するカスタマイズルールを受け付けるカスタマイズルール受付手段と、
受け付けた前記カスタマイズルールを前記プロトコル仕様とともに解析するカスタマイズルール解析手段と、
解析された前記カスタマイズルールについて前記プロトコル仕様への適用を処理するカスタマイズルール処理手段と、
前記カスタマイズルールにしたがってインタフェース用構造体およびプログラムルーチンを生成するプログラムルーチン生成手段と、
前記プログラムルーチン生成手段によって得られた結果を出力する結果出力手段と、
を有することを特徴とするプロトコル符号化/復号化装置。
【0040】
(付記2) 前記インタフェース用構造体およびプログラムルーチンに関するカスタマイズにおいて、前記プロトコル符号化/復号化装置は、現在処理中の型の出現位置に関する型依存関係の情報を記憶装置に逐次格納しておく型依存情報格納手段を有し、該位置における任意の型あるいはその任意の要素の変更を行うことを特徴とする付記1記載のプロトコル符号化/復号化装置。
【0041】
(付記3) 前記カスタマイズルール処理手段は、型あるいは型依存関係に対し、任意のインタフェース用構造体およびプログラムルーチンが新たに定義される新規定義手段を有することを特徴とする付記1あるいは付記2記載のプロトコル符号化/復号化装置。
(付記4) 前記インタフェース用構造体およびプログラムルーチンに関するカスタマイズにおいて、前記プロトコル符号化/復号化装置は、使用頻度の多いものについてテンプレートとして保存しておくテンプレート登録手段と、そのテンプレートを選択可能とするテンプレート選択手段とを有することを特徴とする付記1乃至付記3のいずれかに記載のプロトコル符号化/復号化装置。
【0042】
(付記5) 前記テンプレート登録手段では、テンプレートの追加、変更、および削除がユーザの入力によって行えることを特徴とする付記4記載のプロトコル符号化/復号化装置。
(付記6) 前記インタフェース用構造体の構造およびプログラムルーチンのカスタマイズにおいて、前記プロトコル符号化/復号化装置は、新規定義が行われない場合で、かつ、前記テンプレートが選択されない場合、前記インタフェース用構造体およびプログラムルーチンが採用するデフォルトを登録しておくデフォルト登録手段を有することを特徴とする付記3あるいは付記4記載のプロトコル符号化/復号化装置。
【0043】
(付記7) プロトコル仕様の入力を受けて抽象構文記法メッセージと言語処理系のデータ構造との間の変換を行うプログラムルーチンをカスタマイズして生成するプロトコル符号化/復号化方法であって、
ユーザによって定義され入力されたインタフェース用構造体およびプログラムルーチンの処理内容に関するカスタマイズルールを受け付けるカスタマイズルール受付ステップと、
受け付けた前記カスタマイズルールを前記プロトコル仕様とともに解析するカスタマイズルール解析ステップと、
解析された前記カスタマイズルールについて前記プロトコル仕様への適用を処理するカスタマイズルール処理ステップと、
前記カスタマイズルールにしたがってインタフェース用構造体およびプログラムルーチンを生成するプログラムルーチン生成ステップと、
前記プログラムルーチン生成ステップによって得られた結果を出力する結果出力ステップと、
を有することを特徴とするプロトコル符号化/復号化方法。
【0044】
(付記8) プロトコル仕様の入力を受けて抽象構文記法メッセージと言語処理系のデータ構造との間の変換を行うプログラムルーチンをカスタマイズして生成するプロトコル符号化/復号化プログラムであって、
コンピュータに、
ユーザによって定義され入力されたインタフェース用構造体およびプログラムルーチンの処理内容に関するカスタマイズルールを受け付けるカスタマイズルール受付ステップと、
受け付けた前記カスタマイズルールを前記プロトコル仕様とともに解析するカスタマイズルール解析ステップと、
解析された前記カスタマイズルールについて前記プロトコル仕様への適用を処理するカスタマイズルール処理ステップと、
前記カスタマイズルールにしたがってインタフェース用構造体およびプログラムルーチンを生成するプログラムルーチン生成ステップと、
前記プログラムルーチン生成ステップによって得られた結果を出力する結果出力ステップと、
を実行させるプロトコル符号化/復号化プログラム。
【0045】
【発明の効果】
以上述べてきたように、抽象構文記法メッセージと言語処理系のデータ構造との相互変換を行うプログラムルーチン (デコーダ/エンコーダ)について、カスタマイズルールを適用することによって、従来技術では、生成できるインタフェース用構造体の構造、デコーダ、エンコーダの形式は固定されたものとなっていたインターフェース用構造体の構造、デコーダ、エンコーダをアプリケーション毎に変えて生成することを可能とした。
【0046】
本発明は、プロトコルを処理するアプリケーションを開発する上でインタフェース用構造体の構造について、アプリケーション毎に最適な構造を提供することとなり、アプリケーションの開発ユ−ザにとって、自動生成されたインタフェース用構造体およびデコーダ、エンコーダを人手で修正する必要がなくなり、工数の削減となる。
【図面の簡単な説明】
【図1】本発明の実施の形態になる基本システム構成を示す図である。
【図2】本発明の実施の形態になるテンプレ−ト/デフォルト登録のフロ−チャ−トを示す図である。
【図3】本発明の実施の形態になるプロトコル符号化/復号化のフローチャートを示す図である。
【図4】プロトコル仕様の例を示す図である。
【図5】本発明の実施の形態になるカスタマイズルールの例(その1)を示す図である。
【図6】本発明の実施の形態になるカスタマイズルールの例(その2)を示す図である。
【図7】本発明の実施の形態になるカスタマイズルールの例(その3)を示す図である。
【図8】本発明の実施の形態になるカスタマイズルールの例(その4)を示す図である。
【図9】本発明の実施の形態になるカスタマイズルールの例(その5)を示す図である。
【図10】本発明の実施の形態になるテンプレートの例(その1)を示す図である。
【図11】本発明の実施の形態になるテンプレートの例(その2)を示す図である。
【図12】本発明の実施の形態になるテンプレートの例(その3)を示す図である。
【図13】本発明の実施の形態になるデフォルトテーブルを示す図である。
【図14】本発明の実施の形態になるプログラムルーチンの生成例を示す図である。
【図15】従来のプロトコル符号化/復号化のフローチャートを示す図である。
【符号の説明】
1 プロトコル符号化/復号化装置
2 プロトコル処理装置
3 カスタマイズ処理装置
4 記憶装置
21 プロトコル仕様受付手段
22 プロトコル仕様解析手段
23 型依存情報格納手段
24 プログラムルーチン生成手段
25 結果出力手段
31 カスタマイズルール受付手段
32 カスタマイズルール処理手段
32a 処理追加手段
32b 新規定義手段
32c テンプレート選択手段
33 カスタマイズルール解析手段
34 テンプレート登録手段
35 デフォルト登録手段
41 型依存情報
42 テンプレート
43 デフォルトテーブル[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention provides a protocol encoding / decoding system that reflects customization in automatically generating a program routine for performing mutual conversion between an abstract syntax notation message and a data structure of a processing system such as C language from a protocol described in an abstract syntax. Related to the technical field.
[0002]
[Prior art]
A protocol for transmission and reception between computers is described in an abstract syntax according to Abstract Syntax Notation 1 (ASN.1: Abstract Syntax Notation 1). This is a language for defining syntax of protocols such as MHS (Message Handling System electronic mail system) and SNMP (Simple Network Protocol simple network protocol). The procedure is based on a standard defined by the ISO (International Organization for Standardization). The abstract syntax notation message is data that is actually handled by MHS, SNMP, and the like, and is generally transmitted and received by data encoded by a BER method (Basic Encoding Rule) or a DER method (Distributed Encoding Rule). It has become.
[0003]
Since the above-mentioned abstract syntax notation message is difficult to handle as it is, it is generally converted to a data structure of a processing system such as C language and handled. Since the syntax rules are different for each protocol, it is necessary to create a program rune (decoder / encoder) and an interface structure for each protocol. At present, one compiler is provided as a tool for creating a decoder, an encoder, and an interface structure from the syntax specification of a protocol described in an abstract syntax notation.
[0004]
Here, key terms used below will be described with specific examples.
Abstract syntax notation "ASN.1":
Example 1 (Syntax definition by ASN.1)
Figure 2004234405
ASN. When the syntax definition is performed as described above using “1”, it has the following meaning. The Type A type is a type having Type B type b and Type C type c as data. The Type B type is an INTEGER type, that is, a type having an integer value, and the Type C type is an OCTET STRING type, that is, a type having a byte sequence.
Abstract syntax notation message:
Example 2 ("DER" encoding)
0000: 30 SEQUENCE type number
0001: 08 data size (8 bytes from 0002 to 0009)
0002: 02 INTEGER (= TypeB) type number
0003: Data size of 01b (1 byte of 0005)
0004: 05b data
0005: 04 OCTET STRING (= TypeC) model number
0006: Data size of 03c (3 bytes of 0007 to 0009)
0007: Data of 03 02 03 c
(Note) Data is described in hexadecimal.
[0005]
It has the structure of “type number”, “data size”, and “data”. In the syntax specification of the above-described example 1, a Type A type having data of b as an integer of 5 and c as a byte string of 3, 2, and 3 as data. When handling data, the data encoded by the “DER” method is the 10-byte data described above.
Decoder, encoder, interface structure:
Example 3 (Interface structure corresponding to the syntax specification of Example 1)
Figure 2004234405
typeA is composed of typeB having a b value and typeC having a c value, where typeB indicates an int type and typeC indicates a pointer to a char type.
[0006]
As described above, an abstract syntax notation message is generally converted into a data structure of a processing system such as C language and used in a format that is easy to handle. The decoder is a program routine for performing a process of converting an abstract syntax notation message into a data structure of a processing system, and the encoder is a program routine for performing a process of converting the data structure of the processing system into an abstract syntax notation message. The interface structure is for building a data structure of the processing system.
[0007]
Conventionally, ASN. Interface structure and decoder (program written in C language or the like for storing abstract syntax notation messages such as BER and DER in the interface structure, with protocol specifications described in abstract syntax notation such as 1 as input) Routine) / Encoder (a program routine written in C language or the like for generating an abstract syntax notation message from data stored in an interface structure) has been proposed (for example, Patent Document 1). 1).
[0008]
Further, the above conventional example will be described with reference to a conventional protocol encoding / decoding flowchart shown in FIG. Receiving the protocol specification data input by the user (step S11), the contents of the protocol specification are analyzed (step S12), and an interface structure and a decoder / encoder program routine are generated according to the analysis result (step S13). ), And outputs the result (step S14).
[0009]
[Patent Document 1]
JP-A-7-168772 (pages 2 to 9)
[0010]
[Problems to be solved by the invention]
In developing an application that processes a protocol, it is desirable that the structure of the interface structure be an optimal structure for each application. However, in the related art, the structure of the interface structure that can be generated, the format of the decoder, and the encoder are fixed, and it is quite necessary to generate the interface structure by changing the configuration, the decoder, and the encoder for each application. The work had entered and it was very inconvenient.
[0011]
Further, in a communication environment in which various types of applications are connected, existing ASN. To customize interface structures, decoders, and encoders for each application using one compiler, the interface structures, decoders, and encoders that are automatically generated are manually corrected, so that bugs are likely to occur and a large number of Man-hours were required.
[0012]
Therefore, in application development, it is required to customize the configuration of the program routine for converting (decoding and encoding) the message of the abstract syntax and the structure of the interface structure so that the user can easily use it. SUMMARY OF THE INVENTION It is an object of the present invention to provide a data structure in a format that can be easily processed by a program routine of a decoder / encoder, to reduce the size of these program routines, and to speed up the processing in order to compensate for the above-mentioned drawbacks. .
[0013]
[Means for Solving the Problems]
A first invention is a protocol encoding / decoding device that receives a protocol specification input, customizes and generates a program routine for converting between an abstract syntax notation message and a data structure of a language processing system, A customization rule receiving means for receiving a customization rule related to the interface structure and the processing content of the program routine defined and input by the user; a customization rule analysis means for analyzing the received customization rule together with the protocol specification; Customization rule processing means for processing application of the customization rule to the protocol specification; and program routine generation means for generating an interface structure and a program routine according to the customization rule. Protocol for encoding / decoding apparatus characterized by having a result output means for outputting a result obtained by the program routine generation unit.
[0014]
That is, according to the first invention, in order to change the structure of the interface structure, or change or add the processing contents of the program routine (decoder / encoder), the customization rule receiving means, the customization rule analysis means, and By having the customization rule processing means, a system that generates and outputs the structure of the interface structure and the program routine (decoder / encoder) as intended by the user can be realized.
[0015]
According to a second aspect of the present invention, in the customization of the interface structure and the program routine, the protocol encoding / decoding device sequentially stores, in a storage device, type dependency information on an appearance position of a type currently being processed. The present invention relates to the protocol encoding / decoding device according to the first aspect, further comprising type dependent information storage means for changing an arbitrary type or an arbitrary element at the position.
[0016]
That is, according to the second aspect, by storing the type dependency in the protocol encoding / decoding device, it is possible to correspond to another type or perform processing depending on the position where the same type appears. It is possible to do.
The third invention is characterized in that the customization rule processing means has a new definition means for newly defining an arbitrary interface structure and a program routine for a type or a type dependency. The protocol encoding / decoding device according to the second invention.
[0017]
That is, according to the third invention, each ASN. By newly defining the type 1 and the type dependency, an arbitrary interface structure and program routine (decoder / encoder) can be generated.
According to a fourth aspect of the present invention, in the customization of the interface structure and the program routine, the protocol encoding / decoding device can select a template registering means for storing frequently used ones as templates, and select the template. The present invention also relates to the protocol encoding / decoding device according to the first to third aspects, characterized by having a template selecting means.
[0018]
That is, according to the fourth aspect, the template storing means and the template selecting means previously store some templates for customization that is likely to be executed with respect to the interface structure and the program routine (decoder / encoder). This makes it possible to retrieve and select the template stored at the time of use.
[0019]
According to a fifth aspect of the present invention, in the customization of the structure of the interface structure and the program routine, the protocol encoding / decoding apparatus is configured to execute the interface encoding when the new definition is not performed and the template is not selected. The protocol encoding / decoding device according to the third or fourth aspect of the present invention, further comprising a default registration unit for registering a default adopted by a structure for use and a program routine.
[0020]
That is, according to the fifth aspect, the default storage means uses the default for the interface structure and the program routine (decoder / encoder) when there is no new definition in the customization rule and no template is selected. It is possible to do.
[0021]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, an embodiment of the present invention will be described with reference to the drawings.
FIG. 1 shows a basic system configuration according to an embodiment of the present invention. The protocol encoding / decoding device 1 includes a protocol processing device 2, a customization processing device 3, and a storage device 4.
[0022]
The protocol processing device 2 includes a protocol specification receiving unit 21 for receiving an input of a protocol specification from a user, a protocol specification analyzing unit 22, a type dependency information storage unit 23 for storing information on a dependency relationship of a type currently being processed, It has a program routine generating means 24 for generating a structure and a decoder / encoder program routine, and a result output means 25.
[0023]
The customization processing device 3 includes a customization rule receiving unit 31, a customization rule processing unit 32, as a subset thereof, a processing addition unit 32a for adding a customization processing function, a new definition unit 32b for defining a new customization definition, It has a template selecting means 32 c for selecting a template, a customizing rule analyzing means 33, and a template registering means 34 / default registering means 35 for accepting a template / default input and registering it in the customizing rule storage device 4 in advance.
[0024]
The storage device 4 stores type dependency information 41 indicating a type data currently being processed, a template 42, and a default table 43.
Here, the protocol encoding / decoding device 1 is a computer, in which a program for protocol processing and customization processing which are built in in advance is built in. Is performed. The program is recorded on a computer-readable recording medium such as a floppy disk, a compact disk, or a CD-ROM. Although not shown in the figure, the program is set in a built-in or externally connected medium reading device and installed. It may be in an executable state.
[0025]
Next, the basic operation of the present invention will be described below with reference to the flowcharts of FIGS.
FIG. 2 shows a flowchart of template / default registration according to the embodiment of the present invention. The template / default data input by the user is received (step S11), and the input information on the template / default is initially registered in the storage device 4 as the template 42 and the default table 43 (step S12).
[0026]
FIG. 3 shows a flowchart of protocol encoding / decoding according to the embodiment of the present invention. In the protocol encoding / decoding 1, first, the protocol specification receiving unit 21 receives an input of a protocol specification from a user (step S21), and at the same time, the customization rule receiving unit 31 outputs the customization rule defined and input by the user. Is received (step S22), the received customization rule and protocol specification are analyzed by the customization rule analysis unit 33 and the protocol specification analysis unit 22 (step S23), and based on the analyzed customization rule, the customization rule processing unit 32 The customization rule is applied and processed by the program routine generation means 24, and an interface structure and a program routine reflecting the customization are automatically generated (step S24), and the result output is performed. The result is outputted by the stage 25 (step S25).
[0027]
FIG. 4 shows an example of the protocol specification. In the example of the protocol described in the abstract syntax notation, SEQUENCE means a type having a plurality of values, and SampleA is SampleA. b1. i-type or SampleA. b2. The i type and the like indicate that the type is the INTEGER type. Among such INTEGER types, SampleA. b1. Only the i type is set to the double type (C), the other INTEGER types are set to the int type (C), or SampleA. b2. In some cases, it may be necessary to change the corresponding type (C) or processing (C) depending on the position where the same type appears, such as changing the i type to the int type (C). It was impossible (here, (C) shows the case of applying C language). Therefore, the following customization was introduced.
[0028]
FIG. 5 shows an example (part 1) of a customization rule according to the embodiment of the present invention. In the present invention, by storing the type dependency in the system, it becomes possible to correspond to another type (C) or perform the process (C) depending on the position where the same type appears. I have. In the embodiment, SampleA. b1. When processing type i, this type is INTEGER type, and SampleB. i-type, SampleA. b1. Since the i-type is stored in the storage device 4 as the type-dependent information 41, by writing a customization rule as shown in FIG. b1. It is possible to generate an interface structure, a decoder, and an encoder such that the i-type is processed as the double type (C) and the other INTEGER type is processed as the int type (C). (Shown in (1)).
[0029]
FIG. 6 shows an example (part 2) of the customization rule according to the embodiment of the present invention. In this example, a new definition described in a customization rule is reflected by having a new definition means 32b for newly defining an arbitrary interface structure, decoder, and encoder for a type or a type dependency. Here is an example. In the protocol specification of FIG. 4, by embedding a code in a customization rule as shown in FIG. 6, it is possible to generate an arbitrary interface structure, decoder, and encoder corresponding to the SampleC type. (2)).
[0030]
FIG. 7 shows an example (part 3) of the customization rule according to the embodiment of the present invention. In the protocol specification of FIG. 5, a template (FIG. 11) for determining whether the structure is to be in the pointer format or embedded in the entity is prepared, and the customization rule is described as shown in FIG. . An interface structure, a decoder, and an encoder can be generated so that the structure corresponding to the b2 type is in the pointer reference format, and the other is in the entity embedding format (an example of code generation is shown in (3) in FIG. 14). .
[0031]
FIG. 8 shows an example (part 4) of the customization rule according to the embodiment of the present invention. Here, there is shown a case where it is desired to use an inline expansion format or a function call format when processing the elements of the generated decoder or encoder. In the embodiment, a template (FIG. 11) for inline expansion or function call is prepared in the protocol specification of FIG. 4, and a customization rule as shown in FIG. The processing corresponding to the b1 type is capable of generating a decoder and an encoder that are in an inline expansion format and the others are in a function call format (an example of code generation is shown in (4) in FIG. 14).
[0032]
FIG. 9 shows an example (part 5) of the customization rule according to the embodiment of the present invention. In this example, by providing the processing addition means 32a for giving an arbitrary additional processing to the generated decoder or encoder, it is possible to add the additional processing described in the customization rule to the decoder or encoder. Here, a case where it is desired to add a process specialized for an application to the generated decoder and encoder. In the protocol specification of FIG. 5, by embedding a code in a customization rule as shown in FIG. 10, a SampleA type and a SampleA. A decoder corresponding to the b2 type, a decoder having an additional process added to the encoder, and an encoder are generated (an example of code generation is indicated by (5) in FIG. 14).
[0033]
In the present embodiment, SampleA and SampleA. 2 shows an example in which the output processing is performed before and after decoding C 2 in.
FIG. 10 shows an example (No. 1) of a template according to the embodiment of the present invention. In generating the interface structure, decoder, and encoder, all of the ASN. Defining the interface structure, decoder, and encoder corresponding to type 1 with customization rules is a daunting task. However, for example, when converting the INTEGER type to the C type, it is converted to a certain fixed type such as an int type (C) or a double type (C). Therefore, a decode_int function for converting an INTEGER type to an int type (C), an encode_int function for converting an int type (C) to an INTEGER type, a decode_double_for_real function for converting an INTEGER type to a double type (C), and a double type ( For example, for the encode_double_for_real function for converting C) into the INTEGER type, for example, by preparing a template as shown in FIG. Conversion corresponding to type 1 can be easily performed.
[0034]
The template 42 of the present example has the ASN. It is composed of a plurality of records having items of type 1 101, generation type 102, C type 103, decoder 104, and encoder 105. ASN. A type 101 is a type based on the abstract syntax notation, a generated type 102 represents a type name as a template, and a C type 103 indicates a type in the C language including a type of an interface structure. The decoder 104 and the encoder 105 show each function in each program routine.
[0035]
FIG. 11 shows an example (part 2) of the template according to the embodiment of the present invention. This template is prepared when the elements of the generated interface structure are to be in the pointer reference format or in the entity embedded format.
FIG. 12 shows an example (part 3) of the template according to the embodiment of the present invention. This applies when the decoder or encoder to be generated is to be processed in an inline expansion format when processing elements, or when it is desired to use a function call format.
[0036]
FIG. 13 shows a default example according to the embodiment of the present invention. This default is applied when no new definition is made in the customization rule and no template is selected.
The default table 43 stores the ASN. It is composed of a plurality of records having items of type 1 101, structure 103, decoder 104, encoder 105, pointer / embedding 106, and inline / function 107. As in FIG. The first type 101 is a type based on the abstract syntax notation, the structure 103 indicates an interface structure in the C language, and the decoder 104 and the encoder 105 indicate types in respective program routines. The pointer / embedding 106 indicates whether the data is in a pointer reference type format or a substance embedding type format, and the inline / function 107 is in an inline expansion format or a function calling format. In this embodiment, both REAL and INTAGER are set to “substance embedded format” and “function call format”.
[0037]
FIG. 14 shows an example of generating a program routine according to the embodiment of the present invention. In the present embodiment, only the decoder is shown. This shows a program routine (case of a decoder) in the case where the customizing rule examples (parts 1) to (part 5) described above are applied. Mark 5 is inserted and shown.
[0038]
Among the inventions described above, furthermore, the input of the protocol specification and the input of the customization rule are separated, and the customization rule is an application that processes the same protocol by describing as a set of the type dependency and the customization rule. However, this provides a solution to the case where different customization rules are to be adopted.
[0039]
(Supplementary Note 1) A protocol encoding / decoding device that customizes and generates a program routine for converting between an abstract syntax notation message and a data structure of a language processing system in response to an input of a protocol specification,
A customization rule receiving means for receiving a customization rule related to an interface structure and a processing content of a program routine defined and input by a user;
Customization rule analysis means for analyzing the received customization rule together with the protocol specification,
Customization rule processing means for processing application of the analyzed customization rule to the protocol specification,
Program routine generating means for generating an interface structure and a program routine according to the customization rule;
A result output unit that outputs a result obtained by the program routine generation unit;
A protocol encoding / decoding device, comprising:
[0040]
(Supplementary Note 2) In the customization related to the interface structure and the program routine, the protocol encoding / decoding device sequentially stores, in a storage device, information of a type dependency relationship regarding an appearance position of a type currently being processed. 2. The protocol encoding / decoding apparatus according to claim 1, further comprising a dependency information storage unit, wherein an arbitrary type or an arbitrary element at the position is changed.
[0041]
(Supplementary note 3) The supplementary note 1 or supplementary note 2, wherein the customization rule processing means has a new definition means for newly defining an arbitrary interface structure and a program routine for a type or a type dependency. Protocol encoding / decoding device.
(Supplementary Note 4) In the customization of the interface structure and the program routine, the protocol encoding / decoding device can select a template registration unit that saves a frequently used template as a template and select the template. 4. The protocol encoding / decoding device according to any one of supplementary notes 1 to 3, further comprising a template selecting unit.
[0042]
(Supplementary note 5) The protocol encoding / decoding apparatus according to supplementary note 4, wherein the template registration unit can add, change, and delete templates by user input.
(Supplementary Note 6) In customizing the structure of the interface structure and the program routine, the protocol encoding / decoding device may execute the interface structure if no new definition is made and the template is not selected. The protocol encoding / decoding device according to claim 3 or 4, further comprising a default registering means for registering defaults adopted by the body and the program routine.
[0043]
(Supplementary Note 7) A protocol encoding / decoding method for receiving a protocol specification input and customizing and generating a program routine for converting between an abstract syntax notation message and a data structure of a language processing system,
A customization rule receiving step of receiving a customization rule related to an interface structure and a processing content of a program routine defined and input by a user;
A customization rule analysis step of analyzing the received customization rule together with the protocol specification,
A customization rule processing step of processing the analyzed customization rule for application to the protocol specification,
A program routine generating step of generating an interface structure and a program routine according to the customization rule;
A result output step of outputting a result obtained by the program routine generation step;
A protocol encoding / decoding method.
[0044]
(Supplementary Note 8) A protocol encoding / decoding program that receives a protocol specification input and customizes and generates a program routine for performing conversion between an abstract syntax notation message and a data structure of a language processing system.
On the computer,
A customization rule receiving step of receiving a customization rule related to an interface structure and a processing content of a program routine defined and input by a user;
A customization rule analysis step of analyzing the received customization rule together with the protocol specification,
A customization rule processing step of processing the analyzed customization rule for application to the protocol specification,
A program routine generating step of generating an interface structure and a program routine according to the customization rule;
A result output step of outputting a result obtained by the program routine generation step;
A protocol encoding / decoding program for executing
[0045]
【The invention's effect】
As described above, in the prior art, an interface structure that can be generated by applying a customization rule to a program routine (decoder / encoder) that performs mutual conversion between an abstract syntax notation message and a data structure of a language processing system. The structure of the body, the format of the decoder and the encoder were fixed, and the structure of the interface structure, the decoder and the encoder can be changed and generated for each application.
[0046]
According to the present invention, an interface structure is provided for each application with respect to the structure of an interface structure in developing an application for processing a protocol. For an application development user, an automatically generated interface structure is provided. In addition, it is not necessary to manually correct the decoder and the encoder, and the number of steps is reduced.
[Brief description of the drawings]
FIG. 1 is a diagram showing a basic system configuration according to an embodiment of the present invention.
FIG. 2 is a diagram showing a template / default registration flowchart according to the embodiment of the present invention.
FIG. 3 is a diagram showing a flowchart of protocol encoding / decoding according to the embodiment of the present invention.
FIG. 4 is a diagram illustrating an example of a protocol specification.
FIG. 5 is a diagram showing an example (part 1) of a customization rule according to the embodiment of the present invention.
FIG. 6 is a diagram showing an example (part 2) of a customization rule according to the embodiment of the present invention.
FIG. 7 is a diagram showing an example (part 3) of a customization rule according to the embodiment of the present invention.
FIG. 8 is a diagram showing an example (part 4) of a customization rule according to the embodiment of the present invention.
FIG. 9 is a diagram showing an example (part 5) of a customization rule according to the embodiment of the present invention.
FIG. 10 is a diagram showing an example (No. 1) of a template according to the embodiment of the present invention.
FIG. 11 is a diagram showing an example (No. 2) of a template according to the embodiment of the present invention.
FIG. 12 is a diagram showing an example (part 3) of a template according to the embodiment of the present invention;
FIG. 13 is a diagram showing a default table according to the embodiment of the present invention.
FIG. 14 is a diagram showing a generation example of a program routine according to the embodiment of the present invention.
FIG. 15 is a diagram showing a flowchart of conventional protocol encoding / decoding.
[Explanation of symbols]
1 Protocol encoding / decoding device
2 Protocol processing device
3 Customized processing equipment
4 Storage device
21 Protocol specification acceptance means
22 Protocol specification analysis means
23 Type-dependent information storage means
24 Program Routine Generation Means
25 Result output means
31 Customize rule accepting means
32 Customization rule processing means
32a processing addition means
32b New definition means
32c template selection means
33 Customization rule analysis means
34 Template registration means
35 Default registration method
41 Type-dependent information
42 Template
43 Default table

Claims (5)

プロトコル仕様の入力を受けて抽象構文記法メッセージと言語処理系のデータ構造との間の変換を行うプログラムルーチンをカスタマイズして生成するプロトコル符号化/復号化装置であって、
ユーザによって定義され入力されたインタフェース用構造体およびプログラムルーチンの処理内容に関するカスタマイズルールを受け付けるカスタマイズルール受付手段と、
受け付けた前記カスタマイズルールを前記プロトコル仕様とともに解析するカスタマイズルール解析手段と、
解析された前記カスタマイズルールについて前記プロトコル仕様への適用を処理するカスタマイズルール処理手段と、
前記カスタマイズルールにしたがってインタフェース用構造体およびプログラムルーチンを生成するプログラムルーチン生成手段と、
前記プログラムルーチン生成手段によって得られた結果を出力する結果出力手段と、
を有することを特徴とするプロトコル符号化/復号化装置。
A protocol encoding / decoding device for customizing and generating a program routine for converting between an abstract syntax notation message and a data structure of a language processing system in response to an input of a protocol specification,
A customization rule receiving means for receiving a customization rule related to an interface structure and a processing content of a program routine defined and input by a user;
Customization rule analysis means for analyzing the received customization rule together with the protocol specification,
Customization rule processing means for processing application of the analyzed customization rule to the protocol specification,
Program routine generating means for generating an interface structure and a program routine according to the customization rule;
A result output unit that outputs a result obtained by the program routine generation unit;
A protocol encoding / decoding device, comprising:
前記インタフェース用構造体およびプログラムルーチンに関するカスタマイズにおいて、前記プロトコル符号化/復号化装置は、現在処理中の型の出現位置に関する型依存関係の情報を記憶装置に逐次格納しておく型依存情報格納手段を有し、該位置における任意の型あるいはその任意の要素の変更を行うことを特徴とする請求項1記載のプロトコル符号化/復号化装置。In customizing the interface structure and the program routine, the protocol encoding / decoding device sequentially stores, in a storage device, type dependency information relating to the appearance position of the type currently being processed. 2. The protocol encoding / decoding apparatus according to claim 1, further comprising: changing an arbitrary type or an arbitrary element at the position. 前記カスタマイズルール処理手段は、型あるいは型依存関係に対し、任意のインタフェース用構造体およびプログラムルーチンが新たに定義される新規定義手段を有することを特徴とする請求項1あるいは請求項2記載のプロトコル符号化/復号化装置。3. The protocol according to claim 1, wherein said customization rule processing means has a new definition means for newly defining an arbitrary interface structure and a program routine for a type or a type dependency. Encoding / decoding device. 前記インタフェース用構造体およびプログラムルーチンに関するカスタマイズにおいて、前記プロトコル符号化/復号化装置は、使用頻度の多いものについてテンプレートとして保存しておくテンプレート登録手段と、そのテンプレートを選択可能とするテンプレート選択手段とを有することを特徴とする請求項1乃至請求項3のいずれかに記載のプロトコル符号化/復号化装置。In customizing the interface structure and the program routine, the protocol encoding / decoding apparatus includes a template registering unit that stores a frequently used template as a template, and a template selecting unit that allows the template to be selected. The protocol encoding / decoding device according to claim 1, further comprising: 前記インタフェース用構造体の構造およびプログラムルーチンのカスタマイズにおいて、前記プロトコル符号化/復号化装置は、新規定義が行われない場合で、かつ、前記テンプレートが選択されない場合、前記インタフェース用構造体およびプログラムルーチンが採用するデフォルトを登録しておくデフォルト登録手段を有することを特徴とする請求項3あるいは請求項4記載のプロトコル符号化/復号化装置。In customizing the structure of the interface structure and the program routine, the protocol encoding / decoding device sets the interface structure and the program routine if no new definition is made and the template is not selected. 5. The protocol encoding / decoding apparatus according to claim 3, further comprising a default registration unit for registering a default adopted by the protocol encoding unit.
JP2003023060A 2003-01-31 2003-01-31 Protocol encoder/decoder Pending JP2004234405A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003023060A JP2004234405A (en) 2003-01-31 2003-01-31 Protocol encoder/decoder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003023060A JP2004234405A (en) 2003-01-31 2003-01-31 Protocol encoder/decoder

Publications (1)

Publication Number Publication Date
JP2004234405A true JP2004234405A (en) 2004-08-19

Family

ID=32951971

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003023060A Pending JP2004234405A (en) 2003-01-31 2003-01-31 Protocol encoder/decoder

Country Status (1)

Country Link
JP (1) JP2004234405A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006186773A (en) * 2004-12-28 2006-07-13 Kddi Corp Unit and method for protocol generation and program therefor
GB2438455A (en) * 2006-05-23 2007-11-28 Agilent Technologies Inc Generation of data packet decoding instructions
CN102546557A (en) * 2010-12-17 2012-07-04 北京中水科水电科技开发有限公司 Method and device for customizing protocol
JP2012203826A (en) * 2011-03-28 2012-10-22 Toshiba Corp Decoder compiler, program and communication apparatus
JP2012203819A (en) * 2011-03-28 2012-10-22 Toshiba Corp Encoder compiler, program and communication apparatus
CN112188211A (en) * 2020-08-21 2021-01-05 北京新媒传信科技有限公司 Transcoding implementation method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006186773A (en) * 2004-12-28 2006-07-13 Kddi Corp Unit and method for protocol generation and program therefor
GB2438455A (en) * 2006-05-23 2007-11-28 Agilent Technologies Inc Generation of data packet decoding instructions
CN102546557A (en) * 2010-12-17 2012-07-04 北京中水科水电科技开发有限公司 Method and device for customizing protocol
CN102546557B (en) * 2010-12-17 2015-04-15 北京中水科水电科技开发有限公司 Method and device for customizing protocol
JP2012203826A (en) * 2011-03-28 2012-10-22 Toshiba Corp Decoder compiler, program and communication apparatus
JP2012203819A (en) * 2011-03-28 2012-10-22 Toshiba Corp Encoder compiler, program and communication apparatus
US8700680B2 (en) 2011-03-28 2014-04-15 Kabushiki Kaisha Toshiba Decoder compiler, computer readable medium, and communication device
CN112188211A (en) * 2020-08-21 2021-01-05 北京新媒传信科技有限公司 Transcoding implementation method and device

Similar Documents

Publication Publication Date Title
US20030115548A1 (en) Generating class library to represent messages described in a structured language schema
JP4997777B2 (en) Method and system for reducing delimiters
US7822826B1 (en) Deployment of a web service
TWI262439B (en) Strategy for dynamically modeling ASN.1 data to an object model
JP2007508602A (en) General application network architecture
JP5377818B2 (en) Method and system for sequentially accessing a compiled schema
WO2003091903A1 (en) System and method for processing of xml documents represented as an event stream
JP2001502823A (en) Method and apparatus for transporting data structures defined by an interface definition language between heterogeneous systems
JP5325920B2 (en) Encoder compiler, program and communication equipment
JP2004178602A (en) Method for importing and exporting hierarchized data, and computer-readable medium
JP5044942B2 (en) System and method for determining acceptance status in document analysis
WO2008071070A1 (en) An object oriented management device for asn.1 message
WO2010000139A1 (en) Method for processing tlv format of communication data
CN102566984A (en) Method and device for configuring parameters
US20030172186A1 (en) Method, system and program product for transcoding content
JP5044943B2 (en) Method and system for high-speed encoding of data documents
JP2004234405A (en) Protocol encoder/decoder
Levillain Parsifal: A pragmatic solution to the binary parsing problems
JP2013008395A (en) Display system and method for acceptance state
JP2006221652A (en) Encoded document decoding method and system
JP2002342078A (en) Program development system and method
US7243341B2 (en) Scripting language for processing typed structured data
JP2006221655A (en) Method and system for compiling schema
US7665074B2 (en) Mechanism for converting text output into objects
US20100088588A1 (en) Method and device for processing documents on the basis of enriched schemas and corresponding decoding method and device

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20040610

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20040610

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051111

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20080201

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080430

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20080627

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20080722