The present invention discloses a storage and query method and device for
monitoring data, and relates to the field of
computer technology. A specific implementation of the storage method includes: encoding the
monitoring data to be stored, and obtaining the encoded
monitoring data to be stored; when the time dimension information of the monitoring data to be stored is at the second level, storing the encoded monitoring data to be stored in a cache and a
database; when the time dimension information of the monitoring data to be stored is not at the second level, storing the encoded monitoring data to be stored in a
database. This implementation method performs encoding
processing on the monitoring data, which can significantly reduce the
disk space for data storage, and stores the second-level monitoring data in the cache and the
database respectively, which can meet the efficiency of different types of queries and ensure the query speed of recent data in the second-level monitoring data.