A multi-serial port expansion device applied to an optoelectronic system and a data processing method

By designing a multi-serial port expansion device and a specific data processing method, the problems of cumbersome and inefficient serial port expansion operations in optoelectronic systems were solved, enabling simultaneous communication and efficient data transmission across multiple serial ports.

CN122111919APending Publication Date: 2026-05-29西安应用光学研究所
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
西安应用光学研究所
Filing Date
2026-02-05
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing serial port expansion methods in optoelectronic systems are cumbersome to operate, have low efficiency, and multiple serial ports cannot communicate normally at the same time.

Method used

Design a multi-serial port expansion device, including a microcontroller module, a serial port interface module, and a power supply module. Employ a specific communication protocol and data processing method, and achieve efficient communication of multiple serial port channels through interrupt reception and first-in-first-out message queue.

Benefits of technology

This enables normal communication between multiple serial channels simultaneously, reduces the number of wires from the computer board to the sensor, minimizes the impact of wire interference on servo control, and improves work efficiency and communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111919A_ABST
    Figure CN122111919A_ABST
Patent Text Reader

Abstract

The application discloses a multi-serial port expansion device applied to an optoelectronic system and a data processing method, the multi-serial port expansion device comprising a power module, a micro control module and a serial port interface module; the micro control module is provided with a plurality of serial port modules; the serial port interface module comprises a serial port interface chip; a single-end port of the serial port interface chip is connected with a serial port pin of the micro control module, and a differential port of the serial port interface chip is electrically connected with a communication device through an electric connector; when the multi-serial port expansion device processes data, a unified format communication protocol is formulated for each sensor connected with the multi-serial port expansion device; each serial port channel receives and transmits data in a mode of interrupt receiving and idle sending, and the receiving and transmitting process is provided with an independent message queue. The multi-serial port expansion module disclosed by the application can realize serial port expansion of a stable sighting turret, realize real-time data transparent transmission, simultaneously transmit multiple serial ports, meet the docking requirements of a larger number of sensors, and is good in flexibility as the sensor type is configurable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of electronic communication technology, specifically relating to a multi-serial port expansion device for optoelectronic systems and a multi-serial port data processing method for optoelectronic systems. Background Technology

[0002] With increasingly stringent technological requirements, higher demands are being placed on the informatization, intelligence, and integration of optoelectronic systems. This means not only integrating abundant sensor resources but also ensuring rapid interaction between various information entities, while simultaneously achieving low cost and low latency. Currently, optoelectronic systems use serial ports for communication between sensors and computer boards, with the computer board handling unified communication management. However, the serial port resources of the computer board are limited. Once the number of newly added serial devices exceeds the available serial port resources, serial port expansion is necessary.

[0003] Existing serial port expansion methods mainly fall into two categories: one is to use interfaces such as I2C, SPI, and parallel ports for serial port expansion. This method relies on hardware resources other than the serial port and suffers from cumbersome operation and low work efficiency. The other method uses analog switches to time-division switch serial port channels to achieve the purpose of serial port expansion. This method uses the microcontroller's input / output port chip select analog switch to switch serial port channels, resulting in only one channel of the serial port being able to communicate normally at a time, and thus does not achieve the purpose of true serial port expansion. Summary of the Invention

[0004] The purpose of this invention is to solve the problems of cumbersome operation, low work efficiency, and inability of multiple serial ports to communicate normally at the same time in existing serial port expansion methods, and to provide a multi-serial port expansion device and a multi-serial port data processing method for optoelectronic systems.

[0005] To achieve the above objectives, the technical solution provided by this invention is:

[0006] A multi-serial port expansion device for an optoelectronic system is provided. The device is installed within the inner ring frame of the optoelectronic system's sensor and includes a microcontroller module, a serial port interface module, and a power supply module. The microcontroller module has multiple serial port modules and multiple TTL serial port pins corresponding to the number of serial port modules. The TTL serial port pins are electrically connected to the serial port modules. The serial port modules are used for transmitting and receiving data. The serial port interface module includes multiple serial port interface chips corresponding to the number of serial port modules, and the multiple serial port interface chips have the same number of pins. The serial port interface chips have single-ended ports and differential ports. The single-ended port is electrically connected to the other end of the TTL serial port pin. The differential port is used for external communication. The device is electrically connected; the serial port interface chip is used to convert the serial port signal input from the single-ended port into a differential signal and output it from the differential port, and at the same time convert the differential signal input from the differential port into a single-ended signal and output it from the single-ended port to the TTL serial port pin of the microcontroller module; the power supply module is electrically connected to the microcontroller module and the serial port interface module respectively, and the power supply module is used to provide operating power to the microcontroller module and the serial port interface module; among them, the serial port interface chip and the TTL serial port pin are electrically connected one-to-one to form multiple serial port channels, of which the first serial port channel is used to electrically connect to the computer board of the optoelectronic system, and each of the remaining serial port channels is used to electrically connect to a sensor inside the optoelectronic system.

[0007] Furthermore, the differential ports in the serial interface chip include a transmit differential port and a receive differential port; transient suppression diodes are connected between the positive and negative pins of the transmit differential port and the receive differential port of the serial interface chip, respectively, and a termination resistor is connected between the positive and negative pins of the receive differential port of the serial interface chip.

[0008] Furthermore, multiple serial port interface chips share the same model number.

[0009] A multi-serial port data processing method for use in optoelectronic systems is also provided, which utilizes the aforementioned multi-serial port expansion device for data processing, and includes the following steps:

[0010] Step 1: Establish a communication protocol for the sensor that uses the same frame format as the multi-serial port expansion device; the frame format defined in the communication protocol includes a frame header, device identifier, frame length, message body, and checksum.

[0011] Step 2: Connect the first serial port channel to the computer board, and connect the other serial port channels to the corresponding sensors. The first serial port channel is used to communicate with the computer board and transmit the received data to the sensors through the corresponding serial port channels. When the other serial port channels receive data from the sensors, they transmit the received data to the first serial port and then send it to the computer board.

[0012] Step 3: Configure a serial port message structure for each serial port channel. In this step, the device identifier from the communication protocol of the corresponding sensor needs to be assigned to the member variable of the serial port message structure, thereby completing the binding between the serial port channel and the device identifier of the sensor.

[0013] Step 4: Configure the serial port module to receive and send data using interrupt reception and idle transmission. The data received by the interrupt service routine of each serial port module is written into the first-in-first-out message queue of that serial port module, waiting to be parsed and sent.

[0014] Furthermore, in step 4, the data parsing process of the first serial port channel communicating with the computer board is as follows:

[0015] - Determine if the data read from the receive FIFO message queue is a frame header; if yes, proceed to the next step; if not, continue to determine if the next data read from the receive FIFO message queue is a frame header.

[0016] - Determine whether the device identifier read from the first-in-first-out message queue is the identifier of the bound sensor device; if yes, obtain the frame length; if not, clear the parsed data length to zero and return to the previous step;

[0017] - If the length of the parsed data is equal to the frame length, copy the parsed data in the parsing buffer to the send first-in-first-out message queue of the destination serial port channel, and end the current parsing process.

[0018] Furthermore, in step 4, the data parsing process for the remaining serial port channels communicating with the sensor is as follows:

[0019] - Determine if the data read from the receive first-in-first-out message queue is a frame header. If yes, proceed to the next step; otherwise, continue to determine if the next data read from the receive first-in-first-out message queue is a frame header.

[0020] - Determine whether the device identifier read from the first-in-first-out message queue is the identifier of the bound sensor device. If yes, obtain the frame length; otherwise, clear the parsed data length to zero and return to the previous step.

[0021] - If the parsed data length is equal to the frame length, copy the parsed data in the parsing buffer to the first serial port channel's transmit first-in-first-out message queue and end the current parsing process.

[0022] Furthermore, in step 4, the data transmission process for each serial port channel is as follows: the data in the first-in-first-out (FIFO) message queue of the serial port channel is sequentially written into the transmit data register of the serial port channel, with one data being read and written each time; before writing, it is determined whether the transmit message queue is not empty and whether the transmit data register is empty. If both conditions are met, a read operation is performed; if either condition is not met, data is forwarded to another serial port channel.

[0023] Furthermore, in step 1, the frame header is used to identify the start of the frame; the device identifier is used to distinguish different sensors; the message body is used to transmit control commands or status information; and the checksum is used to detect whether errors occur during frame transmission.

[0024] Furthermore, the message length is set according to the complexity of the sensor message, and different sensors may use the same or different message lengths.

[0025] The advantages of this invention are:

[0026] 1. The multi-serial port expansion device designed in this invention includes a microcontroller module, a serial port interface module, and a power supply module. The multi-serial port expansion device is installed in the inner ring frame where the photoelectric system sensor is located, which can significantly reduce the number of wires from the computer board to the sensor. By setting up serial port channels that connect to the computer board and the sensor, multiple serial port channels can communicate normally at the same time. It also solves the problem that traditional serial port expansion requires the use of hardware resources outside the serial port, effectively reduces the impact of wire interference on servo control, reduces operations, and improves work efficiency.

[0027] 2. The data processing method designed in this invention adopts a specific communication protocol, assigning a device identifier to each sensor. Through flexible configuration, the multi-serial port expansion device can interface with different sensor combinations. The designed data processing method employs a serial port interrupt plus FIFO message queue reception mode and a FIFO message queue plus idle transmission mode, ensuring high communication efficiency while guaranteeing stability during large-scale data transmission. During communication, when the first serial port channel of the multi-serial port expansion device receives data sent by the computer board, it sends the received data to the corresponding sensor through the corresponding serial port channel according to the device identifier. When the other serial port channels of the multi-serial port expansion device receive data sent by each sensor, they send the data to the computer board through the first serial port channel after receiving the length determined by the communication protocol. In this way, serial port expansion is realized, enabling multiple serial port channels to communicate normally at the same time. Attached Figure Description

[0028] The features and advantages of the invention will become more readily apparent from the following description with reference to the accompanying drawings, which are not drawn to scale and some features are enlarged or reduced to show details of specific parts.

[0029] Figure 1 This is a block diagram and connection diagram of the multi-serial port expansion device of the present invention;

[0030] Figure 2 This invention relates to a multi-serial port data processing method;

[0031] Figure 3 This is a flowchart of the data parsing process for the first serial port channel of the present invention;

[0032] Figure 4 This is a flowchart of data parsing for the remaining serial ports in this invention;

[0033] Figure 5 This is a flowchart of the multi-serial port data transmission of the present invention. Detailed Implementation

[0034] The present invention will now be described in detail with reference to the accompanying drawings and exemplary embodiments thereof. It should be noted that the following detailed description of the present invention is for illustrative purposes only and is not intended to limit the scope of the invention.

[0035] This invention provides a multi-serial port expansion device for use in optoelectronic systems, such as... Figure 1 As shown, it includes a microcontroller module, a serial port interface module, and a power supply module. The microcontroller module has multiple serial port modules and multiple TTL serial port pins corresponding to the number of serial port modules. One end of the TTL serial port pin is electrically connected to the serial port module. The serial port module is used to send and receive data. The serial port module integrated in the microcontroller module itself uses interrupt reception and idle transmission to send and receive data, which can reduce CPU usage.

[0036] The serial interface module includes multiple serial interface chips corresponding to the number of serial port modules. These chips have the same number of pins. Each chip has a single-ended port and a differential port. The single-ended port is electrically connected to the other end of a TTL serial port pin. The differential port is electrically connected to an external communication device. The serial interface chip converts the serial signal input from the single-ended port into a differential signal and outputs it from the differential port. Simultaneously, it converts the differential signal input from the differential port into a single-ended signal and outputs it from the single-ended port to the TTL serial port pin of the microcontroller module. The serial interface module also includes an electrical connector, through which the differential port is electrically connected to the external communication device.

[0037] The serial interface chip is electrically connected to the TTL serial port pins one by one to form multiple serial channels. The first serial channel is used to connect to the computer board of the optoelectronic system, and each of the other serial channels is used to connect to a sensor inside the optoelectronic system.

[0038] The power module is electrically connected to both the microcontroller module and the serial interface module, providing operating power to both. The power module may include an electrical connector through which power is obtained.

[0039] In other embodiments, the power module, microcontroller module, and serial interface module are electrically or communicationally connected via electrical connectors. Most electrical devices in the optoelectronic system should have electrical connectors to facilitate the installation and disassembly of the electrical devices. The electrical connector is the external interface and the physical interface for power and communication signal transmission.

[0040] In this embodiment, the received power signal is converted by the power module to output a suitable voltage for use by the microcontroller module and the serial interface module. The microcontroller module is responsible for data transmission, reception, parsing, and forwarding throughout the entire device. The TTL serial port signal output by the microcontroller module does not have long-distance transmission capability and requires level conversion by the serial interface module. After conversion, the external signal is a differential signal with good anti-interference capability. Most electrical devices within the optoelectronic system should have electrical connectors to facilitate their installation and disassembly.

[0041] The multi-serial port expansion device designed in this invention is installed in the inner ring frame where the photoelectric system sensor is located, which can significantly reduce the number of wires from the computer board to the sensor; and solve the problem that traditional serial port expansion requires the use of hardware resources outside the serial port, effectively reducing the impact of wire interference on servo control, reducing operations, and improving work efficiency.

[0042] In this embodiment, the microcontroller module has 6 TTL serial port pins, and the serial port interface module includes 6 serial port interface chips D1 to D6 of the same model and the same number of pins; the serial port interface chips D1 to D6 have single-ended ports and differential ports respectively; the first TTL serial port pin is connected to the single-ended port pin of the serial port interface chip D1 to form serial port channel 1, the second TTL serial port pin is connected to the single-ended port pin of the serial port interface chip D2 to form serial port channel 2, the third TTL serial port pin is connected to the single-ended port pin of the serial port interface chip D3 to form serial port channel 3, the fourth TTL serial port pin is connected to the single-ended port pin of the serial port interface chip D4 to form serial port channel 4, the fifth TTL serial port pin is connected to the single-ended port pin of the serial port interface chip D5 to form serial port channel 5, and the sixth TTL serial port pin is connected to the single-ended port pin of the serial port interface chip D6 to form serial port channel 6. The differential ports of the serial interface chip are connected to electrical connectors. The differential ports in the serial interface chip include transmit differential ports and receive differential ports. Each serial interface chip has two pairs of differential ports: a positive terminal for the transmit differential port, a negative terminal for the transmit differential port, a positive terminal for the receive differential port, and a negative terminal for the receive differential port. Transient voltage suppression diodes are connected between the positive and negative pins of the transmit and receive differential ports of the serial interface chip, respectively. These transient voltage suppression diodes provide surge electrostatic protection for the differential ports of the serial interface chip. Termination resistors R1 to R6 are connected between the positive and negative pins of the receive differential port of the serial interface chip. These termination resistors are used for impedance matching and to reduce signal reflections in the transmission line.

[0043] This invention also provides a multi-serial port data processing method applied to optoelectronic systems, such as... Figure 2 As shown, the method for data processing using the aforementioned multi-serial port expansion device includes the following steps:

[0044] Step 1: Establish a communication protocol for the sensor that uses the same frame format as the multi-serial port expansion device; the frame format defined in the communication protocol includes a frame header, device identifier, frame length, message body, and checksum.

[0045] Step 2: Connect the first serial port channel to the computer board, and connect the other serial port channels to the corresponding sensors. The first serial port channel is used to communicate with the computer board and transmit the received data to the sensors through the corresponding serial port channels; the other serial port channels are used to receive data from the sensors and transmit all the received data to the first serial port.

[0046] Step 3: Configure a serial port message structure for each serial port channel. In this step, the device identifier from the communication protocol of the corresponding sensor needs to be assigned to the member variable of the serial port message structure, thereby completing the binding between the serial port channel and the device identifier of the sensor.

[0047] Step 4: Configure the serial port module to receive and send data using interrupt reception and idle transmission. The data received by the interrupt service routine of each serial port module is written into the first-in-first-out message queue of that serial port module, waiting to be parsed and sent.

[0048] Each step is described in detail below:

[0049] In step 1, the communication protocol is used to constrain how data is transmitted. The computer board and each sensor have a communication protocol that determines the frame header, device identifier, frame length, message body, and checksum.

[0050] The frame header identifies the start of the frame; the device identifier distinguishes different sensors; the message body transmits control commands or status information; and the checksum detects whether errors occur during frame transmission. The length of the message body is set according to the complexity of the sensor message; different sensors can use the same or different message lengths. The frame header, device identifier, frame length, and checksum are all of fixed length.

[0051] The multi-serial port expansion device parses and forwards received serial port data through a transparent data parsing method that matches the frame header and device identifier fields. Without this multi-serial port expansion device, the computer board would need five serial port channels to connect five sensors. However, with this device, the computer board only needs to communicate with the expansion device, which is responsible for receiving data from each serial port channel and forwarding the data between the computer board and each sensor according to the device identifier.

[0052] In step 2, there are a total of 6 serial port channels. Serial port channel 1 is connected to the serial port of the computer board of the optoelectronic system as the first serial port channel; serial port channels 2 to 6 are connected to the sensors inside the optoelectronic system respectively; serial port channel 1 is responsible for communicating with the computer board of the optoelectronic system, and serial port channels 2 to 6 are responsible for communicating with the sensors. The data received by serial port 1 is distributed to different sensors, while the remaining serial port channels receive data from a certain sensor. All the data received by the remaining serial port channels are converged to serial port channel 1.

[0053] In step 3, the serial port channels of the multi-serial port expansion device can be adjusted. When the task requirements of the optoelectronic system change, the required sensors are different. After the physical connection between the multi-serial port expansion device and the sensor changes, it is necessary to readjust the binding relationship between the device identifier of the new sensor and the serial port channel. When multiple multi-serial port expansion devices are used in the optoelectronic system, in order to maintain software consistency and hardware interchangeability, each serial port channel of the multi-serial port expansion device can be bound to multiple device identifiers.

[0054] In step 4, the main program of the multi-serial port expansion device sequentially parses the data in the first-in-first-out message queue of each serial port channel. Each serial port channel sends and receives data through interrupt reception and idle transmission to ensure real-time data communication. The sending and receiving process has an independent first-in-first-out message queue, specifically a receiving first-in-first-out message queue and a sending first-in-first-out message queue to avoid data loss and misalignment.

[0055] like Figure 3 As shown, the data parsing process of the first serial port channel communicating with the computer board is as follows:

[0056] - Determine if the data read from the receive FIFO message queue is a frame header; if yes, proceed to the next step; if not, continue to determine if the next data read from the receive FIFO message queue is a frame header.

[0057] - Determine whether the device identifier read from the first-in-first-out message queue is the identifier of the bound sensor device; if yes, obtain the frame length; if not, clear the parsed data length to zero and return to the previous step;

[0058] - If the length of the parsed data is equal to the frame length, copy the parsed data in the parsing buffer to the send first-in-first-out message queue of the destination serial port channel, and end the current parsing process.

[0059] like Figure 3 As shown, the process begins by checking if the receive message queue is empty. If it is empty, it means that all received data has been read and parsed, and the process continues to receive the next data and perform the parsing check. The parsing process first finds the frame header, which indicates the start of a frame, and then checks if it is a bound device identifier. Based on the device identifier, it determines which serial port channel's send message queue to copy data to.

[0060] like Figure 4 As shown, the parsing and processing process for the remaining serial port channels communicating with the sensor is as follows:

[0061] - Determine if the data read from the FIFO message queue is a frame header. If it is, proceed to the next step; otherwise, continue to determine if the next data read from the FIFO message queue is a frame header.

[0062] - Determine whether the device identifier read from the first-in-first-out message queue is the identifier of the bound sensor device. If yes, obtain the frame length; otherwise, clear the parsed data length to zero and return to the previous step.

[0063] - If the parsed data length is equal to the frame length, copy the parsed data in the parsing buffer to the first serial port channel's transmit first-in-first-out message queue and end the current parsing process.

[0064] like Figure 5 As shown, the data received by the interrupt service routine of each serial port module is written into the receive first-in-first-out (FIFO) message queue of that serial port module. The data transmission process of each serial port channel is as follows: the multi-serial port expansion device sequentially writes the data from the transmit FIFO message queue of each serial port channel into the transmit data register of that serial port channel, reading and writing one piece of data at a time. Before writing, it checks whether the transmit message queue is not empty and whether the transmit data register is empty. If both conditions are met, a read operation is performed. A read operation is only performed if the message queue is not empty and the transmit register is empty; if either condition is not met, data is forwarded to another serial port channel.

[0065] Finally, it should be noted that the features mentioned and / or shown in the above description of exemplary embodiments of the present invention can be combined in the same or similar manner with one or more other embodiments, combined with features in other embodiments, or substituted for corresponding features in other embodiments. These combined or substituted technical solutions should also be considered to be included within the scope of protection of the present invention.

Claims

1. A multi-serial port expansion device for use in optoelectronic systems, characterized in that, The multi-serial port expansion device is installed in the inner ring frame where the photoelectric system sensor is located, and includes: The microcontroller module has multiple serial port modules and multiple TTL serial port pins corresponding to the number of serial port modules. One end of each TTL serial port pin is electrically connected to the serial port module. The serial port module is used to transmit and receive data. A serial port interface module includes multiple serial port interface chips corresponding to the number of serial port modules, and the multiple serial port interface chips have the same number of pins; each serial port interface chip has a single-ended port and a differential port, the single-ended port being electrically connected to the other end of the TTL serial port pin; the differential port being electrically connected to an external communication device; the serial port interface chip is used to convert the serial port signal input from the single-ended port into a differential signal and output it from the differential port, and simultaneously convert the differential signal input from the differential port into a single-ended signal and output it from the single-ended port to the TTL serial port pin of the microcontroller module; The power module is electrically connected to the microcontroller module and the serial interface module respectively, and the power module is used to provide working power to the microcontroller module and the serial interface module. The serial port interface chip is electrically connected to the TTL serial port pins one by one to form multiple serial port channels. The first serial port channel is used to electrically connect to the computer board of the optoelectronic system, and each of the other serial port channels is used to electrically connect to a sensor inside the optoelectronic system.

2. The multi-serial port expansion device according to claim 1, characterized in that, The differential ports in the serial interface chip include a transmit differential port and a receive differential port; transient suppression diodes are connected between the positive and negative pins of the transmit differential port and the receive differential port of the serial interface chip, respectively; and a termination resistor is connected between the positive and negative pins of the receive differential port of the serial interface chip.

3. The multi-serial port expansion device according to claim 1, characterized in that, The serial port interface chips mentioned above are of the same model.

4. A multi-serial port data processing method applied to optoelectronic systems, characterized in that, For data processing using the multi-serial port expansion device as described in claims 1-3, the following steps are included: Step 1: Establish a communication protocol for the sensor that uses the same frame format as the multi-serial port expansion device; the frame format defined in the communication protocol includes a frame header, device identifier, frame length, message body, and checksum. Step 2: Connect the first serial port channel to the computer board, and connect the other serial port channels to the corresponding sensors. The first serial port channel is used to communicate with the computer board and transmit the received data to the sensors through the corresponding serial port channels. When the other serial port channels receive data from the sensors, they transmit the received data to the first serial port and then send it to the computer board. Step 3: Configure a serial port message structure for each serial port channel. In this step, the device identifier from the communication protocol of the corresponding sensor needs to be assigned to the member variable of the serial port message structure, thereby completing the binding between the serial port channel and the device identifier of the sensor. Step 4: Configure the serial port module to receive and send data using interrupt reception and idle transmission. The data received by the interrupt service routine of each serial port module is written into the first-in-first-out message queue of that serial port module, waiting to be parsed and sent.

5. The multi-serial port data processing method according to claim 4, characterized in that, In step 4, the data parsing process of the first serial port channel communicating with the computer board is as follows: - Determine if the data read from the receive FIFO message queue is a frame header; if yes, proceed to the next step; if not, continue to determine if the next data read from the receive FIFO message queue is a frame header. - Determine whether the device identifier read from the first-in-first-out message queue is the identifier of the bound sensor device; if yes, obtain the frame length; if not, clear the parsed data length to zero and return to the previous step; - If the length of the parsed data is equal to the frame length, copy the parsed data in the parsing buffer to the send first-in-first-out message queue of the destination serial port channel, and end the current parsing process.

6. The multi-serial port data processing method according to claim 4, characterized in that, In step 4, the data parsing process for the remaining serial port channels communicating with the sensor is as follows: - Determine if the data read from the receive first-in-first-out message queue is a frame header. If yes, proceed to the next step; otherwise, continue to determine if the next data read from the receive first-in-first-out message queue is a frame header. - Determine whether the device identifier read from the first-in-first-out message queue is the identifier of the bound sensor device. If yes, obtain the frame length; otherwise, clear the parsed data length to zero and return to the previous step. - If the parsed data length is equal to the frame length, copy the parsed data in the parsing buffer to the first serial port channel's transmit first-in-first-out message queue and end the current parsing process.

7. The multi-serial port data processing method according to claim 4, characterized in that, In step 4, the data transmission process for each serial port channel is as follows: the data in the first-in-first-out (FIFO) message queue of the serial port channel is written sequentially into the transmit data register of the serial port channel, with one data being read and written each time; before writing, it is determined whether the transmit message queue is not empty and whether the transmit data register is empty. If both conditions are met, a read operation is performed; if either condition is not met, data is forwarded to another serial port channel.

8. The multi-serial port data processing method according to claim 4, characterized in that, In step 1, the frame header is used to identify the start of the frame; the device identifier is used to distinguish different sensors; the message body is used to transmit control commands or status information; and the checksum is used to detect whether errors occur during frame transmission.

9. The multi-serial port data processing method according to claim 8, characterized in that, The length of the message body is set according to the complexity of the sensor message; different sensors may use the same or different message lengths.