Alibaba Cloud Iot framework ServerSuperIO tutorial-20. Network Communication Controller grouping to improve interactive load balancing capabilities. V3.6.6 released, Iot Controller
20.1 Overview
ServerSuperIO originally had only one network controller in network communication mode. in self-control mode, concurrency mode, and Singleton mode, the returned data is processed asynchronously without any performance problems. However, in the round-robin mode, a network controller needs to operate device-driven sending and receiving one by one in order, so that the round-robin cycle is too long to reach the data read frequency.
To solve the above problem, the network controller grouping function is now added to the device driver parameters. The network controller controls the device driver according to the group name set by the device parameters. For example, if there are 1000 device drivers in polling mode, you can set the same group name for each 10 device drivers. These 10 device drivers are controlled by the same network controller, if data is read every 1 s, the polling cycle of each device driver is 10 s, similar to that of other network controllers.
20.2 network controller
Static void Main (string [] args) {string deviceID = "2"; DeviceDriver dev3 = new DeviceDriver (); dev3.DeviceParameter. deviceName = "device 2"; dev3.DeviceParameter. deviceAddr = 0; dev3.DeviceParameter. deviceID = deviceID; dev3.DeviceParameter. deviceCode = deviceID; dev3.DeviceDynamic. deviceID = deviceID; dev3.DeviceParameter. NET. remoteIP = "127.0.0.1"; dev3.DeviceParameter. NET. remotePort = 9600; dev3.DeviceParameter. NET. controllerGroup = "G2"; dev3.CommunicateType = CommunicateType. NET; dev3.DeviceParameter. NET. workMode = WorkMode. tcpServer; dev3.Initialize (deviceID); deviceID = "3"; DeviceDriver dev4 = new DeviceDriver (); dev4.DeviceParameter. deviceName = "device 3"; dev4.DeviceParameter. deviceAddr = 0; dev4.DeviceParameter. deviceID = deviceID; dev4.DeviceParameter. deviceCode = deviceID; dev4.DeviceDynamic. deviceID = deviceID; dev4.DeviceParameter. NET. remoteIP = "127.0.0.1"; dev4.DeviceParameter. NET. remotePort = 9600; dev4.DeviceParameter. NET. controllerGroup = "G3"; dev4.CommunicateType = CommunicateType. NET; dev4.Initialize (deviceID); IServer server = new ServerManager (). createServer (new ServerConfig () {ServerName = "Service 1", ComReadTimeout = 1000, ComWriteTimeout = 1000, NetReceiveTimeout = 1000, NetSendTimeout = 1000, ControlMode = ControlMode. loop, SocketMode = SocketMode. tcp, StartReceiveDataFliter = false, ClearSocketSession = true, StartCheckPackageLength = false, CheckSameSocketSession = false,}); server. addDeviceCompleted + = server_AddDeviceCompleted; server. deleteDeviceCompleted + = server_DeleteDeviceCompleted; server. socketConnected + = server_SocketConnected; server. socketClosed + = server_SocketClosed; server. start (); server. addDevice (dev3); server. addDevice (dev4); while ("exit" = Console. readLine () {server. stop ();}}
1. [serialization] C # communication (Serial Port and network) Framework Design and Implementation
2. [Open Source] C # cross-platform Iot communication framework ServerSuperIO (SSIO) Introduction
2. Overall system construction solution using SuperIO and open-source cross-platform Iot framework ServerSuperIO
3. C # technical route of industrial IoT and integrated system solutions (data sources, , data upload and receiving, ActiveMQ, Mongodb, WebApi, and mobile App)
5. ServerSuperIO Open Source Address: https://github.com/wxzz/ServerSuperIO
Internet of Things & integrated technology (. NET) QQ group: 54256083
: Http://www.bmpj.net/thread-14-1-1.html
1. C # Introduction to cross-platform Iot communication framework ServerSuperIO (SSIO)
Serialization | Iot framework ServerSuperIO tutorial 1.4 communication modes and mechanisms.
Serialization | Iot framework ServerSuperIO tutorial 2. service instance configuration parameters
Serialization | Iot framework ServerSuperIO tutorial-3. Device Driver Introduction
Serialization | Iot framework ServerSuperIO tutorial-4. For example, you can develop a device driver that supports both serial and network communication.
Serialization | Iot framework ServerSuperIO tutorial-5. Polling communication mode development and precautions.
Serialization | Iot framework ServerSuperIO tutorial-6. concurrent communication mode development and precautions
Serialization | Iot framework ServerSuperIO tutorial-7. Self-control communication mode development and precautions
Serialization | Iot framework ServerSuperIO tutorial-8. single-instance communication mode development and precautions
Serialization | Iot framework ServerSuperIO tutorial-9. protocol filter to solve multiple packet-related, sticky packet, and redundant data
Serialization | Iot framework ServerSuperIO tutorial-10. Two Methods for continuous transmission of large data streams (such as files)
Serialization | Iot framework ServerSuperIO tutorial-11. Implement device (driver) and device (driver) interaction and cascade control.
Serialization | Iot framework ServerSuperIO tutorial-12. Service Interface Development and bidirectional interaction with the cloud
Serialization | Iot framework ServerSuperIO tutorial-13. Custom View display interface development to meet different display requirements
Serialization | Iot framework ServerSuperIO tutorial-14. Introduction to preparation tools and mounting of device drivers, view drivers, and service instances
Serialization | Iot framework ServerSuperIO tutorial-15. Use of data persistence Interfaces
Serialization | Iot framework ServerSuperIO tutorial-16.OPC Server usage steps
Serialization | Iot framework ServerSuperIO tutorial-17. Support for real-time databases and high-concurrency storage of measurement point data
Serialization | Iot framework ServerSuperIO tutorial-18. Integrated OPC Client and usage steps
Serialization | Iot framework ServerSuperIO tutorial-19. device drivers and OPC Client Support persistence of mysql, oracle, sqlite, and sqlserver