JP4830558B2 - Structured document encoding apparatus and structured document decoding apparatus - Google Patents
Structured document encoding apparatus and structured document decoding apparatus Download PDFInfo
- Publication number
- JP4830558B2 JP4830558B2 JP2006072225A JP2006072225A JP4830558B2 JP 4830558 B2 JP4830558 B2 JP 4830558B2 JP 2006072225 A JP2006072225 A JP 2006072225A JP 2006072225 A JP2006072225 A JP 2006072225A JP 4830558 B2 JP4830558 B2 JP 4830558B2
- Authority
- JP
- Japan
- Prior art keywords
- document
- external
- encoded
- structured
- parts
- 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.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 claims description 110
- 238000003860 storage Methods 0.000 claims description 64
- 238000004458 analytical method Methods 0.000 claims description 42
- 238000006243 chemical reaction Methods 0.000 claims description 40
- 230000008569 process Effects 0.000 claims description 25
- 238000012545 processing Methods 0.000 claims description 19
- 238000004891 communication Methods 0.000 description 25
- 230000008676 import Effects 0.000 description 25
- 230000006835 compression Effects 0.000 description 23
- 238000007906 compression Methods 0.000 description 23
- 238000010586 diagram Methods 0.000 description 17
- 230000000694 effects Effects 0.000 description 15
- 230000005540 biological transmission Effects 0.000 description 9
- 230000008859 change Effects 0.000 description 8
- 238000007792 addition Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 238000012546 transfer Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 235000006719 Cassia obtusifolia Nutrition 0.000 description 1
- 235000014552 Cassia tora Nutrition 0.000 description 1
- 244000201986 Cassia tora Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000005549 size reduction Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Landscapes
- Document Processing Apparatus (AREA)
Description
本発明は構造化文書の符号化装置とその復号化装置に関し、特に類似する外部文書を自文書の一部として参照可能な構造化文書符号化装置とその復号化装置に関する。 The present invention relates to a structured document encoding apparatus and decoding apparatus thereof, and more particularly to a structured document encoding apparatus and decoding apparatus capable of referencing a similar external document as a part of the own document.
XMLやSGMLを始めとする構造化文書は、柔軟性や拡張性などの利点から通信の標準規格など様々な用途で利用されている。構造化文書を標準規格に採用した通信規格としては、SOAP(Simple Object Access Protocol)などが著名である。 Structured documents such as XML and SGML are used for various purposes such as communication standards because of their advantages such as flexibility and extensibility. As a communication standard that employs a structured document as a standard, SOAP (Simple Object Access Protocol) and the like are prominent.
構造化文書は、一つの要素を根として木構造を構成する。一般に各要素は要素名、要素値、属性名、属性値、子要素のリストなどから構成される。また本明細書では、木構造の中で、任意の一つの要素を親としてその子要素の集合からなるサブツリーを文書部品と呼ぶ。構造化文書は複数の文書部品の集合であるといえる。 A structured document forms a tree structure with one element as a root. In general, each element includes an element name, an element value, an attribute name, an attribute value, a list of child elements, and the like. In this specification, a sub-tree consisting of a set of child elements with an arbitrary element as a parent in a tree structure is called a document part. It can be said that a structured document is a collection of a plurality of document parts.
特にSOAPを始めとする構造化文書を用いた通信では、異なる文書構造定義で規定された文書部品を組み合わせて一つの通信メッセージを構成できる事が、その拡張性の高さの理由となっている。例えばSOAPでは、通信メッセージはヘッダーとボディとから構成されるが、ボディには個別のアプリケーション毎に規定される文書部品を、ヘッダには例えば暗号や署名の付加や宛先情報、セッションやトランザクション情報など様々な通信制御規格によって規定された文書部品を、それぞれ任意の数だけ、自由に組み合わせて一つの通信メッセージを作成する事が可能である。また同じアプリケーションシステムの間で多数の通信が行われる場合、通常は類似した多数の構造化文書が送受信されることが、構造化文書の通信での利用での特長である。 In particular, in communication using structured documents such as SOAP, the ability to compose one communication message by combining document parts defined by different document structure definitions is the reason for its high extensibility. . For example, in SOAP, a communication message consists of a header and a body. The body contains document parts specified for each application, and the header includes, for example, encryption and signature addition, destination information, session and transaction information, etc. It is possible to create a single communication message by freely combining any number of document parts defined by various communication control standards. In addition, when a large number of communications are performed between the same application systems, it is a feature in using structured documents for communication that usually a large number of similar structured documents are transmitted and received.
しかし構造化文書は情報の表現方法の冗長性から文書のデータサイズが大きいため、データの生成や解析、通信や保存などの処理効率が悪いなどの問題があった。これを解決するため、構造化文書のデータサイズを圧縮する構造化文書処理装置が従来より幾つか提案されている。 However, since structured documents have a large document data size due to the redundancy of information expression methods, there are problems such as poor processing efficiency such as data generation and analysis, communication and storage. In order to solve this problem, several structured document processing apparatuses that compress the data size of a structured document have been proposed.
一つの方法が、構造化文書を本来の文字列ではなくデータサイズ縮小に適した他の符号化方式を定めこれを用いる方式である。本明細書ではこれを全文保持型バイナリ表現方式と呼ぶ。例えば特許文献1では、1文書内に全ての情報を持たせながらフォーマットの工夫により効率化を図っている。図28に示すとおり、この全文保持型バイナリ表現方式では、構造化文書を構造化文書符号化モジュールに入力して符号化文書に変換し、また符号化文書のみを構造化文書復号化モジュールに入力して構造化文書を復元する。このような全文保持型バイナリ表現方式は、符号化において構造化文書の持つ情報の冗長性の排除のみを行い、符号化文書が構造化文書を復元するのに必要な全ての情報を含むため、他の補助的情報無しで符号化文書を構造化文書に復号化することが可能である。なお特許文献1では符号化文書の検証のためにさらに文書構造定義ファイルを用いているが、これは検証のために使用するもので復号化に使用するものではなく、この点で文書構造定義ファイルを符号化に用いる後述する構造情報外部参照型とは相違する。
One method is a method in which a structured document is not an original character string but another encoding method suitable for data size reduction is determined and used. In the present specification, this is referred to as a full-text holding binary representation method. For example, in
また他の方法として、構造化文書を本来の文字列ではなくデータサイズ縮小に適した他の符号化方式を定めこれを用いるが、加えて、符号化文書以外に要素名や属性名など構造化文書の構造に関する情報を記載した構造情報符号化テーブルを用意し、個々の符号化文書には文書構造関連情報は記載せず代わりに構造情報符号化テーブル内の該当情報への参照のみを記載する方式がある。本明細書ではこれを構造情報外部参照型バイナリ表現方式と呼ぶ。例えば特許文献2では、このような構造情報符号化テーブルを使用し、かつ参照情報の符号化方法などを工夫することで符号化文書のサイズ圧縮を図っている。図29に示すとおり、この構造情報外部参照型バイナリ表現方式では、全文保持型バイナリ表現方式に似た構造を取るが、加えて構造情報符号化テーブルが用意され、構造化文書符号化モジュールと構造化文書復号化モジュールがこれを共有し、符号化時には構造に関する情報は符号化文書には記載せず、代わりに構造情報符号化テーブル内の該当情報への参照のみを記載して、復号化時には符号化文書と構造情報符号化テーブルをあわせて使用することで構造化文書を復元する。この方式では、文書構造定義で規定される情報は個々の符号化文書には記載せずに済むため、全文保持型バイナリ表現方式よりもサイズの圧縮効果を高めることが出来る。
As another method, the structured document is not an original character string but another encoding method suitable for reducing the data size is determined and used. In addition, in addition to the encoded document, element names and attribute names are structured. Prepare a structure information encoding table that describes information related to the structure of the document. Instead of describing the document structure related information in each encoded document, describe only the reference to the corresponding information in the structure information encoding table. There is a method. In this specification, this is called a structure information external reference type binary representation method. For example, in
また他の方法として、特に通信などにおいて以前の構造化文書からの差分情報を生成し、それを送付することで転送データサイズを削減する方式がある。本明細書ではこれを差分送付方式と呼ぶ。例えば特許文献3では、クライアント側のXMLデータの更新を目的とし、構造化文書差分生成部で旧文書から新文書への差分データを生成し、通信先にそれを転送し、受信側では保持している旧文書に対して差分データを適用することで新文書を生成している。図30に示すとおり、差分送付方式では、差分生成部と文書更新部が一つの旧い構造化文書を共有し、その上で旧文書から新文書への差分データを一種の符号化文書として用いる。この方式では、元となる構造化文書の大きさに関わらず新旧の文書の差分のみを転送データとして使用するため、新旧文書の差異が小さければ圧縮効果を高めることが出来る。
As another method, there is a method of reducing transfer data size by generating difference information from a previous structured document and sending it, especially in communication. In the present specification, this is called a differential sending method. For example, in
また他の方法として、バイナリ符号化までは行っていないが、構造化文書中で他の構造化文書への参照を記述することで、他の文書を文書部品として自文書に取り込む方式がある。構造化文書では文書は木構造となるが、この取込では木構造の或るノードにおいて参照を記述することで、そのノードの下に参照された文書が記載されているかのように意味付けることが出来る。本明細書ではこれを文書部品取込方式と呼ぶ。例えばエクステンシブル・マークアップ・ランゲージ1.0(Extensible Markup Language(XML)1.0)では、外部実体(external entity)と呼ぶ記法を用いて、他の文書を自分の文書の一部として取り込む事が可能である。図31は文書部品取込方式を利用したサイズ圧縮の例である。構造化文書として、通信の送受信元で事前に部品として利用する文書を用意、共有しておき、通信時には文書全文を送付する代わりに、構造化文書中で、用意された文書と等しい部分は事前文書への参照のみを記述し、構造化文書解析モジュールは構造化文書の解析時に参照があると、参照された事前準備された構造化文書も読み込み、全体として一つの文書であるかのような結果を返す。この方式では、事前に多くの文書が部品として利用するために用意可能であれば、文書サイズの圧縮率を高めることが出来る。 As another method, although binary encoding is not performed, there is a method in which a reference to another structured document is described in the structured document, and the other document is taken into the own document as a document part. In a structured document, the document has a tree structure, but in this import, a reference is described in a certain node of the tree structure, so that it is given meaning as if the document referenced under that node is described. I can do it. In this specification, this is referred to as a document part taking-in method. For example, in Extensible Markup Language 1.0 (Extensible Markup Language (XML) 1.0), you can import other documents as part of your document using a notation called an external entity. . FIG. 31 shows an example of size compression using the document parts taking-in method. As a structured document, a document to be used as a component in advance is prepared and shared at the communication sender / receiver, and instead of sending the entire document during communication, the part that is equal to the prepared document in advance is sent in advance. If only a reference to a document is described, the structured document analysis module reads a pre-prepared structured document when there is a reference when the structured document is analyzed, and it looks as if it is a single document as a whole. Returns the result. In this method, if a large number of documents can be prepared for use as parts in advance, the compression ratio of the document size can be increased.
また他の方法として、例えば特許文献4に見られるように、構造化文書中の一つの要素にのみ着目し、その要素の持つ属性の組み合わせについてテンプレート化および差分計算を行う方式がある。本明細書ではこれを内部要素テンプレート化方式と呼ぶ。内部要素テンプレート化方式では、構造化文書を解釈し、その解釈した文書中に同一要素が存在するか否かを検知し、同一要素が存在する場合、同一要素間の差分を計算し、この計算した差分情報に基づいて個々の要素を圧縮して符号化する。
As another method, for example, as seen in
上述したように構造化文書のデータサイズを圧縮する構造化文書処理装置が従来より幾つか提案されているが、それぞれ以下のような課題がある。 As described above, several structured document processing apparatuses that compress the data size of a structured document have been proposed in the past, but each has the following problems.
全文保持型バイナリ表現方式では、符号化文書が構造化文書と同等の情報を持つため、通信の送受信装置間の事前の調整無しに任意の情報を追加できる反面、全ての情報を符号化文書内に含まなければならないためサイズの圧縮効果が低い。 In the full-text binary representation method, the encoded document has the same information as the structured document, so arbitrary information can be added without prior adjustment between the communication transmitting and receiving devices, but all information is included in the encoded document. The compression effect of the size is low because it must be included.
構造情報外部参照型バイナリ表現方式では、文書構造定義で規定されている要素名や属性名などの情報は符号化文書に含める必要がないためその分だけ圧縮率は高まるが、符号化文書には構造化文書と同等数の要素情報(要素の親子関係や要素名/属性名などの文字列への参照などの情報)を記述しなければならず、大きな文書の場合は圧縮効果に限界がある。加えて、通信の送受信装置間で必要な構造情報符号化テーブルを共有していることが前提であり、構造情報符号化テーブルに含まれない文書構造定義に基づく情報を符号化文書に追加することは出来ない。 In the structure information external reference type binary representation method, the information such as element name and attribute name specified in the document structure definition does not need to be included in the encoded document, so the compression rate increases accordingly. Element information (information such as element parent / child relationships and references to character strings such as element names / attribute names) must be described in the same number as a structured document. For large documents, the compression effect is limited. . In addition, it is premised that the necessary structure information encoding table is shared between the communication transmitting and receiving apparatuses, and information based on the document structure definition not included in the structure information encoding table is added to the encoded document. I can't.
差分送付方式では、二つの構造化文書間の差分しか扱うことが出来ない。このため二つの文書の差異が大きい場合、例えば旧文書として二つの構造化文書a,bがあり、それらを繋げた一つの新構造化文書cを符号化する場合、差分データとしてはaとc、あるいはbとcのいずれかの差分しか取ることが出来ず、その結果、差分データには前者であればb、後者であればaの文書に相当する情報が含まれてしまうことになり、差分データが大きくなってしまう。 The difference sending method can handle only the difference between two structured documents. For this reason, when the difference between two documents is large, for example, there are two structured documents a and b as the old document, and when one new structured document c that connects them is encoded, the difference data includes a and c. Or, only the difference between b and c can be taken, and as a result, the difference data will contain information corresponding to the document of b if it is the former and if it is the latter, Difference data becomes large.
文書部品取込方式では、完全に等しい文書しか部品として利用することが出来ない。例えば100個の要素を含む構造化文書が部品として事前に準備されている場合、参照元の構造化文書が記載したい文書部品と事前準備された文書が例え一つの要素でも異なれば、その部分は参照元で使用することが出来ず、全ての情報を参照元の文書内に記載しなければならない。部品として用意する文書のサイズを小さくすれば確率的には部品として利用できる可能性は高まるが、この場合逆に参照元の文書内に沢山の参照情報を記載しなければならず、結果的に参照元の文書のサイズをあまり小さくすることが出来ない。 In the document part fetching method, only completely equal documents can be used as parts. For example, when a structured document including 100 elements is prepared in advance as a part, if the document part to be described in the reference structured document differs from the prepared document even in one element, that part is It cannot be used by the referrer and all information must be included in the referrer document. If the size of a document prepared as a part is reduced, the possibility that it can be used as a part increases probabilistically. However, in this case, a lot of reference information must be described in the reference source document. The size of the reference source document cannot be reduced too much.
内部要素テンプレート化方式では、一つの構造化文書内で同じ要素が繰り返し現れるものをテンプレート化するため、同一の要素が多数含まれる構造化文書については高い圧縮率が期待できる。しかし、他の構造化文書の同じ要素を参照する概念がないため、同一または類似する要素を持つ外部の構造化文書を利用して圧縮を図ることはできない。 In the internal element templating method, since the same element repeatedly appears in one structured document, it is templated. Therefore, a high compression rate can be expected for a structured document including many identical elements. However, since there is no concept that refers to the same element in another structured document, compression cannot be achieved using an external structured document having the same or similar elements.
このように従来方式では、特に複数の独立した文書部品を組合わせた構造化文書や、類似した多数の構造化文書の処理において、サイズの圧縮の効果に限界がある。 As described above, in the conventional method, there is a limit to the effect of size compression particularly in processing of a structured document in which a plurality of independent document parts are combined and a large number of similar structured documents.
[発明の目的]
本発明の目的は、複数の文書部品からなるような構造化文書の処理や、類似した多数の文書の処理において、サイズの高い圧縮率を得ることができ、かつ自由に任意の情報を追加可能な、構造化文書の符号化装置およびその復号化装置を提供することにある。
[Object of invention]
The object of the present invention is to obtain a high compression ratio and to freely add arbitrary information in the processing of a structured document composed of a plurality of document parts and the processing of a large number of similar documents. It is another object of the present invention to provide a structured document encoding apparatus and decoding apparatus thereof.
本発明の第1の構造化文書符号化装置は、符号化対象の構造化文書に含まれる文書部品に類似した文書部品を持つ外部文書を検索する外部文書参照決定手段と、検索された外部文書と符号化対象の構造化文書の類似した文書部品間の差分を計算する外部文書差分解析手段と、符号化対象の構造化文書に含まれる文書部品のうち外部文書の文書部品と類似した文書部品は当該外部文書の文書部品への参照情報と文書部品間の差分情報として符号化した符号化文書を生成する符号化文書生成手段とを備えることを特徴とする。 The first structured document encoding apparatus according to the present invention includes an external document reference determining unit that searches for an external document having a document part similar to a document part included in the structured document to be encoded, and the searched external document. External document difference analysis means for calculating the difference between similar document parts of the structured document to be encoded and a document part similar to the document part of the external document among the document parts included in the structured document to be encoded Is provided with reference information to the document part of the external document and encoded document generation means for generating an encoded document encoded as difference information between the document parts.
本発明の第2の構造化文書符号化装置は、第1の構造化文書符号化装置において、前記符号化文書生成手段は、外部文書の文書部品への参照情報を外部文書への参照情報と文書部品への参照情報とに分割して符号化することを特徴とする。 According to a second structured document encoding apparatus of the present invention, in the first structured document encoding apparatus, the encoded document generation unit includes reference information to the document part of the external document as reference information to the external document. It is characterized by being divided and encoded into reference information to document parts.
本発明の第3の構造化文書符号化装置は、第1の構造化文書符号化装置において、外部文書を記憶する文書保存部を備え、前記外部文書参照決定手段は前記文書保存部に記憶された外部文書のうち符号化対象の構造化文書に含まれる文書部品に類似した文書部品を持つ外部文書を検索することを特徴とする。 A third structured document encoding device of the present invention is the first structured document encoding device, further comprising a document storage unit that stores an external document, and the external document reference determination unit is stored in the document storage unit. Of the external documents, an external document having a document part similar to the document part included in the structured document to be encoded is searched.
本発明の第4の構造化文書符号化装置は、第3の構造化文書符号化装置において、前記符号化文書生成手段によって符号化された構造化文書の一部あるいは全部をあらたな外部文書として前記文書保存部に追加する文書蓄積手段を備えることを特徴とする。 According to a fourth structured document encoding apparatus of the present invention, in the third structured document encoding apparatus, a part or all of the structured document encoded by the encoded document generating unit is newly created as an external document. Document storage means for adding to the document storage unit is provided.
本発明の第5の構造化文書符号化装置は、第1の構造化文書符号化装置において、外部文書が、前記符号化文書生成手段が用いる符号化方式と同一の方式で符号化された符号化文書であることを特徴とする。 The fifth structured document encoding apparatus of the present invention is the first structured document encoding apparatus, wherein the external document is encoded by the same method as the encoding method used by the encoded document generating means. It is characterized by being a document.
本発明の第6の構造化文書符号化装置は、第5の構造化文書符号化装置において、前記符号化文書生成手段は、構造化文書の各要素をIDを付けた部品として符号化し要素間の参照をこのIDで表現する符号化方式を使用し、かつ文書部品間の差分情報は、外部文書のどの部品をどの部品で置換するかを置換え前後の部品のIDの組み合わせで表現したものであることを特徴とする。 According to a sixth structured document encoding apparatus of the present invention, in the fifth structured document encoding apparatus, the encoded document generation means encodes each element of the structured document as a part with an ID, and The encoding method that expresses the reference of the document with this ID is used, and the difference information between the document parts is the combination of the part IDs before and after replacing which part of the external document is replaced with which part. It is characterized by being.
本発明の第7の構造化文書符号化装置は、第6の構造化文書符号化装置において、前記符号化文書生成手段は、外部文書への参照情報にIDの変換ルールを含めて符号化し、かつ、差分情報で外部文書中の部品のIDを記述する際には、外部文書における当該部品に付けられているIDに前記変換ルールを適用した結果のIDを使用することを特徴とする。 According to a seventh structured document encoding device of the present invention, in the sixth structured document encoding device, the encoded document generation means encodes the reference information to the external document including an ID conversion rule, In addition, when the ID of the component in the external document is described by the difference information, the ID obtained as a result of applying the conversion rule to the ID attached to the component in the external document is used.
本発明の第8の構造化文書符号化装置は、第6の構造化文書符号化装置において、置換え前後の部品が文字列であることを特徴とする。 The eighth structured document encoding apparatus of the present invention is characterized in that, in the sixth structured document encoding apparatus, the parts before and after replacement are character strings.
本発明の第1の構造化文書復号化装置は、構造化文書に含まれる文書部品のうち外部文書の文書部品と類似した文書部品は当該外部文書の文書部品への参照情報と文書部品間の差分情報として符号化した符号化文書を復号化する装置であって、前記参照情報で示される外部文書を読み込む外部文書取込手段と、前記読み込んだ外部文書を前記差分情報に基づいて書き換える外部文書書換手段と、前記参照情報および前記差分情報として符号化された箇所を前記書き換えられた外部文書に置き換えて符号化文書から構造化文書を生成する構造化文書生成手段とを備えることを特徴とする。 According to the first structured document decryption apparatus of the present invention, a document part similar to the document part of the external document among the document parts included in the structured document is between the reference information and the document part of the document part of the external document. An apparatus for decoding an encoded document encoded as difference information, an external document fetching unit for reading an external document indicated by the reference information, and an external document for rewriting the read external document based on the difference information Rewriting means, and structured document generating means for generating a structured document from an encoded document by replacing the portion encoded as the reference information and the difference information with the rewritten external document. .
本発明の第2の構造化文書復号化装置は、第1の構造化文書復号化装置において、前記符号化文書においては外部文書の文書部品への参照情報が外部文書への参照情報と文書部品への参照情報とに分割して符号化されていることを特徴とする。 The second structured document decryption apparatus of the present invention is the first structured document decryption apparatus, wherein the reference information to the document part of the external document is the reference information to the external document and the document part in the encoded document. It is characterized by being divided and encoded into reference information.
本発明の第3の構造化文書復号化装置は、第1の構造化文書復号化装置において、外部文書を記憶する文書保存部を備え、前記外部文書取込手段は前記文書保存部から前記参照情報で示される外部文書を読み込むことを特徴とする。 The third structured document decryption apparatus of the present invention is the first structured document decryption apparatus, further comprising a document storage unit for storing an external document, and the external document fetching unit refers to the reference from the document storage unit. An external document indicated by information is read.
本発明の第4の構造化文書復号化装置は、第3の構造化文書復号化装置において、前記構造化文書生成手段によって復号化された構造化文書の一部あるいは全部をあらたな外部文書として前記文書保存部に追加する文書蓄積手段を備えることを特徴とする。 According to a fourth structured document decryption apparatus of the present invention, in the third structured document decryption apparatus, a part or all of the structured document decrypted by the structured document generation unit is newly created as an external document. Document storage means for adding to the document storage unit is provided.
本発明の第5の構造化文書復号化装置は、第1の構造化文書復号化装置において、外部文書が、前記符号化文書と同一の方式で符号化された符号化文書であることを特徴とする。 A fifth structured document decoding apparatus according to the present invention is characterized in that, in the first structured document decoding apparatus, the external document is an encoded document encoded by the same method as the encoded document. And
本発明の第6の構造化文書復号化装置は、第5の構造化文書復号化装置において、前記符号化文書は、構造化文書の各要素をIDを付けた部品として符号化し要素間の参照をこのIDで表現する符号化方式を使用して符号化され、かつ文書部品間の差分情報は、外部文書のどの部品をどの部品で置換するかを置換え前後の部品のIDの組み合わせで表現したものであり、前記構造化文書生成手段は、前記符号化文書と前記外部文書に記載されたIDとその部品をIDを用いて参照しながら、参照されたIDが前記差分情報に記載された置換え前のIDであった場合は代わりに置換え後のIDを参照して構造化文書を生成することを特徴とする。 The sixth structured document decryption apparatus of the present invention is the fifth structured document decryption apparatus, wherein the encoded document is encoded as a component with an ID attached to each element of the structured document and referenced between the elements. The difference information between document parts is expressed as a combination of parts ID before and after replacing which part of the external document is replaced by which part. The structured document generation means refers to the replacement in which the referenced ID is described in the difference information while referring to the ID and its parts described in the encoded document and the external document using the ID. If it is the previous ID, a structured document is generated by referring to the replaced ID instead.
本発明の第7の構造化文書復号化装置は、第6の構造化文書復号化装置において、前記符号化文書は、外部文書への参照情報にIDの変換ルールを含めて符号化され、かつ、差分情報で外部文書中の部品のIDを記述する際には、外部文書における当該部品に付けられているIDに前記変換ルールを適用した結果のIDが使用されており、前記外部文書取込手段は、前記読み込んだ外部文書に含まれる全てのIDに対し前記変換ルールに従った変換処理を施すことを特徴とする。 The seventh structured document decoding apparatus of the present invention is the sixth structured document decoding apparatus, wherein the encoded document is encoded by including an ID conversion rule in the reference information to the external document, and When describing the part ID in the external document with the difference information, the ID obtained as a result of applying the conversion rule to the ID attached to the part in the external document is used. The means is characterized in that a conversion process according to the conversion rule is performed on all IDs included in the read external document.
本発明の第8の構造化文書復号化装置は、第6の構造化文書復号化装置において、置換え前後の部品が文字列であることを特徴とする。 An eighth structured document decryption apparatus according to the present invention is characterized in that, in the sixth structured document decryption apparatus, the parts before and after replacement are character strings.
本発明の構造化文書符号化方法は、コンピュータを用いて構造化文書を符号化する方法であって、前記コンピュータが、符号化対象の構造化文書に含まれる文書部品に類似した文書部品を持つ外部文書を検索する第1のステップと、前記コンピュータが、検索された外部文書と符号化対象の構造化文書の類似した文書部品間の差分を計算する第2のステップと、前記コンピュータが、符号化対象の構造化文書に含まれる文書部品のうち外部文書の文書部品と類似した文書部品は当該外部文書の文書部品への参照情報と文書部品間の差分情報として符号化した符号化文書を生成する第3のステップとを含むことを特徴とする。 The structured document encoding method of the present invention is a method of encoding a structured document using a computer, and the computer has a document part similar to a document part included in a structured document to be encoded. A first step of searching for an external document; a second step of calculating a difference between similar document parts of the searched external document and a structured document to be encoded; and Among the document parts included in the structured document to be converted into a document part that is similar to the document part of the external document, generates an encoded document that is encoded as the reference information to the document part of the external document and the difference information between the document parts And a third step.
本発明の構造化文書復号化方法は、構造化文書に含まれる文書部品のうち外部文書の文書部品と類似した文書部品は当該外部文書の文書部品への参照情報と文書部品間の差分情報として符号化した符号化文書をコンピュータを用いて復号化する方法であって、前記コンピュータが、前記参照情報で示される外部文書を読み込む第1のステップと、前記コンピュータが、前記読み込んだ外部文書を前記差分情報に基づいて書き換える第2のステップと、前記コンピュータが、前記参照情報および前記差分情報として符号化された箇所を前記書き換えられた外部文書に置き換えて符号化文書から構造化文書を生成する第3のステップとを含むことを特徴とする。 According to the structured document decryption method of the present invention, among document parts included in a structured document, a document part similar to a document part of an external document is used as reference information for the document part of the external document and difference information between the document parts. A method for decoding an encoded document using a computer, wherein the computer reads an external document indicated by the reference information, and the computer reads the external document read by the computer. A second step of rewriting based on the difference information; and the computer generates a structured document from the encoded document by replacing the reference information and the portion encoded as the difference information with the rewritten external document. And 3 steps.
本発明の第1のデータ構造は、1以上の外部文書取込宣言データと1以上の外部部品参照データとを含み、前記外部文書取込宣言データは、自文書に取り込む外部の文書を示す外部文書参照データを含み、前記外部部品参照データは、前記外部文書参照データで特定される外部文書中のどの文書部品を参照するかを示す参照先データと、参照先データで特定される文書部品中のどの部品をどの部品で置換するかを示す差分情報とを含むことを特徴とする。 The first data structure of the present invention includes one or more external document capture declaration data and one or more external part reference data, and the external document capture declaration data is an external indicating an external document to be captured in the own document. Document reference data is included, and the external part reference data includes reference destination data indicating which document part in the external document specified by the external document reference data is referred to, and the document part specified by the reference destination data. Difference information indicating which part is replaced with which part.
本発明の第2のデータ構造は、第1のデータ構造において、前記外部文書取込宣言データはIDの変換ルールを含み、前記外部部品参照データ中の参照先データは、参照する外部文書中の文書部品に当該外部文書中で付けられているIDを前記変換ルールで変換したIDが設定され、かつ、前記差分情報で外部文書中の部品のIDを記述する際には、外部文書における当該部品に付けられているIDに前記変換ルールを適用した結果のIDが設定されていることを特徴とする。 According to a second data structure of the present invention, in the first data structure, the external document capture declaration data includes an ID conversion rule, and the reference destination data in the external part reference data is in an external document to be referenced. When an ID assigned to the document part in the external document is set by the conversion rule, and the ID of the part in the external document is described by the difference information, the part in the external document An ID obtained as a result of applying the conversion rule is set to the ID attached to.
『作用』
本発明にあっては、構造化文書の符号化時に、外部文書参照決定手段が、構造化文書の文書部品と類似する文書部品を含む外部の符号化文書を調べ、存在する場合、外部文書差分解析手段が類似する二つの文書部品の差分を解析し、符号化文書生成手段が、符号化文書の中の類似文書が存在した部品の記載として、外部文書への参照情報と参照先との差分情報とを記録する。また、符号化文書からの構造化文書の復号化時は、符号化文書中に外部文書の参照情報が含まれる場合、外部文書取込手段が参照先の外部文書の部品を読み込み、外部文書書換手段が読み込んだ文書部品に差分情報を適用して書き換え、構造化文書生成手段が、書き換えられた文書部品を外部部品の参照情報の代わりに用いて構造化文書を復元する。
"Action"
In the present invention, when the structured document is encoded, the external document reference determining unit examines an external encoded document including a document part similar to the document part of the structured document, and if there is an external document difference The analysis unit analyzes the difference between two similar document parts, and the encoded document generation unit uses the difference between the reference information to the external document and the reference destination as a description of the part in which the similar document exists in the encoded document. Record information. In addition, when decoding a structured document from an encoded document, if the reference information of the external document is included in the encoded document, the external document fetching means reads the part of the external document that is the reference destination, and rewrites the external document. The difference information is applied to the document part read by the means for rewriting, and the structured document generating means restores the structured document by using the rewritten document part instead of the reference information of the external part.
このような構成を採用し、外部文書を部品として参照しながら、かつ参照先部品との差分を記載可能として、完全には等しくない外部文書を参照先として利用可能としたことにより、より多くの文書部品で外部文書を参照することができる。また、同時に複数の外部文書を参照しながら部品単位で最低限の差分情報のみを記録する事ができる。これにより、本発明の目的を達成することができる。 By adopting such a configuration, it is possible to describe the difference from the reference part while referring to the external document as a part, and it is possible to use an external document that is not completely equal as a reference destination. External documents can be referred to by document parts. Further, it is possible to record only the minimum difference information for each part while referring to a plurality of external documents at the same time. Thereby, the object of the present invention can be achieved.
また本発明の好ましい実施の形態にあっては、符号化文書を、要素名、属性名、要素値、属性値などの文字列部品のリストと、一つの要素を示す要素部品あるいは外部部品参照データのリストにより構成し、全ての部品は符号化文書内で一意なIDにより識別され、各要素部品は自身の要素名、要素値、属性名、属性値などの文字列と、自身の子要素である他の要素部品を前記IDで参照するよう符号化する。さらに符号化文書は、外部符号化文書への参照と外部符号化文書内のIDの参照元文書内IDへの変換ルールからなる外部文書取込み宣言を持ち、また外部部品参照データは外部文書取込宣言の変換ルールによって得られる外部符号化文書内の要素部品のIDを指定し、差分データを変更対象となる部品のIDとその変更後のIDのセットのリストとして記載する。そして、符号化文書を読み込み、参照される外部符号化文書を読み込むとき、外部符号化文書のIDをID変換ルールによって変換したものを参照元の符号化文書の一部のように扱う。 In a preferred embodiment of the present invention, an encoded document is a list of character string parts such as an element name, an attribute name, an element value, and an attribute value, and an element part or external part reference data indicating one element. All parts are identified by a unique ID in the encoded document, and each element part is a string of its own element name, element value, attribute name, attribute value, etc. and its own child element A certain other element part is encoded so as to be referred to by the ID. Furthermore, the encoded document has an external document import declaration consisting of a reference to the external encoded document and a conversion rule of the ID in the external encoded document to the ID in the reference source document, and the external part reference data is acquired in the external document. The ID of the element part in the externally encoded document obtained by the declaration conversion rule is specified, and the difference data is described as a list of the set of the part ID to be changed and the changed ID. Then, when the encoded document is read and the external encoded document to be referred to is read, the ID of the external encoded document converted by the ID conversion rule is handled as a part of the reference encoded document.
このような構成を採用し、構造化文書を文字列や要素単位で部品化してIDで参照するよう符号化すると同時に、他の符号化文書をあたかも自分の符号化文書の一部として取り込み可能にし、さらに外部部品参照データの差分情報としてこのIDを置換可能にする事で、書き換えを伴わない部品の取込は単にIDを指定するだけで可能になると同時に、書き換えを伴う部品の取り込みも差分情報をID二つのみの小さいデータで記述することが可能となる。 By adopting such a configuration, the structured document is encoded as a part of character string or element unit and referred to by ID, and at the same time, other encoded documents can be imported as if they were part of their encoded document. Furthermore, by making it possible to replace this ID as difference information of external part reference data, it is possible to import parts without rewriting by simply specifying an ID, and at the same time, importing parts with rewriting is also differential information. Can be described with small data with only two IDs.
本発明によれば、構造化文書の符号化において、高い圧縮効果を得る事ができる。その理由は、一つ以上の外部文書を文書部品として参照しながら、かつそれとの差分のみを記載できる符号化文書を生成できるためである。特に、構造化文書の各要素をIDを付けた部品として符号化し要素間の参照をこのIDで表現する符号化方式を使用すれば、外部文書内の文書部品や文字列への参照や差分を小さなデータで記述することが可能となるため、圧縮率をより一層高めることができる。 According to the present invention, a high compression effect can be obtained in encoding a structured document. The reason is that it is possible to generate an encoded document in which only one or more external documents are referred to as document parts and only the difference between them can be described. In particular, if you use an encoding method that encodes each element of a structured document as a part with an ID and expresses the reference between the elements with this ID, references and differences to document parts and character strings in the external document are displayed. Since it is possible to describe with small data, the compression rate can be further increased.
次に、本発明を実施するための最良の形態について図面を参照して詳細に説明する。 Next, the best mode for carrying out the present invention will be described in detail with reference to the drawings.
『第1の実施の形態』
図1Aを参照すると、本発明の第1の実施の形態にかかる構造化文書処理装置は、構造化文書131を入力して符号化文書121を生成し出力する構造化文書符号化モジュール101と、符号化文書121を入力して元の構造化文書131と同じ構造化文書133を生成して出力する構造化文書復号化モジュール111と、双方のモジュール101および111で共用される外部文書132とから構成される。
"First embodiment"
Referring to FIG. 1A, a structured document processing apparatus according to a first embodiment of the present invention includes a structured
外部文書132は、構造化文書131と同様な他の構造化文書を符号化文書121と同一の方式を用いて符号化した文書である。
The
構造化文書符号化モジュール101は、構造化文書131を解析する構造化文書解析部102と、この構造化文書解析部102から構造化文書131の解析結果を入力し、構造化文書131の一部と類似した外部文書132を検索する外部文書参照決定部104と、この外部文書参照決定部104で検索された外部文書132と構造化文書131の類似した箇所との差分を計算する外部文書差分解析部105と、構造化文書解析部102から構造化文書131の解析結果を入力し、外部文書差分解析部105から構造化文書131の一部とそれに類似した外部文書132との差分情報を入力し、類似した箇所は外部文書132への参照情報とそれとの差分情報として符号化した符号化文書121を生成する符号化文書生成部103と、符号化処理の過程で生成される参照利用情報107を記憶する記憶部106とを備える。
The structured
構造化文書復号化モジュール111は、符号化文書121を解析する符号化文書解析部112と、この符号化文書解析部112から符号化文書121の解析結果を入力し、符号化文書121に含まれる参照情報で参照される外部文書132を読み込む外部文書取込部114と、読み込んだ外部文書132を符号化文書121に含まれる差分情報を用いて書き換える外部文書書換部115と、符号化文書解析部112から符号化文書121の解析結果を入力し、外部文書書換部115から書き換えられた外部文書を入力し、符号化文書121の参照情報として符号化された箇所を前記書き換えられた外部文書に置き換えて構造化文書133を生成する構造化文書生成部113と、復号化処理の過程で生成される符号化文書内部データ117を記憶する記憶部116とを備える。
The structured
ここで、構造化文書符号化モジュール101および構造化文書復号化モジュール111は、例えばCPUと主記憶と外部記憶装置を少なくとも有するコンピュータによって実現することができる。その場合、構造化文書符号化モジュール101を実現するコンピュータと、構造化文書復号化モジュール111を実現するコンピュータとは、同じコンピュータであっても良いし、別のコンピュータであっても良い。
Here, the structured
次に、図1Aのブロック図、図2A及び図3のフローチャートを参照して本実施の形態の全体の動作について詳細に説明する。 Next, the overall operation of this embodiment will be described in detail with reference to the block diagram of FIG. 1A and the flowcharts of FIGS. 2A and 3.
構造化文書符号化モジュール101では、まずステップS201において、構造化文書解析部102が符号化対象の構造化文書131を解析する。
In the structured
次にステップS202で、外部文書参照決定部104は、外部文書132の中から、解析された構造化文書131に含まれる文書部品と類似したものを検索する。本実施の形態の場合、他の構造化文書を符号化した符号化文書を外部文書132としているため、例えば、外部文書132を構造化文書に復号化したものと構造化文書131に含まれる文書部品とを比較して、類似した外部文書を検索する。あるいは、利用できる外部文書が存在しないものと仮定して構造化文書131を符号化したものと、外部文書132とを比較して、類似した外部文書を検索しても良い。ここで、類似するとは、完全に一致する場合と、完全に一致しないが、予め定められた条件が満たされる程度に似ている場合を含む。
In step S202, the external document
上記の検索の結果、類似する外部文書が見つかった場合(ステップS203でY)、外部文書差分解析部105により、構造化文書131と外部文書132の類似した文書部品同士を比較し、その差分情報を計算する(ステップS204)。そして、類似した文書部品を含む外部文書132の参照情報と、外部文書132内の類似した文書部品の位置と、構造化文書131の中の類似した外部文書が見つかった文書部品の位置と、差分情報とをあわせて参照利用情報107として記憶部106に保存する(ステップS205)。
If similar external documents are found as a result of the above search (Y in step S203), the external document
次に、符号化文書生成部103が符号化対象の構造化文書131を符号化し、符号化文書121を生成する(ステップS206)。このとき符号化文書生成部103は、参照利用情報107の有無を確認し、参照利用情報107がある場合、参照利用情報107に記述された構造化文書131の中の文書部品については符号化は行わず、その代わりに外部部品参照データ122を生成し符号化文書121に記載する。外部部品参照データ122は、参照利用情報107の、外部文書132の参照情報を外部文書参照データ123として有し、外部符号化文書132内の類似した文書部品の位置を部品参照データ125として有し、差分情報を差分データ124として有している。ここで、外部部品参照データ122は構造化文書の形式で表現され、他の要素と同様に符号化される。
Next, the encoded
こうして構造化文書131を符号化した符号化文書121が、構造化文書符号化モジュール101から構造化文書復号化モジュール111へ伝達される。
The encoded document 121 obtained by encoding the structured
構造化文書復号化モジュール111では、ステップS301でまず符号化文書解析部112が符号化文書121を解析し、その解析結果を符号化文書内部データ117として記憶部116に保存する。次に、外部文書取込部114は、その解析結果を参照して、符号化文書121の中に外部部品参照データ122が含まれているかどうかチェックし(ステップS302)、含まれている場合、全ての外部部品参照データ122について外部文書参照データ123で参照される外部文書132を読み込む(ステップS303)。さらに、外部文書書換部115が、読み込まれた外部文書132の部品参照データ125で指定される文書部品を差分データ124を用いて書き換え(ステップS304)、記憶部116に保存されている符号化文書内部データ117の中の外部部品参照データ122であった要素部分を前記書き換えた文書部品に置き換える(ステップS305)。全ての外部部品参照データ122の文書部品への置き換えを終えたら、最後に構造化文書生成部112が、記憶部116の符号化文書内部データ117から構造化文書133を生成する(ステップS306)。
In the structured
なお本実施の形態においては、符号化文書121内での一般的な要素の符号化方法やフォーマットは規定しないが、外部部品参照データ122自身を構造化文書の形式で表現し、他の要素と同様に符号化すると考えれば、従来の様々な構造化文書の符号化方法が利用できることは明らかであろう。加えて、符号化方式として符号化しない、すなわち構造化文書自身をフォーマットとして採用する事も可能である事は明らかである。 In the present embodiment, the encoding method and format of general elements in the encoded document 121 are not stipulated, but the external component reference data 122 itself is expressed in the form of a structured document, and other elements and It will be apparent that various conventional structured document encoding methods can be used in the same way. In addition, it is obvious that it is possible not to encode as an encoding method, that is, to adopt a structured document itself as a format.
また本実施の形態では、構造化文書と外部符号化文書との差分の計算の仕方や、差分データの表現方法は特に規定していないが、これは様々な既存技術が利用可能であることは明らかであろう。例えば特許文献3では多様な差分の計算方法や差分データのXSLTでの表現方法などを開示している。
In this embodiment, the method of calculating the difference between the structured document and the externally encoded document and the method of expressing the difference data are not particularly defined, but this is because various existing technologies can be used. It will be clear. For example,
また本実施の形態においては、外部文書参照決定部104が外部文書132を検索する方法は特に規定しないが、好適な実施例としては、外部文書132を、データベースや二次記憶装置、構造化文書符号化モジュール101や構造化文書復号化モジュール111にネットワークを介して接続されたサーバ上に配置し、それらに対して検索要求を送って結果を受取ったり、全文書を取得して外部文書参照決定部104自身が類似性を判定するなどといった方法が考えられる。
In the present embodiment, the method by which the external document
また本実施の形態においては、外部文書として符号化文書を用いたが、構造化文書を外部文書とすることができるのは勿論のことである。 In the present embodiment, an encoded document is used as an external document. However, it goes without saying that a structured document can be used as an external document.
次に、本実施の形態の効果について説明する。 Next, the effect of this embodiment will be described.
本実施の形態では、符号化時に外部文書参照決定部104が部品として利用可能な外部文書132を決定し、外部文書差分解析部105が部品間の差分を解析し、符号化文書生成部103が本来の部品の代わりに外部文書参照データ123と部品参照データ125と差分データ124のセットからなる外部部品参照データ122を生成し、復号化時には外部文書取込部114が外部文書参照データ123で指定された外部文書132を読み込んで部品参照データ125で指定される文書部品を取り出し、外部文書書換部115が差分データ124を用いて、読み込んだ部品を書き換え、これを用いて構造化文書生成部113が構造化文書を復号するため、多少異なる外部文書でも部品として参照することが可能となる。これにより、より多くの外部文書が参照先として利用可能になると同時に、符号化文書121には参照先との差分情報のみを記載すれば良いため、符号化文書121の圧縮率を高めることが可能となる。加えて、複数の外部文書を類似部品として参照しそれぞれの部品毎に差分の記載を行うため、複数の内容を組合わせて記述するような構造化文書であっても、少ない情報で符号化を行うことが可能となる。
In the present embodiment, the external document
『第2の実施の形態』
第1の実施の形態では、外部文書参照決定部104が検索し外部文書取込部114が獲得する外部文書132の格納場所は特に限定しなかったが、本実施の形態では、図1Bに示されるように、外部文書132を記憶する共有文書保存部109を設け、ここから外部文書132を検索、獲得すると同時に、構造化文書符号化モジュール101が作成した符号化文書121をあらたな外部文書として自動的に共有文書保存部109に追加する。
“Second Embodiment”
In the first embodiment, the storage location of the
図1Bを参照すると、構造化文書符号化モジュール101はさらに符号化文書蓄積部108を持ち、共有文書保存部109に接続される。構造化文書復号化モジュール111もまた共有文書保存部109に接続される。
Referring to FIG. 1B, the structured
次に図1Bのブロック図と図2Bのフローチャートを参照して、本実施の形態の動作を説明する。 Next, the operation of this embodiment will be described with reference to the block diagram of FIG. 1B and the flowchart of FIG. 2B.
構造化文書符号化モジュール101における構造化文書131の解析ステップS201から符号化文書121を生成するステップS206までは、第1の実施の形態における動作と同じである。構造化文書符号化モジュール101の符号化文書蓄積部108は、ステップS206で符号化文書121の生成が完了すると、生成された符号化文書121が外部文書132を参照しているか否かを調べる(ステップS207)。参照していない場合、構造化文書131に類似する外部文書132が一つも共有文書保存部109に存在しなかったことになるため、今回生成した符号化文書121をあらたな外部文書として共有文書保存部109に追加する(ステップS208)。
The steps from the analysis step S201 of the structured
また外部文書132を参照していた場合、符号化文書蓄積部108は、参照した外部文書132との差分が予め定められた量より大きいか否かを調べ(ステップS209)、大きい場合、差分として記載された文書部品を一つの符号化文書(外部文書)として共有文書保存部109に追加する(ステップS210)。
If the
このように、構造化文書モジュール101が、類似した外部文書が存在しなかった場合や、存在しても差異が大きい場合に、生成した符号化文書の全部もしくは一部を外部文書として自動的に蓄積することにより、参照可能な外部文書が増加し、処理が進むにつれて高い圧縮効果が得られるようになる。
In this way, the structured
なお、本実施の形態では、共有文書保存部109への新たな外部文書の追加を構造化文書符号化モジュール101が行ったが、符号化文書蓄積部108と同様の機能手段を構造化文書復号化モジュール111に設けることにより、共有文書保存部109への新たな外部文書の追加を構造化文書復号化モジュール111が行っても良い。
In the present embodiment, the structured
『第3の実施の形態』
図4Aを参照すると、本発明の第3の実施の形態にかかる構造化文書処理装置は、構造化文書131を入力してID型符号化文書421を生成し出力する構造化文書符号化モジュール101と、ID型符号化文書421を入力して元の構造化文書131と同じ構造化文書133を生成して出力する構造化文書復号化モジュール111と、双方のモジュール101および111で共用される外部文書432とから構成される。
“Third embodiment”
Referring to FIG. 4A, the structured document processing apparatus according to the third exemplary embodiment of the present invention inputs a structured
本実施の形態は、符号化方式としてID型符号化方式を用いる。ID型符号化方式は、構造化文書の構成要素を、文字列部品(要素名、属性名、要素値、属性値など)と、要素部品とに分解し、個々にIDを割り当ててIDで相互に参照することで符号化する方式である。 In the present embodiment, an ID type encoding method is used as an encoding method. The ID-type encoding method divides the components of a structured document into character string parts (element names, attribute names, element values, attribute values, etc.) and element parts, and assigns IDs to each other and uses them as IDs. This is a method of encoding by referring to.
外部文書432は、構造化文書131とは別の構造化文書をID型符号化方式で符号化した文書である。
The external document 432 is a document obtained by encoding a structured document different from the structured
構造化文書符号化モジュール101は、構造化文書131を解析する構造化文書解析部102と、この構造化文書解析部102から構造化文書131の解析結果を入力し、構造化文書131の一部と類似した他の構造化文書を符号化した外部文書432を検索する外部文書参照決定部104と、この外部文書参照決定部104で検索された外部文書432と構造化文書131の類似した箇所との差分を計算する外部文書差分解析部105と、構造化文書解析部102から構造化文書131の解析結果を入力し、外部文書差分解析部105から構造化文書131の一部とそれに類似した外部文書との差分情報を入力し、類似した箇所は外部文書への参照情報とそれとの差分情報として符号化したID型符号化文書421を生成するID型符号化文書生成部403と、符号化処理の過程で生成される参照利用情報107を記憶する記憶部106とを備える。
The structured
構造化文書復号化モジュール111は、ID型符号化文書421を解析するID型符号化文書解析部412と、このID型符号化文書解析部412からID型符号化文書421の解析結果を入力し、ID型符号化文書421に含まれる参照情報で参照される外部文書432を読み込むID型外部文書取込部414と、読み込んだ外部文書432をID型符号化文書421に含まれる差分情報を用いて書き換えるID型外部文書書換部415と、ID型符号化文書解析部412からID型符号化文書421の解析結果を入力し、ID型外部文書書換部415から書き換えられた外部文書を入力し、ID型符号化文書421の参照情報として符号化された箇所を前記書き換えられた外部文書に置き換えて構造化文書133を生成するID型構造化文書生成部413と、復号化処理の過程で生成されるIDテーブル417を記憶する記憶部116とを備える。
The structured
図5を参照すると、ID型符号化文書421、432の構成例を示すID型符号化文書501は、外部文書を参照している場合には参照している外部文書の数に等しい個数の外部文書取込宣言502と、一つ以上の部品503のリストとからなる。部品503は、文字列部品、要素部品、ID型外部部品参照データのいずれかの種類になり、符号化文書内で一意なIDを持つ。
Referring to FIG. 5, the ID type encoded document 501 showing the configuration example of the ID type encoded
図6を参照すると、外部文書取込宣言502の構成例を示す外部文書取込宣言601は、取り込む外部の文書を示すID型外部文書参照データ602と、このID型外部文書参照データ602が示す外部の文書中に現れるIDをどのように変換するかを示すID変換ルール603とを持つ。ID変換ルール603は、当該ID型外部文書参照データ602が示す外部の文書中に現れる部品のIDが、これから生成するID型符号化文書421に現れる構造化文書131中のIDや他のID型外部文書参照データ602が示す外部の文書中に現れるIDと重複しないようなルールに定められる。
Referring to FIG. 6, an external document import declaration 601 showing a configuration example of the external document capture declaration 502 is indicated by ID type external document reference data 602 indicating an external document to be captured and the ID type external document reference data 602. An ID conversion rule 603 indicating how to convert an ID appearing in an external document. In the ID conversion rule 603, the ID of the part appearing in the external document indicated by the ID type external document reference data 602 is the ID in the structured
図7を参照すると、文字列部品である場合の部品503の構成例を示す文字列型部品701は、文字列702を持つ。文字列702は、要素名や要素値などを表現する文字列そのものである。
Referring to FIG. 7, a character string type component 701 showing a configuration example of a component 503 in the case of a character string component has a
図8を参照すると、要素部品である場合の部品503の構成例を示す要素部品801は、要素名ID802、要素値ID803、属性名IDと属性値IDのリストからなる属性テーブル804、子要素IDのリストからなる子要素テーブル805を持つ。つまり、前述したように構造化文書は、一つの要素を根として木構造を構成し、各要素は要素名、要素値、属性名、属性値、子要素のリストなどで構成されるが、一つの要素部品は一つの要素をIDを使用して表現したものである。
Referring to FIG. 8, an element component 801 showing a configuration example of a component 503 in the case of an element component includes an
図9を参照すると、ID型外部部品参照データである場合の部品503の構成例を示すID型外部部品参照データ901は、参照先ID902と、変更前IDと変更後IDのリストからなる差分データ903とを持つ。参照先ID902は、外部文書取込宣言601のID型外部文書参照データ602で特定される外部文書中のどの文書部品を参照するかをその文書部品のIDで指定する。差分データ903の変更前IDと変更後IDの組は、参照先IDで特定される文書部品中のどの部品をどの部品で置換するかを置換え前後の部品のIDの組み合わせで表現している。ここで、参照先ID902は、外部文書における文書部品のIDに外部文書取込宣言601の変換ルール603を適用した結果のIDを使用する。また、差分情報で外部文書中の部品のIDを記述する際も同様に、外部文書における当該部品に付けられているIDに外部文書取込宣言601の変換ルール603を適用した結果のIDを使用する。
Referring to FIG. 9, ID type external part reference data 901 showing a configuration example of a part 503 in the case of ID type external part reference data is difference data composed of a
図10を参照すると、復号処理の過程で記憶部116に記憶されるIDテーブル417の構成例を示すIDテーブル1001は、IDとそれが示す部品のリストからなる。
Referring to FIG. 10, an ID table 1001 showing a configuration example of the ID table 417 stored in the
次に、本実施の形態の全体の動作について詳細に説明する。 Next, the overall operation of the present embodiment will be described in detail.
構造化文書符号化モジュール101では、まず図4BのステップS201において、構造化文書解析部102が符号化対象の構造化文書131を解析し、次いでステップS202で、外部文書参照決定部104が、外部文書432の中から、解析された構造化文書131に含まれる文書部品と類似した文書部品を持つものを検索する。本実施の形態の場合、他の構造化文書をID型符号化方式で符号化したID型符号化文書を外部文書432としているため、例えば、ID型符号化文書432を構造化文書に復号化したものと構造化文書131に含まれる文書部品とを比較して、類似した外部文書を検索する。あるいは、利用できる外部文書が存在しないものと仮定して構造化文書131をID型符号化したものと、外部文書432とを比較して、類似した外部文書を検索しても良い。ここで、類似するとは、完全に一致する場合と、完全に一致しないが、予め定められた条件が満たされる程度に似ている場合を含む。
In the structured
上記の検索の結果、類似する外部文書432が見つかった場合(ステップS203でY)、外部文書差分解析部105により、構造化文書131と外部文書432の類似した文書部品同士を比較し、その差分情報を計算する(ステップS204)。そして、類似した文書部品を含む外部文書432の参照情報と、外部文書432内の類似した文書部品の位置と、構造化文書131の中の類似した外部文書が見つかった文書部品の位置と、差分情報とをあわせて参照利用情報107として記憶部106に保存する(ステップS205)。
If a similar external document 432 is found as a result of the above search (Y in step S203), the external document
次に、ID型符号化文書生成部103が符号化対象の構造化文書131をID型符号化方式により符号化し、ID型符号化文書421を生成する(ステップS211、S212)。本実施の形態では、この符号化時に、ID型符号化文書生成部403が、外部文書参照決定部104が決定した外部文書432への参照情報を、ID型符号化文書432を示すID型外部文書参照データ602とID変換ルール603とからなる外部文書取込宣言601として、外部部品参照データとは別に符号化する。さらに、ID型符号化文書生成部403は、構造化文書131を、要素名、属性名、要素値、属性値などに使用される文字列部品と、一つの要素を示す要素部品と、ID型外部部品参照データのリストとからなるように符号化する。ここで、要素部品やID型外部部品参照データは、文字列部品や他の要素部品をIDで指定することで参照するよう符号化する。参照先のIDは、処理対象の構造化文書131内の部品については適切なIDを指定し、外部文書取込宣言601によって指定した外部のID型符号化文書432内の部品については、その部品に外部文書中で付けられているIDをID変換ルールによって変換した結果のIDを指定する。
Next, the ID type encoded
こうして構造化文書131をID型符号化方式により符号化したID型符号化文書421が、構造化文書符号化モジュール101から構造化文書復号化モジュール111へ伝達される。
The ID type encoded
一方、構造化文書復号化モジュール111では、図4CのステップS301でまずID型符号化文書解析部412がID型符号化文書421を解析し、その解析結果に基づいて符号化文書内部データとして、IDと対応する部品データとの変換テーブルであるIDテーブル417を作成する(ステップS311)。
On the other hand, in the structured
次にID型外部文書取込部414は、ID型符号化文書421に含まれる全ての外部文書取込宣言601について、ID型外部文書参照データ602を用いてID型符号化文書である外部文書432を読み込み(ステップS302、S303)、ID変換ルール603を用いて外部文書中の全てのIDを変換して(ステップS312)、これをIDテーブル417に追加する(ステップS313)。さらに、ID型外部文書書換部415は、ID型外部部品参照データ901を用いて、このID型外部部品参照データ901のIDのIDテーブル417での対応部品を、参照先ID902の示すIDの部品に書き換えるとともに、参照先ID902が示す要素から直接あるいは子や孫要素を通じて間接的に参照される部品のIDを調べ、そこに差分データ903の変更前IDと等しいIDが見つかった場合、IDテーブル417の変更前IDの部品を変更後IDの対応する部品に置き換える(ステップS314)。
Next, the ID type external document capturing unit 414 uses the ID type external document reference data 602 for all the external document capture declarations 601 included in the ID type encoded
最後にID型構造化文書生成部413が、構造化文書の根となる要素から順に、IDテーブル417を使用してIDを解決して部品を参照し、IDテーブル417から構造化文書133を復元する(ステップS306)。
Finally, the ID-type structured
次に、本実施の形態の効果について説明する。 Next, the effect of this embodiment will be described.
本実施の形態では、特に符号化の具体的方法として、構造化文書の構成要素を文字列と要素に分解し、個々にIDを割り当ててIDで相互に参照するID型符号化方式を用い、各部品をIDで参照可能にするとともに、外部文書取込宣言によって外部のID型符号化文書内の部品をあたかも自文書内の部品として扱い可能とすることで、外部文書の部品の参照やその差分情報をIDの指定やIDの置換として表現する事が可能となり、より小さなデータで外部文書を取込み符号化することが可能となる。 In the present embodiment, as a specific method of encoding, in particular, an ID type encoding method is used in which components of a structured document are decomposed into character strings and elements, IDs are individually assigned and mutually referenced by IDs, Each part can be referred to by ID, and the parts in the external ID type encoded document can be handled as parts in the own document by the external document import declaration. Difference information can be expressed as ID designation or ID substitution, and it is possible to import and encode an external document with smaller data.
また参照する情報の単位として、構造化文書の文書部品だけではなく、要素名や要素値、属性名や属性値などの文字列単位で外部の文書内の部品を参照可能とすることにより、構造化文書の文書構造定義で規定される文字列や、それ以外の任意の文字列も、頻繁に使用されるものを事前に外部の構造化文書に記載して符号化モジュールと復号化モジュールで共有すれば、個々のID型符号化文書には単にそれらへの参照のみを記載すればよくなるため、より高いサイズの圧縮効果を得ることが可能となる。 In addition, as a unit of information to be referenced, it is possible to refer to parts in external documents not only in document parts of structured documents but also in character string units such as element names, element values, attribute names and attribute values. Character strings specified in the document structure definition of structured documents and other arbitrary character strings are frequently used in advance in external structured documents and shared by the encoding module and decoding module Then, since it is only necessary to describe only the reference to each ID type encoded document, it is possible to obtain a compression effect of a higher size.
『その他の実施の形態』
第1乃至第3の実施の形態では、構造化文書復号化モジュール111は、復号時に外部文書を毎回外部から読み込んで解析していたが、これを、解析済みの状態で記憶部内部にキャッシュしておいても良い。類似の構造化文書を何度も復号化する場合、同じ外部文書を何度も使用するため、復号処理の処理負荷を軽減する事が出来る。
"Other embodiments"
In the first to third embodiments, the structured
また第1乃至第3の実施の形態では、構造化文書符号化モジュール101の入力と構造化文書復号化モジュール111の出力は共に構造化文書としていたが、これを、解析済みの形で扱うようにしてもよい。解析済みの形の好適な実施例は、DOM APIやSAX APIを通して利用可能なオブジェクトや、構造化文書をプログラム言語のオブジェクトのクラス定義や変数に変換したものなどである。クラス定義や変数に変換したものの例は、Java(登録商標)プログラム言語のJava Beansコンポーネントである。さらに、解析済みの形態が、外部文書との差分が計算しやすい形であると、より効率的な符号化処理が行える。
In the first to third embodiments, both the input of the structured
また第1乃至第3の実施の形態では、外部文書参照決定部104が同一文書部品に対して利用可能な複数の外部文書を発見した場合の利用する外部文書の決定方法は特に規定しなかったが、これを、生成される符号化文書のサイズが最も小さくなるように決定しても良い。
In the first to third embodiments, the external document
次に、具体的な実施例を用いて本発明の実施の形態の動作をより詳細に説明する。 Next, the operation of the embodiment of the present invention will be described in more detail using specific examples.
図11は、本発明の第3の実施の形態にかかる構造化文書処理装置を用いて実現した通信システムの実施例の構成図である。構造化文書符号化モジュール101を持つメッセージ送信システム1126があり、メッセージを作成する送信アプリケーション1121が繋がっている。また構造化文書復号化モジュール111を持つメッセージ受信システム1127があり、メッセージを利用する受信アプリケーション1122が繋がっている。またメッセージ送信システム1126とメッセージ受信システム1127はネットワーク1123を介して繋がっている。またメッセージ送信システム1126とメッセージ受信システム1127は、参照する共有外部文書を保持する共有文書保存部1124、1125を持つ。共有文書保存部1124と共有文書保存部1125とは、任意の方法によって常に同一内容を保持するように管理されているとする。
FIG. 11 is a configuration diagram of an example of a communication system realized by using the structured document processing apparatus according to the third embodiment of the present invention. There is a message transmission system 1126 having a structured
図12は送信アプリケーション1121が受信アプリケーション1121に送りたい構造化文書の例である。この例は、構造化文書としてXMLで記述されたSOAP通信プロトコルのメッセージであるが、勿論本発明の対象はこれに限られるものではなく、例えば構造化文書の記述方式としてはHTMLやSGMLなども考えられる。 FIG. 12 shows an example of a structured document that the transmission application 1121 wants to send to the reception application 1121. This example is a SOAP communication protocol message described in XML as a structured document, but of course the subject of the present invention is not limited to this. For example, HTML, SGML, etc. can be used as a structured document description method. Conceivable.
以下、共有文書保存部1124、1125にどのような文書が保存されているかについて幾つかの状況を想定し、各状況における本実施例の動作を説明する。 Hereinafter, the operation of the present embodiment in each situation will be described assuming some kinds of documents stored in the shared document storage units 1124 and 1125.
まず一つ目の状況として、本実施例で用いるID符号化方式の説明のため、共有文書保存部1124,1125に類似した文書が一つも保存されていない状況での動作を説明する。 First, as a first situation, an operation in a situation where no document similar to the shared document storage units 1124 and 1125 is stored will be described in order to explain the ID encoding method used in this embodiment.
この場合、送信アプリケーション1121が図12の構造化文書1201をメッセージ送信システム1126に渡すと、まず構造化文書解析部102が構造化文書1201の解析を行い、外部文書参照決定部104を用いて参照可能な外部文書を検索する。しかしここでは一つも外部文書が見つからないため、構造化文書1201全部がID型符号化文書生成部403でID型符号化文書に符号化される。
In this case, when the transmission application 1121 passes the structured document 1201 of FIG. 12 to the message transmission system 1126, the structured
図13は生成されたID型符号化文書1301の例である。本実施例では、部品へのIDとして自然数を用いる。なお、説明簡略化のため、属性名、属性値、名前空間の扱いなどは図示を省略している。この例では、参照する外部文書が存在しないため、外部文書取込宣言は空である。IDの1から15までは文字列部品で、そのうち1から10が要素名、11から15が要素値となっている。IDの16から25は要素部品で、要素名、要素値、子要素などをIDで参照している。また本実施例では、符号化文書の中で最初に現れる要素部品あるいはID型外部部品参照データを構造化文書の根の要素とみなすとする。
FIG. 13 shows an example of the generated ID type encoded
図13の符号化文書1301がネットワーク1123を介してメッセージ受信システム1127に渡されると、まずID型符号化文書解析部412が符号化文書1301を解析し、IDテーブル417を作成する。図14に示すIDテーブル1401がこのとき生成されたIDテーブルである。これは、符号化文書1301から外部文書取込宣言を取り除いたものと同等である。次にID型外部文書取込部414は外部文書取込宣言を使用して外部文書を取り込むが、ここでは外部文書取込宣言が空なので何も行われない。最後にID型構造化文書生成部413が、最初に出現する要素部品であるID=16の要素を根として、必要な要素名や要素値、子要素を、IDを本IDテーブルを用いて解決しながら、構造化文書1201を生成し、受信アプリケーション1122に生成された構造化文書を渡す。
When the encoded
次に二つ目の状況として、図15と図16の構造化文書をID型符号化したものが共有文書保存部1124、1125に格納されている場合の例を説明する。 Next, as a second situation, an example in which the structured document of FIGS. 15 and 16 is ID-encoded and stored in the shared document storage units 1124 and 1125 will be described.
SOAP通信プロトコルにおいては、一般にHeaderはアプリケーションに依存しない通信制御情報を、Bodyは個別のアプリケーションに依存した情報を保持し、それらを任意に組合わせて利用するため、図15および図16の例はHeader、Bodyそれぞれに対して文書部品が用意されている状況を示している。具体的な要素値の中で、ToとUserIDは同じ通信装置間でメッセージをやり取りする場合には固定なので、文書部品にその値が記載されている。一方、それ以外のMessageID、OrderID、ProductIDは、メッセージ毎に毎回値が異なるので外部文書にはダミーの値が記載されている。 In the SOAP communication protocol, in general, the header holds communication control information that does not depend on an application, and the body holds information that depends on an individual application, and uses them in any combination. It shows the situation where document parts are prepared for each of Header and Body. Among specific element values, To and UserID are fixed when a message is exchanged between the same communication apparatuses, and the values are described in the document part. On the other hand, other MessageID, OrderID, and ProductID have different values for each message, so a dummy value is described in the external document.
図17と図18は、それぞれ図15と図16の構造化文書をID型符号化したものであり、ID型符号化文書1701と1801が共有文書保存部1124と1125の両方に、それぞれID型符号化文書1701はHeader1、ID型符号化文書1801はBody1と名前が付けられて保存されている。ID型符号化の方法は一つ目の状況のときと同じである。
FIGS. 17 and 18 are obtained by ID-coding the structured documents of FIGS. 15 and 16, respectively. The ID-type encoded
ここで、送信アプリケーション1121が図12の構造化文書1201をメッセージ送信システム1126に渡すと、まず構造化文書解析部102が構造化文書1201の解析を行い、外部文書参照決定部104を用いて参照可能な外部文書を検索する。ここでEnvelope要素については類似文書が見つからないが、その子要素のHeader要素についてはID型符号化文書1701、文書Header1のID=6の要素が類似文書として見つかり、Body要素についてはID型符号化文書1801、文書Body1のID=10の要素が類似文書として見つかる。
Here, when the transmission application 1121 passes the structured document 1201 of FIG. 12 to the message transmission system 1126, the structured
次に外部文書差分解析部105は、構造化文書1201のHeader要素以下の文書部品と、見つかったID型符号化文書1701、文書Header1のID=6の要素の文書部品とを比較し、MessageID要素の要素値のみが0123456に変わっていることを計算し、これらの情報を記載した参照利用情報1107を生成してメモリ1106に記録する。同様に、構造化文書1201のBody要素以下の文書部品と、ID型符号化文書1801、文書Body1のID=10の要素の文書部品とを比較して、OrderID要素とProductID要素の要素値が変更されていることを計算し、これらの情報を記載した参照利用情報1108を生成してメモリ1106に記録する。
Next, the external document
次にID型符号化文書生成部403が構造化文書1201をID型符号化するが、ここでは参照利用情報が存在するため、まず外部のID型符号化文書1701、1801それぞれに対応する外部文書取込宣言601を生成する。ここではID型符号化文書1701用の外部文書取込宣言601として、ID型符号化文書1701の文書名"Header1"に、ID変換ルールとして例えば"IDに100加算"を設定したものを作成する。同様にID型符号化文書1801用の外部文書取込宣言601として、ID型符号化文書1801の文書名"Body1"に、ID変換ルールとして例えば"IDに200加算"を設定したものを作成する。
Next, the ID type encoded document generation unit 403 performs ID type encoding of the structured document 1201. Since reference usage information exists here, first, external documents corresponding to the external ID type encoded
次に構造化文書1201の各要素を文字列部品と要素部品として符号化するが、Header要素とBody要素は要素部品の代わりにID型外部部品参照データ901として符号化する。ここではHeader要素用に、まず変更された要素値0123456の値をID=2の文字列部品として作成すると共に、ID型外部部品参照データ901として、参照先IDとして6に100を加算した106を、差分データで変更前IDが4+100で104、変更後IDが先に登録した文字列部品の2としたものを作成し、これをHeader要素の代わりにEnvelope要素の子要素として登録する。同様にBody要素用には、変更された要素値order1と4600をそれぞれID=3とID=4の文字列部品として作成し、ID型外部部品参照データ901として、参照先IDとして210を、差分データで変更前IDが207で変更後IDが3と、変更前IDが209で変更後IDが4となるものを作成し、これをBody要素の代わりにEnvelope要素の子要素として登録する。このようにして出来た符号化文書が図19のID型符号化文書1901であり、ここではID=6とID=7がID型外部部品参照データ901になる。
Next, each element of the structured document 1201 is encoded as a character string component and an element component. The Header element and the Body element are encoded as ID type external component reference data 901 instead of the element component. Here, for the Header element, first, the value of the changed
1番目のID=6のID型外部部品参照データ901は、1番目の外部文書取込宣言に対応しており、「参照先ID=106」の部分が、対応する外部文書取込宣言のID型外部文書参照データが示す図17のID型符号化文書におけるID=6(106-100)の文書部品をID=6の部品として取り込むことを示し、「差分(旧,新)=(104,2)」の部分が、取り込んだ文書部品中のID=4(104-100)の文字列(つまりMessageID)はID=2の文字列(つまり01234567)に置き換えることを示している。同様に、2番目のID=7のID型外部部品参照データ901は、2番目の外部文書取込宣言に対応しており、「参照先ID=210」の部分が、対応する外部文書取込宣言のID型外部文書参照データが示す図18のID型符号化文書におけるID=10(210-200)の文書部品をID=7の部品として取り込むことを示し、「差分(旧,新)=(207,3)」の部分が、取り込んだ文書部品中のID=7(207-200)の文字列(つまりorder0)はID=3の文字列(つまりorder1)に置き換えることを、また、「差分(旧,新)=(209,4)」の部分が、取り込んだ文書部品中のID=9(209-200)の文字列(つまりpid0)はID=4の文字列(つまり4600)に置き換えることを、それぞれ示している。
The ID type external part reference data 901 with the first ID = 6 corresponds to the first external document import declaration, and the part of “reference ID = 106” is the ID of the corresponding external
ここで、図19中の1番目のID=6のID型外部部品参照データ901が1番目の外部文書取込宣言に対応すること、および2番目のID=7のID型外部部品参照データ901が2番目の外部文書取込宣言に対応していることを明示する情報は符号化文書1901中には存在しない。その理由は、後述する図21で説明するように復号化時、外部文書取込宣言で指定された外部文書中のIDを変換ルールで変換することにより、ID型外部部品参照データ中のIDと外部文書中のIDとの関係が一意に決定されるためである。
Here, the ID type external component reference data 901 with the first ID = 6 in FIG. 19 corresponds to the first external document import declaration, and the ID type external component reference data 901 with the second ID = 7. There is no information in the encoded
なお、上記においては生成する符号化文書内のIDやID変換ルールは説明が容易なように予め完成した符号化文書のイメージを念頭において適当に決定したが、この決定方式は任意でよい。例えば要素を一つずつ処理していく過程では適当なものを振って矛盾が出たり最後に符号化文書を作成するときに全てIDを振りなおしたり、先に一度構造化文書全体を解析して文書サイズを確認し必要なID数を把握してから処理するなどは、通常のスキルを持った技術者であれば容易に予想できるであろう。 In the above description, the ID and ID conversion rule in the encoded document to be generated are appropriately determined in consideration of the image of the encoded document that has been completed in advance for easy explanation, but this determination method may be arbitrary. For example, in the process of processing one element at a time, an appropriate thing is shaken and a contradiction appears, or all IDs are reassigned when creating an encoded document at the end, or the entire structured document is analyzed once. It would be easy for an engineer with ordinary skills to easily check the document size and determine the number of required IDs before processing.
次に、図19のようなID型符号化文書1901がネットワーク1123を介してメッセージ受信システム1127に渡されると、構造化文書復号化モジュール111は、まずID型符号化文書1901を解析し、IDテーブル417を生成する。図20のIDテーブル2001はこの状態でのIDテーブル417の内容例を示す。次にID型外部文書取込部414が、二つの外部文書取込宣言を参照し、二つの文書を読み込んで、IDをID変換ルールで変換したものをIDテーブル417に追加する。図21のIDテーブル2101がこの状態でのIDテーブル417であり、IDが100番台と200番台の部品がここで追加された部品である。
Next, when the ID type encoded
次に、ID型外部文書書換部415が、ID=6,7のID型外部部品参照データを使用して、IDテーブル417を書き換える。まずID=6のID型外部部品参照データをみて、参照先IDからID=6のデータをID=106の部品に、差分データからID=104の部品をID=2の部品に置き換える。次にID=7のID型外部部品参照データをみて、参照先IDからID=7のデータをID=210の部品に、差分データからID=207の部品をID=3の部品に、ID=209の部品をID=4の部品に置き換える。図22のIDテーブル2201がこの状態でのIDテーブル417であり、IDの前に矢印の書いてある箇所が書き換えられたIDである。 Next, the ID type external document rewriting unit 415 rewrites the ID table 417 using the ID type external component reference data with ID = 6,7. First, looking at the ID type external part reference data with ID = 6, the data with ID = 6 from the reference ID is replaced with the part with ID = 106, and the part with ID = 104 from the difference data is replaced with the part with ID = 2. Next, look at the ID type external part reference data with ID = 7, from the reference ID to ID = 7 data to ID = 210 parts, from the difference data ID = 207 parts to ID = 3 parts, ID = Replace 209 part with ID = 4 part. An ID table 2201 in FIG. 22 is an ID table 417 in this state, and a portion with an arrow before the ID is the rewritten ID.
最後にID型構造化文書生成部413がIDテーブル417を使用し、根の要素であるID=5の部品から、IDを用いて要素や文字列を検索しながら構造化文書1201を生成し、受信アプリケーション1122に生成された構造化文書を渡す。
Finally, the ID type structured
次に三つ目の状況として、図23の構造化文書2301をID型符号化したものが共有文書保存部1124、1125に格納されている場合の例を説明する。
Next, as a third situation, an example will be described in which the ID type encoded version of the structured
図23の構造化文書2301は毎回変わる要素値がダミーの値になっている事以外は、図12の送信したい構造化文書1201と同じものである。これをID型符号化したものが図24のID型符号化文書2401であり、Message1という名前で格納されている。ただし、ここでは単に構造化文書2301をID型符号化しただけではなく、符号化文書の最後に、どの要素からも参照されないが頻繁に要素値として使用される文字列部品ID=26、ID=27、ID=28の3つを追加している。これは、多くの場合、構造は全く同じで幾つかの値しか変わらない構造化文書を使用する通信において、その構造化文書全体を部品として利用可能にしてしまうということと、さらに、高い頻度で使用される文字列に関しては、外部文書内に未使用部品として用意しようという事を意図するものである。
The structured
動作手順は二つ目の状況と同じであるので、ここでは生成された符号化文書のみを記載する。図25が生成されたID型符号化文書である。ID型符号化文書2501では、根の要素として直接外部文書の要素を参照し、要素値の文字列部品の差分のみを記載している。さらに要素ProductIDの要素値4600に関しては、参照先の外部の符号化文書2401の中の文字列部品ID=26(差分データではID変換後の値で126)を参照しており、ID型符号化文書2501には、01234567とorder1の文字列だけを記載し、4600の文字列は記載していない。
Since the operation procedure is the same as the second situation, only the generated encoded document is described here. FIG. 25 shows the generated ID type encoded document. In the ID type encoded document 2501, the element of the external document is directly referred to as the root element, and only the difference between the character string components of the element value is described. Furthermore, for the
長い期間に渡って多くのメッセージをやり取りするアプリケーションシステム間では、文書構造が同じで要素値や属性値など値だけが異なるようなメッセージを大量に送受信する事が多いが、このような場合、メッセージ全文の雛形を共有する外部文書を用意すれば、この状況の例のように、変更された値の文字列と若干の参照情報を記載するだけで通信を行う事が可能となり、極めて高いサイズの圧縮効果を得る事が出来る。さらに、やり取りされるメッセージに含まれる文字列を学習し、頻度の高いものをどんどん共有する外部文書に追加していけば、より多くの文字列が参照のみで扱う事が可能となり、さらに高いサイズの圧縮効果を得る事が可能となる。 Many application systems that exchange many messages over a long period of time often send and receive a large number of messages that have the same document structure but differ only in values such as element values and attribute values. If you prepare an external document that shares the full-text template, you can communicate just by writing the changed value string and some reference information, as shown in this example, and it is extremely high in size. A compression effect can be obtained. Furthermore, if you learn the character strings included in the exchanged messages and add frequently used ones to external documents that are shared more and more, it becomes possible to handle more character strings by reference only, and even higher sizes. It is possible to obtain a compression effect.
また、このような参照利用を目的とした未使用部品は要素値や属性値などの文字列部品に限らず、要素名や属性名など構造を表す文字列や、要素部品であっても良い。例えば、構造化文書の文書構造定義から得られる要素名、要素値、属性名、属性値などの全ての文字列を記載した外部文書を事前に共有しておき、個々の通信メッセージはこの事前に用意した外部文書を参照しながら文書全体の要素間の関係など全体構造を記載するようにすれば、従来技術である構造情報外部参照型バイナリ表現方式と同等の効果を得る事も可能である。 Further, such unused parts for reference use are not limited to character string parts such as element values and attribute values, but may be character strings representing structures such as element names and attribute names, and element parts. For example, an external document in which all character strings such as element names, element values, attribute names, and attribute values obtained from the document structure definition of structured documents are shared in advance, and individual communication messages are By describing the entire structure such as the relationship between the elements of the entire document while referring to the prepared external document, it is possible to obtain the same effect as the conventional structure information external reference type binary representation method.
上記の説明では主に差分データとして文字列部品の置換を述べたが、置換の対象は要素部品でも良い。差分データ903で記述するのは単にIDであるため、文字列部品の置換も要素部品の置換も同じように扱う事が出来る。
In the above description, the replacement of the character string component is mainly described as the difference data, but the replacement target may be an element component. Since only the ID is described in the
三つ目の状況で、図26の構造化文書2601を送信するとする。ただし、事前に格納されている図23の構造化文書2301をID符号化したものは、図27Aの通り、参照されない文字列部品として、さらに様々な通信で使用される名称としてID=29に"SessionID"という文字列部品をさらに追加している。構造化文書2601は先の説明で使用した図12の構造化文書1201に対して、HeaderにSessionIDとTransactionIDという要素が追加されている。
Assume that the structured
動作手順は二つ目の状況と同じであるので、ここでは生成された符号化文書のみを記載する。図27Bが生成されたID型符号化文書2701である。ID型符号化文書2701では、図25のID型符号化文書2501と比べ、差分データにHeader要素をID=8とID=9の子要素を二つ追加した要素への置換(117,7)が追加され、かつ追加された要素とその要素名や要素値を構成するためのID=3,4,5,7,8,9の部品が追加されている。ただし、SessionIDという要素については、要素名として参照先文書2702中に用意された文字列部品ID=29を変換後ID=129として参照している。
Since the operation procedure is the same as the second situation, only the generated encoded document is described here. FIG. 27B shows the generated ID type encoded
このように、差分データとして要素を置換する事も可能であると同時に、事前に共有する外部符号化文書では一切想定されていないような新しい要素も追加する事が出来る。 In this way, it is possible to replace elements as difference data, and at the same time, it is possible to add new elements that are not assumed at all in the externally encoded document shared in advance.
以上で述べたとおり、事前に用意される共有符号化文書の種類によって、符号化文書のサイズの圧縮率が変わる。構造化文書符号化モジュール101と構造化文書復号化モジュール111との間でどのような文書が事前に共有可能であるかは、利用するアプリケーションや運用環境によって様々であり、必ずしも最初から符号化される構造化文書の種類や形が明らかになっているとは限らないため、十分な量の共有符号化文書が用意できるとは限らない。この場合、最初は圧縮効果は限定的となるが、システムの運用中に実行履歴などから共有する符号化文書を拡充していくことで、どんどん圧縮効果を高めていく事が可能となる。
As described above, the compression ratio of the size of the encoded document varies depending on the type of the shared encoded document prepared in advance. The types of documents that can be shared in advance between the structured
なお上記で述べた共有符号化文書の幾つかの状況はあくまで例であり、より多様な符号化文書の共有のあり方が考えられる事は、通常の能力を持つ技術者であれば容易に推測できるであろう。 It should be noted that some situations of the shared encoded document described above are merely examples, and it can be easily guessed by an engineer having ordinary ability that various ways of sharing the encoded document can be considered. Will.
以上本発明を幾つかの実施の形態および実施例を挙げて説明したが、本発明は以上の例に限定されず、その他各種の付加変更が可能である。また、本発明の構造化文書符号化装置および復号化装置は、その有する機能をハードウェア的に実現することは勿論、コンピュータとプログラムとで実現することができる。プログラムは、磁気ディスクや半導体メモリ等のコンピュータ可読記録媒体に記録されて提供され、コンピュータの立ち上げ時などにコンピュータに読み取られ、そのコンピュータの動作を制御することにより、そのコンピュータを前述した各実施の形態における構造化文書符号化モジュール、構造化文書復号化モジュールとして機能させ、前述した各処理を実行させる。 Although the present invention has been described with reference to some embodiments and examples, the present invention is not limited to the above examples, and various other additions and modifications are possible. In addition, the structured document encoding apparatus and decoding apparatus of the present invention can be realized by a computer and a program as well as the functions of the hardware. The program is provided by being recorded on a computer-readable recording medium such as a magnetic disk or a semiconductor memory, and is read by the computer at the time of starting up the computer, etc. And function as a structured document encoding module and a structured document decoding module in the above-described form, and execute the above-described processes.
本発明によれば、構造化文書を用いた通信装置において、通信データ量や処理負荷を軽減させるといった用途に適用できる。また、主記憶装置からのスワップや文書データの永続化などを目的として、構造化文書をファイルやデータベースなどの二次記憶装置に頻繁に格納し読み込むような装置において、二次記憶の入出力負荷や生成や解析の処理負荷を軽減させるといった用途にも適用可能である。 According to the present invention, in a communication apparatus using a structured document, the present invention can be applied to applications such as reducing the amount of communication data and processing load. In addition, the input / output load of secondary storage in devices that frequently store and read structured documents in secondary storage devices such as files and databases for the purpose of swapping from the main storage device or making document data permanent. It can also be applied to applications such as reducing the processing load of generation and analysis.
101…構造化文書符号化モジュール
102…構造化文書解析部
103…符号化文書生成部
104…外部文書参照決定部
105…外部文書差分解析部
106…記憶部
107…参照利用情報
108…符号化文書蓄積部
109…共有文書保存部
111…構造化文書復号化モジュール
112…符号化文書解析部
113…構造化文書生成部
114…外部文書取込部
115…外部文書書換部
116…記憶部
117…符号化文書内部データ
121…符号化文書
122…外部部品参照データ
123…外部文書参照データ
124…差分データ
125…部品参照データ
131、133…構造化文書
132…外部文書(符号化文書)
403…ID型符号化文書生成部
412…ID型符号化文書解析部
413…ID型構造化文書生成部
414…ID型外部文書取込部
415…ID型外部文書書換部
417…IDテーブル
421…ID型符号化文書
432…外部文書(ID型符号化文書)
601…外部文書取込宣言
602…ID型外部文書参照データ
603…ID変換ルール
701…文字列型部品
702…文字列
801…要素部品
802…要素名ID
803…要素値ID
804…属性テーブル
805…子要素テーブル
901…ID型外部部品参照データ
902…参照先ID
903…差分データ
1001…IDテーブル
101 ... Structured document encoding module
102 ... Structured document analysis unit
103 ... Encoded document generator
104 ... External document reference determination unit
105 ... External document difference analysis part
106: Memory unit
107… Reference usage information
108: Encoded document storage unit
109… Shared document storage
111 ... Structured document decryption module
112 ... Encoded document analysis unit
113 ... Structured document generator
114… External document import section
115 ... External document rewriting part
116… Memory unit
117 ... Encoded document internal data
121 ... Encoded document
122… External part reference data
123… External document reference data
124 ... Differential data
125… Part reference data
131, 133 ... structured documents
132 ... External document (encoded document)
403 ... ID type encoded document generator
412 ... ID type encoded document analysis section
413 ... ID type structured document generator
414 ... ID-type external document import unit
415 ... ID type external document rewriting part
417 ... ID table
421 ... ID type encoded document
432 ... External document (ID type encoded document)
601 ... External document import declaration
602… ID type external document reference data
603 ... ID conversion rule
701 ... String type parts
702 ... String
801 ... Element parts
802 ... Element name ID
803 ... Element value ID
804 ... Attribute table
805 ... Child element table
901… ID type external parts reference data
902 ... Reference ID
903 ... Difference data
1001 ... ID table
Claims (30)
前記符号化文書生成手段は、構造化文書の各要素をIDを付けた部品として符号化し要素間の参照をこのIDで表現する符号化方式を使用し、かつ文書部品間の差分情報は、外部文書のどの部品をどの部品で置換するかを置換え前後の部品のIDの組み合わせで表現する
ことを特徴とする構造化文書符号化装置。 External document reference determination means for retrieving an external document having a document part that is structurally similar to a document part included in the structured document to be encoded, and a document similar to the searched external document and the structured document to be encoded External document difference analysis means for calculating differences between parts, and document parts that are structurally similar to the document parts of the external document among the document parts included in the structured document to be encoded are referred to the document parts of the external document. An encoded document generating means for generating an encoded document encoded as difference information between information and document parts ,
The encoded document generation means uses an encoding method in which each element of a structured document is encoded as a part with an ID and a reference between the elements is expressed by this ID, and difference information between document parts is external A structured document encoding apparatus characterized in that which part of a document is replaced by which part is expressed by a combination of IDs of parts before and after the replacement .
前記符号化文書は、構造化文書の各要素をIDを付けた部品として符号化し要素間の参照をこのIDで表現する符号化方式を使用して符号化され、かつ文書部品間の差分情報は、外部文書のどの部品をどの部品で置換するかを置換え前後の部品のIDの組み合わせで表現したものであり、前記構造化文書生成手段は、前記符号化文書と前記外部文書に記載されたIDとその部品をIDを用いて参照しながら、参照されたIDが前記差分情報に記載された置換え前のIDであった場合は代わりに置換え後のIDを参照して構造化文書を生成する
ことを特徴とする構造化文書復号化装置。 Among the document parts included in the structured document, a document part that is structurally similar to the document part of the external document is decoded as the reference information to the document part of the external document and the encoded document encoded as the difference information between the document parts. an apparatus for, based an external document capturing means load external document having a document part indicated by the reference information, the document module indicated by the reference information in said read external documents on the differential information External document rewriting means for rewriting, and structured document generation means for generating a structured document from an encoded document by replacing the portion encoded as the reference information and the difference information with the document part of the rewritten external document. Prepared ,
The encoded document is encoded using an encoding method in which each element of the structured document is encoded as a part with an ID and a reference between the elements is expressed by this ID, and difference information between the document parts is , Which part of the external document is replaced by which part is replaced by the ID of the parts before and after the replacement, and the structured document generation means includes the ID described in the encoded document and the external document. When the referenced ID is the ID before replacement described in the difference information, the structured document is generated by referring to the replaced ID instead. A structured document decoding apparatus characterized by the above.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006072225A JP4830558B2 (en) | 2006-03-16 | 2006-03-16 | Structured document encoding apparatus and structured document decoding apparatus |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2006072225A JP4830558B2 (en) | 2006-03-16 | 2006-03-16 | Structured document encoding apparatus and structured document decoding apparatus |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2007249619A JP2007249619A (en) | 2007-09-27 |
| JP4830558B2 true JP4830558B2 (en) | 2011-12-07 |
Family
ID=38593840
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2006072225A Expired - Fee Related JP4830558B2 (en) | 2006-03-16 | 2006-03-16 | Structured document encoding apparatus and structured document decoding apparatus |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4830558B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108763198B (en) * | 2018-05-11 | 2021-06-22 | 北京理工大学 | A Generative Method for Automatically Generating Related Work in Academic Papers |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2837006B2 (en) * | 1991-11-01 | 1998-12-14 | シャープ株式会社 | Text compression device |
| JP3943830B2 (en) * | 2000-12-18 | 2007-07-11 | 株式会社東芝 | Document composition method and document composition apparatus |
-
2006
- 2006-03-16 JP JP2006072225A patent/JP4830558B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2007249619A (en) | 2007-09-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8583704B2 (en) | Systems and methods for efficient data transfer | |
| US9530012B2 (en) | Processing extensible markup language security messages using delta parsing technology | |
| US7051084B1 (en) | Methods and apparatus for regenerating and transmitting a partial page | |
| CN1771496B (en) | Systems and methods involving access to information | |
| JP4972067B2 (en) | User query processing apparatus and method using encrypted modulation of queries in a database containing encrypted columns | |
| US7865525B1 (en) | High efficiency binary encoding | |
| US20050120031A1 (en) | Structured document encoder, method for encoding structured document and program therefor | |
| US20050027731A1 (en) | Compression dictionaries | |
| CN115080651A (en) | Excel data import method, device, electronic device and storage medium | |
| JP2006235840A (en) | Database access system and database access method | |
| JP4965014B2 (en) | Data object transfer method and transfer device, activation method and activation device in computer communication network | |
| JP4231261B2 (en) | Identity determination device | |
| US8918356B2 (en) | Method, apparatus and machine-readable medium for transforming, converting and processing messages between multiple systems | |
| US7506068B2 (en) | Method, apparatus and system for transforming, converting and processing messages between multiple systems | |
| JP2001125831A (en) | Data scramble method, data distributing device, data scrambler and recording medium | |
| JP4830558B2 (en) | Structured document encoding apparatus and structured document decoding apparatus | |
| US7769896B2 (en) | Method, apparatus and system for dispatching messages within a system | |
| US8239562B2 (en) | Envelope attachment for message context | |
| US20070239393A1 (en) | Knowledge based encoding of data | |
| CN103246671A (en) | Processing method and device for abstract syntax notation files | |
| JP4821287B2 (en) | Structured document encoding method, encoding apparatus, encoding program, decoding apparatus, and encoded structured document data structure | |
| US7447787B2 (en) | Protocol executing system and protocol PDU common data structure converting method for processing protocol PDUS | |
| JP2003044459A (en) | Method for compressing and exchanging structured data | |
| US7716576B1 (en) | Flexible XML parsing based on p-code | |
| JP5732926B2 (en) | Remote procedure call processing method |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20090212 |
|
| RD02 | Notification of acceptance of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7422 Effective date: 20090805 |
|
| RD03 | Notification of appointment of power of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7423 Effective date: 20090805 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20110614 |
|
| A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20110804 |
|
| 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: 20110823 |
|
| 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: 20110905 |
|
| R150 | Certificate of patent or registration of utility model |
Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140930 Year of fee payment: 3 |
|
| LAPS | Cancellation because of no payment of annual fees |