JP6053476B2 - calculator - Google Patents
calculator Download PDFInfo
- Publication number
- JP6053476B2 JP6053476B2 JP2012259930A JP2012259930A JP6053476B2 JP 6053476 B2 JP6053476 B2 JP 6053476B2 JP 2012259930 A JP2012259930 A JP 2012259930A JP 2012259930 A JP2012259930 A JP 2012259930A JP 6053476 B2 JP6053476 B2 JP 6053476B2
- Authority
- JP
- Japan
- Prior art keywords
- computer
- value
- update
- record
- priority
- 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.)
- Active
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Description
本発明は、データベースシステムを構成する計算機に関し、特に、複数のデータベースの内容を一致化させるための技術に関する。 The present invention relates to a computer constituting a database system, and more particularly to a technique for matching the contents of a plurality of databases.
例えば、電力系統の運用等のための監視制御システム等では、大量のデータが逐次記録され、データベースとして管理されている。このようなシステムでは、安定的な運用を行うため、計算機およびネットワークの多重化がなされている。例えば、複数のデータベースを分散して配置し、ある1つのデータベースの更新を他のデータベースへも反映させることで安定的な運用を可能とする。 For example, in a monitoring control system for operating a power system, a large amount of data is sequentially recorded and managed as a database. In such a system, computers and networks are multiplexed for stable operation. For example, a plurality of databases are arranged in a distributed manner, and a stable operation can be performed by reflecting an update of one database to another database.
このように、ある計算機上のデータベースで発生した更新内容を、他の複数の計算機上のデータベースにネットワークを介して転送し、更新内容を各データベースで一致化させる機能をレプリケーション機能という。例えば、マスタ・スレーブ方式によるレプリケーション機能を持つデータベース管理システムが知られている。マスタ・スレーブ方式によるレプリケーション機能とは、データの更新の要求を、特定の1台の計算機(マスタ)のデータベースで受け付けて、当該特定の1台の計算機(マスタ)から他の計算機(スレーブ)のデータベースに対して更新データを通知することをいう。このマスタ・スレーブ方式の場合、同一のレコードに対して複数の計算機上でデータの更新の要求が発生したとしても、マスタのデータベースにおいて順に要求が処理されるため、データベースの内容の一致化が容易である。 A function for transferring update contents generated in a database on a certain computer to databases on a plurality of other computers via a network and matching the update contents in each database is called a replication function. For example, a database management system having a replication function based on a master / slave method is known. The replication function using the master / slave method accepts a data update request from a database of a specific one computer (master), and from the specific one computer (master) to another computer (slave). This is to notify update data to the database. In the case of this master / slave method, even if data update requests occur on multiple computers for the same record, the requests are processed in order in the master database, making it easy to match the database contents. It is.
また、近年は、マルチマスタ方式と呼ばれるデータレプリケーション機能を持つデータベース管理システムが普及してきている。マルチマスタ方式とは、複数のデータベースを備えるシステムにおいて、各計算機上で動作するプログラムが直接当該計算機のデータベースを更新可能とし、更新結果をデータベース間で互いに反映する方式のことをいう。 In recent years, database management systems having a data replication function called a multi-master method have become widespread. The multi-master method refers to a method in which a program running on each computer can directly update the database of the computer and the update result is reflected between the databases in a system including a plurality of databases.
マルチマスタ方式をマスタ・スレーブ方式と比較すると、マスタ・スレーブ方式は、データベースの内容を更新することができる計算機が特定の1台に限定され、この特定の1台の計算機(マスタ)を経由して各計算機のデータベースが更新されるのに対し、マルチマスタ方式は、各計算機がそれぞれデータベースを更新する。そのため、マルチマスタ方式は、更新処理の負荷を各計算機で分散することができ、マスタ・スレーブ方式と比較してデータの書き込みを早めることができる。また、更新処理の負荷が各計算機で分散されているため、特定のデータベースが動作できない状態であっても、他のデータベースの更新処理に影響せず、データベース管理システムを安定的に運用することが容易であるという利点がある。 Comparing the multi-master method with the master-slave method, the master-slave method is limited to one specific computer that can update the contents of the database, and passes through this one specific computer (master). While the database of each computer is updated, each computer updates the database in the multi-master method. Therefore, in the multi-master method, the load of update processing can be distributed among the computers, and data writing can be accelerated compared to the master-slave method. In addition, because the load of update processing is distributed among computers, even if a specific database cannot be operated, it is possible to operate a database management system stably without affecting the update processing of other databases. There is an advantage that it is easy.
しかし、マルチマスタ方式は、任意のタイミングで各計算機がデータベースを更新するため、同一のレコードに対して複数の計算機でデータの更新が発生し得る。したがって、各計算機のデータベースの内容を計算機間で一致化させるための処理を行う必要がある。 However, in the multi-master method, since each computer updates the database at an arbitrary timing, data update can occur in a plurality of computers for the same record. Therefore, it is necessary to perform processing for matching the contents of the database of each computer among the computers.
マルチマスタ方式によって複数のデータベースの内容の整合性を維持するための技術として、下記の特許文献等が知られている。例えば、特開平3−256146号公報(特許文献1)は、同一内容をもつべく構成された正データベースと副データベースについて、正データベースの更新通番と、副データベースの更新通番と、レコード更新時刻とをデータベースレコードに保有し、各データベースの更新通番を照合することでデータベースを統合する技術が記載している。特許文献1において、各データベースで並列に更新されたレコードは、レコード更新時刻を比較して再処理される。これにより、データベース更新の順序が維持される。特開平11−7403号公報(特許文献2)は、レプリケーションの実行時刻と、レプリケーションを行おうとするレコードの更新時刻とを比較することでデータベースの不整合を回避する技術を記載している。 The following patent documents and the like are known as techniques for maintaining the consistency of the contents of a plurality of databases by the multi-master method. For example, Japanese Patent Laid-Open No. 3-256146 (Patent Document 1) discloses a primary database update sequence number, a secondary database update sequence number, and a record update time for a primary database and a secondary database configured to have the same contents. It describes a technology that integrates databases by holding them in database records and collating the update sequence numbers of each database. In Patent Document 1, records updated in parallel in each database are reprocessed by comparing record update times. Thereby, the order of database update is maintained. Japanese Patent Application Laid-Open No. 11-7403 (Patent Document 2) describes a technique for avoiding database inconsistency by comparing the execution time of replication with the update time of a record to be replicated.
特許文献1のように、複数のパラメータを使用してデータベースの内容の整合性を維持する場合、複数のパラメータを使用して複雑な判定処理を実装する必要がある。特に、レコードの数が大量にある大規模なデータベース管理システムであるほど、データベースの内容の一致化の処理負荷が大きくなる。また、特許文献2のように、レコードの更新時刻など時刻情報に基づいてデータベースの内容の一致化を行うには、各計算機が計時している時刻を厳密に一致させることが必要であり、高精度の時刻同期処理が必要となる。
When maintaining the consistency of the contents of a database using a plurality of parameters as in Patent Document 1, it is necessary to implement a complicated determination process using a plurality of parameters. In particular, the larger the database management system with a large number of records, the greater the processing load for matching the contents of the database. Further, as in
そこで、本発明は、複数のデータベースが分散して配置され、いずれのデータベースからもデータを更新することができるマルチマスタ方式を適用したデータベースシステムにおいて、データベースの内容の一貫性を保つ仕組みを低コストで実現する技術を提供することを目的とする。 Therefore, the present invention is a low-cost mechanism for maintaining the consistency of the contents of a database in a database system to which a multi-master system is applied in which a plurality of databases are distributed and updated from any database. The purpose is to provide technology realized in
この発明に係る計算機では、マルチマスタ方式により複数の計算機間でレプリケーションを行うデータベースシステムの構成が提供される。この計算機は、データベースに保持されるレコードそれぞれについての更新状況を示す更新値を記憶する。計算機は、レコードを更新する場合、更新前のレコードに対応する更新値と、自計算機に固有の優先値とに基づいて、更新後のレコードの更新値を算出する。この更新後のレコードの更新値は、レコードの更新回数に応じた値であり、また、自計算機に固有の値である。自計算機でレコードを更新した場合は、更新後のレコードと、算出した更新値とを、データベースシステムを構成する他の計算機へ送信する。他の計算機でレコードが更新された場合、計算機は、更新されたレコードと更新値とを他の計算機から受信し、受信した更新値と、自計算機において記憶している更新値とを比較することにより、複数の計算機間でのレプリケーションを行う。 The computer according to the present invention provides a configuration of a database system that performs replication between a plurality of computers by a multi-master method. This computer stores an update value indicating an update status for each record held in the database. When updating a record, the computer calculates an updated value of the updated record based on the updated value corresponding to the record before the update and the priority value unique to the own computer. The updated value of the record after the update is a value corresponding to the number of record updates, and is a value unique to the own computer. When the record is updated by the own computer, the updated record and the calculated update value are transmitted to other computers constituting the database system. When the record is updated in another computer, the computer receives the updated record and the updated value from the other computer, and compares the received updated value with the updated value stored in the own computer. To replicate between multiple computers.
この発明によると、各計算機において、複数のデータベースの内容を一致化させる処理を容易に行うことができる。そのため、例えば大規模な分散データベースシステムを比較的低い性能の計算機で構成することができる。 According to the present invention, each computer can easily perform the process of matching the contents of a plurality of databases. Therefore, for example, a large-scale distributed database system can be configured with a relatively low performance computer.
この発明の上記および他の目的、特徴、局面および利点は、添付の図面と関連して理解されるこの発明に関する次の詳細な説明から明らかとなるであろう。 The above and other objects, features, aspects and advantages of the present invention will become apparent from the following detailed description of the present invention taken in conjunction with the accompanying drawings.
以下、図面を参照しつつ、本発明の実施の形態について説明する。以下の説明では、同一の部品には同一の符号を付してある。それらの名称および機能も同じである。したがって、それらについての詳細な説明は繰り返さない。 Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the following description, the same parts are denoted by the same reference numerals. Their names and functions are also the same. Therefore, detailed description thereof will not be repeated.
<実施の形態1>
本実施の形態の計算機はデータベースを備えており、計算機が複数設置されてデータベースシステムを構成する。データベースシステムは、各計算機のデータベースの内容を同一化するためのレプリケーションをマルチマスタ方式によって行う。データベースシステムは、例えば制御システム1において使用される。制御システム1は、このデータベースシステムのデータに基づいて各種制御を行う。
<Embodiment 1>
The computer of this embodiment includes a database, and a plurality of computers are installed to constitute a database system. The database system performs replication for making the contents of the database of each computer identical by the multi-master method. The database system is used in the control system 1, for example. The control system 1 performs various controls based on the data of this database system.
図1は、実施の形態1における制御システム1の構成を示す図である。図1を参照して、制御システム1は、複数の拠点(第1拠点5A、第2拠点5B、第3拠点5C、第4拠点5D)と、複数の計算機(第1計算機100、第2計算機200、第3計算機300)とにより構成され、これら複数の拠点と複数の計算機とが相互にネットワーク2によって接続されている。第1計算機100等の計算機それぞれはデータベースを備えており、これら計算機によってデータベースシステムを構成する。第1拠点5A等の拠点は、データベースシステムに蓄積されるデータ等を用いて監視対象のモニタリングや各機器への指令を行う。
FIG. 1 is a diagram showing a configuration of a control system 1 in the first embodiment. Referring to FIG. 1, the control system 1 includes a plurality of bases (
制御システム1は、例えば、監視制御システムであり、多数設置されたモニタリング機器等がデータを逐次取得し、これら取得されたデータをデータベースシステム(第1計算機100、第2計算機200、第3計算機300等の計算機)に蓄積し、運用拠点(第1拠点5A等)がデータベースシステムのデータに基づいてモニタリングを行って各種の指令を行う。
The control system 1 is, for example, a monitoring control system, and a large number of monitoring devices or the like sequentially acquire data, and these acquired data are stored in a database system (
監視制御システムは、例えば、発電所において発電された電力を工場等の需要家に安定して供給するための系統制御システムである。系統制御システムは、系統の状態を監視して、例えば、電圧や電流の最大値・最小値、位相の変化、遮断器(Circuit Breaker)のON/OFF状態などの監視値等を収集し、収集したデータによってデータベースシステムのデータレコードを更新する。系統制御システムは、安定した連続運転が求められるため、データベースシステムを構成する計算機および各計算機を接続するためのネットワークを多重化している。例えば、各計算機および運用拠点(中央給電指令所、系統給電指令所など)をそれぞれ地理的に分散して設置することで、災害等が発生して一部の計算機や運用拠点が機能を発揮できなくなった場合においても計算機や運用拠点を切り替えて運転の継続を可能とする。 The monitoring control system is, for example, a system control system for stably supplying electric power generated in a power plant to consumers such as factories. The system control system monitors the status of the system and collects monitoring values such as the maximum and minimum values of voltage and current, changes in phase, and ON / OFF status of the circuit breaker (Circuit Breaker). Update data records in the database system with the updated data. Since the system control system requires stable continuous operation, a computer constituting the database system and a network for connecting the computers are multiplexed. For example, by installing each computer and operation base (central power supply command station, grid power supply command station, etc.) geographically dispersed, disasters occur and some computers and operation bases can function. Even if it runs out, it is possible to continue operation by switching computers and operation bases.
<構成>
本実施の形態の計算機(第1計算機100等)のハードウェア構成および機能的な構成について説明する。図2は、実施の形態1における第1計算機100のハードウェアの構成を示す図である。図2を参照して、第1計算機100は、プロセッサ61と、メモリ62と、HDD63と、通信インタフェース64等を含む。
<Configuration>
A hardware configuration and a functional configuration of a computer (
プロセッサ61は、プログラムを読み出して、読み出したプログラムに従って第1計算機100の動作を制御し、第1計算機100をデータベース管理システムとして機能させる。メモリ62は、第1計算機100において処理されるデータを保持するための揮発性の記憶領域である。HDD63は、第1計算機100がデータベース管理システムとして機能するための不揮発性の記憶領域であり、複数件のデータレコードを保持する。通信インタフェース64は、第1計算機100が外部の機器と通信するためのインタフェースとして機能する。
The processor 61 reads the program, controls the operation of the
図3は、実施の形態1における第1計算機100の機能を示すブロック図である。複数の計算機(第1計算機100、第2計算機200、第3計算機300)がネットワーク2によって接続され、データベースシステムを構成している。各計算機の機能的な構成は同一であるため、第1計算機100の構成を詳細に説明する。図3を参照して、第1計算機100は、データベースファイル11と、更新通番管理ファイル12と、優先度管理ファイル13と、優先度管理部14と、データ更新管理部15と、データ送受信部16と、更新要求元プログラム17とを含む。
FIG. 3 is a block diagram illustrating functions of the
データベースファイル11は、データベースを構成する複数件のデータレコードを保存するための記憶領域である。
The
更新通番管理ファイル12は、データベースファイル11に保存されるデータレコードの更新状態を示す更新通番値を記憶するための記憶領域である。更新通番値は、データレコードの更新状態を通し番号によって示している。更新通番管理ファイル12は、データベースファイル11に保存されるデータレコードそれぞれについて、更新通番値を記憶する。
The update sequence
優先度管理ファイル13は、第1計算機100に割り当てられた優先度を示す優先値を記憶するための記憶領域である。優先値は、複数のデータベースにおいてデータの更新が競合した場合に、どのデータベースの内容を優先して各データベースにデータを反映するかを決定するために使用される。複数の計算機からなるデータベースシステムにおいて、各計算機のデータベースごと(または各データベースのうち、特定のグループごと)に優先値が関連付けられて設定されており、各データベースにそれぞれ異なる固有の優先値が割り当てられている。
The
優先値の取りうる値の範囲は、例えば、データベースシステムを構成するデータベースの総数を最大値とする整数値である。例えば、計算機が3台の場合、優先値の取りうる最大値は3となり、各計算機は、通し番号となる1から3の値のいずれかを割り当てられて優先値として記憶する。また、本実施形態では、計算機は、データベースの更新を許可しない無効状態によって動作することもできる。無効状態とは、例えば、計算機の初期の起動時や、後述する優先値を変更している途上の状態をいい、この無効状態の間、計算機は、優先値を0に設定して動作する。 The range of values that the priority value can take is, for example, an integer value with the total number of databases constituting the database system as a maximum value. For example, when there are three computers, the maximum value that the priority value can take is 3, and each computer is assigned one of the values from 1 to 3 as the serial number and stores it as a priority value. In this embodiment, the computer can also operate in an invalid state that does not permit database update. The invalid state is, for example, an initial startup state of the computer or a state in which a priority value described later is being changed. During this invalid state, the computer operates with the priority value set to 0.
優先度管理部14は、各計算機のデータベースに割り当てられた優先値を、他の計算機との通信によって変更する。
The
更新要求元プログラム17は、第1計算機100におけるデータベースの更新処理をデータ更新管理部15に指示するためのプログラムであり、データ更新管理部15に対してデータベースの更新要求を発行する。
The update request source program 17 is a program for instructing the data
データ更新管理部15は、更新値算出部18と、レコード更新制御部19とを含み、データベースファイル11へのデータの書き込みと、データレコードに対応する更新通番値の算出および更新と、他の計算機のデータベースとのレプリケーションと、を制御する。
The data
更新値算出部18は、更新要求元プログラム17からデータの書き込み要求を受け付けてデータベースファイル11へデータを書き込む場合に、データベースファイル11へのデータの書き込み後の更新通番値を算出し、算出した更新通番値を更新通番管理ファイル12に記憶させる。更新値算出部18は、データの書き込みに伴う更新通番値を、更新前のデータにかかるデータレコードの更新通番値と、優先度管理ファイル13に記憶される優先値とに基づいて算出する。
When the update
レコード更新制御部19は、更新要求元プログラム17からデータの書き込み要求を受け付けてデータベースファイル11へデータを書き込む処理を行う。また、レコード更新制御部19は、他の計算機のデータベースとの内容を一致させるためのレプリケーション処理を制御する。レコード更新制御部19は、データ送受信部16によって他の計算機からデータレコードおよびデータレコードの更新通番値を受信した場合に、受信したデータレコードについて更新通番管理ファイル12に記憶される更新通番値と、受信した更新通番値とを比較し、更新通番値の大きさに基づいて、受信したデータレコードおよび更新通番値を用いてデータベースファイル11を更新するか否かを制御する。
The record
第2計算機200および第3計算機300の各構成要素は、参照符号の他は第1計算機100と同様の構成を備えている。第1計算機100、第2計算機200、第3計算機300等の計算機は相互にネットワーク2によって接続され、データレコードおよび更新通番値を送受信することでデータベースの内容の同一化を行う。
Each component of the
<動作>
第1計算機100の動作について、第1計算機100の更新値算出部18が更新通番値を算出する処理と、第1計算機100が他の計算機とデータベースの内容のレプリケーションを行う処理とを具体的に説明する。
<Operation>
Regarding the operation of the
(データ更新時に更新通番値を算出する処理)
図4は、実施の形態1におけるデータ更新管理部15が更新値算出部18によって更新通番値を算出し、データレコードを更新する処理を示すフローチャートである。データ更新管理部15は、更新要求元プログラム17からのデータの書き込み要求を受け付けて、更新値算出部18によって更新通番値を算出する処理、およびレコード更新制御部19によってデータベースファイル11のデータレコードを更新する処理を開始する。
(Process to calculate the update sequence number when updating data)
FIG. 4 is a flowchart illustrating processing in which the data
ステップS21において、更新値算出部18は、更新要求元プログラム17からのデータの書き込み要求に応じて、更新対象のデータを受信する。
In step S <b> 21, the update
ステップS22において、更新値算出部18は、第1計算機100に設定された優先値を優先度管理ファイル13から取り出す。
In step S <b> 22, the update
ステップS23において、更新値算出部18は、データレコードの更新が許可されているか無効状態であるかを判定するため、優先度管理ファイル13から取り出した優先値の値が有効であるか(優先値が0ではないか)無効であるか(優先値が0であるか)を判断する。更新値算出部18は、優先値の値が有効である場合はステップS24の処理を行い、優先値の値が無効である場合は、ステップS26へ進み、第1計算機100は、更新要求元プログラム17からの書き込み要求に対し、データ更新管理部15によるデータレコードの更新を行わず処理を終了する。
In step S23, the update
ステップS24において、更新値算出部18は、更新前のデータレコードの更新通番値(現在の更新通番値)を更新通番管理ファイル12から読み出して、読み出した更新通番値と、ステップS22で読み出した優先値に基づいて、以下の式(1)に従って、データレコードの更新回数に応じて当該データレコードの更新後の更新通番値を算出する。
In step S24, the update
更新後の更新通番値 = {INT(現在の更新通番値 / データベースシステムを構成するデータベースの総数) + 1} × データベースシステムを構成するデータベースの総数 + (優先値 − 1) ・・・(1)
なお、式(1)において、”INT(X)”は、Xを超えない最大の整数値を示す。式(1)を参照して、実施の形態1では、各計算機の更新値算出部18は、データレコードの更新回数と、データベースシステムを構成するデータベース(計算機)の数との積を基準値とし、基準値に対して各計算機に割り当てられた優先値に基づく値を補正することでデータレコードの更新後の更新通番値を算出する。
Update sequence number after update = {INT (current update sequence number / total number of databases constituting the database system) + 1} x total number of databases constituting the database system + (priority value -1) (1)
In the formula (1), “INT (X)” indicates a maximum integer value not exceeding X. Referring to Equation (1), in the first embodiment, the update
実施の形態1では、更新値算出部18は、上記の基準値に対し、”優先値に1を減じた数”を加算することでデータレコードの更新後の更新通番値を算出する。更新値算出部18は、式(1)において、INT(現在の更新通番値 / データベースシステムを構成するデータベースの総数)を演算することで、データレコードの更新前における更新回数を取得する。優先値は、各計算機で固有の値が割り当てられているため、各計算機が算出する更新通番値は、各計算機に固有の値となる。そのため、データレコードに対応づけられた更新通番値を参照すると、いずれの計算機によってデータレコードが更新されたかを判別することができる。
In the first embodiment, the update
ステップS25において、レコード更新制御部19は、更新要求元プログラム17からのデータの書き込み要求があったデータをもとにデータベースファイル11のデータレコードを更新する。更新値算出部18は、ステップS24で算出した更新通番値を更新通番管理ファイル12へ記憶させる。レコード更新制御部19は、更新したデータレコード、および更新後の更新通番値を、データ送受信部16によって他の計算機(第2計算機200、第3計算機300等)へ送信する。
In step S <b> 25, the record
ステップS26において、データレコードの更新処理を終了する。
(他の計算機からデータを受信した場合のレプリケーション処理)
第1計算機100は、データ送受信部16によって他の計算機が更新したデータおよび当該データの更新通番値を受信すると、他の計算機とのデータベースの内容を同一化させるため、受信したデータを第1計算機100のデータベースファイル11に反映させるか否かをデータ更新管理部15によって制御する。
In step S26, the data record update process is terminated.
(Replication processing when data is received from other computers)
When the
データ更新管理部15は、受信したデータをデータベースファイル11に格納する位置のデータレコードについて更新通番管理ファイル12に記憶される更新通番値を読み出して、読み出した更新通番値と、受信した更新通番値とを比較する。データ更新管理部15は、受信した更新通番値の値が更新通番管理ファイル12から読み出した更新通番値よりも大きい場合は、受信したデータによるデータベースファイル11の更新と、更新通番管理ファイル12に記憶される更新通番値の更新とを行う。
The data
また、データ更新管理部15は、他の計算機から受信したデータの更新通番値の値が更新通番管理ファイル12から読み出した更新通番値よりも小さい場合は、自計算機においてデータベースファイル11に保持するデータレコードの値を優先する。そのため、データ更新管理部15は、受信したデータおよび更新通番値を廃棄し、データベースファイル11に記憶されるデータレコードおよび当該データレコードに対応する更新通番値を他の計算機へネットワーク2を介して送信する。これにより、第1計算機100は、データベースシステムを構成する他の計算機のデータベースとの間でレプリケーション処理を行う。
In addition, when the update sequence number value of the data received from another computer is smaller than the update sequence number value read from the update
(レプリケーション処理の具体例)
上述のように複数の計算機間で行われるレプリケーション処理について、具体例を用いて説明する。
(Specific examples of replication processing)
A replication process performed between a plurality of computers as described above will be described using a specific example.
図5は、実施の形態1における本実施の形態において、データベースを備える計算機間でレプリケーションを行い、更新通番値が他のデータベースに反映される処理を示す図である。図5では、データベースを備える計算機の総数が3の場合を示し、各計算機の更新通番管理ファイル12、更新通番管理ファイル22、優先度管理ファイル33の具体的な変化の例を示している。この例では、第1計算機100は、優先値の値「1」を優先度管理ファイル13において保持し、第2計算機200は、優先値の値「2」を優先度管理ファイル23において保持し、第3計算機300は、優先値の値「3」を優先度管理ファイル33において保持している。
FIG. 5 is a diagram illustrating processing in which replication is performed between computers including a database and the update sequence number value is reflected in another database in the present embodiment in the first embodiment. FIG. 5 shows a case where the total number of computers having a database is 3, and shows an example of specific changes in the update sequence
ステップS31において、同一のレコードについて更新通番管理ファイル12、更新通番管理ファイル22、更新通番管理ファイル32で管理されている更新通番値がいずれも初期状態(更新通番値の値が0の状態)であるとする。ここで、第1計算機100は、更新要求元プログラム17によりデータの更新要求がなされたとする。
In step S31, all the update sequence numbers managed in the update sequence
ステップS32において、第1計算機100は、データ更新管理部15によってデータベースファイル11のレコードを更新し、更新通番値を更新する処理(図4のステップS24、ステップS25)を行い、更新通番管理ファイル12に更新通番値「3」を格納する。
In step S32, the
ステップS33において、第1計算機100は、レコード更新制御部19の処理によって他の計算機とデータベースの記憶内容の同一化(レプリケーション処理)を行う。このレプリケーション処理の結果、第1計算機100が更新したレコードについて更新通番管理ファイル12において保持されている更新通番値「3」は、第2計算機200の更新通番管理ファイル22と第3計算機300の更新通番管理ファイル32とに反映される。
In step S <b> 33, the
ステップS34において、第2計算機200がレコードを更新したとする。第2計算機200は、更新通番値を更新する処理(図4のステップS24、ステップS25)を行い、更新通番値「7」を算出して更新通番管理ファイル22に更新通番値「7」を格納する。
In step S34, it is assumed that the
ステップS35において、第2計算機200は、レコード更新制御部29の処理によって他の計算機とレプリケーション処理を行い、第2計算機200が更新したレコードについて更新通番管理ファイル22において保持されている更新通番値「7」は、第1計算機100の更新通番管理ファイル12と第3計算機300の更新通番管理ファイル32とに反映される。
In step S <b> 35, the
ステップS36において、第3計算機300がレコードを更新したとする。第3計算機300は、更新通番値を更新する処理(図4のステップS24、ステップS25)を行い、更新通番値「11」を算出して更新通番管理ファイル32に更新通番値「11」を格納する。
In step S36, the
ステップS37において、第3計算機300は、レコード更新制御部39の処理によって他の計算機とレプリケーション処理を行い、第3計算機300が更新したレコードについて更新通番管理ファイル32において保持されている更新通番値「11」は、第1計算機100の更新通番管理ファイル12と第2計算機200の更新通番管理ファイル22とに反映される。
In step S <b> 37, the
このように、第1計算機100、第2計算機200、第3計算機300は、更新通番値の算出を、データレコードの更新回数と、各計算機に固有に割り当てられた優先値とに基づいて算出している。これにより、更新通番値は、データレコードの更新を行った計算機に固有の値が算出される。例えば、上記の図5の例では、各計算機に通し番号で優先値が割り当てられており、データレコードの更新回数に応じた定まる基準値を優先値で補正している。例えば、第1計算機100がデータレコードを更新した場合、更新通番値は「3×n」(nは任意の正の整数)となり、第2計算機200がデータレコードを更新した場合、更新通番値は「3×n+1」となり、第3計算機300がデータレコードを更新した場合、更新通番値は「3×n+2」となる。各計算機は、優先値を参照すると、いずれの計算機によってデータレコードが更新されたか判別することができる。
As described above, the
また、このようにデータレコードの更新回数と計算機の数との積に基づいて基準値を算出し、算出された基準値を各計算機の優先値によって補正して更新通番値を算出することで、簡易な処理により更新通番値を各計算機に固有の値とすることができる。 In addition, by calculating the reference value based on the product of the number of updates of the data record and the number of computers in this way, by calculating the updated serial number value by correcting the calculated reference value by the priority value of each computer, The update sequence number value can be made unique to each computer by simple processing.
図6は、実施の形態1におけるレプリケーション処理によってデータレコードの内容が他の計算機のデータベースと同一化する例を示す図である。図6では、第1計算機100と第2計算機200のデータレコードの内容を、更新通番値に基づいて同一化する例を示している。レプリケーション処理は、各計算機がデータレコードを更新して他の計算機へ更新後のデータレコードおよび更新通番値を送信したときや、各計算機が他の計算機からデータレコードおよび更新通番値を受信したときや、ネットワーク2に異常が発生し他の計算機との通信が不可の状態となった後、通信状態が復旧したときに各計算機によって行われる。
FIG. 6 is a diagram illustrating an example in which the content of the data record is made identical to the database of another computer by the replication processing in the first embodiment. FIG. 6 shows an example in which the contents of the data records of the
ステップS41において、第1計算機100は、他の計算機(第2計算機200)の更新通番管理ファイル(更新通番管理ファイル22)と、自計算機の更新通番管理ファイル12とを各データレコードについて比較する。比較の結果、更新通番値の値が異なる場合、第1計算機100は、更新通番値の大きいデータレコードを優先する。例えば、図6の例では、レコード1およびレコード3の更新通番値が第1計算機100と第2計算機200とで異なっている。第1計算機100は、各データレコードの更新通番値を参照し、レコード1についてはデータベースファイル11を優先し、レコード3についてはデータベースファイル21を優先すると判断する。
In step S41, the
ステップS42において、レプリケーション処理が行われ、第1計算機100と第2計算機200との間で、レコード1についてはデータベースファイル11の記憶内容がデータベースファイル21よりも優先され、レコード3についてはデータベースファイル21の記憶内容がデータベースファイル11よりも優先される。各計算機がデータレコードの更新および更新通番値の更新を行うことにより、各計算機のデータベースの内容が同一化される。
In step S42, replication processing is performed, and between the
このように、本実施形態では、各計算機が更新通番管理ファイル(更新通番管理ファイル12等)に保持している更新通番値を比較するという簡易な処理によりレプリケーション処理を行うことができ、特に大規模なデータベースにおいて動作を効率化することができる。
As described above, in this embodiment, the replication process can be performed by a simple process of comparing the update sequence number values stored in the update sequence number management file (update sequence
(各計算機でそれぞれデータレコードの更新が行われた場合)
各計算機がそれぞれデータレコードの更新を行った場合は、最も高い優先値が設定されている計算機のデータレコードが優先される。図7は、実施の形態1における複数の計算機がデータレコードを更新した場合のレプリケーション処理を示す図である。例えば、複数の計算機がほぼ同時にデータレコードを更新する場合や、計算機間の通信接続に障害が発生し、レプリケーション処理を行うことが困難な期間において各データベースがそれぞれデータレコードを更新した場合などがある。図7の例では、同一のデータレコードを第2計算機200と第3計算機300とがそれぞれ更新した場合の例を示している。
(When data records are updated on each computer)
When each computer updates the data record, the data record of the computer with the highest priority value is given priority. FIG. 7 is a diagram showing a replication process when a plurality of computers in the first embodiment updates a data record. For example, when multiple computers update data records almost simultaneously, or when a communication connection between computers fails and each database updates data records during periods when replication processing is difficult . In the example of FIG. 7, an example is shown in which the
ステップS51において、各計算機のデータベースの内容は同一化がなされており、更新通番値「11」が各計算機の更新通番管理ファイルに保持されている。その後、第2計算機200と第3計算機300とが同一のデータレコードに対してそれぞれ更新を行ったとする。
In step S51, the contents of the database of each computer are made identical, and the update sequence value “11” is held in the update sequence number management file of each computer. Thereafter, it is assumed that the
ステップS52において、第2計算機200がデータベースファイル21を更新し、第3計算機300がデータベースファイル31を更新した結果、第2計算機200の更新通番管理ファイル22には更新通番値「13」が保持され、第3計算機300の更新通番管理ファイル32には更新通番値「14」が保持されている。
In step S52, as a result of the
ステップS53において、レプリケーション処理が行われ、最も大きい更新通番値を持つ第3計算機300のデータレコードの内容が他の計算機と一致化される。
In step S53, replication processing is performed, and the contents of the data record of the
上記説明したように、本実施形態によると、各計算機がほぼ同時にデータレコードを更新した場合であっても、更新通番値を比較するという簡易な処理によりレプリケーション処理を行うことができる。 As described above, according to the present embodiment, even if each computer updates a data record almost simultaneously, the replication process can be performed by a simple process of comparing the update sequence number values.
<実施の形態2>
実施の形態1では、各計算機に割り当てられた優先値の値が固定であるものとして説明したが、優先値の値を各計算機が変更することとしてもよい。例えば、新たに計算機を追加する場合や、計算機の性能を向上させた場合などにおいて、各計算機の優先値を変更させることとしてもよい。優先値を変更する処理は、各計算機の優先度管理部(優先度管理部14、優先度管理部24、優先度管理部34等)が行う。各計算機にはそれぞれ固有の優先値が割り当てられているため、各計算機は、複数の計算機が同一の優先値を持たないよう優先値の変更の処理を行う必要がある。具体的には、各計算機は、優先値を変更する際に、各計算機の優先度管理部が相互に優先値の値を交換し、各計算機が変更しようとする優先値の値が既に使用されている場合は、優先値の変更の要求を無視する動作をする。また、各計算機が同一の優先値を持たないよう、いずれかの計算機の優先値の値を無効状態(優先値の値を0に設定)にしてから優先値を変更する。
<
In the first embodiment, the priority value assigned to each computer has been described as being fixed. However, each computer may change the value of the priority value. For example, the priority value of each computer may be changed when a new computer is added or when the performance of the computer is improved. The processing for changing the priority value is performed by the priority management unit (
図8は、実施の形態2における各計算機が優先値を変更する処理を示すフローチャートである。以下に示す処理では、優先値の高い計算機から順に、自計算機が優先値を変更する対象であるか否かを判断し、変更対象の優先値の値を減少させつつ各計算機の優先値を再設定する。 FIG. 8 is a flowchart illustrating processing in which each computer in the second embodiment changes the priority value. In the processing shown below, in order from the computer with the highest priority value, it is determined whether or not the own computer is the target for changing the priority value, and the priority value of each computer is re-established while decreasing the priority value to be changed. Set.
ステップS101において、計算機は、優先度管理部(優先度管理部14等)により他の計算機と通信し、各計算機が変更すべき優先値の再設定値を取得する。例えば、各計算機に優先順位を付け、優先順位の高い計算機の優先値の値が大きくなるよう優先値の値を再設定する。各計算機の優先順位は、例えば、各計算機のMAC(Media Access Control)アドレス、IP(Internet Protocol)アドレス、各計算機のシリアル番号、各計算機の性能値、計算機毎の重要性等に基づいて定める。
In step S101, the computer communicates with other computers through the priority management unit (
ステップS103において、各計算機は、変更対象となる装置を示すフラグカウンタ(変更対象装置情報)に、優先値の最大値(計算機の総数)を設定する。 In step S103, each computer sets a maximum priority value (total number of computers) in a flag counter (change target device information) indicating a device to be changed.
ステップS105において、各計算機は、自計算機の優先度管理部において管理している優先値の値と、変更対象装置情報とを比較し、優先値の値が変更対象装置情報と一致するか否かを判断する。ステップS105において肯定的な判断結果の場合(優先値の値と変更対象装置情報とが一致する場合)、計算機は、ステップS107の処理を実行する。ステップS105において否定的な判断結果の場合(優先値の値が変更対象装置情報と一致しない)、計算機は、ステップS113の処理を実行する。 In step S105, each computer compares the value of the priority value managed by the priority management unit of its own computer with the change target device information, and whether or not the priority value matches the change target device information. Judging. If the determination result in step S105 is affirmative (if the priority value matches the change target device information), the computer executes the process of step S107. In the case of a negative determination result in step S105 (the value of the priority value does not match the change target device information), the computer executes the process of step S113.
ステップS107において、計算機は、ステップS101で取得した各計算機の優先値の再設定値に基づいて、自計算機の優先値の値を変更する必要があるか否かを判断する。自計算機の優先値の設定が変更されない場合、計算機は、ステップS109の処理を実行し、自計算機の優先値の設定を変更する場合、計算機は、ステップS111の処理を実行する。 In step S107, the computer determines whether it is necessary to change the value of the priority value of its own computer based on the reset value of the priority value of each computer acquired in step S101. When the setting of the priority value of the own computer is not changed, the computer executes the process of step S109. When the setting of the priority value of the own computer is changed, the computer executes the process of step S111.
ステップS109において、計算機は、優先値の値を変更せず、自計算機における優先値の変更処理が完了したことを他の計算機へ通知する。 In step S109, the computer does not change the value of the priority value and notifies the other computers that the priority value change processing in the own computer has been completed.
ステップS111において、計算機は、自計算機の優先値の値を無効状態(優先値=0)にし、優先値の値を無効状態にしたことを他の計算機へ通知する。 In step S111, the computer sets the priority value of its own computer to an invalid state (priority value = 0), and notifies other computers that the value of the priority value has been invalidated.
ステップS113において、計算機は、他の計算機から優先値に関する通知があるまで待機し、この通知を受信する。 In step S <b> 113, the computer waits until there is a priority value notification from another computer, and receives this notification.
ステップS115において、各計算機は、変更対象装置情報の値をデクリメントする。
ステップS117において、各計算機は、自計算機の優先度管理部において管理している優先値の値と、変更対象装置情報とを比較し、優先値の値が変更対象装置情報と一致するか否かを判断することで、自計算機が優先値を変更する対象の計算機であるか判断する。ステップS117において否定的な判断結果の場合(優先値の値が変更対象装置情報と一致しない場合)、計算機は、ステップS119の処理を実行する。ステップS117において肯定的な判断結果の場合(優先値の値が変更対象装置情報と一致する場合)、計算機は、ステップS121の処理を実行する。
In step S115, each computer decrements the value of the change target device information.
In step S117, each computer compares the priority value managed by the priority management unit of its own computer with the change target device information, and whether or not the priority value matches the change target device information. Is determined to determine whether the own computer is a computer whose priority value is to be changed. In the case of a negative determination result in step S117 (when the priority value does not match the change target device information), the computer executes the process of step S119. In the case of a positive determination result in step S117 (when the priority value matches the change target device information), the computer executes the process of step S121.
ステップS119において、計算機は、他の計算機から優先値に関する通知があるまで待機し、この通知を受信する。 In step S119, the computer waits until there is a notification regarding the priority value from another computer, and receives this notification.
ステップS121において、計算機は、自計算機の優先値の値を、優先値の再設定値に従って変更し、優先値を変更したことを他の計算機へ通知する。 In step S121, the computer changes the value of the priority value of the own computer according to the reset value of the priority value, and notifies the other computers that the priority value has been changed.
ステップS123において、各計算機は、変更対象装置情報の値をデクリメントする。
ステップS125において、各計算機は、優先値の値の再設定値と、各計算機において変更された優先値の値とを参照し、全ての計算機の優先値が変更されたか否かを判断する。全ての計算機の優先値が変更された場合(ステップS125においてYES)、各計算機は優先値の変更の処理を終了する。全ての計算機の優先値の変更が完了していない場合(ステップS125においてNO)、各計算機は、ステップS117の処理を行う。
In step S123, each computer decrements the value of the change target device information.
In step S125, each computer refers to the reset value of the priority value and the value of the priority value changed in each computer, and determines whether or not the priority values of all the computers have been changed. If the priority values of all the computers have been changed (YES in step S125), each computer ends the priority value change process. When the change of the priority value of all the computers has not been completed (NO in step S125), each computer performs the process of step S117.
図9は、実施の形態2における各計算機が優先値を変更する処理の具体例を示す図である。図9の例では、3つの計算機(第1計算機100、第2計算機200、第3計算機300)が優先値を変更する場合の動作例を示している。
FIG. 9 is a diagram illustrating a specific example of processing in which each computer in the second embodiment changes the priority value. In the example of FIG. 9, an operation example in the case where three computers (
ステップS61において、各計算機の優先度管理部には、第1計算機100の優先度管理ファイル13に優先値「1」が保持され、第2計算機200の優先度管理ファイル23に優先値「2」が保持され、第3計算機300の優先度管理ファイル33に優先値「3」が保持されている。優先値の値の再設定により、第1計算機100に割り当てられる優先値を「2」とし、第2計算機200に割り当てられる優先値を「3」とし、第3計算機300に割り当てられる優先値を「1」に変更するものとする。
In step S61, the priority management unit of each computer holds the priority value “1” in the
ステップS62において、第3計算機300の優先度管理部34は、ステップS105、ステップS107の処理を行い、優先値を無効状態(優先値=0)とする。
In step S62, the priority management unit 34 of the
ステップS63において、第3計算機300の優先度管理部34は、ステップS111の処理を行い、優先値を無効状態(優先値=0)としたことを他の計算機に通知する。第1計算機100および第2計算機200は、ステップS113の処理を行い、第3計算機300が優先値を無効状態にしたことの通知を受信する。
In step S63, the priority management unit 34 of the
ステップS64において、第2計算機200は、ステップS63における第3計算機300からの通知の受信前に、第3計算機300から受信したデータでデータレコードに更新を反映すべきデータがある場合は、データベースファイル21に当該データを反映させる。
In step S64, the
ステップS65において、第2計算機200は、ステップS117、ステップS121の処理を行って、優先度管理ファイル23に優先値の値「3」を保持させる。
In step S <b> 65, the
ステップS66において、第2計算機200は、ステップS121の処理を行って、第2計算機200が優先値の値を変更したことを他の計算機へ通知する。第1計算機100と第3計算機300は、ステップS119の処理を行い、第2計算機200が優先値を変更したことの通知を受信する。
In step S66, the
ステップS67において、第1計算機100は、ステップS66における第2計算機200からの通知の受信前に、第2計算機200から受信したデータでデータレコードに更新を反映すべきデータがある場合は、データベースファイル11に当該データを反映させる。
In step S67, the
ステップS68において、第1計算機100は、ステップS117、ステップS121の処理を行って、優先度管理ファイル13に優先値の値「2」を保持させる。
In step S <b> 68, the
ステップS69において、第1計算機100は、ステップS121の処理を行って、第1計算機100が優先値の値を変更したことを他の計算機へ通知する。第2計算機200と第3計算機300は、ステップS119の処理を行い、第1計算機100が優先値を変更したことの通知を受信する。
In step S69, the
ステップS70において、第3計算機300は、ステップS69における第1計算機100からの通知の受信前に、第1計算機100から受信したデータでデータレコードに更新を反映すべきデータがある場合は、データベースファイル31に当該データを反映させる。
In step S70, the
ステップS71において、第3計算機300は、ステップS117、ステップS121の処理を行って、優先度管理ファイル33に優先値の値「1」を保持させる。
In step S <b> 71, the
以上の処理により、各計算機が優先値を重複させることなく優先値を変更することができる。 With the above processing, each computer can change the priority value without duplicating the priority value.
図10は、実施の形態2における各計算機が優先値を変更する処理を示す第2のフローチャートである。図8及び図9のような処理によらなくても、各計算機への新優先値の設定の前後で、各計算機が自己データの更新を禁止/許可をすることで、計算機間での更新通番値の重複を避ける手順を示している。ステップS201で新優先値を指示された各計算機はそれぞれ、図10のフローを実行する。ステップS202において、計算機は、自己データの更新を禁止する。これによって、ステップS203でまだ反映されていない他計算機データの更新データを反映完了して以降、新たな更新データの反映を行わないので、各計算機の優先値が変更されることによる更新通番値の重複を避けることが出来る。ステップS204で自己の優先値を指定された値に変更する。次にステップS205で、自己の優先値変更完了を送信する。各計算機はステップS206で他の計算機が優先値の変更を完了したことを確認できるまで待機し、全計算機の優先値の変更が完了した後、ステップS207で自己データの更新許可をしてステップS209で終了する。 FIG. 10 is a second flowchart illustrating a process in which each computer in the second embodiment changes the priority value. Even if the processing shown in FIG. 8 and FIG. 9 is not used, each computer prohibits / permits the update of its own data before and after the setting of the new priority value to each computer. The procedure for avoiding duplicate values is shown. Each computer instructed with the new priority value in step S201 executes the flow of FIG. In step S202, the computer prohibits updating of self data. As a result, after the update data of other computer data that has not yet been reflected in step S203 is reflected, new update data is not reflected, so the update sequence number value by changing the priority value of each computer is changed. Duplication can be avoided. In step S204, the self priority value is changed to a designated value. Next, in step S205, the own priority value change completion is transmitted. Each computer waits until it can be confirmed in step S206 that another computer has completed the change of the priority value, and after the change of the priority value of all the computers is completed, the update of the self data is permitted in step S207, and step S209 is performed. End with.
各実施形態で説明したように、分散配置されたいずれのデータベースからでも更新を行えるマルチマスタ方式を適用したデータベースシステムにおいて、時刻ずれの影響を受けやすい計算機の時刻情報や、複雑なパラメータの参照などを必要とせず、更新通番値の比較という処理を行うだけで、データレコードの更新時の競合を避けることができる。したがって、時刻同期ができない環境や、低い性能の計算機でデータベースシステムを構成する場合であっても、マルチマスタ方式による大規模な分散データベースシステムを構成することができる。 As explained in each embodiment, in a database system that applies a multi-master method that can be updated from any distributed database, time information of computers that are easily affected by time lag, reference to complex parameters, etc. Is not required, and contention at the time of updating the data record can be avoided by simply performing the process of comparing the update sequence number values. Therefore, even in an environment where time synchronization is not possible or a database system is configured with a low-performance computer, it is possible to configure a large-scale distributed database system using the multi-master method.
上記説明では、3つの計算機からなるデータベースシステムの例を中心に説明したが、データベースの数は3つに限られない。また、優先値によって管理する対象は、データベース全体に限らず、ある特定のデータレコードのグループであることとしてもよい。 In the above description, an example of a database system including three computers has been mainly described, but the number of databases is not limited to three. Moreover, the target managed by the priority value is not limited to the entire database, and may be a group of a specific data record.
以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。今回開示された実施の形態はすべての点で例示であって制限的なものでないと考えられるべきである。この発明の範囲は上記した説明ではなくて特許請求の範囲によって示され、特許請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say. The embodiment disclosed this time should be considered as illustrative in all points and not restrictive. The scope of the present invention is defined by the terms of the claims, rather than the description above, and is intended to include any modifications within the scope and meaning equivalent to the terms of the claims.
1 制御システム、2 ネットワーク、5A 第1拠点、5B 第2拠点、5C 第3拠点、5D 第4拠点、11 データベースファイル、12 更新通番管理ファイル、13 優先度管理ファイル、14 優先度管理部、15 データ更新管理部、16 データ送受信部、17 更新要求元プログラム、18 更新値算出部、19 レコード更新制御部、21 データベースファイル、22 更新通番管理ファイル、23 優先度管理ファイル、24 優先度管理部、25 データ更新管理部、26 データ送受信部、27 更新要求元プログラム、28 更新値算出部、29 レコード更新制御部、31 データベースファイル、32 更新通番管理ファイル、33 優先度管理ファイル、34 優先度管理部、35 データ更新管理部、36 データ送受信部、37 更新要求元プログラム、38 更新値算出部、39 レコード更新制御部、61 プロセッサ、62 メモリ、63 HDD、64 通信インタフェース、100 第1計算機、200 第2計算機、300 第3計算機。 DESCRIPTION OF SYMBOLS 1 Control system, 2 Network, 5A 1st base, 5B 2nd base, 5C 3rd base, 5D 4th base, 11 Database file, 12 Update serial number management file, 13 Priority management file, 14 Priority management part, 15 Data update management unit, 16 data transmission / reception unit, 17 update request source program, 18 update value calculation unit, 19 record update control unit, 21 database file, 22 update sequence number management file, 23 priority management file, 24 priority management unit, 25 data update management unit, 26 data transmission / reception unit, 27 update request source program, 28 update value calculation unit, 29 record update control unit, 31 database file, 32 update sequence number management file, 33 priority management file, 34 priority management unit , 35 Data update management unit, 36 Data transmission / reception Parts, 37 update request source program, 38 update value calculation unit, 39 record update control unit, 61 Processor, 62 memory, 63 HDD, 64 a communication interface, 100 a first computer, 200 the second computer, 300 third computer.
Claims (6)
複数のレコードを保持するためのデータレコード保持部と、
前記レコードの更新状況を示す更新値を各レコードについて記憶するための記憶部と、
自計算機においてレコードを更新する場合、更新前の前記レコードの更新値と、自計算機に固有の優先値とに基づいて、更新されるレコードの更新回数に応じた自計算機に固有の更新値を算出する算出部と、
自計算機において更新したレコードおよび当該レコードについて前記算出された自計算機に固有の更新値を、前記データベースシステムを構成する他の計算機へ送信し、前記他の計算機から当該他の計算機において更新されたレコードおよび当該レコードの更新値を受信する送受信処理部と、
前記他の計算機からレコードおよび当該レコードの更新値を前記受信した場合、前記受信したレコードについて前記記憶部に記憶される更新値と、前記受信した更新値とを比較することにより、前記複数の計算機間でレプリケーションを行う制御部とを備える、
計算機。 A computer that constitutes a database system that performs replication among multiple computers by a multi-master method,
A data record holding unit for holding a plurality of records;
A storage unit for storing an update value indicating an update status of the record for each record;
When updating a record in its own computer, an update value specific to the own computer is calculated according to the number of updates of the record to be updated, based on the update value of the record before the update and the priority value specific to the own computer. A calculating unit to
A record updated in the own computer and an update value unique to the calculated own computer for the record are transmitted to another computer constituting the database system, and the record updated in the other computer from the other computer And a transmission / reception processing unit that receives an update value of the record,
When the record and the update value of the record are received from the other computer, the plurality of computers are compared by comparing the received update value with the update value stored in the storage unit for the received record. And a controller that performs replication between
calculator.
前記更新前の前記レコードの更新値に基づいて当該レコードの更新回数を取得し、取得した前記更新回数と、前記データベースシステムを構成する計算機の数との積に基づいて基準値を算出し、算出された前記基準値を前記優先値によって補正することにより行う、請求項1記載の計算機。 The process of calculating the update value specific to the computer by the calculation unit is as follows:
Obtain the number of updates of the record based on the update value of the record before the update, calculate a reference value based on the product of the obtained number of updates and the number of computers constituting the database system, and calculate The computer according to claim 1, wherein the calculated reference value is corrected by the priority value.
ネットワーク接続によりデータベースシステムを構成する計算機群において自計算機に固有の優先値を記憶するように構成されている、
請求項2記載の計算機。 The storage unit
The network host computer in a computer group constituting the database system by the connection is configured to store a unique priority value,
The computer according to claim 2.
前記算出部は、前記算出された基準値に対し、前記優先値を加算または減算することにより前記自計算機に固有の更新値を算出する、
請求項3記載の計算機。 The priority value is a serial number assigned to each computer constituting the database system,
The calculation unit calculates an update value specific to the own computer by adding or subtracting the priority value to the calculated reference value.
The computer according to claim 3.
優先値記憶部に記憶される優先値の再設定要求を受け付けて、前記データベースシステムを構成する他の計算機との通信により、計算機間で優先値を変更する優先値管理部をさらに備える、
請求項1から4のいずれか1項に記載の計算機。 The calculator is
Accepts request of resetting the priority value stored in the Yu Sakichi storage unit, the communications with other computers constituting the database system further comprises a priority value manager to change the priority value among the computer,
The computer according to any one of claims 1 to 4.
前記データベースシステムを構成する計算機それぞれの装置固有情報に基づいて、自計算機に再設定される優先値を取得する、
請求項5記載の計算機。 The priority value management unit
Based on the device-specific information of each computer constituting the database system, a priority value to be reset in the own computer is acquired.
The computer according to claim 5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012259930A JP6053476B2 (en) | 2012-11-28 | 2012-11-28 | calculator |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2012259930A JP6053476B2 (en) | 2012-11-28 | 2012-11-28 | calculator |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2014106785A JP2014106785A (en) | 2014-06-09 |
| JP6053476B2 true JP6053476B2 (en) | 2016-12-27 |
Family
ID=51028208
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2012259930A Active JP6053476B2 (en) | 2012-11-28 | 2012-11-28 | calculator |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6053476B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP6996176B2 (en) * | 2017-09-11 | 2022-01-17 | カシオ計算機株式会社 | Database management system |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3254434B2 (en) * | 1999-04-13 | 2002-02-04 | 三菱電機株式会社 | Data communication device |
| JP3963417B2 (en) * | 1999-11-19 | 2007-08-22 | 株式会社東芝 | Communication method and electronic device for data synchronization processing |
| JP2002116940A (en) * | 2000-07-31 | 2002-04-19 | Fujitsu Ltd | Data distribution management device, data distribution management program, and recording medium |
| JP2001229066A (en) * | 2000-12-19 | 2001-08-24 | Mitsubishi Electric Corp | Mirroring system and mirroring method |
| US7620659B2 (en) * | 2007-02-09 | 2009-11-17 | Microsoft Corporation | Efficient knowledge representation in data synchronization systems |
-
2012
- 2012-11-28 JP JP2012259930A patent/JP6053476B2/en active Active
Also Published As
| Publication number | Publication date |
|---|---|
| JP2014106785A (en) | 2014-06-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10027748B2 (en) | Data replication in a tree based server architecture | |
| CN112261135B (en) | Node election method, system, device and equipment based on consistency protocol | |
| JP5548829B2 (en) | Computer system, data management method, and data management program | |
| EP3015998B1 (en) | Zoning balance subtask delivering method, apparatus and system | |
| CN104137008B (en) | Method for fail-safe operation of a process control system with redundant control devices | |
| CN103324495A (en) | Method and system for data center server boot management | |
| CN109376197B (en) | Data synchronization method, server and computer storage medium | |
| US7813341B2 (en) | Overhead reduction for multi-link networking environments | |
| WO2014087287A1 (en) | Replication control using eventually consistent meta-data | |
| CN104054076B (en) | Data storage method, database storage node fault handling method and device | |
| CN114385561A (en) | File management method and device and HDFS system | |
| US20240061754A1 (en) | Management of logs and cache for a graph database | |
| JP6233403B2 (en) | Storage system, storage device, storage device control method and control program, management device, management device control method and control program | |
| CN119201180A (en) | Cluster upgrade control method, device, equipment, medium and program product | |
| US20200401340A1 (en) | Distributed storage system | |
| JP6376626B2 (en) | Data storage method, data storage device, and storage device | |
| JP6053476B2 (en) | calculator | |
| CN107239235A (en) | A kind of many RAID synchronous method living of many controls and system | |
| WO2010048045A2 (en) | Forgetting items with knowledge based synchronization | |
| CN111064643A (en) | A node server and its data interaction method and related device | |
| CN111800511B (en) | Synchronous login state processing method, system, equipment and readable storage medium | |
| US8965843B2 (en) | Prioritized replication paths | |
| CN114296941A (en) | Method, system and related device for communication among nodes of distributed cluster system | |
| CN110457392B (en) | Copy reading and writing method and device | |
| JP5812512B2 (en) | Database system, master-slave management method, and master-slave management program |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150707 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160314 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160510 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160530 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20161101 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20161129 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 6053476 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |