JP2015045897A - Gateway device, communication method using gateway device, and communication program used for gateway device - Google Patents

Gateway device, communication method using gateway device, and communication program used for gateway device Download PDF

Info

Publication number
JP2015045897A
JP2015045897A JP2013175103A JP2013175103A JP2015045897A JP 2015045897 A JP2015045897 A JP 2015045897A JP 2013175103 A JP2013175103 A JP 2013175103A JP 2013175103 A JP2013175103 A JP 2013175103A JP 2015045897 A JP2015045897 A JP 2015045897A
Authority
JP
Japan
Prior art keywords
data
websocket
communication
gateway device
web service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2013175103A
Other languages
Japanese (ja)
Inventor
剛志 渡邉
Tsuyoshi Watanabe
剛志 渡邉
川戸 正裕
Masahiro Kawato
正裕 川戸
英明 谷
Hideaki Tani
英明 谷
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.)
NEC Corp
Original Assignee
NEC Corp
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 NEC Corp filed Critical NEC Corp
Priority to JP2013175103A priority Critical patent/JP2015045897A/en
Publication of JP2015045897A publication Critical patent/JP2015045897A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

PROBLEM TO BE SOLVED: To enable WebSocket communication by a request from a client application even when using a Web service incompatible with WebSocket.SOLUTION: A gateway device which mediates between WebSocket communication and communication that uses a protocol other than WebSocket includes: first communication means that uses WebSocket; second communication means that uses a second protocol different from WebSocket; and data conversion means provided between the first communication means and second communication means, which mutually converts first data in a WebSocket format and second data in a second protocol format and associates the first data and second data. A client can use a Web service incompatible with WebSocket while using WebSocket.

Description

本発明は、ゲートウェイ装置に関し、特にWebSocketを用いるゲートウェイ装置に関する。   The present invention relates to a gateway device, and more particularly to a gateway device using WebSocket.

サービス指向アーキテクチャ(Service Oriented Architecture:SOA)は、標準的なインターフェースを持った再利用可能なソフトウェア部品の組合せによってシステムを構成するというコンピュータシステムの作り方である。このようなソフトウェア部品の代表例はWebサービスである。   Service Oriented Architecture (SOA) is a method of creating a computer system in which a system is configured by a combination of reusable software components having a standard interface. A typical example of such a software component is a web service.

これまでの一般的なWebアプリケーションでは、Webサービスの組合せは、ネットワーク上に配備されたアプリケーションサーバが担当し、クライアント(主にWebブラウザ)はアプリケーションサーバが行った処理の結果を表示する機能を担っていた。   In conventional general Web applications, the combination of Web services is handled by the application server deployed on the network, and the client (mainly Web browser) is responsible for displaying the results of processing performed by the application server. It was.

しかしながら、AjaxやCometのような近年のHTML技術の発展により、WebブラウザはHTML表示にとどまらず、クライアントサイドで様々な処理を実施するクライアントアプリケーションとしての利用が可能になってきている。これにより、アプリケーションサーバが存在していなくとも、クライアントアプリケーション上におけるWebサービスの組合せによって、アクセスしたのと同等の機能を実現することも可能である。   However, with the recent development of HTML technologies such as Ajax and Comet, Web browsers are not limited to HTML display, but can be used as client applications that perform various processes on the client side. As a result, even if there is no application server, it is possible to realize a function equivalent to that accessed by a combination of Web services on the client application.

さらに多様な機能を実現するためには、通常の同期通信だけでなく、サーバからクライアントへのデータのプッシュと、非同期通信ができることが望ましい。ところが、Ajaxアプリケーションでは、サーバとクライアント間のデータのやり取りが頻繁に発生するが、あくまでブラウザ側からサーバにデータの送信リクエストを出す手段であり、サーバ側からクライアントにデータをプッシュ配信することが難しい。またCometでは、サーバ側からのプッシュ配信が可能なものの、HTTPコネクションを長時間占有するため、同一サーバに接続する他のアプリケーションの動作に影響を及ぼす可能性がある。この問題はクライアントの数が増えるとさらに深刻になる。   In order to realize various functions, it is desirable that not only normal synchronous communication but also data push from the server to the client and asynchronous communication can be performed. However, in the Ajax application, data is frequently exchanged between the server and the client. However, it is only a means for issuing a data transmission request from the browser side to the server, and it is difficult to push the data from the server side to the client. . In Comet, although push distribution from the server side is possible, it occupies the HTTP connection for a long time, which may affect the operation of other applications connected to the same server. This problem becomes more serious as the number of clients increases.

これらの課題を解決する技術としてWebSocketが考案された。HTTPでは、接続の確立→リクエスト送信→レスポンス受信→切断といったプロセスを繰り返し行う必要があるのに対し、WebSocketでは接続の確立は1回だけでよい。また、接続、切断等のHTTPヘッダが不要になるため、トラフィックを抑えられる。そして、コネクションを確立した後は、非同期で双方向の通信を行うことが出来る。すなわちサーバからクライアントへのデータのプッシュも可能である。   WebSocket has been devised as a technique for solving these problems. In HTTP, it is necessary to repeat the process of establishing a connection → sending a request → receiving a response → disconnecting, whereas in WebSocket, the connection needs to be established only once. Further, since an HTTP header such as connection and disconnection is unnecessary, traffic can be suppressed. Then, after establishing the connection, asynchronous two-way communication can be performed. In other words, data can be pushed from the server to the client.

このようなWebSocketの特性を利用することで、通信の負荷を軽減しリアルタイムで情報をプッシュする技術が種々検討されている。   Various techniques for reducing the communication load and pushing information in real time by using such WebSocket characteristics have been studied.

例えば、特許文献1には、クライアントとサーバの間にWebSocketコネクションを張ることで、多数のクライアントが同時に参加するオークションシステムを構築する方法が提案されている。このオークションシステムでは、クライアントがサーバとWebSocketコネクションを確立し、クライアントから一度情報の送信リクエストを出しておけば、以降は入札価格の更新等があるたびに、サーバからクライアントに情報がプッシュ送信される。このシステムでは通信の負荷が非常に軽いため、能力の低いサーバでも用いることができ、クライアントの数が増えても、タイムラグのないリアルタイム通信を実現することができる。   For example, Patent Document 1 proposes a method for constructing an auction system in which a large number of clients participate simultaneously by establishing a WebSocket connection between a client and a server. In this auction system, once a client establishes a WebSocket connection with a server and issues a request for sending information once from the client, information is pushed from the server to the client every time a bid price is updated. . Since this system has a very light communication load, it can be used even with a server with low capability, and real-time communication without a time lag can be realized even if the number of clients increases.

特開2013−20407号公報JP 2013-20407 A

しかし、特許文献1の技術は、サーバがWebSocketに対応していることが前提となっており、既にサービスが提供されている多くのWebSocket非対応サーバには適用することが出来ないという問題点がある。   However, the technique of Patent Document 1 is based on the premise that the server is compatible with WebSocket, and cannot be applied to many WebSocket non-compliant servers for which services are already provided. is there.

すなわち、WebSocket非対応のサーバとクライアント間の通信において、HTTP等による同期型Webサービスは利用可能であるが、非同期型Webサービスは利用することが出来ない。   That is, in communication between a server not supporting WebSocket and a client, a synchronous web service using HTTP or the like can be used, but an asynchronous web service cannot be used.

またHTTPを用いた非同期型Webサービスを利用するためには、クライアントにHTTPサーバ機能が必要であるが、一般的には、HTTPサーバ機能は、クライアントアプリケーションに組み込むことが出来ないという問題がある。   In addition, in order to use an asynchronous Web service using HTTP, an HTTP server function is required for a client, but generally, there is a problem that the HTTP server function cannot be incorporated into a client application.

本発明の目的は、上記の課題に鑑みて成されたものであり、WebSocket非対応のサーバとクライアント間においても、クライアントアプリケーションからのリクエストによる非同期型通信の利用を可能とすることである。   An object of the present invention is made in view of the above problems, and is to enable the use of asynchronous communication based on a request from a client application even between a server and a client not supporting WebSocket.

上記の課題を解決するために、本発明のゲートウェイ装置は、WebSocketにより通信を行う第1の通信手段と、WebSocketとは異なるプロトコルにより通信を行う第2の通信手段と、前記第1の通信手段からから受信したWebSocket形式の第1のデータをWebSocketとは異なる第2のプロトコル形式の第2のデータに変換し前記第2の通信手段から受信した前記第2のデータを前記第1のデータに変換するとともに前記第1のデータと前記第2のデータとを紐付けするデータ変換部と、を有する。   In order to solve the above-described problems, the gateway device of the present invention includes a first communication unit that performs communication using WebSocket, a second communication unit that performs communication using a protocol different from WebSocket, and the first communication unit. The first data in the WebSocket format received from is converted into the second data in the second protocol format different from the WebSocket, and the second data received from the second communication means is converted to the first data. A data conversion unit for converting and associating the first data and the second data.

本発明によるゲートウェイ装置では、WebSocketを用いて、WebSocketとは異なるプロトコルによるWebサービスを利用することができる。   The gateway device according to the present invention can use a Web service based on a protocol different from WebSocket by using WebSocket.

本発明第1の実施の形態のゲートウェイ装置のブロック図である。It is a block diagram of the gateway apparatus of the 1st Embodiment of this invention. 本発明第1の実施の形態の動作を示すシーケンス図である。It is a sequence diagram which shows the operation | movement of the 1st Embodiment of this invention. 本発明第1の実施の形態のゲートウェイ装置のリクエスト送信動作を示すフローチャートである。It is a flowchart which shows the request transmission operation | movement of the gateway apparatus of the 1st Embodiment of this invention. 本発明第1の実施の形態のWebSocketデータフォーマットの一例である。It is an example of the WebSocket data format of the first embodiment of the present invention. 本発明第1の実施の形態の紐付け情報の一例である。It is an example of the tied information of the 1st Embodiment of this invention. 本発明第1の実施の形態のレスポンスデータ形式の一例である。It is an example of the response data format of the 1st Embodiment of this invention. 本発明第1の実施の形態のデータ変換の一例である。It is an example of the data conversion of the 1st Embodiment of this invention. 本発明第1のレスポンス受信動作を示すフローチャートである。It is a flowchart which shows the 1st response reception operation | movement of this invention. 本発明第2の実施の形態を示すブロック図である。It is a block diagram which shows the 2nd Embodiment of this invention.

本実施の形態のゲートウェイ装置は、WebSocketによる非同期型双方向通信と、WebSocketとは異なる他の通信プロトコルを用いた通信とを仲介するものである。以下、図面を参照しながら本発明について詳細に説明する。
(第1の実施の形態)
図1は、本発明第1の実施の形態のゲートウェイ装置を示す構成図である。
The gateway device according to the present embodiment mediates asynchronous two-way communication using WebSocket and communication using another communication protocol different from WebSocket. Hereinafter, the present invention will be described in detail with reference to the drawings.
(First embodiment)
FIG. 1 is a configuration diagram illustrating a gateway device according to the first embodiment of this invention.

ゲートウェイ装置100は、WebSocket通信部1、WebSocketデータ解析部2、変換シナリオ部3、Webサービスデータ生成部4、Webサービス通信部5、Webサービスデータ解析部6、紐付け情報保持部7、シナリオ保持部8、WebSocketデータ生成部9を有する。   The gateway device 100 includes a WebSocket communication unit 1, a WebSocket data analysis unit 2, a conversion scenario unit 3, a Web service data generation unit 4, a Web service communication unit 5, a Web service data analysis unit 6, a linking information holding unit 7, and a scenario holding Unit 8 and WebSocket data generation unit 9.

WebSocket通信部1は、クライアントとの間でWebSocketのコネクションを確立し、クライアントから受信したデータをWebSocketデータ解析部2へ出力する。また、WebSocketデータ生成部9から入力されたデータをクライアントに対し送信する。   The WebSocket communication unit 1 establishes a WebSocket connection with the client, and outputs data received from the client to the WebSocket data analysis unit 2. In addition, data input from the WebSocket data generation unit 9 is transmitted to the client.

WebSocketデータ解析部2は、入力されたデータを解析し、各種パラメータを変換シナリオ部3へ出力する。   The WebSocket data analysis unit 2 analyzes the input data and outputs various parameters to the conversion scenario unit 3.

変換シナリオ部3は、WebSocketデータ解析部2とシナリオ保持部8の情報を元にデータフォーマットの変換を実施し、Webサービスデータ生成部4へ出力する。その際にクライアント側の通信とWebサービス側の通信の紐付け、および非同期Webサービスにおけるリクエストとレスポンスの紐付けのために用いる識別子(パラメータ名)を紐付け情報保持部7へ保存する。また、Webサービスデータ解析部6から入力されたデータとシナリオ保持部8の情報を元にデータフォーマットの変換を実施し、WebSocketデータ生成部9に出力する。その際に紐付け情報保持部7に保持された紐付け情報を参照し、Webサービス側通信とクライアント側通信の紐付けを行う。   The conversion scenario unit 3 converts the data format based on the information of the WebSocket data analysis unit 2 and the scenario holding unit 8 and outputs the data format to the Web service data generation unit 4. At this time, an identifier (parameter name) used for associating the communication on the client side and the communication on the Web service side and the request and response in the asynchronous Web service is stored in the associating information holding unit 7. Further, the data format conversion is performed based on the data input from the Web service data analysis unit 6 and the information of the scenario holding unit 8, and is output to the WebSocket data generation unit 9. At that time, referring to the link information held in the link information holding unit 7, the Web service side communication and the client side communication are linked.

紐付け情報保持部7は、クライアント側の通信とWebサービス側の通信の紐付け、および非同期Webサービスにおけるリクエストとレスポンスの紐付けのために用いる識別子の保持に利用される。また、コールバックURLと適用される変換シナリオ情報の保持に利用される。   The linking information holding unit 7 is used to hold an identifier used for linking communication on the client side and communication on the Web service side, and linking a request and a response in the asynchronous Web service. Further, it is used to hold a callback URL and applied conversion scenario information.

Webサービスデータ生成部4は変換シナリオ部3から入力された情報から、Webサービスのリクエスト情報を生成し、Webサービス通信部5へ出力する。   The Web service data generation unit 4 generates Web service request information from the information input from the conversion scenario unit 3 and outputs the request information to the Web service communication unit 5.

Webサービス通信部5は、Webサービスサーバとコネクションを確立し、要求リクエストの送信を行う。また、レスポンスを受信し、Webサービスデータ解析部6へ出力する。   The web service communication unit 5 establishes a connection with the web service server and transmits a request request. The response is received and output to the Web service data analysis unit 6.

Webサービスデータ解析部6は、入力されたデータを解析し、各種パラメータを変換シナリオ部3へ出力する。   The web service data analysis unit 6 analyzes the input data and outputs various parameters to the conversion scenario unit 3.

WebSocketデータ生成部9は変換シナリオ部3から入力された情報から、WebSocketデータに変換されたWebサービスのレスポンス情報を生成し、WebSocket通信部1へ出力する。   The WebSocket data generation unit 9 generates response information of the Web service converted into WebSocket data from the information input from the conversion scenario unit 3 and outputs the response information to the WebSocket communication unit 1.

シナリオ保持部8は、WebSocket通信およびWebサービス通信の制御に必要なサービスシーケンス情報、データフォーマットおよびそのマッピング、Webサービスにおけるリクエストとレスポンスの紐付けのために用いる識別子情報(パラメータ名)を保持する。   The scenario holding unit 8 holds service sequence information, data format and mapping required for control of WebSocket communication and Web service communication, and identifier information (parameter name) used for associating a request and a response in the Web service.

次にゲートウェイ装置100の動作について説明する。   Next, the operation of the gateway device 100 will be described.

図2はゲートウェイ装置100を用いて、クライアント200がWebサービスサーバ300を利用するときのフローを示すシーケンス図である。図2を参照して、まず動作の概要を説明する。   FIG. 2 is a sequence diagram showing a flow when the client 200 uses the Web service server 300 using the gateway device 100. With reference to FIG. 2, the outline | summary of operation | movement is demonstrated first.

まずクライアント200がゲートウェイ装置100との間にWebSocketコネクションを確立する(S1−1)。以降クライアント200とゲートウェイ装置100の間では、コネクションの切断・再接続を行うことなく、非同期、双方向の通信が可能になる。次にクライアント200がゲートウェイ装置100にWebサービス・リクエストを送信する(S1−2)。ゲートウェイ装置100は受信したデータを解析し(S1−3)、Webサービスに適合するようにデータ変換シナリオを決定し(S1−4)、識別子とコールバックURLを決定する。結果は紐付け情報保持部7に保存される(S1−5)。次いでデータ変換を実行し(S1−6)、Webサービスサーバ300にWebサービス・リクエストを送信する。Webサービスサーバ300は、受信した要求に応じた処理を行い(S1−8)、レスポンスをゲートウェイ装置100に送信する(S1−9)。レスポンスは、コールバックURLへのリクエストの形で送信される。ゲートウェイ装置100は、レスポンスを受信すると、データ解析を行い(S1−10)、クライアント200から受信したリクエストとの紐付けを行う(S1−11)。次いでWebSocket用にデータ変換を行い(S1−12)、Webサービスデータをクライアント200に送信する(S1−13)。   First, the client 200 establishes a WebSocket connection with the gateway device 100 (S1-1). Thereafter, asynchronous and bidirectional communication can be performed between the client 200 and the gateway device 100 without disconnecting / reconnecting the connection. Next, the client 200 transmits a Web service request to the gateway device 100 (S1-2). The gateway device 100 analyzes the received data (S1-3), determines a data conversion scenario so as to be compatible with the Web service (S1-4), and determines an identifier and a callback URL. The result is stored in the linking information holding unit 7 (S1-5). Next, data conversion is executed (S1-6), and a Web service request is transmitted to the Web service server 300. The Web service server 300 performs processing according to the received request (S1-8), and transmits a response to the gateway device 100 (S1-9). The response is sent in the form of a request for a callback URL. Upon receiving the response, the gateway device 100 performs data analysis (S1-10), and links the request received from the client 200 (S1-11). Next, data conversion is performed for WebSocket (S1-12), and Web service data is transmitted to the client 200 (S1-13).

次に本実施の形態におけるゲートウェイ装置100の動作の詳細について説明する。図3はリクエスト送信におけるゲートウェイ装置100の動作を示すフローチャートである。   Next, details of the operation of gateway apparatus 100 in the present embodiment will be described. FIG. 3 is a flowchart showing the operation of the gateway apparatus 100 in request transmission.

S2−1:WebSocketコネクションの確立
クライアントとハンドシェイクを行い、WebSocketコネクションを確立する。なおWebSocketコネクションの確立手法は標準技術であるため、手法自体の説明は省略する。
S2-1: Establishing a WebSocket connection A handshake with the client is performed to establish a WebSocket connection. Since the method for establishing the WebSocket connection is a standard technique, description of the method itself is omitted.

S2−2:クライアントからデータの受信
ゲートウェイ装置100は、WebSocketを介してクライアントからデータを受信する。データは、WebSocket通信部1により受信される。WebSocket通信部1は受信したデータをWebSocketデータ解析部2へ出力する。
S2-2: Receiving Data from Client The gateway device 100 receives data from the client via the WebSocket. The data is received by the WebSocket communication unit 1. The WebSocket communication unit 1 outputs the received data to the WebSocket data analysis unit 2.

S2−3:データの解析
WebSocketデータ解析部2は事前に定められたインターフェース仕様に基づきデータの解析を実施し、変換シナリオ部3へ出力する。
S2-3: Data Analysis The WebSocket data analysis unit 2 analyzes data based on a predetermined interface specification and outputs the data to the conversion scenario unit 3.

なお、クライアントとゲートウェイ装置100の間のインターフェース仕様はWebSocketのデータフォーマット形式である。このデータフォーマットを、利用するWebサービスに因らない形式としておくと、クライアントにおける本装置利用の敷居を下げるものとなる。図4にデータフォーマットの具体例を示す。図4に示すように、データには利用するWebサービスのURLおよびWebサービス・リクエストに含むパラメータ情報が含まれる。また、パラメータのうちコールバックURLが設定される部分には、特定文字列を設定することで、変換シナリオにおいて決定するコールバックURLへの置き換えを実施可能とする。図4の例ではコールバックURLを、_CALLBACKURL_としている。なお、図4のデータフォーマットは実際にはバイナリ形式のデータである。   Note that the interface specification between the client and the gateway device 100 is a WebSocket data format. If this data format is set in a format that does not depend on the Web service to be used, the threshold for using this apparatus in the client is lowered. FIG. 4 shows a specific example of the data format. As shown in FIG. 4, the data includes the URL of the Web service to be used and parameter information included in the Web service request. In addition, by setting a specific character string in the part where the callback URL is set in the parameters, it is possible to perform replacement with the callback URL determined in the conversion scenario. In the example of FIG. 4, the callback URL is _CALLBACKURL_. Note that the data format in FIG. 4 is actually binary data.

S2−4:適用シナリオの決定
変換シナリオ部3は、入力されたデータを元に、その通信に対し適用する変換シナリオを決定する。変換シナリオの決定手法については実装に依存するが、WebサービスURL毎にシナリオを決定するのが最も容易な方法である。例えばURLが異なるWebサービスがある場合、それぞれのサービス毎に特有のシーケンスフロー、信号フォーマットを有する。シナリオ保持部8は、このような変換ルールを、URLをキーとしたテーブルに保持している。
S2-4: Determination of Application Scenario The conversion scenario unit 3 determines a conversion scenario to be applied to the communication based on the input data. Although the conversion scenario determination method depends on the implementation, it is easiest to determine the scenario for each Web service URL. For example, when there are Web services with different URLs, each service has a unique sequence flow and signal format. The scenario holding unit 8 holds such conversion rules in a table using URL as a key.

S2−5:識別子情報・コールバックURLの決定、保存
変換シナリオ部3は、変換シナリオを元に識別子に用いるパラメータ情報を決定する。識別子の特定は変換シナリオ内に規定され、検索可能とする。
S2-5: Determination and storage of identifier information / callback URL The conversion scenario unit 3 determines parameter information used for the identifier based on the conversion scenario. The identification of the identifier is specified in the conversion scenario and can be searched.

識別子は、WebSocketとWebサービスの紐付け、Webサービス・リクエストとWebサービス・レスポンスの紐付けに用いる情報となる。通常、非同期Webサービスにおいては、リクエストとレスポンスを紐付ける一意のパラメータが規定されるため、本装置で規定するパラメータも基本的にはこれと同一のものとなる。   The identifier is information used for associating the WebSocket with the Web service and associating the Web service request with the Web service response. Usually, in an asynchronous Web service, since a unique parameter for linking a request and a response is defined, the parameter defined by this apparatus is basically the same as this.

なお、非同期Webサービスにおいてリクエストとレスポンスを一意に紐付けるパラメータは、クライアント側が決定してリクエストに設定するパターン、Webサービス側が決定しレスポンスに設定するパターンなどが存在するが、それらの差分は変換シナリオにより吸収される。ここではリクエストに設定するパターンで記載する。   Note that parameters that uniquely associate a request and a response in an asynchronous Web service include a pattern that is determined by the client and set in the request, a pattern that is determined by the Web service and set in the response, and the difference between them is a conversion scenario. Is absorbed by. Here, it is described in the pattern set in the request.

また変換シナリオ部3は、変換シナリオを元にコールバックURLを決定し、決定されたコールバックURLを有効化する。コールバックURLは非同期Webサービスにおいて、レスポンスの送信先となる。コールバックURLの内容は実装に依存するが、全てのサービス・リクエストで同一にしてもよいし、識別子情報を元に全てのサービス・リクエストで異なるものにしてもよい。図5に一例を示す。図5では、コールバックURLに識別子情報を含むように規定している。変換シナリオ部3は、図5のように、決定された識別子とそれに紐付くセッションの情報、およびコールバックURLと紐付く変換シナリオ情報を紐付け情報保持部4へ保存する。   The conversion scenario unit 3 determines a callback URL based on the conversion scenario, and validates the determined callback URL. The callback URL is a response transmission destination in the asynchronous Web service. Although the content of the callback URL depends on the implementation, it may be the same for all service requests, or may be different for all service requests based on the identifier information. An example is shown in FIG. In FIG. 5, it is specified that the identifier information is included in the callback URL. As illustrated in FIG. 5, the conversion scenario unit 3 stores the determined identifier, session information associated with the determined identifier, and conversion scenario information associated with the callback URL in the association information holding unit 4.

図6にWebサービス・レスポンスの一例を示す。図6では、レスポンスにおけるWebサービスパラメータ内の、correlaterパラメータ(<correlator>〜</correlator>で囲まれた部分)を識別子として利用するように規定している。   FIG. 6 shows an example of the Web service response. In FIG. 6, it is defined that the correlator parameter (the part enclosed by <correlator> to </ correlator>) in the Web service parameter in the response is used as an identifier.

S2−6:データフォーマット変換・リクエスト生成
変換シナリオ部3は、続いてデータフォーマット変換を実施する。WebSocketにおける通信データと、Webサービスのリクエストフォーマットのデータマッピングは変換シナリオに規定され、その情報を元にデータフォーマットの変換を実施し、Webサービスデータ生成部5へ出力する。データフォーマット変換例を図7に示す。ここでは、Webサービス通信がHTTPで行われる場合の例を示している。概要は次の通りである。1)WebサービスURLを元にHTTP電文のリクエストラインを生成、2)HTTPヘッダの自動設定、3)WebサービスパラメータをHTTPボディに自動設定、4)ゲートウェイ装置にて決定したコールバックURLで_CALLBACKURL_を置換。Webサービスデータ生成部5は、入力された情報を元にWebサービスに送信するWebサービスのリクエスト電文を作成し、Webサービス通信部6へ出力する。
S2-6: Data Format Conversion / Request Generation The conversion scenario unit 3 subsequently performs data format conversion. The communication data in the WebSocket and the data mapping of the request format of the Web service are defined in the conversion scenario, the data format is converted based on the information, and output to the Web service data generation unit 5. An example of data format conversion is shown in FIG. Here, an example in which Web service communication is performed by HTTP is shown. The outline is as follows. 1) Generate HTTP message request line based on Web service URL, 2) Automatic setting of HTTP header, 3) Automatic setting of Web service parameter in HTTP body, 4) _CALLBACKURL_ with callback URL determined by gateway device Replacement. The web service data generation unit 5 creates a web service request message to be transmitted to the web service based on the input information, and outputs the request message to the web service communication unit 6.

S2−7:Webサービス要求リクエスト送信
Webサービス通信部6は、WebサービスURLを元にWebサービスサーバとの間でコネクションを確立する。コネクションの確立については標準技術であるため説明は割愛する。コネクションの確立後、Webサービス通信部5は、Webサービスデータ生成部4から入力された要求リクエスト電文をWebサービスサーバ300へ送信する。
S2-7: Web Service Request Request Transmission The Web service communication unit 6 establishes a connection with the Web service server based on the Web service URL. Since the establishment of the connection is a standard technology, a description thereof will be omitted. After the connection is established, the Web service communication unit 5 transmits the request request message input from the Web service data generation unit 4 to the Web service server 300.

次にレスポンス受信動作について説明する。図8はゲートウェイ装置100のWebサービス・レスポンス受信からWebSocketデータ送信までの動作を示すフローチャートである。   Next, a response receiving operation will be described. FIG. 8 is a flowchart showing the operation of the gateway device 100 from the reception of the Web service response to the transmission of WebSocket data.

S3−1:Webサービスからレスポンス受信
Webサービスからのレスポンスは、Webサービス通信部6において用意されたコールバックURLにて受信され、Webサービスデータ解析部7へ出力される。
S3-1: Reception of Response from Web Service A response from the Web service is received at the callback URL prepared in the Web service communication unit 6 and output to the Web service data analysis unit 7.

S3−2:データの解析
Webサービスデータ解析部6は事前に定められたインターフェース仕様に基づきデータの解析を実施し、結果を変換シナリオ部3へ出力する。
S3-2: Data Analysis The Web service data analysis unit 6 performs data analysis based on a predetermined interface specification and outputs the result to the conversion scenario unit 3.

S3−3:紐付けられたリクエストを決定
変換シナリオ部3はデータ解析により得られた情報から識別子を決定し、紐付け情報保持部4の検索を行い、紐付けられた要求リクエストを決定する。
S3-3: Determine linked request The conversion scenario unit 3 determines an identifier from information obtained by data analysis, searches the linked information holding unit 4, and determines a linked request request.

紐付けられた要求リクエストの決定は実装に依存し、それぞれの実装に適切な方法により実施される。例えば、図6に示したようにコールバックURLから適用される変換シナリオを特定する。そして変換シナリオを元に、レスポンスメッセージ内から識別子情報を取得し、得られた識別子から紐付けられたリクエストを決定する。   The determination of the associated request request depends on the implementation, and is performed by a method appropriate for each implementation. For example, the conversion scenario applied from the callback URL is specified as shown in FIG. Based on the conversion scenario, identifier information is acquired from the response message, and a request associated with the obtained identifier is determined.

S3−4:データフォーマット変換・WebSocketデータ作成
変換シナリオ部3は、続いてデータフォーマット変換を実施する。Webサービスのリクエストフォーマットと、WebSocketにおける通信データのデータマッピングは変換シナリオに規定され、その情報を元にデータフォーマットの変換を実施し、WebSocketデータ生成部9へ出力する。
S3-4: Data Format Conversion / WebSocket Data Creation The conversion scenario unit 3 subsequently performs data format conversion. The request format of the Web service and the data mapping of the communication data in the WebSocket are defined in the conversion scenario, the data format is converted based on the information, and output to the WebSocket data generation unit 9.

WebSocketデータ生成部9は、入力された情報を元にクライアントに送信するデータを作成し、WebSocket通信部1へ出力する。   The WebSocket data generation unit 9 creates data to be transmitted to the client based on the input information and outputs the data to the WebSocket communication unit 1.

S3−5:WebSocketデータ送信
WebSocket通信部1は、データ生成部8から入力されたデータを、S2−5で紐付けられた通信に対し送信する。
S3-5: WebSocket Data Transmission The WebSocket communication unit 1 transmits the data input from the data generation unit 8 to the communication associated with S2-5.

以上説明したように、本実施の形態のゲートウェイ装置を用いれば、WebSocket非対応のWebサービスを利用する場合においても、クライアントは非同期双方向の通信を行うことができる。また、クライアントは本発明のゲートウェイ装置とWebSocketで通信しているため、WebサービスサーバがWebSocket対応か非対応かに関わらず、非同期双方向通信を利用することが出来る。
(第2の実施の形態)
本実施の形態のゲートウェイ装置100は、第1の実施の形態の機能に加えて、ルータ機能部110を備えている。図9は本発明第2の実施の形態を示すブロック図である。ゲートウェイ装置100に複数のクライアント200、クライアント200a、クライアント200b、クライアント200c、・・・が接続されている。ゲートウェイ装置100はインターネット400に接続されている。それぞれのクライアント200がインターネット400に接続するWebサービスを利用する際には、クライアント200とゲートウェイ装置100の間にはWebSocketコネクションが確立される。あるクライアント200からのリクエストは、当該クライアントのプライベートIPアドレスと紐付けられ、第1の実施の形態と同様にWebサービスからのレスポンスとも紐付けられる。このようにして、本実施の形態によれば、複数のクライアント200が、WebSocketを用いてWebサービスを利用することができる。
As described above, by using the gateway device of the present embodiment, the client can perform asynchronous bidirectional communication even when using a Web service that does not support WebSocket. In addition, since the client communicates with the gateway device of the present invention using WebSocket, asynchronous two-way communication can be used regardless of whether the Web service server is compatible with WebSocket.
(Second Embodiment)
The gateway device 100 of this embodiment includes a router function unit 110 in addition to the functions of the first embodiment. FIG. 9 is a block diagram showing a second embodiment of the present invention. A plurality of clients 200, 200a, 200b, 200c,... Are connected to the gateway device 100. The gateway device 100 is connected to the Internet 400. When each client 200 uses a Web service that connects to the Internet 400, a WebSocket connection is established between the client 200 and the gateway device 100. A request from a certain client 200 is associated with the private IP address of the client, and is also associated with a response from the Web service as in the first embodiment. Thus, according to the present embodiment, a plurality of clients 200 can use a Web service by using WebSocket.

1 WebSocket通信部
2 WebSocketデータ解析部
3 変換シナリオ部
4 Webサービスデータ生成部
5 Webサービス通信部
6 Webサービスデータ解析部
7 紐付け情報保持部
8 シナリオ保持部
9 WebSocketデータ生成部
100 ゲートウェイ装置
110 ルータ機能部
200 クライアント
DESCRIPTION OF SYMBOLS 1 WebSocket communication part 2 WebSocket data analysis part 3 Conversion scenario part 4 Web service data generation part 5 Web service communication part 6 Web service data analysis part 7 Linking information holding part 8 Scenario holding part 9 WebSocket data generation part 100 Gateway apparatus 110 Router Functional part 200 client

Claims (8)

WebSocketにより通信を行う第1の通信手段と、WebSocketとは異なるプロトコルにより通信を行う第2の通信手段と、前記第1の通信手段からから受信したWebSocket形式の第1のデータをWebSocketとは異なる第2のプロトコル形式の第2のデータに変換し前記第2の通信手段から受信した前記第2のデータを前記第1のデータに変換するとともに前記第1のデータと前記第2のデータとを紐付けするデータ変換部と、を有することを特徴とするゲートウェイ装置。   The first communication means for performing communication using WebSocket, the second communication means for performing communication using a protocol different from WebSocket, and the first data in the WebSocket format received from the first communication means are different from WebSocket. The second data converted into the second data of the second protocol format and received from the second communication means is converted into the first data, and the first data and the second data are converted. And a data conversion unit to be linked. ルータ機能部を有していることを特徴とする請求項1に記載のゲートウェイ装置。   The gateway device according to claim 1, further comprising a router function unit. 前記紐付け手段が、前記第1のデータまたは前記第2のデータに識別子とコールバックURLを紐付け情報として付与する紐付け情報付与手段を有することを特徴とする請求項1または請求項2に記載のゲートウェイ装置。   3. The linking unit includes a linking information adding unit that adds an identifier and a callback URL as linking information to the first data or the second data. The gateway device described. 前記紐付け手段が、前記ルータに接続するクライアントのプライベートIPアドレスと前記WebSocketデータとを紐付けるアドレス紐付け手段を有していることを特徴とする請求項2または請求項3に記載のゲートウェイ装置。   The gateway device according to claim 2 or 3, wherein the linking unit includes an address linking unit that links a private IP address of a client connected to the router and the WebSocket data. . WebSocketにより通信を行う第1の通信手段と、WebSocketとは異なるプロトコルにより通信を行う第2の通信手段と、前記第1の通信手段からから受信したWebSocket形式の第1のデータをWebSocketとは異なる第2のプロトコル形式の第2のデータに変換し前記第2の通信手段から受信した前記第2のデータを前記第1のデータに変換し前記第1のデータと前記第2のデータとを紐付けするデータ変換部と、を有するゲートウェイ装置を用いた通信方法であって、前記第1の通信手段から第1のデータを受信する工程と、前記第1のデータを前記第2のデータに変換する工程と、前前記第2の通信手段から前記第2のデータを受信する工程と、前記第2のデータを前記第1のデータに変換する工程と、記第1のデータと前記第2のデータとを紐付けする工程と、を有することを特徴とするゲートウェイ装置を用いた通信方法。   The first communication means for performing communication using WebSocket, the second communication means for performing communication using a protocol different from WebSocket, and the first data in the WebSocket format received from the first communication means are different from WebSocket. The second data converted into the second data in the second protocol format and received from the second communication means is converted into the first data, and the first data and the second data are linked. A communication method using a gateway device having a data conversion unit, a step of receiving first data from the first communication means, and converting the first data into the second data The step of receiving, the step of receiving the second data from the second communication means, the step of converting the second data into the first data, Communication method using a gateway device, characterized in that it comprises a step of tying the first data and the second data. 前記紐付けする工程が、前記第1データまたは第2のデータに識別子とコールバックURLを付与する工程を有することを特徴とする請求項5に記載のゲートウェイ装置を用いた通信方法。   The communication method using the gateway device according to claim 5, wherein the linking step includes a step of assigning an identifier and a callback URL to the first data or the second data. 前記ゲートウェイ装置が複数のクライアントとWebSocketコネクションを確立する工程と、前記クライアントからのリクエストと前記クライアントのプライベートIPアドレスを紐付けする工程を有することを特徴とする請求項5または請求項6に記載のゲートウェイ装置を用いた通信方法。   7. The method according to claim 5, wherein the gateway device includes a step of establishing a WebSocket connection with a plurality of clients, and a step of associating a request from the client with a private IP address of the client. A communication method using a gateway device. WebSocketにより通信を行う第1の通信手段と、WebSocketとは異なるプロトコルにより通信を行う第2の通信手段と、前記第1の通信手段からから受信したWebSocket形式の第1のデータをWebSocketとは異なる第2のプロトコル形式の第2のデータに変換し前記第2の通信手段から受信した前記第2のデータを前記第1のデータに変換し前記第1のデータと前記第2のデータとを紐付けするデータ変換部と、を有するゲートウェイ装置に用いる通信プログラムあって、前記第1の通信手段から第1のデータを受信するステップと、前記第1のデータを前記第2のデータに変換するステップと、前前記第2の通信手段から前記第2のデータを受信するステップと、前記第2のデータを前記第1のデータに変換するステップと、前記第1のデータと前記第2のデータとを紐付けするステップと、を有することを特徴とするゲートウェイ装置に用いる通信プログラム。   The first communication means for performing communication using WebSocket, the second communication means for performing communication using a protocol different from WebSocket, and the first data in the WebSocket format received from the first communication means are different from WebSocket. The second data converted into the second data in the second protocol format and received from the second communication means is converted into the first data, and the first data and the second data are linked. A communication program for use in a gateway device including: a step of receiving first data from the first communication means; and a step of converting the first data into the second data Receiving the second data from the second communication means, and converting the second data into the first data. Steps and, a communication program for use in a gateway apparatus characterized by having the steps of association with said first data and said second data conversion.
JP2013175103A 2013-08-27 2013-08-27 Gateway device, communication method using gateway device, and communication program used for gateway device Pending JP2015045897A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013175103A JP2015045897A (en) 2013-08-27 2013-08-27 Gateway device, communication method using gateway device, and communication program used for gateway device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013175103A JP2015045897A (en) 2013-08-27 2013-08-27 Gateway device, communication method using gateway device, and communication program used for gateway device

Publications (1)

Publication Number Publication Date
JP2015045897A true JP2015045897A (en) 2015-03-12

Family

ID=52671382

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013175103A Pending JP2015045897A (en) 2013-08-27 2013-08-27 Gateway device, communication method using gateway device, and communication program used for gateway device

Country Status (1)

Country Link
JP (1) JP2015045897A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2016151798A1 (en) * 2015-03-25 2017-09-07 三菱電機株式会社 Communication system, facility management apparatus, communication method, and program
CN111164945A (en) * 2017-10-13 2020-05-15 瑞典爱立信有限公司 Method and apparatus for brokering between different architectures

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102299967A (en) * 2011-09-08 2011-12-28 中兴通讯股份有限公司 Mobile position system, gateway, mobile terminal and method for realizing mobile position
US20120084351A1 (en) * 2010-10-05 2012-04-05 Hitachi, Ltd. Service collaboration system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120084351A1 (en) * 2010-10-05 2012-04-05 Hitachi, Ltd. Service collaboration system
JP2012079210A (en) * 2010-10-05 2012-04-19 Hitachi Ltd Service cooperation system
EP2450789A2 (en) * 2010-10-05 2012-05-09 Hitachi Ltd. Service collaboration system
CN102447729A (en) * 2010-10-05 2012-05-09 株式会社日立制作所 Service collaboration system
CN102299967A (en) * 2011-09-08 2011-12-28 中兴通讯股份有限公司 Mobile position system, gateway, mobile terminal and method for realizing mobile position

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2016151798A1 (en) * 2015-03-25 2017-09-07 三菱電機株式会社 Communication system, facility management apparatus, communication method, and program
CN111164945A (en) * 2017-10-13 2020-05-15 瑞典爱立信有限公司 Method and apparatus for brokering between different architectures
JP2020537401A (en) * 2017-10-13 2020-12-17 テレフオンアクチーボラゲット エルエム エリクソン(パブル) Methods and equipment for proxies between different architectures
JP7200237B2 (en) 2017-10-13 2023-01-06 テレフオンアクチーボラゲット エルエム エリクソン(パブル) Method and Apparatus for Proxying Between Different Architectures
US11750708B2 (en) 2017-10-13 2023-09-05 Telefonaktiebolaget Lm Ericsson (Publ) Method and device for proxy between different architectures

Similar Documents

Publication Publication Date Title
CN107018147B (en) Internet of things communication method and system and gateway module
EP3275162B1 (en) Systems and techniques for web communication
CN112311774B (en) Data processing method and device, electronic equipment and storage medium
CN101843079A (en) Communicating a selection of a potential configuration
WO2004107100A2 (en) Peer-to-peer dynamic web page sharing
CN103108037B (en) A kind of communication means, Web server and Web communication system
CN102984223B (en) A kind of message method, the network equipment and system
CN108418847A (en) A kind of network traffic cache system, method and device
CN104767742A (en) Safe communication method, gateway, network side server and system
CN106549989B (en) Data transmission method and system, user terminal and application server
CN101465763A (en) Method for monitoring and analyzing user terminal network appliance flux
CN102647432B (en) A kind of authentication information transmission method, device and certification middleware
CN103581361A (en) Domain name resolution proxy method, device and system
CN111427703A (en) Industrial data real-time display method and system
JP2014057149A (en) Communication device, relay device and communication method
JP2015045897A (en) Gateway device, communication method using gateway device, and communication program used for gateway device
Klinpratum et al. Toward interconnecting M2M/IoT standards: Interworking proxy for IEEE1888 standard at ETSI M2M platform
Tanganelli et al. A distributed architecture for discovery and access in the internet of things
CN104754042A (en) Picture releasing and uploading acceleration method and system using CDN (content distribution network)
JP2007035053A (en) Method for maintaining session between different-terminals
JP6293611B2 (en) Page synchronization method and program for displaying same page synchronously between terminals
JP2014222455A (en) Communication system, proxy server, communication method, and program
CN105227659B (en) A kind of network communication method and equipment
CN110753071B (en) Information acquisition method and device
JP2013186820A (en) Relay device and communication system

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20160715

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20170418

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20170516

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20171107