Alibaba Cloud Iot framework ServerSuperIO tutorial-23. Dynamic Data interfaces increase the cache to improve the efficiency of data output to OPCServer and (Real-Time) databases,

Source: Internet
Author: User

Alibaba Cloud Iot framework ServerSuperIO tutorial-23. Dynamic Data interfaces increase the cache to improve the efficiency of data output to OPCServer and (Real-Time) databases,

22.1 overview and problems to be solved

The device driver has the DeviceDynamic interface, which can inherit and add new real-time data attributes, and update these attribute data after each communication is completed. In the past, the DeviceDynamic interface was used to obtain the latest real-time data through object reflection and output it to interfaces such as relational database, real-time database, and OPC Server.

However, this operation has two problems:1.Reflection is not efficient. 2.If it is a sensor, there are not many defined real-time data attributes. If it is data uploaded by a site (which can be understood as a production unit or gateway layer), there may be thousands of monitoring sites, therefore, it is impossible to inherit DeviceDynamicDefine so many attributes in the subclass of the interface. The original operation method is as follows:


To solve the preceding problem, the DynamicCache attribute cache interface is defined in the DeviceDynamic interface to store monitoring data in KeyValue mode. That is to say, if the device driver receives a batch of monitoring data, it can be cyclically stored in the DynamicCache cache and then output to interfaces such as relational database, real-time database, and OPC Server. The new operation method is as follows:


The following describes how to use the device drivers, configure output monitoring points, and configure parameters.

22.2 Device Drivers

Some netizens may have already written the device driver. On this basis, they need to put the data information in the DynamicCache cache. The following code:

if (cr == CommandArray.RealTimeData){    Dyn dyn = (Dyn)obj;    _deviceDyn.DynamicCache.AddOrUpdate("flow",dyn.Flow);    _deviceDyn.DynamicCache.AddOrUpdate("signal",dyn.Signal);}
22.3 configure the output monitoring point

In the root directory, open the “serversuperio.tool.exe tool and add the standard names to be output to interfaces such as relational databases, real-time databases, and OPC servers in the DynamicCache cache of the device driver to the configuration items in tag configuration. For example, flow and signal. For example:

In the same example, open the “serversuperio.tool.exe tool and click basic configuration ].

If you want to output data to the OPC Server interface, first install the corresponding components. In the "OPC tools and components" directory, configure the following parameters:

If you want to output data to a relational database or a real-time database, configure the following parameters:

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 collection, 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

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.