Serial port baud rate processing device and method, electronic equipment and storage medium

By designing a serial baud rate processing device, and using the data transmission module and data processing module to automatically identify and adapt the serial baud rate, the problem of inefficient processing in the existing technology is solved, and efficient and accurate serial baud rate processing is achieved.

CN119629041AActive Publication Date: 2025-03-14INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510160197.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-03-14
Estimated Expiration
2045-02-13

AI Technical Summary

Technical Problem

In the prior art, the baud rate processing efficiency of the switch and the serial port server is low, and manual configuration errors or omissions are prone to occur, resulting in low processing efficiency.

Method used

A serial baud rate processing device is designed, including a data transmission module and a data processing module. By automatically identifying and adapting the serial baud rate of the switch and the serial port server, the automatic conversion and transmission of data is realized.

Benefits of technology

It improves the processing efficiency of the serial port baud rate, reduces the possibility of manual configuration errors, ensures the accuracy and reliability of data transmission, and is suitable for different models of switches and serial port servers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629041A_ABST
    Figure CN119629041A_ABST
Patent Text Reader

Abstract

The invention discloses a serial port baud rate processing device and method, electronic equipment and a storage medium. The device comprises a data transmission module and a data processing module, the data processing module is used for converting the second serial port data into fourth serial port data which can be identified by the switch according to the first serial port baud rate; the data transmission module is used for transmitting the third serial port data to the target serial port, and the data transmission module is used for transmitting the fourth serial port data to the switch. Compared with the prior art, according to the embodiment of the invention, when the serial port baud rates of the target serial port of the switch and the serial port server are inconsistent, the serial port baud rate of the opposite side is automatically utilized to convert the serial port data of the opposite side, so that the opposite side can identify the serial port data of the opposite side, and the serial port baud rate of the target serial port does not need to be manually reconfigured; and the processing efficiency of the serial port baud rate is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of data processing, and in particular to a serial port baud rate processing device and method, an electronic device and a storage medium. Background Art

[0002] After the switch is produced, it is necessary to connect the switch to the serial port server and exchange data between the switch and the serial port server to test whether the switch is produced qualified; different models of switches have different serial port baud rates. When replacing the switch connected to the target serial port of the serial port server with another model of switch, the serial port baud rate of the target serial port needs to be processed.

[0003] In the related technology of serial port baud rate processing, the serial port baud rate of the target serial port of the serial port server is usually manually reconfigured to the serial port baud rate of the replaced switch. There is a possibility of manual serial port baud rate configuration error or forgetting to configure, resulting in low serial port baud rate processing efficiency. Summary of the invention

[0004] The present invention provides a serial port baud rate processing device and method, electronic equipment and storage medium, and its main purpose is to solve the problem of low serial port baud rate processing efficiency.

[0005] According to a first aspect of the present disclosure, a serial port baud rate processing device is provided, the device comprising: a data transmission module, a data processing module; The data transmission module is connected to the port of the switch, the data transmission module is connected to the target serial port of the serial port server, and the data transmission module is connected to the data processing module; The data transmission module is used to transmit the first serial port baud rate of the switch, the first serial port data of the switch, the second serial port baud rate of the target serial port, and the second serial port data of the target serial port to the data processing module; The data processing module is used to convert the first serial port data into third serial port data recognizable by the target serial port according to the second serial port baud rate, and the data processing module is used to convert the second serial port data into fourth serial port data recognizable by the switch according to the first serial port baud rate; The data transmission module is used to transmit the third serial port data to the target serial port, and the data transmission module is used to transmit the fourth serial port data to the switch.

[0006] In some embodiments, the data transmission module includes: a first data transmitter, a second data transmitter; The first data transmitter is connected to the switch, and the first data transmitter is connected to the data processing module; The second data transmitter is connected to the target serial port, and the second data transmitter is connected to the data processing module; The first data transmitter is used to transmit the first serial port baud rate and the first serial port data to the data processing module, and the first data transmitter is used to transmit the fourth serial port data to the switch; The second data transmitter is used to transmit the second serial port baud rate and the second serial port data to the data processing module, and the second data transmitter is used to transmit the third serial port data to the target serial port.

[0007] In some embodiments, the first data transmitter is further configured to: Acquire a first communication level standard of the switch; If the first communication level standard is inconsistent with the preset communication level standard, the first communication level standard is converted into the preset communication level standard.

[0008] In some embodiments, the second data transmitter is further configured to: Acquire a second communication level standard of the target serial port; If the second communication level standard is inconsistent with the preset communication level standard, the second communication level standard is converted into the preset communication level standard.

[0009] In some embodiments, the data processing module includes: a data processor, a key module, and a data indication visualization module; The data processor is connected to the first data transmitter, the data processor is connected to the second data transmitter, the data processor is connected to the key module, and the data processor is connected to the data indication visualization module; The data processor is used to convert the first serial port data into the third serial port data according to the second serial port baud rate, and the data processor is used to convert the second serial port data into the fourth serial port data according to the first serial port baud rate; The button module is used to generate control instructions for the data processor, the data indication visualization module, the first data transmitter and the second data transmitter, and the data indication visualization module is used to perform data visualization display based on the control instructions.

[0010] In some embodiments, the apparatus further comprises: a connection switching module; The connection switching module is used to control the switching between the first circuit and the second circuit, the first circuit is a circuit connecting the data transmission module, the data processing module, the switch and the target serial port, and the second circuit is a circuit connecting the data processing module, the switch and the target serial port.

[0011] In some embodiments, the connection switching module includes a first connection switching switch and a second connection switching switch; The first connection switching switch is used to control the switching between the third circuit and the fourth circuit; the first circuit includes the third circuit, the second circuit includes the fourth circuit, the third circuit is a circuit connecting the switch, the first data transmitter and the data processing module, and the fourth circuit is a circuit connecting the switch and the data processing module; The second connection switching switch is used to control the switching between the fifth circuit and the sixth circuit; the first circuit includes the third circuit and the fifth circuit, the second circuit includes the fourth circuit and the sixth circuit, the fifth circuit is a circuit connecting the target serial port, the second data transmitter, and the data processing module, and the sixth circuit is a circuit connecting the target serial port and the data processing module.

[0012] In some embodiments, the apparatus further comprises: a connector module; The connector module is used to connect the switch, the target serial port and the data transmission module respectively.

[0013] In some embodiments, the connector module includes: a connector plug, a connector socket; The plug end of the connector plug is connected to the port of the switch, and the wire end of the connector plug is connected to the first data transmitter; The socket end of the connector socket is connected to the target serial port, and the wire end of the connector socket is connected to the second data transmitter.

[0014] In some embodiments, the device further comprises: a power supply module: The power supply module is connected to the switch, and the power supply module is connected to the data processing module; The power supply module is used to obtain power from the switch and transmit the power to the data processing module for use.

[0015] According to a second aspect of the present disclosure, a method for processing a serial port baud rate is provided, the method comprising: The data transmission module transmits the first serial port baud rate of the switch, the first serial port data of the switch, the second serial port baud rate of the target serial port of the serial port server, and the second serial port data of the target serial port to the data processing module; Using the data processing module to convert the first serial port data into third serial port data recognizable by the target serial port according to the second serial port baud rate, and using the data processing module to convert the second serial port data into fourth serial port data recognizable by the switch according to the first serial port baud rate; The data transmission module is used to transmit the third serial port data to the target serial port, and the data transmission module is used to transmit the fourth serial port data to the switch.

[0016] In some embodiments, the data transmission module includes: a first data transmitter and a second data transmitter, and the method further includes: Using a first data transmitter to obtain a first communication level standard of the switch, and using a second data transmitter to obtain a second communication level standard of the target serial port; If the first data transmitter determines that the first communication level standard is inconsistent with the preset communication level standard, converting the first communication level standard to the preset communication level standard using the first data transmitter; If the second data transmitter determines that the second communication level standard is inconsistent with the preset communication level standard, the second communication level standard is converted into the preset communication level standard by using the second data transmitter.

[0017] According to a third aspect of the present disclosure, there is provided an electronic device, including: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the second aspect.

[0018] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method described in the second aspect.

[0019] According to a fifth aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method as described in the second aspect above.

[0020] The present disclosure provides a serial port baud rate processing device and method, an electronic device and a storage medium, wherein the device comprises: a data transmission module and a data processing module; the data transmission module is connected to a port of a switch, the data transmission module is connected to a target serial port of a serial port server, and the data transmission module is connected to the data processing module; the data transmission module is used to transmit the first serial port baud rate of the switch, the first serial port data of the switch, the second serial port baud rate of the target serial port and the second serial port data of the target serial port to the data processing module; the data processing module is used to convert the first serial port data into third serial port data recognizable by the target serial port according to the second serial port baud rate, and the data processing module is used to convert the second serial port data into fourth serial port data recognizable by the switch according to the first serial port baud rate; the data transmission module is used to transmit the third serial port data to the target serial port, and the data transmission module is used to transmit the fourth serial port data to the switch. Compared with the related art, the disclosed embodiment automatically converts its own serial port data using the serial port baud rate of the other party when the serial port baud rate of the target serial port of the switch and the serial port server is inconsistent, so that the other party can recognize its own serial port data without manually reconfiguring the serial port baud rate of the target serial port, thereby improving the processing efficiency of the serial port baud rate.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. Figure 1 A structural schematic diagram of a serial port baud rate processing device provided by an embodiment of the present disclosure; Figure 2 A flowchart of a method for processing a serial port baud rate provided by an embodiment of the present disclosure; Figure 3 A flowchart of a serial port baud rate processing process provided by an embodiment of the present disclosure; Figure 4 A flowchart of another serial port baud rate processing process provided by an embodiment of the present disclosure; Figure 5 A schematic block diagram of an exemplary electronic device provided for an embodiment of the present disclosure. DETAILED DESCRIPTION

[0023] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0024] The following describes a serial port baud rate processing device and method, an electronic device, and a storage medium according to an embodiment of the present disclosure with reference to the accompanying drawings.

[0025] Figure 1 A schematic diagram of the structure of a serial port baud rate processing device provided by an embodiment of the present disclosure, such as Figure 1 As shown, the serial port baud rate processing device includes: a data transmission module 10 and a data processing module 20.

[0026] The data transmission module 10 is connected to a port of the switch 30 , the data transmission module 10 is connected to a target serial port 40 of the serial port server, and the data transmission module 10 is connected to the data processing module 20 .

[0027] In the embodiments of the present disclosure, the data transmission module is a component responsible for transmitting data between the switch, the target serial port of the serial port server and the data processing module, ensuring that data can be accurately and efficiently transmitted between various devices and modules; the data processing module is a component responsible for processing and converting data, analyzing and processing the transmitted data to make it meet the requirements of different devices. The target serial port refers to the specific serial port on the serial port server that communicates with the switch. The serial port server contains multiple serial ports, and one serial port can communicate with one switch. Therefore, one server can communicate with multiple switches at the same time.

[0028] Through the data transmission module, the data of the switch and serial port server can be transmitted to the data processing module in real time for processing, ensuring the real-time and accuracy of the switch testing process.

[0029] The data transmission module 10 is used to transmit the first serial port baud rate of the switch 30 , the first serial port data of the switch 30 , the second serial port baud rate of the target serial port 40 , and the second serial port data of the target serial port 40 to the data processing module 20 .

[0030] In the embodiments of the present disclosure, the serial port baud rate refers to the number of bits transmitted per second during serial communication, and is an important parameter for measuring data transmission speed. In serial communication, data is transmitted one bit at a time, and the baud rate determines the amount of data transmitted per unit time.

[0031] To help you better understand the serial port baud rate, an example is provided. Assume that the serial port baud rate is 9600, which means that 9600 bits of data are transmitted per second. If a character consists of 8 bits, then at a serial port baud rate of 9600, about 1200 characters can be transmitted per second (9600 / 8=1200). Different devices may use different baud rates based on their design and application scenarios. The serial port baud rates include but are not limited to 1200, 2400, 4800, and 19200.

[0032] Serial port data refers to data transmitted through a serial interface. Serial port data can be various types of information, such as device status information, control instructions, data collected by sensors, etc., which are transmitted bit by bit on the communication line in binary form.

[0033] The data transmission module can monitor the baud rate and data status during data transmission in real time. Once an abnormality is found, it can be fed back to the data processing module for processing to ensure the accuracy and integrity of data transmission.

[0034] The data processing module 20 is used to convert the first serial port data into third serial port data recognizable by the target serial port 40 according to the second serial port baud rate, and the data processing module 20 is used to convert the second serial port data into fourth serial port data recognizable by the switch 30 according to the first serial port baud rate.

[0035] In the embodiment of the present disclosure, the data processing module sets a buffer to store the received first serial port data and second serial port data, and the data processing module compares the baud rate of the first serial port data with the baud rate of the second serial port of the target serial port. If the two are inconsistent, the data processing module re-encodes and modulates the first serial port data according to the second baud rate to make it meet the baud rate requirement of the target serial port, and re-encodes and modulates the second serial port data according to the first baud rate to make it meet the baud rate requirement of the switch. The data processing module processes the first serial port data and the second serial port data frame by frame.

[0036] Different models of switches and serial port servers may use different baud rates. The data processing module can automatically identify and adapt the baud rates of the two to ensure that data can be transmitted correctly. The relevant technical methods require manual configuration of the baud rate, which is prone to errors or omissions. Through automated processing, human errors are avoided and the reliability of communication is improved. When replacing a different model of switch, the data processing module can automatically complete the conversion of baud rate and data format without reconfiguration, which significantly improves the test efficiency.

[0037] The data transmission module 10 is used to transmit the third serial port data to the target serial port 40 , and the data transmission module 10 is used to transmit the fourth serial port data to the switch 30 .

[0038] The third and fourth serial port data converted by the data processing module have matched the baud rate and data format of the target serial port and the switch. The data transmission module transmits the processed data to the corresponding device to ensure that the data can be correctly parsed and processed, avoiding communication errors caused by baud rate mismatch or inconsistent data format.

[0039] The present disclosure provides a serial port baud rate processing device, the device comprising: a data transmission module and a data processing module; the data transmission module is connected to the port of a switch, the data transmission module is connected to the target serial port of a serial port server, and the data transmission module is connected to the data processing module; the data transmission module is used to transmit the first serial port baud rate of the switch, the first serial port data of the switch, the second serial port baud rate of the target serial port, and the second serial port data of the target serial port to the data processing module; the data processing module is used to convert the first serial port data into the third serial port data recognizable by the target serial port according to the second serial port baud rate, and the data processing module is used to convert the second serial port data into the fourth serial port data recognizable by the switch according to the first serial port baud rate; the data transmission module is used to transmit the third serial port data to the target serial port, and the data transmission module is used to transmit the fourth serial port data to the switch. Compared with the related art, the disclosed embodiment automatically converts its own serial port data using the serial port baud rate of the other party when the serial port baud rate of the target serial port of the switch and the serial port server is inconsistent, so that the other party can recognize its own serial port data without manually reconfiguring the serial port baud rate of the target serial port, thereby improving the processing efficiency of the serial port baud rate.

[0040] In some embodiments, please refer to Figure 1 , the data transmission module 10 comprises: a first data transmitter 101 and a second data transmitter 102; The first data transmitter 101 is connected to the switch 30, and the first data transmitter 101 is connected to the data processing module 20; The second data transmitter 102 is connected to the target serial port 40 , and the second data transmitter 102 is connected to the data processing module 20 ; The first data transmitter 101 is used to transmit the first serial port baud rate and the first serial port data to the data processing module 20, and the first data transmitter 101 is used to transmit the fourth serial port data to the switch 30; The second data transmitter 102 is used to transmit the second serial port baud rate and the second serial port data to the data processing module 20 . The second data transmitter 102 is used to transmit the third serial port data to the target serial port 40 .

[0041] In the embodiment of the present disclosure, the first data transmitter is a component in the data transmission module responsible for communicating with the switch, and the second data transmitter is a component in the data transmission module responsible for communicating with the target serial port.

[0042] The first data transmission device and the second data transmission device are connected to the switch and the target serial port respectively, providing a dedicated channel for data transmission. This design can reduce interference and delay in data transmission and improve the efficiency and accuracy of data transmission.

[0043] In some embodiments, please refer to Figure 1 The first data transmitter 101 is also used to obtain a first communication level standard of the switch 30; if the first communication level standard is inconsistent with a preset communication level standard, the first communication level standard is converted into the preset communication level standard.

[0044] In the embodiments of the present disclosure, the communication level standard refers to the specification of the voltage level and logic level of the signal in serial communication. Different devices may use different communication level standards, which define the voltage range of the signal on the transmission line and the representation of the logic state (such as high level and low level). Inconsistency in communication level standards may cause the devices to fail to communicate correctly, so conversion is required to ensure compatibility.

[0045] Communication level standards include but are not limited to Transistor-Transistor Logic (TTL) level and Recommended Standard (RS)-232 level. The voltage range of TTL level is 3.3V or 5V for high level and 0V for low level. TTL level is widely used in digital logic circuits and some low-speed serial communication interfaces; the voltage range of RS-232 level is +3V to +15V for high level and -3V to -15V for low level. RS-232 level is used for serial communication between computers and external devices (such as modems, printers, etc.). The RS-232 standard defines a wider voltage range to improve the signal's anti-interference ability.

[0046] Among them, the preset communication level standard is a communication level standard preset in advance. The preset communication level standard can be a TTL level or an RS-232 level. However, it should be clear that this statement is not intended to limit the preset communication level standard to only be a TTL level or an RS-232 level, and it can also be other level standards.

[0047] If the communication level standards are inconsistent, communication errors may occur between devices, such as signal distortion, increased bit error rate, etc. Through level conversion, these problems can be avoided and the accuracy and reliability of data transmission can be ensured.

[0048] In some embodiments, please refer to Figure 1 The second data transmitter 102 is also used to obtain the second communication level standard of the target serial port 40; if the second communication level standard is inconsistent with the preset communication level standard, the second communication level standard is converted into the preset communication level standard.

[0049] The specific implementation method of the embodiment of the present disclosure is the same as that of the above embodiment, and will not be repeated in the embodiment of the present disclosure.

[0050] In some embodiments, please refer to Figure 1 , the data processing module 20 includes: a data processor 201, a button module 202, and a data indication visualization module 203; The data processor 201 is connected to the first data transmitter 101, the data processor 201 is connected to the second data transmitter 102, the data processor 201 is connected to the key module 202, and the data processor 201 is connected to the data indication visualization module 203; The data processor 201 is used to convert the first serial port data into the third serial port data according to the second serial port baud rate, and the data processor 201 is used to convert the second serial port data into the fourth serial port data according to the first serial port baud rate; The button module 202 is used to generate control instructions for the data processor 201, the data indication visualization module 203, the first data transmitter 101 and the second data transmitter 102, and the data indication visualization module 203 is used to perform data visualization based on the control instructions.

[0051] In the embodiments of the present disclosure, the data processor is the core component of the data processing module, which is responsible for performing data conversion, processing and control tasks. It is usually a microcontroller, a microprocessor or an application-specific integrated circuit, which can perform complex algorithms and logical operations. The key module is a user input interface that allows the user to input control instructions to the device through physical keys or virtual keys. It usually includes one or more keys, as well as related circuits and software logic. The indication visualization module is a display device for showing the operating status of the device and data transmission information to the user. It usually includes a light emitting diode (LED) indicator light, a liquid crystal display (LCD) screen or other display technology.

[0052] The connection between the data processor, data transmitter, key module and data indication visualization module adopts modular design, which is easy to maintain and replace.

[0053] In some embodiments, please refer to Figure 1 , the device further comprises: a connection switching module 50; The connection switching module 50 is used to control the switching between the first circuit and the second circuit, the first circuit is a circuit connecting the data transmission module 10, the data processing module 20, the switch 30 and the target serial port 40, and the second circuit is a circuit connecting the data processing module 20, the switch 30 and the target serial port 40.

[0054] In the embodiment of the present disclosure, the connection switching module is a circuit control component for switching between different circuits inside the device to change the data transmission path or connection mode. The first circuit is a circuit for connecting the data transmission module, the data processing module, the switch and the target serial port. The second circuit is a circuit for connecting the data processing module, the switch and the target serial port.

[0055] By switching modules, the circuit connection method can be quickly adjusted according to different test requirements or work scenarios. For example, in some cases, complete data processing and transmission may be required through the data transmission module, while in other cases, it may only require direct connection to the switch and serial port server, skipping some intermediate processing steps.

[0056] In some embodiments, please refer to Figure 1 , the connection switching module 50 includes a first connection switching switch 501 and a second connection switching switch 502; The first connection switching switch 501 is used to control the switching between the third circuit and the fourth circuit; the first circuit includes the third circuit, the second circuit includes the fourth circuit, the third circuit is a circuit for connecting the switch 30, the first data transmitter 101 and the data processing module 20, and the fourth circuit is a circuit for connecting the switch 30 and the data processing module 20; The second connection switching switch 502 is used to control the switching between the fifth circuit and the sixth circuit; the first circuit includes the third circuit and the fifth circuit, the second circuit includes the fourth circuit and the sixth circuit, the fifth circuit is a circuit connecting the target serial port 40, the second data transmitter 102, and the data processing module 20, and the sixth circuit is a circuit connecting the target serial port 40 with the data processing module 20.

[0057] In the embodiment of the present disclosure, the first connection switching switch and the second connection switching switch are switch components for controlling circuit switching. The third circuit refers to a circuit connecting the switch, the first data transmitter and the data processing module, the fourth circuit refers to a circuit directly connecting the switch with the data processing module, the fifth circuit refers to a circuit connecting the target serial port, the second data transmitter and the data processing module, and the sixth circuit refers to a circuit directly connecting the target serial port with the data processing module.

[0058] It is compatible with different types of switches or serial port servers and can adapt to different communication protocols or device characteristics by switching circuit configurations.

[0059] In some embodiments, please refer to Figure 1 , the device further comprises: a connector module 60; The connector module 60 is used to connect the switch 30 and the target serial port 40 to the data transmission module 10 respectively.

[0060] In the embodiments of the present disclosure, the connector module is a component used to physically connect the switch and the target serial port to the data transmission module respectively, and its main function is to ensure that signals and data can be stably transmitted between devices.

[0061] Connector modules usually have certain electrical protection functions, such as anti-short circuit, anti-reverse insertion, etc., to protect the circuit from damage.

[0062] In some embodiments, please refer to Figure 1 , the connector module 60 includes: a connector plug 601, a connector socket 602; The plug end of the connector plug 601 is connected to the port of the switch 30, and the wire end of the connector plug 601 is connected to the first data transmitter 101; The socket end of the connector socket 602 is connected to the target serial port 40 , and the wire end of the connector socket 602 is connected to the second data transmitter 102 .

[0063] In the embodiments of the present disclosure, a connector plug is an electrical connection component that can be inserted into a socket, usually with metal contacts, and is used to transmit electrical signals or power. The plug end of the connector plug is connected to the port of the switch, responsible for receiving signals from the switch or sending signals to the switch, and the wire end of the connector is connected to the first data transmitter to transmit the signal to the data transmission module. A connector socket is an electrical connection component for receiving a plug, usually fixed on a device, and is used to receive signals or power. The socket end of the connector socket is connected to the target serial port, responsible for receiving signals from the target serial port or sending signals to the target serial port, and the wire end of the connector socket is connected to the second data transmitter to transmit the signal to the data transmission module.

[0064] The connector plug and connector socket are electrically connected through metal contacts to ensure stable transmission of signals and power and avoid poor contact or signal loss.

[0065] In some embodiments, please refer to Figure 1 The device further comprises: a power supply module 70: The power supply module 70 is connected to the switch 30, and the power supply module 70 is connected to the data processing module 20; The power supply module 70 is used to obtain power from the switch 30 and transmit the power to the data processing module 20 for use.

[0066] In the embodiments of the present disclosure, the power supply module is a power management unit in the device, which is responsible for obtaining power from an external power source (such as a switch) and converting it into power suitable for use by other modules inside the device.

[0067] The power supply module can manage the distribution of power to ensure that each module in the device can obtain a stable power supply. It can also provide overvoltage protection, overcurrent protection and other functions to prevent power failure from damaging the device.

[0068] According to an embodiment of the present disclosure, the present disclosure also proposes a method for processing the serial port baud rate, such as Figure 2 As shown, Figure 2 A flowchart of a method for processing a serial port baud rate provided in an embodiment of the present disclosure is provided. The method is applied to a device for processing a serial port baud rate. The method comprises the following steps: Step 801, using a data transmission module to transmit the first serial port baud rate of a switch, the first serial port data of the switch, the second serial port baud rate of a target serial port of a serial port server, and the second serial port data of the target serial port to a data processing module.

[0069] Step 802: Using the data processing module to convert the first serial port data into third serial port data recognizable by the target serial port according to the second serial port baud rate; using the data processing module to convert the second serial port data into fourth serial port data recognizable by the switch according to the first serial port baud rate.

[0070] Step 803: Use the data transmission module to transmit the third serial port data to the target serial port, and use the data transmission module to transmit the fourth serial port data to the switch.

[0071] Since the embodiment of the serial port baud rate processing method part corresponds to the embodiment of the serial port baud rate processing device part, the embodiment of the serial port baud rate processing method part can refer to the description of the embodiment of the serial port baud rate processing device part, which will not be repeated here. And it has the same beneficial effects as the above-mentioned serial port baud rate processing device.

[0072] The present disclosure provides a method for processing serial port baud rate, the method comprising: a data transmission module and a data processing module; the data transmission module is connected to a port of a switch, the data transmission module is connected to a target serial port of a serial port server, and the data transmission module is connected to the data processing module; the data transmission module is used to transmit the first serial port baud rate of the switch, the first serial port data of the switch, the second serial port baud rate of the target serial port, and the second serial port data of the target serial port to the data processing module; the data processing module is used to convert the first serial port data into third serial port data recognizable by the target serial port according to the second serial port baud rate, and the data processing module is used to convert the second serial port data into fourth serial port data recognizable by the switch according to the first serial port baud rate; the data transmission module is used to transmit the third serial port data to the target serial port, and the data transmission module is used to transmit the fourth serial port data to the switch. Compared with the related art, the disclosed embodiment automatically converts its own serial port data using the serial port baud rate of the other party when the serial port baud rate of the target serial port of the switch and the serial port server is inconsistent, so that the other party can recognize its own serial port data without manually reconfiguring the serial port baud rate of the target serial port, thereby improving the processing efficiency of the serial port baud rate.

[0073] In actual applications, the communication level standards of the target serial port of the switch and the serial port server may be inconsistent. It is necessary to adjust the communication level standards of the target serial port of the switch and the serial port server to be consistent. This can be achieved by but not limited to the following methods: using a first data transmitter to obtain the first communication level standard of the switch, and using a second data transmitter to obtain the second communication level standard of the target serial port; if the first data transmitter determines that the first communication level standard is inconsistent with the preset communication level standard, the first data transmitter is used to convert the first communication level standard to the preset communication level standard; if the second data transmitter determines that the second communication level standard is inconsistent with the preset communication level standard, the second data transmitter is used to convert the second communication level standard to the preset communication level standard.

[0074] For more specific working processes of the above embodiments, please refer to the corresponding contents disclosed in the above embodiments, which will not be repeated here.

[0075] In one possible implementation of the embodiment of the present disclosure, in order to better understand the entire process of the serial port baud rate processing method, as shown in FIG. Figure 3 As shown, Figure 3A flowchart of a serial port baud rate processing process provided by an embodiment of the present disclosure, according to the communication level standards of the target serial ports of the switch and the serial port server, the communication level standards of the switch and the target serial port are adjusted to be consistent; according to actual use requirements, a working mode is selected, wherein the working mode includes automatic mode and manual mode; if the selected working mode is automatic mode, the serial port baud rates of the switch and the target serial port are automatically identified; if the selected working mode is manual mode, it is executed according to the corresponding manual mode, wherein the manual mode includes automatic on the switch side and manual on the target serial port side, manual on the switch side and automatic on the target serial port side, and manual on the switch side and manual on the target serial port side; if the selected manual mode is automatic on the switch side and manual on the target serial port side, the switch side is configured to the automatic baud rate mode, the serial port baud rate of the switch is automatically identified, and the UART device side is configured to the forced baud rate mode, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 11 5200; If the selected manual mode is manual on the switch side and automatic on the target serial port side, the switch side is configured to the forced baud rate mode, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and the target serial port side is configured to the automatic baud rate mode to automatically identify the serial port baud rate of the target serial port; If the selected manual mode is manual on the switch side and manual on the target serial port side, the switch side is configured to the forced baud rate mode, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200, configure the target serial port side to the forced baud rate mode, the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200; receive serial port data from the switch and the target serial port in real time and cache it; after receiving each frame of serial port data, convert it according to the corresponding serial port baud rate of the switch and the target serial port side, and send the converted serial port data to the switch and the target serial port. By providing flexible working mode selection, automatic identification function, real-time data processing and multiple baud rate options, this serial port baud rate processing device significantly improves the compatibility, reliability and flexibility of communication. It not only simplifies the configuration and maintenance process, but also can adapt to a variety of application scenarios, improving the versatility and scalability of the system.

[0076] In one possible implementation of the embodiment of the present disclosure, in order to better understand the entire process of the serial port baud rate processing method, as shown in FIG. Figure 4 As shown, Figure 4A flowchart of another serial port baud rate processing process provided by an embodiment of the present disclosure is provided, wherein step (1) configures the corresponding RS232 or TTL level through the DIP switch according to the level type of the switch and the UART device, and proceeds to step (2); step (2) selects the working mode according to actual use requirements, if the automatic mode is selected, proceeds to step (3); if the manual mode is selected, proceeds to step (6); step (3) configures both the switch side and the UART device side to the automatic baud rate mode through the key unit A / B, and proceeds to step (4); Step (4) The main control unit automatically identifies the baud rate of the UART signal of the switch and the UART device according to the received UART signal, and enters step (5); Step (5) During the baud rate identification process, the LED flashes to indicate that the baud rate of the current switch side or the UART device has not been successfully locked; After the baud rate identification is successful, the corresponding LED indicator light is turned on to indicate the UART baud rate information of the switch and the UART device side, and enters step (13); Step (6) Select the manual mode. If the switch side is selected to be automatic and the UART device side is manual, enter step (7); If the switch side is selected to be manual and the UART device side is automatic, enter step (9); If both the switch and the UART device side are selected to be manual, enter step (11); Step (7) The switch side is configured to the automatic baud rate mode through the key unit A. The main control unit automatically identifies the baud rate of the switch UART signal according to the received UART signal of the switch side, and enters step (8); Step (8 ) Use the key unit B to configure the UART device side to the forced baud rate mode. The optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and then go to step (13); Step (9) Use the key unit A to configure the switch side to the forced baud rate mode. The optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and then go to step (10); Step (10) Use the key unit B to configure the UART device side to the automatic baud rate mode. The master control The unit automatically identifies the baud rate of the UART signal of the UART device according to the received UART signal of the UART device side, and enters step (13); step (11) configures the switch side to the forced baud rate mode through the key unit A, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and enters step (12); step (12) configures the UART device side to the forced baud rate mode through the key unit B, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200, go to step (13); step (13) the main control unit receives the UART data from the switch and the UART device in real time, and stores it in the internal cache, go to step (14); step (14) after receiving each frame of data, the main control unit sends it to the switch and the UART device according to the baud rate corresponding to the switch and the UART device, go to step (15); whether step (15) is finished, if finished, go to step (16), otherwise, return to step (2); step (16) is finished.

[0077] In summary, the embodiments of the present disclosure can achieve the following effects: When the serial port baud rates of the target serial ports of the switch and the serial port server are inconsistent, the disclosed embodiment automatically converts its own serial port data using the serial port baud rate of the other party, so that the other party can recognize its own serial port data without manually reconfiguring the serial port baud rate of the target serial port, thereby improving the processing efficiency of the serial port baud rate.

[0078] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.

[0079] Figure 5 A schematic block diagram of an example electronic device 900 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0080] like Figure 5 As shown, the electronic device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a ROM (Read-Only Memory) 902 or a computer program loaded from a storage unit 908 to a RAM (Random Access Memory) 903. In the RAM 903, various programs and data required for the operation of the electronic device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An I / O (Input / Output) interface 905 is also connected to the bus 904.

[0081] Multiple components in the electronic device 900 are connected to the I / O interface 905, including: an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the electronic device 900 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0082] The computing unit 901 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, CPU (Central Processing Unit), GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, DSP (Digital Signal Processor), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as a processing method for a serial port baud rate. For example, in some embodiments, the processing method for a serial port baud rate may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 908. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the method described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to execute the aforementioned serial port baud rate processing method in any other appropriate manner (for example, by means of firmware).

[0083] Various embodiments of the systems and techniques described above herein may be implemented in digital electronic circuit systems, integrated circuit systems, FPGAs (Field Programmable Gate Arrays), ASICs (Application-Specific Integrated Circuits), ASSPs (Application Specific Standard Products), SOCs (System On Chips), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs that may be executed and / or interpreted on a programmable system including at least one programmable processor that may be a dedicated or general-purpose programmable processor that may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0084] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0085] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, EPROM (Electrically Programmable Read-Only-Memory) or flash memory, optical fiber, CD-ROM (Compact Disc Read-Only Memory), optical storage device, magnetic storage device, or any suitable combination of the foregoing.

[0086] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0087] The systems and techniques described herein may be implemented in a computing system that includes a backend component (e.g., as a data server), or a computing system that includes a middleware component (e.g., an application server), or a computing system that includes a frontend component (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0088] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.

[0089] It should be noted that artificial intelligence is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), and includes both hardware-level and software-level technologies. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, and big data processing; artificial intelligence software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, as well as machine learning / deep learning, big data processing technology, knowledge graph technology, and other major directions.

[0090] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0091] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A serial port baud rate processing device, characterized in that: include: Data transmission module, data processing module; The data transmission module is connected to the port of the switch, the data transmission module is connected to the target serial port of the serial port server, and the data transmission module is connected to the data processing module; The data transmission module is used to transmit the first serial port baud rate of the switch, the first serial port data of the switch, the second serial port baud rate of the target serial port, and the second serial port data of the target serial port to the data processing module; The data processing module is used to convert the first serial port data into third serial port data recognizable by the target serial port according to the second serial port baud rate, and the data processing module is used to convert the second serial port data into fourth serial port data recognizable by the switch according to the first serial port baud rate; The data transmission module is used to transmit the third serial port data to the target serial port, and the data transmission module is used to transmit the fourth serial port data to the switch.

2. The device according to claim 1, characterized in that The data transmission module includes: a first data transmitter and a second data transmitter; The first data transmitter is connected to the switch, and the first data transmitter is connected to the data processing module; The second data transmitter is connected to the target serial port, and the second data transmitter is connected to the data processing module; The first data transmitter is used to transmit the first serial port baud rate and the first serial port data to the data processing module, and the first data transmitter is used to transmit the fourth serial port data to the switch; The second data transmitter is used to transmit the second serial port baud rate and the second serial port data to the data processing module, and the second data transmitter is used to transmit the third serial port data to the target serial port.

3. The device according to claim 2, characterized in that The first data transmitter is further used for: Acquire a first communication level standard of the switch; If the first communication level standard is inconsistent with the preset communication level standard, the first communication level standard is converted into the preset communication level standard.

4. The device according to claim 2, characterized in that The second data transmitter is further used for: Acquire a second communication level standard of the target serial port; If the second communication level standard is inconsistent with the preset communication level standard, the second communication level standard is converted into the preset communication level standard.

5. The device according to claim 2, characterized in that The data processing module includes: a data processor, a key module, and a data indication visualization module; The data processor is connected to the first data transmitter, the data processor is connected to the second data transmitter, the data processor is connected to the key module, and the data processor is connected to the data indication visualization module; The data processor is used to convert the first serial port data into the third serial port data according to the second serial port baud rate, and the data processor is used to convert the second serial port data into the fourth serial port data according to the first serial port baud rate; The button module is used to generate control instructions for the data processor, the data indication visualization module, the first data transmitter and the second data transmitter, and the data indication visualization module is used to perform data visualization display based on the control instructions.

6. The device according to claim 4, characterized in that The device also includes: a connection switching module; The connection switching module is used to control the switching between the first circuit and the second circuit, the first circuit is a circuit connecting the data transmission module, the data processing module, the switch and the target serial port, and the second circuit is a circuit connecting the data processing module, the switch and the target serial port.

7. The device according to claim 6, characterized in that The connection switching module includes a first connection switching switch and a second connection switching switch; The first connection switching switch is used to control the switching between the third circuit and the fourth circuit; the first circuit includes the third circuit, the second circuit includes the fourth circuit, the third circuit is a circuit connecting the switch, the first data transmitter and the data processing module, and the fourth circuit is a circuit connecting the switch and the data processing module; The second connection switching switch is used to control the switching between the fifth circuit and the sixth circuit; the first circuit includes the third circuit and the fifth circuit, the second circuit includes the fourth circuit and the sixth circuit, the fifth circuit is a circuit connecting the target serial port, the second data transmitter, and the data processing module, and the sixth circuit is a circuit connecting the target serial port and the data processing module.

8. The device according to claim 2, characterized in that The device further comprises: a connector module; The connector module is used to connect the switch, the target serial port and the data transmission module respectively.

9. The device according to claim 8, characterized in that The connector module comprises: a connector plug and a connector socket; The plug end of the connector plug is connected to the port of the switch, and the wire end of the connector plug is connected to the first data transmitter; The socket end of the connector socket is connected to the target serial port, and the wire end of the connector socket is connected to the second data transmitter.

10. The device according to claim 1, characterized in that The device also includes: a power supply module: The power supply module is connected to the switch, and the power supply module is connected to the data processing module; The power supply module is used to obtain power from the switch and transmit the power to the data processing module for use.

11. A processing method of the serial port baud rate processing device according to any one of claims 1 to 10, characterized in that: include: The data transmission module transmits the first serial port baud rate of the switch, the first serial port data of the switch, the second serial port baud rate of the target serial port of the serial port server, and the second serial port data of the target serial port to the data processing module; Using the data processing module to convert the first serial port data into third serial port data recognizable by the target serial port according to the second serial port baud rate, and using the data processing module to convert the second serial port data into fourth serial port data recognizable by the switch according to the first serial port baud rate; The data transmission module is used to transmit the third serial port data to the target serial port, and the data transmission module is used to transmit the fourth serial port data to the switch.

12. The method according to claim 11, characterized in that The method further comprises: Using a first data transmitter to obtain a first communication level standard of the switch, and using a second data transmitter to obtain a second communication level standard of the target serial port; If the first data transmitter determines that the first communication level standard is inconsistent with the preset communication level standard, converting the first communication level standard to the preset communication level standard using the first data transmitter; If the second data transmitter determines that the second communication level standard is inconsistent with the preset communication level standard, the second communication level standard is converted into the preset communication level standard by using the second data transmitter.

13. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 11 to 12.

14. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 11-12.

15. A computer program product, characterized in that It comprises a computer program which, when executed by a processor, implements the method according to any one of claims 11-12.

Citation Information

Patent Citations

  • Serial port baud rate self-adaptive receiving end, implementation method and system

    CN112559412A

  • Low-power UART serial port system

    CN114490488A

  • Communication baud rate debugging method and device, equipment and storage medium

    CN117254884A

  • Serial port communication circuit, board card and server

    CN117785760A