Serial port to Ethernet meteorological data transmission method and device
By turning the meteorological data transmission method of Ethernet, the meteorological data transmission stability and safety of the meteorological data station are solved, and the long -distance efficient transmission and quality control of the meteorological data is realized.
Patent Information
- Application Number
- CN202411343415.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-01-28
AI Technical Summary
In unattended meteorological stations, meteorological service machines that operate uninterrupted for a long time have problems such as low operating stability rate, inconvenient backup and storage of meteorological data, and network security. Especially in long-distance transmission, the existing RS232 and RS485 The serial port transmission method is limited by distance and cost, so it is difficult to take on heavy responsibilities.
A meteorological data transmission method of serial port to Ethernet is proposed. By collecting serial data, it is re -arranged into TCP/IP format for packaging transmission, and sent to the local area network connected to Ethernet through instant messaging software to achieve long -range data transmission of data.
This method improves the stability and security of meteorological data, realizes the remote acquisition and quality control of meteorological data in the unmanned guarding station, and solves the distance and cost limit of the traditional serial port transmission method.
Smart Images

Figure CN119383198A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of meteorological communication technology, and in particular to a method and device for serial-to-Ethernet meteorological data transmission. Background Art
[0002] In recent years, with the advancement of comprehensive business reforms in meteorological departments, it is inevitable that meteorological stations will develop into unmanned stations. How to remotely control the quality of station data during unmanned work has become an urgent problem to be solved in the promotion of unmanned work at stations.
[0003] Although the widely used and mature remote desktop technology has solved this problem, in view of the long-term uninterrupted operation of meteorological business machines, there are still problems such as low operation stability, inconvenient backup and storage of meteorological data, and network security.
[0004] In response to the above problems, RS232 and RS485 serial industrial communications are widely used in various detection equipment at meteorological stations. However, the transmission distance of RS232 is only 15 meters, and the transmission distance of RS485 is 1200 meters. In addition, each serial port device requires a serial port cable. Therefore, due to the limitations of distance and cost, this transmission method cannot play an important role in the long-distance transmission of meteorological data.
[0005] The existing unmanned work cannot perform quality control on remote station data. Although this problem can be solved through remote control, the actual use of meteorological business machines that run uninterruptedly for a long time has problems such as low operating stability and inconvenient network backup and storage of meteorological data. Summary of the invention
[0006] The present application provides a serial-to-Ethernet meteorological data transmission method, which aims to solve the problems of low operation stability, inconvenient network backup and storage of meteorological data, etc. in the actual use of meteorological business machines that run uninterruptedly for a long time.
[0007] The present application proposes a serial-to-Ethernet meteorological data transmission method, which comprises the following steps:
[0008] Collect serial port data and use the collected data as TCP / IP application layer data;
[0009] Data rearrangement: Data to be sent is transmitted by TCP / IP encapsulation transmission and rearranged according to the TCP / IP protocol;
[0010] Data transmission: the arranged data is sent to the local area network connected to the Ethernet through the instant messaging software;
[0011] Data extraction includes data reception and data reception sorting. Ethernet extracts data received from the local area network in TCP / IP format through instant messaging software, and then receives it after combining it in the format of serial communication.
[0012] Furthermore, the TCP / IP protocol is rearranged as follows:
[0013] Remove the check bit and additional bit from the received serial port data and extract 8 bytes of pure data;
[0014] Filling the data portion of the Ethernet frame with pure data and supplementing it with any 38 to 46 bytes can form a frame of Ethernet data packet to be sent out.
[0015] Furthermore, the order in which data is received includes:
[0016] Remove the frame synchronization, address, type and checksum from the received data packet to obtain 46 bytes of pure data;
[0017] Take the first 8 bytes, add the check bit and additional bit, and receive them through the serial port according to the baud rate.
[0018] Furthermore, the TCP / IP encapsulation transmission method is specifically as follows:
[0019] The sending end is set in the TCP serial port server, and the receiving end is the terminal receiver. The sending end counts the total bytes of meteorological data sent; the sending end device obtains the total bytes of meteorological data received by the receiving end device;
[0020] When the total number of received bytes is greater than or equal to the total number of sent bytes, the sending end device confirms that the network is not congested and sends the meteorological data using the meteorological data sending parameters before data retransmission.
[0021] A serial port to Ethernet meteorological data transmission device, including the above-mentioned serial port to Ethernet meteorological data transmission method, the serial port to Ethernet meteorological data transmission device comprising:
[0022] Sensor,is installed on the meteorological rack, and the sensor is linearly connected via a data line;
[0023] Serial port to Ethernet server, the serial port to Ethernet server is equipped with a power supply unit and a network port unit, the network port unit includes a common network port, a tiered network port and a POE power supply port, the common network port is connected to the sensor through a data cable, the tiered network port is used to connect to the Ethernet server, and the POE power supply port is linearly connected to the power supply;
[0024] Terminal receiver, linear connection serial to Ethernet server.
[0025] The present application has the following beneficial effects: the serial-to-Ethernet meteorological data transmission is applied to the long-distance transmission of meteorological observation data, making the remote control of automatic stations and the acquisition of observation data more convenient and safer, thereby realizing the remote acquisition and quality control of observation data in the case of separation of local stations in unmanned stations. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a flow chart of the serial port to Ethernet meteorological data transmission method of this application;
[0027] Figure 2 A flowchart of the TCP / IP protocol data sorting of this application;
[0028] Figure 3 This is a schematic diagram of the structure of the serial port to Ethernet meteorological data transmission device of the present application.
[0029] Description of main component symbols:
[0030] 101. sensor; 102. data cable; 103. serial port to Ethernet server; 104. server connection; 105. terminal receiver. DETAILED DESCRIPTION
[0031] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0032] In the description of this application, unless otherwise clearly defined, words such as setting and connecting should be understood in a broad sense, and technicians in the relevant technical field can reasonably determine the specific meanings of the above words in this application based on the specific content of the technical solution.
[0033] In the technical solution of the present application, serial-to-Ethernet meteorological data transmission is applied to the long-distance transmission of meteorological observation data, making the remote control of automatic stations and the acquisition of observation data more convenient and safer, thereby realizing the remote acquisition and quality control of observation data in the case of separation of local stations in unmanned stations.
[0034] Embodiment 1
[0035] See also Figure 1 The serial port to Ethernet meteorological data transmission method of the present application comprises the following steps:
[0036] S1, collect serial port data, and use the collected data as TCP / IP application layer data;
[0037] S2, data rearrangement, the data to be sent is transmitted by TCP / IP encapsulation transmission and rearranged according to the TCP / IP protocol;
[0038] S3, data transmission, the arranged data is sent to the local area network connected to the Ethernet through the instant messaging software;
[0039] S4. Data extraction, including data reception and data reception sorting. Ethernet extracts data received from the local area network through instant messaging software according to the TCP / IP format, and then receives it after combining it according to the serial communication format.
[0040] In the serial-to-Ethernet meteorological data transmission method of the present application, serial port data is collected and the collected data is used as TCP / IP application layer data. The serial port is linearly connected to the meteorological sensor through a data line, wherein the meteorological sensor includes various sensors such as wind direction sensor, humidity sensor and rainfall sensor. It is easy to understand that in this embodiment, a serial-to-Ethernet server for collecting meteorological data is provided. The model of the serial-to-Ethernet server is ZLAN5800. The collected rainfall, wind speed, and temperature and humidity signals are used as TCP / IP application layer data. After the meteorological data is concentrated, the data transmission volume can be reduced and the transmission efficiency can be improved. Compared with the frequent transmission of a single data point, the centralized transmission of the entire data set can greatly reduce the network load.
[0041] In another embodiment, the data is rearranged, specifically, the data to be sent is transmitted by TCP / IP encapsulation transmission, and the data is rearranged according to the TCP / IP protocol. By encapsulating and transmitting meteorological data in a data format that complies with the TCP / IP protocol, data standardization can be ensured, which is beneficial to interoperability between different systems and devices. The TCP / IP protocol provides mechanisms such as retransmission and flow control, which can ensure the integrity and orderliness of data during transmission.
[0042] In another embodiment, the rearranged data is sent. Specifically, the rearranged data is sent to a local area network connected to Ethernet via instant messaging software. Sending the rearranged data to a local area network connected to Ethernet via instant messaging software can transmit data in real time without waiting, and the data can be quickly sent to a target device. The local area network is more secure and reliable than the public network, and data transmission in the intranet has a higher security.
[0043] In another embodiment, data extraction includes data reception and data reception sorting. The data received from the local area network via Ethernet through instant messaging software is extracted in TCP / IP format and then combined in a serial communication format before being received.
[0044] Through the local area network connected by Ethernet, the data is received by instant messaging software and extracted according to the TCP / IP format, and then received after being combined according to the serial communication format. It is compatible with both TCP / IP protocol and serial communication protocol, which improves the flexibility and adaptability of data transmission; the process of converting data from TCP / IP format to serial communication format is automated and efficient, without manual intervention, which improves transmission efficiency.
[0045] According to the actual situation of unmanned stations, the serial-to-Ethernet meteorological data transmission is applied to the long-distance transmission of meteorological observation data, making the remote control of automatic stations and the acquisition of observation data more convenient and safe, thereby realizing the remote acquisition and quality control of observation data in the case of separation of local stations in unmanned stations.
[0046] Embodiment 2
[0047] See also Figure 2 , Figure 2 The specific steps for rearranging the TCP / IP protocol are:
[0048] S11, remove the check bit and additional bit from the received serial port data and extract 8 bytes of pure data;
[0049] S12. Fill the pure data into the data part of the Ethernet frame, and add any 38 bytes to 46 bytes to form a frame of Ethernet data packet to be sent out.
[0050] Specifically, the current serial communication format of the ground meteorological observation station is (9600, N, 8, 1), that is, the communication rate (baud rate) is 9600bps, or 9600 bits per second, N means no parity bit, 8 means 8 bytes are used to represent a number, and 1 means adding an additional bit at the end.
[0051] The data of Ethernet TCP / IP protocol includes frame synchronization, address, type, data, and check. The serial port removes the check bit and additional bit to extract 8 bytes of pure data, and then fills it into the data part of the Ethernet frame, and then adds any 38 bytes to 46 bytes to form a frame of Ethernet data packet to be sent out.
[0052] Embodiment 3
[0053] The order in which data is received includes:
[0054] Remove the frame synchronization, address, type and checksum from the received data packet to obtain 46 bytes of pure data;
[0055] Take the first 8 bytes, add the check bit and additional bit, and receive them through the serial port according to the baud rate.
[0056] Specifically, after removing the frame synchronization, address, type and check of a frame of data packet received by Ethernet, 46 bytes of pure data are obtained. Only the first 8 bytes are taken, and then the check bit and additional bit are added and received by the serial port according to the baud rate.
[0057] Embodiment 4
[0058] The specific TCP / IP encapsulation transmission method is:
[0059] The sending end is set in the TCP serial port server, and the receiving end is the terminal receiver. The sending end counts the total bytes of meteorological data sent; the sending end device obtains the total bytes of meteorological data received by the receiving end device;
[0060] When the total number of received bytes is greater than or equal to the total number of sent bytes, the sending end device confirms that the network is not congested and sends the meteorological data using the meteorological data sending parameters before data retransmission.
[0061] Specifically, the serial port data is used as the application layer data of TCP / IP and is encapsulated and transmitted using TCP / IP. The application layer data of TCP / IP is the real valid data to be transmitted by TCP / IP. For example, what the user receives and sends through the recv() and send() functions of the socket is actually the application layer data.
[0062] By converting the serial port to TCP / IP, users can use the recv() and send() functions to send and receive serial port data. Depending on the working mode, TCP / IP includes but is not limited to recv() and send(), and can add connections, closes, monitors, etc. This is the part that needs to be processed after the serial port is converted to the network port.
[0063] The working modes of TCP / IP can be divided into: TCP server mode (TCP Server), TCP client mode (TCP Client), and UDP mode.
[0064] Among them, UDP mode: UDP mode is based on non-connection mode, as long as there is data to send, it can be sent without prior connection;
[0065] TCP mode: TCP mode uses a reliable data transmission mechanism, so it can ensure that data is basically error-free and loss-free.
[0066] Furthermore, in TCP communication, there are two ends of communication, one of which is the TCP client and the other is the TCP server. The concepts of TCP client and TCP server can be compared to a telephone. The TCP client is the person making the call, and the TCP server is the person answering the call.
[0067] Embodiment 5
[0068] refer to Figure 3 In this embodiment, a serial port to Ethernet meteorological data transmission device is provided, and the serial port to Ethernet meteorological data transmission device includes:
[0069] Sensor 101, arranged on the meteorological stand, the sensor 101 is linearly connected via a data line 102;
[0070] The serial port to Ethernet server 103 is provided with a power supply unit and a network port unit. The network port unit includes a common network port, a tiered network port and a POE power supply port. The common network port is connected to the sensor 101 via a data line 102. The tiered network port is used to connect to the Ethernet server 104. The POE power supply port is linearly connected to the power supply.
[0071] The terminal receiver 105 is linearly connected to the serial-to-Ethernet server 103 .
[0072] By converting the sensor 101 data into Ethernet data packets through the serial port to Ethernet server 103, the data transmission speed and bandwidth utilization can be greatly improved, which is more efficient than direct serial port transmission. At the same time, the serial port to Ethernet server 103 has a tiered network port, which can easily connect multiple sensor 101 devices to the same Ethernet network, increasing the scalability of the system. Compared with traditional serial port communications, the Ethernet network has higher stability and reliability, and can better ensure the stable transmission of data.
[0073] The above is a description of a specific embodiment of the present specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0074] Program instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate form. Storage media include: any entity or device capable of carrying computer program codes, recording media, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signals, telecommunication signals, and software distribution media. It should be noted that the content contained in the storage medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, storage media do not include electric carrier signals and telecommunication signals.
[0075] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0076] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0077] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the present application is not limited to the above embodiments, and various changes can be made within the knowledge scope of ordinary technicians in the technical field without departing from the purpose of the present application.
Claims
1. A serial-to-Ethernet meteorological data transmission method, characterized in that: The data transmission method comprises: Collect serial port data and use the collected data as TCP / IP application layer data; Data rearrangement: Data to be sent is transmitted by TCP / IP encapsulation transmission and rearranged according to the TCP / IP protocol; Data transmission: the arranged data is sent to the local area network connected to the Ethernet through the instant messaging software; Data extraction includes data reception and data reception sorting. Ethernet extracts data received from the local area network in TCP / IP format through instant messaging software, and then receives it after combining it in the format of serial communication.
2. The data transmission device according to claim 1, characterized in that: The TCP / IP protocol is rearranged as follows: Remove the check bit and additional bit from the received serial port data and extract 8 bytes of pure data; Filling the data portion of the Ethernet frame with pure data and supplementing it with any 38 to 46 bytes can form a frame of Ethernet data packet to be sent out.
3. The data transmission device according to claim 1, characterized in that: The receiving sequence of the data includes: Remove the frame synchronization, address, type and checksum from the received data packet to obtain 46 bytes of pure data; Take the first 8 bytes, add the check bit and additional bit, and receive them through the serial port according to the baud rate.
4. The data transmission device according to claim 1, characterized in that: The TCP / IP encapsulation transmission method is specifically: The sending end is set in the TCP serial port server, and the receiving end is the terminal receiver. The sending end counts the total bytes of meteorological data sent; the sending end device obtains the total bytes of meteorological data received by the receiving end device; When the total number of received bytes is greater than or equal to the total number of sent bytes, the sending end device confirms that the network is not congested and sends the meteorological data using the meteorological data sending parameters before data retransmission.
5. A serial-to-Ethernet meteorological data transmission device, comprising the serial-to-Ethernet meteorological data transmission method according to any one of claims 1 to 4, characterized in that: The serial port to Ethernet meteorological data transmission device comprises: Sensor,is installed on the meteorological rack, and the sensor is linearly connected via a data line; Serial port to Ethernet server, the serial port to Ethernet server is equipped with a power supply unit and a network port unit, the network port unit includes a common network port, a tiered network port and a POE power supply port, the common network port is connected to the sensor through a data cable, the tiered network port is used to connect to the Ethernet server, and the POE power supply port is linearly connected to the power supply; Terminal receiver, linear connection serial to Ethernet server.