Overview
Device Microservices (Device Service) is an independent service in the IoT platform responsible for the full lifecycle management of devices. It is divided in function with Data Microservices (manage data) and Alarm Microservices (manage alarms). Device Microservices adopt a microservice architecture to implement functions such as device registration, authentication, status tracking, shadow synchronization, OTA upgrades, and command issuance. It supports horizontal scaling and can handle millions of devices. In scenarios like smart homes, industrial monitoring, and vehicle networking, Device Microservices serve as the "control hub" between applications and devices. Applications use Device Microservices APIs to get device lists, issue control commands, and query device status without directly communicating with the devices.
Device Microservices work closely with access gateways and authentication microservices: the access gateway handles device connections, Device Microservices manage device profiles and business logic; authentication microservices handle identity verification, while Device Microservices handle device metadata and permissions. Device Microservices usually cache device status in Redis, store device profiles in distributed databases, and store device shadows separately (or embedded in document databases), achieving high concurrency in reading and writing.
Core Capabilities
Device Registration and Product Management
Product definition (thing model, communication protocol, data format), device creation (triple ProductKey+DeviceName+DeviceSecret or certificate), bulk import, pre-registration. Supports binding devices with IoT SIM cards to achieve "integrated SIM-device" management. Device profile includes device ID, product, group, tags, extended attributes, etc.
State management
Online/offline status, last active time, connection node (access gateway instance). Status is updated by the access gateway when the device goes online or offline, and the device microservice provides query APIs. Supports statistical online rate by product, group, and region. Works with cache to achieve millisecond-level status query.
Device shadow
Synchronization of desired state and reported state. The application issues the desired state, and the device pulls and executes it after going online; the device reports status to update the shadow in real time. Supports offline commands: the application can still issue commands when the device is offline, which automatically sync when the device comes online. See Device Shadow for details.
Command issuance
Synchronous call: request-response mode, suitable for simple operations (like reading properties). Asynchronous call: returns immediately after issuance, then the device executes and reports back via message callback. Supports batch issuance (by group) and single device issuance. Commands are delivered to the access gateway via message queue or device shadow, and then pushed to the device by the gateway.
Use Cases
Smart Home: device control, scene linkage, status inquiry. Industrial Monitoring: device parameter configuration, remote diagnostics, batch operations. Connected Vehicles: remote locking, remote start, fault code reading. Coordinated with data services, alarm services, and OTA services, forming a complete IoT backend. In the scenario of IoT SIM cards and device management, SimtoLink requires device microservices to interface and integrate with card management and operators, achieving a unified view of devices and connectivity.