JP5879235B2 - Method, apparatus and program for parallel verification of semi-structured messages - Google Patents
Method, apparatus and program for parallel verification of semi-structured messages Download PDFInfo
- Publication number
- JP5879235B2 JP5879235B2 JP2012206472A JP2012206472A JP5879235B2 JP 5879235 B2 JP5879235 B2 JP 5879235B2 JP 2012206472 A JP2012206472 A JP 2012206472A JP 2012206472 A JP2012206472 A JP 2012206472A JP 5879235 B2 JP5879235 B2 JP 5879235B2
- Authority
- JP
- Japan
- Prior art keywords
- semi
- tag
- verification
- structured
- message
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Description
本発明は、XMLやJSON(java script object notation)等の形式で記述された半構造電文内のタグ及び/又はコンテンツ間の相互関係に関する制約の成立/不成立を、多数のコアを有する演算装置を用いて並列に検証する方法、装置及びプログラムに関する。 The present invention provides a computing device having a large number of cores for establishing / disabling constraints on mutual relations between tags and / or contents in semi-structured messages described in a format such as XML or JSON (java script object notation). The present invention relates to a method, an apparatus, and a program for using and verifying in parallel.
企業間の電子取引やシステム間の連携等には固定長電文が用いられてきたが、昨今では、XMLやJSON等の形式で記述された半構造電文が普及してきている。半構造電文は、タグにより意味や構造を記述することができるため、固定長電文と比較して可読性や拡張性に優れている。一方で、半構造電文はサイズが大きく構造が複雑である。このため、制約に対する半構造電文の検証は、コンピュータにとって大きな負担になっている。 Fixed-length telegrams have been used for electronic transactions between companies, linkages between systems, and the like, but nowadays semi-structured telegrams written in a format such as XML or JSON have become widespread. Semi-structured messages can be described with meanings and structures by tags, so they are more readable and extensible than fixed-length messages. On the other hand, semi-structured messages are large in size and complex in structure. For this reason, verification of semi-structured messages against restrictions is a heavy burden on the computer.
XML電文に対する検証内容の記述には、例えばXML Schema(非特許文献1)が利用されている。XML Schemaでは、XML電文内で利用されるタグ名やコンテンツに対する制約(変数型や正規表現)を記述することができる。 For example, XML Schema (Non-patent Document 1) is used to describe the verification contents for an XML message. In XML Schema, it is possible to describe restrictions (variable types and regular expressions) on tag names and contents used in XML messages.
このような背景から、半構造電文のタグ構造の解析や制約の検証を、CPUやGPUの持つ多数のコアプロセッサ(演算ユニット)(以下、単に「コア」ともいう)を利用し、並列に処理する試みがなされている。例えば非特許文献3では、複数のXPathで指定されたタグやコンテンツの特定を、個々のXPathを各コアに割り当てることにより並列に処理している。また、非特許文献4は、各コアに一つのタグ名のみを割り当てることにより、並列に探索又はタグ検索するためのインデックスを作成している。更に、非特許文献5には、半構造電文内のコンテンツの書式の検証に必要な正規表現のマッチングの並列処理方法が記述されている。
Against this background, analysis of tag structures of semi-structured messages and verification of constraints are performed in parallel using a number of core processors (arithmetic units) (hereinafter simply referred to as “cores”) of CPUs and GPUs. Attempts have been made. For example, in
しかしながら、特定の業界では、XML電文に対してXML Schemaでは記述できない制約を規定する場合がある。例えば金融決済電文を規定するISO20022では、決済方法に応じて様々な制約を規定している(非特許文献2参照)。 However, in certain industries, there are cases in which restrictions that cannot be described in XML Schema are defined for XML messages. For example, in ISO20022 that defines a financial settlement message, various restrictions are defined according to the settlement method (see Non-Patent Document 2).
図1に、ISO20022で規定している送金指示のためのCusutomerCreditTransferInitiationのXML電文の例を示す。ただし、説明を簡略化するために、図1では、電文の一部を省略している。図1の例では、ABC Corporationが、DEF Electronicsに10000000円、GHI Semiconductorsに500000ユーロ送金することを指示している。 FIG. 1 shows an example of a CusutomerCreditTransferInitiation XML message for a remittance instruction defined in ISO20022. However, in order to simplify the description, a part of the message is omitted in FIG. In the example of FIG. 1, ABC Corporation instructs DEF Electronics to remit 10 million yen and GHI Semiconductors to remit 500,000 euros.
このCustomerCreditTransferInitiationの電文に対し、ISO20022は、次の様なルール(制約)を規定している。 For this CustomerCreditTransferInitiation message, ISO20022 defines the following rules (constraints).
R4 PaymentTypeInformationRule
If PaymentTypeInformation is present, then CreditTransferTransactionInformation/PaymentTypeInformation is not allowed.
On Condition
/PaymentTypeInformation is present
Following Must be True
/CreditTransferTransactionInformation[*]/PaymentTypeInformation Must be absent
R4 PaymentTypeInformationRule
If PaymentTypeInformation is present, then CreditTransferTransactionInformation / PaymentTypeInformation is not allowed.
On Condition
/ PaymentTypeInformation is present
Following Must be True
/ CreditTransferTransactionInformation [*] / PaymentTypeInformation Must be absent
このR4 PyamentTypeInformationRuleは、規定されているルール(制約)の一例であり、図1のXML電文において、<CstmrCdtTrfInitn><Pmtiinf>(<PmtInf>はPaymentTypeInformationに対応するタグ名)が存在した場合、<CstmrCdtTrfInitn><CdtTrfTxInf><PmtInf>(<CdtTrfTxInf>は、CreditTransferTransactionInformationに対応するタグ名)が存在してはいけないことを規定している。このようなタグ間の相互関係に関する制約は、XML Schemaによっては記述することができない。 This R4 PyamentTypeInformationRule is an example of a specified rule (constraint). If <CstmrCdtTrfInitn> <Pmtiinf> (<PmtInf> is a tag name corresponding to PaymentTypeInformation) exists in the XML message of FIG. 1, <CstmrCdtTrfInitn > <CdtTrfTxInf> <PmtInf> (<CdtTrfTxInf> is a tag name corresponding to CreditTransferTransactionInformation) should not exist. Such constraints on the interrelationship between tags cannot be described by XML Schema.
このようなタグ及び/又はコンテンツ間の相互関係に関する制約を、多数のコアを用いて効率的に検証するには、次に示す技術課題がある。
(1)制約の記述方法について
そもそも、XML Schemaでは記述できないタグ及び/又はコンテンツ間の相互関係に関する制約を、どのように記述したら良いかという課題がある。
(2)タグ構造の高速な特定について
非特許文献3に記載された手法では、指定されたXPathの個数までしか、非特許文献4に記載された手法では、スキーマに記述されたタグ名の数までしか、処理を並列化できない。現在市販のGPUは数千個のコアを有しているが、従来技術では数十から数百程度の並列性しか実現できず、GPUの性能を十分に引き出していない。
(3)制約の検証に用いるタグの高速な検索について
従来の手法では、2つのタグが、タグ間の相対的な位置(Parent/Children,Ancesstor等)が指定された場合、2つのタグを効率的に取得することができない。
In order to efficiently verify such constraints on the interrelationship between tags and / or contents using a large number of cores, there are the following technical problems.
(1) Constraint Description Method In the first place, there is a problem of how to describe a constraint related to a mutual relationship between tags and / or contents that cannot be described in XML Schema.
(2) About fast identification of tag structure With the method described in
(3) High-speed search for tags used for constraint verification In the conventional method, when the relative position between two tags (Parent / Children, Anchors, etc.) is specified, the two tags are efficiently used. Cannot be acquired.
このように、従来の多数のコアを用いた半構造電文検証技術には、タグ及び/又はコンテンツ間の相互関係に関する制約の成立/不成立を効率的に検証できないという技術課題がある。 As described above, the conventional semi-structured electronic message verification technology using a large number of cores has a technical problem that it is not possible to efficiently verify the establishment / non-establishment of restrictions on the mutual relationship between tags and / or contents.
そこで、本発明者は、半構造電文内のタグ及び/又はコンテンツ間の相互関係に関する制約の検証処理を、可能な限り多数のコアを用いて並列的に実行するための仕組みを提供する。 Therefore, the present inventor provides a mechanism for executing verification processing of constraints on the mutual relation between tags and / or contents in a semi-structured message in parallel using as many cores as possible.
具体的には、検証対象とする半構造電文を受信する前に、シーケンス処理に優れた第1の演算装置(例えばCPU)が、(i)半構造電文のスキーマからタグ名を取得して文字列マッチングのためのタグ名の有限オートマトンを生成すると共に、(ii)並列処理に優れた第2の演算装置(例えばGPU)を使用して半構造電文の検証を並列的に実行するためのプログラムを、制約を記述した検証ファイルに基づいて生成する。 Specifically, before receiving the semi-structured electronic message to be verified, the first arithmetic device (for example, CPU) excellent in sequence processing acquires the tag name from the schema of the semi-structured electronic message (i) A program for generating a tag name finite automaton for column matching, and (ii) executing a semi-structured message verification in parallel using a second arithmetic unit (for example, GPU) excellent in parallel processing Is generated based on the verification file describing the constraints.
次に、半構造電文が受信されると、第1の演算装置が、前処理として、半構造電文内のタグ位置を特定する配列と共にそのタグ構造の木構造を生成する。 Next, when the semi-structured electronic message is received, the first arithmetic unit generates a tree structure of the tag structure together with an array for specifying the tag position in the semi-structured electronic message as preprocessing.
その後、前述の第2の演算装置を構成する各コアプロセッサが、事前に作成されたプログラムの並列実行を通じ、有限オートマトンに基づいてタグ名を特定し、事前に作成されたタグ構造の木構造を利用してタグ及び/又はコンテンツ間の相互関係に関する制約の検証対象となるタグ及び/又はコンテンツを取得し、取得されたタグ及び/又はコンテンツに基づいて半構造電文を検証する仕組みを提供する。 After that, each core processor constituting the second arithmetic unit described above identifies a tag name based on a finite automaton through parallel execution of a program created in advance, and creates a tree structure of the tag structure created in advance. Provided is a mechanism for acquiring a tag and / or content that is a target of verification of constraints on mutual relations between tags and / or content and verifying a semi-structured electronic message based on the acquired tag and / or content.
ここで、検証ファイルは、検証対象となるタグ及び/又はコンテンツを指定するLet句、全ての検証対象となるタグ及び/又はコンテンツが制約を満たすのかを指定するEvery句、制約を満たすタグ及び/又はコンテンツが存在するかを指定するSome句、満たすべき制約を指定するSatisfy句で記述したものであることが望ましい。 Here, the verification file includes a Let clause that specifies a tag and / or content to be verified, an Ever clause that specifies whether all tags and / or content to be verified satisfy a constraint, a tag that satisfies the constraint, and / or Alternatively, it is desirable that the content is described in a Some clause that specifies whether content exists or a Satify clause that specifies constraints to be satisfied.
本発明によれば、例えば以下に示す効果の少なくとも1つを実現することができる。
(1)XML Schemaでは記述できないタグ及び/又はコンテンツ間の相互関係に関する制約を記述した検証ファイルを提供することにより、結果として、相関のある制約を記述することができる。
(2)第1の演算装置による前処理において、半構造電文のタグ位置を予め特定しておくことにより、第2の演算装置を構成する各コアは、タグの位置からタグ名の文字列マッチングを行うことができる。このため、タグの数だけ処理を並列化できる。この結果、従来手法よりも高速な半構造電文の解析が可能となる。
(3)第1の演算装置による前処理において、半構造電文のタグ位置を特定する配列とタグ構造の木構造を生成し簡潔データ構造を用いて圧縮することにより、半構造電文のタグ構造の情報を、第2の演算装置を構成する多数のコアのローカルメモリに格納することができる。これにより、第2の演算装置は、半構造電文の制約を検証するために必要なタグ及び/又はコンテンツを高速に取得することができる。
According to the present invention, for example, at least one of the following effects can be realized.
(1) By providing a verification file that describes restrictions on the interrelationship between tags and / or contents that cannot be described in XML Schema, as a result, correlated restrictions can be described.
(2) In the pre-processing by the first arithmetic device, by specifying the tag position of the semi-structured message in advance, each core constituting the second arithmetic device can match the character string of the tag name from the tag position. It can be performed. For this reason, processing can be parallelized by the number of tags. As a result, it is possible to analyze a semi-structured electronic message faster than the conventional method.
(3) In the pre-processing by the first arithmetic unit, an array for identifying the tag position of the semi-structured message and a tree structure of the tag structure are generated and compressed using a simple data structure, so that the tag structure of the semi-structured message is Information can be stored in the local memory of a number of cores comprising the second arithmetic unit. Thereby, the 2nd arithmetic unit can acquire a tag and / or content required in order to verify the restriction | limiting of a semi-structure message | telegram at high speed.
このように、本発明によれば、タグ及び/又はコンテンツ間の相互関係に関する制約を、多数のコアを利用して、効率的に検証することができる。上記した以外の課題、構成及び効果は、以下の実施形態の説明により明らかにされる。 As described above, according to the present invention, it is possible to efficiently verify the constraints related to the interrelationship between the tags and / or the contents by using many cores. Problems, configurations, and effects other than those described above will be clarified by the following description of embodiments.
以下、図面に基づいて、本発明の実施の形態を説明する。なお、後述する装置構成や処理動作の内容は発明を説明するための一例である。本発明は、後述する装置構成同士や処理動作同士の任意の組み合わせ、後述する装置構成や処理動作に既知の技術を追加する組み合わせ、後述する装置構成や処理動作の一部を既知の技術で置換する組み合わせも包含する。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. Note that the contents of the apparatus configuration and processing operation described later are examples for explaining the invention. The present invention provides an arbitrary combination of device configurations and processing operations described later, a combination of adding a known technology to the device configuration and processing operations described later, and replacing a part of the device configuration and processing operations described later with known technologies. Combinations to include are also included.
(1)半構造電文検証システムの構成
図2に、半構造電文検証コンピュータ120を実装する半構造電文検証システムの構成例を示す。図2に示す半構造電文検証システムは、(1)決済等の半構造電文140を生成するクライアントコンピュータ100、(2)生成された半構造電文140を転送するインターネット110、(3)多数のコアを持つCPUやGPUを備え、受信した半構造電文140をCPUやGPUを用いて検証する半構造電文検証コンピュータ120、(4)半構造電文140の検証結果を受信する半構造電文管理コンピュータ130とで構成される。本実施例における半構造電文140は、ISO20022が規定している送金指示のCusutomerCreditTransferInitiationのXML電文(図1)であるものとする。
(1) Configuration of Semi-Structured Message Verification System FIG. 2 shows a configuration example of a semi-structured message verification system in which the semi-structured
図3に、半構造電文検証コンピュータ120の構成例を示す。半構造電文検証コンピュータ120は、コンピュータ本体300と、入力装置330と、表示装置331と、通信装置332とから構成される。なお、通信装置332は、半構造電文管理コンピュータ130とは直接通信し、クライアントコンピュータ100とはインターネット110を介して通信する。
FIG. 3 shows a configuration example of the semi-structured electronic
コンピュータ本体300は、CPU301、ROM302、CPU_RAM310、ハードディスク駆動装置320、多数のコアプロセッサ(PU341)を有するGPU340、これらデバイス間のデータ転送を実現するCPUバス308、これらデバイスとCPUバス308とを結合するインターフェース303〜307で構成される。
The computer
ここで、CPU301は、動作周波数とコアの処理能力が共に高い、シーケンス処理に優れた演算装置である。一方、GPU340は、動作周波数とコアの処理能力がCPU301よりも低いものの多数のコアを有し、並列処理に優れた演算装置である。
Here, the
CPU_RAM310には、CPU301で実行される半構造電文検証プログラム311の実行領域と、演算時に一時的に生成されるデータを格納する作業領域312が少なくとも確保される。
In the
ハードディスク駆動装置320の記憶領域には、プログラム格納部321とデータ格納部322が少なくとも確保される。このうち、プログラム格納部321には、CPU301で実行される半構造電文検証プログラム311と、GPU340で実行される並列半構造電文検証プログラム351が格納される。データ格納部322には、検証する半構造電文のXML Schema等のスキーマ、タグ及び/又はコンテンツ間の相互関係に関する制約を記述した検証ファイル、クライアントコンピュータ100から受信した半構造電文140が一時的に格納される。スキーマや検証ファイルは、例えば不図示の外部コンピュータから与えられる。
In the storage area of the
図4に、前述のPaymentTypeInformationRuleを記述した検証ファイルの例を示す。検証ファイルは、検証対象となるタグ及び/又はコンテンツをXPath等により指定するLet句401と、Let句401で指定されたタグ及び/又はコンテンツの全てが条件を満たすのか(Every)、条件を満たすものが存在するのか(Some)を指定するEvery/Some句402と、満たすべき条件を指定するSatisfy句403から構成される。
FIG. 4 shows an example of a verification file describing the above-described PaymentTypeInformationRule. The verification file includes a
この検証ファイルの例では、Let句401で指定されたPmtInfタグとCdtTrfTxInf/PmtInfタグを取得し、PmtInfタグが存在するならばCdTrfIxInf/PmtInfタグが一つも存在しないという条件を満たすか否かを検証することを意味している。
In this example of the verification file, the PmtInf tag and the CdtTrfTxInf / PmtInf tag specified by the
GPU340は、データ演算を実行させる数十から数千個の演算ユニットPU341と、全てのPU341からアクセス可能なGPU_GLOBAL_RAM350と、近接するPU341からのみアクセス可能なGPU_LOCAL_RAM360、これらのデバイス間のデータ転送を実現するGPUバス342で構成される。ここで、PU341とGPU_LOCAL_RAM360との間のデータ転送速度は、PU341とGPU_GLOBAL_RAM350との間のデータ転送速度に比べて非常に高速である。ただし、GPU_LOCAL_RAM360のサイズは数十KB程度であり、GPU_GLOBAL_RAM350のサイズ(数GB)と比べて非常に小さい。
The
GPU_GLOBAL_RAM350には、PU341に演算処理させる並列半構造電文検証プログラム351と、演算時に一時的に生成されるデータを格納する作業領域352が確保される。GPU_LOCAL_RAM360には、PU341の演算時に一時的に生成されるデータを格納する作業領域361が確保される。
In the
図5は、GPU_GLOBAL_RAM350及びGPU_LOCAL_RAM360の作業領域に少なくとも作成されるデータ領域の例を示している。GPU_GLOBAL_RAM350の作業領域352には、半構造電文のタグ名を文字列マッチングにより特定するためにタグ名の有限オートマトンの各ノードに対応した文字配列501、タグ名の有限オートマトンに対応したタグID配列502、半構造電文140の構造を保持しつつ不要文字を削除した半構造電文503、半構造電文内のタグ位置の配列504、半構造電文内のタグIDの配列505、さらに個々の検証結果を保持するための検証結果の配列506を確保する。
FIG. 5 shows an example of a data area created at least in the work area of the
GPU_LOCAL_RAM360の作業領域361には、タグ名の文字列マッチングのための有限オートマトン及び半構造電文140の構造が簡潔データ構造を用いて、タグ名の有限オートマトンのBP表現511と半構造電文内のタグ構造のBP表現512を保持する。ここで、簡潔データ構造を利用しているのは、GPU_LOCAL_RAM360の小さいメモリ容量で大量の構造を保持するためである。また、本実施形態では、簡潔データ構造としてBP表現(非特許文献6参照)を利用しているが、これ以外の簡潔データ構造を利用してもよい。
In the
(2)半構造電文の検証動作
図6に、半構造電文検証システム全体において実行される半構造電文検証プロセスの概略を示す。
(2) Semi-Structured Message Verification Operation FIG. 6 shows an outline of a semi-structured message verification process executed in the entire semi-structured message verification system.
(ステップ600)
半構造電文検証コンピュータ120は、電源が入れられると、半構造電文検証プログラム311を実行する。
(Step 600)
The semi-structured
(ステップ601)
半構造電文検証コンピュータ120は、CPU301を使用し、ハードディスク駆動装置320のデータ格納部322に格納されている半構造電文のスキーマ及び検証ファイルを取得し、CPU_RAM310の作業領域312に格納する。
(Step 601)
The semi-structured electronic
ここで、CPU301は、タグ名の文字列マッチングのための有限オートマトンをスキーマから生成すると共に、GPU340で検証処理を並列実行させるための並列半構造電文検証プログラムを検証ファイルから生成する。生成された有限オートマトンは、GPU340のGPU_GLOBAL_RAMの作業領域352とGPU_LOCAL_RAMの作業領域361に転送される。また、生成された並列半構造電文検証プログラムは、GPU_GLOBAL_RAM350の並列半構造電文検証プログラム351に転送される。このプログラムの処理内容の詳細は後述する。
Here, the
(ステップ602)
半構造電文検証コンピュータ120は、クライアントコンピュータ100から送信された半構造電文140を通信装置332を介して受信すると、これをCPU_RAM310の作業領域312に格納する。
(Step 602)
When the semi-structured electronic
(ステップ603)
半構造電文検証コンピュータ120は、通信装置332を介して受信した半構造電文140に対し、不要文字の削除やタグ構造の生成等の検証に必要な前処理を実行する。このとき、半構造電文検証コンピュータ120は、前処理で生成された不要文字を削除した半構造電文やタグ構造のデータを、GPU340内のGPU_GLOBAL_RAMの作業領域352及びGPU_LOCAL_RAMの作業領域361に転送する。これら前処理の詳細についても後述する。
(Step 603)
The semi-structured
(ステップ604)
半構造電文検証コンピュータ120は、GPU340の多数のPU341を利用して並列半構造電文検証プログラム351を実行し、検証ファイルに記述された内容の検証を半構造電文に対して行う。この並列検証処理の詳細については後述する。
(Step 604)
The semi-structured electronic
(ステップ605)
半構造電文検証コンピュータ120は、ステップ604で得られた検証結果を、通信装置332を介して半構造電文管理コンピュータ130に通知する。
(Step 605)
The semi-structured electronic
(3)初期化プロセスの詳細
図6の初期化プロセス601の詳細内容を、図7を用いて説明する。
(3) Details of Initialization Process Details of the
(ステップ701)
半構造電文検証コンピュータ120は、ハードディスク駆動装置320のデータ格納部322から半構造電文140のスキーマを取得し、CPU301を介して、タグ名を文字列マッチングするための有限オートマトンを作成する。
(Step 701)
The semi-structured
図8は、GPU340における処理に適したデータ構造を持つ有限オートマトンを、スキーマから生成する手順を説明する図である。まず、CPU301は、スキーマからタグ名801を抽出する。ここでは、3つのタグ名「AB、BC、ACD」が得られる。次に、CPU301は、この3つのタグ名から有限オートマトン802を作成する。有限オートマトン802のリーフEndはアルファベット以外の文字が来ることを意味している。
FIG. 8 is a diagram illustrating a procedure for generating a finite automaton having a data structure suitable for processing in the
このタグ名の文字列マッチングのための有限オートマトン802の木構造をBP表現で表すと803のようになる。BP表現803において、「(」をビット0、「)」をビット1に置換したビット列を「タグ名の有限オートマトンのBP表現511」とする。このとき、タグ名の有限オートマトンのBP表現511のビット列の対応するノードの順番に従い作成した、有限オートマトン802の各ノードの文字の配列を「タグ名の有限オートマトンに対応した文字配列501」とする。さらに、タグ名の有限オートマトンのBP表現511のビット列の対応するノードの順番に従い、(End)ノードの順番の位置にそのタグのIDを格納した「タグ名の有限オートマトンに対応したタグID配列502」を生成する。
A tree structure of the
このように、タグ名の有限オートマトン802の構造をBP表現で表したことで、半構造電文をメモリ容量の小さいGPU_LOCAL_RAM360の作業領域361にも格納できるようになり、各PU341が高速にタグ名の文字列マッチングが行えるようになる。
Thus, by representing the structure of the
(ステップ702)
半構造電文検証コンピュータ120は、ハードディスク駆動装置320のデータ格納部322に格納された検証ファイルを取得し、CPU301を介して、GPU340の多数のPU341で並列に検証するための並列半構造電文検証プログラムを作成する。この並列半構造電文検証プログラムの内容については後述する。
(Step 702)
The semi-structured electronic
(ステップ703)
半構造電文検証コンピュータ120は、CPU301を通じ、ステップ701で作成したタグ名の有限オートマトンのデータを、図5に従いGPU_GLOBAL_RAM350及びGPU_LOCAL_RAM360の作業領域に格納する。また、半構造電文検証コンピュータ120は、CPU301を通じ、ステップ702で作成した並列半構造電文検証プログラム351を、GPU_GLOBAL_RAM350のデータ領域に格納する。
(Step 703)
The semi-structured electronic
(4)半構造電文検証前処理プロセスの詳細
図6の半構造電文検証前処理プロセス603の詳細について、図9を用いて説明する。
(4) Details of Semi-Structured Message Verification Pre-Processing Process Details of the semi-structured message
(ステップ901)
半構造電文検証コンピュータ120は、CPU301を用い、CPU_RAMの作業領域312に格納されている受信した半構造電文140から、タブやスペースや改行等の不要文字を削除する。これは、後述の処理においてタグ名の文字列マッチングを実行する際に誤ったマッチングを回避するためと、後述するステップ903において、CPU_RAMの作業領域312にある半構造電文140をGPU_GLOBAL_RAMの作業領域352に転送する際に、転送量を削減し、転送時間及びGPU_GLOBAL_RAMの作業領域352で使用するメモリサイズを削減するためである。
(Step 901)
The semi-structured electronic
図10に不要文字を削除した例を示す。受信した半構造電文140からタブ、スペース、改行文字が削除され、不要文字を削除した半構造電文503が生成されている。
FIG. 10 shows an example in which unnecessary characters are deleted. Tabs, spaces, and line feed characters are deleted from the received
(ステップ902)
半構造電文検証コンピュータ120は、CPU301を用い、ステップ901で作成した不要文字を削除した半構造電文503からタグ構造を生成する。
(Step 902)
The semi-structured electronic
図10に、タグ構造を生成する具体例を示す。半構造電文検証コンピュータ120は、不要文字を削除した半構造電文503において、「<」をビット0に、「</」及び「/>」をビット1に置き換え、それ以外の文字は無視したビット列(半構造電文内のタグ構造のBP表現512)を生成する。また、半構造電文検証コンピュータ120は、「<」、「</」、「/>」に対応したタグ名の位置の配列(半構造電文内のタグ位置の配列504)も同時に生成する。ただし、あくまで「<」、「</」、「/>」をビットに置換えただけで、タグ名自身は特定していない。
FIG. 10 shows a specific example of generating a tag structure. The semi-structured
このように、前処理として逐次処理を得意とするCPU301を介してタグの構造と位置を特定しておくことで、後の処理で多数のPU341を介して並列検証を効率的に行うことができる。タグ名の位置を特定しておくことで、各PU341がタグ名と関係無い位置から文字列マッチングを開始することを回避できる。並列処理では構築が困難なタグ構造を特定しておくことで、検証に必要な親ノードや子ノードを容易に見つけることができる。特にタグ構造は簡潔データ構造を利用して、GPU_LOCAL_RAM360のメモリ容量の小さい領域に格納することで高速な親ノードや子ノードの検索が可能となる。
In this way, by identifying the tag structure and position via the
(ステップ903)
半構造電文検証コンピュータ120は、ステップ901で生成した不要文字を削除した半構造電文503をGPU_GLOBAL_RAMの作業領域352に転送する。さらに、半構造電文検証コンピュータ120は、ステップ902で生成した半構造電文内のタグ構造のBP表現512をGPU_LOCAL_RAMの作業領域361に、半構造電文内のタグ位置の配列504を、GPU_GLOBAL_RAMの作業領域352に格納する。
(Step 903)
The semi-structured electronic
(5)半構造電文検証プロセスの詳細
図6の半構造電文検証プロセス604の詳細を、図11を用いて説明する。まず、半構造電文検証コンピュータ120は、GPU_GLOBAL_RAM350の並列半構造電文検証プログラム351を各PU341で実行させる。以下、各PU341の処理について説明する。
(5) Details of Semi-Structured Message Verification Process Details of the semi-structured
(ステップ1101)
半構造電文検証コンピュータ120は、各PU341が順番に一意に自身に割り当てられたスレッドIDを取得する。
(Step 1101)
The semi-structured electronic
(ステップ1102)
半構造電文検証コンピュータ120は、各PU341が、GPU_GLOBAL_RAMの作業領域352に格納された半構造電文内のタグ位置の配列504から、ステップ1101で取得したスレッドIDに対応するタグ位置を取得する。
(Step 1102)
In the semi-structured electronic
(ステップ1103)
半構造電文検証コンピュータ120は、各PU341にタグの文字列マッチングを行わせる。各PU341は、ステップ1102で取得したタグ位置を始点として、タグ名の有限オートマトンのBP表現511とタグ名の有限オートマトンに対応した文字配列501を参照してタグ名の文字列マッチングを行い、タグ名を特定する。さらに、半構造電文検証コンピュータ120は、有限オートマトンにより特定したタグ名に基づいて、タグ名の有限オートマトンの対応したタグID配列502からタグIDを取得する。また、半構造電文検証コンピュータ120は、半構造電文内のタグ構造のBP表現512を参照し、スレッドIDの番号に対応するビットが0の場合は取得したタグIDの符号を「+」に、ビットが1の場合はタグIDの符号を「−」にして、半構造電文内のタグIDの配列505においてスレッドIDの番号に対応する位置に、この符号付きタグIDを格納する。
(Step 1103)
The semi-structured electronic
(ステップ1104)
半構造電文検証コンピュータ120は、各PU341間の同期をとる。
(Step 1104)
The semi-structured electronic
(ステップ1105)
半構造電文検証コンピュータ120は、PU341を利用して、半構造電文内のタグIDの配列505の総和を求める。もし総和が0になっていれば、開始タグと終了タグが対応していることがわかる。
(Step 1105)
The semi-structured
(ステップ1106)
半構造電文検証コンピュータ120は、各PU341が検証ファイルのLet句401で指定されたタグ及び/又はコンテンツを、不要文字を削除した半構造電文503から取得する。
(Step 1106)
The semi-structured
ここでは、図4に例示した検証ファイルの場合を考える。各PU341は、半構造電文内のタグIDの配列505から自身のスレッドIDの番号の値を取得する。各PU341は、この取得した値がPmtInfのタグIDと一致している場合は、半構造電文内のタグ構造のBP表現512を利用して、親ノードのタグIDを取得する。この親ノードのタグIDが「document」のタグIDと一致するならば、各PU341は、GPU_GLOBAL_RAMの作業領域352に確保した変数$aの配列内のスレッドIDに対応する番号の位置に存在することを意味するビット1を設定する。親ノードのタグIDが「CdtTrfTxInf」のタグIDと一致するならば、各PU341は、GPU_GLOBAL_RAMの作業領域352に確保した変数$bの配列内のPU341のスレッドIDに対応する番号の位置に存在することを意味するビット1を設定する。
Here, the case of the verification file illustrated in FIG. 4 is considered. Each
(ステップ1107)
半構造電文検証コンピュータ120は、各PU341間の同期をとる。
(Step 1107)
The semi-structured electronic
(ステップ1108)
半構造電文検証コンピュータ120は、各PU341が、ステップ1106で取得した結果を用いて検証ファイルのSatisfy句403を評価する。半構造電文検証コンピュータ120は、評価結果がTrueの場合はビット1を、Falseの場合はビット0を、検証結果の配列506のスレッドIDの番号の位置に格納する。
(Step 1108)
The semi-structured electronic
(ステップ1109)
半構造電文検証コンピュータ120は、各PU341間の同期をとる。
(Step 1109)
The semi-structured electronic
(ステップ1110)
半構造電文検証コンピュータ120は、PU341を利用して検証結果の配列506を集計し、その後、検証結果をまとめて結果をCPU_RAMの作業領域312に転送する。検証ファイルのEvery/Some句402において、Everyが指定されている場合は、検証結果の配列506が全てビット1(True)であること、Someが指定されている場合は、検証結果の配列506にビット1(True)が存在しているならば、検証ファイルで指定された制約を半構造電文140は満たしていることになる。
(Step 1110)
The semi-structured electronic
(6)実施例の効果
(i)本実施例によれば、検証対象となるタグ及び/又はコンテンツを指定するLet句401、全ての検証対象となるタグ及び/又はコンテンツが制約を満たすのかを指定するEvery句/制約を満たすタグ及び/又はコンテンツが存在するかを指定するSome句402、満たすべき制約を指定するSatisfy句403を記述可能な検証ファイルを提供することができる。これにより、タグ及び/又はコンテンツ間の相互関係に関する制約を記述することができる。
(ii)本実施例に係る半構造電文検証コンピュータ120では、CPU301による前処理において、半構造電文のタグ位置を予め特定しておくことにより、GPU340を構成する各PU341は、タグの位置からタグ名の文字列マッチングを行うことができる。このため、タグの数だけ処理を並列化できる。この結果、従来手法よりも高速な半構造電文の解析が可能となる。
(iii)本実施例に係る半構造電文検証コンピュータ120では、CPU301による前処理において、半構造電文のタグ構造を予め特定し、更に簡潔データ構造を利用してタグ構造を圧縮し、GPU340を構成する多数のPU341のローカルメモリに格納しておくことにより、相互関係に関する制約を検証するためのタグ及び/又はコンテンツを高速に取得することができる。
(6) Effects of the embodiment
(i) According to the present embodiment, the
(ii) In the semi-structured electronic
(iii) In the semi-structured
このように、本実施例に係る半構造電文検証コンピュータ120によれば、タグ及び/又はコンテンツ間の相互関係に関する制約を、多数のPU341を利用して、効率的に検証することができる。
As described above, according to the semi-structured electronic
なお、本発明は上述した実施例に限定されるものでなく、様々な変形例が含まれる。例えば、上述した実施例は、本発明を分かりやすく説明するために詳細に説明したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、実施例の一部を他の構成を追加、削除又は置換することも可能である。例えば半構造電文検証コンピュータ120と半構造電文管理コンピュータ130は同一のコンピュータ上に形成しても良い。
In addition, this invention is not limited to the Example mentioned above, Various modifications are included. For example, the above-described embodiments have been described in detail for easy understanding of the present invention, and are not necessarily limited to those having all the configurations described. Moreover, it is also possible to add, delete, or replace a part of the embodiment with another configuration. For example, the semi-structured
また、上述した各構成、機能、処理部、処理手段等は、それらの一部又は全部を、例えば集積回路その他のハードウェアとして実現しても良い。また、上記の各構成、機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することにより実現しても良い。すなわち、ソフトウェアとして実現しても良い。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリやハードディスク、SSD(Solid State Drive)等の記憶装置、ICカード、SDカード、DVD等の記憶媒体に格納することができる。 Moreover, you may implement | achieve some or all of each structure, a function, a process part, a process means, etc. which were mentioned above as an integrated circuit or other hardware, for example. Each of the above-described configurations, functions, and the like may be realized by the processor interpreting and executing a program that realizes each function. That is, it may be realized as software. Information such as programs, tables, and files for realizing each function can be stored in a memory, a hard disk, a storage device such as an SSD (Solid State Drive), or a storage medium such as an IC card, an SD card, or a DVD.
また、制御線や情報線は、説明上必要と考えられるものを示すものであり、製品上必要な全ての制御線や情報線を表すものでない。実際にはほとんど全ての構成が相互に接続されていると考えて良い。 Control lines and information lines indicate what is considered necessary for the description, and do not represent all control lines and information lines necessary for the product. In practice, it can be considered that almost all components are connected to each other.
100…クライアントコンピュータ
110…インターネット
120…半構造電文検証コンピュータ
130…半構造電文管理コンピュータ
301…CPU
340…GPU
350…GPU_GLOBAL_RAM
360…GPU_LOCAL_RAM
DESCRIPTION OF
340 ... GPU
350 ... GPU_GLOBAL_RAM
360 ... GPU_LOCAL_RAM
Claims (5)
並列処理を実行する第2の演算装置に半構造電文の検証処理を並列的に実行させるためのプログラムを、前記第1の演算装置が、タグ及び/又はコンテンツ間の相互関係に関する制約を記述した検証ファイルに基づいて生成する第2の処理と、
半構造電文を受信した前記第1の演算装置が、前処理として、半構造電文内のタグ位置を特定する配列及び半構造電文のタグ構造を特定する配列を生成する第3の処理と、
前記第2の演算装置を構成する各コアプロセッサが前記プログラムの並列実行を通じ、前記有限オートマトンに基づいてタグ名を特定し、前記タグ構造を特定する配列を利用してタグ及び/又はコンテンツ間の相互関係に関する制約の検証対象となるタグ及び/又はコンテンツを半構造電文から取得し、取得されたタグ及び/又はコンテンツに基づいて半構造電文を検証する第4の処理と、
前記第1の演算装置が、前記検証の結果を出力する第5の処理と
を有する半構造電文の並列検証方法。 A first processing unit that executes sequence processing , obtains a tag name from the schema of the semi-structured message, and generates a tag name finite automaton for character string matching;
A program for causing a second arithmetic device that executes parallel processing to execute verification processing of a semi-structured message in parallel, the first arithmetic device describes restrictions on the interrelationship between tags and / or contents A second process generated based on the verification file;
The first processing unit that has received the semi-structured message generates, as pre-processing, a third process for generating an array for specifying the tag position in the semi-structured message and an array for specifying the tag structure of the semi-structured message;
Each core processor constituting the second arithmetic unit specifies a tag name based on the finite automaton through parallel execution of the program, and uses tags and / or content between the tags using an array that specifies the tag structure. A fourth process of acquiring a tag and / or content subject to verification of constraints relating to interrelationships from a semi-structured message, and verifying the semi-structured message based on the acquired tag and / or content;
A parallel verification method for semi-structured electronic statements, wherein the first arithmetic unit includes a fifth process for outputting the verification result.
前記第1の処理で生成された前記有限オートマトン及び前記第3の処理で生成されたタグ構造を特定する配列を、前記第1の演算装置が簡潔データ表現を利用して圧縮し、前記コアプロセッサに隣接するローカルメモリ上に格納する
ことを特徴とする半構造電文の並列検証方法。 In the parallel verification method of the semi-structure message according to claim 1,
The core processor compresses the array that specifies the finite automaton generated in the first process and the tag structure generated in the third process using a concise data representation, and the core processor A parallel verification method for semi-structured messages, which is stored in a local memory adjacent to the.
前記検証ファイルは、検証対象のタグ及び/又はコンテンツを指定するLet句と、対象となるタグ及び/又はコンテンツが全て条件を満たすか/条件を満たすものがあるかを指定するEvery/Some句と、満たすべき条件を指定するSatisfy句とを有する
ことを特徴とする半構造電文の並列検証方法。 In the parallel verification method of the semi-structure message according to claim 1,
The verification file includes a Let clause that specifies a tag and / or content to be verified, and an Every / Some clause that specifies whether all of the target tags and / or content satisfy a condition or satisfy a condition. And a Satify clause that specifies a condition to be satisfied.
半構造電文のスキーマからタグ名を取得し、文字列マッチングのためのタグ名の有限オートマトンを生成させる第1の処理と、
コンピュータを構成する、並列処理を実行する第2の演算装置に半構造電文の検証処理を並列的に実行させるためのプログラムを、タグ及び/又はコンテンツ間の相互関係に関する制約を記述した検証ファイルに基づいて生成させる第2の処理と、
半構造電文を受信した場合に、前処理として、半構造電文内のタグ位置を特定する配列及び半構造電文のタグ構造を特定する配列を生成させる第3の処理とを実行させ、
前記第2の演算装置を構成する各コアプロセッサに、
前記プログラムの並列実行を通じ、前記有限オートマトンに基づいてタグ名を特定させる処理、前記タグ構造を特定する配列を利用してタグ及び/又はコンテンツ間の相互関係に関する制約の検証対象となるタグ及び/又はコンテンツを半構造電文から取得する処理、取得されたタグ及び/又はコンテンツに基づいて半構造電文を検証させる第4の処理を実行させ、
前記第1の演算装置に、
前記検証の結果を出力させる第5の処理を実行させる
プログラム。 In the first arithmetic unit that executes the sequence processing that constitutes the computer,
A first process for obtaining a tag name from the schema of the semi-structured message and generating a finite automaton of the tag name for character string matching;
A program for causing a second computing device that executes parallel processing to execute verification processing of a semi-structured message in parallel in a computer, in a verification file that describes restrictions on the mutual relationship between tags and / or contents A second process to be generated based on:
When a semi-structured message is received, as pre-processing, an array for specifying the tag position in the semi-structured message and a third process for generating an array for specifying the tag structure of the semi-structured message are executed,
For each core processor constituting the second arithmetic unit,
Processing for specifying a tag name based on the finite automaton through parallel execution of the program, a tag and / or a target of verification of constraints on a mutual relationship between tags and / or contents using an array for specifying the tag structure Alternatively, a process for acquiring content from the semi-structured message, a fourth process for verifying the semi-structured message based on the acquired tag and / or content,
In the first arithmetic unit,
A program for executing a fifth process for outputting the result of the verification.
並列処理を実行する第2の演算装置に半構造電文の検証処理を並列的に実行させるためのプログラムを、前記第1の演算装置が、タグ及び/又はコンテンツ間の相互関係に関する制約を記述した検証ファイルに基づいて生成する第2の処理部と、
半構造電文を受信した前記第1の演算装置が、前処理として、半構造電文内のタグ位置を特定する配列及び半構造電文のタグ構造を特定する配列を生成する第3の処理部と、
前記第2の演算装置を構成する各コアプロセッサが前記プログラムの並列実行を通じ、前記有限オートマトンに基づいてタグ名を特定し、前記タグ構造を特定する配列を利用してタグ及び/又はコンテンツ間の相互関係に関する制約の検証対象となるタグ及び/又はコンテンツを半構造電文から取得し、取得されたタグ及び/又はコンテンツに基づいて半構造電文を検証する第4の処理部と、
前記第1の演算装置が、前記検証の結果を出力する第5の処理部と
を有する半構造電文の並列検証装置。 A first processing unit that executes sequence processing , obtains a tag name from the schema of the semi-structured electronic message, and generates a tag name finite automaton for character string matching;
A program for causing a second arithmetic device that executes parallel processing to execute verification processing of a semi-structured message in parallel, the first arithmetic device describes restrictions on the interrelationship between tags and / or contents A second processing unit that generates based on the verification file;
The first processing unit that has received the semi-structured message generates, as preprocessing, a third processing unit that generates an array for specifying the tag position in the semi-structured message and an array for specifying the tag structure of the semi-structured message;
Each core processor constituting the second arithmetic unit specifies a tag name based on the finite automaton through parallel execution of the program, and uses tags and / or content between the tags using an array that specifies the tag structure. A fourth processing unit that acquires a tag and / or content subject to verification of a constraint on a mutual relationship from a semi-structured message, and verifies the semi-structured message based on the acquired tag and / or content;
The parallel verification device for a semi-structured electronic statement, wherein the first arithmetic device includes a fifth processing unit that outputs the verification result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012206472A JP5879235B2 (en) | 2012-09-20 | 2012-09-20 | Method, apparatus and program for parallel verification of semi-structured messages |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012206472A JP5879235B2 (en) | 2012-09-20 | 2012-09-20 | Method, apparatus and program for parallel verification of semi-structured messages |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014063244A JP2014063244A (en) | 2014-04-10 |
JP5879235B2 true JP5879235B2 (en) | 2016-03-08 |
Family
ID=50618453
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012206472A Active JP5879235B2 (en) | 2012-09-20 | 2012-09-20 | Method, apparatus and program for parallel verification of semi-structured messages |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5879235B2 (en) |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP4220573B2 (en) * | 2002-02-28 | 2009-02-04 | 株式会社京三製作所 | Railway signal system database verification method |
-
2012
- 2012-09-20 JP JP2012206472A patent/JP5879235B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2014063244A (en) | 2014-04-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10942708B2 (en) | Generating web API specification from online documentation | |
US9171182B2 (en) | Dynamic data masking | |
US10122380B2 (en) | Compression of javascript object notation data using structure information | |
Brown et al. | Implementation patterns for microservices architectures | |
US9009173B2 (en) | Using views of subsets of nodes of a schema to generate data transformation jobs to transform input files in first data formats to output files in second data formats | |
US7984373B2 (en) | EDI instance based transaction set definition | |
JP5689361B2 (en) | Method, program, and system for converting a part of graph data into a data structure that is an image of a homomorphic map | |
US8650207B2 (en) | Inductive synthesis of table-based string transformations | |
US8972936B2 (en) | Version labeling in a version control system | |
US20160306852A1 (en) | Answering natural language table queries through semantic table representation | |
US10223550B2 (en) | Generating canonical representations of JSON documents | |
JP2011159302A (en) | Xml payload specification for modeling edi schema | |
US20170300305A1 (en) | Executable guidance experiences based on implicitly generated guidance models | |
CN105589959A (en) | Form processing method and form processing system | |
CN112671734B (en) | Message processing method for multiple data sources and related equipment thereof | |
US9305032B2 (en) | Framework for generating programs to process beacons | |
CN110109983B (en) | Method and device for operating Redis database | |
US10956659B1 (en) | System for generating templates from webpages | |
US8607201B2 (en) | Augmenting visualization of a call stack | |
JP5879235B2 (en) | Method, apparatus and program for parallel verification of semi-structured messages | |
US11797277B2 (en) | Neural network model conversion method server, and storage medium | |
KR20080100344A (en) | Scalable algorithm for sharing edi schemas | |
CN105389295A (en) | Data processing method and system for card personalization | |
US20160171018A1 (en) | Append structured data system for maintaining structured format compatibility | |
KR102265304B1 (en) | Device and Method for Modeling Ontology |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150126 |
|
A711 | Notification of change in applicant |
Free format text: JAPANESE INTERMEDIATE CODE: A712 Effective date: 20150827 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20151106 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20151117 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20151207 |
|
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: 20160105 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160201 |
|
R151 | Written notification of patent or utility model registration |
Ref document number: 5879235 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |