Control device and program
The control device and program enhance data storage efficiency by using reference and differential records in time-series databases with synchronized time information, addressing inefficient storage and enabling integrated, high-accuracy data analysis.
Patent Information
- Application Number
- JP2023073533
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-04-27
- 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, necessitating improved methods for post-mortem analysis of large data sets.
A control device and program that efficiently store data by constructing reference and differential records based on execution cycles, incorporating time-series databases with key-value store types and synchronized time information, allowing asynchronous data writing without interrupting control cycles.
Enables more efficient data storage and retrieval, reducing storage capacity requirements and facilitating high-accuracy, integrated data analysis across multiple devices.
Smart Images

Figure 2024158380000001_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 operations at a predetermined execution period, including collecting input data from field devices, calculating output data based on the input data according to a predetermined user program, and outputting the calculated output data, a database that chronologically stores specified data among the data managed by the processing unit, and data writing means for writing data to the database at the same period as the execution period in which the control operations are cyclically executed. The data writing means includes means for constructing a reference record of the specified data, and means for constructing a difference record of the specified data when a predetermined condition is satisfied.
[0010] The means for constructing a reference record constructs a reference record of the specified data for each first timing, and the means for constructing a difference record constructs a difference record of the specified data when a predetermined condition is satisfied for each second timing different from the first timing.
[0011] The means for constructing a difference record constructs a difference record of the specified data when there is a change based on a comparison between the previously specified data and the currently specified data as a predetermined condition.
[0012] The control device is connected to field devices that are time-synchronized with each other, and data stored in the database is provided with time information indicating when the data was collected by the field device.
[0013] 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 the data as the value.
[0014] The system further comprises a reproducing means for reproducing the time-series data stored in the database, and the reproducing means reconstructs, based on the reference record, differential records of the corresponding data stored in the database during reproduction, and outputs the reconstructed records.
[0015] 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 chronologically stores specified data among the data managed by the control calculation, the program causes the computer to execute a step of writing data to the database at the same execution period as the execution period in which the control calculation is cyclically executed, the step of writing data includes a step of constructing a reference record of the specified data, and a step of constructing a difference record of the specified data when a predetermined condition is satisfied. Effect of the Invention
[0016] According to the control device and program of the present disclosure, more efficient data storage can be achieved. [Brief description of the drawings]
[0017] [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]It is a schematic diagram for explaining the cyclic execution process and the writing process to the time series database in the control device 100 according to the present embodiment. [Figure 6] It is a diagram for explaining a specific example of data stored in the time series database 180 according to the embodiment and the comparative example. [Figure 7] It is a flowchart for explaining the processing of the data writing program according to the embodiment. [Figure 8] It is a diagram for explaining the reproduction process according to the data in the time series database based on the embodiment.
Embodiments for Carrying Out the Invention
[0018] 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 the description thereof will not be repeated.
[0019] <A. Overall Configuration Example of the Control System> First, an overall configuration example of the control system 1 including the control device according to the present embodiment will be described.
[0020] FIG. 1 is a schematic diagram showing an overall configuration example of the 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.
[0021] 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 the field device group 6 via the first field bus 2 and is connected to one or more display devices 300 via the second field bus 4. The control device 100 exchanges data with the connected devices via the respective buses or networks.
[0022] 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.
[0023] 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).
[0024] 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.
[0025] 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.
[0026] 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.
[0027] 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.
[0028] 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.
[0029] 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.
[0030] 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.).
[0031] 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".
[0032] In addition, 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.
[0033] The support device 200 is a device that supports the preparations necessary for the control device 100 to control the control target. Specifically, the support device 200 provides a development environment for the program executed in the control device 100 (program creation / editing tools, parser, compiler, etc.), 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 executed on the control device 100, etc.
[0034] 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.
[0035] 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.
[0036] <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.
[0037] 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, ....
[0038] 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.
[0039] 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.
[0040] 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.
[0041] 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.
[0042] 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.
[0043] 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.
[0044] 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.
[0045] 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 execute the necessary applications on each OS.
[0046] <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.
[0047] 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.
[0048] 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.
[0049] 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.
[0050] 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.
[0051] 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.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] The system programs 160 include a scheduler program 162 , an input program 164 , and an output program 166 .
[0056] 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.
[0057] 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.
[0058] 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.
[0059] 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.
[0060] 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.
[0061] More specifically, the time-series database 180 includes a data storage processing unit 184 , an internal storage 188 , and an external storage 189 .
[0062] 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.
[0063] 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).
[0064] Also in the support device 200 connected to the control device 100, any application 210 may 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, so-called data mining that analyzes the time-series data stored in the time-series database 180 of the control device 100 to find some trend or feature amount associated with the trend is assumed. Alternatively, an application that executes various statistical processes on the time-series data stored in the time-series database 180, or an application that displays the numerical values of the time-series data stored in the time-series database 180 or displays a graph or the like that visually shows the data is also assumed.
[0065] <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.
[0066] 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.
[0067] 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.
[0068] A 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.
[0069] 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.
[0070] Referring to FIG. 4(B), for example, time information (Timestamp) or information indicating timing (counter) may be stored in the time-series Key. The corresponding input data, output data, and values (actual values) of calculation data may be stored in the time-series Value. In this example, a case where an actual value associated with the ID of variable data is stored is shown as an example. As will be described later, the lengths of the time-series Values are not the same and are variably set.
[0071] <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, an I / O refresh process is repeatedly executed at a predetermined cycle. At least a part of the user program 154 is executed at the same cycle as this I / O refresh process. In the present embodiment, 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.
[0072] 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.
[0073] The time series database 180 may be configured to store multiple independent time series data. One or multiple storages may be used depending on the size of the time series database 180. 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.
[0074] 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."
[0075] 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 reference record construction process 1564, a differential record construction process 1565, and a database storage process 1566.
[0076] 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).
[0077] 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 write data. That is, the cyclically executed control calculation includes a process of issuing a data write request to the database writing program 156. When the user program 154 issues a data write 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.
[0078] 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.
[0079] As described above, from the viewpoint of the user program 154, after issuing a data write request, the user program is processed so as not to wait for the completion of the database write program 156. The database write program 156 is processed in the background asynchronously with the control calculation 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.
[0080] 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 data write 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 write program 156 is executed in synchronization with a control cycle, it is possible to accept a new data write request even if the data write processing issued in the previous control cycle is not completed.
[0081] 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.
[0082] 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.
[0083] The base record construction process 1564 is a process for constructing the aggregated data as a base record.
[0084] The differential record construction process 1565 is a process for constructing a differential record for the aggregated data. The differential record includes only data that has changed based on the comparison result by comparing the previously acquired aggregated data with the currently acquired aggregated data.
[0085] 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.
[0086] 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.
[0087] 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.
[0088] 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.
[0089] 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.
[0090] 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.
[0091] 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.
[0092] 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 .
[0093] 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 .
[0094] 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.
[0095] 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.
[0096] 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.
[0097] 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.
[0098] 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.
[0099] 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.
[0100] 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.
[0101] 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.
[0102] 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.
[0103] 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.
[0104] 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.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] 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.
[0110] FIG. 6 is a diagram illustrating a specific example of data stored in the time-series database 180 according to the embodiment and the comparative example.
[0111] Referring to FIG. 6(A), conventional records stored in time-series database 180 are shown as a comparative example.
[0112] As a comparative example, a conventional record stores all time series data for each control cycle.
[0113] Therefore, the data volume of the time series database 180 has tended to increase considerably. Referring to FIG. 6(B), records stored in the time series database 180 according to an embodiment are shown.
[0114] In this embodiment, a case is shown in which a base record and a difference record are stored.
[0115] The reference record stores data sampled at a timing interval of a predetermined period ΔT. The difference record stores data at a timing interval equal to a control cycle that is shorter than the predetermined period ΔT. The predetermined period ΔT can be designed as appropriate.
[0116] A delta record is constructed if there is a change based on a comparison between the previously sampled data and the currently sampled data. Specifically, only data that has changed based on the comparison is stored as a delta record.
[0117] Specifically, a buffer is provided for storing previously sampled data, and the data stored in the buffer is compared with the currently sampled data, and any variable data that has changed is constructed as a difference record.
[0118] Any variable data that has changed is stored in a buffer as updated data. The difference records can be reconstructed into the original sampled data based on the reference records.
[0119] FIG. 7 is a flow diagram illustrating processing of a data writing program according to an embodiment.
[0120] Referring to FIG. 7, the control device 100 determines whether or not there is a data write request (step S2).
[0121] In step S2, when it is determined that there is a data write request (YES in step S2), the control device 100 executes a variable data read process (step S4).
[0122] The sampling process aggregates pre-specified data. Next, the control device 100 judges whether it is the timing of the reference record (step S6). Specifically, it judges whether it is the timing of a predetermined period ΔT.
[0123] In step S6, when it is determined that it is time for a base record (YES in step S6), the control device 100 creates a base record (step S8).
[0124] All sampling data is constructed as a base record. Then, the control device 100 executes a process of storing the data in the time-series database 180 (step S10).
[0125] Then, the process returns to step S2. On the other hand, in step S6, when the control device 100 determines that it is not the timing for the reference record (NO in step S6), it executes a data comparison with the previous value (step S12). Specifically, a buffer is provided to store the previously sampled data, and the data stored in the buffer is compared with the currently sampled data.
[0126] Next, the control device 100 judges whether there is any changed data (step S14). The data that has changed based on the comparison result is constructed as a difference record. The data that has changed is stored in the buffer as updated data.
[0127] In step S14, if the control device 100 determines that there is changed data (YES in step S14), it constructs a difference record (step S16). A difference record based only on the changed data is constructed.
[0128] Then, the control device 100 executes a process of storing the data in the time-series database 180 (step S10).
[0129] Then, the process returns to step S2. On the other hand, in step S14, if the control device 100 determines that there is no changed data (NO in step S14), the process returns to step S2 and the above-mentioned processing is repeated.
[0130] This process stores the record described in FIG. 6(B). FIG. 8 is a diagram illustrating a playback process in accordance with data in a time-series database based on an embodiment.
[0131] 8(A) shows a case where a reference record and a difference record are collected and stored in the time-series database 180. Also shown is a case where an abnormality occurs between the start and end of collection.
[0132] FIG. 8B shows a case where only records before and after the occurrence of an abnormality are extracted, with the time point at which the abnormality occurred being used as a reference.
[0133] 8(C) shows a case where variable data is reconstructed from information of differential records based on reference data among the extracted records. Since the differential records are data based on the difference with the previously stored reference data, reconstruction is possible based on the information.
[0134] Referring to FIG. 8(D), a case is shown in which the reproduction process is performed based on the reference data and the variable data reconstructed according to the difference record.
[0135] Therefore, it is possible to visually display time-series data by performing a playback process according to the application 210.
[0136] In addition, in the playback process, for example, when extracting records before and after the occurrence of an abnormality based on the time point at which the abnormality occurred, in the conventional method, it was necessary to acquire and play back all the sampling data. However, in the present method, the reference data and differential data are acquired and played back, so that it is possible to reduce the amount of data acquired from the time series database 180.
[0137] 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]
[0138] 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 data writing means includes: means for constructing a reference record of the specified data; and means for constructing a differential record of the specified data if a predetermined condition is met.
2. The means for constructing a reference record constructs a reference record of the specified data for each first timing, 2. The control device according to claim 1, wherein the means for constructing the difference record constructs a difference record of the specified data when the predetermined condition is satisfied for each second timing different from the first timing.
3. 2. The control device according to claim 1, wherein the means for constructing the difference record constructs a difference record of the specified data when a change is found based on a comparison between the specified data of a previous time and the specified data of a current time as the predetermined condition.
4. 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.
5. 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.
6. A reproducing means for reproducing the time-series data stored in the database, 2. The control device according to claim 1, wherein said reproducing means reconstructs said difference records among the corresponding data stored in said database based on said reference records during reproduction, and outputs said difference records.
7. 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 into the database in the same period as the execution period in which the control calculation is cyclically executed; The step of performing data writing includes: constructing a baseline record of the specified data; and constructing a differential record of the specified data if a predetermined condition is satisfied.
Citation Information
Patent Citations
Control apparatus and program
JP2018151726A
Cited By
Control system for a technical installation
WO2026119578A1
