Device and Method for Processing Serial Port Baud Rate, Electronic Device, and Storage Medium

By designing a serial baud rate processing device, the data transmission module and data processing module automatically identify and convert the serial baud rate, the problem of baud rate mismatch between the switch and the serial server is solved, and processing efficiency and data transmission reliability are improved.

CN119629041BActive Publication Date: 2025-06-03INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, the baud rate processing efficiency between the switch and the serial port server is low, which is prone to mismatch in the baud rate due to manual configuration errors, affecting data transmission.

Method used

A serial baud rate processing device is designed, including a data transmission module and a data processing module. By automatically identifying and converting the serial baud rate, the data transmission between the switch and the serial server can be automatically adapted.

Benefits of technology

It improves the efficiency of serial port baud rate processing, reduces the possibility of manual configuration errors, and ensures the reliability and compatibility of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629041B_ABST
    Figure CN119629041B_ABST
Patent Text Reader

Abstract

The present disclosure discloses a processing device and method for serial port baud rate, an electronic device, and a storage medium, relating to the technical field of data processing, including: a data transmission module transmits the first serial port baud rate and first serial port data of a switch, and the second serial port baud rate and second serial port data of a target serial port to a data processing module; the data processing module converts 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 converts 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 transmits the third serial port data to the target serial port, and the data transmission module transmits the fourth serial port data to the switch. Compared with the related art, the embodiment of the present disclosure does not require manual reconfiguration of the serial port baud rate of the target serial port, improving the processing efficiency of the serial port baud rate.
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 particularly to an apparatus and method for processing the serial port baud rate, 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 perform data interaction between the switch and the serial port server to test whether the production of the switch is qualified; for switches of different models, the serial port baud rates are different. When replacing the switch connected to the target serial port of the serial port server with another model of switch, it is necessary to process the serial port baud rate of the target serial port.

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

[0004] The present disclosure provides an apparatus and method for processing the serial port baud rate, an electronic device, and a storage medium. Its main purpose is to solve the problem of low efficiency in processing the serial port baud rate.

[0005] According to a first aspect of the present disclosure, there is provided an apparatus for processing the serial port baud rate, the apparatus including: a data transmission module, a data processing module;

[0006] 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;

[0007] The data transmission module is configured 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;

[0008] The data processing module is configured 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 configured to convert the second serial port data into fourth serial port data recognizable by the switch according to the first serial port baud rate;

[0009] The data transmission module is configured to transmit the third serial port data to the target serial port, and the data transmission module is configured to transmit the fourth serial port data to the switch.

[0010] In some embodiments, the data transmission module includes: a first data transmitter and a second data transmitter;

[0011] The first data transmitter is connected to the switch, and the first data transmitter is connected to the data processing module;

[0012] The second data transmitter is connected to the target serial port, and the second data transmitter is connected to the data processing module;

[0013] The first data transmitter is configured 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 configured to transmit the fourth serial port data to the switch;

[0014] The second data transmitter is configured 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 configured to transmit the third serial port data to the target serial port.

[0015] In some embodiments, the first data transmitter is further configured to

[0016] acquire a first communication level standard of the switch;

[0017] If the first communication level standard is inconsistent with a preset communication level standard, convert the first communication level standard to the preset communication level standard.

[0018] In some embodiments, the second data transmitter is further configured to

[0019] acquire a second communication level standard of the target serial port;

[0020] If the second communication level standard is inconsistent with a preset communication level standard, convert the second communication level standard to the preset communication level standard.

[0021] In some embodiments, the data processing module includes: a data processor, a key module, and a data indication visualization module;

[0022] 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;

[0023] The data processor is configured 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 configured to convert the second serial port data into the fourth serial port data according to the first serial port baud rate;

[0024] 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.

[0025] In some embodiments, the device further includes: a connection switching module;

[0026] The connection switching module is used to control the switching between a first circuit and a 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.

[0027] In some embodiments, the connection switching module includes a first connection switching switch and a second connection switching switch;

[0028] The first connection switching switch is used to control the switching between a third circuit and a 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;

[0029] The second connection switching switch is used to control the switching between a fifth circuit and a 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.

[0030] In some embodiments, the device further includes: a connector module;

[0031] The connector module is used to connect the switch and the target serial port to the data transmission module respectively.

[0032] In some embodiments, the connector module includes: a connector plug and a connector socket;

[0033] 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;

[0034] 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.

[0035] In some embodiments, the device further includes: a power supply module:

[0036] The power supply module is connected to the switch, and the power supply module is connected to the data processing module;

[0037] The power supply module is configured to obtain power from the switch and transmit the power to the data processing module for use.

[0038] According to a second aspect of the present disclosure, there is provided a method for processing the serial port baud rate, the method including:

[0039] Using a data transmission module 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 of the serial port server, and the second serial port data of the target serial port to a data processing module;

[0040] 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;

[0041] Using the data transmission module to transmit the third serial port data to the target serial port, and using the data transmission module to transmit the fourth serial port data to the switch.

[0042] In some embodiments, the data transmission module includes: a first data transmitter, a second data transmitter, and the method further includes:

[0043] Using the first data transmitter to obtain the first communication level standard of the switch, and using the second data transmitter to obtain the second communication level standard of the target serial port;

[0044] If the first data transmitter determines that the first communication level standard is inconsistent with a preset communication level standard, then using the first data transmitter to convert the first communication level standard into the preset communication level standard;

[0045] If the second data transmitter determines that the second communication level standard is inconsistent with a preset communication level standard, then using the second data transmitter to convert the second communication level standard into the preset communication level standard.

[0046] According to a third aspect of the present disclosure, there is provided an electronic device, including:

[0047] At least one processor; and

[0048] A memory communicatively connected to the at least one processor; wherein,

[0049] The memory stores instructions executable by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to execute the method described in the foregoing second aspect.

[0050] 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 cause the computer to execute the method described in the foregoing second aspect.

[0051] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program which, when executed by a processor, implements the method described in the foregoing second aspect.

[0052] The serial port baud rate processing device, method, electronic device and storage medium provided by the present disclosure, the device includes: 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 configured 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 configured 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 configured 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 configured to transmit the third serial port data to the target serial port, and the data transmission module is configured to transmit the fourth serial port data to the switch. Compared with the related art, when the serial port baud rates of the switch and the target serial port of the serial port server are inconsistent in the embodiment of the present disclosure, the serial port data of itself is automatically converted by using the serial port baud rate of the other party, so that the other party can recognize the serial port data of itself, and there is no need to manually reconfigure the serial port baud rate of the target serial port, thereby improving the processing efficiency of the serial port baud rate.

[0053] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present application, nor is it used 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

[0054] The drawings are used to better understand the solution and do not constitute a limitation to the present disclosure. Among them:

[0055] Figure 1Schematic structural diagram of a serial port baud rate processing device provided by an embodiment of the present disclosure;

[0056] Figure 2 Schematic flowchart of a serial port baud rate processing method provided by an embodiment of the present disclosure;

[0057] Figure 3 Schematic flowchart of a serial port baud rate processing process provided by an embodiment of the present disclosure;

[0058] Figure 4 Schematic flowchart of another serial port baud rate processing process provided by an embodiment of the present disclosure;

[0059] Figure 5 Schematic block diagram of an exemplary electronic device provided by an embodiment of the present disclosure. Detailed implementation manners

[0060] The following describes exemplary embodiments of the present disclosure with reference to the accompanying drawings. Various details of the embodiments of the present disclosure are included to facilitate understanding, and they should be considered merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

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

[0062] Figure 1 Schematic structural diagram of a serial port baud rate processing device provided by an embodiment of the present disclosure, as Figure 1 shown. The serial port baud rate processing device includes: a data transmission module 10 and a data processing module 20.

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

[0064] In an embodiment 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 meet the requirements of different devices. The target serial port refers to a 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 simultaneously.

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

[0066] The data transmission module 10 is configured 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.

[0067] In an embodiment 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 the data transmission speed. In serial communication, data is transmitted bit by bit, and the baud rate determines the amount of data transmitted per unit time.

[0068] To facilitate a better understanding of the serial port baud rate, an example is provided. Assuming the serial port baud rate is 9600, it means that 9600 bits of data are transmitted per second. If a character consists of 8 bits, then at a 9600 serial port baud rate, approximately 1200 characters can be transmitted per second (9600 / 8 = 1200). Different devices may adopt different baud rates according to their designs and application scenarios. The serial port baud rates include, but are not limited to, 1200, 2400, 4800, 19200.

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

[0070] The data transmission module can monitor the baud rate and data status during the data transmission process in real time. Once an abnormality is detected, it can be promptly feedback to the data processing module for processing to ensure the accuracy and integrity of the data transmission.

[0071] The data processing module 20 is configured 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 configured 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.

[0072] In an embodiment of the present disclosure, the data processing module will set a buffer to store the received first serial port data and second serial port data. The data processing module compares the baud rate of the first serial port data with the second serial port baud rate of the target serial port. If the two are inconsistent, the data processing module will re-encode and modulate the first serial port data according to the second baud rate to make it meet the baud rate requirements of the target serial port, and re-encode and modulate the second serial port data according to the first baud rate to make it meet the baud rate requirements of the switch. Among them, the data processing module processes the first serial port data and the second serial port data frame by frame.

[0073] Switches and serial port servers of different models may use different baud rates. The data processing module can automatically identify and adapt to the baud rates of both to ensure correct data transmission. Related 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 switches of different models, the data processing module can automatically complete the conversion of the baud rate and data format without reconfiguration, significantly improving the test efficiency.

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

[0075] The third serial port data and the fourth serial port data after being converted by the data processing module have matched the baud rates and data formats of the target serial port and the switch. The data transmission module transmits the processed data to the corresponding devices to ensure that the data can be correctly parsed and processed, avoiding communication errors caused by unmatched baud rates or inconsistent data formats.

[0076] The serial port baud rate processing device provided by the present disclosure includes a data transmission module and 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 configured 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 configured 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 configured 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 configured to transmit the third serial port data to the target serial port, and the data transmission module is configured to transmit the fourth serial port data to the switch. Compared with the related art, when the serial port baud rates of the switch and the target serial port of the serial port server are inconsistent, the embodiments of the present disclosure automatically convert their own serial port data using the serial port baud rate of the other party, so that the other party can recognize their own serial port data, without manually reconfiguring the serial port baud rate of the target serial port, improving the processing efficiency of the serial port baud rate.

[0077] In some embodiments, please continue to refer to Figure 1 , the data transmission module 10 includes a first data transmitter 101 and a second data transmitter 102;

[0078] 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;

[0079] 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;

[0080] The first data transmitter 101 is configured 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 configured to transmit the fourth serial port data to the switch 30;

[0081] The second data transmitter 102 is configured to transmit the second serial port baud rate and the second serial port data to the data processing module 20, and the second data transmitter 102 is configured to transmit the third serial port data to the target serial port 40.

[0082] In the embodiments 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.

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

[0084] In some embodiments, please continue to refer to Figure 1 , the first data transmitter 101 is further configured to obtain the first communication level standard of the switch 30; if the first communication level standard is inconsistent with the preset communication level standard, then convert the first communication level standard to the preset communication level standard.

[0085] 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 adopt different communication level standards, and these standards define the voltage range of the signal on the transmission line and the representation method of the logical state (such as high level and low level). Inconsistency in the communication level standard may cause incorrect communication between devices, so conversion is required to ensure compatibility.

[0086] The communication level standard includes but is not limited to Transistor-Transistor Logic (TTL) level, Recommended Standard (RS)-232 level. Among them, the voltage range of the TTL level is 3.3V or 5V for high level and 0V for low level. The TTL level is widely used in digital logic circuits and some low-speed serial communication interfaces; the voltage range of the RS-232 level is +3V to +15V for high level and -3V to -15V for low level. The RS-232 level is used for serial communication between a computer and external devices (such as a modem, printer, etc.). The RS-232 standard defines a relatively wide voltage range to improve the anti-interference ability of the signal.

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

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

[0089] In some embodiments, please continue to refer to Figure 1, the second data transmitter 102 is further configured 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, convert the second communication level standard to the preset communication level standard.

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

[0091] In some embodiments, please continue to refer to Figure 1 , the data processing module 20 includes: a data processor 201, a key module 202, and a data indication visualization module 203;

[0092] 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;

[0093] The data processor 201 is configured 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 configured to convert the second serial port data into the fourth serial port data according to the first serial port baud rate;

[0094] The key module 202 is configured 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 configured to perform data visualization display based on the control instructions.

[0095] In the embodiments of the present disclosure, the data processor is the core component of the data processing module, responsible for executing data conversion, processing, and control tasks. It is usually a microcontroller, a microprocessor, or an application-specific integrated circuit, capable of executing complex algorithms and logical operations. The key module is a user input interface that allows users 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 data indication visualization module is a display device for presenting the operating status and data transmission information of the device to the user. It usually includes light-emitting diodes (LEDs), liquid crystal display (LCD) screens, or other display technologies.

[0096] The connections between the data processor, the data transmitter, the key module, and the data indication visualization module adopt a modular design, which is convenient for maintenance and replacement.

[0097] In some embodiments, continue to refer to Figure 1 , the device further includes: a connection switching module 50;

[0098] The connection switching module 50 is used to control the switching between the first circuit and the second circuit. The first circuit is the circuit that connects the data transmission module 10, the data processing module 20, the switch 30, and the target serial port 40. The second circuit is the circuit that connects the data processing module 20, the switch 30, and the target serial port 40.

[0099] In the embodiments of the present disclosure, the connection switching module is a circuit control component used to switch between different circuits inside the device to change the data transmission path or connection method. The first circuit is the circuit that connects the data transmission module, the data processing module, the switch, and the target serial port. The second circuit is the circuit that connects the data processing module, the switch, and the target serial port.

[0100] Through the switching module, the circuit connection method can be quickly adjusted according to different test requirements or working scenarios. For example, in some cases, it may be necessary to perform complete data processing and transmission through the data transmission module, while in other cases, it may only be necessary to directly connect the switch and the serial port server, skipping some intermediate processing steps.

[0101] In some embodiments, continue to refer to Figure 1 , the connection switching module 50 includes a first connection switching switch 501 and a second connection switching switch 502;

[0102] 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 the circuit that connects the switch 30, the first data transmitter 101, and the data processing module 20, and the fourth circuit is the circuit that connects the switch 30 and the data processing module 20;

[0103] 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 the circuit that connects the target serial port 40, the second data transmitter 102, and the data processing module 20, and the sixth circuit is the circuit that connects the target serial port 40 and the data processing module 20.

[0104] In an 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 the circuit connecting the switch, the first data transmitter, and the data processing module. The fourth circuit refers to the circuit directly connecting the switch to the data processing module. The fifth circuit refers to the circuit connecting the target serial port, the second data transmitter, and the data processing module. The sixth circuit refers to the circuit directly connecting the target serial port to the data processing module.

[0105] It can be compatible with different types of switches or serial port servers, and adapt to different communication protocols or device characteristics by switching the circuit configuration.

[0106] In some embodiments, please continue to refer to Figure 1 , the device further includes: a connector module 60;

[0107] The connector module 60 is used to connect the switch 30 and the target serial port 40 to the data transmission module 10 respectively.

[0108] In an embodiment of the present disclosure, the connector module is a component for physically connecting the switch and the target serial port to the data transmission module, and its main function is to ensure stable signal and data transmission between devices.

[0109] The connector module usually has certain electrical protection functions, such as short-circuit prevention and reverse insertion prevention, so as to protect the circuit from damage.

[0110] In some embodiments, please continue to refer to Figure 1 , the connector module 60 includes: a connector plug 601 and a connector socket 602;

[0111] 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;

[0112] 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.

[0113] In an embodiment of the present disclosure, a connector plug is an electrical connection component that can be inserted into a socket, usually with metal contacts, for transmitting 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. 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, for receiving 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. The wire end of the socket of the connector is connected to the second data transmitter to transmit the signal to the data transmission module.

[0114] The connector plug and the connector socket achieve electrical connection through metal contacts, ensuring stable transmission of signals and power, and avoiding poor contact or signal loss.

[0115] In some embodiments, please continue to refer to Figure 1 , the device further includes: a power supply module 70:

[0116] 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;

[0117] 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.

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

[0119] 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 functions such as overvoltage protection and overcurrent protection to prevent damage to the device caused by power failures.

[0120] According to an embodiment of the present disclosure, the present disclosure also proposes a method for processing the serial port baud rate, as Figure 2 shown, Figure 2 is a schematic flowchart of a method for processing the serial port baud rate provided by an embodiment of the present disclosure. The method is applied to a device for processing the serial port baud rate, and the method includes the following steps:

[0121] Step 801, use the data transmission module 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 of the serial port server, and the second serial port data of the target serial port to the data processing module.

[0122] Step 802: Use 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 use 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.

[0123] 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.

[0124] Since the embodiments in the part of the method for processing the serial port baud rate correspond to the embodiments in the part of the apparatus for processing the serial port baud rate, please refer to the description of the embodiments in the part of the apparatus for processing the serial port baud rate for the embodiments in the part of the method for processing the serial port baud rate, which will not be elaborated here. And it has the same beneficial effects as the above-mentioned apparatus for processing the serial port baud rate.

[0125] The method for processing the serial port baud rate provided by the present disclosure includes: a data transmission module and 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 configured 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 configured 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 configured 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 configured to transmit the third serial port data to the target serial port, and the data transmission module is configured to transmit the fourth serial port data to the switch. Compared with the related art, when the serial port baud rates of the switch and the target serial port of the serial port server are inconsistent, the embodiments of the present disclosure automatically convert their own serial port data using the serial port baud rate of the other party, so that the other party can recognize their own serial port data, without manually reconfiguring the serial port baud rate of the target serial port, improving the processing efficiency of the serial port baud rate.

[0126] In practical applications, the communication level standards of the target serial ports of the switch and the serial server may not be consistent. It is necessary to adjust the communication level standards of the target serial ports of the switch and the serial server to be consistent. This can be achieved by, but not limited to, the following methods: obtaining the first communication level standard of the switch using a first data transmitter, and obtaining the second communication level standard of the target serial port using a second data transmitter; if the first data transmitter determines that the first communication level standard is inconsistent with the preset communication level standard, then using the first data transmitter to convert the first communication level standard into 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, then using the second data transmitter to convert the second communication level standard into the preset communication level standard.

[0127] For a more specific working process of the above embodiments, reference can be made to the corresponding content disclosed in the foregoing embodiments, and details will not be elaborated herein.

[0128] In one implementable manner of the embodiments of the present disclosure, for a better understanding of the entire process of the method for processing the serial port baud rate, as Figure 3 shown Figure 3A flowchart showing the processing procedure of the serial port baud rate provided by an embodiment of the present disclosure. According to the communication level standard of the target serial port 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 the actual usage requirements, a working mode is selected, where the working mode includes an automatic mode and a manual mode; if the selected working mode is the automatic mode, the serial port baud rates of the switch and the target serial port are automatically identified; if the selected working mode is the manual mode, it is executed according to the corresponding manual mode, where 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 as the automatic baud rate mode to automatically identify the serial port baud rate of the switch, and the UART device side is configured as the forced baud rate mode, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200; if the selected manual mode is manual on the switch side and automatic on the target serial port side, the switch side is configured as the forced baud rate mode, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and the target serial port side is configured as 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 as the forced baud rate mode, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and the target serial port side is configured as the forced baud rate mode, and the optional baud rates are 9600 / 19200 / 38400 / 57600 / 115200; the serial port data from the switch and the target serial port are received in real time and cached; after each frame of serial port data is received, it is converted according to the corresponding serial port baud rates on the switch and the target serial port side, and the converted serial port data is sent 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 communication compatibility, reliability, and flexibility. It not only simplifies the configuration and maintenance process but also can adapt to various application scenarios, improving the universality and expandability of the system.

[0129] In an implementable manner of an embodiment of the present disclosure, for a better understanding of the entire process of the serial port baud rate processing method, as Figure 4 shown Figure 4It is a schematic flowchart of another processing procedure for the serial port baud rate provided by the embodiments of the present disclosure. Step (1): According to the level types of the switch and the UART device, configure them to the corresponding RS232 or TTL level through the DIP switch, and enter step (2); Step (2): Select the working mode according to the actual usage requirements. If the automatic mode is selected, enter step (3); if the manual mode is selected, enter step (6); Step (3): Configure both the switch side and the UART device side to the automatic baud rate mode through the key unit A / B, and enter step (4);

[0130] Step (4): The main control unit automatically identifies the baud rates of the switch and the UART device according to the received UART signal, and proceeds to step (5); In 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 is successfully identified, the corresponding LED indicator is lit to indicate the UART baud rate information on the switch and UART device sides, and proceeds to step (13); Step (6): Select the manual mode. If it is selected to be automatic on the switch side and manual on the UART device side, proceed to step (7); If it is selected to be manual on the switch side and automatic on the UART device side, proceed to step (9); If it is selected to be manual on both the switch and UART device sides, proceed to step (11); Step (7): Configure the switch side 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 on the switch side, and proceeds to step (8); Step (8): Configure the UART device side to the forced baud rate mode through the key unit B. The selectable baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and proceed to step (13); Step (9): Configure the switch side to the forced baud rate mode through the key unit A. The selectable baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and proceed to step (10); Step (10): Configure the UART device side to the automatic baud rate mode through the key unit B. The main control unit automatically identifies the baud rate of the UART device UART signal according to the received UART signal on the UART device side, and proceeds to step (13); Step (11): Configure the switch side to the forced baud rate mode through the key unit A. The selectable baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and proceed to step (12); Step (12): Configure the UART device side to the forced baud rate mode through the key unit B. The selectable baud rates are 9600 / 19200 / 38400 / 57600 / 115200, and proceed 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 buffer, and proceeds 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 corresponding baud rates on the switch and UART device sides, and proceeds to step (15); Step (15): Whether to end. If it ends, proceed to step (16), otherwise, return to step (2); Step (16): End.

[0131] In summary, the embodiments of the present disclosure can achieve the following effects:

[0132] When the serial baud rate of the target serial port of the switch and the serial port server is inconsistent, the embodiments of the present disclosure automatically convert the serial port data of itself using the serial baud rate of the other party, so that the other party can recognize the serial port data of itself, without the need for manual reconfiguration of the serial baud rate of the target serial port, improving the processing efficiency of the serial baud rate.

[0133] 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.

[0134] Figure 5 A schematic block diagram of an exemplary electronic device 900 that can be used to implement the embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as, a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, a personal digital processor, a cellular phone, a smart phone, a wearable device, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely exemplary and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0135] As Figure 5 shown, the electronic device 900 includes a computing unit 901, which can execute various appropriate actions and processes according to the computer program stored in the ROM (Read-Only Memory) 902 or the computer program loaded from the storage unit 908 into the 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 through a bus 904. The I / O (Input / Output) interface 905 is also connected to the bus 904.

[0136] 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 disc, 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.

[0137] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a CPU (Central Processing Unit), a GPU (Graphic Processing Units), various dedicated AI (Artificial Intelligence) computing chips, various computing units running machine learning model algorithms, a DSP (Digital Signal Processor), and any suitable processor, controller, microcontroller, etc. The computing unit 901 executes the various methods and processes described above, such as the method for processing the serial port baud rate. For example, in some embodiments, the method for processing the serial port baud rate can be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed onto 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 can be executed. Alternatively, in other embodiments, the computing unit 901 can be configured to execute the aforementioned method for processing the serial port baud rate in any other suitable manner (e.g., by means of firmware).

[0138] The various embodiments of the systems and techniques described above in this article can 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 Chip), CPLDs (Complex Programmable Logic Devices), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a dedicated or general-purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.

[0139] The program code for implementing the methods of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing devices, such that when the program codes are executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program codes can be executed entirely on the machine, partially on the machine, executed partially on the machine and partially on a remote machine as an independent software package, or executed entirely on a remote machine or server.

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

[0141] In order to provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (Cathode-Ray Tube) or LCD (Liquid Crystal Display) monitor); and a keyboard and a pointing device (e.g., a mouse or a trackball), through which the user can provide input to the computer. Other kinds 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 the input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0142] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having 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 including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected to each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: LAN (Local Area Network), WAN (Wide Area Network), the Internet, and blockchain networks.

[0143] A computer system can include clients and servers. Clients and servers are generally far from each other and typically interact through a communication network. The client - server relationship is created by computer programs running on respective computers and having a client - server relationship with each other. A server can 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, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services ("Virtual Private Server", or simply "VPS"). A server can also be a server of a distributed system, or a server combined with blockchain.

[0144] Among them, it should be noted that artificial intelligence is a discipline that studies enabling a computer to simulate certain thinking processes and intelligent behaviors of humans (such as learning, reasoning, thinking, planning, etc.), and there are both hardware - level technologies 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 several major directions such as computer vision technology, speech recognition technology, natural language processing technology, and machine learning / deep learning, big data processing technology, and knowledge graph technology.

[0145] It should be understood that various forms of processes shown above can be used, re - ordering, adding, or deleting steps. For example, the steps recited in this disclosure can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and no limitation is imposed herein.

[0146] The above specific embodiments do not constitute a limitation on the protection scope of the present disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principle of the present disclosure shall be included within 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 includes: 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