This application discloses a method, apparatus, and electronic device for storing and retrieving process data in a power
monitoring system, relating to the field of power
monitoring data processing. It parses event information in a preset format sent by data producers to determine at least the following fields: event
timestamp,
event data source identifier,
event type, and a description of the associated business content. Then, based on the
data source identifier, the first storage partition of the
data source in the data storage space is determined from a sharding
routing table. Further, based on the
timestamp and a time interval length threshold, the first storage
shard of the
data source in the first storage partition is determined from the sharding
routing table. The storage shards determined by the data source identifier and
timestamp are sorted according to storage rules and stored in the first storage
shard. This allows users to retrieve multiple types of data from the data source at once when querying based on time or data source identifier, improving the flexibility of
system expansion and query efficiency.