Academic Journal of Science and Technology ISSN: 2771-3032 | Vol. 10, No. 1, 2024 16 Linux-based Terminal temperature monitoring system Deyu Duan1, *, Chunguang Zhang1, Lianwei Shang2 1School of Automation and Electrical Engineering, Dalian Jiaotong University, Dalian 11628, China 2Yingkou Xiangyang Catalyst Company, Yingkou, China * Corresponding author Abstract: Traction converter has high power during operation, and loose terminals can lead to poor contact and heating of the connections. In order to prevent the internal terminals of the traction converter from heating up and damaging the electrical equipment, this design proposes a Linux-based online temperature status monitoring system. The system uses thermal imaging technology to capture temperature data images and connects to a controller via Ethernet, which ultimately displays the images on a display in the driver's room. Keywords: Embedded development; Linux system; temperature monitoring; thermal imaging; image processing. 1. Introduction Traction converter cabinet is a key component of electric locomotive. The traction converter cabinet is a frame structure in the form of a combination of riveted and bolted internal equipment [4]. The traction converter cabinet includes two sets of traction converter unit and cooling duct device. The traction converter unit includes traction control unit (TCU), input circuit, four-quadrant rectifier, intermediate DC circuit, traction inverter, output circuit, cooling system, detection and protection device, safety device and other parts [5]. The traction converter is mainly composed of IGBT modules, DC support capacitors, reactors and other electrical equipment [3]. Traction converter is one of the key components of the train, installed in the bottom of the train moving car, its main function is to convert the electrical energy between DC and AC systems, through the voltage and frequency control to achieve the AC traction motor starting, braking, speed control. Each traction converter is controlled by the corresponding traction control unit. Each traction converter can drive one traction motor. There are a large number of terminals in each control unit inside the traction converter cabinet, and the train is very prone to vibration in high-speed movement [4]. Vibration may cause the terminals to loosen, resulting in poor contact between the terminals and the equipment, the traction converter cabinet internal control unit and other equipment work with high working current, poor contact leads to higher temperatures, which can lead to damage to electrical equipment, which may lead to serious electrical fires, posing a threat to the safety of train traffic. This design consists of terminal equipment, controller industrial computer, industrial router and host computer, using uncooled temperature measurement thermal imaging module and PCB boards constitute the terminal as the lower computer to collect and send data, collecting YUV422 format image data and temperature data, and using 8-bit parallel transmission to improve transmission speed. And through the Ethernet connection between the controller and the host computer to upload data. 2. Overall System Design The overall structure of the terminal condition monitoring system, mainly including the controller industrial computer, terminal, routing and driver's room, as show in Fig. 1, the terminal condition monitoring system is mainly divided into three parts, the terminal for the thermal imaging camera to collect data and the collected data for preliminary processing, through the RJ45 Ethernet interface, transmitted to the controller industrial computer, the controller industrial computer and then through a router The controller industrial computer then transmits the data to the driver's room of the upper computer through the router. The data acquisition terminal device is mainly composed of two parts, the uncooled temperature measurement thermal imaging module, the module camera is responsible for collecting infrared images and temperature images and data of the terminals in the corresponding monitoring area, and connecting to the PCB board through the CSI interface. The main function of the data acquisition terminal is to collect image and temperature data and encapsulate the data, and then transmit the data to the controller via Ethernet. Figure 1. Overall System Architecture Diagram The data acquisition terminal device is mainly composed of two parts, the uncooled temperature measurement thermal imaging module, the module camera is responsible for collecting infrared images and temperature images and data 17 of the terminals in the corresponding monitoring area, and connecting to the PCB board through the CSI interface. The main function of the data acquisition terminal is to collect image and temperature data and encapsulate the data, and then transmit the data to the controller via Ethernet. The controller industrial computer integrates the computer control function and the switch function, which provides the conditions for the expansion of the equipment. The controller industrial computer is connected to a DC110V power supply, connects to external devices via a USB interface to export data update programmes, etc., and connects to routers, terminals and cascades with other controllers via Ethernet. The controller is integrated with the switch function, so the connection of the controller computer is more expandable, each controller can be connected to five terminal devices at the same time. The controllers can be interfaced up via cascaded Ethernet. This allows simultaneous monitoring of many device terminals to ensure safety on the road. The controllers can also perform web publishing and use other devices to view data online. When the host computer in the driver's room receives the data, it restores the data and displays the image on the driver's room monitor screen according to the synchronisation word in the header, device ID, transmission data type, map number, frame number and other information. The upper computer system has functions such as high temperature alarm, maximum temperature data display, and historical high temperature record view. 3. Temperature Monitoring System Design 3.1. Data acquisition terminal hardware design As show in Fig. 2. The S3 chip is selected as the CPU chip and the AXP203 chip is used for power control. The thermal imaging camera is connected through the row of wires. In order to reduce the size of the device, the data acquisition terminal is powered by POE technology through the Ethernet interface, which is a technology that can transmit power and data to the device through twisted-pair wires in the Ethernet. The use of POE power technology is easy to install, only a twisted pair cable needs to be arranged, there is no need to lay power cables, which can save expensive power cables and the workload of laying power cables.POE power end device will only supply power to the device that needs power, only connected to the device that needs power, the Ethernet cable will have voltage present, thus eliminating the risk of leakage of electricity on the line. Figure 2. Terminal Hardware Diagram The thermal imaging camera used in this design acquires data in YUV422 format and uses 8-bit data parallel acquisition mode, the first 512 clocks output 256 pixels in YUV422 format, the YUV422 format averages two bytes per pixel, and the last 512 clocks output 256 16-bit temperature data. 3.2. Data Acquisition Terminal Software Design As show in Fig. 3. first initialise the parameters, create a TCP server socket, turn on the camera, enumerate the pixel formats supported by the device, query the camera properties, set the camera format to capture the data, query the camera format, apply for the frame buffer, turn on the video capture, start to cycle through the captured video, LISTEN to the request, wait for the ACCEPT, and after the client connects successfully, the VIDIOC_DQBUF pulls the memory that has already captured the video out of the queue of the captured video, and then copies the video data and temperature data into the buffer that has been prepared, and VIDIOC_QBUF adds the free memory to the queue of the capturable video. Figure 3. Terminal Software Flowchart Then copy the first 512 bytes of the data in this buffer to the image buffer, and copy the last 512 bytes of the data in this buffer to the temperature buffer, and convert the image data from the original YUV422 format to the YUV420 format, so that the compressed data becomes smaller, from the original average of 2 bytes per pixel to an average of 1.5 bytes per pixel. Temperature data multiplied by 10, and then subtracted 273.5 converted to Celsius data, before sending in multiplied by 10, forced to convert to short type data, short integer data is more space-saving than double type data, which is also equivalent to compression. Before sending the data to the client, it should be edited, because the data volume of a picture is large, so each picture will be cut across several copies, and stipulate the picture number, frame number, data type, data ID, synchronous word, picture size and other information in the header, the design sets the number of data lines to 4, and sets the size of the picture to 256*192, because the picture is compressed to YUV420 format, so it takes 72 data packets to transmit a picture, and 96 data packets to transmit the temperature data. A total of 72 data packets to transmit temperature data to 96 data packets, the first transmission of image data, in the 18 transmission of temperature data, the continuous cycle of data lossless transmission to the host computer, the host computer in the acceptance of data, and then according to the header data type and other data in the data packets will be parsed, and then disassemble the header, will be reassembled data. After the client disconnects from the server, the server releases the resources and turns off the camera. 3.3. Upper computer design The overall design of the upper computer of the terminal status monitoring system, as show in Fig. 4, is developed using Visual Studio compilation platform, Mysql, opencv and other software. The upper computer programme design, first of all, to configure the environment. The overall interface design of the host computer design includes image display design and alarm recording interface. Data transmission use use TCP protocol, then data processing and image display. The high temperature alarm function includes over- temperature alarm, record saving and record query. Finally, the programme is compiled to generate an executable file and then connected to the terminal to test the system. Figure 4. Flowchart of upper computer software design The use of opencv in this design is mainly for image processing, such as labelling the highest point of its temperature, and the conversion of image formats. As show in Fig. 5. There are start and stop buttons on the right side. The four windows on the left side are the display images of cameras 1-4, and the right side shows the maximum temperature of the camera respectively. The lower right side of the interface is the alarm upper limit, alarm record view button and alarm silencing button. Figure 5. Monitoring system interface diagram 4. Conclusions The traction converter cabinet is a key component of an electric locomotive. The traction converter has high power during operation and the existing monitoring system is not effective. This design of the traction converter cabinet terminal temperature monitoring system, the terminal using thermal imaging technology for embedded development, using TCP protocol to transmit data. This system can online real-time monitoring of the temperature status of the terminals, using MySQL database to achieve the over-temperature alarm recording function, with the help of opencv to achieve image processing and graphic display function. This design can prevent the internal terminals of the traction converter from heating up and damaging the electrical equipment. References [1] Lu Chunfang,. Development trend of high-speed railway technology[J]. Modern Transportation and Metallurgical Materials, 2021(04):1-5. [2] Xie Yi,Xiao Jie. Research on the development status and trend of high-speed railway[J]. High-speed railway technology, 2021, 12(02): 23-26. [3] TIAN Hang,. Online monitoring method of reliability of AC drive traction converter[J]. Electrotechnology,2023(22):154- 156. [4] JIA Jinsheng, MA Siqun, SUN Yanbin, MA Rui, HUO Hongsheng, JIA Boyuan. Optimisation design of traction converter cabinet for a certain power locomotive[J]. Mechanical Engineer, 2020(06):55-57. [5] SUN Jialin,CHEN Gang,XU Wei.Research on the cause of axle isolation of main converter cabinet of HX_D2B type electric locomotive[J]. Railway Locomotive and Locomotive, 2021, No.566 (04): 46-48+6+61. [6] LIU Peng,. An analysis of the cause of the heating event of cable wire terminal of HXD2C type locomotive[J]. Electromechanical information,2017(33):111+113.