Source: http://blog.csdn.net/bichenggui/article/details/7889638
Recently, a data center solution based on grps dtu data transmission needs to be developed, so I found some materials. I personally think it is very useful.
Gprs dtu is the full name of the GPRS data transmission unit. Currently, there is a more explicit Convention on gprs dtu in China: gprs dtu is specially usedSerial Port DataPassGPRSNetworkThe GPRS wireless device for transmission.
Four core functions of gprs dtu:
1) internal integration of TCP/IP protocol stack: gprs dtu encapsulates the PPP dialing protocol and TCP/IP protocol stack and has an embedded operating system, it can be seen as a combination of embedded PC and wireless GPRS Modem. It has the functions of GPRS dial-up Internet access and TCP/IP data communication.
2) provides two-way conversion of serial data: the gprs dtu wireless transmission module provides a serial communication interface, including RS232, RS485, rs422, and so on, in addition, gprs dtu has designed the serial port data to be a "transparent conversion" method. That is to say, gprs dtu can convert the original data on the serial port into TCP/IP data packets for transmission, instead of changing the original data communication content. Therefore, gprs dtu can be connected to a variety of user devices that use serial communication, and do not need to be modified.
3) support for automatic heartbeat and permanent online: One of the advantages of the GPRS communication network is that the GPRS wireless transmission module is permanently online. Therefore, the typical gprs dtu supports permanent online functions in design, this requires that the gprs dtu includes automatic dial-up upon power-on and uses heartbeat packets to stay online permanently (when there is no data communication for a long time, the mobile gateway will disconnect the connection between the gprs dtu and the center, a heartbeat packet is a small packet sent before the connection between the gprs dtu and the data center is disconnected to keep the connection intact. It supports automatic reconnection and automatic dialing.
4) Support parameter configuration and permanent storage: as a communication device, gprs dtu is widely used. In different applications, the IP address and port number of the data center and the baud rate of the serial port are different. Therefore, gprs dtu should support parameter configuration and save the configured parameters in the internal permanent memory (generally flash or EEPROM ). Once powered on, the system automatically works according to the set parameters.
Ii. Extended functions of gprs dtu:
The professional gprs dtu also provides some extended functions, including: supports data center domain name resolution, remote parameter configuration/remote firmware upgrade, remote SMS/phone wake-up, local serial firmware upgrade, SMS channel, and online/offline DTU level indication..
These extended functions can enhance the reliability of the wireless transmission module system and facilitate the use and maintenance of users.
Iii. Working Principle of gprs dtu:
1) online monitoring system structure:
Site collection point:
User serial port Devices (various instruments, PLCs, single-chip microcomputer, and PCs) at the site collection point are connected to the gprs dtu terminal through RS232 or RS485/rs422 interfaces, the data sent by the user's serial port device is encapsulated by the internal embedded processor of the gprs dtu terminal, and then sent to the data center through the GPRS wireless network.
Monitoring Center:
A) Public Network Access Solution
Gprs dtu servers access the Internet through the public network, such as ADSL dial-up/Telecom leased line broadband access, and apply for dynamic domain names or public fixed IP addresses. This can be used to collect small and medium capacity data.
B) Private Network Access Plan
The gprs dtu server uses the ddnleased line provided by the provincial mobile communication company and applies for configuring a fixed IP address to connect to the GPRS network. Because the ddnleased line can provide a high bandwidth, when the number of site collection points increases, the center does not need to expand to meet the bandwidth requirements, and large-capacity data collection applications can be achieved. The RADIUS server of the monitoring center performs AAA authentication after receiving data from the GPRS network, and then transmits the data to the Computer Host of the monitoring center. The system software restores and displays the data and processes the data, this further enhances the system's data communication security performance.
Iv. gprs dtu process:
After the gprs dtu is powered on, read the working parameters stored in the Internal flash (including GPRS dialing parameters, serial port baud rate, data center IP address, etc., which have been configured in advance ).
Gprs dtu logs on to the GSM network and then performs gprs ppp dialing. After successful dialing, gprs dtu will obtain an internal IP address (generally 10. x) randomly assigned by mobile ). That is to say, gprs dtu is in the mobile Intranet, and its Intranet IP address is usually not fixed, and changes with each dial-up. It can be understood that gprs dtu is a device in a mobile internal LAN, which can communicate with the Internet through a mobile gateway. This is similar to the way computers in the LAN access the external network through the gateway.
DTU initiates a communication connection with the data center and keeps the Communication Connection continuously. Because gprs dtu is in the mobile Intranet, and the IP address is not fixed. Therefore, the gprs dtu can only be used to actively connect to the data center, rather than the gprs dtu. This requires the data center to have a fixed public IP address or a fixed domain name. The public IP address or fixed domain name of the data center is stored in the gprs dtu as the parameter, so that the gprs dtu can actively connect to the data center once the dial-up is successful.
Specifically, gprs dtu uses parameters such as the IP address of the data center (if the central domain name is used, the central IP address is resolved through the central domain name first) and the port number, initiate a TCP or UDP Communication Request to the data center. After receiving a response from the center, the gprs dtu deems that the handshake is successful with the center, and then the communication connection remains there. If the communication connection is interrupted, the gprs dtu will immediately shake hands with the center. Because the TCP/UDP communication connection has been established, two-way data communication can be performed.
For gprs dtu, as long as two-way communication with the data center is established, the conversion between user serial port data and GPRS network data packets is relatively simple. Once the user's serial port data is received, gprs dtu immediately encapsulates the serial port data in a TCP/UDP packet and sends it to the data center. Otherwise, when gprs dtu receives a TCP/UDP packet from the data center, it extracts the data and sends it to the User device through the serial port.
Two-way communication with multiple gprs dtu is also implemented through a wired data collection center. This is the most common method in the gprs dtu application system.
I am using a public network communication solution. A server with a public IP address is used as a data center and the self-developed DTU data communication program is running on it.
Concept of gprs dtu and working principle of DTU (conversion)