The invention discloses a time series data aggregation retrieval method and device and a medium. The method comprises a database for storing the time series data, and comprises the steps of firstly, optimizing the time series database, adding a statistical level concept for the data storage, carrying out the hierarchical fragmentation storage of the time series data, and providing the data structure support for the optimization of the time series data aggregation retrieval; when the time series data is subjected to statistical query, applying different query algorithms according to different statistical query requests, and subjecting the time series data to the statistical query in combination with the hierarchical fragmented data storage structure. When the data is written into the database, the data only needs to be subjected to hierarchical fragmentation statistics according to the determined hierarchical fragmentation rule so as to record the data characteristics, and conditions for future query and retrieval are not considered in the writing process; during the statistical query, according to the retrieval conditions, the original data and all levels of statistical data are used, a statistical result is calculated after optimization and combination without depending on mass original data, so that the data access amount is reduced, and the retrieval efficiency is improved.