JP5432595B2 - Communication apparatus and processing method thereof - Google Patents

Communication apparatus and processing method thereof Download PDF

Info

Publication number
JP5432595B2
JP5432595B2 JP2009130937A JP2009130937A JP5432595B2 JP 5432595 B2 JP5432595 B2 JP 5432595B2 JP 2009130937 A JP2009130937 A JP 2009130937A JP 2009130937 A JP2009130937 A JP 2009130937A JP 5432595 B2 JP5432595 B2 JP 5432595B2
Authority
JP
Japan
Prior art keywords
message
service
information
connection
execution
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
JP2009130937A
Other languages
Japanese (ja)
Other versions
JP2010277433A (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 JP2009130937A priority Critical patent/JP5432595B2/en
Priority to US12/767,232 priority patent/US9258391B2/en
Publication of JP2010277433A publication Critical patent/JP2010277433A/en
Application granted granted Critical
Publication of JP5432595B2 publication Critical patent/JP5432595B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、他の装置とネットワークを介してメッセージを送受信する通信装置及びその処理方法に関する。   The present invention relates to a communication apparatus that transmits / receives a message to / from another apparatus via a network, and a processing method thereof.

近年、ネットワークを介して複数の装置同士がデータのやり取りを行うWebサービス技術を用いたPCや機器の連携が一般的に行われている。サービスは、クライアントからのサービスの実行を要求するリクエストメッセージを受信し、サービスロジックを実行して、実行結果を含んだレスポンスメッセージをクライアントに送信する。サービスがリクエストメッセージを受信した後に、ネットワーク障害やタイムアウト、及び、クライアントのキャンセルにより、コネクションが切断された場合、サービス側では、サービスロジックの実行処理を途中で止められない。通常、サービスロジックの実行が終了し、レスポンスメッセージを書き出そうとして、コネクションの切断に気づき、処理を終了する。そのため、せっかく作成したレスポンスメッセージが無駄になってしまう。
そこで、先行技術には、ウェブ・サービス要求を受信したことに応答して、ウェブ・サービス・コントローラが制御し、サービスロジックを実行せずにキャッシュしたものを使用できるようにした特許がある(参考文献1参照)。
In recent years, cooperation between PCs and devices using Web service technology in which a plurality of devices exchange data with each other via a network is generally performed. The service receives a request message for requesting execution of the service from the client, executes the service logic, and transmits a response message including the execution result to the client. After the service receives the request message, if the connection is disconnected due to a network failure, timeout, or client cancellation, the service side cannot stop the service logic execution process. Normally, the execution of the service logic is completed, the response message is written out, the disconnection is noticed, and the process is terminated. Therefore, the created response message is wasted.
Therefore, in the prior art, in response to receiving a web service request, there is a patent which is controlled by a web service controller and can use a cached one without executing service logic (reference) Reference 1).

特開2007−200311JP2007-200311

特許文献1の場合、どのような場合でもキャッシュを使用するが、すべての情報をキャッシュしておくことは難しい。また、Webサービスのオペレーション呼び出しの場合、同じ呼び出しであっても、毎回同じ実行結果が返るとは限らない。例えば、申請書類などのファイルのダウンロードをするようなサービスの場合を考える。申請書類には、複数人が閲覧及び、承認印などの処理を加える。そのため、同じファイル名であっても、呼び出したタイミングによって、申請書類の情報が異なっている。つまり、一度呼び出したサービスの実行結果をキャッシュしておくことには何の意味もないのである。   In the case of Patent Document 1, a cache is used in any case, but it is difficult to cache all information. Also, in the case of a Web service operation call, even if the call is the same, the same execution result is not always returned. For example, consider the case of a service that downloads files such as application documents. The application documents are processed by a number of people and processed for approval. Therefore, even if the file name is the same, the information on the application document differs depending on the call timing. In other words, there is no point in caching the execution results of a service that has been called once.

また、まったくキャッシュしておくことができない場合もある。その場合、非常に処理が重いサービスロジックの実行処理は無駄となってしまう。そこで、キャッシュをしない場合でも、コネクションの切断時に、非常に処理が重いようなサービスロジックの実行処理を途中で中断できる仕組みが必要である。   In some cases, it may not be possible to cache at all. In that case, the execution process of the service logic which is very heavy processing is wasted. Therefore, there is a need for a mechanism that can interrupt the execution process of service logic that is very heavy even when the connection is disconnected even when the cache is not used.

本発明は、サービスを実行した結果を効率よく利用する通信装置及びその処理方法を提供する。   The present invention provides a communication apparatus and a processing method thereof that efficiently use a result of executing a service.

本発明の一実施形態に係る通信装置は、他の装置とネットワークを介してメッセージを送受信する通信装置であって、
前記他の装置からサービスの実行を要求するメッセージを受信する受信手段と、
前記他の装置とのコネクションが切断されたか否かを監視する監視手段と、
前記メッセージに該メッセージを識別するための情報が付与されているか否かを判定する判定手段と、
前記受信されたメッセージのサービスを実行中に前記他の装置とのコネクションが切断された場合であって、前記判定手段が前記情報は付与されていると判定した場合、当該サービスを実行した結果を前記情報と共に保存する保存手段と、
前記受信されたメッセージのサービスを実行中に前記他の装置とのコネクションが切断された場合であって、前記判定手段が前記情報は付与されていないと判定した場合、前記受信されたメッセージのサービスの実行を中断させる制御手段と、
前記受信手段により受信されたメッセージに前記保存手段に保存された前記情報が付与されていた場合、前記情報と共に保存された実行結果を前記他の装置へ送信する送信手段と、
を有することを特徴とする。
A communication apparatus according to an embodiment of the present invention is a communication apparatus that transmits / receives a message to / from another apparatus via a network,
Receiving means for receiving a message requesting execution of a service from the other device;
Monitoring means for monitoring whether or not the connection with the other device is disconnected;
Determining means for determining whether or not information for identifying the message is attached to the message;
When the connection with the other device is disconnected while executing the service of the received message, and the determination unit determines that the information is given, the result of executing the service is and storage means for storing together before Kijo report,
If the connection with the other device is disconnected while the service of the received message is being executed, and the determination unit determines that the information is not given, the service of the received message Control means for interrupting the execution of
When the information stored in the storage unit is added to the message received by the reception unit, a transmission unit that transmits the execution result stored together with the information to the other device;
It is characterized by having.

本発明によれば、サービスを実行した結果を効率よく利用することができる。   According to the present invention, it is possible to efficiently use a result of executing a service.

本実施形態における通信装置のハードウェア構成の一例を示す図。The figure which shows an example of the hardware constitutions of the communication apparatus in this embodiment. 本実施形態における通信装置のソフトウェア構成の一例を示す図。The figure which shows an example of the software configuration of the communication apparatus in this embodiment. 識別IDが付与されていないリクエストメッセージの場合の処理を示す図。The figure which shows the process in the case of the request message to which identification ID is not provided. 識別IDが付与されたリクエストメッセージの場合の処理を示す図。The figure which shows the process in the case of the request message to which identification ID was provided. 識別IDのみのリクエストメッセージの場合の処理を示す図。The figure which shows the process in the case of the request message only of identification ID. データベースに保持される情報の一例を示す図。The figure which shows an example of the information hold | maintained at a database. 本実施形態における通信装置の処理を示すフローチャート。The flowchart which shows the process of the communication apparatus in this embodiment. 保存期間を過ぎたデータを削除する処理を示すフローチャート。The flowchart which shows the process which deletes the data which passed the preservation | save period.

以下、図面を参照しながら発明を実施するための形態について詳細に説明する。まず、本実施形態における通信装置のハードウェア構成の一例を、図1を用いて説明する。尚、本実施形態では、通信装置として、他の装置からの、サービス要求に応じて、サービスを実行し、実行結果(応答)を他の装置へ返送するサービス装置を例に説明する。   Hereinafter, embodiments for carrying out the invention will be described in detail with reference to the drawings. First, an example of the hardware configuration of the communication apparatus according to the present embodiment will be described with reference to FIG. In the present embodiment, a communication apparatus that executes a service in response to a service request from another apparatus and returns an execution result (response) to the other apparatus will be described as an example.

図1において、他の装置101は、ネットワーク113を介してサービス装置(通信装置)102とメッセージを授受する、サービスを利用する側の装置(コンピュータ)である。サービス装置102は、CPU103、メモリ104、HD(ハードディスク)装置105、表示ボード106、周辺コントローラ107、ネットワークI/F108を備える。CPU103は、プログラムに従ってサービス装置102の各処理部の処理を実行する。プログラムはHD装置105やメモリ104に格納されており、CPU103がプログラムを実行時にRAMに読み込まれる。メモリ104はプログラムや制御データを格納するROMとCPU103の作業領域としてのRAMを含み、更にXMLの要素やオブジェクトも格納される。また、プログラムはコンピュータを通信装置として機能させるためのものである。   In FIG. 1, another device 101 is a device (computer) on the service side that exchanges messages with a service device (communication device) 102 via a network 113. The service device 102 includes a CPU 103, a memory 104, an HD (hard disk) device 105, a display board 106, a peripheral controller 107, and a network I / F 108. The CPU 103 executes processing of each processing unit of the service device 102 according to the program. The program is stored in the HD device 105 or the memory 104, and is read into the RAM when the CPU 103 executes the program. The memory 104 includes a ROM for storing programs and control data, and a RAM as a work area for the CPU 103, and further stores XML elements and objects. The program is for causing a computer to function as a communication device.

HD装置105はハードディスクへのアクセスを制御するインタフェースを含み、各種データを記憶する。表示ボード106はディスプレイ装置109を接続するためのインタフェースを含み、サービス装置102の状態や処理結果をディスプレイ装置109に表示させる。周辺コントローラ107はマウス110やキーボード111を接続するためのインタフェースを含み、サービス装置102への指示や各種入力を制御する。ネットワークI/F108はネットワーク113との間で通信するためのインタフェースを含み、他の装置101との通信を制御する。   The HD device 105 includes an interface for controlling access to the hard disk, and stores various data. The display board 106 includes an interface for connecting the display device 109, and causes the display device 109 to display the status of the service device 102 and the processing result. The peripheral controller 107 includes an interface for connecting a mouse 110 and a keyboard 111, and controls instructions and various inputs to the service device 102. The network I / F 108 includes an interface for communicating with the network 113 and controls communication with other apparatuses 101.

システムバス112は上述の各部を接続する。ネットワーク113は他の装置101とサービス装置102がメッセージを通信できればどのような形態でもよく、例えばインターネット、WAN、LANなどである。また、通信プロトコルも特定のプロトコルに限るものではない。   The system bus 112 connects the above-described units. The network 113 may have any form as long as the other apparatus 101 and the service apparatus 102 can communicate messages, such as the Internet, WAN, or LAN. Also, the communication protocol is not limited to a specific protocol.

次に、サービス装置102のソフトウェア構成の一例を、図2を用いて説明する。他の装置101からサービスの実行を要求するメッセージとしてリクエストメッセージ201が送信されると、メッセージ受信部202がそのリクエストメッセージ201を受信する。ここで、他の装置101とサービス装置102とのコネクションが切断されていないか否かはコネクション切断検知部203が検知する。コネクションが切断されていなければ、メッセージ解析部204がそのリクエストメッセージ201を解析し、何のサービスの呼び出しかを判断する。また、メッセージ解析部204はリクエストメッセージ201に、メッセージを識別するための情報として識別IDが含まれているか否かも判断する。   Next, an example of the software configuration of the service device 102 will be described with reference to FIG. When a request message 201 is transmitted as a message requesting execution of a service from another apparatus 101, the message receiving unit 202 receives the request message 201. Here, the connection disconnection detection unit 203 detects whether or not the connection between the other apparatus 101 and the service apparatus 102 is disconnected. If the connection is not disconnected, the message analysis unit 204 analyzes the request message 201 and determines what service is called. The message analysis unit 204 also determines whether or not the request message 201 includes an identification ID as information for identifying the message.

次に、メッセージ解析部204で呼び出すサービスが特定されると、サービスロジック制御部205がサービスロジック206の呼び出しを行う。また、コネクション切断検知部203が切断を検知した場合は、リクエストメッセージ201に識別IDが付与されていない場合、サービスロジック206の処理を中断させる。サービスロジック206は、サービスロジック制御部205によってサービスの実行及び実行の中断が行われる。   Next, when the service to be called is specified by the message analysis unit 204, the service logic control unit 205 calls the service logic 206. Further, when the connection disconnection detection unit 203 detects disconnection, the service logic 206 is interrupted when the identification ID is not given to the request message 201. In the service logic 206, the service logic control unit 205 executes the service and interrupts the execution.

サービスロジック制御部205によるサービスの実行が終了すると、メッセージ作成部207がサービスロジック206の実行結果に基づいて他の装置101に返信するレスポンスメッセージ209を作成する。そして、メッセージ送信部208が他の装置101にサービスの実行結果を表すメッセージとして、レスポンスメッセージ209を送信する。また、レスポンスメッセージ209は、サービスの実行に失敗した場合、失敗した情報を表すメッセージとなる。   When the service logic control unit 205 finishes executing the service, the message creation unit 207 creates a response message 209 that is returned to the other apparatus 101 based on the execution result of the service logic 206. Then, the message transmission unit 208 transmits a response message 209 as a message indicating the service execution result to the other apparatus 101. The response message 209 is a message indicating failed information when the service execution fails.

他の装置101とのコネクションの切断により、メッセージを送信できなかった場合、未送信メッセージ管理部210がデータベース211に未送信のレスポンスメッセージを保持する。これは、他の装置101からのリクエストメッセージ201に識別IDが付与されていた場合に行われ、識別IDとレスポンスメッセージ209を紐付けて保持する。また、未送信メッセージ管理部210は再び、同じ識別IDを持つリクエストメッセージ201が他の装置101から送信された場合、既に紐付けされたレスポンスメッセージをメッセージ送信部208に渡す。データベース211は、未送信メッセージ管理部210が情報を格納する格納先であり、HD装置105に含まれる。   If the message cannot be transmitted due to the disconnection with the other device 101, the unsent message management unit 210 holds the unsent response message in the database 211. This is performed when an identification ID is assigned to the request message 201 from another device 101, and the identification ID and the response message 209 are linked and held. Further, when the request message 201 having the same identification ID is transmitted from another device 101 again, the unsent message management unit 210 passes the already associated response message to the message transmission unit 208. The database 211 is a storage location where the unsent message management unit 210 stores information, and is included in the HD device 105.

次に、本実施形態におけるサービス装置の特徴的な処理を、図3乃至図8を用いて説明する。まず、識別IDが付与されていないリクエストメッセージをやり取りする具体例を図3に示す。リクエストメッセージ301は、他の装置101がgetDataオペレーションを呼び出す際に送信される具体例である。リクエストメッセージ301には、識別IDが付与されていない。サービス装置102では、このリクエストメッセージ301を受信し、具体的なサービスロジック302を実行する。そのサービスロジック302を実行した結果として、具体的なレスポンスメッセージ303が作成される。しかし、このサービスロジック302の処理を実行中にコネクションが切断された場合、リクエストメッセージ301に識別IDが付与されていないため、サービスロジック302の実行を中断する。従って、この場合、レスポンスメッセージ303は作成されない。   Next, characteristic processing of the service device according to the present embodiment will be described with reference to FIGS. First, a specific example of exchanging request messages without an identification ID is shown in FIG. The request message 301 is a specific example that is transmitted when another device 101 calls the getData operation. The request message 301 is not given an identification ID. The service device 102 receives this request message 301 and executes specific service logic 302. As a result of executing the service logic 302, a specific response message 303 is created. However, if the connection is disconnected while the processing of the service logic 302 is being executed, the identification of the request message 301 is not given, so the execution of the service logic 302 is interrupted. Therefore, in this case, the response message 303 is not created.

次に、識別IDが付与されたリクエストメッセージをやり取りする具体例を図4に示す。リクエストメッセージ401は、他の装置101がgetDataオペレーションを呼び出す際に送信される具体例である。リクエストメッセージ401には、識別ID「100020」が付与されている。この識別IDは初めてのアクセスであるため、データベース211には、紐付けされたレスポンスメッセージ303は存在しない。そのため、サービス装置102は、サービスロジック302の実行を行い、レスポンスメッセージ303の作成を行う。このサービスロジック302の実行結果として、具体的なレスポンスメッセージ303が作成される。ここで、サービスロジック302の処理を実行中にコネクションが切断された場合、このリクエストメッセージ401には識別IDが付与されているため、サービスロジック302の実行を最後まで行う。そして、レスポンスメッセージ303を作成し、識別ID「100020」と紐付けして保持しておく。再度、リクエストメッセージ401が他の装置101から送信されると、識別ID「100020」に紐付けされたレスポンスメッセージ303が存在するため、サービスロジック302を実行せずに、そのメッセージを送信する。そして、識別ID「100020」と紐付けされたレスポンスメッセージ303の情報をデータベース211から削除する。   Next, a specific example of exchanging request messages with identification IDs is shown in FIG. The request message 401 is a specific example that is transmitted when another device 101 calls the getData operation. The request message 401 has an identification ID “100020”. Since this identification ID is the first access, there is no response message 303 associated with the database 211. Therefore, the service device 102 executes the service logic 302 and creates a response message 303. As a result of executing the service logic 302, a specific response message 303 is created. Here, when the connection is disconnected during the processing of the service logic 302, since the identification ID is given to the request message 401, the service logic 302 is executed to the end. Then, a response message 303 is created and associated with the identification ID “100020” and held. When the request message 401 is transmitted again from the other apparatus 101, the response message 303 associated with the identification ID “100020” exists, so that the message is transmitted without executing the service logic 302. Then, the information of the response message 303 associated with the identification ID “100020” is deleted from the database 211.

また、サービスロジック302の処理を実行中にコネクションが切断されなかった場合は、サービスロジック302を実行して作成したレスポンスメッセージ303を他の装置101にそのまま送信する。   If the connection is not disconnected during the processing of the service logic 302, the response message 303 created by executing the service logic 302 is transmitted to the other apparatus 101 as it is.

ここで、他の装置101から識別IDのみが送信された場合に、装置間で送受信されるメッセージを図5に示す。識別IDの情報だけをもつリクエストメッセージ501が送信される。サービス装置102では、送信された識別ID「100020」に紐付けされたレスポンスメッセージが格納されているか否かを判断する。判断した結果、紐付けされたメッセージ303が存在すれば、図4と同様にそのメッセージを送信し、格納されているメッセージの情報をデータベース211から削除する。しかし、紐付けされたメッセージ303が存在しなかった場合、識別IDのみで実行するサービスが不明なため、フォルトのメッセージを具体的なレスポンスメッセージ502として作成する。このサービス実行に失敗したことを表すレスポンスメッセージ502が他の装置101に送信される。   Here, FIG. 5 shows a message transmitted and received between devices when only the identification ID is transmitted from another device 101. A request message 501 having only identification ID information is transmitted. The service apparatus 102 determines whether or not a response message associated with the transmitted identification ID “100020” is stored. If the determined message 303 exists as a result of the determination, the message is transmitted in the same manner as in FIG. 4 and the stored message information is deleted from the database 211. However, if the associated message 303 does not exist, the service to be executed with only the identification ID is unknown, so a fault message is created as a specific response message 502. A response message 502 indicating that the service execution has failed is transmitted to the other apparatus 101.

上述したサービス装置102におけるデータベース211が保持する情報の一例を図6に示す。図4に示すリクエストメッセージ401のサービスを実行処理中にコネクションが切断された場合、識別ID「100020」がレスポンスメッセージと共に格納される(601)。この例では、識別ID「100120」もレスポンスメッセージと共に格納されている(602)。また、この例では、他に、保存期間が記述してある。601では残り60分となっており、602では残り120分となっている。これは、サービス装置102のデータベース211において、データを保存しておく期間を設けた例である。   An example of information held in the database 211 in the service device 102 described above is shown in FIG. When the connection is disconnected during the execution process of the service of the request message 401 shown in FIG. 4, the identification ID “100020” is stored together with the response message (601). In this example, the identification ID “100120” is also stored together with the response message (602). In this example, a storage period is also described. 601 has 60 minutes remaining, and 602 has 120 minutes remaining. This is an example in which a period for storing data is provided in the database 211 of the service apparatus 102.

他の装置101がサービスの実行要求を行った場合に、コネクションが切断される可能性は、二つある。一つは、ネットワーク障害やタイムアウトなどによる、他の装置101が意図していない切断である。この場合、他の装置101がリトライを行う可能性が高い。しかし、他の装置101が何らかの理由により、意図的に切断を行う場合もある。この場合、後で実行する可能性もあるが、実行を行わない場合もある。そのため、二度とリトライが発生しないようなメッセージが存在してしまう。二度とアクセスされないメッセージをいつまでもデータベースに保管しておくのは、よくないので、ある一定の保存期間を設けるのが望ましい。   There are two possibilities of disconnecting the connection when another apparatus 101 makes a service execution request. One is disconnection unintended by the other device 101 due to a network failure or timeout. In this case, there is a high possibility that another device 101 will retry. However, the other apparatus 101 may intentionally disconnect for some reason. In this case, there is a possibility that it will be executed later, but there is a case where it is not executed. Therefore, there will be a message that will never retry. It is not good to keep messages that are never accessed again in the database, so it is desirable to have a certain retention period.

この保存期間は、サービス装置102の作成者が自由に設定するか、他の装置101からのリクエストメッセージに情報として付与されても良い。この保存期間を過ぎたデータは削除するが、削除された後にその識別IDでリクエストメッセージを送信してきた場合、図4に示すように、サービスのメッセージを含んでいれば、サービスロジックの実行が行われるので問題ない。但し、図5に示すように、識別IDのみのリクエストメッセージの場合は、フォルトレスポンスメッセージが返ることになる。   This storage period may be freely set by the creator of the service device 102 or may be given as information to a request message from another device 101. The data that has passed this storage period is deleted. However, if a request message is transmitted with the identification ID after being deleted, the service logic is executed if a service message is included as shown in FIG. Will not be a problem. However, as shown in FIG. 5, in the case of a request message with only an identification ID, a fault response message is returned.

次に、本実施形態におけるサービス装置102の処理を、図7に示すフローチャートを用いて説明する。メッセージ受信部202が他の装置101から送られてきたリクエストメッセージ201を受信する(S701)。次に、コネクション切断検知部203がコネクションが切断されていないかを常に監視する(S702)。切断を検知した場合には、すぐにメッセージ受信部202に知らせる。通知された情報は、その他の全ての処理部に伝えられる。   Next, the processing of the service device 102 in this embodiment will be described using the flowchart shown in FIG. The message receiving unit 202 receives the request message 201 sent from the other apparatus 101 (S701). Next, the connection disconnection detection unit 203 always monitors whether the connection is disconnected (S702). When the disconnection is detected, the message receiving unit 202 is immediately notified. The notified information is transmitted to all other processing units.

次に、メッセージ解析部204がリクエストメッセージ201に識別IDが付与されているか否かを判定する(S703)。判定した結果、リクエストメッセージ201に識別IDが付与されていなければ(S703でNO)、呼び出すサービスを特定し(S704)、処理がサービスロジック制御部205へ移る。サービスロジック制御部205では、メッセージ解析部204が特定したサービスに基づいてサービスロジック206を実行する(S705)。リクエストメッセージ201が上述したgetDataオペレーションを呼び出すリクエストメッセージ301の場合は、サービスロジック302が実行される。   Next, the message analysis unit 204 determines whether or not an identification ID is given to the request message 201 (S703). As a result of the determination, if an identification ID is not given to the request message 201 (NO in S703), the service to be called is specified (S704), and the process proceeds to the service logic control unit 205. The service logic control unit 205 executes the service logic 206 based on the service specified by the message analysis unit 204 (S705). When the request message 201 is the request message 301 for calling the above-described getData operation, the service logic 302 is executed.

ここで、サービスロジック206の実行中に、コネクション切断検知部203がコネクションの切断を検知しなければ(S706でNO)、メッセージ作成部207がサービスロジックの結果を含むレスポンスメッセージ209を作成する(S707)。次に、メッセージ送信部208が、作成されたレスポンスメッセージ209を他の装置101に送信し(S708)、この処理を終了する。   If the connection disconnection detection unit 203 does not detect disconnection during execution of the service logic 206 (NO in S706), the message creation unit 207 creates a response message 209 including the service logic result (S707). ). Next, the message transmission unit 208 transmits the created response message 209 to the other apparatus 101 (S708), and the process ends.

一方、コネクション切断検知部203がコネクションの切断を検知すると(S706でYES)、サービスロジック制御部205はサービスロジック206の実行を中断し(S709)、この処理を終了する。このサービスロジックの中断方法については、いくつか方法が考えられる。例えば、スレッドを別にしてサービスロジックの実行を行っておき、中断を検知すると、スレッドを止める。或いは、サービスロジックにキャンセルメソッドを用意しておき、そのメソッドを呼び出すなどである。尚、中断方法は、どのように実装されていても構わない。   On the other hand, when the connection disconnection detection unit 203 detects the disconnection of the connection (YES in S706), the service logic control unit 205 interrupts the execution of the service logic 206 (S709) and ends this process. There are several possible methods for interrupting this service logic. For example, the service logic is executed separately for each thread, and when an interruption is detected, the thread is stopped. Alternatively, a cancel method is prepared in the service logic and the method is called. The interruption method may be implemented in any way.

また、メッセージ解析部204が、上述のリクエストメッセージ401のように、識別IDが付与されているリクエストメッセージであると判定すると(S703でYES)、処理が未送信メッセージ管理部210へ移る。未送信メッセージ管理部210では、識別ID「100020」に対応するレスポンスメッセージがデータベース211に存在するか否かを判定する(S710)。判定した結果、識別ID「100020」が付与されたリクエストメッセージを初めて受信したのであれば、データベース211には存在しない(S710でNO)。そこで、メッセージ解析部204がそのメッセージを解析し、何のサービスの呼び出しかを特定する(S711)。尚、リクエストメッセージ401の場合、サービス呼び出しの情報が含まれているので、何の呼び出しかを特定することが可能である(S711でYES)。リクエストメッセージ401は、getDataオペレーションを呼び出すリクエストメッセージである。   If the message analysis unit 204 determines that the request message is given an identification ID as in the request message 401 described above (YES in S703), the process proceeds to the unsent message management unit 210. The unsent message management unit 210 determines whether a response message corresponding to the identification ID “100020” exists in the database 211 (S710). If it is determined that the request message with the identification ID “100020” is received for the first time, it does not exist in the database 211 (NO in S710). Therefore, the message analysis unit 204 analyzes the message and specifies what service is called (S711). Note that in the case of the request message 401, since service call information is included, it is possible to specify what call is being made (YES in S711). A request message 401 is a request message for calling a getData operation.

次に、サービスロジック制御部205が、メッセージ解析部204が特定したサービスに基づいてサービスロジック206を実行する(S712)。この場合、上述したサービスロジック302が実行される。次に、メッセージ作成部207がサービスロジック206の結果を含むレスポンスメッセージ209を作成する(S713)。次に、コネクション切断検知部203がコネクションの切断を検知していなければ(S714でNO)、メッセージ送信部208は、作成されたレスポンスメッセージ209を他の装置101に送信し(S715)、この処理を終了する。   Next, the service logic control unit 205 executes the service logic 206 based on the service specified by the message analysis unit 204 (S712). In this case, the service logic 302 described above is executed. Next, the message creation unit 207 creates a response message 209 including the result of the service logic 206 (S713). Next, if the connection disconnection detection unit 203 has not detected disconnection of the connection (NO in S714), the message transmission unit 208 transmits the created response message 209 to the other device 101 (S715), and this process Exit.

一方、コネクション切断検知部203が、サービスロジックの実行中にコネクションの切断を検知していた場合(S714でYES)、未送信メッセージ管理部210に処理が移る。未送信メッセージ管理部210がデータベース211に識別ID「100020」と作成したレスポンスメッセージ303を紐付けて601のように保存し(S716)、この処理を終了する。   On the other hand, if the connection disconnection detection unit 203 detects disconnection of the connection during execution of the service logic (YES in S714), the process proceeds to the unsent message management unit 210. The unsent message management unit 210 associates the created response message 303 with the identification ID “100020” in the database 211 and stores it as 601 (S716), and ends this processing.

また、上述したS710で、未送信メッセージ管理部210が、データベース211に識別ID「100020」に対応するレスポンスメッセージが存在すると判定した場合、処理がメッセージ送信部208へ移る。ここで、メッセージ送信部208は、その紐付けされたレスポンスメッセージを他の装置101に送信する(S717)。そして、データベース211から送信が終了したレスポンスメッセージに対応する情報(601)を削除し(S718)、この処理を終了する。   If the unsent message management unit 210 determines in S710 described above that a response message corresponding to the identification ID “100020” exists in the database 211, the process proceeds to the message transmission unit 208. Here, the message transmission unit 208 transmits the associated response message to the other device 101 (S717). Then, the information (601) corresponding to the response message whose transmission has been completed is deleted from the database 211 (S718), and this process is terminated.

また、上述したS711で、メッセージ解析部204がリクエストメッセージ201を解析し、何の呼び出しかを特定できない場合は、処理がメッセージ作成部207へ移る。具体的には、データベース211の保存期間が切れてデータが削除されていた場合、そもそも識別IDがでたらめだった場合、識別IDに対応するレスポンスメッセージが存在しない場合などが特定できない場合である。これらの場合、メッセージ作成部207では、フォルト情報を含むレスポンスメッセージを作成する(S719)。具体的には、図5に示すレスポンスメッセージ502が作成される。   In S711 described above, if the message analysis unit 204 analyzes the request message 201 and cannot identify what call, the process proceeds to the message creation unit 207. Specifically, the case where the storage period of the database 211 has expired and the data has been deleted, the case where the identification ID is random, or the case where the response message corresponding to the identification ID does not exist cannot be specified. In these cases, the message creation unit 207 creates a response message including fault information (S719). Specifically, a response message 502 shown in FIG. 5 is created.

次に、コネクション切断検知部203がコネクションの切断を検知していなければ(S720でNO)、メッセージ送信部208が、作成されたレスポンスメッセージ502を他の装置101に送信し(S715)、この処理を終了する。しかし、コネクション切断検知部203がコネクションの切断を検知していれば(S720でYES)、そのまま、この処理を終了する。また、作成したフォルトのメッセージはデータベース211に保存しない。   Next, if the connection disconnection detection unit 203 has not detected disconnection of the connection (NO in S720), the message transmission unit 208 transmits the created response message 502 to the other device 101 (S715). Exit. However, if the connection disconnection detection unit 203 detects the disconnection of the connection (YES in S720), the process is terminated as it is. The created fault message is not stored in the database 211.

ここで、サービス装置102の未送信メッセージ管理部210がデータベース211の保存期間を過ぎたデータを削除する処理を、図8に示すフローチャートを用いて説明する。例えば、データベース211の保存期間が残り0分になっていた場合、そのデータは、データベース211から削除される。削除するタイミングとして、この例では、他の装置101からリクエストメッセージ201を受信した場合とする。また、この処理は、他の装置101からリクエストメッセージ201を受信した場合に、削除するデータがあるか否かを確認するので、S701とS702の処理の間で行われる。   Here, a process in which the unsent message management unit 210 of the service apparatus 102 deletes data whose storage period of the database 211 has passed will be described with reference to the flowchart shown in FIG. For example, when the storage period of the database 211 is 0 minutes, the data is deleted from the database 211. In this example, it is assumed that the request message 201 is received from another device 101 as the timing of deletion. In addition, when the request message 201 is received from the other apparatus 101, this process is performed between the processes of S701 and S702 because it is confirmed whether there is data to be deleted.

まず、メッセージ受信部202がリクエストメッセージ201を受信し(S701)、未送信メッセージ管理部210がデータベース211に保存期間が過ぎたデータが存在するか否かを調べる(S801)。ここで、保存期間を過ぎたデータが存在しない場合(S801でNO)は、そのまま、処理がコネクション切断検知部203へ移る。一方、保存期間が残り0分になっていた場合など、保存期間を過ぎたデータが存在すれば(S801でYES)、そのデータを削除する(S802)。そして、処理がコネクション切断検知部203へ移る。   First, the message reception unit 202 receives the request message 201 (S701), and the unsent message management unit 210 checks whether there is data in the database 211 whose storage period has passed (S801). If there is no data that has passed the storage period (NO in S801), the process proceeds to the connection disconnection detection unit 203 as it is. On the other hand, if there is data that has passed the storage period, such as when the storage period is 0 minutes remaining (YES in S801), the data is deleted (S802). Then, the processing moves to the connection disconnection detection unit 203.

尚、データを削除するタイミングは、これだけに限らず、他の場合でも良い。例えば、メッセージ送信部208がレスポンスメッセージ209を送信した後、削除しても良い。また、処理のタイミングではなく、データベース211を常に監視し、保存期間が過ぎたデータを即座に検知して削除するようにしても良い。   Note that the timing of deleting data is not limited to this, and may be other cases. For example, the message transmission unit 208 may delete the response message 209 after transmitting it. Further, instead of the processing timing, the database 211 may always be monitored, and data whose storage period has passed may be immediately detected and deleted.

以上のように、サービス装置102におけるこの処理を利用して、サービスを利用する他の装置101が効率的にデータを取得することも可能となる。例えば、他の装置101は識別IDを付与したリクエストメッセージ401をサービス装置102に送信する。サービス装置102で実行されるサービスロジック302が、非常に重い処理であることがわかっていれば、他の装置101は意図的にコネクションを切断する。そして、しばらく経ってから、再び、リクエストメッセージ401をサービス装置102に送信する。これにより、サービス装置102では、既にサービスロジック302の実行が終了しており、レスポンスメッセージ303がデータベース211に保存されている。従って、他の装置101に対して、すぐにレスポンスメッセージが送信される。   As described above, by using this processing in the service device 102, it becomes possible for another device 101 that uses the service to efficiently acquire data. For example, the other device 101 transmits a request message 401 to which the identification ID is assigned to the service device 102. If the service logic 302 executed by the service device 102 is known to be a very heavy process, the other device 101 intentionally disconnects the connection. Then, after a while, the request message 401 is transmitted to the service device 102 again. As a result, in the service device 102, the execution of the service logic 302 has already been completed, and the response message 303 is stored in the database 211. Accordingly, a response message is immediately transmitted to the other device 101.

このようにすることで、他の装置101は、サービス装置102からのレスポンスメッセージを取得するために、ずっとコネクションを維持しておく必要がない。サービス装置102が処理を行っている間に、他の処理をすることも可能であり、コネクションを長くキープしてタイムアウトが発生してしまうという問題も解消される。   In this way, the other apparatus 101 does not need to maintain the connection all the time in order to obtain the response message from the service apparatus 102. While the service apparatus 102 is performing processing, it is possible to perform other processing, and the problem of keeping a connection long and causing a timeout is also solved.

本実施形態によれば、サービスにおいて、サービスロジックの実行を必要最低限に抑えることができ、メモリが少ない組込み機器での負荷を軽減することが可能となる。   According to the present embodiment, in the service, the execution of the service logic can be suppressed to the minimum necessary, and the load on the embedded device with a small amount of memory can be reduced.

Claims (5)

他の装置とネットワークを介してメッセージを送受信する通信装置であって、
前記他の装置からサービスの実行を要求するメッセージを受信する受信手段と、
前記他の装置とのコネクションが切断されたか否かを監視する監視手段と、
前記メッセージに該メッセージを識別するための情報が付与されているか否かを判定する判定手段と、
前記受信されたメッセージのサービスを実行中に前記他の装置とのコネクションが切断された場合であって、前記判定手段が前記情報は付与されていると判定した場合、当該サービスを実行した結果を前記情報と共に保存する保存手段と、
前記受信されたメッセージのサービスを実行中に前記他の装置とのコネクションが切断された場合であって、前記判定手段が前記情報は付与されていないと判定した場合、前記受信されたメッセージのサービスの実行を中断させる制御手段と、
前記受信手段により受信されたメッセージに前記保存手段に保存された前記情報が付与されていた場合、前記情報と共に保存された実行結果を前記他の装置へ送信する送信手段と、
を有することを特徴とする通信装置。
A communication device that transmits and receives messages to and from other devices via a network,
Receiving means for receiving a message requesting execution of a service from the other device;
Monitoring means for monitoring whether or not the connection with the other device is disconnected;
Determining means for determining whether or not information for identifying the message is attached to the message;
When the connection with the other device is disconnected while executing the service of the received message, and the determination unit determines that the information is given, the result of executing the service is and storage means for storing together before Kijo report,
If the connection with the other device is disconnected while the service of the received message is being executed, and the determination unit determines that the information is not given, the service of the received message Control means for interrupting the execution of
When the information stored in the storage unit is added to the message received by the reception unit, a transmission unit that transmits the execution result stored together with the information to the other device;
A communication apparatus comprising:
前記送信手段は、前記情報と共に保存された実行結果を前記他の装置へ送信した場合には当該情報と実行結果とを削除することを特徴とする請求項1に記載の通信装置。   The communication device according to claim 1, wherein the transmission unit deletes the information and the execution result when transmitting the execution result stored together with the information to the other device. 前記保存手段は、前記情報と共に保存された実行結果の保存期間を管理し、特定の保存期間が過ぎた場合、その情報と実行結果とを削除することを特徴とする請求項1又は2に記載の通信装置。   3. The storage unit manages a storage period of an execution result stored together with the information, and deletes the information and the execution result when a specific storage period has passed. Communication equipment. 他の装置とネットワークを介してメッセージを送受信する通信装置の処理方法であって、
受信手段が、前記他の装置からサービスの実行を要求するメッセージを受信する受信工程と、
監視手段が、前記他の装置とのコネクションが切断されたか否かを監視する監視工程と、
判定手段が、前記メッセージに該メッセージを識別するための情報が付与されているか否かを判定する判定工程と、
記受信されたメッセージのサービスを実行中に前記他の装置とのコネクションが切断された場合であって、前記判定工程で前記情報は付与されていると判定した場合、保存手段が、当該サービスを実行した結果を前記情報と共に保存する保存工程と、
前記受信されたメッセージのサービスを実行中に前記他の装置とのコネクションが切断された場合であって、前記判定工程で前記情報は付与されていないと判定した場合、制御手段が、前記受信されたメッセージのサービスの実行を中断させる制御工程と、
送信手段が、前記受信工程において受信されたメッセージに前記保存工程において保存された前記情報が付与されていた場合、前記情報と共に保存された実行結果を前記他の装置へ送信する送信工程と、
を有することを特徴とする通信装置の処理方法。
A processing method of a communication device for transmitting / receiving a message to / from another device via a network,
A receiving step for receiving a message requesting execution of a service from the other device;
A monitoring step for monitoring whether or not the connection with the other device is disconnected;
A determining step for determining whether or not information for identifying the message is given to the message;
Even if the connection with the other devices during the service before Symbol received message is disconnected, the determination step by the information if it is determined to have been granted, storage means, those wherein a storing step of storing with prior Kijo report the results of running the service,
When it is determined that the information is not given in the determination step when the connection with the other device is disconnected while executing the service of the received message, the control means receives the received A control process for interrupting the execution of the service of the message,
When the transmission means is provided with the information stored in the storage step to the message received in the reception step, a transmission step of transmitting the execution result stored together with the information to the other device;
A processing method for a communication apparatus, comprising:
コンピュータを請求項1乃至の何れか1項に記載された通信装置の各手段として機能させるためのプログラム。 The program for functioning a computer as each means of the communication apparatus as described in any one of Claims 1 thru | or 3 .
JP2009130937A 2009-05-29 2009-05-29 Communication apparatus and processing method thereof Expired - Fee Related JP5432595B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2009130937A JP5432595B2 (en) 2009-05-29 2009-05-29 Communication apparatus and processing method thereof
US12/767,232 US9258391B2 (en) 2009-05-29 2010-04-26 Processing method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009130937A JP5432595B2 (en) 2009-05-29 2009-05-29 Communication apparatus and processing method thereof

Publications (2)

Publication Number Publication Date
JP2010277433A JP2010277433A (en) 2010-12-09
JP5432595B2 true JP5432595B2 (en) 2014-03-05

Family

ID=43424320

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009130937A Expired - Fee Related JP5432595B2 (en) 2009-05-29 2009-05-29 Communication apparatus and processing method thereof

Country Status (1)

Country Link
JP (1) JP5432595B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH05324526A (en) * 1992-05-18 1993-12-07 Hitachi Ltd Remote computing system
JP3776706B2 (en) * 2000-10-04 2006-05-17 富士通株式会社 Data communication apparatus, data communication method, and computer-readable recording medium recording data communication program
KR101316150B1 (en) * 2006-01-25 2013-10-08 파나소닉 주식회사 Terminal device, server device, and digital contents distribution system

Also Published As

Publication number Publication date
JP2010277433A (en) 2010-12-09

Similar Documents

Publication Publication Date Title
JP4744171B2 (en) Computer system and storage control method
JP6198737B2 (en) System, method and configuration for dynamic discovery of resource servers in a traffic director environment
JP4794143B2 (en) System and method for managing cache objects using notification bonds
US10609123B2 (en) Hybrid quorum policies for durable consensus in distributed systems
JP4205323B2 (en) Distribution system, distribution server and distribution method, distribution program
US8898312B2 (en) Element terminal and communication system
US7500251B2 (en) Method and system for managing programs for web service system
JP2013097548A (en) Information processing system, information processing device, client terminal, information processing method and program
JP2015511421A (en) Remote network management system and operation method thereof
US9092396B2 (en) Standby system device, a control method, and a program thereof
US10721135B1 (en) Edge computing system for monitoring and maintaining data center operations
JP6153639B2 (en) Protocol automatic setting method for PLC system
CN110324384B (en) Data pushing method and device
JP5529596B2 (en) Processing method, processing device, communication device, and program
KR102567900B1 (en) Method and Apparatus for Ensuring Continuous Device Operational Stability in Cloud Degraded Mode
JP5432595B2 (en) Communication apparatus and processing method thereof
JP2008304982A (en) Information management method and information processor
US9258391B2 (en) Processing method and apparatus
JP2015114952A (en) Network system, monitoring control unit, and software verification method
JP2003256390A (en) Distributed object system
JP2006018376A (en) Network communication system
JP5691248B2 (en) Task takeover program, processing device, and computer system
JP2014178832A (en) Service providing system, server device, client terminal, failure detection method, and program
JP3952031B2 (en) Distributed object system and server
CN116996505B (en) File exchange control method and system based on scheduling engine

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120529

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130221

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130304

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130424

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20131206

R151 Written notification of patent or utility model registration

Ref document number: 5432595

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees