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 PDF

Info

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
Application number
JP2008293979A
Other languages
Japanese (ja)
Inventor
Akihiro Ito
昭博 伊藤
Suenori Oda
末典 小田
Hiroyuki Higaki
宏行 檜垣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2008293979A priority Critical patent/JP2010122773A/en
Publication of JP2010122773A publication Critical patent/JP2010122773A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Computer And Data Communications (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a distributed processing system 10 capable of allocating processing to a plurality of nodes 20 while taking coordination among the processing into consideration, without concentrating load on the particular node 20. <P>SOLUTION: In the distributed processing system 10, the node 20 serving as a master, for each processing ID identifying a processing unit that is the unit of processing allocated to each node 20, refers to the process ID of the processing unit providing data to be processed by the processing unit and to a processing definition that defines the processing capability required of the processing unit. Within the range of the resource processing capability of each node 20 to the node 20 other than the master, the processing unit of the provider of data and the processing unit that processes the data are allocated to the same node 20. <P>COPYRIGHT: (C)2010,JPO&INPIT

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 Patent Document 1, for each business program, the amount of resources (for example, CPU, storage, etc.) required to execute the business program is managed, and the resource information of a separately managed system is attached. A technique for determining a resource allocation amount for a business program is disclosed. When the technique of Patent Document 1 is applied to the ubiquitous front-end system described above, the role of each small computer can be automatically determined.

また、特許文献2には、サービス連携エンジンがサービス連携シナリオに記載された制御ロジックに基づき、利用すべきサービスコンポーネントを検索し、適切なサービスコンポーネントを順に呼び出す技術が開示されている。ユビキタスフロントエンドシステムに特許文献2の技術を適用すると、サービス間の連携方法を1つのサービス連携シナリオとして記述できるため、連携のための設定を各小型計算機に行う必要がなくなる。   Patent Document 2 discloses a technology in which a service cooperation engine searches for service components to be used based on control logic described in a service cooperation scenario and sequentially calls appropriate service components. When the technique of Patent Document 2 is applied to the ubiquitous front-end system, the cooperation method between services can be described as one service cooperation scenario, so that it is not necessary to perform setting for cooperation in each small computer.

特許文献1または2のようなシステムでは、システムを構成する計算機の1つが管理機能を有する計算機(管理計算機)となる。すなわち、特許文献1では業務プログラムへのリソースの割り当て量を決定する計算機が管理計算機となり、特許文献2では、サービス連携エンジンが動作する計算機が管理計算機となる。   In a system such as Patent Document 1 or 2, one of the computers constituting the system is a computer having a management function (management computer). That is, in Patent Document 1, a computer that determines the amount of resources allocated to a business program is a management computer, and in Patent Document 2, a computer on which a service cooperation engine operates is a management computer.

また、小型計算機は、センサの近くに配置される場合が多い。そのため、通常の計算機と比較して過酷な環境(例えば、振動や埃が多い場所)で利用されることが多く、障害発生頻度が高い場合が多い。そのため、ユビキタスフロントエンドシステムでは、管理計算機に障害が発生した場合に、他の計算機が管理計算機となって処理を続けることができるようにするため、特定の小型計算機を固定的に管理計算機とするのではなく、複数の小型計算機の中から動的に管理計算機が選択される構成とすることが望ましい。   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 Patent Document 3, as a technique for determining a management computer from a plurality of computers, in a ring network, each node (computer) transfers its priority to an adjacent node, and finally the node with the highest priority. Is disclosed as a management computer. Moreover, it can be considered as a kind of distributed agreement that a plurality of small computers cooperate to determine one management computer. Distributed agreement is a technology in which each computer operates independently, but all computers finally arrive at the same result by exchanging information with each other.

非特許文献1には、分散合意アルゴリズムを使ったPAXOSというプロトコルが開示されている。PAXOSとは、計算機間で投票処理を行い、定足数(多くの場合過半数とする)以上の合意が得られれば、結果をすべての計算機に確定するプロトコルであり、全ての計算機から合意が得られなくても、定足数以上の合意が得られれば、結果を確定することができる。   Non-Patent Document 1 discloses a protocol called PAXOS using a distributed agreement algorithm. PAXOS is a protocol in which voting is performed between computers, and if an agreement over a quorum (in most cases, a majority) is obtained, the result is confirmed for all computers, and no agreement can be obtained from all computers. However, the result can be confirmed if an agreement over the quorum is obtained.

特開2004−302937号公報Japanese Patent Laid-Open No. 2004-302937 特開2008−130033号公報JP 2008-130033 A 特開2001−358736号公報JP 2001-35836 A Lamport, L. The part−time parliament. ACM Transactions on Computer Systems 16, 2 (1998), 133−169Lampport, L.M. The part-time parallel. ACM Transactions on Computer Systems 16, 2 (1998), 133-169

ところで、ユビキタスフロントエンドシステムでは、小型計算機上で稼動するあるプログラムが必要とするリソースの量は、そのプログラムの処理内容に加えて、そのプログラムと連携する他のプログラムの動作にも依存する。例えば、センサを制御するプログラム(制御プログラム)が取得したデータを、別のプログラム(加工プログラム)が加工する場合、加工プログラムの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 Patent Document 1, the amount of resources required by each program is managed as an attribute of each program, and therefore, cooperation between programs is not considered, and each program is an allocated resource. May not work properly in conjunction with other programs. In Patent Document 2, every time each service component finishes work, the service linkage engine acquires all data such as variables at that time and passes them to the next service component. Must be involved in the operation of the service component, and the load may be concentrated on the service cooperation engine. Therefore, the service cooperation engine may not be able to operate on a small computer with limited CPU performance, memory capacity, and the like.

また、システムの規模が大きくなると、それぞれの小型計算機が異なるネットワークに配置される場合がある。また、ネットワークがリング型でなくバス型の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 Patent Document 3 is used for a LAN that is not a ring type but a bus type, a broadcast packet is used. However, it is necessary to perform settings such as passing a predetermined broadcast packet to a communication device such as a router at the boundary of the network, and the setting work becomes complicated.

また、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 processing system 10 according to the first embodiment of the present invention. The distributed processing system 10 is an example of a ubiquitous front-end system, and includes a plurality of information processing apparatuses 20 (hereinafter referred to as nodes 20) and a plurality of sensors 14.

それぞれのノード20は計算機用LAN12およびセンサ用LAN13に接続されている。それぞれのノード20は、計算機用LAN12を介して、他のノード20や、計算機用LAN12に接続されているコンソール11と通信する。また、それぞれのノード20は、センサ用LAN13を介してそれぞれのセンサ14を制御する。それぞれのセンサ14にはアドレス(例えばIPアドレス)が割り当てられており、それぞれのノード20は、センサ用LAN13を介して、それぞれのセンサ14にアクセスすることができる。   Each node 20 is connected to a computer LAN 12 and a sensor LAN 13. Each node 20 communicates with the other nodes 20 and the console 11 connected to the computer LAN 12 via the computer LAN 12. Each node 20 controls each sensor 14 via the sensor LAN 13. Each sensor 14 is assigned an address (for example, an IP address), and each node 20 can access each sensor 14 via the sensor LAN 13.

本実施形態において、分散処理システム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 processing system 10 includes nodes 20-0 to 20-3. Further, sensors 14c and 14d, which are RFID reader / writers (R / W), are connected to the node 20-3 without going through the sensor LAN 13. In addition, an antenna 15-1 is connected to the node 20-1, and an antenna 15-2 is connected to the node 20-2.

コンソール11は、各ノード20から構成されるユビキタスフロントエンドシステムとユーザ間の情報伝達を行うための端末であり、分散処理システム10の管理者等によって操作される。コンソール11は、例えば通信機能を有する汎用のコンピュータであり、ディスプレイ、キーボード、およびマウス等の入出力装置が接続されている。分散処理システム10の管理者は、これらの入出力装置を操作して分散処理システム10へ指示を出したり、稼働状況を確認したりする。   The console 11 is a terminal for transmitting information between a ubiquitous front-end system constituted by each node 20 and a user, and is operated by an administrator of the distributed processing system 10 or the like. The console 11 is a general-purpose computer having a communication function, for example, and is connected to input / output devices such as a display, a keyboard, and a mouse. The administrator of the distributed processing system 10 operates these input / output devices to give instructions to the distributed processing system 10 and confirm the operation status.

図2は、コンソール11の動作の一例を示すフローチャートである。例えば電源が投入される等の所定のタイミングで、コンソール11は、本フローチャートに示す動作を開始する。   FIG. 2 is a flowchart showing an example of the operation of the console 11. For example, at a predetermined timing such as when the power is turned on, the console 11 starts the operation shown in this flowchart.

まず、コンソール11は、分散処理システム10の管理者等のユーザから処理定義を入力されたか否かを判定する(S100)。処理定義の詳細な内容については後述する。処理定義がユーザから入力された場合(S100:Yes)、コンソール11は、複数のノード20の中でマスタとなるノード20のアドレスを要求するマスタ情報要求を、計算機用LAN12を介して全てのノード20に、例えばブロードキャストによって送信する(S101)。   First, the console 11 determines whether a process definition has been input from a user such as an administrator of the distributed processing system 10 (S100). Details of the process definition will be described later. When the process definition is input from the user (S100: Yes), the console 11 sends a master information request for requesting the address of the master node 20 among the plurality of nodes 20 to all nodes via the computer LAN 12. 20, for example, by broadcast (S101).

次に、コンソール11は、計算機用LAN12を介してマスタとなるノード20のアドレスを受信したか否かを判定する(S102)。マスタとなるノード20のアドレスを受信した場合(S102:Yes)、コンソール11は、当該ノード20へユーザから入力された処理定義を送信し(S103)、再びステップS100に示した処理を実行する。一方、マスタとなるノード20のアドレスを受信しなかった場合(S102:No)、コンソール11は、所定時間(例えば10秒間)待機して再びステップS101に示した処理を実行する。   Next, the console 11 determines whether or not the address of the master node 20 has been received via the computer LAN 12 (S102). When the address of the master node 20 is received (S102: Yes), the console 11 transmits the process definition input by the user to the node 20 (S103), and executes the process shown in step S100 again. On the other hand, when the address of the master node 20 is not received (S102: No), the console 11 waits for a predetermined time (for example, 10 seconds) and executes the processing shown in step S101 again.

また、ステップ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 console 11 determines whether or not the user has instructed to re-select the master (S105). When the master re-election is not instructed (S105: No), the console 11 executes the process shown in step S100 again.

一方、マスタの再選出を指示された場合(S105:Yes)、コンソール11は、マスタ情報要求を計算機用LAN12を介して全てのノード20に、例えばブロードキャストによって送信する(S106)。そして、コンソール11は、マスタのノード20にマスタの再選出を指示するメッセージを送信し(S107)、再びステップS100に示した処理を実行する。   On the other hand, when a master re-election is instructed (S105: Yes), the console 11 transmits a master information request to all the nodes 20 via the computer LAN 12, for example, by broadcast (S106). Then, the console 11 transmits a message instructing master re-election to the master node 20 (S107), and again executes the processing shown in step S100.

次に、それぞれのノード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 node 20 will be described. FIG. 3 shows an example of the hardware configuration of each node 20 in the first embodiment. The node 20 includes a RAM (Random Access Memory) 200, a ROM (Read Only Memory) 201, a CPU (Central Processing Unit) 202, a LAN interface (I / F) 205, a LAN interface (I / F) 206, and a media interface ( I / F) 207. Some of the plurality of nodes 20 include at least one of an input / output interface (I / F) 203, a wireless interface (I / F) 204, and a sensor interface (I / F) 208.

RAM200は、実行中のプログラムやプログラムが取り扱うデータを一時的に保存する。ROM201には、初期起動用のプログラムが格納されている。CPU202は、ROM201または記録媒体213から読み出されてRAM200に展開されたプログラム等を実行する。CPU202は、ノード20の電源が投入されると、ROM201からプログラムを読み出してRAM200に展開して実行する。メディアインターフェイス207は、コンパクトフラッシュ(登録商標)メモリカード等の記録媒体213を取り付けるためのインターフェイスである。当該記録媒体213には、各種プログラムやデータが格納され、メディアインターフェイス207は、CPU202からの指示に応じて、これらを記録媒体213から読み出してRAM200上に展開する。   The RAM 200 temporarily stores a program being executed and data handled by the program. The ROM 201 stores an initial startup program. The CPU 202 executes a program or the like read from the ROM 201 or the recording medium 213 and loaded on the RAM 200. When the power of the node 20 is turned on, the CPU 202 reads a program from the ROM 201, develops it in the RAM 200, and executes it. The media interface 207 is an interface for attaching a recording medium 213 such as a compact flash (registered trademark) memory card. Various programs and data are stored in the recording medium 213, and the media interface 207 reads these from the recording medium 213 and expands them on the RAM 200 in response to an instruction from the CPU 202.

LANインターフェイス205およびLANインターフェイス206は、一般的なイーサネット(登録商標)規格のネットワークインターフェイスである。各ノード20は2つのLANインターフェイスを備える。センサインターフェイス208は、例えばRS-232C規格等のシリアル通信インターフェイスであり、ノード20に接続されているセンサ14を制御するときに利用される。無線インターフェイス204はモバイル通信カード等の通信インターフェイスであり、分散処理システム10内のいずれかのノード20が収集したデータをデータ収集サーバ(図示せず)に送信するときに利用される。ノード20を設置する現場では、有線ネットワークのインフラが整備されていない場合が多く、このような場合に本実施形態ではモバイル通信カードを利用してデータ収集サーバへデータを送信する。   The LAN interface 205 and the LAN interface 206 are general Ethernet (registered trademark) network interfaces. Each node 20 includes two LAN interfaces. The sensor interface 208 is a serial communication interface such as RS-232C standard, and is used when controlling the sensor 14 connected to the node 20. The wireless interface 204 is a communication interface such as a mobile communication card, and is used when data collected by any one of the nodes 20 in the distributed processing system 10 is transmitted to a data collection server (not shown). In the field where the node 20 is installed, the infrastructure of the wired network is often not maintained. In such a case, in this embodiment, data is transmitted to the data collection server using the mobile communication card.

入出力インターフェイス203、無線インターフェイス204、およびセンサインターフェイス208は、分散処理システム10内の全てのノード20に設けられている必要はない。すなわち、センサインターフェイス208は、センサ用LAN13を介さずにセンサ14を接続するノード20(図1の例ではノード20−3)が備えていればよい。また、無線インターフェイス204は、データ収集サーバと通信するノード20(図1の例ではノード20−1およびノード20−2)が備えていればよい。   The input / output interface 203, the wireless interface 204, and the sensor interface 208 need not be provided in all the nodes 20 in the distributed processing system 10. That is, the sensor interface 208 only needs to be included in the node 20 (node 20-3 in the example of FIG. 1) that connects the sensor 14 without passing through the sensor LAN 13. The wireless interface 204 only needs to be included in the node 20 (the node 20-1 and the node 20-2 in the example of FIG. 1) that communicates with the data collection server.

次に、それぞれのノード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 node 20 will be described. FIG. 4 is a block diagram illustrating an example of a functional configuration of each node 20 in the first embodiment. The node 20 includes a resource information transmission unit 21, a resource information registration unit 22, a history information storage unit 23, a history information management unit 24, a master determination unit 25, a process allocation unit 26, a resource information storage unit 27, a slave processing unit 28, and A sensing application execution unit 29 is provided. Programs that realize these functions are stored in the recording medium 213 shown in FIG. 3, and the CPU 202 reads these programs from the recording medium 213 via the media interface 207, develops them in the RAM 200, and executes them.

センシングアプリケーション実行部29は、ディスパッチャ290、フィルタ291、駆動制御292、およびアダプタ293を有する。アダプタ293は、センサ14間のインターフェイスの違いを吸収し、様々なセンサ14を同一インターフェイスから利用できるようにする。駆動制御292は、センサ14からデータを取得するタイミングを制御する。フィルタ291は、アダプタ293がセンサ14から取得したデータを加工する。ディスパッチャ290は、アダプタ293がセンサ14から取得したデータまたはフィルタ291が加工したデータを、予め定められた通信プロトコルでデータ収集サーバへ送信する。   The sensing application execution unit 29 includes a dispatcher 290, a filter 291, a drive control 292, and an adapter 293. The adapter 293 absorbs interface differences between the sensors 14 and allows various sensors 14 to be used from the same interface. The drive control 292 controls the timing for acquiring data from the sensor 14. The filter 291 processes the data acquired from the sensor 14 by the adapter 293. The dispatcher 290 transmits the data acquired by the adapter 293 from the sensor 14 or the data processed by the filter 291 to the data collection server using a predetermined communication protocol.

センシングアプリケーション実行部29の動作を纏めると例えば以下のようになる。駆動制御292が駆動指示をアダプタ293へ送信すると、アダプタ293はセンサ14を制御してセンサ14からデータを取得し、取得したデータを駆動制御292に返信する。駆動制御292は、受信したデータをフィルタ291へ送信し、フィルタ291はデータ加工を行った後、加工したデータをディスパッチャ290に渡す。最後にディスパッチャ290は、受け取ったデータをデータ収集サーバへ送信する。   The operation of the sensing application execution unit 29 is summarized as follows, for example. When the drive control 292 transmits a drive instruction to the adapter 293, the adapter 293 controls the sensor 14 to acquire data from the sensor 14 and returns the acquired data to the drive control 292. The drive control 292 transmits the received data to the filter 291, the filter 291 performs data processing, and then passes the processed data to the dispatcher 290. Finally, the dispatcher 290 transmits the received data to the data collection server.

このようにセンシングアプリケーション実行部29内の各機能ブロックは連携動作するが、機能ブロック間の連携は1つのノード20内で閉じるわけではなく、異なるノード20の機能ブロック同士が連携する場合もある。例えば、アダプタ293、駆動制御292、フィルタ291、およびディスパッチャ290が全て異なるノード20上で動作し、相互に連携することも可能であるし、あるノード20上で動作する駆動制御292が、それぞれのノード20上で動作するアダプタ293に対して、計算機用LAN12を介して順にデータ取得指示を送信することも可能である。   As described above, the functional blocks in the sensing application execution unit 29 operate in cooperation with each other. However, the cooperation between the functional blocks is not closed within one node 20, and the functional blocks of different nodes 20 may cooperate with each other. For example, the adapter 293, the drive control 292, the filter 291, and the dispatcher 290 all operate on different nodes 20 and can cooperate with each other, and the drive control 292 that operates on a certain node 20 It is also possible to sequentially send data acquisition instructions to the adapter 293 operating on the node 20 via the computer LAN 12.

リソース情報格納部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 information storage unit 27, for example, a resource information management table 270 as shown in FIG. 5 is stored. The resource information management table 270 stores a plurality of records 276. Each record 276 includes a node ID 271 for identifying each node 20, an address 272 of the node 20 (IP address in the present embodiment), The reception time 273 indicating the time when the record 276 is newly registered or updated, the resource information 274 of the node 20, and the date of manufacture 275 of the node 20 are stored. The resource information 274 stores detailed information of the resource specified by the identifier for each identifier (“Communicate”, “Cpu”, “Sensor”, etc. in the example of FIG. 5) for identifying each resource. The The resource information management table 270 stores resource information of the own node 20 in advance. In addition, regarding the own node 20, data is not registered at the reception time 273.

例えば、図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 node 20 whose node ID 271 is “001” provides communication means (corresponding to “Communicate”) and Cpu as resources, and the performance of the communication means is “80 kbps”. It is described that the performance of the Cpu is “200 mips (million instructions per second)”. Further, the resource information management table 270 describes that the communication means is identified by a device identifier (devId) and the value of the device identifier of the communication means is “card001”. In addition, two RFID device sensors 14 controlled serially (RS-232C) are connected to the node 20 whose node ID 271 is “003”. The identifier (devId) value of each RFID device and each device And the serial port name (serial) used when accessing.

履歴情報格納部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 information storage unit 23 stores the contents 231 of the history information in association with the history number 230 for identifying each history information. In the example of FIG. 6, entries whose history numbers 230 are “013” and “014” are master node information, and include the node ID of the master node and the lease period. When the master node 20 is determined with another node 20, the node ID of the master node and the lease period are stored in the history information storage unit 23 as a history. In the example shown in FIG. 6, in the entry whose history number 230 is “013”, the node ID of the master node is “000” and the lease period is “up to 10: 5: 0”.

また、コンソール11や他のノード20から送信された処理定義も履歴情報として履歴情報格納部23に格納される。図6に示した例において、履歴番号230が「015のエントリが処理定義である。処理定義は、図7に示す処理定義テンプレートと、図8および図9に示す処理定義本体とを含む。処理定義テンプレートは、処理定義本体に記載する内容のうち、カスタマイズされることがない項目、もしくはカスタマイズされる頻度が少ない項目を分離して記載したものである。つまり、処理定義テンプレートとは、処理定義本体に繰り返し記載する必要がある項目のデフォルト値を別にまとめたものである。全ての項目を処理定義本体に記載すれば、処理定義を分離する必要はないが、分離することで処理定義の作成作業を効率的に行うことができる。処理定義に記載されている内容の詳細については後述する。   Further, the process definition transmitted from the console 11 or another node 20 is also stored in the history information storage unit 23 as history information. In the example shown in FIG. 6, the entry whose history number 230 is “015 is the process definition. The process definition includes the process definition template shown in FIG. 7 and the process definition main body shown in FIGS. A definition template is a list of items that are not customized or items that are not frequently customized among the contents described in the process definition body. The default values of items that need to be repeatedly described in the main body are summarized separately.If all items are described in the main body of the process definition, it is not necessary to separate the process definition, but by creating the process definition by separating it The details of the contents described in the process definition will be described later.

リソース情報送信部21は、自ノード20のノードID、自ノード20のアドレス、自ノード20のリソース情報、および自ノード20の製造年月日をリソース情報格納部27内のリソース情報管理テーブル270から読み出して、計算機用LAN12を介して他のノード20へ例えばブロードキャストにより送信する。なお、IP(Internet Protocol)が用いられる場合、リソース情報送信部21が送信するブロードキャストパケットのパケットヘッダには、自ノード20のIPアドレスが記録されるので、リソース情報送信部21が明示的にブロードキャストパケットのメッセージに上記アドレスを記録する必要はない。   The resource information transmitting unit 21 obtains the node ID of the own node 20, the address of the own node 20, the resource information of the own node 20, and the date of manufacture of the own node 20 from the resource information management table 270 in the resource information storage unit 27. The data is read out and transmitted to another node 20 via the computer LAN 12 by broadcast, for example. When IP (Internet Protocol) is used, since the IP address of the own node 20 is recorded in the packet header of the broadcast packet transmitted by the resource information transmitting unit 21, the resource information transmitting unit 21 explicitly broadcasts. It is not necessary to record the address in the packet message.

リソース情報登録部22は、計算機用LAN12を介して他のノード20からノードID、アドレス、リソース情報、および製造年月日を受信した場合に、リソース情報格納部27内のリソース情報管理テーブル270を参照し、当該ノードIDがリソース情報管理テーブル270内に登録されていないならば、受信したこれらの情報と共に受信時刻をリソース情報管理テーブル270に新規に登録する。また、受信したノードIDがリソース情報管理テーブル270内に既に登録されているならば、リソース情報登録部22は、受信したこれらの情報でリソース情報管理テーブル270内の情報を上書きすると共に、受信時刻を更新する。また、リソース情報登録部22は、リソース情報管理テーブル270内の受信時刻を監視し、受信時刻から予め定められた時間(例えば40秒)が経過したエントリをリソース情報管理テーブル270から削除する。   When the resource information registration unit 22 receives a node ID, an address, resource information, and a manufacturing date from another node 20 via the computer LAN 12, the resource information registration unit 22 stores the resource information management table 270 in the resource information storage unit 27. If the node ID is not registered in the resource information management table 270, the reception time is newly registered in the resource information management table 270 together with the received information. If the received node ID is already registered in the resource information management table 270, the resource information registration unit 22 overwrites the information in the resource information management table 270 with the received information, and also receives the reception time. Update. In addition, the resource information registration unit 22 monitors the reception time in the resource information management table 270, and deletes an entry for which a predetermined time (for example, 40 seconds) has elapsed from the reception time from the resource information management table 270.

マスタ決定部25は、分散合意により分散処理システム10内の複数のノード20間でマスタノードを決定する処理を実行する。マスタ決定部25は、履歴情報管理部24またはスレーブ処理部28からマスタノードの決定を指示された場合に、例えばPAXOSプロトコルを用いてマスタノードを選出する。PAXOSプロトコルを用いてマスタノードを選出する過程を説明するためのシーケンスを図10に示す。PAXOSプロトコルは、1つの投票開催者と複数の投票参加者間の通信プロトコルである。図10ではノード20−0が投票開催者であり、ノード20−1〜3が投票参加者となるケースを例として示している。   The master determination unit 25 executes a process of determining a master node among a plurality of nodes 20 in the distributed processing system 10 by a distributed agreement. When the master information determination unit 25 is instructed to determine the master node from the history information management unit 24 or the slave processing unit 28, the master determination unit 25 selects a master node using, for example, the PAXOS protocol. FIG. 10 shows a sequence for explaining a process of selecting a master node using the PAXOS protocol. The PAXOS protocol is a communication protocol between one voting organizer and a plurality of voting participants. FIG. 10 shows an example in which the node 20-0 is a vote organizer and the nodes 20-1 to 20-3 are vote participants.

各投票は、決定する事項に対する番号(前述の履歴番号に等しい)と各投票に対する番号とを使用して管理される。本実施形態では、決定する事項に対する番号を事項番号(図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 master determination unit 25 of each node 20 stores therein variables such as Q, D, lastTried, nextBallot, lastVoteBallot, and lastVoteDecree for PAXOS protocol processing. Q means a quorum, and if an agreement over a quorum is obtained for a certain item, that item is determined. In this embodiment, the quorum is the majority of all participants. D is an item number of an item determined by voting. lastTried is the ongoing vote number. nextBallot is the vote number of the vote that the vote participant is participating in. lastVoteBallot is the vote number of the last vote voted by the voting participant. lastVoteDecree is the content of the voting item last voted by the voting participant.

まず、新規に提案を行おうとするノード20−0のマスタ決定部25は、これから開催する投票の投票番号をnextBallotよりも大きな値になるように決め、lastTriedとnextBallotに保存する。ここでは、投票開催者は自身が開催する投票に対して投票参加者を兼ねるため、nextBallotにも投票番号を保存している。そして、マスタ決定部25は、これから決定する事項の事項番号Dと、上記投票番号(図10ではbと記載)とを有するPrepareメッセージを作成し、ノード20−1〜3へ送信し、これから投票を開始する旨を通知する(S200)。PAXOSプロトコルでは、投票番号は投票毎に一意となる必要があるが、実際には任意のノードが投票開催者になる可能性があるため、異なるノード20が開催した投票の投票番号が重複することを避ける必要がある。本実施形態では、投票番号にノードIDを含めることで、投票番号の重複を防いでいる。   First, the master determination unit 25 of the node 20-0 that intends to make a new proposal determines that the vote number of the vote to be held will be larger than nextBallot, and stores it in lastTried and nextBallot. Here, the ballot organizer also saves the ballot number in nextBallot to serve as a ballot participant for the ballot held by him. Then, the master determination unit 25 creates a Prepare message having the item number D of the item to be determined and the vote number (described as b in FIG. 10), transmits the Prepare message to the nodes 20-1 to 20-3, and vote Is notified (S200). In the PAXOS protocol, the vote number needs to be unique for each vote. However, since any node may actually become a vote organizer, the vote numbers of the votes held by different nodes 20 are duplicated. Need to avoid. In this embodiment, duplication of vote numbers is prevented by including the node ID in the vote number.

次に、Pepareメッセージを受信したノード20−1〜3のマスタ決定部25は、自ノード20が保持するnextBallotと受信したPrepareメッセージに含まれる投票番号bとを比較し、nextBallotが当該投票番号bよりも小さければ、nextBallotの値をbに変更し、その投票への参加表明としてPromiseメッセージを送信する(S201)。マスタ決定部25は、Prepareメッセージに含まれる事項番号Dに関して、以前に投票したことがあれば、以前の投票の情報(投票番号と事項内容と)をPromiseメッセージに含めて送信する。以前の投票の情報は、変数lastVoteBallotおよびlastVoteDecreeに保持されているので、これを利用する。   Next, the master determination units 25 of the nodes 20-1 to 20-3 that have received the Pepare message compare the nextBallot held by the node 20 with the vote number b included in the received Prepare message, and the nextBallot has the vote number b. If smaller, the value of nextBallot is changed to b, and a Promise message is transmitted as an expression of participation in the vote (S201). If the master determination unit 25 has voted before with respect to the item number D included in the Prepare message, the master determination unit 25 transmits information including the previous vote (voting number and item content) included in the Promise message. The information of the previous vote is held in the variables lastVoteBallot and lastVoteDecree, so use this.

次に、ノード20−0のマスタ決定部25は、定足数(Q−1)以上のノードからPromiseメッセージを受信した場合に、受信したPromiseメッセージに含まれるlastVoteBallot、lastVoteDecreeをチェックし、その中から最も値が大きいlastVoteBallotに対応するlastVoteDecreeを、次の投票の提案内容とする(S202)。事項番号Dに関して、今回が最初の投票である場合、どのノード20からもlastVoteDecreeは送信されない。このような場合、ノード20−0は、自身で決定した自提案を次の投票の提案内容とする。本実施形態において、マスタ決定部25は、リソース情報格納部27を参照して、製造年月日が最も新しいノード20をマスタノードとして推薦する旨を自案として作成する。   Next, when the master determination unit 25 of the node 20-0 receives a Promise message from a node having a quorum (Q-1) or more, the master determination unit 25 checks lastVoteBallot and lastVoteDecree included in the received Promise message. The lastVoteDecree corresponding to the lastVoteBallot having a large value is set as the proposal content of the next vote (S202). Regarding item number D, if this is the first vote, lastVoteDecree is not transmitted from any node 20. In such a case, the node 20-0 uses the self-suggestion determined by itself as the proposal content of the next vote. In the present embodiment, the master determination unit 25 refers to the resource information storage unit 27 and creates as its own idea that the node 20 with the newest manufacturing date is recommended as the master node.

次に、ノード20−0のマスタ決定部25は、事項番号D、変数lastTried、およびステップS202において決定した提案内容を含むAcceptメッセージを生成し、作成したAcceptメッセージをステップS201においてPromiseメッセージを送信したノード20へ送信することで投票を開始する(S203)。図10では、Accesptメッセージに含まれる投票番号をbと記載しているが、これは上記変数lastTriedに等しい。また、図10では、Acceptメッセージ含まれる提案内容を「Decree」と記載している。   Next, the master determination unit 25 of the node 20-0 generates an Accept message including the item number D, the variable lastTried, and the proposal content determined in Step S202, and transmits the Promise message to the created Accept message in Step S201. The vote is started by transmitting to the node 20 (S203). In FIG. 10, the vote number included in the Accespt message is described as b, which is equal to the variable lastTried. In FIG. 10, the proposal content included in the Accept message is described as “Decree”.

次に、Acceptメッセージを受信したノード20−1〜3のマスタ決定部25は、Acceptメッセージに含まれる投票番号bとnextBallotとを比較し、bがnextBallotに一致した場合に、その提案に投票する(S204)。具体的には、Acceptメッセージに含まれる投票番号bをlastVoteBallotに、Acceptメッセージに含まれる提案内容DecreeをlastVoteDecreeに保存し、投票したことを示すためにAcceptedメッセージをノード20−0へ送信する。   Next, the master determination units 25 of the nodes 20-1 to 20-3 that have received the Accept message compare the vote number b included in the Accept message with nextBallot and vote for the proposal if b matches nextBallot. (S204). Specifically, the vote number b included in the Accept message is stored in lastVoteBallot and the proposal content Decree included in the Accept message is stored in lastVoteDecree, and the Accepted message is transmitted to the node 20-0 to indicate that it has voted.

次に、ノード20−0のマスタ決定部25は、定足数(Q−1)以上のノード20からAcceptedメッセージを受信したら、事項が決定したことを示すために、事項番号Dと提案内容を含むCommitメッセージを作成し、全てのノードにCommitメッセージを送信する(S205)。この場合、Acceptedメッセージを送信しなかったノード20に対しても、Commitメッセージが送信されることになる。   Next, when the master determination unit 25 of the node 20-0 receives the Accepted message from the node 20 having a quorum (Q-1) or more, the Commit including the item number D and the proposed content is used to indicate that the item has been determined. A message is created and a Commit message is transmitted to all nodes (S205). In this case, the Commit message is also transmitted to the node 20 that has not transmitted the Accepted message.

次に、ノード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 master determination unit 25 of the node 20-0 stores the item number D as the history number in the history number 230 (see FIG. 6) in the history information storage unit 23, and the proposed content Is stored in the contents 231 in the history information storage unit 23, and the item number D is incremented. Similarly, the master determination units 25 of the nodes 20-1 to 20-3 receiving the Commit message store the item number D and the proposed content Decree included in the Commit message in the history information storage unit 23, and increment the item number D. Then, the master determination unit 25 of the nodes 20-0 to 3 initializes lastVoteBallot and lastVoteDecree (S206).

上記ステップS200において、ノード20−0のマスタ決定部25が、以前に少なくとも1回Prepareメッセージを送信したことがあり、lastTriedとnextBallotの値が等しい場合、ステップS200およびS201を省略してステップS203から実行されてもよい。このとき、投票番号は以前の番号(すなわちlastTriedもしくはnextBallot)をそのまま利用され、自提案が提案内容となる。   In step S200, if the master determination unit 25 of the node 20-0 has transmitted a Prepare message at least once before, and the values of lastTried and nextBallot are equal, steps S200 and S201 are omitted, and step S203 is started. May be executed. At this time, the previous number (that is, lastTried or nextBallot) is used as it is for the vote number, and the proposal is the content of the proposal.

実際には、複数のノードが同時に投票を開催する場合があるため、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 other node 20 after receiving the Prepare from the node 20-0 in S200 and before receiving the Accept, The node 20-1 returns a Promise message to the Prepare message received later. Thereafter, the node 20-1 does not participate in the vote held by the node 20-0.

履歴情報格納部23に登録される内容231にはリース期間が含まれる。マスタノードはリース期間が経過する前に、リース期間を更新したマスタノード情報を上記PAXOSプロトコルによって全ノード20へ送信し、後述する履歴情報管理部24が、更新されたマスタノードを履歴情報格納部23内に追記する。いったんマスタノードが決定した場合は、リース期間が切れるか、もしくはマスタノードに障害が発生するまで、マスタノード以外のノード20はPAXOSの投票開催者にはならない。これによって、スムーズにリース期間の更新が行われるようになっている。   The content 231 registered in the history information storage unit 23 includes a lease period. Before the lease period elapses, the master node transmits the master node information whose lease period has been updated to all the nodes 20 using the PAXOS protocol, and the history information management unit 24 described later stores the updated master node as a history information storage unit. 23 to add. Once the master node is determined, the nodes 20 other than the master node do not become PAXOS vote organizers until the lease period expires or a failure occurs in the master node. As a result, the lease period is smoothly updated.

マスタ決定部25は、決定したマスタノードが自ノード20である場合に、履歴情報格納部23に格納されている処理定義に基づいてそれぞれのノード20への処理の割当を処理割当部26に指示する。また、マスタ決定部25は、コンソール11からマスタノードの再選出を指示された場合に、PAXOSプロトコルを用いてマスタを再度決定し直す。また、自ノード20がマスタとならなかった場合、マスタ決定部25は、マスタノードのノードIDをスレーブ処理部28に通知する。   When the determined master node is the own node 20, the master determination unit 25 instructs the process allocation unit 26 to allocate a process to each node 20 based on the process definition stored in the history information storage unit 23. To do. Further, when instructed from the console 11 to re-select a master node, the master determination unit 25 determines the master again using the PAXOS protocol. If the node 20 has not become the master, the master determination unit 25 notifies the slave processing unit 28 of the node ID of the master node.

履歴情報管理部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 information management unit 24 monitors the number of nodes 20 registered in the resource information management table 270 of the resource information storage unit 27 after activation of the own node 20, and is registered in the resource information management table 270. When the number of nodes 20 becomes more than half of the number of all nodes 20, a message requesting history information is transmitted to the other nodes 20 via the computer LAN 12 by broadcast, for example, and the history is transmitted from the other nodes 20. Information is received and stored in the history information storage unit 23. Then, the history information management unit 24 refers to the history information storage unit 23 and determines whether there is master node information within the lease term. When the master node information within the lease term exists in the history information storage unit 23, the history information management unit 24 notifies the slave processing unit 28 of the node ID of the master node. When master node information within the lease term does not exist in the history information storage unit 23, the history information management unit 24 instructs the master determination unit 25 to select a master node. Note that the number of nodes 20 in the distributed processing system 10 is preset in the history information management unit 24 of all the nodes 20 by an administrator or the like.

また、他のノード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 node 20, the history information management unit 24 returns the history in the history information storage unit 23. Further, the history information management unit 24 refers to the history information storage unit 23 and the resource information storage unit 27 when the console 11 requests the address of the master node. 20 addresses are transmitted to the console 11. Further, when the process definition is received from the console 11 when the own node 20 is the master, the history information management unit 24 stores the received process definition in the history information storage unit 23 and newly registered processing. The definition is shared with other nodes 20 using the PAXOS protocol. As a result, even if a failure occurs in the master node, the node 20 that becomes the next master can execute the process using the shared process definition.

処理割当部26は、マスタ決定部25から処理の割当を指示された場合に、履歴情報格納部23内に格納されている処理定義およびリソース情報格納部27内のリソース情報管理テーブル270に基づいて、マスタとなった自ノード20以外の各ノード20に割り当てる処理を決定する。割当方法の詳細については後述する。処理割当部26は、割り当てた処理を示すノード別処理指示を例えばユニキャストにより計算機用LAN12を介して、自ノード20以外のそれぞれのノード20へ送信する。   When the process allocation unit 26 is instructed to allocate a process from the master determination unit 25, the process allocation unit 26 is based on the process definition stored in the history information storage unit 23 and the resource information management table 270 in the resource information storage unit 27. The process to be assigned to each node 20 other than the master node 20 that has become the master is determined. Details of the allocation method will be described later. The process assignment unit 26 transmits a node-specific process instruction indicating the assigned process to each of the nodes 20 other than the own node 20 via the computer LAN 12 by, for example, unicast.

スレーブ処理部28は、計算機用LAN12を介して他のノード20からノード別処理指示を受信した場合に、受信したノード別処理指示に従って、センシングアプリケーション実行部29内のそれぞれのブロックを稼動させる。また、スレーブ処理部28は、履歴情報管理部24またはマスタ決定部25から通知されたマスタノードのノードIDに基づいてリソース情報格納部27内のリソース情報管理テーブル270を参照し、マスタノードのリソース情報が格納されているか否かを監視し、マスタノードのリソース情報がリソース情報管理テーブル270から削除された場合に、マスタノードに障害が発生したと判定してマスタ決定部25にマスタノードの選出を指示する。   When the slave processing unit 28 receives a node-specific processing instruction from another node 20 via the computer LAN 12, the slave processing unit 28 operates each block in the sensing application execution unit 29 according to the received node-specific processing instruction. Further, the slave processing unit 28 refers to the resource information management table 270 in the resource information storage unit 27 based on the node ID of the master node notified from the history information management unit 24 or the master determination unit 25, and determines the resource of the master node. Whether or not information is stored is monitored, and when the resource information of the master node is deleted from the resource information management table 270, it is determined that a failure has occurred in the master node and the master determination unit 25 selects the master node. Instruct.

ここで、リソース情報登録部22は、受信時刻から所定時間(例えば40秒)経過したエントリをリソース情報管理テーブル270から削除するため、マスタノードが正常に稼動しており、マスタノード内のリソース情報送信部21がリソース情報を所定時間(例えば30秒)毎に正常に送信していれば、リソース情報管理テーブル270内にはマスタノードのリソース情報が存在し続けることになる。マスタノードのリソース情報がリソース情報管理テーブル270から削除されたことを検出することによって、スレーブ処理部28は、マスタノードに障害が発生したことを検出することができる。   Here, since the resource information registration unit 22 deletes an entry for which a predetermined time (for example, 40 seconds) has elapsed from the reception time from the resource information management table 270, the master node is operating normally, and the resource information in the master node If the transmission unit 21 has normally transmitted the resource information every predetermined time (for example, 30 seconds), the resource information of the master node continues to exist in the resource information management table 270. By detecting that the resource information of the master node has been deleted from the resource information management table 270, the slave processing unit 28 can detect that a failure has occurred in the master node.

次に、ノード20全体の動作について、フローチャートを用いて詳細に説明する。図11は、第1の実施形態におけるノード20の動作の一例を示すフローチャートである。例えば電源が投入される等の所定のタイミングで、ノード20は、本フローチャートに示す動作を開始する。   Next, the operation of the entire node 20 will be described in detail using a flowchart. FIG. 11 is a flowchart illustrating an example of the operation of the node 20 in the first embodiment. For example, at a predetermined timing such as when the power is turned on, the node 20 starts the operation shown in this flowchart.

まず、リソース情報送信部21は、自ノード20のノードID、自ノード20のアドレス、自ノード20のリソース情報、および自ノード20の製造年月日をリソース情報格納部27内のリソース情報管理テーブル270から読み出して、計算機用LAN12を介して他のノード20へ例えばブロードキャストにより送信する(S300)。そして、履歴情報管理部24は、リソース情報格納部27内のリソース情報管理テーブル270を参照して、所定数以上のノード20に関するリソース情報がリソース情報管理テーブル270内に格納されたか否かを判定する(S301)。なお、リソース情報登録部22は、他のノード20からリソース情報等を受信する都度、受信したリソース情報等をリソース情報格納部27内のリソース情報管理テーブル270に新規登録または上書登録する。   First, the resource information transmission unit 21 stores the node ID of the own node 20, the address of the own node 20, the resource information of the own node 20, and the date of manufacture of the own node 20 in the resource information management table 27 in the resource information storage unit 27. The data is read from 270 and transmitted to other nodes 20 via the computer LAN 12 by, for example, broadcast (S300). Then, the history information management unit 24 refers to the resource information management table 270 in the resource information storage unit 27 and determines whether or not resource information regarding a predetermined number of nodes 20 is stored in the resource information management table 270. (S301). Each time the resource information registration unit 22 receives resource information or the like from another node 20, the resource information registration unit 22 newly registers or overwrites the received resource information or the like in the resource information management table 270 in the resource information storage unit 27.

所定数以上のノード20に関するリソース情報がリソース情報管理テーブル270内に格納された場合(S301:Yes)、履歴情報管理部24は、他のノード20へ履歴情報を要求するメッセージを、例えばブロードキャストにより計算機用LAN12を介して送信し、他のノード20から送信された履歴情報を受信して履歴情報格納部23に格納する(S302)。そして、履歴情報管理部24は、履歴情報格納部23を参照し、リース期限内のマスタノード情報が存在するか否かを判定する(S303)。   When resource information related to a predetermined number of nodes 20 or more is stored in the resource information management table 270 (S301: Yes), the history information management unit 24 sends a message requesting history information to other nodes 20 by, for example, broadcasting. The history information transmitted via the computer LAN 12 and transmitted from the other node 20 is received and stored in the history information storage unit 23 (S302). Then, the history information management unit 24 refers to the history information storage unit 23 and determines whether there is master node information within the lease time limit (S303).

リース期限内のマスタノード情報が履歴情報格納部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 information management unit 24 notifies the slave processing unit 28 of the node ID of the master node. The slave processing unit 28 determines whether or not a node-specific processing instruction describing the processing assigned to the node 20 is received from the master node (S304). When the node-specific processing instruction of the own node 20 has not been received from the master node (S304: No), the slave processing unit 28 executes the processing shown in step S304 until the node-specific processing instruction is received.

自ノード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 own node 20 is received from the master node (S304: Yes), the slave processing unit 28 operates each block in the sensing application execution unit 29 according to the received node-specific processing instruction (S305). ). Then, the slave processing unit 28 refers to the resource information management table 270 in the resource information storage unit 27 based on the node ID of the master node, and monitors whether or not the resource information of the master node is stored. It is determined whether or not the master node is operating normally (S306). When the master node is not operating normally (S306: No), the slave processing unit 28 instructs the master determination unit 25 to determine the master node, and the master determination unit 25 executes the process of step S307 described later. .

ステップ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 information management unit 24 instructs the master determination unit 25 to select a master node. The master determination unit 25 determines a master node with another node 20 using the PAXOS protocol, for example, according to the procedure described with reference to FIG. 10 (S307). Then, the master determination unit 25 determines whether or not the own node 20 has become the master (S308). When the own node 20 is not the master (S308: No), the master determination unit 25 notifies the node ID of the master node to the slave processing unit 28, and the slave processing unit 28 executes the process shown in step S304. On the other hand, when the node 20 is a master (S308: Yes), the process allocation unit 26 determines whether or not a process definition exists in the history information storage unit 23 (S309). When the process definition does not exist in the history information storage unit 23 (S309: No), the process allocation unit 26 repeats step S309 until the process definition is stored in the history information storage unit 23.

履歴情報格納部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 process allocation unit 26 executes process allocation described later (S400). Then, the process allocation unit 26 transmits a node-specific process instruction in which the process allocated to each node 20 other than the own node 20 is described (S310). Then, the process assigning unit 26 assigns the process by monitoring whether or not the resource information of each node 20 to which the process is assigned is stored in the resource information management table 270 in the resource information storage unit 27. It is determined whether or not the node 20 is operating normally (S311).

処理を割り当てたそれぞれのノード20が正常に稼動している場合(S311:Yes)、履歴情報管理部24は、計算機用LAN12を介してコンソール11から新たな処理定義を受信したか否かを判定する(S312)。処理を割り当てたいずれかのノード20が正常に稼動していない場合(S311:No)、または、コンソール11から新たな処理定義を受信した場合(S312:Yes)、処理割当部26は、再びステップS400に示す処理を実行する。   When each node 20 to which the process is assigned is operating normally (S311: Yes), the history information management unit 24 determines whether or not a new process definition has been received from the console 11 via the computer LAN 12. (S312). When any of the nodes 20 to which the process is assigned is not operating normally (S311: No), or when a new process definition is received from the console 11 (S312: Yes), the process assignment unit 26 performs the step again. The process shown in S400 is executed.

一方、履歴情報管理部24がコンソール11から新たな処理定義を受信していない場合(S312:No)、マスタ決定部25は、12を介してコンソール11からマスタノードの再選出を指示されたか否かを判定する(S313)。マスタノードの再選出を指示された場合(S313:Yes)、マスタ決定部25は、再びステップS307に示した処理を実行する。一方、マスタノードの再選出を指示されなかった場合(S313:No)、処理割当部26は、再びステップS311に示した処理を実行する。   On the other hand, if the history information management unit 24 has not received a new process definition from the console 11 (S312: No), the master determination unit 25 has been instructed by the console 11 to re-select a master node via 12 or not. Is determined (S313). When an instruction to re-select a master node is given (S313: Yes), the master determination unit 25 executes the process shown in step S307 again. On the other hand, when the re-election of the master node is not instructed (S313: No), the process allocation unit 26 executes the process shown in step S311 again.

図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 information storage unit 23 stores the process definition template illustrated in FIG. 7 and the process definition body illustrated in FIGS. 8 and 9. Further, it is assumed that the resource information management table 270 in the resource information storage unit 27 stores data having the contents shown in FIG.

ここで、処理定義のデータ構造について説明する。処理定義は、処理定義テンプレートと処理定義本体とを有する。処理定義本体(図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 node 20, and the class name corresponding to the program executing each process is described in the first argument of “Process” and “SubProcess”. For the sake of brevity, in the following, the process defined by the Process section and the SubProcess section is simply referred to as Process or SubProsess. Parameters necessary for executing each process are described as “Param” attributes in the section. The first argument of the Param attribute is the parameter name, and the second argument is the parameter value.

処理定義本体に記載された処理のインスタンス構成は、処理割当部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 process allocation unit 26. There is not necessarily one instance of one Process or SubProcess, and a plurality of nodes may execute the same process in parallel. On the other hand, there is a case where it is desired to explicitly specify that two or more processes described in the process definition body should not exist. For example, lines 44 to 47 of the process definition main body (see FIG. 9) describe a process for controlling an RFID device accessed at a specified address (192.168.10.101). Since there is only one, this process needs to have one instance. In such a case, the instance name is specified in the second argument of the SubProcess section. Since the instance of the SubProcess section in which the instance name is specified is only the instance corresponding to the instance name, the number of instances is one.

処理定義テンプレート(図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 line 21 of the process definition template is used as a pattern matching condition, and matches the “Process“ sensor ”” section described in line 43 of the process definition body. Then, “ProcessUnit“ subprocess ”” described in the 22nd line of the process definition template is inserted into the Process section on the 43rd line and below of the process definition body.

処理定義テンプレートの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 dispatcher 290, the filter 291, the drive control 292, and the adapter 293 included in the sensing application execution unit 29 shown in FIG. The Process section whose class name is “dispatch” described in the first to fourth lines of the process definition main body indicates the process of the dispatcher 290, and the destination (dest) and the content encoding method (content- coding) is specified as a parameter.

処理定義本体(図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 filter 291. Specific processing contents are defined in the SubProcess section. The SubProcess section described in the ninth to eleventh lines of the process definition body is a differential filter used in the data processing of the RFID tag, and the class name is “inout-filter”. The difference filter is a filter process that outputs a difference between continuously input data. For example, when a new RFID tag is detected, an IN event is output, and when an existing RFID tag cannot be found, an OUT event is output. In this example, since the output data (output) is described as “in” as a parameter, an OUT event is not output, and only an IN event is output. The SubProcess section described in the 17th to 20th lines of the process definition body is a filter that performs statistical processing. Output data (output) is specified as a parameter, and here, an average (average) and a variance (variance) are output.

処理定義本体の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 drive control 292, and the independently operated sensor control cycle is defined as the SubProcess section. ing. In this example, three sensor control cycles are defined. In each SubProcess section, a driving period (period) and a driving sensor (sensor-ref) are specified as parameters. In the parameter sensor-ref, the instance name of SubProcess whose class name is “sensor” is specified. As will be described later, SubProcess whose class name is “sensor” corresponds to the sensor one-to-one. Therefore, specifying the parameter sensor-ref in this way is equivalent to specifying the sensors individually. When a plurality of sensor-refs are described as in lines 26 to 27 of the process definition body, it is indicated that the sensors described in the “sensor-ref” are driven in parallel. Therefore, in this example, the sensors “a” and “b” are driven in this order, and the sensors “c” and “d” are driven in this order in parallel.

処理定義本体(図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 adapter 293, and the control process of each sensor 14 is the SubProcess section. Is defined as In each SubProcess, the type of sensor 14 and the address (addr) or device identifier (devId) of sensor 14 are specified as parameters. In this example, the type of sensor 14 connected to the network is specified by an address, and the sensor 14 that is directly connected to the node 20 via a serial interface is specified by a device identifier. The device identifier of the sensor 14 specified by the device identifier and the serial port name for accessing the sensor 14 are described in the resource information 274 of the resource information management table 270 (see FIG. 5). When accessing such a sensor 14, the adapter 293 searches the resource information 274 using the device identifier as a key, acquires the serial port name, and uses the serial port.

各処理の連携方法は、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 nodes 20, when an instance of each process is allocated to each node 20, it is necessary to determine a minimum unit of the instance (hereinafter referred to as a process unit). A processing unit means a minimum unit in which no more instances can be decomposed, and one processing unit is always executed on one node. Further, when a certain process is composed of a plurality of processing units, different nodes can execute each processing unit. As a method for determining a processing unit, for example, (1) a method in which each SubProcess section in which an instance name is specified is configured as one processing unit, and (2) a processing unit is configured in association with a resource used by the processing. And (3) a method of configuring a processing unit in association with a processing unit of processing for generating input data of the processing.

各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 node 20 whose node ID is “001” or “002”. Therefore, the process described in the Process “dispatch” section is composed of two processing units executed by each of the two nodes 20.

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 sensor 14 and can also be expressed by event / sec. Since the amount of data to be processed is proportional to the number of sensors 14 and the reciprocal of the driving period of the sensors 14, the unit sensor-event is used. In the end, the above means that “8kbps communication resources are required when processing data acquired once per second from one sensor”.

「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 process allocation unit 26 creates the process allocation table 30 shown in FIG. 13 from the process definition template shown in FIG. 7 and the process definition body shown in FIGS. 8 and 9 (S401). In the process allocation table 30, for each process ID 31 for identifying each process unit, a process unit name 32 indicating the name of the corresponding process unit, and a process ID of the process unit of the data providing source used by the corresponding process unit are displayed. A data source 33 to be displayed, an event / sec 34 indicating the number of executions per unit time of the corresponding processing unit, and an ID of a device used by the corresponding processing unit and connected to the sensor interface 208 of the node 20 The device 35, mips 36 indicating the processing capability required for the corresponding processing unit, and node 37 indicating the ID of the node 20 to which the corresponding processing unit is assigned are stored.

処理割当部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 process allocation unit 26 refers to the ProcessUnit attribute of each Process section, and the first argument of the ProcessUnit attribute is (1) “subprocess”, (2) “device”, or (3) “source-subprocess” in that order. The processing unit is determined. When the first argument of the ProcessUnit attribute is (1) “subprocess”, the process allocation unit 26 uses the SubProcess section as a processing unit as it is. The name of the processing unit is [Process class name] / [SubProcess class name] @ [SubProcess instance name]. When the first argument of the ProcessUnit attribute is (2) “device”, the process allocation unit 26 needs to refer to the resource information management table 270 in the resource information storage unit 27 in addition to the process definition. Postpone processing.

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 process allocation unit 26 refers to the SourceRef attribute of the Process or SubProcess section whose processing unit is to be determined, and creates input data for the process. Get the processing unit of SubProcess. Hereinafter, a process (Process or SubProcess) that generates input data of a certain process (Process or SubProcess) is referred to as a data source. When the processing unit of the data source can be acquired, a processing unit corresponding to the processing unit is created. For example, the SourceRef attribute of the Process "filters" section described in lines 14 to 21 of the process definition body (Fig. 8) is "SourceRef" cycle "" sensor-group "" area2, area3 "" And the instance name of the process referenced by the SourceRef attribute. Since the process with the instance name is a processing unit, the processing unit of the data source is (Process class name, SubProcess class name, SubProcess instance name) = (cycle, sensor-group, area2), (cycle , sensor-group, area3). The process allocation unit 26 creates a process unit corresponding to these two process units as a process unit of the Process “filters” section. The name of the process unit is [Process class name] / [data source SubProcess class name] @ [data source SubProcess instance name]. Therefore, filters / sensor-group @ area2 and filters / sensor-group @ area3 are processing unit names.

上記手順で(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 processing allocation unit 26 registers the processing unit name in the processing unit name 32 of the processing allocation table 30, and is a number that can uniquely identify each processing unit. Is registered in the process ID 31. Next, the process allocation unit 26 acquires a device identifier of a device to be used from the process definition for a process unit having a ProcessUnit attribute other than “device”. For example, in the 54th or 58th line of the process definition body (see FIG. 9), the device identifier for the process unit having (class name, instance name) = (sensor, c) (sensor, d) is the parameter “ devId ”. The process allocation unit 26 registers the ID of the device corresponding to “devId” in the device 35 of the process allocation table 30.

次に処理割当部26は、処理定義に記載されたSource-Ref属性に基づき、各処理単位が使用するデータの提供元となる処理単位の処理IDを、各処理単位に対応するデータソース33に登録することで、処理単位間の連携関係を処理割当テーブル30に登録する。ここでは、処理割当部26は、Source-Ref属性にSubProcessのインスタンス名まで指定された場合についてのみデータソース33に登録する。   Next, based on the Source-Ref attribute described in the process definition, the process allocating unit 26 assigns the process ID of the process unit that provides the data used by each process unit to the data source 33 corresponding to each process unit. By registering, the cooperative relationship between the processing units is registered in the processing allocation table 30. Here, the process allocation unit 26 registers in the data source 33 only when the Source-Ref attribute is specified up to the instance name of SubProcess.

また、処理定義の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 process allocation unit 26 processes the processing unit of the data providing source for the processing unit. The ID is registered in the data source 33. Specifically, the processing unit name 32 is “filter / sensor-group @ area1”, “filter / sensor-group @ area2”, or “filter / sensor-group @ area3”. Process the data generated by the processing unit of “cycle / sensor-group @ area1”, “cycle / sensor-group @ area2”, or “cycle / sensor-group @ area3” as input data. Associate these in the process allocation table 30. As a result, as shown in FIG. 13, the data sources 33 of the processing units whose process IDs 31 are “1”, “2”, and “3” are “4”, “5”, and “6”, respectively.

処理定義本体(図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 line 23 to line 41 of the process definition body (see Figure 8), both the SubProcess and the data source of the SubProcess are listed up to the instance name, so the relationship between the processing units of SubProcess and the data source is obvious. is there. Therefore, the process allocation unit 26 describes the correspondence relationship with the data source in the process allocation table 30 according to the content described in the Source-Ref attribute. As a result, as shown in FIG. 13, the data sources 33 whose processing IDs are “4”, “5”, and “6” are “7, 8, 9, 10”, “11, 12”, respectively. , 13 ”and“ 14, 15, 16 ”.

次に、処理割当部26は、処理定義本体(図8参照)のProcess "cycle"セクションの記載内容から、Process "sensors"セクションに定義されたセンサ制御処理の駆動間隔を求め、センサ制御処理の各処理単位に対してevent/sec34の値を求める。このevent/sec34の値を足し合わせることで、センサ制御処理が生成するデータを入力データとして使用する各種処理単位のevent/sec34を求めていく。   Next, the process allocation unit 26 obtains the drive interval of the sensor control process defined in the Process “sensors” section from the description in the Process “cycle” section of the process definition body (see FIG. 8), and performs the sensor control process. The value of event / sec 34 is obtained for each processing unit. By adding the values of the event / sec 34, the event / sec 34 for various processing units using the data generated by the sensor control process as input data is obtained.

すなわち、処理割当部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 process allocation unit 26 refers to the Process “cycle” section of the process definition body, and acquires the drive period of the sensor control process from the “period” parameter in the SubProcess “sensor-group” section. For example, in the SubProcess section described in the 24th to 28th lines of the process definition body (see FIG. 8), sensor control processes having instance names of “a”, “b”, “c”, and “d” Is driven at a cycle of 1000 milliseconds. Accordingly, the value of event / sec 34 in the processing unit of the sensor control process is “1”. Similarly, from the SubProcess section described in the 29th to 34th lines of the process definition body, the drive cycle of the sensor control process with instance names of “e”, “f”, and “g” is 2000 milliseconds. It turns out that the event / sec 34 of the processing unit of these sensor control processes is “0.5”. In this way, the process allocation unit 26 determines event / sec 34 for the processing unit of each sensor control process. As a result, the event / sec 34 of the processing unit having the process ID 31 of “7” to “16” is as shown in FIG.

次に、処理割当部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 process allocation unit 26 searches for the process unit described in the data source 33 by the process ID 31 of the process unit for which the value of event / sec 34 has already been obtained. That is, the process allocation unit 26 finds process units having process IDs 31 of “4”, “5”, and “6”. The event / sec 34 of each processing unit found by the process allocation unit 26 is the sum of the event / sec 34 of the processing unit corresponding to the process ID 31 described in the data source 33. For example, “7, 8, 9, 10” is described in the data source 33 of the processing unit whose process ID 31 is “4”, and the process ID 31 is “7”, “8”, “9”, or “ The value of event / sec 34 in the processing unit of “10” is “1”. Therefore, the process allocation unit 26 calculates the value of the event / sec 34 of the process unit having the process ID 31 of “4” as “4” that is the sum of these values. Similarly, the process allocation unit 26 calculates event / sec 34 for a process unit whose process ID 31 is “5” or “6”.

続いて処理割当部26は、データソース33に処理IDが設定されている他の処理単位のそれぞれについても上記の手順を繰り返してevent/sec34を求める。例えば、処理ID31が「1」、「2」、または「3」の処理単位についてのevent/sec34は、図13に示す値となる。これにより、処理ID31が「1」〜「16」のそれぞれの処理単位についてevent/sec34が設定された。   Subsequently, the process allocation unit 26 repeats the above procedure for each of the other processing units for which process IDs are set in the data source 33, and obtains event / sec 34. For example, the event / sec 34 for the processing unit with the processing ID 31 of “1”, “2”, or “3” has the value shown in FIG. As a result, event / sec 34 is set for each processing unit whose processing ID 31 is “1” to “16”.

次に処理割当部26は、処理定義に記載された必要な処理能力に関するRequire属性と、各処理単位が処理するデータ量に基づき、各処理単位に必要な処理能力を算出する。処理定義には、Require属性として「mips-per-sensor-event」単位でのmips値が記載されており、この値と処理割当テーブル30内の各処理単位のevent/sec34を積算したものが、各処理単位に必要な処理能力となる。   Next, the process allocation unit 26 calculates the required processing capacity for each processing unit based on the Require attribute relating to the required processing capacity described in the process definition and the amount of data processed by each processing unit. In the process definition, the mips value in “mips-per-sensor-event” unit is described as the Require attribute, and this value and the event / sec 34 of each process unit in the process allocation table 30 are integrated. This is the processing capacity required for each processing unit.

図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 / sec 34 of the process unit with the process ID 31 “1” is “4”. This processing unit is defined as a Process “filters” section, and the Require attribute relating to the processing capability required for this processing unit is “Require“ cpu ”“ 10 ”” on the seventh line of the processing definition body (see FIG. 8). mips-per-sensor-event "". Therefore, the process allocation unit 26 calculates 4 × 10 = 40 mips as the necessary processing capacity. The process allocation unit 26 registers the calculated necessary processing capacity in the mips 36 column of the corresponding processing unit. The process allocation unit 26 similarly obtains mips values for the process units having process IDs 31 of “2” to “16” and registers them in the mips 36. At this time, the column in the mips 36 of the process allocation table 30 is in the state shown in FIG.

図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 process allocation unit 26 refers to the process definition and resource information management table 270 and creates a process unit to be created for each device connected to the node 20 (S402). More specifically, the process allocation unit 26 refers to the process definition template and the resource information 274 of the resource information management table 270 and searches for the resource specified as the second argument of the ProcessUnit attribute. For example, since the ProcessUnit attribute of the Process “dispatch” section is “ProcessUnit“ device ”“ communicate ””, the process allocation unit 26 searches the resource information management table 270 for a “communicate” resource for the section. . In the resource information management table 270 shown in FIG. 5, since the communication card with the device identifier (devID) “card001” and the communication card with “card002” are found, the processing allocation unit 26 creates a processing unit corresponding to each. To do.

今の場合、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 process allocation unit 26 sets the name of the processing unit as [Process class name] @ [device identifier]. On the other hand, when the SubProcess exists, the process allocation unit 26 sets the name of the processing unit as [Process class name] / [SubProcess class name] @ [device identifier]. In addition, since the device identifier may be duplicated across the plurality of nodes 20, the process allocation unit 26 may use a combination of the node ID and the device identifier instead of the device identifier. In this embodiment, it is assumed that a device can be identified only by a device identifier for the sake of brevity. Then, the process allocation unit 26 refers to the process definition corresponding to the generated process unit, and if there is a device used by the process unit and connected to the node 20, the device 35 of the process allocation table 30 is used. Register with. The process allocation table 30 after the process of step S402 is performed is, for example, as shown in FIG. An area 300 indicates data newly registered as a result of the processing in step S402.

次に、処理割当部26は、新たに作成された処理単位(処理ID31が「17」または「18」の処理単位)について、当該処理単位が使用するデータの提供元を割り当てる処理を実行する(S500)。ここで、データ提供元の割当処理(S500)の動作について図15を用いて説明する。図15は、データ提供元の割当処理(S500)の一例を示すフローチャートである。本フローチャートでは、処理割当テーブル30が図14に示した状態にあることを前提として説明を行う。   Next, the process allocation unit 26 executes a process of allocating a data supply source used by the process unit for a newly created process unit (a process unit whose process ID 31 is “17” or “18”) ( S500). Here, the operation of the data provider allocation process (S500) will be described with reference to FIG. FIG. 15 is a flowchart illustrating an example of the data providing source allocation process (S500). This flowchart will be described on the assumption that the process allocation table 30 is in the state shown in FIG.

まず、処理割当部26は、ステップS402において新たに作成された処理単位にデータを提供する処理単位の中で、新たに作成された処理単位のデータ提供元としてデータソース33に登録されておらず、かつ、単位時間当たりの実行回数が最も多い処理単位を1つ選択する(S501)。図14の処理割当テーブル30の例では、処理割当部26は、クラス名「filters」を持つ処理単位の中で、処理ID31が「1」の処理を選択する。   First, the process allocation unit 26 is not registered in the data source 33 as a data provider of a newly created processing unit among the processing units that provide data to the newly created processing unit in step S402. One processing unit having the largest number of executions per unit time is selected (S501). In the example of the process allocation table 30 in FIG. 14, the process allocation unit 26 selects a process whose process ID 31 is “1” among the process units having the class name “filters”.

次に、処理割当部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 process allocation unit 26 calculates the processing capability required by the currently allocated resource for each processing unit newly created in step S402, and stores the calculated value in the corresponding event / sec 34 column. (S502). In the example of the process allocation table 30 in FIG. 14, since no data is registered in the data source 33 of the process unit whose process ID 31 is “17” or “18”, the process unit is input from another process unit. The processing capacity necessary for processing the processed data is currently “0”. Further, for example, when “2” and “3” are registered in the data source 33 of the processing unit with the processing ID 31 of “18”, the processing allocation unit 26 determines the event / of the processing unit with the processing ID 31 of “2”. The total processing capacity of “1.5” registered in sec 34 and “1.5” registered in event / sec 34 of the processing unit whose processing ID 31 is “3” is the data input from other processing units. Calculated as the processing capacity required for processing.

次に、処理割当部26は、ステップS402において新たに作成された処理単位の中で、必要な処理能力が最も低い処理単位に、ステップS501で選択した処理単位を割り当てる(S503)。図14の処理割当テーブル30の例では、処理ID31が「17」または「18」の処理単位のいずれにも、現時点ではevent/sec34に「0」が登録されている。この場合、処理割当部26は、処理ID31が「17」または「18」の処理単位のいずれのデータソース33に「1」を登録してもよいが、本実施形態では、処理ID31が小さい処理単位の33に登録することとする。   Next, the processing allocation unit 26 allocates the processing unit selected in step S501 to the processing unit having the lowest necessary processing capability among the processing units newly created in step S402 (S503). In the example of the process allocation table 30 in FIG. 14, “0” is registered in the event / sec 34 at the present time for both process units having the process ID 31 of “17” or “18”. In this case, the process allocation unit 26 may register “1” in any data source 33 in the process unit having the process ID 31 of “17” or “18”, but in the present embodiment, the process ID 31 is a small process. The unit 33 is registered.

なお、ステップS503において、処理割当部26は、ステップS402において新たに作成された処理単位の中で、必要な処理能力が最も低い処理単位に、ステップS501で選択した処理単位を割り当てるが、この場合、必要な処理能力が最も低い処理単位のdevice35に登録されている機器のIDに基づいてリソース情報管理テーブル270を参照し、当該機器の処理能力を取得して、ステップS501で選択した処理単位を割り当てた場合に、当該処理能力を超えるならば、必要な処理能力が次に低い処理単位にステップS501で選択した処理単位を割り当てるようにする。   In step S503, the processing allocation unit 26 allocates the processing unit selected in step S501 to the processing unit having the lowest necessary processing capacity among the processing units newly created in step S402. In this case, The resource information management table 270 is referred to based on the ID of the device registered in the device 35 of the processing unit having the lowest necessary processing capability, the processing capability of the device is acquired, and the processing unit selected in step S501 is obtained. If the allocation exceeds the processing capability, the processing unit selected in step S501 is allocated to the processing unit having the next lowest processing capability.

次に、処理割当部26は、ステップS402において新たに作成した処理単位にデータを提供する処理単位の全てを割り当てたか否かを判定する(S504)。ステップS402において新たに作成した処理単位にデータを提供する処理単位の全てを割り当てていない場合(S504:No)、処理割当部26は、再びステップS501に示した処理を実行する。一方、ステップS402において新たに作成した処理単位にデータを提供する処理単位の全てを割り当てた場合(S504:Yes)、処理割当部26は、本フローチャートに示したデータ提供元の割当の処理を終了する。本フローチャートに示した処理が終了すると、処理割当テーブル30には、図16に示した領域301および領域302内のデータが登録される。   Next, the process allocation unit 26 determines whether all the process units that provide data are allocated to the process unit newly created in step S402 (S504). If all of the processing units that provide data are not allocated to the newly created processing unit in step S402 (S504: No), the process allocation unit 26 executes the process shown in step S501 again. On the other hand, when all of the processing units that provide data are allocated to the newly created processing unit in step S402 (S504: Yes), the processing allocation unit 26 ends the allocation process of the data provider illustrated in this flowchart. To do. When the process shown in this flowchart is completed, the data in the area 301 and the area 302 shown in FIG.

なお、図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 processing allocation unit 26 refers to the resource information management table 270 based on the ID of the device registered in the device 35 of the processing unit newly created in step S402, and determines the processing capability of the device. get. Then, the processing allocation unit 26 allocates the processing unit selected in step S501 as a data providing source of the processing unit having the largest required processing capability within a range not exceeding the processing capability of the resource (S505). In addition to allocating the processing unit of the data provider to the full processing capacity of the resource, the processing allocation unit 26 sets a limit value for a predetermined ratio (for example, 75%) of the processing capacity of the resource, and the processing unit selected in step S501 May be assigned as the data provider of the processing unit having the largest required processing capability within a range not exceeding the limit value.

図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 process allocation unit 26 calculates the necessary processing capacity for each processing unit created in step S402 (S403). In step S403, the process allocation unit 26 calculates the processing capacity required for each processing unit based on the Require attribute related to the required processing capacity described in the process definition and the amount of data processed by each processing unit. For example, the event / sec 34 of the processing unit with the processing ID 31 of “17” is “4”, and this processing unit is defined as a Process “dispatch” section. “Require“ cpu ”“ 10 ”“ mips-per-sensor-event ”” is described in the fourth line of the process definition template. Therefore, the process allocation unit 26 calculates 4 × 10 = 40 mips as necessary processing capability and registers it in the mips 36. The process allocation unit 26 similarly determines the mips value for the process unit having the process ID 31 of “18” and registers it in the mips 36. As a result, the data of the area 303 shown in FIG.

次に、処理割当部26は、ノード20に接続されている機器を利用する処理単位を、その機器が接続されているノード20に割り当てる(S404)。処理割当部26は、処理割当テーブル30内でdevice35にデータが登録されているそれぞれの処理単位について、リソース情報管理テーブル270を参照し、device35と同一のデバイス識別子が記載されたリソース情報を探す。そして、処理割当部26は、見つかったリソース情報に対応付けられているノードIDを、対応する処理単位のnode37に登録する。   Next, the process allocation unit 26 allocates a processing unit using a device connected to the node 20 to the node 20 to which the device is connected (S404). The process allocation unit 26 refers to the resource information management table 270 for each process unit in which data is registered in the device 35 in the process allocation table 30 and searches for resource information in which the same device identifier as the device 35 is described. Then, the process allocation unit 26 registers the node ID associated with the found resource information in the corresponding process unit node 37.

例えば、処理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 device 35 of the processing unit whose processing ID 31 is “17”, the processing allocation unit 26 stores the resource information in which the device identifier “card001” is registered in the resource information management table 270. The resource information of the node 20 whose node ID is “001” is detected. Then, the process allocation unit 26 registers “001” in the node 37 of the corresponding process unit in the process allocation table 30. The process allocation unit 26 registers the node 37 in the same manner for the process unit having the process ID 31 of “9”, “10”, or “18”. As a result, the data of the area 304 and the area 305 shown in FIG.

次に、処理割当部26は、処理単位を実行させるノード20を決定する。各ノード20への処理割り当てアルゴリズムの概要は以下のとおりである。
(1)要求性能が大きな処理に確実にCPUリソースを割り当てるために、必要な処理能力(mips値)が大きな処理単位から順に割り当てる。
(2)ノード20間の通信オーバヘッドを削減するため、データの送受信が関連している処理単位を、なるべく同一ノードに割り当てる。
(3)上記(1)のポリシーで割り当てを行うと、特定のノードに負荷が集中してしまう場合があるため、CPU負荷に制限値(例えば75%)を設け、処理を割り当てたとすればCPU負荷が当該制限値以上となってしまう場合には、通信オーバヘッドが発生したとしても当該処理単位を他のノード20に割り当てる。上の例ではCPU負荷の制限値を100%よりも小さな値にしているが、これはCPU負荷の変動にも対応可能とするためである。
Next, the process allocation unit 26 determines a node 20 that executes a process unit. The outline of the algorithm for assigning processes to each node 20 is as follows.
(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 nodes 20, a processing unit related to data transmission / reception is assigned to the same node as much as possible.
(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 node 20 even if communication overhead occurs. In the above example, the limit value of the CPU load is set to a value smaller than 100%, but this is to make it possible to cope with fluctuations in the CPU load.

処理割当部26は、まず、リソース情報管理テーブル270および処理割当テーブル30を参照して、図18に示す負荷テーブル40を作成する。図18に示す負荷テーブル40には、ノードID41に対応付けて、当該ノードID41に対応するノード20のCPU処理能力を示す許容値42、および、当該ノードID41に対応するノード20に割り当てられている処理負荷を示す現在の負荷43が格納される。処理割当部26は、それぞれのノード20について、リソース情報管理テーブル270を参照して許容値42にデータを登録し、ステップS404においてノード20に割り当てた処理単位の負荷の合計値を現在の負荷43の欄に登録する(S405)。   The process allocation unit 26 first creates the load table 40 shown in FIG. 18 with reference to the resource information management table 270 and the process allocation table 30. In the load table 40 illustrated in FIG. 18, an allowable value 42 indicating the CPU processing capacity of the node 20 corresponding to the node ID 41 and the node 20 corresponding to the node ID 41 are allocated in association with the node ID 41. A current load 43 indicating the processing load is stored. The process allocation unit 26 registers data in the allowable value 42 with reference to the resource information management table 270 for each node 20, and sets the total load of the processing units allocated to the node 20 in step S 404 as the current load 43. (S405).

具体的には、処理割当部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 process allocation unit 26 refers to the process allocation table 30 and allocates the process unit with the process ID 31 of “17” to the node 20 with the node ID of “001” and the process ID 31 of “18”. The unit is assigned to the node 20 whose node ID is “002”, and the processing unit whose process ID 31 is “9” or “10” is assigned to the node 20 whose node ID is “003”. Therefore, when mips 36 of the corresponding processing unit is added, the CPU load of the node 20 with the node ID “001” is “40”, the CPU load of the node 20 with the node ID “002” is “30”, and the node ID is “ The CPU load of the node 20 of “003” is calculated as 20 + 20 = 40. At this point, the load table 40 is in the state shown in FIG.

次に、処理割当部26は、処理割当テーブル30を参照して、node37にデータが登録されていない処理単位の中で、必要な処理能力が最大の処理単位を1つ選択する(S406)。図16の状態では、node37にデータが登録されていない処理単位の中で、mips36に「75」が登録されている処理単位が2つ(処理ID31が「2」または「3」の処理単位)存在する。必要な処理能力が最大の処理単位が複数存在する場合、処理割当部26は、例えば処理ID31が最も小さい処理単位(図15の例では処理ID31が「2」の処理単位)を選択する。   Next, the processing allocation unit 26 refers to the processing allocation table 30 and selects one processing unit having the maximum required processing capability from among processing units for which data is not registered in the node 37 (S406). In the state of FIG. 16, among the processing units in which no data is registered in the node 37, there are two processing units in which “75” is registered in the mips 36 (processing units whose processing ID 31 is “2” or “3”). Exists. When there are a plurality of processing units having the maximum required processing capacity, the process allocation unit 26 selects, for example, the processing unit with the smallest processing ID 31 (the processing unit with the processing ID 31 of “2” in the example of FIG. 15).

次に、処理割当部26は、選択した処理単位が使用するデータの提供元または提供先の処理単位の中で、ノード20に既に割り当てられている処理単位が存在するか否かを判定する(S407)。例えば、図16の処理割当テーブル30では、処理ID31が「2」の処理単位にデータを提供している処理単位は、処理ID31が「5」の処理単位であり、処理ID31が「2」の処理単位は、処理ID31が「18」の処理単位にデータを提供している。処理ID31が「5」または「18」の処理単位の中で、ノード20に既に割り当てられているものは、図16の処理割当テーブル30では処理IDが「18」の処理単位である。   Next, the processing allocation unit 26 determines whether there is a processing unit already allocated to the node 20 among the processing units of the data providing source or the data receiving destination used by the selected processing unit ( S407). For example, in the process allocation table 30 of FIG. 16, the process unit that provides data to the process unit with the process ID 31 “2” is the process unit with the process ID 31 “5”, and the process ID 31 is “2”. The processing unit provides data to the processing unit whose process ID 31 is “18”. Among the processing units with the process ID 31 of “5” or “18”, those already assigned to the node 20 are processing units with the process ID “18” in the process assignment table 30 of FIG.

選択した処理単位が使用するデータの提供元または提供先の処理単位の中で、ノード20に既に割り当てられている処理単位が存在しない場合(S407:No)、処理割当部26は、ステップS409に示す処理を実行する。一方、選択した処理単位が使用するデータの提供元または提供先の処理単位の中で、ノード20に既に割り当てられている処理単位が存在する場合(S407:Yes)、処理割当部26は、その処理が割り当てられているノード20の許容値および現在の負荷の値を負荷テーブル40から取得し、ステップS406で選択した処理単位に必要な処理能力を処理割当テーブル30から取得する。   When there is no processing unit already assigned to the node 20 among the processing units of the data providing source or the receiving destination used by the selected processing unit (S407: No), the processing assigning unit 26 proceeds to step S409. The process shown is executed. On the other hand, if there is a processing unit that is already assigned to the node 20 among the processing units of the data provider or the destination that the selected processing unit uses (S407: Yes), the processing assignment unit 26 The allowable value of the node 20 to which the process is assigned and the current load value are acquired from the load table 40, and the processing capacity required for the processing unit selected in step S406 is acquired from the process allocation table 30.

そして、処理割当部26は、取得した現在の負荷の値と、ステップS406で選択した処理単位に必要な処理能力の値とを合計し、その合計値が、取得した許容値の所定割合(本実施形態では75%)以上か否かを判定する(S408)。合計値が許容値の所定割合未満である場合(S408:No)、処理割当部26は、ステップS406で選択した処理単位に対応する処理割当テーブル30のnode37に、ステップS407のYesで検出したノード20のノードIDを登録し(S410)、ステップS411に示す処理を実行する。   Then, the process allocating unit 26 sums the acquired current load value and the processing capacity value necessary for the processing unit selected in step S406, and the total value is a predetermined ratio of the acquired allowable value (this It is determined whether or not 75% or more in the embodiment (S408). When the total value is less than the predetermined ratio of the allowable value (S408: No), the process allocation unit 26 detects the node detected in Yes in step S407 in the node 37 of the process allocation table 30 corresponding to the processing unit selected in step S406. 20 node IDs are registered (S410), and the process shown in step S411 is executed.

一方、合計値が許容値の所定割合以上となる場合(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 process allocation unit 26 refers to the load table 40 and sets the processing unit selected in step S406 as the node with the lowest current load. The 20 node IDs are specified, and the specified node ID is registered in the node 37 of the process allocation table 30 corresponding to the process unit selected in step S406 (S409). Then, the process allocation unit 26 refers to the load table 40, and adds the processing capacity necessary for the newly allocated processing unit to the current load of the node 20 to which the new processing unit has been allocated. The contents of 40 are updated (S411).

次に、処理割当部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 process allocation unit 26 refers to the process allocation table 30 and determines whether or not the node ID is registered in the field of the node 37 of all the process units. It is determined whether or not it has been assigned (S412). When any processing unit is not allocated to the node 20 (S412: No), the process allocation unit 26 executes the process shown in step S406 again. On the other hand, when all the processing units are allocated to the node 20 (S412: Yes), the process allocation unit 26 executes processing for creating a node-specific processing instruction to be described later for each node 20 other than the own node 20 ( (S600), the process allocation unit 26 ends the process allocation shown in this flowchart. The load table 40 and the process allocation table 30 at the time when this flowchart ends are as shown in FIGS. 19 and 20, for example.

次に、ノード別処理指示の作成処理(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 node 20 other than the own node 20, but in the following, an explanation will be given by taking an example of a node-specific processing instruction for the node 20 whose node ID is “002”.

まず、処理割当部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 process allocation unit 26 refers to the process allocation table 30 and selects one unselected process unit (S601), and acquires the class name of the corresponding Process from the process unit name 32 of the selected process unit. Then, referring to the process definition, a Process section having the same class name is acquired (S602). In this case, since the node ID is “002”, a processing unit whose process ID 311 is “2”, “5”, “11”, “12”, or “18” is found. Then, the processing allocation unit 26 selects one of these processing units. For example, when the processing unit 31 has the processing ID 31 of “18”, the processing unit name 32 is “dispatch @ card002”. , Get Process section whose class name is “dispatch”.

次に、処理割当部26は、ステップS602で取得したProcessセクションのProcessUnit属性を参照して、ProcessUnit属性が「device」であるか否かを判定する(S603)。今の場合、処理定義テンプレート(図7)の2行目に「ProcessUnit "device" "communicate"」と記載されており、第一引数が「device」であることから、処理割当部26は、ステップS603においてYesと判定する。   Next, the process allocation unit 26 refers to the ProcessUnit attribute of the Process section acquired in Step S602, and determines whether or not the ProcessUnit attribute is “device” (S603). In this case, “ProcessUnit“ device ”“ communicate ”” is described in the second line of the process definition template (FIG. 7), and the first argument is “device”. In S603, it determines with Yes.

この処理単位は、デバイスに対応付けられているため、処理単位の実行にはデバイス情報が必要となる。処理割当部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 process allocation unit 26 adds device information as a parameter to the Process section (S604). The name of the parameter to be added is the second argument (that is, the device type) of the ProcessUnit attribute, and the parameter value is the device identifier described in the resource information 274 of the resource information management table 270. Specifically, the process allocation unit 26 refers to the process allocation table 30, acquires the ID of the node that executes the process unit from the node 37 of the process unit selected in step S601, and uses the acquired node ID as a key to obtain a resource. The information management table 270 is searched, and the resource information of the node 20 is acquired. In this case, since the node ID of the node 20 executing the processing unit is “002”, the resource information whose resource information management table 270 is “002” is acquired. The process allocation unit 26 acquires the device identifier of the community device from the acquired resource information. As a result, the process allocation unit 26 obtains “card002”. As described above, the process allocation unit 26 adds “Param“ communicate ”“ card2 ”” to the Process section.

次に、処理割当部26は、処理単位の名称をProcessセクションにName属性として追加する(S608)。Processセクションには、Processのクラス名が既に記載されているため、処理割当テーブル30の処理単位名称32に記載された名称からProcessのクラス名を削除したものをName属性とする。従って、ここでは、処理割当部26は、「Name "@card002"」を追加することとなる。   Next, the process allocation unit 26 adds the name of the process unit to the Process section as a Name attribute (S608). Since the Process class name is already described in the Process section, the name obtained by deleting the Process class name from the name described in the processing unit name 32 of the process allocation table 30 is referred to as a Name attribute. Accordingly, here, the process allocation unit 26 adds “Name“ @ card002 ””.

次に、処理割当部26は、生成したデータを入力データとして処理する処理単位をDestRef属性に設定する(S609)。処理割当部26は、ステップS601で選択した処理単位の処理ID31をデータソース33に持つ処理単位を検索することで、上記処理単位を検索する。今の場合、このような処理単位は見つからないので、処理割当部26は、上記パラメタは設定しない。以上で、処理割当部26は、処理ID31が「18」の処理単位に対してのノード別処理指示が完成する。   Next, the process allocation unit 26 sets a processing unit for processing the generated data as input data in the DestRef attribute (S609). The process allocation unit 26 searches for the process unit by searching for the process unit having the process ID 31 of the process unit selected in step S601 in the data source 33. In this case, since such a processing unit is not found, the processing allocation unit 26 does not set the above parameters. The process allocation unit 26 completes the node-specific process instruction for the process unit with the process ID 31 of “18”.

また、ステップ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 process allocation unit 26 refers to the ProcessUnit attribute of the Process section acquired in Step S602, and refers to the ProcessUnit attribute. It is determined whether or not the attribute is “souce-subprocess” (S605). When the ProcessUnit attribute is “souce-subprocess” (S605: Yes), that is, when the processing unit with the process ID 31 of “2” is selected in step S601, in the comparison of only the Process class name, a plurality of Process sections are included. To be acquired. In this case, the process allocation unit 26 acquires the parts of the 6th to 12th lines and the 14th to 21st lines of the process definition body (see FIG. 8). The process allocation unit 26 determines which process section should be used based on the SourceRef attribute (S606).

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 processing unit name 32 follows the naming rule of [Process class name] / [Data source SubProcess class name] @ [Data source SubProcess instance name]. Become. On the other hand, since the class name of SubProcess of the data source and the instance name of SUbProcess are set in the second argument and third argument of the SourceRef attribute, the processing allocation unit 26 is compared by comparing the processing unit name 32 with the SourceRef attribute. Can extract the corresponding part of the process definition. In this case, “area2” can be extracted from the processing unit name 32 as the instance name of the SubProcess of the data source, so the Process section having this instance name is the 14th to 21st lines of the process definition body. It turns out that it is a part.

次に、処理割当部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 process assignment unit 26 executes the process shown in step S608. Specifically, the process allocation unit 26 determines the Name attribute of the Process section. In this case, the Name attribute of the Process section is “Name“ sensor-group @ area2 ””. Then, the process allocation unit 26 searches the process allocation table 30 for a process unit having the process ID 31 of the process unit selected in S601 in the data source 33. In this case, the process allocation unit 26 finds the process unit whose process ID 31 is “18” as the process unit that satisfies the condition. This processing unit is the setting destination of the DestRef attribute. The process allocation unit 26 refers to the process unit name 32 and the node 37 of the process unit and confirms that they are “dispatch @ card002” and “002”, respectively. Further, the process allocation unit 26 refers to the resource information management table 270, searches for an entry having the same value as the data described in the field of the node 37 in the node ID 271, and refers to the address 272 of the found entry. Thus, the address of the node 20 is acquired. The process allocation unit 26 sets the DestRef attribute with the first argument as the node ID, the second argument as the address of the node 20, and the third argument as the name of the processing unit. Therefore, in this case, the process allocation unit 26 adds “DestRef“ 002 ”“ 192.168.10.12 ”“ dispatch @ card002 ”” to the Process section.

また、ステップ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 process allocation unit 26 determines that the first argument of the ProcessUnit attribute is “subprocess”. judge. For example, when the process is performed on the process unit with the process ID 31 of “5”, the process allocation unit 26 executes step S607. The process allocation unit 26 acquires the parts of the 23rd to 41st lines of the process definition body (see FIG. 8) by comparing the class names of Process. This part includes setting information for a plurality of processing units. In step S607, the process allocation unit 26 narrows down information based on the instance name of SubProcess. When the first argument of the ProcessUnit attribute is subprocess, the processing unit has a naming rule of [Process class name] / [SubProcess class name] @ [SubProcess instance name]. Therefore, the process allocation unit 26 can determine the corresponding SubProcess section from the second argument of the SubProcess section in the acquired Process section. In this case, since the processing unit name 32 of the processing unit with the processing ID 31 of “5” is “cycle / sensor-group @ area2”, the instance name of SubProcess is “area2”. Accordingly, the 29th to 34th lines of the process definition body are the corresponding SubProcess. Then, the process allocation unit 26 deletes other unnecessary SubProcess sections from the Process section.

次に、処理割当部26は、S608に示した処理を実行する。処理割当部26は、処理ID31が「11」または「12」の処理単位についても同様に処理を行い、ノードIDが「002」のノード20に対するノード別処理指示を完成させる。ノードIDが「002」のノード20に対するノード別処理指示を例示すると、例えば図22のようになる。なお、ノード別処理指示には、処理定義テンプレートまたは処理定義本体に記載されている、SourceRef属性、ProcessUnit属性、およびRequire属性は記載される必要はなく、処理割当部26は、ノード別処理指示を生成するときにこれら属性を削除する。   Next, the process allocation unit 26 executes the process shown in S608. The process allocation unit 26 performs the same process for the process unit with the process ID 31 of “11” or “12”, and completes the node-specific process instruction for the node 20 with the node ID of “002”. An example of a node-specific processing instruction for the node 20 with the node ID “002” is as shown in FIG. 22, for example. The node-specific process instruction does not need to include the SourceRef attribute, ProcessUnit attribute, and Require attribute described in the process definition template or the process definition body, and the process allocation unit 26 indicates the node-specific process instruction. Remove these attributes when creating.

以上、本発明の第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 processing system 10 of the present embodiment, it is possible to assign processing to a plurality of nodes 20 in consideration of cooperation between processing without concentrating the load on a specific node 20. it can.

なお、ユビキタスフロントエンドシステムを構成する全てのノード20が、同時に起動するとは限らないため、マスタノードが全てのノード20のノード別処理指示を生成し、各ノードへノード別処理指示を送信してシステムが動作を開始した後に、新たなノード20が起動する場合がある。また、システムが動作中にセンシングアプリケーション実行部29を稼動させているノード20に障害が発生する場合もある。マスタノードは、上記のようなノード20の増減を検出した場合、構成変更を行い、改めて全体の最適化を行う。具体的には、マスタノードは全てのノード20に、処理の停止を指示した後、図12に示す処理を再度実行し、各ノード20のノード別処理指示を再生成する。構成変更を実施するには、一旦システムの動作を停止する必要があるため、頻繁に構成変更を行うことは好ましくない。従って、マスタノードは、新規にノード20を検出した場合は、ノード検出後、一定時間経過した後に構成変更を行う。一方、センシングアプリケーション実行部29が動作中のノード20に障害が発生した場合、そのままにしておくとシステムの機能が損なわれてしまうため、マスタノードは、直ちに構成変更を行う。   Since not all nodes 20 constituting the ubiquitous front-end system are activated at the same time, the master node generates node-specific processing instructions for all the nodes 20, and transmits the node-specific processing instructions to each node. After the system starts operation, a new node 20 may start up. In addition, a failure may occur in the node 20 that operates the sensing application execution unit 29 while the system is operating. When the master node detects the increase or decrease of the node 20 as described above, the master node changes the configuration and optimizes the whole again. Specifically, after instructing all nodes 20 to stop processing, the master node re-executes the processing shown in FIG. In order to change the configuration, it is necessary to once stop the operation of the system. Therefore, it is not preferable to change the configuration frequently. Accordingly, when a new node 20 is detected, the master node changes the configuration after a certain time has elapsed after the node detection. On the other hand, if a failure occurs in the node 20 in which the sensing application execution unit 29 is operating, the function of the system is lost if the node 20 is left as it is, so the master node immediately changes the configuration.

次に、本発明の第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 processing system 50 in the second embodiment. The distributed processing system 50 includes a plurality of nodes 60 connected to the LAN 52. Each node 60 belongs to the subnet 51 for each of a plurality of groups. Each subnet 51 is connected via a router 53. Each node 60 performs distributed agreement processing using a PAXOS protocol with a plurality of other nodes 60.

図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 node 60 according to the second embodiment. The node 60 includes a node ID storage unit 61, an ID notification unit 62, an ID registration unit 63, and a distributed agreement processing unit 64. In the node ID storage unit 61, for example, as shown in FIG. 25, the node ID 611 for identifying each node 60 and the address 612 of each node 60 are received at the reception time 610 received from the other nodes 60 via the LAN 52. Store in association.

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 node 60 is activated, the ID notification unit 62 transmits the node ID and address of the own node 60 to the other nodes 60 via the LAN 52, for example, by broadcast. When receiving the node ID and address from another node 60 via the LAN 52, the ID registration unit 63 registers the received node ID and address in the node ID storage unit 61 in association with the reception time. The IP address of at least one node 60 in the other subnet 51 is set in at least one node 60 in each subnet 51, and the information of the node in each subnet 51 is the other subnet. The data is transmitted to at least one node 60 in 51.

分散合意処理部64は、ノード60の起動後に、ノードID格納部61内のノードIDの登録数の増加率を測定し、増加率が上昇から下降に転じた後に、当該増加率が、当該増加率の最大値から予め定められた割合だけ低い増加率となった場合に、その時点でノードID格納部61に登録されているノードIDの数を、分散合意アルゴリズムにおける定足数として、分間合意アルゴリズムを用いた処理を開始する。   The distributed agreement processing unit 64 measures the rate of increase in the number of registered node IDs in the node ID storage unit 61 after the node 60 is started, and the rate of increase increases after the rate of increase increases to decrease. When the rate of increase is a predetermined rate lower than the maximum rate, the number of node IDs registered in the node ID storage unit 61 at that time is used as a quorum in the distributed agreement algorithm, and the minute agreement algorithm is Start the process used.

ここで、ユビキタスフロントエンドシステムが多数のノード60から構成される場合、一般にはネットワーク負荷を分散させるため、図23に示すように、システムを複数のサブネットに分離した構成にする場合が多い。一方、ブロードキャストパケットにはネットワークアドレスが含まれており、ブロードキャストパケットは、ブロードキャストパケットが有するネットワークアドレス内の全ノード60に届くが、ネットワークが複数のサブネットで構成される場合、ブロードキャストパケットは、発信元のサブネット内にしか届かない。   Here, when the ubiquitous front-end system is composed of a large number of nodes 60, in general, in order to distribute the network load, the system is often separated into a plurality of subnets as shown in FIG. On the other hand, the broadcast packet includes a network address, and the broadcast packet reaches all the nodes 60 within the network address included in the broadcast packet. However, when the network is configured by a plurality of subnets, Can only reach within the subnet.

そのため、複数のサブネットから構成されるシステムでネットワーク全体へのブロードキャストを行うためには、全てのサブネットに対してブロードキャストパケットを送信する必要がある。そのためには、全てのサブネットのネットワークアドレスを予め全てのノード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 nodes 60, and the system construction work becomes complicated. In addition, when all nodes 60 transmit broadcast packets to all subnets, there is a problem that the network load increases.

この課題を解決する手法として、大規模な分散システムではシステムを構成するノード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 nodes 60 constituting a system in a large-scale distributed system. In other words, this is a method in which nodes that do not directly know the node information exchange node information in such a way that they are obtained via other nodes 60. When a state in which a certain node 60 holds node information of another node 60 is regarded as an edge (branch), the entire system can be considered as a graph structure. In such a node detection method, all the nodes 60 can perform node detection as long as each node 60 constituting the graph in the initial state is connected to each other at some edge and is a connected graph. it can.

従って、グラフが連結グラフになるように各ノード60に他のノード60のノード情報を予め設定しておけば、一定時間後、全てのノード60が他の全てのノード60を検出した状態になる。また、各ノード60は、停止するときに、これまで検出したノード60の情報をフラッシュROM等の不揮発性メモリに記録しておき、次回起動時に当該メモリからノード情報を読み出して通信を再開する。これによって次回起動時は、ノード情報の設定が不要となる。また次回起動時に、システムの構成変更によって一部のノード60のアドレスが変化したり、ノード60の増減があった場合も、変更されていない情報に基づき変更部分を検出することが可能となる。従って、システム構築時に設定作業が発生するが、一旦設定を行えば、その後のシステムの保守は不要になる。   Accordingly, if node information of other nodes 60 is set in advance in each node 60 so that the graph becomes a connected graph, after a predetermined time, all nodes 60 are in a state where all other nodes 60 are detected. . Further, when each node 60 stops, the information of the node 60 detected so far is recorded in a non-volatile memory such as a flash ROM, and the node information is read from the memory at the next activation and communication is resumed. This eliminates the need to set node information at the next startup. Further, at the next startup, even if the addresses of some of the nodes 60 change or the number of nodes 60 increases or decreases due to a system configuration change, the changed portion can be detected based on the information that has not been changed. Therefore, although setting work occurs at the time of system construction, once the setting is made, subsequent system maintenance becomes unnecessary.

一方、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 node 60 needs to know the total number of nodes. In the first embodiment described above, the total number of nodes is set for each node 60. However, when the number of nodes increases, the setting for each node 60 becomes complicated. When the system is changed and the number of nodes is changed, it is necessary to reset all the nodes 60.

システムが1つのサブネット内に収まる場合は、ブロードキャストパケットの送信周期だけ待てば全てのノード60を検出することが可能であるため、これによってそれぞれのノード60は全ノード数を知ることができる。しかし、上記のようにシステムが複数のサブネットから構成されており、ノード同士がノード情報を交換することでノード検出を行う場合には、どの程度待てば全ノード数を検出した状態になるのか不明である。   When the system is within one subnet, it is possible to detect all the nodes 60 by waiting for the transmission period of the broadcast packet, so that each node 60 can know the total number of nodes. However, if the system is composed of multiple subnets as described above, and node detection is performed by exchanging node information between nodes, it is unclear how long to wait until the total number of nodes is detected. It is.

このような課題に対して本実施形態では、各ノード60が検出したノード数の時間変化を記録しておき、検出したノード数の時間変化に基づき、全ノード数を予測し、PAXOSプロトコルで使用する定足数を決定する。   In this embodiment, the time change of the number of nodes detected by each node 60 is recorded, and the total number of nodes is predicted based on the time change of the detected number of nodes and used in the PAXOS protocol. Determine the quorum you want.

図26〜図28に、ノード60同士がノード情報を交換する方式でノード検出を行った場合のシミュレーション結果を示す。図26〜図28では、検出したノード数の時間変化が「+」でプロットされ、それを微分した値(増加率)が「×」でプロットされている。グラフの縦軸は検出されたノード数、横軸はステップ数である。本シミュレーションでは、1ステップ毎に、各ノード60がノード情報を送信するノード60を検出済みのノード60の中から1つ選択し、自ノード60と検出済みのノード60のノード情報を一定個数、選択したノード60へ送信する操作を行うこととした。送信する検出済みのノード60のノード情報と、送信先のノード60は、ランダムに選択することとした。   FIGS. 26 to 28 show simulation results when the nodes 60 perform node detection by exchanging node information. In FIG. 26 to FIG. 28, the time change of the detected number of nodes is plotted with “+”, and the value obtained by differentiating it (increase rate) is plotted with “x”. The vertical axis of the graph is the number of detected nodes, and the horizontal axis is the number of steps. In this simulation, for each step, each node 60 selects one node 60 to which node information is transmitted from the detected nodes 60, and a fixed number of node information of the own node 60 and the detected nodes 60. The operation of transmitting to the selected node 60 is performed. The node information of the detected node 60 to be transmitted and the destination node 60 are selected at random.

図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 nodes 60 can be easily performed by broadcasting in the subnet, the nodes in the subnet are mutually detected as an initial state. For transmission of node information across subnets, one node 60 in the i-th (i = 1 to 15) subnet holds node information of one node 60 in the i + 1-th subnet, and the 16th subnet One node 60 holds node information of one node 60 in the first subnet.

図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 nodes 60 in each subnet are mutually detecting. As for transmission of node information across subnets, one node 60 in the i-th (i = 1 to 15) subnet holds node information of one node 60 in the i + 1-th subnet, and the 16th It is assumed that one node 60 in the subnet of the first node holds node information of one node 60 in the first subnet.

図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 nodes 60 in each subnet detected each other as an initial state. For node information transmission between subnets, one node 60 in the i-th (i = 1 to 7) subnet holds node information of one node 60 in the i + 1-th subnet, and the eighth It is assumed that one node 60 in the subnet of the first node holds node information of one node 60 in the first subnet.

図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のtの時点)でノードID格納部61に登録されているノードIDの数を、分散合意アルゴリズムにおける定足数として、分間合意アルゴリズムを用いた処理を開始する。これにより、全ノード数が判明するtの時点まで待つことなく、分散合意処理部64は、tの時点で迅速にPAXOSプロトコルを使った分散合意の処理を開始することができる。 In this embodiment, the distributed agreement processing unit 64 measures the rate of increase in the number of registered node IDs in the node ID storage unit 61 after the own node 60 is started, for example, as shown in FIG. Then, the distribution agreement processing unit 64 increases the increase rate by a predetermined rate (70% in the example of FIG. 29) lower than the maximum value of the increase rate after the increase rate has changed from rising to falling. when a rate, the number of node ID registered in the node ID storage unit 61 at that time (time of t 0 in FIG. 29), as a quorum in a distributed agreement algorithm, the processing using the min agreement algorithm Start. Thus, the distributed agreement processing unit 64 can quickly start the distributed agreement processing using the PAXOS protocol at the time t 0 without waiting until the time t 0 when the total number of nodes is known.

図30は、第2の実施形態におけるノード60の動作の一例を示すフローチャートである。例えば、電源が投入される等の所定のタイミングで、ノード60は、本フローチャートに示す動作を開始する。   FIG. 30 is a flowchart illustrating an example of the operation of the node 60 according to the second embodiment. For example, at a predetermined timing such as when the power is turned on, the node 60 starts the operation shown in this flowchart.

まず、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 ID notification unit 62 notifies the node ID and address of the own node 60 to the other nodes 60 via the LAN 52 (S700). Then, the ID registration unit 63 determines whether a node ID and an address have been received from another node 60 via the LAN 52 (S701). When the node ID and address are not received from the other node 60 (S701: No), the ID registration unit 63 repeats step S701 until the node ID and address are received from the other node 60. On the other hand, when a node ID and address are received from another node 60 (S701: Yes), the ID registration unit 63 registers the received node ID and address in the node ID storage unit 61 in association with the reception time ( S702).

次に、分散合意処理部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 agreement processing unit 64 calculates the increase rate of the number of registered node IDs registered in the node ID storage unit 61 (S703), and determines whether or not the increase rate has changed from increasing to decreasing (S703). S704). When the increase rate has changed from increasing to decreasing (S704: Yes), the distributed agreement processing unit 64 determines whether or not the increasing rate has decreased from the maximum value to a predetermined ratio or less (for example, 70% or less of the maximum value) ( S705). If the increase rate has not changed from increasing to decreasing (S704: No), or if the increasing rate has not fallen below the predetermined ratio from the maximum value (S705: No), the ID registration unit 63 again shows in step S701. Execute the process. When the increase rate is equal to or less than the predetermined value from the maximum value (S705: Yes), the ID registration unit 63 refers to the node ID storage unit 61 and starts the distributed agreement process using the current number of nodes as a quorum (S706). The node 60 ends the operation shown in this flowchart.

以上、本発明の第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 master determination unit 25 proposes the node 20 with the newest manufacturing date as the master node in determining the master node, but the present invention is not limited to this. As another form, the master determination part 25 may propose the self-node 20 as a master node, and may propose the node 20 with the smallest node ID or address value as a master node.

また、マスタ決定部25は、処理割当テーブル30に登録されているリソース情報を参照して、CPU以外のリソースの情報が少ないノード20をマスタノードとして提案するようにしてもよい。マスタノードの信頼性を向上する方法の1つとして、マスタノードがマスタノードとしての処理以外を行わないことが挙げられる。CPU以外のリソースを持つノード20は、そのリソースを利用した処理(マスタノードとしての処理以外の処理)を割り当てることができ、マスタ以外のノード20として動作させることが好ましい。例えば、通信手段を備えるノード20ではディスパッチャ290を稼動させ、データ収集サーバと通信させる。また、センサ14が接続されたノード20ではアダプタ293を稼動させ、センサ14の制御処理を行わせる。これにより、複数のノード20に効率よく処理を割り当てることができる。   In addition, the master determination unit 25 may refer to the resource information registered in the process allocation table 30 and propose a node 20 with less information on resources other than the CPU as a master node. One method for improving the reliability of the master node is that the master node does not perform any processing other than as a master node. The node 20 having a resource other than the CPU can be assigned a process using the resource (a process other than the process as the master node) and is preferably operated as the node 20 other than the master. For example, the node 20 having the communication unit operates the dispatcher 290 to communicate with the data collection server. In addition, the adapter 293 is operated at the node 20 to which the sensor 14 is connected, and the sensor 14 is controlled. Thereby, processing can be efficiently allocated to a plurality of nodes 20.

また、それぞれのノード20に、自ノード20の障害を検出する障害発生検出部をさらに設け、リソース情報送信部21は、当該障害発生検出部によって自ノード20に障害が発生したことが検出された場合に、次のリソース情報の送信タイミングで、リソース情報内に障害の発生を示す障害情報を含めて送信するようにしてもよい。この場合、リソース情報登録部22は、リソース情報に障害情報が含まれている場合に、障害情報以外のリソース情報でリソース情報管理テーブル270内の対応する情報を上書きすると共に、当該障害情報を障害履歴としてリソース情報管理テーブル270に追加登録する。そして、マスタ決定部25は、マスタノードを提案する場合に、リソース情報管理テーブル270を参照して、登録されている障害情報が少ないノード20をマスタノードとして提案する。これにより、より信頼性の高いノード20をマスタノードとして提案することができる。   Each node 20 is further provided with a failure occurrence detection unit that detects a failure of the own node 20, and the resource information transmission unit 21 detects that a failure has occurred in the own node 20 by the failure occurrence detection unit. In this case, the failure information indicating the occurrence of the failure may be included in the resource information at the transmission timing of the next resource information. In this case, if the resource information includes failure information, the resource information registration unit 22 overwrites the corresponding information in the resource information management table 270 with resource information other than the failure information, and sets the failure information to the failure information. It is additionally registered in the resource information management table 270 as a history. Then, when proposing a master node, the master determination unit 25 refers to the resource information management table 270 and proposes a node 20 with less registered failure information as a master node. Thereby, the node 20 with higher reliability can be proposed as the master node.

また、それぞれのノード20に、自ノード20の稼働環境を測定し、稼働環境が悪い場合に高い数値を示す環境値を出力する環境測定部をさらに設け、リソース情報送信部21は、当該環境測定部が出力した環境値をリソース情報内に含めて他の情報処理装置へ送信するようにしてもよい。環境測定部は、例えば、稼働中の温度や湿度等が、予め設定された許容範囲から外れている度合いを数値として出力する。マスタノードを提案する場合、マスタ決定部25は、リソース情報管理テーブル270を参照して、リソース情報に含まれている環境値が低いノード20をマスタノードとして提案する。これにより、より稼働環境の良好なノード20をマスタノードとして提案することができるため、より故障する可能性の低いノード20をマスタノードとして提案することができる。   Each node 20 further includes an environment measuring unit that measures the operating environment of the node 20 and outputs an environmental value indicating a high numerical value when the operating environment is bad. The resource information transmitting unit 21 The environment value output by the unit may be included in the resource information and transmitted to another information processing apparatus. For example, the environment measurement unit outputs, as a numerical value, the degree to which the operating temperature, humidity, and the like are out of a preset allowable range. When proposing a master node, the master determination unit 25 refers to the resource information management table 270 and proposes a node 20 having a low environment value included in the resource information as a master node. Thereby, since the node 20 with a better operating environment can be proposed as the master node, the node 20 with a lower possibility of failure can be proposed as the master node.

また、上記した第1の実施形態では、分散合意における定足数は管理者等によってそれぞれのノード20に予め設定されていたが、他の形態として、第1の実施形態において、上記した第2の実施形態の方法を用いるようにしてもよい。   In the first embodiment described above, the quorum in the distributed agreement is set in advance in each node 20 by the administrator or the like. However, as another form, the second embodiment described above is used in the first embodiment. You may make it use the method of a form.

本発明の第1実施形態に係る分散処理システム10の一例を示すシステム構成図である。1 is a system configuration diagram illustrating an example of a distributed processing system 10 according to a first embodiment of the present invention. コンソール11の動作の一例を示すフローチャートである。3 is a flowchart showing an example of the operation of the console 11. 第1の実施形態におけるそれぞれのノード20の一例を示すハードウェア構成図である。It is a hardware block diagram which shows an example of each node 20 in 1st Embodiment. 第1の実施形態におけるそれぞれのノード20の機能構成の一例を示すブロック図である。It is a block diagram which shows an example of a function structure of each node 20 in 1st Embodiment. リソース情報格納部27に格納されるデータの構造の一例を示す図である。It is a figure which shows an example of the structure of the data stored in the resource information storage part. 履歴情報格納部23に格納されるデータの構造の一例を示す図である。6 is a diagram illustrating an example of a structure of data stored in a history information storage unit 23. FIG. 処理定義に含まれる処理定義テンプレートの一例を示す図である。It is a figure which shows an example of the process definition template contained in a process definition. 処理定義に含まれる処理定義本体の一例を示す図である。It is a figure which shows an example of the process definition main body contained in a process definition. 処理定義に含まれる処理定義本体の一例を示す図である。It is a figure which shows an example of the process definition main body contained in a process definition. PAXOSプロトコルを使った分散合意の一例を説明するためのシーケンス図である。It is a sequence diagram for demonstrating an example of the distributed agreement using a PAXOS protocol. 第1の実施形態におけるノード20の動作の一例を示すフローチャートである。It is a flowchart which shows an example of operation | movement of the node 20 in 1st Embodiment. 処理の割当(S400)の処理の一例を示すフローチャートである。It is a flowchart which shows an example of a process allocation (S400) process. 処理の割当過程における処理割当テーブル30の一例を示す概念図である。It is a conceptual diagram which shows an example of the process allocation table 30 in the process allocation process. 処理の割当過程における処理割当テーブル30の一例を示す概念図である。It is a conceptual diagram which shows an example of the process allocation table 30 in the process allocation process. データ提供元の割当処理(S500)の一例を示すフローチャートである。It is a flowchart which shows an example of the allocation process (S500) of a data provider. 処理の割当過程における処理割当テーブル30の一例を示す図である。It is a figure which shows an example of the process allocation table 30 in the process allocation process. データ提供元の割当処理(S500)の他の例を示すフローチャートである。It is a flowchart which shows the other example of the allocation process (S500) of a data provider. 処理の割当過程における負荷テーブル40の一例を示す図である。It is a figure which shows an example of the load table 40 in the allocation process of a process. 処理の割当の終了時点における負荷テーブル40の一例を示す図である。It is a figure which shows an example of the load table 40 in the end time of the allocation of a process. 処理の割当の終了時点における処理割当テーブル30の一例を示す図である。It is a figure which shows an example of the process allocation table 30 in the end time of process allocation. ノード別処理指示の作成処理(S600)の一例を示すフローチャートである。It is a flowchart which shows an example of the preparation process (S600) of a process instruction according to node. ノード別処理指示の作成処理(S600)によって作成されたノード別処理指示の一例を示す図である。It is a figure which shows an example of the process instruction according to node produced by the preparation process (S600) of process instruction according to node. 第2の実施例における分散処理システム50の一例を示すシステム構成図である。It is a system configuration figure showing an example of distributed processing system 50 in the 2nd example. 第2の実施形態におけるノード60の機能構成の一例を示すブロック図である。It is a block diagram which shows an example of a function structure of the node 60 in 2nd Embodiment. ノードID格納部61に格納されるデータの構造の一例を示す図である。6 is a diagram illustrating an example of a structure of data stored in a node ID storage unit 61. FIG. ノード検出のシミュレーション結果を示す図である。It is a figure which shows the simulation result of a node detection. ノード検出のシミュレーション結果を示す図である。It is a figure which shows the simulation result of a node detection. ノード検出のシミュレーション結果を示す図である。It is a figure which shows the simulation result of a node detection. 定足数の推定方法の一例を説明するための概念図である。It is a conceptual diagram for demonstrating an example of the estimation method of a quorum. 第2の実施形態におけるノード60の動作の一例を示すフローチャートである。It is a flowchart which shows an example of operation | movement of the node 60 in 2nd Embodiment.

符号の説明Explanation of symbols

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 SYMBOLS 10 ... Distributed processing system, 11 ... Console, 12 ... LAN for computers, 13 ... LAN for sensors, 14 ... Sensor, 15 ... Antenna, 20 ... Node, 21. ··· Resource information transmission unit, 22 ... Resource information registration unit, 23 ... History information storage unit, 24 ... History information management unit, 25 ... Master determination unit, 26 ... Process allocation unit, 27 ... Resource information storage unit, 28 ... Slave processing unit, 29 ... Sensing application execution unit, 290 ... Dispatcher, 291 ... Filter, 292 ... Drive control, 293 ... Adapter , 200 ... RAM, 201 ... ROM, 202 ... CPU, 203 ... input / output interface, 204 ... wireless interface, 205 ... LAN interface Ace, 206 ... LAN interface, 207 ... media interface, 208 ... sensor interface, 210 ... display, 211 ... keyboard, 212 ... mouse, 213 ... recording medium, 30 ... Process allocation table 31 ... Process ID 32 ... Process unit name 33 ... Data source 34 ... event / sec 35 ... device 36 ... mips 37 ··· node, 40 ... load table, 41 ... node ID, 42 ... allowable value, 43 ... current load, 50 ... distributed processing system, 51 ... subnet, 52 ... LAN, 53 ... router, 60 ... node, 61 ... node ID storage unit, 62 ... ID notification unit, 63 ... ID registration unit, 64 ... distributed agreement processing unit

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.
請求項1に記載の分散処理システムであって、
前記処理割当部は、
必要な処理能力が大きい処理単位から順に、処理単位を情報処理装置に割り当てることを特徴とする分散処理システム。
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.
請求項1または2に記載の分散処理システムであって、
ぞれぞれの前記情報処理装置が有するリソースには、前記ネットワークを介さずに接続されているデバイスが含まれ、
前記処理定義には、
前記ネットワークを介さずに接続されている特定のデバイスと同数の処理単位が作成されるべきデバイス依存処理と、
当該デバイス依存処理に応じて作成される処理単位のいずれかが処理するデータの提供元の処理単位の処理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.
請求項3に記載の分散処理システムであって、
前記処理割当部は、
前記ネットワークを介さずに接続されている特定のデバイスの数と同数の処理単位を新たに作成した場合に、新たに作成した処理単位が複数存在するならば、当該新たに作成した複数の処理単位の処理負荷が均等になるように、当該処理単位に、当該処理単位が処理するデータの提供元の処理単位の処理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.
請求項3に記載の分散処理システムであって、
前記処理割当部は、
前記ネットワークを介さずに接続されている特定のデバイスの数と同数の処理単位を新たに作成した場合に、新たに作成した処理単位が複数存在するならば、当該新たに作成した処理単位に対応する特定のデバイスの処理能力の範囲内で、当該新たに作成したいずれかの処理単位に負荷が集中するように、当該処理単位に、当該処理単位が処理するデータの提供元の処理単位の処理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から5のいずれかに記載の分散処理システムであって
自装置のリソース情報を第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.
請求項6に記載の分散処理システムであって、
前記リソース情報登録部は、
前記リソース情報格納部内に登録されているリソース情報を監視し、前記第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.
請求項6または7に記載の分散処理システムであって、
前記リソース情報送信部は、
前記リソース情報と共に、自装置の製造年月日を示す情報を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.
請求項6または7に記載の分散処理システムであって、
自装置の障害を検出する障害発生検出部をさらに備え、
前記リソース情報送信部は、
前記障害発生検出部によって自装置に障害が発生したことが検出された場合に、次のリソース情報の送信タイミングで、リソース情報内に障害の発生を示す障害情報を含め、
前記リソース情報登録部は、
前記リソース情報に障害情報が含まれている場合に、障害情報以外のリソース情報で前記リソース情報格納部内の対応する情報を上書きすると共に、当該障害情報を障害履歴として前記リソース情報格納部に追加保存し、
前記マスタ決定部は、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定する場合に、前記リソース情報格納部を参照して、登録されている障害情報が少ない情報処理装置をマスタとして提案することを特徴とする分散処理システム。
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.
請求項6または7に記載の分散処理システムであって、
自装置の稼働環境を測定し、稼働環境が悪い場合に高い数値を示す環境値を出力する環境測定部をさらに備え、
前記リソース情報送信部は、
前記環境測定部が出力した環境値をリソース情報内に含めて他の情報処理装置へ送信し、
前記マスタ決定部は、
分散合意アルゴリズムを使って複数の情報処理装置間でマスタを決定する場合に、前記リソース情報格納部を参照して、リソース情報に含まれている環境値が低い情報処理装置をマスタとして提案することを特徴とする分散処理システム。
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
請求項6から10のいずれかに記載の分散処理システムであって、
前記マスタ決定部は、
自装置が起動してからの前記リソース情報格納部内のリソース情報の登録数の増加率を算出し、当該増加率が上昇から下降に転じた後に、当該増加率が、当該増加率の最大値から予め定められた割合だけ低い増加率となった場合に、その時点の情報処理装置の台数を、分散合意アルゴリズムにおける定足数として分間合意アルゴリズムを用いたマスタの決定処理を開始することを特徴とする分散処理システム。
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.
JP2008293979A 2008-11-18 2008-11-18 Distributed processing system, method of allocating processing, and information processing apparatus Pending JP2010122773A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (13)

* Cited by examiner, † Cited by third party
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
JP6888078B2 (en) Network function NF management method and NF management device
US20160127193A1 (en) D2hcp protocol in ad hoc networks: merging of sub-networks and address conflict resolution
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
KR20090005555A (en) Method for avoiding and overcoming indirect collision in beacon-mode wireless sensor network
US10091066B2 (en) Integration method and system
JP7187849B2 (en) Data collection system and data collection method
JP5470938B2 (en) Information processing apparatus, information processing method, and program
WO2012176337A1 (en) Information processing system, information processing system control method, administration device, and system switching program
CN108769118A (en) The choosing method and device of host node in a kind of distributed system
CN103825789A (en) Bus system, method for operating bus system and fluid system with bus system
JP2007237300A (en) Control apparatus, robot system, and method for controlling robot
JP2018133001A (en) Management device, portable terminal, methods therefor, and program
US20210064411A1 (en) Management apparatus, management system, management method and management program
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
JP2004171540A (en) Production facility control device, production facility control system, and control method of production facility with production facility control device
JP2005228172A (en) Initialization server system, initialization system, initialization method and computer-readable recording medium
JP5266997B2 (en) Network connection station information output device, network connection station information output method, and program
JP2001195377A (en) Isolation judgment system, management method therefor and recording medium