【0001】
【発明の属する技術分野】
本発明はプログラム間におけるメッセージ通信技術に関する。
【0002】
【従来の技術】
情報処理の形態は、かつては専らメインフレームと端末による集中型処理であったが現在ではクライアントサーバ方式が主流となりつつあり、その基盤は分散処理方式である。この分散処理方式における通信方式として柔軟で拡張性に富んだシステムを構築するためメッセージキューを介し、クライアントとサーバシステム間の通信を非同期に通信する非同期メッセージ通信を活用したシステム構築の事例が急速に広まっている。非同期メッセージ通信ではクライアントアプリケーションはサーバシステムへの処理要求メッセージを送信キューに格納したところで要求処理を手放すことができ、さらにクライアントアプリケーションはサーバシステムから応答された処理結果メッセージをキューから取り出すことで参照できる。
【0003】
つまり非同期メッセージ通信はサーバシステムへの処理要求メッセージの送信やサーバからの処理結果メッセージの受信がクライアントアプリケーションから離れ、バックグラウンドで実行できるといった特徴がある。処理要求メッセージを実行できる業務アプリケーションを持ったサーバシステムが複数存在する場合もクライアントアプリケーションは処理要求メッセージがどのサーバシステムに送信されて実行されるかは検知する必要がない。しかし、業務アプリケーションの実行待ちによる停滞がより少ないサーバシステムを送信先として選択することが望まれる。
【0004】
従来の処理要求メッセージの送信先サーバシステムの選択方法としては特許文献1に開示されているようなサーバシステムからクライアントに通知される可用性データに基づいて送信可能なサーバシステムを選択し、選択可能なサーバシステムが複数存在する場合は例えばラウンドロビン方式などの任意の負荷分散ロジックに基づいたアルゴリズムにより解決される。
【0005】
【特許文献1】
特開平11−328132号
【0006】
【発明が解決しようとする課題】
上記従来技術はクライアントがサーバシステムから受信する受信可/否データをもとに送信先が決定されるが、受信可能となっているサーバシステムが複数存在するときクライアント内の負荷分散ロジックに依存される。例えばクライアントがラウンドロビン方式を採用している場合、特定のサーバシステムが業務アプリケーションの実行遅延などの理由から既に多数の処理要求メッセージを抱えている場合でもクライアントはそのサーバシステムを送信先として選択し、処理要求メッセージを送信してしまうため、サーバシステム間での処理要求メッセージの仕掛かりが均等化できなくなり、特定のサーバシステムで多数の処理要求メッセージをもつ傍ら他のサーバシステムで処理要求メッセージの到着待ちとなるなどシステム全体のスループットが低下する場合があるといった問題があった。
【0007】
本発明は、サーバシステム間の負荷のアンバランスの改善や、サーバシステムのリソースをより効率的に利用することを目的とする。
【0008】
【課題を解決するための手段】
上記の目的を達成するために以下の方法を用いるものである。クライアントの送信要求アプリケーションで発行されるサーバシステムの業務アプリケーションに対する処理要求メッセージは処理要求メッセージのサーバシステム送信時に送信先判定テーブルを参照することで、同一業務アプリケーションをもったサーバシステムの集まりであるサーバグループの中から処理要求メッセージの送信先サーバシステムを選択する。ここでいうメッセージ通信は、端末と計算機もしくは計算機間の通信、もしくはプログラム間やオブジェクト間、プログラムとオブジェクト間の通信でも良い。
【0009】
クライアントで保持する送信先判定テーブルは後述のサーバグループ内負荷管理装置により受け取るテーブルであり、サーバグループ内の全てのサーバシステム内の受信キューに格納されているメッセージ数とそれぞれの「起動中」または「停止中」の業務アプリケーションの実行状況を保持している。
【0010】
クライアントにおける送信先サーバシステムの判定基準は送信先判定テーブルのレコード内で最もメッセージ数が少ない業務アプリケーションが「起動中」のサーバシステムを選択する。ここでもし、前記の条件を満たすサーバシステムが複数存在した場合はそのうちどのサーバシステムを選択しても良い。クライアントは選択したサーバシステムへ処理要求メッセージを送信する。送信が成功すると送信時にサーバシステムから受け取った最新の受信キューのメッセージ数と業務アプリケーションの実行状況を送信先判定テーブルの送信先サーバシステムのレコードに対して更新する。
【0011】
ここでもし、サーバシステムへの処理要求メッセージの送信に失敗した場合は、サーバシステムに障害が発生しているものと判断し、送信先判定テーブル内の該当するサーバシステムの業務アプリケーションの実行状況を「停止中」に変更することで当該サーバシステムへの処理要求メッセージの送信を抑止する。なお、クライアントが処理要求メッセージの送信時に参照する送信先判定テーブルには有効期限を設けてサーバグループ内負荷管理装置より更新した送信先判定テーブルがクライアント定義による間隔を経過した場合は使用せず、再びサーバグループ内負荷管理装置から最新データを取得する。
【0012】
サーバグループ内負荷管理装置では定期的およびサーバシステムの業務アプリケーションの状態が「起動中」から「停止中」、または「停止中」から「起動中」に変わる度に各サーバシステムが通知する更新データをもとにサーバグループ内の全てのサーバシステムの受信キューに格納されているメッセージ数と業務アプリケーションの実行状況を管理する。サーバグループ内負荷管理装置ではシステムで定義された一定の間隔内に更新データを送付しなかったサーバシステムについてサーバシステムに障害が発生しているものと判断し、送信先判定テーブル内の該当サーバシステムの業務アプリケーションの実行状況を「停止中」に変更することで当該サーバシステムへの処理要求メッセージの送信を抑止する。
【0013】
サーバシステム内では受信キューの処理要求メッセージがシステムで定義された一定の間隔取り出しが行われていないと業務アプリケーションが異常停止していると判断し、サーバシステムの業務アプリケーションの実行状況を「停止中」としてサーバグループ内負荷監視装置に通知し、処理要求メッセージの送信を抑止する。さらに当該サーバシステムはサーバグループ内負荷監視装置から受信キュー管理テーブルの状態を取得し、クライアントのサーバシステム選択手順と同様な手順で転送先のサーバシステムを選択し、転送先サーバに向けてメッセージを送信する。
【0014】
サーバシステムでの業務アプリケーションの実行状況は業務アプリケーションが開始または実行契機で「開始中」に設定され終了時に「停止中」に設定される。つまりサーバグループ内負荷管理装置での更新データの通知のよる監視やーバシステム内での受信キューの処理要求メッセージの取り出しの監視によって抑止されたクライアントからの処理要求メッセージの送信やサーバシステムの転送処理は業務アプリケーションの開始時または実行時に解除する。
【0015】
【発明の実施の形態】
以下、本発明の実施例を図面より説明する。図1は本発明の一実施例の概略構成図である。
図1において101はクライアントを示す。201はサーバグループ401に属するサーバシステムを示す。また301はサーバグループ401に設置されたサーバ内負荷管理装置を示す。
【0016】
クライアント101はサーバグループ401のサーバシステムの業務アプリケーション21に対する処理要求をするクライアント処理要求アプリケーション10と処理要求メッセージを生成する処理要求メッセージ生成部11と処理要求メッセージを蓄積するクライアント送信キュー12とサーバグループ401の中から送信先のサーバシステム201を選択するクライアントメッセージ送信先判定部13と送信先サーバシステムを選択するため判定情報となる送信先サーバ判定テーブル14を有する。ここでいうアプリケーションは、プログラム、業務プログラム、オブジェクトでも良い。
【0017】
さらにクライアント101はサーバシステム201より送付される処理結果メッセージを格納するためのクライアント受信キュー15とクライアント受信キュー15から処理結果メッセージを取り出すクライアント処理結果メッセージ応答部16および処理結果をクライアント101のユーザに向けて結果を表示するクライアント結果表示アプリケーション17を有する。さらにクライアント101からサーバシステム201へ処理要求メッセージを送信するクライアントメッセージ送信部18とサーバシステム201からの処理結果メッセージ受信し、クライアント受信キュー15へ格納するクライアントメッセージ受信部19を有する。
【0018】
サーバシステム201はクライアント101から受信した処理要求メッセージを蓄積できるサーバ受信キュー20と処理要求メッセージに応じた業務データベース22に検索や更新などのアクセスをし、サーバ送信キュー23へ処理結果メッセージを格納する業務アプリケーション21と処理結果メッセージを蓄積するサーバ送信キュー23とサーバ受信キュー20の処理要求メッセージの格納を監視するサーバ送信キュー監視部24とクライアント101から処理要求メッセージを受信してサーバ受信キュー20へ格納するサーバメッセージ受信部28とクライアント101への処理結果メッセージの送信を行うサーバメッセージ送信部29を有する。
【0019】
さらにサーバシステム201はサーバ受信キュー20の処理要求メッセージの格納数を管理するサーバ受信キュー状態管理部25と業務アプリケーション21の起動と停止状態を監視し、停止状態になるとサーバ受信キュー20の処理要求メッセージを他のサーバシステム201へ転送する業務アプリケーション状態監視部26とその転送先となるサーバシステムを選択するため判定情報となる転送先サーバ判定テーブル27を有する。
【0020】
サーバグループ内負荷管理装置301はサーバグループ401内の全てのサーバシステム201のサーバ受信キュー20のメッセージ数と業務アプリケーションの状態を管理する受信キュー管理テーブル32とサーバシステム201から通知される情報を受信キュー管理テーブル32に更新する受信キュー負荷状態更新部31とクライアント101またはサーバシステム201からのサーバ受信キュー管理テーブル32の参照に応答する受信キュー負荷状態応答部30を有する。
【0021】
なお、システム内のクライアント101およびサーバシステム201にはそれぞれシステム全体でユニークとなるクライアントIDまたはサーバシステムIDを付与するものとする。
【0022】
クライアント101においてクライアント処理要求アプリケーション10は図2に示したフローチャート10201に従って実行する。クライアント処理要求アプリケーション10は例えばグラフィカルユーザインタフェースなど任意のユーザアプリケーションを介して、サーバシステムにおける例えば業務データベース更新や検索要求など任意の処理要求を受け付け、処理要求をクライアント処理要求メッセージ生成部に通知する。
【0023】
クライアント処理要求メッセージ生成部11は図3に示したフローチャート10301に従って実行する。クライアント処理要求メッセージ生成部11は図19に示す処理要求メッセージ形式1901に従った処理要求メッセージを作成する。処理要求メッセージのメッセージ種別フィールドには本メッセージが処理要求メッセージであることを示すシステム共通で定めた識別子を更新する。メッセージIDフィールドにはシステム全体でユニークとなる任意のメッセージIDを更新する。メッセージIDをシステム全体でユニークにする方法については規定しない。例えば「クライアントID+メッセージ生成時刻+同一時刻内の生成通番」などが考えられる。メッセージ生成時刻フィールドには現在時刻を更新する。要求元クライアントIDフィールドには自クライアントIDを更新する。処理要求内容フィールドにはクライアント処理要求アプリケーション11から受け付けた処理要求を更新する。次にクライアント処理要求メッセージ生成部11は作成した処理要求メッセージをクライアント送信キュー12に格納する。
【0024】
クライアント送信キュー12はクライアントメッセージ送信先判定部13によって監視される。クライアントメッセージ送信先判定部13は図4に示したフローチャート10401に従って実行する。クライアントメッセージ送信先判定部13はクライアント送信キュー12に処理要求メッセージが到着すると、まずはクライアント101内で管理される送信先サーバ判定テーブル14のデータ更新時刻を参照する。現在時刻がデータ更新時刻からクライアント101内であらかじめ定義された更新間隔を経過している場合は以下の手順により送信先判定テーブル14を最新情報に更新する。クライアントメッセージ送信先判定部13は図22に示したサーバ負荷情報送信依頼電文形式2201に従ったサーバ負荷情報送信依頼電文を作成する。
【0025】
サーバ負荷情報送信依頼電文の電文種別フィールドには本電文がサーバ負荷情報送信依頼電文であることを示すシステム共通で定めた識別子を更新する。依頼元システムIDフィールドには自クライアントIDを更新する。
【0026】
作成したサーバ負荷情報送信依頼電文はサーバグループ内負荷管理装置301のサーバ受信キュー負荷情報応答部30へ送信する。
サーバ受信キュー負荷情報応答部30からは図23に示したサーバ負荷情報応答電文形式2301に従ったサーバ負荷情報応答電文が返却される。
【0027】
サーバ負荷情報応答電文にはサーバグループ401に属したサーバシステム毎のサーバ受信キューのメッセージ数と業務アプリケーションのステータス情報が埋め込まれている。クライアントメッセージ送信先判定部13はこのサーバ負荷情報応答電文を受け取るとサーバ負荷情報応答電文の先頭サーバシステムIDフィールドのシステムIDから最終サーバシステムIDフィールドのシステムIDまで順番に図27に示した送信先判定テーブル形式2701の形式をもった送信先判定テーブル14にサーバ負荷情報応答電文のサーバ受信キューメッセージ数フィールドと業務アプリケーションステータスフィールドの内容を更新する。なお、送信先判定テーブル14のクライアント101内での保持方法は規定しない。ただし、クライアント101のシステム軽度を保つためにはメモリ上で保持することが望ましい。送信先判定テーブル14の更新が完了するとクライアント101のシステム内固有に管理される送信先サーバ判定テーブル14のデータ更新時刻を現在時刻に更新する。
【0028】
クライアントメッセージ送信先判定部13は次に送信先サーバ判定テーブル14を使用して処理要求メッセージの送信先サーバシステムを選択する。処理要求メッセージの送信先サーバシステムの選択処理の手順については後述する。
【0029】
クライアントメッセージ送信先判定部13は処理要求メッセージの送信先サーバシステムの選択処理により送信先サーバシステムが選択できなかった場合は送信先サーバ判定テーブル14のデータ更新時刻から更新間隔が経過するまで待ち、再びサーバ負荷情報送信依頼電文の作成処理に戻る。送信先サーバシステムが選択できた場合、クライアント送信キュー12から処理要求メッセージを取得し、取得した処理要求メッセージの送信先サーバシステムIDフィールドに送信先サーバシステムの選択処理で選択した送信先サーバシステムのサーバシステムIDを更新する。そしてクライアントメッセージ送信部18へ処理要求メッセージを通知し、送信指示する。クライアントメッセージ送信部18による処理要求メッセージの送信処理が終わるとクライアントメッセージ送信部18からの戻り値を判定し、送信成功が返却された場合は戻り値に付与されたメッセージ数と業務アプリケーションステータスを送信先サーバ判定テーブル14の送信先サーバシステムのレコードに対して更新する。
【0030】
またクライアントメッセージ送信部18から送信失敗が返却された場合は該当サーバシステムが送信先サーバシステムとして選択されないように送信先サーバ判定テーブル内の業務アプリケーションステータスフィールドを「停止中」に変更する。その後、クライアントメッセージ送信先判定部13はクライアント受信キュー12のメッセージ監視処理に戻り、これら一連の処理を繰り返す。
クライアントメッセージ送信先判定部13の送信先サーバシステムの選択処理は図5に示すフローチャート10501に従って実行する。まず送信先サーバ判定テーブル14の全てのレコードを参照し、業務アプリケーションステータスフィールドが「起動中」のサーバシステムIDを抽出する。ここでもし、「起動中」のサーバシステム201が一つも存在しない場合は選択可能なサーバシステム201がないものと判断し、「選択可能なサーバシステムなし」を返却する。
【0031】
起動中のサーバシステム201が1つしかないときはそのサーバシステムが送信先サーバシステムとして選択されることになり、そのサーバシステムのサーバシステムIDを返却する。また、起動中のサーバシステム201が複数あるときはサーバ受信キューメッセージ数が最も少ないサーバシステム201を選択し、そのサーバシステム201のサーバシステムIDを返却する。また、サーバ受信キューメッセージ数については、他に比べて少ないものでもある程度の効果は期待できる。
【0032】
ここでもし、サーバ受信キューメッセージ数が同一のサーバシステム201が複数存在した場合は、そのうちでどのサーバシステム201を選択しても良いものとする。例えばシステムIDの小さい方を優先的に選択することで一つのサーバシステム201を特定できる。
【0033】
クライアントメッセージ送信部18はクライアントメッセージ送信先判定部13が選択したサーバシステム201へ処理要求メッセージを送信する。クライアントメッセージ送信部18は図6に示したフローチャート10601に従って実行される。
【0034】
クライアントメッセージ送信部18は送信指示を受け付けると図24に示したメッセージ送信電文形式2401に従うメッセージ送信電文を作成する。メッセージ送信電文の電文種別フィールドには本電文がメッセージ送信電文であることを示すシステム共通で定めた識別子を更新する。依頼元システムIDフィールドには自クライアントIDを格納する。メッセージフィールドにはクライアントメッセージ送信先判定部13より受け取った処理要求メッセージを更新する。そして処理要求メッセージの送信先サーバシステムIDフィールドを参照し、そのサーバシステム201のサーバメッセージ受信部28に向けてメッセージ送信電文を送信する。
【0035】
その後送信先のサーバシステムから図25に示したメッセージ送信応答電文形式2501に従うメッセージ送信応答電文が返るのを待つ。ここでもし、システムで定義した応答タイムアウト間隔内にメッセージ送信応答電文が返らないとき、送信先サーバシステムは停止しているものと判断し、クライアント送信キューに処理要求メッセージを戻し、送信失敗を返却する。送信先のサーバシステム201からメッセージ送信応答電文が返るとメッセージ送信応答電文の応答結果フィールドを参照し、応答結果が送信成功のときサーバ受信キューメッセージ数フィールドと業務アプリケーションステータスフィールドの値を戻り値に付与し、送信成功を返却する。応答結果が送信失敗の場合はクライアント送信キュー15に処理要求メッセージを戻し、送信失敗を返却する。
【0036】
クライアントメッセージ送信部18が送信するメッセージ送信電文はサーバメッセージ受信部28が受信する。サーバメッセージ受信部28は図11に示したフローチャート11101に従って実行する。サーバメッセージ受信部28はメッセージ送信電文を受け取るとまず、サーバシステム内で保持している業務アプリケーションステータスを参照する。この業務アプリケーションステータスはサーバシステム内の業務アプリケーションが「起動中」か「停止中」かを表わす情報で例えば共用メモリ領域などで管理されたサーバシステム201内の機能間で参照および更新ができる共通情報である。
【0037】
業務アプリケーションステータスが「起動中」のときメッセージ送信電文から処理要求メッセージを取り出し、サーバ受信キュー20に格納する。そしてサーバ受信キュー20の現在のメッセージ数を参照する。その後、メッセージ送信応答電文を作成する。メッセージ送信応答電文の電文種別フィールドには本電文がメッセージ送信応答電文であることを示すシステム共通で定めた識別子を更新する。サーバ受信キューメッセージ数フィールドには参照したサーバ受信キュー20の現在のメッセージ数を更新する。業務アプリケーションフィールドには現在の業務アプリケーションステータスを更新する。応答結果フィールドは送信成功に更新する。 そして作成したメッセージ送信応答電文をメッセージ送信電文の依頼元システムIDフィールドに格納されている依頼元システムに向けて送信する。業務アプリケーションステータスが「停止中」のときは同様にメッセージ送信応答電文を作成するが、電文種別フィールドを更新した後、応答結果フィールドには送信失敗を更新する。サーバ受信キューメッセージ数フィールドと業務アプリケーションステータスフィールドは更新する必要はない。作成したメッセージ送信応答電文は同様の手順で依頼元システムに送信する。
【0038】
サーバシステム201の受信キュー20はサーバ受信キュー状態管理部25により監視される。サーバ受信キュー状態管理部25は図12に示したフローチャート11201に従って実行する。サーバ受信キュー状態管理部25はサーバシステム内であらかじめ定義したサーバ受信キュー監視間隔毎または業務アプリケーション状態監視部からの受信キューの状態報告指示により、図21に示したサーバ受信キュー状態報告電文形式2101に従うサーバ受信キュー状態報告電文を作成する。サーバ受信キュー状態報告電文の電文種別フィールドには本電文がサーバ受信キュー状態報告電文であることを示すシステム共通で定めた識別子を更新する。サーバシステムIDフィールドには自サーバシステムIDを更新する。サーバ受信キューメッセージ数フィールドにはサーバ受信キュー20から現在の処理要求メッセージ数を取得し、更新する。
【0039】
さらに業務アプリケーションステータスフィールドにサーバシステム内で管理する業務アプリケーションステータスを更新する。作成したサーバ受信キュー状態報告電文はサーバグループ内負荷管理装置301のサーバ受信キュー負荷状態更新部31に通知する。
【0040】
サーバ受信キュー負荷状態更新部31は図18のフローチャート11801に従って実行する。サーバ受信キュー負荷管理状態更新部31はサーバ受信キュー状態報告電文を受け取るとサーバ受信キュー管理テーブル32を更新する。サーバ受信キュー管理テーブル32は図26に示したサーバ受信キュー管理テーブル形式2601の形式をもつ。サーバ受信キュー管理テーブル32はサーバグループ401内のサーバシステム201それぞれのサーバ受信キュー20に格納されたメッセージ数と業務アプリケーション21が「起動中」であるか「停止中」であるかを示すステータス各レコードの更新時刻を管理情報として保持する。なおサーバグループ内負荷管理装置301でのサーバ受信キュー管理テーブル32の保持方法は規定しない。しかし、本テーブルの各サーバシステムのレコード情報は最新の管理情報が逐次更新されるのでデータベース管理システムを使用することが望ましい。
【0041】
サーバ受信キュー負荷状態更新部31はサーバ受信キュー状態報告電文よりサーバシステムIDフィールドとサーバ受信キューメッセージ数フィールドおよび業務アプリケーションステータスフィールドを参照し、サーバ受信キュー管理テーブル32のサーバシステムIDが合致するレコードに対してサーバ受信キューメッセージ数フィールドと業務アプリケーションステータスフィールドに更新する。さらに同レコードの更新時刻フィールドは現在時刻で更新する。
【0042】
また、サーバ受信キュー負荷管理状態更新部31では、各サーバシステム201からサーバ受信キュー状態報告電文が定期的に送られているかを監視している。サーバグループ内負荷管理装置301であらかじめ定義されたサーバ受信キュー管理テーブル更新監視間隔毎にサーバ受信キュー管理テーブル32の全レコードの更新時刻フィールドをチェックし、サーバ受信キュー管理テーブル更新監視間隔内に更新されていないレコードに該当するサーバシステム201は停止していると判断し、該当レコードの業務アプリケーションステータスフィールドを「停止中」に更新する。
【0043】
クライアント101やサーバシステム201からのサーバ受信キュー管理テーブル32への参照はサーバグループ内負荷管理装置301のサーバ受信キュー負荷状態応答部30が応答する。サーバ受信キュー負荷状態応答部30は図17に示したフローチャート11701に従って実行される。サーバ受信キュー負荷状態応答部30ではクライアント101またはサーバシステム201から送られるサーバ負荷情報送信依頼電文を受け取るとサーバ受信キュー管理テーブル32より全サーバシステム201のレコードを参照し、サーバ負荷情報応答電文を作成する。
【0044】
サーバ負荷情報応答電文の電文種別フィールドには本電文がサーバ負荷情報応答電文であることを示すシステム共通で定めた識別子を格納し、先頭サーバシステムIDフィールドにはサーバ受信キュー管理テーブル32の先頭レコードのシステムID、最終サーバシステムIDフィールドに最終レコードのシステムIDを格納する。そしてサーバシステムIDフィールド、サーバ受信キューメッセージ数フィールドおよび業務アプリケーションステータスフィールドにはサーバ受信キュー管理テーブルの先頭レコードから最終レコードまでレコード順にフィールドに対応して格納する。作成したサーバ負荷情報応答電文はサーバ負荷情報送信依頼電文の依頼元システムIDフィールドを参照し、依頼元システムに向けて送信する。
【0045】
一方、サーバシステム201の受信キュー20に格納された処理要求メッセージは業務アプリケーション21によって監視される。業務アプリケーション21は図15に示したフローチャート11501に従って実行する。業務アプリケーション21は起動時に業務アプリケーションステータスを「起動中」に更新する。起動後はユーザからの停止要求があるまで常時、サーバ受信キュー20を参照し、処理要求メッセージの到着を監視する。サーバ受信キュー20に処理要求メッセージがあったとき業務アプリケーション21はサーバ受信キュー20から処理要求メッセージを取得する。
【0046】
ただし、サーバ受信キュー内の処理要求メッセージは他サーバシステム201から転送されてくる場合があるため、サーバ受信キュー20に格納された順序が必ずしも処理要求メッセージの生成時刻が古いものから順番になっているとは限らない。このため、メッセージの取得手順はメッセージ先入れ先出し方式ではなく処理要求メッセージのメッセージ生成時刻フィールドが最も古いものを優先して取得する。
【0047】
業務アプリケーション21は取得した処理要求メッセージの処理要求内容フィールドを参照し、業務データベース22などを利用し、処理要求内容に応じたユーザアプリケーションを実行することで要求元のクライアント101への処理結果を得る。業務アプリケーション21は次に図20に示した処理結果メッセージ形式2001に従う処理結果メッセージを作成する。処理結果メッセージのメッセージ種別フィールドには本メッセージが処理結果メッセージであることを示すシステム共通で定めた識別子を更新する。要求元クライアントIDフィールドには処理要求メッセージに格納されていた要求元クライアントIDを更新する。
【0048】
さらに処理結果フィールドにはユーザアプリケーションによって得た処理結果を格納する。作成した処理結果メッセージはサーバ送信キュー23に格納する。業務アプリケーション21はユーザアプリケーションを実行する度に業務アプリケーションステータスを「起動中」に更新する。これはユーザアプリケーションがその処理内容によって、特異的に処理が遅延した場合を考慮しており、もし業務アプリケーション状態監視部26が後述のアプリケーション実行監視処理により業務アプリケーションステータスを「停止中」に更新しても業務アプリケーション21が処理を継続している場合には業務アプリケーションステータスを「起動中」に戻すことができるためである。
【0049】
業務アプリケーション21は停止時に業務アプリケーションステータスを「停止中」に変更する。
【0050】
業務アプリケーション21が変更する業務アプリケーションステータスは業務アプリケーション状態監視部26が監視する。業務アプリケーション状態監視部26は図13のフローチャート11301に従って実行する。業務アプリケーション状態監視部26は業務アプリケーションステータスが「停止中」から「起動中」に状態が変わるとサーバ受信キュー状態管理部25へサーバ受信キューの状態報告を指示する。業務アプリケーション状態監視部26は業務アプリケーションステータスが「起動中」になると今度は「停止中」に変更されていないかを随時チェックする。また起動中の間はサーバ受信キュー20に格納された処理要求メッセージが正常に処理されているか業務アプリケーション21の状態監視処理をする。業務アプリケーション状態監視手順は以下通りである。
【0051】
まず、サーバ受信キュー20に処理要求メッセージが格納されているかどうかチェックし、処理要求メッセージが格納されている時、業務アプリケーション21が次に処理する先頭の処理要求メッセージを参照し、そのメッセージIDを記憶する。その後、サーバシステム201内であらかじめ定義したアプリケーション実行監視間隔の時間待つ。ただし、この間も業務アプリケーションステータスが「停止中」に変更されないかは繰り返しチェックする。アプリケーション実行監視間隔が経過すると再度サーバ受信キューに処理要求メッセージをチェックする。もしサーバ受信キューにメッセージがない場合、または業務アプリケーション21が次に処理する先頭の処理要求メッセージのメッセージIDが前記で記憶中したメッセージIDと異なる場合は処理要求メッセージが正常に動作していると判断し、監視処理を継続する。
【0052】
しかし、前記のメッセージIDが記憶中のメッセージIDと異なる場合は業務アプリケーションが障害などの理由で業務アプリケーションステータスを変更せずにダウンしていると判断し、システム内の業務アプリケーションステータスを「停止中」に変更する。業務アプリケーション21からのステータス変更または業務アプリケーション状態監視部26によるステータス変更により、業務アプリケーションステータスが「停止中」になるとサーバ受信キュー状態管理部25にサーバ受信キューの状態報告を指示する。さらにサーバ受信キュー20に処理要求メッセージが存在するときこれらの処理要求メッセージを他のサーバシステム201へ転送する。
【0053】
業務アプリケーション状態監視部26の転送処理は図14に示したフローチャート11401に従って実行する。業務アプリケーション状態監視部26はサーバ負荷情報送信依頼電文を作成し、サーバグループ内負荷管理装置301のサーバ受信キュー負荷情報応答部30へを送信する。このときサーバ負荷情報送信依頼電文の要求元システムIDフィールドには自サーバシステムIDを格納する。サーバ受信キュー負荷情報応答部30からサーバ負荷情報応答電文を受け取るとサーバ負荷情報応答電文の先頭サーバシステムIDから最終サーバシステムIDまで順にサーバ受信キューメッセージ数と業務アプリケーションステータスの情報をもとに図28に示した転送先判定テーブル形式2801に従う転送先判定テーブル27を作成する。
【0054】
転送先判定テーブル27はクライアント101で保持する送信先判定テーブル14と同形式であり、サーバ負荷情報応答電文からの更新もクライアント101の送信先判定テーブル14と同様の手順で行うことができる。
【0055】
ただし、転送先判定テーブル27は転送先として自サーバシステムが選択されることがないようにあらかじめ自サーバシステムのレコードは作成しないようにする。なお、転送先判定テーブル27の保持方法は規定しない。しかし、転送先判定テーブル27は処理要求メッセージ転送時の一時的な情報を管理するためのテーブルであるためメモリ上することが望ましい。転送先判定テーブル27の更新が完了すると、ここで業務アプリケーション21が再起動されているかチェックする。業務アプリケーションステータスが「起動中」に変更されているとき、つまり再起動された場合には転送の必要がないため転送処理は中止する。
【0056】
業務アプリケーションステータスが「停止中」のときクライアントでの送信先サーバシステムの選択手順と同様にフローチャート10501に従って業務アプリケーションが起動中で最もサーバ受信キューのメッセージ数が少ない転送先サーバシステムを選択する。転送先サーバシステムが選択できなかった場合はサーバ負荷情報送信依頼電文の送信から繰り返す。また転送先サーバシステムが選択できた場合はサーバ受信キューから処理要求メッセージを取得し、送信先サーバシステムIDフィールドに選択した転送先サーバシステムIDを更新し、サーバメッセージ送信部29に処理要求メッセージを通知し、送信指示する。
【0057】
サーバメッセージ送信部29の戻り値が送信成功のとき、戻り値に付与されたサーバ受信キューメッセージ数と業務アプリケーションステータスを転送先判定テーブル27の転送先サーバシステムIDのレコードに更新する。また処理要求メッセージの送信失敗が返却されると同レコードの業務アプリケーションステータスを「停止中」に変更する。次に再度自サーバシステム内の処理要求メッセージを参照し、メッセージが存在する場合は業務アプリケーションステータスチェック処理に戻り、自サーバ受信キューのメッセージがなくなるか、業務アプリケーションのステータスが「起動中」になるまでこれを繰り返す。
【0058】
サーバ送信キュー23に格納された処理結果メッセージはサーバ送信キュー監視部24により監視される。サーバ送信キュー監視部24は図16のフローチャート11601に従って実行される。サーバ送信キュー23に処理結果メッセージが格納されるとサーバ送信キュー監視部24がこれを取り出し、取り出した処理結果メッセージをサーバメッセージ送信部29に通知する。
【0059】
サーバメッセージ送信部29はサーバ送信キュー監視部29からの処理結果メッセージのクライアント101への送信と業務アプリケーション状態監視部26からの処理要求メッセージの他サーバシステム201への転送を行う。サーバメッセージ送信部29は図10に示したフローチャート11001に従って実行される。
【0060】
サーバメッセージ送信部29は送信指示を受け付けると通知されたメッセージのメッセージ種別フィールドを参照する。メッセージ種別が処理結果メッセージの場合、まずメッセージ送信電文を作成する。電文種別フィールドにはメッセージ送信電文を示す識別子を更新する。依頼元システムIDフィールドは自サーバシステムIDを更新する。メッセージフィールドにはサーバ送信キュー監視部29から受け取った処理結果メッセージを更新する。次に処理結果メッセージの要求元クライアントIDフィールドを参照し、要求元のクライアント101のメッセージ受信部にメッセージ送信電文を送信する。その後送信先のクライアント101からのメッセージ送信応答電文が返るのを待つ。
【0061】
ここでもし、システムで定義した応答タイムアウト間隔内にメッセージ送信応答電文が返らないとき、サーバ送信キュー24に処理要求メッセージを戻し、送信失敗を返却する。
【0062】
送信先のクライアント101からメッセージ送信応答電文が返るとメッセージ送信応答電文の応答結果フィールドを参照し、応答結果が送信成功のとき、送信成功を返却する。応答結果が送信失敗の場合はサーバ送信キュー23に処理要求メッセージを戻し、送信失敗を返却する。
【0063】
メッセージ種別が処理要求メッセージの場合、まずメッセージ送信電文を作成する。電文種別フィールドにはメッセージ送信電文を示す識別子を更新する。依頼元システムIDフィールドは自サーバシステムIDを更新する。メッセージフィールドには業務アプリケーション状態監視部26から受け取った処理要求メッセージを更新する。次に処理要求メッセージの送信先サーバシステムIDフィールドを参照し、転送先のサーバシステム201のメッセージ受信部28にメッセージ送信電文を送信する。その後転送先のサーバシステム201からのメッセージ送信応答電文が返るのを待つ。
【0064】
ここでもし、システムで定義した応答タイムアウト間隔内にメッセージ送信応答電文が返らないとき、転送先サーバシステム201は停止しているものと判断し、サーバ受信キュー20に処理要求メッセージを戻し、送信失敗を返却する。
【0065】
転送先のサーバシステム201からメッセージ送信応答電文が返るとメッセージ送信応答電文の応答結果フィールドを参照し、応答結果が送信成功のときメッセージ送信応答電文のサーバ受信キューメッセージ数フィールドと業務アプリケーションステータスフィールドの値を戻り値に付与し、送信成功を返却する。応答結果が送信失敗の場合はサーバ受信キュー20に処理要求メッセージを戻し、送信失敗を返却する。
【0066】
クライアント101ではサーバシステム201が送信するメッセージ送信電文をクライアントメッセージ受信部19が受信する。クライアントメッセージ受信部19は図7に示したフローチャート10701に従って実行する。クライアントメッセージ受信部19ではサーバシステム201からのメッセージ送信電文を受け取るとメッセージ送信電文のメッセージフィールドから処理結果メッセージを取得し、クライアント受信キュー15に格納する。その後、メッセージ送信応答電文を作成し、電文種別フィールドにメッセージ送信電文の識別子を更新し、さらに応答結果フィールドには送信成功を更新する。そしてメッセージ送信電文の依頼元システムIDフィールドに格納されたサーバシステム201にメッセージ送信応答電文を送信する。
【0067】
クライアント101のクライアント受信キュー15はクライアント処理結果メッセージ応答部16により監視される。クライアント処理結果メッセージ応答部16は図8に示したフローチャート10801に従って実行する。クライアント処理結果メッセージ応答部16はクライアント受信キュー15に処理結果メッセージが格納されると処理結果メッセージを取得し、処理結果メッセージの処理結果フィールドの内容をクライアント結果表示アプリケーション17に通知する。
【0068】
クライアント結果表示アプリケーション17は図9に示したフローチャート10901に従って実行する。クライアント結果表示アプリケーション17では例えばグラフィカルユーザインタフェースなど任意のユーザアプリケーションを介して処理結果をユーザに通知する。
【0069】
サーバグループ内のサーバシステム間での業務アプリケーションの負荷を均等化することでサーバグループ内のシステムリソースを効率的に利用することができ、業務アプリケーションの実行待ちが少ないサーバを選択できる。さらに業務アプリケーションが異常停止した場合でも他のサーバシステムに転送することでサーバ処理要求メッセージの滞留を防ぐことができる。
【0070】
【発明の効果】
本発明によれば、サーバシステム間の負荷のアンバランスの改善が可能となる
【図面の簡単な説明】
【図1】本システムの一実施例の概略構成図である。
【図2】実施例のクライアント処理要求アプリケーションの処理を示すフローチャートである。
【図3】実施例の実施例のクライアント処理要求メッセージ生成部の処理を示すフローチャートである。
【図4】実施例の実施例のクライアントメッセージ送信先判定部
の処理を示すフローチャートである。
【図5】実施例の実施例のクライアントメッセージ送信先判定部の送信先サーバシステム選択処理と業務アプリケーション状態監視部の転送先サーバシステム選択処理を示すフローチャートである。
【図6】実施例の実施例のクライアントメッセージ送信部の処理を示すフローチャートである。
【図7】実施例の実施例のクライアントメッセージ受信部の処理を示すフローチャートである。
【図8】実施例の実施例のクライアント処理結果メッセージ応答部の処理を示すフローチャートである。
【図9】実施例の実施例のクライアント結果表示アプリケーションの処理を示すフローチャートである。
【図10】実施例の実施例のサーバメッセージ受信部の処理を示すフローチャートである。
【図11】実施例の実施例のサーバメッセージ受信部の処理を示すフローチャートである。
【図12】実施例の実施例のサーバ受信キュー状態管理部の処理を示すフローチャートである。
【図13】実施例の実施例の業務アプリケーション状態監視部の監視処理を示すフローチャートである。
【図14】実施例の実施例の業務アプリケーション状態監視部の転送処理を示すフローチャートである。
【図15】実施例の実施例の業務アプリケーションの処理を示すフローチャートである。
【図16】実施例の実施例のサーバ送信キュー監視部の処理を示すフローチャートである。
【図17】実施例の実施例のサーバ受信キュー負荷状態応答部の処理を示すフローチャートである。
【図18】実施例の実施例のサーバ受信キュー負荷状態更新部の処理を示すフローチャートである。
【図19】実施例の処理要求メッセージの形式である。
【図20】実施例の処理結果メッセージの形式である。
【図21】実施例のサーバ受信キュー状態報告電文の形式である。
【図22】実施例のサーバ負荷情報送信依頼電文の形式である。
【図23】実施例のサーバ負荷情報応答電文の形式である。
【図24】実施例のメッセージ送信電文の形式である。
【図25】実施例のメッセージ送信応答電文の形式である。
【図26】実施例のサーバ受信キュー管理テーブルの形式である。
【図27】実施例の送信先サーバ判定テーブルの形式である。
【図28】実施例の転送先サーバ判定テーブルの形式である。
【符号の説明】
101 クライアント
201 サーバシステム
301 サーバグループ内負荷管理装置
401 サーバグループ
10 クライアント処理要求アプリケーション
11 クライアント処理要求メッセージ生成部
12 クライアント受信キュー
13 クライアントメッセージ送信先判定部
14 送信先サーバ判定テーブル
15 クライアント受信キュー
16 クライアント処理結果メッセージ応答部
17 クライアント結果表示アプリケーション
18 クライアントメッセージ送信部
19 クライアントメッセージ受信部
20 サーバ受信キュー
21 業務アプリケーション
22 業務データベース
23 サーバ送信キュー
25 サーバ送信キュー監視部
25 サーバ受信キュー状態管理部
26 業務アプリケーション状態監視部
27 転送先サーバ判定テーブル
28 サーバメッセージ受信部
29 サーバメッセージ送信部
30 サーバ受信キュー負荷状態応答部
31 業務アプリケーション負荷状態更新部
32 サーバ受信キュー管理テーブル[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a message communication technique between programs.
[0002]
[Prior art]
The form of information processing used to be centralized processing using only mainframes and terminals, but at present, the client-server system is becoming mainstream, and the foundation is a distributed processing system. In order to build a flexible and extensible system as a communication method in this distributed processing method, examples of system construction using asynchronous message communication that asynchronously communicates communication between client and server systems via message queues are rapidly It is widespread. In asynchronous message communication, the client application can release the request processing when the processing request message to the server system is stored in the transmission queue, and the client application can refer to the processing result message returned from the server system by retrieving it from the queue. .
[0003]
In other words, asynchronous message communication has a feature that transmission of a processing request message to the server system and reception of a processing result message from the server can be executed in the background away from the client application. Even when there are a plurality of server systems having business applications that can execute the processing request message, the client application does not need to detect which server system the processing request message is transmitted to be executed. However, it is desirable to select a server system with less stagnation due to waiting for execution of business applications as a transmission destination.
[0004]
As a conventional method for selecting a destination server system for processing request messages, a server system that can be sent based on availability data notified to a client from the server system as disclosed in Patent Document 1 can be selected and selected. When there are a plurality of server systems, the problem is solved by an algorithm based on an arbitrary load balancing logic such as a round robin method.
[0005]
[Patent Document 1]
JP-A-11-328132
[0006]
[Problems to be solved by the invention]
In the above prior art, the transmission destination is determined based on the receivability data that the client receives from the server system. However, when there are multiple server systems that can be received, it depends on the load balancing logic in the client. The For example, when a client adopts the round robin method, even when a specific server system already has a large number of processing request messages due to delays in execution of business applications, the client selects that server system as a destination. Since the processing request message is transmitted, the processing request messages between the server systems cannot be equalized, and there are many processing request messages in a specific server system. There was a problem that the throughput of the entire system might be reduced, such as waiting for arrival.
[0007]
It is an object of the present invention to improve load imbalance between server systems and more efficiently use server system resources.
[0008]
[Means for Solving the Problems]
In order to achieve the above object, the following method is used. A processing request message for a business application in a server system issued by a client transmission request application refers to a server system group having the same business application by referring to the destination determination table when the processing request message is sent to the server system. Select a destination server system for processing request messages from the group. The message communication here may be communication between a terminal and a computer or a computer, communication between programs or objects, or communication between programs and objects.
[0009]
The destination determination table held by the client is a table received by the load management device in the server group, which will be described later, and the number of messages stored in the reception queues in all server systems in the server group and the respective “active” or Holds the execution status of business applications that are "stopped".
[0010]
As a determination criterion of the destination server system in the client, a server system in which the business application having the smallest number of messages in the record of the destination determination table is “active” is selected. Here, when there are a plurality of server systems satisfying the above conditions, any one of them may be selected. The client sends a processing request message to the selected server system. If the transmission is successful, the latest number of messages in the reception queue received from the server system at the time of transmission and the execution status of the business application are updated to the record of the transmission destination server system in the transmission destination determination table.
[0011]
If the processing request message fails to be sent to the server system, it is determined that a failure has occurred in the server system, and the execution status of the business application of the corresponding server system in the destination determination table is displayed. By changing to “stopped”, transmission of the processing request message to the server system is suppressed. The destination determination table that the client refers to when sending the processing request message is not used when the destination determination table updated by the load management device in the server group with an expiration date has passed an interval defined by the client, The latest data is acquired again from the load management device in the server group.
[0012]
Update data notified by each server system on the server group load management device periodically and whenever the status of a business application in the server system changes from "Starting" to "Stopping" or "Stopping" to "Starting" Based on the above, it manages the number of messages stored in the reception queue of all server systems in the server group and the execution status of business applications. The load management device in the server group determines that a failure has occurred in the server system for a server system that has not sent update data within a certain interval defined by the system, and the corresponding server system in the destination determination table By changing the execution status of the current business application to “Stopped”, transmission of the processing request message to the server system is suppressed.
[0013]
In the server system, if the processing request message in the receive queue is not fetched at a fixed interval defined in the system, it is determined that the business application has stopped abnormally, and the execution status of the business application in the server system is set to “Stopped”. ”To the server group load monitoring apparatus, and the transmission of the processing request message is suppressed. Furthermore, the server system obtains the status of the reception queue management table from the load monitoring device in the server group, selects the transfer destination server system in the same manner as the client server system selection procedure, and sends a message to the transfer destination server. Send.
[0014]
The execution status of the business application in the server system is set to “Starting” when the business application starts or is triggered, and is set to “Stopped” when the business application ends. In other words, the transmission of processing request messages from the client and the transfer processing of the server system that are suppressed by the monitoring by the update data notification in the load management device in the server group and the monitoring of the processing request messages in the reception queue in the server system Cancel when starting or executing a business application.
[0015]
DETAILED DESCRIPTION OF THE INVENTION
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a schematic configuration diagram of an embodiment of the present invention.
In FIG. 1, reference numeral 101 denotes a client. Reference numeral 201 denotes a server system belonging to the server group 401. Reference numeral 301 denotes an in-server load management apparatus installed in the server group 401.
[0016]
The client 101 includes a client processing request application 10 that makes a processing request to the business application 21 of the server system in the server group 401, a processing request message generator 11 that generates a processing request message, a client transmission queue 12 that stores the processing request message, and a server group. A client message transmission destination determination unit 13 that selects a transmission destination server system 201 from 401 and a transmission destination server determination table 14 that is determination information for selecting a transmission destination server system. The application here may be a program, a business program, or an object.
[0017]
Furthermore, the client 101 stores the processing result message sent from the server system 201, the client reception queue 15 for storing the processing result message, the client processing result message response unit 16 for retrieving the processing result message from the client reception queue 15, and the processing result to the user of the client 101. A client result display application 17 for displaying the results. Further, a client message transmitting unit 18 that transmits a processing request message from the client 101 to the server system 201 and a client message receiving unit 19 that receives a processing result message from the server system 201 and stores it in the client reception queue 15.
[0018]
The server system 201 accesses the server reception queue 20 that can store the processing request message received from the client 101 and the business database 22 according to the processing request message, and stores the processing result message in the server transmission queue 23. The processing request message is received from the client 101 and the server transmission queue monitoring unit 24 for monitoring the storage of the processing request message in the server transmission queue 23 and the server reception queue 20 for accumulating the business application 21 and the processing result message. A server message receiving unit 28 for storing and a server message transmitting unit 29 for transmitting a processing result message to the client 101 are included.
[0019]
Further, the server system 201 monitors the start and stop states of the server reception queue state management unit 25 and the business application 21 that manage the number of stored processing request messages in the server reception queue 20. A business application status monitoring unit 26 that transfers a message to another server system 201 and a transfer destination server determination table 27 that is determination information for selecting a server system that is the transfer destination are included.
[0020]
The intra-server group load management apparatus 301 receives the information received from the server system 201 and the reception queue management table 32 for managing the number of messages in the server reception queue 20 of all the server systems 201 in the server group 401 and the state of the business application. A reception queue load state update unit 31 that updates the queue management table 32 and a reception queue load state response unit 30 that responds to reference to the server reception queue management table 32 from the client 101 or the server system 201 are provided.
[0021]
It is assumed that a client ID or server system ID that is unique for the entire system is assigned to each of the client 101 and the server system 201 in the system.
[0022]
In the client 101, the client processing request application 10 executes in accordance with the flowchart 10201 shown in FIG. The client processing request application 10 receives an arbitrary processing request such as a business database update or a search request in the server system via an arbitrary user application such as a graphical user interface, and notifies the processing request to the client processing request message generator.
[0023]
The client processing request message generating unit 11 executes the processing according to the flowchart 10301 shown in FIG. The client process request message generation unit 11 creates a process request message according to the process request message format 1901 shown in FIG. In the message type field of the processing request message, an identifier common to the system indicating that this message is a processing request message is updated. An arbitrary message ID that is unique in the entire system is updated in the message ID field. The method for making the message ID unique throughout the system is not specified. For example, “client ID + message generation time + generation serial number within the same time” can be considered. The current time is updated in the message generation time field. The own client ID is updated in the request source client ID field. The processing request received from the client processing request application 11 is updated in the processing request content field. Next, the client process request message generator 11 stores the created process request message in the client transmission queue 12.
[0024]
The client transmission queue 12 is monitored by the client message transmission destination determination unit 13. The client message transmission destination determination unit 13 executes in accordance with the flowchart 10401 shown in FIG. When a processing request message arrives at the client transmission queue 12, the client message transmission destination determination unit 13 first refers to the data update time of the transmission destination server determination table 14 managed in the client 101. When the current time has passed the update interval defined in advance in the client 101 from the data update time, the transmission destination determination table 14 is updated to the latest information by the following procedure. The client message transmission destination determination unit 13 creates a server load information transmission request message according to the server load information transmission request message format 2201 shown in FIG.
[0025]
In the message type field of the server load information transmission request message, an identifier defined in common in the system indicating that this message is a server load information transmission request message is updated. The own client ID is updated in the request source system ID field.
[0026]
The created server load information transmission request message is transmitted to the server reception queue load information response unit 30 of the intra-server group load management apparatus 301.
The server reception queue load information response unit 30 returns a server load information response message in accordance with the server load information response message format 2301 shown in FIG.
[0027]
In the server load information response message, the number of messages in the server reception queue for each server system belonging to the server group 401 and the status information of the business application are embedded. When the client message transmission destination determination unit 13 receives this server load information response message, the transmission destination shown in FIG. 27 in order from the system ID in the first server system ID field to the system ID in the last server system ID field of the server load information response message. The contents of the server reception queue message number field and the business application status field of the server load information response message are updated in the transmission destination determination table 14 having the determination table format 2701 format. Note that the method of holding the transmission destination determination table 14 in the client 101 is not defined. However, in order to keep the system lightness of the client 101, it is desirable to hold it on the memory. When the update of the transmission destination determination table 14 is completed, the data update time of the transmission destination server determination table 14 managed uniquely in the system of the client 101 is updated to the current time.
[0028]
Next, the client message transmission destination determination unit 13 uses the transmission destination server determination table 14 to select a transmission destination server system for the processing request message. The procedure for selecting the processing destination message transmission destination server system will be described later.
[0029]
The client message transmission destination determination unit 13 waits until the update interval elapses from the data update time of the transmission destination server determination table 14 when the transmission destination server system cannot be selected by the selection processing of the transmission destination server system of the processing request message. The process returns to the server load information transmission request message creation process again. When the transmission destination server system can be selected, the processing request message is acquired from the client transmission queue 12, and the transmission destination server system selected in the transmission destination server system selection process is selected in the transmission destination server system ID field of the acquired processing request message. Update the server system ID. Then, the client message transmitting unit 18 is notified of the processing request message and instructed to transmit. When the transmission processing of the processing request message by the client message transmission unit 18 is completed, the return value from the client message transmission unit 18 is determined, and when the transmission success is returned, the number of messages attached to the return value and the business application status are transmitted. Update the record of the destination server system in the destination server determination table 14.
[0030]
When the transmission failure is returned from the client message transmission unit 18, the business application status field in the transmission destination server determination table is changed to “stopped” so that the corresponding server system is not selected as the transmission destination server system. Thereafter, the client message destination determination unit 13 returns to the message monitoring process of the client reception queue 12 and repeats the series of processes.
The selection processing of the destination server system of the client message destination determination unit 13 is executed according to the flowchart 10501 shown in FIG. First, all records in the destination server determination table 14 are referred to, and a server system ID whose business application status field is “Active” is extracted. If there is no “active” server system 201, it is determined that there is no selectable server system 201, and “no selectable server system” is returned.
[0031]
When there is only one active server system 201, the server system is selected as the destination server system, and the server system ID of the server system is returned. When there are a plurality of active server systems 201, the server system 201 having the smallest number of server reception queue messages is selected, and the server system ID of the server system 201 is returned. Further, even if the number of server reception queue messages is smaller than the others, a certain degree of effect can be expected.
[0032]
If there are a plurality of server systems 201 having the same number of server reception queue messages, any server system 201 may be selected. For example, one server system 201 can be specified by preferentially selecting the smaller system ID.
[0033]
The client message transmission unit 18 transmits a processing request message to the server system 201 selected by the client message transmission destination determination unit 13. The client message transmission unit 18 is executed according to the flowchart 10601 shown in FIG.
[0034]
Upon receipt of the transmission instruction, the client message transmission unit 18 creates a message transmission message in accordance with the message transmission message format 2401 shown in FIG. In the message type field of the message transmission message, an identifier defined in common in the system indicating that the message is a message transmission message is updated. The client ID is stored in the request source system ID field. In the message field, the processing request message received from the client message destination determination unit 13 is updated. Then, referring to the transmission destination server system ID field of the processing request message, a message transmission message is transmitted to the server message reception unit 28 of the server system 201.
[0035]
Thereafter, it waits for a message transmission response message conforming to the message transmission response message format 2501 shown in FIG. If the message transmission response message is not returned within the response timeout interval defined by the system, it is determined that the destination server system is stopped, the processing request message is returned to the client transmission queue, and the transmission failure is returned. To do. When a message transmission response message is returned from the destination server system 201, the response result field of the message transmission response message is referred to. When the response result is successful, the values of the server reception queue message number field and the business application status field are set as return values. Grant and return successful transmission. If the response result is a transmission failure, a processing request message is returned to the client transmission queue 15 and a transmission failure is returned.
[0036]
The server message receiver 28 receives the message transmission message transmitted by the client message transmitter 18. The server message receiving unit 28 executes in accordance with the flowchart 11101 shown in FIG. When the server message receiving unit 28 receives the message transmission message, it first refers to the business application status held in the server system. The business application status is information indicating whether the business application in the server system is “starting” or “stopping”, and is common information that can be referred to and updated between functions in the server system 201 managed in, for example, the shared memory area. It is.
[0037]
When the business application status is “active”, the processing request message is extracted from the message transmission message and stored in the server reception queue 20. Then, the current number of messages in the server reception queue 20 is referred to. Then, a message transmission response message is created. In the message type field of the message transmission response message, an identifier defined in common in the system indicating that this message is a message transmission response message is updated. In the server reception queue message number field, the current number of messages in the referenced server reception queue 20 is updated. The current business application status is updated in the business application field. The response result field is updated with successful transmission. Then, the created message transmission response message is transmitted to the request source system stored in the request source system ID field of the message transmission message. When the business application status is “stopped”, a message transmission response message is created in the same manner, but after updating the message type field, the transmission failure is updated in the response result field. The server reception queue message count field and the business application status field do not need to be updated. The created message transmission response message is transmitted to the request source system in the same procedure.
[0038]
The reception queue 20 of the server system 201 is monitored by the server reception queue state management unit 25. The server reception queue state management unit 25 executes in accordance with the flowchart 11201 shown in FIG. The server reception queue status management unit 25 receives the server reception queue status report message format 2101 shown in FIG. 21 at every server reception queue monitoring interval defined in the server system or according to a reception queue status report instruction from the business application status monitoring unit. Create a server reception queue status report message conforming to. In the message type field of the server reception queue status report message, an identifier defined in common in the system indicating that this message is a server reception queue status report message is updated. The own server system ID is updated in the server system ID field. In the server reception queue message number field, the current processing request message number is acquired from the server reception queue 20 and updated.
[0039]
Further, the business application status managed in the server system is updated in the business application status field. The created server reception queue status report message is notified to the server reception queue load status update unit 31 of the intra-server group load management device 301.
[0040]
The server reception queue load state update unit 31 executes in accordance with the flowchart 11801 of FIG. When the server reception queue load management state update unit 31 receives the server reception queue state report message, it updates the server reception queue management table 32. The server reception queue management table 32 has a server reception queue management table format 2601 shown in FIG. The server reception queue management table 32 shows the number of messages stored in the server reception queue 20 of each server system 201 in the server group 401 and statuses indicating whether the business application 21 is “starting” or “stopping”. Holds record update time as management information. Note that the method for holding the server reception queue management table 32 in the server group load management apparatus 301 is not defined. However, it is desirable to use a database management system because the latest management information is sequentially updated in the record information of each server system in this table.
[0041]
The server reception queue load state update unit 31 refers to the server system ID field, the server reception queue message number field, and the business application status field from the server reception queue state report message, and records that match the server system ID in the server reception queue management table 32 Update to the server reception queue message count field and business application status field. Furthermore, the update time field of the record is updated with the current time.
[0042]
In addition, the server reception queue load management state updating unit 31 monitors whether or not a server reception queue state report message is periodically sent from each server system 201. The update time field of all records in the server reception queue management table 32 is checked at every server reception queue management table update monitoring interval defined in advance in the server group load management device 301, and updated within the server reception queue management table update monitoring interval. It is determined that the server system 201 corresponding to the record that is not yet stopped, and the business application status field of the record is updated to “stopped”.
[0043]
The reference to the server reception queue management table 32 from the client 101 or the server system 201 is responded by the server reception queue load state response unit 30 of the intra-server group load management apparatus 301. The server reception queue load state response unit 30 is executed according to the flowchart 11701 shown in FIG. When the server reception queue load state response unit 30 receives a server load information transmission request message sent from the client 101 or the server system 201, the server reception queue management table 32 refers to the records of all the server systems 201 and sends a server load information response message. create.
[0044]
In the message type field of the server load information response message, an identifier defined in common in the system indicating that this message is a server load information response message is stored. In the first server system ID field, the first record of the server reception queue management table 32 is stored. The system ID of the final record is stored in the system ID and final server system ID fields. In the server system ID field, the server reception queue message number field, and the business application status field, the first record to the last record in the server reception queue management table are stored in the order of records. The created server load information response message refers to the request source system ID field of the server load information transmission request message and transmits it to the request source system.
[0045]
On the other hand, the processing request message stored in the reception queue 20 of the server system 201 is monitored by the business application 21. The business application 21 is executed according to the flowchart 11501 shown in FIG. The business application 21 updates the business application status to “active” at the time of startup. After startup, the server reception queue 20 is always referred to until a stop request is received from the user, and the arrival of the processing request message is monitored. When there is a processing request message in the server reception queue 20, the business application 21 acquires the processing request message from the server reception queue 20.
[0046]
However, since the processing request messages in the server reception queue may be transferred from the other server system 201, the order stored in the server reception queue 20 is not necessarily from the generation time of the processing request message. Not necessarily. For this reason, the message acquisition procedure preferentially acquires the oldest message generation time field of the processing request message instead of the message first-in first-out method.
[0047]
The business application 21 refers to the processing request content field of the acquired processing request message, uses the business database 22 or the like, and executes a user application corresponding to the processing request content to obtain a processing result for the requesting client 101. . Next, the business application 21 creates a processing result message in accordance with the processing result message format 2001 shown in FIG. In the message type field of the processing result message, an identifier defined in common in the system indicating that this message is a processing result message is updated. The request source client ID field is updated with the request source client ID stored in the processing request message.
[0048]
Further, the processing result obtained by the user application is stored in the processing result field. The created processing result message is stored in the server transmission queue 23. The business application 21 updates the business application status to “Active” every time the user application is executed. This takes into account the case where the user application specifically delays processing depending on the processing contents, and if the business application status monitoring unit 26 updates the business application status to “stopped” by the application execution monitoring processing described later. However, if the business application 21 continues processing, the business application status can be returned to “Active”.
[0049]
The business application 21 changes the business application status to “stopped” when stopped.
[0050]
The business application status monitoring unit 26 monitors the business application status changed by the business application 21. The business application state monitoring unit 26 executes according to the flowchart 11301 of FIG. The business application status monitoring unit 26 instructs the server reception queue status management unit 25 to report the status of the server reception queue when the status of the business application status changes from “stopped” to “active”. When the business application status becomes “active”, the business application status monitoring unit 26 checks from time to time whether the status is changed to “stopped”. During the activation, the status monitoring process of the business application 21 is performed to check whether the processing request message stored in the server reception queue 20 is normally processed. The business application status monitoring procedure is as follows.
[0051]
First, it is checked whether or not a processing request message is stored in the server reception queue 20, and when the processing request message is stored, the business processing application 21 refers to the first processing request message to be processed next, and determines the message ID. Remember. Thereafter, the server system 201 waits for an application execution monitoring interval defined in advance in the server system 201. However, during this time, it is repeatedly checked whether the business application status is changed to “stopped”. When the application execution monitoring interval elapses, the processing request message is checked again in the server reception queue. If there is no message in the server reception queue, or if the message ID of the first processing request message to be processed next by the business application 21 is different from the message ID stored above, the processing request message is operating normally. Judge and continue the monitoring process.
[0052]
However, if the message ID is different from the stored message ID, it is determined that the business application is down without changing the business application status due to a failure or the like, and the business application status in the system is changed to “stopped”. Change to When the business application status becomes “stopped” due to the status change from the business application 21 or the status change by the business application status monitoring unit 26, the server reception queue status management unit 25 is instructed to report the status of the server reception queue. Further, when there are processing request messages in the server reception queue 20, these processing request messages are transferred to another server system 201.
[0053]
The transfer process of the business application state monitoring unit 26 is executed according to the flowchart 11401 shown in FIG. The business application state monitoring unit 26 creates a server load information transmission request message and transmits it to the server reception queue load information response unit 30 of the intra-server group load management device 301. At this time, the own server system ID is stored in the request source system ID field of the server load information transmission request message. When a server load information response message is received from the server reception queue load information response unit 30, the server load information response message is sequentially displayed from the first server system ID to the last server system ID in the server reception queue message number and business application status information. A transfer destination determination table 27 according to the transfer destination determination table format 2801 shown in FIG.
[0054]
The transfer destination determination table 27 has the same format as the transmission destination determination table 14 held by the client 101, and the update from the server load information response message can be performed in the same procedure as the transmission destination determination table 14 of the client 101.
[0055]
However, the transfer destination determination table 27 does not create a record of the own server system in advance so that the own server system is not selected as the transfer destination. Note that the method for holding the transfer destination determination table 27 is not defined. However, since the transfer destination determination table 27 is a table for managing temporary information at the time of processing request message transfer, it is preferably stored in a memory. When the update of the transfer destination determination table 27 is completed, it is checked here whether the business application 21 has been restarted. When the business application status is changed to “Starting”, that is, when it is restarted, the transfer processing is stopped because there is no need for transfer.
[0056]
When the business application status is “stopped”, the transfer destination server system having the smallest number of messages in the server reception queue is selected according to the flowchart 10501 in the same manner as the selection procedure of the transmission destination server system at the client. When the transfer destination server system cannot be selected, the process is repeated from the transmission of the server load information transmission request message. If the transfer destination server system can be selected, the processing request message is acquired from the server reception queue, the selected transfer destination server system ID is updated in the transmission destination server system ID field, and the processing request message is sent to the server message transmission unit 29. Notify and send instructions.
[0057]
When the return value of the server message sending unit 29 is successful, the number of server reception queue messages and the business application status assigned to the return value are updated to the record of the transfer destination server system ID in the transfer destination determination table 27. If the processing request message transmission failure is returned, the business application status of the record is changed to “Stopped”. Next, refer to the processing request message in the local server system again, and if there is a message, return to the business application status check process and the message in the local server reception queue disappears, or the status of the business application becomes “Starting” Repeat this until.
[0058]
The processing result message stored in the server transmission queue 23 is monitored by the server transmission queue monitoring unit 24. The server transmission queue monitoring unit 24 is executed according to the flowchart 11601 in FIG. When the processing result message is stored in the server transmission queue 23, the server transmission queue monitoring unit 24 takes it out and notifies the server message transmission unit 29 of the extracted processing result message.
[0059]
The server message transmission unit 29 transmits the processing result message from the server transmission queue monitoring unit 29 to the client 101 and transfers the processing request message from the business application state monitoring unit 26 to the server system 201. The server message transmission unit 29 is executed according to the flowchart 11001 shown in FIG.
[0060]
When the server message transmission unit 29 accepts the transmission instruction, the server message transmission unit 29 refers to the message type field of the notified message. If the message type is a processing result message, a message transmission message is first created. The identifier indicating the message transmission message is updated in the message type field. The request source system ID field updates its own server system ID. In the message field, the processing result message received from the server transmission queue monitoring unit 29 is updated. Next, referring to the request source client ID field of the processing result message, a message transmission message is transmitted to the message reception unit of the request source client 101. After that, it waits for a message transmission response message from the destination client 101 to return.
[0061]
Here, when the message transmission response message is not returned within the response timeout interval defined by the system, the processing request message is returned to the server transmission queue 24 and the transmission failure is returned.
[0062]
When a message transmission response message is returned from the destination client 101, the response result field of the message transmission response message is referred to. When the response result is successful, the transmission success is returned. If the response result is a transmission failure, a processing request message is returned to the server transmission queue 23, and the transmission failure is returned.
[0063]
If the message type is a processing request message, a message transmission message is first created. The identifier indicating the message transmission message is updated in the message type field. The request source system ID field updates its own server system ID. In the message field, the processing request message received from the business application state monitoring unit 26 is updated. Next, referring to the transmission destination server system ID field of the processing request message, a message transmission message is transmitted to the message receiving unit 28 of the transfer destination server system 201. Thereafter, it waits for a message transmission response message from the destination server system 201 to be returned.
[0064]
Here, if the message transmission response message is not returned within the response timeout interval defined by the system, it is determined that the transfer destination server system 201 is stopped, the processing request message is returned to the server reception queue 20, and the transmission fails. To return.
[0065]
When a message transmission response message is returned from the transfer destination server system 201, the response result field of the message transmission response message is referred to. When the response result is successful, the server reception queue message number field and the business application status field of the message transmission response message Assign a value to the return value and return successful transmission. If the response result is a transmission failure, a processing request message is returned to the server reception queue 20 and a transmission failure is returned.
[0066]
In the client 101, the client message receiving unit 19 receives a message transmission message transmitted from the server system 201. The client message receiving unit 19 executes in accordance with the flowchart 10701 shown in FIG. When the client message reception unit 19 receives a message transmission message from the server system 201, the client message reception unit 19 acquires a processing result message from the message field of the message transmission message and stores it in the client reception queue 15. Thereafter, a message transmission response message is created, the identifier of the message transmission message is updated in the message type field, and the transmission success is updated in the response result field. Then, a message transmission response message is transmitted to the server system 201 stored in the request source system ID field of the message transmission message.
[0067]
The client reception queue 15 of the client 101 is monitored by the client processing result message response unit 16. The client processing result message response unit 16 executes in accordance with the flowchart 10801 shown in FIG. When the processing result message is stored in the client reception queue 15, the client processing result message response unit 16 acquires the processing result message and notifies the client result display application 17 of the contents of the processing result field of the processing result message.
[0068]
The client result display application 17 is executed according to the flowchart 10901 shown in FIG. The client result display application 17 notifies the user of the processing result via an arbitrary user application such as a graphical user interface.
[0069]
By equalizing the business application load among the server systems in the server group, the system resources in the server group can be used efficiently, and a server with less business application execution waiting can be selected. Furthermore, even if a business application is abnormally stopped, the server processing request message can be prevented from staying by transferring it to another server system.
[0070]
【The invention's effect】
According to the present invention, it is possible to improve load imbalance between server systems.
[Brief description of the drawings]
FIG. 1 is a schematic configuration diagram of an embodiment of the present system.
FIG. 2 is a flowchart illustrating processing of a client processing request application according to the embodiment.
FIG. 3 is a flowchart illustrating processing of a client processing request message generation unit according to the embodiment.
FIG. 4 illustrates a client message transmission destination determination unit according to the embodiment.
It is a flowchart which shows the process of.
FIG. 5 is a flowchart illustrating a destination server system selection process of a client message destination determination unit and a transfer destination server system selection process of a business application status monitoring unit according to an embodiment of the present invention.
FIG. 6 is a flowchart illustrating processing of a client message transmission unit according to an embodiment of the present invention.
FIG. 7 is a flowchart illustrating processing of a client message receiving unit according to an embodiment of the present invention.
FIG. 8 is a flowchart illustrating processing of a client processing result message response unit according to the embodiment.
FIG. 9 is a flowchart illustrating processing of a client result display application according to the embodiment.
FIG. 10 is a flowchart illustrating processing of a server message receiving unit according to the embodiment of the present invention.
FIG. 11 is a flowchart illustrating processing of a server message receiving unit according to an embodiment of the present invention.
FIG. 12 is a flowchart illustrating processing of a server reception queue state management unit according to the embodiment of the present invention.
FIG. 13 is a flowchart illustrating monitoring processing of a business application state monitoring unit according to the embodiment.
FIG. 14 is a flowchart illustrating a transfer process of the business application state monitoring unit according to the embodiment.
FIG. 15 is a flowchart illustrating processing of the business application according to the embodiment.
FIG. 16 is a flowchart illustrating processing of a server transmission queue monitoring unit according to an embodiment of the present invention.
FIG. 17 is a flowchart illustrating processing of a server reception queue load state response unit according to the embodiment of the present invention.
FIG. 18 is a flowchart illustrating processing of a server reception queue load state update unit according to an embodiment of the present invention.
FIG. 19 is a format of a processing request message according to the embodiment.
FIG. 20 is a format of a processing result message according to the embodiment.
FIG. 21 is a format of a server reception queue status report message according to the embodiment.
FIG. 22 is a format of a server load information transmission request message according to the embodiment.
FIG. 23 is a format of a server load information response message according to the embodiment.
FIG. 24 is a format of a message transmission message according to the embodiment.
FIG. 25 is a format of a message transmission response message according to the embodiment.
FIG. 26 is a format of a server reception queue management table according to the embodiment.
FIG. 27 is a format of a transmission destination server determination table of the embodiment.
FIG. 28 is a format of a transfer destination server determination table of the embodiment.
[Explanation of symbols]
101 clients
201 server system
301 Server Group Load Management Device
401 Server group
10 Client processing request application
11 Client processing request message generator
12 Client receive queue
13 Client message destination determination unit
14 Destination server determination table
15 Client receive queue
16 Client processing result message response part
17 Client result display application
18 Client message transmitter
19 Client message receiver
20 Server receive queue
21 Business applications
22 Business database
23 Server transmission queue
25 Server transmission queue monitoring unit
25 Server reception queue status management section
26 Business Application Status Monitor
27 Transfer destination server determination table
28 Server message receiver
29 Server message transmitter
30 Server reception queue load status response section
31 Business application load status update section
32 Server reception queue management table