JP2016110175A - Client device, communication system, and data processing method and program - Google Patents

Client device, communication system, and data processing method and program Download PDF

Info

Publication number
JP2016110175A
JP2016110175A JP2014243741A JP2014243741A JP2016110175A JP 2016110175 A JP2016110175 A JP 2016110175A JP 2014243741 A JP2014243741 A JP 2014243741A JP 2014243741 A JP2014243741 A JP 2014243741A JP 2016110175 A JP2016110175 A JP 2016110175A
Authority
JP
Japan
Prior art keywords
client
request
representative
response
client device
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.)
Granted
Application number
JP2014243741A
Other languages
Japanese (ja)
Other versions
JP6324304B2 (en
Inventor
淳平 羽藤
Junpei Hado
淳平 羽藤
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.)
Mitsubishi Electric Corp
Original Assignee
Mitsubishi Electric 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 Mitsubishi Electric Corp filed Critical Mitsubishi Electric Corp
Priority to JP2014243741A priority Critical patent/JP6324304B2/en
Publication of JP2016110175A publication Critical patent/JP2016110175A/en
Application granted granted Critical
Publication of JP6324304B2 publication Critical patent/JP6324304B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

PROBLEM TO BE SOLVED: To reduce a load on a server device even in a server device-alone structure without reinforcing the server device.SOLUTION: When acquiring a request to a server device 105, a representative client decision unit 208 decides whether a representative client role that is a role of handling a request as a representative is assigned to the own device in relation to the acquired request. If the representative client role for the acquired request is assigned, a representative client processing unit 210 decides whether a response to the acquired request is present in a receiving data management unit 211. If the response is absent from the receiving data management unit 211, a server communication unit 212 transmits the acquired request to the server device 105. If the representative client role for the acquired request is not assigned, an other client communication unit 209 transmits the acquired request to any other client device.SELECTED DRAWING: Figure 3

Description

本発明は、クライアント・サーバシステムに関する。   The present invention relates to a client / server system.

サーバ装置(以下、単にサーバともいう)が様々な処理やデータをクライアント装置(以下、単にクライアントともいう)に提供するクライアント・サーバシステムにおいて、クライアント装置の台数、もしくはクライアント装置からサーバ装置への要求数が増大した場合、その増加率に応じてサーバ装置の処理負荷は増大する。   In a client / server system in which a server device (hereinafter simply referred to as a server) provides various processing and data to a client device (hereinafter also simply referred to as a client), the number of client devices or requests from the client device to the server device When the number increases, the processing load of the server apparatus increases according to the increase rate.

サーバ装置の処理負荷を分散・平準化する方法として、以下の方法が存在する。
サーバ装置とクライアント装置の間にロードバランサーを配置し、クライアント装置はロードバランサーに対して要求を送信し、ロードバランサーがある一定の基準に従ってその要求を、複数あるサーバ装置のうち、どのサーバ装置が処理するかを決定する。
そして、ロードバランサーが、処理を行わせるサーバ装置に要求に対処するよう命令を発行する。
これにより、個々のサーバ装置の処理負荷を分散・平準化させることができる。
The following methods exist as methods for distributing and leveling the processing load of the server device.
A load balancer is placed between the server device and the client device, the client device sends a request to the load balancer, and which load balancer processes the request according to a certain standard, which server device handles the request Decide.
Then, the load balancer issues an instruction to deal with the request to the server device that performs processing.
Thereby, the processing load of each server apparatus can be distributed and leveled.

しかし、この先行技術では複数のサーバ装置とロードバランサーをサーバシステム側で確保する必要があり、サーバ装置が単体のサーバシステムを構築する場合には、当該技術を利用できないという課題がある。   However, in this prior art, it is necessary to secure a plurality of server devices and a load balancer on the server system side, and there is a problem that the technology cannot be used when the server device constructs a single server system.

また、サーバ装置の処理負荷の分散・平準化技術として、例えば、特許文献1に記載される方法が存在する。
特許文献1の技術では、サーバ装置と複数のクライアント装置で構成され、クライアント装置にソフトウエアイメージを配布するシステムにおいて、サーバ装置がクライアント装置を複数のグループに分類し、グループごとに代表クライアント装置を決め、サーバ装置は代表クライアント装置へソフトウエアイメージを配布する。
代表クライアント装置は、同一グループに所属する他のクライアント装置からの要求に基づいてソフトウエアイメージを同一グループに属するクライアント装置に配布する。
As a technique for distributing and leveling the processing load of the server device, for example, there is a method described in Patent Document 1.
In the technique of Patent Document 1, in a system configured with a server device and a plurality of client devices and distributing software images to the client devices, the server device classifies the client devices into a plurality of groups, and a representative client device is assigned to each group. The server device distributes the software image to the representative client device.
The representative client device distributes the software image to client devices belonging to the same group based on requests from other client devices belonging to the same group.

国際公開WO2011/135629号International Publication WO2011 / 135629

しかし、特許文献1の技術では、サーバ装置が複数のクライアント装置のグループ分類と代表クライアント装置の決定を行う必要がある。
クライアント装置のシステムへの参加、離脱が頻繁に発生するような、例えば高速移動体からの無線通信によるシステム参加が行われる状況においては、サーバ装置が頻繁にグループ管理、代表クライアント装置の決定を行う必要があり、サーバ装置の処理負荷が増加してしまうという課題がある。
However, in the technique of Patent Document 1, it is necessary for the server device to perform group classification of a plurality of client devices and determination of a representative client device.
In situations where client devices frequently join or leave the system, for example, in situations where system participation is performed by wireless communication from a high-speed mobile body, the server device frequently performs group management and representative client device determination. There is a problem that the processing load of the server device increases.

本発明は、上述の課題を解決することを主な目的とし、サーバ装置を増強させることなく、また、サーバ装置が単体で構成される場合でも、サーバ装置の負荷を軽減することを主な目的とする。   The main object of the present invention is to reduce the load on the server device without increasing the server device and even when the server device is configured as a single unit. And

本発明に係るクライアント装置は、
複数のクライアント装置が含まれる通信システムに含まれるクライアント装置であって、
いずれかのクライアント装置により生成されたサーバ装置へのリクエストを取得した場合に、取得した取得リクエストについて、代表してリクエストを処理する役割である代表クライアントロールが自装置に割り当てられているか否かを判定する代表クライアント判定部と、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられている場合に、前記取得リクエストに対応する前記サーバ装置からのレスポンスが、自装置がアクセスできるキャッシュ領域にキャッシュされているか否かを判定する代表クライアント処理部と、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられており、前記取得リクエストに対応するレスポンスが前記キャッシュ領域にキャッシュされていない場合に、前記取得リクエストを前記サーバ装置に送信するサーバ通信部と、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられていない場合に、前記取得リクエストを他のクライアント装置に送信する他クライアント通信部とを有する。
A client device according to the present invention provides:
A client device included in a communication system including a plurality of client devices,
If a request to the server device generated by any client device is acquired, whether or not a representative client role that is a role for processing the request on behalf of the acquired acquisition request is assigned to the own device A representative client determination unit for determining;
When a representative client role for the acquisition request is assigned to the own device, it is determined whether a response from the server device corresponding to the acquisition request is cached in a cache area accessible by the own device. A representative client processing unit;
A server communication unit that transmits the acquisition request to the server device when a representative client role for the acquisition request is assigned to the own device and a response corresponding to the acquisition request is not cached in the cache area; ,
And an other client communication unit that transmits the acquisition request to another client device when a representative client role for the acquisition request is not assigned to the own device.

本発明では、代表クライアントロールが割り当てられているクライアント装置にリクエストの処理を集約しているため、クライアント装置ごとにリクエストが送信され、サーバ装置が個別にレスポンスを返信するという事態を回避することができる。
また、代表クライアントロールが割り当てられているクライアント装置においてレスポンスがキャッシュされている場合には、サーバ装置にリクエストを送信することなく、リクエスト生成元のクライアント装置にレスポンスを提供することができる。
このため、サーバ装置を増強させることなく、また、サーバ装置が単体で構成される場合でも、サーバ装置の負荷を軽減することができる。
In the present invention, since the request processing is consolidated to the client device to which the representative client role is assigned, it is possible to avoid a situation in which the request is transmitted for each client device and the server device individually returns a response. it can.
Further, when the response is cached in the client device to which the representative client role is assigned, the response can be provided to the client device that has generated the request without transmitting the request to the server device.
Therefore, the load on the server device can be reduced without increasing the number of server devices and even when the server device is configured as a single unit.

実施の形態1に係るサーバ装置及びクライアント装置のハードウエア構成例を示す図。FIG. 3 is a diagram illustrating a hardware configuration example of a server device and a client device according to the first embodiment. 実施の形態1に係るサーバ装置の内部処理モジュールの構成例を示す図。FIG. 3 is a diagram illustrating a configuration example of an internal processing module of the server device according to the first embodiment. 実施の形態1に係るクライアント装置の内部処理モジュールの構成例を示す図。FIG. 3 is a diagram illustrating a configuration example of an internal processing module of the client device according to the first embodiment. 実施の形態1に係るリクエスト生成元のクライアント装置の動作例を示すフローチャート図。FIG. 4 is a flowchart showing an operation example of a client device that is a request generation source according to the first embodiment. 実施の形態1に係るリクエスト送信先のクライアント装置の動作例を示すフローチャート図。FIG. 3 is a flowchart showing an operation example of a client device that is a request transmission destination according to the first embodiment. 実施の形態1に係るAPI呼び出し例とリクエスト例とを示す図。The figure which shows the example of API call which concerns on Embodiment 1, and the example of a request. 実施の形態1に係るリクエスト生成部の動作例を示すフローチャート図。FIG. 4 is a flowchart showing an operation example of a request generation unit according to the first embodiment. 実施の形態1に係る代表クライアント判定部の動作例を示すフローチャート図。FIG. 6 is a flowchart showing an operation example of a representative client determination unit according to the first embodiment. 実施の形態1に係る代表クライアント判定部の動作例を示すフローチャート図。FIG. 6 is a flowchart showing an operation example of a representative client determination unit according to the first embodiment. 実施の形態1に係る代表クライアント処理部の動作例を示すフローチャート図。FIG. 3 is a flowchart showing an operation example of a representative client processing unit according to the first embodiment. 実施の形態1に係る受信データ管理部でのリクエストとレスポンス保存例を示す図。The figure which shows the example of the request | requirement in the received data management part which concerns on Embodiment 1, and a response preservation | save. 実施の形態2に係る仮想空間上のノードとキーの配置例を示す図。FIG. 10 is a diagram illustrating an arrangement example of nodes and keys on a virtual space according to the second embodiment. 実施の形態2に係る仮想空間上のノードとキーの配置例を示す図。FIG. 10 is a diagram illustrating an arrangement example of nodes and keys on a virtual space according to the second embodiment. 実施の形態2に係る代表クライアント処理部の動作例を示す図。FIG. 10 is a diagram illustrating an operation example of a representative client processing unit according to the second embodiment. 実施の形態3に係る予備代表クライアントの情報をHTTPリクエストに結合した例を示す図。The figure which shows the example which couple | bonded the information of the backup representative client which concerns on Embodiment 3 with the HTTP request. 実施の形態3に係る予備代表クライアントの情報をHTTPリクエストに結合した例を示す図。The figure which shows the example which couple | bonded the information of the backup representative client which concerns on Embodiment 3 with the HTTP request. 実施の形態3に係るサーバ装置の動作例を示すフローチャート図。FIG. 10 is a flowchart showing an operation example of the server apparatus according to the third embodiment. 実施の形態4に係る代表クライアント処理部の動作例を示すフローチャート図。FIG. 10 is a flowchart showing an operation example of a representative client processing unit according to the fourth embodiment. 実施の形態4に係る代表クライアント処理部の動作例を示すフローチャート図。FIG. 10 is a flowchart showing an operation example of a representative client processing unit according to the fourth embodiment. 実施の形態4に係る代表クライアント処理部の動作例を示すフローチャート図。FIG. 10 is a flowchart showing an operation example of a representative client processing unit according to the fourth embodiment. 実施の形態4に係るリクエストとリクエスト発行元とを管理するリストの例を示す図。The figure which shows the example of the list | wrist which manages the request which concerns on Embodiment 4, and a request issuer. 実施の形態4に係る代表クライアントとリクエスト発行元クライアントとの関係を示す図。The figure which shows the relationship between the representative client which concerns on Embodiment 4, and a request issuer client. 実施の形態4に係る代表クライアントとリクエスト発行元クライアントとの関係を示す図。The figure which shows the relationship between the representative client which concerns on Embodiment 4, and a request issuer client. 実施の形態4に係る代表クライアントとリクエスト発行元クライアントと代表クライアントクローンとの関係を示す図。The figure which shows the relationship between the representative client which concerns on Embodiment 4, a request issuing client, and a representative client clone. 実施の形態4に係る代表クライアントとリクエスト発行元クライアントと代表クライアントクローンとの関係を示す図。The figure which shows the relationship between the representative client which concerns on Embodiment 4, a request issuing client, and a representative client clone. 実施の形態4に係る代表クライアントとリクエスト発行元クライアントと代表クライアントクローンとの関係を示す図。The figure which shows the relationship between the representative client which concerns on Embodiment 4, a request issuing client, and a representative client clone. 実施の形態4に係る代表クライアントとリクエスト発行元クライアントと代表クライアントクローンとの関係を示す図。The figure which shows the relationship between the representative client which concerns on Embodiment 4, a request issuing client, and a representative client clone. 実施の形態4に係る代表クライアントとリクエスト発行元クライアントと代表クライアントクローンとの関係を示す図。The figure which shows the relationship between the representative client which concerns on Embodiment 4, a request issuing client, and a representative client clone. 実施の形態4に係る代表クライアント処理部の動作例を示すフローチャート図。FIG. 10 is a flowchart showing an operation example of a representative client processing unit according to the fourth embodiment. 実施の形態4に係る代表クライアント処理部の動作例を示すフローチャート図。FIG. 10 is a flowchart showing an operation example of a representative client processing unit according to the fourth embodiment. 実施の形態5に係る代表クライアント判定部の動作例を示すフローチャート図。FIG. 10 is a flowchart showing an operation example of a representative client determination unit according to the fifth embodiment. 実施の形態5に係る代表クライアント判定部の動作例を示すフローチャート図。FIG. 10 is a flowchart showing an operation example of a representative client determination unit according to the fifth embodiment. 実施の形態5に係る代表クライアント処理部の動作例を示すフローチャート図。FIG. 9 is a flowchart showing an operation example of a representative client processing unit according to the fifth embodiment. 実施の形態5に係る代表クライアント処理部の動作例を示すフローチャート図。FIG. 9 is a flowchart showing an operation example of a representative client processing unit according to the fifth embodiment. 実施の形態5に係る論理和リクエストとレスポンスとを管理するテーブルの例を図。FIG. 18 is a diagram illustrating an example of a table for managing a logical sum request and a response according to the fifth embodiment. 実施の形態5に係るレスポンスの例を示す図。FIG. 10 shows an example of a response according to the fifth embodiment.

実施の形態1.
以下にて、本実施の形態を説明する。
本実施の形態では、サーバ装置のリソースを増強させることなく、また、サーバ装置単体のみで構成した場合でも、サーバ装置の負荷軽減効果が得られるようにする。
このため、本実施の形態では、サーバ装置に負荷分散のための処理を行わせるのではなく、クライアント装置に負荷分散のための処理を行わせる。
Embodiment 1 FIG.
This embodiment will be described below.
In the present embodiment, the load reduction effect of the server device can be obtained without increasing the resources of the server device and even when the server device is configured by itself.
For this reason, in the present embodiment, the server apparatus is not allowed to perform load distribution processing, but the client apparatus is caused to perform load distribution processing.

***構成の説明***
図1は、本実施の形態に係るクライアント・サーバシステムの構成例を示す。
*** Explanation of configuration ***
FIG. 1 shows a configuration example of a client / server system according to the present embodiment.

図1に示すように、本実施の形態に係るクライアント・サーバシステムは、2台以上のクライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104と、1台以上のサーバ装置105が存在し、それぞれがネットワーク130を経由して接続されている。
クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104で構成されるシステムは、通信システム1000という。
なお、クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104は、あくまで複数のクライアント装置が存在する事を示すため、一つの例として4台のクライアント構成としている。
クライアント装置の台数は複数であれば構わず、4台以外の構成で構わない。
以下では、サーバ装置105を単にサーバともいい、クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104を単にクライアントともいう。
As shown in FIG. 1, the client / server system according to the present embodiment includes two or more client devices 101, a client device 102, a client device 103, a client device 104, and one or more server devices 105. Are connected via the network 130.
A system including the client device 101, the client device 102, the client device 103, and the client device 104 is referred to as a communication system 1000.
Note that the client device 101, the client device 102, the client device 103, and the client device 104 have a configuration of four clients as an example to show that there are a plurality of client devices.
The number of client devices may be plural, and a configuration other than four may be used.
Hereinafter, the server device 105 is simply referred to as a server, and the client device 101, the client device 102, the client device 103, and the client device 104 are also simply referred to as a client.

次に、クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104のハードウエア構成例を説明する。
なお、クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104のハードウエア構成例は共通しているため、以下では、代表として、クライアント装置101のハードウエア構成例を説明する。
以下の説明は、クライアント装置102、クライアント装置103、クライアント装置104にも同様に当てはまる。
Next, a hardware configuration example of the client device 101, the client device 102, the client device 103, and the client device 104 will be described.
Since the client device 101, the client device 102, the client device 103, and the client device 104 have the same hardware configuration example, the hardware configuration example of the client device 101 will be described below as a representative.
The following description applies to the client device 102, the client device 103, and the client device 104 as well.

クライアント装置101は、情報処理装置であり、CPU(Central Processing Unit)110、メモリ111、入力インタフェース112、出力インタフェース113、通信インタフェース114、永続記憶インタフェース115、ディスク116などの要素を内蔵し、それらがバス117で接続されている。   The client apparatus 101 is an information processing apparatus, and includes elements such as a CPU (Central Processing Unit) 110, a memory 111, an input interface 112, an output interface 113, a communication interface 114, a persistent storage interface 115, a disk 116, and the like. They are connected by a bus 117.

CPU110は、メモリ111に格納されているプログラムやデータ、各種要素からの割り込みやデータ受け処理を行い、クライアント装置101としての動作を実現する。
より具体的には、CPU110が、後述するアプリケーションロジック部206、リクエスト生成部207、代表クライアント判定部208、他クライアント通信部209、代表クライアント処理部210、受信データ管理部211、サーバ通信部212の機能を実現するプログラムを実行することで、クライアント装置101の後述する処理が行われる。
入力インタフェース112は、マウスやキーボードなどの入力デバイスが接続されるインタフェースであり、クライアント装置101のユーザは入力インタフェース112に接続された入力デバイスを操作して、クライアント装置101を操作する。
出力インタフェース113は、ディスプレイやスピーカーなどの出力デバイスが接続されるインタフェースであり、クライアント装置101のユーザは出力デバイスに出力される光や音などの刺激を元にクライアント装置101の状況を知覚する事が可能となる。
通信インタフェース114は、クライアント装置101がサーバ装置105や他クライアント装置102、クライアント装置103、クライアント装置104とデータの交換を行うためのインタフェースであり、ネットワーク130に接続される。
永続記憶インタフェース115は、ディスクなどの不揮発性の記憶装置が接続されるインタフェースであり、電源断後にも記憶したいデータや一時データの保存読み出しはこのインタフェースを通して行われる。
The CPU 110 implements an operation as the client apparatus 101 by performing an interrupt and data receiving process from programs and data stored in the memory 111 and various elements.
More specifically, the CPU 110 includes an application logic unit 206, a request generation unit 207, a representative client determination unit 208, another client communication unit 209, a representative client processing unit 210, a received data management unit 211, and a server communication unit 212, which will be described later. By executing a program that realizes the function, processing described later of the client device 101 is performed.
The input interface 112 is an interface to which an input device such as a mouse or a keyboard is connected. The user of the client apparatus 101 operates the client apparatus 101 by operating the input device connected to the input interface 112.
The output interface 113 is an interface to which an output device such as a display or a speaker is connected. The user of the client apparatus 101 perceives the situation of the client apparatus 101 based on a stimulus such as light or sound output to the output device. Is possible.
The communication interface 114 is an interface for the client device 101 to exchange data with the server device 105, the other client device 102, the client device 103, and the client device 104, and is connected to the network 130.
The permanent storage interface 115 is an interface to which a non-volatile storage device such as a disk is connected, and data to be stored and temporary data are stored and read after the power is turned off.

次に、サーバ装置105のハードウエア構成例を説明する。
サーバ装置105は、クライアント装置101〜104と同等の情報処理装置である。
サーバ装置105は、CPU120、メモリ121、入力インタフェース122、出力インタフェース123、通信インタフェース124、永続記憶インタフェース125、ディスク126などの要素を内蔵しており、それらがバス127で接続されている。
Next, a hardware configuration example of the server device 105 will be described.
The server device 105 is an information processing device equivalent to the client devices 101 to 104.
The server device 105 includes elements such as a CPU 120, a memory 121, an input interface 122, an output interface 123, a communication interface 124, a permanent storage interface 125, and a disk 126, which are connected via a bus 127.

CPU120は、メモリ121に格納されているプログラムやデータ、各種要素からの割り込みやデータ受け処理を行い、サーバ装置105としての動作を実現する。
より具体的には、CPU120が、後述する通信部213及び要求処理部214の機能を実現するプログラムを実行することで、サーバ装置105の後述する処理が行われる。
入力インタフェース122は、マウスやキーボードなどの入力デバイスが接続されるインタフェースであり、サーバ管理者は入力インタフェース122に接続された入力デバイスを操作して、サーバ装置105を操作する。
出力インタフェース123は、ディスプレイやスピーカーなどの出力デバイスが接続されるインタフェースであり、サーバ管理者は出力デバイスに出力される光や音などの刺激を元にサーバ装置105の状況を知覚する事が可能となる。
通信インタフェース124は、クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104とデータの交換を行うためのインタフェースであり、ネットワーク130に接続される。
永続記憶インタフェース125は、ディスクなどの不揮発性の記憶装置が接続されるインタフェースであり、電源断後にも記憶したいデータや一時データの保存読み出しはこのインタフェースを通して行われる。
The CPU 120 performs an interrupt and data receiving process from programs and data stored in the memory 121 and various elements, and realizes an operation as the server device 105.
More specifically, the CPU 120 executes a program that realizes the functions of the communication unit 213 and the request processing unit 214, which will be described later, so that the process described later of the server device 105 is performed.
The input interface 122 is an interface to which an input device such as a mouse or a keyboard is connected, and the server administrator operates the server device 105 by operating the input device connected to the input interface 122.
The output interface 123 is an interface to which an output device such as a display or a speaker is connected, and the server administrator can perceive the situation of the server device 105 based on a stimulus such as light or sound output to the output device. It becomes.
The communication interface 124 is an interface for exchanging data with the client device 101, the client device 102, the client device 103, and the client device 104, and is connected to the network 130.
The permanent storage interface 125 is an interface to which a non-volatile storage device such as a disk is connected, and saving and reading of data and temporary data to be stored even after the power is turned off are performed through this interface.

クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104はクライアント装置のユーザに対してあるサービスを提供するため、ネットワーク130を経由してサーバ装置105と連携処理を行う。
クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104は、サーバ装置105に何らかの処理を要求する場合、その要求内容をデータとして記述したリクエストをサーバ装置105に発行する。
例えばWebシステムではクライアント・サーバ間の通信はHTTP(HyperText Transfer Protocol)を用いて行われ、そのリクエストはHTTPリクエストのメソッド、URI(Unified Resource Identifier)、ボディなどとして表現される。
なお、サーバ・クライアント間の通信はHTTP以外にもWebSocket API(Application Programming Interface)など他のプロトコルを用いたとしても、本質的には同等であり、違いはない。
The client device 101, the client device 102, the client device 103, and the client device 104 perform cooperation processing with the server device 105 via the network 130 in order to provide a certain service to the user of the client device.
When the client device 101, the client device 102, the client device 103, and the client device 104 request the server device 105 to perform some processing, the client device 101, the client device 102, the client device 103, and the client device 104 issue a request describing the request content as data to the server device 105.
For example, in a Web system, communication between a client and a server is performed using HTTP (Hyper Text Transfer Protocol), and the request is expressed as an HTTP request method, a URI (Unified Resource Identifier), a body, and the like.
Note that communication between the server and the client is essentially the same even if another protocol such as WebSocket API (Application Programming Interface) is used in addition to HTTP, and there is no difference.

クライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104が送信したリクエストを受信したサーバ装置105は、そのリクエストの内容を解析し、どの様な処理を行うべきかを決定する。
HTTPを用いてリクエストを受け取った場合、サーバ装置105は、一般的にはURIで処理を行うべき対象となるリソースを一意に特定し、メソッドでそのリソースに対する具体的な動作を特定する。
その他処理に必要となるパラメータをクライアント装置から指定する場合にはURIのクエリー部もしくはボディとしてパラメータを与えて、クライアント装置から送信されてくるため、サーバ装置105は適時その情報(パラメータ)を利用して処理を行う。
サーバ装置105がクライアント装置に提供する処理は、ファイルの内容の送信、ファイルの書き換え、データベース等の他プロセスの制御や、サーバ装置105に接続されている各種機器の制御など多岐にわたる。
The server device 105 that has received the request transmitted by the client device 101, the client device 102, the client device 103, and the client device 104 analyzes the content of the request and determines what processing should be performed.
When receiving a request using HTTP, generally, the server apparatus 105 uniquely identifies a resource to be processed by a URI, and identifies a specific operation for the resource by a method.
When other parameters required for processing are specified from the client device, the parameters are given as a URI query part or body and transmitted from the client device. Therefore, the server device 105 uses the information (parameters) in a timely manner. Process.
The processing provided by the server device 105 to the client device is diverse, such as transmission of file contents, file rewriting, control of other processes such as a database, and control of various devices connected to the server device 105.

図2を用いて、本実施の形態に係るサーバ装置105の内部処理モジュールの説明を行う。   The internal processing module of the server apparatus 105 according to the present embodiment will be described with reference to FIG.

サーバ装置105は、システム内に存在するクライアント装置101、クライアント装置102、クライアント装置103、クライアント装置104と通信するための通信部213を持つ。
通信部213は、複数のクライアント装置と並行して通信のコネクションを確立できる。
通信部213は、クライアント装置からのリクエストを受信すると、そのリクエストを要求処理部214に転送する。
The server device 105 includes a communication unit 213 for communicating with the client device 101, the client device 102, the client device 103, and the client device 104 existing in the system.
The communication unit 213 can establish a communication connection in parallel with a plurality of client devices.
When receiving a request from the client device, the communication unit 213 transfers the request to the request processing unit 214.

要求処理部214は、リクエストを解析し、どの様な処理が要求されているのかを特定する。
その後、要求処理部214は、特定された要求処理を実行し、その処理結果を得る。
処理結果を得た要求処理部214はクライアント装置が解釈可能な形式にその処理結果を変換しレスポンスを生成する。
レスポンス生成後、要求処理部214は通信部213を利用してレスポンスを、リクエスト送信元のクライアント装置に返信する。
The request processing unit 214 analyzes the request and identifies what kind of processing is requested.
Thereafter, the request processing unit 214 executes the specified request processing and obtains the processing result.
Upon obtaining the processing result, the request processing unit 214 converts the processing result into a format that can be interpreted by the client device, and generates a response.
After generating the response, the request processing unit 214 uses the communication unit 213 to send a response back to the client device that sent the request.

次に、図3を用いて本実施の形態に係るクライアント装置の内部処理モジュールの説明を行う。
各クライアント装置は、それぞれ同等の内部処理モジュール構成となっており、どのクライアント装置も基本的に等価である。
図3では、クライアント装置101、クライアント装置102のみ内部処理モジュールを記述しているが、クライアント装置103、クライアント装置104にはその記述がないのは、記述を省略しているためであり、クライアント装置103、クライアント装置104はクライアント装置101、クライアント装置102と同等の内部処理モジュールを持つ。
以下では、代表として、クライアント装置101の内部処理モジュールを説明する。
以下の説明は、クライアント装置102、クライアント装置103、クライアント装置104にも同様に当てはまる。
Next, the internal processing module of the client device according to the present embodiment will be described with reference to FIG.
Each client device has an equivalent internal processing module configuration, and all client devices are basically equivalent.
In FIG. 3, only the client device 101 and the client device 102 describe the internal processing module, but the client device 103 and the client device 104 do not have the description because the description is omitted. 103, the client apparatus 104 has an internal processing module equivalent to the client apparatus 101 and the client apparatus 102.
Hereinafter, as a representative, the internal processing module of the client apparatus 101 will be described.
The following description applies to the client device 102, the client device 103, and the client device 104 as well.

クライアント装置101がクライアント装置101のユーザに提供するサービスの具体的なロジックを記述するのがアプリケーションロジック部206である。
例えば、提供するサービスがサーバ装置105と連動して動作するゲームアプリケーションであれば、ゲームアプリケーションに必要となるデータやゲームロジックなどがプログラミングされたソフトウエア等がアプリケーションロジック部206に相当する。
それ以外にサーバ装置105を経由したプラント監視制御を提供するサービスであれば、監視制御に必要な制御手続きやプラントから取得したデータを表示するための表示ロジック等がプログラミングされたソフトウエア等がアプリケーションロジック部206に相当する。
アプリケーションロジック部206は、サーバ装置105と連動して動作するアプリケーションであれば何でも構わない。
アプリケーションロジック部206は、サーバ装置105と連動する必要が発生すると、リクエスト生成部207に対してサーバ装置105と連動すべき具体的な処理内容を伝える処理を行う。
The application logic unit 206 describes specific logic of services provided by the client device 101 to the user of the client device 101.
For example, if the service to be provided is a game application that operates in conjunction with the server device 105, software in which data necessary for the game application, game logic, and the like are programmed corresponds to the application logic unit 206.
In addition to this, if the service provides plant monitoring control via the server device 105, the application such as software programmed with the display procedure for displaying the control procedure necessary for monitoring control and data acquired from the plant, etc. This corresponds to the logic unit 206.
The application logic unit 206 may be any application that operates in conjunction with the server device 105.
When the application logic unit 206 needs to be linked to the server device 105, the application logic unit 206 performs a process of transmitting specific processing contents to be linked to the server device 105 to the request generation unit 207.

リクエスト生成部207は、アプリケーションロジック部206に対して、サーバ装置105がクライアント装置101に提供する処理内容に対応したAPIを提供する。
アプリケーションロジック部206は連動すべき処理内容に対応するAPIを呼び出す。
また、リクエスト生成部207は、必要に応じてパラメータをAPIに提供する。
更に、リクエスト生成部207は、アプリケーションロジック部206がサーバ装置105と通信する際のプロトコルやリクエストのデータ形式を意識することなく、またサーバ装置105からのレスポンスのデータ形式を意識することなく処理を遂行できるようにするための抽象化層の役割を持つ。
また、リクエスト生成部207は、本実施の形態に関わる振る舞いをアプリケーションロジック部206と独立にするための抽象化層の役割も併せ持つ。
呼び出されたAPIに対応する処理内容と提供されたパラメータを元にサーバ装置105が解釈可能なリクエストを生成したリクエスト生成部207は、代表クライアント判定部208に生成したリクエストを出力する。
The request generation unit 207 provides the application logic unit 206 with an API corresponding to the processing content provided by the server device 105 to the client device 101.
The application logic unit 206 calls an API corresponding to the processing content to be linked.
Further, the request generation unit 207 provides parameters to the API as necessary.
Further, the request generation unit 207 performs processing without being aware of the protocol and request data format when the application logic unit 206 communicates with the server device 105, and without being aware of the response data format from the server device 105. Has the role of abstraction layer so that it can be performed.
The request generation unit 207 also serves as an abstraction layer for making the behavior related to the present embodiment independent of the application logic unit 206.
The request generation unit 207 that has generated a request that can be interpreted by the server device 105 based on the processing content corresponding to the called API and the provided parameters, outputs the generated request to the representative client determination unit 208.

代表クライアント判定部208は、いずれかのクライアント装置により生成されたサーバ装置105へのリクエストを取得した場合に、取得したリクエストについて、代表してリクエストを処理する役割である代表クライアントロールが自装置(クライアント装置101)に割り当てられているか否かを判定する。
代表クライアントロールが割り当てられているクライアント装置を、代表クライアント装置又は単に代表クライアントという。
なお、上記「リクエストを処理する」における「処理」には、リクエストに対するレスポンスがキャッシュされているか否かを判定する処理、レスポンスがキャッシュされていない場合に、リクエストをサーバ装置105に送信する処理、サーバ装置105からレスポンスを受信する処理、受信したレスポンスをリクエスト発行元に返信する処理、受信したレスポンスをキャッシュする処理が含まれる。
代表クライアント判定部208は、前述したように、自装置のリクエスト生成部207により生成されたリクエストを取得する場合もあるし、他のクライアント装置のリクエスト生成部207により生成されたリクエストを取得する場合もある。
自装置のリクエスト生成部207により生成されたリクエストであって代表クライアント判定部208が取得したリクエスト、他のクライアント装置のリクエスト生成部207により生成されたリクエストであって代表クライアント判定部208が取得したリクエストの両者を、以下では取得リクエストという。
代表クライアント判定部208は、複数のクライアント装置の間で共有している分散ハッシュテーブルを用いて、取得リクエストについての代表クライアントロールが自装置(クライアント装置101)に割り当てられているか否かを判定する。
代表クライアント判定部208は、取得リクエストについて、代表クライアントロールが自装置(クライアント装置101)に割り当てられている場合は、取得リクエストを代表クライアント処理部210に出力する。
一方、取得リクエストについて、代表クライアントロールが自装置(クライアント装置101)に割り当てられていない場合は、代表クライアント判定部208は、取得リクエストを他クライアント通信部209に出力する。
When the representative client determination unit 208 acquires a request to the server device 105 generated by one of the client devices, the representative client role, which is a role of processing the request on behalf of the acquired request, is the own device ( It is determined whether it is assigned to the client apparatus 101).
A client device to which a representative client role is assigned is referred to as a representative client device or simply a representative client.
The “processing” in the “processing the request” includes processing for determining whether a response to the request is cached, processing for transmitting a request to the server device 105 when the response is not cached, A process of receiving a response from the server device 105, a process of returning the received response to the request issuer, and a process of caching the received response are included.
As described above, the representative client determination unit 208 may acquire a request generated by the request generation unit 207 of its own device, or acquire a request generated by the request generation unit 207 of another client device. There is also.
A request generated by the request generation unit 207 of the own device and acquired by the representative client determination unit 208, a request generated by the request generation unit 207 of another client device and acquired by the representative client determination unit 208 Both requests will be referred to as acquisition requests below.
The representative client determination unit 208 determines whether or not a representative client role for an acquisition request is assigned to the own device (client device 101) using a distributed hash table shared among a plurality of client devices. .
The representative client determination unit 208 outputs the acquisition request to the representative client processing unit 210 when the representative client role is assigned to the own device (client device 101) for the acquisition request.
On the other hand, when the representative client role is not assigned to the own device (client device 101) for the acquisition request, the representative client determination unit 208 outputs the acquisition request to the other client communication unit 209.

前述したように、取得リクエストについての代表クライアントロールが自装置(クライアント装置101)に割り当てられていない場合は、代表クライアント判定部208から取得リクエストが出力され、他クライアント通信部209が、取得リクエストを他のクライアント装置に送信する。
また、取得リクエストが他のクライアント装置で生成されたリクエストであり、取得リクエストについての代表クライアントロールが自装置(クライアント装置101)に割り当てられており、キャッシュ領域に取得リクエストに対応するレスポンスがキャッシュされている場合に、他クライアント通信部209は、受信データ管理部211にキャッシュされているレスポンスを取得リクエストの生成元のクライアント装置に送信する。
他クライアント通信部209は、通信インタフェース114を用いて他クライアント装置と通信を行うためのAPI(Application Programming Interface)を提供している。
例えば、本実施の形態に係るシステムがWebシステムとして構築されており、クライアント装置101がWebブラウザ上に実装されている場合には、WebRTCなどのAPIを提供する事となる。
他クライアント通信部209は、何らかのデータ送信要求がAPI経由で通知された場合には、その要求に従い送信先となるクライアント装置にデータを送信する。
また、他のクライアント装置から何らかのデータが送信されてきた場合には、他のクライアント装置からデータが送信されてきた旨をイベントなどの形式でクライアント装置101内に通知し、そのイベントを監視しているモジュールがその受信データを処理する事となる。
As described above, when the representative client role for the acquisition request is not assigned to the own device (client device 101), the acquisition request is output from the representative client determination unit 208, and the other client communication unit 209 outputs the acquisition request. Send to other client devices.
In addition, the acquisition request is a request generated by another client device, a representative client role for the acquisition request is assigned to the own device (client device 101), and a response corresponding to the acquisition request is cached in the cache area. The other client communication unit 209 transmits the response cached in the received data management unit 211 to the client device that has generated the acquisition request.
The other client communication unit 209 provides an API (Application Programming Interface) for communicating with other client devices using the communication interface 114.
For example, when the system according to the present embodiment is constructed as a Web system and the client apparatus 101 is mounted on a Web browser, an API such as WebRTC is provided.
When a data transmission request is notified via the API, the other client communication unit 209 transmits data to the client apparatus as a transmission destination according to the request.
Further, when some data is transmitted from another client device, the client device 101 is notified in the form of an event or the like that the data has been transmitted from another client device, and the event is monitored. The received module will process the received data.

代表クライアント処理部210は、自装置(クライアント装置101)に代表クライアントロールが割り当てられている場合に、代表クライアントとして振る舞うための動作を行う。
具体的には、代表クライアント処理部210は、取得リクエストがリクエスト生成部207で生成されたリクエストであり、取得リクエストについての代表クライアントロール(クライアント装置101)が自装置に割り当てられており、受信データ管理部211に取得リクエストに対応するサーバ装置105からのレスポンスであって有効期限内のレスポンスがキャッシュされている場合に、受信データ管理部211にキャッシュされているレスポンスを代表クライアント判定部208を介してリクエスト生成部207に出力する。
また、取得リクエストが他のクライアント装置のリクエスト生成部207で生成されたリクエストであり、取得リクエストについての代表クライアントロール(クライアント装置101)が自装置に割り当てられており、受信データ管理部211に取得リクエストに対応するサーバ装置105からのレスポンスがキャッシュされている場合に、受信データ管理部211にキャッシュされているレスポンスを他クライアント通信部209に出力する。
The representative client processing unit 210 performs an operation for acting as a representative client when a representative client role is assigned to the own apparatus (client apparatus 101).
Specifically, in the representative client processing unit 210, the acquisition request is a request generated by the request generation unit 207, the representative client role (client device 101) for the acquisition request is assigned to the own device, and the received data When the response from the server device 105 corresponding to the acquisition request is cached in the management unit 211, the response cached in the received data management unit 211 is passed through the representative client determination unit 208. To the request generation unit 207.
Further, the acquisition request is a request generated by the request generation unit 207 of another client device, and the representative client role (client device 101) for the acquisition request is assigned to the own device, and is acquired by the received data management unit 211. When the response from the server device 105 corresponding to the request is cached, the response cached in the received data management unit 211 is output to the other client communication unit 209.

受信データ管理部211は、サーバ装置105からのレスポンスを保存するキャッシュ領域を持ち、キャッシュ領域を管理する。
受信データ管理部211は、代表クライアント処理部210がサーバ装置105より取得したレスポンスを対応するリクエストと対応付けしてキャッシュ領域に保存する。
また、受信データ管理部211は、あるリクエストをキーとして対応するレスポンスを取得することができる。
なお、本実施の形態では、キャッシュ領域はクライアント装置101に内蔵されているが、キャッシュ領域は、クライアント装置101(より厳密には、代表クライアント処理部210)がアクセスできればよく、クライアント装置101に内蔵されていなくてもよい。
なお、以下では、レスポンスが受信データ管理部211にキャッシュされている旨の表現も用いるが、これは受信データ管理部211が管理するキャッシュ領域にレスポンスがキャッシュされているという意味である。
The received data management unit 211 has a cache area for storing a response from the server apparatus 105, and manages the cache area.
The reception data management unit 211 stores the response acquired by the representative client processing unit 210 from the server device 105 in the cache area in association with the corresponding request.
Further, the reception data management unit 211 can acquire a corresponding response with a certain request as a key.
In this embodiment, the cache area is built in the client apparatus 101. However, the cache area only needs to be accessible by the client apparatus 101 (more precisely, the representative client processing unit 210), and is built in the client apparatus 101. It does not have to be.
Hereinafter, the expression that the response is cached in the reception data management unit 211 is also used, which means that the response is cached in the cache area managed by the reception data management unit 211.

サーバ通信部212は、取得リクエストについての代表クライアントロールが自装置(クライアント装置101)に割り当てられており、取得リクエストに対応するレスポンスが受信データ管理部211にキャッシュされていない場合に、取得リクエストをサーバ装置105に送信する。
サーバ通信部212は、通信インタフェース114を用いてサーバ装置105と通信を行うためのAPIを提供している。
例えば、本実施の形態に係るシステムがWebシステムとして構築されており、クライアント装置101がWebブラウザ上に実装されている場合には、XMLHttpRequestオブジェクトやWebSocket APIなどがサーバ通信部212に相当する。
なおサーバ装置、クライアント装置間の通信プロトコルをHTTPとする場合にはXMLHttpRequestオブジェクトを用いる事になるが、WebSocket APIを用いたとしてもHTTPと同等の機能を実現できるため、実質的にどちらを用いたとしても、両方を併用したとしても、違いはない。
When the representative client role for the acquisition request is assigned to the own device (client device 101) and the response corresponding to the acquisition request is not cached in the received data management unit 211, the server communication unit 212 outputs the acquisition request. It transmits to the server device 105.
The server communication unit 212 provides an API for communicating with the server device 105 using the communication interface 114.
For example, when the system according to the present embodiment is constructed as a Web system and the client apparatus 101 is mounted on a Web browser, an XMLHttpRequest object, a WebSocket API, or the like corresponds to the server communication unit 212.
Note that the XMLHttpRequest object is used when the communication protocol between the server device and the client device is HTTP. However, even if the WebSocket API is used, a function equivalent to HTTP can be realized. Even if both are used together, there is no difference.

***動作の説明***
次に、本実施の形態に係るクライアント装置におけるデータ処理方法の概要を説明する。
*** Explanation of operation ***
Next, an outline of a data processing method in the client device according to the present embodiment will be described.

図4は、リクエスト生成元のクライアント装置の動作例を示す。
以下では、クライアント装置101がリクエスト生成元である例を用いて説明を進める。
FIG. 4 shows an operation example of the client device that is the request generation source.
Hereinafter, the description will be given using an example in which the client apparatus 101 is a request generation source.

クライアント装置101のリクエスト生成部207は、アプリケーションロジック部206からの指示に基づき、サーバ装置105へのリクエストを生成する(処理101)。
そして、リクエスト生成部207は生成したリクエストを代表クライアント判定部208に出力する。
The request generation unit 207 of the client device 101 generates a request to the server device 105 based on an instruction from the application logic unit 206 (processing 101).
Then, the request generation unit 207 outputs the generated request to the representative client determination unit 208.

代表クライアント判定部208は、当該リクエスト(取得リクエスト)についての代表クライアントロールが自装置(クライアント装置101)に割り当てられているか否かを判定する(処理102)。
この処理102は、代表クライアント判定ステップに相当する。
The representative client determination unit 208 determines whether or not the representative client role for the request (acquisition request) is assigned to the own device (client device 101) (processing 102).
This process 102 corresponds to a representative client determination step.

リクエストについて自装置に代表クライアントロールが割り当てられている場合(処理102でYES)は、代表クライアント判定部208はリクエストを代表クライアント処理部210に出力し、代表クライアント処理部210が、サーバ通信部212にリクエストに対応するレスポンスがキャッシュされているか否かを判定する(処理103)。
この処理103は、代表クライアント処理ステップに相当する。
If the representative client role is assigned to the own device for the request (YES in processing 102), the representative client determining unit 208 outputs the request to the representative client processing unit 210, and the representative client processing unit 210 receives the server communication unit 212. It is determined whether or not the response corresponding to the request is cached (process 103).
This processing 103 corresponds to a representative client processing step.

受信データ管理部211にレスポンスがキャッシュされている場合(処理103でYES)は、代表クライアント処理部210は、受信データ管理部211にキャッシュされているレスポンスをリクエスト生成部207に返し、また、リクエスト生成部207が当該レスポンスをアプリケーションロジック部206に返し、アプリケーションロジック部206は当該レスポンスを用いた処理を行う(処理104)。   When the response is cached in the reception data management unit 211 (YES in processing 103), the representative client processing unit 210 returns the response cached in the reception data management unit 211 to the request generation unit 207, The generation unit 207 returns the response to the application logic unit 206, and the application logic unit 206 performs processing using the response (processing 104).

一方、受信データ管理部211にレスポンスがキャッシュされていない場合(処理103でNO)は、代表クライアント処理部210はリクエストをサーバ通信部212に出力し、サーバ通信部212がサーバ装置105にリクエストを送信する(処理105)。
この処理105は、サーバ通信ステップに相当する。
On the other hand, if the response is not cached in the received data management unit 211 (NO in processing 103), the representative client processing unit 210 outputs a request to the server communication unit 212, and the server communication unit 212 sends a request to the server device 105. Transmit (process 105).
This process 105 corresponds to a server communication step.

サーバ通信部212は、サーバ装置105からレスポンスを受信する(処理106)。
その後、サーバ通信部212はサーバ装置105からのレスポンスを代表クライアント処理部210及び代表クライアント判定部208を経由してリクエスト生成部207に返し、リクエスト生成部207がアプリケーションロジック部206にレスポンスを返し、リクエスト生成部207が当該レスポンスを用いた処理を行う(処理104)。
The server communication unit 212 receives a response from the server device 105 (processing 106).
Thereafter, the server communication unit 212 returns a response from the server device 105 to the request generation unit 207 via the representative client processing unit 210 and the representative client determination unit 208, and the request generation unit 207 returns a response to the application logic unit 206. The request generation unit 207 performs processing using the response (processing 104).

一方、リクエストについて自装置に代表クライアントロールが割り当てられていない場合(処理102でNO)は、代表クライアント判定部208はリクエストを他クライアント通信部209に出力し、他クライアント通信部209がリクエストを他のクライアント装置(例えば、クライアント装置102)に送信する(処理107)。
この処理107は、他クライアント通信ステップに相当する。
On the other hand, when the representative client role is not assigned to the own device for the request (NO in process 102), the representative client determination unit 208 outputs the request to the other client communication unit 209, and the other client communication unit 209 transmits the request to the other device. To the client device (for example, the client device 102) (process 107).
This process 107 corresponds to another client communication step.

他クライアント通信部209は、他のクライアント装置(例えば、クライアント装置102)からレスポンスを受信する(処理108)。
その後、他クライアント通信部209は、受信したレスポンスを代表クライアント処理部210に出力する。
The other client communication unit 209 receives a response from another client device (for example, the client device 102) (process 108).
Thereafter, the other client communication unit 209 outputs the received response to the representative client processing unit 210.

代表クライアント処理部210は、他クライアント通信部209から出力されたレスポンスが自装置(クライアント装置101)宛のレスポンスであるか否かを判定する(処理109)。   The representative client processing unit 210 determines whether or not the response output from the other client communication unit 209 is a response addressed to the own device (client device 101) (processing 109).

自装置(クライアント装置101)宛のレスポンスであれば(処理109でYES)、代表クライアント処理部210は、代表クライアント判定部208を経由して当該レスポンスをリクエスト生成部207に返し、また、リクエスト生成部207が当該レスポンスをアプリケーションロジック部206に返し、アプリケーションロジック部206は当該レスポンスを用いた処理を行う(処理104)。   If the response is for the own device (client device 101) (YES in processing 109), the representative client processing unit 210 returns the response to the request generation unit 207 via the representative client determination unit 208, and generates a request. The unit 207 returns the response to the application logic unit 206, and the application logic unit 206 performs processing using the response (processing 104).

一方、自装置(クライアント装置101)宛のレスポンスでなければ(処理109でNO)、代表クライアント判定部208は、当該レスポンスを他クライアント通信部209に出力し、他クライアント通信部209が当該レスポンスを他のクライアント装置(例えば、クライアント装置103)に転送する(処理110)。
処理109でNOとなるのは、リクエスト生成部207で生成されたリクエストを他のクライアント装置(例えば、クライアント装置102)に送信するとともに、他のクライアント装置(例えば、クライアント装置103)で生成されたリクエストを他のクライアント装置(クライアント装置102)に送信し、他のクライアント装置(クライアント装置102)から他のクライアント装置(クライアント装置103)で生成されたリクエストに対するレスポンスを受信した場合である。
On the other hand, if the response is not addressed to the own device (client device 101) (NO in processing 109), the representative client determination unit 208 outputs the response to the other client communication unit 209, and the other client communication unit 209 outputs the response. Transfer to another client device (for example, client device 103) (process 110).
The result of NO in the process 109 is that the request generated by the request generation unit 207 is transmitted to another client device (for example, the client device 102) and is generated by another client device (for example, the client device 103). This is a case where a request is transmitted to another client device (client device 102), and a response to a request generated by another client device (client device 103) is received from another client device (client device 102).

図5は、リクエストの送信先のクライアント装置の動作例を示す。
ここでは、クライアント装置102がクライアント装置101で生成されたリクエストを受信した例を用いて、説明を進める。
FIG. 5 shows an operation example of the client device to which the request is transmitted.
Here, the description will be given using an example in which the client device 102 receives a request generated by the client device 101.

クライアント装置102では、他クライアント通信部209が他のクライアント装置(クライアント装置101)から送信されたリクエストを受信する(処理201)。
他クライアント通信部209は、受信したリクエストを代表クライアント判定部208に出力する。
In the client apparatus 102, the other client communication unit 209 receives a request transmitted from another client apparatus (client apparatus 101) (process 201).
The other client communication unit 209 outputs the received request to the representative client determination unit 208.

代表クライアント判定部208は、当該リクエスト(取得リクエスト)についての代表クライアントロールが自装置(クライアント装置102)に割り当てられているか否かを判定する(処理202)。   The representative client determination unit 208 determines whether or not the representative client role for the request (acquisition request) is assigned to the own device (client device 102) (process 202).

当該リクエストについて自装置に代表クライアントロールが割り当てられている場合(処理202でYES)は、代表クライアント判定部208は当該リクエストを代表クライアント処理部210に出力し、代表クライアント処理部210が、受信データ管理部211に当該リクエストに対応するレスポンスがキャッシュされているか否かを判定する(処理203)。   When the representative client role is assigned to the own device for the request (YES in processing 202), the representative client determining unit 208 outputs the request to the representative client processing unit 210, and the representative client processing unit 210 receives the received data. It is determined whether or not the response corresponding to the request is cached in the management unit 211 (process 203).

受信データ管理部211にレスポンスがキャッシュされている場合(処理203でYES)は、代表クライアント処理部210は、受信データ管理部211にキャッシュされているレスポンスを代表クライアント判定部208を経由して他クライアント通信部209に返し、他クライアント通信部209が当該レスポンスを他のクライアント装置(クライアント装置101)に返信する(処理204)。   If the response is cached in the received data management unit 211 (YES in processing 203), the representative client processing unit 210 sends another response cached in the received data management unit 211 via the representative client determination unit 208. The response is returned to the client communication unit 209, and the other client communication unit 209 returns the response to the other client device (client device 101) (process 204).

一方、受信データ管理部211にレスポンスがキャッシュされていない場合(処理203でNO)は、代表クライアント処理部210はリクエストをサーバ通信部212に出力し、サーバ通信部212がサーバ装置105にリクエストを送信する(処理205)。   On the other hand, if the response is not cached in the received data management unit 211 (NO in processing 203), the representative client processing unit 210 outputs a request to the server communication unit 212, and the server communication unit 212 sends a request to the server device 105. Transmit (process 205).

サーバ通信部212は、サーバ装置105からレスポンスを受信する(処理206)。
その後、サーバ通信部212はサーバ装置105からのレスポンスを代表クライアント処理部210及び代表クライアント判定部208を経由して他クライアント通信部209に返し、他クライアント通信部209が当該レスポンスを他のクライアント装置(クライアント装置101)に返信する(処理204)。
The server communication unit 212 receives a response from the server device 105 (processing 206).
Thereafter, the server communication unit 212 returns the response from the server device 105 to the other client communication unit 209 via the representative client processing unit 210 and the representative client determination unit 208, and the other client communication unit 209 returns the response to the other client device. A reply is made to (client apparatus 101) (process 204).

一方、当該リクエストについて自装置に代表クライアントロールが割り当てられていない場合(処理202でNO)は、代表クライアント判定部208は当該リクエストを他クライアント通信部209に出力し、他クライアント通信部209が当該リクエストを他のクライアント装置(例えば、クライアント装置104)に送信する(処理207)。   On the other hand, when the representative client role is not assigned to the own device for the request (NO in process 202), the representative client determination unit 208 outputs the request to the other client communication unit 209, and the other client communication unit 209 The request is transmitted to another client device (for example, the client device 104) (process 207).

他クライアント通信部209は、他のクライアント装置(クライアント装置104)からレスポンスを受信する(処理208)。
その後、他クライアント通信部209は当該レスポンスを他のクライアント装置(クライアント装置101)に返信する(処理204)。
The other client communication unit 209 receives a response from another client device (client device 104) (processing 208).
Thereafter, the other client communication unit 209 returns the response to the other client device (client device 101) (processing 204).

次に、本実施の形態に係るクライアント装置の動作を詳細に説明する。
まず、APIの呼び出し後にリクエスト生成部207が行う処理を、図7を用いて説明する。
Next, the operation of the client device according to the present embodiment will be described in detail.
First, processing performed by the request generation unit 207 after calling the API will be described with reference to FIG.

処理401で、リクエスト生成部207は、呼び出されたAPIに対応する処理内容と提供されたパラメータを元にサーバ装置105が解釈可能なリクエストを生成する。   In process 401, the request generation unit 207 generates a request that can be interpreted by the server apparatus 105 based on the processing content corresponding to the called API and the provided parameters.

図6に処理401の一つの具体例を示す。
図6はAPI呼出し時のコード上の記述に対応する、生成されるリクエストの一例を示した対応表である。
ここでは、アプリケーションロジック部206が提供すべきサービスはプラント監視制御を想定し、プラントの監視時間間隔を取得するAPI、監視時間間隔を変更するAPI、ディスプレイに表示すべき画面の定義データを取得するAPIがあるとし、それぞれのAPI名は「getMonitorInterval」、「setMonitorInterval」、「getPageContent」としている。
また、サーバ装置105とクライアント装置はHTTPで通信すると仮定している。
監視時間間隔を取得する場合、アプリケーションロジック部206は引数なしで「getMonitorInterval」を呼び出す。
呼び出されたリクエスト生成部207はデータ取得を意味するメソッドGETと時間間隔を一意に特定するURIである「http://xxx/api/monitor_interval/ 」で構成されるHTTPリクエストを生成する。
また、監視時間間隔を変更する場合、アプリケーションロジック部206は引数で設定した時間間隔を与えて「setMonitorInterval」を呼び出す。
呼び出されたリクエスト生成部207は、データ送信を意味するメソッドPOSTと時間間隔を一意に特定するURIである「http://xxx/api/monitor_interval/ 」に対してクエリーとして引数で指定された値を加えたURLを生成し、それらで構成されるHTTPリクエストを生成する。
加えて、画面の定義データを取得する場合、アプリケーションロジック部206は引数で画面名を与えて「getPagetContent」を呼び出す。
呼び出されたリクエスト生成部207は、データ取得を意味するメソッドGETと要求された画面の定義データを一意に特定するURIである「http://xxx/html/Monitor.html」で構成されるHTTPリクエストを生成する。
この例では、画面定義データをHTML(HyperText Markup Language)で記述されているファイルであると仮定しており、「http://xxx/html/」と「.html」の間に引数で受けた画面名を挿入してURIを構成している。
FIG. 6 shows one specific example of the process 401.
FIG. 6 is a correspondence table showing an example of the generated request corresponding to the description on the code when calling the API.
Here, assuming that the service to be provided by the application logic unit 206 is plant monitoring control, an API for acquiring a plant monitoring time interval, an API for changing the monitoring time interval, and screen definition data to be displayed on the display are acquired. It is assumed that there is an API, and each API name is “getMonitorInterval”, “setMonitorInterval”, and “getPageContent”.
Further, it is assumed that the server apparatus 105 and the client apparatus communicate with each other using HTTP.
When acquiring the monitoring time interval, the application logic unit 206 calls “getMonitorInterval” without an argument.
The called request generation unit 207 generates an HTTP request configured by “http: // xxx / api / monitor_interval /” which is a URI for uniquely specifying a time interval and a method GET meaning data acquisition.
Further, when changing the monitoring time interval, the application logic unit 206 calls “setMonitorInterval” by giving the time interval set by the argument.
The called request generation unit 207 has a value designated as an argument as a query for “http: // xxx / api / monitor_interval /”, which is a URI that uniquely specifies a time interval and a method POST that means data transmission. Is generated, and an HTTP request composed of these URLs is generated.
In addition, when acquiring the screen definition data, the application logic unit 206 calls the “getPagetContent” by giving the screen name as an argument.
The called request generation unit 207 is an HTTP configured by “http: //xxx/html/Monitor.html”, which is a URI for uniquely specifying the definition data of the requested screen and the method GET meaning data acquisition. Generate a request.
In this example, it is assumed that the screen definition data is a file described in HTML (HyperText Markup Language), and is received as an argument between “http: // xxx / html /” and “.html”. A URI is constructed by inserting a screen name.

図7に戻り、処理401でリクエストを生成した後、リクエスト生成部207は、処理402で、代表クライアント判定部208にリクエストを送信し、処理403でそのレスポンスが代表クライアント判定部208から返信されるまで待機する。
レスポンスが代表クライアント判定部208から返信されると、リクエスト生成部207は、処理404で、返信されたレスポンスをアプリケーションロジック部206が解釈可能な形式に変換する。
そして、処理405で、リクエスト生成部207は、その変換結果をアプリケーションロジック部206に返信し処理を完了する。
Returning to FIG. 7, after generating the request in process 401, the request generation unit 207 transmits the request to the representative client determination unit 208 in process 402, and the response is returned from the representative client determination unit 208 in process 403. Wait until.
When the response is returned from the representative client determination unit 208, the request generation unit 207 converts the returned response into a format that can be interpreted by the application logic unit 206 in processing 404.
In step 405, the request generation unit 207 returns the conversion result to the application logic unit 206 to complete the processing.

処理404でのレスポンスの変換処理の一例としてレスポンスがJSON(JavaScript(登録商標) Object Notation)形式のデータである場合には、JavaScript(登録商標)が解釈可能なオブジェクトに変換するなどが考えられる。   As an example of the response conversion process in the process 404, when the response is data in JSON (Java Script (registered trademark) Object Notation) format, it may be converted into an object that can be interpreted by Java Script (registered trademark).

リクエストの転送を受けた代表クライアント判定部208の処理を、図8を用いて説明する。   The processing of the representative client determination unit 208 that has received the request transfer will be described with reference to FIG.

リクエストの転送を受けた代表クライアント判定部208は、処理501で、分散ハッシュテーブルを用い、そのリクエストのIDを算出する。   In step 501, the representative client determination unit 208 that has received the request transfer calculates the ID of the request using the distributed hash table.

分散ハッシュテーブルとは複数のピアでハッシュテーブルを分散して管理する技術の事であり、ピアを本実施の形態ではクライアント装置に対応づけて解釈する。
分散ハッシュテーブルは分散管理されている以外はハッシュテーブルと機能面では同等であり、ある値をハッシュ関数を用いてある空間の点に射影し、その点をIDとして値に関連付けを行う。
この関連付けを行う事によってIDから値を検索する事が可能となる。
ハッシュ関数への入力値は異なる尺度の値でも構わず、それぞれの尺度の値同士の関連性を作り出すためにも用いる事が出来る。
そのため、分散ファイルシステムでどのファイルをどのノードで管理するかを決定するために分散ハッシュテーブルを用いてファイルとノードの関連性を作り出す事にも用いられる事がある。
本実施の形態では、リクエストとクライアント装置の通信時の識別情報となるネットワークIDをハッシュ関数の入力として扱い、各リクエストのIDと各クライアント装置のIDの関係に応じて、どのリクエストに対して、どのクライアント装置がサーバに発行するクライアント装置である代表クライアント装置になるか(どのクライアント装置に代表クライアントロールが割り当てられているか)を分散ハッシュテーブルを用いて決定する。
リクエストのIDの具体例としてURIが考えられる。
また、クライアント装置のネットワークIDの具体例として、そのクライアント装置のIP(Internet Protocol)アドレスやMAC(Media Access Control)アドレスが考えられる。
分散ハッシュテーブルはハッシュ関数を選択する事によって、代表クライアントロールを確率的に一様に各クライアント装置に振り分ける事が理論上可能となるため、ある特定のクライアント装置に多くの代表クライアントロールを割り当てる様なクライアント装置間の処理負荷の偏りを回避可能である。
The distributed hash table is a technique for managing a hash table distributed by a plurality of peers. In this embodiment, peers are interpreted in association with client devices.
The distributed hash table is functionally equivalent to the hash table except that it is managed in a distributed manner, and a certain value is projected onto a point in a certain space using a hash function, and the point is associated with the value as an ID.
By performing this association, it is possible to retrieve a value from the ID.
Input values to the hash function may be values of different scales, and can also be used to create a relationship between the values of the respective scales.
Therefore, it may be used to create a relationship between a file and a node using a distributed hash table in order to determine which file is managed by which node in the distributed file system.
In the present embodiment, the network ID serving as identification information at the time of communication between the request and the client device is treated as an input of a hash function, and for which request depending on the relationship between the ID of each request and the ID of each client device, A distributed hash table is used to determine which client device is a representative client device that is a client device issued to a server (which client device is assigned a representative client role).
A URI can be considered as a specific example of the ID of the request.
Further, as a specific example of the network ID of the client device, an IP (Internet Protocol) address or a MAC (Media Access Control) address of the client device can be considered.
In the distributed hash table, it is theoretically possible to assign a representative client role to each client device in a probabilistic and uniform manner by selecting a hash function. Therefore, a large number of representative client roles are assigned to a specific client device. It is possible to avoid uneven processing load among client devices.

図8に戻り、処理502では、代表クライアント判定部208は、リクエストIDとそのクライアント装置に対する分散ハッシュテーブル上のIDおよび分散ハッシュテーブル自身を用いて、そのクライアント装置自身が、サーバ装置にそのリクエストを発行するクライアント装置である代表クライアント装置となるかを判定する。
つまり、そのクライアント装置に、そのリクエストについて代表クライアントロールが割り当てられているかを判定する。
そのクライアント装置自身が代表クライアント装置である場合には処理503、そのクライアント装置ではない他のクライアント装置が代表クライアント装置である場合には処理505に処理を分岐する。
Returning to FIG. 8, in processing 502, the representative client determination unit 208 uses the request ID, the ID on the distributed hash table for the client device, and the distributed hash table itself, and the client device itself sends the request to the server device. It is determined whether the client device to be issued is a representative client device.
That is, it is determined whether a representative client role is assigned to the client device for the request.
If the client device itself is a representative client device, the processing branches to processing 503. If another client device that is not the client device is a representative client device, the processing branches to processing 505.

処理503では、クライアント装置自身が代表クライアント装置となるため、代表クライアント判定部208は、そのリクエストを代表クライアント処理部210に転送し、処理504で代表クライアント処理部210からリクエストに対応するレスポンスが返信されるまで待機を行う。
その後、レスポンスが返信された場合には処理507に遷移する。
In processing 503, since the client device itself becomes the representative client device, the representative client determination unit 208 transfers the request to the representative client processing unit 210, and a response corresponding to the request is returned from the representative client processing unit 210 in processing 504. Wait until
Thereafter, when a response is returned, the process proceeds to processing 507.

一方で、処理505では、そのクライアント装置以外の他のクライアント装置が代表クライアント装置となるため、代表クライアント判定部208は、リクエストを分散ハッシュテーブルのアルゴリズムに従って他クライアント通信部209より他のクライアント装置に転送する。
この時、リクエストに加えて、クライアント装置自身の分散ハッシュテーブルに従って算出されたIDもしくはクライアント装置自身のネットワークIDなど、リクエストに対応するレスポンスを最終的にどのクライアント装置に返信すればよいかを判断できる情報を付加して転送する。
On the other hand, in process 505, since the client device other than the client device becomes the representative client device, the representative client determination unit 208 sends the request to the other client device from the other client communication unit 209 according to the algorithm of the distributed hash table. Forward.
At this time, in addition to the request, it is possible to determine to which client device the response corresponding to the request is finally returned, such as an ID calculated according to the distributed hash table of the client device itself or the network ID of the client device itself Add information and transfer.

リクエストの転送後、処理506で、代表クライアント判定部208は、そのクライアント装置が転送したリクエストに対応するレスポンスが代表クライアント装置から返信されるまで待機する。
代表クライアント装置からのレスポンスの返信があった場合には処理507に遷移する。
After transferring the request, in processing 506, the representative client determination unit 208 waits until a response corresponding to the request transferred by the client device is returned from the representative client device.
If a response is returned from the representative client device, the process proceeds to processing 507.

処理507では、代表クライアント判定部208は、レスポンスに対応するリクエストの発行元クライアントが現在処理を行っているクライアント装置自身であるか判定を行う。
その結果、クライアント装置自身である場合には処理508に遷移し、サーバ装置105、もしくは代表クライアントからのレスポンスをリクエスト生成部207に返信する。
逆に、その結果がクライアント装置自身でない場合には、代表クライアント判定部208は、処理509で、リクエストの発行元のクライアント装置に向け分散ハッシュテーブルに従い、他のクライアント装置にレスポンスを転送する。
例えば、図8の処理を行っているクライアント装置がクライアント装置101であり、代表クライアント装置がクライアント装置103であり、リクエスト発行元のクライアント装置がクライアント装置104である場合は、クライアント装置101の代表クライアント判定部208は、クライアント装置102にレスポンスを転送する。
In processing 507, the representative client determination unit 208 determines whether the client that issued the request corresponding to the response is the client device that is currently performing the processing.
As a result, if it is the client device itself, the process proceeds to processing 508, and a response from the server device 105 or the representative client is returned to the request generation unit 207.
Conversely, if the result is not the client device itself, the representative client determination unit 208 transfers a response to another client device in accordance with the distributed hash table toward the client device that issued the request in processing 509.
For example, if the client device performing the processing of FIG. 8 is the client device 101, the representative client device is the client device 103, and the request issuing client device is the client device 104, the representative client of the client device 101 The determination unit 208 transfers the response to the client device 102.

次に、処理505でリクエストを他のクライアント装置に転送した際の、リクエストの転送先となるクライアント装置の処理を図9を用いて説明する。
図9はリクエストの転送先となるクライアント装置の代表クライアント判定部208の処理フローである。
Next, processing of a client device that is a transfer destination of a request when the request is transferred to another client device in processing 505 will be described with reference to FIG.
FIG. 9 is a processing flow of the representative client determination unit 208 of the client device that is the transfer destination of the request.

リクエストの転送を他クライアント通信部209で受けたクライアント装置は、代表クライアント判定部208にそのリクエストを転送する。
リクエストの転送を受けた代表クライアント判定部208は、処理601で、分散ハッシュテーブルを用い、そのリクエストのIDを算出する。
The client device that has received the request transfer by the other client communication unit 209 transfers the request to the representative client determination unit 208.
In step 601, the representative client determination unit 208 that has received the request transfer calculates the ID of the request using the distributed hash table.

処理602では、代表クライアント判定部208は、リクエストIDとそのクライアント装置自身に対する分散ハッシュテーブル上のIDおよび分散ハッシュテーブル自身を用いて、そのクライアント装置自身が、代表クライアント装置となるかを判定する。
そのクライアント装置自身が代表クライアント装置である場合には処理603、そのクライアント装置ではない他のクライアント装置が代表クライアント装置である場合には処理605に処理を分岐する。
In process 602, the representative client determination unit 208 determines whether the client device itself becomes a representative client device by using the request ID, the ID on the distributed hash table for the client device itself, and the distributed hash table itself.
If the client apparatus itself is a representative client apparatus, the process branches to process 603, and if another client apparatus that is not the client apparatus is a representative client apparatus, the process branches to process 605.

処理603では、クライアント装置自身が処理中のリクエストに対する代表クライアント装置となるため、代表クライアント判定部208は、そのリクエストを代表クライアント処理部210に転送し、処理604で、代表クライアント処理部210からリクエストに対応するレスポンスが返信されるまで待機を行う。   In process 603, since the client apparatus itself becomes the representative client apparatus for the request being processed, the representative client determination unit 208 transfers the request to the representative client processing unit 210, and in process 604, the request is sent from the representative client processing unit 210. Wait until a response corresponding to is returned.

その後、レスポンスが返信された場合には処理606に遷移し、代表クライアント判定部208は、リクエスト発行元のクライアント装置に向け分散ハッシュテーブルに従い、他クライアント通信部209を介して、他のクライアント装置にレスポンスを転送する。
ただし、この時にリクエスト発行元のクライアント装置のネットワークIDが既知である場合には、分散ハッシュテーブルに従うことなく、直接リクエスト発行元のクライアント装置にレスポンスを返信しても構わない。
Thereafter, when a response is returned, the process proceeds to processing 606, where the representative client determination unit 208 follows the distributed hash table toward the client device that issued the request, and transmits to the other client device via the other client communication unit 209. Forward the response.
However, if the network ID of the request issuing client device is known at this time, the response may be returned directly to the request issuing client device without following the distributed hash table.

処理605では、クライアント装置自身は処理中のリクエストに対する代表クライアント装置ではないため、代表クライアント判定部208は、分散ハッシュテーブルに従い、他のクライアント装置にレスポンスを転送する。
処理605でリクエストを他のクライアント装置に転送した際の、リクエストの転送先となるクライアント装置の処理は図9で説明した通りの処理が行われ、システム内でリクエストに対応する代表クライアント装置に到達するまで、クライアント装置を渡り歩く形で、再帰的に処理が繰り返される。
In process 605, since the client apparatus itself is not a representative client apparatus for the request being processed, the representative client determination unit 208 transfers a response to another client apparatus according to the distributed hash table.
When the request is transferred to another client device in the processing 605, the processing of the client device that is the transfer destination of the request is performed as described in FIG. 9, and reaches the representative client device corresponding to the request in the system. Until then, the process is recursively repeated while walking around the client device.

次に、代表クライアント処理部210の処理を図10を用いて説明する。   Next, the processing of the representative client processing unit 210 will be described with reference to FIG.

リクエストを受けた代表クライアント処理部210は、処理701で、そのリクエストが安全であるかどうかを判定する。
リクエストが安全であるとは、そのリクエストをサーバ装置105が処理する事によってサーバ装置105の内部に変更が発生しない事を意味する。
例えば、HTTPではGETメソッドを用いたリクエストは指定したリソースの取得を行うメソッドであり、安全なリクエストであると言える。
一方で、POSTやPUTと言ったメソッドを用いたリクエストはサーバ装置105の内部に変更が発生する可能性があるため、安全でないリクエストとなる。
リクエストが安全である場合には処理702へ遷移し、安全でない場合には処理703に遷移する。
In step 701, the representative client processing unit 210 that has received the request determines whether the request is safe.
That the request is safe means that no change occurs in the server device 105 when the server device 105 processes the request.
For example, in HTTP, a request using the GET method is a method for acquiring a specified resource and can be said to be a safe request.
On the other hand, a request using a method such as POST or PUT is an unsafe request because there is a possibility that a change occurs in the server device 105.
If the request is safe, the process proceeds to process 702; otherwise, the process proceeds to process 703.

安全なリクエストの場合には、サーバ装置105に変更が発生しないため、もし代表クライアント装置となっているクライアント装置の内部に現在処理中のリクエストに対応するレスポンスが保存されている場合には、そのレスポンスを流用する事が出来る可能性がある。
そこで、処理702では、代表クライアント処理部210は、現在処理中のリクエストに対応するレスポンスが受信データ管理部211に保存されているかを判定する。
対応するレスポンスが受信データ管理部211に保存されている場合には処理706へ遷移し、保存されていない場合には処理703に遷移する。
In the case of a secure request, since no change occurs in the server device 105, if a response corresponding to the request currently being processed is stored in the client device that is the representative client device, There is a possibility that the response can be diverted.
Therefore, in process 702, the representative client processing unit 210 determines whether a response corresponding to the request currently being processed is stored in the received data management unit 211.
If the corresponding response is stored in the received data management unit 211, the process proceeds to the process 706, and if not stored, the process proceeds to the process 703.

処理706では、受信データ管理部211に対応するレスポンスが保存されている事が確認できている。
しかし、そのレスポンスを再利用して問題ないかの判定が行われていない状態である。そこで、レスポンスの有効期限が切れているか否かの判定を処理706で行う。
有効期限はHTTPであればレスポンスヘッダの中からExpiresレスポンスヘッダもしくはCache−Controlレスポンスヘッダのmax−ageを用いて判定する事が可能である。
Expiresレスポンスヘッダにはそのレスポンスの有効期限が値として記述されている。
その有効期限が現在日時と比較して過去であればそのレスポンスの有効期限は切れていると判定可能である。
Cache−Controlレスポンスヘッダのmax−ageにはそのレスポンスをキャッシュして構わない時間が値として記述されている。
レスポンスの受信時刻にmax−ageの時間を加算した結果と現在日時を比較し、過去であればそのレスポンスの有効期限は切れていると判定可能である。
In process 706, it is confirmed that the response corresponding to the received data management unit 211 is stored.
However, it is in a state where it is not determined whether there is no problem by reusing the response. Therefore, it is determined in step 706 whether the response has expired.
If the expiration date is HTTP, it can be determined from the response header using the Expres response header or the max-age of the Cache-Control response header.
In the Expires response header, the expiration date of the response is described as a value.
If the expiration date is past compared to the current date and time, it can be determined that the response has expired.
The max-age of the Cache-Control response header describes a time when the response can be cached as a value.
The result of adding the time of max-age to the response reception time is compared with the current date and time, and if it is in the past, it can be determined that the expiration date of the response has expired.

処理706で有効期限が切れていると判定された場合には処理703に遷移し、有効期限が切れていないと判定された場合には処理707に遷移する。
なお、有効期限が切れていると判定された場合には、代表クライアント処理部210は、受信データ管理部211に対してリクエストに対応するエントリーを削除させても構わない。
なお、データの有効期限が存在しない場合、全てのレスポンスは変更されない場合、もしくは全てのレスポンスは常に更新されており、流用する事が出来ない様な場合には、処理706の処理はなくても構わない。
その場合、例えば全てのレスポンスが変更されない場合には、処理706への処理遷移は処理707への処理遷移に置き換えられる。
また、全てのレスポンスが常に更新されている場合には、処理706への処理遷移は処理703への処理遷移に置き換えられる。
If it is determined in process 706 that the expiration date has expired, the process proceeds to process 703, and if it is determined that the expiration date has not expired, the process proceeds to process 707.
When it is determined that the expiration date has expired, the representative client processing unit 210 may cause the received data management unit 211 to delete the entry corresponding to the request.
If the data expiration date does not exist, all responses are not changed, or all responses are constantly updated and cannot be diverted, the processing 706 is not necessary. I do not care.
In this case, for example, when all responses are not changed, the process transition to the process 706 is replaced with the process transition to the process 707.
If all responses are constantly updated, the process transition to process 706 is replaced with the process transition to process 703.

処理707は、現在処理中のリクエストが安全でかつ有効期限が切れていない事が確認できている状態で処理が行われる。
この処理では、代表クライアント処理部210は、現在処理中のリクエストに対応するレスポンスを受信データ管理部211から取得する。
取得完了後に処理708に遷移する。
The process 707 is performed in a state where it can be confirmed that the request currently being processed is safe and has not expired.
In this process, the representative client processing unit 210 acquires a response corresponding to the request currently being processed from the received data management unit 211.
After the acquisition is completed, the process proceeds to process 708.

処理703は、現在処理中のリクエストに対応するレスポンスが代表クライアント装置であるクライアント装置が保持していたとしても、再利用する事が出来ない事が確認できている状態で行われる。
この処理では現在処理中のリクエストをサーバ通信部212を介して、サーバ装置105に発行する処理を行う。
リクエスト発行完了後、処理704に遷移する。
The process 703 is performed in a state in which it is confirmed that even if the client apparatus as the representative client apparatus holds a response corresponding to the request currently being processed, it cannot be reused.
In this processing, processing for issuing a request currently being processed to the server device 105 via the server communication unit 212 is performed.
After the request issuance is completed, the process proceeds to process 704.

処理704は、発行したリクエストに対応するサーバからのレスポンスが返信されているまで待機する処理である。
レスポンスがサーバ装置105から返信された事をトリガーとして処理705に遷移する。
A process 704 is a process of waiting until a response from the server corresponding to the issued request is returned.
Transition to processing 705 is triggered by a response returned from the server apparatus 105.

処理705では、サーバ装置105から受信したレスポンスが対応するリクエストが安全である場合には、代表クライアント処理部210は、そのレスポンスとそのリクエストを関連付けて受信データ管理部211に保存する。
受信データ管理部211ではリクエストとそのレスポンスを対応づけて保存しているため、処理702でリクエストをキーとしてレスポンスを存在するか確認する事が可能となっている。
保存完了後、処理708に遷移する。
In process 705, if the request corresponding to the response received from the server device 105 is safe, the representative client processing unit 210 associates the response with the request and stores it in the received data management unit 211.
Since the received data management unit 211 stores the request and its response in association with each other, it is possible to check in step 702 whether a response exists using the request as a key.
After saving is completed, the process proceeds to processing 708.

処理708では、代表クライアント処理部210は、サーバ装置105もしくは受信データ管理部211から取得したレスポンスが対応するリクエストの発行元となるクライアント装置が自身であるか判定する。
判定の結果、リクエストの発行元がクライアント装置自身である場合には処理709に遷移し、代表クライアント判定部208にレスポンスを返信する。
リクエストの発行元がクライアント装置自身ではない場合には処理710に遷移し、代表クライアント処理部210は、リクエスト発行元のクライアント装置に向け分散ハッシュテーブルに従い、他クライアント通信部209を介して、他クライアント装置にレスポンスを転送する。
In processing 708, the representative client processing unit 210 determines whether the client device that is the source of the request corresponding to the response acquired from the server device 105 or the received data management unit 211 is itself.
As a result of the determination, if the request source is the client device itself, the process proceeds to processing 709 and a response is returned to the representative client determination unit 208.
When the request issue source is not the client device itself, the process proceeds to processing 710, and the representative client processing unit 210 follows the distributed hash table toward the client device that issued the request, and transmits the other client via the other client communication unit 209. Transfer the response to the device.

図11に受信データ管理部211でのリクエストとレスポンスの保存の具体例を示す。
この例では、HTTPに従ったリクエストとレスポンスを想定している。
リクエストではHTTPのリクエストのスタートライン、ヘッダ、ボディをリクエストとして保存し、対応するレスポンスに関しても同様にHTTPのレスポンスのスタートライン、ヘッダ、ボディを保存する。
この例では、同じ行のリクエストとレスポンスが対応づけられているとして表現している。
つまり、あるリクエストをキーとしてレスポンスを検索する場合、まずリクエスト列にキーとなるリクエストに合致するリクエストが存在するか検索し、あった場合にはそのリクエストと同じ行のレスポンスが検索すべきレスポンスとなる。
また、キーとなるリクエストとリクエスト列のリクエストを比較する場合にスタートライン、ヘッダ、ボディ全てが完全一致した場合、そのリクエスト同士は同一であるとする。
しかし、簡略化のためスタートライン中のURIのみの比較で行う事も可能である。
FIG. 11 shows a specific example of request and response storage in the received data management unit 211.
In this example, a request and response according to HTTP are assumed.
In the request, the start line, header, and body of the HTTP request are stored as a request, and the start line, header, and body of the HTTP response are similarly stored for the corresponding response.
In this example, the request and response on the same line are expressed as being associated with each other.
In other words, when searching for a response using a request as a key, first search for a request that matches the key request in the request column. If there is a response, the response on the same line as that request should be searched. Become.
Further, when comparing a request that is a key and a request in a request string, if all of the start line, header, and body are completely matched, it is assumed that the requests are the same.
However, for simplification, it is also possible to compare only the URIs in the start line.

***効果の説明***
以上までで説明した本実施の形態におけるクライアント処理を行う事によって、複数のクライアント装置で同一のリクエストをサーバ装置105に発行する必要がある状況において、複数のクライアント装置の全てが同一のリクエストを独立に発行することなく、そのリクエストに対応する代表クライアント装置を一意に決定し、その代表クライアント装置のみがサーバ装置105に対してリクエストを発行する事が可能となる。
この時、リクエスト発行を代表クライアント装置のみに決定する処理にサーバ装置105が関与していない事が重要であり、代表クライアント装置を決めるための処理負荷がサーバ装置105の新たな負荷として発生しない事が一つの効果である。
*** Explanation of effects ***
By performing the client processing in the present embodiment as described above, in a situation where a plurality of client devices need to issue the same request to the server device 105, all of the plurality of client devices independently issue the same request. In this case, the representative client device corresponding to the request is uniquely determined, and only the representative client device can issue the request to the server device 105.
At this time, it is important that the server device 105 is not involved in the process of determining only the representative client device to issue a request, and the processing load for determining the representative client device does not occur as a new load on the server device 105. Is one effect.

また、代表クライアント装置を決定するに当たり、分散ハッシュテーブルを用い、公平な代表クライアント装置の決定アルゴリズムを実現する事が可能となっているため、クライアント装置がクライアント・サーバシステムへ参加したタイミングによって多くのリクエストに対する代表クライアント装置が一つのクライアント装置に偏って決定される不公平が理論上発生しない点ももう一つの効果である。
参加したタイミングによって代表クライアント装置が偏る不公平が発生する一つの理由として、リクエストを発行する前にクライアント装置間でリクエストに対応するレスポンスを保持しているクライアント装置の検索を行い、保持するクライアント装置がいない場合には、リクエストを発行するクライアント装置が代表クライアント装置となる方式が、考えられる。
この方式では、システムに最初に参加したクライアント装置の参加時刻とその次に参加したクライアント装置の参加時刻との間の時間幅が大きい場合、最初に参加したクライアント装置が多くのリクエストをサーバ装置105に出す事になり、必然的に最初に参加したクライアント装置が多くのリクエストの代表クライアント装置に決定されやすくなる。
しかし、分散ハッシュテーブルを用いた本実施の形態による方式では、同様の状況であっても、2番目に参加したクライアント装置が発生すると、分散ハッシュテーブルの機能を利用して、代表クライアント装置の再配分が行われる事になる。
そのため、最初に参加したクライアント装置に多くのリクエストに対応する代表クライアント装置が決定していたとしても、2番目のクライアント装置が参加する事によって、代表クライアント装置の受け持ち数を平準化させる事が可能となる。
このような効果を得るために用いられる具体的な分散ハッシュテーブルのアルゴリズムの一つとしてChordなどがあげられる。
Chordはネットワークに参加するクライアント装置が動的に増減しても、分散ハッシュテーブルの維持・管理が可能である。
In addition, when determining the representative client device, it is possible to implement a fair representative client device determination algorithm using a distributed hash table, so there are many depending on the timing at which the client device participates in the client / server system. Another effect is that the unfairness in which the representative client device for a request is determined to be biased to one client device does not theoretically occur.
One reason for the unfairness in which the representative client device is biased depending on the timing of participation is to search for a client device that holds a response corresponding to the request between the client devices before issuing the request, and to hold the client device In the case where there is not, there is a method in which the client device that issues the request becomes the representative client device.
In this method, when the time width between the participation time of the client device that first participates in the system and the participation time of the client device that participates next is large, the client device that first participates sends many requests to the server device 105. Inevitably, the client device that participates first is inevitably determined as the representative client device of many requests.
However, in the method according to the present embodiment using the distributed hash table, even in the same situation, when the second participating client device occurs, the function of the distributed hash table is used to re-represent the representative client device. Allocation will be done.
Therefore, even if the representative client device corresponding to many requests is determined for the first client device to join, the number of representative client devices can be leveled by the participation of the second client device. It becomes.
One of the specific distributed hash table algorithms used to obtain such an effect is Chord.
Chord can maintain and manage the distributed hash table even if the number of client devices participating in the network increases or decreases dynamically.

実施の形態2.
以下では、実施の形態1に示したシステム構成において分散ハッシュテーブルとしてChordを用いた場合の具体例を説明する。
本実施の形態では、通信システム1000に新たなクライアント装置が参入する際の代表クライアントロールの引き継ぎ動作と、通信システム1000からクライアント装置が離脱する際の代表クライアントロールの引き継ぎ動作を説明する。
Embodiment 2. FIG.
Hereinafter, a specific example in the case where Chord is used as a distributed hash table in the system configuration shown in the first embodiment will be described.
In the present embodiment, a representative client role takeover operation when a new client device enters the communication system 1000 and a representative client role takeover operation when the client device leaves the communication system 1000 will be described.

***構成の説明***
本実施の形態に係るサーバ装置105の構成例は、図2に示す通りであり、また、本実施の形態に係る各クライアント装置の構成例は、図3に示す通りである。
本実施の形態では、主に実施の形態1との差異を説明する。
本実施の形態で説明していない事項は、実施の形態1と同様である。
*** Explanation of configuration ***
A configuration example of the server apparatus 105 according to the present embodiment is as shown in FIG. 2, and a configuration example of each client apparatus according to the present embodiment is as shown in FIG.
In the present embodiment, differences from the first embodiment will be mainly described.
Matters not described in the present embodiment are the same as those in the first embodiment.

新たなクライアント装置が通信システム1000に参加する際には、新たなクライアント装置に代表クライアントロールを引き継ぐクライアント装置では、他クライアント通信部209が以下のように動作する。
新たなクライアント装置に割り当てられる代表クライアントロールが対象とするリクエストに対応するレスポンスが受信データ管理部211にキャッシュされている場合に、他クライアント通信部209は、受信データ管理部211にキャッシュされているレスポンスを、新たなクライアント装置に送信する。
新たなクライアント装置は、送信されたレスポンスを記憶する。
When a new client device participates in the communication system 1000, the other client communication unit 209 operates as follows in the client device that takes over the representative client role to the new client device.
When the response corresponding to the request targeted by the representative client role assigned to the new client device is cached in the received data management unit 211, the other client communication unit 209 is cached in the received data management unit 211. The response is transmitted to the new client device.
The new client device stores the transmitted response.

また、通信システム1000からクライアント装置が離脱する際には、残留するクライアント装置では、他クライアント通信部209が以下のように動作する。
通信システムから離脱する離脱クライアント装置に割り当てられている代表クライアントロールが対象とするリクエストに対応するレスポンスが離脱クライアント装置にキャッシュされている場合に、他クライアント通信部209は、キャッシュされているレスポンスを離脱クライアント装置から受信する。
そして、残留するクライアント装置では、離脱クライアント装置から受信したレスポンスを受信データ管理部211で保存する。
When the client device leaves the communication system 1000, the other client communication unit 209 operates as follows in the remaining client device.
When the response corresponding to the request targeted by the representative client role assigned to the leaving client device leaving the communication system is cached in the leaving client device, the other client communication unit 209 displays the cached response. Received from the leaving client device.
In the remaining client device, the received data management unit 211 stores the response received from the leaving client device.

***動作の説明***
次に、本実施の形態に係るクライアント装置の動作例を図12及び図13を参照して説明する。
*** Explanation of operation ***
Next, an operation example of the client device according to the present embodiment will be described with reference to FIGS.

図12は、Chordを用いた本システムでのクライアント装置とリクエストとで構成する仮想空間を示す。
Chordでは、ノードとキーが同一の仮想空間上に配置される。
ノードとは実施の形態1のクライアント装置に対応し、キーとは実施の形態1のリクエストに対応する。
つまり、図12のノード902、903、904、905は、通信システム1000に参加しているクライアント装置101、102、103、104のいずれかに相当する。
ノードとキーの仮想空間上の配置の決定はハッシュ関数を用い、それぞれにIDを割り振り、そのIDの位置に配置する。
図12は、複数のノードとキーが仮想空間上に配置されている一例を図示している。
仮想空間901上にノード902、903、904、905とキー906、907、908、909、910、911、912がハッシュ関数によってそれぞれ求められたIDの位置に配置されている。
Chordではキーおよびそのキーに対応するデータの管理はノードが行う。
どのノードがどのキーおよびそのキーに対応するデータを管理するかの決定方法は以下の通りである。
あるノードとそのノードが仮想空間上で右回りで隣接するノードとの間に存在するキーおよびそのキーに対応するデータをそのノードが管理する。
例えば、ノード903は右回りで隣接するノード902の間にはキー906、907が存在する。
よって、ノード903はキー906、907およびそれらに対応するデータの管理を行う。
同様に、ノード904はキー908、909、910およびそれらに対応するデータの管理を行う。
FIG. 12 shows a virtual space composed of client devices and requests in this system using Chord.
In Chord, nodes and keys are arranged in the same virtual space.
The node corresponds to the client device of the first embodiment, and the key corresponds to the request of the first embodiment.
That is, the nodes 902, 903, 904, and 905 in FIG. 12 correspond to any of the client devices 101, 102, 103, and 104 participating in the communication system 1000.
Determination of the arrangement of the nodes and keys in the virtual space uses a hash function, assigns an ID to each, and arranges the ID at the position of the ID.
FIG. 12 illustrates an example in which a plurality of nodes and keys are arranged in the virtual space.
Nodes 902, 903, 904, and 905 and keys 906, 907, 908, 909, 910, 911, and 912 are arranged on the virtual space 901 at the ID positions obtained by the hash functions, respectively.
In Chord, a node manages a key and data corresponding to the key.
A method for determining which node manages which key and data corresponding to the key is as follows.
The node manages a key existing between a node and a node adjacent to the node clockwise in the virtual space and data corresponding to the key.
For example, keys 906 and 907 exist between nodes 902 that are clockwise and adjacent to node 903.
Therefore, the node 903 manages keys 906 and 907 and data corresponding to them.
Similarly, the node 904 manages keys 908, 909, and 910 and data corresponding to them.

図12に基づいて、本実施の形態における代表クライアント装置とリクエストとの関係を説明する。
前述の通り、ノードはクライアント装置、キーはリクエストに対応する。
Chordでは、キーおよびキーに対応するデータの管理をノードで行うが、そのキーに対応するデータとして、本実施の形態では少なくとも以下のものが対応する。
・リクエストによって取得されるレスポンス
・リクエストの発行元のクライアント装置のリスト
よってノード904に対応するクライアント装置はキー908、909、910に対応するリクエストの代表クライアント装置である事を意味する。
そのため、ノード904以外のノードに対応するクライアント装置が例えばキー908に対応するリクエストのレスポンスを取得するためには、そのリクエストをノード904に対応するクライアント装置に転送し、ノード904に対応するクライアント装置からレスポンスを入手する。
Based on FIG. 12, the relationship between the representative client device and the request in this embodiment will be described.
As described above, the node corresponds to the client device, and the key corresponds to the request.
In Chord, a key and data corresponding to the key are managed by the node. As data corresponding to the key, at least the following is supported in the present embodiment.
-Response acquired by request-List of client devices from which requests are issued It means that the client device corresponding to the node 904 is the representative client device of the request corresponding to the keys 908, 909, 910.
Therefore, in order for a client device corresponding to a node other than the node 904 to obtain a response to a request corresponding to the key 908, for example, the request is transferred to the client device corresponding to the node 904, and the client device corresponding to the node 904 Get a response from

次に、図13を用いて新規にクライアント装置が通信システム1000に参加した場合の挙動を説明する。   Next, the behavior when a new client device joins the communication system 1000 will be described with reference to FIG.

図13は、図12の状態の仮想空間に対してノード1001に対応するクライアント装置が新規に参加した状況を示す。
この場合は、ノード1001に対応するクライアント装置はキー906に対応するリクエストの代表クライアント装置とならなければならない。
Chordでは新規参加ノードが仮想空間に参加した場合、新規参加ノードの前後のノードと通信を行い、状態更新を行う。
その際に、新規参加ノードに対応するクライアント装置は、代表クライアント装置を担当すべきリクエストおよびその関連データ(レスポンス、リクエスト発行元のクライアント装置のリスト)を参加前の代表クライアント装置から受け取る。
ノード1001に対応するクライアント装置の参加前の代表クライアント装置は、ノード903に対応するクライアント装置である。
このため、ノード1001に対応するクライアント装置は、ノード903に対応するクライアント装置からキー906に対応するリクエストおよび関連データを引継ぐ必要がある。
この時、引継ぎ元のクライアント装置からリクエストおよび関連データを引き継ぎ先のクライアント装置に引継ぐ際、引継ぎ元のクライアント装置がレスポンスをサーバ装置105から受信中の場合には、受信完了を待ってから引継ぎ処理を開始する。
受信完了を待つ事によって、不完全なレスポンスが引継がれる事を回避できる。
FIG. 13 shows a situation where a client device corresponding to the node 1001 newly participates in the virtual space in the state of FIG.
In this case, the client device corresponding to the node 1001 must be the representative client device of the request corresponding to the key 906.
In Chord, when a new participating node joins the virtual space, it communicates with nodes before and after the new participating node to update the state.
At that time, the client device corresponding to the newly participating node receives the request to be responsible for the representative client device and its related data (response, list of client devices that issued the request) from the representative client device before participation.
The representative client device before participation of the client device corresponding to the node 1001 is a client device corresponding to the node 903.
For this reason, the client device corresponding to the node 1001 needs to take over the request and related data corresponding to the key 906 from the client device corresponding to the node 903.
At this time, when taking over the request and related data from the takeover source client device to the takeover destination client device, if the takeover source client device is receiving a response from the server device 105, the takeover processing is performed after the reception is completed. To start.
By waiting for reception completion, it is possible to avoid taking over an incomplete response.

次に、図13の状態からノード1001に対応するクライアント装置が通信システム1000から離脱した場合の挙動を例にクライアント装置の離脱時の処理を説明する。
なお、この離脱が完了すると図12の状態に戻る事を意味する。
Next, the processing when the client device is detached will be described by taking as an example the behavior when the client device corresponding to the node 1001 leaves the communication system 1000 from the state of FIG.
Note that when this separation is completed, it means returning to the state of FIG.

ノード1001に対応するクライアント装置が離脱した場合、そのクライアント装置が代表クライアント装置を担当していたキー906に対応するリクエストの代表クライアントを引き続きシステムに残るクライアント装置に引継ぐ必要がある。
Chordを用いた場合には、代表クライアントを引継ぐクライアント装置はノード903に対応するクライアント装置となる。
そこで、ノード1001に対応するクライアントは、離脱する前に、自身が代表クライアント装置を担当するリクエストおよび関連データをノード903に対応するクライアント装置に引継ぐ。
この時、新規参加と同様にサーバ装置105からレスポンスを受信している場合は、レスポンスの受信完了を待ってからノード903に対応するクライアント装置に引継ぐ。
When the client device corresponding to the node 1001 leaves, it is necessary to continue the representative client of the request corresponding to the key 906 for which the client device was responsible for the representative client device to the client device remaining in the system.
When Chord is used, the client device that takes over the representative client is a client device corresponding to the node 903.
Therefore, the client corresponding to the node 1001 takes over the request and related data, which is responsible for the representative client device, to the client device corresponding to the node 903 before leaving.
At this time, if a response is received from the server device 105 as in the case of new participation, the client device corresponding to the node 903 is taken over after waiting for the completion of reception of the response.

***効果の説明***
本実施の形態によれば、システムに対するクライアント装置の参加、離脱が発生した場合であっても、適切な代表クライアント装置の引継ぎが可能となる。
*** Explanation of effects ***
According to the present embodiment, even when a client device joins or leaves the system, an appropriate representative client device can be taken over.

実施の形態3.
本実施の形態では、通信システム1000からのクライアント装置の離脱に関する手順を更に説明する。
Embodiment 3 FIG.
In the present embodiment, a procedure related to detachment of a client device from the communication system 1000 will be further described.

あるクライアント装置のシステム離脱は大きく分けて、クライアント装置として計画した離脱と、主に不正処理による強制終了などを要因とした計画していない離脱に分けられる。
計画した離脱の場合には実施の形態2に前述した通りの手順にて分散ハッシュテーブルを用いる事で代表クライアントロールの引継ぎが適切に行えるが、計画していない離脱の場合には、代表クライアントロールの引継ぎを前述の手順で行えない。
本実施の形態では、計画していないクライアント装置の離脱に対応する手順を説明する。
The system detachment of a certain client device can be broadly divided into a detachment planned as a client device and an unscheduled detachment mainly due to forced termination due to unauthorized processing.
In the case of planned departure, it is possible to appropriately take over the representative client role by using the distributed hash table in the procedure described above in the second embodiment, but in the case of unplanned departure, the representative client role Cannot be taken over by the above procedure.
In the present embodiment, a procedure corresponding to unscheduled detachment of a client device will be described.

***構成の説明***
本実施の形態に係るサーバ装置105の構成例は、図2に示す通りであり、また、本実施の形態に係る各クライアント装置の構成例は、図3に示す通りである。
本実施の形態では、主に実施の形態1、2との差異を説明する。
本実施の形態で説明していない事項は、実施の形態1、2と同様である。
*** Explanation of configuration ***
A configuration example of the server apparatus 105 according to the present embodiment is as shown in FIG. 2, and a configuration example of each client apparatus according to the present embodiment is as shown in FIG.
In the present embodiment, differences from the first and second embodiments will be mainly described.
Matters not described in the present embodiment are the same as those in the first and second embodiments.

本実施の形態では、代表クライアント処理部210が、自装置が通信システム1000から離脱した後に自装置に代わって動作する予備代表クライアント装置(以下、単に予備代表クライアントともいう)を他のクライアント装置の中から選択し、サーバ装置105に送信するリクエストに予備代表クライアント装置の識別子を追加する。
そして、サーバ通信部212は、代表クライアント処理部210により予備代表クライアント装置の識別子が追加されたリクエストをサーバ装置105に送信する。
サーバ装置105では、通信部213が、リクエスト発行元のクライアント装置にレスポンスを送信できない場合に、予備代表クライアント装置にレスポンスを送信する。
In the present embodiment, the representative client processing unit 210 replaces a spare representative client device (hereinafter also simply referred to as a spare representative client) that operates on behalf of the own device after the own device leaves the communication system 1000 with another client device. The identifier of the backup representative client device is added to the request transmitted to the server device 105.
Then, the server communication unit 212 transmits a request to which the identifier of the backup representative client device has been added by the representative client processing unit 210 to the server device 105.
In the server device 105, the communication unit 213 transmits a response to the backup representative client device when the response cannot be transmitted to the request issuing client device.

***動作の説明***
次に、本実施の形態に係る代表クライアント処理部210の動作例を図14を用いて説明する。
図14は、図10で示した代表クライアント処理部210の処理を拡張した処理フロー図であり、図10に対して処理1101、1102が追加されている。
以下では、追加処理に関連する部分のみを説明する。
*** Explanation of operation ***
Next, an operation example of the representative client processing unit 210 according to the present embodiment will be described with reference to FIG.
FIG. 14 is a processing flow diagram in which the processing of the representative client processing unit 210 shown in FIG. 10 is expanded, and processing 1101 and 1102 are added to FIG.
Below, only the part relevant to an additional process is demonstrated.

処理1101は、代表クライアント装置として、サーバ装置105にリクエストを送信する事が決定した時に最初に処理される処理である。
そのため、処理702でレスポンスが受信データ管理部211に保存されていない事が判明した場合、および処理706で受信データ管理部211に保存される対応するレスポンスの有効期限が切れている事が判明した場合に、処理1101に遷移する。
A process 1101 is a process that is first processed when it is determined that a request is transmitted to the server apparatus 105 as a representative client apparatus.
For this reason, it is found that the response is not stored in the received data management unit 211 in the process 702, and that the corresponding response stored in the received data management unit 211 is expired in the process 706. In this case, the processing transits to processing 1101.

処理1101では、この処理を行っているクライアント装置が処理704でサーバ装置105からのレスポンスの返信待機中に計画していない離脱を余儀なくされた場合に、処理中の代表クライアントの処理を引継ぐクライアント装置である予備代表クライアント装置の探索を行う。
具体的にはその時点の分散ハッシュテーブルにて、代表クライアント装置が離脱した場合に、その代表クライアント装置が担当する全てのリクエスト及びレスポンスの処理を引継ぐクライアント装置を予備代表クライアント装置として決定する。
分散ハッシュテーブルとしてChordを用いている場合であれば、その代表クライアントの時計回りに隣接するノードに対応するクライアント装置となる。
In process 1101, when the client apparatus performing this process is forced to leave without waiting for a response reply from the server apparatus 105 in process 704, the client apparatus takes over the process of the representative client being processed. The preliminary representative client device is searched.
Specifically, in the distributed hash table at that time, when the representative client device leaves, the client device that takes over the processing of all requests and responses handled by the representative client device is determined as the backup representative client device.
If Chord is used as the distributed hash table, the client device corresponds to the node adjacent to the representative client in the clockwise direction.

次に、処理1102では、代表クライアント処理部210が、処理1101で決定した予備代表クライアントの情報をリクエストに結合する。   Next, in processing 1102, the representative client processing unit 210 combines the information of the spare representative client determined in processing 1101 with the request.

図15は予備代表クライアントの情報をHTTPリクエストに結合した一つの例である。
図15では、予備代表クライアントの情報をHTTP Headerとして結合している。
具体的にはX−Representative−Client−AddressヘッダとX−Requestor−Client−Addresses−Listヘッダである。
X−Representative−Client−Addressヘッダには予備代表クライアントのネットワークIDを値として設定し、X−Requestor−Client−Addresses−Listヘッダにはこのリクエストのリクエスト元のクライアントのネットワークIDのリストを値として設定している。
なお、ヘッダ名は一つの例であり、ヘッダ名が異なる場合であっても、本質的な違いはない。
FIG. 15 shows an example in which the information of the backup representative client is combined with the HTTP request.
In FIG. 15, information on the backup representative client is combined as an HTTP header.
Specifically, an X-Representative-Client-Address header and an X-Requester-Client-Address-List header.
The network ID of the backup representative client is set as a value in the X-Representative-Client-Address header, and the network ID list of the request source client of this request is set as the value in the X-Requester-Client-Address-List header. doing.
Note that the header name is an example, and even if the header name is different, there is no essential difference.

また、図16は予備代表クライアントの情報をHTTPリクエストに結合したもう一つの例である。
図16では、予備代表クライアントの情報をHTTP Request Bodyとして結合している。
具体的には予備代表クライアントの情報をJSON形式で表現しており、Representativeプロパティに予備代表クライアントのネットワークIDを値として設定し、Requestorsプロパティにこのリクエストのリクエスト元のクライアントのネットワークIDのリストを値として設定している。
なお、予備代表クライアントは唯一とする必要はなく、予備代表クライアントも離脱している場合を想定して、その先の予備代表クライアントも含めて複数の予備代表クライアントをサーバ装置105に送信するとしても構わない。
その場合には、予備代表クライアントのネットワークIDはリストとしてサーバ装置105に送信される事になる。
FIG. 16 shows another example in which the information of the backup representative client is combined with the HTTP request.
In FIG. 16, the information of the backup representative client is combined as an HTTP request body.
Specifically, information on the backup representative client is expressed in the JSON format, the network ID of the backup representative client is set as a value in the Representative property, and a list of the network IDs of the request source client of this request is set in the Requests property. It is set as.
The spare representative client need not be unique, and assuming that the spare representative client is also disconnected, a plurality of spare representative clients including the spare representative client ahead may be transmitted to the server device 105. I do not care.
In that case, the network ID of the backup representative client is transmitted to the server device 105 as a list.

次に、図17を用いて予備代表クライアントの情報を用いたサーバ処理を説明する。
なお、説明を簡単化するため本サーバの処理フローはシングルスレッドで動作する事を前提としているが、マルチスレッドでの動作で動作するサーバでも構わない。
Next, server processing using information of the backup representative client will be described with reference to FIG.
In order to simplify the description, it is assumed that the processing flow of this server operates with a single thread, but a server that operates with a multi-thread operation may be used.

処理1401で、サーバ装置105はクライアント装置からリクエストが送信されるのを待機する。
クライアント装置からリクエストが送信されてくると処理1402に遷移する。
In process 1401, the server apparatus 105 waits for a request to be transmitted from the client apparatus.
When a request is transmitted from the client device, the process proceeds to processing 1402.

処理1402では、通信部213が、送信されてきたリクエストを受信し、メモリ上に展開する。   In processing 1402, the communication unit 213 receives the transmitted request and expands it on the memory.

処理1403では、要求処理部214が、メモリ上に展開したリクエストを解析し、内容を解釈可能な状態にする。   In processing 1403, the request processing unit 214 analyzes the request developed on the memory and makes the contents interpretable.

処理1404で、要求処理部214が、そのリクエストに記述されている内容に従った処理を実施する。
その処理内容についてはリクエストに依存するため、ここでは言及しない。
In processing 1404, the request processing unit 214 performs processing according to the contents described in the request.
Since the processing content depends on the request, it is not mentioned here.

処理1405では、要求処理部214が、処理1404で処理した結果、クライアントに通知すべき内容をレスポンスとして生成する。   In processing 1405, the request processing unit 214 generates, as a response, contents to be notified to the client as a result of processing in processing 1404.

処理1406では、通信部213が、処理1405で生成したレスポンスをリクエストを送信してきたクライアント装置に送信する。   In processing 1406, the communication unit 213 transmits the response generated in processing 1405 to the client device that has transmitted the request.

処理1407では、要求処理部214が、処理1406での送信処理が正常に完了したかを判定し、正常に完了した場合には処理1401に遷移し、他のクライアント装置からのリクエスト送信に備えて待機を行う。
逆に正常に完了しなかった場合は、処理1408に遷移する。
In processing 1407, the request processing unit 214 determines whether or not the transmission processing in processing 1406 has been normally completed. If the transmission processing is completed normally, the request processing unit 214 proceeds to processing 1401 and prepares for request transmission from another client device. Wait.
On the other hand, if it is not completed normally, the process proceeds to process 1408.

処理1408では、クライアント装置に正常にレスポンスを返信できなかったため、サーバ装置105では、要求処理部214が、処理1403でリクエストを解析した結果から未処理の予備代表クライアントの情報のうちの一つの取得を試みる。   In processing 1408, since the response could not be normally returned to the client device, the request processing unit 214 in the server device 105 obtains one of the information of the unprocessed backup representative client from the result of analyzing the request in processing 1403. Try.

処理1409では、要求処理部214が、処理1408の結果、未処理である予備代表クライアントの情報の取得に成功したかを判定する。
取得に成功した場合には処理1410に遷移し、失敗した場合には、これ以上予備代表クライアントの情報はないため、今回の処理はエラー終了として結果を破棄し処理1401に遷移する。
In processing 1409, the request processing unit 214 determines whether or not the information of the unprocessed backup representative client has been successfully acquired as a result of processing 1408.
If the acquisition is successful, the process proceeds to process 1410. If the acquisition is unsuccessful, there is no information on the spare representative client any more, so the current process is terminated as an error and the result is discarded, and the process proceeds to process 1401.

処理1410では、通信部213が、処理1408で取得した未処理である予備代表クライアントの情報に記載されている予備代表クライアントのネットワークIDを取得し、そのネットワークIDの相手に対してレスポンスの送信を試みる。
ここでの送信ではHTTPの様にクライアントからのリクエストを起点とするプロトコルは用いる事ができないため、例えばWebSocketやServer−Sent Eventsなどのサーバを起点とする事が可能なプロトコルを用いる。
In processing 1410, the communication unit 213 acquires the network ID of the standby representative client described in the information of the unprocessed standby representative client acquired in processing 1408, and transmits a response to the partner of the network ID. Try.
In this transmission, since a protocol starting from a request from a client cannot be used like HTTP, a protocol that can start from a server such as WebSocket or Server-Sent Events is used.

処理1411では、要求処理部214が、処理1410での送信処理が正常に完了したかを判定し、正常に完了した場合には処理1401に遷移し、他のクライアント装置からのリクエスト送信に備えて待機を行う。
逆に正常に完了しなかった場合は、処理1408に遷移し、残る未処理である予備代表クライアントの情報を用いた送信処理を繰り返す。
In processing 1411, the request processing unit 214 determines whether or not the transmission processing in processing 1410 has been completed normally. If the processing is completed normally, the request processing unit 214 transitions to processing 1401 to prepare for request transmission from another client device. Wait.
On the other hand, if not completed normally, the process proceeds to process 1408, and the transmission process using information of the remaining unprocessed backup representative client is repeated.

***効果の説明***
本実施の形態によれば、代表クライアント装置に計画外の離脱が発生した場合であっても、予備代表クライアント装置により、リクエスト発行元に確実にレスポンスを返すことができる。
*** Explanation of effects ***
According to the present embodiment, even if the unplanned departure occurs in the representative client device, the spare representative client device can reliably return a response to the request issuer.

実施の形態4.
クライアント・サーバシステムにおいて、サーバ装置はクライアント装置の要求に必ず即時にレスポンスを返信するとは限らない。
例えば、要求に対応するサーバ処理に非常に時間がかかる場合、サーバ装置の都合に応じてレスポンスの返信タイミングが遅延する場合が想定され、その場合には時間をおいてクライアント装置にレスポンスが返信される事になる。
複数のクライアント装置から同一のリクエストが発生している状況でサーバ装置からのレスポンスが遅延した場合に、マルチキャスト配信ができないシステムでは、そのリクエストの代表クライアント装置はレスポンスの受信後に、全てのリクエスト発行元のクライアント装置に順次レスポンスを返信しなければならない。
このような場合は、代表クライアント装置の返信負荷が一時期に集中してしまう。
また、最初にレスポンスが返信されるリクエスト発行元のクライアント装置と最後にレスポンスが返信されるリクエスト発行元のクライアント装置では、レスポンスを受信するタイミングに差異が生じる。
リクエスト発行元のクライアント装置が多いほど、この差異は大きくなる。
本実施の形態は、これらの事情に鑑みたものである。
Embodiment 4 FIG.
In a client / server system, a server device does not always immediately return a response to a request from a client device.
For example, when server processing corresponding to a request takes a very long time, it is assumed that the response return timing is delayed depending on the convenience of the server device. In this case, a response is returned to the client device over time. It will be.
In a system where multicast delivery is not possible when the response from the server device is delayed in the situation where the same request is generated from multiple client devices, the representative client device of the request receives all the request issuers after receiving the response. Responses must be sent back to the client devices in sequence.
In such a case, the reply load of the representative client device is concentrated at one time.
Also, there is a difference in the timing of receiving a response between the client device that issued the response first and the client device that issued the request last.
This difference increases as the number of client devices that issue requests increases.
The present embodiment has been made in view of these circumstances.

***構成の説明***
本実施の形態に係るサーバ装置105の構成例は、図2に示す通りであり、また、本実施の形態に係る各クライアント装置の構成例は、図3に示す通りである。
本実施の形態では、主に実施の形態1との差異を説明する。
本実施の形態で説明していない事項は、実施の形態1と同様である。
*** Explanation of configuration ***
A configuration example of the server apparatus 105 according to the present embodiment is as shown in FIG. 2, and a configuration example of each client apparatus according to the present embodiment is as shown in FIG.
In the present embodiment, differences from the first embodiment will be mainly described.
Matters not described in the present embodiment are the same as those in the first embodiment.

本実施の形態では、代表クライアント処理部210は、2以上のクライアント装置で生成された同一のリクエストが取得リクエストとして取得され、当該取得リクエストについての代表クライアントロールが自装置に割り当てられている場合に、リクエスト生成元の2以上のクライアント装置のうちのいずれかのクライアント装置を、自装置と協働する代表クライアントクローン装置(以下、単に代表クライアントクローンともいう)に指定する。
より具体的には、代表クライアント処理部210は、取得リクエストのリクエスト生成元のクライアント装置の個数が閾値を超える場合に、代表クライアントクローン装置を指定する。
他クライアント通信部209は、代表クライアントクローン装置に指定されたクライアント装置に対して、代表クライアントクローン装置に指定された旨を通知するとともに、前記2以上のクライアント装置のうち代表クライアントクローン装置に指定されなかったクライアント装置をレスポンスの送信先として通知する通知メッセージを送信する。
また、他クライアント通信部209は、取得リクエストに対応するレスポンスを、代表クライアントクローン装置に送信し、代表クライアントクローン装置から、通知メッセージで通知した送信先のクライアント装置にレスポンスを送信させる。
他クライアント通信部209は、代表クライアントクローン装置がレスポンスを送信するクライアント装置には、レスポンスを送信しない。
In the present embodiment, the representative client processing unit 210 acquires the same request generated by two or more client devices as an acquisition request, and the representative client role for the acquisition request is assigned to the own device. Any one of the two or more client devices of the request generation source is designated as a representative client clone device (hereinafter also simply referred to as a representative client clone) cooperating with the own device.
More specifically, the representative client processing unit 210 designates a representative client clone device when the number of request generation client devices of the acquisition request exceeds a threshold value.
The other client communication unit 209 notifies the client device designated as the representative client clone device that the designated client clone device has been designated, and is designated as the representative client clone device among the two or more client devices. A notification message for notifying the client device that has not been received as a response destination is transmitted.
Further, the other client communication unit 209 transmits a response corresponding to the acquisition request to the representative client clone device, and causes the representative client clone device to transmit a response to the destination client device notified by the notification message.
The other client communication unit 209 does not transmit a response to the client device to which the representative client clone device transmits a response.

また、代表クライアントクローン装置に指定されたクライアント装置では、他クライアント通信部209が、他のクライアント装置から通知メッセージを受信する。
通知メッセージでは、前述のように、代表クライアントクローン装置に指定された旨が通知されるとともに、レスポンスの送信先のクライアント装置が通知される。
他クライアント通信部209は、通知メッセージを受信した後に、他のクライアント装置からレスポンスを受信した場合に、受信したレスポンスを、通知メッセージで通知された送信先のクライアント装置に送信する。
In the client device designated as the representative client clone device, the other client communication unit 209 receives the notification message from the other client device.
As described above, the notification message notifies that the representative client clone device has been designated, and also notifies the client device to which the response is transmitted.
When the other client communication unit 209 receives a response from another client device after receiving the notification message, the other client communication unit 209 transmits the received response to the destination client device notified by the notification message.

また、代表クライアントクローン装置に指定されたクライアント装置では、代表クライアント処理部210は、通知メッセージで通知された送信先のクライアント装置の個数が2以上であり、当該個数が閾値以上である場合に、2以上のクライアント装置のうちのいずれかのクライアント装置を、新たな代表クライアントクローン装置に指定する。
そして、他クライアント通信部209が、新たな代表クライアントクローン装置に指定されたクライアント装置に対して、代表クライアントクローン装置に指定された旨を通知するとともに、2以上のクライアント装置のうち新たな代表クライアントクローン装置に指定されなかったクライアント装置をレスポンスの送信先として通知する通知メッセージを送信する。
そして、他クライアント通信部209は、他のクライアント装置からレスポンスを受信した場合に、受信したレスポンスを、新たな代表クライアントクローン装置に送信し、新たな代表クライアントクローン装置から、新たな代表クライアントクローン装置への通知メッセージで通知した送信先のクライアント装置にレスポンスを送信させる。
他クライアント通信部209は、新たな代表クライアントクローン装置がレスポンスを送信するクライアント装置には、レスポンスを送信しない。
Further, in the client device designated as the representative client clone device, the representative client processing unit 210 determines that the number of destination client devices notified by the notification message is 2 or more and the number is equal to or more than a threshold. One of the two or more client devices is designated as a new representative client clone device.
Then, the other client communication unit 209 notifies the client device designated as the new representative client clone device that it has been designated as the representative client clone device, and the new representative client among the two or more client devices. A notification message for notifying a client device not designated as a clone device as a response transmission destination is transmitted.
When the other client communication unit 209 receives a response from another client device, the other client communication unit 209 transmits the received response to the new representative client clone device, and the new representative client clone device sends a new representative client clone device. A response is transmitted to the destination client device notified by the notification message.
The other client communication unit 209 does not send a response to the client device to which the new representative client clone device sends a response.

***動作の説明***
図22〜図28を用いて、本実施の形態に係るクライアント装置の動作の概略を説明する。
図22〜図28において、あるリクエストに対する代表クライアント装置をクライアント0とし、代表クライアント装置を丸図形で表現する。
また、図22〜図28では、代表クライアント装置に対するリクエストの発行元となるクライアント装置は正方形で表現する。
また、図22〜図28では、代表クライアントクローン装置となるクライアント装置は六角形で表現する。
また、図22〜図28において、番号0〜7は、クライアント装置のID番号である。
また、代表クライアントおよび代表クライアントクローンがレスポンスを返信する担当となるクライアントの図形に対しては矢印が伸びる事で表現する。
例えば、図22は、代表クライアント0はリクエスト発行元クライアント1にレスポンスを返信する担当である事を意味する。
*** Explanation of operation ***
The outline of the operation of the client device according to the present embodiment will be described with reference to FIGS.
22 to 28, the representative client device for a certain request is represented by client 0, and the representative client device is represented by a circle.
In FIG. 22 to FIG. 28, the client device that is the source of the request for the representative client device is represented by a square.
In FIG. 22 to FIG. 28, the client device that is the representative client clone device is represented by a hexagon.
22 to 28, numbers 0 to 7 are client device ID numbers.
In addition, the representative client and the representative client clone are represented by an arrow extending with respect to the figure of the client that is in charge of returning a response.
For example, FIG. 22 means that the representative client 0 is in charge of returning a response to the request issuer client 1.

以下では、代表クライアントクローンを指定するための閾値をN=3として説明を進める。
つまり、同一のリクエストが3つのクライアントで発行された場合には、代表クライアント装置の代表クライアント処理部210は、当該3つのクライアントの中から代表クライアントクローンを指定する。
同様に、代表クライアントクローンの代表クライアント処理部210は、代表クライアントから、3つのクライアントへのレスポンスの送信が要求された場合に、当該3つのクライアントの中から新たな代表クライアントクローンを指定する。
In the following description, the threshold for designating the representative client clone is assumed to be N = 3.
That is, when the same request is issued by three clients, the representative client processing unit 210 of the representative client device designates a representative client clone from the three clients.
Similarly, the representative client processing unit 210 of the representative client clone designates a new representative client clone from the three clients when the representative client requests transmission of responses to the three clients.

図22に示す通り、最初にクライアント1がリクエストを発行した際には、代表クライアント0がリクエストの処理を担当する。
次に、クライアント2がリクエストを発行した際にも同様に代表クライアント0がリクエストの処理を担当し、図23の通りとなる。
次に、クライアント3がリクエストを発行した際は、閾値N=3に達するため、代表クライアント0の代表クライアント処理部210は、例えばクライアント1をクライアント3に対する代表クライアントクローンに指定する。
そして、代表クライアント0の他クライアント通信部209が、クライアント1に通知メッセージ(以下、代表クライアントクローン要求という)を送信する。
代表クライアントクローン要求では、クライアント1が代表クライアントクローンに指定された旨と、クライアント3にレスポンスを送信する旨が通知される。
この結果、図24の通り、クライアント1がクライアント3を担当する代表クライアントクローンとなる。
As shown in FIG. 22, when the client 1 first issues a request, the representative client 0 is in charge of processing the request.
Next, when the client 2 issues a request, the representative client 0 is also in charge of processing the request, as shown in FIG.
Next, when the client 3 issues a request, since the threshold value N = 3 is reached, the representative client processing unit 210 of the representative client 0 designates the client 1 as a representative client clone for the client 3, for example.
Then, the other client communication unit 209 of the representative client 0 transmits a notification message (hereinafter referred to as a representative client clone request) to the client 1.
In the representative client clone request, it is notified that the client 1 is designated as the representative client clone and that a response is transmitted to the client 3.
As a result, the client 1 becomes a representative client clone in charge of the client 3 as shown in FIG.

次に、クライアント4がリクエストを発行した際は、閾値N=3に達しているので、代表クライアント0の代表クライアント処理部210は、例えばクライアント2をクライアント4に対する代表クライアントクローンに指定する。
そして、代表クライアント0の他クライアント通信部209が、クライアント2に代表クライアントクローン要求を送信する。
この代表クライアントクローン要求では、クライアント2が代表クライアントクローンに指定された旨と、クライアント4にレスポンスを送信する旨が通知される。
この結果、図25の通り、クライアント2がクライアント4を担当する代表クライアントクローンとなる。
Next, when the client 4 issues a request, since the threshold value N = 3 is reached, the representative client processing unit 210 of the representative client 0 designates the client 2 as a representative client clone for the client 4, for example.
Then, the other client communication unit 209 of the representative client 0 transmits a representative client clone request to the client 2.
In this representative client clone request, it is notified that the client 2 is designated as the representative client clone and that a response is transmitted to the client 4.
As a result, the client 2 becomes the representative client clone in charge of the client 4 as shown in FIG.

次に、クライアント5がリクエストを発行した際は、閾値N=3に達しているので、代表クライアント0の代表クライアント処理部210は、例えばクライアント1をクライアント5に対する代表クライアントクローンに指定する。
そして、代表クライアント0の他クライアント通信部209が、クライアント1に代表クライアントクローン要求を送信する。
この代表クライアントクローン要求では、クライアント1が代表クライアントクローンに指定された旨と、クライアント5にレスポンスを送信する旨が通知される。
この結果、図26の通り、クライアント1がクライアント3とクライアント5を担当する代表クライアントクローンとなる。
Next, when the client 5 issues a request, since the threshold value N = 3 is reached, the representative client processing unit 210 of the representative client 0 designates the client 1 as a representative client clone for the client 5, for example.
Then, the other client communication unit 209 of the representative client 0 transmits a representative client clone request to the client 1.
In this representative client clone request, it is notified that the client 1 is designated as a representative client clone and that a response is transmitted to the client 5.
As a result, as shown in FIG. 26, the client 1 becomes a representative client clone in charge of the client 3 and the client 5.

次に、クライアント6がリクエストを発行した際は、閾値N=3に達しているので、代表クライアント0の代表クライアント処理部210は、例えばクライアント2をクライアント6に対する代表クライアントクローンに指定する。
そして、代表クライアント0の他クライアント通信部209が、クライアント2に代表クライアントクローン要求を送信する。
この代表クライアントクローン要求では、クライアント2が代表クライアントクローンに指定された旨と、クライアント6にレスポンスを送信する旨が通知される。
この結果、図27の通り、クライアント2がクライアント4とクライアント6を担当する代表クライアントクローンとなる。
Next, when the client 6 issues a request, since the threshold value N = 3 is reached, the representative client processing unit 210 of the representative client 0 designates the client 2 as a representative client clone for the client 6, for example.
Then, the other client communication unit 209 of the representative client 0 transmits a representative client clone request to the client 2.
In this representative client clone request, it is notified that the client 2 is designated as a representative client clone and that a response is transmitted to the client 6.
As a result, as shown in FIG. 27, the client 2 becomes a representative client clone in charge of the client 4 and the client 6.

次に、クライアント7がリクエストを発行した際は、閾値N=3に達しているので、代表クライアント0の代表クライアント処理部210は、例えばクライアント1をクライアント7に対する代表クライアントクローンに指定する。
そして、代表クライアント0の他クライアント通信部209が、クライアント1に代表クライアントクローン要求を送信する。
しかし、代表クライアントクローン1でも閾値N=3に達する。
このため、代表クライアントクローン1の代表クライアント処理部210は、例えば、クライアント3をクライアント7に対する代表クライアントクローンとして新たに指定する。
そして、代表クライアントクローン1の他クライアント通信部209が、クライアント3に代表クライアントクローン要求を送信する。
この代表クライアントクローン要求では、クライアント3が代表クライアントクローンに指定された旨と、クライアント7にレスポンスを送信する旨が通知される。
この結果、図27の通り、クライアント3がクライアント7を担当する新たな代表クライアントクローンとなる。
Next, when the client 7 issues a request, since the threshold value N = 3 has been reached, the representative client processing unit 210 of the representative client 0 designates the client 1 as a representative client clone for the client 7, for example.
Then, the other client communication unit 209 of the representative client 0 transmits a representative client clone request to the client 1.
However, even the representative client clone 1 reaches the threshold value N = 3.
Therefore, the representative client processing unit 210 of the representative client clone 1 newly designates the client 3 as a representative client clone for the client 7, for example.
Then, the other client communication unit 209 of the representative client clone 1 transmits a representative client clone request to the client 3.
In this representative client clone request, it is notified that the client 3 is designated as the representative client clone and that a response is transmitted to the client 7.
As a result, as shown in FIG. 27, the client 3 becomes a new representative client clone in charge of the client 7.

次に、図18、図19、図20を用いて本実施の形態における代表クライアント処理部210の処理フローを説明する。
図18、図19、図20は、図10で示した代表クライアント処理部210の処理フローを拡張した処理フローであり、図10に対して処理1501〜1509の処理が追加されている。
以下では、追加処理に関連する部分のみを説明する。
Next, the processing flow of the representative client processing unit 210 in the present embodiment will be described with reference to FIGS. 18, 19, and 20.
18, 19, and 20 are processing flows obtained by extending the processing flow of the representative client processing unit 210 illustrated in FIG. 10, and processes 1501 to 1509 are added to FIG. 10.
Below, only the part relevant to an additional process is demonstrated.

また、本実施の形態では、代表クライアント処理部210はリクエストと、そのリクエスト発行元のリストを管理する。
図21にリクエストとリクエスト発行元のリスト管理の一例を示す。
In this embodiment, the representative client processing unit 210 manages a request and a list of request issuers.
FIG. 21 shows an example of request and request issuer list management.

図21に示すリストでは、リクエスト一つに対して複数のリクエスト発行元の情報を管理する事が可能となっている。
リクエスト発行元の情報には、少なくともリクエスト発行元のネットワークIDなどの対応するレスポンスを各リクエスト発行元に通信にて転送する事が可能な情報が含まれている。
この例では、「GET http://xxx/api/monitor_interval/ 」リクエストに対してリクエスト発行元は「192.168.0.1」、「192.168.0.2」、「192.168.0.3」の合計3個が登録されている。
また、「GET http://xxx/html/Monitor.html」リクエストに対してリクエスト発行元は「192.168.0.5」、「192.168.0.2」、「192.168.0.6」、「192.168.0.8」の合計4個が登録されている。
In the list shown in FIG. 21, it is possible to manage information of a plurality of request issuers for one request.
The request issuer information includes information that enables at least a corresponding response such as the request issuer network ID to be transferred to each request issuer by communication.
In this example, for the “GET http: // xxx / api / monitor_interval /” request, the request issue sources are “192.168.0.1”, “192.168.0.2”, “192.168 .. A total of three "0.3" are registered.
In addition, for the “GET http: //xxx/html/Monitor.html” request, the request issue sources are “192.168.0.5”, “192.168.0.2”, “192.168.8.0”. .6 ”and“ 192.168.0.8 ”are registered in total.

図18に戻り、代表クライアント処理部210は、処理1501によって、転送されたリクエストに対応するレスポンスを取得出来るのを待機している他のクライアントが存在するかを確認する。
例えば確認はリクエストとリクエスト発行元のリストで現在処理中のリストが存在する場合には、他のクライアントが存在すると確認可能である。
他のクライアントが存在しない場合には処理701に遷移し、存在する場合には処理1502に遷移する。
Returning to FIG. 18, the representative client processing unit 210 confirms whether there is another client waiting to acquire a response corresponding to the transferred request by the processing 1501.
For example, if there is a list currently being processed in the request and the request issuer list, it can be confirmed that there is another client.
If there is no other client, the process proceeds to process 701, and if it exists, the process proceeds to process 1502.

処理701にてリクエストが安全でない場合には処理703ではなく処理1507に遷移する処理が異なっている。
同様に、処理702で保存されていない場合の遷移先が処理703ではなく処理1507に変更されている。
なお、処理701で行っているリクエストが安全でない場合の処理については、リクエストの発行元となるクライアントがリクエストを処理する際に判定し、安全でない場合には、本処理を実施せず、リクエスト発行元のクライアントが直接サーバにリクエストを発行するとしても構わない。
その様な挙動にする事によって、リクエストの転送分の通信処理を削減可能である。
When the request is not secure in the process 701, the process for transitioning to the process 1507 instead of the process 703 is different.
Similarly, the transition destination when not stored in the process 702 is changed to the process 1507 instead of the process 703.
In addition, about the process when the request made in process 701 is not safe, it is determined when the request source client processes the request. If it is not safe, this process is not performed and the request is issued. The original client may issue a request directly to the server.
By adopting such behavior, it is possible to reduce the communication processing for the request transfer.

処理1507では、代表クライアント処理部210は、現在処理中のリクエストに対応するエントリーがリクエストとリクエスト発行元のリスト(図21)に存在していないため、そのエントリーを作成し、そのエントリーのリクエスト発行元として現在処理中のリクエスト発行元を登録する。
登録完了後、処理703に遷移する。
In processing 1507, the representative client processing unit 210 creates the entry and issues a request for the entry because the entry corresponding to the request currently being processed does not exist in the request and request issuer list (FIG. 21). Register the request issuer currently being processed as a source.
After registration is completed, the process proceeds to process 703.

また、処理705および処理707の遷移先が処理708から処理1508に変更となっている。
処理1508では、代表クライアント処理部210は、処理中のリクエストに対応するレスポンスの転送先となる未処理のリクエスト発行元クライアントがリクエスト発行元のリスト(図21)に存在するかを判定する。
存在しない場合には処理を完了し、存在する場合には処理1509に遷移し、代表クライアント処理部210は、その未処理リクエスト発行元を取得して、処理708に遷移する。
その後の処理として処理709および処理710の遷移先が終了ではなく、処理1508となり、全ての未処理のリクエスト発行元に対してレスポンスを返信するまで処理を繰り返す。
Further, the transition destination of processing 705 and processing 707 is changed from processing 708 to processing 1508.
In processing 1508, the representative client processing unit 210 determines whether or not an unprocessed request issuer client serving as a transfer destination of a response corresponding to the request being processed exists in the request issuer list (FIG. 21).
If it does not exist, the process is completed. If it exists, the process proceeds to process 1509, and the representative client processing unit 210 acquires the unprocessed request issue source, and transitions to process 708.
As the subsequent processing, the transition destination of processing 709 and processing 710 is not completed, but processing 1508 is performed, and the processing is repeated until responses are returned to all unprocessed request issuers.

処理1502では、現在処理中のリクエストに対するリクエスト発行元が存在している状態であり、代表クライアント処理部210は、リクエストとリクエスト発行元のリスト(図21)のそのリクエストに対応するエントリーのリクエスト発行元に現在処理中のリクエスト発行元を追加登録する。   In processing 1502, there is a request issuer for the request currently being processed, and the representative client processing unit 210 issues a request for an entry corresponding to the request in the request and request issuer list (FIG. 21). Register the request issuer that is currently being processed.

処理1503では、代表クライアント処理部210は、同一リクエストに対するリクエスト発行元の個数が閾値となるN個以上あるかを判定する。
その判定の結果、N個未満である場合には処理を終了する。
一方で、N個以上存在する場合には処理1504に遷移する。
なお、閾値Nは固定値として与えてもよいし、ネットワークやクライアントの処理負荷状況などを考慮して動的に変更される値として与えてもよいが、(N−1)は単一の代表クライアントがある単一のリクエストに対するレスポンスをそのリクエスト発行元となるクライアントに転送する処理の繰返し最大回数を意味する。
In processing 1503, the representative client processing unit 210 determines whether there are N or more request issuers for the same request, which is a threshold value.
As a result of the determination, if it is less than N, the process is terminated.
On the other hand, if there are N or more, the process proceeds to processing 1504.
Note that the threshold value N may be given as a fixed value, or may be given as a value that is dynamically changed in consideration of the processing load status of the network or the client, but (N−1) is a single representative. It means the maximum number of repetitions of processing for transferring a response to a single request to the client that issued the request.

処理1504では、代表クライアント処理部210は、現在処理中のリクエストに対する全てのリクエスト発行元の中から代表クライアントクローンを決定する。
この時に代表クライアントクローンを唯一に決めてもよいし、複数個決めても構わない。
ただし、複数個に決めた場合、処理1505および処理1506はその個数分だけ繰り返される事になる。
In processing 1504, the representative client processing unit 210 determines a representative client clone from all request issue sources for the request currently being processed.
At this time, the representative client clone may be determined uniquely or a plurality of client clones may be determined.
However, when the number is determined to be plural, the processing 1505 and the processing 1506 are repeated by that number.

処理1505では、代表クライアント処理部210は、処理1504で決定した各代表クライアントクローンがレスポンスの転送を担当するリクエスト発行元クライアントを決定する。   In processing 1505, the representative client processing unit 210 determines a request issuing client that each representative client clone determined in processing 1504 is responsible for transferring a response.

処理1506では、他クライアント通信部209が、処理1505で決定した担当するリクエスト発行元クライアントに関する情報とリクエスト情報を持たせた代表クライアントクローン要求を代表クライアントクローンに対して送付し、処理を完了する。   In processing 1506, the other client communication unit 209 sends a representative client clone request having information and request information related to the request issuing client in charge determined in processing 1505 to the representative client clone, and the processing is completed.

次に、図29及び図30を用いて代表クライアントクローン要求を受信した際の代表クライアント処理部210の処理フローを説明する。   Next, a processing flow of the representative client processing unit 210 when a representative client clone request is received will be described with reference to FIGS. 29 and 30.

処理2401では、代表クライアント処理部210は、代表クライアントクローン要求から代表クライアントクローンになる事を要求されている対応するリクエストの情報を取得する。   In processing 2401, the representative client processing unit 210 acquires information of a corresponding request that is requested to become a representative client clone from the representative client clone request.

処理2402では、代表クライアント処理部210は、処理2401で取得したリクエストに対応するエントリーがリクエストとリクエスト発行元のリスト(図21)に存在するかを判定する。
エントリーが存在した場合には処理2404、存在しない場合には処理2403に遷移する。
In process 2402, the representative client processing unit 210 determines whether an entry corresponding to the request acquired in process 2401 exists in the request and request issuer list (FIG. 21).
If there is an entry, the process proceeds to process 2404; otherwise, the process proceeds to process 2403.

処理2403では、代表クライアント処理部210は、リクエストとリクエスト発行元のリスト(図21)に現在処理中のリクエストに対応するエントリーを新規作成し、処理2404に遷移する。   In processing 2403, the representative client processing unit 210 newly creates an entry corresponding to the request currently being processed in the request and request issuer list (FIG. 21), and transitions to processing 2404.

処理2404では、代表クライアント処理部210は、リクエストとリクエスト発行元のリスト(図21)の現在処理中のリクエストに対応するエントリーに代表クライアントクローン要求に記載されている担当するリクエスト発行元クライアントに関する情報に記載の全てのリクエスト発行元を追加する。   In processing 2404, the representative client processing unit 210 performs information on the request issuer client in charge described in the representative client clone request in the entry corresponding to the request currently being processed in the request and request issuer list (FIG. 21). Add all request issuers described in.

処理2405では、代表クライアント処理部210は、同一リクエストに対するリクエスト発行元の個数が閾値となるN個以上あるかを判定する。
その判定の結果、N個未満である場合には処理2409に遷移する。
一方で、N個以上存在する場合には処理2406に遷移する。
なお、閾値Nは固定値として与えてもよいし、ネットワークやクライアントの処理負荷状況などを考慮して動的に変更される値として与えてもよいが、(N−1)は単一の代表クライアントクローンがある単一のリクエストに対するレスポンスをそのリクエスト発行元となるクライアントに転送する処理の繰返し最大回数を意味する。
In processing 2405, the representative client processing unit 210 determines whether there are N or more request issuers for the same request, which is a threshold value.
As a result of the determination, if the number is less than N, the process proceeds to processing 2409.
On the other hand, if there are N or more, the process proceeds to process 2406.
Note that the threshold value N may be given as a fixed value, or may be given as a value that is dynamically changed in consideration of the processing load status of the network or the client, but (N−1) is a single representative. This means the maximum number of repetitions of processing for transferring a response to a single request with a client clone to the client that issued the request.

処理2406では、代表クライアント処理部210は、現在処理中のリクエストに対する全てのリクエスト発行元の中から代表クライアントクローンを決定する。
この時に代表クライアントクローンを唯一に決めてもよいし、複数個決めても構わない。
ただし、複数個に決めた場合、処理2407および処理2408はその個数分だけ繰り返される事になる。
In processing 2406, the representative client processing unit 210 determines a representative client clone from all request issue sources for the request currently being processed.
At this time, the representative client clone may be determined uniquely or a plurality of client clones may be determined.
However, when the number is determined to be plural, the processing 2407 and the processing 2408 are repeated by that number.

処理2407では、代表クライアント処理部210は、処理2406で決定した各代表クライアントクローンがレスポンスの返信を担当するリクエスト発行元クライアントを決定する。   In processing 2407, the representative client processing unit 210 determines a request issuing client that each representative client clone determined in processing 2406 is responsible for responding to a response.

処理2408では、他クライアント通信部209は、処理2407で決定した担当するリクエスト発行元に関する情報とリクエスト情報を持たせた代表クライアントクローン要求を代表クライアントクローンに対して送付し、処理2409に遷移する。   In process 2408, the other client communication unit 209 sends the representative client clone request having the request issuer information and request information determined in process 2407 to the representative client clone, and transitions to process 2409.

処理2409では、代表クライアントもしくは他の代表クライアントクローンから処理中のリクエストに対応するレスポンスが送信されるまで待機する。
処理中のリクエストに対応するレスポンスが送信されてきた場合には処理1508に遷移する。
それ以降の処理は図18、図19、図20を用いて説明した処理と同一であるため、説明は省略する。
In process 2409, the process waits until a response corresponding to the request being processed is transmitted from the representative client or another representative client clone.
When a response corresponding to the request being processed is transmitted, the process proceeds to process 1508.
Subsequent processing is the same as the processing described with reference to FIGS.

***効果の説明***
以上の処理を行う事で、単一リクエストに対して多数のリクエスト発行元が待機状態となった場合に、レスポンスのリクエスト発行元への転送処理を代表クライアントクローンに分散して処理する事が可能となり、単一の代表クライアントの処理負荷が高くなることなく、全てのリクエスト発行元に対して転送し終わるまでの処理時間を短縮する事が可能となる。
*** Explanation of effects ***
By performing the above processing, when a large number of request issuers are waiting for a single request, it is possible to distribute the response transfer processing to the request issuer in a representative client clone. Thus, it is possible to reduce the processing time until transfer to all request issuers without increasing the processing load of a single representative client.

図22〜図28を用いて本実施の形態の具体的な効果を説明する。
図22〜図28に示すように、クライアント1〜クライアント7から同一のリクエストが発生した場合を想定する。
この時、代表クライアントクローンを設定しない場合、代表クライアント0が全てのリクエスト発行元クライアントに対して順次レスポンスを返信するため、返信処理は7回実施される。
また、返信処理時間が一定と仮定し、その時間をTとして表現すると、最後に返信されるクライアントレスポンスは7Tだけの遅延が発生する事になる。
一方で、閾値N=3として代表クライアントクローンを設定した場合は、代表クライアントおよび各代表クライアントクローンのレスポンスの返信処理回数は高々2回である。
つまり、代表クライアント0は、代表クライアントクローン1と代表クライアントクローン2にのみレスポンスを返信すればよい。
代表クライアントクローン1は、代表クライアントクローン3とクライアント5にのみレスポンスを返信すればよい。
代表クライアントクローン2は、クライアント4とクライアント6にのみレスポンスを返信すればよい。
代表クライアントクローン3は、クライアント7にのみレスポンスを返信すればよい。
このように、代表クライアントクローンを設定しない場合と比べると代表クライアントの負荷の偏りがない事が分かる。
また、図28において返信処理を左側の矢印を右側の矢印よりも先に処理するとした場合、最後に返信されるクライアントはクライアント6である。
クライアント0→クライアント1、クライアント0→クライアント2、クライアント2→クライアント4、クライアント2→クライアント6という順序でレスポンスが返信される。
このため、クライアント6での遅延時間は4Tとなり、代表クライアントクローンを設定しない場合と比べると3Tだけ短縮される事が分かる。
Specific effects of the present embodiment will be described with reference to FIGS.
As shown in FIGS. 22 to 28, it is assumed that the same request is generated from the client 1 to the client 7.
At this time, when the representative client clone is not set, the representative client 0 sequentially returns responses to all the request issuing clients, and thus the reply process is performed seven times.
If the reply processing time is assumed to be constant and the time is expressed as T, the client response that is returned last is delayed by 7T.
On the other hand, when the representative client clone is set with the threshold value N = 3, the number of response return processes for the representative client and each representative client clone is at most two.
That is, the representative client 0 only needs to send a response back to the representative client clone 1 and the representative client clone 2.
The representative client clone 1 may return a response only to the representative client clone 3 and the client 5.
The representative client clone 2 needs to send a response only to the client 4 and the client 6.
The representative client clone 3 only needs to send a response back to the client 7.
Thus, it can be seen that there is no bias in the load of the representative client compared to the case where no representative client clone is set.
Further, in FIG. 28, when the reply process is performed with the left arrow before the right arrow, the client 6 that is replied last is the client 6.
Responses are returned in the order of client 0 → client 1, client 0 → client 2, client 2 → client 4, client 2 → client 6.
For this reason, the delay time in the client 6 is 4T, and it can be seen that the delay time is shortened by 3T compared to the case where no representative client clone is set.

実施の形態5.
一般的にクライアント装置からサーバ装置105に発行するリクエストにはパラメータを付加する事がある。
例えばURIであれば「?」記号の後にパラメータの名前と値の間に「=」記号を挟む形でパラメータを付加する事がある。
例えば、図6に記載のリクエスト例の一つである「POST http://xxx/api/monitor_interval/?val=5」における「val=5」がパラメータであり、名前が「val」のパラメータの値として「5」を指定している。
また、複数のパラメータを付加する場合には、各パラメータ間を「&」記号で区切って連結する事がある。
例えば、「http://xxx/api/monitor_interval/?val=5&target=temperature」の場合には名前が「val」のパラメータの値として「5」を、名前が「target」のパラメータの値として「temperature」を指定している。
これらパラメータを記述する「?」記号の後の文字列をクエリー部と呼ぶ事にする。
クエリー部には、サーバ装置105での検索の対象となる検索条件式が定義される。
Embodiment 5 FIG.
Generally, a parameter may be added to a request issued from the client device to the server device 105.
For example, in the case of a URI, a parameter may be added in such a way that a “=” symbol is inserted between the name and value of the parameter after the “?” Symbol.
For example, “val = 5” in “POST http: // xxx / api / monitor_interval /? Val = 5” which is one of the request examples shown in FIG. 6 is a parameter, and the parameter whose name is “val” “5” is designated as the value.
In addition, when a plurality of parameters are added, each parameter may be separated by an “&” symbol and connected.
For example, in the case of “http: // xxx / api / monitor_interval /? Val = 5 & target = temperature”, “5” is set as the value of the parameter whose name is “val”, and “5” is set as the value of the parameter whose name is “target”. “temperature” is specified.
The character string after the “?” Symbol describing these parameters is called a query part.
In the query part, a search condition expression to be searched by the server device 105 is defined.

ここまでに例示したパラメータでは具体的な値を指定しているが、パラメータ自体の解釈として値の集合や範囲を指定する事も可能である。
例えば、「http://xxx/api/user?height=160|170|180」は、パラメータ「height」の値が「160」もしくは「170」もしくは「180」を指定すると解釈させる事も可能である。
また、例えば「http://xxx/api/user?height_gt=160」はパラメータ「height_gt」の値が「160」と言う意味になるが、パラメータ「height_gt」はパラメータ「height」の値が「height_gt」の値より大きい(gt=Greater Than)事を示すパラメータと解釈させる事で、最終的にパラメータ「height」の値が「160」より大きい値と言う範囲を指定する事も可能となる。
URIのクエリー部は前述の例の様な表現に限定されるものではなく、同じ内容を別の書式にて表現しても構わない。
また、説明を単純化するため、本実施の形態ではURIのクエリー部のみを例として説明するが、URIのクエリー部でパラメータを表現しなくとも、HTTPのPOSTメソッドのリクエストボディ部に同様にパラメータを指定する方法でも構わない。
Although specific values are specified in the parameters exemplified so far, a set or range of values can also be specified as an interpretation of the parameters themselves.
For example, “http: // xxx / api / user? Height = 160 | 170 | 180” can be interpreted as the value of the parameter “height” specifying “160”, “170”, or “180”. is there.
Also, for example, “http: // xxx / api / user? Height_gt = 160” means that the value of the parameter “height_gt” is “160”, but the parameter “height_gt” has the value of the parameter “height” is “height_gt” It is also possible to specify a range in which the value of the parameter “height” is finally greater than “160” by interpreting it as a parameter indicating that the value is greater than “” (gt = Greater Than).
The query part of the URI is not limited to the expression as in the above example, and the same contents may be expressed in different formats.
Further, in order to simplify the explanation, in the present embodiment, only the URI query part will be described as an example, but the parameters are similarly expressed in the request body part of the HTTP POST method without expressing the parameters in the URI query part. You can specify the method.

上記の説明の通り、リクエストにパラメータが与えられる事を想定した場合、リクエストからURIのクエリー部を除外した内容は同一だが、クエリー部のみが異なるリクエストが発生する事が考えられる。
例えば、
http://xxx/api/user?height_gt=160
http://xxx/api/user?height_gt=170
の2つのURIを例に挙げて考えると、それぞれ別のリクエストとして処理する事になるが、実際には、
http://xxx/api/user?height_gt=160
に関するリクエストのみをサーバに発行し、得られたレスポンスから
http://xxx/api/user?height_gt=170
に適合するレスポンスのみを代表クライアントで抽出可能な場合がある。
具体的にはレスポンスのデータ群それぞれがプロパティ「height」の値を持っている場合などが挙げられるが、それはシステム開発時にレスポンスのデータ構造を決定する時点で明らかとなる。
その場合には、上記2種類のリクエストに対して、サーバ装置105には1種類のリクエストを発行するのみで、2種類のリクエストに対するレスポンスを得る事が可能となる。
As described above, when it is assumed that a parameter is given to a request, it is conceivable that a request except for the query part of the URI from the request is the same, but only the query part is different.
For example,
http: // xxx / api / user? height_gt = 160
http: // xxx / api / user? height_gt = 170
Considering these two URIs as an example, each request will be processed as a separate request.
http: // xxx / api / user? height_gt = 160
Only a request related to the server is issued to the server, and from the obtained response, http: // xxx / api / user? height_gt = 170
In some cases, the representative client can extract only responses that conform to.
Specifically, there is a case where each response data group has a value of the property “height”, and this becomes clear when the response data structure is determined during system development.
In that case, it is possible to obtain responses to the two types of requests by simply issuing one type of request to the server device 105 for the two types of requests.

以上を考慮して更なるサーバ負荷軽減を実現するための実施の形態を説明する。   An embodiment for realizing further server load reduction in consideration of the above will be described.

***構成の説明***
本実施の形態に係るサーバ装置105の構成例は、図2に示す通りであり、また、本実施の形態に係る各クライアント装置の構成例は、図3に示す通りである。
本実施の形態では、主に実施の形態1との差異を説明する。
本実施の形態で説明していない事項は、実施の形態1と同様である。
*** Explanation of configuration ***
A configuration example of the server apparatus 105 according to the present embodiment is as shown in FIG. 2, and a configuration example of each client apparatus according to the present embodiment is as shown in FIG.
In the present embodiment, differences from the first embodiment will be mainly described.
Matters not described in the present embodiment are the same as those in the first embodiment.

本実施の形態では、取得リクエストについての代表クライアントロールが自装置に割り当てられており、取得リクエストに対応するレスポンスが受信データ管理部211にキャッシュされておらず、取得リクエストに検索条件式が含まれ、当該検索条件式で得られる検索結果よりも広範な検索結果が得られる広範検索条件式に当該検索条件式を変換可能である場合に、代表クライアント処理部210は、検索条件式を広範検索条件式に変換する。
例えば、取得リクエストが前述の「http://xxx/api/user?height_gt=170」である場合に、クエリー部に含まれる検索条件式「height_gt=170」は、より広範な検索結果が得られる「height_gt=160」という検索条件式に変換可能である。
このため、代表クライアント処理部210は、クエリー部の「height_gt=170」という検索条件式を「height_gt=160」という広範検索条件式に変換する。
サーバ通信部212は、代表クライアント処理部210により変換された広範検索条件式が含まれるリクエストをサーバ装置105に送信する。
前述の例では、サーバ通信部212は、「http://xxx/api/user?height_gt=160」をサーバ装置105に送信する。
In this embodiment, the representative client role for the acquisition request is assigned to the own device, the response corresponding to the acquisition request is not cached in the received data management unit 211, and the search request includes a search condition expression. When the search condition formula can be converted into a broad search condition formula that provides a wider range of search results than the search result obtained with the search condition formula, the representative client processing unit 210 converts the search condition formula into the broad search condition formula. Convert to an expression.
For example, when the acquisition request is “http: // xxx / api / user? Height_gt = 170” described above, the search condition expression “height_gt = 170” included in the query part can obtain a wider range of search results. It can be converted into a search condition expression “height_gt = 160”.
Therefore, the representative client processing unit 210 converts the search condition expression “height_gt = 170” in the query part into a broad search condition expression “height_gt = 160”.
The server communication unit 212 transmits a request including the broad search conditional expression converted by the representative client processing unit 210 to the server device 105.
In the above example, the server communication unit 212 transmits “http: // xxx / api / user? Height_gt = 160” to the server device 105.

***動作の説明***
図31を用いて、本実施の形態におけるリクエスト生成元のクライアント装置の代表クライアント判定部208の処理フローを説明する。
図31は、図8で示した代表クライアント判定部208の処理フローを拡張した処理フローであり、図8に対して処理2501〜2503の処理が追加されている。
追加処理に関連する部分のみを説明する。
*** Explanation of operation ***
The processing flow of the representative client determination unit 208 of the client device that is the request generation source in this embodiment will be described with reference to FIG.
FIG. 31 is a processing flow obtained by extending the processing flow of the representative client determination unit 208 shown in FIG. 8, and processes 2501 to 2503 are added to FIG. 8.
Only the part related to the additional processing will be described.

処理2501では、代表クライアント判定部208は、転送されたリクエストにクエリー部があるかを判定する。
判定にはURIに「?」が存在するかどうかを条件として利用可能である。
クエリー部がある場合には処理2502へ遷移し、クエリー部がない場合は、これまでの実施の形態と同様の処理可能であるため処理501に遷移する。
In processing 2501, the representative client determination unit 208 determines whether there is a query part in the transferred request.
The determination can be made on the condition that “?” Exists in the URI.
If there is a query part, the process proceeds to process 2502, and if there is no query part, the process can proceed to process 501 because the same processing as in the previous embodiments is possible.

処理2502では、代表クライアント判定部208は、処理中のリクエストのクエリー部をクエリー部の内容のみ異なる同一のリクエストと論理和構成したリクエストでレスポンスを取得した際に、各クエリー部に対応するレスポンスに分離可能か判定する。
この判定には前述の通り、例えばシステム開発時にクエリーを含まないリクエストに対して論理和構成可能かが決定するため、その可否情報をテーブルとしてデータ化し、そのテーブルに基づいて判定する方法が考えられる。
論理和構成可能である場合には処理2503に遷移し、論理和構成不可能である場合には処理501に遷移する。
In processing 2502, when the representative client determination unit 208 obtains a response with a request in which the query part of the request being processed differs from the same request that differs only in the contents of the query part, the representative client determination part 208 converts the response to the corresponding query part. Determine whether separation is possible.
As described above, for this determination, for example, it is determined whether or not a logical sum can be configured for a request that does not include a query at the time of system development. .
If the logical sum configuration is possible, the process proceeds to a process 2503. If the logical sum configuration is not possible, the process proceeds to the process 501.

処理2503では、クエリー部を論理和構成可能なリクエストに対するリクエストのID算出処理を行う。
ID算出のキーとして少なくともリクエストからクエリー部の情報を除去した結果をキーとして算出する。
ID算出完了後、処理502に遷移する。
それ以降の処理は前述の通りであり説明は省略する。
In process 2503, a request ID calculation process is performed for a request that can be ORed with the query part.
As a key for calculating the ID, a result obtained by removing at least the query part information from the request is calculated as a key.
After completing the ID calculation, the process proceeds to processing 502.
Subsequent processing is as described above, and a description thereof is omitted.

次に、処理505でリクエストを他クライアント装置に転送した際の、リクエストの転送先となるクライアント装置の処理を図32を用いて説明する。
図32はリクエストの転送先となるクライアントの代表クライアント判定部208の処理フローである。
Next, processing of the client device that is the transfer destination of the request when the request is transferred to another client device in processing 505 will be described with reference to FIG.
FIG. 32 is a processing flow of the representative client determination unit 208 of the client that is the transfer destination of the request.

図32は、図9で示した代表クライアント判定部208の処理フローを拡張した処理フローであり、図9に対して処理2601〜2603の処理が追加されている。
追加処理に関連する部分のみを説明する。
FIG. 32 is a processing flow obtained by extending the processing flow of the representative client determination unit 208 shown in FIG. 9, and processing 2601 to 2603 is added to FIG.
Only the part related to the additional processing will be described.

処理2601では、代表クライアント判定部208は、転送されたリクエストにクエリー部があるかを判定する。
判定にはURIに「?」が存在するかどうかを条件として利用可能である。
クエリー部がある場合には処理2602へ遷移し、クエリー部がない場合は、これまでの実施の形態と同様の処理が可能であるため処理601に遷移する。
In process 2601, the representative client determination unit 208 determines whether there is a query part in the transferred request.
The determination can be made on the condition that “?” Exists in the URI.
If there is a query part, the process proceeds to process 2602, and if there is no query part, the process can proceed to process 601 because the same process as in the previous embodiments is possible.

処理2602では、代表クライアント判定部208は、処理中のリクエストのクエリー部をクエリー部の内容のみ異なる同一のリクエストと論理和構成したリクエストでレスポンスを取得した際に、各クエリー部に対応するレスポンスに分離可能か判定する。
この判定には前述の通り、例えばシステム開発時にクエリーを含まないリクエストに対して論理和構成可能かが決定するため、その可否情報をテーブルとしてデータ化し、そのテーブルに基づいて判定する方法が考えられる。
論理和構成可能である場合には処理2603に遷移し、論理和構成不可能である場合には処理601に遷移する。
In process 2602, when the representative client determination unit 208 obtains a response by using a logical OR-structured request for the query part of the request being processed and the same request that differs only in the contents of the query part, Determine whether separation is possible.
As described above, for this determination, for example, it is determined whether or not a logical sum can be configured for a request that does not include a query at the time of system development. .
If the logical sum configuration is possible, the process proceeds to process 2603, and if the logical sum configuration is not possible, the process proceeds to process 601.

処理2603では、クエリー部を論理和構成可能なリクエストに対するリクエストのID算出処理を行う。
ID算出のキーとして少なくともリクエストからクエリー部の情報を除去した結果をキーとして算出する。
ID算出完了後、処理602に遷移する。
それ以降の処理は前述の通りであり説明は省略する。
In a process 2603, a request ID calculation process is performed for a request that can be ORed with the query part.
As a key for calculating the ID, a result obtained by removing at least the query part information from the request is calculated as a key.
After completing the ID calculation, the process proceeds to process 602.
Subsequent processing is as described above, and a description thereof is omitted.

次に、図33及び図34は、図10で示した代表クライアント処理部210の処理を拡張した処理フロー図であり、図10に対して処理2701、2702、2703、2704が追加されている。
追加処理に関連する部分のみを説明する。
Next, FIG. 33 and FIG. 34 are processing flow diagrams in which the processing of the representative client processing unit 210 shown in FIG. 10 is extended, and processing 2701, 2702, 2703, 2704 are added to FIG.
Only the part related to the additional processing will be described.

処理2701は、処理702で対応するレスポンスが受信データ管理部211に保存されていない場合、もしくは処理706で対応レスポンスの有効期限が切れている場合に到達する処理である。
本処理では、代表クライアント処理部210は、現在処理中のリクエストからクエリー部を比較対象外として対応するレスポンスが受信データ管理部211に保存されているか判定する。
保存されていない場合には、現在処理中のリクエストをそのままサーバ装置に発行する必要があるため処理703に遷移する。
保存されている場合には、処理2702に遷移する。
A process 2701 is a process that is reached when the corresponding response is not stored in the received data management unit 211 in the process 702 or when the corresponding response has expired in the process 706.
In this processing, the representative client processing unit 210 determines whether a response corresponding to the currently processed request is stored in the received data management unit 211 with the query unit excluded from comparison.
If the request is not stored, the current processing request needs to be issued to the server device as it is, and the processing transitions to processing 703.
If stored, the process proceeds to process 2702.

処理2702では、代表クライアント処理部210は、現在処理中のリクエストのクエリー部と処理2701でヒットしたレスポンスに対応するリクエストのクエリー部とでクエリーの論理和を生成し、その生成結果を新たなクエリー部とする論理和リクエストを生成し、それを処理703でサーバ装置105に発行するリクエストとする。
論理和リクエストの生成完了後、処理2705に遷移する。
In processing 2702, the representative client processing unit 210 generates a logical sum of queries between the query part of the request currently being processed and the request query part corresponding to the response hit in the process 2701, and the generated result is used as a new query. A logical sum request is generated as a request and is issued to the server device 105 in processing 703.
After the completion of the generation of the logical sum request, the process proceeds to process 2705.

処理2703は、処理705又は処理707から遷移する処理となる。
本処理では、代表クライアント処理部210は、サーバ装置105から受け取ったレスポンスに対応するリクエストが処理2702で生成した論理和リクエストに基づくものかを判定する。
論理和リクエストに基づかない場合には処理708に遷移し、基づく場合には処理2704に遷移する。
The process 2703 is a process that transitions from the process 705 or the process 707.
In this processing, the representative client processing unit 210 determines whether the request corresponding to the response received from the server device 105 is based on the logical sum request generated in processing 2702.
If it is not based on the logical sum request, the process proceeds to process 708. If it is based, the process proceeds to process 2704.

処理2704では、論理和リクエストに基づくレスポンスをサーバ装置105から受け取った状態であるため、現在処理中のリクエストのクエリー部に対応するデータのみで構成されるレスポンスを生成する必要があり、その生成処理を行う。
生成処理結果を処理中のリクエストに対応するレスポンスとして処理708に遷移する。
In the process 2704, since the response based on the logical sum request is received from the server apparatus 105, it is necessary to generate a response composed only of data corresponding to the query part of the request currently being processed. I do.
The generation processing result is transitioned to processing 708 as a response corresponding to the request being processed.

処理2705は、処理2702から遷移する処理である。
本処理では、処理2702で生成したリクエストに対応するレスポンスが受信データ管理部211に保存済みかどうかを判断する。
レスポンスが受信データ管理部211に保存済みである場合には処理706に遷移し、保存済みでない場合には処理703に遷移する。
A process 2705 is a process transitioning from the process 2702.
In this process, it is determined whether or not the response corresponding to the request generated in process 2702 has been saved in the received data management unit 211.
If the response has been stored in the received data management unit 211, the process proceeds to process 706, and if not stored, the process proceeds to process 703.

なお、本実施の形態では、処理707の後は処理708ではなく処理2703に遷移する。   In this embodiment, after the process 707, the process shifts to the process 2703 instead of the process 708.

図35に、論理和リクエストと対応するレスポンスとを保存したテーブルの一例を示す。
図35ではURIが「http://xxx/data.dat」に対してクエリー部に「min=3」という検索条件式が存在するリクエストと「min=4」という検索条件式が存在するリクエストという2つのリクエストを想定している。
ここで、プロパティ「min」は、レスポンスで得られるプロパティ「val」の値がプロパティ「min」の値を下限とする事を意味する。
この意味に従うと2つのリクエストのクエリー部の論理和は「min=3」となり、その論理和リクエストによって得られたレスポンスをレスポンスエントリーに保存している。
処理2704で各リクエストに対応するデータのみで構成されるレスポンスを生成すると、クエリー部が「min=3」のリクエストに対しては論理和リクエストと一致するため、レスポンスエントリーの内容がそのままレスポンスとなる。
一方で、クエリー部が「min=4」のリクエストに対しては論理和リクエストと一致せず、各データのプロパティ「val」の値が下限となる4以上となるもののみを抽出する処理を処理2704で行う事となる。
その結果、得られるレスポンスは図36の通りとなる。
FIG. 35 shows an example of a table storing logical sum requests and corresponding responses.
In FIG. 35, a request having a search condition expression “min = 3” and a request having a search condition expression “min = 4” in the query part for a URI “http: //xxx/data.dat”. Two requests are assumed.
Here, the property “min” means that the value of the property “val” obtained by the response has the value of the property “min” as a lower limit.
According to this meaning, the logical sum of the query parts of the two requests is “min = 3”, and the response obtained by the logical sum request is stored in the response entry.
When a response composed only of data corresponding to each request is generated in the process 2704, the request part matches with the logical sum request for the request with “min = 3”, so the content of the response entry becomes the response as it is. .
On the other hand, for the request with “min = 4” in the query part, processing is performed to extract only those whose value of the property “val” of each data is not less than 4 that is the lower limit and does not match the logical sum request. 2704 will be performed.
As a result, the obtained response is as shown in FIG.

***効果の説明***
以上の処理を行う事によって、リクエストにおけるクエリー部のみが異なる複数のリクエストに関して、クエリー部を論理和構成可能な場合には、それら複数のリクエストを一つの論理和リクエストとしてまとめ、それぞれのリクエストをサーバに発行するのではなく、論理和リクエストのみをサーバに発行するだけで済ませる事が可能となり、サーバ負荷の軽減が達成される。
*** Explanation of effects ***
By performing the above processing, if the query part can be logically ORed for multiple requests that differ only in the query part, these multiple requests are combined into a single OR request, and each request is In this case, only the logical sum request can be issued to the server, and the server load can be reduced.

以上、本発明の実施の形態について説明したが、これらの実施の形態のうち、2つ以上を組み合わせて実施しても構わない。
あるいは、これらの実施の形態のうち、1つを部分的に実施しても構わない。
あるいは、これらの実施の形態のうち、2つ以上を部分的に組み合わせて実施しても構わない。
なお、本発明は、これらの実施の形態に限定されるものではなく、必要に応じて種々の変更が可能である。
As mentioned above, although embodiment of this invention was described, you may implement in combination of 2 or more among these embodiment.
Alternatively, one of these embodiments may be partially implemented.
Alternatively, two or more of these embodiments may be partially combined.
In addition, this invention is not limited to these embodiment, A various change is possible as needed.

101 クライアント装置、102 クライアント装置、103 クライアント装置、104 クライアント装置、105 サーバ装置、110 CPU、111 メモリ、112 入力インタフェース、113 出力インタフェース、114 通信インタフェース、115 永続記憶インタフェース、116 ディスク、120 CPU、121 メモリ、122 入力インタフェース、123 出力インタフェース、124 通信インタフェース、125 永続記憶インタフェース、126 ディスク、206 アプリケーションロジック部、207 リクエスト生成部、208 代表クライアント判定部、209 他クライアント通信部、210 代表クライアント処理部、211 受信データ管理部、212 サーバ通信部、213 通信部、214 要求処理部。
101 Client Device, 102 Client Device, 103 Client Device, 104 Client Device, 105 Server Device, 110 CPU, 111 Memory, 112 Input Interface, 113 Output Interface, 114 Communication Interface, 115 Persistent Storage Interface, 116 Disk, 120 CPU, 121 Memory, 122 input interface, 123 output interface, 124 communication interface, 125 persistent storage interface, 126 disk, 206 application logic unit, 207 request generation unit, 208 representative client determination unit, 209 other client communication unit, 210 representative client processing unit, 211 reception data management unit, 212 server communication unit, 213 communication unit, 214 request processing unit

Claims (17)

複数のクライアント装置が含まれる通信システムに含まれるクライアント装置であって、
いずれかのクライアント装置により生成されたサーバ装置へのリクエストを取得した場合に、取得した取得リクエストについて、代表してリクエストを処理する役割である代表クライアントロールが自装置に割り当てられているか否かを判定する代表クライアント判定部と、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられている場合に、前記取得リクエストに対応する前記サーバ装置からのレスポンスが、自装置がアクセスできるキャッシュ領域にキャッシュされているか否かを判定する代表クライアント処理部と、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられており、前記取得リクエストに対応するレスポンスが前記キャッシュ領域にキャッシュされていない場合に、前記取得リクエストを前記サーバ装置に送信するサーバ通信部と、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられていない場合に、前記取得リクエストを他のクライアント装置に送信する他クライアント通信部とを有するクライアント装置。
A client device included in a communication system including a plurality of client devices,
If a request to the server device generated by any client device is acquired, whether or not a representative client role that is a role for processing the request on behalf of the acquired acquisition request is assigned to the own device A representative client determination unit for determining;
When a representative client role for the acquisition request is assigned to the own device, it is determined whether a response from the server device corresponding to the acquisition request is cached in a cache area accessible by the own device. A representative client processing unit;
A server communication unit that transmits the acquisition request to the server device when a representative client role for the acquisition request is assigned to the own device and a response corresponding to the acquisition request is not cached in the cache area; ,
A client apparatus comprising: another client communication unit that transmits the acquisition request to another client apparatus when a representative client role for the acquisition request is not assigned to the own apparatus.
前記他クライアント通信部は、
前記取得リクエストが他のクライアント装置で生成されたリクエストであり、前記取得リクエストについての代表クライアントロールが自装置に割り当てられており、前記キャッシュ領域に前記取得リクエストに対応するレスポンスがキャッシュされている場合に、前記キャッシュ領域にキャッシュされているレスポンスを前記取得リクエストの生成元のクライアント装置に送信する請求項1に記載のクライアント装置。
The other client communication unit
The acquisition request is a request generated by another client device, a representative client role for the acquisition request is assigned to the own device, and a response corresponding to the acquisition request is cached in the cache area The client device according to claim 1, wherein the response cached in the cache area is transmitted to the client device that has generated the acquisition request.
前記クライアント装置は、更に、
前記サーバ装置へのリクエストを生成するリクエスト生成部を有し、
前記代表クライアント処理部は、
前記取得リクエストが前記リクエスト生成部で生成されたリクエストであり、前記取得リクエストについての代表クライアントロールが自装置に割り当てられており、前記キャッシュ領域に前記取得リクエストに対応するレスポンスがキャッシュされている場合に、前記キャッシュ領域にキャッシュされているレスポンスを前記リクエスト生成部に出力する請求項1に記載のクライアント装置。
The client device further includes:
A request generation unit for generating a request to the server device;
The representative client processing unit
When the acquisition request is a request generated by the request generation unit, a representative client role for the acquisition request is assigned to the own device, and a response corresponding to the acquisition request is cached in the cache area The client device according to claim 1, wherein a response cached in the cache area is output to the request generation unit.
前記代表クライアント判定部は、
前記複数のクライアント装置の間で共有している分散ハッシュテーブルを用いて、前記取得リクエストについての代表クライアントロールが自装置に割り当てられているか否かを判定する請求項1に記載のクライアント装置。
The representative client determination unit
The client device according to claim 1, wherein it is determined whether or not a representative client role for the acquisition request is assigned to the own device, using a distributed hash table shared among the plurality of client devices.
前記代表クライアント処理部は、
前記取得リクエストに対応するレスポンスであって有効期限内のレスポンスが前記キャッシュ領域にキャッシュされているか否かを判定する請求項1に記載のクライアント装置。
The representative client processing unit
The client device according to claim 1, wherein it is determined whether a response corresponding to the acquisition request and within a valid period is cached in the cache area.
前記他クライアント通信部は、
前記通信システムに参入する新たなクライアント装置に割り当てられる代表クライアントロールが対象とするリクエストに対応するレスポンスが前記キャッシュ領域にキャッシュされている場合に、前記キャッシュ領域にキャッシュされているレスポンスを、前記新たなクライアント装置に送信する請求項1に記載のクライアント装置。
The other client communication unit
When a response corresponding to a request targeted by a representative client role assigned to a new client device entering the communication system is cached in the cache area, the response cached in the cache area is changed to the new client apparatus. The client device according to claim 1, wherein the client device transmits to a client device.
前記他クライアント通信部は、
前記通信システムから離脱する離脱クライアント装置に割り当てられている代表クライアントロールが対象とするリクエストに対応するレスポンスが前記離脱クライアント装置にキャッシュされている場合に、前記離脱クライアント装置にキャッシュされているレスポンスを前記離脱クライアント装置から受信する請求項1に記載のクライアント装置。
The other client communication unit
When the response corresponding to the request targeted by the representative client role assigned to the leaving client device leaving the communication system is cached in the leaving client device, the response cached in the leaving client device is The client device according to claim 1, receiving from the leaving client device.
前記代表クライアント処理部は、
自装置が前記通信システムから離脱した後に自装置に代わって動作する予備代表クライアント装置を他のクライアント装置の中から選択し、前記サーバ装置に送信するリクエストに前記予備代表クライアント装置の識別子を追加し、
前記サーバ通信部は、
前記代表クライアント処理部により前記予備代表クライアント装置の識別子が追加されたリクエストを前記サーバ装置に送信する請求項1に記載のクライアント装置。
The representative client processing unit
A backup representative client device that operates on behalf of the own device after the device has left the communication system is selected from other client devices, and the identifier of the backup representative client device is added to the request transmitted to the server device. ,
The server communication unit
The client device according to claim 1, wherein the request to which the identifier of the backup representative client device is added by the representative client processing unit is transmitted to the server device.
前記代表クライアント処理部は、
2以上のクライアント装置で生成された同一のリクエストが取得リクエストとして取得され、当該取得リクエストについての代表クライアントロールが自装置に割り当てられている場合に、リクエスト生成元の2以上のクライアント装置のうちのいずれかのクライアント装置を、自装置と協働する代表クライアントクローン装置に指定し、
前記他クライアント通信部は、
前記代表クライアントクローン装置に指定されたクライアント装置に対して、前記代表クライアントクローン装置に指定された旨を通知するとともに、前記2以上のクライアント装置のうち前記代表クライアントクローン装置に指定されなかったクライアント装置をレスポンスの送信先として通知する通知メッセージを送信し、
前記取得リクエストに対応するレスポンスを、前記代表クライアントクローン装置に送信し、前記代表クライアントクローン装置から、前記通知メッセージで通知した送信先のクライアント装置に前記レスポンスを送信させる請求項1に記載のクライアント装置。
The representative client processing unit
When the same request generated by two or more client devices is acquired as an acquisition request, and the representative client role for the acquisition request is assigned to the own device, Designate one of the client devices as a representative client clone device that cooperates with its own device,
The other client communication unit
A client device designated as the representative client clone device is notified that it has been designated as the representative client clone device, and of the two or more client devices, the client device not designated as the representative client clone device Send a notification message to notify
The client device according to claim 1, wherein a response corresponding to the acquisition request is transmitted to the representative client clone device, and the response is transmitted from the representative client clone device to a destination client device notified by the notification message. .
前記他クライアント通信部は、
前記代表クライアントクローン装置がレスポンスを送信するクライアント装置には、レスポンスを送信しない請求項9に記載のクライアント装置。
The other client communication unit
The client device according to claim 9, wherein a response is not transmitted to a client device to which the representative client clone device transmits a response.
前記代表クライアント処理部は、
前記取得リクエストのリクエスト生成元のクライアント装置の個数が閾値を超える場合に、前記代表クライアントクローン装置を指定する請求項9に記載のクライアント装置。
The representative client processing unit
The client device according to claim 9, wherein the representative client clone device is designated when the number of client devices that generate the request for the acquisition request exceeds a threshold value.
前記他クライアント通信部は、
他のクライアント装置から、前記代表クライアントクローン装置に指定された旨を通知するとともに、レスポンスの送信先のクライアント装置を通知する通知メッセージを受信する場合があり、
前記通知メッセージを受信した後に、前記他のクライアント装置からレスポンスを受信した場合に、受信したレスポンスを、前記通知メッセージで通知された送信先のクライアント装置に送信する請求項9に記載のクライアント装置。
The other client communication unit
In addition to notifying that the representative client clone device has been designated from another client device, there may be received a notification message notifying the client device of the response transmission destination,
The client apparatus according to claim 9, wherein when a response is received from the other client apparatus after receiving the notification message, the received response is transmitted to the destination client apparatus notified by the notification message.
前記代表クライアント処理部は、
前記通知メッセージで通知された送信先のクライアント装置の個数が2以上である場合に、2以上のクライアント装置のうちのいずれかのクライアント装置を、新たな代表クライアントクローン装置に指定し、
前記他クライアント通信部は、
前記新たな代表クライアントクローン装置に指定されたクライアント装置に対して、代表クライアントクローン装置に指定された旨を通知するとともに、前記2以上のクライアント装置のうち前記新たな代表クライアントクローン装置に指定されなかったクライアント装置をレスポンスの送信先として通知する通知メッセージを送信し、
前記他のクライアント装置からレスポンスを受信した場合に、受信したレスポンスを、前記新たな代表クライアントクローン装置に送信し、前記新たな代表クライアントクローン装置から、前記新たな代表クライアントクローン装置への通知メッセージで通知した送信先のクライアント装置に前記レスポンスを送信させる請求項12に記載のクライアント装置。
The representative client processing unit
If the number of destination client devices notified by the notification message is two or more, designate any one of the two or more client devices as a new representative client clone device;
The other client communication unit
Notifying the client device designated as the new representative client clone device that it has been designated as the representative client clone device, and not being designated as the new representative client clone device among the two or more client devices. Send a notification message to notify the client device as the response destination,
When a response is received from the other client device, the received response is transmitted to the new representative client clone device, and a notification message is sent from the new representative client clone device to the new representative client clone device. The client device according to claim 12, wherein the response is transmitted to the notified client device of the transmission destination.
前記代表クライアント処理部は、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられており、前記取得リクエストに対応するレスポンスが前記キャッシュ領域にキャッシュされておらず、前記取得リクエストに検索条件式が含まれ、当該検索条件式で得られる検索結果よりも広範な検索結果が得られる広範検索条件式に当該検索条件式を変換可能である場合に、
前記検索条件式を前記広範検索条件式に変換し、
前記サーバ通信部は、
前記代表クライアント処理部により変換された前記広範検索条件式が含まれるリクエストを前記サーバ装置に送信する請求項1に記載のクライアント装置。
The representative client processing unit
A representative client role for the acquisition request is assigned to the own device, a response corresponding to the acquisition request is not cached in the cache area, the search request includes a search condition expression, and the search condition expression If the search condition expression can be converted into a broad search condition expression that provides a broader search result than the search result obtained in
Converting the search condition formula into the broad search condition formula;
The server communication unit
The client apparatus according to claim 1, wherein a request including the broad search condition expression converted by the representative client processing unit is transmitted to the server apparatus.
複数のクライアント装置が含まれる通信システムであって、
各クライアント装置は、
いずれかのクライアント装置により生成されたサーバ装置へのリクエストを取得した場合に、取得した取得リクエストについて、代表してリクエストを処理する役割である代表クライアントロールが自装置に割り当てられているか否かを判定し、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられている場合に、前記取得リクエストに対応する前記サーバ装置からのレスポンスが、自装置がアクセスできるキャッシュ領域にキャッシュされているか否かを判定し、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられており、前記取得リクエストに対応するレスポンスが前記キャッシュ領域にキャッシュされていない場合に、前記取得リクエストを前記サーバ装置に送信し、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられていない場合に、前記取得リクエストを他のクライアント装置に送信する通信システム。
A communication system including a plurality of client devices,
Each client device
If a request to the server device generated by any client device is acquired, whether or not a representative client role that is a role for processing the request on behalf of the acquired acquisition request is assigned to the own device Judgment,
When a representative client role for the acquisition request is assigned to the own device, it is determined whether a response from the server device corresponding to the acquisition request is cached in a cache area accessible by the own device. ,
When a representative client role for the acquisition request is assigned to the own device and a response corresponding to the acquisition request is not cached in the cache area, the acquisition request is transmitted to the server device,
A communication system that transmits the acquisition request to another client device when a representative client role for the acquisition request is not assigned to the own device.
複数のクライアント装置が含まれる通信システムに含まれるコンピュータであるクライアント装置が行うデータ処理方法であって、
前記クライアント装置が、いずれかのクライアント装置により生成されたサーバ装置へのリクエストを取得した場合に、取得した取得リクエストについて、代表してリクエストを処理する役割である代表クライアントロールが自装置に割り当てられているか否かを判定する代表クライアント判定ステップと、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられている場合に、前記クライアント装置が、前記取得リクエストに対応する前記サーバ装置からのレスポンスが、自装置がアクセスできるキャッシュ領域にキャッシュされているか否かを判定する代表クライアント処理ステップと、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられており、前記取得リクエストに対応するレスポンスが前記キャッシュ領域にキャッシュされていない場合に、前記クライアント装置が、前記取得リクエストを前記サーバ装置に送信するサーバ通信ステップと、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられていない場合に、前記クライアント装置が、前記取得リクエストを他のクライアント装置に送信する他クライアント通信ステップとを有するデータ処理方法。
A data processing method performed by a client device which is a computer included in a communication system including a plurality of client devices,
When the client device acquires a request to the server device generated by any one of the client devices, a representative client role that is a role of processing the request on behalf of the acquired acquisition request is assigned to the own device. A representative client determination step of determining whether or not
Whether a response from the server device corresponding to the acquisition request is cached in a cache area accessible by the client device when a representative client role for the acquisition request is assigned to the client device Representative client processing step for determining whether or not,
When a representative client role for the acquisition request is assigned to the own device and a response corresponding to the acquisition request is not cached in the cache area, the client device transmits the acquisition request to the server device. Server communication step to
A data processing method comprising: another client communication step in which the client device transmits the acquisition request to another client device when a representative client role for the acquisition request is not assigned to the own device.
複数のクライアント装置が含まれる通信システムに含まれるコンピュータであるクライアント装置に、
いずれかのクライアント装置により生成されたサーバ装置へのリクエストを取得した場合に、取得した取得リクエストについて、代表してリクエストを処理する役割である代表クライアントロールが自装置に割り当てられているか否かを判定する代表クライアント判定ステップと、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられている場合に、前記取得リクエストに対応する前記サーバ装置からのレスポンスが、自装置がアクセスできるキャッシュ領域にキャッシュされているか否かを判定する代表クライアント処理ステップと、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられており、前記取得リクエストに対応するレスポンスが前記キャッシュ領域にキャッシュされていない場合に、前記取得リクエストを前記サーバ装置に送信するサーバ通信ステップと、
前記取得リクエストについての代表クライアントロールが自装置に割り当てられていない場合に、前記取得リクエストを他のクライアント装置に送信する他クライアント通信ステップとを実行させるプログラム。
In a client device which is a computer included in a communication system including a plurality of client devices,
If a request to the server device generated by any client device is acquired, whether or not a representative client role that is a role for processing the request on behalf of the acquired acquisition request is assigned to the own device A representative client determination step for determining;
When a representative client role for the acquisition request is assigned to the own device, it is determined whether a response from the server device corresponding to the acquisition request is cached in a cache area accessible by the own device. A representative client processing step;
A server communication step of transmitting the acquisition request to the server device when a representative client role for the acquisition request is assigned to the own device and a response corresponding to the acquisition request is not cached in the cache area; ,
A program for executing another client communication step of transmitting the acquisition request to another client device when a representative client role for the acquisition request is not assigned to the own device.
JP2014243741A 2014-12-02 2014-12-02 Client apparatus, communication system, data processing method, and program Active JP6324304B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2014243741A JP6324304B2 (en) 2014-12-02 2014-12-02 Client apparatus, communication system, data processing method, and program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2014243741A JP6324304B2 (en) 2014-12-02 2014-12-02 Client apparatus, communication system, data processing method, and program

Publications (2)

Publication Number Publication Date
JP2016110175A true JP2016110175A (en) 2016-06-20
JP6324304B2 JP6324304B2 (en) 2018-05-16

Family

ID=56124309

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2014243741A Active JP6324304B2 (en) 2014-12-02 2014-12-02 Client apparatus, communication system, data processing method, and program

Country Status (1)

Country Link
JP (1) JP6324304B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112839071A (en) * 2019-11-25 2021-05-25 商汤集团有限公司 Training system, training data access method and device, electronic device and medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ANTONY ROWSTRON: "Pastry:Scalable,decentralized object location and routing for large-scale peer-to-peer systems", MIDDLEWARE 2001 PROCEEDINGS OF THE IFIP/ACM INTERNATIONAL CONFERENCE ON DISTRIBUTED SYSTEMS PLATFORM, JPN6017050083, 12 November 2001 (2001-11-12), GB, pages p329-p350 *
SITARAM LYER: "Squirrel: A decentralized peer-to-peer web cache", 21TH ACM SYMPOSIUM ON PRINCIPLES OF DISTRIBUTED COMPUTING(PODC 2002), JPN6017050081, 1 July 2002 (2002-07-01), US, pages p1-p10 *
堀江 光: "MashCache:Flash Crowds耐性を持つマッシュアップサービス実現手法", 情報処理学会研究報告 平成22年度▲5▼ [CD−ROM], JPN6017050084, 15 February 2011 (2011-02-15), JP, pages 1頁-9頁 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112839071A (en) * 2019-11-25 2021-05-25 商汤集团有限公司 Training system, training data access method and device, electronic device and medium
CN112839071B (en) * 2019-11-25 2024-01-05 商汤集团有限公司 Training system, training data access method and device, electronic equipment and medium

Also Published As

Publication number Publication date
JP6324304B2 (en) 2018-05-16

Similar Documents

Publication Publication Date Title
CN103209223B (en) distributed application session information sharing method, system and application server
CN105939335B (en) The method and system of management passage ownership in Publish-subscribe data processing circumstance
US10091086B2 (en) System and method for providing an application programming interface manager for use with a service bus runtime
US9277030B2 (en) Stream processing using a client-server architecture
US9164806B2 (en) Processing pattern framework for dispatching and executing tasks in a distributed computing grid
JP5719323B2 (en) Distributed processing system, dispatcher and distributed processing management device
CN101313292A (en) Peer data transfer orchestration
JP5104489B2 (en) Distributed event detection system, distributed event detection method, and distributed event detection program
CN114024972B (en) Long connection communication method, system, device, equipment and storage medium
CN111917838B (en) Micro-service-based processing method and device, storage medium and electronic device
JP2017021494A (en) Load distribution program and server
JP2013235518A (en) Server device, system, and control method thereof
CN103186536A (en) Method and system for scheduling data shearing devices
US8978048B2 (en) Information processing system, control method, and non-transitory computer readable medium storing program
JP5109901B2 (en) Session data sharing method
JP6324304B2 (en) Client apparatus, communication system, data processing method, and program
CN110798513B (en) Internet of things equipment interconnection system and method
WO2023208132A1 (en) Api conversion system and access request processing method therefor, and electronic device and medium
CN113553206B (en) Data event execution method and device, electronic equipment and computer readable medium
US20200327122A1 (en) Conflation of topic selectors
CN117632395A (en) Workflow processing method, device, apparatus, storage medium and program product
JP5723330B2 (en) Distributed processing system and distributed processing method
JP2017167845A (en) Communication device, communication system, communication method and program
JP2008147819A (en) Security/financial data distribution system
KR102565409B1 (en) Method, device, electronic equipment for adjusting the number of instances and readble storage medium

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170123

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20171228

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180109

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180124

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

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180410

R150 Certificate of patent or registration of utility model

Ref document number: 6324304

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150