Integration of Bitemporal PostgreSQL Temporal Database and Machine Learning for Detecting Backdate Correction in Daily kWh and Voltage Usage Data
Santi Ayu Rahma Wati, Zahrotul Firdaus, Safira Firdaus Mujiyanti, Dwi Oktavianto Wahyu Nugroho
Electricity monitoring systems require data storage mechanisms that not only record consumption values but also preserve historical changes to ensure data integrity and accountability. This paper proposes the integration of a bitememporal database architecture with machine learning models to support analysis and prediction of daily electricity consumption data, including kWh and voltage measurements. The bitemporal design is implemented using PostgreSQL with a system-versioned table approach based on the SQL:2011 standard, enabling each record to be managed through valid time and transaction time dimensions. This mechanism allows accurate retrieval of historical data states (as-was) and current conditions (as-is). Data processing is conducted using Python, involving data cleaning, feature extraction, and normalization. Three machine learning algorithms, namely Linear Regression, Support Vector Regression (SVR), and Random Forest, are employed to model the relationship between voltage and energy consumption. Experimental results indicate that the bitemporal schema effectively maintains complete historical records, while the machine learning models demonstrate reliable performance in consumption modeling. The proposed approach enhances data transparency, improves information quality, and provides a robust foundation for developing reliable electricity monitoring systems.