Waterschap Brabantse Delta · R&D lab · research artifact

Data compression: requirements for a comparative study of compression within the sensor repeatability

Mike Molekamp (intern, Avans Hogeschool) track Data compression date 2026-10-23 version 1.7 draft
Every EVOLV node writes its own sensor data to FROST through a reducer in its FROST writer; today that reducer (change-heartbeat) does not compress. This study looks for the compression method, or combination of methods, that stores the data in the fewest bytes while every reconstructed measurement stays within the repeatability of the sensor. Monotone PCHIP and SDT are the minimum building blocks. The best method is then compared, on the same five public datasets that Untied was tested on and with the same error bound, with Untied, the method of the R&D lab. The winner becomes the reducer in generalFunctions. This artifact lists the requirements as user stories with acceptance criteria, prioritised with the MoSCoW method.[1][2]

Approach

How the study works, step by step:[2]

  1. Baseline — measure what change-heartbeat stores on the five datasets, the same data as the comparison (a trial run on synthetic data, 38.2 GB per year for 4 sensors, was used to build and test the counting script).
  2. Candidates — build each method as an encoder and a decoder: at least SDT, monotone PCHIP and a combination that picks the cheapest building block per piece (flat, line, monotone PCHIP, point by point).
  3. Storage format — part of every candidate: blocks instead of single Observations, compact time, binary coding and general-purpose compression, because the bytes count, not the number of knots.
  4. Measure and choose — on all five datasets: bytes per sensor per day and the largest deviation; every candidate is decoded and checked against ε.
  5. Compare with Untied — on the same five datasets, with the same ε, gap rule and byte count. The datasets are not split: Untied was developed and measured on all of them as well.
  6. Winner — if the best own method wins it becomes a reducer in generalFunctions; applying it in the live system is a Could. If Untied wins, the R&D lab applies Untied itself.

Definitions

RepeatabilityHow far repeated measurements of the same value by the sensor lie apart. From the asset configuration or datasheet, as a percentage of the reading and/or an absolute value. For the test datasets: from the sensor data in Untied's code.
ε (error bound)The maximum allowed deviation per point. For the test datasets: Untied's AUTO ε, ε = max(repeatability, resolution / 2), as a fixed value per sensor. For EVOLV sensors with a repeatability as a percentage of the reading: ε = max(absolute floor, repeatability/100 · |value|), falling back to accuracy and then a default. The same ε per sensor for every method.
Within the boundAt every measurement the reconstruction deviates at most ε, and between two consecutive measurements it stays within ε of the range of those two measurements (gap check).
StorageBytes per sensor per day, counted as in Untied's benchmark: the compressed series itself (one zstd-19 blob per series, stored timestamps included where a method needs them), without database metadata per row or Observation. The same count for every method, the baseline included. The criterion of the study.
CandidateA compression method (encoder + decoder) that takes part in the comparison.
Building blockA shape for one piece of the series, for example flat, straight line (SDT), monotone PCHIP or point by point.
CombinationA candidate that picks the cheapest building block per piece.
KnotA stored number (time and value) from which the series is reconstructed. It does not have to be a real measurement, as long as the series stays within the bound.
BlockA piece of the series (for example one hour) that is encoded and stored in one go.
UntiedThe compression method of the R&D lab: constant, line, quantised and curve pieces with a gap check. At the edge it encodes one-hour blocks; in its benchmark a whole series is one block and timestamps are not stored.
DatasetsThe five public datasets Untied was tested on; the test data of this study.
GapAn invalid value (NaN or error code) or a long silence. As in Untied, invalid values are left out before compression and the gap check applies between the valid measurements around them; the reconstruction may also return "no data" there, but does not have to.
BaselineWhat the current reducer change-heartbeat stores on the five datasets; the reference for the saving.
ReducerThe object per series in the FROST writer that decides what goes to FROST (plug-in point src/frost/reducer.js).

Requirements (MoSCoW)

Each requirement is a user story with a description and acceptance criteria. The stakeholder in every story is the R&D lab. Changed in version 1.6: US-1, US-2, US-3 (now includes US-16), US-8; US-19 lowered to Should, US-4 lowered to Could. New: US-21, US-22 and US-23. Removed: US-7, US-12 (now part of US-21), US-14 (now part of US-1), US-15 and US-16 (now part of US-3). Changed in version 1.7: US-8 lowered to Should and handled as in Untied (invalid values left out, no time limit, "no data" allowed but not required), US-1 (bytes counted as in Untied's benchmark), US-11, US-21 (datasets, ε, gap rule, no split into tuning and comparison data, Untied run in the same script), and the definitions of storage, ε and gap.

5
Must have
7
Should have
4
Could have
2
Won't have (this phase)
Show
All user stories with priority, description and acceptance criteria. Use the filter above to show one MoSCoW category.
IDUser storyPriorityDescriptionAcceptance criteria
US-1 As the R&D lab I want measurement data to be stored in as few bytes as possible, so that storage and cost go down. MUST Changed in 1.6. The criterion is bytes, not the number of knots; the storage format counts (includes the former US-14, compact timestamps).
  • Counted as in Untied's benchmark: the bytes of the compressed series (one blob per series, compact coding plus zstd level 19), without database metadata; the baseline change-heartbeat is counted the same way (its kept points as knots, as Untied counts deadband). Reported per sensor per day.
  • Demonstrably fewer bytes than the baseline (change-heartbeat).
  • Stored numbers may be approximations, as long as US-2 holds.
US-2 As the R&D lab I want the reconstructed series never to deviate more than the repeatability of the sensor, so that the deviation stays within the measurement uncertainty. MUST Changed in 1.6: the bound also applies between two measurements, not only on them.
  • At every measurement |reconstruction − measurement| ≤ ε.
  • Between two consecutive measurements the reconstruction stays within ε of the range of those two measurements.
  • ε follows the rule in the definitions and can be found by the decoder.
  • Demonstrated on the full test data with an automatic check.
US-3 As the R&D lab I want to retrieve values at any timestamp and interval of my choice, so that I can analyse the series. MUST Changed in 1.6: includes the former US-16 (retrieval at a chosen time step).
  • The decoder returns a value for every series at any requested timestamp and at a chosen interval (e.g. every 5 minutes).
  • Requesting the same timestamps twice gives exactly the same result.
US-21 As the R&D lab I want the methods to be compared on equal terms, so that the choice of the final reducer can be justified. MUST New in 1.6. Includes the former US-12 (saving and deviation per series). Changed in 1.7: datasets, ε and gap rule fixed.
  • Same datasets (the five of Untied's benchmark, with Untied's preprocessing), same ε per sensor (Untied's AUTO ε), same gap rule (no time limit), same byte count (US-1) and same check on the bound (US-2).
  • Per series, per sensor and in total: bytes per day, factor against the baseline, largest deviation (× ε), and the delay (for information).
  • All methods use all data, as Untied was developed and measured on the same datasets. So that no method wins by being tuned on exactly this data: one fixed setting for all datasets (what differs per series, the encoder chooses itself), and every fixed setting is checked on a dataset it was not tuned on (leave-one-dataset-out).
  • Reproducible: Untied is run in the same script with the R&D lab's own code; its outcome is checked against the R&D lab's published results, and if they do not match, those results are used. Running twice gives the same numbers.
US-22 As the R&D lab I want to know which method works best and why. MUST New in 1.6. Candidates are built and measured before the best one is chosen.
  • At least monotone PCHIP, SDT and one combination are built (encoder + decoder) and measured.
  • Adding a candidate to the comparison takes one line.
  • The choice of the best method is backed by numbers, also when a building block (for example PCHIP) drops out.
US-8 As the R&D lab I want to see when a sensor did not measure, so that I don't mistake missing data for real measurements. SHOULD Lowered from Must in 1.7, and handled as in Untied: invalid values are left out before compression, and there is no time limit for a gap.
  • Invalid values (NaN, error codes) are left out before compression; between the valid measurements around them the gap check of US-2 applies, however long the silence.
  • Over an invalid value, or a silence longer than an agreed maximum, the reconstruction may return "no data" instead of a value; a value must stay within the gap check.
  • Before the first and after the last measurement the reconstruction returns "no data".
US-6 As the R&D lab I want the method to fit on the edge device, so that it can run between sensor and storage. SHOULD Lowered from Must in 1.6: the study runs offline on the datasets first.
  • Memory per series is limited by a fixed maximum block or window size.
  • Memory use and compute time are measured.
US-10 As the R&D lab I want recent measurements to be available in storage quickly, so that I can follow the current situation. SHOULD Blocks delay storage; the delay is recorded for every method.
  • A measurement is in storage within an agreed maximum time.
  • The delay per method is reported in the comparison.
US-11 As the R&D lab I want missing or faulty values to be handled by fixed rules, so that the compression doesn't derail on bad data. SHOULD Values such as NaN or sensor error codes are recognised and processed predictably.
  • Missing and faulty values are left out before compression, as in Untied (US-8).
  • The handling is documented and tested.
US-13 As the R&D lab I want each stored block to record how it was compressed, so that the data can always be reconstructed correctly later. SHOULD The bytes of this metadata count towards US-1.
  • Series ID, algorithm version and ε can be found per block or per Datastream.
US-19 As the R&D lab I want the compression to work on a copy of the data, so that the control in the nodes (for example pumps) keeps using the full, original data. SHOULD Lowered from Must in 1.6: it applies once the method runs as a reducer (US-20).
  • The reducer only sees the points of the FROST writer and does not change them.
  • An error in the compression does not crash the node and does not affect its control.
US-20 As the R&D lab I want the best own method as a general function in generalFunctions, so that every node with a FROST writer can use it. SHOULD The method becomes a reducer in the plug-in point of the FROST writer.
  • Follows the reducer contract (offer/due/absent/flush) and is registered with registerReducer.
  • A node needs no compression logic of its own.
US-4 As the R&D lab I want the reconstructed series to contain no peaks or dips that were not measured, so that I don't analyse fake data. COULD Lowered from Must in 1.6: the criterion is storage within ε (US-2).
  • Between two knots the reconstruction stays between the values of those two knots.
US-5 As the R&D lab I want no data to be lost when the edge device restarts or storage is unreachable, so that the series is always complete. COULD Lowered from Must in 1.6: only relevant when the method is applied in the live system (US-23).
  • After a restart no data is missing.
  • When storage is unavailable, data is buffered and sent later.
US-9 As the R&D lab I want the highest and lowest values to be kept exactly, so that I can check afterwards whether a limit was exceeded. COULD Lowered from Should in 1.6.
  • The maximum and minimum per block are always knots.
US-23 As the R&D lab I want the winning own method applied in the current system, so that the saving is real. COULD New in 1.6. Only if the own method wins and there is time; if Untied wins, the R&D lab applies Untied itself.
  • Enabled for existing nodes, stored in FROST and reconstructed in the dashboard.
US-17 As the R&D lab I want to compress multiple series together. WON'T Out of scope: each series is compressed separately.
  • n/a in this phase.
US-18 As the R&D lab I want to receive an alarm from the edge device when a threshold is exceeded. WON'T Out of scope: alarming belongs to a different system.
  • n/a in this phase.
assumption Status. Version 1.7 is a proposal of 2026-10-23 and still has to be approved by the product owner. Compared with 1.5 (2026-10-12) the assignment changed from building a PCHIP reducer to a comparative study: the best own method (with at least monotone PCHIP and SDT) is compared with Untied, and the method with the fewest bytes within the repeatability wins. Fixed in 1.7: the test data (the five public datasets of Untied's benchmark), ε per sensor (Untied's AUTO ε) and the gap rule (no time limit). Also decided: the datasets are not split into a tuning and a comparison part (US-21), and the baseline feeds the datasets to change-heartbeat row by row. Also decided: storage is counted as in Untied's benchmark for every method, the baseline included (US-1), and Untied is run in the same script, checked against its published results (US-21). Still to agree with the product owner: how a block is stored in FROST, once the winning method becomes a reducer (US-20). The source document is in Dutch; the stories are translated to English here following the HELIX artifact language rule.

Sources

  1. Requirements.docx — "Opdracht idee" and "Requirements op basis van MoSCoW", M. Molekamp, internship Waterschap Brabantse Delta / Avans Hogeschool. consulted 2026-09-29
  2. Compression_README.md — project description v3.5, sections 2, 4, 6 and 7 (testdata, approach, definitions, requirements v1.7), M. Molekamp. consulted 2026-10-23
  3. Untied — de methode in beelden — presentation of the Untied method, R&D lab, September 2026. consulted 2026-10-23
  4. Onderzoek.docx and Portfolio-LU2.docx — research report (nulmeting, data and bibliography of the datasets) and portfolio, M. Molekamp, internship Waterschap Brabantse Delta / Avans Hogeschool; data in the repository m.molekamp/DataCompression (data/zet-om.py, data/datasets.json). consulted 2026-10-23
Data vintage Requirements as of 2026-10-23 (version 1.7, proposal)
Method User stories + acceptance criteria, prioritised with MoSCoW
Track Data compression (prj_c388225ebbe9)
Contact Mike Molekamp · R&D lab · lab.wbd-rd.nl