JP2015035174A - Control program dividing apparatus, control program dividing method and recording medium therefor - Google Patents
Control program dividing apparatus, control program dividing method and recording medium therefor Download PDFInfo
- Publication number
- JP2015035174A JP2015035174A JP2013166781A JP2013166781A JP2015035174A JP 2015035174 A JP2015035174 A JP 2015035174A JP 2013166781 A JP2013166781 A JP 2013166781A JP 2013166781 A JP2013166781 A JP 2013166781A JP 2015035174 A JP2015035174 A JP 2015035174A
- Authority
- JP
- Japan
- Prior art keywords
- control program
- source code
- output signal
- divided
- dependency
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Images
Landscapes
- Devices For Executing Special Programs (AREA)
Abstract
Description
本発明の実施形態は、クラウド制御システムにおいて使用される制御プログラム分割装置、制御プログラムの分割方法及びその記録媒体に関する。 Embodiments described herein relate generally to a control program dividing device, a control program dividing method, and a recording medium thereof used in a cloud control system.
災害復旧を容易にするため、遠隔からネットワークを介して現場機器を制御する遠隔制御技術に注目が集まっている。遠隔に配置された複数のクラウドサーバから制御を行うシステムを、ここではクラウド制御システムと呼ぶ。 In order to facilitate disaster recovery, attention has been focused on remote control technology for remotely controlling field devices via a network. A system that performs control from a plurality of cloud servers that are remotely located is referred to herein as a cloud control system.
クラウド制御システムでは、制御プログラムを物理的に離れた複数のサーバに保持するので、被災時において、全ての制御プログラムが失われる恐れがない。また、災害からの復旧の際、制御プログラムの再構築および制御サーバの交換にかかる時間を短縮することもできる。 In the cloud control system, since the control program is held in a plurality of physically separated servers, there is no possibility that all the control programs are lost in the event of a disaster. In addition, when recovering from a disaster, it is possible to shorten the time required for rebuilding the control program and replacing the control server.
このような背景から、クラウド制御システムにおいては、制御プログラムを複数のサーバで並列実行できるように分割するプリコンパイラが求められている。 From such a background, in a cloud control system, a precompiler that divides a control program so that it can be executed in parallel by a plurality of servers is required.
ところで、一般的なマルチプロセッサ向けのコンパイラでは、ループ処理を並列実行可能なように分割する手法がある(例えば、特許文献1参照)。 By the way, in a general multiprocessor compiler, there is a method of dividing loop processing so that it can be executed in parallel (see, for example, Patent Document 1).
また、従来から多くのプログラミング言語のコンパイラ開発のために、字句解析器(レキシカルアナライザ)を生成するためのプログラムとしてLexが、また、構文解析器(パーサジェネレータ)を生成するためのプログラムとしてYaccがある(例えば、非特許文献1参照。)。
For the development of compilers for many programming languages, Lex is used as a program for generating a lexical analyzer (lexical analyzer), and Yacc is used as a program for generating a parser (parser generator). Yes (see Non-Patent
上述した特許文献1のコンパイラにおいては、プログラムのデータの依存性を判定して、ループ処理を並列実行するため、ループの分割を行った後、ループ毎に異なる複数のサーバで演算して1つの出力を求める。
In the above-described compiler of
そのため、複数のデータを交換しながら1つの出力を演算するため、サーバ間の通信が多くなるので、サーバ間のネットワークは超高速ネットワークとしている。 Therefore, since a single output is calculated while exchanging a plurality of data, communication between servers increases, so the network between servers is an ultra-high speed network.
即ち、特許文献1のコンパイラは、1つの出力を求めるための演算時間が1日もかかり、演算時間が通信時間に比べて極端にかかるデータ依存性が存在する多重ループを含む科学技術計算などのプログラムの場合に適用されるもので、1つの出力の処理時間を短くできる効果が有る。
In other words, the compiler of
しかしながら、多数の入出力点数を備え、夫々の演算時間と通信時間の比率が同等で、演算時間がミリ秒単位であるようなクラウド制御システムとは、対象とするプログラムの構造もネットワークも異なるので、制御プログラムを高速処理するコンパイラとしては適用することが出来ない。 However, the target program structure and network are different from a cloud control system that has a large number of input / output points, the ratio of the calculation time and communication time is the same, and the calculation time is in milliseconds. It cannot be applied as a compiler for high-speed processing of control programs.
本願は、インターネットを使用したネットワークで構成されるクラウド制御システムにおいて、多数の入出力信号の処理を要求される制御プログラムを、予め出力信号に対する入力信号や一時変数の依存性を判定して、同じ依存性があるソースコード同士に纏めて分割し、分割された制御プログラムを並列に実行して、制御プログラムの実行時間を短縮するようにした制御プログラム分割装置、制御プログラムの分割方法及びその記録媒体を提供することを目的とする。 In the cloud control system configured by the network using the Internet, the present application determines the control program required to process a large number of input / output signals in advance by determining the dependency of the input signals and temporary variables on the output signals. Control program dividing apparatus, control program dividing method, and recording medium for reducing the execution time of the control program by dividing the source code having dependencies together and executing the divided control programs in parallel The purpose is to provide.
上記目的を達成するために、本実施の形態の制御プログラムの分割装置は、制御対象である現場機器の制御プログラムを遠隔地に備える複数のサーバで制御するクラウド制御システムにおいて、当該制御プログラムを当該複数のサーバに予め分割して並列に実行させるプリコンパイラとしての制御プログラムの分割装置であって、予め定めるプログラミング言語で生成される前記制御プログラムのソースコードを入力し、当該ソースコードの記号列を読み取る入力処理部と、読み取った前記記号列を入力し、機械可読にした前記プログラミング言語の規則定義を、プログラムLexを介して与え、前記ソースコードのトークン列(語彙列)を生成する字句解析処理部と、前記字句解析処理部で解析したトークン列を入力し、前記プログラミング言語の前記トークン列の構文規則定義を、プログラムYaccを介して与え、前記ソースコードの構文規則定義に一致する前記トークン列から当該ソースコードの信号名と前記現場機器との入力信号、一次変数、及び出力信号の種類を判定して記述した入出力信号テーブルと、どの前記出力信号がどの前記入力信号及び前記一次変数に依存しているかを判定して記述した依存性テーブルと、前記ソースコードの構造を判定して記述した構文木と、を生成する構文解析処理部と、前記入出力信号テーブルと、前記依存性テーブルと、及び前記構文木と、に記述された前記構文規則定義の意味から、前記出力信号に依存性のある複数の分割された前記ソースコード毎に分割する分割処理部と、分割された前記ソースコードを前記記号列として出力する出力処理部と、を備え、前記制御プログラムの前記ソースコードを、前記出力信号に同じ依存性のあるソースコード同士に纏めて分割することを特徴とする。 In order to achieve the above object, the control program dividing apparatus according to the present embodiment includes a control program for a field device, which is a control target, in a cloud control system that controls a plurality of servers provided in remote locations. A control program dividing device as a precompiler that is divided into a plurality of servers in advance and executed in parallel. The control program source code generated in a predetermined programming language is input, and a symbol string of the source code is input. An input processing unit for reading, and a lexical analysis process for inputting a rule string of the programming language that has been read and made machine-readable, via a program Lex, and generating a token string (vocabulary string) of the source code And the token string analyzed by the lexical analysis processing unit, The token sequence syntax rule definition of the source code is given through the program Yacc, and the source code signal name and the input signal from the field device from the token sequence that matches the source code syntax rule definition, primary variables, and Input / output signal table described by determining the type of output signal, dependency table described by determining which output signal depends on which input signal and primary variable, and structure of the source code From the meaning of the syntax rule definition described in the syntax analysis processing unit for generating the syntax analysis processing unit, the input / output signal table, the dependency table, and the syntax tree, A division processing unit that divides each of the plurality of divided source codes depending on the output signal, and an output that outputs the divided source code as the symbol string Comprising a processing section, a, the source code of the control program, characterized by dividing together with the source code together with the same dependence on the output signal.
上記目的を達成するために、本実施の形態の制御プログラムの分割方法は、制御対象である現場機器の制御プログラムを遠隔地に備える複数のサーバで制御するクラウド制御システムにおいて、当該制御プログラムを当該複数のサーバに予め分割して並列に実行させるプリコンパイラとしての制御プログラムの分割方法であって、前記プリコンパイラとしてのプロセッサは、予め定めるプログラミング言語で生成される前記制御プログラムのソースコードを入力し、当該ソースコードの記号列を読み取る入力処理ステップと、読み取った前記記号列を入力し、機械可読にした前記プログラミング言語の規則定義を、プログラムLexを介して与え、前記ソースコードのトークン列(語彙列)を生成する字句解析処理ステップと、前記字句解析処理部で解析したトークン列を入力し、前記プログラミング言語の前記トークン列の構文規則定義を、プログラムYaccを介して与え、前記ソースコードの構文規則定義に一致する前記トークン列から当該ソースコードの信号名と前記現場機器との入力信号、一次変数、及び出力信号の種類を判定して記述した入出力信号テーブルと、どの前記出力信号がどの前記入力信号及び前記一次変数に依存しているかを判定して記述した依存性テーブルと、前記ソースコードの構造を判定して記述した構文木と、を生成する構文解析処理ステップと、前記入出力信号テーブルと、前記依存性テーブルと、及び前記構文木と、に記述された前記構文規則定義の意味から、前記出力信号に依存性のある複数の分割された前記ソースコード毎に分割する分割処理ステップと、分割された前記ソースコードを前記トークン列として出力する出力処理ステップと、を備え、前記制御プログラムの前記ソースコードを、前記出力信号に同じ依存性があるソースコード同士に纏めて分割することを特徴とする。 In order to achieve the above object, the method for dividing a control program according to the present embodiment is a cloud control system in which a control program for a field device that is a control target is controlled by a plurality of servers provided in remote locations. A method of dividing a control program as a precompiler that is divided into a plurality of servers in advance and executed in parallel, wherein the processor as the precompiler inputs a source code of the control program generated in a predetermined programming language An input processing step for reading a symbol string of the source code; a rule definition of the programming language that is input to the read symbol string and made machine-readable is given via a program Lex, and a token string (vocabulary of the source code) Lexical analysis processing step for generating a sequence) and the lexical analysis processing The token sequence parsed in the above is input, the syntax rule definition of the token sequence of the programming language is given via the program Yacc, and the signal name of the source code from the token sequence that matches the syntax rule definition of the source code Input / output signal table describing and describing the types of input signals, primary variables, and output signals with the field equipment, and determining which output signals depend on which input signals and primary variables A syntax analysis processing step for generating a described dependency table, a syntax tree described by determining the structure of the source code, the input / output signal table, the dependency table, and the syntax tree; Is divided into a plurality of divided source codes that depend on the output signal. And an output processing step for outputting the divided source code as the token string, and the source code of the control program is divided into source codes having the same dependency on the output signal. It is characterized by that.
以下、本発明の実施の形態について図面を参照して説明する。本実施の形態に示す制御プログラム分割装置1は、制御対象である現場機器の制御プログラムを遠隔地に備える複数のサーバで制御するクラウド制御システムにおいて使用される制御プログラムが、複数のサーバで並列に実行できるように、予め制御プログラムを分割するためプリコンパイラである。
Hereinafter, embodiments of the present invention will be described with reference to the drawings. In the control
制御プログラム分割装置1は、それ自身を専用の装置で構成しても良いし、ネットワークに接続される何れかのサーバが制御プログラムを実行する前にプリコンパイラとなるように構成しても良い。
The control program dividing
先ず、図1を参照して、制御プログラム分割装置1の構成について説明する。制御プログラム分割装置1の構成は、予め定めるプログラミング言語で生成される前記制御プログラムのソースコードを入力し、当該ソースコードの記号列を読み取る入力処理部10と、入力処理部10で読み取った記号列を入力し、機械可読にした前記プログラミング言語の規則定義を、プログラムLex(非特許文献1参照)を介して与え、ソースコードのトークン列(語彙列)を生成する字句解析処理部11と、を備える。
First, the configuration of the control program dividing
更に、字句解析処理部11で解析したトークン列を入力し、プログラミング言語のトークン列の構文規則定義を、プログラムYacc(非特許文献1参照)を介して与え、前記ソースコードの構文規則定義に一致する前記トークン列から当該ソースコードの信号名と前記現場機器との入力信号、一次変数、及び出力信号の種類を判定して記述した入出力信号テーブル20と、どの出力信号がどの入力信号及び一次変数に依存しているかを判定して記述した依存性テーブル21と、ソースコードの構造を判定して記述した構文木22と、を生成する構文解析処理部12と、を備える。
Further, the token string analyzed by the lexical
更に、入出力信号テーブル20と、依存性テーブル21と、及び構文木22と、に記述された構文規則定義の意味から、出力信号に依存性のある複数の分割されたソースコード毎に分割する分割処理部13と、分割されたソースコードをトークン列として出力する出力処理部14と、を備える。
Further, from the meaning of the syntax rule definition described in the input / output signal table 20, the dependency table 21, and the
ここで、制御プログラムのプログラミング言語は、国際規格IEC61131−3に規定するプログラミング言語、及びこの既存のIEC61131−3を想定して、説明するが、拡張された国際規格IEC61499を含んでも良いし、その他のプログラミング高級言語、FORTRANなどであっても良い。 Here, the programming language of the control program will be described assuming the programming language defined in the international standard IEC61131-3 and this existing IEC61131-3, but may include the expanded international standard IEC61499, and others It may be a high-level programming language such as FORTRAN.
また、ここで言うクラウド制御システムのネットワークは、汎用のインターネットと、このネットワークに接続された複数のサーバ及び現場機器とで構成されるが、現場機器とこのネットワークとは専用のネットワークで接続されるように構成しても良い。 The cloud control system network here is composed of a general-purpose Internet and a plurality of servers and field devices connected to the network. The field devices and this network are connected by a dedicated network. You may comprise as follows.
次に、各部の構成を説明する前に、本実施の形態を説明するための制御プログラムのソースコード30について、図2を参照して説明しておく。
Next, before describing the configuration of each unit, the
図2に示す制御プログラムのソースコード30は、IEC61131−3に基づいた分割前の宣言部と命令部とから成るソースコード30を示す。宣言部は、入出力信号の変数、一次変数、ファンクションPOU1〜POU4を記述し、命令部はその関数POU1〜POU4が記述されている。個々のトークン列の意味は、衆知の内容であるので割愛する。
The
次に、各部の詳細構成について説明する。入力処理部10は、分割前のソースコード30から記述された記号列を読み取り、読み取った記号列を字句解析処理部11に送る。
Next, the detailed configuration of each unit will be described. The
また、字句解析処理部11は、入力処理部10で読み取った記号列を入力し、機械可読にしたプログラミング言語の規則定義を、プログラムLex(非特許文献1参照)を介して与え、ソースコードのトークン列(語彙列)を生成する。
Further, the lexical
ここで、制御プログラムのソースコード30のトークン列とは、プログラミング言語で定義された制御構文を示す単語や信号名、また、ユーザが任意に記述する信号名、信号の型などである。
Here, the token string of the
例えば、図2に示す制御プログラム言語IEC61131−3で記述された制御プログラムのソースコード30の場合では、プログラムの開始を示す「PROGRAM」、プログラム名を示す「POU0」、信号定義の開始を示す「VAR」、信号名を示す「X1」、信号の型を示す「INT」などがプログラムソースコードのトークン列である。
For example, in the case of the
このような字句解析処理部11での処理は、字句解析器生成ツールであるLex、または、Flex等のプログラムを用いて、予め機械可読にした予め設定されるプログラミング言語の構文規則定義を与えることで、入力される記号列に対して字句解析が実行され、トークン列が生成される。
Such processing in the lexical
次に、構文解析処理部12は、字句解析処理部11で解析したトークン列の構文規則定義を予めプログラムYaccを介して与えておき、入力されたトークン列が予め与えられた構文規則定義と照合してどの構文規則と一致するかを判定して、制御プログラムのソースコード30の意味をテーブルや構造図として記述する。
Next, the syntax
例えば、ソースコード30の信号名と現場機器との入力信号、一時変数、及び出力信号の種類を記述した入出力信号テーブル20に記述し、また、どの出力信号がどの入力信号及び一時変数に依存しているかを記述した依存性テーブル21に記述し、ソースコード30の構造は後述する構文木22として記述する。
For example, it is described in the input / output signal table 20 in which the signal name of the
また、図2に示す例では、「PROGRAM〜END_PROGRAM」が1つのソースコード30であること、「VAR〜END_VAR」が信号名の定義を記述する部分であることも与えられた構文規則定義と照合して判定される。
In the example shown in FIG. 2, “PROGRAM to END_PROGRAM” is one
また、同様に、「X1 AT %IW61.1: INT;」は、整数型変数の入力信号X1がメモリアドレス61.1に記憶されることも判定される。 Similarly, “X1 AT% IW61.1: INT;” is also determined that the input signal X1 of the integer variable is stored in the memory address 61.1.
このようなソースコード30のトークン列の判定情報をもとに、入出力信号テーブル20、依存性テーブル21、構文木22が生成される。
Based on such token string determination information of the
生成される入出力信号テーブル20には、図3に示すように、信号名23と入出力信号の種類24が記述されている。
In the generated input / output signal table 20, as shown in FIG. 3, a
ソースコード30中にどの程度の数の入出力信号があるかは、ソースコード30を読み込まないと不明なため、動的にデータの数を追加可能なテーブル構造で入出力信号テーブル20を保持するようにしても良い。
The number of input / output signals in the
また、依存性テーブル21には、図4に示すように、信号名25と入出力信号の種類26と直接依存性27と間接依存性28が記述される。
In the dependency table 21, as shown in FIG. 4, a
この依存性テーブル21は、図2のソースコード30の場合、構文解析処理部12に設定した依存性に関する構文規則定義と照合して、「POU1(X:=X1, Y=>T1);」という行の記述は、POU1という関数はX1を入力とし、T1を出力することが判定できるので、T1はX1に依存していると判定し、この判定が信号名T1の直性依存性27の欄にX1が記述される。
In the case of the
同様に、Y1はT1に依存し、Y2はT2とX2に依存し、T2はX3に依存していると判定し、この判定が直接依存性27として依存性テーブル21に記述される。
Similarly, it is determined that Y1 depends on T1, Y2 depends on T2 and X2, and T2 depends on X3, and this determination is described in the dependency table 21 as a
更に、各信号名に対する直接依存性27から、間接依存性28を生成することが出来る。
Furthermore, an
例えば、Y1はT1に依存し、T1はX1に依存していることから、Y1はX1にも依存していることが、間接依存性28として依存性テーブル21に記述される。したがって、信号名Y1の間接依存性28の欄にはX1が記述される。同様にY2の間接依存性28の欄にはX3が記述される。
For example, since Y1 depends on T1 and T1 depends on X1, it is described in the dependency table 21 as
即ち、依存性は、該当する出力を求めるために直接的に使用されている変数は、直接依存性あり、直接依存性のある変数が、その他の変数により求められる場合には、このその他の変数は間接依存性ありと判定する。 In other words, the dependency is a variable that is directly used to obtain the corresponding output is a direct dependency. If a variable that has a direct dependency is obtained by another variable, this other variable is used. Is determined to have indirect dependency.
このような依存性テーブル21をテーブルに記述しておくことで、出力信号に対する入力信号や一時変数の依存性を短時間で参照することが出来る。
また、構文木22は、プログラム構造に関する構文規則定義と照合して、ソースコード30の構造をグラフィックに記述するものである。構文解析処理部12は、ソースコード30の1行をノードとし、ある行に従属する行をそのノードの下位のノードとする木構造を記述する。
By describing such a dependency table 21 in the table, the dependency of the input signal and the temporary variable on the output signal can be referred to in a short time.
The
例えば、図2に示すソースコード30に対しては、図5に示すような木構造のグラフィックデータを記述する。
For example, for the
このようにソースコード30の構造を木構造でグラフ化することで、出力されるソースコード30のインデントを設定可能とし、視認性が良いソースコード30を出力することが可能となる。
Thus, by graphing the structure of the
次に、分割処理部13は、入出力信号テーブル20と依存性テーブル21と構文木22を読み込み、構文木22の各ノードがどの出力信号に依存しているかをプログラム構造に関する構文規則定義と照合して判定する。
Next, the
例えば、図5の例では、「PROGRAM POU0」や「VAR」というノードは出力信号によらず、プログラムを構成するために必要なノードである。また、「POU1(X:=X1, Y=>T1);」というノードは、依存性テーブル21によると出力信号Y1に依存している。 For example, in the example of FIG. 5, nodes such as “PROGRAM POU0” and “VAR” are nodes necessary for configuring a program regardless of the output signal. Further, according to the dependency table 21, the node “POU1 (X: = X1, Y => T1);” depends on the output signal Y1.
したがって、「POU1(X:=X1, Y=>T1);」はY1を出力するプログラムにのみ必要なノードである。 Therefore, “POU1 (X: = X1, Y => T1);” is a node necessary only for the program that outputs Y1.
同様に、「POU2(X:=T1, Y=>Y1);」というノードも、依存性テーブル21によると出力信号Y1に依存している。 Similarly, the node “POU2 (X: = T1, Y => Y1);” also depends on the output signal Y1 according to the dependency table 21.
したがって、「POU2(X:=T1, Y=>Y1);」はY1を出力するプログラムにのみ必要なノードで、POU1とPOU2とは、同じ依存性であると判定される。 Therefore, “POU2 (X: = T1, Y => Y1);” is a node necessary only for the program that outputs Y1, and it is determined that POU1 and POU2 have the same dependency.
他方、「POU3(X:=T2, X2=X2 Y=>Y2);は、Y=>Y2;」というノードは、依存性テーブル21によると出力信号Y2依存している。 On the other hand, according to the dependency table 21, the node “POU3 (X: = T2, X2 = X2 Y => Y2); is Y => Y2;” depends on the output signal Y2.
したがって、「POU3(X:=T2, Y=>Y2);」というノードは、Y2を出力するプログラムにのみ必要なノードである。 Therefore, the node “POU3 (X: = T2, Y => Y2);” is a node necessary only for the program that outputs Y2.
同様に、「POU4(X:=X3, Y=>T2);」というノードも、依存性テーブル21によると出力信号Y2に依存している。 Similarly, the node “POU4 (X: = X3, Y => T2);” also depends on the output signal Y2 according to the dependency table 21.
したがって、「POU4(X:=X3, Y=>T2);」はY2を出力するプログラムにのみ必要なノードで、POU3とPOU4とは、同じ依存性であると判定される。 Therefore, “POU4 (X: = X3, Y => T2);” is a node necessary only for the program that outputs Y2, and it is determined that POU3 and POU4 have the same dependency.
その結果、図2に示したソースコード30は、図6(a)に示すように、命令部が同じ依存性である分割されたソースコード31と、図6(b)に示すように、命令部が同じ依存性である分割されたソースコード32と、に分割して出力される。
As a result, as shown in FIG. 6A, the
即ち、分割は、出力信号の数分のソースコードに分割する。 That is, in the division, the source code is divided into the number of output signals.
また、出力処理部14は、生成された構文木22を走査し、各出力信号が関係するノードを分割されたソースコード41、42として出力するもので、図7に示すように、依存性テーブル21から信号名を取得する信号名取得部15と、分割されたソースコード41、42を出力するファイル名を設定するファイル名設定部16と、分割されたソースコード41、42をテキストPOU_Y1、POU_Y2として出力するテキスト出力部17を備えても良い。
The
この信号名取得部15とファイル名設定部16を備えることで、出力信号の名前がついた分割されたソースコード41、42のファイルを出力することができ、分割されたソースコード41、42のファイル名からどの出力信号を演算するためのプログラムかを判断することが可能となる。
By providing the signal
また、図8に示すように、出力処理部14は、1〜Nまでの連番を生成する連番生成部18と、出力するファイル名を設定するファイル名設定部16aと、分割されたソースコードをテキストとして出力するテキスト出力部17aとを備える用に構成することも出来る。
As shown in FIG. 8, the
この連番生成部18とファイル名設定部16a、及びテキスト出力部17aを備えることで、連番を付けたファイル51、52を出力することができ、どの程度の数の出力信号があるかをファイル名からのみで判断することが可能となる。
By providing the serial number generation unit 18, the file
また、図9に示すように、制御プログラム分割装置1には、更に、制御プログラムのソースコード30を、分割されたソースコードをオブジェクトプログラムに変換するコンパイラ19を備え、分割された制御プログラム34〜36を出力するように構成することも出来る。
As shown in FIG. 9, the control
この場合にも、同様に、分割された制御プログラム34〜36のファイル名に出力信号名を付加しても良いし、連番を付加しても良い。
Also in this case, similarly, an output signal name may be added to the file names of the divided
本実施の形態によれば、複数の入出力信号を持つ制御プログラムのソースコードを、出力信号に同じ依存性があるソースコード同士に纏めて分割し、並列実行可能な分割された複数の制御プログラムに分割することができる。 According to the present embodiment, the source code of a control program having a plurality of input / output signals is divided into source codes having the same dependency on output signals and divided into a plurality of divided control programs that can be executed in parallel. Can be divided into
したがって、本実施の形態によれば、インターネットを使用したネットワークで構成されるクラウド制御システムにおいて、複数の入出力信号の処理を要求される制御プログラムを、予め出力信号に対する入力信号や一時変数に同じ依存性があるソースコード同士に纏めて分割し、複数のサーバで制御プログラムの実行時間を短縮するようにした制御プログラム分割装置、制御プログラムの分割方法及びその記録媒体を提供することが出来る。 Therefore, according to the present embodiment, in a cloud control system configured by a network using the Internet, a control program required to process a plurality of input / output signals is the same as an input signal or temporary variable for an output signal in advance. It is possible to provide a control program dividing device, a control program dividing method, and a recording medium thereof, which are divided into source codes having dependencies and reduced by a plurality of servers to reduce the execution time of the control program.
本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる。 Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.
1 制御プログラム分割装置
10 入力処理部
11 字句解析処理部
12 構文解析処理部
13 分割処理部
14 出力処理部
15 信号名取得部
16 ファイル名設定部
17 テキスト出力部
18 連番生成部
19 コンパイラ
20 入出力信号テーブル
21 依存性テーブル
22 構文木
23、25 信号名
24、26 入出力
27 直接依存性
28 間接依存性
30 分割前のソースコード
31、32、33 分割後のソースコード
34、35、36 分割後のソースプログラム
DESCRIPTION OF
Claims (13)
予め定めるプログラミング言語で生成される前記制御プログラムのソースコードを入力し、当該ソースコードの記号列を読み取る入力処理部と、
読み取った前記記号列を入力し、機械可読にした前記プログラミング言語の規則定義を、プログラムLexを介して与え、前記ソースコードのトークン列(語彙列)を生成する字句解析処理部と、
前記字句解析処理部で解析したトークン列を入力し、前記プログラミング言語の前記トークン列の構文規則定義を、プログラムYaccを介して与え、前記ソースコードの構文規則定義に一致する前記トークン列から当該ソースコードの信号名と前記現場機器との入力信号、一次変数、及び出力信号の種類を判定して記述した入出力信号テーブルと、どの前記出力信号がどの前記入力信号及び前記一次変数に依存しているかを判定して記述した依存性テーブルと、前記ソースコードの構造を判定して記述した構文木と、を生成する構文解析処理部と、
前記入出力信号テーブルと、前記依存性テーブルと、及び前記構文木と、に記述された前記構文規則定義の意味から、前記出力信号に依存性のある複数の分割された前記ソースコード毎に分割する分割処理部と、
分割された前記ソースコードを前記記号列として出力する出力処理部と、
を備え、
前記制御プログラムの前記ソースコードを、前記出力信号に同じ依存性のあるソースコード同士に纏めて分割することを特徴とする制御プログラム分割装置。 In a cloud control system in which a control program for field devices to be controlled is controlled by a plurality of servers provided in remote locations, the control program is divided as a precompiler that divides the control program into the plurality of servers and executes them in parallel A device,
An input processing unit for inputting a source code of the control program generated in a predetermined programming language and reading a symbol string of the source code;
The lexical analysis processing unit that inputs the read symbol string and gives the rule definition of the programming language made machine-readable via the program Lex, and generates a token string (vocabulary string) of the source code;
The token string analyzed by the lexical analysis processing unit is input, the syntax rule definition of the token string of the programming language is given via the program Yacc, and the source from the token string that matches the syntax rule definition of the source code The input / output signal table describing the signal name of the code and the input signal of the field device, the primary variable, and the output signal, and which output signal depends on which input signal and the primary variable A syntax analysis processing unit for generating a dependency table described by determining whether or not, a syntax tree described by determining the structure of the source code,
Divided for each of a plurality of divided source codes having a dependency on the output signal from the meaning of the syntax rule definition described in the input / output signal table, the dependency table, and the syntax tree. A split processing unit to
An output processing unit for outputting the divided source code as the symbol string;
With
An apparatus for dividing a control program, comprising: dividing the source code of the control program into source codes having the same dependency on the output signal.
予め与えられた前記トークン列の前記構文規則定義に基づいて判定され、前記制御プログラムの全ての前記ソースコードの前記直接依存性から記述される間接的な依存性を示す間接依存性と、
をテーブル化して記述し、
前記出力信号に対する前記入力信号及び前記一次変数の依存性を参照可能となるようにしたことを特徴とする請求項1記載の制御プログラム分割装置。 The dependency table is determined based on the syntax rule definition of the token sequence given in advance, the input signal with respect to the output signal, and the direct dependency of the primary variable;
An indirect dependency which is determined based on the syntax rule definition of the token sequence given in advance and indicates an indirect dependency described from the direct dependency of all the source codes of the control program;
Is described as a table,
2. The control program dividing apparatus according to claim 1, wherein the dependence of the input signal and the primary variable on the output signal can be referred to.
前記ソースコードを木構造で出力できるようにしたことを特徴とする請求項1記載の制御プログラム分割装置。 The syntax tree is determined based on the syntax rule definition of the token sequence given in advance, and describes one line of the source code of the control program as a node, and a line subordinate to a certain line is subordinate to that node. Describe the source code in a tree structure described as a node,
2. The control program dividing apparatus according to claim 1, wherein the source code can be output in a tree structure.
を備え、
分割された前記ソースコードのファイル名からどの前記出力信号を演算するためのプログラムかを知ことが可能となるようにしたことを特徴とする請求項1記載の制御プログラム分割装置。 The output processing unit sets a signal name acquisition unit that acquires the signal name from the dependency table for the plurality of source codes divided by the division processing unit, and sets the file name of the divided source code A file name setting section and a text output section for outputting the file
With
2. The control program dividing device according to claim 1, wherein it is possible to know which output signal is a program for calculating the output signal from the file name of the divided source code.
を備え、
分割された前記ソースコードのファイル名から前記出力信号の数を知ることが可能となるようにしたことを特徴とする請求項1記載の制御プログラム分割装置。 The output processing unit is a file that sets a serial number generation unit that generates a serial number of the plurality of divided source codes divided by the division processing unit, and a file name that sets the file name of the source code given the serial number A name setting part and a text output part for outputting the file,
With
2. The control program dividing apparatus according to claim 1, wherein the number of the output signals can be known from the file name of the divided source code.
前記プリコンパイラとしてのプロセッサは、
予め定めるプログラミング言語で生成される前記制御プログラムのソースコードを入力し、当該ソースコードの記号列を読み取る入力処理ステップと、
読み取った前記記号列を入力し、機械可読にした前記プログラミング言語の規則定義を、プログラムLexを介して与え、前記ソースコードのトークン列(語彙列)を生成する字句解析処理ステップと、
前記字句解析処理部で解析したトークン列を入力し、前記プログラミング言語の前記トークン列の構文規則定義を、プログラムYaccを介して与え、前記ソースコードの構文規則定義に一致する前記トークン列から当該ソースコードの信号名と前記現場機器との入力信号、一次変数、及び出力信号の種類を判定して記述した入出力信号テーブルと、どの前記出力信号がどの前記入力信号及び前記一次変数に依存しているかを判定して記述した依存性テーブルと、前記ソースコードの構造を判定して記述した構文木と、を生成する構文解析処理ステップと、
前記入出力信号テーブルと、前記依存性テーブルと、及び前記構文木と、に記述された前記構文規則定義の意味から、前記出力信号に依存性のある複数の分割された前記ソースコード毎に分割する分割処理ステップと、
分割された前記ソースコードを前記トークン列として出力する出力処理ステップと、
を備え、
前記制御プログラムの前記ソースコードを、前記出力信号に同じ依存性があるソースコード同士に纏めて分割することを特徴とする制御プログラムの分割方法。 In a cloud control system in which a control program for field devices to be controlled is controlled by a plurality of servers provided in remote locations, the control program is divided as a precompiler that divides the control program into the plurality of servers and executes them in parallel A method,
The processor as the precompiler is:
An input processing step of inputting a source code of the control program generated in a predetermined programming language and reading a symbol string of the source code;
The lexical analysis processing step of inputting the read symbol string and providing the machine language readable rule definition of the programming language via the program Lex to generate a token string (vocabulary string) of the source code;
The token string analyzed by the lexical analysis processing unit is input, the syntax rule definition of the token string of the programming language is given via the program Yacc, and the source from the token string that matches the syntax rule definition of the source code The input / output signal table describing the signal name of the code and the input signal of the field device, the primary variable, and the output signal, and which output signal depends on which input signal and the primary variable A syntax analysis processing step for generating a dependency table described by determining whether or not, and a syntax tree described by determining the structure of the source code,
Divided for each of a plurality of divided source codes having a dependency on the output signal from the meaning of the syntax rule definition described in the input / output signal table, the dependency table, and the syntax tree. Split processing steps to
An output processing step of outputting the divided source code as the token string;
With
A method for dividing a control program, comprising: dividing the source code of the control program into source codes having the same dependency on the output signal.
前記出力信号に対する前記入力信号及び前記一次変数の依存性を参照可能となるようにしたことを特徴とする請求項7記載の制御プログラム分割方法。 The generation of the dependency table in the parsing processing step is determined based on the syntax rule definition of the token sequence given in advance, the input signal with respect to the output signal, and the direct dependency of the primary variable; An indirect dependency which is determined based on the syntax rule definition of the token sequence given in advance and indicates an indirect dependency described from the direct dependency of all the source codes of the control program; To describe it,
8. The control program dividing method according to claim 7, wherein the dependence of the input signal and the primary variable on the output signal can be referred to.
前記ソースコードを木構造で出力できるようにしたことを特徴とする請求項7記載の制御プログラム分割方法。 The generation of the syntax tree in the previous parsing step is determined based on the syntax rule definition of the token sequence given in advance, and describes one line of the source code of the control program as a node. The source code is described in a tree structure in which subordinate lines are described as subordinate nodes of the node,
8. The control program dividing method according to claim 7, wherein the source code can be output in a tree structure.
分割された前記ソースコードのファイル名からどの前記出力信号を演算するためのプログラムかを知ことが可能となるようにしたことを特徴とする請求項7記載の制御プログラム分割装置。 The output processing step obtains the signal name from the dependency table for the plurality of source codes divided by the division processing unit, names the file names of the divided source codes, and Output text to file,
8. The control program dividing device according to claim 7, wherein it is possible to know which output signal is a program for calculating the output signal from the file name of the divided source code.
分割された前記ソースコードのファイル名から前記出力信号の数を知ることが可能となるようにしたことを特徴とする請求項7記載の制御プログラム分割方法。 The output processing step generates a serial number of the plurality of divided source codes divided by the division processing unit, sets a file name of the source code given the serial number, and outputs the file And
8. The control program dividing method according to claim 7, wherein the number of output signals can be known from the file name of the divided source code.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013166781A JP6175306B2 (en) | 2013-08-09 | 2013-08-09 | Control program dividing apparatus, control program dividing method and recording medium therefor |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2013166781A JP6175306B2 (en) | 2013-08-09 | 2013-08-09 | Control program dividing apparatus, control program dividing method and recording medium therefor |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2015035174A true JP2015035174A (en) | 2015-02-19 |
| JP6175306B2 JP6175306B2 (en) | 2017-08-02 |
Family
ID=52543630
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2013166781A Active JP6175306B2 (en) | 2013-08-09 | 2013-08-09 | Control program dividing apparatus, control program dividing method and recording medium therefor |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP6175306B2 (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016170707A (en) * | 2015-03-13 | 2016-09-23 | 株式会社東芝 | Control program division apparatus, control program division method, computer program, and division source code production method |
| US11086604B2 (en) | 2017-11-21 | 2021-08-10 | Mitsubishi Electric Corporation | Source code splitting device, source code analyzing device, source code splitting method, and computer readable medium |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5896289A (en) * | 1996-09-05 | 1999-04-20 | Allen-Bradley Company, Llc | Output weighted partitioning method for a control program in a highly distributed control system |
| JP2001325011A (en) * | 2000-05-12 | 2001-11-22 | Omron Corp | Programmable controller system |
| US20110230978A1 (en) * | 2008-11-28 | 2011-09-22 | Siemens Aktiengesellschaft | Automatic Control System and Method for Executing Control Program in Parallel |
-
2013
- 2013-08-09 JP JP2013166781A patent/JP6175306B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5896289A (en) * | 1996-09-05 | 1999-04-20 | Allen-Bradley Company, Llc | Output weighted partitioning method for a control program in a highly distributed control system |
| JP2001325011A (en) * | 2000-05-12 | 2001-11-22 | Omron Corp | Programmable controller system |
| US20110230978A1 (en) * | 2008-11-28 | 2011-09-22 | Siemens Aktiengesellschaft | Automatic Control System and Method for Executing Control Program in Parallel |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2016170707A (en) * | 2015-03-13 | 2016-09-23 | 株式会社東芝 | Control program division apparatus, control program division method, computer program, and division source code production method |
| US11086604B2 (en) | 2017-11-21 | 2021-08-10 | Mitsubishi Electric Corporation | Source code splitting device, source code analyzing device, source code splitting method, and computer readable medium |
Also Published As
| Publication number | Publication date |
|---|---|
| JP6175306B2 (en) | 2017-08-02 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP5197688B2 (en) | Integrated environment generator | |
| US8799299B2 (en) | Schema contracts for data integration | |
| CN110673854B (en) | SAS language compilation method, device, equipment and readable storage medium | |
| US20190361802A1 (en) | Semantic comparison of computer compiler traces | |
| US20130139137A1 (en) | Systems and Methods for Customizing Optimization/Transformation/ Processing Strategies | |
| JP2004295398A (en) | Compiler, compiling method, and program development tool | |
| EP3177990B1 (en) | Method for compiling a source code | |
| JP6175306B2 (en) | Control program dividing apparatus, control program dividing method and recording medium therefor | |
| JP2008276735A (en) | Program code conversion apparatus and program code conversion method | |
| JP6502044B2 (en) | Data analysis device, data analysis method, and program. | |
| US10545741B2 (en) | Information processing apparatus, method of compiling, and storage medium | |
| US20230342117A1 (en) | Program generation apparatus, program generation method and program | |
| JP6111150B2 (en) | Source code analysis apparatus, source code analysis method, and program | |
| WO2020049622A1 (en) | Information processing device, analysis system, analysis method, and non-transitory computer-readable medium having analysis program stored thereon | |
| CN117170684A (en) | File compiling method, device, equipment and storage medium | |
| JP5932707B2 (en) | Computer, program, and data generation method | |
| JP2008165342A (en) | Source code generation method and apparatus, and program | |
| JP2011180814A (en) | Compiler apparatus, compiling method and program | |
| CN113031952A (en) | Method and device for determining execution code of deep learning model and storage medium | |
| US20250348297A1 (en) | Static dataflow analysis for build pipelines | |
| US20160162384A1 (en) | Apparatus and program | |
| JP2004246924A (en) | Application generator development support device and application generator development support method | |
| JP2008176520A (en) | Tag converter | |
| Denis | High-performance regular expression matching with Parabix and LLVM | |
| Almghawish et al. | An automatic parallelizing model for sequential code using Python |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20150218 |
|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20160316 |
|
| RD01 | Notification of change of attorney |
Free format text: JAPANESE INTERMEDIATE CODE: A7421 Effective date: 20160422 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20170214 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170317 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170424 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20170512 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20170523 |
|
| 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: 20170609 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20170710 |
|
| R151 | Written notification of patent or utility model registration |
Ref document number: 6175306 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R151 |