Data QC automation × batch reports

Time-Series Anomaly Checks and Plain-Language Reports

Temperature sensors in server-room racks report one reading per hour. Data quality is checked every quarter, and each sensor needs a summary written for non-technical readers. The tool retrieves one quarter of data from the database, classifies anomalies with explicit rules and builds the summary from fixed sentence templates.

5 anomaly typesGap, stuck value, spike, level shift, out of range
About 2,200 readings per quarterHourly readings for each sensor
1 summary per sensorOne text per sensor, also compiled into a summary table

Terms

Gap

No reading is received for several consecutive hours. A single missing reading is not counted. A gap is listed only when the number of consecutive missing readings reaches the threshold.

Stuck value

Several consecutive readings are identical, which can mean the sensor has stopped updating.

Spike

One reading rises or drops sharply, and the next reading returns to the previous level.

Level shift

Readings move to a different value range and stay in that range afterwards.

Out of range

A reading is above the upper limit or below the lower limit. The limits follow the equipment specification.

Rule file

Stores the on/off state and threshold of the five rules. After a change, the tool is run again and applies the new settings.

Original problem

Before

  • Each quarter has dozens of sensors. Staff opened each time-series chart one by one, judged the anomalies and wrote the summary by hand.
  • Anomaly judgements depended on individual experience, so different staff could judge and word the same chart differently.
  • After the criteria changed, all charts had to be reviewed again.

After

  • The tool retrieves one quarter of data from the database and classifies five anomaly types with explicit rules.
  • Each anomaly type has a fixed sentence template, and the summary paragraph is built automatically with consistent wording.
  • Thresholds are kept in the rule file. After an adjustment, the tool is run again and all sensors are processed with the same rules.

Workflow

1Retrieve dataReads one quarter of hourly readings from the database and groups them by sensor.
2Apply rulesChecks the five anomaly types one by one, using the on/off state and thresholds in the rule file.
3Group anomaly periodsMerges consecutive anomalous readings and records the start time, end time and basis for each period.
4Build summaryEach anomaly type has a fixed sentence template, filled in with dates and values.
5Output reportsProduces one report with chart and text per sensor, and compiles a summary table.

Interactive demo: adjust the rules and view the summary

Time-series anomaly checkSynthetic data. Anomalies are built into three sensors, and one sensor has none.
Consecutive missing ≥ hours
Consecutive identical ≥ readings
Difference from neighbors ≥ times
The multiple is measured in units of the typical hourly change
Shift ≥ °C
Compare before/after hours
Lower limit °C   Upper limit °C
Anomalies—
Hours affected—
Data completeness—
Rules on—
Hourly readings (bands and numbers mark anomaly periods; dashed lines are the lower and upper limits)
Anomaly list
Generated summary text

Outcome and technology

Explicit rules

The criteria and thresholds for the five anomaly types are written in the rule file. Running the same data again gives the same result.

Consistent wording

Each anomaly type has a fixed sentence template, so the summary text has the same format for every sensor and quarter.

Adjust and rerun

After the thresholds in the rule file are changed, the tool is run again and the charts, tables and summary text of all sensors are updated together.

PythonpandasSQL ServerRule-based anomaly detectionmatplotlibpython-docxBatch report generation