JP6175306B2 - 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
- JP6175306B2 JP6175306B2 JP2013166781A JP2013166781A JP6175306B2 JP 6175306 B2 JP6175306 B2 JP 6175306B2 JP 2013166781 A JP2013166781 A JP 2013166781A JP 2013166781 A JP2013166781 A JP 2013166781A JP 6175306 B2 JP6175306 B2 JP 6175306B2
- Authority
- JP
- Japan
- Prior art keywords
- control program
- source code
- divided
- dependency
- output
- 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
- Devices For Executing Special Programs (AREA)
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 syntax rule definition token sequence, provided through the program Yacc, an input signal from the token string as the signal name of the source code and the field device that matches the syntax definition of the source code, a temporary variable, and the output signal table describing to determine the type of output signal, and which the output signal which said input signal and said to determine relies on temporary variables describing dependency table, the source code The syntax rule definition described in the syntax analysis processing unit that generates the syntax tree described by determining the structure of the input / output signal table, the dependency table, and the syntax tree. To 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 codes 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 control program dividing method according to the present embodiment is configured such that when a control program for a field device to be controlled is operated by a plurality of servers provided in remote locations, A control program dividing method that is divided in advance and then executed in parallel, an input processing step of reading a symbol string of a source code of the control program generated in a predetermined programming language input to the server; The lexical analysis processing step of inputting the symbol string and making the machine language readable rule definition of the programming language through the program Lex and generating the token string (vocabulary string) of the source code, and the lexical analysis process enter the token sequence analyzed in step, the syntax rules of the token sequence of the programming language Is determined through the program Yacc, and the type of the signal name of the source code and the input signal, temporary variable, and output signal of the field device are determined from the token string that matches the syntax rule definition of the source code. The input / output signal table described above, the dependency table described by determining which output signal depends on which input signal and the temporary variable, and the syntax described by determining the structure of the source code A syntactic analysis processing step for generating a tree, and the meaning of the syntax rule definition described in the input / output signal table, the dependency table, and the syntax tree. A division processing step for dividing the source code into a plurality of divided source codes, and an output processing step for outputting the divided source code as the token string , Is executed, the source code of the control program, characterized in that to divide together with the source code together with the same dependence on the output signal.
以下、本発明の実施の形態について図面を参照して説明する。本実施の形態に示す制御プログラム分割装置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 input signals of the signal name of the code and the field apparatus, depending on the temporary variable, and the input and output signals table describing to determine the type of output signal, which the which the input signal output signal and the temporary variable A syntax analysis processing unit that generates a dependency table described by determining whether or not a syntax tree described by determining the structure of the source code, and
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 on the basis of the syntax rules defining the pre-assigned the token sequence, the input signal to the output signal, and directly dependent of the temporary variable, the token string given previously And indirect dependency indicating indirect dependency described from the direct dependency of all the source code of the control program in a table,
Control program dividing apparatus according to claim 1, characterized in that as a possible reference the dependence of the input signal and the temporary variable for the output signal.
前記ソースコードを木構造で出力できるようにしたことを特徴とする請求項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 name as text,
Control program dividing apparatus according to claim 1, wherein the or divided the source code file name which the output signal of the program for calculating from the set to be able Ru known.
前記サーバに入力された予め定めるプログラミング言語で生成される前記制御プログラムのソースコードの記号列を読み取る入力処理ステップと、
読み取った前記記号列を入力し、機械可読にした前記プログラミング言語の規則定義を、プログラムLexを介して与え、前記ソースコードのトークン列(語彙列)を生成する字句解析処理ステップと、
前記字句解析処理ステップで解析したトークン列を入力し、前記プログラミング言語の前記トークン列の構文規則定義を、プログラムYaccを介して与え、前記ソースコードの構文規則定義に一致する前記トークン列から当該ソースコードの信号名と前記現場機器との入力信号、一時変数、及び出力信号の種類を判定して記述した入出力信号テーブルと、どの前記出力信号がどの前記入力信号及び前記一時変数に依存しているかを判定して記述した依存性テーブルと、前記ソースコードの構造を判定して記述した構文木と、を生成する構文解析処理ステップと、
前記入出力信号テーブルと、前記依存性テーブルと、及び前記構文木と、に記述された前記構文規則定義の意味から、前記出力信号に依存性のある複数の分割された前記ソースコード毎に分割する分割処理ステップと、
分割された前記ソースコードを前記トークン列として出力する出力処理ステップと、
を実行させ、
前記制御プログラムの前記ソースコードを、前記出力信号に同じ依存性があるソースコード同士に纏めて分割させることを特徴とする制御プログラムの分割方法。 A control program dividing method for dividing the control program into the plurality of servers in advance when the control program for the field device to be controlled is operated on a plurality of servers in a remote place, and executing the control program in parallel.
An input processing step of reading a symbol string of a source code of the control program generated in a predetermined programming language input to the server;
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 sequence analyzed in the lexical analysis processing step is input, and the syntax rule definition of the token sequence of the programming language is given via the program Yacc, and the source from the token sequence that matches the syntax rule definition of the source code Input / output signal table that describes the signal name of the code and the input signal, temporary variable, and output signal of the field device, and which output signal depends on which input signal and temporary 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;
And execute
A method of 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記載の制御プログラム分割方法。 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, and the direct dependency of the input signal and the temporary variable with respect to the output signal; 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 temporary variable on the output signal can be referred to.
前記ソースコードを木構造で出力できるようにしたことを特徴とする請求項7記載の制御プログラム分割方法。 The generation of the syntax tree in the parsing processing 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, depending on a certain line. The source code is described in a tree structure in which a line to be described is described as a lower node 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 acquires the signal name from the dependency table for the plurality of source codes divided in the division processing step , sets a file name of the divided source code, and the file and it outputs the name as text,
Control program dividing method according to claim 7, wherein the or divided the source code file name which the output signal of the program for calculating from the set to be able Ru known.
分割された前記ソースコードのファイル名から前記出力信号の数を知ることが可能となるようにしたことを特徴とする請求項7記載の制御プログラム分割方法。 The output processing step generates a pre-Symbol dividing process sequence number of the plurality of divided split the source code at step sets the file name of the source code attached serial numbers, and the file Output,
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 JP2015035174A (en) | 2015-02-19 |
JP6175306B2 true 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) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP6404751B2 (en) * | 2015-03-13 | 2018-10-17 | 株式会社東芝 | Control program dividing apparatus, control program dividing method, and computer program |
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 |
Family Cites Families (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 |
JP4186383B2 (en) * | 2000-05-12 | 2008-11-26 | オムロン株式会社 | Programmable controller system |
CN102227710A (en) * | 2008-11-28 | 2011-10-26 | 西门子公司 | Automatic control system and method for executing control program in parallel |
-
2013
- 2013-08-09 JP JP2013166781A patent/JP6175306B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2015035174A (en) | 2015-02-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP5197688B2 (en) | Integrated environment generator | |
JP2004295398A (en) | Compiler, method for compiling and program developing tool | |
JP6479184B2 (en) | Computer-executable model reverse engineering method and apparatus | |
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 converter and program code conversion method | |
US10545741B2 (en) | Information processing apparatus, method of compiling, and storage medium | |
JP2008165342A (en) | Source code creating method, device and program | |
JP2007293621A (en) | Document creating device and document creating method | |
JP5275087B2 (en) | Program generating apparatus and block diagram generating apparatus | |
JP5932707B2 (en) | Computer, program, and data generation method | |
JP6502044B2 (en) | Data analysis device, data analysis method, and program. | |
WO2020049622A1 (en) | Information processing device, analysis system, analysis method, and non-transitory computer-readable medium having analysis program stored thereon | |
JP6008456B2 (en) | Apparatus and program | |
JP2011180814A (en) | Compiler apparatus, compiling method and program | |
JP5966801B2 (en) | Language converter, program | |
JP2008176520A (en) | Tag conversion device | |
JPWO2011090032A1 (en) | Parallel processing program generation method, parallel processing program generation program, and parallel processing program generation device | |
US20230342117A1 (en) | Program generation apparatus, program generation method and program | |
JP2009080681A (en) | Program structure parsing method and device | |
Almghawish et al. | An automatic parallelizing model for sequential code using Python | |
JP2004246924A (en) | Application generator development support device and application generator development support method | |
JP4371000B2 (en) | IDL compiling device, IDL compiling method, and IDL compiler | |
KR20170040004A (en) | Apparatus for refactoring synchronization code based on Unified Modeling Language and method thereof | |
CN114595477A (en) | Data encryption method, device and equipment by using special password instruction processor |
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 | Written amendment |
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 | Written amendment |
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 |