JP2016170707A - Control program division apparatus, control program division method, computer program, and division source code production method - Google Patents

Control program division apparatus, control program division method, computer program, and division source code production method Download PDF

Info

Publication number
JP2016170707A
JP2016170707A JP2015051051A JP2015051051A JP2016170707A JP 2016170707 A JP2016170707 A JP 2016170707A JP 2015051051 A JP2015051051 A JP 2015051051A JP 2015051051 A JP2015051051 A JP 2015051051A JP 2016170707 A JP2016170707 A JP 2016170707A
Authority
JP
Japan
Prior art keywords
source code
control program
control
unit
division
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
Application number
JP2015051051A
Other languages
Japanese (ja)
Other versions
JP6404751B2 (en
Inventor
直哉 大西
Naoya Onishi
直哉 大西
徹 高仲
Toru Takanaka
徹 高仲
優介 渡邉
Yusuke Watanabe
優介 渡邉
中谷 博司
Hiroshi Nakatani
博司 中谷
正臣 吉川
Masaomi Yoshikawa
正臣 吉川
俊也 丸地
Shunya Maruchi
俊也 丸地
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2015051051A priority Critical patent/JP6404751B2/en
Publication of JP2016170707A publication Critical patent/JP2016170707A/en
Application granted granted Critical
Publication of JP6404751B2 publication Critical patent/JP6404751B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Devices For Executing Special Programs (AREA)
  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a control program division apparatus configured to enable parallel processing of a control program, while preventing increase of traffic, a control program division method, a computer program, and a division source code production method.SOLUTION: A control program division device includes a lexical analysis section, a parsing section, a division section, and an execution entity determination section. The lexical analysis section extracts a token from a source code of a control program that generates a plurality of control signals for controlling a device, on the basis of a detection signal including environment information or state information. The parsing section parses the extracted token, to generate syntax information indicating a meaning of the source code. The division section generates a plurality of division source codes for generating the control signals, on the basis of the syntax information and the source code. The execution entity determination section determines an execution entity of the control program, on the basis of dependence of input signals of the control program generated from the division source codes.SELECTED DRAWING: Figure 1

Description

本発明の実施形態は、制御プログラム分割装置、制御プログラム分割方法、コンピュータプログラム及び分割ソースコード生産方法に関する。   Embodiments described herein relate generally to a control program dividing device, a control program dividing method, a computer program, and a divided source code production method.

災害復旧を容易にするため、ネットワークを介して機器を遠隔制御する遠隔制御技術が注目されている。このような遠隔制御をクラウドサーバで実行する形態の遠隔制御システムは、クラウド制御システムと呼ばれる。クラウド制御システムでは、遠隔制御を実現するための制御プログラムが物理的に離れた複数のクラウドサーバに保持される。このようなクラウド制御システムでは、仮に1つの拠点が被災した場合であっても、他の拠点のクラウドサーバに制御プログラムが保持されているため、制御プログラムを消失することがない。そのため、被災時のシステム復旧作業に要する時間を短縮することができる。   In order to facilitate disaster recovery, remote control technology for remotely controlling devices via a network has attracted attention. A remote control system in which such remote control is executed by a cloud server is called a cloud control system. In the cloud control system, control programs for realizing remote control are held in a plurality of cloud servers that are physically separated. In such a cloud control system, even if one base is damaged, the control program is not lost because the control program is held in the cloud server of another base. Therefore, the time required for the system restoration work at the time of a disaster can be shortened.

ところで、遠隔制御システムは、制御対象の機器に関する情報をセンサ等の検知装置を用いて取得する。検知装置は、制御対象の機器に関する事象を計測し、計測値を示す検知信号を遠隔制御システムに送信する。遠隔制御システムは、検知信号を入力情報として、制御対象の機器を制御する制御信号を生成する。生成された制御信号に基づいて、制御対象の機器が動作することによって、機器の遠隔制御が実現される。このような遠隔制御システムをクラウド制御システムとして構成した場合、検知信号及び制御信号の送受信にはインターネットなどの広域ネットワークが用いられる可能性がある。この場合、広域ネットワークにおいて通信遅延が発生した場合、クラウド制御システムは、検知信号に対する制御信号の応答を要求される応答時間内に行うことができず、システムの応答性が低下する可能性がある。   By the way, the remote control system acquires information on the device to be controlled using a detection device such as a sensor. The detection device measures an event related to the device to be controlled and transmits a detection signal indicating the measurement value to the remote control system. The remote control system generates a control signal for controlling a device to be controlled using the detection signal as input information. Based on the generated control signal, the device to be controlled operates to realize remote control of the device. When such a remote control system is configured as a cloud control system, a wide area network such as the Internet may be used for transmission and reception of detection signals and control signals. In this case, when a communication delay occurs in the wide area network, the cloud control system cannot perform the response of the control signal to the detection signal within the required response time, which may reduce the system responsiveness. .

このような背景により、制御プログラムを複数の装置で並列実行することができるように分割するプリコンパイラが求められている。このようなプリコンパイラが実現されれば、クラウド制御システムは、広域ネットワークの状況に応じて制御プログラムを分割することでシステムの応答時間を保証することができる。例えば、検知装置側のネットワークに位置する装置と、広域ネットワーク側に位置するクラウドサーバとに制御プログラムを分割することができる。   With such a background, there is a need for a precompiler that divides a control program so that it can be executed in parallel by a plurality of devices. If such a precompiler is realized, the cloud control system can guarantee the response time of the system by dividing the control program according to the situation of the wide area network. For example, the control program can be divided into a device located on the network on the detection device side and a cloud server located on the wide area network side.

このようなプログラムの分割を行う手法として、従来、一般的なマルチプロセッサ向けのコンパイラにおいて、ループ処理を並列実行可能に分割する手法があった。しかしながら、従来手法では、データ依存性の整合をとるため、分割されたループごとにサーバ間通信を行う必要がある。そのため、分割するプログラムの処理内容や処理量によっては、分割したことによる通信量のオーバーヘッドが大きくなり、必ずしも処理時間の短縮につながらない可能性があった。   As a technique for dividing such a program, there has conventionally been a technique for dividing a loop process so that it can be executed in parallel in a general multiprocessor compiler. However, in the conventional method, it is necessary to perform server-to-server communication for each divided loop in order to achieve data dependency matching. For this reason, depending on the processing contents and processing amount of the program to be divided, the overhead of the communication amount due to the division becomes large, and there is a possibility that the processing time is not necessarily shortened.

特許第3729644号公報Japanese Patent No. 3729644

Lex & Yacc, O’Reilly & Associates (1992) ISBN 1565920007Lex & Yacc, O’Reilly & Associates (1992) ISBN 1565920007

本発明が解決しようとする課題は、通信量の増大を抑制しつつ制御プログラムの並列処理を可能にする制御プログラム分割装置、制御プログラム分割方法、コンピュータプログラム及び分割ソースコード生産方法を提供することである。   The problem to be solved by the present invention is to provide a control program dividing device, a control program dividing method, a computer program, and a divided source code production method that enable parallel processing of control programs while suppressing an increase in communication volume. is there.

実施形態の制御プログラム分割装置は、字句解析部と、構文解析部と、分割部と、実行主体判定部と、を持つ。字句解析部は、制御対象の機器が設置された環境に関する情報を示す環境情報と、前記機器の状態を示す状態情報とのいずれかを含む検知信号に基づいて前記機器を制御するための制御信号を複数生成する制御処理を実現する制御プログラムのソースコードから、前記ソースコードにおいて意味を持つ最小の単位の文字列であるトークンを抽出する。構文解析部は、前記字句解析部によって抽出されたトークンの構文を解析し、前記ソースコードの意味を示す構文情報を生成する。分割部は、前記構文解析部によって生成された構文情報と前記ソースコードとに基づいて、前記制御信号を生成する複数の分割ソースコードを生成する。実行主体判定部は、前記分割ソースコードから生成される制御プログラムが実行された際の入力となる入力信号の依存関係に基づいて、前記制御プログラムの実行主体を判定する。   The control program dividing device of the embodiment includes a lexical analyzer, a syntax analyzer, a divider, and an execution subject determining unit. The lexical analysis unit is a control signal for controlling the device based on a detection signal including either environment information indicating information about an environment in which the device to be controlled is installed and state information indicating the state of the device From the source code of the control program that realizes the control process for generating a plurality of tokens, a token that is a character string of the smallest unit having meaning in the source code is extracted. The syntax analysis unit analyzes the syntax of the token extracted by the lexical analysis unit, and generates syntax information indicating the meaning of the source code. The dividing unit generates a plurality of divided source codes for generating the control signal based on the syntax information generated by the syntax analyzing unit and the source code. The execution subject determination unit determines the execution subject of the control program based on the dependency relationship of the input signals that are input when the control program generated from the divided source code is executed.

第1の実施形態の制御プログラム分割装置1の機能構成を示す機能ブロック図。The functional block diagram which shows the function structure of the control program division | segmentation apparatus 1 of 1st Embodiment. クラウド制御システム10のシステム構成を示すシステム構成図。1 is a system configuration diagram showing a system configuration of a cloud control system 10. FIG. 制御プログラムを分割する処理の流れを示すフローチャート。The flowchart which shows the flow of the process which divides | segments a control program. 分割対象のソースコードの具体例を示す図。The figure which shows the specific example of the source code of a division | segmentation object. アドレス情報テーブル141の具体例を示す図。The figure which shows the specific example of the address information table 141. FIG. 入出力信号テーブル142の具体例を示す図。The figure which shows the specific example of the input-output signal table 142. FIG. 依存性テーブル143の具体例を示す図。The figure which shows the specific example of the dependency table 143. FIG. ツリー情報144の具体例を示す図。The figure which shows the specific example of the tree information 144. FIG. 分割されたソースコードの具体例を示す図。The figure which shows the specific example of the divided | segmented source code. 対応情報テーブル145の具体例を示す図。The figure which shows the specific example of the corresponding | compatible information table 145. FIG. 第2の実施形態の制御プログラム分割装置1aの機能構成を示す機能ブロック図。The functional block diagram which shows the function structure of the control program division | segmentation apparatus 1a of 2nd Embodiment. 変形例の制御プログラム分割装置1bの機能構成を示す機能ブロック図。The functional block diagram which shows the function structure of the control program division | segmentation apparatus 1b of a modification. 変形例の制御プログラム分割装置1cの機能構成を示す機能ブロック図。The functional block diagram which shows the function structure of the control program division | segmentation apparatus 1c of a modification.

以下、実施形態の制御プログラム分割装置、制御プログラム分割方法、コンピュータプログラム及び分割ソースコード生産方法を、図面を参照して説明する。   Hereinafter, a control program dividing device, a control program dividing method, a computer program, and a divided source code production method according to embodiments will be described with reference to the drawings.

(第1の実施形態)
図1は、第1の実施形態の制御プログラム分割装置1の機能構成を示す機能ブロック図である。
制御プログラム分割装置1は、バスで接続されたCPU(Central Processing Unit)やメモリや補助記憶装置などを備え、分割プログラムを実行する。制御プログラム分割装置1は、分割プログラムの実行によって入力部11、字句解析部12、構文解析部13、記憶部14、分割部15及び分割プログラム出力部16を備える装置として機能する。なお、制御プログラム分割装置1の各機能の全て又は一部は、ASIC(Application Specific Integrated Circuit)やPLD(Programmable Logic Device)やFPGA(Field Programmable Gate Array)等のハードウェアを用いて実現されてもよい。分割プログラムは、コンピュータ読み取り可能な記録媒体に記録されてもよい。コンピュータ読み取り可能な記録媒体とは、例えばフレキシブルディスク、光磁気ディスク、ROM、CD−ROM等の可搬媒体、コンピュータシステムに内蔵されるハードディスク等の記憶装置である。分割プログラムは、電気通信回線を介して送信されてもよい。
(First embodiment)
FIG. 1 is a functional block diagram illustrating a functional configuration of the control program dividing device 1 according to the first embodiment.
The control program dividing device 1 includes a CPU (Central Processing Unit), a memory, an auxiliary storage device, and the like connected by a bus, and executes a divided program. The control program dividing device 1 functions as a device including an input unit 11, a lexical analyzer 12, a syntax analyzer 13, a storage unit 14, a dividing unit 15, and a divided program output unit 16 by executing the dividing program. Note that all or a part of each function of the control program dividing device 1 may be realized by using hardware such as an application specific integrated circuit (ASIC), a programmable logic device (PLD), or a field programmable gate array (FPGA). Good. The division program may be recorded on a computer-readable recording medium. The computer-readable recording medium is, for example, a portable medium such as a flexible disk, a magneto-optical disk, a ROM, a CD-ROM, or a storage device such as a hard disk built in the computer system. The division program may be transmitted via a telecommunication line.

入力部11は、分割対象のプログラムのソースコードを自装置に入力する。例えば、入力部11は、LAN等のネットワークに接続するための通信インターフェースを含んで構成され、他の装置からソースコードが記載されたファイルを取得するように構成されてもよい。また、例えば、入力部11は、CD−ROMやフラッシュメモリなどの記録媒体から情報を読み出す装置を含んで構成され、これらの記録媒体からソースコードが記載されたファイルを取得するように構成されてもよい。また、例えば、入力部11は、キーボードやマウスなどの入力装置を含んで構成され、これらの入力装置を用いて入力された文字をソースコードとして取得するように構成されてもよい。入力部11は、取得したソースコードを字句解析部12に出力する。   The input unit 11 inputs the source code of the program to be divided into its own device. For example, the input unit 11 may include a communication interface for connecting to a network such as a LAN, and may be configured to acquire a file in which source code is described from another device. Further, for example, the input unit 11 includes a device that reads information from a recording medium such as a CD-ROM or a flash memory, and is configured to acquire a file in which source code is described from these recording media. Also good. Further, for example, the input unit 11 may be configured to include an input device such as a keyboard and a mouse, and may be configured to acquire characters input using these input devices as source code. The input unit 11 outputs the acquired source code to the lexical analyzer 12.

字句解析部12は、入力部11からソースコードを取得する。字句解析部12は、ソースコードを解析してトークン列を取得する。トークン列とは、ソースコードにおいて意味を持つ最小単位の文字列のことである。このような字句解析を行うプログラムは、一般にレキシカルアナライザ(lexical analyzer)と呼ばれる。非特許文献1に記載のプログラムLexは、プログラミング言語(以下、単純に「言語」という。)のトークンの規則に基づいて、レキシカルアナライザを自動生成するプログラムである。例えば、字句解析部12は、取得したソースコードの言語におけるトークンの規則が定義されたファイルをプログラムLexに入力し、解析対象のソースコードのレキシカルアナライザを生成する。字句解析部12は、取得したソースコードを入力として生成されたレキシカルアナライザを実行することで、ソースコードからトークン列を取得する。字句解析部12は、取得したトークン列を構文解析部13に出力する。   The lexical analysis unit 12 acquires the source code from the input unit 11. The lexical analyzer 12 analyzes the source code and obtains a token string. A token string is a character string of the smallest unit that has meaning in source code. A program that performs such lexical analysis is generally called a lexical analyzer. The program Lex described in Non-Patent Document 1 is a program that automatically generates a lexical analyzer based on a token rule of a programming language (hereinafter simply referred to as “language”). For example, the lexical analyzer 12 inputs a file in which token rules in the acquired source code language are defined to the program Lex, and generates a lexical analyzer of the source code to be analyzed. The lexical analyzer 12 acquires a token string from the source code by executing a lexical analyzer generated using the acquired source code as an input. The lexical analysis unit 12 outputs the acquired token string to the syntax analysis unit 13.

構文解析部13は、字句解析部12から出力されるトークン列に基づいて、ソースコードの構文解析を行う。このような構文解析を行うプログラムは一般にパーサ(Parser)と呼ばれる。非特許文献1に記載のプログラムYaccは、言語の構文規則に基づいて、パーサを自動生成するプログラムである。例えば、構文解析部13は、取得されたソースコードの言語における構文規則が定義されたファイルをプログラムYaccに入力し、解析対象のソースコードのパーサを生成する。構文解析部13は、取得したトークン列を入力として生成されたパーサを実行することで、トークン列の構文解析を行う。   The syntax analysis unit 13 performs source code syntax analysis based on the token string output from the lexical analysis unit 12. A program that performs such parsing is generally called a parser. The program Yacc described in Non-Patent Document 1 is a program that automatically generates a parser based on the syntax rules of the language. For example, the syntax analysis unit 13 inputs a file in which syntax rules in the language of the acquired source code are defined to the program Yacc, and generates a parser for the source code to be analyzed. The syntax analysis unit 13 executes the parser generated by using the acquired token sequence as input, thereby performing syntax analysis of the token sequence.

一般に、ソースコードは、宣言部と命令部とに分類される。宣言部は、取り扱う変数や関数の定義に関する記述であり、命令部は、宣言部で定義された変数や関数を用いた具体的な処理に関する記述である。構文解析部13は、構文解析を行うことにより、このようなソースコードの構成を示す情報を解析結果として取得する。構文解析部13は、取得した解析結果を記憶部14に保存する。   In general, source code is classified into a declaration part and an instruction part. The declaration part is a description related to the definition of variables and functions to be handled, and the instruction part is a description related to specific processing using the variables and functions defined in the declaration part. The syntax analysis unit 13 obtains information indicating the configuration of the source code as an analysis result by performing syntax analysis. The syntax analysis unit 13 stores the acquired analysis result in the storage unit 14.

記憶部14は、磁気ハードディスク装置や半導体記憶装置などの記憶装置を用いて構成される。記憶部14は、構文解析部13によって取得されたソースコードの解析結果(構文情報)を記憶する。   The storage unit 14 is configured using a storage device such as a magnetic hard disk device or a semiconductor storage device. The storage unit 14 stores the analysis result (syntax information) of the source code acquired by the syntax analysis unit 13.

分割部15は、構文解析部13の解析結果に基づいてソースコードを、個々の制御信号を生成するソースコードに分割する。分割部15は、分割したソースコードを分割プログラム出力部16に出力する。   The dividing unit 15 divides the source code into source code for generating individual control signals based on the analysis result of the syntax analysis unit 13. The dividing unit 15 outputs the divided source code to the divided program output unit 16.

分割プログラム出力部16は、分割部15から出力された分割後の各ソースコードを、それぞれ別々のテキストファイルとして出力する。   The division program output unit 16 outputs the divided source codes output from the division unit 15 as separate text files.

以下、実施形態の制御プログラム分割装置1が制御プログラムのソースコードを分割する処理について詳細に説明する。まず、制御プログラムを実行するクラウド制御システムの構成について説明する。   Hereinafter, a process in which the control program dividing device 1 of the embodiment divides the source code of the control program will be described in detail. First, the configuration of a cloud control system that executes a control program will be described.

図2は、クラウド制御システム10のシステム構成を示すシステム構成図である。
クラウド制御システム10は、検知装置20−1〜20−3、被制御装置30−1及び30−2、通信装置40−1及び40−2、サーバ50を備える。通信装置40−1及び40−2は、広域ネットワーク60を介してサーバ50と通信する。
FIG. 2 is a system configuration diagram illustrating a system configuration of the cloud control system 10.
The cloud control system 10 includes detection devices 20-1 to 20-3, controlled devices 30-1 and 30-2, communication devices 40-1 and 40-2, and a server 50. The communication devices 40-1 and 40-2 communicate with the server 50 via the wide area network 60.

検知装置20−1及び20−2は、被制御装置30−1に関する検知信号を取得する。検知装置20−1及び20−2は、取得した検知信号を通信装置40−1に送信する。同様に、検知装置20−3は、被制御装置30−2に関する検知信号を取得する。検知装置20−3は、取得した検知信号を通信装置40−2に送信する。   The detection devices 20-1 and 20-2 acquire a detection signal related to the controlled device 30-1. The detection devices 20-1 and 20-2 transmit the acquired detection signal to the communication device 40-1. Similarly, the detection device 20-3 acquires a detection signal related to the controlled device 30-2. The detection device 20-3 transmits the acquired detection signal to the communication device 40-2.

被制御装置30−1は、通信装置40−1から制御信号を取得する。被制御装置30−1は、取得した制御信号に基づいて自装置を動作させる。同様に、被制御装置30−2は、通信装置40−2から制御信号を取得する。被制御装置30−2は、取得した制御信号に基づいて自装置を動作させる。   The controlled device 30-1 acquires a control signal from the communication device 40-1. The controlled device 30-1 operates its own device based on the acquired control signal. Similarly, the controlled device 30-2 acquires a control signal from the communication device 40-2. The controlled device 30-2 operates its own device based on the acquired control signal.

通信装置40−1は、検知装置20−1及び20−2から検知信号を取得する。通信装置40−1は、取得した検知信号をサーバ50に送信する。また、通信装置40−1は、送信した検知信号に基づいて生成された制御信号をサーバ50から取得する。通信装置40−1は、取得した制御信号を被制御装置30−1に送信する。   The communication device 40-1 acquires detection signals from the detection devices 20-1 and 20-2. The communication device 40-1 transmits the acquired detection signal to the server 50. Further, the communication device 40-1 acquires from the server 50 a control signal generated based on the transmitted detection signal. The communication device 40-1 transmits the acquired control signal to the controlled device 30-1.

同様に、通信装置40−2は、検知装置20−3から検知信号を取得する。通信装置40−2は、取得した検知信号をサーバ50に送信する。また、通信装置40−2は、送信した検知信号に基づいて生成された制御信号をサーバ50から取得する。通信装置40−2は、取得した制御信号を被制御装置30−2に送信する。   Similarly, the communication device 40-2 acquires a detection signal from the detection device 20-3. The communication device 40-2 transmits the acquired detection signal to the server 50. Further, the communication device 40-2 acquires a control signal generated based on the transmitted detection signal from the server 50. The communication device 40-2 transmits the acquired control signal to the controlled device 30-2.

サーバ50は、制御処理を実行可能なクラウドサーバである。制御処理とは、検知信号に基づいて制御信号を生成する処理である。制御処理は、制御プログラムの実行により実現される。サーバ50は、通信装置40−1及び40−2から検知信号を取得する。サーバ50は、取得した検知信号のそれぞれに応じた処理を行って、それぞれの検知信号に応じた制御信号を生成する。サーバ50は、生成した制御信号を対応する通信装置40−1又は40−2に送信する。   The server 50 is a cloud server that can execute control processing. The control process is a process for generating a control signal based on the detection signal. The control process is realized by executing a control program. The server 50 acquires detection signals from the communication devices 40-1 and 40-2. The server 50 performs a process corresponding to each acquired detection signal, and generates a control signal corresponding to each detection signal. The server 50 transmits the generated control signal to the corresponding communication device 40-1 or 40-2.

サーバ50は、制御処理の主たる実行主体であるが、この制御処理は通信装置40−1及び40−2においても実行可能である。通常、通信装置40−1及び40−2は、検知信号をサーバ50に送信し、サーバ50が制御処理を実行する。その一方で、通信装置40−1及び40−2は、必要に応じて自装置で制御処理を実行することによって、システムの応答性の低下を抑制する。この場合、通信装置40−1及び40−2は、サーバ50に検知信号を送信しない。   The server 50 is the main execution subject of the control process, but this control process can also be executed in the communication devices 40-1 and 40-2. Normally, the communication devices 40-1 and 40-2 transmit a detection signal to the server 50, and the server 50 executes a control process. On the other hand, the communication devices 40-1 and 40-2 suppress a decrease in the responsiveness of the system by executing control processing on the own device as necessary. In this case, the communication devices 40-1 and 40-2 do not transmit a detection signal to the server 50.

以下、説明を簡単にするために、特に区別しない限り、検知装置20−1〜20−3を検知装置20と記載する。同様に、被制御装置30−1及び30−2を被制御装置30と記載する。同様に、通信装置40−1及び40−2を通信装置40と記載する。   Hereinafter, for the sake of simplicity, the detection devices 20-1 to 20-3 are referred to as the detection device 20 unless otherwise specified. Similarly, controlled devices 30-1 and 30-2 are referred to as controlled device 30. Similarly, the communication devices 40-1 and 40-2 are referred to as the communication device 40.

このようなクラウド制御システム10において、検知装置20は、対応する被制御装置30について環境情報又は状態情報を取得する。環境情報は、被制御装置30が設置された環境に関する情報であり、例えば、明るさ、温度、人の有無、人の数などを示す情報である。また、状態情報は、被制御装置30の状態に関する情報であり、例えば、スイッチのON又はOFF、電流、電圧、圧力、流量、重量、速度などを示す情報である。検知装置20は、取得したこれらの情報を示す検知信号を通信装置40に送信する。なお、環境情報や状態情報は、被制御装置30の制御に用いることができる情報であれば、他のどのような情報であってもよい。   In such a cloud control system 10, the detection device 20 acquires environmental information or state information for the corresponding controlled device 30. The environment information is information related to the environment where the controlled device 30 is installed, and is information indicating, for example, brightness, temperature, presence / absence of people, the number of people, and the like. The state information is information related to the state of the controlled device 30 and is information indicating, for example, ON or OFF of the switch, current, voltage, pressure, flow rate, weight, speed, and the like. The detection device 20 transmits a detection signal indicating the acquired information to the communication device 40. The environment information and the state information may be any other information as long as it can be used for control of the controlled apparatus 30.

また、クラウド制御システム10の制御対象となる被制御装置30はどのような装置であってもよい。例えば、被制御装置30は、製造工場やプラントを自動制御する機器であってもよい。また、被制御装置30は、住宅や施設等の屋内に設置される機器であってもよいし、道路や公園等の屋外に設置される機器であってもよい。また、被制御装置30は、所定の場所に固定して設置される機器であってもよいし、飛行機や自動車等の移動体に設置される機器であってもよい。このような被制御装置30となり得る機器の具体例として、モータ、バルブ、ポンプ、照明機器、空調機器、信号機などが挙げられる。   Further, the controlled device 30 to be controlled by the cloud control system 10 may be any device. For example, the controlled device 30 may be a device that automatically controls a manufacturing factory or a plant. The controlled device 30 may be a device installed indoors such as a house or a facility, or may be a device installed outdoors such as a road or a park. The controlled device 30 may be a device that is fixedly installed at a predetermined place, or a device that is installed on a moving body such as an airplane or an automobile. Specific examples of devices that can be the controlled device 30 include motors, valves, pumps, lighting devices, air conditioning devices, and traffic lights.

図2の例のクラウド制御システム10の場合、被制御装置30−1の制御信号は、検知装置20−1及び20−2によって取得された検知信号に基づいて生成される。通常、この2つの検知信号に基づく制御処理はサーバ50によって実行されるが、この制御処理を通信装置40−1とサーバ50とに分割して並列処理することができれば、検知信号の入力に対する制御信号の出力に要する応答時間を短縮することができる。このような応答時間の短縮を目的として、実施形態の制御プログラム分割装置1は、以下のような方法で制御プログラムを分割する。   In the case of the cloud control system 10 of the example of FIG. 2, the control signal of the controlled device 30-1 is generated based on the detection signals acquired by the detection devices 20-1 and 20-2. Normally, the control processing based on these two detection signals is executed by the server 50. However, if this control processing can be divided into the communication device 40-1 and the server 50 and processed in parallel, the control for the input of the detection signal is performed. The response time required for signal output can be shortened. For the purpose of shortening the response time, the control program dividing device 1 of the embodiment divides the control program by the following method.

図3は、制御プログラムを分割する処理の流れを示すフローチャートである。
まず、入力部11は、分割する対象の制御プログラムのソースコードを取得する(ステップS101)。入力部11は、取得したソースコードを字句解析部12に出力する。例えば、入力部11は、次の図4に示すソースコードを取得する。
FIG. 3 is a flowchart showing a flow of processing for dividing the control program.
First, the input unit 11 acquires the source code of the control program to be divided (step S101). The input unit 11 outputs the acquired source code to the lexical analyzer 12. For example, the input unit 11 acquires the source code shown in FIG.

図4は、分割対象のソースコードの具体例を示す図である。
図4のソースコード100において、符号110が示す範囲の記述が宣言部であり、符号120が示す範囲の記述が命令部である。さらに宣言部110のうち、符号111が示す範囲には入出力信号の変数が、符号112が示す範囲には一時変数が、符号113が示す範囲には関数名が、それぞれ宣言されている。また、命令部120には、宣言部113に宣言された各関数の入出力が記載されている。図4では、説明を簡単にするために、各関数の詳細な処理の記載を省略している。また、各関数のソースコードはソースコード100と異なるファイルに記載されてもよい。
FIG. 4 is a diagram illustrating a specific example of the source code to be divided.
In the source code 100 of FIG. 4, the description of the range indicated by reference numeral 110 is a declaration part, and the description of the range indicated by reference numeral 120 is an instruction part. Further, in the declaration unit 110, a variable of the input / output signal is declared in the range indicated by reference numeral 111, a temporary variable is declared in the range indicated by reference numeral 112, and a function name is declared in the range indicated by reference numeral 113. The instruction unit 120 describes input / output of each function declared in the declaration unit 113. In FIG. 4, in order to simplify the description, detailed processing of each function is omitted. The source code of each function may be described in a file different from the source code 100.

ソースコード100における、“X1”、“X2”及び“X3”は入力信号、すなわち検知信号を示す変数であり、“Y1”及び“Y2”は出力信号、すなわち制御信号を示す変数である。“T1”及び“T2”は、一時変数である。また、関数“POU1”は検知信号“X1”を入力として一時変数“T1”を出力する関数である。関数“POU2”は一時変数“T1”を入力として制御信号“Y1”を出力する関数である。関数“POU3”は検知信号“X3”を入力として一時変数“T2”を出力する関数である。関数“POU4”は一時変数“T2”及び検知信号“X2”を入力として制御信号“Y2”を出力する関数である。   In the source code 100, “X1”, “X2” and “X3” are variables indicating an input signal, that is, a detection signal, and “Y1” and “Y2” are variables indicating an output signal, that is, a control signal. “T1” and “T2” are temporary variables. The function “POU1” is a function that receives the detection signal “X1” and outputs a temporary variable “T1”. The function “POU2” is a function that receives the temporary variable “T1” and outputs the control signal “Y1”. The function “POU3” is a function that receives the detection signal “X3” and outputs a temporary variable “T2”. The function “POU4” is a function that receives the temporary variable “T2” and the detection signal “X2” and outputs the control signal “Y2”.

図3の説明に戻る。
字句解析部12は、入力部11からソースコードを取得する。字句解析部12は、取得したソースコードの字句解析を行う(ステップS102)。字句解析部12は、字句解析によって取得されたトークン列を構文解析部13に保存する。構文解析部13は、字句解析部12からトークン列を取得する。構文解析部13は、取得したトークン列について構文解析を行う(ステップS103)。構文解析部13は、解析結果を記憶部14に保存する。具体的には、構文解析部13は、解析結果を、アドレス情報テーブル141、入出力信号テーブル142、依存性テーブル143(依存性情報)及びツリー情報144として保存する。
Returning to the description of FIG.
The lexical analysis unit 12 acquires the source code from the input unit 11. The lexical analysis unit 12 performs lexical analysis of the acquired source code (step S102). The lexical analysis unit 12 stores the token string acquired by the lexical analysis in the syntax analysis unit 13. The syntax analysis unit 13 acquires a token string from the lexical analysis unit 12. The syntax analysis unit 13 performs syntax analysis on the acquired token string (step S103). The syntax analysis unit 13 stores the analysis result in the storage unit 14. Specifically, the syntax analysis unit 13 stores the analysis results as an address information table 141, an input / output signal table 142, a dependency table 143 (dependency information), and tree information 144.

図5は、アドレス情報テーブル141の具体例を示す図である。
アドレス情報テーブル141は、変数名ごとにアドレス情報レコードを有する。アドレス情報レコードは、変数名及びアドレス情報の各項目を有する。変数名は、検知信号及び制御信号に対応する変数名を表す。アドレス情報は、変数名が示す変数の値が保持される装置の識別情報である。アドレス情報レコードは、宣言部111の内容に基づいて生成される。宣言部111には、各変数のアドレス情報が記載されている。例えば、変数“X1”の場合、アドレス情報は“%IW60.1”である。アドレス情報は、“.”(以下、「ドット」という。)で区切られ、ドットより前の値は、変数の種別と、変数の値を保持する通信装置40の種別とを表す。ドットより後の値は、1台の通信装置40におけるメモリアドレスを表す。図3の例の場合、“%IW”及び“%QW”が変数の種別を表し、“%IW”は検知信号を、“%QW”は制御信号を示している。また、変数の種別とドットとの間の数値が通信装置40の種別を表し、“60”は通信装置40−1を、“70”は通信装置40−2を示している。構文解析部13は、変数名と通信装置40の種別とに基づいてアドレス情報レコードを生成し、アドレス情報テーブル141に登録する。
FIG. 5 is a diagram showing a specific example of the address information table 141.
The address information table 141 has an address information record for each variable name. The address information record has items of variable name and address information. The variable name represents a variable name corresponding to the detection signal and the control signal. The address information is identification information of a device that holds the value of the variable indicated by the variable name. The address information record is generated based on the contents of the declaration unit 111. In the declaration unit 111, address information of each variable is described. For example, in the case of the variable “X1”, the address information is “% IW60.1”. The address information is delimited by “.” (Hereinafter referred to as “dot”), and the value before the dot represents the type of the variable and the type of the communication device 40 that holds the value of the variable. A value after the dot represents a memory address in one communication device 40. In the case of the example of FIG. 3, “% IW” and “% QW” indicate the types of variables, “% IW” indicates a detection signal, and “% QW” indicates a control signal. The numerical value between the variable type and the dot indicates the type of the communication device 40, “60” indicates the communication device 40-1, and “70” indicates the communication device 40-2. The syntax analysis unit 13 generates an address information record based on the variable name and the type of the communication device 40 and registers it in the address information table 141.

図6は、入出力信号テーブル142の具体例を示す図である。
入出力信号テーブル142は、変数名ごとに入出力信号レコードを有する。入出力信号レコードは、変数名及び信号種別の各項目を有する。変数名は、検知信号、制御信号及び一時変数に対応する変数名を表す。変数名が示す変数に対応する信号の種別を表す。図5でも説明したように、宣言部111には、検知信号及び制御信号に対応する各変数のアドレス情報が定義されている。このアドレス情報により、各変数に対応する信号の種別が識別される。また、宣言部112には、一時変数が定義されている。構文解析部13は、宣言部111及び宣言部112の内容に基づいて入出力信号レコードを生成し、入出力信号テーブル142に登録する。
FIG. 6 is a diagram showing a specific example of the input / output signal table 142.
The input / output signal table 142 has an input / output signal record for each variable name. The input / output signal record has items of variable name and signal type. The variable name represents a variable name corresponding to the detection signal, the control signal, and the temporary variable. Indicates the type of signal corresponding to the variable indicated by the variable name. As described with reference to FIG. 5, the declaration unit 111 defines address information of each variable corresponding to the detection signal and the control signal. The type of signal corresponding to each variable is identified by this address information. In the declaration part 112, a temporary variable is defined. The syntax analysis unit 13 generates an input / output signal record based on the contents of the declaration unit 111 and the declaration unit 112 and registers the input / output signal record in the input / output signal table 142.

図7は、依存性テーブル143の具体例を示す図である。
依存性テーブル143は、変数名ごとに依存性レコードを有する。依存性レコードは、変数名、信号種別、直接依存性、間接依存性及び連携要否の各項目を有する。変数名は、制御信号及び一時変数に対応する変数名を表す。信号種別は、変数名が示す変数に対応する信号の種別を表す。直接依存性は、変数名が示す変数の値を出力する関数に入力される変数を表す。一方、間接依存性は、直接依存性が示す変数を取得するために用いられた変数を表す。直接依存性が示す変数が、複数の関数の入出力を経て取得される場合もあるが、ここでは、説明を簡単にするために、間接依存性が示す変数は、直接依存性が示す変数を出力する関数に入力される変数を表すものと仮定する。連携要否は、変数名が示す変数の取得に、他の装置との連携を必要とするか否かを表す。このような依存性テーブル143を保持することによりで、制御信号に対する検知信号や一時変数の依存性を短時間で参照することが可能となる。
FIG. 7 is a diagram illustrating a specific example of the dependency table 143.
The dependency table 143 has a dependency record for each variable name. The dependency record includes items of variable name, signal type, direct dependency, indirect dependency, and necessity of cooperation. The variable name represents a variable name corresponding to the control signal and the temporary variable. The signal type represents the type of signal corresponding to the variable indicated by the variable name. The direct dependency represents a variable input to a function that outputs the value of the variable indicated by the variable name. On the other hand, indirect dependency represents a variable used to acquire a variable indicated by direct dependency. The variable indicated by the direct dependency may be obtained through input / output of multiple functions, but here, for simplicity of explanation, the variable indicated by the indirect dependency is the variable indicated by the direct dependency. Suppose that it represents a variable that is input to the output function. The necessity of cooperation indicates whether or not cooperation with another apparatus is required for obtaining the variable indicated by the variable name. By holding such a dependency table 143, it is possible to refer to the dependency of the detection signal and the temporary variable on the control signal in a short time.

構文解析部13は、命令部120の内容に基づいて、まず、連携要否の項目以外の値を持つ依存性レコードを生成し、依存性テーブル143に登録する。連携要否の項目は、後段の分割部15によって登録される。   Based on the contents of the command unit 120, the syntax analysis unit 13 first generates a dependency record having a value other than the item of necessity / unnecessity for cooperation and registers it in the dependency table 143. The item of necessity / unnecessity for cooperation is registered by the subsequent division unit 15.

図8は、ツリー情報144の具体例を示す図である。
ツリー情報144は、ソースコードのツリー構造を示す情報である。ソースコードのツリー構造とは、ソースコード内のトークンの従属関係を木構造で表したものである。構文解析部13は、ソースコードにおける各セクションの開始及び終了を示すトークンに基づいて、トークンの木構造を生成する。例えば、図4の例のソースコード100の場合、ソースコードの開始を示すトークンは“PROGRAM POU0”であり、終了を示すトークンは“END_PROGRAM”である。また、宣言部111の開始を示すトークンは“VAR”であり、終了を示すトークンは“END_VAR”である。宣言部112及び113の開始及び終了を表すトークンも同様である。このようなセクションの開始及び終了を表すトークンに基づけば、ソースコード100のツリー構造は図8のように表される。
FIG. 8 is a diagram illustrating a specific example of the tree information 144.
Tree information 144 is information indicating the tree structure of the source code. The tree structure of the source code is a tree structure showing the dependency of tokens in the source code. The syntax analysis unit 13 generates a token tree structure based on tokens indicating the start and end of each section in the source code. For example, in the example of the source code 100 of FIG. 4, the token indicating the start of the source code is “PROGRAM POU0”, and the token indicating the end is “END_PROGRAM”. The token indicating the start of the declaration unit 111 is “VAR”, and the token indicating the end is “END_VAR”. The same applies to tokens representing the start and end of the declaration units 112 and 113. Based on such tokens representing the start and end of the section, the tree structure of the source code 100 is represented as shown in FIG.

図3の説明に戻る。
構文解析部13によるソースコードの構文解析が行われると、分割部15は、構文解析部13の解析結果に基づいて、分割対象のソースコードを個々の制御信号を生成するソースコードに分割する(ステップS104)。具体的には、分割部15は、ツリー情報144を参照し、ツリー構造を構成するトークンから、個々の制御信号の生成に必要なトークンを抽出することで、ソースコードを分割する。このとき、分割部15は、依存性テーブル143を参照し、直接依存性及び間接依存性が示す変数に関するトークンを抽出する。このように、制御信号の生成に必要なトークンを、制御信号ごとに抽出することによって、分割対象のソースコードを個々の制御信号を生成するソースコードに分割することができる。このような分割によって、図4の例のソースコード100は、例えば、次の図9のような2つのソースコードに分割される。
Returning to the description of FIG.
When the syntax analysis of the source code is performed by the syntax analysis unit 13, the dividing unit 15 divides the source code to be divided into source codes for generating individual control signals based on the analysis result of the syntax analyzing unit 13 ( Step S104). Specifically, the dividing unit 15 divides the source code by referring to the tree information 144 and extracting tokens necessary for generating individual control signals from tokens constituting the tree structure. At this time, the dividing unit 15 refers to the dependency table 143 and extracts tokens related to variables indicated by the direct dependency and the indirect dependency. In this way, by extracting the tokens necessary for generating the control signal for each control signal, it is possible to divide the source code to be divided into source codes for generating individual control signals. By such division, the source code 100 in the example of FIG. 4 is divided into, for example, two source codes as shown in FIG.

図9は、分割されたソースコードの具体例を示す図である。
ソースコード100−1及び100−2は、各制御信号の生成に必要となる各変数が、図7の例の依存性テーブル143が示す依存関係を持つ場合において分割されたソースコード100である。ソースコード100−1は、制御信号“Y1”を生成するソースコードである。依存性テーブル143が示す依存関係により、制御信号“Y1”の生成には、関数“POU3”及び“POU4”は不要である。そのため、分割部15は、ツリー情報144が示すツリー構造から、トークン1441及び1442以外のトークンを抽出することによりソースコード100−1を生成する。また、ソースコード100−2は、制御信号“Y2”を生成するソースコードである。依存性テーブル143が示す依存関係により、制御信号“Y2”の生成には、関数“POU1”及び“POU2”は不要である。そのため、分割部15は、ツリー情報144が示すツリー構造から、トークン1443及び1444以外のトークンを抽出することによりソースコード100−2を生成する。
FIG. 9 is a diagram illustrating a specific example of the divided source code.
The source codes 100-1 and 100-2 are the source codes 100 that are divided when each variable necessary for generating each control signal has the dependency indicated by the dependency table 143 in the example of FIG. The source code 100-1 is a source code for generating the control signal “Y1”. Due to the dependency shown by the dependency table 143, the functions “POU3” and “POU4” are not necessary for generating the control signal “Y1”. Therefore, the dividing unit 15 generates the source code 100-1 by extracting tokens other than the tokens 1441 and 1442 from the tree structure indicated by the tree information 144. The source code 100-2 is a source code for generating the control signal “Y2”. Due to the dependency shown by the dependency table 143, the functions “POU1” and “POU2” are not necessary for generating the control signal “Y2”. Therefore, the dividing unit 15 generates the source code 100-2 by extracting tokens other than the tokens 1443 and 1444 from the tree structure indicated by the tree information 144.

図3の説明に戻る。
分割部15(分割部及び実行主体判定部)は、ソースコードを分割した後、分割されたソースコード(以下、「分割ソースコード」という。)に基づいて生成される制御プログラム(以下、「分割プログラム」という。)の実行主体となる装置を決定する(ステップS105)。具体的には、分割部15は、依存性テーブル143の各依存性レコードについて連携要否を判定することで、通信装置40又はサーバ50のいずれかを分割プログラムの実行主体として決定する。分割プログラムの実行主体を決定する処理の詳細は次のとおりである。
Returning to the description of FIG.
The dividing unit 15 (dividing unit and execution subject determining unit) divides the source code and then generates a control program (hereinafter, “divided source code”) based on the divided source code (hereinafter, “divided source code”). A device that is the execution subject of the program is determined (step S105). Specifically, the dividing unit 15 determines either the communication device 40 or the server 50 as an execution subject of the divided program by determining whether or not cooperation is necessary for each dependency record in the dependency table 143. The details of the process for determining the execution subject of the divided program are as follows.

分割部15は、アドレス情報テーブル141及び依存性テーブル143を参照し、各依存性レコードの変数名、直接依存性及び間接依存性が示す変数のアドレス情報を取得する。分割部15は、取得した全てのアドレス情報が同じである場合、その変数名が示す制御信号を生成する処理において、他の装置との連携が“不要”であると判定する。一方、分割部15は、取得したアドレス情報に複数のアドレス情報が含まれる場合、その変数名が示す制御信号を生成する処理において、他の装置との連携が“必要”であると判定する。   The dividing unit 15 refers to the address information table 141 and the dependency table 143, and acquires the variable name of each dependency record, the address information of the variable indicated by the direct dependency and the indirect dependency. When all the acquired address information is the same, the dividing unit 15 determines that the cooperation with other apparatuses is “unnecessary” in the process of generating the control signal indicated by the variable name. On the other hand, when the acquired address information includes a plurality of pieces of address information, the dividing unit 15 determines that the cooperation with other apparatuses is “necessary” in the process of generating the control signal indicated by the variable name.

例えば、図7の例の依存性テーブル143において、制御信号“Y1”の生成は、一時変数“T1”及び検知信号“X1”に依存している。また、変数“T1”は検知信号“X1”に依存している。この場合、図5の例のアドレス情報テーブル141によれば、検知信号“X1”及び制御信号“Y1”のアドレス情報はともに“60”である。そのため、この場合、分割部15は、制御信号“Y1”を生成する制御処理の連携要否を“不要”と判断する。   For example, in the dependency table 143 of the example of FIG. 7, the generation of the control signal “Y1” depends on the temporary variable “T1” and the detection signal “X1”. The variable “T1” depends on the detection signal “X1”. In this case, according to the address information table 141 in the example of FIG. 5, both the address information of the detection signal “X1” and the control signal “Y1” is “60”. Therefore, in this case, the dividing unit 15 determines that the necessity of cooperation of the control process for generating the control signal “Y1” is “unnecessary”.

また、例えば、図7の例の依存性テーブル143において、制御信号“Y2”の生成は、一時変数“T2”、検知信号“X2”及び“X3”に依存している。また、変数“T2”は検知信号“X3”に依存している。この場合、図5の例のアドレス情報テーブル141によれば、検知信号“X2”のアドレス情報は“60”であり、検知信号“X3”及び制御信号“Y2”のアドレス情報はともに“70”である。そのため、この場合、分割部15は、制御信号“Y2”を生成する制御処理の連携要否を“必要”と判断する。
分割部15は、このように判断した連携要否を各依存性レコードに登録する。
Further, for example, in the dependency table 143 in the example of FIG. 7, the generation of the control signal “Y2” depends on the temporary variable “T2” and the detection signals “X2” and “X3”. The variable “T2” depends on the detection signal “X3”. In this case, according to the address information table 141 in the example of FIG. 5, the address information of the detection signal “X2” is “60”, and the address information of the detection signal “X3” and the control signal “Y2” are both “70”. It is. Therefore, in this case, the dividing unit 15 determines that the necessity of cooperation of the control process for generating the control signal “Y2” is “necessary”.
The dividing unit 15 registers the necessity of cooperation determined in this way in each dependency record.

分割部15は、このように判断した連携要否に基づいて分割プログラムの実行主体を決定する。例えば、連携要否が図7の例の依存性テーブル143のように判定された場合、分割部15は、連携が“必要”な分割プログラムの実行主体をサーバ50に決定する。この場合の分割プログラムは、ソースコード100−2に基づいて生成された制御プログラムである。また、分割部15は、連携が“不要”な分割プログラムの実行主体を通信装置40−1に決定する。この場合の分割プログラムは、ソースコード100−1に基づいて生成された制御プログラムである。分割部15は、このように決定された分割プログラムの実行主体と、分割ソースコードとの対応を示す情報(以下、「対応情報」という。)を記憶部14に保存する。例えば、図9の例のようにソースコード100が分割された場合、分割部15は、図10の例のような対応情報テーブル145として対応情報を保存する。このような対応情報を記憶しておくことにより、制御プログラム分割装置1は、制御プログラムを複数の装置で自動的に並列実行させることができる。   The dividing unit 15 determines the execution subject of the divided program based on the necessity of cooperation determined in this way. For example, when the necessity of cooperation is determined as in the dependency table 143 in the example of FIG. 7, the dividing unit 15 determines the execution subject of the divided program “necessary” for cooperation as the server 50. The division program in this case is a control program generated based on the source code 100-2. Further, the dividing unit 15 determines the communication program 40-1 as the execution subject of the divided program whose cooperation is “unnecessary”. The division program in this case is a control program generated based on the source code 100-1. The dividing unit 15 stores information (hereinafter referred to as “corresponding information”) indicating the correspondence between the execution subject of the divided program determined as described above and the divided source code in the storage unit 14. For example, when the source code 100 is divided as in the example of FIG. 9, the dividing unit 15 stores the correspondence information as the correspondence information table 145 as in the example of FIG. By storing such correspondence information, the control program dividing device 1 can automatically execute the control program in parallel by a plurality of devices.

続いて、分割プログラム出力部16は、分割部15によって分割された各分割ソースコードのファイル名を決定し、決定したファイル名で各分割ソースコードをファイル出力する。例えば、分割プログラム出力部16は、分割元のソースコードのプログラム名(図4の例では“POU0”)と、各分割ソースコードにより生成される制御信号の変数名とを組み合わせて、各分割ソースコードのファイル名を決定する。例えば、ソースコード100−1のファイル名を決定する場合、分割プログラム出力部16は、依存性テーブル143を参照し、制御信号の変数名“Y1”を取得する(ステップS106)。分割プログラム出力部16は、分割元のソースコード名“POU0”と制御信号の変数名“Y1”とを組み合わせ、例えば、“POU0_Y1”というファイル名をソースコード100−1のファイル名として決定する(ステップS107)。分割プログラム出力部16は、決定した“POU0_Y1”というファイル名でソースコード100−1をテキスト出力する(ステップS108)。同様に、分割プログラム出力部16は、ソースコード100−2を、“POU0_Y2”というファイル名でテキスト出力する。   Subsequently, the divided program output unit 16 determines the file name of each divided source code divided by the dividing unit 15 and outputs each divided source code as a file with the determined file name. For example, the division program output unit 16 combines the program name of the source code of the division source (“POU0” in the example of FIG. 4) and the variable name of the control signal generated by each division source code. Determine the file name of the code. For example, when determining the file name of the source code 100-1, the divided program output unit 16 refers to the dependency table 143 and acquires the variable name “Y1” of the control signal (step S106). The division program output unit 16 combines the source code name “POU0” of the division source and the variable name “Y1” of the control signal, and determines, for example, the file name “POU0_Y1” as the file name of the source code 100-1 ( Step S107). The divided program output unit 16 outputs the source code 100-1 as text with the determined file name “POU0_Y1” (step S108). Similarly, the division program output unit 16 outputs the source code 100-2 as text with a file name “POU0_Y2”.

分割プログラム出力部16がこのようなファイル出力を行うことにより、分割ソースコードのファイル名から、その分割ソースコードがどの制御信号を生成するソースコードであるかを判断することが可能となる。   When the divided program output unit 16 performs such file output, it is possible to determine from the file name of the divided source code which control signal the divided source code generates.

このように構成された第1の実施形態の制御プログラム分割装置1は、制御処理を、1台の通信装置40で実行可能な制御処理と、複数台の通信装置40とで連携して実行する制御処理とに分類して制御プログラムを分割する。このように制御プログラムを分割すれば、1台の通信装置40で実行可能な制御処理を通信装置40に実行させ、複数台の通信装置40が連携して実行する制御処理をサーバ50に実行させることができる。このような制御プログラムの分割により、クラウド制御システムは、制御処理における通信量の増大を抑制しつつ、制御プログラムを並列処理することが可能となる。   The control program dividing apparatus 1 according to the first embodiment configured as described above executes control processing in cooperation with a control process that can be executed by one communication device 40 and a plurality of communication devices 40. The control program is divided into control processes. If the control program is divided in this way, the communication device 40 executes control processing that can be executed by one communication device 40, and the server 50 executes control processing that is executed in cooperation with a plurality of communication devices 40. be able to. With such a division of the control program, the cloud control system can process the control program in parallel while suppressing an increase in the communication amount in the control process.

以下、第1の実施形態の制御プログラム分割装置1の変形例について説明する。   Hereinafter, modified examples of the control program dividing device 1 of the first embodiment will be described.

制御プログラム分割装置1が備える機能部は、通信装置40及びサーバ50を含む制御処理が実行可能ないずれかの制御装置に実装されてもよい。この場合、これらの機能部は、制御装置が制御プログラムを実行する前に動作するプリコンパイラとして構成されてもよい。   The functional units included in the control program dividing device 1 may be implemented in any control device that can execute control processing, including the communication device 40 and the server 50. In this case, these functional units may be configured as a precompiler that operates before the control device executes the control program.

上記の実施形態では、制御プログラムのプログラミング言語に、国際規格IEC61131−3に準拠するプログラミング言語を想定しているが、制御プログラムのプログラミング言語は、上記の字句解析や構文解析と同等の解析が可能であれば、他のどのようなプログラミング言語であってもよい。例えば、上記規格が拡張された国際規格IEC61499に準拠するものであってもよいし、CやCOBOL、FORTRANなどの高級言語であっても良い。   In the above embodiment, the programming language of the control program is assumed to be a programming language compliant with the international standard IEC61131-3. However, the programming language of the control program can be equivalent to the above lexical analysis and syntax analysis. Any other programming language can be used. For example, it may be based on the international standard IEC61499, which is an extension of the above standard, or may be a high-level language such as C, COBOL, or FORTRAN.

ソースコード内にどの程度の数の入出力信号があるかは、ソースコードの読み込みが完了するまで不明である。そのため、構文解析部13が解析結果を出力する各種テーブルは、動的にレコードを追加することが可能なテーブルであってもよい。   It is unknown how many input / output signals are present in the source code until the reading of the source code is completed. Therefore, the various tables from which the syntax analysis unit 13 outputs the analysis results may be tables that can dynamically add records.

分割部15は、ソースコードを分割する際、ツリー情報144に基づいて、ツリー構造が示す従属関係に対応する位置にトークンが表示されるように、トークンの出力を調整してもよい。例えば、分割部15は、分割ソースコードに、ツリー構造に対応するインデントを設定してもよい。分割部15がインデントを設定した分割ソースコードを出力することにより、ユーザは視認性のよい分割ソースコードを取得することができる。   When dividing the source code, the dividing unit 15 may adjust the output of the token based on the tree information 144 so that the token is displayed at a position corresponding to the dependency indicated by the tree structure. For example, the dividing unit 15 may set an indent corresponding to the tree structure in the divided source code. When the dividing unit 15 outputs the divided source code in which the indent is set, the user can obtain a divided source code with high visibility.

(第2の実施形態)
図11は、第2の実施形態の制御プログラム分割装置1aの機能構成を示す機能ブロック図である。
第2の実施形態の制御プログラム分割装置1aは、コンパイラ17をさらに備える点で、第1の実施形態の制御プログラム分割装置1と異なる。コンパイラ17以外の制御プログラム分割装置1aの各機能部は、制御プログラム分割装置1と同様である。そのため、図11では、コンパイラ17以外の各機能部については、図1と同じ符号を付すことにより説明を省略する。
(Second Embodiment)
FIG. 11 is a functional block diagram showing a functional configuration of the control program dividing device 1a of the second embodiment.
The control program dividing device 1a of the second embodiment is different from the control program dividing device 1 of the first embodiment in that it further includes a compiler 17. Each functional unit of the control program dividing apparatus 1a other than the compiler 17 is the same as that of the control program dividing apparatus 1. Therefore, in FIG. 11, the functional units other than the compiler 17 are denoted by the same reference numerals as those in FIG.

コンパイラ17(コンパイル部)は、ソースコードから実行モジュールを生成するコンパイラである。コンパイラ17は、分割プログラム出力部16から分割ソースコードのファイルを取得する。コンパイラ17は、取得した分割ソースコードをコンパイルし、分割プログラムを生成する。なお、コンパイラ17は、gccやg++、cc、MinGWなどのコンパイラであってもよいし、組み込み機器専用のコンパイラであってもよい。   The compiler 17 (compile unit) is a compiler that generates an execution module from source code. The compiler 17 obtains a divided source code file from the divided program output unit 16. The compiler 17 compiles the obtained divided source code and generates a divided program. The compiler 17 may be a compiler such as gcc, g ++, cc, or MinGW, or may be a dedicated compiler for embedded devices.

以下、第2の実施形態の制御プログラム分割装置1aの変形例について説明する。   Hereinafter, modified examples of the control program dividing device 1a of the second embodiment will be described.

[第1の変形例]
通信装置40とサーバ50とが同じOS(Operating System:オペレーティングシステム)やCPUで動作する場合、制御プログラム分割装置1aは、その環境に対応したコンパイラ17を備えればよいが、通信装置40とサーバ50とが異なるOSやCPUで動作する場合や、複数の通信装置40の間でOSやCPUが異なる場合、それら複数の環境に対応したコンパイラ17が必要になる。このような場合、制御プログラム分割装置1aは、複数の環境に対応するコンパイラ17を備えてもよい。
[First Modification]
When the communication device 40 and the server 50 operate on the same OS (Operating System) or CPU, the control program dividing device 1a may include the compiler 17 corresponding to the environment. When operating with an OS or CPU different from 50, or when the OS or CPU differs between the plurality of communication devices 40, the compiler 17 corresponding to the plurality of environments is required. In such a case, the control program dividing device 1a may include a compiler 17 corresponding to a plurality of environments.

図12は、変形例の制御プログラム分割装置1bの機能構成を示す機能ブロック図である。
変形例の制御プログラム分割装置1bは、環境判別部171及びコンパイラ切り替え部172をさらに備える点で、第2の実施形態の制御プログラム分割装置1aと異なる。
環境判別部171は、通信装置40及びサーバ50からOSの種別やCPUの種別などのシステム環境を示すシステム情報を取得する。環境判別部171は、システム情報に基づいて、制御プログラムを実行主体となる通信装置40又はサーバ50のシステム環境を判別する。環境判別部171は、判別結果をコンパイラ切り替え部172に通知する。
FIG. 12 is a functional block diagram illustrating a functional configuration of a control program dividing device 1b according to a modification.
The control program dividing device 1b of the modification is different from the control program dividing device 1a of the second embodiment in that it further includes an environment determining unit 171 and a compiler switching unit 172.
The environment determination unit 171 acquires system information indicating the system environment such as the type of OS and the type of CPU from the communication device 40 and the server 50. The environment determination unit 171 determines the system environment of the communication device 40 or the server 50 that is the execution subject of the control program based on the system information. The environment determination unit 171 notifies the determination result to the compiler switching unit 172.

コンパイラ切り替え部172(コンパイラ制御部)は、環境判別部171から通知された判別結果に基づいて、コンパイラ17を、制御プログラムの実行主体のシステム環境に対応したコンパイラに変更する。   The compiler switching unit 172 (compiler control unit) changes the compiler 17 to a compiler corresponding to the system environment in which the control program is executed based on the determination result notified from the environment determination unit 171.

[第2の変形例]
一般に、コンパイラには、OSの種別やCPUの種別に応じて実行モジュールを最適化するコンパイラオプションが用意されている。そのため、変形例の制御プログラム分割装置1bは、OSの種別やCPUの種別に応じてコンパイラオプションを切り換えるように構成されてもよい。
[Second Modification]
In general, a compiler has a compiler option for optimizing an execution module according to the type of OS or the type of CPU. Therefore, the modified control program dividing device 1b may be configured to switch the compiler option according to the type of OS or the type of CPU.

図13は、変形例の制御プログラム分割装置1cの機能構成を示す機能ブロック図である。
変形例の制御プログラム分割装置1cは、環境判別部171に代えて環境判別部171cを備える点、コンパイラオプション切り替え部173をさらに備える点で、変形例の制御プログラム分割装置1bと異なる。
環境判別部171cは、システム環境の判別結果を、コンパイラ切り替え部172及びコンパイラオプション切り替え部173に通知する。
FIG. 13 is a functional block diagram illustrating a functional configuration of a control program dividing device 1c according to a modification.
The modified control program dividing apparatus 1c is different from the modified control program dividing apparatus 1b in that an environment determining unit 171c is provided instead of the environment determining unit 171 and a compiler option switching unit 173 is further provided.
The environment determination unit 171c notifies the compiler switching unit 172 and the compiler option switching unit 173 of the determination result of the system environment.

コンパイラオプション切り替え部173(コンパイラ制御部)は、環境判別部171cから通知された判別結果に基づいて、コンパイラ17のコンパイラオプションを、制御プログラムの実行主体のシステム環境に対応したコンパイラオプションに変更する。   The compiler option switching unit 173 (compiler control unit) changes the compiler option of the compiler 17 to a compiler option corresponding to the system environment in which the control program is executed based on the determination result notified from the environment determination unit 171c.

例えば、コンパイラオプション切り替え部173は、システム環境の判別結果に基づいて、CPUの種別を指定するオプションや、浮動小数点レジスタを使用しないオプションを自動的に追加するように構成されてもよい。また、コンパイラオプション切り替え部173は、CPUの種別に応じてエンディアンを切り替えるオプションを追加してもよい。また、コンパイラオプション切り替え部173は、性能が低いCPUに対しては実行速度を優先し、メモリキャッシュの少ないCPUに対してはファイルサイズを優先するように、実行モジュールを最適化するオプションを追加してもよい。なお、上述したコンパイラの切り替えやコンパイラオプションの切り替えは一例を示したものであり、実施形態の校正をここに示す範囲に限定するものではない。このような、コンパイラの切り替えやコンパイラオプションの切り替えは、一般的に使用可能な他のコンパイラやコンパイラオプションの切り替えに適用されてもよい。   For example, the compiler option switching unit 173 may be configured to automatically add an option for designating a CPU type or an option not using a floating-point register based on the determination result of the system environment. Further, the compiler option switching unit 173 may add an option for switching the endian according to the CPU type. In addition, the compiler option switching unit 173 adds an option for optimizing the execution module so that the execution speed is given priority to a CPU with low performance and the file size is given priority to a CPU with a small memory cache. May be. Note that the above-described switching of compilers and switching of compiler options are merely examples, and the calibration of the embodiment is not limited to the range shown here. Such switching of compilers and switching of compiler options may be applied to switching of other generally available compilers and compiler options.

このようなコンパイラの切り替えやコンパイラオプションの切り替えを行うことによって、制御プログラム分割装置1cは、制御プログラムの実行主体となる装置の様々なアーキテクチャに対応した制御プログラムを生成することが可能となる。   By performing such switching of compilers and switching of compiler options, the control program dividing apparatus 1c can generate control programs corresponding to various architectures of the apparatus that is the main execution body of the control program.

以上説明した少なくともひとつの実施形態によれば、制御プログラムのソースコードからトークンを抽出する字句解析部と、抽出されたトークンの構文を解析し、ソースコードの意味を示す構文情報を生成する構文解析部と、構文情報とソースコードとに基づいて、個々の制御信号を生成する複数の分割ソースコードを生成する分割部と、入力信号の依存関係に基づいて、制御プログラムの実行主体を判定する実行主体判定部と、を持つことにより、通信量の増大を抑制しつつ制御プログラムの並列処理を可能にすることができる。   According to at least one embodiment described above, a lexical analyzer that extracts a token from the source code of the control program, and a syntax analyzer that analyzes the syntax of the extracted token and generates syntax information indicating the meaning of the source code A division unit for generating a plurality of divided source codes for generating individual control signals based on the syntax information and the source code, and execution for determining the execution subject of the control program based on the dependency relationship of the input signals By having the subject determination unit, it is possible to enable parallel processing of control programs while suppressing an increase in communication volume.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれると同様に、特許請求の範囲に記載された発明とその均等の範囲に含まれるものである。   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 embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the spirit of the invention. These embodiments and their modifications are included in the scope and gist of the invention, and are also included in the invention described in the claims and the equivalents thereof.

1、1a、1b、1c…制御プログラム分割装置,10…クラウド制御システム,11…入力部,12…字句解析部,13…構文解析部,14…記憶部,141…アドレス情報テーブル,142…入出力信号テーブル,143…依存性テーブル,144…ツリー情報,1441〜1444…トークン,145…対応情報テーブル,15…分割部,16…分割プログラム出力部,17…コンパイラ,171、171c…環境判別部,172…コンパイラ切り替え部,173…コンパイラオプション切り替え部,20、20−1〜20−3…検知装置,30、30−1、30−2…被制御装置,40、40−1、40−2…通信装置,50…サーバ,60…広域ネットワーク,100、100−1、100−2…ソースコード,110、111、112、113…宣言部,120…命令部 DESCRIPTION OF SYMBOLS 1, 1a, 1b, 1c ... Control program division | segmentation apparatus, 10 ... Cloud control system, 11 ... Input part, 12 ... Lexical analysis part, 13 ... Syntax analysis part, 14 ... Memory | storage part, 141 ... Address information table, 142 ... Input Output signal table, 143 ... dependency table, 144 ... tree information, 1441 to 1444 ... token, 145 ... correspondence information table, 15 ... division unit, 16 ... divided program output unit, 17 ... compiler, 171, 171c ... environment discrimination unit , 172 ... Compiler switching unit, 173 ... Compiler option switching unit, 20, 20-1 to 20-3 ... Detection device, 30, 30-1, 30-2 ... Controlled device, 40, 40-1, 40-2 ... communication device, 50 ... server, 60 ... wide area network, 100, 100-1, 100-2 ... source code, 110, 111, 12,113 ... the declaration part, 120 ... command section

Claims (11)

制御対象の機器が設置された環境に関する情報を示す環境情報と、前記機器の状態を示す状態情報とのいずれかを含む検知信号に基づいて前記機器を制御するための制御信号を複数生成する制御処理を実現する制御プログラムのソースコードから、前記ソースコードにおいて意味を持つ最小の単位の文字列であるトークンを抽出する字句解析部と、
前記字句解析部によって抽出されたトークンの構文を解析し、前記ソースコードの意味を示す構文情報を生成する構文解析部と、
前記構文解析部によって生成された構文情報と前記ソースコードとに基づいて、前記制御信号を生成する複数の分割ソースコードを生成する分割部と、
前記分割ソースコードから生成される制御プログラムが実行された際の入力となる入力信号の依存関係に基づいて、前記制御プログラムの実行主体を判定する実行主体判定部と、
を備える制御プログラム分割装置。
Control for generating a plurality of control signals for controlling the device based on a detection signal including any one of environment information indicating information about an environment in which the device to be controlled is installed and state information indicating the state of the device A lexical analyzer that extracts a token, which is a character string of the smallest unit having meaning in the source code, from the source code of a control program that realizes processing;
Analyzing the syntax of the token extracted by the lexical analyzer, and generating syntax information indicating the meaning of the source code;
A dividing unit that generates a plurality of divided source codes that generate the control signal based on the syntax information generated by the syntax analysis unit and the source code;
An execution subject determination unit that determines an execution subject of the control program based on a dependency of an input signal that becomes an input when the control program generated from the divided source code is executed;
A control program dividing device comprising:
前記構文解析部は、前記トークンのツリー構造を示すツリー情報と、前記ソースコードの入力信号と他の信号との依存関係を示す依存性情報と、を含む構文情報を生成し、
前記分割部は、前記依存性情報に基づいて、前記ツリー情報から各制御信号の生成に必要なトークンを抽出することで、前記分割ソースコードを生成する、
請求項1に記載の制御プログラム分割装置。
The syntax analysis unit generates syntax information including tree information indicating a tree structure of the token and dependency information indicating a dependency relationship between an input signal of the source code and another signal;
The dividing unit generates the divided source code by extracting a token necessary for generating each control signal from the tree information based on the dependency information.
The control program dividing device according to claim 1.
前記分割部は、前記分割ソースコードが表示される際、前記分割ソースコードに含まれるトークンが前記ツリー構造に応じた位置に表示されるように前記分割ソースコードを生成する、
請求項2に記載の制御プログラム分割装置。
The division unit generates the divided source code so that a token included in the divided source code is displayed at a position corresponding to the tree structure when the divided source code is displayed.
The control program dividing device according to claim 2.
前記実行主体判定部は、前記分割ソースコードの入力信号の依存関係が1つの装置に閉じた関係である場合、前記装置を前記分割ソースコードの実行主体と判定し、前記分割ソースコードの入力信号の依存関係が複数の装置に関係する場合、前記複数の装置と通信可能な他の装置を前記分割ソースコードの実行主体として判定する、
請求項1から3のいずれか一項に記載の制御プログラム分割装置。
The execution subject determination unit determines that the device is an execution subject of the divided source code when the dependency of the input signal of the divided source code is a relationship closed to one device, and the input signal of the divided source code If the dependency relationship is related to a plurality of devices, another device that can communicate with the plurality of devices is determined as an execution subject of the divided source code.
The control program dividing device according to any one of claims 1 to 3.
前記分割プログラムにより生成される制御信号の識別情報と、分割前の前記ソースコードの識別情報とに基づいて、各分割ソースコードのファイル名を決定し、決定した前記ファイル名で各分割ソースコードをファイル出力する分割プログラム出力部をさらに備える、
請求項1から4のいずれか一項に記載の制御プログラム分割装置。
Based on the identification information of the control signal generated by the division program and the identification information of the source code before the division, the file name of each division source code is determined, and each division source code is determined by the decided file name. A split program output unit for outputting a file;
The control program dividing device according to any one of claims 1 to 4.
前記分割ソースコードをコンパイルし、実行可能な制御プログラムを生成するコンパイル部をさらに備える、
請求項1から5のいずれか一項に記載の制御プログラム分割装置。
A compiling unit that compiles the divided source code and generates an executable control program;
The control program dividing device according to any one of claims 1 to 5.
前記コンパイル部は、制御プログラムの実行主体となる装置のオペレーティングシステム又はCPUの種別に応じた複数のコンパイラを有し、
制御プログラムの実行主体となる装置のオペレーティングシステム又はCPUに関する情報に基づいて、前記コンパイル部が使用するコンパイラを、制御プログラムの実行主体となる装置のオペレーティングシステム又はCPUに応じたコンパイラに切り替えるコンパイラ制御部をさらに備える、
請求項6に記載の制御プログラム分割装置。
The compiling unit has a plurality of compilers according to the type of the operating system or CPU of the device that is the execution subject of the control program,
A compiler control unit that switches a compiler used by the compiling unit to a compiler corresponding to the operating system or CPU of the device that is the execution body of the control program, based on information about the operating system or CPU of the device that is the execution body of the control program Further comprising
The control program dividing device according to claim 6.
前記コンパイラ制御部は、制御プログラムの実行主体となる装置のオペレーティングシステム又はCPUに関する情報に基づいて、前記コンパイル部が使用するコンパイラのコンパイラオプションを、制御プログラムの実行主体となる装置のオペレーティングシステム又はCPUに応じたコンパイラオプションに切り替える、
請求項7に記載の制御プログラム分割装置。
The compiler control unit determines the compiler option of the compiler used by the compiling unit based on the information related to the operating system or CPU of the device that is the execution subject of the control program, and the operating system or CPU of the device that is the execution subject of the control program. Switch to the appropriate compiler option,
The control program dividing device according to claim 7.
制御対象の機器が設置された環境に関する情報を示す環境情報と、前記機器の状態を示す状態情報とのいずれかを含む検知信号に基づいて前記機器を制御するための制御信号を複数生成する制御処理を実現する制御プログラムのソースコードから、前記ソースコードにおいて意味を持つ最小の単位の文字列であるトークンを抽出する字句解析ステップと、
前記字句解析ステップにおいて抽出されたトークンの構文を解析し、前記ソースコードの意味を示す構文情報を生成する構文解析ステップと、
前記構文解析ステップにおいて生成された構文情報と前記ソースコードとに基づいて、前記制御信号を生成する複数の分割ソースコードを生成する分割ステップと、
前記分割ソースコードから生成される制御プログラムが実行された際の入力となる入力信号の依存関係に基づいて、前記制御プログラムの実行主体を判定する実行主体判定ステップと、
を有する制御プログラム分割方法。
Control for generating a plurality of control signals for controlling the device based on a detection signal including any one of environment information indicating information about an environment in which the device to be controlled is installed and state information indicating the state of the device A lexical analysis step for extracting a token, which is a character string of the smallest unit having meaning in the source code, from the source code of a control program that realizes processing;
Analyzing the syntax of the token extracted in the lexical analysis step and generating syntax information indicating the meaning of the source code;
A dividing step of generating a plurality of divided source codes for generating the control signal based on the syntax information generated in the parsing step and the source code;
An execution subject determination step of determining an execution subject of the control program based on a dependency relationship of an input signal that becomes an input when the control program generated from the divided source code is executed;
A control program dividing method comprising:
制御対象の機器が設置された環境に関する情報を示す環境情報と、前記機器の状態を示す状態情報とのいずれかを含む検知信号に基づいて前記機器を制御するための制御信号を複数生成する制御処理を実現する制御プログラムのソースコードから、前記ソースコードにおいて意味を持つ最小の単位の文字列であるトークンを抽出する字句解析ステップと、
前記字句解析ステップにおいて抽出されたトークンの構文を解析し、前記ソースコードの意味を示す構文情報を生成する構文解析ステップと、
前記構文解析ステップにおいて生成された構文情報と前記ソースコードとに基づいて、前記制御信号を生成する複数の分割ソースコードを生成する分割ステップと、
前記分割ソースコードから生成される制御プログラムが実行された際の入力となる入力信号の依存関係に基づいて、前記制御プログラムの実行主体を判定する実行主体判定ステップと、
をコンピュータに実行させるためのコンピュータプログラム。
Control for generating a plurality of control signals for controlling the device based on a detection signal including any one of environment information indicating information about an environment in which the device to be controlled is installed and state information indicating the state of the device A lexical analysis step for extracting a token, which is a character string of the smallest unit having meaning in the source code, from the source code of a control program that realizes processing;
Analyzing the syntax of the token extracted in the lexical analysis step and generating syntax information indicating the meaning of the source code;
A dividing step of generating a plurality of divided source codes for generating the control signal based on the syntax information generated in the parsing step and the source code;
An execution subject determination step of determining an execution subject of the control program based on a dependency relationship of an input signal that becomes an input when the control program generated from the divided source code is executed;
A computer program for causing a computer to execute.
制御対象の機器が設置された環境に関する情報を示す環境情報と、前記機器の状態を示す状態情報とのいずれかを含む検知信号に基づいて前記機器を制御するための制御信号を複数生成する制御処理を実現する制御プログラムのソースコードから、前記ソースコードにおいて意味を持つ最小の単位の文字列であるトークンを抽出する字句解析ステップと、
前記字句解析ステップにおいて抽出されたトークンの構文を解析し、前記ソースコードの意味を示す構文情報を生成する構文解析ステップと、
前記構文解析ステップにおいて生成された構文情報と前記ソースコードとに基づいて、前記制御信号を生成する複数の分割ソースコードを生成する分割ステップと、
を有する分割ソースコードの生産方法。
Control for generating a plurality of control signals for controlling the device based on a detection signal including any one of environment information indicating information about an environment in which the device to be controlled is installed and state information indicating the state of the device A lexical analysis step for extracting a token, which is a character string of the smallest unit having meaning in the source code, from the source code of a control program that realizes processing;
Analyzing the syntax of the token extracted in the lexical analysis step and generating syntax information indicating the meaning of the source code;
A dividing step of generating a plurality of divided source codes for generating the control signal based on the syntax information generated in the parsing step and the source code;
A method for producing divided source code.
JP2015051051A 2015-03-13 2015-03-13 Control program dividing apparatus, control program dividing method, and computer program Active JP6404751B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015051051A JP6404751B2 (en) 2015-03-13 2015-03-13 Control program dividing apparatus, control program dividing method, and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015051051A JP6404751B2 (en) 2015-03-13 2015-03-13 Control program dividing apparatus, control program dividing method, and computer program

Publications (2)

Publication Number Publication Date
JP2016170707A true JP2016170707A (en) 2016-09-23
JP6404751B2 JP6404751B2 (en) 2018-10-17

Family

ID=56983874

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015051051A Active JP6404751B2 (en) 2015-03-13 2015-03-13 Control program dividing apparatus, control program dividing method, and computer program

Country Status (1)

Country Link
JP (1) JP6404751B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6452904B1 (en) * 2017-12-25 2019-01-16 三菱電機株式会社 Design support apparatus, design support method, and program
KR20200086093A (en) * 2019-01-08 2020-07-16 국방과학연구소 Apparatus and method for analyzing source code of concurrent program and computer readible storage medium therefor

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010528361A (en) * 2007-05-22 2010-08-19 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Compiler and compiling method for network control system having a plurality of devices
JP2015035174A (en) * 2013-08-09 2015-02-19 株式会社東芝 Control program division device, control program division method, and recording medium therefor

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2010528361A (en) * 2007-05-22 2010-08-19 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Compiler and compiling method for network control system having a plurality of devices
JP2015035174A (en) * 2013-08-09 2015-02-19 株式会社東芝 Control program division device, control program division method, and recording medium therefor

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
高仲 徹 外2名: "「ネットワークを介したリアルタイム制御システムのための動的負荷平準化手法の開発」", 電気学会研究会資料 通信研究会, vol. CMN-14-001〜007・009〜015, JPN6018004683, 23 January 2014 (2014-01-23), pages 43 - 46 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6452904B1 (en) * 2017-12-25 2019-01-16 三菱電機株式会社 Design support apparatus, design support method, and program
WO2019130396A1 (en) * 2017-12-25 2019-07-04 三菱電機株式会社 Design assistance device, design assistance method and program
KR20200081502A (en) * 2017-12-25 2020-07-07 미쓰비시덴키 가부시키가이샤 Design support devices, design support methods, and programs stored on recording media
CN111512285A (en) * 2017-12-25 2020-08-07 三菱电机株式会社 Design support device, design support method, and program
KR102213046B1 (en) * 2017-12-25 2021-02-05 미쓰비시덴키 가부시키가이샤 Design support device, design support method, and program stored on a recording medium
US10977032B2 (en) 2017-12-25 2021-04-13 Mitsubishi Electric Corporation Assistance device, design assistance method and program
KR20200086093A (en) * 2019-01-08 2020-07-16 국방과학연구소 Apparatus and method for analyzing source code of concurrent program and computer readible storage medium therefor
KR102185294B1 (en) 2019-01-08 2020-12-01 국방과학연구소 Apparatus and method for analyzing source code of concurrent program and computer readible storage medium therefor

Also Published As

Publication number Publication date
JP6404751B2 (en) 2018-10-17

Similar Documents

Publication Publication Date Title
US9916145B2 (en) Utilizing special purpose elements to implement a FSM
JP5763783B2 (en) Method and apparatus for compiling regular expressions
ES2635437T3 (en) Method and system to generate an analyzer and analysis of complex data
JP5857072B2 (en) Expansion of quantifiers to control the order of entry and / or exit of automata
US7739696B2 (en) Message translation systems and methods
US10613844B2 (en) Using comments of a program to provide optimizations
JP2014506693A5 (en)
US11029924B2 (en) Program optimization by converting code portions to directly reference internal data representations
US9477451B1 (en) Generating dynamic measurement metadata for efficient compilation and optimization on a target device
US20160048376A1 (en) Portable binary image format (pbif) for pre-compiled kernels
JP6404751B2 (en) Control program dividing apparatus, control program dividing method, and computer program
CN110457065B (en) Method and apparatus for obtaining applications compatible with multi-version systems
US11036527B2 (en) Class splitting in object-oriented environments
US10169008B2 (en) Information processing device and compilation method
CN112269566B (en) Script generation processing method, device, equipment and system
US10275228B2 (en) Relaxing user-specified register constraints for improving register allocation
KR102117165B1 (en) Method and apparatus for testing intermediate language for binary analysis
US20220269490A1 (en) Feature estimating device, feature estimating method and computer-readable medium
CN107562430B (en) Compiling method for file processing function of mobile pi-calculus language
KR101691600B1 (en) Program Analysis Method Based on Common Structure Transformation and Apparatus Therefor
JP2015035174A (en) Control program division device, control program division method, and recording medium therefor
US10572233B2 (en) Vectorization device, vectorization method, and recording medium on which vectorization program is stored
US20130318509A1 (en) Generating object code from a conjoined assembler directive
US9772825B2 (en) Program structure-based blocking
KR20200061280A (en) Method for Static Analysis based on Data Dependence on Data Plane Towards Network Switch Parallelization, and Parallelization Apparatus using the same

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20170321

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20170911

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20170911

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20180129

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20180213

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20180416

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: 20180814

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20180913

R150 Certificate of patent or registration of utility model

Ref document number: 6404751

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150