Serial port communication device and method

Through the combination of LPC bus and digital logic controller, intelligent switching and multiplexing of serial communication methods are realized, solving the problems of high hardware cost and software overhead in the existing technology, and improving communication efficiency and resource utilization.

CN118760642AInactive Publication Date: 2024-10-11BEIJING URBAN CONSTR INTELLIGENT CONTROL TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202410771425.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

In the existing serial communication solution, the hardware cost is high and the software overhead is large. Multiple serial port controllers and serial interfaces are required to implement RS232, RS485 and RS422 communication, resulting in high resource usage and complex software programming.

Method used

Using the LPC bus solution, the embedded controller communicates with the digital logic controller to realize intelligent switching and multiplexing of multiple serial port transceivers. Only one LPC interface is needed, which reduces hardware overhead and controls the signal through the target logic gate circuit. Strobe the target serial port transceiver.

Benefits of technology

It realizes intelligent switching and reuse of different serial communication methods, saves hardware and software resources, reduces hardware costs and software overhead, and improves communication efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760642A_ABST
    Figure CN118760642A_ABST
Patent Text Reader

Abstract

The invention provides a serial port communication device and method, and relates to the technical field of serial port communication. The serial port communication equipment comprises an embedded controller and a digital logic controller, wherein one end of the embedded controller is connected with a target computer through an LPC bus; the other end of the embedded controller is connected with the digital logic controller; the embedded controller is used for sending a control signal to the digital logic controller; and the digital logic controller is used for gating a target serial port transceiver from the plurality of serial port transceivers according to the control signal and communicating with the serial port equipment. According to the embodiment of the invention, hardware resources and software overhead are effectively reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of serial port communication, and in particular to a serial port communication device and method. Background Art

[0002] With the development and popularization of computer technology, serial communication technology plays an important role in the fields of computer control and industrial control.

[0003] The existing serial port solution is that the Platform Controller Hub (Platform Controller Hub) bridge integrates multiple serial port controllers and Universal Asynchronous Receiver / Transmitter (UART) interfaces. Each independent serial port is equipped with a unique serial port transceiver to form RS232, RS485 and RS422 communications. That is, the three serial port communication modes in the existing serial port communication solution require the South Bridge PCH to provide three serial port controllers and three serial port interfaces, which will increase hardware costs and unnecessary software overhead. Summary of the invention

[0004] The invention provides a serial port communication device and method.

[0005] Specifically, the embodiment of the present invention provides the following technical solutions: In a first aspect, an embodiment of the present invention provides a serial communication device, including: Embedded controllers and digital logic controllers; among them,

[0006] One end of the embedded controller is connected to the target computer via an LPC bus; the other end of the embedded controller is connected to the digital logic controller; the embedded controller is used to send a control signal to the digital logic controller; the digital logic controller is used to select a target serial port transceiver from multiple serial port transceivers according to the control signal and communicate with the serial port device.

[0007] Furthermore, the digital logic controller includes a target logic gate circuit; the target logic gate circuit is used to determine the selected target serial port transceiver from the multiple serial port transceivers according to the control signal, and disable other serial port transceivers in the multiple serial port transceivers.

[0008] Furthermore, the target logic gate circuit is specifically used to determine the target serial port transceiver selected from multiple serial port transceivers and disable other serial port transceivers in the multiple serial port transceivers according to the first signal, the second signal, the third signal and the fourth signal in the control signal; the first signal is used to enable or disable the first serial port transceiver in the multiple transceivers; the second signal is used to enable or disable the second serial port transceiver in the multiple transceivers; the third signal is used to enable or disable the third serial port transceiver in the multiple transceivers; the fourth signal is a process control signal.

[0009] Further, when the signal value of the first signal is the first value, and the signal values ​​of the second signal and the third signal are the second values, the target logic gate circuit is used to determine that the target serial port transceiver selected from the plurality of serial port transceivers is the first serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the second serial port transceiver and the third serial port transceiver; When the signal value of the second signal is the first value, and the signal values ​​of the first signal and the third signal are the second values, the target logic gate circuit is used to determine that the target serial port transceiver selected from the plurality of serial port transceivers is the second serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the first serial port transceiver and the third serial port transceiver; When the signal value of the third signal is the first value and the signal value of the first signal and the signal value of the second signal are the second value, the target logic gate circuit is used to determine that the target serial port transceiver selected from the multiple serial port transceivers is the third serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the first serial port transceiver and the second serial port transceiver.

[0010] Furthermore, the first serial port transceiver is an RS232 serial port transceiver; the second serial port transceiver is an RS422 serial port transceiver; and the third serial port transceiver is an RS485 serial port transceiver.

[0011] Furthermore, the digital logic controller is further used to send request information to the serial port device in the process of sequentially selecting each serial port transceiver in the plurality of serial port transceivers based on the polling method; the request information is used to request the serial port device to return reply data after receiving the request information; The digital logic controller determines the serial port transceiver that is selected corresponding to when the reply data is received as the target serial port transceiver.

[0012] Furthermore, the digital logic controller is also used for: When the polling number is greater than the preset number and the digital logic controller does not receive the reply data, it is determined that the communication connection with the serial port device fails.

[0013] In a second aspect, an embodiment of the present invention further provides a serial port communication method, comprising: A control signal is sent to the digital logic controller; the control signal is used by the digital logic controller to select a target serial port transceiver from a plurality of serial port transceivers to communicate with the serial port device.

[0014] In a third aspect, an embodiment of the present invention further provides an embedded controller, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the serial port communication method described in the second aspect are implemented.

[0015] In a fourth aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the serial port communication method described in the second aspect.

[0016] In a fifth aspect, an embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the serial port communication method described in the second aspect.

[0017] The serial port communication device and method provided by the embodiment of the present invention adopts an LPC bus solution, does not need to consume multiple serial port controllers and serial interfaces, and only needs to provide one LPC interface; and because the CPU only needs to program one LPC bus, software overhead is greatly saved; in addition, the LPC bus controls the digital logic controller to arbitrarily switch and select the communication mode of the serial port by communicating with the embedded controller, effectively realizing the intelligent switching of different serial port communication modes and multiplexing of serial port communication functions. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0019] Figure 1 It is a schematic diagram of the structure of a serial communication device in the prior art provided by an embodiment of the present invention.

[0020] Figure 2 It is a structural diagram of the serial communication device in this application provided by an embodiment of the present invention.

[0021] Figure 3 It is a schematic diagram of a target logic gate circuit corresponding to the digital logic controller provided in an embodiment of the present invention.

[0022] Figure 4 It is a schematic diagram of three serial port communications provided by an embodiment of the present invention.

[0023] Figure 5 It is a schematic diagram of the operation of a transceiver provided in an embodiment of the present invention.

[0024] Figure 6 The present invention is a flowchart of automatic identification of serial port mode of an access device provided by an embodiment of the present invention.

[0025] Figure 7 It is a flowchart of a serial communication method provided by an embodiment of the present invention.

[0026] Figure 8 It is a schematic diagram of the structure of an embedded controller provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] The method of the embodiment of the present invention can be applied to the scenario of serial port communication, effectively reducing hardware resources and software overhead.

[0029] In the related technology, the PCH bridge integrates multiple serial port controllers and UART interfaces, and each independent serial port is equipped with a unique serial port transceiver to form RS232, RS485 and RS422 communications. That is, the three serial port communication modes in the existing serial port communication scheme require the South Bridge PCH to provide three serial port controllers and three serial port interfaces, which will increase the hardware cost and increase the unnecessary software overhead.

[0030] The serial communication device and method of the embodiment of the present invention adopts the LPC bus solution, which does not require the consumption of multiple serial port controllers and serial interfaces, and only requires one LPC interface; and because the CPU only needs to program one LPC bus, software overhead is greatly saved; in addition, the LPC bus controls the digital logic controller to arbitrarily switch and select the communication mode of the serial port by communicating with the embedded controller, thereby effectively realizing the intelligent switching of different serial port communication modes and multiplexing the serial port communication function.

[0031] Combine the following Figure 1-Figure 8The technical solution of the present invention is described in detail with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0032] Figure 1 1 is a flow chart of an embodiment of a serial communication device provided by an embodiment of the present invention. Figure 1 As shown, the serial communication device provided in this embodiment includes: Embedded controllers and digital logic controllers; among them,

[0033] One end of the embedded controller is connected to the target computer via the LPC bus; the other end of the embedded controller is connected to the digital logic controller; the embedded controller is used to send a control signal to the digital logic controller; The digital logic controller is used to select a target serial port transceiver from a plurality of serial port transceivers according to a control signal, so as to communicate with a serial port device.

[0034] Specifically, Figure 1 As shown, the existing computer serial port solution is to integrate multiple serial port controllers and UART interfaces in the PCH bridge, and each independent serial port is equipped with a unique serial port transceiver to form RS232, RS485 and RS422 communications. The serial port selection circuit is output to the final DB9 interface through switching control. The above method has the following disadvantages: (1) High resource usage: The three serial port communication modes require the South Bridge PCH to provide three serial port controllers and three serial port interfaces.

[0035] (2) The software overhead is large. The three different serial port communications correspond to three different serial port controllers. The serial port receives and sends data by first putting the data into a buffer and then parsing it. Since all three communication methods may be used when switching serial port communications, it is necessary to program the three-way UART controller when programming embedded software, which increases the software overhead.

[0036] In order to solve the problem of high hardware cost and software overhead in the above serial communication, the serial communication device in the embodiment of the present application is as follows: Figure 2As shown, it includes: an embedded controller and a digital logic controller. Among them, one end of the embedded controller is connected to the target computer through the LPC bus, that is, the south bridge chip PCH is connected to the embedded controller (Embedded Controller) through the LPC bus; optionally, the embedded controller can use IT8786E, which can communicate with the south bridge through the LPC bus in the upstream, and provide 6 serial ports and multiple IO outputs in the downstream. The serial port is used for communication connection, and the IO is used for mode switching control. As a parallel bus, the LPC bus can support a bus frequency of up to 33MHZ. Using the LPC bus communication, the communication between the embedded controller and other devices through the serial port only requires the upstream south bridge chip to process the data transmitted by the LPC bus, which greatly saves software overhead.

[0037] Optionally, the other end of the embedded controller is connected to the digital logic controller; the embedded controller is used to send a control signal to the digital logic controller; the digital logic controller is used to select a target serial port transceiver from multiple serial port transceivers according to the control signal to communicate with the serial port device; that is, the digital logic controller is used to select the RS232, RS422 or RS485 communication mode in the external interface, thereby realizing intelligent switching of different serial port communication modes.

[0038] It should be noted that the serial communication device in this application is based on the LPC bus. For the south bridge chip for data uplink, it does not need to consume multiple serial port controllers and serial interfaces, but only needs to provide one LPC interface. For data downlink, the LPC bus communicates with the embedded controller to control the digital logic controller to switch the communication mode of the serial port at will, and matches the appropriate serial port transceiver to realize the intelligent switching of different serial port communication modes and multiplex the serial port communication function, with less hardware overhead. Since the CPU only needs to program one LPC bus, it also greatly saves software overhead.

[0039] The serial communication device of the above-mentioned embodiment adopts the LPC bus solution, which does not require the consumption of multiple serial port controllers and serial interfaces, and only requires one LPC interface. Moreover, since the CPU only needs to program one LPC bus, the software overhead is greatly saved. In addition, the LPC bus controls the digital logic controller to arbitrarily switch and select the communication mode of the serial port by communicating with the embedded controller, thereby effectively realizing the intelligent switching of different serial port communication modes and multiplexing the serial port communication function.

[0040] Optionally, the digital logic controller includes a target logic gate circuit; the target logic gate circuit is used to determine the target serial port transceiver selected from the multiple serial port transceivers according to the control signal, and disable other serial port transceivers in the multiple serial port transceivers.

[0041] In the embodiment of the present application, the digital logic controller is implemented using a logic gate circuit, which has a small delay and high logic stability, and thus can more accurately select the serial communication mode.

[0042] In addition, it should be noted that the target logic gate circuit corresponding to the digital logic controller in the embodiment of the present application can not only determine the selected target serial port transceiver from multiple serial port transceivers, but also effectively disable other serial port transceivers other than the target serial port transceiver, thereby effectively reducing interference and accurately realizing the selection of the target serial port transceiver.

[0043] Optionally, the target logic gate circuit is specifically used to determine the target serial port transceiver selected from multiple serial port transceivers and disable other serial port transceivers in the multiple serial port transceivers according to the first signal, the second signal, the third signal and the fourth signal in the control signal; the first signal is used to enable or disable the first serial port transceiver in the multiple transceivers; the second signal is used to enable or disable the second serial port transceiver in the multiple transceivers; the third signal is used to enable or disable the third serial port transceiver in the multiple transceivers; the fourth signal is a process control signal.

[0044] Specifically, the target logic gate circuit corresponding to the digital logic controller in the embodiment of the present application is as follows: Figure 3 As shown, the corresponding digital logic control truth table is shown in Table 1.

[0045] Table 1

[0046] That is, the digital logic controller obtains output signals A, B, and C according to the first signal 232_EN, the second signal Y, the third signal X, and the fourth signal Z in the control signal, and then determines the corresponding selected serial communication mode according to the output signals A, B, and C and the corresponding digital logic control truth table.

[0047] Optionally, when the signal value of the first signal is the first value, and the signal values ​​of the second signal and the third signal are the second values, the target logic gate circuit is used to determine that the target serial port transceiver selected from the plurality of serial port transceivers is the first serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the second serial port transceiver and the third serial port transceiver; When the signal value of the second signal is the first value, and the signal values ​​of the first signal and the third signal are the second values, the target logic gate circuit is used to determine that the target serial port transceiver selected from the plurality of serial port transceivers is the second serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the first serial port transceiver and the third serial port transceiver; When the signal value of the third signal is the first value and the signal value of the first signal and the signal value of the second signal are the second value, the target logic gate circuit is used to determine that the target serial port transceiver selected from the multiple serial port transceivers is the third serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the first serial port transceiver and the second serial port transceiver.

[0048] Specifically, the target logic gate circuit corresponding to the digital logic controller in the embodiment of the present application can not only determine the selected target serial port transceiver from multiple serial port transceivers, but also effectively disable other serial port transceivers other than the target serial port transceiver, thereby effectively reducing interference and accurately achieving the gating of the target serial port transceiver. For example, only when the input signal 232_EN is 1 and the input signals X and Y are 0, the serial port communication mode selected by the digital logic controller is RS232, that is, while enabling the 232 mode, the 422 and 485 modes are disabled to avoid interference, thereby accurately achieving the gating of the target serial port transceiver RS232.

[0049] Optionally, the first serial port transceiver is an RS232 serial port transceiver; the second serial port transceiver is an RS422 serial port transceiver; and the third serial port transceiver is an RS485 serial port transceiver.

[0050] For example, Figure 4 The following is a basic schematic diagram of the three serial communication modes: RS232, RS485, and RS422. The following is an explanation of the principle: 1. The three modes differ in communication level and full / half-duplex communication.

[0051] 2. RS232 communication level is single-ended level mode, RS485 and RS422 are differential transmission mode.

[0052] 3.RS232 and RS422 are full-duplex communication transmissions, while RS485 is half-duplex communication transmission.

[0053] 4. The communication between the transceiver and the controller adopts the UART communication method with TTL level.

[0054] For example, the transceiver and level converter are Figure 5 As shown, the details are as follows: (1) RS232 communication is controlled by pins 22 and 23 of U19. The signal name 232_EN comes from the embedded controller.

[0055] (2) U20 and U21 are RS485 and RS422 transceivers. When one transceiver is used, it is half-duplex 485 communication, and when two are used, it is full-duplex RS422 communication. U20 is an RS485 transceiver, and U20 and U21 are combined to form an RS422 transceiver.

[0056] (3) When the transceiver's pin 3 (TEN) is high, the serial port data is sent from pin 4 (T) to pins 6 and 7, changing to a differential level. When TEN is low, transmission is prohibited. When the transceiver's pin 2 (REN) is low, the serial port data is received from the differential signal of pins 6 and 7 to pin 1 of the chip. When REN is high, data reception is disabled.

[0057] (4) According to the digital logic control table in Table 1, in RS232 mode, the embedded controller controls 232_EN to a high level, enables RS232 transceiver U19, A=0, B=1, C=0, and disables the receiving and transmitting functions of U20 and U21.

[0058] (5) In RS485 mode, U20's reception and transmission are enabled at different times. When A=0, B=1, C=1, it is in transmission mode, reception is disabled, and the serial port sends data out through U20. When A=0, B=0, C=0, U20 is in reception mode, and data transmission is disabled. This forms the half-duplex communication mode of RS485, and data is received and sent at different times.

[0059] (6) In RS422 mode, U20 acts as a receiver and U21 as a transmitter. In this mode, A=1, B=0, C=0, the sending function of U20 is disabled and the receiving function is enabled, and the sending function of U21 is enabled and the receiving function is disabled, forming a full-duplex communication mode.

[0060] In the serial communication device of the above embodiment, the target logic gate circuit corresponding to the digital logic controller can not only determine the selected target serial transceiver from multiple serial transceivers, but also effectively disable other serial transceivers except the target serial transceiver, thereby effectively reducing interference and accurately realizing the selection of the target serial transceiver.

[0061] Optionally, the digital logic controller is also used to: In the process of selecting each serial port transceiver in the plurality of serial port transceivers in turn based on the polling method, a request message is sent to the serial port device; the request message is used to request the serial port device to return reply data after receiving the request message; The digital logic controller determines the serial port transceiver that is selected corresponding to when the reply data is received as the target serial port transceiver.

[0062] Specifically, before the target serial port transceiver is selected, the embodiment of the present application needs to determine the communication mode of the serial port device, and then select the corresponding target serial port transceiver based on the determined communication mode of the serial port device. Optionally, in the embodiment of the present application, when the digital logic controller selects each of the multiple serial port transceivers in turn based on the polling method, the digital logic controller sends request information to the serial port device, and the digital logic controller determines the serial port transceiver corresponding to the received reply data as the target serial port transceiver, thereby realizing automatic recognition of the serial port mode of the access device, and then the corresponding target serial port transceiver can be selected based on the serial port mode of the access device.

[0063] Alternatively, if Figure 6 As shown in the figure, the process of automatically identifying the serial port mode of the access device is as follows: (1) After the device is connected, it is first set to RS232 mode and sends a request reply command to the other device. If the host device receives the reply data within 2s, the RS232 communication mode is maintained and the communication ends.

[0064] (2) If no data is received, switch to RS485 mode and send a request reply command to the peer device. If the host device receives the reply data within 2 seconds, maintain the RS485 communication mode and end.

[0065] (3) If no data is received, switch to RS422 mode and send a request reply command to the peer device. If the host device receives the reply data within 2s, maintain the RS422 communication mode and end.

[0066] (4) If no data is received, return to step (1) and repeat steps (1) to (3) for a total of 5 times. If no response is received, end the process and return a communication connection failure.

[0067] In the method of the above embodiment, when the digital logic controller selects each of the multiple serial port transceivers in turn based on the polling method, the target computer sends a request message to the serial port device, and the target computer determines the serial port transceiver corresponding to the received reply data as the target serial port transceiver, thereby realizing automatic recognition of the serial port mode of the access device, and realizing automatic recognition and configuration of the communication mode, without the need for manual modification of software configuration parameters.

[0068] Optionally, the digital logic controller is also used to: When the polling number is greater than the preset number and the digital logic controller does not receive the reply data, the digital logic controller determines that the communication connection with the serial port device fails.

[0069] Specifically, in an embodiment of the present application, when the number of polling times is greater than the preset number of times and the digital logic controller has not received any reply data, such as after polling 5 times for the three serial port communication modes of RS232, RS485, and RS422, if no reply is received, the digital logic controller determines that the communication connection with the serial port device has failed, thereby effectively avoiding the problem of serial port mode determination failure caused by the inability of the transceiver serial port to reply data in time due to the occupancy of the serial port, thereby improving the accuracy of automatic identification of the serial port mode of the access device, and thus accurately selecting the serial port transceiver.

[0070] For the serial communication device in the above embodiment, when the polling number is greater than the preset number and the target computer has not received the reply data, if no reply is received, the digital logic controller determines that the communication connection with the serial port device has failed, thereby effectively avoiding the problem of failure to determine the serial port mode when the transceiver serial port is occupied and cannot reply data in time, thereby improving the accuracy of automatic identification of the serial port mode of the access device.

[0071] Exemplarily, the present application also provides a serial communication method, which is applied to an embedded controller in a serial communication device, such as Figure 7 As shown, including: Step 701: Send a control signal to a digital logic controller; the control signal is used by the digital logic controller to select a target serial port transceiver from multiple serial port transceivers and communicate with the serial port device.

[0072] Specifically, in order to solve the problem of high hardware cost and software overhead in serial communication and realize arbitrary switching between RS232 / RS485 and RS422 communications, one end of the embedded controller in the embodiment of the present application is connected to the target computer via the LPC bus; the embedded controller can use IT8786E, which can communicate with the south bridge via the LPC bus in the upstream, and provides 6 serial ports and multiple IO outputs in the downstream. The serial port is used for communication connection, and the IO is used for mode switching control. As a parallel bus, the LPC bus can support a bus frequency of up to 33MHZ; using the LPC bus communication, the communication between the embedded controller and other devices through the serial port only requires the upstream south bridge chip to process the data transmitted by the LPC bus, which greatly saves software overhead.

[0073] Optionally, the other end of the embedded controller is connected to the digital logic controller; the embedded controller is used to send a control signal to the digital logic controller; the digital logic controller selects the target serial port transceiver from multiple serial port transceivers according to the control signal to communicate with the serial port device; that is, the digital logic control is used to select the RS232, RS422 or RS485 communication mode in the external interface, thereby realizing intelligent switching of different serial port communication modes.

[0074] It should be noted that in this application, based on the LPC bus, for the south bridge chip for data uplink, there is no need to consume multiple serial port controllers and serial interfaces, and only one LPC interface is needed. For data downlink, the LPC bus communicates with the embedded controller to control the digital logic controller to arbitrarily switch and select the serial port communication mode, thereby effectively realizing the intelligent switching of different serial port communication modes and multiplexing of serial port communication functions.

[0075] In the method of the above embodiment, in a serial communication device based on an LPC bus and an embedded controller, the embedded controller sends a control signal to a digital logic controller, so that the digital logic controller selects a target serial transceiver from multiple serial transceivers to achieve communication with the serial device. While reducing software and hardware overhead, it effectively realizes intelligent switching of different serial communication modes and multiplexing of serial communication functions.

[0076] Figure 8 The schematic diagram of the physical structure of an embedded controller is illustrated, and the embedded controller may include: a processor 810, a communication interface 820, a memory 830 and a communication bus 840, wherein the processor 810, the communication interface 820 and the memory 830 communicate with each other through the communication bus 840. The processor 810 may call the logic instructions in the memory 830 to execute the serial communication method, and the method includes: sending a control signal to a digital logic controller; the control signal is used by the digital logic controller to select a target serial transceiver from multiple serial transceivers and communicate with the serial device.

[0077] In addition, the logic instructions in the above-mentioned memory 830 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

[0078] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the serial port communication method provided by the above methods, and the method includes: sending a control signal to a digital logic controller; the control signal is used by the digital logic controller to select a target serial port transceiver from multiple serial port transceivers and communicate with the serial port device.

[0079] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned serial port communication methods, the method comprising: sending a control signal to a digital logic controller; the control signal is used by the digital logic controller to select a target serial port transceiver from multiple serial port transceivers and communicate with the serial port device.

[0080] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0081] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0082] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A serial communication device, characterized in that: include: Embedded controllers and digital logic controllers; among them, One end of the embedded controller is connected to the target computer via an LPC bus; the other end of the embedded controller is connected to the digital logic controller; the embedded controller is used to send a control signal to the digital logic controller; The digital logic controller is used to select a target serial port transceiver from a plurality of serial port transceivers according to the control signal, and communicate with the serial port device.

2. The serial communication device according to claim 1, characterized in that: The digital logic controller includes a target logic gate circuit; the target logic gate circuit is used to determine the selected target serial port transceiver from multiple serial port transceivers according to the control signal, and disable other serial port transceivers in the multiple serial port transceivers.

3. The serial communication device according to claim 2, characterized in that: The target logic gate circuit is specifically used to determine the target serial port transceiver selected from multiple serial port transceivers and disable other serial port transceivers in the multiple serial port transceivers according to the first signal, the second signal, the third signal and the fourth signal in the control signal; the first signal is used to enable or disable the first serial port transceiver in the multiple transceivers; the second signal is used to enable or disable the second serial port transceiver in the multiple transceivers; the third signal is used to enable or disable the third serial port transceiver in the multiple transceivers; the fourth signal is a process control signal.

4. The serial communication device according to claim 3, characterized in that: When the signal value of the first signal is a first value, and the signal values ​​of the second signal and the third signal are second values, the target logic gate circuit is used to determine that the target serial port transceiver selected from the plurality of serial port transceivers is the first serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the second serial port transceiver and the third serial port transceiver; When the signal value of the second signal is the first value, and the signal values ​​of the first signal and the third signal are the second values, the target logic gate circuit is used to determine that the target serial port transceiver selected from the plurality of serial port transceivers is the second serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the first serial port transceiver and the third serial port transceiver; When the signal value of the third signal is the first value, and the signal value of the first signal and the signal value of the second signal are the second value, the target logic gate circuit is used to determine that the target serial port transceiver selected from the multiple serial port transceivers is the third serial port transceiver according to the first signal, the second signal, the third signal and the fourth signal in the control signal, and disable the first serial port transceiver and the second serial port transceiver.

5. The serial communication device according to claim 4, characterized in that: The first serial port transceiver is an RS232 serial port transceiver; the second serial port transceiver is an RS422 serial port transceiver; and the third serial port transceiver is an RS485 serial port transceiver.

6. The serial communication device according to any one of claims 1 to 5, characterized in that: The digital logic controller is also used to send request information to the serial port device in the process of sequentially selecting each serial port transceiver in the plurality of serial port transceivers based on the polling method; the request information is used to request the serial port device to return reply data after receiving the request information; The digital logic controller determines the corresponding serial port transceiver selected when receiving the reply data as the target serial port transceiver.

7. The serial communication device according to claim 6, characterized in that: The digital logic controller is also used for: When the polling number is greater than the preset number and the digital logic controller does not receive the reply data, it is determined that the communication connection with the serial port device fails.

8. A serial communication method, characterized in that: An embedded controller used in a serial communication device according to any one of claims 1 to 7, comprising: A control signal is sent to the digital logic controller; the control signal is used by the digital logic controller to select a target serial port transceiver from a plurality of serial port transceivers and communicate with the serial port device.

9. An embedded controller, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the serial port communication method according to claim 8 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the serial port communication method according to claim 8 is implemented.

Citation Information

Patent Citations

  • Server Serial Port Design System and Methods

    CN102281254A

  • Server serial port output method and server serial port output device

    CN104102614A

  • Interface card

    CN106126456A

  • Method and device for server system to share serial port, controlled terminal and storage medium

    CN109902014A

  • Main control system with multiple controllers sharing serial port

    CN116126761A