百度智能云

All Product Document

          Time-Spatial Database

          Noun Interpretation

          TSDB: Time Series Database (TSDB), used to store massive data of time series (changes in the chronological order).

          Metric: Category of data indexes, such as engine temperature, engine speed, amount of simulation, etc.

          Field: Sub-categories of data under specified metrics. That is, one metric supports multiple fields, such as when a metric is wind, the metric has two fields: direction and speed.

          Timestamp: Time point at which the data is generated.

          Value: Value corresponding to the metric, e.g., 56, 1000r/s, etc. (no unit in practice). If multiple fields exist, each field has a corresponding value. Different fields support the writing of different data types. For the same field, no other data types are allowed to be written into the same field after the value of a data type is written.

          Tag: A tag is a key-value pair, used to provide additional information, such as "device number=95D8-7913", "model=ABC123", and "factory number=1234567890", etc.

          Data point: "1 metric + 1 field (optional) + 1 timestamp + 1 value + n tags (n>=1)" uniquely defines a data point. When the written metric, field, timestamp, and n tags are all the same, the value written later overrides the value written before.

          Time series: "1 metric + 1 field (optional) + n tags (n>=1)" defines a time series. Single-field and multi-field data points and time series are shown in the figure below:

          Practice 1 (Single-field)

          Monitor the value of temperature with temperature as a metric, and tags are used to identify the additional information for each data. For example, 3 tags are provided for each data point, tag is a key-value pair, and the tag keys are deivceID, floor, and room.

          As shown in the figure, a total of 4 data points represent the time series monitoring value of temperature. The metrics and tags used by the four data points in the figure are the same, so the time series is the same.

          Practice 2 (Multi-field)

          Monitor the value of wind with wind as a metric, and wind is divided into two fields: direction and speed. The monitoring data is transmitted from different sensors to the cloud, using tags to identify the additional information for each data. For example, three tags are provided for each data point, tag is a key-value pair, and the tag keys are sensor, city and province.

          To represent the data of direction uploaded by the sensor number 95D8-7913 in Shenzhen, Guangdong Province, you can mark the tags of the data point as sensor=95D8-7913, city=Shenzhen, and province=Guangdong.

          The monitoring data for the two fields (speed and direction) of wind as a metric is shown in the figure. When the used metric, fields and tags are the same, the time series is the same. That is, 2 time series and 8 data points are shown in the figure.

          The advantage of storing data in a metric-field way is that queries can be jointly done under the same time series. Taking the above figure as an example, to query the case of wind in time of 1467627246000-1467627249000, you can jointly query the values of multiple fields to get the data in the figure below.

          If no data is written, in the query, you can use the interpolation scheme to complete the values. For interpolation instructions, see the related database operation documentation.

          • The key values of the tags and values are the same tag, i.e. deviceid=1 and deviceid=2 are two tags.
          • Do not use the timestamp as a tag, as this causes a time series to exceed the limit. See the Rate Table for the time series limit.

          Group: Group data points by tags.

          Aggregator: Data points over some time are aggregated, such as sum value, average, maximum, and minimum of every 10 minutes. For aggregators currently supported by TSDB, see Reference Documentation

          Database: A user may have multiple databases, and multiple "data points" of "metrics" can be written into a database.

          Previous
          Product Advantages
          Next
          Data Structure