UART communication channel gating method, device, system, apparatus and medium

By centrally parsing and forwarding UART communication path selection commands through the main control device, the problem of complex UART communication path selection operations in the existing technology is solved, and the effects of simplifying wiring and improving switching efficiency are achieved.

CN122247781APending Publication Date: 2026-06-19SHANGHAI EVEX INFORMATION TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI EVEX INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-05-21
Publication Date
2026-06-19

Smart Images

  • Figure CN122247781A_ABST
    Figure CN122247781A_ABST
Patent Text Reader

Abstract

This application provides a UART communication path selection method, apparatus, system, device, and medium, relating to the field of communication technology. The method first receives operation commands sent by a host device, and then uniformly distributes these commands, avoiding the complex hardware structure caused by separate wiring between the host device and multiple slave devices. Next, the operation commands are parsed to obtain at least one register value, and at least one path selection command is generated based on this value. Based on this command, the master and slave devices interact through an interface to send the command to the corresponding slave device, causing at least one slave device to perform the corresponding path selection operation. This centralized forwarding and hierarchical execution approach simplifies the path selection process and improves the convenience and reliability of UART communication path switching.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a UART communication path selection method, apparatus, system, device and medium. Background Technology

[0002] In modern network and computing devices, Universal Asynchronous Receiver / Transmitter (UART) communication is one of the core technologies for hardware debugging, firmware development, and system integration testing.

[0003] In related technologies, when it is necessary to select the UART communication path between controlled devices, the host device sends operation commands to the controlled devices to be selected through different buses, so as to enable the UART communication path between the controlled devices to be selected.

[0004] However, the aforementioned host device needs to be connected to each controlled device via multiple different buses, resulting in complex wiring and complicated UART communication path selection operations. Summary of the Invention

[0005] This application provides a UART communication path selection method, apparatus, system, device, and medium to solve the problem that the complex wiring of the host device and the controlled device leads to complicated UART communication path selection operations in related technologies.

[0006] In a first aspect, embodiments of this application provide a UART communication path selection method, applied to a master control device connected to a host device via a bus in a UART multi-communication path system. The master control device is connected to slave control devices via interactive interfaces. The method includes:

[0007] Receive operation instructions sent by the host device, wherein the operation instructions indicate a path selection operation associated with at least one slave device;

[0008] The operation instruction is parsed to obtain at least one register value from the operation instruction;

[0009] Based on the at least one register value, generate at least one path selection instruction;

[0010] Based on the at least one path selection instruction, the master control device sends a path selection instruction to the slave control device corresponding to each path selection instruction through the interaction interface between the master control device and the at least one slave control device, so that the at least one slave control device performs the corresponding path selection operation.

[0011] In one possible implementation, generating at least one path selection instruction based on the at least one register value includes:

[0012] Based on all register values, the path selection information corresponding to each register value is extracted from a preset register mapping table; the preset register mapping table indicates the path selection information corresponding to each register value.

[0013] Each path selection information is encapsulated using a protocol to obtain at least one path selection instruction.

[0014] In one possible implementation, the step of protocol encapsulating each path selection information to obtain the at least one path selection instruction includes:

[0015] Based on each path selection information and a preset priority mapping table, the priority of each path selection information is determined; the preset priority mapping table indicates the priority corresponding to each path selection information.

[0016] According to the priority order from high to low, the corresponding path selection information is sent to the at least one slave device in sequence.

[0017] In one possible implementation, the host device includes a host computer or an external device, wherein the external device is used to send operation commands via shortcut keys.

[0018] Secondly, embodiments of this application provide a UART communication path selection device, applied to a master control device connected to a host device via a bus in a UART multi-communication path system. The master control device is connected to slave control devices via interactive interfaces. The device includes:

[0019] The receiving module is used to receive operation instructions sent by the host device, the operation instructions indicating a path selection operation related to at least one slave device;

[0020] The sending module is used for:

[0021] The operation instruction is parsed to obtain at least one register value from the operation instruction;

[0022] Based on the at least one register value, generate at least one path selection instruction;

[0023] Based on the at least one path selection instruction, the master control device sends a path selection instruction to the slave control device corresponding to each path selection instruction through the interaction interface between the master control device and the at least one slave control device, so that the at least one slave control device performs the corresponding path selection operation.

[0024] In one possible implementation, the sending module is further configured to:

[0025] Based on all register values, the path selection information corresponding to each register value is extracted from a preset register mapping table; the preset register mapping table indicates the path selection information corresponding to each register value.

[0026] Each path selection information is encapsulated using a protocol to obtain at least one path selection instruction.

[0027] In one possible implementation, the sending module is further configured to:

[0028] Based on each path selection information and a preset priority mapping table, the priority of each path selection information is determined; the preset priority mapping table indicates the priority corresponding to each path selection information.

[0029] According to the priority order from high to low, the corresponding path selection information is sent to the at least one slave device in sequence.

[0030] In one possible implementation, the host device includes a host computer or an external device, wherein the external device is used to send operation commands via shortcut keys.

[0031] Thirdly, embodiments of this application provide a UART communication path selection system, the system comprising: at least one host device, a master control device, and at least one slave control device;

[0032] Each host device is connected to the master control device via a bus and an interaction interface, and the master control device is connected to the at least one slave control device via the interaction interface.

[0033] The master control device receives operation instructions from the at least one host device via a bus, parses the operation instructions, and obtains at least one register value from the operation instructions.

[0034] Based on the at least one register value, at least one path selection instruction is generated; based on the at least one path selection instruction, a path selection instruction is sent to the slave device corresponding to each path selection instruction through the interaction interface between the master control device and the at least one slave control device, so that the at least one slave control device performs the corresponding path selection operation.

[0035] Fourthly, embodiments of this application provide an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0036] The memory stores computer-executed instructions;

[0037] The processor executes computer execution instructions stored in the memory to implement the first aspect and / or various possible implementations of the first aspect as described above.

[0038] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0039] In a sixth aspect, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0040] The UART communication path selection method, apparatus, system, device, and medium provided in this application embodiment first receive an operation command sent by a host device. The operation command indicates a path selection operation related to at least one slave device. By uniformly issuing operation commands through the host device, the complexity of the hardware structure caused by separate wiring between the host device and multiple slave devices is avoided. Then, according to the operation command, a path selection command is sent to at least one slave device through the interaction interface between the master device and at least one slave device, so that at least one slave device performs the corresponding path selection operation. The centralized forwarding and hierarchical execution method simplifies the path selection operation process and improves the convenience and reliability of UART communication path switching. Attached Figure Description

[0041] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0042] Figure 1 A schematic diagram of a UART multi-communication path system architecture provided for embodiments of this application;

[0043] Figure 2 A flowchart illustrating the UART communication path selection method provided in the embodiments of this application. Figure 1 ;

[0044] Figure 3 A flowchart illustrating the UART communication path selection method provided in the embodiments of this application. Figure 2 ;

[0045] Figure 4 This is a schematic diagram of the structure of the UART communication path selection device provided in the embodiments of this application;

[0046] Figure 5 A schematic diagram of the system architecture for UART communication path selection provided in the embodiments of this application. Figure 1 ;

[0047] Figure 6 A schematic diagram of the system architecture for UART communication path selection provided in the embodiments of this application. Figure 2 ;

[0048] Figure 7 This is a schematic diagram of the structure of an electronic device provided in this application.

[0049] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0050] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0051] Before introducing the embodiments of this application, the terms used in the embodiments of this application will be explained first:

[0052] UART: A hardware interface for asynchronous serial communication, supporting data transfer between devices. For example, in embedded systems, UART is often used for debug log transmission or peripheral communication.

[0053] Operation commands: These are control commands that contain communication path selection requirements and are transmitted to the master control device via the bus interface. Examples include commands sent by the host device such as "select device A" or "select device A's UART0 interface."

[0054] Register value: A parameter used in operation instructions to identify communication requirements, which is converted into a path selection instruction through a preset mapping relationship. For example: the register value is 0x02.

[0055] Path selection instruction: This is data that instructs the slave device to switch communication paths, including the device address or communication parameters. For example, the path selection instruction corresponding to register value 0x02 includes a frame header, target slave device, target channel number of the target slave device (e.g., UART0 interface), opcode (e.g., 0 indicates path selection, 1 indicates path deactivation), and frame tail.

[0056] The interaction interface, also known as the data interaction interface or data parsing channel, can be used to transmit data or instructions, and can also be used to transmit data information after the UART communication path is selected.

[0057] The application background of the embodiments of this application is explained below:

[0058] In the development, debugging, and system integration testing of modern network and computing devices, UART communication path selection is one of the core functions. For example, during the hardware debugging phase, engineers need to interact with multiple slave devices (such as sensors, storage modules, and peripheral controllers) via the UART interface to verify the correctness of hardware functions. During firmware development, UART communication is often used to transmit debug logs, configuration parameters, or firmware update data in real time; in system integration testing, UART path selection is used to simulate complex scenarios of multiple devices working together to ensure the overall stability of the system. However, current UART communication systems typically require a host device (such as a debugger, development board, or external control device) to connect to each slave device via multiple independent buses to achieve dynamic switching of communication paths.

[0059] The relevant technologies generally adopt software command configuration to realize independent switching of the UART channels of each controlled device, thereby completing cross-board communication interaction.

[0060] This type of solution has the following significant technical shortcomings:

[0061] 1. Hardware design level: Additional auxiliary communication interfaces such as Inter-Integrated Circuit (I2C) and Low Pin Count (LPC) are required to transmit configuration commands. This not only occupies valuable printed circuit board (PCB) layout space, but also increases the complexity of high-speed signal routing and impedance matching difficulty, resulting in higher software and hardware development costs and greater difficulty in production yield control.

[0062] 2. Verification and testing level: The channel switching process relies on multiple sets of instruction sequences encapsulated in software. The operation steps are cumbersome and lack flexibility, making it difficult to adapt to the diverse board combinations and the rapid changes in test scenarios.

[0063] 3. Reliability testing: The inherent delay in instruction parsing and execution cannot meet the stress test requirements of large-scale, high-frequency UART communication channel switching, which can easily lead to low testing efficiency and make it difficult to expose potential faults under extreme switching conditions.

[0064] 4. Post-maintenance: The software configuration chain involves multiple levels of interaction, such as the driver layer and the application layer. Once an abnormal UART communication channel switching occurs, fault location requires cross-software and hardware collaborative troubleshooting, which greatly increases the debugging difficulty and maintenance cycle.

[0065] In summary, the related designs suffer from high wiring complexity, increased hardware costs, and cumbersome operation procedures. This is especially true in scenarios requiring frequent switching of communication paths between multiple slave devices (such as multi-sensor collaborative debugging and multi-device status monitoring). The host device must send selection commands to each device individually, resulting in redundant control logic and significantly reducing communication efficiency and debugging flexibility. Furthermore, in resource-constrained embedded systems (such as IoT terminals and industrial automation equipment), complex wiring and control logic consume valuable hardware resources, limiting system scalability.

[0066] However, the aforementioned host device needs to be connected to each controlled device via multiple different buses, resulting in complex wiring and complicated UART communication path selection operations.

[0067] To address the technical problems existing in related technologies, the inventors of this application propose the following solution: Existing UART communication path selection schemes suffer from cumbersome system wiring and low UART communication path switching efficiency due to the use of multiple independent buses by the host device to directly connect to each controlled device. This application first establishes a unified master control device in the system, enabling each host device to connect to the master control device only via a bus, eliminating direct wiring between the host and slave devices. Simultaneously, the master control device interconnects with each slave device through an interactive interface, constructing a centralized control architecture. During UART communication path switching, the master control device uniformly receives operation commands from the host device, parses the register values ​​carried in the commands, matches the corresponding path selection information according to the register mapping table, and encapsulates the path selection information into path selection commands. These commands are then sent to the corresponding slave devices through the interactive interface between the master and slave devices, allowing the slave devices to execute the path selection operation and achieve the selection of the target UART communication path.

[0068] Specifically, Figure 1 A schematic diagram of a UART multi-communication path system architecture provided in the embodiments of this application is shown, such as... Figure 1As shown, in the existing UART multi-communication path system, the host device is connected to the controlled device 1 via bus 1, the host device is connected to the controlled device 2 via bus 2, and the host device is connected to the controlled device 3 via bus 3. The host device sends operation commands to the controlled devices 1, 2, and 3 via buses 1, 2, and 3, respectively. After receiving the operation command, the controlled device controls its internally integrated multiplexer (MUX) to perform the corresponding UART communication path selection operation. Additionally, there is a data exchange interface between the host device and the controlled device 2, including a transmit line (TX) and a receive line (RX) for data transmission. The controlled devices also have data exchange interfaces, including TX and RX, for data transmission.

[0069] The parts not described in detail are disclosed in the following embodiments.

[0070] The technical solution of this application will now be described in detail through specific embodiments. It should be noted that the following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0071] Figure 2 A flowchart illustrating the UART communication path selection method provided in the embodiments of this application. Figure 1 ,like Figure 2 As shown, this method is applied to a master control device in a UART multi-communication path system that is connected to a host device via a bus. The master control device connects to slave control devices through interactive interfaces. The method may include the following steps:

[0072] Step 21: Receive the operation instructions sent by the host device.

[0073] The operation instruction indicates a path selection operation associated with at least one slave device.

[0074] Specifically, the host device includes a host computer or an external device, wherein the external device is used to send operation commands via shortcut keys.

[0075] In this step, the master control device, as the centralized control core of the UART multi-communication channel system, establishes a communication connection with the host device through the bus and listens for operation commands issued by the host device in real time.

[0076] The operation command is a path selection request initiated by the host device, used to instruct the master control device to perform a corresponding UART communication path selection operation on at least one slave control device in the system. For example, the command can carry key information such as the target slave control device identifier, target path number, and path status, enabling precise scheduling of multi-path selection operations. As the control initiator of the system, the host device can be flexibly selected according to the actual application scenario. It does not require separate wiring with each slave control device; it only needs to interact with the master control device through a single bus to complete the selection control of all paths, greatly simplifying the hardware connection structure of the system.

[0077] External devices are used to send operation commands via shortcut keys. The host computer can be a Baseboard Management Controller (BMC) or a Central Processing Unit (CPU), and the external device can be a Type-C debugging interface. External devices can trigger preset path selection operations with a single keystroke via preset shortcut keys. For example, a shortcut key can directly select the debugging path between the Type-C interface and a specified slave device, eliminating the need for complex command input and improving the convenience of path selection operations, thus adapting to the needs of rapid on-site debugging and maintenance scenarios.

[0078] The interaction interface, also known as the data interaction interface or data parsing channel, can be used to transmit data or instructions, and can also be used to transmit data information after the UART communication path is selected.

[0079] Step 22: According to the operation instructions, send path selection instructions to at least one slave device through the interaction interface between the master control device and at least one slave control device, so that at least one slave control device can perform the corresponding path selection operation.

[0080] In this step, after receiving the operation command from the host device, the master control device first parses the command and extracts the register value. Then, based on the register value and the preset register mapping table, it generates the corresponding path selection command and sends the path selection command to the corresponding slave control device through the interaction interface between the master control device and each slave control device, that is, the data parsing channel. After receiving the path selection command, the slave device controls its internally integrated multiplexer (MUX) to perform the corresponding UART communication path selection operation, selecting the TX / RX transmission link of the target UART, and finally establishing a complete UART communication path between the host device and the target peripheral. For example, when the master device receives an operation command from the host device instructing the selection of the 0th UART communication path of the slave device CPLD2, the master device parses the operation command and generates the corresponding path selection command. The command is then sent to the slave device CPLD2 via the TX signal. After receiving the command, CPLD2 controls its internal MUX to select the TX / RX path of the 0th UART, completing the establishment of the communication link between the host device and the peripheral corresponding to the 0th UART of CPLD2, and realizing the path selection operation.

[0081] The UART communication path selection method provided in this application first receives an operation command sent by a host device. The operation command indicates a path selection operation related to at least one slave device. The host device uniformly issues the operation command, avoiding the complex hardware structure problem caused by separate wiring between the host device and multiple slave devices. Then, according to the operation command, the host device sends path selection commands to at least one slave device through the interaction interface between the host device and at least one slave device, causing at least one slave device to perform the corresponding path selection operation. The centralized forwarding and hierarchical execution approach simplifies the path selection operation process and improves the convenience and reliability of UART communication path switching.

[0082] Based on the above embodiments, Figure 3 A flowchart illustrating the UART communication path selection method provided in the embodiments of this application. Figure 2 ,like Figure 3 As shown, step 22 can include the following implementation methods:

[0083] Step 31: Parse the operation instruction and obtain at least one register value from the operation instruction.

[0084] In this step, the master control device parses the operation instructions sent by the host device and obtains one or more register values ​​from the operation instructions.

[0085] For example, if the operation instruction includes 5 register values, then all 5 register values ​​are extracted.

[0086] Step 32: Generate at least one path selection instruction based on at least one register value.

[0087] Specifically, step 32 can be implemented as follows:

[0088] Step 1: Based on all register values, extract the path selection information corresponding to each register value from the preset register mapping table.

[0089] The preset register mapping table indicates the path selection information corresponding to each register value.

[0090] Step 2: Encapsulate each path selection information using a protocol to obtain at least one path selection instruction.

[0091] In steps 1 and 2, the master control device matches the acquired register values ​​with its own stored preset register mapping table, selecting the path selection information corresponding to each register value. Then, for each path selection information, the master control device sequentially adds fields such as frame header, target slave device, target UART communication path, and frame tail according to a preset communication protocol, completing the protocol encapsulation processing of each path communication information to form a path selection instruction conforming to the communication standard. The path selection instruction after protocol encapsulation has a complete structure and a unified format, facilitating recognition, parsing, and execution by the slave device, ensuring the reliability and standardization of control instruction transmission between the master and slave devices, and ultimately obtaining at least one path selection instruction corresponding one-to-one with each path selection information.

[0092] For example, when the register value is 0x02, by querying the preset register mapping table, the corresponding path selection information can be extracted as follows: the target slave device is CPLD2, and the target path is the UART communication path between TYPE-C and the 0th channel of CPLD2.

[0093] Accordingly, step 2 includes the following implementation:

[0094] Based on each path selection information and a preset priority mapping table, the priority of each path selection information is determined. The preset priority mapping table indicates the priority corresponding to each path selection information.

[0095] In descending order of priority, the corresponding path selection information is sent to at least one slave device in sequence.

[0096] In this implementation, after extracting the path selection information, the master control device compares and matches each path selection information with a preset priority mapping table, and determines the execution priority corresponding to each path selection information based on the mapping table. The preset priority mapping table is a pre-configured mapping table used to indicate the priority levels corresponding to different path selection requirements, different slave control devices, or different UART communication paths, thereby ensuring the priority selection of critical paths.

[0097] After determining the priority of all path selection information, the master control device schedules and sends path selection information to the corresponding slave control devices in sequence according to the priority sorting rule from high to low, so as to avoid instruction conflicts or transmission chaos when multiple paths are selected at the same time, and ensure that the UART communication path selection process is executed in an orderly and stable manner.

[0098] Step 33: Based on at least one path selection instruction, send a path selection instruction to the slave device corresponding to each path selection instruction through the interaction interface between the master control device and at least one slave control device.

[0099] In this step, the master control device sends the corresponding path selection command to the appropriate slave control device via the interactive interface, based on the target slave control device indicated by each path selection command. The master control device and each slave control device are connected via an RX / TX channel. During transmission, the master control device pushes the path selection command to its respective slave control device one by one, enabling the slave control device to execute the corresponding UART communication path selection action according to the command, ensuring reliable command transmission and accurate path switching.

[0100] The UART communication path selection method provided in this application first parses the operation instruction to obtain at least one register value from the instruction. By centrally processing path selection requirements through unified instruction parsing, it avoids the complex wiring issues caused by direct connections between the host device and each slave device. Then, based on the at least one register value, it generates at least one path selection instruction. This centralized instruction generation simplifies the control logic and effectively reduces the complexity of UART communication path selection operations. Finally, based on at least one path selection instruction, it sends the path selection instruction to the corresponding slave device through the interaction interface between the master device and at least one slave device. This achieves unified forwarding and hierarchical control, further optimizing the system hardware connection structure and improving the reliability and execution efficiency of path selection.

[0101] The following are embodiments of the apparatus described in this application, which can be used to execute the embodiments of the method described in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the method described in this application.

[0102] Figure 4This is a schematic diagram of the structure of the UART communication path selection device provided in the embodiments of this application, as shown below. Figure 4 As shown, a master control device is used in a UART multi-communication channel system and is connected to a host device via a bus. The master control device is connected to slave control devices through interactive interfaces. The device includes:

[0103] The receiving module 41 is used to receive operation instructions sent by the host device, the operation instructions indicating a path selection operation related to at least one slave device;

[0104] Sending module 42, used for:

[0105] Parse the operation instructions and obtain at least one register value from the operation instructions;

[0106] Generate at least one path selection instruction based on at least one register value;

[0107] Based on at least one path selection instruction, the master control device sends a path selection instruction to the slave control device corresponding to each path selection instruction through the interaction interface between the master control device and at least one slave control device, so that at least one slave control device performs the corresponding path selection operation.

[0108] In one possible implementation, the sending module 42 is further configured to:

[0109] Based on all register values, the path selection information corresponding to each register value is extracted from the preset register mapping table; the preset register mapping table indicates the path selection information corresponding to each register value.

[0110] Each path selection information is encapsulated using a protocol to obtain at least one path selection instruction.

[0111] In one possible implementation, the sending module 42 is further configured to:

[0112] Based on each path selection information and a preset priority mapping table, the priority of each path selection information is determined; the preset priority mapping table indicates the priority corresponding to each path selection information.

[0113] In descending order of priority, the corresponding path selection information is sent to at least one slave device in sequence.

[0114] In one possible implementation, the host device includes a host computer or an external device, wherein the external device is used to send operation commands via shortcut keys.

[0115] The UART communication path selection device provided in this application embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described again in this embodiment.

[0116] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented in software via processing element calls, while others are implemented in hardware. Additionally, these modules can be fully or partially integrated together, or implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through the integrated logic circuits in the hardware of the processor element or through software instructions.

[0117] The following are system embodiments of this application, which can be used to execute the method embodiments of this application. For details not disclosed in the system embodiments of this application, please refer to the method embodiments of this application.

[0118] Figure 5 A schematic diagram of the system architecture for UART communication path selection provided in the embodiments of this application. Figure 1 ,like Figure 5 As shown, the system includes: at least one host device, one master control device, and at least one slave control device.

[0119] Each host device is connected to the master control device via a bus and an interactive interface, and the master control device is connected to at least one slave control device via an interactive interface.

[0120] The master control device receives operation instructions from at least one host device via a bus, parses the operation instructions, and obtains at least one register value from the operation instructions; generates at least one path selection instruction based on the at least one register value; and sends a path selection instruction to the corresponding slave device through the interaction interface between the master control device and at least one slave control device based on the at least one path selection instruction, so that at least one slave control device performs the corresponding path selection operation.

[0121] The interaction interfaces between the host device and the main control device are TX and RX.

[0122] The aforementioned UART communication path selection system is used to perform the above... Figure 2 and Figure 3 Since the technical content of the UART communication path selection method in any embodiment has been described in detail in the method embodiment, the technical details that are the same as or corresponding to the method in this system embodiment will not be repeated here.

[0123] Figure 6 A schematic diagram of the system architecture for UART communication path selection provided in the embodiments of this application. Figure 2 ,like Figure 6 As shown, the host device is a TYPE-C, BMC, or CPU; the master control device is CPLD1; and the slave control devices are CPLD2 and CPLD3. CPLD1 integrates a MUX, which receives operation commands from the TYPE-C, BMC, or CPU via bus 1, parses them, and generates path selection commands. Simultaneously, it uses the internal MUX to enable UART data path selection between the BMC / CPU and the lower-level slave control devices, and sends path selection commands to slave control devices CPLD2 and CPLD3 via the TX signal. Each slave CPLD also integrates a MUX, which receives commands from CPLD1 via TX and controls the internal MUX to select the corresponding UART channel (uart0, uart1, uart2, etc.) TX / RX communication link, ultimately establishing a complete UART communication path between each pair of BMC / CPU, CPLD1, CPLD2, and CPLD3. CPLD1 is equipped with a CMD_Master module, which is responsible for parsing commands sent by the host device, then encapsulating the parsed commands and sending them to CPLD2~3 via TX signals; CPLD2~3 also have a command parsing module, which is responsible for parsing commands and selecting channels.

[0124] Control commands between CPLD1 and CPLD2~3 are transmitted via the TX signal between CPLD1 and CPLD2~3, using a time-division multiplexing method.

[0125] When the BMC / CPU is the host computer, operation instructions are sent via host computer commands. The corresponding preset register mapping table can be represented by Table 1:

[0126] Table 1

[0127]

[0128] When the host device is a keyboard connected via a TYPE-C interface, operation commands can be sent via shortcut keys. The corresponding preset register mapping table can be represented by Table 2:

[0129] Table 2

[0130]

[0131] exist Figure 6In the corresponding embodiments, no additional auxiliary communication interfaces such as I2C and LPC are required, effectively saving printed circuit board layout space and reducing the difficulty of other signal routing. It breaks free from the constraints of software instruction encapsulation, enabling flexible scheduling of board and system verification testing. Channel switching operations can be completed without complex instruction sequences, improving testing flexibility and efficiency. It supports large-scale, high-frequency channel switching stress testing, meeting reliability verification requirements under extreme operating conditions. It simplifies the later debugging and testing process; fault location does not require cross-software / hardware collaborative troubleshooting, significantly improving R&D and maintenance efficiency. Through these improvements, the performance and usability of the solution can be further enhanced, costs reduced, production efficiency increased, and debugging and maintenance convenience enhanced.

[0132] Figure 7 A schematic diagram of the structure of an electronic device provided in this application, such as... Figure 7 As shown, the electronic device 70 provided in this embodiment includes at least one processor 701 and a memory 702. Optionally, the electronic device 70 further includes a communication component 703. The processor 701, memory 702, and communication component 703 are connected via a bus 704.

[0133] In a specific implementation, at least one processor 701 executes computer execution instructions stored in memory 702, causing at least one processor 701 to perform the above-described method.

[0134] The specific implementation process of processor 701 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0135] In the above embodiments, it should be understood that the processor can be a CPU, or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0136] The memory may include random access memory (RAM) in high-speed memory, and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0137] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0138] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0139] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0140] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random-Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0141] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside within an ASIC. Alternatively, the processor and the readable storage medium can exist as discrete components in a device.

[0142] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0143] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0144] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0145] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.

[0146] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0147] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for selecting a UART communication path, characterized in that, A master control device, applied in a UART multi-communication path system and connected to a host device via a bus, wherein the master control device is connected to slave control devices through interactive interfaces, the method comprising: Receive operation instructions sent by the host device, wherein the operation instructions indicate a path selection operation associated with at least one slave device; The operation instruction is parsed to obtain at least one register value from the operation instruction; Based on the at least one register value, generate at least one path selection instruction; Based on the at least one path selection instruction, the master control device sends a path selection instruction to the slave control device corresponding to each path selection instruction through the interaction interface between the master control device and the at least one slave control device, so that the at least one slave control device performs the corresponding path selection operation.

2. The method according to claim 1, characterized in that, The step of generating at least one path selection instruction based on the at least one register value includes: Based on all register values, the path selection information corresponding to each register value is extracted from a preset register mapping table; the preset register mapping table indicates the path selection information corresponding to each register value. Each path selection information is encapsulated using a protocol to obtain at least one path selection instruction.

3. The method according to claim 2, characterized in that, The process of protocol encapsulating each path selection information to obtain the at least one path selection instruction includes: Based on each path selection information and a preset priority mapping table, the priority of each path selection information is determined; the preset priority mapping table indicates the priority corresponding to each path selection information. According to the priority order from high to low, the corresponding path selection information is sent to the at least one slave device in sequence.

4. The method according to any one of claims 1 to 3, characterized in that, The host device includes a host computer or an external device, wherein the external device is used to send operation commands via shortcut keys.

5. A UART communication path selection device, characterized in that, A master control device used in a UART multi-communication channel system, connected to a host device via a bus, wherein the master control device is connected to slave control devices through interactive interfaces, and the device includes: The receiving module is used to receive operation instructions sent by the host device, the operation instructions indicating a path selection operation related to at least one slave device; The sending module is used for: The operation instruction is parsed to obtain at least one register value from the operation instruction; Based on the at least one register value, generate at least one path selection instruction; Based on the at least one path selection instruction, the master control device sends a path selection instruction to the slave control device corresponding to each path selection instruction through the interaction interface between the master control device and the at least one slave control device, so that the at least one slave control device performs the corresponding path selection operation.

6. A UART communication path selection system, characterized in that, The system includes: at least one host device, one master control device, and at least one slave control device; Each host device is connected to the master control device via a bus and an interaction interface, and the master control device is connected to the at least one slave control device via the interaction interface. The master control device receives operation instructions from the at least one host device via a bus, parses the operation instructions, and obtains at least one register value from the operation instructions; generates at least one path selection instruction based on the at least one register value; and sends a path selection instruction to the corresponding slave device through the interaction interface between the master control device and the at least one slave control device based on the at least one path selection instruction, so that the at least one slave control device performs the corresponding path selection operation.

7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 4.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 4.

9. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 4.