.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer

Introduction

With the continuous development of Internet of Things (IoT) technology, more and more enterprises and developers are starting to build their own device management and control platforms.

This article recommends a universal IoT development platform architecture built on practical project experience. This platform has good scalability, flexibility, and maintainability, making it suitable for device access and control in various industry scenarios.

This platform not only achieves unified integration of underlying communication services but also covers multiple modules such as data processing, logging, security mechanisms, and UI interaction, providing a solid foundation for quickly building various IoT systems.

Project Overview

The IoT platform adopts a layered architecture design, covering a complete system from the underlying communication to the upper application:

  • Communication Layer: Supports various protocols such as TCP, UDP, serial port, and Bluetooth;

  • Data Processing Layer: Includes database operations, JSON/Protobuf serialization, audio processing, etc.;

  • Business Logic Layer: Device management, channel definition, protocol parsing, etc.;

  • Logging and Security Layer: Comprehensive logging and encryption/decryption mechanisms;

  • UI and Control Layer: Visual interface and interactive control;

  • Script Extension Layer: Supports Lua scripts for flexible business extensions.

This architecture supports networking mode and standalone control mode, allowing for flexible deployment based on project requirements.

Project Architecture

Software architecture description: The underlying layer can be networked or controlled independently, as shown in the following diagrams:

.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer
.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer

Project Modules

1. Audio Processing Module

Used for playing, constructing, and receiving WAV format audio files, suitable for scenarios requiring voice prompts or broadcast monitoring.

2. Communication Module

Integrates commonly used communication protocols:

  • TCP / UDP network communication

  • Serial communication (COM)

  • Bluetooth connection support

This is the core foundational module for achieving device interconnection on the platform.

3. DapperExtend ORM Extension Module

Enhances the functionality of the open-source ORM framework Dapper, supporting the following databases:

MSSQL, SQLite, Oracle

Simplifies the database operation process and improves development efficiency.

4. Native Database Module

Provides native SQL operation interfaces, supporting mainstream relational databases:

Access, MySQL, Oracle, MSSQL, SQLite

Suitable for data access scenarios with high performance requirements.

5. Device Management Module

This module defines and integrates:

  • Communication bus (UDP/TCP/serial)

  • Protocol interfaces and device connection interfaces

  • Data bus definitions

  • Encapsulation of common device protocols such as Siemens PLC

This is a key module for device access and control.

6. JSON Serialization Module

Responsible for the conversion between objects and JSON format, with plans to integrate Protobuf and BSON support in the future to meet high-performance data transmission needs.

7. Log4NetEx Logging Extension Module

Encapsulates the open-source logging component Log4Net, providing richer logging output methods and configuration options.

8. Native Logging Module

Implements log reading and writing using independent threads, with a simple and efficient structure, supporting the generation of various types of logs, widely used in multiple projects.

9. LuaScript Extension Module

By integrating the Lua scripting engine, it enables dynamic calls to C# functions, facilitating flexible data processing and control logic, especially suitable for configuration software development.

10. NetBase Network Request Module

Encapsulates commonly used network communication functions, including:

  • HTTP requests

  • WebService calls

  • File downloads

Provides support for the platform’s integration with the cloud or other systems.

11. Protobuf Data Serialization Module

Integrates Google’s open-source Protobuf protocol, providing lightweight and efficient serialization and deserialization capabilities, suitable for cross-platform data exchange.

12. SecurityUtil Security Tools Module

Includes commonly used encryption algorithms and security functions:

  • DES encryption and decryption

  • RSA asymmetric encryption

  • Verification code generation

Ensures the security of data transmission and storage on the platform.

13. Util Utility Class Collection Module

Integrates a large number of practical small tools, covering the following functions:

  • CRC check

  • CSV / INI / Excel file operations

  • XML serialization

  • Image processing (thumbnail, watermark, color filter, grayscale, etc.)

  • Time and calendar processing

  • MD5 encryption

  • Reflection helper classes

  • Number to Chinese character conversion (e.g., capitalizing amounts)

This is one of the most reused general modules in the platform.

Project Application Scenarios

Example 1: Olfactory Ability Challenge

This project uses an odor simulation device, combined with audio prompts and user interaction, where the platform’s Audio module, Devices module, and LuaScript module play key roles.

.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer

Example 2: Hotel Check-in Kiosk

Realizes functions such as ID card recognition, room card issuance, and information printing, relying on modules like NetBase, DataBases, and SecurityUtil for data interaction and security verification.

.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer

Example 3: Olfactory Detector

An instrument for odor detection and analysis, utilizing the Devices module to connect sensors, the Log module to record experimental data, and Protobuf for remote data reporting.

.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer

Example 4: Speed Limiter Testing System

Interacts with devices through serial communication, using the Communication module to obtain device status in real-time, and the Logs module to record the testing process, ensuring data integrity.

.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer

Example 5: Odor Vortex Cannon

Combining sound, gas release, and other multi-dimensional controls, the platform’s Audio, LuaScript, and Devices modules work together to achieve complex linkage effects.

.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer

Project Source Code

GitHub: https://github.com/kingkie/MyPlatform

Conclusion

This article introduces a universal IoT platform architecture validated by multiple projects, with advantages including:

✅ Modular design: Each functional module has clear responsibilities, making it easy to expand and maintain;

✅ Rich communication protocols: Supports various device access methods such as TCP/UDP/serial/Bluetooth;

✅ Powerful data processing: Integrates core capabilities such as databases, JSON, Protobuf, and encryption;

✅ High security: Equipped with comprehensive logging and encryption/decryption mechanisms;

✅ Wide applicability: Successfully implemented in multiple industry scenarios.

The above only showcases part of the IoT platform’s functionalities. For more practical features and detailed information, please visit the project source code.

I hope this article can provide valuable references for technical personnel engaged in IoT development. Thank you for reading this article, and I welcome discussions and exchanges on more experiences regarding IoT platform design and implementation!

Keywords: #IoT Platform, #WPF, #Device Communication, #Modular Architecture, #Dapper, #Log4Net, #Protobuf, #C#, #Industrial Automation, #Smart Hardware

FinallyIf you find this article helpful, please give it a thumbs up to support! Your support is my motivation to continue sharing knowledge. If you have any questions or need further assistance, feel free to leave a message. You can also join the WeChat public account[DotNet Technology Craftsman] community to exchange insights with other technology enthusiasts and grow together!

Author: Xiao Ma Bian Jiang

Source: gitee.com/smallcore/DotNetCoreStatement: Online content is for learning purposes only, respecting copyright, and will be deleted upon infringement, apologies and thanks!ENDFacilitating communication, resource sharing, and mutual growthA pure technical exchange group, if you want to join, please scan the code and noteJoin Group

.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application Layer

Recommended ReadingUpper computer development: C# reading and writing PLC data block dataEnterprise-level asset management system (AMS) developed with WinForm + FastReportIoT teaching visualization tool development based on MQTTnet and SunnyUIWinForm retail ERP cash register system – efficient cash register solution for supermarkets and convenience storesWinForm + SunnyUI practical: Developing communication software supporting serial, Socket, and industrial protocolsIndustrial IoT monitoring system practical: Based on WinForm’s S7/Modbus protocol integration and architecture optimization

Do you feel you have gained something? Please share it to benefit more people

Follow “DotNet Technology Craftsman“, to enhance technical strength together

.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application LayerCollect.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application LayerLike.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application LayerShare.NET Universal IoT Platform: Full-Stack Design from Communication Layer to Application LayerLooking

Leave a Comment