Real-time data transmission based on embedded TCP/IP
2026-04-06 06:15:13··#1
Abstract: This paper introduces a practical real-time data transmission system based on embedded TCP/IP technology and analyzes its hardware and software systems. Considering the decentralized nature of the system's controlled objects and the characteristics of networked management, the paper focuses on key technologies such as embedded operating systems, embedded TCP/IP technology, system reliability, and security. Keywords: Embedded system, TCP/IP, Reliability, Security 1 Introduction Currently, liquefied petroleum gas (LPG) is widely used in various fields of residential life and industrial production. Most LPG transactions require flow measurement of both gas and liquid. Existing systems mainly use weighing instruments as metering devices, with data collection and statistical summarization done manually. This manual method is time-consuming and labor-intensive, and prone to human error at various metering points, leading to unnecessary losses and loopholes. Furthermore, manual processing of LPG storage and transportation data is essentially a logistic process; the relationships between various raw data are separate, making timely querying and management inconvenient and hindering accurate business decisions. Applying embedded systems to liquefied petroleum gas (LPG) storage and transportation data allows for real-time monitoring of equipment operation, enabling autonomous operation without manual intervention. Secondly, it enables adaptive adjustment of its functions based on changes in equipment operating conditions, ensuring accurate monitoring and diagnosis. This eliminates potential loopholes in all aspects of LPG storage and transportation, improving enterprise economic efficiency. Finally, it allows for the organic combination of various types of raw LPG storage and transportation data, comprehensively handling data input, querying, statistics, display, and output, making the process of processing LPG storage and transportation data smooth, rational, fast, and accurate. 2. Embedded Systems and Their Real-Time Data Transmission System Solutions for LPG Storage and Transportation 2.1 Introduction to Embedded Systems Embedded systems do not appear as independent physical devices. Components of embedded systems are embedded within the main equipment according to the needs of the main equipment and applications, performing functions such as computation, processing, storage, and control. From an architectural perspective, embedded systems mainly consist of embedded processors, supporting hardware, and embedded software. Early embedded systems were based on a single chip and were mostly used in industrial control systems. Later, they evolved into new structures centered on embedded CPUs and embedded real-time operating systems (RTOS). However, with the development of information technology, network communication has become an essential consideration in embedded system design. Embedded TCP/IP technology can be considered a product of the integration of embedded computer systems and Internet technology, making Internet-based embedded systems a research hotspot. 2.2 Overall System Design Features This system features low power consumption, high reliability, and complete functionality. The system consumes only 1-3W of power. Due to its low power consumption, it is specifically designed for industrial applications. Therefore, rigorous verification and experimental analysis were conducted in all aspects, including component selection and anti-interference design, ensuring its operational reliability. The system uses a 32-bit microprocessor with a clock frequency of 400MHz or higher and a 100MHz bus, which can meet the needs of both high-speed real-time processing and large-capacity data transmission. The novel design architecture gives the entire system powerful processing capabilities and ample upgrade potential. For users, the system offers seamless operation due to operating system support, eliminating any noticeable system differences. For developers, programs previously written on the x86 platform only require recompilation and simple porting, maximizing resource protection and enhancing system scalability. 2.3 Hardware Structure: To accommodate the large data transmission volume, the core control chip in the real-time data acquisition and control box is the Intel XScale 255. Other circuits include A/D interfaces, I/O interface chips, voltage conversion chips, charging protection chips, filtering circuits, and display drivers. The network card chip used is the Realtek RTL8019AS, a low-cost, general-purpose Ethernet controller with a highly integrated design. The signals acquired by the field sensors—temperature, pressure, and flow—are all analog signals and require A/D conversion. The hardware structure block diagram is shown in Figure 1: [align=center]Figure 1 Hardware Structure Block Diagram[/align] 2.4 Software Structure 2.4.1 Operating System The embedded operating system is the core of the entire embedded system, typically including hardware-related low-level drivers, system kernel, device driver interfaces, communication protocols, graphical user interface (GUI), etc. It is specifically responsible for managing memory allocation, interrupt handling, task scheduling, and other functions. This design uses embedded Linux as the operating system. Embedded Linux is a small operating system composed of a kernel and customized system modules as needed. Compared with other embedded RTOSs, it has distinct characteristics: microkernel structure, at most a few hundred KB; free and open source code, customizable, and can be designed according to specific needs; excellent network and database support functions, supporting common protocols such as TCP/IP, and capable of realizing network communication and real-time processing of data. When the system starts, BootRom maps the Linux kernel from FLASH/ROM to RAM to initialize the system's hardware and software environment. The initialization of relevant content in the application is stored in FLASH/ROM as the application boot module, so that the kernel program can read it into the RAM file system after the host is powered on, and then use this part to boot the application running module. Since the system is based on a stable all-IP network, considering network bandwidth and system communication volume, we chose a normal threshold of 1 second for heartbeat detection, and adopted an instant data transmission strategy for data recovery. 2.4.2 Embedded TCP/IP Technology Because users of this system require the ability to access the network from any location via a web browser to query the storage and transportation data of each liquefied gas station in real time, and to remotely control and manage the work points through a client, achieving large-scale interconnection, remote data transmission became a crucial issue. Embedded TCP/IP technology is a device access technology that primarily addresses how to use Web and embedded technologies to monitor, diagnose, manage, and maintain devices and heterogeneous subnets connected to the Internet from different subnets and physical areas, enabling users to remotely monitor, diagnose, and manage various devices or other types of subnets connected to the Internet. Embedded systems, due to their limited hardware resources, differ from general-purpose computer systems. Therefore, functional modules such as memory management, device management, file systems, and network communication implemented by the kernel of a general-purpose computer operating system cannot all be implemented in the kernel of an embedded operating system. The traditional seven-layer TCP/IP communication transmission architecture is no longer suitable for embedded systems, and the protocol must be reasonably simplified according to the actual data transmission requirements. This system adopts the four-layer sub-protocol set of TCP/IP shown in Figure 2. [align=center]Figure 2 Sub-protocol Set Fig.2 Child Protocol[/align] The application layer is responsible for implementing the HTTP protocol; the transport layer is responsible for reliable data communication between the data acquisition site and the information center; the Internet layer completes addressing, data packaging, and path arrangement, and also determines network connectivity; the data link layer sends frames to the line and can also retrieve frames to be received from the line. 2.4.3 Application Software Structure We divide the application software structure into three layers (as shown in Figure 3): client, information center, and field. The information center consists of a web server and an application server; the database design considers a local database server located in the information center layer and a virtual server for the client; the field control system includes control system software for various field instruments and sensors. We can understand this system as a relatively complex B/S architecture software system. [align=center]Fig.3 Software Architecture[/align] The complex architecture of this system is determined by its functional design and network structure. This means that a machine needs to collaborate with other systems, providing services while also requiring services from other systems. This three-layer structure refers to the rational use of system resources, with different levels of division of labor and collaboration, enabling a task to be matched among multiple machines. The client runs applications that provide user interfaces and front-end processing, while the application server and web server are used to publish information, data, and transmit instructions. The field system completes real-time data acquisition and transmission, and ultimately executes control commands to achieve control objectives and performance indicators. 3. System Reliability Design Under the premise of ensuring functionality, system reliability is an important indicator for evaluating its performance. The real-time data acquisition and management system for liquefied petroleum gas storage and transportation adopts an unattended operation mode. In order to improve the reliability of the embedded remote data acquisition system, we design the system from both hardware and software aspects. 3.1 Hardware anti-interference measures The embedded host used in the system is developed for industrial sites. Its mechanical and electrical characteristics are sufficient to operate continuously under harsh environmental conditions. However, in order to prevent other electromagnetic interference from impacting the output of the switching power supply or the signal lines of the digital system, which could lead to abnormal operation or crashes of the embedded system, we must improve the system's electromagnetic compatibility to enhance its reliability. Careful analysis reveals that the three elements causing electromagnetic interference are the interference source, the propagation path, and the disturbed equipment. The way to suppress electromagnetic interference is also to start from these three aspects: suppress the interference source; eliminate the coupling and radiation between the interference source and the disturbed equipment, cut off the propagation path of electromagnetic interference; improve the anti-interference capability of the disturbed equipment and reduce its sensitivity to noise. At present, most electronic devices use the method of cutting off the coupling channel between the electromagnetic interference source and the disturbed equipment to suppress electromagnetic interference. Commonly used methods include shielding, grounding, and filtering. The following three measures are adopted in this system to reduce or eliminate the impact of electromagnetic interference: (1) The power supply adopts intrinsically safe power supply to directly eliminate the possibility of power supply interference. When a normal power supply is connected to too many loads, the voltage drop is very serious, while the intrinsically safe power supply avoids this situation; (2) The embedded computer host is placed with a metal shielding shell, and the entire shielding shell is connected to the system chassis and ground as one unit; (2) An electromagnetic interference absorption element made of ferrite magnetic material is added to the power input terminal to improve the filtering characteristics of the system. 3.2 Software anti-interference measures The following measures are mainly adopted in the software design to ensure the stability of the program operation: (1) Start the watchdog timer so that it can automatically restart the entire system when the program runs abnormally. (2) Write a special program to monitor the available resources of the CPU and the available space of memory. If the CPU resources and memory cannot meet the normal operation of the application, the system will be restarted. The monitoring program runs independently. 4. Security The security of this system design involves two aspects. One is the security of data transmission. The other is that the system object is flammable and explosive materials, and preventing fire is another very important issue. The data transmission security problem is due to the fact that the system uses Internet access technology, which increases the possibility of network attacks. Network security protection has become a major problem. It is necessary to adopt a variety of technical means and prevention strategies to ensure that the system is not damaged by viruses and hackers, so as to ensure the integrity and uniformity of the system data. The main solution strategy is to adopt password and firewall strategies, filter out external data streams according to rules, and data transmission must be encrypted. Access to all potentially attacked points must be provided with the correct username and password. In addition, a read-only access strategy is adopted to mark key information and sensitive information as read-only, especially access requests from IP addresses outside the Intranet range. In order to prevent the combustion of liquefied petroleum gas due to the on-site acquisition system and the occurrence of accidents, this design adopts two measures: (1) As mentioned above, the power supply of the front-end control box adopts intrinsically safe power supply. This power supply is extremely stable and does not produce electric sparks. It is widely used in explosion-proof working environments; (2) Since the monitoring equipment needs to operate for a long time, the system requires good heat dissipation function. The heat sink structure of the system has been modified from the traditional one heat sink to two heat sinks, making the system suitable for flammable and explosive working environments. 5. Summary and Author's Innovations The system introduced in this paper features a reasonable hierarchical structure, clear module division, and good portability. Furthermore, the system fully utilizes existing telecommunications networks, saving the cost of on-site construction and wired network setup. In addition, test data shows that the system can perform basic operations, management, and access to the managed devices, meeting the application needs of general embedded systems for system monitoring and real-time data acquisition. This design concept can be widely applied to other similar distributed, networked real-time data acquisition and transmission management systems, showing broad application prospects from both economic and social perspectives. References [1] Miohael Barr. Programming Embedded Systems in C and C++ [M]. USA: O'Reilly, 1999. 12-24 [2] Zou Siyi. Embedded Linux Design and Application [M]. Beijing: Tsinghua University Press, 2002. 15-18. [3] Lou Xiaoping, Deng Wenyi, Lü Naiguang, et al. Embedded Automatic Water Quality Monitoring System Based on Windows CE.net [J]. Computer Engineering and Applications, 2005, 41 (26): 120-122. [4] Li Feng, Ying Hong, Zhang Jun. Communication between Windows and Vxworks Using TCP/IP [J]. Microcomputer Information, 2006, 2-2: P80-82