[go: up one dir, main page]

JP5409090B2 - Information processing apparatus, information processing method, program, and storage medium - Google Patents

Information processing apparatus, information processing method, program, and storage medium Download PDF

Info

Publication number
JP5409090B2
JP5409090B2 JP2009097120A JP2009097120A JP5409090B2 JP 5409090 B2 JP5409090 B2 JP 5409090B2 JP 2009097120 A JP2009097120 A JP 2009097120A JP 2009097120 A JP2009097120 A JP 2009097120A JP 5409090 B2 JP5409090 B2 JP 5409090B2
Authority
JP
Japan
Prior art keywords
value
data
memory
attribute
application
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
Application number
JP2009097120A
Other languages
Japanese (ja)
Other versions
JP2010250434A (en
Inventor
均 内田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP2009097120A priority Critical patent/JP5409090B2/en
Publication of JP2010250434A publication Critical patent/JP2010250434A/en
Application granted granted Critical
Publication of JP5409090B2 publication Critical patent/JP5409090B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Description

本発明は、情報処理装置、情報処理方法、プログラム及び記憶媒体に関する。   The present invention relates to an information processing apparatus, an information processing method, a program, and a storage medium.

これまで、XMLパーサが解析するXMLデータのフォーマットは、一般的にテキスト形式であった。しかし、XMLデータは、データ構造を表現するために冗長なデータを必要とし、コンピュータが読み書きするのに時間がかかるという問題があるため、近年バイナリXML技術が注目されている。バイナリXML技術としては、例えば、W3C標準のEfficient XML Interchangeや、ISO標準のFast Infosetが挙げられる。これらの技術を用いることによって、XMLデータに含まれる要素名や属性名等の各ボキャブラリを、XMLデータ内の出現順に番号を振って符号化し、データサイズを小さくすることができる。符号と各ボキャブラリとの対応を示す表は符号化テーブルと呼ばれる。これらのバイナリXMLデータは、従来のテキスト形式のXMLデータに比べて、高速に読み書きすることができる。   Until now, the format of XML data analyzed by an XML parser has generally been a text format. However, since XML data requires redundant data to express the data structure and takes time for a computer to read and write, the binary XML technology has recently attracted attention. Examples of the binary XML technology include W3C standard Efficient XML Interchange and ISO standard Fast Infoset. By using these techniques, vocabularies such as element names and attribute names included in the XML data are encoded by assigning numbers in the order of appearance in the XML data, and the data size can be reduced. A table showing the correspondence between codes and vocabularies is called a coding table. These binary XML data can be read and written at higher speed than conventional XML data in text format.

また、属性値や要素内容を従来のような文字列型のデータではなく、整数型、浮動小数点型や、独自形式の圧縮アルゴリズムを用いてエンコードすることにより、データサイズを更に小さくすることができる。また、それらデータを解析する際には、従来のようなアプリケーションによる文字列データから数値データへの変換処理が必要なくなるので、解析全体にかかる処理時間を更に短くすることができる。
また、KDDIのXEUSは、属性値や要素内容に、カンマ等で区切られた数値の配列に対しては、各数値をそれぞれ符号化することによって、XMLデータを効率的に圧縮することができる。
また、同一の構造を持った複数のXMLデータについて、タグ名をリスト化した共通の1つのタグリストを作成し、それら各タグ名を符号化することで圧縮を行うものがある(特許文献1参照)。
In addition, the data size can be further reduced by encoding attribute values and element contents using integer-type, floating-point-type, or proprietary compression algorithms instead of conventional string-type data. . In addition, when analyzing such data, the conversion processing from character string data to numerical data by a conventional application is not necessary, so that the processing time for the entire analysis can be further shortened.
Also, KDDI XEUS can efficiently compress XML data by encoding each numerical value for an array of numerical values delimited by commas or the like into attribute values and element contents.
In addition, for a plurality of XML data having the same structure, one common tag list in which tag names are listed is created, and compression is performed by encoding each tag name (Patent Document 1). reference).

特開2002−163248号公報JP 2002-163248 A

しかし、従来のバイナリXMLパーサは、長い文字列データや、画像データ等サイズの大きなデータを符号化テーブルに含む場合、メモリリソースの限られた環境では、バイナリXMLデータを全て解析することができなかった。
図1は、アドレス帳の内容を記述した、従来のテキスト形式のXMLデータの一例を示す図である。このXMLデータをバイナリXML形式で記述したものが、図2、3、4である。図2は、XMLデータに含まれる要素名や属性名を符号化した符号化テーブルの一例を示す図である。ここでは図2のテーブルを名前テーブルと呼ぶことにする。図3は、XMLデータに含まれる属性値や要素内容等を符号化した符号化テーブルの一例を示す図である。ここでは図3のテーブルを値テーブルと呼ぶことにする。図4は、テキスト形式の構造化文書を、図2、3の符号化テーブルに含まれる各符号を用いることによってバイナリXML形式で記述した内容の一例を示す図である。なお、図4における開始タグ、終了タグ、属性、要素内容等の各イベントの符号は、図5の符号を用いるものとし、これら各イベントの符号はアプリケーションが予め知っている(又はアプリケーションに予め定義されている)ものとする。図5は、各イベントの符号の一例を示す図である。
However, the conventional binary XML parser cannot analyze all binary XML data in an environment where memory resources are limited when long encoding data such as long character string data or image data is included in the encoding table. It was.
FIG. 1 is a diagram showing an example of conventional text-format XML data describing the contents of an address book. The XML data described in the binary XML format is shown in FIGS. FIG. 2 is a diagram illustrating an example of an encoding table in which element names and attribute names included in XML data are encoded. Here, the table of FIG. 2 is called a name table. FIG. 3 is a diagram illustrating an example of an encoding table in which attribute values, element contents, and the like included in XML data are encoded. Here, the table of FIG. 3 is referred to as a value table. FIG. 4 is a diagram showing an example of contents described in a binary XML format by using each code included in the encoding table of FIGS. 2 and 3 for a structured document in a text format. Note that the codes of each event such as the start tag, end tag, attribute, element content, etc. in FIG. 4 are the same as those in FIG. 5, and the codes of these events are known in advance by the application (or defined in advance in the application). ). FIG. 5 is a diagram illustrating an example of a code of each event.

バイナリXMLパーサがデータを解析する際には、まずデータに含まれる図2の名前テーブルと図3の値テーブルとを解析し、各テーブルの内容を内部メモリに保存しておく。そして、バイナリXMLパーサは、バイナリXMLデータの構造と値とを含むボディ部を解析する際には、その内部メモリに保存したテーブルの各符号と値との組を用いることによって、タグ名や属性名、属性値や要素内容を解決する。
しかし、メモリリソースの限られた組込み機器の環境においては、図3のように値テーブルに画像データのようなサイズの大きなデータを含む場合には、その画像データを内部メモリに保存することができなかった。バイナリXMLデータにそのようなサイズの大きなデータを含む場合、バイナリXMLパーサは、それ以降の解析処理を中断し、アプリケーションに解析エラーを通知するのが一般的だった。
When the binary XML parser analyzes data, the name table of FIG. 2 and the value table of FIG. 3 included in the data are first analyzed, and the contents of each table are stored in the internal memory. The binary XML parser, when analyzing the body part including the structure and values of the binary XML data, uses a set of each code and value stored in its internal memory, so that the tag name and attribute Resolve names, attribute values, and element contents.
However, in an embedded device environment with limited memory resources, if the value table contains large data such as image data as shown in FIG. 3, the image data can be stored in the internal memory. There wasn't. When binary XML data includes such large data, it is common for the binary XML parser to interrupt the subsequent analysis processing and notify the application of an analysis error.

本発明はこのような問題点に鑑みなされたもので、構造化文書の符号化に関するオブジェクト(例えば符号化テーブル等)に、サイズの大きなデータが含まれている場合でも、少ないメモリリソースで解析できるようにすることを目的とする。   The present invention has been made in view of such a problem, and even when an object (for example, an encoding table) related to encoding of a structured document contains large-size data, analysis can be performed with a small amount of memory resources. The purpose is to do so.

そこで、本発明の情報処理装置は、構造化文書に含まれる構造情報と値とを符号化して作成された符号化文書に含まれる符号と、前記値と、前記値に関する属性値と、が対応付けられた値データを複数含む値オブジェクトの前記値データの前記属性値に基づいて、前記属性値に対応する値を含む値データをメモリに記憶するか否かを判定する記憶判定手段と、前記記憶判定手段で前記属性値に対応する値を含む値データをメモリに記憶すると判定された場合には、前記値を含む値データをメモリ内のメモリ内値オブジェクトに記憶し、前記記憶判定手段で前記属性値に対応する値を含む値データをメモリに記憶しないと判定された場合には、前記値を含まない値データをメモリ内のメモリ内値オブジェクトに記憶する記憶手段と、前記メモリ内値オブジェクトの値データに値が含まれているか否かを判定する値判定手段と、前記値判定手段で前記メモリ内値オブジェクトの値データに値が含まれていると判定された場合には、前記値をアプリケーションに返し、前記値判定手段で前記メモリ内値オブジェクトの値データに値が含まれていないと判定された場合には、前記値データに含まれる符号及び属性値をアプリケーションに返す通知手段と、前記アプリケーションから前記アプリケーションが取得しようとする値の符号が渡された場合、前記値オブジェクトを解析し、前記アプリケーションから渡された符号と一致する符号の組である値を前記値オブジェクトから取得して前記アプリケーションに渡す値取得手段と、を有する。 Therefore, in the information processing apparatus of the present invention, the code included in the encoded document created by encoding the structure information and the value included in the structured document, the value, and the attribute value related to the value correspond to each other. Storage determining means for determining whether or not to store in the memory value data including a value corresponding to the attribute value based on the attribute value of the value data of the value object including a plurality of attached value data; and When it is determined by the storage determination means that the value data including the value corresponding to the attribute value is stored in the memory, the value data including the value is stored in the in-memory value object, and the storage determination means Storage means for storing value data not including the value in a value object in the memory when it is determined not to store in the memory value data including a value corresponding to the attribute value; and the memory A value determination unit that determines whether or not the value data of the value object includes a value; and when the value determination unit determines that the value data of the value object in the memory includes a value, The value is returned to the application, and when the value determination unit determines that the value data of the in-memory value object does not include a value, a notification that returns the code and attribute value included in the value data to the application When a sign of a value to be acquired by the application is received from the means, the value object is analyzed, and a value that is a set of codes matching the sign passed from the application is obtained from the value object. Value acquisition means for acquiring and passing to the application.

本発明によれば、構造化文書の符号化に関するオブジェクト(例えば符号化テーブル等)に、サイズの大きなデータが含まれている場合でも、少ないメモリリソースで解析できるようにすることができる。   According to the present invention, even when an object (for example, an encoding table) relating to encoding of a structured document includes large-size data, it can be analyzed with a small amount of memory resources.

アドレス帳の内容を記述した、従来のテキスト形式のXMLデータの一例を示す図である。It is a figure which shows an example of the XML data of the conventional text format which described the content of the address book. XMLデータに含まれる要素名や属性名を符号化した符号化テーブルの一例を示す図である。It is a figure which shows an example of the encoding table which encoded the element name and attribute name contained in XML data. XMLデータに含まれる属性値や要素内容等を符号化した符号化テーブルの一例を示す図である。It is a figure which shows an example of the encoding table which encoded the attribute value, element content, etc. which are contained in XML data. テキスト形式の構造化文書を、図2、3の符号化テーブルに含まれる各符号を用いることによってバイナリXML形式で記述した内容の一例を示す図である。It is a figure which shows an example of the content described in the binary XML format by using each code | symbol contained in the encoding table of FIG. 各イベントの符号の一例を示す図である。It is a figure which shows an example of the code | symbol of each event. 本実施形態に係るシステムのシステム構成の一例を示す図である。It is a figure which shows an example of the system configuration | structure of the system which concerns on this embodiment. PCのハードウェア構成の一例を示す図である。It is a figure which shows an example of the hardware constitutions of PC. バイナリXMLデータに含まれる符号化テーブルを解析する処理の一例を示すフローチャート(その1)である。It is a flowchart (the 1) which shows an example of the process which analyzes the encoding table contained in binary XML data. 内部メモリに保存した値テーブルの一例を示した図(その1)である。FIG. 6 is a diagram (part 1) illustrating an example of a value table stored in an internal memory. ボディ部の解析処理の一例を示すフローチャート(その1)である。It is a flowchart (the 1) which shows an example of the analysis process of a body part. 値を取得する処理の一例を示すフローチャート(その1)である。It is a flowchart (the 1) which shows an example of the process which acquires a value. バイナリXMLデータに含まれる符号化テーブルを解析する処理の一例を示すフローチャート(その2)である。It is a flowchart (the 2) which shows an example of the process which analyzes the encoding table contained in binary XML data. 内部メモリに保存した値テーブルの一例を示した図(その2)である。FIG. 10 is a second diagram illustrating an example of a value table stored in an internal memory. ボディ部の解析処理の一例を示すフローチャート(その2)である。It is a flowchart (the 2) which shows an example of the analysis process of a body part. 値を取得する処理の一例を示すフローチャート(その2)である。It is a flowchart (the 2) which shows an example of the process which acquires a value.

以下、本発明の実施形態について図面に基づいて説明する。   Hereinafter, embodiments of the present invention will be described with reference to the drawings.

<実施形態1>
本実施形態では、符号化テーブルにサイズの大きなデータを含むバイナリXMLデータを、少ないメモリリソースで解析する処理について説明する。
図6は、本実施形態に係るシステムのシステム構成の一例を示す図である。
PC101は、LAN102に接続されている。LAN102には、デジタルカメラ103、複合機104、ファイルサーバ105が接続されている。
<Embodiment 1>
In the present embodiment, a process for analyzing binary XML data including large data in an encoding table with a small memory resource will be described.
FIG. 6 is a diagram illustrating an example of a system configuration of the system according to the present embodiment.
The PC 101 is connected to the LAN 102. A digital camera 103, a multifunction peripheral 104, and a file server 105 are connected to the LAN 102.

図7は、PCのハードウェア構成の一例を示す図である。
CPU201は、システム制御部であり、PC全体を制御する。ROM202は、CPU201の制御プログラムや各種固定データを格納する。RAM203は、SRAM、DRAM等で構成され、プログラム制御変数等を格納する。また、各種設定パラメータ、各種ワーク用バッファもRAM203に格納される。記憶部204は、ハードディスク等で構成され、文書データや画像データ等、各種データファイルを格納する。操作部205は、キーボードやマウス、タッチパネル等で構成され、オペレータが各種入力操作を行うためのものである。表示部206は、画像を表示するテレビジョンの画面である。LANi/f 207は、LAN回線208に接続するためのインターフェースである。USBi/f 209は、USB回線210に接続するためのインターフェースである。
なお、デジタルカメラ103、複合機104、ファイルサーバ105のハードウェア構成も、装置に応じて構成の一部が異なるものの、図6に示したPC101のハードウェア構成と同様であり、少なくともCPUと記憶部とを有する。
各装置のCPUが、記憶部等に記憶されているプログラム(例えば、本実施形態のバイナリXMLパーサ(以下、単にバイナリXMLパーサという)やアプリケーションに該当するプログラム)に基づき処理を実行する。このことによって、各装置の機能、後述するフローチャートに係る処理が実現される。つまり、後述するバイナリXMLパーサやアプリケーションは、PC101に実装されていてもよいし、デジタルカメラ103、複合機104、ファイルサーバ105等に実装されていてもよい。
FIG. 7 is a diagram illustrating an example of a hardware configuration of a PC.
The CPU 201 is a system control unit and controls the entire PC. The ROM 202 stores a control program for the CPU 201 and various fixed data. The RAM 203 is configured by SRAM, DRAM, and the like, and stores program control variables and the like. Various setting parameters and various work buffers are also stored in the RAM 203. The storage unit 204 is configured with a hard disk or the like, and stores various data files such as document data and image data. The operation unit 205 includes a keyboard, a mouse, a touch panel, and the like, and is used for an operator to perform various input operations. The display unit 206 is a television screen that displays an image. The LAN i / f 207 is an interface for connecting to the LAN line 208. The USBi / f 209 is an interface for connecting to the USB line 210.
Note that the hardware configurations of the digital camera 103, the multifunction peripheral 104, and the file server 105 are the same as the hardware configuration of the PC 101 shown in FIG. Part.
The CPU of each device executes processing based on a program (for example, a program corresponding to a binary XML parser (hereinafter simply referred to as a binary XML parser) or an application of the present embodiment) stored in a storage unit or the like. As a result, the function of each device and the processing relating to the flowchart described later are realized. That is, a binary XML parser and an application described later may be mounted on the PC 101, or may be mounted on the digital camera 103, the multifunction peripheral 104, the file server 105, and the like.

図8は、バイナリXMLデータに含まれる符号化テーブルを解析する処理の一例を示すフローチャート(その1)である。
まず、バイナリXMLパーサは、要素名や属性名等の名前と、その名前に割り当てられた符号と、を格納した図2に示されるような名前テーブルを解析し、各名前と符号との組をRAM203又は記憶部204等の内部メモリに保存する(S102)。
次に、バイナリXMLパーサは、属性値や要素内容、コメントの内容等の値と、その値に割り当てられた符号と、を格納した図3に示されるような値テーブルを内部メモリに保存する際の制限情報を解析する(S103)。この制限情報は、内部メモリに保存する各値の上限サイズや、内部メモリに保存する必要がないデータの種類等である。この上限サイズや内部メモリに保存する必要がないデータの種類等は、一般的にはアプリケーションがバイナリXMLパーサに、解析を開始する前に予め設定しておくものである。本実施形態では、各値の上限サイズを50000バイトとし、アプリケーションにとって不要なデータの種類をコメントとする。
FIG. 8 is a flowchart (part 1) illustrating an example of processing for analyzing an encoding table included in binary XML data.
First, the binary XML parser analyzes a name table as shown in FIG. 2 in which names such as element names and attribute names and codes assigned to the names are stored, and sets a pair of each name and code. The data is stored in an internal memory such as the RAM 203 or the storage unit 204 (S102).
Next, when the binary XML parser stores a value table as shown in FIG. 3 in which values such as attribute values, element contents, comment contents, etc., and codes assigned to the values are stored in the internal memory. The restriction information is analyzed (S103). This restriction information includes the upper limit size of each value stored in the internal memory, the type of data that does not need to be stored in the internal memory, and the like. The upper limit size, the type of data that does not need to be stored in the internal memory, and the like are generally set in advance in the binary XML parser by the application before starting analysis. In this embodiment, the upper limit size of each value is 50000 bytes, and the type of data unnecessary for the application is a comment.

バイナリXMLパーサは、値テーブルの解析を開始するが、まず値テーブルの全ての内容を解析したか否かを判定する(S104)。S104において、値テーブルの全ての内容を解析していないと判断した場合、バイナリXMLパーサは、値テーブルに含まれる各値の、符号、所属情報(種類情報)(所属)、サイズ情報(サイズ)を解析し、内部メモリに保存する(S105〜S107)。この所属情報は、図5に示されるように各イベントに割り当てられた符号であり、バイナリXMLパーサは、この符号を参照することによって、属性値や要素内容等、各値がどの値を表すものか判断することができる。
バイナリXMLパーサは、値の所属に基づいて、値の所属が内部メモリに保存する種類であるかどうか判定(記憶判定)する(S108)。S108において、値の所属が内部メモリに保存する種類ではないと判断した場合、バイナリXMLパーサは、S107で解析したサイズ分、値を内部メモリに保存しないで読み飛ばす(S109)。より具体的に説明すると、後述する図9に示すように、バイナリXMLパーサは、値テーブルを構成するレコードデータである値データの内、値を含まない値データ(符号+所属+サイズ)を内部メモリに保存(記憶)する。
The binary XML parser starts to analyze the value table, but first determines whether or not all contents of the value table have been analyzed (S104). If it is determined in S104 that the entire contents of the value table have not been analyzed, the binary XML parser determines the sign, affiliation information (type information) (affiliation), and size information (size) of each value included in the value table. Are stored in the internal memory (S105 to S107). This affiliation information is a code assigned to each event as shown in FIG. 5, and the binary XML parser refers to this code to indicate which value each value such as an attribute value or element content represents. It can be judged.
Based on the value affiliation, the binary XML parser determines (stores determination) whether the value affiliation is a type stored in the internal memory (S108). If it is determined in S108 that the value does not belong to the type stored in the internal memory, the binary XML parser skips reading the value for the size analyzed in S107 without saving it in the internal memory (S109). More specifically, as shown in FIG. 9 to be described later, the binary XML parser internally stores value data (sign + affiliation + size) that does not include a value among value data that is record data constituting the value table. Save (store) it in memory.

S108において、その値の所属が内部メモリに保存する種類であると判断した場合、バイナリXMLパーサは、S103において解析した内容に基づいて、値のサイズが内部メモリに保存する上限サイズ以下であるかどうか判定(記憶判定)する(S110)。S110において、値のサイズが上限値以下ではないと判断した場合、バイナリXMLパーサは、S107で解析したサイズ分、値を内部メモリに保存しないで読み飛ばす(S109)。より具体的に説明すると、上述したように、バイナリXMLパーサは、値テーブルを構成するレコードデータである値データの内、値を含まない値データ(符号+所属+サイズ)を内部メモリに保存(記憶)する。S110において、値のサイズが上限値以下であると判断した場合、バイナリXMLパーサは、値を内部メモリに保存する(S111)。   If it is determined in S108 that the value belongs to the type stored in the internal memory, the binary XML parser determines whether the value size is equal to or smaller than the upper limit size stored in the internal memory based on the content analyzed in S103. Whether or not is determined (memory determination) (S110). In S110, when it is determined that the size of the value is not less than or equal to the upper limit value, the binary XML parser skips reading the value for the size analyzed in S107 without saving it in the internal memory (S109). More specifically, as described above, the binary XML parser stores value data (sign + affiliation + size) that does not include a value among value data that is record data constituting the value table in the internal memory ( Remember. In S110, when it is determined that the size of the value is equal to or smaller than the upper limit value, the binary XML parser stores the value in the internal memory (S111).

図8の処理で値テーブルを解析した後の内部メモリに保存した値テーブルを示したものが図9である。図9は、内部メモリに保存した値テーブルの一例を示した図(その1)である。
図9に示されるように、本実施形態では、値の上限サイズ50000バイトを越えた100000バイトのBASE64化した画像データと、コメントの内容と、をバイナリXMLパーサは、S103の制限情報に基づいて内部メモリに保存していない。
FIG. 9 shows the value table stored in the internal memory after the value table is analyzed in the process of FIG. FIG. 9 is a diagram (part 1) illustrating an example of a value table stored in the internal memory.
As shown in FIG. 9, in this embodiment, the binary XML parser uses the BASE64 image data of 10000 bytes exceeding the upper limit size of 50000 bytes and the content of the comment based on the restriction information in S103. Not saved in internal memory.

次に、バイナリXMLパーサは、内部メモリに保存した名前テーブルと、値テーブルと、を用いて、図10に示す処理を実行し、図4に示したバイナリXMLデータの構造と、値と、を含んだボディ部を解析する。図10は、ボディ部の解析処理の一例を示すフローチャート(その1)である。
バイナリXMLパーサは、タグ名を内部メモリに保存するスタックを初期化する(S202)。そして、バイナリXMLパーサは、ボディ部を全て解析したかどうか判定する(S203)。S203において、ボディ部を全て解析していないと判断した場合、バイナリXMLパーサは、ボディ部を1バイト読み進めてイベントの種類を解析する(S204)。
次に、バイナリXMLパーサは、前記イベントの種類が開始タグであるかどうか判定する(S205)。S205において、イベントの種類が開始タグであると判断した場合、バイナリXMLパーサは、ボディ部を1バイト読み進め、名前テーブルを用いてタグ名を解析する(S206)。その際、バイナリXMLパーサは、そのタグ名をスタックにプッシュし(S207)、開始タグの名前としてそのタグ名を要求元のアプリケーションに渡す(S208)。
Next, the binary XML parser executes the processing shown in FIG. 10 using the name table and value table stored in the internal memory, and obtains the structure and values of the binary XML data shown in FIG. Analyze the included body part. FIG. 10 is a flowchart (part 1) illustrating an example of the body part analysis process.
The binary XML parser initializes a stack for storing the tag name in the internal memory (S202). Then, the binary XML parser determines whether all body parts have been analyzed (S203). If it is determined in S203 that the body part has not been analyzed, the binary XML parser advances the body part by reading 1 byte and analyzes the event type (S204).
Next, the binary XML parser determines whether or not the event type is a start tag (S205). If it is determined in S205 that the event type is a start tag, the binary XML parser reads the body part by 1 byte and analyzes the tag name using the name table (S206). At that time, the binary XML parser pushes the tag name onto the stack (S207), and passes the tag name to the requesting application as the name of the start tag (S208).

S205において、イベントの種類が開始タグではないと判断した場合、バイナリXMLパーサは、終了タグであるかどうか判定する(S209)。S209において、イベントの種類が終了タグであると判断した場合、バイナリXMLパーサは、スタックからタグ名をポップし(S210)、終了タグの名前としてポップしたタグ名を要求元のアプリケーションに渡す(S211)。
S209において、イベントの種類が終了タグではないと判断した場合、バイナリXMLパーサは、属性であるかどうか判定する(S212)。S212において、イベントの種類が属性であると判断した場合、バイナリXMLパーサは、ボディ部を1バイト読み進め、名前テーブルを用いて属性名を解析する(S213)。そして、バイナリXMLパーサは、ボディ部を1バイト読み進め、値テーブルを用いて属性値(値)を解析するが、その際、その属性値を値テーブルに保存しているかどうか判定(値判定)する(S214)。S214において、その属性値を値テーブルに保存していると判断した場合、バイナリXMLパーサは、要求元のアプリケーションに属性名と、属性値と、を渡す(S215)。S214において、その属性値を値テーブルに保存していないと判断した場合、バイナリXMLパーサは、要求元のアプリケーションに属性名と、属性値の符号と、サイズ情報と、を渡す(通知する)(S216)。
If it is determined in S205 that the event type is not a start tag, the binary XML parser determines whether it is an end tag (S209). If it is determined in S209 that the event type is an end tag, the binary XML parser pops the tag name from the stack (S210), and passes the popped tag name as the end tag name to the requesting application (S211). ).
If it is determined in S209 that the event type is not an end tag, the binary XML parser determines whether the event is an attribute (S212). If it is determined in S212 that the event type is an attribute, the binary XML parser reads the body part by 1 byte and analyzes the attribute name using the name table (S213). The binary XML parser reads the body part by 1 byte and analyzes the attribute value (value) using the value table. At this time, it is determined whether the attribute value is stored in the value table (value determination). (S214). If it is determined in S214 that the attribute value is stored in the value table, the binary XML parser passes the attribute name and attribute value to the requesting application (S215). If it is determined in S214 that the attribute value is not stored in the value table, the binary XML parser passes (notifies) the attribute name, the sign of the attribute value, and the size information to the requesting application ( S216).

S212において、イベントの種類が属性ではないと判断した場合、バイナリXMLパーサは、要素内容であるかどうか判定する(S217)。S217において、イベントの種類が要素内容であると判断した場合、バイナリXMLパーサは、ボディ部を1バイト読み進め、値テーブルを用いて要素内容を解析する。その際、バイナリXMLパーサは、その要素内容を値テーブルに保存しているかどうか判定(値判定)する(S218)。S218において、その要素内容を値テーブルに保存していると判断した場合、バイナリXMLパーサは、要求元のアプリケーションにその要素内容を渡す(S219)。S218において、その要素内容を値テーブルに保存していないと判断した場合、バイナリXMLパーサは、要求元のアプリケーションに要素内容の符号と、サイズ情報と、を渡す(通知する)(S220)。
S212において、イベントの種類が要素内容ではないと判断した場合、バイナリXMLパーサは、イベントの種類がコメントであると判断する。そして、バイナリXMLパーサは、ボディ部を1バイト読み進め、コメントの内容を解析するが、その際、コメントの内容を値テーブルに保存しているかどうか判定(値判定)する(S221)。S221において、そのコメントの内容を値テーブルに保存していると判断した場合、バイナリXMLパーサは、要求元のアプリケーションにそのコメントの内容を渡す(S222)。S221において、コメントの内容を値テーブルに保存していないと判断した場合、バイナリXMLパーサは、要求元のアプリケーションにコメントの内容の符号と、サイズ情報と、を渡す(通知する)(S223)。
本実施形態では、図9の内部メモリに保存した値テーブルに基づいて、バイナリXMLパーサは、photo要素の要素内容と、コメントの内容と、については、要求元のアプリケーションにそれぞれの符号と、サイズ情報と、を渡す。
If it is determined in S212 that the event type is not an attribute, the binary XML parser determines whether it is element content (S217). If it is determined in S217 that the event type is element content, the binary XML parser reads the body part by 1 byte and analyzes the element content using the value table. At that time, the binary XML parser determines (value determination) whether or not the element contents are stored in the value table (S218). If it is determined in S218 that the element content is stored in the value table, the binary XML parser passes the element content to the requesting application (S219). If it is determined in S218 that the element content is not stored in the value table, the binary XML parser passes (notifies) the code of the element content and the size information to the requesting application (S220).
If it is determined in S212 that the event type is not element content, the binary XML parser determines that the event type is a comment. Then, the binary XML parser advances the body part by reading 1 byte and analyzes the content of the comment. At this time, the binary XML parser determines whether the content of the comment is stored in the value table (value determination) (S221). If it is determined in S221 that the content of the comment is stored in the value table, the binary XML parser passes the content of the comment to the requesting application (S222). In S221, when it is determined that the comment content is not stored in the value table, the binary XML parser passes (notifies) the code of the comment content and the size information to the request source application (S223).
In the present embodiment, based on the value table stored in the internal memory of FIG. 9, the binary XML parser, for the element content of the photo element and the content of the comment, sets the code and size of each to the requesting application. And pass information.

バイナリXMLパーサが図10に示した処理でボディ部の解析を一通り終えた後でアプリケーションが、バイナリXMLパーサによって読み飛ばされた値データを取得する必要がある場合、図11の処理が実行されることで取得することができる。図11は、値を取得する処理の一例を示すフローチャート(その1)である。
まず、アプリケーションは、取得したい値の符号と共に取得したサイズ情報を解析する(S302)。そして、アプリケーションは、値のサイズ情報を基に、その値を取得するかどうか判定する(S303)。S303において、その値を取得すると判断した場合、アプリケーションは、値の符号をバイナリXMLパーサに渡す(S304)。
バイナリXMLパーサは、アプリケーションより符号を渡されると、バイナリXMLデータの解析を再度先頭から開始する(S305)。その際、アプリケーションが取得したいデータは値データなので、バイナリXMLパーサは、名前テーブルの内容は内部メモリに保存しないで読み飛ばす。
If the application needs to acquire value data skipped by the binary XML parser after the binary XML parser completes the body part analysis in the process shown in FIG. 10, the process of FIG. 11 is executed. Can be obtained. FIG. 11 is a flowchart (part 1) illustrating an example of a process for acquiring a value.
First, the application analyzes the size information acquired together with the sign of the value to be acquired (S302). Then, the application determines whether to acquire the value based on the size information of the value (S303). If it is determined in S303 that the value is acquired, the application passes the sign of the value to the binary XML parser (S304).
When a code is passed from the application, the binary XML parser starts the analysis of the binary XML data again from the top (S305). At this time, since the data that the application wants to acquire is value data, the binary XML parser skips the contents of the name table without saving them in the internal memory.

そして次に、バイナリXMLパーサは、値テーブルの全ての内容を解析したかどうか判定する(S306)。S306において、値テーブルの全ての内容を解析していないと判断した場合、バイナリXMLパーサは、各符号を解析し(S307)、渡された符号と一致するかどうか判定する(S308)。S308において、渡された符号と一致したと判断した場合、バイナリXMLパーサは、値テーブルからその符号の組である値を取得(値取得)し、要求元のアプリケーションに渡す(S309)。
S308において、渡された符号と一致しないと判断した場合、バイナリXMLパーサは、アプリケーションの指定した符号が出現するまで、値テーブルの解析を続ける。S306において、値テーブルの全ての内容を解析したと判断した場合、バイナリXMLパーサは、要求元のアプリケーションに、指定した符号が値テーブルに含まれていないことを通知する(S310)。
バイナリXMLパーサは、S309において、要求元のアプリケーションに値を渡す際には、値だけではなく、前記値を含む値データを渡してもよい。また、バイナリXMLパーサは、S309において、値データ全体を一括で渡すのではなく、アプリケーションが値データを逐次読むことができるようにストリーム形式で渡してもよい。
以上の処理によって、符号化テーブルにサイズの大きなデータを含むバイナリXMLデータを、少ないメモリリソースで解析できるようになる。
Next, the binary XML parser determines whether all contents of the value table have been analyzed (S306). In S306, when it is determined that the entire contents of the value table have not been analyzed, the binary XML parser analyzes each code (S307) and determines whether or not it matches the passed code (S308). If it is determined in S308 that the code matches the passed code, the binary XML parser acquires a value that is a set of the code from the value table (value acquisition) and passes the value to the requesting application (S309).
If it is determined in S308 that the code does not match the passed code, the binary XML parser continues to analyze the value table until the code specified by the application appears. If it is determined in S306 that all contents of the value table have been analyzed, the binary XML parser notifies the requesting application that the specified code is not included in the value table (S310).
When passing a value to the requesting application in S309, the binary XML parser may pass not only the value but also value data including the value. Further, in S309, the binary XML parser may transfer the value data in a stream format so that the application can sequentially read the value data instead of transferring the entire value data at once.
With the above processing, binary XML data including large data in the encoding table can be analyzed with a small amount of memory resources.

<実施形態2>
本実施形態では、符号化テーブル内の読み飛ばしたサイズの大きなデータを、アプリケーションがバイナリXMLデータの先頭からのオフセットを指定することによって取得する処理について説明する。
図12は、バイナリXMLデータに含まれる符号化テーブルを解析する処理の一例を示すフローチャート(その2)である。
まず、バイナリXMLパーサは、バイナリXMLデータの先頭からのバイト数を数える変数offsetを初期化する(S402)。次に、バイナリXMLパーサは、要素名や属性名等と、その名前に割り当てたられ符号と、を格納した名前テーブルを解析し、各名前と符号との組をRAM203又は記憶部204等の内部メモリに保存する(S403)。
<Embodiment 2>
In the present embodiment, a description will be given of processing in which an application acquires large-sized data skipped in the encoding table by specifying an offset from the beginning of binary XML data.
FIG. 12 is a flowchart (part 2) illustrating an example of processing for analyzing an encoding table included in binary XML data.
First, the binary XML parser initializes a variable offset that counts the number of bytes from the beginning of the binary XML data (S402). Next, the binary XML parser analyzes a name table storing element names, attribute names, and the like and codes assigned to the names, and sets each name and code in the RAM 203 or the storage unit 204. Save in the memory (S403).

次に、バイナリXMLパーサは、名前テーブル解析後に、バイナリXMLデータの現在の解析位置で、変数offsetを更新する。次に、バイナリXMLパーサは、属性値や要素内容、コメントの内容等の値と、その値に割り当てられた符号と、を格納した値テーブルを内部メモリに保存する際の制限情報を解析する(S404)。
バイナリXMLパーサは、値テーブルの解析を開始するが、まず値テーブルの全ての内容を解析したか否かを判定する(S405)。S405において、値テーブルの全ての内容を解析していないと判断した場合、バイナリXMLパーサは、値テーブルに含まれる各値の、符号、所属情報、サイズ情報を解析し、内部メモリに保存する(S406〜S408)。
そして、バイナリXMLパーサは、サイズ情報のデータが始まる位置で変数offsetを更新し、その値を内部メモリに保存する(S409)。なお、サイズ情報のデータサイズは4バイトとする。
Next, the binary XML parser updates the variable offset at the current analysis position of the binary XML data after the name table analysis. Next, the binary XML parser analyzes restriction information when saving a value table storing values such as attribute values, element contents, and comment contents, and codes assigned to the values in the internal memory ( S404).
The binary XML parser starts to analyze the value table, but first determines whether all contents of the value table have been analyzed (S405). If it is determined in S405 that the entire contents of the value table have not been analyzed, the binary XML parser analyzes the sign, affiliation information, and size information of each value included in the value table and saves them in the internal memory ( S406 to S408).
Then, the binary XML parser updates the variable offset at the position where the size information data starts, and stores the value in the internal memory (S409). The data size of the size information is 4 bytes.

そして、バイナリXMLパーサは、S404において解析した内容に基づいて、値の所属が内部メモリに保存する種類であるかどうか判定(記憶判定)する(S410)。S410において、値の所属が内部メモリに保存する種類ではないと判断した場合、バイナリXMLパーサは、S408で解析したサイズ分、値を内部メモリに保存しないで読み飛ばす(S411)。より具体的に説明すると、上述したように、バイナリXMLパーサは、値テーブルを構成するレコードデータである値データの内、値を含まない値データ(符号+所属+サイズ+オフセット(offset))を内部メモリに保存(記憶)する。S410において、その値の所属が内部メモリに保存する種類であると判断した場合、バイナリXMLパーサは、S408において解析した内容に基づいて、値のサイズが内部メモリに保存する上限サイズ以下であるかどうか判定(記憶判定)する(S412)。S412において、値のサイズが上限値以下ではないと判断した場合、バイナリXMLパーサは、S408で解析したサイズ分、値を内部メモリに保存しないで読み飛ばす(S411)。より具体的に説明すると、上述したように、バイナリXMLパーサは、値テーブルを構成するレコードデータである値データの内、値を含まない値データ(符号+所属+サイズ+オフセット(offset))を内部メモリに保存(記憶)する。S412において、値のサイズが上限値以下であると判断した場合、バイナリXMLパーサは、値を内部メモリに保存する(S413)。   Then, the binary XML parser determines (stores determination) whether or not the value affiliation is the type stored in the internal memory based on the content analyzed in S404 (S410). If it is determined in S410 that the value affiliation is not a type to be stored in the internal memory, the binary XML parser skips reading the value for the size analyzed in S408 without storing it in the internal memory (S411). More specifically, as described above, the binary XML parser outputs value data (sign + affiliation + size + offset (offset)) that does not include a value among value data that is record data constituting the value table. Save (store) in internal memory. If it is determined in S410 that the value belongs to the type stored in the internal memory, the binary XML parser determines whether the value size is equal to or smaller than the upper limit size stored in the internal memory based on the content analyzed in S408. It is determined (memory determination) (S412). If it is determined in S412 that the size of the value is not less than or equal to the upper limit value, the binary XML parser skips reading without saving the value in the internal memory for the size analyzed in S408 (S411). More specifically, as described above, the binary XML parser outputs value data (sign + affiliation + size + offset (offset)) that does not include a value among value data that is record data constituting the value table. Save (store) in internal memory. If it is determined in S412 that the value size is equal to or smaller than the upper limit value, the binary XML parser stores the value in the internal memory (S413).

図12の処理で値テーブルを解析した後の、内部メモリに保存した値テーブルを示したものが図13である。図13は、内部メモリに保存した値テーブルの一例を示した図(その2)である。
図13に示されるように、値の上限サイズ50000バイトを越えた100000バイトのBASE64化した画像データと、コメントの内容と、をバイナリXMLパーサは、S404の制限情報に基づいて内部メモリに保存していない。また、バイナリXMLパーサは、値テーブルにおけるサイズ情報の開始位置をオフセット値として保存している。
FIG. 13 shows the value table stored in the internal memory after the value table is analyzed by the processing of FIG. FIG. 13 is a diagram (part 2) illustrating an example of a value table stored in the internal memory.
As shown in FIG. 13, the binary XML parser stores 100000 bytes of BASE64 image data exceeding the upper limit size of 50000 bytes and the content of the comment in the internal memory based on the restriction information in S404. Not. The binary XML parser stores the start position of the size information in the value table as an offset value.

次に、バイナリXMLパーサは、内部メモリに保存した名前テーブルと、値テーブルと、を用いて、図14に示す処理を実行し、図4に示したバイナリXMLデータの構造と、値と、を含んだボディ部を解析する。図14は、ボディ部の解析処理の一例を示すフローチャート(その2)である。
バイナリXMLパーサは、タグ名を内部メモリに保存するスタックを初期化する(S502)。そして、バイナリXMLパーサは、ボディ部を全て解析したかどうか判定する(S503)。S503において、ボディ部を全て解析していないと判断した場合、バイナリXMLパーサは、ボディ部を1バイト読み進めてイベントの種類を解析する(S504)。
次に、バイナリXMLパーサは、前記イベントの種類が開始タグであるかどうか判定する(S505)。S505において、イベントの種類が開始タグであると判断した場合、バイナリXMLパーサは、ボディ部を1バイト読み進め、名前テーブルを用いてタグ名を解析する(S506)。その際、バイナリXMLパーサは、そのタグ名をスタックにプッシュし(S507)、開始タグの名前としてそのタグ名を要求元のアプリケーションに渡す(S508)。
Next, the binary XML parser executes the processing shown in FIG. 14 using the name table and the value table stored in the internal memory, and obtains the structure and values of the binary XML data shown in FIG. Analyze the included body part. FIG. 14 is a flowchart (part 2) illustrating an example of the body part analysis process.
The binary XML parser initializes a stack for storing the tag name in the internal memory (S502). Then, the binary XML parser determines whether all the body parts have been analyzed (S503). If it is determined in S503 that the entire body part has not been analyzed, the binary XML parser advances the body part by 1 byte and analyzes the event type (S504).
Next, the binary XML parser determines whether or not the event type is a start tag (S505). If it is determined in S505 that the event type is a start tag, the binary XML parser reads the body part by 1 byte and analyzes the tag name using the name table (S506). At that time, the binary XML parser pushes the tag name onto the stack (S507), and passes the tag name to the requesting application as the name of the start tag (S508).

S505において、イベントの種類が開始タグではないと判断した場合、バイナリXMLパーサは、終了タグであるかどうか判定する(S509)。S509において、イベントの種類が終了タグであると判断した場合、スタックからタグ名をポップし(S510)、終了タグの名前としてポップしたタグ名を要求元のアプリケーションに渡す(S511)。
S509において、イベントの種類が終了タグではないと判断した場合、バイナリXMLパーサは、属性であるかどうか判定する(S512)。S512において、イベントの種類が属性であると判断した場合、バイナリXMLパーサは、ボディ部を1バイト読み進め、名前テーブルを用いて属性名を解析する(S513)。そして、バイナリXMLパーサは、ボディ部を1バイト読み進め、値テーブルを用いて属性値(値)を解析するが、その際、その属性値を値テーブルに保存しているかどうか判定(値判定)する(S514)。S514において、その属性値を値テーブルに保存していると判断した場合、バイナリXMLパーサは、要求元のアプリケーションに属性名と、属性値と、を渡す(S515)。S514において、その属性値を値テーブルに保存していないと判断した場合、バイナリXMLパーサは、要求元のアプリケーションに属性名と、属性値の位置に関するオフセットと、属性値のサイズ情報と、を渡す(通知する)(S516)。
If it is determined in S505 that the event type is not a start tag, the binary XML parser determines whether it is an end tag (S509). If it is determined in S509 that the event type is an end tag, the tag name is popped from the stack (S510), and the popped tag name is passed to the requesting application (S511).
If it is determined in S509 that the event type is not an end tag, the binary XML parser determines whether the event is an attribute (S512). If it is determined in S512 that the event type is an attribute, the binary XML parser reads the body part by 1 byte, and analyzes the attribute name using the name table (S513). The binary XML parser reads the body part by 1 byte and analyzes the attribute value (value) using the value table. At this time, it is determined whether the attribute value is stored in the value table (value determination). (S514). If it is determined in S514 that the attribute value is stored in the value table, the binary XML parser passes the attribute name and attribute value to the requesting application (S515). If it is determined in S514 that the attribute value is not stored in the value table, the binary XML parser passes the attribute name, the offset regarding the position of the attribute value, and the size information of the attribute value to the requesting application. (Notify) (S516).

S512において、イベントの種類が属性ではないと判断した場合、バイナリXMLパーサは、要素内容であるかどうか判定する(S517)。S517において、イベントの種類が要素内容であると判断した場合、バイナリXMLパーサは、ボディ部を1バイト読み進め、値テーブルを用いて要素内容を解析する。その際、バイナリXMLパーサは、その要素内容を値テーブルに保存しているかどうか判定(値判定)する(S518)。S518において、その要素内容を値テーブルに保存していると判断した場合、バイナリXMLパーサは、要求元のアプリケーションにその要素内容を渡す(S519)。S518において、その要素内容を値テーブルに保存していないと判断した場合、バイナリXMLパーサは、要求元のアプリケーションに要素内容の位置に関するオフセットと、要素内容のサイズ情報と、を渡す(通知する)(S520)。
S512において、イベントの種類が要素内容ではないと判断した場合、バイナリXMLパーサは、イベントの種類がコメントであると判断する。そして、バイナリXMLパーサは、ボディ部を1バイト読み進め、コメントの内容を解析するが、その際、コメントの内容を値テーブルに保存しているかどうか判定(値判定)する(S521)。S521において、そのコメントの内容を値テーブルに保存していると判断した場合、要求元のアプリケーションにそのコメントの内容を渡す(S522)。S521において、そのコメントの内容を値テーブルに保存していないと判断した場合、バイナリXMLパーサは、要求元のアプリケーションにコメントの内容の位置に関するオフセットと、コメントの内容のサイズ情報と、を渡す(通知する)(S523)。
本実施形態では、図13の内部メモリに保存した値テーブルに基づいて、バイナリXMLパーサは、photo要素の要素内容と、コメントの内容と、については、要求元のアプリケーションにはそれぞれの位置に関するオフセットと、サイズ情報と、を渡す。
If it is determined in S512 that the event type is not an attribute, the binary XML parser determines whether the event content is element content (S517). If it is determined in S517 that the event type is element content, the binary XML parser reads the body part by 1 byte, and analyzes the element content using the value table. At that time, the binary XML parser determines (value determination) whether or not the element content is stored in the value table (S518). If it is determined in S518 that the element content is stored in the value table, the binary XML parser passes the element content to the requesting application (S519). In S518, when it is determined that the element contents are not stored in the value table, the binary XML parser passes (notifies) the offset regarding the position of the element contents and the size information of the element contents to the request source application. (S520).
In S512, when it is determined that the event type is not element content, the binary XML parser determines that the event type is a comment. Then, the binary XML parser advances the body part by reading 1 byte and analyzes the content of the comment. At this time, the binary XML parser determines whether the content of the comment is stored in the value table (value determination) (S521). If it is determined in S521 that the content of the comment is stored in the value table, the content of the comment is passed to the request source application (S522). If it is determined in S521 that the content of the comment is not stored in the value table, the binary XML parser passes the offset regarding the position of the content of the comment and the size information of the content of the comment to the requesting application ( (S523).
In the present embodiment, based on the value table stored in the internal memory of FIG. 13, the binary XML parser has an offset regarding the position of the element content of the photo element and the content of the comment in the request source application. And size information.

バイナリXMLパーサが図14に示した処理でボディ部の解析を一通り終えた後でアプリケーションが、バイナリXMLパーサによって読み飛ばされた値データを取得する必要がある場合、図15の処理が実行されることで取得することができる。図15は、値を取得する処理の一例を示すフローチャート(その2)である。
まず、アプリケーションは、取得したい値のサイズ情報を解析する(S602)。そして、アプリケーションは、値のサイズ情報を基に、その値を取得するかどうか判定する(S603)。S603において、その値を取得すると判断した場合、アプリケーションは、値に関するオフセットをバイナリXMLパーサに渡す(S604)。
バイナリXMLパーサは、アプリケーションよりオフセットを渡されると、バイナリXMLデータの解析を再度先頭から開始し、前記オフセット分、データを読み飛ばす(S605)。そして、バイナリXMLパーサは、取得する値のサイズ情報を解析し(S606)、サイズ分のデータ(値)を読み込み(値取得)、要求元のアプリケーションに渡す(S607)。
If the application needs to acquire the value data skipped by the binary XML parser after the binary XML parser completes the body part analysis in the process shown in FIG. 14, the process of FIG. 15 is executed. Can be obtained. FIG. 15 is a flowchart (part 2) illustrating an example of a process for acquiring a value.
First, the application analyzes size information of a value to be acquired (S602). Then, the application determines whether to acquire the value based on the size information of the value (S603). If it is determined in S603 that the value is acquired, the application passes an offset related to the value to the binary XML parser (S604).
When an offset is passed from the application, the binary XML parser starts the analysis of the binary XML data from the top again, and skips the data corresponding to the offset (S605). Then, the binary XML parser analyzes the size information of the value to be acquired (S606), reads the data (value) for the size (value acquisition), and passes it to the requesting application (S607).

バイナリXMLパーサは、S607において、要求元のアプリケーションに値を渡す際には、値だけではなく、前記値を含む値データを渡してもよい。また、バイナリXMLパーサは、S309において、値データ全体を一括で渡すのではなく、アプリケーションが値データを逐次読むことができるようにストリーム形式で渡してもよい。
以上の処理によって、符号化テーブル内の読み飛ばしたサイズの大きなデータを、アプリケーションがバイナリXMLデータの先頭からのオフセットを指定することによって、より少ない解析時間で取得できるようになる。
In S607, the binary XML parser may pass not only the value but also value data including the value when passing the value to the requesting application. Further, in S309, the binary XML parser may transfer the value data in a stream format so that the application can sequentially read the value data instead of transferring the entire value data at once.
As a result of the above processing, it is possible to acquire large-sized data skipped in the encoding table with less analysis time by designating an offset from the top of the binary XML data by the application.

<その他の実施形態>
また、上述した実施形態の目的は、以下のようにすることによって達成される。即ち、上述した実施形態の機能を実現するソフトウェアのプログラムコードを記録した記憶媒体(又は記録媒体)を、システム或いは装置に供給する。そして、そのシステム或いは装置の中央演算処理手段(CPUやMPU)が記憶媒体に格納されたプログラムコードを読み出し実行する。この場合、記憶媒体から読み出されたプログラムコード自体が上述した実施形態の機能を実現することになり、そのプログラムコードを記録した記憶媒体は上述した実施形態を構成することになる。
また、システム或いは装置の前記中央演算処理手段が読み出したプログラムコードを実行することにより、そのプログラムコードの指示に基づき、システム或いは装置上で稼働しているオペレーティングシステム(OS)等が実際の処理の一部又は全部を行う。その処理によって上述した実施形態の機能が実現される場合も含まれる。
更に、記憶媒体から読み出されたプログラムコードが、前記システム或いは装置に挿入された機能拡張カードや、接続された機能拡張ユニットに備わるメモリに書込まれたとする。その後、そのプログラムコードの指示に基づき、その機能拡張カードや機能拡張ユニットに備わるCPU等が実際の処理の一部又は全部を行い、その処理によって上述した実施形態の機能が実現される場合も含まれる。
上述した実施形態を前記記憶媒体に適用する場合、その記憶媒体には、先に説明したフローチャートに対応するプログラムコードが格納されることになる。
<Other embodiments>
The object of the above-described embodiment is achieved by the following. That is, a storage medium (or recording medium) in which a program code of software that realizes the functions of the above-described embodiments is recorded is supplied to the system or apparatus. Then, the central processing means (CPU or MPU) of the system or apparatus reads and executes the program code stored in the storage medium. In this case, the program code itself read from the storage medium realizes the functions of the above-described embodiment, and the storage medium recording the program code constitutes the above-described embodiment.
In addition, by executing the program code read by the central processing means of the system or apparatus, an operating system (OS) or the like operating on the system or apparatus performs actual processing based on the instruction of the program code. Do some or all. The case where the function of the above-described embodiment is realized by the processing is also included.
Further, it is assumed that the program code read from the storage medium is written in a memory provided in a function expansion card inserted into the system or apparatus or a function expansion unit connected thereto. After that, based on the instruction of the program code, the CPU of the function expansion card or function expansion unit performs part or all of the actual processing, and the function of the above-described embodiment is realized by the processing. It is.
When the above-described embodiment is applied to the storage medium, the storage medium stores program codes corresponding to the flowcharts described above.

以上、上述した各実施形態によれば、構造化文書の符号化に関するオブジェクト(例えば符号化テーブル等)に、サイズの大きなデータが含まれている場合でも、少ないメモリリソースで解析できるようにすることができる。   As described above, according to each embodiment described above, even when an object (for example, an encoding table) related to encoding of a structured document includes large-size data, analysis can be performed with a small amount of memory resources. Can do.

以上、本発明の好ましい実施形態について詳述したが、本発明は係る特定の実施形態に限定されるものではなく、特許請求の範囲に記載された本発明の要旨の範囲内において、種々の変形・変更が可能である。   The preferred embodiments of the present invention have been described in detail above, but the present invention is not limited to such specific embodiments, and various modifications can be made within the scope of the gist of the present invention described in the claims.・ Change is possible.

なお、特許請求の範囲に記載の値オブジェクトは、例えば、上述した図3に示したような値テーブル等に対応する。値テーブルは上述したようにXMLデータ文書(構造化文書)に含まれる構造情報と値とを符号化して作成された図4に示されるような符号化文書に含まれる符号と値と値に関する属性値の一例として所属及びサイズとが対応付けられた値データを複数含んでいる。また、特許請求の範囲に記載のメモリ内値オブジェクトは、例えば、上述した図9又は図13に示したような内部メモリに保存した値テーブル等に対応する。また、特許請求の範囲に記載の値データは、例えば、上述した値テーブルに含まれる1レコードのデータ等に対応する。また、特許請求の範囲に記載の情報処理装置及びコンピュータは、例えば、上述したPC101、又はデジタルカメラ103、又は複合機104、又はファイルサーバ105等に対応する。   The value object described in the claims corresponds to, for example, the value table as shown in FIG. 3 described above. As described above, the value table is an attribute related to the code, value, and value included in the encoded document as shown in FIG. 4 created by encoding the structure information and value included in the XML data document (structured document). As an example of the value, a plurality of value data in which affiliation and size are associated are included. The in-memory value object described in the claims corresponds to, for example, a value table stored in the internal memory as shown in FIG. 9 or 13 described above. The value data described in the claims corresponds to, for example, data of one record included in the above-described value table. An information processing apparatus and a computer described in the claims correspond to, for example, the PC 101, the digital camera 103, the multifunction machine 104, the file server 105, or the like described above.

101 PC、102 LAN、103、デジタルカメラ、104 複合機 101 PC, 102 LAN, 103, digital camera, 104 MFP

Claims (6)

構造化文書に含まれる構造情報と値とを符号化して作成された符号化文書に含まれる符号と、前記値と、前記値に関する属性値と、が対応付けられた値データを複数含む値オブジェクトの前記値データの前記属性値に基づいて、前記属性値に対応する値を含む値データをメモリに記憶するか否かを判定する記憶判定手段と、
前記記憶判定手段で前記属性値に対応する値を含む値データをメモリに記憶すると判定された場合には、前記値を含む値データをメモリ内のメモリ内値オブジェクトに記憶し、前記記憶判定手段で前記属性値に対応する値を含む値データをメモリに記憶しないと判定された場合には、前記値を含まない値データをメモリ内のメモリ内値オブジェクトに記憶する記憶手段と、
前記メモリ内値オブジェクトの値データに値が含まれているか否かを判定する値判定手段と、
前記値判定手段で前記メモリ内値オブジェクトの値データに値が含まれていると判定された場合には、前記値をアプリケーションに返し、前記値判定手段で前記メモリ内値オブジェクトの値データに値が含まれていないと判定された場合には、前記値データに含まれる符号及び属性値をアプリケーションに返す通知手段と、
前記アプリケーションから前記アプリケーションが取得しようとする値の符号が渡された場合、前記値オブジェクトを解析し、前記アプリケーションから渡された符号と一致する符号の組である値を前記値オブジェクトから取得して前記アプリケーションに渡す値取得手段と、
を有する、情報処理装置。
A value object including a plurality of value data in which a code included in an encoded document created by encoding structure information and a value included in a structured document, the value, and an attribute value related to the value are associated with each other Storage determination means for determining whether or not to store in the memory value data including a value corresponding to the attribute value, based on the attribute value of the value data;
When it is determined by the storage determination means that the value data including the value corresponding to the attribute value is stored in the memory, the value data including the value is stored in the in-memory value object, and the storage determination means When it is determined that the value data including the value corresponding to the attribute value is not stored in the memory, the storage unit stores the value data not including the value in the in-memory value object;
Value determining means for determining whether or not the value data of the in-memory value object includes a value;
If it is determined by the value determination means that the value data of the in-memory value object contains a value, the value is returned to the application, and the value determination means returns a value to the value data of the in-memory value object. Is not included, the notification means for returning the code and attribute value included in the value data to the application,
When a sign of a value to be acquired by the application is passed from the application, the value object is analyzed, and a value that is a set of codes that matches the sign passed from the application is acquired from the value object. A value acquisition means to be passed to the application;
An information processing apparatus.
前記値に関する属性値は、前記値のサイズである、請求項1記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the attribute value related to the value is a size of the value. 前記値に関する属性値は、前記値の種類情報である、請求項1記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the attribute value related to the value is type information of the value. 構造化文書に含まれる構造情報と値とを符号化して作成された符号化文書に含まれる符号と、前記値と、前記値に関する属性値と、が対応付けられた値データを複数含む値オブジェクトの前記値データの前記属性値に基づいて、前記属性値に対応する値を含む値データをメモリに記憶するか否かを判定する記憶判定ステップと、
前記記憶判定ステップで前記属性値に対応する値を含む値データをメモリに記憶すると判定された場合には、前記値を含む値データをメモリ内のメモリ内値オブジェクトに記憶し、前記記憶判定ステップで前記属性値に対応する値を含む値データをメモリに記憶しないと判定された場合には、前記値を含まない値データをメモリ内のメモリ内値オブジェクトに記憶する記憶ステップと、
前記メモリ内値オブジェクトの値データに値が含まれているか否かを判定する値判定ステップと、
前記値判定ステップで前記メモリ内値オブジェクトの値データに値が含まれていると判定された場合には、前記値をアプリケーションに返し、前記値判定ステップで前記メモリ内値オブジェクトの値データに値が含まれていないと判定された場合には、前記値データに含まれる符号及び属性値をアプリケーションに返す通知ステップと、
前記アプリケーションから前記アプリケーションが取得しようとする値の符号が渡された場合、前記値オブジェクトを解析し、前記アプリケーションから渡された符号と一致する符号の組である値を前記値オブジェクトから取得して前記アプリケーションに渡す値取得ステップと、
を含む情報処理方法。
A value object including a plurality of value data in which a code included in an encoded document created by encoding structure information and a value included in a structured document, the value, and an attribute value related to the value are associated with each other A storage determination step for determining whether or not to store in the memory value data including a value corresponding to the attribute value based on the attribute value of the value data;
When it is determined in the storage determination step that the value data including the value corresponding to the attribute value is stored in the memory, the value data including the value is stored in the in-memory value object, and the storage determination step A storage step of storing the value data not including the value in a value object in the memory if it is determined not to store the value data including the value corresponding to the attribute value in the memory;
A value determination step for determining whether or not a value is included in the value data of the in-memory value object;
If it is determined in the value determination step that the value data of the in-memory value object contains a value, the value is returned to the application, and the value determination step returns a value to the value data of the in-memory value object. A notification step for returning to the application the code and the attribute value included in the value data,
When a sign of a value to be acquired by the application is passed from the application, the value object is analyzed, and a value that is a set of codes that matches the sign passed from the application is acquired from the value object. A value acquisition step to pass to the application;
An information processing method including:
コンピュータを、
構造化文書に含まれる構造情報と値とを符号化して作成された符号化文書に含まれる符号と、前記値と、前記値に関する属性値と、が対応付けられた値データを複数含む値オブジェクトの前記値データの前記属性値に基づいて、前記属性値に対応する値を含む値データをメモリに記憶するか否かを判定する記憶判定手段と、
前記記憶判定手段で前記属性値に対応する値を含む値データをメモリに記憶すると判定された場合には、前記値を含む値データをメモリ内のメモリ内値オブジェクトに記憶し、前記記憶判定手段で前記属性値に対応する値を含む値データをメモリに記憶しないと判定された場合には、前記値を含まない値データをメモリ内のメモリ内値オブジェクトに記憶する記憶手段と、
前記メモリ内値オブジェクトの値データに値が含まれているか否かを判定する値判定手段と、
前記値判定手段で前記メモリ内値オブジェクトの値データに値が含まれていると判定された場合には、前記値をアプリケーションに返し、前記値判定手段で前記メモリ内値オブジェクトの値データに値が含まれていないと判定された場合には、前記値データに含まれる符号及び属性値をアプリケーションに返す通知手段と、
前記アプリケーションから前記アプリケーションが取得しようとする値の符号が渡された場合、前記値オブジェクトを解析し、前記アプリケーションから渡された符号と一致する符号の組である値を前記値オブジェクトから取得して前記アプリケーションに渡す値取得手段と、
として機能させるプログラム。
Computer
A value object including a plurality of value data in which a code included in an encoded document created by encoding structure information and a value included in a structured document, the value, and an attribute value related to the value are associated with each other Storage determination means for determining whether or not to store in the memory value data including a value corresponding to the attribute value, based on the attribute value of the value data;
When it is determined by the storage determination means that the value data including the value corresponding to the attribute value is stored in the memory, the value data including the value is stored in the in-memory value object, and the storage determination means When it is determined that the value data including the value corresponding to the attribute value is not stored in the memory, the storage unit stores the value data not including the value in the in-memory value object;
Value determining means for determining whether or not the value data of the in-memory value object includes a value;
If it is determined by the value determination means that the value data of the in-memory value object contains a value, the value is returned to the application, and the value determination means returns a value to the value data of the in-memory value object. Is not included, the notification means for returning the code and attribute value included in the value data to the application,
When a sign of a value to be acquired by the application is passed from the application, the value object is analyzed, and a value that is a set of codes that matches the sign passed from the application is acquired from the value object. A value acquisition means to be passed to the application;
Program to function as.
請求項5記載のプログラムを記憶した、コンピュータが読み取り可能な記憶媒体。   A computer-readable storage medium storing the program according to claim 5.
JP2009097120A 2009-04-13 2009-04-13 Information processing apparatus, information processing method, program, and storage medium Expired - Fee Related JP5409090B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009097120A JP5409090B2 (en) 2009-04-13 2009-04-13 Information processing apparatus, information processing method, program, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009097120A JP5409090B2 (en) 2009-04-13 2009-04-13 Information processing apparatus, information processing method, program, and storage medium

Publications (2)

Publication Number Publication Date
JP2010250434A JP2010250434A (en) 2010-11-04
JP5409090B2 true JP5409090B2 (en) 2014-02-05

Family

ID=43312717

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009097120A Expired - Fee Related JP5409090B2 (en) 2009-04-13 2009-04-13 Information processing apparatus, information processing method, program, and storage medium

Country Status (1)

Country Link
JP (1) JP5409090B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5325921B2 (en) * 2011-03-28 2013-10-23 株式会社東芝 Decoder compiler, program and communication equipment
JP5325920B2 (en) * 2011-03-28 2013-10-23 株式会社東芝 Encoder compiler, program and communication equipment
JP2015115652A (en) 2013-12-09 2015-06-22 キヤノン株式会社 Information processing apparatus, information processing method and program

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2005101210A1 (en) * 2004-04-09 2008-03-06 シャープ株式会社 Data analysis apparatus and data analysis program
JP3962748B2 (en) * 2005-03-28 2007-08-22 キヤノン株式会社 Information processing apparatus and method
JP2007102368A (en) * 2005-09-30 2007-04-19 Seiko Epson Corp Data file analysis device, data file editing device, data file analysis method, data file analysis program, data file editing method, and data file editing program

Also Published As

Publication number Publication date
JP2010250434A (en) 2010-11-04

Similar Documents

Publication Publication Date Title
JP4576442B2 (en) Image processing apparatus and user interface providing method
US8411956B2 (en) Associating optical character recognition text data with source images
US7752603B2 (en) Systems and methods for data interchange among autonomous processing entities
US11775176B2 (en) Terminal device, data management system, and server device
JP2012206505A (en) Output apparatus, system, control method, and program
US20210191668A1 (en) Information processing apparatus and non-transitory computer readable medium
US10705777B2 (en) Information processing apparatus, image forming apparatus, and storage medium that enable printing while receiving random access document file
JP5409090B2 (en) Information processing apparatus, information processing method, program, and storage medium
TW201714124A (en) Document management system and method thereof
JP2019067361A (en) INFORMATION PROCESSING APPARATUS, COMMUNICATION SYSTEM, IMAGE FORMING METHOD, PROGRAM
US9396174B1 (en) Inserting and using metadata within a portable document format document
JP2010267092A (en) Information processing apparatus and information processing method
US8190563B2 (en) Document management apparatus, document management method, and computer-readable encoding medium recorded with a computer program
JP2001256256A (en) Device and method for retrieving electronic document
JP4144878B2 (en) Data processing apparatus, data processing method, and computer program
US9326015B2 (en) Information processing apparatus, information processing system, information processing method, and non-transitory computer readable medium
US20090287733A1 (en) Method for preparing prepress image data
JP4420747B2 (en) File creation device and file structure
CN106445893A (en) Picture indexing method and picture indexing apparatus
JP2008035224A (en) Log information management system, log information management apparatus, log information management method, log information management program, and storage medium
US7356543B2 (en) Structured document data, contents processing method, program for implementing that process, and storage medium storing program
JP2006235756A (en) Image processing apparatus and method
JP6996373B2 (en) Information processing equipment, image forming equipment, systems and programs
JP4189592B2 (en) Image data management apparatus, image forming apparatus, and image data management method
JP2008020946A (en) Image log management system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120412

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130515

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130521

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130701

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130806

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130919

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: 20131008

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131105

R151 Written notification of patent or utility model registration

Ref document number: 5409090

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees