Control device, time stamp modification method, computer program, and data structure
AssigneeOMRON Corporation
InventorShinsuke Kawanoue
Life of this patent
Estimating the term…
Abstract
Data is recorded to a time-series database embedded in a PLC. A local clock of the PLC is corrected by accessing a time server such as an NTP server on a regular basis. At that time, a time correction amount and an NTP-ID for identifying each iteration of correction processing are recorded to an NTP log in association with each other. When a query arrives, a time stamp of a record corresponding to a designated time range is modified by proportionally distributing the time correction amount of the corresponding NTP-ID.
Claims11
A control device comprising:
- a memory;
- a local clock circuit;
- and
- a processor configured to perform operations comprising:
- operation as a correction unit configured to repeatedly execute correction processing of a local time provided by the local clock circuit in which the local time is capable of being synchronized with a network time, the local time comprising a time upon which time stamps are based, the correction processing executed at a first interval;
- operation as a storage unit configured to store a time correction amount for each iteration of the correction processing in the memory together with a first time stamp of a first point in time according to the local time, at which a respective iteration of correction processing was performed;
- operation as a data collection unit configured to collect a plurality of data elements related to a controlled object at a second interval;
- operation as a database configured to store the collected plurality of data elements in the memory, with a respective second time stamp attached to each data element of the plurality of data elements, the respective second time stamp indicating, for each respective data element, a second point in time according to the local time, at which the respective data element was collected;
- operation as an extraction unit configured to extract, from the database, data elements of the plurality of data elements corresponding to a period designated by a query directed to the database;
- operation as a modification unit configured to, for each of the extracted data elements, modify the respective second time stamp, based on the time correction amount of the iteration of correction processing to which a respective first time stamp and the respective second time stamp correspond, by:
- calculating a time deviation per unit time comprising an amount by which a difference between the local time and the network time changes per each unit of time, by dividing the time correction amount to which the respective first time stamp corresponds by:
- an operation interval of the correction unit;
- or an elapsed time between iterations of the correction processing;
- calculating a time modification amount, for modifying the respective second time stamp, by multiplying the time deviation per unit time by an elapsed time between a first time indicated by the respective first time stamp and a second time indicated by the respective second time stamp;
- and
- applying the time modification amount to the respective second time stamp;
- and
- operation as a response unit configured to send the extracted data elements with the modified respective second time stamps attached thereto to an issuer of the query.
A time stamp modification method comprising:
- repeatedly executing correction processing of a local time provided by a local clock circuit in which the local time is capable of being synchronized with a network time, the correction processing executed at a first frequency;
- causing a storage unit to store a time correction amount for each iteration of the correction processing in a memory together with a first time stamp of the point in time at which a respective iteration of correction processing was performed;
- collecting a plurality of data elements related to a controlled object;
- storing the collected plurality of data elements in a database, with a second time stamp attached to each data element of the plurality of data elements, the second time stamp indicating for each respective data element, a point in time at which the respective data element was collected;
- extracting, from the database, data elements of the plurality of data elements corresponding to a period designated by a query directed to the database;
- and
- modifying, for each of the extracted data elements, the respective second time stamp based on the time correction amount of the iteration of correction processing to which a respective first time stamp and a respective second time stamp correspond, by:
- calculating a time deviation per unit time comprising an amount by which a difference between the local time and the network time changes per each unit of time, by dividing the time correction amount to which the respective first time stamp corresponds by:
- an operation interval;
- or an elapsed time between iterations of the correction processing;
- calculating a time modification amount, for modifying the respective second time stamp, by multiplying the time deviation per unit time by an elapsed time between a first time indicated by the respective first time stamp and a second time indicated by the respective second time stamp;
- and
- applying the time modification amount to the respective second time stamp.
A data storage system for a computer memory in a control device comprising:
- the computer memory;
- a local clock circuit;
- and
- a processor configured with a program to perform operations comprising:
- repeatedly executing correction processing of a local time provided by the local clock circuit in which the local time is capable of being synchronized with a network time, the local time comprising a time upon which time stamps are based, the correction processing executed at a first interval,
- wherein
- the data storage system comprises:
- a first portion of the computer memory in which a time correction amount for each iteration of the correction processing together with a first time stamp of a first point in time according to the local time, at which a respective iteration of correction processing was performed is stored;
- and
- a second portion of the computer memory in which a time-series database comprising a plurality of records are stored in association with respective indexes, wherein each of the records is organized according to a data structure comprising:
- a data element related to a controlled object of the device;
- a second time stamp assigned to the data element, the second time stamp indicating a time of the local clock circuit at which the data element was collected;
- and
- an identifier for identifying a value of correction processing of the second time stamp such that the second time stamp is modified according to the value of correction processing to correct errors in the local clock circuit,
- the processor is configured with the program to perform operations further comprising modifying the second time stamp by, for each data element:
- calculating a time deviation per unit time comprising an amount by which a difference between the local time and the network time changes per each unit of time, by dividing the identified value of correction processing by:
- an operation interval of the correction processing;
- or an elapsed time between iterations of the correction processing;
- calculating a time modification amount, for modifying the second time stamp, by multiplying the time deviation per unit time by an elapsed time between a first time indicated by the first time stamp and a second time indicated by the second time stamp;
- and
- applying the time modification amount to the second time stamp.
Dependencies are inferred from the claim text.