The serial | Internet of Things Framework Serversuperio Tutorial 1.4 Communication mode mechanism. Elementary: Recruit. NET development, and he turned to Java, and it was all about life.

Source: Internet
Author: User

Recently learned a framework, thanks to the network name: only smile to share

Original Bo main original address: http://www.cnblogs.com/lsjwq/

First, feeling

In college, did not learn C #, spent 5 yuan in the Ditan Book Fair bought a tutorial, it is officially entered. Later study, learned Java, later forced to livelihood, intends to turn Java. Later considered, the framework of his own writing still has a lot of room for development, and later in the C # position persisted down. From the beginning of the embryonic, to the superio of the product, and then to the server side of the Serversuperio, but also slowly evolved. Later, I intend to transplant the Serversuperio into the embedded device and develop the documentation. Originally did not want to mention these, but today intends to recruit a C # Developer (b/s), is a group of friends, but others want to turn Java development, can only say that fate is not, can not work together, behind with some chat records, for everyone career development reference.

Ii. Questions and Answers

Some people ask, you this frame and supersocket, Netty ... What's the difference? Serversuperio is the communication framework? Yes; Serversuperio support high concurrency no? theoretically supported; Serversuperio support cross-platform? Ran on Ubuntu. But these are not serversuperio at the beginning of the design of the first point, it inherits the Superio design ideas, the latter gradually to the service side of the development, strengthen communication capabilities, cross-platform and so on.

Serversuperio is an IoT framework, first of all the framework built on the device (sensor), the Protocol independence of the Device (sensor), and the ability to mount the device drive under the frame. So Serversuperio essentially coordinates the relationship between device drivers (protocols), IO channels (COM and net), and operating mechanisms (schemas) to seamlessly combine and run.

has been mixed in the industrial field, do integrated systems, remote monitoring monitoring and so on, so Serversuperio is not only a communication framework, more is a combination of work experience, in line with the ability to solve the real problem.

Three, Operation control mode

1. Polling mode

This is the first operating mode of the framework, the serial port and network communication can use this control mode. When multiple devices are connected to a communication platform, the communication platform polls the dispatch device for communication tasks. Only one device at a time can send a request command, wait to receive the return data, the device completes the send, receive (automatically returns if a timeout occurs), the next device does the communication task, polling the device in turn.

The application scenario is that the service side communicates with the device to follow the call answering method, that is, when the IO is available, the server initiates the Communication command request, the device according to the command information, the inspection passes back the data to the service side. This communication pattern is well understood, and each device's communication follows the principle of queuing. But what if a device's commands need to be sent in a timely manner? Serversuperio Framework is to support device priority scheduling, such as: for a device to be in real-time detection, need to send commands continuously, then you need to high-level device settings, send request data command.

Communication structures such as:

2. Concurrency mode

In the case of network communication, the polling mode is obviously less efficient, then the concurrency mode can be used. The concurrent traffic mode is centralized to all device request instructions, the framework is the use of cyclic synchronization to send the request command to each IO channel corresponding device, of course, can also be in parallel to send request commands in a centralized manner. After the hardware equipment receives the instruction to verify, after the verification succeeds returns the corresponding instruction the data, the communication platform asynchronously hears the data information, carries on the reception operation, then carries on the data the dissemination, the processing and so on.

So here is the data received by the IO Channel is received asynchronously, how to match the device driver matching (data distribution to the device driver), this can be over Devicecode and DEVICEIP two ways to achieve. Devicecode can be a device address or device encoding, DEVICEIP is pre-set parameters, requires the terminal device IP address is fixed.

Communication structures such as:

3. self-control mode

This control mode can be used only for network communication. The self-control communication mode is similar to the concurrent communication mode, the difference is that the sending instruction operation is given to the device driver itself for control, or to two developers, two times the developer can send the instruction data in event-driven manner through the clock timing. After the hardware equipment receives the instruction to verify, after the verification succeeds returns the corresponding instruction the data, the communication platform asynchronously hears the data information, carries on the reception operation, then carries on the data the dissemination, the processing and so on.

The self-control communication mode can provide accurate timing request real-time data mechanism for two time developers, make communication mechanism more flexible and autonomous, if multiple devices drive using the same IO channel, TIME control will be biased.

Also involves the distribution of data, as is the case with concurrency patterns.

Communication structures such as:

4. single-case mode

This control mode can be used only for network communication. There can be only one device driver in a service instance, which is equivalent to a device driver that corresponds to n multiple hardware device terminals. Data protocols that are more suitable for communication have a fixed standard for processing different data with the command keyword. It is suitable for the high concurrent hardware terminal device to upload data actively, and the server to process and return the corresponding data according to the data information.

Communication structures such as:

Iv.. NET development, the result he turned to Java, everything is for life

Recent work is busy, development, problem solving, recruitment ..., even the time to look at the mobile phone is not, eat is also a hurry. In order to better promote the platform of construction, really need people, but also for the future reserve talent, in the group and netizens chat, originally small guy is very interested in the early days. Today asked his thoughts, the results are going to go to Java, but also the reason for my feelings ahead of the article. In order to survive, he also to survive, are understandable.

Please refer to the following chat history:

The serial | Internet of Things Framework Serversuperio Tutorial 1.4 Communication mode mechanism. Elementary: Recruit. NET development, and he turned to Java, and it was all about life.

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.