Control device and program
The control device and program enhance data storage efficiency by synchronizing with control calculation cycles, parallel processing, and time-series database management, facilitating effective post-event analysis and scalable data integration.
Patent Information
- Application Number
- JP2023072155
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2024-11-08
AI Technical Summary
Existing control devices struggle with inefficient data storage mechanisms, particularly in relation to the execution cycle of control calculations, which hinders effective post-event analysis.
A control device and program that efficiently store data by performing control calculations, including data collection and output, with a processing unit executing cyclically at a specified execution cycle, a database storing data in chronological order, and a data writing mechanism that issues sampling requests without waiting for completion, utilizing parallel processing and time synchronization with field devices.
Enables more efficient data storage and retrieval, allowing for high-time accuracy and scalability in integrating and analyzing time-series data across multiple control devices.
Smart Images

Figure 2024157672000001_ABST
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a control device having a database that stores data in chronological order, and a program for implementing the control device. [Background technology]
[0002] Factory automation (FA) technology using control devices such as programmable controllers (PLCs) is becoming more and more common in various manufacturing sites. There is a need to analyze the data handled by such control devices after the fact.
[0003] In particular, advances in information and communication technology (ICT) are enabling control devices to collect and store large amounts of data.
[0004] Even when a configuration is adopted in which a large amount of data is collected in a database built into the control device as described above, a mechanism is required that makes it easy to carry out post-event analysis and interpretation.
[0005] In this regard, Patent Document 1 discloses a control device capable of storing data in accordance with the execution period of a control calculation. [Prior art documents] [Patent documents]
[0006] [Patent Document 1] JP 2018-151726 A Summary of the Invention [Problem to be solved by the invention]
[0007] On the other hand, in terms of executing data storage in accordance with the execution cycle of control calculations, it is necessary to store data more efficiently.
[0008] The present disclosure is intended to solve the above-mentioned problems, and has an object to provide a control device and a program that enable more efficient data storage. [Means for solving the problem]
[0009] A control device according to an example of the present disclosure includes a processing unit that cyclically executes control calculations at a predetermined execution period, including collection of input data from field devices, calculation of output data based on the input data according to a predetermined user program, and output of the calculated output data, a database that chronologically stores designated data from among the data managed by the processing unit, and data writing means for writing data to the database at the same execution period as the execution period in which the control calculations are cyclically executed. The cyclically executed control calculations include a process of issuing a sampling request to sample designated data from among the data managed by the processing unit. When a sampling request is issued in the control calculations, the next process is executed continuously without waiting for completion of the sampling request. This configuration enables more efficient data storage.
[0010] The data writing means includes a variable reading processing means for receiving a sampling request and sampling the specified data, a quality determination processing means for determining the quality of the sampled data, and a storage processing means for storing the sampled data in the database. With this configuration, it is possible to determine the quality of the data.
[0011] A sampling request is issued at the completion timing of a control operation, and a quality judgment request is issued to request judgment of the quality of the sampled data at the start timing of the control operation. With this configuration, it is possible to judge the quality of the data.
[0012] The quality determination processing means receives at least one of a sampling request and a quality determination request and determines the quality of the sampled data based on whether sampling has been completed. With this configuration, it is possible to determine the quality of the data in a simple manner.
[0013] The control device is configured with a processor having multiple cores. The processing section and the data writing section operate in parallel using different cores. With this configuration, more efficient data storage is possible.
[0014] The control device is connected to field devices that are time-synchronized with each other. Data stored in the database is given time information when the data was collected by the field device. With this configuration, data can be stored more efficiently by adding time information.
[0015] The database stores records of a key-value store type, with time information as the key and the value of the corresponding data and quality information of that data as the value. With this structure, data can be stored more efficiently.
[0016] The apparatus further includes a reproducing means for reproducing the time-series data stored in the database. The reproducing means outputs quality information of the corresponding data stored in the database during reproducing. With this configuration, it is possible to easily check the quality information.
[0017] A program for realizing a control device according to one example of the present disclosure, the program causes a computer to execute a step of cyclically executing a control calculation at a predetermined execution period, the control calculation including collecting input data from a field device, calculating output data based on the input data according to a predetermined user program, and outputting the calculated output data, the computer has a database that stores designated data from among the data managed by the control calculation in chronological order, the program causes the computer to execute a step of writing data to the database at the same period as the execution period in which the control calculation is cyclically executed, the cyclically executed control calculation includes a step of issuing a sampling request to sample the designated data from among the data managed by the control calculation, and when the sampling request is issued in the control calculation, the next process is executed continuously without waiting for the completion of the sampling request. With this configuration, data can be stored more efficiently. Effect of the Invention
[0018] According to the control device and program of the present disclosure, more efficient data storage can be achieved. [Brief description of the drawings]
[0019] [Figure 1] 1 is a schematic diagram showing an example of the overall configuration of a control system 1 according to the present embodiment. [Diagram 2] 1 is a block diagram showing an example of a hardware configuration of a control device 100 constituting a control system 1 according to the present embodiment. [Diagram 3] 2 is a block diagram showing an example of a software configuration of a control device 100 constituting a control system 1 according to the present embodiment. FIG. [Figure 4] 2 is a schematic diagram outlining the data structure of a time-series database 180 implemented in the control device 100 according to the present embodiment. FIG. [Diagram 5] 2 is a schematic diagram for explaining a cyclic execution process and a writing process to a time-series database in the control device 100 according to the present embodiment. FIG. [Figure 6] This is a diagram for explaining the determination of data quality according to an embodiment. [Figure 7] This is a diagram for explaining the storage process of time-series data based on a comparative example. [Figure 8] This is a diagram for explaining the multi-core configuration according to an embodiment. [Figure 9] This is a flowchart for explaining the data quality determination process of a database writing program according to an embodiment. [Figure 10] This is a diagram for explaining the display based on an example of application 210 according to an embodiment.
Embodiments for Carrying Out the Invention
[0020] Embodiments of the present invention will be described in detail with reference to the drawings. For the same or corresponding parts in the drawings, the same reference numerals are given and their descriptions are not repeated.
[0021] <A. Overall Configuration Example of the Control System> First, an overall configuration example of a control system 1 including a control device according to the present embodiment will be described.
[0022] FIG. 1 is a schematic diagram showing an overall configuration example of a control system 1 according to the present embodiment. Referring to FIG. 1, the control system 1 according to the present embodiment includes, as main components, a control device 100 that controls a control target, and a support device 200 connected to the control device 100.
[0023] The control device 100 may be embodied as a kind of computer such as a PLC (Programmable Logic Controller). The control device 100 is connected to a field device group 6 via a first field bus 2 and is connected to one or more display devices 300 via a second field bus 4. The control device 100 exchanges data with the connected devices via their respective buses or networks.
[0024] The control device 100 has a control and calculation function that executes various calculations for controlling manufacturing devices and equipment. In addition to the control and calculation function, the control device 100 has an input / output function that acquires data (hereinafter also referred to as "input data") measured by the field device group 6 and transferred to the control device 100 and various data calculated by the control and calculation function, and a time-series database 180. In the following description, "database" is also written as "DB." The time-series database 180 stores various data acquired by the input / output function in chronological order, as described later.
[0025] It is preferable to adopt a bus or network that performs periodic communication and guarantees data arrival time as the first field bus 2 and the second field bus 4. Known examples of such buses or networks that perform periodic communication include EtherCAT (registered trademark), EtherNet / IP (registered trademark), DeviceNet (registered trademark), and CompoNet (registered trademark).
[0026] The field devices 6 include devices that collect input data from controlled objects or manufacturing devices and production lines related to the control (hereinafter collectively referred to as "field"). Assumed devices for collecting such input data include input relays and various sensors (e.g., analog sensors, temperature sensors, vibration sensors, etc.). The field devices 6 further include devices that perform some kind of action on the field based on commands (hereinafter also referred to as "output data") generated by the control device 100. Assumed devices for performing some kind of action on such a field include output relays, contactors, servo drivers and servo motors, and any other actuators.
[0027] In this way, the control and calculation function of the control device 100 acquires input data from a controlled object, and executes control calculations based on the acquired input data to determine output data for the controlled object.
[0028] The field device group 6 exchanges data including input data and output data with the control device 100 via the first field bus 2. In the configuration example shown in Fig. 1, the field device group 6 includes a remote I / O (Input / Output) device 12, a relay group 14, an image sensor 18, a camera 20, a servo driver 22, and a servo motor 24. The field device group 6 is not limited to these, and any device that can collect input data or perform some action based on output data may be used.
[0029] The remote I / O device 12 includes a communication unit that communicates via the first field bus 2, and an input / output unit (hereinafter also referred to as an "I / O unit") for acquiring input data and outputting output data. Input data and output data are exchanged between the control device 100 and the field via such an I / O unit. Fig. 1 shows an example in which digital signals are exchanged as input data and output data via a relay group 14.
[0030] The I / O unit may be directly connected to the field bus or field network. In FIG. 1, an example in which the I / O unit 16 is directly connected to the first field bus 2 is shown.
[0031] The image sensor 18 performs image measurement processing such as pattern matching on the image data captured by the camera 20, and outputs the processing results to the control device 100.
[0032] The servo driver 22 drives the servo motor 24 in accordance with output data from the control device 100 (for example, a position command, a speed command, etc.).
[0033] As described above, data will be exchanged between the control device 100 and the field device group 6 via the first field bus 2, and the data to be exchanged will be updated at a very short cycle of the order of several hundred μsec to several tens of msec. Note that the update process of such exchanged data is sometimes referred to as "I / O refresh process".
[0034] Also, the display device 300 connected to the control device 100 via the second field bus 4 receives an operation from the user, outputs a command corresponding to the user operation to the control device 100, and graphically displays the calculation result etc. in the control device 100.
[0035] The support device 200 is a device that supports the preparations necessary for the control device 100 to control the controlled object. Specifically, the support device 200 provides a development environment (program creation / editing tools, parser, compiler, etc.) for the program executed in the control device 100, a setting environment for setting parameters (configurations) of the control device 100 and various devices connected to the control device 100, a function of outputting the generated user program to the control device 100, a function of online correcting / modifying the user program etc. executed on the control device 100, and so on.
[0036] The control device 100 further has a gateway function of outputting the data acquired by the input / output function and / or the data stored in the time series database 180 to an external device.
[0037] As an external device, FIG. 1 shows, as a typical example, a host system 400 such as a manufacturing execution system connected to the control device 100 via the host / controller communication network 8. The manufacturing execution system acquires information from manufacturing devices and facilities to be controlled, monitors and manages the entire production, and can also handle order information, quality information, shipping information, etc.
[0038] <B. Hardware Configuration Example of Control Device> Next, a hardware configuration example of the control device 100 constituting the control system 1 according to the present embodiment will be described.
[0039] 2 is a block diagram showing an example of a hardware configuration of the control device 100 constituting the control system 1 according to the present embodiment. Referring to Fig. 2, the control device 100 includes a calculation processing unit and one or more I / O units 124-1, 124-2, ....
[0040] The control device 100 includes a processor 102, a chipset 104, a main memory device 106, a secondary memory device 108, a network controller 110, a Universal Serial Bus (USB) controller 112, a memory card interface 114, a local bus controller 122, and field bus controllers 118 and 120.
[0041] The processor 102 is composed of a CPU (Central Processing Unit) and an MPU (Micro-Processing Unit), and realizes control according to the control target and various processes described below by reading various programs stored in the secondary storage device 108, and expanding and executing them in the main storage device 106. The chipset 104 realizes the processing of the control device 100 as a whole by controlling the processor 102 and each device.
[0042] In addition to system programs for implementing basic functions, user programs created according to the manufacturing devices and facilities to be controlled are stored in the secondary storage device 108. Furthermore, a time-series database 180, which will be described later, is configured using the secondary storage device 108 and the like.
[0043] The network controller 110 exchanges data with the host system 400 (see FIG. 1) and the like via the host / controller communication network 8. The USB controller 112 controls the exchange of data with the support device 200 via a USB connection.
[0044] The memory card interface 114 is configured to be detachable from the memory card 116, and is capable of writing data to the memory card 116 and reading various data from the memory card 116. It is also possible to configure a time series database 180 as described later using the memory card 116.
[0045] The local bus controller 122 is an interface for exchanging data with the I / O units 124-1, 124-2,... mounted on the control device 100.
[0046] The field bus controller 118 controls the exchange of data with the field device group 6 etc. via the first field bus 2. Similarly, the field bus controller 120 exchanges data with the display device 300 etc. via the second field bus 4.
[0047] FIG. 2 shows a configuration example in which functions necessary for the processor 102 to execute a program are provided. However, some or all of these provided functions may be implemented using a dedicated hardware circuit (for example, an ASIC (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array), etc.). Alternatively, the main part of the control device 100 may be realized using hardware that follows a general-purpose architecture (for example, an industrial personal computer based on a general-purpose personal computer). In this case, virtualization technology may be used to execute a plurality of OSs (Operating System) with different uses in parallel and to execute necessary applications on each OS.
[0048] <C. Software Configuration Example of Control Device> Next, a software configuration example of the control device 100 that constitutes the control system 1 according to the present embodiment will be described.
[0049] 3 is a block diagram showing an example of a software configuration of the control device 100 constituting the control system 1 according to the present embodiment. Referring to FIG. 3, the control device 100 includes a PLC engine 150, an input / output processing unit 170, and a time-series database 180.
[0050] The PLC engine 150 typically corresponds to a processing unit capable of executing various programs in an execution environment provided by the processor 102 of the control device 100 executing a system program. More specifically, the PLC engine 150 includes a control program 152, a system program 160, and a time management unit 168.
[0051] The control program 152 is a program for providing various applications according to the control target, and typically includes a user program 154, a database writing program 156, and a serialized communication program 158.
[0052] The user program 154 corresponds to a main part that provides a control and calculation function, and can be arbitrarily configured according to the manufacturing device or facility to be controlled by the control device 100. The user program 154 can be defined by ladder logic using function blocks or the like. In the example shown in Fig. 3, the user program 154 includes a sequence calculation 1541 and a motion calculation 1542. The motion calculation 1542 generates an output value to the actuator by referring to input data from sensors, actuators, etc., and instructions included in the user program 154.
[0053] In this way, the user program 154 refers to state values in the control device 100 including observed values updated by the input program 164, and updates the state values in the control device 100 as outputs. The updated state values may be referred to by other functions executed in the control device 100, such as the output program 166 and the database writing program 156. In general, the user program 154 is created by a user of the control device 100 (such as a device developer) using a programming tool.
[0054] The database writing program 156 is called by an instruction defined in the user program 154, and writes specified data to the time-series database 180 via the input / output processor 170. The database writing program 156 may be executed as a high-priority program.
[0055] More specifically, the database writing program 156 collects data and requests that the data be stored in the time series database 180. The database writing program 156 can be executed in synchronization with the user program 154. The database writing program 156 can add time information to the data that is synchronized between devices by the time management unit 168. A specific example of the time information may be the time when the sensor that is the input source of the data inputs the data. The database writing program 156 can additionally have various processes such as processing the collected data such as unit conversion, and deriving some information from multiple data. The database writing program 156 can request that the data to be processed be stored in the time series database 180 in the same way as the collected data. The database writing program 156 can be created with the same tool as the user program 154. Alternatively, it may be created as a part of the user program 154. The database writing program 156 may be created independently of the user program 154 using another tool.
[0056] The serialized communication program 158 performs serialization processing on data written from the database writing program 156 to the time-series database 180. More specifically, the serialized communication program 158 executes processing (serialization) to convert time-series data into a byte string that can be stored. The serialized communication program 158 converts a group of data that the database writing program 156 has requested to be stored in the time-series database 180 into a format suitable for storing in and referencing the database. Depending on the speed at which data is written to the time-series database 180 and the data volume, it is not necessarily necessary to perform serialization processing. In other words, the serialized communication program 158 is an optional configuration.
[0057] The system programs 160 include a scheduler program 162 , an input program 164 , and an output program 166 .
[0058] The scheduler program 162 schedules each program executed by the control device 100 based on the execution conditions. That is, the scheduler program 162 manages the execution order and execution timing of one or more tasks or processes constituting the control program 152. The input program 164 provides a function of acquiring input data (e.g., sensor observation values and equipment status values) from various devices (field device group 6) connected to the control device 100 via a local bus or a field bus. The output program 166 outputs a command value (output data) calculated by the user program 154 executed in the control device 100 to a target device (field device group 6) connected via a local bus or a field bus.
[0059] The time management unit 168 is a subject that manages the synchronization timing in the control device 100, and is realized, for example, by using a counter or timer that counts up / down at a predetermined cycle. The time management unit 168 may have a function for synchronizing with another counter or timer, and in this case, it can synchronize with a counter or timer on a device on a local bus, a field bus, or a field network. The time management unit 168 shares time with high precision (for example, on the order of microseconds) not only with devices on the local bus, the field bus, or the field network, but also with other network-connected devices. This time becomes a reference for the execution timing of input / output of sensors / actuators and the program execution timing in the control device 100.
[0060] The input / output processor 170 processes a data write request from the PLC engine 150 to the time-series database 180. The input / output processor 170 accepts and accumulates data write requests from the database write program 156 to the time-series database 180, and sequentially stores the data in the time-series database 180. The input / output processor 170 operates without affecting the processing in the control cycle executed by the system program 160 and the control program 152.
[0061] As an example of the control cycle, the database writing program 156 may be executed for each control cycle, and the time-series data may be sequentially stored in the time-series database 180. Furthermore, data can be flexibly supplied to other databases or applications, or input can be received from applications other than the control program. The detailed processing of the input / output processing unit 170 will be described later.
[0062] The time series database 180 is typically placed in the main storage device 106 or the secondary storage device 108 (see FIG. 2) and stores time series data. The time series database 180 stores the time series data written by the database writing program 156.
[0063] More specifically, the time-series database 180 includes a data storage processing unit 184 , an internal storage 188 , and an external storage 189 .
[0064] The data storage processing unit 184 adds the input time series data to a specified record in the internal storage 188 or the external storage 189 in accordance with a data write request to the database via the input / output processing unit 170. The data storage processing unit 184 can also use multiple storages as storage destinations for time series data. The data storage processing unit 184 can also set a ring operation that keeps the data amount (storage usage) of the database below a certain level by deleting old data. The data storage processing unit 184 can also write to the database in a way that does not damage the database when the power to the control device 100 is cut off.
[0065] The built-in storage 188 is a data storage unit that uses the secondary storage device 108 (FIG. 2) built into the control device 100. The built-in storage 188 may include a non-volatile memory such as a flash memory in addition to a volatile memory such as a DRAM (Dynamic Random Access Memory) or an SRAM (Statistic Random Access Memory). The external storage 189 is a non-volatile data storage unit that uses the memory card 116 (FIG. 2) or an external hard disk (not shown).
[0066] In the support device 200 connected to the control device 100, any application 210 may also be executed. As an example of the application 210, a program that uses the time-series data stored in the time-series database 180 is assumed. For example, it is assumed that so-called data mining is performed to analyze the time-series data stored in the time-series database 180 of the control device 100 and find some trends or feature quantities associated with the trends. Alternatively, applications that perform various statistical processes on the time-series data stored in the time-series database 180, or applications that display the numerical values of the time-series data stored in the time-series database 180 or display graphs or the like that visually show them are also assumed.
[0067] <D. Time-Series Database> Next, the data structure of the time-series database 180 implemented in the control device 100 according to the present embodiment will be described.
[0068] FIG. 4 is a schematic diagram outlining the data structure of the time-series database 180 implemented in the control device 100 according to the present embodiment. Referring to FIG. 4(A), the concept of the time-series data handled by the time-series database 180 is also referred to as "TimeSeries". One time series may be composed of databases at multiple levels.
[0069] The time-series database 180 can generate a plurality of time series. For example, time series may be generated for each application. Each database file may have unique attributes such as a version.
[0070] The time-series database 180 stores a data group. The data group may store time-series data in units of records, which are the minimum units of data. Each record may adopt a Key-Value store type. When a record of the Key-Value store type is adopted, the data to be stored (Value) and a unique identifier (Key) corresponding to the data are stored in association with each other. That is, each record includes a Key and a Value of the Key-Value store type.
[0071] More specifically, each record may store a time-series Key indicating an identifier of time-series data and a time-series Value indicating a value of the time-series data.
[0072] Referring to FIG. 4(B), the time-series Key may store, for example, time information (Timestamp) or information (counter) indicating timing. The time-series Value may store the values (actual values) of corresponding input data, output data, and calculation data. In this example, as an example, an ID indicating a data quality flag, an ID indicating a variable flag, variable data, etc. are shown as being stored. The quality flag, which is the quality result of the data quality determination process described later, will be described later.
[0073] <E. Storage Process of Time-Series Data> Next, the storage process of time-series data in the control device 100 according to the present embodiment will be described. In the control device 100, the I / O refresh process is repeatedly executed at a predetermined cycle. At the same cycle as this I / O refresh process, at least a part of the user program 154 is executed. In the present embodiment, the writing of time-series data to the time-series database 180 is executed by a database writing program 156, and the database writing program 156 is called from the user program 154.
[0074] In the control device 100 of this embodiment, the on-the-fly input / output processing provided by the input / output processing unit 170 enables writing of time series data to the time series database 180 without interfering with repeated execution (cyclic execution) of a series of programs including I / O refresh processing.
[0075] The time series database 180 may be configured to store and search multiple independent pieces of time series data. Depending on the size of the time series database 180, one or multiple storages may be used. Furthermore, in addition to the function of storing continuous and steady time series data in the time series database 180, a ring function may be added to suppress the amount of storage usage to a certain amount by discarding past time series data.
[0076] Fig. 5 is a schematic diagram for explaining the cyclic execution process and the write process to the time series database in the control device 100 according to this embodiment. Fig. 5 shows, as an example, an example in which an output program 166, an input program 164, and a user program 154 are cyclically executed. The execution period (the interval between execution start timings) of the cyclic execution shown in Fig. 5 is sometimes referred to as a "control cycle."
[0077] A database writing program 156 called from the user program 154 is executed. The database writing program 156 includes a variable reading process 1562, a data quality judgment process 1564, and a database storage process 1566.
[0078] As shown in FIG. 5, the control calculations that are cyclically executed at a predetermined execution period include collection of input data from field devices (input program 164), calculation of output data based on the input data in accordance with a predetermined user program 154, and output of the calculated output data (output program 166).
[0079] 5, when the user program 154 calls the database writing program 156, the database writing program 156 is executed in synchronization with the control cycle. At that time, the user program 154 requests the database writing program 156 to execute a sampling process (sampling request). That is, the cyclically executed control calculation includes a process of issuing a sampling request to the database writing program 156. When the user program 154 issues a sampling request to the database writing program 156, the user program 154 is cyclically executed as the next process without waiting for the completion of the database writing program 156.
[0080] In the control device 100 according to this embodiment, the control program 152 can behave in a manner that does not wait for the database writing program 156 to be completed.
[0081] As described above, from the viewpoint of the user program 154, after issuing a sampling request, the user program is processed so as not to wait for the completion of the database writing program 156. The database writing program 156 is processed in the background asynchronously with the control calculations executed in the control cycle. By executing the program in the background asynchronously in this manner, the impact on the control cycle can be reduced.
[0082] Such cyclic execution is managed by the scheduler program 162 . That is, in the user program 154, the processing can be completed as long as a sampling request is issued, and it is possible to guarantee that the cyclic execution shown in Fig. 5 is executed in a predetermined control cycle. That is, when the database writing program 156 is executed in synchronization with a control cycle, it is possible to accept a new sampling request even if the sampling processing issued in the previous control cycle is not completed.
[0083] Note that FIG. 5 only shows one example of cyclic execution, and the programs to be executed are not limited to those shown in FIG. 5. Another program may be cyclically executed, or some of the programs shown in FIG. 5 may be omitted.
[0084] The variable reading process 1562 aggregates data that has been specified in advance by a sampling process, from among the input values acquired by the input program 164, the internal state values indicating the internal state of the control program 152 or the control device 100, and the output values output by the output program 166.
[0085] The data quality determination process 1564 is a process for determining the quality of the aggregated data, the details of which will be described later.
[0086] The database storage process 1566 issues a data write request to the time-series database 180. The data write request is provided to the input / output processor 170.
[0087] The time-series database 180 stores, in time series, specified data among the data managed by the PLC engine 150 (processing unit). The input / output processing unit 170 processes a data write request from the database writing program 156 on the fly. Therefore, the database writing program 156 does not need to wait for the input / output processing unit 170 to complete storing of data in the time-series database 180. That is, the database writing program 156 can complete the processing by simply issuing a data write request.
[0088] In this way, in the control device 100 according to this embodiment, the database writing program 156 can behave without waiting for the completion of storing the time-series data in the time-series database 180.
[0089] The data to be stored in the time-series database 180 and the acquired values may be preprocessed, such as by scaling or statistical processing, to compress the amount of information.
[0090] The database writing program 156 itself may be created using the same programming tool as that used to create the user program 154. In this case, the database writing program 156 may be configured as a part of the user program 154, or may be configured as a program independent of the user program 154. Furthermore, a plurality of database writing programs 156 may be executed using the same processor 102.
[0091] Furthermore, the database writing program 156 may be configured to allow editing operations (addition or deletion of target variables) even during execution (cyclic execution) of the control program 152 in the control device 100.
[0092] The description style or description format of the database writing program 156 is not limited to a code that describes a series of commands, and a dedicated tool or application for specifying necessary information (for example, a list of variables to be collected or a list of operations for transforming variables) may be provided. In order to realize such a dedicated tool or application, an interface for receiving various settings may be provided on the control device 100 side or the support device 200 side.
[0093] Furthermore, rather than an explicit database write program 156 , the database write program 156 may be implemented as part of a system task executed within the controller 100 .
[0094] In response to a data write request from the database write program 156 , the input / output processor 170 stores the specified time series data in the time series database 180 .
[0095] As described above, from the viewpoint of the database writing program 156, after issuing a data write request, the input / output processing unit 170 processes the data write request so as not to wait for the completion of storage of the time series data. The storage of the time series data by the input / output processing unit 170 is performed in the background asynchronously with the control calculation executed in the control cycle. Such asynchronous and background execution can reduce the impact on the control cycle.
[0096] When a multi-core or multi-processor configuration is adopted as the processor 102, a core or processor responsible for processing to realize the input / output processing unit 170 may be assigned separately from the core or processor that cyclically executes the control calculation.
[0097] As an example of an implementation form for storing data asynchronously with such a control cycle, the input / output processing unit 170 may include a buffer for queuing a write request. That is, the input / output processing unit 170 may include a buffer for receiving a data write request and queuing the data write request. Alternatively, a buffer having a similar function may be arranged in the data storage processing unit 184 of the time-series database 180. Furthermore, a configuration in which a buffer is arranged in each of the input / output processing unit 170 and the data storage processing unit 184 may be adopted.
[0098] By employing such a configuration, when a sampling request is issued in the control calculation, the next process is executed continuously without waiting for the completion of data writing.
[0099] In the control device 100, an output program 166, an input program 164, and a user program 154 (which may include a database writing program, not shown) are cyclically executed by a scheduler program 162 managing the execution timing.
[0100] The control device 100 is connected to a group of field devices 6 (for example, output devices 61 such as actuators and input devices 62 such as sensors) via a local bus, a field bus, a field network, etc. Between the control device 100 and the group of field devices 6 connected via a local bus, a field bus, a field network, etc., there are timers and the like synchronized with each other in order to realize synchronized communication processing. That is, the time management unit 168 of the control device 100 is synchronized with the time management unit of the output device 61 and / or the time management unit of the input device 62.
[0101] Therefore, by adding time information managed by the time management unit of each device to the data transmitted from the output device 61 and the input device 62 to the control device 100, it is possible to achieve time consistency between the data handled by the output program 166 and the input program 164 of the control device 100.
[0102] The field device group 6 transmits collected observation values and the like together with time information managed by a time management unit to the control device 100. When the control device 100 receives the time information and the observation value from the field device group 6, it stores the time information as at least a part of a key in the time series database 180 and the observation value as a value.
[0103] In this way, the control device 100 is connected to field devices that are time-synchronized with each other, and time information when the data is collected by the field device may be added to the data stored in the time-series database 180 of the control device 100. In this case, the time-series database 180 may store records of a key-value store type in which the time information is used as a key and the value of the corresponding data is used as a value.
[0104] By adding time information managed by the mutually synchronized time management units 168, it is possible to synchronize the time series data collected in the time series database 180 with each other. In other words, it becomes possible to compare the time series data on a common time axis.
[0105] In this manner, in the control device 100 according to this embodiment, by using time information managed by time management units 168 that are synchronized with each other, it is possible to realize integration, accumulation, and analysis of time series data with high time accuracy on the control device 100 connected to one or more field device groups 6.
[0106] Furthermore, multiple control devices 100 can also be time-synchronized with each other. In such a case, the time series data stored in the time series databases 180 of the multiple control devices 100 can be integrated by any of the control devices 100, the support device 200, or the higher-level system 400, so that even time series data collected from field device groups 6 connected to different control devices 100 can be integrated with each other for analysis, etc.
[0107] Time synchronization is established between the control devices 100 connected via such a bus or network, and each device has a common time. By using such time-synchronized time information when registering time series data in the time series database 180, the time axis can be made common between the time series data stored in each time series database 180.
[0108] The control device 100 may aggregate data stored in the time series database 180 of each of the other one or more control devices 100 connected thereto.
[0109] By implementing the above-described data aggregation function, even if multiple control devices 100 are distributed in order to meet required system specifications, the time axis can be made common between the time series data collected by each control device 100, making it easier to perform post-hoc integrated analysis of the time series data.
[0110] As described above, by connecting a plurality of control devices 100 to each other via a time-synchronized network or the like and collecting time-series data with time-synchronized time stamps, it is possible to integrate and analyze this time-series data after the fact. By adopting such a configuration, it is possible to easily realize a scalable configuration that allows the system to be expanded according to the required performance, number of measurement points, etc.
[0111] FIG. 6 is a diagram illustrating the determination of data quality according to an embodiment. In this embodiment, the quality of the sampled variable data is inspected, and information indicating the quality is added to the records stored in the time-series database 180 and recorded.
[0112] Specifically, a sampling request (1) is sent when a control program is completed, which starts the sampling process. A quality judgment request (2) is sent when the next control program starts, which executes the data quality judgment process. The data quality judgment process judges the quality of the data depending on whether or not the sampling request (1) and quality judgment request (2) are received during the sampling process.
[0113] The judgment result is recorded in a record together with the variable data and stored in the time series database 180.
[0114] Referring to FIG. 6(A), in this example, a sampling request (1) is received at the timing of completion of a control program, and sampling processing is started. A quality judgment request (2) is received at the timing of start of the next control program, and data quality judgment processing is executed. When data quality judgment processing is executed, sampling processing has already been completed. Therefore, it is judged as a case in which data concurrency is guaranteed (Good). The quality flag is set to "0x00: Good".
[0115] Referring to FIG. 6(B), in this example, a sampling request (1) is notified at the timing of completion of a control program, and sampling processing is started. A quality judgment request (2) is notified at the timing of start of the next control program, and data quality judgment processing is executed. During data quality judgment processing, sampling processing is still in progress. Then, upon receiving a notification of the next sampling processing request (1), sampling processing is started. At that time, sampling processing has been completed. Therefore, it is determined that this is a case in which data concurrency is not guaranteed (no data concurrency). The quality flag is set to "0x01: no data concurrency".
[0116] With reference to FIG. 6(C), in this example, a sampling request (1) is received at the timing of completion of a control program, and sampling processing is started. A quality judgment request (2) is received at the timing of start of the next control program, and data quality judgment processing is executed. During data quality judgment processing, sampling processing is still in progress. Then, upon receiving a notification of the next sampling processing request (1), sampling processing is started. Even at that time, sampling processing has not yet been completed. In this case, the next sampling processing is started. Therefore, it is determined that this is a case in which sampling processing is skipped (sampling period exceeded). The quality flag is set to "0x02: sampling period exceeded".
[0117] The quality flag is recorded as a record, and as one example, when the data is played back, a data quality result based on the quality flag is displayed.
[0118] FIG. 7 is a diagram illustrating a storage process of time-series data based on a comparative example. Referring to FIG. 7, in the comparative example, the control calculation included a sampling process. Therefore, the data sampled by the sampling process was processed by the database storage process. Therefore, in the relationship between the control period and the task execution time, the task execution time may increase as the number of variables to be sampled increases. Therefore, there was a high possibility that the task period would be exceeded when a large amount of data was sampled and stored in the time-series database 180.
[0119] Therefore, by excluding the sampling process from the cyclic execution of the control calculation, as in the configuration according to the embodiment, it is possible to store data more efficiently in that data storage is performed in accordance with the execution cycle of the control calculation.
[0120] FIG. 8 is a diagram illustrating a multi-core configuration according to the embodiment. Referring to FIG. 8, a case is shown in which three multi-cores Core#P, Core#Q, and Core#R are provided.
[0121] In this example, the multi-core #P is assigned database storage processing, the multi-core #Q is assigned sampling processing, and the multi-core #R is assigned control calculation of the control program. As shown in the figure, efficient processing is possible by assigning processing to each multi-core. Note that although three multi-cores are described in this example, any number of multi-cores may be provided as long as there are multiple multi-cores, and the processing described above may be assigned to each of them.
[0122] The same applies to the multiprocessor configuration. FIG. 9 is a flow diagram illustrating data quality determination processing of a database writing program according to an embodiment.
[0123] 9, the control device 100 judges whether or not there is a quality judgment request (step S20). The quality judgment request is notified at the start timing of the control program.
[0124] If it is determined in step S20 that there is a quality judgment request (YES in step S20), the control device 100 then determines whether or not sampling is completed (step S22).
[0125] In step S22, if the control device 100 determines that sampling is complete (YES in step S22), it determines that there is data concurrency, and then ends the process (END).
[0126] On the other hand, in step S22, when the control device 100 determines that sampling is not completed (NO in step S22), the control device 100 waits until a sampling start request is received (step S26).
[0127] If it is determined in step S26 that there is a request to start sampling (YES in step S26), the control device 100 determines whether or not sampling is completed (step S28).
[0128] In step S28, if the control device 100 determines that sampling is complete (YES in step S28), it determines that there is no data concurrency, and then ends the process (END).
[0129] On the other hand, in step S28, if the control device 100 determines that sampling is not complete (NO in step S28), it determines that the sampling period has expired, and then ends the process (END).
[0130] FIG. 10 is a diagram illustrating a display based on an example of the application 210 according to the embodiment.
[0131] Referring to FIG. 10, for example, screen 500 shows a case in which time series data stored in time series database 180 of control device 100 is analyzed and the numerical values of the time series data stored in time series database 180 are reproduced and displayed.
[0132] An operation means 502 capable of performing a playback operation is provided within the screen 500. The operation means 502 indicates the playback position and also displays the quality of the data during playback.
[0133] Specifically, the case where "no simultaneity" is displayed based on the quality flag of the record is shown. Other "Good" and "over sampling period" can also be displayed based on the quality flag.
[0134] The embodiments disclosed herein should be considered to be illustrative and not restrictive in all respects. The scope of the present disclosure is defined by the claims, not the above description, and is intended to include all modifications within the meaning and scope of the claims. [Explanation of symbols]
[0135] 1 control system, 2 first field bus, 4 second field bus, 6 field device group, 8 inter-controller communication network, 12 remote I / O device, 14 relay group, 16, 124 I / O unit, 18 image sensor, 20 camera, 22 servo driver, 24 servo motor, 61 output device, 62 input device, 100 control device, 102 processor, 104 chip set, 106 main memory device, 108 secondary memory device, 110 network controller, 112 controller, 114 memory card interface, 116 memory card, 118, 120 field bus controller, 122 local bus controller, 150 PLC engine, 152 control program, 154 user program, 156 database writing program, 158 serialized communication program, 160 system program, 162 scheduler program, 164 input program.
Claims
1. a processing unit that cyclically executes control operations at a predetermined execution period, the control operations including collection of input data from field devices, calculation of output data based on the input data in accordance with a predetermined user program, and output of the calculated output data; a database for storing designated data from among the data managed by the processing unit in chronological order; a data writing means for writing data to the database in the same cycle as an execution cycle in which the control calculation is cyclically executed; the control calculations that are cyclically executed include a process of issuing a sampling request to sample designated data among data managed by the processing unit, In the control operation, when the sampling request is issued, the control device continues to execute the next process without waiting for the completion of the sampling request.
2. The data writing means includes: a variable read processing means for receiving the sampling request and sampling the specified data; A quality determination processing means for determining the quality of the sampled data; 2. The control system of claim 1, further comprising: a storage processing means for storing sampled data in said database.
3. 3. The control device according to claim 2, wherein the sampling request is issued at a timing when the control calculation is completed, and a quality judgment request for requesting judgment of the quality of the sampled data is issued at a timing when the control calculation is started.
4. 4. The control device according to claim 3, wherein said quality judgment processing means judges the quality of said sampled data based on whether or not sampling has been completed upon receiving at least one of said sampling request and said quality judgment request.
5. The control device is configured with a processor configured with a plurality of cores, 2. The control device according to claim 1, wherein said processing section and said data writing means operate in parallel using different cores.
6. The control device is connected to field devices which are time-synchronized with each other; 2. The control device according to claim 1, wherein the data stored in the database is provided with time information when the data was collected by the field device.
7. 2. The control device according to claim 1, wherein the database stores records of a Key-Value store type, in which time information is a Key, and the value of the corresponding data and quality information of the data are a Value.
8. Further comprising a reproducing means for reproducing the time-series data stored in the database, 8. The control device according to claim 7, wherein said reproducing means outputs said quality information of the corresponding data stored in said database during reproduction.
9. A program for implementing a control device, the program being configured to: Executing a step of cyclically executing a control operation including collection of input data from a field device, calculation of output data based on the input data in accordance with a predetermined user program, and output of the calculated output data at a predetermined execution period; The computer includes a database that stores designated data among the data managed by the control operation in chronological order, and the program is executed by the computer. executing a step of writing data to the database in the same period as the execution period in which the control calculation is cyclically executed; The control operations that are cyclically executed include a step of issuing a sampling request to sample designated data among data managed by the control operations, When the sampling request is issued in the control calculation, the next process is executed continuously without waiting for the completion of the sampling request.
Citation Information
Patent Citations
Control apparatus and program
JP2018151726A
