O MongoDB oferece uma plataforma dimensionável para sistemas de medição inteligente, o que possibilita a coleta de dados em tempo real, análise de séries temporais e detecção de anomalias.
Casos de uso: IoT, Análise orientada por aplicativos, Visão única
Setores: Manufatura e mobilidade, energia e meio Ambiente
Produtos e ferramentas: MongoDB Atlas, MongoDB Atlas Charts, MongoDB Change Streams, MongoDB Time Series Collections, MongoDB Query Language
Parceiros: Cedalo
Visão Geral da Solução
As smart meter technology adoption rises, MongoDB provides a comprehensive platform for managing and analyzing smart meter time series data at scale. This smart meter solution helps utility companies:
- Collect high-frequency meter readings 
- Process streaming data in real time 
- Store historical data efficiently 
- Detect anomalies to identify issues like voltage spikes, power outages, or unusual consumption patterns 
This solution leverages the following MongoDB integrations and features to allow companies to scale while maintaining performance and data accessibility:
- IoT messaging protocol integration: MongoDB's integration with IoT messaging protocols like MQTT allows for reliable data ingestion from smart meters' head-end units. 
- MongoDB Atlas: MongoDB Atlas' native time series support enables efficient storage and querying of temporal data. 
- Advanced MongoDB Features: Advanced features like data tiering and Atlas Online Archive help manage historical data cost-effectively. 
- Analytics and monitoring: Built-in analytics capabilities enable real-time monitoring and operational insights through customizable dashboards and reports. 
Arquiteturas de referência
This solution contains two main components: Smart Meter Data Storage and Smart Meter Data Management with MongoDB.
Armazenamento de dados de medidores inteligentes
To use smart metering, power utility companies deploy a core smart metering ecosystem that includes the following components:
- Smart meters: Smart meters collect data from end consumers and transmit it to the data aggregator through the LAN. You can adjust the transmission frequency to 15 minutes, 30 minutes, or hourly, depending on data demand requirements. 
- Meter data collection network: The aggregator retrieves the smart meter data and then transmits it to the HES. 
- Head-end system: The HES analyzes the data and sends it to the MDMS. The initial communications path uses commands that you can send directly to the meters, customer premise, or distribution device. 
- Meter data management system: The MDMS system uses MongoDB Atlas as the backend database for this solution. Once the data reaches the HES, an MQTT provider transmits it to MongoDB Atlas. MongoDB Atlas stores the smart meter data, including information such as meter ID, timestamp, and measurements like energy, current, or voltage. 
Leading MQTT broker providers, such as Cedalo, have MongoDB integrations that enable seamless data transfer and efficient management of the information that smart meters collect. This solution employs the Cedalo Pro Mosquitto MQTT broker to facilitate effective message transmission. The Cedalo broker connects to MongoDB and ensures a continuous flow of data between the two systems.
Smart Meter Data Management with MongoDB
Once you store the smart meter data in MongoDB Atlas, you can analyze it for anomalies and insights. This solution leverages three key MongoDB features to create a next generation MDMS:
MongoDB change streams enable real-time capturing and processing of database changes, like insert operations, to provide immediate insights into energy consumption patterns, system anomalies, and potential faults. Real-time capability in smart meter systems allows for timely analysis using the MongoDB aggregation framework, detecting anomalies and preventing costly damages and service disruptions.
MongoDB stores the analyzed data in time series collections. These specialized collections do the following for your smart meter data:
- Provide high compression 
- Enhance query performance of time series data 
- Enable fast operations 
Figura 1. Arquitetura de sistema de gerenciamento de medidores inteligentes de ponta a ponta
Abordagem do modelo de dados
This solution uses two time series data models. You can use the first model for raw smart meter data with meter_id as the metaField:
{   "_id": "668cb56d3830323642e562d9" ,   "timestamp": { "$date": "1720497517183" },   "power_factor": 0.89 ,   "power": 220.1 ,   "frequency": 49.85,   "meter_id": 1,   "energy": 0.22,   "current": 1,   "voltage": 219.38 } 
The second dataset includes anomalies detected in various measurements based on predefined criteria. In the following example, anomalies are readings that are over three standard deviations from the mean values. This dataset uses meter_id as the metaField:
{   "_id": "668d4a023819ef77d3fc84d8",   "timestamp": { "$date": "1720535553856" },   "meter_id": 3,   "data": {     "voltage": 190.06,     "current": 18.13,     "power": 3445.67,     "energy": 3.45,     "power_factor": 0.76,     "frequency": 49.92   },   "anomalies": ["voltage", "current"] } 
Construir a solução
This smart meter data management solution uses MQTT broker and MongoDB Atlas to collect and analyze modern energy infrastructure data.
Observação
While this implementation showcases Cedalo's MQTT Broker, this solution is broker-agnostic and supports integration with various MQTT providers.
Use the following procedure to set up your smart meter data management system with MongoDB. For a more detailed implementation of this solution, see the GitHub repository.
Set up your MQTT broker
- Set up your MQTT broker for reliable message handling. 
- Configure a integração do broker com o MongoDB. 
- Estabeleça pipelines seguros para streaming de dados. 
- Habilite a coleção de dados em tempo real de medidores inteligentes. 
- Implemente o gerenciamento e o monitoramento de brokers. 
Configure your database
- Create a MongoDB database with required collections. 
- Set up time series collections for: - Anomalies data 
- Metrics data 
- Transformed data 
 
- Configure pipelines de transformação de dados. 
- Ative as funcionalidades de processamento de dados em tempo real. 
Principais Aprendizados
- Data management is critical: Smart meters generate large volumes of time series data, which creates challenges in data interoperability, privacy, and processing. Solutions require flexible, scalable databases that handle high-frequency, complex data streams. 
- MQTT enables efficient IoT communication: Smart meter ecosystems need lightweight publish-subscribe protocols for efficient, secure data transmission between devices, aggregators, and management systems. 
- MongoDB offers comprehensive IoT data solutions: Time series collections, change streams, aggregation frameworks, and flexible document models help MongoDB address key smart meter challenges like anomaly detection, real-time analytics, and scalable data storage. 
- Use an integrated approach: Successful smart meter implementations combine messaging protocols like MQTT, advanced database technologies, and comprehehensive analytics to transform raw meter data into actionable insights. 
Autores
- Dr. Humza Akhtar, MongoDB 
- Rami Pinto, MongoDB 
- Sebastian Rojas Arbulu, MongoDB 
- Diego Canales, MongoDB