JP2010122773A - Distributed processing system, method of allocating processing, and information processing apparatus - Google Patents
Distributed processing system, method of allocating processing, and information processing apparatus Download PDFInfo
- Publication number
- JP2010122773A JP2010122773A JP2008293979A JP2008293979A JP2010122773A JP 2010122773 A JP2010122773 A JP 2010122773A JP 2008293979 A JP2008293979 A JP 2008293979A JP 2008293979 A JP2008293979 A JP 2008293979A JP 2010122773 A JP2010122773 A JP 2010122773A
- Authority
- JP
- Japan
- Prior art keywords
- processing
- unit
- information
- node
- master
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Computer And Data Communications (AREA)
Abstract
Description
本発明は、分散処理システム、処理割当方法、および情報処理装置に関し、特に互いにネットワーク接続された複数の情報処理装置を備え、それぞれの情報処理装置が互いに連携して動作する技術に関する。 The present invention relates to a distributed processing system, a processing allocation method, and an information processing apparatus, and more particularly to a technique that includes a plurality of information processing apparatuses connected to each other via a network and that each information processing apparatus operates in cooperation with each other.
近年、RFID(Radio Frequency IDentification)や温度センサ等の各種センサを、情報システムと容易に連携することが可能となり、各種センサを活用したシステムが利用されるようになってきた。通常、これらセンサを活用する情報システムでは、専用の小型計算機がセンサを制御してセンサからデータを取得し、データをサーバへ送信する構成をとる場合が多い。小型計算機から送信されたデータは、様々なアプリケーションから利用できる形でサーバ内に蓄積される。それぞれの小型計算機は、サーバの負荷を軽減するために、簡単なデータ加工(例えば、差分抽出や時間平均等)を行い、データ量を少なくしてからサーバへデータを送信する場合がある。 In recent years, various sensors such as RFID (Radio Frequency IDentification) and temperature sensors can be easily linked with an information system, and a system using various sensors has been used. In general, an information system using these sensors often has a configuration in which a dedicated small computer controls the sensor to acquire data from the sensor and transmits the data to a server. Data transmitted from a small computer is stored in the server in a form that can be used by various applications. In order to reduce the load on the server, each small computer may perform simple data processing (for example, differential extraction, time averaging, etc.) and reduce the amount of data before transmitting the data to the server.
1つの小型計算機では、その性能やセンサを接続するための接続インターフェイスの数等に限界があるため、大規模なシステムを構築する場合には、複数の小型計算機を利用する場合が多い。例えば、センサを制御する小型計算機と、センサが出力したデータを加工する小型計算機とを別々に用意しておき、小型計算機同士が連携する構成とする場合が多い。この場合、大規模なシステムでは、小型計算機の性能条件等を考慮した上で、どの小型計算機にどの役割(例えば、センサの制御やデータの加工)を実行させるか、どの小型計算機同士が連携するか等を決定する必要がある。上記した複数の小型計算機同士が連携して各種センサからデータを収集するシステムを、以後、ユビキタスフロントエンドシステムと呼ぶ。 One small computer has a limit in performance, the number of connection interfaces for connecting sensors, and the like. Therefore, when constructing a large-scale system, a plurality of small computers are often used. For example, it is often the case that a small computer that controls the sensor and a small computer that processes data output from the sensor are prepared separately, and the small computers cooperate with each other. In this case, in a large-scale system, taking into account the performance conditions of the small computers, which small computers are caused to perform which role (for example, sensor control and data processing) and which small computers cooperate It is necessary to decide. Hereinafter, a system in which a plurality of small computers cooperate to collect data from various sensors is referred to as a ubiquitous front-end system.
例えば特許文献1には、業務プログラム毎に、その業務プログラムの実行に必要なリソース(例えば、CPUやストレージ等)の量を管理しておき、別途管理しているシステムのリソース情報と付き合わせて、業務プログラムへのリソース割り当て量を決定する技術が開示されている。上記したユビキタスフロントエンドシステムに特許文献1の技術を適用すると、各小型計算機の役割を自動的に決定することができる。
For example, in
また、特許文献2には、サービス連携エンジンがサービス連携シナリオに記載された制御ロジックに基づき、利用すべきサービスコンポーネントを検索し、適切なサービスコンポーネントを順に呼び出す技術が開示されている。ユビキタスフロントエンドシステムに特許文献2の技術を適用すると、サービス間の連携方法を1つのサービス連携シナリオとして記述できるため、連携のための設定を各小型計算機に行う必要がなくなる。
特許文献1または2のようなシステムでは、システムを構成する計算機の1つが管理機能を有する計算機(管理計算機)となる。すなわち、特許文献1では業務プログラムへのリソースの割り当て量を決定する計算機が管理計算機となり、特許文献2では、サービス連携エンジンが動作する計算機が管理計算機となる。
In a system such as
また、小型計算機は、センサの近くに配置される場合が多い。そのため、通常の計算機と比較して過酷な環境(例えば、振動や埃が多い場所)で利用されることが多く、障害発生頻度が高い場合が多い。そのため、ユビキタスフロントエンドシステムでは、管理計算機に障害が発生した場合に、他の計算機が管理計算機となって処理を続けることができるようにするため、特定の小型計算機を固定的に管理計算機とするのではなく、複数の小型計算機の中から動的に管理計算機が選択される構成とすることが望ましい。 In addition, small computers are often placed near sensors. For this reason, it is often used in a harsh environment (for example, a place with a lot of vibration and dust) as compared with a normal computer, and the frequency of occurrence of failures is often high. Therefore, in the ubiquitous front-end system, when a failure occurs in the management computer, a specific small computer is fixedly used as the management computer so that other computers can continue processing as the management computer. Instead, it is desirable that the management computer is dynamically selected from a plurality of small computers.
例えば特許文献3には、複数の計算機から管理計算機を決定する技術として、リング型ネットワークにおいて、各ノード(計算機)が自身の優先度を隣接ノードに転送し、最終的に最も優先度が高いノードを管理計算機として決定する技術が開示されている。また、複数の小型計算機同士が連携して1つの管理計算機を決定することは、分散合意の一種と考えることができる。分散合意とは、各計算機が独立に動作するが、互いの情報をやり取りすることにより、最終的には全ての計算機が同一の結果に辿り着く技術である。
For example, in
非特許文献1には、分散合意アルゴリズムを使ったPAXOSというプロトコルが開示されている。PAXOSとは、計算機間で投票処理を行い、定足数(多くの場合過半数とする)以上の合意が得られれば、結果をすべての計算機に確定するプロトコルであり、全ての計算機から合意が得られなくても、定足数以上の合意が得られれば、結果を確定することができる。
Non-Patent
ところで、ユビキタスフロントエンドシステムでは、小型計算機上で稼動するあるプログラムが必要とするリソースの量は、そのプログラムの処理内容に加えて、そのプログラムと連携する他のプログラムの動作にも依存する。例えば、センサを制御するプログラム(制御プログラム)が取得したデータを、別のプログラム(加工プログラム)が加工する場合、加工プログラムのCPU負荷は加工処理の内容だけでなく、制御プログラムから受信するデータの量にも依存する。また、複数の制御プログラムが加工プログラムにデータを送信する構成とした場合、加工プログラムのCPU負荷は、制御プログラムの数にも依存する。 By the way, in the ubiquitous front-end system, the amount of resources required by a certain program running on a small computer depends on the operations of other programs linked with the program in addition to the processing contents of the program. For example, when another program (machining program) processes data acquired by a program (control program) for controlling the sensor, the CPU load of the machining program is not only the content of the machining process but also the data received from the control program. It depends on the amount. Further, when a plurality of control programs are configured to transmit data to the machining program, the CPU load of the machining program also depends on the number of control programs.
上記した特許文献1では、各プログラムが必要とするリソースの量は、各プログラム個別の属性として管理されているため、プログラム間の連携が考慮されておらず、各プログラムは割り当てられたリソースで他のプログラムと連携して適切に動作することができない場合がある。また、特許文献2では、各サービスコンポーネントが作業を終了するたびに、その時点での変数等のデータを全てサービス連携エンジンが取得して次の各サービスコンポーネントに渡すため、サービス連携エンジンは、全てのサービスコンポーネントの動作に関与しなければならず、サービス連携エンジンに負荷が集中する場合がある。従って、CPUの性能やメモリ容量等が限られた小型計算機上で、サービス連携エンジンを動作させることができない場合がある。
In the above-described
また、システムの規模が大きくなると、それぞれの小型計算機が異なるネットワークに配置される場合がある。また、ネットワークがリング型でなくバス型のLANに上記の特許文献3の技術を用いるとすれば、ブロードキャストパケットを用いることになる。しかし、ネットワークの境界にあるルータ等の通信機器に所定のブロードキャストパケットを通過させる等の設定を行う必要があり、設定作業が煩雑になる。
Further, when the scale of the system increases, each small computer may be arranged in a different network. Further, if the technique of
また、PAXOSは、全体の過半数の合意が得られれば結果を確定することが可能であるが、過半数であるかどうかを決定するためには、全体のノード数が予め分かっている必要がある。管理者が全てのノード数を把握して設定することも考えられるが、システムの規模が大きくなったり、ノードが故障して機能しなくなったり、ノードが新たに追加されたりした場合、ノード数をその都度全て把握することは難しい。そこで、それぞれのノードが他のノードに自ノードの情報を発信させることで、自動的にシステム全体のノード数を測定することも考えられる。 In addition, PAXOS can determine the result if a majority agreement is obtained, but the total number of nodes needs to be known in advance in order to determine whether it is a majority. It is possible that the administrator knows and sets the number of all nodes, but if the system scales up, a node fails and fails, or a new node is added, the number of nodes It is difficult to grasp everything each time. Therefore, it is conceivable that each node automatically measures the number of nodes in the entire system by transmitting information on the own node to other nodes.
しかし、システムの規模異が大きくなり、ノードが異なるネットワークに存在する場合には、ブロードキャストだけでなくユニキャストによる通信も行う必要があることから、それぞれのノードが全てのノードの情報を受信するには長い時間がかかる場合がある。そのため、システムはPAXOSによる分散合意を開始するまでに長時間待機しなければならない場合があった。 However, when the scale of the system increases and the nodes exist in different networks, it is necessary to perform not only broadcast but also unicast communication, so each node receives information on all nodes. May take a long time. Therefore, the system sometimes has to wait for a long time before starting the distributed agreement by PAXOS.
本発明は上記事情を鑑みてなされたものであり、本発明の目的は、特定の計算機に負荷が集中することなく、処理間の連携を考慮して複数の計算機に処理を割り当てることにある。また、本発明の目的は、分散合意をより迅速に開始することができるようにすることにある。 The present invention has been made in view of the above circumstances, and an object of the present invention is to assign processes to a plurality of computers in consideration of cooperation between processes without a load being concentrated on a specific computer. It is also an object of the present invention to allow a distributed agreement to be initiated more quickly.
上記課題を解決するために本発明は、複数の情報処理装置を有する分散処理システムにおいて、マスタとなる情報処理装置が、情報処理装置に割り当てる処理の単位である処理単位毎に、当該処理単位が処理するデータを提供する処理単位、および、当該処理単位に必要な処理能力を定義する処理定義を参照して、マスタ以外の情報処理装置に対して、それぞれの情報処理装置が有するリソースの処理能力の範囲内で、データの供給元の処理単位と当該データを処理する処理単位とを同一の情報処理装置に割り当てる。 In order to solve the above-described problems, the present invention provides a distributed processing system having a plurality of information processing devices. For each processing unit that is a unit of processing that is assigned to an information processing device by a master information processing device, the processing unit is With reference to the processing unit that provides the data to be processed and the processing definition that defines the processing capability required for the processing unit, the processing capability of the resources that each information processing device has for information processing devices other than the master In this range, the processing unit of the data supply source and the processing unit for processing the data are allocated to the same information processing apparatus.
例えば、本発明の第一の態様は、互いにネットワーク接続された複数の情報処理装置を備え、それぞれの情報処理装置が互いに連携して動作する分散処理システムであって、それぞれの情報処理装置は、それぞれの情報処理装置を識別するノードIDに対応付けて、当該情報処理装置が有するリソースの情報を格納するリソース情報格納部と、情報処理装置に割り当てる処理の単位である処理単位を識別する処理ID毎に、当該処理単位が処理するデータを提供する処理単位の処理ID、および、当該処理単位に必要な処理能力を定義する処理定義を格納する処理定義格納部と、分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定するマスタ決定部と、自装置がマスタとなった場合に、自装置以外のそれぞれの情報処理装置について、前記リソース情報格納部および前記処理定義格納部を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信する処理割当部とを有することを特徴とする分散処理システムを提供する。 For example, a first aspect of the present invention is a distributed processing system that includes a plurality of information processing apparatuses connected to each other via a network, and each information processing apparatus operates in cooperation with each other. In association with the node ID for identifying each information processing apparatus, a resource information storage unit that stores information on resources possessed by the information processing apparatus, and a process ID that identifies a processing unit that is a unit of processing allocated to the information processing apparatus For each processing unit, a processing ID that provides data to be processed by the processing unit, a processing definition storage unit that stores a processing definition that defines processing capability required for the processing unit, and a distributed agreement algorithm are used. A master determination unit that determines a master among the information processing apparatuses, and each information processing apparatus other than the own apparatus when the own apparatus becomes the master With respect to the resource information storage unit and the process definition storage unit, each of the information processing devices other than its own device processes data within the range of the resource processing capability of the information processing device. A distributed processing system comprising: a processing allocation unit that allocates a unit and a processing unit of a provider of the data to the same information processing apparatus and transmits an allocation result to each information processing apparatus via a network provide.
また、本発明の第二の態様は、互いにネットワーク接続されたそれぞれの情報処理装置が互いに連携して動作する分散処理システムにおける処理割当方法であって、それぞれの情報処理装置が、分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定するマスタ決定ステップと、自装置がマスタとなった場合に、自装置以外のそれぞれの情報処理装置について、それぞれの情報処理装置を識別するノードIDに対応付けて、当該情報処理装置が有するリソースの情報を格納するリソース情報格納部、ならびに、情報処理装置に割り当てる処理の単位である処理単位を識別する処理ID毎に、当該処理単位が処理するデータを提供する処理単位の処理ID、および、当該処理単位に必要な処理能力を定義する処理定義を格納する処理定義格納部を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信する処理割当ステップとを実行することを特徴とする処理割当方法を提供する。 A second aspect of the present invention is a processing allocation method in a distributed processing system in which information processing apparatuses connected to each other in a network operate in cooperation with each other, and each information processing apparatus uses a distributed agreement algorithm. A master determination step of determining a master among a plurality of information processing devices, and a node ID for identifying each information processing device for each information processing device other than the own device when the own device becomes a master. Correspondingly, a resource information storage unit that stores information on resources of the information processing apparatus, and data processed by the processing unit for each processing ID that identifies a processing unit that is a unit of processing assigned to the information processing apparatus The process ID that stores the process ID and the process definition that defines the processing capacity required for the process unit With reference to the definition storage unit, for each information processing device other than its own device, the processing unit for processing the data and the processing unit of the data providing source within the range of the resource processing capability of the information processing device Are allocated to the same information processing apparatus, and a process allocation step is performed for transmitting the allocation result to each information processing apparatus via a network.
また、本発明の第三の態様は、互いにネットワーク接続されたそれぞれの情報処理装置が互いに連携して動作する分散処理システムに用いられる情報処理装置であって、それぞれの情報処理装置を識別するノードIDに対応付けて、当該情報処理装置が有するリソースの情報を格納するリソース情報格納部と、情報処理装置に割り当てる処理の単位である処理単位を識別する処理ID毎に、当該処理単位が処理するデータを提供する処理単位の処理ID、および、当該処理単位に必要な処理能力を定義する処理定義を格納する処理定義格納部と、分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定するマスタ決定部と、自装置がマスタとなった場合に、自装置以外のそれぞれの情報処理装置について、前記リソース情報格納部および前記処理定義格納部を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信する処理割当部とを備えることを特徴とする情報処理装置を提供する。 According to a third aspect of the present invention, there is provided an information processing apparatus used in a distributed processing system in which information processing apparatuses connected to each other in a network operate in cooperation with each other, and a node for identifying each information processing apparatus The processing unit processes the resource information storage unit that stores information of the resource of the information processing apparatus in association with the ID, and the processing ID that identifies the processing unit that is the processing unit to be allocated to the information processing apparatus. Master ID is determined among multiple information processing devices using the processing definition storage unit that stores the processing ID of the processing unit that provides the data, the processing definition that defines the processing capacity required for the processing unit, and the distributed agreement algorithm The resource information storage for each information processing device other than the own device when the own device becomes the master And the processing definition storage unit, and for each information processing apparatus other than its own apparatus, a processing unit for processing data and a provider of the data within the range of the resource processing capability of the information processing apparatus The information processing apparatus is provided with a processing allocation unit that allocates the processing unit to the same information processing apparatus and transmits the allocation result to each information processing apparatus via the network.
また、本発明の第四の態様は、互いにネットワーク接続されたそれぞれの情報処理装置が互いに連携して動作する分散処理システムに用いられる情報処理装置における処理割当方法であって、情報処理装置が、分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定するマスタ決定ステップと、自装置がマスタとなった場合に、自装置以外のそれぞれの情報処理装置について、それぞれの情報処理装置を識別するノードIDに対応付けて、当該情報処理装置が有するリソースの情報を格納するリソース情報格納部、ならびに、処理単位を識別する処理ID毎に、当該処理単位が処理するデータを提供する処理単位の処理ID、および、当該処理単位に必要な処理能力を定義する処理定義を格納する処理定義格納部を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信する処理割当ステップとを実行することを特徴とする処理割当方法を提供する。 According to a fourth aspect of the present invention, there is provided a process allocation method in an information processing apparatus used in a distributed processing system in which information processing apparatuses connected to each other in a network operate in cooperation with each other. A master determination step for determining a master among a plurality of information processing devices using a distributed agreement algorithm, and identifying each information processing device for each information processing device other than the own device when the own device becomes the master A resource information storage unit that stores information about resources of the information processing apparatus in association with the node ID to be processed, and a processing unit that provides data to be processed by the processing unit for each processing ID that identifies the processing unit. Refer to the process definition storage unit that stores the process ID and the process definition that defines the processing capacity required for the processing unit. For each information processing apparatus other than the above, the processing unit for processing the data and the processing unit of the data providing source are allocated to the same information processing apparatus within the range of the processing capability of the resource of the information processing apparatus And a process allocation step of transmitting an allocation result to each information processing apparatus via a network.
また、本発明の第五の態様は、互いにネットワーク接続されたそれぞれの情報処理装置が互いに連携して動作する分散処理システムであって、それぞれの情報処理装置は、他の情報処理装置の識別情報を格納する識別情報格納部と、自装置が起動した場合に、他の情報処理装置に自装置の識別情報を通知する識別情報通知部と、他の情報処理装置から受信した識別情報を前記識別情報格納部に格納する識別情報登録部と、自装置が起動してからの前記識別情報格納部内の識別情報の登録数の増加率を算出し、当該増加率が上昇から下降に転じた後に、当該増加率が、当該増加率の最大値から予め定められた割合だけ低い増加率となった場合に、その時点で前記識別情報格納部に格納されている識別情報の数を、分散合意アルゴリズムにおける定足数として、分間合意アルゴリズムを用いた処理を開始する分散合意処理部とを備えることを特徴とする分散処理システムを提供する。 According to a fifth aspect of the present invention, there is provided a distributed processing system in which information processing devices connected to each other in a network operate in cooperation with each other, and each information processing device has identification information of another information processing device. The identification information storage unit for storing the identification information, the identification information notification unit for notifying the other information processing device of the identification information of the own device when the own device is activated, and the identification information received from the other information processing device. After calculating the identification information registration unit to be stored in the information storage unit and the increase rate of the number of registrations of identification information in the identification information storage unit after the own device is activated, When the increase rate is an increase rate that is lower than the maximum value of the increase rate by a predetermined rate, the number of pieces of identification information stored in the identification information storage unit at that time is determined in the distributed agreement algorithm. As foot number, to provide a distributed processing system characterized in that it comprises a distributed agreement process section to start processing using the min agreement algorithm.
本発明によれば、特定の計算機に負荷が集中することなく、処理間の連携を考慮して複数の情報処理装置に処理を割り当てることができる。また、本発明によれば、分散合意をより迅速に開始することができる。 According to the present invention, it is possible to assign a process to a plurality of information processing apparatuses in consideration of cooperation between processes without concentrating the load on a specific computer. Further, according to the present invention, the distributed agreement can be started more quickly.
まず、本発明の第1の実施形態について説明する。 First, a first embodiment of the present invention will be described.
図1は、本発明の第1実施形態に係る分散処理システム10の一例を示すシステム構成図である。分散処理システム10は、ユビキタスフロントエンドシステムの一例であり、複数の情報処理装置20(以下ノード20と呼ぶ)および複数のセンサ14を備える。
FIG. 1 is a system configuration diagram showing an example of a distributed
それぞれのノード20は計算機用LAN12およびセンサ用LAN13に接続されている。それぞれのノード20は、計算機用LAN12を介して、他のノード20や、計算機用LAN12に接続されているコンソール11と通信する。また、それぞれのノード20は、センサ用LAN13を介してそれぞれのセンサ14を制御する。それぞれのセンサ14にはアドレス(例えばIPアドレス)が割り当てられており、それぞれのノード20は、センサ用LAN13を介して、それぞれのセンサ14にアクセスすることができる。
Each
本実施形態において、分散処理システム10は、ノード20−0〜ノード20−3を有する。また、ノード20−3には、センサ用LAN13を介さずにRFIDのリーダライタ(R/W)であるセンサ14cおよび14dが接続されている。また、ノード20−1にはアンテナ15−1が接続されており、ノード20−2にはアンテナ15−2が接続されている。
In the present embodiment, the distributed
コンソール11は、各ノード20から構成されるユビキタスフロントエンドシステムとユーザ間の情報伝達を行うための端末であり、分散処理システム10の管理者等によって操作される。コンソール11は、例えば通信機能を有する汎用のコンピュータであり、ディスプレイ、キーボード、およびマウス等の入出力装置が接続されている。分散処理システム10の管理者は、これらの入出力装置を操作して分散処理システム10へ指示を出したり、稼働状況を確認したりする。
The
図2は、コンソール11の動作の一例を示すフローチャートである。例えば電源が投入される等の所定のタイミングで、コンソール11は、本フローチャートに示す動作を開始する。
FIG. 2 is a flowchart showing an example of the operation of the
まず、コンソール11は、分散処理システム10の管理者等のユーザから処理定義を入力されたか否かを判定する(S100)。処理定義の詳細な内容については後述する。処理定義がユーザから入力された場合(S100:Yes)、コンソール11は、複数のノード20の中でマスタとなるノード20のアドレスを要求するマスタ情報要求を、計算機用LAN12を介して全てのノード20に、例えばブロードキャストによって送信する(S101)。
First, the
次に、コンソール11は、計算機用LAN12を介してマスタとなるノード20のアドレスを受信したか否かを判定する(S102)。マスタとなるノード20のアドレスを受信した場合(S102:Yes)、コンソール11は、当該ノード20へユーザから入力された処理定義を送信し(S103)、再びステップS100に示した処理を実行する。一方、マスタとなるノード20のアドレスを受信しなかった場合(S102:No)、コンソール11は、所定時間(例えば10秒間)待機して再びステップS101に示した処理を実行する。
Next, the
また、ステップS100において、処理定義がユーザから入力されていない場合(S100:No)、コンソール11は、ユーザからマスタの再選出を指示されたか否かを判定する(S105)。マスタの再選出を指示されていない場合(S105:No)、コンソール11は、再びステップS100に示した処理を実行する。
In step S100, when the process definition is not input from the user (S100: No), the
一方、マスタの再選出を指示された場合(S105:Yes)、コンソール11は、マスタ情報要求を計算機用LAN12を介して全てのノード20に、例えばブロードキャストによって送信する(S106)。そして、コンソール11は、マスタのノード20にマスタの再選出を指示するメッセージを送信し(S107)、再びステップS100に示した処理を実行する。
On the other hand, when a master re-election is instructed (S105: Yes), the
次に、それぞれのノード20の構成について説明する。図3は、第1の実施形態におけるそれぞれのノード20のハードウェア構成の一例を示す。ノード20は、RAM(Random Access Memory)200、ROM(Read Only Memory)201、CPU(Central Processing Unit)202、LANインターフェイス(I/F)205、LANインターフェイス(I/F)206、およびメディアインターフェイス(I/F)207を備える。また、複数のノード20の中には、入出力インターフェイス(I/F)203、無線インターフェイス(I/F)204、およびセンサインターフェイス(I/F)208の少なくともいずれかを含むものがある。
Next, the configuration of each
RAM200は、実行中のプログラムやプログラムが取り扱うデータを一時的に保存する。ROM201には、初期起動用のプログラムが格納されている。CPU202は、ROM201または記録媒体213から読み出されてRAM200に展開されたプログラム等を実行する。CPU202は、ノード20の電源が投入されると、ROM201からプログラムを読み出してRAM200に展開して実行する。メディアインターフェイス207は、コンパクトフラッシュ(登録商標)メモリカード等の記録媒体213を取り付けるためのインターフェイスである。当該記録媒体213には、各種プログラムやデータが格納され、メディアインターフェイス207は、CPU202からの指示に応じて、これらを記録媒体213から読み出してRAM200上に展開する。
The
LANインターフェイス205およびLANインターフェイス206は、一般的なイーサネット(登録商標)規格のネットワークインターフェイスである。各ノード20は2つのLANインターフェイスを備える。センサインターフェイス208は、例えばRS-232C規格等のシリアル通信インターフェイスであり、ノード20に接続されているセンサ14を制御するときに利用される。無線インターフェイス204はモバイル通信カード等の通信インターフェイスであり、分散処理システム10内のいずれかのノード20が収集したデータをデータ収集サーバ(図示せず)に送信するときに利用される。ノード20を設置する現場では、有線ネットワークのインフラが整備されていない場合が多く、このような場合に本実施形態ではモバイル通信カードを利用してデータ収集サーバへデータを送信する。
The
入出力インターフェイス203、無線インターフェイス204、およびセンサインターフェイス208は、分散処理システム10内の全てのノード20に設けられている必要はない。すなわち、センサインターフェイス208は、センサ用LAN13を介さずにセンサ14を接続するノード20(図1の例ではノード20−3)が備えていればよい。また、無線インターフェイス204は、データ収集サーバと通信するノード20(図1の例ではノード20−1およびノード20−2)が備えていればよい。
The input /
次に、それぞれのノード20の機能構成を説明する。図4は、第1の実施形態におけるそれぞれのノード20の機能構成の一例を示すブロック図である。ノード20は、リソース情報送信部21、リソース情報登録部22、履歴情報格納部23、履歴情報管理部24、マスタ決定部25、処理割当部26、リソース情報格納部27、スレーブ処理部28、およびセンシングアプリケーション実行部29を備える。これらの機能を実現するプログラムは図3に示した記録媒体213に格納されており、CPU202は、これらのプログラムをメディアインターフェイス207を介して記録媒体213から読み出してRAM200に展開して実行する。
Next, the functional configuration of each
センシングアプリケーション実行部29は、ディスパッチャ290、フィルタ291、駆動制御292、およびアダプタ293を有する。アダプタ293は、センサ14間のインターフェイスの違いを吸収し、様々なセンサ14を同一インターフェイスから利用できるようにする。駆動制御292は、センサ14からデータを取得するタイミングを制御する。フィルタ291は、アダプタ293がセンサ14から取得したデータを加工する。ディスパッチャ290は、アダプタ293がセンサ14から取得したデータまたはフィルタ291が加工したデータを、予め定められた通信プロトコルでデータ収集サーバへ送信する。
The sensing
センシングアプリケーション実行部29の動作を纏めると例えば以下のようになる。駆動制御292が駆動指示をアダプタ293へ送信すると、アダプタ293はセンサ14を制御してセンサ14からデータを取得し、取得したデータを駆動制御292に返信する。駆動制御292は、受信したデータをフィルタ291へ送信し、フィルタ291はデータ加工を行った後、加工したデータをディスパッチャ290に渡す。最後にディスパッチャ290は、受け取ったデータをデータ収集サーバへ送信する。
The operation of the sensing
このようにセンシングアプリケーション実行部29内の各機能ブロックは連携動作するが、機能ブロック間の連携は1つのノード20内で閉じるわけではなく、異なるノード20の機能ブロック同士が連携する場合もある。例えば、アダプタ293、駆動制御292、フィルタ291、およびディスパッチャ290が全て異なるノード20上で動作し、相互に連携することも可能であるし、あるノード20上で動作する駆動制御292が、それぞれのノード20上で動作するアダプタ293に対して、計算機用LAN12を介して順にデータ取得指示を送信することも可能である。
As described above, the functional blocks in the sensing
リソース情報格納部27には、例えば図5に示すようなリソース情報管理テーブル270が格納されている。リソース情報管理テーブル270には、複数のレコード276が格納されており、それぞれのレコード276には、それぞれのノード20を識別するノードID271、当該ノード20のアドレス272(本実施形態ではIPアドレス)、当該レコード276が新たに登録されたあるいは更新された時刻を示す受信時刻273、当該ノード20のリソース情報274、および当該ノード20の製造年月日275が格納される。リソース情報274には、それぞれのリソースを識別する識別子(図5の例では、「Communicate」、「Cpu」、「Sensor」等)毎に、当該識別子によって特定されるリソースの詳細な情報が格納される。なお、リソース情報管理テーブル270には、自ノード20のリソース情報が予め格納されている。また、自ノード20に関しては、受信時刻273にはデータが登録されない。
In the resource
例えば、図5に示した270には、ノードID271が「001」であるノード20は、リソースとして通信手段(「Communicate」に対応)とCpuとを提供し、通信手段の性能は「80kbps」であり、Cpuの性能は「200mips(million instructions per second)」であることが記載されている。また、当該リソース情報管理テーブル270には、上記通信手段はデバイス識別子(devId)で識別され、当該通信手段のデバイス識別子の値が「card001」であることが記載されている。また、ノードID271が「003」であるノード20には、シリアル(RS-232C)で制御するRFIDデバイスのセンサ14が2個接続されており、各RFIDデバイスの識別子(devId)の値と各デバイスにアクセスするときに使用するシリアルポート名(serial)とが記載されている。
For example, in 270 shown in FIG. 5, the
履歴情報格納部23には、例えば図6に示すように、それぞれの履歴情報を識別する履歴番号230に対応付けて、当該履歴情報の内容231が格納される。図6の例では、履歴番号230が「013」および「014」のエントリがマスタノード情報であり、マスタノードのノードIDとリース期間とが含まれる。他のノード20との間でマスタのノード20が決まった場合に、マスタノードのノードIDとリース期間とが履歴として履歴情報格納部23に格納される。図6に示した例において、履歴番号230が「013」のエントリでは、マスタノードのノードIDが「000」であり、リース期間が「10時5分0秒まで」となっている。
For example, as shown in FIG. 6, the history
また、コンソール11や他のノード20から送信された処理定義も履歴情報として履歴情報格納部23に格納される。図6に示した例において、履歴番号230が「015のエントリが処理定義である。処理定義は、図7に示す処理定義テンプレートと、図8および図9に示す処理定義本体とを含む。処理定義テンプレートは、処理定義本体に記載する内容のうち、カスタマイズされることがない項目、もしくはカスタマイズされる頻度が少ない項目を分離して記載したものである。つまり、処理定義テンプレートとは、処理定義本体に繰り返し記載する必要がある項目のデフォルト値を別にまとめたものである。全ての項目を処理定義本体に記載すれば、処理定義を分離する必要はないが、分離することで処理定義の作成作業を効率的に行うことができる。処理定義に記載されている内容の詳細については後述する。
Further, the process definition transmitted from the
リソース情報送信部21は、自ノード20のノードID、自ノード20のアドレス、自ノード20のリソース情報、および自ノード20の製造年月日をリソース情報格納部27内のリソース情報管理テーブル270から読み出して、計算機用LAN12を介して他のノード20へ例えばブロードキャストにより送信する。なお、IP(Internet Protocol)が用いられる場合、リソース情報送信部21が送信するブロードキャストパケットのパケットヘッダには、自ノード20のIPアドレスが記録されるので、リソース情報送信部21が明示的にブロードキャストパケットのメッセージに上記アドレスを記録する必要はない。
The resource
リソース情報登録部22は、計算機用LAN12を介して他のノード20からノードID、アドレス、リソース情報、および製造年月日を受信した場合に、リソース情報格納部27内のリソース情報管理テーブル270を参照し、当該ノードIDがリソース情報管理テーブル270内に登録されていないならば、受信したこれらの情報と共に受信時刻をリソース情報管理テーブル270に新規に登録する。また、受信したノードIDがリソース情報管理テーブル270内に既に登録されているならば、リソース情報登録部22は、受信したこれらの情報でリソース情報管理テーブル270内の情報を上書きすると共に、受信時刻を更新する。また、リソース情報登録部22は、リソース情報管理テーブル270内の受信時刻を監視し、受信時刻から予め定められた時間(例えば40秒)が経過したエントリをリソース情報管理テーブル270から削除する。
When the resource
マスタ決定部25は、分散合意により分散処理システム10内の複数のノード20間でマスタノードを決定する処理を実行する。マスタ決定部25は、履歴情報管理部24またはスレーブ処理部28からマスタノードの決定を指示された場合に、例えばPAXOSプロトコルを用いてマスタノードを選出する。PAXOSプロトコルを用いてマスタノードを選出する過程を説明するためのシーケンスを図10に示す。PAXOSプロトコルは、1つの投票開催者と複数の投票参加者間の通信プロトコルである。図10ではノード20−0が投票開催者であり、ノード20−1〜3が投票参加者となるケースを例として示している。
The
各投票は、決定する事項に対する番号(前述の履歴番号に等しい)と各投票に対する番号とを使用して管理される。本実施形態では、決定する事項に対する番号を事項番号(図10ではDと記載)と呼び、各投票に対する番号を投票番号(図10ではbと記載)と呼ぶ。各ノード20のマスタ決定部25は、PAXOSプロトコル処理のために、Q、D、lastTried、nextBallot、lastVoteBallot、lastVoteDecreeという変数を内部に保持する。Qは定足数を意味し、ある事項に関して定足数以上の合意が得られれば、その事項が決定される。本実施形態において定足数は全参加者の過半数とする。Dは投票によって決定する事項の事項番号である。lastTriedは開催中の投票番号である。nextBallotは投票参加者が参加中の投票の投票番号である。lastVoteBallotは投票参加者が最後に投票した投票の投票番号である。lastVoteDecreeは投票参加者が最後に投票した投票の事項の内容である。
Each vote is managed using a number for the item to be determined (equal to the history number described above) and a number for each vote. In the present embodiment, a number for an item to be determined is referred to as an item number (denoted as D in FIG. 10), and a number for each vote is referred to as a voting number (denoted as b in FIG. 10). The
まず、新規に提案を行おうとするノード20−0のマスタ決定部25は、これから開催する投票の投票番号をnextBallotよりも大きな値になるように決め、lastTriedとnextBallotに保存する。ここでは、投票開催者は自身が開催する投票に対して投票参加者を兼ねるため、nextBallotにも投票番号を保存している。そして、マスタ決定部25は、これから決定する事項の事項番号Dと、上記投票番号(図10ではbと記載)とを有するPrepareメッセージを作成し、ノード20−1〜3へ送信し、これから投票を開始する旨を通知する(S200)。PAXOSプロトコルでは、投票番号は投票毎に一意となる必要があるが、実際には任意のノードが投票開催者になる可能性があるため、異なるノード20が開催した投票の投票番号が重複することを避ける必要がある。本実施形態では、投票番号にノードIDを含めることで、投票番号の重複を防いでいる。
First, the
次に、Pepareメッセージを受信したノード20−1〜3のマスタ決定部25は、自ノード20が保持するnextBallotと受信したPrepareメッセージに含まれる投票番号bとを比較し、nextBallotが当該投票番号bよりも小さければ、nextBallotの値をbに変更し、その投票への参加表明としてPromiseメッセージを送信する(S201)。マスタ決定部25は、Prepareメッセージに含まれる事項番号Dに関して、以前に投票したことがあれば、以前の投票の情報(投票番号と事項内容と)をPromiseメッセージに含めて送信する。以前の投票の情報は、変数lastVoteBallotおよびlastVoteDecreeに保持されているので、これを利用する。
Next, the
次に、ノード20−0のマスタ決定部25は、定足数(Q−1)以上のノードからPromiseメッセージを受信した場合に、受信したPromiseメッセージに含まれるlastVoteBallot、lastVoteDecreeをチェックし、その中から最も値が大きいlastVoteBallotに対応するlastVoteDecreeを、次の投票の提案内容とする(S202)。事項番号Dに関して、今回が最初の投票である場合、どのノード20からもlastVoteDecreeは送信されない。このような場合、ノード20−0は、自身で決定した自提案を次の投票の提案内容とする。本実施形態において、マスタ決定部25は、リソース情報格納部27を参照して、製造年月日が最も新しいノード20をマスタノードとして推薦する旨を自案として作成する。
Next, when the
次に、ノード20−0のマスタ決定部25は、事項番号D、変数lastTried、およびステップS202において決定した提案内容を含むAcceptメッセージを生成し、作成したAcceptメッセージをステップS201においてPromiseメッセージを送信したノード20へ送信することで投票を開始する(S203)。図10では、Accesptメッセージに含まれる投票番号をbと記載しているが、これは上記変数lastTriedに等しい。また、図10では、Acceptメッセージ含まれる提案内容を「Decree」と記載している。
Next, the
次に、Acceptメッセージを受信したノード20−1〜3のマスタ決定部25は、Acceptメッセージに含まれる投票番号bとnextBallotとを比較し、bがnextBallotに一致した場合に、その提案に投票する(S204)。具体的には、Acceptメッセージに含まれる投票番号bをlastVoteBallotに、Acceptメッセージに含まれる提案内容DecreeをlastVoteDecreeに保存し、投票したことを示すためにAcceptedメッセージをノード20−0へ送信する。
Next, the
次に、ノード20−0のマスタ決定部25は、定足数(Q−1)以上のノード20からAcceptedメッセージを受信したら、事項が決定したことを示すために、事項番号Dと提案内容を含むCommitメッセージを作成し、全てのノードにCommitメッセージを送信する(S205)。この場合、Acceptedメッセージを送信しなかったノード20に対しても、Commitメッセージが送信されることになる。
Next, when the
次に、ノード20−0のマスタ決定部25は、Commitメッセージを送信した場合に、事項番号Dを履歴番号として履歴情報格納部23内の履歴番号230(図6参照)に格納し、提案内容を履歴情報格納部23内の内容231に格納し、事項番号Dをインクリメントする。Commitメッセージを受信したノード20−1〜3のマスタ決定部25も同様に、Commitメッセージに含まれる事項番号Dと提案内容Decreeとを履歴情報格納部23に格納し、事項番号Dをインクリメントする。そして、ノード20−0〜3のマスタ決定部25は、lastVoteBallotとlastVoteDecreeとを初期化する(S206)。
Next, when transmitting the Commit message, the
上記ステップS200において、ノード20−0のマスタ決定部25が、以前に少なくとも1回Prepareメッセージを送信したことがあり、lastTriedとnextBallotの値が等しい場合、ステップS200およびS201を省略してステップS203から実行されてもよい。このとき、投票番号は以前の番号(すなわちlastTriedもしくはnextBallot)をそのまま利用され、自提案が提案内容となる。
In step S200, if the
実際には、複数のノードが同時に投票を開催する場合があるため、PAXOSプロトコルでは、S200〜S201の準備段階と、S203〜S204の投票段階の2段階を踏むことで衝突検出を行い、衝突が発生した投票が無効となるようにしている。例えば、S200でノード20−1が、ノード20−0からPrepareを受信した後であり、かつ、Acceptを受信する前に、他のノード20からより大きな投票番号を持つPrepareメッセージを受信した場合は、ノード20−1は後から受信したPrepareメッセージ対してPromiseメッセージを返信する。以後、ノード20−1はノード20−0が開催する投票には参加しない。
Actually, since a plurality of nodes may hold voting at the same time, the PAXOS protocol performs collision detection by taking two stages, the preparation stage of S200 to S201 and the voting stage of S203 to S204. The generated voting is invalidated. For example, when the node 20-1 receives the Prepare message from the
履歴情報格納部23に登録される内容231にはリース期間が含まれる。マスタノードはリース期間が経過する前に、リース期間を更新したマスタノード情報を上記PAXOSプロトコルによって全ノード20へ送信し、後述する履歴情報管理部24が、更新されたマスタノードを履歴情報格納部23内に追記する。いったんマスタノードが決定した場合は、リース期間が切れるか、もしくはマスタノードに障害が発生するまで、マスタノード以外のノード20はPAXOSの投票開催者にはならない。これによって、スムーズにリース期間の更新が行われるようになっている。
The
マスタ決定部25は、決定したマスタノードが自ノード20である場合に、履歴情報格納部23に格納されている処理定義に基づいてそれぞれのノード20への処理の割当を処理割当部26に指示する。また、マスタ決定部25は、コンソール11からマスタノードの再選出を指示された場合に、PAXOSプロトコルを用いてマスタを再度決定し直す。また、自ノード20がマスタとならなかった場合、マスタ決定部25は、マスタノードのノードIDをスレーブ処理部28に通知する。
When the determined master node is the
履歴情報管理部24は、自ノード20の起動後に、リソース情報格納部27のリソース情報管理テーブル270内に登録されているノード20の数を監視し、リソース情報管理テーブル270内に登録されているノード20の数が全ノード20の数の半数以上となった場合に、他のノード20へ履歴情報を要求するメッセージを、例えばブロードキャストにより計算機用LAN12を介して送信し、他のノード20から履歴情報を受信して履歴情報格納部23に格納する。そして、履歴情報管理部24は、履歴情報格納部23を参照し、リース期限内のマスタノード情報が存在するか否かを判定する。リース期限内のマスタノード情報が履歴情報格納部23内に存在する場合、履歴情報管理部24は、マスタノードのノードIDをスレーブ処理部28に通知する。リース期限内のマスタノード情報が履歴情報格納部23内に存在しない場合、履歴情報管理部24は、マスタノードの選出をマスタ決定部25に指示する。なお、全てのノード20の履歴情報管理部24には、分散処理システム10内のノード20の数が管理者等によって予め設定されている。
The history
また、他のノード20から履歴情報を要求するメッセージを受信した場合、履歴情報管理部24は、履歴情報格納部23内の履歴を返す。また、履歴情報管理部24は、コンソール11からマスタノードのアドレスを要求された場合に、履歴情報格納部23およびリソース情報格納部27を参照して、自ノード20がマスタノードならば、自ノード20のアドレスをコンソール11へ送信する。また、履歴情報管理部24は、自ノード20がマスタの場合に、処理定義をコンソール11から受信したならば、受信した処理定義を履歴情報格納部23に格納すると共に、新たに登録された処理定義を、PAXOSプロトコルを用いて他のノード20と共有する。これにより、マスタノードに障害が発生した場合であっても、次にマスタとなったノード20が、共有した処理定義を用いて処理を実行することができる。
When a message requesting history information is received from another
処理割当部26は、マスタ決定部25から処理の割当を指示された場合に、履歴情報格納部23内に格納されている処理定義およびリソース情報格納部27内のリソース情報管理テーブル270に基づいて、マスタとなった自ノード20以外の各ノード20に割り当てる処理を決定する。割当方法の詳細については後述する。処理割当部26は、割り当てた処理を示すノード別処理指示を例えばユニキャストにより計算機用LAN12を介して、自ノード20以外のそれぞれのノード20へ送信する。
When the
スレーブ処理部28は、計算機用LAN12を介して他のノード20からノード別処理指示を受信した場合に、受信したノード別処理指示に従って、センシングアプリケーション実行部29内のそれぞれのブロックを稼動させる。また、スレーブ処理部28は、履歴情報管理部24またはマスタ決定部25から通知されたマスタノードのノードIDに基づいてリソース情報格納部27内のリソース情報管理テーブル270を参照し、マスタノードのリソース情報が格納されているか否かを監視し、マスタノードのリソース情報がリソース情報管理テーブル270から削除された場合に、マスタノードに障害が発生したと判定してマスタ決定部25にマスタノードの選出を指示する。
When the
ここで、リソース情報登録部22は、受信時刻から所定時間(例えば40秒)経過したエントリをリソース情報管理テーブル270から削除するため、マスタノードが正常に稼動しており、マスタノード内のリソース情報送信部21がリソース情報を所定時間(例えば30秒)毎に正常に送信していれば、リソース情報管理テーブル270内にはマスタノードのリソース情報が存在し続けることになる。マスタノードのリソース情報がリソース情報管理テーブル270から削除されたことを検出することによって、スレーブ処理部28は、マスタノードに障害が発生したことを検出することができる。
Here, since the resource
次に、ノード20全体の動作について、フローチャートを用いて詳細に説明する。図11は、第1の実施形態におけるノード20の動作の一例を示すフローチャートである。例えば電源が投入される等の所定のタイミングで、ノード20は、本フローチャートに示す動作を開始する。
Next, the operation of the
まず、リソース情報送信部21は、自ノード20のノードID、自ノード20のアドレス、自ノード20のリソース情報、および自ノード20の製造年月日をリソース情報格納部27内のリソース情報管理テーブル270から読み出して、計算機用LAN12を介して他のノード20へ例えばブロードキャストにより送信する(S300)。そして、履歴情報管理部24は、リソース情報格納部27内のリソース情報管理テーブル270を参照して、所定数以上のノード20に関するリソース情報がリソース情報管理テーブル270内に格納されたか否かを判定する(S301)。なお、リソース情報登録部22は、他のノード20からリソース情報等を受信する都度、受信したリソース情報等をリソース情報格納部27内のリソース情報管理テーブル270に新規登録または上書登録する。
First, the resource
所定数以上のノード20に関するリソース情報がリソース情報管理テーブル270内に格納された場合(S301:Yes)、履歴情報管理部24は、他のノード20へ履歴情報を要求するメッセージを、例えばブロードキャストにより計算機用LAN12を介して送信し、他のノード20から送信された履歴情報を受信して履歴情報格納部23に格納する(S302)。そして、履歴情報管理部24は、履歴情報格納部23を参照し、リース期限内のマスタノード情報が存在するか否かを判定する(S303)。
When resource information related to a predetermined number of
リース期限内のマスタノード情報が履歴情報格納部23内に存在する場合(S303:Yes)、履歴情報管理部24は、マスタノードのノードIDをスレーブ処理部28に通知する。スレーブ処理部28は、マスタノードから自ノード20に割り当てられた処理が記述されたノード別処理指示を受信したか否かを判定する(S304)。自ノード20のノード別処理指示をマスタノードから受信していない場合(S304:No)、スレーブ処理部28は、ノード別処理指示を受信するまでステップS304に示した処理を実行する。
When master node information within the lease term exists in the history information storage unit 23 (S303: Yes), the history
自ノード20のノード別処理指示をマスタノードから受信した場合(S304:Yes)、スレーブ処理部28は、受信したノード別処理指示に従って、センシングアプリケーション実行部29内のそれぞれのブロックを稼動させる(S305)。そして、スレーブ処理部28は、マスタノードのノードIDに基づいてリソース情報格納部27内のリソース情報管理テーブル270を参照し、マスタノードのリソース情報が格納されているか否かを監視することにより、マスタノードが正常に稼動しているか否かを判定する(S306)。マスタノードが正常に稼動していない場合(S306:No)、スレーブ処理部28は、マスタ決定部25にマスタノードの決定を指示し、マスタ決定部25は、後述するステップS307の処理を実行する。
When the node-specific processing instruction of the
ステップS303において、リース期限内のマスタノード情報が履歴情報格納部23内に存在しない場合(S303:No)、履歴情報管理部24は、マスタノードの選出をマスタ決定部25に指示する。マスタ決定部25は、例えばPAXOSプロトコルを用い、図10で説明した手順に従って、他のノード20との間でマスタノードを決定する(S307)。そして、マスタ決定部25は、自ノード20がマスタとなったか否かを判定する(S308)。自ノード20がマスタではない場合(S308:No)、マスタ決定部25は、マスタノードのノードIDをスレーブ処理部28に通知し、スレーブ処理部28は、ステップS304に示した処理を実行する。一方、自ノード20がマスタである場合(S308:Yes)、処理割当部26は、履歴情報格納部23内に処理定義が存在するか否かを判定する(S309)。履歴情報格納部23内に処理定義が存在しない場合(S309:No)、処理割当部26は、履歴情報格納部23内に処理定義が格納されるまでステップS309を繰り返す。
In step S303, when the master node information within the lease term does not exist in the history information storage unit 23 (S303: No), the history
履歴情報格納部23内に処理定義が存在する場合(S309:Yes)、処理割当部26は、後述する処理の割当を実行する(S400)。そして、処理割当部26は、自ノード20以外の各ノード20に割り当てた処理が記載されたノード別処理指示を、各ノード20へ送信する(S310)。そして、処理割当部26は、処理を割り当てたそれぞれのノード20のリソース情報がリソース情報格納部27内のリソース情報管理テーブル270に格納されているか否かを監視することにより、処理を割り当てたそれぞれのノード20が正常に稼動しているか否かを判定する(S311)。
When a process definition exists in the history information storage unit 23 (S309: Yes), the
処理を割り当てたそれぞれのノード20が正常に稼動している場合(S311:Yes)、履歴情報管理部24は、計算機用LAN12を介してコンソール11から新たな処理定義を受信したか否かを判定する(S312)。処理を割り当てたいずれかのノード20が正常に稼動していない場合(S311:No)、または、コンソール11から新たな処理定義を受信した場合(S312:Yes)、処理割当部26は、再びステップS400に示す処理を実行する。
When each
一方、履歴情報管理部24がコンソール11から新たな処理定義を受信していない場合(S312:No)、マスタ決定部25は、12を介してコンソール11からマスタノードの再選出を指示されたか否かを判定する(S313)。マスタノードの再選出を指示された場合(S313:Yes)、マスタ決定部25は、再びステップS307に示した処理を実行する。一方、マスタノードの再選出を指示されなかった場合(S313:No)、処理割当部26は、再びステップS311に示した処理を実行する。
On the other hand, if the history
図12は、処理の割当(S400)の処理の一例を示すフローチャートである。本フローチャートの説明に先立って、履歴情報格納部23には、図7に例示した処理定義テンプレート、および、図8および図9に例示した処理定義本体が格納されているものと仮定する。また、リソース情報格納部27内のリソース情報管理テーブル270には、図5に示した内容のデータが格納されているものと仮定する。
FIG. 12 is a flowchart illustrating an example of processing allocation (S400). Prior to the description of this flowchart, it is assumed that the history
ここで、処理定義のデータ構造について説明する。処理定義は、処理定義テンプレートと処理定義本体とを有する。処理定義本体(図8および図9参照)は、複数のProcessセクションから構成され、ProcessセクションはSubProcessセクションを含む場合がある。ProcessセクションとSubProcessセクションは各ノード20が実行する処理を表しており、「Process」および「SubProcess」の第一引数に各処理を実行するプログラムに対応したクラス名が記載される。簡潔に説明するため、以下ではProcessセクションおよびSubProcessセクションによって定義された処理のことを、単にProcessまたはSubProsessと呼ぶ。各処理の実行に必要なパラメタはセクション内の「Param」属性として記述される。Param属性の第一引数がパラメタ名、第二引数がパラメタ値である。
Here, the data structure of the process definition will be described. The process definition has a process definition template and a process definition body. The process definition body (see FIGS. 8 and 9) is composed of a plurality of Process sections, and the Process section may include a SubProcess section. The Process section and the SubProcess section represent processes executed by each
処理定義本体に記載された処理のインスタンス構成は、処理割当部26によって決定される。1つのProcessやSubProcessのインスタンスは必ずしも1個ではなく、複数のノードが同一の処理を並列に実行する場合がある。一方、処理定義本体に記載された処理が2個以上存在してはならないことを、明示的に指定したい場合がある。例えば、処理定義本体(図9参照)の44行目〜47行目には、指定したアドレス(192.168.10.101)でアクセスされるRFIDデバイスを制御する処理が記載されているが、このRFIDデバイスは1つしか存在しないため、この処理のインスタンスは1個にする必要がある。このような場合、SubProcessセクションの第二引数にインスタンス名が指定される。インスタンス名が指定されたSubProcessセクションのインスタンスは、そのインスタンス名に対応するものだけになるため、インスタンスの個数は1個となる。
The instance configuration of the process described in the process definition body is determined by the
処理定義テンプレート(図7参照)は、処理定義本体と同様の構成をとる。処理定義テンプレートに記載された「ProcesUnit」、「Require」、および「SourceRef」が処理定義本体に記載されていない場合、処理定義テンプレートに記載されたものが処理定義本体に記載されたものとして扱われる。それ以外の項目(「Process」、「SubProcess」、または「Param」等)は、パターンマッチング条件として利用される。 The process definition template (see FIG. 7) has the same configuration as the process definition body. If "ProcesUnit", "Require", and "SourceRef" described in the process definition template are not described in the process definition body, what is described in the process definition template is treated as described in the process definition body . Other items (such as “Process”, “SubProcess”, or “Param”) are used as pattern matching conditions.
例えば、処理定義テンプレート(図7参照)の21行目〜35行目には、処理定義本体(図9参照)の43行目〜84行目に対する値が記載されている。処理定義テンプレートの21行目に記載された「Process "sensor"」がパターンマッチング条件として利用され、処理定義本体の43行目に記載された「Process "sensor"」セクションにマッチする。そして、処理定義テンプレートの22行目に記載された「ProcessUnit "subprocess"」が処理定義本体の43行目以下のProcessセクション内に挿入される。
For example, in the 21st to 35th lines of the process definition template (see FIG. 7), values for the 43rd to 84th lines of the process definition body (see FIG. 9) are described. “Process“ sensor ”” described in
処理定義テンプレートの23行目以下に記載された部分のパターンマッチングは、上記と比較してやや複雑になる。例えば、処理定義テンプレートの23行目〜26行目に記載された部分は、23行目に記載された「SubProcess "sensor"」と25行目に記載された「Param "type" "rfid"」とがパターンマッチング条件として利用され、処理定義本体(図9参照)の44行目から59行目に記載された4つのSubProcessセクションにマッチする。そして、処理定義テンプレートの24行目に記載された「Require "cpu" "20" "mips-per-sensor-event」が、対応するSubProcessセクションに挿入される。 The pattern matching of the part described in the 23rd and subsequent lines of the process definition template is slightly more complicated than the above. For example, the parts described in the 23rd to 26th lines of the process definition template are "SubProcess" sensor "" described in the 23rd line and "Param" type "" rfid "" described in the 25th line. Are used as pattern matching conditions, and match the four SubProcess sections described in the 44th to 59th lines of the process definition body (see FIG. 9). Then, “Require“ cpu ”“ 20 ”“ mips-per-sensor-event ”described in the 24th line of the process definition template is inserted into the corresponding SubProcess section.
本実施形態において、処理定義本体は、「dispatch」、「filters」、「cycle」、および「sensors」の4つのProcessセクションから構成される。これらは図4に示したセンシングアプリケーション実行部29が有するディスパッチャ290、フィルタ291、駆動制御292、およびアダプタ293にそれぞれ対応する。処理定義本体の1行目〜4行目に記載された、クラス名が「dispatch」であるProcessセクションは、ディスパッチャ290の処理を示しており、送信先(dest)とコンテンツのエンコード方式(content-coding)とがパラメタとして指定されている。
In the present embodiment, the process definition body is composed of four Process sections: “dispatch”, “filters”, “cycle”, and “sensors”. These correspond to the
処理定義本体(図8参照)の6行目〜21行目に記載されたクラス名が「filters」である2つのProcessセクションは、フィルタ291の処理を示している。具体的な処理内容は、SubProcessセクションに定義される。処理定義本体の9行目〜11行目に記載されたSubProcessセクションは、RFIDタグのデータ処理で利用する差分フィルタであり、クラス名が「inout-filter」となっている。差分フィルタとは、連続的に入力されるデータの差分を出力するフィルタ処理である。例えば、新しくRFIDタグを検出すると、INのイベントを出力し、いままで存在したRFIDタグが見つからなくなると、OUTのイベントを出力する。この例では、パラメタとして出力データ(output)が「in」として記載されているので、OUTのイベントは出力されずに、INのイベントのみが出力されることになる。処理定義本体の17行目〜20行目に記載されたSubProcessセクションは、統計処理を行うフィルタである。パラメタとして出力データ(output)が指定されており、ここでは平均(average)と分散(variance)とが出力される。
Two Process sections whose class name is “filters” described in the 6th to 21st lines of the process definition main body (see FIG. 8) indicate the process of the
処理定義本体の23行目〜41行目に記載されたクラス名が「cycle」であるProcessセクションは、駆動制御292の処理を示しており、独立に動作するセンサ制御サイクルがSubProcessセクションとして定義されている。この例では3つのセンサ制御サイクルが定義されている。各SubProcessセクション内では、駆動周期(period)と駆動するセンサ(sensor-ref)とがパラメタとして指定されている。パラメタsensor-refには、クラス名が「sensor」であるSubProcessのインスタンス名が指定される。後述するように、クラス名が「sensor」であるSubProcessはセンサに一対一に対応する。従って、パラメタsensor-refをこのように指定することは、センサを個別に指定することと等価である。処理定義本体の26〜27行目のようにsensor-refが複数記載された場合、それぞれの「sensor-ref」に記載されたセンサが並列的に駆動することが示される。従ってこの例では、センサ「a」および「b」をこの順で駆動し、それと並列にセンサ「c」および「d」をこの順で駆動することになる。
The Process section whose class name is “cycle” described in the 23rd to 41st lines of the process definition body indicates the process of the
処理定義本体(図9参照)の43行目〜84行目に記載されたクラス名が「sensors」であるProcessセクションは、アダプタ293の処理を示しており、各センサ14の制御処理がSubProcessセクションとして定義される。各SubProcessには、センサ14の種別(type)とセンサ14のアドレス(addr)またはデバイス識別子(devId)とがパラメタとして指定される。この例では、ネットワーク接続されるタイプのセンサ14はアドレスで指定され、シリアルインターフェイス経由でノード20と直接接続されるものはデバイス識別子で指定されている。デバイス識別子で指定されたセンサ14のデバイス識別子と、そのセンサ14にアクセスするためのシリアルポート名は、リソース情報管理テーブル270(図5参照)のリソース情報274に記載されている。このようなセンサ14にアクセスする場合、アダプタ293は、デバイス識別子をキーとしてリソース情報274を検索し、シリアルポート名を取得し、そのシリアルポートを使用する。
The Process section whose class name is “sensors” described in the 43rd to 84th lines of the process definition body (see FIG. 9) indicates the process of the
各処理の連携方法は、SourceRef属性で指定される。SourceRef属性の属性値は、そのSourceRef属性が記載されたProcessやSubProcessへの入力データを生成する他の処理(ProcessまたはSubProcess)を示す。SouceRef属性の第一引数には、Processセクションのクラス名が指定され、第二引数にはSubProcessセクションのクラス名が指定され、第三引数には処理のインスタンス名が指定される。例えば、処理定義本体(図8参照)の1行目〜4行目のProcessセクションには、SourceRef属性として「SourceRef "filters"」が指定されている。これはクラス名が「filters」であるProcessの出力結果が、クラス名が「dispatch」であるProcessの入力データとして使用されることを示している。 The linkage method of each process is specified by the SourceRef attribute. The attribute value of the SourceRef attribute indicates another process (Process or SubProcess) that generates input data to the Process or SubProcess in which the SourceRef attribute is described. The class argument of the Process section is designated as the first argument of the SouceRef attribute, the class name of the SubProcess section is designated as the second argument, and the instance name of the process is designated as the third argument. For example, “SourceRef“ filters ”” is specified as the SourceRef attribute in the Process section of the first to fourth lines of the process definition body (see FIG. 8). This indicates that the output result of the process whose class name is “filters” is used as input data for the process whose class name is “dispatch”.
処理定義本体の16行目は、SourceRef属性の第三引数まで指定されている例である。これは、クラス名が「filters」であるProcessの入力データとして、Processのクラス名が「cycle」であり、SubProcessのクラス名が「sensor-group」であり、インスタンス名が「area2」および「area3」であるSubProcessの処理結果を使用することが示されている。このように、入力データを生成する処理が複数存在する場合、1つの引数内に複数の項目名がカンマ区切りで指定される。 The 16th line of the process definition body is an example in which up to the third argument of the SourceRef attribute is specified. This is as input data for Process with class name "filters", Process class name is "cycle", SubProcess class name is "sensor-group", and instance names are "area2" and "area3" It is shown that the processing result of SubProcess which is “” is used. As described above, when there are a plurality of processes for generating input data, a plurality of item names are specified in a single argument separated by commas.
図7の処理定義テンプレートにおいて、クラス名が「cycle」のProcessセクション内にクラス名が「sensor-group」であるSubProcessセクションが記載されているが、このSubProcessセクションのSourceRef属性は、「SourceRef "sensors" "sensor" "param:sensor-ref"」となっている。この第三引数は、そのセクション内に指定されたパラメタsensor-refのパラメタ値に置き換えられることを意味する。例えば、処理定義本体の24行目〜28行目を例に挙げると、sensor-refパラメタは2つ存在し、それぞれパラメタ値が、「a,b」「c,d」であるので、SourceRef属性の第三引数として「a,b,c,d」が指定されたことになる。結局、上記SubProcessは、Procss "sensors"セクション内のSubProcess "sensor"のインスタンス名が「a」、「b」、「c」、または「d」である4つのインスタンスの処理結果が入力データとして使用されることを意味する。 In the process definition template of FIG. 7, the SubProcess section whose class name is “sensor-group” is described in the Process section whose class name is “cycle”. The SourceRef attribute of this SubProcess section is “SourceRef“ sensors ” "" sensor "" param: sensor-ref "" This third argument means that it will be replaced by the parameter value of the parameter sensor-ref specified in that section. For example, taking the 24th to 28th lines of the process definition body as an example, there are two sensor-ref parameters, and the parameter values are “a, b” and “c, d” respectively. "A, b, c, d" is specified as the third argument of. After all, the above SubProcess uses the processing results of four instances whose instance name of SubProcess "sensor" in the Procss "sensors" section is "a", "b", "c", or "d" as input data Means that
処理定義本体に記載した処理は複数のノード20上で実行されるため、各処理のインスタンスを各ノード20に割り当てる際、インスタンスの最小単位(以下、処理単位と呼ぶ)を決める必要がある。処理単位は、それ以上インスタンスを分解できない最小単位を意味し、1つの処理単位は必ず1つのノード上で実行される。また、ある処理が複数の処理単位から構成される場合は、各処理単位を異なるノードが実行することができる。処理単位を決める方法としては、例えば、(1)インスタンス名が指定された各SubProcessセクションを1つの処理単位として構成する方法、(2)その処理が使用するリソースに対応付けて処理単位を構成する方法、(3)その処理の入力データを生成する処理の処理単位に対応付けて処理単位を構成する方法等がある。
Since the process described in the process definition main body is executed on a plurality of
各Processセクションに記載された処理の処理単位が、上記のどの方法で決定されるのかは、ProcessセクションのProcessUnit属性に記述される。Process "cycle"セクション、および、Process "sensors"セクションに対する指定「ProcessUnit "subprocess"」が、上記(1)の指定の例である。ProcessUnit属性の第一引数(subprocess)が(1)の指定方法であることを意味する。本実施形態では、インスタンス名が指定されたSubProcessを必ず処理単位とすることにしているため、インスタンス名が指定されたSubProcessを含むProcessセクションのProcessUnit属性は必ず"subprocess"となる。 Which method is used to determine the processing unit of the processing described in each Process section is described in the ProcessUnit attribute of the Process section. The specification “ProcessUnit“ subprocess ”” for the Process “cycle” section and the Process “sensors” section is an example of the specification in (1) above. This means that the first argument (subprocess) of the ProcessUnit attribute is the designation method of (1). In this embodiment, since the SubProcess with the instance name specified is always used as the processing unit, the ProcessUnit attribute of the Process section including the SubProcess with the instance name specified is always “subprocess”.
Process "dispatch"セクションに対する指定「ProcessUnit "device" "communicate"」が、上記(2)の指定の例である。ProcessUnit属性の第一引数(device)が(2)の指定方法であることを示しており、第二引数がデバイス種別を示している。この例で第二引数として記載された「communicate」は、通信デバイスを意味する。図5に示したリソース情報管理テーブル270には、ノードIDが「001」または「002」のノード20に通信デバイスが設けられている旨が記載示されている。従って、Process "dispatch"セクションに記載された処理は、上記2つのノード20のそれぞれで実行される2つの処理単位から構成される。
The designation “ProcessUnit“ device ”“ communicate ”” for the Process “dispatch” section is an example of the designation (2) above. The first argument (device) of the ProcessUnit attribute indicates that the designation method is (2), and the second argument indicates the device type. “Communicate” described as the second argument in this example means a communication device. The resource information management table 270 illustrated in FIG. 5 describes that a communication device is provided in the
Process "filter"セクションに対する指定「ProcessUnit "source-subprocess"」が、上記(3)の指定の例である。ProcessUnit属性の第一引数(source-subprocess)が(3)の指定方法であることを示す。例えば、処理定義本体の14行目〜21行目に指定されたProcess "filter"セクションは、SourceRef属性に記載されているように、インスタンス名が「area2」および「area3」のSubProcessが出力するデータを入力データとして使用する。インスタンス名が指定されたSubProcessは処理単位であるから、入力データを生成する処理の処理単位は2個である。つまり、インスタンス名が「area2」であるSubProcessの出力データを入力データとして使用するフィルタ処理と、インスタンス名が「area3」であるSubProcessの出力データを入力データとして使用するフィルタ処理が、それぞれ処理単位となる。 The specification “ProcessUnit“ source-subprocess ”” for the Process “filter” section is an example of the specification in (3) above. Indicates that the first argument (source-subprocess) of ProcessUnit attribute is the method specified in (3). For example, the Process "filter" section specified in the 14th to 21st lines of the process definition body is the data output by the SubProcess whose instance names are "area2" and "area3" as described in the SourceRef attribute Is used as input data. Since the SubProcess for which the instance name is specified is a processing unit, the processing unit for processing for generating input data is two. In other words, the filtering process that uses the output data of SubProcess whose instance name is “area2” as input data and the filtering process that uses the output data of SubProcess whose instance name is “area3” as input data are the processing unit and Become.
上記(3)の方法で指定された場合、SourceRef属性が参照する処理の処理単位が明示的に分からない場合がある。例えば、SourceRef属性に第一引数(Process)のみ記載されている場合や、SourceRef属性が参照するSubProcessセクションにインスタンス名が記載されていない場合である。このような場合は、SourceRef属性が参照する処理のSourceRef属性をさらにたどることで、処理単位を確定する。SourceRef属性をたどると最終的には、Process "sensors"セクションで定義されるセンサ制御処理にたどり着く。センサ制御処理は、必ず各々のセンサに対応付けられるため、必然的に処理単位となる。従って、SourceRef属性をたどることで、必ず処理単位を確定することができる。 When specified by the above method (3), the processing unit of the process referred to by the SourceRef attribute may not be explicitly known. For example, this is the case where only the first argument (Process) is described in the SourceRef attribute, or the instance name is not described in the SubProcess section referenced by the SourceRef attribute. In such a case, the processing unit is determined by further tracing the SourceRef attribute of the process referred to by the SourceRef attribute. Tracing the SourceRef attribute eventually leads to the sensor control process defined in the Process "sensors" section. Since the sensor control process is always associated with each sensor, it is necessarily a processing unit. Therefore, the processing unit can be determined without fail by following the SourceRef attribute.
各処理の処理単位を実行するために必要なリソース量はRequire属性に記載される。Require属性の第一引数にはリソース種別が指定され、第二引数にはリソース量が指定され、第三引数には第二引数で指定されたリソース量の単位が指定される。本実施形態では、リソース種別として「communicate」および「cpu」の2種類が例示されている。 The amount of resources required to execute the processing unit of each process is described in the Require attribute. The resource type is specified as the first argument of the Require attribute, the resource amount is specified as the second argument, and the unit of the resource amount specified by the second argument is specified as the third argument. In this embodiment, two types of resource types “communicate” and “cpu” are illustrated.
「communicate」は通信リソースを意味するリソース種別である。例えば、図7の処理定義テンプレートの3行目に「Require "communicate" "8k" "bps-per-sensor-event"」と記載されている。第三引数は「sensor-event」当たりに必要な通信帯域のbps(Bits Per Second)値を示す。sensor-eventとは、1つのセンサ14が出力する1個のデータを意味し、event/secで表すこともできる。処理するデータ量は、センサ14の個数とセンサ14の駆動周期の逆数とに比例するため、sensor-eventという単位を使用している。結局上記は、「1個のセンサから毎秒一回取得したデータを処理する場合、8kbpsの通信リソースが必要」という意味になる。
“Communicate” is a resource type meaning a communication resource. For example, “Require“ communicate ”“ 8k ”“ bps-per-sensor-event ”” is described in the third line of the process definition template in FIG. The third argument indicates the bps (Bits Per Second) value of the communication bandwidth required per “sensor-event”. The sensor-event means one piece of data output from one
「cpu」はCPUリソースを意味するリソース種別である。例えば、図7の4行目に「Require "cpu" "10" "mips-per-sensor-event"」と記載されている。第三引数は「sensor-event」当たりに必要な処理能力のmips(Million Instructions Per Second)値を示す。sensor-eventは上記と同様の意味であるため、上記は「1個のセンサから毎秒一回取得したデータを処理する場合、10mipsのCPUリソースが必要」という意味になる。 “Cpu” is a resource type meaning a CPU resource. For example, “Require“ cpu ”“ 10 ”“ mips-per-sensor-event ”” is described in the fourth line of FIG. The third argument indicates the mips (Million Instructions Per Second) value of the processing capacity required per “sensor-event”. Since sensor-event has the same meaning as described above, the above means “if the data acquired once from one sensor is processed every second, a CPU resource of 10 mips is required”.
図12に戻って、処理の割当(S400)の処理の説明を続ける。まず、処理割当部26は、図7に示した処理定義テンプレートと、図8および図9に示した処理定義本体とから、図13に示す処理割当テーブル30を作成する(S401)。処理割当テーブル30には、それぞれの処理単位を識別する処理ID31毎に、対応する処理単位の名称を示す処理単位名称32、対応する処理単位が使用するデータの提供元の処理単位の処理IDを示すデータソース33、対応する処理単位の単位時間当たりの実行回数を示すevent/sec34、対応する処理単位が使用する機器であって、ノード20のセンサインターフェイス208に接続されている機器のIDを示すdevice35、対応する処理単位に必要な処理能力を示すmips36、および、対応する処理単位が割り当てられるノード20のIDを示すnode37が格納される。
Returning to FIG. 12, the description of the process assignment (S400) will be continued. First, the
処理割当部26は、各ProcessセクションのProcessUnit属性を参照し、ProcessUnit属性の第一引数が(1)「subprocess」、(2)「device」、または(3)「source-subprocess」であるものの順に処理単位を決定していく。ProcessUnit属性の第一引数が(1)「subprocess」の場合、処理割当部26は、SubProcessセクションをそのまま処理単位とする。処理単位の名称を、[Processのクラス名]/[SubProcessのクラス名]@[SubProcessのインスタンス名]とする。ProcessUnit属性の第一引数が(2)「device」の場合、処理割当部26は、処理定義の他にリソース情報格納部27内のリソース情報管理テーブル270を参照する必要があるため、ここではその処理を後回しにする。
The
ProcessUnit属性の第一引数が(3)「source-subprocess」の場合、処理割当部26は、処理単位を決定しようとしているProcessもしくはSubProcessセクションのSourceRef属性を参照し、その処理の入力データを作成するSubProcessの処理単位を取得する。以下では、ある処理(ProcessまたはSubProcess)の入力データを生成する処理(ProcessまたはSubProcess)をデータソースと呼ぶ。データソースの処理単位が取得できたら、その処理単位に一対一に対応した処理単位を作成する。例えば、処理定義本体(図8)の14行目〜21行目に記載されたProcess "filters"セクションのSourceRef属性は「SourceRef "cycle" "sensor-group" "area2, area3"」となっており、SourceRef属性が参照する処理のインスタンス名まで記載されている。インスタンス名が記載された処理は処理単位となることから、データソースの処理単位は(Processのクラス名、SubProcessのクラス名、SubProcessのインスタンス名)=(cycle, sensor-group, area2)、(cycle, sensor-group, area3)で決定される2つの処理単位となる。処理割当部26は、これら2つの処理単位に対応した処理単位を、Process "filters"セクションの処理単位として作成することになるが、処理単位の名称は、[Processのクラス名]/[データソースのSubProcessのクラス名]@[ データソースのSubProcessのインスタンス名]とする。従って、filters/sensor-group@area2、filters/sensor-group@area3が処理単位の名称となる。
When the first argument of the ProcessUnit attribute is (3) “source-subprocess”, the
上記手順で(2)の場合以外の処理単位を決定すると、処理割当部26は、処理割当テーブル30の処理単位名称32に処理単位の名称を登録し、各処理単位を一意に識別可能な番号を生成して処理ID31に登録する。次に、処理割当部26は、ProcessUnit属性が「device」以外の処理単位について、使用するデバイスのデバイス識別子を処理定義から取得する。例えば、処理定義本体(図9参照)の54行目または58行目には、(クラス名、インスタンス名)=(sensor、c)(sensor、d)を持つ処理単位について、デバイス識別子がパラメタ「devId」として記載されている。処理割当部26は、「devId」に対応する機器のIDを処理割当テーブル30のdevice35に登録する。
When the processing unit other than the case of (2) is determined in the above procedure, the
次に処理割当部26は、処理定義に記載されたSource-Ref属性に基づき、各処理単位が使用するデータの提供元となる処理単位の処理IDを、各処理単位に対応するデータソース33に登録することで、処理単位間の連携関係を処理割当テーブル30に登録する。ここでは、処理割当部26は、Source-Ref属性にSubProcessのインスタンス名まで指定された場合についてのみデータソース33に登録する。
Next, based on the Source-Ref attribute described in the process definition, the
また、処理定義のProcessUnit属性がsource-subprocessである処理単位は、他の処理単位からデータを提供されているため、処理割当部26は、当該処理単位について、データの提供元の処理単位の処理IDをデータソース33に登録する。具体的には、処理単位名称32が「filter/sensor-group@area1」、「filter/sensor-group@area2」、または「filter/sensor-group@area3」の処理単位は、それぞれ処理単位名称32が「cycle/sensor-group@area1」、「cycle/sensor-group@area2」、または「cycle/sensor-group@area3」の処理単位が生成するデータを入力データとして処理するので、処理割当部26は処理割当テーブル30においてこれらを対応付ける。その結果、図13に示すように処理ID31が「1」、「2」、および「3」の処理単位のデータソース33は、それぞれ、「4」、「5」、および「6」となる。
In addition, since the processing unit whose process unit attribute of the process definition is source-subprocess is provided with data from another processing unit, the
処理定義本体(図8参照)の23行目〜41行目については、SubProcessとそのSubProcessのデータソースの両方がインスタンス名まで記載されているため、SubProcessとデータソースの処理単位の関係は明白である。従って、処理割当部26は、Source-Ref属性に記載内容に従って、データソースとの対応関係を処理割当テーブル30に記載する。結果、図13に示すように、処理ID31が、「4」、「5」、および「6」の処理単位のデータソース33は、それぞれ、「7,8,9,10」、「11,12,13」、および「14,15,16」となる。
From
次に、処理割当部26は、処理定義本体(図8参照)のProcess "cycle"セクションの記載内容から、Process "sensors"セクションに定義されたセンサ制御処理の駆動間隔を求め、センサ制御処理の各処理単位に対してevent/sec34の値を求める。このevent/sec34の値を足し合わせることで、センサ制御処理が生成するデータを入力データとして使用する各種処理単位のevent/sec34を求めていく。
Next, the
すなわち、処理割当部26は、処理定義本体のProcess "cycle"セクションを参照し、SubProcess "sensor-group"セクション内の「period」パラメタから、センサ制御処理の駆動周期を取得する。例えば、処理定義本体(図8参照)の24行目〜28行目に記載されたSubProcessセクションでは、「a」、「b」、「c」、および「d」のインスタンス名を持つセンサ制御処理が1000ミリ秒周期で駆動している。従って、当該センサ制御処理の処理単位のevent/sec34の値は「1」となる。同様に、処理定義本体の29行目〜34行目に記載されたSubProcessセクションから、「e」、「f」、および「g」のインスタンス名を持つセンサ制御処理の駆動周期が2000ミリ秒であることが分かり、これらセンサ制御処理の処理単位のevent/sec34は「0.5」となる。このようにして、処理割当部26は、各センサ制御処理の処理単位に対してevent/sec34を求める。これにより、処理ID31が「7」〜「16」の処理単位のevent/sec34は、図13のようになる。
That is, the
次に、処理割当部26は、既にevent/sec34の値を求めた処理単位の処理ID31が、データソース33に記載されている処理単位を探す。すなわち、処理割当部26は、処理ID31が「4」、「5」、および「6」の処理単位を見つける。そして、処理割当部26が見つけたそれぞれの処理単位のevent/sec34は、データソース33に記載されている処理ID31に対応する処理単位のevent/sec34を合計したものになる。例えば、処理ID31が「4」の処理単位のデータソース33には、「7,8,9,10」が記載されており、処理ID31が「7」、「8」、「9」、または「10」の処理単位のevent/sec34の値は、それぞれ「1」となっている。従って、処理割当部26は、処理ID31が「4」の処理単位のevent/sec34の値を、これらの合計である「4」と算出する。同様にして、処理割当部26は、処理ID31が「5」または「6」の処理単位についてもevent/sec34を算出する。
Next, the
続いて処理割当部26は、データソース33に処理IDが設定されている他の処理単位のそれぞれについても上記の手順を繰り返してevent/sec34を求める。例えば、処理ID31が「1」、「2」、または「3」の処理単位についてのevent/sec34は、図13に示す値となる。これにより、処理ID31が「1」〜「16」のそれぞれの処理単位についてevent/sec34が設定された。
Subsequently, the
次に処理割当部26は、処理定義に記載された必要な処理能力に関するRequire属性と、各処理単位が処理するデータ量に基づき、各処理単位に必要な処理能力を算出する。処理定義には、Require属性として「mips-per-sensor-event」単位でのmips値が記載されており、この値と処理割当テーブル30内の各処理単位のevent/sec34を積算したものが、各処理単位に必要な処理能力となる。
Next, the
図13の処理割当テーブル30を参照すると、例えば、処理ID31が「1」の処理単位のevent/sec34は「4」である。この処理単位はProcess "filters"セクションとして定義されており、この処理単位に必要な処理能力に関するRequire属性は、処理定義本体(図8参照)の7行目に「Require "cpu" "10" "mips-per-sensor-event"」と記載されている。従って、処理割当部26は、4×10=40mipsを必要な処理能力として算出する。処理割当部26は、算出した必要な処理能力を、対応する処理単位のmips36の欄に登録する。処理割当部26は、処理ID31が「2」〜「16」の処理単位についても同様にmips値をそれぞれ求めてmips36に登録する。この時点で処理割当テーブル30のmips36に欄は、図13の状態となる。
Referring to the process allocation table 30 in FIG. 13, for example, the event /
図12に戻って説明を続ける。次に、処理割当部26は、処理定義およびリソース情報管理テーブル270を参照して、ノード20に接続されている機器毎に作成されるべき処理単位を作成する(S402)。より詳しく説明すると、処理割当部26は、処理定義テンプレートおよびリソース情報管理テーブル270のリソース情報274を参照し、ProcessUnit属性の第二引数に指定されたリソースを検索する。例えば、Process "dispatch"セクションのProcessUnit属性は、「ProcessUnit "device" "communicate"」であるので、処理割当部26は、当該セクションに対して"communicate"リソースをリソース情報管理テーブル270内で検索する。図5に示したリソース情報管理テーブル270には、デバイス識別子(devID)が「card001」の通信カードと「card002」の通信カードが見つかるので、処理割当部26は、それぞれに対応した処理単位を作成する。
Returning to FIG. 12, the description will be continued. Next, the
今の場合、SubProcessが存在しないので、処理割当部26は、処理単位の名称を[Processのクラス名]@[デバイス識別子]とする。一方、SubProcessが存在する場合、処理割当部26は、処理単位の名称を[Processのクラス名]/[SubProcessのクラス名]@[デバイス識別子]とする。なお、複数のノード20を跨ると、デバイス識別子の重複が発生する場合があるので、処理割当部26は、デバイス識別子の代わりにノードIDとデバイス識別子の組み合わせを使用してもよい。本実施形態では、説明を簡潔にするためデバイス識別子のみでデバイスを識別できるものと仮定する。そして、処理割当部26は、作成した処理単位に対応する処理定義を参照して、当該処理単位が使用する機器であって、ノード20に接続されたものがあれば、処理割当テーブル30のdevice35に登録する。ステップS402の処理が実行された後の処理割当テーブル30は、例えば図14のようになる。領域300は、ステップS402の処理が実行されたことによって新たに登録されたデータを示している。
In this case, since there is no SubProcess, the
次に、処理割当部26は、新たに作成された処理単位(処理ID31が「17」または「18」の処理単位)について、当該処理単位が使用するデータの提供元を割り当てる処理を実行する(S500)。ここで、データ提供元の割当処理(S500)の動作について図15を用いて説明する。図15は、データ提供元の割当処理(S500)の一例を示すフローチャートである。本フローチャートでは、処理割当テーブル30が図14に示した状態にあることを前提として説明を行う。
Next, the
まず、処理割当部26は、ステップS402において新たに作成された処理単位にデータを提供する処理単位の中で、新たに作成された処理単位のデータ提供元としてデータソース33に登録されておらず、かつ、単位時間当たりの実行回数が最も多い処理単位を1つ選択する(S501)。図14の処理割当テーブル30の例では、処理割当部26は、クラス名「filters」を持つ処理単位の中で、処理ID31が「1」の処理を選択する。
First, the
次に、処理割当部26は、ステップS402において新たに作成されたそれぞれの処理単位について、現在割り当てられているリソースによって必要となる処理能力を算出し、算出した値を対応するevent/sec34の欄に登録する(S502)。図14の処理割当テーブル30の例では、処理ID31が「17」または「18」の処理単位のデータソース33には、データが登録されていないため、当該処理単位が、他の処理単位から入力されたデータを処理するために必要な処理能力は、現時点ではいずれも「0」である。また、例えば、処理ID31が「18」の処理単位のデータソース33に「2」と「3」が登録されていた場合、処理割当部26は、処理ID31が「2」の処理単位のevent/sec34に登録されている「1.5」と、処理ID31が「3」の処理単位のevent/sec34に登録されている「1.5」とを合計した処理能力を、他の処理単位から入力されたデータを処理するために必要な処理能力として算出する。
Next, the
次に、処理割当部26は、ステップS402において新たに作成された処理単位の中で、必要な処理能力が最も低い処理単位に、ステップS501で選択した処理単位を割り当てる(S503)。図14の処理割当テーブル30の例では、処理ID31が「17」または「18」の処理単位のいずれにも、現時点ではevent/sec34に「0」が登録されている。この場合、処理割当部26は、処理ID31が「17」または「18」の処理単位のいずれのデータソース33に「1」を登録してもよいが、本実施形態では、処理ID31が小さい処理単位の33に登録することとする。
Next, the
なお、ステップS503において、処理割当部26は、ステップS402において新たに作成された処理単位の中で、必要な処理能力が最も低い処理単位に、ステップS501で選択した処理単位を割り当てるが、この場合、必要な処理能力が最も低い処理単位のdevice35に登録されている機器のIDに基づいてリソース情報管理テーブル270を参照し、当該機器の処理能力を取得して、ステップS501で選択した処理単位を割り当てた場合に、当該処理能力を超えるならば、必要な処理能力が次に低い処理単位にステップS501で選択した処理単位を割り当てるようにする。
In step S503, the
次に、処理割当部26は、ステップS402において新たに作成した処理単位にデータを提供する処理単位の全てを割り当てたか否かを判定する(S504)。ステップS402において新たに作成した処理単位にデータを提供する処理単位の全てを割り当てていない場合(S504:No)、処理割当部26は、再びステップS501に示した処理を実行する。一方、ステップS402において新たに作成した処理単位にデータを提供する処理単位の全てを割り当てた場合(S504:Yes)、処理割当部26は、本フローチャートに示したデータ提供元の割当の処理を終了する。本フローチャートに示した処理が終了すると、処理割当テーブル30には、図16に示した領域301および領域302内のデータが登録される。
Next, the
なお、図15に示した方法は、各通信リソースの通信負荷が平均化されるように、処理単位間の連携関係を求めるものであるが、別な方法として、1つの通信リソースに性能限界まで通信負荷を与える方法が考えられる。時間課金の通信カードが用いられる場合、通信量が少ないときには利用する通信カードの数を少なくして、通信料金を節約したい場合がある。このような場合に本方法が有効である。本方法による処理単位間の連携関係の決定手順を図17に示す。図15との違いは、ステップS505のみである。 Note that the method shown in FIG. 15 is for obtaining a cooperative relationship between processing units so that the communication load of each communication resource is averaged, but as another method, up to the performance limit for one communication resource. A method of giving a communication load can be considered. When a time-charged communication card is used, there are cases where it is desired to reduce the number of communication cards to be used when the amount of communication is small to save communication charges. In such a case, this method is effective. FIG. 17 shows a procedure for determining the linkage relationship between processing units according to this method. The difference from FIG. 15 is only step S505.
ステップS502の次に、処理割当部26は、ステップS402において新たに作成された処理単位のdevice35に登録されている機器のIDに基づいてリソース情報管理テーブル270を参照し、当該機器の処理能力を取得する。そして、処理割当部26は、ステップS501で選択した処理単位を、リソースの処理能力を超えない範囲で、必要となる処理能力が最も大きい処理単位のデータ提供元として割り当てる(S505)。なお、処理割当部26は、リソースの処理能力いっぱいまでデータ提供元の処理単位を割り当てる他に、リソースの処理能力の所定割合(例えば75%)に制限値を設け、ステップS501で選択した処理単位を、当該制限値を超えない範囲で、必要となる処理能力が最も大きい処理単位のデータ提供元として割り当てるようにしてもよい。
After step S502, the
図12に戻って説明を続ける。処理割当部26は、ステップS402で作成したそれぞれの処理単位について、必要な処理能力を算出する(S403)。ステップS403において、処理割当部26は、処理定義に記載された必要な処理能力に関するRequire属性と、各処理単位が処理するデータ量に基づき、各処理単位に必要な処理能力を算出する。例えば、処理ID31が「17」の処理単位のevent/sec34は「4」であり、この処理単位はProcess "dispatch"セクションとして定義されており、この処理単位に必要な処理能力に関するRequire属性は、処理定義テンプレートの4行目に「Require "cpu" "10" "mips-per-sensor-event"」と記載されている。従って、処理割当部26は、4×10=40mipsを必要な処理能力として算出し、mips36に登録する。処理割当部26は、処理ID31が「18」の処理単位についても同様にmips値を求めmips36に登録する。これにより、処理割当テーブル30には、図15に示す領域303のデータが登録される。
Returning to FIG. 12, the description will be continued. The
次に、処理割当部26は、ノード20に接続されている機器を利用する処理単位を、その機器が接続されているノード20に割り当てる(S404)。処理割当部26は、処理割当テーブル30内でdevice35にデータが登録されているそれぞれの処理単位について、リソース情報管理テーブル270を参照し、device35と同一のデバイス識別子が記載されたリソース情報を探す。そして、処理割当部26は、見つかったリソース情報に対応付けられているノードIDを、対応する処理単位のnode37に登録する。
Next, the
例えば、処理ID31が「17」の処理単位のdevice35には「card001」が登録されているので、処理割当部26は、リソース情報管理テーブル270にデバイス識別子「card001」が登録されているリソース情報を探し、ノードIDが「001」であるノード20のリソース情報を検出する。そして、処理割当部26は、処理割当テーブル30の対応する処理単位のnode37に「001」を登録する。処理割当部26は、処理ID31が「9」、「10」、または「18」の処理単位についても同様にしてnode37を登録する。これにより、処理割当テーブル30には、図16に示す領域304および領域305のデータが登録される。
For example, since “card001” is registered in the
次に、処理割当部26は、処理単位を実行させるノード20を決定する。各ノード20への処理割り当てアルゴリズムの概要は以下のとおりである。
(1)要求性能が大きな処理に確実にCPUリソースを割り当てるために、必要な処理能力(mips値)が大きな処理単位から順に割り当てる。
(2)ノード20間の通信オーバヘッドを削減するため、データの送受信が関連している処理単位を、なるべく同一ノードに割り当てる。
(3)上記(1)のポリシーで割り当てを行うと、特定のノードに負荷が集中してしまう場合があるため、CPU負荷に制限値(例えば75%)を設け、処理を割り当てたとすればCPU負荷が当該制限値以上となってしまう場合には、通信オーバヘッドが発生したとしても当該処理単位を他のノード20に割り当てる。上の例ではCPU負荷の制限値を100%よりも小さな値にしているが、これはCPU負荷の変動にも対応可能とするためである。
Next, the
(1) In order to reliably allocate a CPU resource to a process with a large required performance, the necessary processing capacity (mips value) is allocated in order from the processing unit with the largest.
(2) In order to reduce the communication overhead between the
(3) If assignment is performed according to the policy (1) above, the load may be concentrated on a specific node. Therefore, if a limit value (for example, 75%) is provided for the CPU load and processing is assigned, the CPU If the load exceeds the limit value, the processing unit is assigned to another
処理割当部26は、まず、リソース情報管理テーブル270および処理割当テーブル30を参照して、図18に示す負荷テーブル40を作成する。図18に示す負荷テーブル40には、ノードID41に対応付けて、当該ノードID41に対応するノード20のCPU処理能力を示す許容値42、および、当該ノードID41に対応するノード20に割り当てられている処理負荷を示す現在の負荷43が格納される。処理割当部26は、それぞれのノード20について、リソース情報管理テーブル270を参照して許容値42にデータを登録し、ステップS404においてノード20に割り当てた処理単位の負荷の合計値を現在の負荷43の欄に登録する(S405)。
The
具体的には、処理割当部26は、処理割当テーブル30を参照して、処理ID31が「17」の処理単位をノードIDが「001」のノード20に割り当て、処理ID31が「18」の処理単位をノードIDが「002」のノード20に割り当て、処理ID31が「9」または「10」の処理単位をノードIDが「003」のノード20に割り当てる。従って、対応する処理単位のmips36を加算すると、ノードIDが「001」のノード20のCPU負荷は「40」、ノードIDが「002」のノード20のCPU負荷は「30」、ノードIDが「003」のノード20のCPU負荷は、20+20=40と算出される。この時点で、負荷テーブル40は、図18に示す状態になる。
Specifically, the
次に、処理割当部26は、処理割当テーブル30を参照して、node37にデータが登録されていない処理単位の中で、必要な処理能力が最大の処理単位を1つ選択する(S406)。図16の状態では、node37にデータが登録されていない処理単位の中で、mips36に「75」が登録されている処理単位が2つ(処理ID31が「2」または「3」の処理単位)存在する。必要な処理能力が最大の処理単位が複数存在する場合、処理割当部26は、例えば処理ID31が最も小さい処理単位(図15の例では処理ID31が「2」の処理単位)を選択する。
Next, the
次に、処理割当部26は、選択した処理単位が使用するデータの提供元または提供先の処理単位の中で、ノード20に既に割り当てられている処理単位が存在するか否かを判定する(S407)。例えば、図16の処理割当テーブル30では、処理ID31が「2」の処理単位にデータを提供している処理単位は、処理ID31が「5」の処理単位であり、処理ID31が「2」の処理単位は、処理ID31が「18」の処理単位にデータを提供している。処理ID31が「5」または「18」の処理単位の中で、ノード20に既に割り当てられているものは、図16の処理割当テーブル30では処理IDが「18」の処理単位である。
Next, the
選択した処理単位が使用するデータの提供元または提供先の処理単位の中で、ノード20に既に割り当てられている処理単位が存在しない場合(S407:No)、処理割当部26は、ステップS409に示す処理を実行する。一方、選択した処理単位が使用するデータの提供元または提供先の処理単位の中で、ノード20に既に割り当てられている処理単位が存在する場合(S407:Yes)、処理割当部26は、その処理が割り当てられているノード20の許容値および現在の負荷の値を負荷テーブル40から取得し、ステップS406で選択した処理単位に必要な処理能力を処理割当テーブル30から取得する。
When there is no processing unit already assigned to the
そして、処理割当部26は、取得した現在の負荷の値と、ステップS406で選択した処理単位に必要な処理能力の値とを合計し、その合計値が、取得した許容値の所定割合(本実施形態では75%)以上か否かを判定する(S408)。合計値が許容値の所定割合未満である場合(S408:No)、処理割当部26は、ステップS406で選択した処理単位に対応する処理割当テーブル30のnode37に、ステップS407のYesで検出したノード20のノードIDを登録し(S410)、ステップS411に示す処理を実行する。
Then, the
一方、合計値が許容値の所定割合以上となる場合(S408:Yes)、処理割当部26は、負荷テーブル40を参照して、ステップS406で選択した処理単位を、現在の負荷が最も低いノード20のノードIDを特定し、ステップS406で選択した処理単位に対応する処理割当テーブル30のnode37に、特定したノードIDを登録する(S409)。そして、処理割当部26は、負荷テーブル40を参照して、新たに処理単位を割り当てたノード20の現在の負荷に、新たに割り当てた処理単位に必要な処理能力を加算することにより、負荷テーブル40の内容を更新する(S411)。
On the other hand, when the total value is equal to or greater than the predetermined ratio of the allowable value (S408: Yes), the
次に、処理割当部26は、処理割当テーブル30を参照して、全ての処理単位のnode37の欄にノードIDが登録されているか否かを判定することにより、全ての処理単位がノード20に割り当てられたか否かを判定する(S412)。いずれかの処理単位がノード20に割り当てられていない場合(S412:No)、処理割当部26は、再びステップS406に示した処理を実行する。一方、全ての処理単位がノード20に割り当てられている場合(S412:Yes)、処理割当部26は、自ノード20以外のそれぞれのノード20について後述するノード別処理指示の作成処理を実行し(S600)、処理割当部26は、本フローチャートに示した処理の割り当てを終了する。本フローチャートが終了した時点での負荷テーブル40および処理割当テーブル30は、それぞれ、例えば図19および図20のようになる。
Next, the
次に、ノード別処理指示の作成処理(S600)の動作について説明する。図21は、ノード別処理指示の作成処理(S600)の一例を示すフローチャートである。本フローチャートでは、処理割当テーブル30が図20に示した状態にあることを前提として説明を行う。また、本フローチャートに示す処理は、自ノード20以外のそれぞれのノード20について実行されるが、以下では、ノードIDが「002」のノード20についてのノード別処理指示を例に説明する。
Next, the operation of the node-specific process instruction creation process (S600) will be described. FIG. 21 is a flowchart illustrating an example of processing for creating a processing instruction for each node (S600). This flowchart will be described on the assumption that the process allocation table 30 is in the state shown in FIG. The processing shown in this flowchart is executed for each
まず、処理割当部26は、処理割当テーブル30を参照して、未選択の処理単位を1つ選択し(S601)、選択した処理単位の処理単位名称32から、対応するProcessのクラス名を取得し、処理定義を参照して同じクラス名を持つProcessセクションを取得する(S602)。今の場合、ノードIDが「002」であるから、処理ID311が「2」、「5」、「11」、「12」、または「18」の処理単位が見つかる。そして、処理割当部26は、これらの処理単位の中の1つを選択し、例えば、処理ID31が「18」の処理単位を選択した場合、処理単位名称32は「dispatch@card002」であるので、クラス名が「dispatch」であるProcessセクションを取得する。
First, the
次に、処理割当部26は、ステップS602で取得したProcessセクションのProcessUnit属性を参照して、ProcessUnit属性が「device」であるか否かを判定する(S603)。今の場合、処理定義テンプレート(図7)の2行目に「ProcessUnit "device" "communicate"」と記載されており、第一引数が「device」であることから、処理割当部26は、ステップS603においてYesと判定する。
Next, the
この処理単位は、デバイスに対応付けられているため、処理単位の実行にはデバイス情報が必要となる。処理割当部26は、デバイスの情報をパラメタとしてProcessセクションに追加する(S604)。追加するパラメタの名称はProcessUnit属性の第二引数(すなわちデバイス種別)とし、パラメタ値はリソース情報管理テーブル270のリソース情報274に記載されているデバイス識別子とする。具体的には、処理割当部26は、処理割当テーブル30を参照して、ステップS601で選択した処理単位のnode37から処理単位を実行するノードのIDを取得し、取得したノードIDをキーとしてリソース情報管理テーブル270を検索し、当該ノード20のリソース情報を取得する。今の場合、処理単位を実行するノード20のノードIDは「002」であるから、リソース情報管理テーブル270が「002」となっているリソース情報を取得する。処理割当部26は、取得したリソース情報から、comunicateデバイスのデバイス識別子を取得する。その結果、処理割当部26は、「card002」を得る。以上より、処理割当部26は、「Param "communicate" "card2"」をProcessセクションに追加することになる。
Since this processing unit is associated with a device, device information is required to execute the processing unit. The
次に、処理割当部26は、処理単位の名称をProcessセクションにName属性として追加する(S608)。Processセクションには、Processのクラス名が既に記載されているため、処理割当テーブル30の処理単位名称32に記載された名称からProcessのクラス名を削除したものをName属性とする。従って、ここでは、処理割当部26は、「Name "@card002"」を追加することとなる。
Next, the
次に、処理割当部26は、生成したデータを入力データとして処理する処理単位をDestRef属性に設定する(S609)。処理割当部26は、ステップS601で選択した処理単位の処理ID31をデータソース33に持つ処理単位を検索することで、上記処理単位を検索する。今の場合、このような処理単位は見つからないので、処理割当部26は、上記パラメタは設定しない。以上で、処理割当部26は、処理ID31が「18」の処理単位に対してのノード別処理指示が完成する。
Next, the
また、ステップS603において、ステップS602で取得したProcessセクションのProcessUnit属性が「device」でない場合(S603:No)、処理割当部26は、ステップS602で取得したProcessセクションのProcessUnit属性を参照して、ProcessUnit属性が「souce-subprocess」であるか否かを判定する(S605)。ProcessUnit属性が「souce-subprocess」である場合(S605:Yes)、すなわち、ステップS601で処理ID31が「2」の処理単位を選択した場合、Processのクラス名のみの比較では、複数のProcessセクションが取得される。今の場合、処理割当部26は、処理定義本体(図8参照)の6行目〜12行目の部分と、14行目〜21行目の部分とを取得する。処理割当部26は、SourceRef属性に基づき、上記どちらのProcessセクションを使用すべきかを決定する(S606)。
In Step S603, when the ProcessUnit attribute of the Process section acquired in Step S602 is not “device” (S603: No), the
ProcessUnit属性の第一引数が、souce-subprocessの場合、処理単位名称32は、[Processのクラス名]/[データソースのSubProcessのクラス名]@[ データソースのSubProcessのインスタンス名]という命名規則になる。一方、SourceRef属性の第二引数、第三引数にはデータソースのSubProcessのクラス名、SUbProcessのインスタンス名が設定されているので、処理単位名称32とSourceRef属性を比較することで、処理割当部26は、処理定義の対応部分を抽出することができる。今の場合、処理単位名称32からは、データソースのSubProcessのインスタンス名として「area2」を抽出することができるので、このインスタンス名を持つProcessセクションは、処理定義本体の14行目〜21行目の部分であることが分かる。
If the first argument of the ProcessUnit attribute is source-subprocess, the
次に、処理割当部26は、ステップS608に示した処理を実行する。具体的には、処理割当部26は、ProcessセクションのName属性を決定する。今の場合、ProcessセクションのName属性は、「Name "sensor-group@area2"」となる。そして、処理割当部26は、S601で選択した処理単位の処理ID31をデータソース33に持つ処理単位を処理割当テーブル30から検索する。今の場合、処理割当部26は、処理ID31が「18」である処理単位が条件を満たす処理単位として見つける。この処理単位がDestRef属性の設定先となる。処理割当部26は、当該処理単位の処理単位名称32とnode37を参照して、それぞれ、「dispatch@card002」、「002」であることを確認する。また、処理割当部26は、リソース情報管理テーブル270を参照して、当該node37の欄に記載されたデータと同じ値をノードID271に持つエントリを検索し、見つけたエントリのアドレス272を参照することで、ノード20のアドレスを取得する。処理割当部26は、第一引数をノードID、第二引数をノード20のアドレス、第三引数を処理単位の名称として、DestRef属性を設定する。従って、今の場合、処理割当部26は、「DestRef "002" "192.168.10.12" "dispatch@card002"」をProcessセクションに追加することとなる。
Next, the
また、ステップS605において、ステップS602で取得したProcessセクションのProcessUnit属性が「souce-subprocess」でない場合(S605:No)、処理割当部26は、ProcessUnit属性の第一引数が、「subprocess」であると判定する。例えば、処理ID31が「5」の処理単位に対する処理を行う場合、処理割当部26は、ステップS607を実行することになる。処理割当部26は、Processのクラス名の比較で、処理定義本体(図8参照)の23行目〜41行目の部分が取得する。この部分は、複数の処理単位に対する設定情報を含んでいる。ステップS607において、処理割当部26は、SubProcessのインスタンス名に基づき、情報を絞り込む。ProcessUnit属性の第一引数が、subprocessの場合、処理単位は、[Processのクラス名]/[SubProcessのクラス名]@[SubProcessのインスタンス名]という命名規則となる。従って、処理割当部26は、取得したProcessセクション内のSubProcessセクションの第二引数から、対応するSubProcessセクションを決定することができる。今の場合、処理ID31が「5」の処理単位の処理単位名称32は、「cycle/sensor-group@area2」であるので、SubProcessのインスタンス名は「area2」である。従って、処理定義本体の29行目〜34行目が対応するSubProcessとなる。そして、処理割当部26は、Processセクションから不要な他のSubProcessセクションを削除する。
In Step S605, when the ProcessUnit attribute of the Process section acquired in Step S602 is not “souce-subprocess” (S605: No), the
次に、処理割当部26は、S608に示した処理を実行する。処理割当部26は、処理ID31が「11」または「12」の処理単位についても同様に処理を行い、ノードIDが「002」のノード20に対するノード別処理指示を完成させる。ノードIDが「002」のノード20に対するノード別処理指示を例示すると、例えば図22のようになる。なお、ノード別処理指示には、処理定義テンプレートまたは処理定義本体に記載されている、SourceRef属性、ProcessUnit属性、およびRequire属性は記載される必要はなく、処理割当部26は、ノード別処理指示を生成するときにこれら属性を削除する。
Next, the
以上、本発明の第1の実施形態について説明した。 The first embodiment of the present invention has been described above.
上記説明から明らかなように、本実施形態の分散処理システム10によれば、特定のノード20に負荷を集中させることなく、処理間の連携を考慮して複数のノード20に処理を割り当てることができる。
As is clear from the above description, according to the distributed
なお、ユビキタスフロントエンドシステムを構成する全てのノード20が、同時に起動するとは限らないため、マスタノードが全てのノード20のノード別処理指示を生成し、各ノードへノード別処理指示を送信してシステムが動作を開始した後に、新たなノード20が起動する場合がある。また、システムが動作中にセンシングアプリケーション実行部29を稼動させているノード20に障害が発生する場合もある。マスタノードは、上記のようなノード20の増減を検出した場合、構成変更を行い、改めて全体の最適化を行う。具体的には、マスタノードは全てのノード20に、処理の停止を指示した後、図12に示す処理を再度実行し、各ノード20のノード別処理指示を再生成する。構成変更を実施するには、一旦システムの動作を停止する必要があるため、頻繁に構成変更を行うことは好ましくない。従って、マスタノードは、新規にノード20を検出した場合は、ノード検出後、一定時間経過した後に構成変更を行う。一方、センシングアプリケーション実行部29が動作中のノード20に障害が発生した場合、そのままにしておくとシステムの機能が損なわれてしまうため、マスタノードは、直ちに構成変更を行う。
Since not all
次に、本発明の第2の実施形態について説明する。 Next, a second embodiment of the present invention will be described.
図23は、第2の実施例における分散処理システム50の一例を示すシステム構成図である。分散処理システム50は、LAN52に接続された複数のノード60を備える。それぞれのノード60は、複数のグループ毎にサブネット51に属している。それぞれのサブネット51は、ルータ53を介して接続されている。それぞれのノード60は、複数の他のノード60との間で、PAXOSプロトコルを使った分散合意の処理を行う。
FIG. 23 is a system configuration diagram showing an example of the distributed
図24は、第2の実施形態におけるノード60の機能構成の一例を示すブロック図である。ノード60は、ノードID格納部61、ID通知部62、ID登録部63、および分散合意処理部64を有する。ノードID格納部61には、例えば図25に示すように、それぞれのノード60を識別するノードID611およびそれぞれのノード60のアドレス612を、LAN52を介して他のノード60から受信した受信時刻610に対応付けて格納する。
FIG. 24 is a block diagram illustrating an example of a functional configuration of the
ID通知部62は、ノード60が起動した場合に、自ノード60のノードIDおよびアドレスを、LAN52を介して例えばブロードキャストにより他のノード60へ送信する。ID登録部63は、LAN52を介して他のノード60からノードIDおよびアドレスを受信した場合に、受信したノードIDおよびアドレスを、受信時刻に対応付けてノードID格納部61に登録する。なお、それぞれのサブネット51内の少なくとも1つのノード60には、他のサブネット51内の少なくとも1つのノード60のIPアドレスが設定されており、それぞれのサブネット51内のノードの情報は、他のサブネット51内の少なくとも1つのノード60に伝達されるようになっている。
When the
分散合意処理部64は、ノード60の起動後に、ノードID格納部61内のノードIDの登録数の増加率を測定し、増加率が上昇から下降に転じた後に、当該増加率が、当該増加率の最大値から予め定められた割合だけ低い増加率となった場合に、その時点でノードID格納部61に登録されているノードIDの数を、分散合意アルゴリズムにおける定足数として、分間合意アルゴリズムを用いた処理を開始する。
The distributed
ここで、ユビキタスフロントエンドシステムが多数のノード60から構成される場合、一般にはネットワーク負荷を分散させるため、図23に示すように、システムを複数のサブネットに分離した構成にする場合が多い。一方、ブロードキャストパケットにはネットワークアドレスが含まれており、ブロードキャストパケットは、ブロードキャストパケットが有するネットワークアドレス内の全ノード60に届くが、ネットワークが複数のサブネットで構成される場合、ブロードキャストパケットは、発信元のサブネット内にしか届かない。
Here, when the ubiquitous front-end system is composed of a large number of
そのため、複数のサブネットから構成されるシステムでネットワーク全体へのブロードキャストを行うためには、全てのサブネットに対してブロードキャストパケットを送信する必要がある。そのためには、全てのサブネットのネットワークアドレスを予め全てのノード60に設定しておく必要があり、システム構築作業が煩雑になる。また、全てのノード60が、全てのサブネットに対してブロードキャストパケットを送信するとネットワーク負荷が増大するという課題もある。
Therefore, in order to broadcast to the entire network in a system composed of a plurality of subnets, it is necessary to transmit broadcast packets to all subnets. For that purpose, it is necessary to set the network addresses of all subnets in advance to all the
この課題を解決する手法として、大規模な分散システムではシステムを構成するノード60同士が、ノード情報(ノード識別子とアドレス)を定期的に交換することで、ノード検出を行う方法がある。つまり、直接ノード情報を知らないノード同士が、他のノード60を経由して芋づる式にノード情報を交換していく方式である。あるノード60が他のノード60のノード情報を保持する状態をエッジ(枝)とみなすと、システム全体をグラフ構造と考えることができる。このようなノード検出手法では、初期状態でグラフを構成する各ノード60同士がどこかのエッジで相互接続されている、連結グラフになっていれば、全てのノード60がノード検出を行うことができる。
As a technique for solving this problem, there is a method of detecting a node by regularly exchanging node information (node identifier and address) between
従って、グラフが連結グラフになるように各ノード60に他のノード60のノード情報を予め設定しておけば、一定時間後、全てのノード60が他の全てのノード60を検出した状態になる。また、各ノード60は、停止するときに、これまで検出したノード60の情報をフラッシュROM等の不揮発性メモリに記録しておき、次回起動時に当該メモリからノード情報を読み出して通信を再開する。これによって次回起動時は、ノード情報の設定が不要となる。また次回起動時に、システムの構成変更によって一部のノード60のアドレスが変化したり、ノード60の増減があった場合も、変更されていない情報に基づき変更部分を検出することが可能となる。従って、システム構築時に設定作業が発生するが、一旦設定を行えば、その後のシステムの保守は不要になる。
Accordingly, if node information of
一方、PAXOSプロトコルによる分散合意を行うには定足数が必要である。通常、定足数は全ノード数の過半数とするため、各ノード60は全ノード数を知っておく必要がある。前記した第1の実施形態では、各ノード60に全ノード数を設定することにしていたが、ノード数が増えると各ノード60への設定は煩雑になる。また、システム変更を行い、ノード数が変更された場合、全てのノード60に対して再設定を行う必要がある。
On the other hand, a quorum is required to make a distributed agreement using the PAXOS protocol. Usually, since the quorum is a majority of the total number of nodes, each
システムが1つのサブネット内に収まる場合は、ブロードキャストパケットの送信周期だけ待てば全てのノード60を検出することが可能であるため、これによってそれぞれのノード60は全ノード数を知ることができる。しかし、上記のようにシステムが複数のサブネットから構成されており、ノード同士がノード情報を交換することでノード検出を行う場合には、どの程度待てば全ノード数を検出した状態になるのか不明である。
When the system is within one subnet, it is possible to detect all the
このような課題に対して本実施形態では、各ノード60が検出したノード数の時間変化を記録しておき、検出したノード数の時間変化に基づき、全ノード数を予測し、PAXOSプロトコルで使用する定足数を決定する。
In this embodiment, the time change of the number of nodes detected by each
図26〜図28に、ノード60同士がノード情報を交換する方式でノード検出を行った場合のシミュレーション結果を示す。図26〜図28では、検出したノード数の時間変化が「+」でプロットされ、それを微分した値(増加率)が「×」でプロットされている。グラフの縦軸は検出されたノード数、横軸はステップ数である。本シミュレーションでは、1ステップ毎に、各ノード60がノード情報を送信するノード60を検出済みのノード60の中から1つ選択し、自ノード60と検出済みのノード60のノード情報を一定個数、選択したノード60へ送信する操作を行うこととした。送信する検出済みのノード60のノード情報と、送信先のノード60は、ランダムに選択することとした。
FIGS. 26 to 28 show simulation results when the
図26は、全ノード数が256、サブネット数が16、各サブネット内のノード数が16、一回のノード交換で交換するノード情報の数が4という条件でシミュレーションを行った結果である。サブネット内では、ブロードキャストにより容易にノード60の相互検出が可能であるため、初期状態としてサブネット内のノードは相互検出しているものとした。サブネット間を跨るノード情報の送信については、i番目(i=1〜15)のサブネット内の1つのノード60がi+1番目のサブネット内の1つのノード60のノード情報を保持し、16番目のサブネット内の1つのノード60が1番目のサブネット内の1つのノード60のノード情報を保持していることとした。
FIG. 26 shows the result of simulation under the conditions that the total number of nodes is 256, the number of subnets is 16, the number of nodes in each subnet is 16, and the number of node information to be exchanged by one node exchange is 4. Since mutual detection of the
図27は、全ノード数が256、サブネット数が16、各サブネット内のノード数が16、一回のノード交換で交換するノード情報の数が8という条件でシミュレーションを行った結果である。図27においても、初期状態として、各サブネット内のノード60は相互検出しているという条件でシミュレーションを行った。また、サブネット間を跨るノード情報の送信については、i番目(i=1〜15)のサブネット内の1つのノード60がi+1番目のサブネット内の1つのノード60のノード情報を保持し、16番目のサブネット内の1つのノード60が1番目のサブネット内の1つのノード60のノード情報を保持していることとした。
FIG. 27 shows the result of simulation under the condition that the total number of nodes is 256, the number of subnets is 16, the number of nodes in each subnet is 16, and the number of node information to be exchanged in one node exchange is 8. Also in FIG. 27, as an initial state, the simulation was performed under the condition that the
図28は、全ノード数が256、サブネット数が8、各サブネット内のノード数が32、一回のノード交換で交換するノード情報の数が8という条件でシミュレーションを行った結果である。図28においても、初期状態として、各サブネット内のノード60は相互に検出しているという条件でシミュレーションを行った。また、サブネット間を跨るノード情報の送信については、i番目(i=1〜7)のサブネット内の1つのノード60がi+1番目のサブネット内の1つのノード60のノード情報を保持し、8番目のサブネット内の1つのノード60が1番目のサブネット内の1つのノード60のノード情報を保持していることとした。
FIG. 28 shows the result of simulation under the condition that the total number of nodes is 256, the number of subnets is 8, the number of nodes in each subnet is 32, and the number of node information to be exchanged by one node exchange is 8. Also in FIG. 28, the simulation was performed under the condition that the
図26〜図28に示したシミュレーション結果はいずれも、「×」でプロットされたノード検出の増加率が最大値に達するときに、全ノード数の約半数を検出する特徴を示している。ノード検出の増加率が減少に転じたときには、全ノード数の半数以上を検出しているはずであるから、そのときに検出しているノード数をPAXOSプロトコルの定足数とすればよいことがわかる。 Each of the simulation results shown in FIGS. 26 to 28 shows a feature of detecting about half of the total number of nodes when the increase rate of the node detection plotted with “x” reaches the maximum value. When the increase rate of node detection starts to decrease, it should be understood that more than half of the total number of nodes should be detected, so that the number of nodes detected at that time may be used as the quorum of the PAXOS protocol.
本実施形態において、分散合意処理部64は、例えば図29に示すように、自ノード60の起動後に、ノードID格納部61内のノードIDの登録数の増加率を測定する。そして、分散合意処理部64は、当該増加率が上昇から下降に転じた後に、当該増加率が、当該増加率の最大値から予め定められた割合(図29の例では70%)だけ低い増加率となった場合に、その時点(図29のt0の時点)でノードID格納部61に登録されているノードIDの数を、分散合意アルゴリズムにおける定足数として、分間合意アルゴリズムを用いた処理を開始する。これにより、全ノード数が判明するt0の時点まで待つことなく、分散合意処理部64は、t0の時点で迅速にPAXOSプロトコルを使った分散合意の処理を開始することができる。
In this embodiment, the distributed
図30は、第2の実施形態におけるノード60の動作の一例を示すフローチャートである。例えば、電源が投入される等の所定のタイミングで、ノード60は、本フローチャートに示す動作を開始する。
FIG. 30 is a flowchart illustrating an example of the operation of the
まず、ID通知部62は、自ノード60のノードIDおよびアドレスをLAN52を介して他のノード60に通知する(S700)。そして、ID登録部63は、LAN52を介して他のノード60からノードIDおよびアドレスを受信したか否かを判定する(S701)。他のノード60からノードIDおよびアドレスを受信していない場合(S701:No)、ID登録部63は、他のノード60からノードIDおよびアドレスを受信するまでステップS701を繰り返す。一方、他のノード60からノードIDおよびアドレスを受信した場合(S701:Yes)、ID登録部63は、受信したノードIDおよびアドレスを、受信時刻に対応付けてノードID格納部61に登録する(S702)。
First, the
次に、分散合意処理部64は、ノードID格納部61に登録されているノードIDの登録数の増加率を算出し(S703)、増加率が上昇から下降に転じたか否かを判定する(S704)。増加率が上昇から下降に転じた場合(S704:Yes)、分散合意処理部64は、増加率が最大値から所定割合以下(例えば最大値の70%以下)になったか否かを判定する(S705)。増加率が上昇から下降に転じていない場合(S704:No)、または、増加率が最大値から所定割合以下になっていない場合(S705:No)、ID登録部63は、再びステップS701に示した処理を実行する。増加率が最大値から所定割合以下になった場合(S705:Yes)、ID登録部63は、ノードID格納部61を参照し、現在のノード数を定足数として分散合意処理を開始し(S706)、ノード60は、本フローチャートに示す動作を終了する。
Next, the distributed
以上、本発明の第2の実施形態について説明した。 The second embodiment of the present invention has been described above.
なお、本発明は、上記した実施形態に限定されるものではなく、その要旨の範囲内で数々の変形が可能である。 In addition, this invention is not limited to above-described embodiment, Many deformation | transformation are possible within the range of the summary.
例えば、上記した第1の実施形態において、マスタ決定部25は、マスタノードの決定において、製造年月日が最も新しいノード20をマスタノードとして提案するが、本発明はこれに限られない。他の形態として、マスタ決定部25は、自ノード20をマスタノードとして提案してもよく、ノードIDまたはアドレスの値が最も小さいノード20をマスタノードとして提案してもよい。
For example, in the first embodiment described above, the
また、マスタ決定部25は、処理割当テーブル30に登録されているリソース情報を参照して、CPU以外のリソースの情報が少ないノード20をマスタノードとして提案するようにしてもよい。マスタノードの信頼性を向上する方法の1つとして、マスタノードがマスタノードとしての処理以外を行わないことが挙げられる。CPU以外のリソースを持つノード20は、そのリソースを利用した処理(マスタノードとしての処理以外の処理)を割り当てることができ、マスタ以外のノード20として動作させることが好ましい。例えば、通信手段を備えるノード20ではディスパッチャ290を稼動させ、データ収集サーバと通信させる。また、センサ14が接続されたノード20ではアダプタ293を稼動させ、センサ14の制御処理を行わせる。これにより、複数のノード20に効率よく処理を割り当てることができる。
In addition, the
また、それぞれのノード20に、自ノード20の障害を検出する障害発生検出部をさらに設け、リソース情報送信部21は、当該障害発生検出部によって自ノード20に障害が発生したことが検出された場合に、次のリソース情報の送信タイミングで、リソース情報内に障害の発生を示す障害情報を含めて送信するようにしてもよい。この場合、リソース情報登録部22は、リソース情報に障害情報が含まれている場合に、障害情報以外のリソース情報でリソース情報管理テーブル270内の対応する情報を上書きすると共に、当該障害情報を障害履歴としてリソース情報管理テーブル270に追加登録する。そして、マスタ決定部25は、マスタノードを提案する場合に、リソース情報管理テーブル270を参照して、登録されている障害情報が少ないノード20をマスタノードとして提案する。これにより、より信頼性の高いノード20をマスタノードとして提案することができる。
Each
また、それぞれのノード20に、自ノード20の稼働環境を測定し、稼働環境が悪い場合に高い数値を示す環境値を出力する環境測定部をさらに設け、リソース情報送信部21は、当該環境測定部が出力した環境値をリソース情報内に含めて他の情報処理装置へ送信するようにしてもよい。環境測定部は、例えば、稼働中の温度や湿度等が、予め設定された許容範囲から外れている度合いを数値として出力する。マスタノードを提案する場合、マスタ決定部25は、リソース情報管理テーブル270を参照して、リソース情報に含まれている環境値が低いノード20をマスタノードとして提案する。これにより、より稼働環境の良好なノード20をマスタノードとして提案することができるため、より故障する可能性の低いノード20をマスタノードとして提案することができる。
Each
また、上記した第1の実施形態では、分散合意における定足数は管理者等によってそれぞれのノード20に予め設定されていたが、他の形態として、第1の実施形態において、上記した第2の実施形態の方法を用いるようにしてもよい。
In the first embodiment described above, the quorum in the distributed agreement is set in advance in each
10・・・分散処理システム、11・・・コンソール、12・・・計算機用LAN、13・・・センサ用LAN、14・・・センサ、15・・・アンテナ、20・・・ノード、21・・・リソース情報送信部、22・・・リソース情報登録部、23・・・履歴情報格納部、24・・・履歴情報管理部、25・・・マスタ決定部、26・・・処理割当部、27・・・リソース情報格納部、28・・・スレーブ処理部、29・・・センシングアプリケーション実行部、290・・・ディスパッチャ、291・・・フィルタ、292・・・駆動制御、293・・・アダプタ、200・・・RAM、201・・・ROM、202・・・CPU、203・・・入出力インターフェイス、204・・・無線インターフェイス、205・・・LANインターフェイス、206・・・LANインターフェイス、207・・・メディアインターフェイス、208・・・センサインターフェイス、210・・・ディスプレイ、211・・・キーボード、212・・・マウス、213・・・記録媒体、30・・・処理割当テーブル、31・・・処理ID、32・・・処理単位名称、33・・・データソース、34・・・event/sec、35・・・device、36・・・mips、37・・・node、40・・・負荷テーブル、41・・・ノードID、42・・・許容値、43・・・現在の負荷、50・・・分散処理システム、51・・・サブネット、52・・・LAN、53・・・ルータ、60・・・ノード、61・・・ノードID格納部、62・・・ID通知部、63・・・ID登録部、64・・・分散合意処理部
DESCRIPTION OF
Claims (15)
それぞれの情報処理装置は、
それぞれの情報処理装置を識別するノードIDに対応付けて、当該情報処理装置が有するリソースの情報を格納するリソース情報格納部と、
情報処理装置に割り当てる処理の単位である処理単位を識別する処理ID毎に、当該処理単位が処理するデータを提供する処理単位の処理ID、および、当該処理単位に必要な処理能力を定義する処理定義を格納する処理定義格納部と、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定するマスタ決定部と、
自装置がマスタとなった場合に、自装置以外のそれぞれの情報処理装置について、前記リソース情報格納部および前記処理定義格納部を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信する処理割当部と
を有することを特徴とする分散処理システム。 A distributed processing system comprising a plurality of information processing devices connected to each other through a network, each information processing device operating in cooperation with each other,
Each information processing device
A resource information storage unit that stores information about resources of the information processing apparatus in association with a node ID for identifying each information processing apparatus;
For each process ID that identifies a process unit to be assigned to an information processing apparatus, a process ID for a process unit that provides data to be processed by the process unit, and a process that defines the processing capability required for the process unit A process definition storage for storing definitions;
A master determination unit that determines a master among a plurality of information processing devices using a distributed agreement algorithm;
When the own device becomes the master, for each information processing device other than the own device, refer to the resource information storage unit and the process definition storage unit, and for each information processing device other than the own device, The processing unit for processing data and the processing unit of the data providing source are allocated to the same information processing device within the range of the resource processing capability of the information processing device, and the allocation result is sent to each information processing unit via the network. A distributed processing system comprising: a processing allocation unit that transmits to a device.
前記処理割当部は、
必要な処理能力が大きい処理単位から順に、処理単位を情報処理装置に割り当てることを特徴とする分散処理システム。 The distributed processing system according to claim 1,
The process allocation unit
A distributed processing system, wherein processing units are assigned to information processing devices in order from processing units having a large required processing capacity.
ぞれぞれの前記情報処理装置が有するリソースには、前記ネットワークを介さずに接続されているデバイスが含まれ、
前記処理定義には、
前記ネットワークを介さずに接続されている特定のデバイスと同数の処理単位が作成されるべきデバイス依存処理と、
当該デバイス依存処理に応じて作成される処理単位のいずれかが処理するデータの提供元の処理単位の処理IDと、
処理ID毎の、単位時間当たりの実行回数を示すsensor-event値と、
処理ID毎の、単位時間当たりに実行されるイベントに必要な処理能力を示すmips値と
がさらに定義されており、
前記処理割当部は、
前記処理定義に前記デバイス依存処理が記述されている場合に、前記リソース情報格納部を参照し、前記ネットワークを介さずに接続されている特定のデバイスと同数の処理単位を新たに作成し、新たに作成したそれぞれの処理単位に、当該処理単位が処理するデータを提供する処理単位の処理IDを対応付け、対応付けた処理単位の処理IDに対応付けられているsensor-event値と、新たに作成した処理単位に対応付けられているmips値とを乗算することにより、新たに作成したそれぞれの処理単位に必要な処理能力を算出し、自装置がマスタとなった場合に、前記処理定義および新たに作成した処理単位毎に必要な処理能力を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信することを特徴とする分散処理システム。 The distributed processing system according to claim 1 or 2,
Each resource that the information processing apparatus has includes a device connected without going through the network,
The process definition includes
Device-dependent processing in which the same number of processing units as a specific device connected without going through the network are to be created;
A processing ID of a processing unit of a data providing source to be processed by any of the processing units created according to the device-dependent processing;
Sensor-event value indicating the number of executions per unit time for each process ID;
A mips value indicating the processing capability required for an event executed per unit time for each processing ID is further defined.
The process allocation unit
When the device-dependent processing is described in the processing definition, the resource information storage unit is referred to and a processing unit is newly created as many as the specific devices connected without the network. Each process unit created is associated with a process ID of a process unit that provides data to be processed by the process unit, a sensor-event value associated with the process ID of the associated process unit, and a new By multiplying the mips value associated with the created processing unit, the processing capacity required for each newly created processing unit is calculated, and when the own device becomes the master, the processing definition and With reference to the processing capability required for each newly created processing unit, for each information processing device other than its own device, within the range of the resource processing capability of the information processing device, A distributed processing system, wherein a processing unit for processing data and a processing unit of a provider of the data are allocated to the same information processing apparatus, and an allocation result is transmitted to each information processing apparatus via a network.
前記処理割当部は、
前記ネットワークを介さずに接続されている特定のデバイスの数と同数の処理単位を新たに作成した場合に、新たに作成した処理単位が複数存在するならば、当該新たに作成した複数の処理単位の処理負荷が均等になるように、当該処理単位に、当該処理単位が処理するデータの提供元の処理単位の処理IDを対応付けることを特徴とする分散処理システム。 The distributed processing system according to claim 3,
The process allocation unit
If a number of newly created processing units exist when the same number of processing units as the number of specific devices connected without going through the network are present, the plurality of newly created processing units The distributed processing system is characterized by associating a processing ID of a processing unit of a data supply source processed by the processing unit with the processing unit so that the processing load of the processing unit becomes equal.
前記処理割当部は、
前記ネットワークを介さずに接続されている特定のデバイスの数と同数の処理単位を新たに作成した場合に、新たに作成した処理単位が複数存在するならば、当該新たに作成した処理単位に対応する特定のデバイスの処理能力の範囲内で、当該新たに作成したいずれかの処理単位に負荷が集中するように、当該処理単位に、当該処理単位が処理するデータの提供元の処理単位の処理IDを対応付けることを特徴とする分散処理システム。 The distributed processing system according to claim 3,
The process allocation unit
Corresponding to the newly created processing unit if there are multiple newly created processing units when the same number of processing units as the number of specific devices connected without going through the network are created Processing within the processing unit of the data providing source processed by the processing unit so that the load is concentrated on one of the newly created processing units within the range of the processing capability of the specific device A distributed processing system characterized by associating IDs.
自装置のリソース情報を第1の時間毎にネットワークを介して他の情報処理装置へ送信するリソース情報送信部と、
他の情報処理装置からリソース情報を受信した場合に、受信したリソース情報を前記リソース情報格納部に登録するリソース情報登録部と
をさらに備えることを特徴とする分散処理システム。 The distributed processing system according to any one of claims 1 to 5, wherein a resource information transmission unit that transmits resource information of the own device to another information processing device via a network every first time;
A distributed processing system, further comprising: a resource information registration unit that registers received resource information in the resource information storage unit when resource information is received from another information processing apparatus.
前記リソース情報登録部は、
前記リソース情報格納部内に登録されているリソース情報を監視し、前記第1の時間よりも長い第2の時間以内に上書きされないリソース情報を前記リソース情報格納部から削除することを特徴とする分散処理システム。 The distributed processing system according to claim 6,
The resource information registration unit
Distributed processing characterized by monitoring resource information registered in the resource information storage unit and deleting resource information not overwritten within a second time longer than the first time from the resource information storage unit system.
前記リソース情報送信部は、
前記リソース情報と共に、自装置の製造年月日を示す情報を1の時間毎に他の情報処理装置へ送信し、
前記リソース情報登録部は、
他の情報処理装置から受信した製造年月日を前記リソース情報格納部にさらに登録し、
前記マスタ決定部は、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定する場合に、前記リソース情報格納部を参照して、製造年月日が最新の情報処理装置をマスタとして提案することを特徴とする分散処理システム。 The distributed processing system according to claim 6 or 7,
The resource information transmitter
Along with the resource information, information indicating the date of manufacture of the own device is transmitted to another information processing device every one hour,
The resource information registration unit
Further registering the manufacturing date received from another information processing apparatus in the resource information storage unit,
The master determination unit
When determining a master among a plurality of information processing devices using a distributed agreement algorithm, the resource information storage unit is referred to, and an information processing device having the latest manufacturing date is proposed as a master Distributed processing system.
自装置の障害を検出する障害発生検出部をさらに備え、
前記リソース情報送信部は、
前記障害発生検出部によって自装置に障害が発生したことが検出された場合に、次のリソース情報の送信タイミングで、リソース情報内に障害の発生を示す障害情報を含め、
前記リソース情報登録部は、
前記リソース情報に障害情報が含まれている場合に、障害情報以外のリソース情報で前記リソース情報格納部内の対応する情報を上書きすると共に、当該障害情報を障害履歴として前記リソース情報格納部に追加保存し、
前記マスタ決定部は、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定する場合に、前記リソース情報格納部を参照して、登録されている障害情報が少ない情報処理装置をマスタとして提案することを特徴とする分散処理システム。 The distributed processing system according to claim 6 or 7,
It further includes a failure occurrence detection unit that detects a failure of the own device,
The resource information transmitter
When the failure detection unit detects that a failure has occurred in its own device, it includes failure information indicating the occurrence of failure in the resource information at the next resource information transmission timing,
The resource information registration unit
When failure information is included in the resource information, the corresponding information in the resource information storage unit is overwritten with resource information other than the failure information, and the failure information is additionally stored in the resource information storage unit as a failure history. And
The master determination unit
When determining a master among a plurality of information processing devices using a distributed agreement algorithm, the resource information storage unit is referred to and an information processing device with less registered failure information is proposed as a master. Distributed processing system.
自装置の稼働環境を測定し、稼働環境が悪い場合に高い数値を示す環境値を出力する環境測定部をさらに備え、
前記リソース情報送信部は、
前記環境測定部が出力した環境値をリソース情報内に含めて他の情報処理装置へ送信し、
前記マスタ決定部は、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定する場合に、前記リソース情報格納部を参照して、リソース情報に含まれている環境値が低い情報処理装置をマスタとして提案することを特徴とする分散処理システム。 The distributed processing system according to claim 6 or 7,
It further includes an environment measurement unit that measures the operating environment of its own device and outputs an environmental value indicating a high numerical value when the operating environment is bad,
The resource information transmitter
The environment value output by the environment measurement unit is included in the resource information and transmitted to another information processing device,
The master determination unit
When determining a master among a plurality of information processing devices using a distributed agreement algorithm, refer to the resource information storage unit and propose an information processing device having a low environment value included in the resource information as a master A distributed processing system characterized by
前記マスタ決定部は、
自装置が起動してからの前記リソース情報格納部内のリソース情報の登録数の増加率を算出し、当該増加率が上昇から下降に転じた後に、当該増加率が、当該増加率の最大値から予め定められた割合だけ低い増加率となった場合に、その時点の情報処理装置の台数を、分散合意アルゴリズムにおける定足数として分間合意アルゴリズムを用いたマスタの決定処理を開始することを特徴とする分散処理システム。 The distributed processing system according to any one of claims 6 to 10,
The master determination unit
After calculating the increase rate of the registered number of resource information in the resource information storage unit after the own device is started, and after the increase rate has changed from rising to falling, the increasing rate is determined from the maximum value of the increasing rate. A distribution characterized in that, when the rate of increase is low by a predetermined rate, the master determination process using the minute agreement algorithm is started with the number of information processing devices at that time as a quorum in the distributed agreement algorithm Processing system.
それぞれの情報処理装置が、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定するマスタ決定ステップと、
自装置がマスタとなった場合に、自装置以外のそれぞれの情報処理装置について、それぞれの情報処理装置を識別するノードIDに対応付けて、当該情報処理装置が有するリソースの情報を格納するリソース情報格納部、ならびに、情報処理装置に割り当てる処理の単位である処理単位を識別する処理ID毎に、当該処理単位が処理するデータを提供する処理単位の処理ID、および、当該処理単位に必要な処理能力を定義する処理定義を格納する処理定義格納部を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信する処理割当ステップと
を実行することを特徴とする処理割当方法。 A processing allocation method in a distributed processing system in which information processing apparatuses connected to each other operate in cooperation with each other,
Each information processing device
A master determination step for determining a master among a plurality of information processing devices using a distributed agreement algorithm;
Resource information for storing information on resources of the information processing apparatus in association with a node ID for identifying each information processing apparatus for each information processing apparatus other than the own apparatus when the own apparatus becomes a master For each processing ID that identifies a processing unit that is a unit of processing assigned to the storage unit and the information processing apparatus, a processing ID of a processing unit that provides data to be processed by the processing unit, and a process required for the processing unit A process for processing data within the range of the resource processing capability of the information processing device for each information processing device other than its own device with reference to the processing definition storage unit that stores the processing definition that defines the capability The unit and the processing unit of the data providing source are allocated to the same information processing apparatus, and the allocation result is transmitted to each information processing apparatus via the network. Processing assignment method characterized by and a process allocation step signal to.
それぞれの情報処理装置を識別するノードIDに対応付けて、当該情報処理装置が有するリソースの情報を格納するリソース情報格納部と、
情報処理装置に割り当てる処理の単位である処理単位を識別する処理ID毎に、当該処理単位が処理するデータを提供する処理単位の処理ID、および、当該処理単位に必要な処理能力を定義する処理定義を格納する処理定義格納部と、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定するマスタ決定部と、
自装置がマスタとなった場合に、自装置以外のそれぞれの情報処理装置について、前記リソース情報格納部および前記処理定義格納部を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信する処理割当部と
を備えることを特徴とする情報処理装置。 Information processing devices used in a distributed processing system in which information processing devices connected to each other operate in cooperation with each other,
A resource information storage unit that stores information about resources of the information processing apparatus in association with a node ID for identifying each information processing apparatus;
For each process ID that identifies a process unit to be assigned to an information processing apparatus, a process ID for a process unit that provides data to be processed by the process unit, and a process that defines the processing capability required for the process unit A process definition storage for storing definitions;
A master determination unit that determines a master among a plurality of information processing devices using a distributed agreement algorithm;
When the own device becomes the master, for each information processing device other than the own device, refer to the resource information storage unit and the process definition storage unit, and for each information processing device other than the own device, The processing unit for processing data and the processing unit of the data providing source are allocated to the same information processing device within the range of the resource processing capability of the information processing device, and the allocation result is sent to each information processing unit via the network. An information processing apparatus comprising: a process allocation unit that transmits the apparatus to the apparatus.
前記情報処理装置が、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定するマスタ決定ステップと、
自装置がマスタとなった場合に、自装置以外のそれぞれの情報処理装置について、それぞれの情報処理装置を識別するノードIDに対応付けて、当該情報処理装置が有するリソースの情報を格納するリソース情報格納部、ならびに、処理単位を識別する処理ID毎に、当該処理単位が処理するデータを提供する処理単位の処理ID、および、当該処理単位に必要な処理能力を定義する処理定義を格納する処理定義格納部を参照し、自装置以外のそれぞれの情報処理装置に対して、当該情報処理装置が有するリソースの処理能力の範囲内で、データを処理する処理単位と当該データの提供元の処理単位とを同一の情報処理装置に割り当て、割当結果をネットワークを介してそれぞれの情報処理装置へ送信する処理割当ステップと
を実行することを特徴とする処理割当方法。 A processing allocation method in an information processing apparatus used in a distributed processing system in which information processing apparatuses connected to each other in a network operate in cooperation with each other,
The information processing apparatus is
A master determination step for determining a master among a plurality of information processing devices using a distributed agreement algorithm;
Resource information for storing information on resources of the information processing apparatus in association with a node ID for identifying each information processing apparatus for each information processing apparatus other than the own apparatus when the own apparatus becomes a master For each process ID for identifying a storage unit and a process unit, a process ID for a process unit that provides data to be processed by the process unit, and a process definition that defines a processing capability required for the process unit With reference to the definition storage unit, for each information processing device other than its own device, the processing unit for processing the data and the processing unit of the data providing source within the range of the resource processing capability of the information processing device To the same information processing apparatus and execute a process allocation step for transmitting the allocation result to each information processing apparatus via the network. Processing assignment method characterized.
それぞれの情報処理装置は、
他の情報処理装置の識別情報を格納する識別情報格納部と、
自装置が起動した場合に、他の情報処理装置に自装置の識別情報を通知する識別情報通知部と、
他の情報処理装置から受信した識別情報を前記識別情報格納部に格納する識別情報登録部と、
自装置が起動してからの前記識別情報格納部内の識別情報の登録数の増加率を算出し、当該増加率が上昇から下降に転じた後に、当該増加率が、当該増加率の最大値から予め定められた割合だけ低い増加率となった場合に、その時点で前記識別情報格納部に格納されている識別情報の数を、分散合意アルゴリズムにおける定足数として、分間合意アルゴリズムを用いた処理を開始する分散合意処理部と
を備えることを特徴とする分散処理システム。 A distributed processing system in which information processing apparatuses connected to each other operate in cooperation with each other,
Each information processing device
An identification information storage unit for storing identification information of other information processing apparatuses;
An identification information notification unit for notifying other information processing devices of the identification information of the own device when the own device is activated;
An identification information registration unit that stores identification information received from another information processing apparatus in the identification information storage unit;
After calculating the increase rate of the number of registered identification information in the identification information storage unit after the own device is activated, and after the increase rate has changed from rising to falling, the increasing rate is determined from the maximum value of the increasing rate. When the rate of increase is low by a predetermined rate, the number of pieces of identification information stored in the identification information storage unit at that time is used as a quorum in the distributed agreement algorithm, and processing using the minute agreement algorithm is started. And a distributed agreement processing unit.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008293979A JP2010122773A (en) | 2008-11-18 | 2008-11-18 | Distributed processing system, method of allocating processing, and information processing apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2008293979A JP2010122773A (en) | 2008-11-18 | 2008-11-18 | Distributed processing system, method of allocating processing, and information processing apparatus |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2010122773A true JP2010122773A (en) | 2010-06-03 |
Family
ID=42324081
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2008293979A Pending JP2010122773A (en) | 2008-11-18 | 2008-11-18 | Distributed processing system, method of allocating processing, and information processing apparatus |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2010122773A (en) |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012081061A (en) * | 2010-10-12 | 2012-04-26 | Ibaraki Univ | Flexible metal foil tape for tissue adhesion, and its adhesion method |
JP2012088873A (en) * | 2010-10-19 | 2012-05-10 | Hitachi Ltd | Communications system and communications method |
KR20150005547A (en) * | 2012-04-20 | 2015-01-14 | 마이크로소프트 코포레이션 | Binding crud-type protocols in distributed agreement protocols |
CN104462172A (en) * | 2013-09-16 | 2015-03-25 | 安讯士有限公司 | Method executed by device in distributed control system and device in distributed control system |
WO2015186191A1 (en) * | 2014-06-03 | 2015-12-10 | 株式会社日立製作所 | Data management system and data management method |
JP2016154316A (en) * | 2015-02-20 | 2016-08-25 | 日本電信電話株式会社 | Information processing method, information processing system, and mobile terminal |
JP2018121189A (en) * | 2017-01-25 | 2018-08-02 | 株式会社ダイヘン | Device including communication function, system including the device, and number of device searching method |
WO2022190624A1 (en) * | 2021-03-10 | 2022-09-15 | ソニーグループ株式会社 | Information processing system, information processing method, program, and cluster system |
-
2008
- 2008-11-18 JP JP2008293979A patent/JP2010122773A/en active Pending
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2012081061A (en) * | 2010-10-12 | 2012-04-26 | Ibaraki Univ | Flexible metal foil tape for tissue adhesion, and its adhesion method |
JP2012088873A (en) * | 2010-10-19 | 2012-05-10 | Hitachi Ltd | Communications system and communications method |
US10193951B2 (en) | 2012-04-20 | 2019-01-29 | Microsoft Technology Licensing, Llc | Binding CRUD-type protocols in distributed agreement protocols |
KR20150005547A (en) * | 2012-04-20 | 2015-01-14 | 마이크로소프트 코포레이션 | Binding crud-type protocols in distributed agreement protocols |
JP2015520440A (en) * | 2012-04-20 | 2015-07-16 | マイクロソフト コーポレーション | Binding CRUD type protocol in distributed agreement protocol |
KR101996624B1 (en) | 2012-04-20 | 2019-07-04 | 마이크로소프트 테크놀로지 라이센싱, 엘엘씨 | Binding crud-type protocols in distributed agreement protocols |
CN104462172A (en) * | 2013-09-16 | 2015-03-25 | 安讯士有限公司 | Method executed by device in distributed control system and device in distributed control system |
JP2015057696A (en) * | 2013-09-16 | 2015-03-26 | アクシス アーベー | Managing application data in distributed control systems |
WO2015186191A1 (en) * | 2014-06-03 | 2015-12-10 | 株式会社日立製作所 | Data management system and data management method |
JPWO2015186191A1 (en) * | 2014-06-03 | 2017-04-20 | 株式会社日立製作所 | Data management system and data management method |
JP2016154316A (en) * | 2015-02-20 | 2016-08-25 | 日本電信電話株式会社 | Information processing method, information processing system, and mobile terminal |
JP2018121189A (en) * | 2017-01-25 | 2018-08-02 | 株式会社ダイヘン | Device including communication function, system including the device, and number of device searching method |
WO2022190624A1 (en) * | 2021-03-10 | 2022-09-15 | ソニーグループ株式会社 | Information processing system, information processing method, program, and cluster system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP2010122773A (en) | Distributed processing system, method of allocating processing, and information processing apparatus | |
CN108810100B (en) | Method, device and equipment for electing master node | |
CN100525215C (en) | Communication apparatus, system, and method | |
US20160127193A1 (en) | D2hcp protocol in ad hoc networks: merging of sub-networks and address conflict resolution | |
JPH098828A (en) | Address allocating method, radio terminal equipment and radio network using the method | |
JP7187849B2 (en) | Data collection system and data collection method | |
CN111263338B (en) | Network distribution method of Bluetooth Mesh network, related network distribution equipment and system | |
US20140201356A1 (en) | Monitoring system of managing cloud-based hosts and monitoring method using for the same | |
CN103973809B (en) | A kind of data distributing method and system | |
JP5470938B2 (en) | Information processing apparatus, information processing method, and program | |
KR20090005555A (en) | Method for avoiding and overcoming indirect collision in beacon-mode wireless sensor network | |
US10091066B2 (en) | Integration method and system | |
CN108769118A (en) | The choosing method and device of host node in a kind of distributed system | |
JP2007237300A (en) | Control apparatus, robot system, and method for controlling robot | |
JP2011118663A (en) | Nic selection method and program | |
JP2018133001A (en) | Management device, portable terminal, methods therefor, and program | |
CN101197741B (en) | Correlation method among nodes in individual field network, device and method for acquiring correlation mode | |
CN113342508B (en) | Task scheduling method and device | |
CN111274022A (en) | Server resource allocation method and system | |
US20210064411A1 (en) | Management apparatus, management system, management method and management program | |
JP2004171540A (en) | Production facility control device, production facility control system, and control method of production facility with production facility control device | |
JP5105085B2 (en) | Asset management system and method | |
JP2006074307A (en) | Radio communication system | |
JP6958542B2 (en) | Information processing equipment, information processing methods, information processing programs and information processing systems | |
JP2005228172A (en) | Initialization server system, initialization system, initialization method and computer-readable recording medium |