Интеграция средств восстановления пропусков временных рядов в режиме реального времени в реляционную СУБД

Алексей Артемьевич Юртин

Аннотация


В статье рассмотрена проблема интеграции восстановления временных рядов в реляционную СУБД. Предложен метод ImputeDB, обеспечивающий внедрение нейросетевых моделей восстановления пропусков в реальном времени в СУБД PostgreSQL. Восстановление пропусков осуществляется с помощью триггеров (хранимых функций, автоматически выполняемые ядром СУБД при наступлении события вставки новых данных). При активации триггера пропущенные значения заменяются синтетическими, генерируемыми обученной нейросетевой моделью. Используя предложенный метод, прикладной программист базы данных может внедрить процесс восстановления пропущенных значений в стандартный цикл обработки временных рядов, не прибегая к сторонним сервисам. Предложенный метод включает набор следующих программных компонентов, реализованных как пользовательские функции (UDF, user-defined functions) на языках Python и PL/Python: Конструктор триггеров, Менеджер моделей, Хранилище моделей и Восстановитель. Конструктор триггер используется для создания триггеров, которые автоматически выполняют восстановление пропущенных значений в вставляемых данных. Менеджер моделей отвечает за обучение нейросетевых моделей. Хранилище моделей используется для сохранения моделей в файловом хранилище. Восстановитель, в свою очередь, синтезирует пропущенные значения с помощью обученных моделей. В исследовании были проведены эксперименты для оценки производительности метода ImputeDB. В ходе экспериментов измерялось время обработки вставки данных с автоматическим восстановлением пропусков в зависимости от размерности временного ряда. Эксперименты проводились в двух сценариях (одиночная и множественная вставка). В качестве моделей восстановления использовались нейросетевые методы с различными архитектурами, включая рекуррентные нейросети, автоэнкодеры и трансформеры. Результаты экспериментов продемонстрировали, что в условиях увеличения размерности временного ряда, роста накладных расходов на сетевые запросы и передачу данных, ImputeDB показывает наилучшую производительность. В частности, система обеспечила прирост эффективности на 22.5% по сравнению с аналогом, при этом сохраняя точность восстановления используемых методов.

Ключевые слова


временной ряд; СУБД; PostgreSQL; восстановление пропущенных значений; нейронные сети

Полный текст:

PDF

Литература


Majumdar S., Laha A.K. Clustering and classification of time series using topological data analysis with applications to finance. Expert Syst. Appl. 2020. Vol. 162. P. 113868. DOI: 10.1016/j.eswa.2020.113868.

Kumar S., Tiwari P., Zymbler M.L. Internet of Things is a revolutionary approach for future technology enhancement: a review. J. Big Data. 2019. Vol. 6. P. 111. DOI: 10.1186/S40537-019-0268-2.

Seyedan M., Mafakheri F. Predictive big data analytics for supply chain demand forecasting: methods, applications, and research opportunities. J. Big Data. 2020. Vol. 7, no. 1. P. 53. DOI: 10.1186/S40537-020-00329-2.

Jensen S.K., Pedersen T.B., Thomsen C. Time Series Management Systems: A Survey. IEEE Trans. Knowl. Data Eng. 2017. Vol. 29, no. 11. P. 2581–2600. DOI: 10.1109/TKDE.2017.2740932.

Ivanova E.V., Zymbler M.L. Overview of Modern Time Series Management Systems. Bulletin of the South Ural State University. Series: Computational Mathematics and Software Engineering. 2020. Vol. 9, no. 4. P. 79–97. DOI: 10.14529/cmse200406.

Shen C., Ouyang Q., Li F., et al. Lindorm TSDB: A Cloud-native Time-series Database for Large-scale Monitoring Systems. Proc. VLDB Endow. 2023. Vol. 16, no. 12. P. 3715–3727. DOI: 10.14778/3611540.3611559.

Ivanova E.V., Zymbler M.L. Embedding of the Matrix Profile Concept Into a Relational DBMS for Time Series Mining. Bulletin of the South Ural State University. Series: Computational Mathematics and Software Engineering. 2021. Vol. 10, no. 3. P. 72–87. DOI: 10.14529/cmse210305.

Khalefa M.E., Fischer U., Pedersen T.B., Lehner W. Model-based Integration of Past & Future in TimeTravel. Proc. VLDB Endow. 2012. Vol. 5, no. 12. P. 1974–1977. DOI: 10.14778/2367502.2367551.

Fischer U., Rosenthal F., Lehner W. F2DB: The Flash-Forward Database System. IEEE 28th International Conference on Data Engineering (ICDE 2012), Washington, DC, USA (Arlington, Virginia), 1-5 April, 2012 / ed. by A. Kementsietsidis, M.A.V. Salles. IEEE Computer Society, 2012. P. 1245–1248. DOI: 10.1109/ICDE.2012.117.

Agarwal A., Alomar A., Shah D. tspDB: Time Series Predict DB. NeurIPS 2020 Competition and Demonstration Track, 6-12 December 2020, Virtual Event / Vancouver, BC, Canada. Vol. 133 / ed. by H.J. Escalante, K. Hofmann. PMLR, 2020. P. 27–56. Proceedings of Machine Learning Research. URL: http://proceedings.mlr.press/v133/agarwal21a.html.

Arous I., Khayati M., Cudré-Mauroux P., et al. RecovDB: Accurate and Efficient Missing Blocks Recovery for Large Time Series. 35th IEEE International Conference on Data Engineering, ICDE 2019, Macao, China, April 8-11, 2019. IEEE, 2019. P. 1976–1979. DOI: 10.1109/ICDE.2019.00218.

Ariyo A.A., Adewumi A.O., Ayo C.K. Stock Price Prediction Using the ARIMA Model. UKSim-AMSS 16th International Conference on Computer Modelling and Simulation, UKSim 2014, Cambridge, United Kingdom, March 26-28, 2014 / ed. by D. Al-Dabass, A. Orsoni, R.J. Cant, et al. IEEE, 2014. P. 106–112. DOI: 10.1109/UKSIM.2014.67.

Salinas D., Flunkert V., Gasthaus J., Januschowski T. DeepAR: Probabilistic forecasting with autoregressive recurrent networks. International Journal of Forecasting. 2020. Vol. 36, no. 3. P. 1181–1191. DOI: https://doi.org/10.1016/j.ijforecast.2019.07.001.

Lim B., Arik S.Ó., Loeff N., Pfister T. Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting. CoRR. 2019. Vol. abs/1912.09363. arXiv: 1912.09363. URL: http://arxiv.org/abs/1912.09363.

Cao W., Wang D., Li J., et al. BRITS: Bidirectional Recurrent Imputation for Time Series. Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada / ed. by S. Bengio, H.M. Wallach, H. Larochelle, et al. 2018. P. 6776–6786. URL: https://proceedings.neurips.cc/paper/2018/hash/734e6bfcd358e25ac1db0a4241b95651-Abstract.html.

Yoon J., Zame W.R., Schaar M. van der. Estimating Missing Data in Temporal Data Streams Using Multi-Directional Recurrent Neural Networks. IEEE Trans. Biomed. Eng. 2019. Vol. 66, no. 5. P. 1477–1490. DOI: 10.1109/TBME.2018.2874712.

Fortuin V., Baranchuk D., Rätsch G., Mandt S. GP-VAE: Deep Probabilistic Time Series Imputation. The 23rd International Conference on Artificial Intelligence and Statistics, AISTATS 2020, 26-28 August 2020, Online [Palermo, Sicily, Italy]. Vol. 108 / ed. by S. Chiappa, R. Calandra. PMLR, 2020. P. 1651–1661. Proceedings of Machine Learning Research. URL: http://proceedings.mlr.press/v108/fortuin20a.html.

Du W., Côte D., Liu Y. SAITS: Self-attention-based imputation for time series. Expert Syst. Appl. 2023. Vol. 219. P. 119619. DOI: 10.1016/J.ESWA.2023.119619.

Oh E., Kim T., Ji Y., Khyalia S. STING: Self-attention based Time-series Imputation Networks using GAN. CoRR. 2022. Vol. abs/2209.10801. DOI: 10.48550/ARXIV.2209.10801. arXiv: 2209.10801.

Fang C., Wang C. Time Series Data Imputation: A Survey on Deep Learning Approaches. CoRR. 2020. Vol. abs/2011.11347. arXiv: 2011.11347. URL: https://arxiv.org/abs/2011.11347.

Wang J., Du W., Cao W., et al. Deep Learning for Multivariate Time Series Imputation: A Survey. CoRR. 2024. Vol. abs/2402.04059. DOI: 10.48550/ARXIV.2402.04059. arXiv: 2402.04059.

Silberschatz A., Korth H.F., Sudarshan S. Database System Concepts, Seventh Edition. McGraw-Hill Book Company, 2020. URL: https://www.db-book.com/.

Yurtin A.A. Imputation of Multivariate Time Series Based on the Behavioral Patterns and Autoencoders. Bulletin of the South Ural State University. Series: Computational Mathematics and Software Engineering. 2024. Vol. 13, no. 2. P. 39–55. DOI: 10.14529/cmse240203.

Zymbler M., Goglachev A. Fast summarization of long time series with graphics processor. Mathematics. 2022. Vol. 10, no. 10. P. 1781. DOI: 10.3390/math10101781.

Imani S., Madrid F., Ding W., et al. Introducing time series snippets: A new primitive for summarizing long time series. Data Min. Knowl. Discov. 2020. Vol. 34, no. 6. P. 1713–1743. DOI: 10.1007/s10618-020-00702-y.

Bilenko R.V., Dolganina N.Y., Ivanova E.V., Rekachinsky A.I. High-performance Computing Resources of South Ural State University. Bulletin of the South Ural State University. Series: Computational Mathematics and Software Engineering. 2022. Vol. 11, no. 1. P. 15–30. DOI: 10.14529/cmse220102.

Zymbler M.L., Polonsky V.A., Yurtin A.A. On One Method of Imputation Missing Values of a Streaming Time Series in Real Time. Bulletin of the South Ural State University. Series: Computational Mathematics and Software Engineering. 2021. Vol. 10, no. 4. P. 5–25. DOI: 10.14529/cmse210401.




DOI: http://dx.doi.org/10.14529/cmse250102