Port switching method, electronic device, storage medium and computer program product

By collecting the pin level status of the port, the protocol type is automatically identified and the displayed capability information is adjusted, which solves the problem of the inability to automatically identify the protocol type in the existing technology. This achieves port unification and stability of cross-protocol switching, and improves compatibility and switching success rate.

CN121935199APending Publication Date: 2026-04-28SHENZHEN HDCVT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN HDCVT TECH CO LTD
Filing Date
2026-03-31
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing technologies cannot automatically and reliably identify the currently inserted protocol type in each port in multi-input switchers, resulting in large space occupied by the device panel ports, high material and assembly complexity, and easy occurrence of black screen, screen distortion or handshake failure when switching between protocols, resulting in poor compatibility.

Method used

By collecting the identification pin level status of each input and output port, the protocol type is automatically detected, and the switching mode is determined based on the target port information. The display capability information is adjusted, and capability rewriting information is generated to ensure that the input and output data conform to the corresponding protocol type.

Benefits of technology

It achieves unified physical form of ports and automatic protocol adaptation, improves compatibility and switching success rate in multi-interface mixed application scenarios, and reduces black screen time and handshake failure rate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121935199A_ABST
    Figure CN121935199A_ABST
Patent Text Reader

Abstract

The invention discloses a port switching method, electronic equipment, a storage medium and a computer program product, relates to the technical field of interface switching, is applied to a multi-port switcher, the multi-port switcher comprises input ports and output ports, and comprises the following steps: determining a target port switching mode based on target port information and an identification pin level state, generating synthesis capability information based on the display capability information of the target output end and a preset capability constraint of the multi-port switcher, and performing adjustment and capability expression mode mapping on the synthesis capability information based on a common protocol index of the target input end and the target output end in a cross-protocol switching mode to obtain capability rewriting information, and then the capability rewriting information is transmitted to the target input end to complete port switching. The technical problem of poor compatibility is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of interface switching technology, and in particular to a port switching method, electronic device, storage medium and computer program product. Background Technology

[0002] With the widespread adoption of multimedia applications, the mixed interface types of signal source devices and display devices are becoming increasingly prominent, with high-definition multimedia interfaces and primary display interface protocols often being used interchangeably in the same scenarios. In multi-input switcher applications, existing technologies typically employ separate ports for different protocols or rely on external adapter cables for protocol conversion, resulting in large port footprints on the device panel, high material and assembly complexity, and product model fragmentation. Although there are combination interface sockets on the market that are compatible with both types of plugs, achieving physical port unification, existing switchers still cannot automatically and reliably identify the currently inserted protocol type on each port in multi-input switching scenarios. They struggle to simultaneously and stably handle capability reading, handshake negotiation, and link training under different protocols during switching. When the input and output protocols are inconsistent, the source-end output capabilities cannot be effectively constrained, leading to black screens, screen distortion, or handshake failures during cross-protocol switching. Therefore, current multi-interface mixed application scenarios suffer from poor compatibility issues.

[0003] The above content is only used to help understand the technical solution of this application and does not represent an admission that the above content is prior art. Summary of the Invention

[0004] The main objective of this application is to provide a port switching method, electronic device, storage medium, and computer program product, which aims to solve the technical problem of poor compatibility.

[0005] To achieve the above objectives, this application proposes a port switching method applied to a multi-port switch, the multi-port switch including input ports and output ports, the port switching method comprising: The identification pin level status of each input port and each output port is collected, and the target port switching mode is determined based on the received target port information and the identification pin level status, wherein the target port information is used to determine the target input terminal and the target output terminal; Based on the target port switching mode, the display capability information of the target output terminal is adjusted to obtain capability rewriting information, wherein the capability rewriting information is determined by the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal; The capability rewriting information is transmitted to the target input terminal so that the target input terminal rewrites the input data according to the capability rewriting information, obtains output data, and sends it to the target output terminal, wherein the input data conforms to the first protocol type and the output data conforms to the second protocol type.

[0006] In one embodiment, the step of determining the target port switching mode based on the received target port information and the identified pin level state includes: Determine the target input and target output based on the received target port information; The first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal are determined by the identification pin level state; Determine whether the first protocol type and the second protocol type are consistent, and determine the target port switching mode based on the determination result.

[0007] In one embodiment, the target port switching mode includes a same-protocol switching mode and a cross-protocol switching mode; The steps for determining the target port switching mode based on the judgment result include: If the determination result is that the first protocol type and the second protocol type are the same, the target port switching mode is determined to be the same protocol switching mode; If the determination result is that the first protocol type and the second protocol type are inconsistent, the target port switching mode is determined to be a cross-protocol switching mode.

[0008] In one embodiment, the step of adjusting the display capability information of the target output terminal based on the target port switching mode to obtain capability rewriting information includes: Obtain the display capability information of the target output terminal, and generate composite capability information based on the display capability information and the preset capability constraints of the multi-port switch; The synthesized capability information is adjusted based on the target port switching mode to obtain capability rewriting information.

[0009] In one embodiment, the step of generating composite capability information based on the display capability information and the preset capability constraints of the multi-port switch includes: The display capability information is converted into a capability description, wherein the capability description is used to characterize the display feature indicators of the target output terminal; Based on the preset capability constraints of the multi-port switcher, the target feature index in the display feature index is adjusted to obtain the synthesized capability information. The target feature index is a display feature index that exceeds the preset capability constraints. The preset capability constraints are used to characterize the processing limit of the multi-port switcher. The synthesized capability information is a display feature index that adapts to the preset capability constraints.

[0010] In one embodiment, the step of adjusting the synthesized capability information based on the target port switching mode to obtain capability rewriting information includes: When the target port switching mode is the same protocol switching mode, the synthesized capability information is converted into a format compatible with the first protocol type corresponding to the target input terminal to obtain capability rewriting information, wherein the target input terminal is associated with the target output terminal; When the target port switching mode is a cross-protocol switching mode, the synthesized capability information is adjusted based on the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal to obtain capability rewriting information.

[0011] In one embodiment, the step of adjusting the synthesis capability information based on the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal includes: The common protocol index of the target input terminal and the target output terminal is determined based on the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal; The range of each indicator in the synthetic capability information is adjusted based on the shared protocol indicators so that the adjusted synthetic capability information meets the shared protocol indicators. The adjusted synthetic capability information is mapped to a capability expression that matches the target input to obtain capability rewriting information.

[0012] Furthermore, to achieve the above objectives, this application also proposes a port switching device for use in a multi-port switcher, the multi-port switcher including input ports and output ports, the port switching device comprising: The mode determination module is used to collect the identification pin level status of each input port and each output port, and determine the target port switching mode based on the received target port information and the identification pin level status, wherein the target port information is used to determine the target input terminal and the target output terminal; The information rewriting module is used to adjust the display capability information of the target output terminal based on the target port switching mode to obtain capability rewriting information, wherein the capability rewriting information is determined by the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal; The data output module is used to transmit the capability rewriting information to the target input terminal, so that the target input terminal rewrites the input data according to the capability rewriting information, obtains output data, and sends it to the target output terminal, wherein the input data conforms to the first protocol type, and the output data conforms to the second protocol type.

[0013] In addition, to achieve the above objectives, this application also proposes an electronic device, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the port switching method described above.

[0014] In addition, to achieve the above objectives, this application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and which, when executed by a processor, implements the steps of the port switching method described above.

[0015] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the port switching method described above.

[0016] This application provides a port switching method applied to a multi-port switcher, which includes input ports and output ports. The port switching method includes: acquiring the identification pin level status of each input port and each output port; determining a target port switching mode based on the received target port information and the identification pin level status, wherein the target port information is used to determine the target input terminal and the target output terminal; adjusting the display capability information of the target output terminal based on the target port switching mode to obtain capability rewriting information, wherein the capability rewriting information is determined by a first protocol type corresponding to the target input terminal and a second protocol type corresponding to the target output terminal; transmitting the capability rewriting information to the target input terminal so that the target input terminal rewrites the input data according to the capability rewriting information, obtaining output data and sending it to the target output terminal, wherein the input data conforms to the first protocol type and the output data conforms to the second protocol type.

[0017] This application automatically detects the current protocol type of each port by collecting the identification pin level status of each input and output port, and determines the target port switching mode based on the received target port information. This solves the problem in the prior art that the protocol type cannot be automatically and reliably identified, leading to easy user mis-plugging or the need for manual settings, and achieves rapid and accurate identification of the protocol type. Secondly, according to the determined target port switching mode, the display capability information of the target output terminal is adaptively adjusted to generate capability rewriting information. This solves the problem that the source output capability cannot be effectively constrained when the input and output protocols are inconsistent, which can easily lead to black screen or screen distortion, and ensures that the output capability meets the processing limits of the switcher and display device. Finally, the capability rewriting information is transmitted to the target input terminal to guide the source terminal to output signals according to the adapted capability, thereby realizing the correct transmission and display of signals from the input terminal to the output terminal. This solves the drawbacks of lack of dynamic capability negotiation and poor compatibility during the switching process, and ensures the stability and success rate of the switching. Compared to related solutions that use separate ports for different protocols or rely on external adapters for protocol conversion, this application automatically determines the protocol type by recognizing the pin level and dynamically adjusts and distributes capability information based on the switching mode. This achieves unified physical form of ports, automatic protocol adaptation, and stable switching across protocol scenarios, significantly improving compatibility and switching success rate in multi-interface mixed application scenarios, and effectively reducing black screen time and handshake failure rate. Attached Figure Description

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

[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0020] Figure 1 This is a flowchart illustrating an embodiment of the port switching method of this application. Figure 2 This is a general block diagram of a multi-port switch provided in Embodiment 1 of this application; Figure 3 This is a flowchart of the identification pin acquisition and port protocol type table generation process provided in Embodiment 1 of this application; Figure 4 This is a schematic diagram of the single-chip multi-protocol cross-switching chip functional module provided in Embodiment 1 of this application; Figure 5 This is a block diagram of a KVM switch provided in Embodiment 1 of this application; Figure 6 This is a flowchart illustrating Embodiment 2 of the port switching method of this application; Figure 7 This is a schematic diagram of the EDID rewriting process of the port switching method provided in Embodiment 2 of this application; Figure 8 This is an overall flowchart of the port switching method provided in Embodiment 2 of this application; Figure 9 This is a schematic diagram of the module structure of the port switching device according to an embodiment of this application; Figure 10 This is a schematic diagram of the device structure of the hardware operating environment involved in the port switching method in the embodiments of this application.

[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation

[0022] It should be understood that the first embodiment described herein is merely used to explain the technical solution of this application and is not intended to limit this application.

[0023] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.

[0024] The first embodiment of this application is applied to a multi-port switcher, which includes various input ports and various output ports. The main solution is as follows: First, the target port switching mode is determined based on the identification pin level state and target port information; then, composite capability information is generated based on the display capability information of the target output terminal and preset capability constraints; in the cross-protocol switching mode, the composite capability information is adjusted based on the common protocol indicators of the target input terminal and the target output terminal, and the capability expression method is mapped; then, the capability rewriting information is transmitted to the target input terminal to trigger the target input terminal to complete data output according to the updated capability information.

[0025] In the first embodiment, for ease of description, the following description uses a port switching device as the execution subject.

[0026] In multi-input switcher applications, existing technologies typically employ separate ports for different protocols or rely on external adapter cables for protocol conversion. This results in large port footprints on the device panel, high material and assembly complexity, and product model fragmentation. Although there are combination interface sockets on the market that are compatible with both types of plugs, achieving physical port unification, existing switches still cannot automatically and reliably identify the currently inserted protocol type on each port in multi-input switching scenarios. They struggle to simultaneously and stably handle capability reading, handshake negotiation, and link training under different protocols during switching. When the input and output protocols are inconsistent, they cannot effectively constrain the output capabilities of the source end, leading to black screens, distorted screens, or handshake failures during cross-protocol switching.

[0027] This application provides a solution that automatically detects the current protocol type of each port by collecting the identification pin level status of each input and output port, and determines the target port switching mode based on the received target port information. This solves the problem in existing technologies where protocol types cannot be automatically and reliably identified, leading to easy user mis-plugging or the need for manual settings, and achieves rapid and accurate identification of protocol types. Secondly, based on the determined target port switching mode, the display capability information of the target output terminal is adaptively adjusted to generate capability rewriting information. This solves the problem of not being able to effectively constrain the output capability of the source end when the input and output protocols are inconsistent, which can easily lead to black screen or screen distortion, and ensures that the output capability meets the processing limits of the switcher and display device. Finally, the capability rewriting information is transmitted to the target input terminal to guide the source end to output signals according to the adapted capability, thereby realizing the correct transmission and display of signals from the input end to the output end. This solves the drawbacks of lack of dynamic capability negotiation and poor compatibility during the switching process, and ensures the stability and success rate of the switching. Compared to related solutions that use separate ports for different protocols or rely on external adapters for protocol conversion, this application automatically determines the protocol type by recognizing the pin level and dynamically adjusts and distributes capability information based on the switching mode. This achieves unified physical form of ports, automatic protocol adaptation, and stable switching across protocol scenarios, significantly improving compatibility and switching success rate in multi-interface mixed application scenarios, and effectively reducing black screen time and handshake failure rate.

[0028] It should be noted that the executing entity in the first embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, or other electronic device, or a system, application, or program capable of implementing the above functions. The first embodiment and the following embodiments will be described using a port switching device as an example.

[0029] All actions involving the acquisition of signals, information, or data in this application are carried out in accordance with the relevant data protection laws and policies of the country where the application is located, and with the authorization of the owner of the relevant device.

[0030] Based on this, the embodiments of this application provide a port switching method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the port switching method of this application.

[0031] In this embodiment, the method is applied to a multi-port switch, which includes input ports and output ports. The port switching method includes steps S01 to S03: It should be noted that a multi-port switcher is a device with multiple input ports and at least one output port, used to select one signal from multiple signal sources and switch it to a display device. Each port uses a combination interface socket compatible with different protocol plugs. A combination interface socket is a physical port receptacle that can accommodate plugs of two different protocol types; for example, the same socket can accept both a high-definition multimedia interface plug and a first display interface protocol plug.

[0032] Additionally, it should be noted that the multi-port switcher can be a 2 / 3 / 4 / 8-input 1-output switcher. Each combined port is equipped with an HDMI / DP combined interface socket. This interface socket has an identification pin. When an HDMI (High-Definition Multimedia Interface) plug is inserted, the identification pin outputs a low level; when a DP (Display Interface) plug is inserted, it outputs a high level (this mapping relationship can be reversed according to the design). The multi-port switcher internally includes modules such as an identification pin acquisition circuit, a single-chip multi-protocol cross-switching chip, and a user control interface. The identification pin acquisition circuit is used to identify the high and low electrical signals of each port; the single-chip multi-protocol cross-switching chip supports internal cross-routing and bidirectional protocol conversion between HDMI and DP. The chip integrates an MCU (Microcontroller Unit) and its firmware to perform protocol identification, routing configuration, EDID (Extended Display Identification Data) simulation, and link training management; the user control interface is used to receive buttons, remote control, serial port, or commands for the user to select the target input port.

[0033] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 2 , Figure 2A general block diagram of the multi-port switcher is provided, which features an N-in, 1-out architecture. The input end includes N input ports: IN1, IN2 to INn. Each input port uses a DP / HDMI combo interface to connect to signal source devices such as PCs (e.g., PC1, PC2…PCn), providing video input and possessing detection / handshake features. The output port OUT also uses a DP / HDMI combo interface to connect to a DP or HDMI display, providing video output and possessing detection / handshake features. A multi-protocol video switching and conversion unit is responsible for selecting / routing the N inputs. Each input is equipped with a port emulation / hold module, supporting EDID emulation (HDMI / DP) and optional DPCD emulation (DP), and implementing HPD gating at the source end. This unit supports same-protocol switching (HDMI→HDMI, DP→DP) and bidirectional cross-protocol conversion (DP→HDMI, HDMI→DP). The automatic protocol identification module collects the pin levels of each port and generates port protocol type tables Type[INi] and Type[OUT], indicating whether each port is currently using the DP or HDMI protocol. The control module connects to buttons, remote controls, indicator lights, or a host computer to receive user commands and status indications. Additionally, the system outputs EDID simulation and HPD gating signals to each input source via a simulation / gating module, enabling port capability negotiation and handshake control.

[0034] Additionally, it should be noted that the multi-port switcher can also be a KVM (Keyboard, Video, Mouse) switcher. The KVM switcher, based on a 2 / 3 / 4 / 8-input 1-output switcher, adds a USB switching module and linkage control logic. The USB (Universal Serial Bus) switching module includes multiple host USB ports and at least one peripheral USB port (for connecting peripherals such as keyboards and mice). Its channel selection is controlled by a built-in MCU, and the linkage control logic is embedded in the MCU firmware. This logic is used to synchronously switch the USB to the corresponding host when the video input is switched to the target input port, achieving synchronized switching between video and USB.

[0035] Step S01: Collect the identification pin level status of each input port and each output port, and determine the target port switching mode based on the received target port information and the identification pin level status. The target port information is used to determine the target input terminal and the target output terminal. It should be noted that the input port is the interface on the multi-port switch used to connect signal source devices, and plugs of different protocol types can be inserted. The output port is the interface on the multi-port switch used to connect display devices, and similarly, plugs of different protocol types can be inserted. The identification pin level status refers to the high or low electrical signal output from the identification pin in the combination interface socket. The electrical signal level status corresponds to the protocol type of the inserted plug; by acquiring the level, the currently connected protocol type can be determined. The target port information is an externally input switching command used to specify the input port to which the switch is intended to be performed. The target port switching mode is determined based on whether the protocol type of the target input port and the output port are consistent, including same-protocol switching and cross-protocol switching. The target input is the input port specified by the target port information, connected to the signal source device. The target output is the output port on the multi-port switch connected to the display device; the signal is ultimately output to the display device from this port.

[0036] Additionally, it should be noted that the steps for acquiring the identification pin level status of each input port and each output port include: using the identification pins on the combination interface sockets used by each input port and each output port, the type of plug inserted into each port is detected in real time, and the identification pins of each combination interface socket output different level statuses when an HDMI plug is inserted and a DP plug is inserted; the acquired identification pin level signals are subjected to jitter sampling processing to remove glitches and interference during the level transition process, so as to obtain a stable level status.

[0037] In one feasible implementation, step S01, which involves determining the target port switching mode based on the received target port information and the identified pin level state, includes steps A01 to A03: Step A01: Determine the target input and target output based on the received target port information; Step A02: Determine the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal by identifying the pin level status; It should be noted that the first protocol type is the interface protocol category used by the source device connected to the target input port, determined by the pin level state of the target input port; it can be either HDMI or DP. The second protocol type is the interface protocol category used by the display device connected to the target output port, determined by the pin level state of the target output port; it can also be either HDMI or DP. The judgment result is a conclusion drawn from comparing the first and second protocol types, i.e., whether they are the same or different, used to determine whether the target port switching mode is a same-protocol switching mode or a cross-protocol switching mode.

[0038] For example, by mapping stable voltage levels (i.e., the voltage level of the identification pin) to corresponding protocol types using pull-up or pull-down resistor networks, a port protocol type table containing the current protocol types of all input and output ports can be generated. By querying this table, the protocol type corresponding to a specific interface can be determined. The system receives target port information sent by the user via buttons, infrared remote control, serial port, or network commands. It parses the target input terminal identifier and target output terminal identifier from the target port information. Based on the target input terminal identifier, it queries the port protocol type table for the first protocol type corresponding to the target input terminal, and based on the target output terminal identifier, it queries the port protocol type table for the second protocol type corresponding to the target output terminal.

[0039] Step A03: Determine whether the first protocol type and the second protocol type are consistent, and determine the target port switching mode based on the determination result.

[0040] In one feasible implementation, the target port switching mode includes a same-protocol switching mode and a cross-protocol switching mode. In step S13, the step of determining the target port switching mode based on the judgment result includes steps A11 to A12: Step A11: If the determination result is that the first protocol type and the second protocol type are consistent, determine that the target port switching mode is the same protocol switching mode; It should be noted that the same protocol switching mode refers to the working mode in which the target input end and the target output end use the same interface protocol for signal transmission when the first protocol type and the second protocol type are the same.

[0041] Step A12: If the first protocol type and the second protocol type are inconsistent, the target port switching mode is determined to be a cross-protocol switching mode.

[0042] It should be noted that cross-protocol switching mode refers to a working mode in which the target input and target output terminals use different interface protocols for signal transmission when the first protocol type and the second protocol type are inconsistent.

[0043] For example, the first protocol type is compared with the second protocol type. If they are the same, the target port switching mode is determined to be the same protocol switching mode. If they are different, the target port switching mode is determined to be the cross-protocol switching mode. In the cross-protocol switching mode, the direction of cross-protocol conversion is further determined according to the combination of the first protocol type and the second protocol type.

[0044] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 3 , Figure 3A flowchart for pin identification acquisition and port protocol type table generation is provided. First, detection information from each input port IN1…INN and output port OUT is acquired, including pin level status, insertion / removal status, and handshake channel characteristics. Then, the acquired signals undergo de-jittering and filtering to eliminate level jitter during insertion / removal, ensuring stability. After stability is determined, the input protocol determination logic, through configurable level mapping or table lookup, classifies the high and low levels of the identified pins into DP or HDMI types. Based on the determination results, a port protocol type table is generated, recording the protocol type Type[INi] of each input port and the protocol type Type[OUT] of the output port. Path decisions are made based on the protocol type table: when the target input and output protocol types are consistent, a direct route using the same protocol is selected; otherwise, cross-protocol conversion is performed, enabling mutual conversion between DP and HDMI. Finally, based on the path decisions, various modules are configured in conjunction, including setting the input / output physical layer protocol mode, selecting EDID emulation or DPCD (DP Configuration Data) emulation strategy, and configuring the HDMI SCDC (State and Control Data). Training strategies for Channel (state and control data channels) or DP links, and gating strategies for determining source-side HPD (HotPlug Detect) signals.

[0045] Understandably, due to the lack of effective protocol identification methods, users are prone to mis-insertion or need to manually set it, resulting in large space occupied by device panel ports and fragmented product models. Therefore, step S01 is performed to collect the identification pin level status of each input port and output port, and determine the target port switching mode by combining it with the received target port information. This achieves the unification of port physical form and automatic perception of protocol type, solving the technical problem in the prior art that it is impossible to automatically and reliably identify the current inserted protocol type of each port. This lays an accurate foundation for subsequent capability adjustment and signal switching, and improves the plug-and-play and adaptability of the device in multi-interface mixed scenarios.

[0046] Step S02: Adjust the display capability information of the target output terminal based on the target port switching mode to obtain capability rewriting information, wherein the capability rewriting information is determined by the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal; It should be noted that Display Capability Information (EDID) is capability data read from the display device connected to the target output terminal. This data may include display characteristics such as supported resolution, refresh rate, color format, color depth, and audio format. Capability rewriting information is new capability data generated after adjusting the display capability information. This adjustment process considers both the switcher's own processing limits and the requirements of the target port's switching mode, ensuring that the final capability adapts to the common limitations of both the switcher and the display device, thus constraining the parameter range of the output signal.

[0047] Understandably, when switching between protocols, the source end may output out-of-specification signals that exceed the processing limits of the conversion link or display device, resulting in black screen, distorted screen, or handshake failure. Therefore, step S02 is performed to dynamically generate adapted capability information by combining the switching mode and the display device capability information. This ensures that the source end output signal is within the common capability range of the switcher and the display device, effectively avoiding display abnormalities caused by capability mismatch and solving the technical problem of not being able to effectively constrain the source end output capability when the input protocol and output protocol are inconsistent.

[0048] Step S03: Transmit the capability rewriting information to the target input terminal so that the target input terminal rewrites the input data according to the capability rewriting information, obtains the output data, and sends it to the target output terminal. The input data conforms to the first protocol type, and the output data conforms to the second protocol type.

[0049] It should be noted that the input data is the raw audio and video signal sent from the signal source device to the multi-port switcher through the target input terminal. The output data is the final signal sent to the display device connected to the target output terminal after internal routing and processing by the multi-port switcher.

[0050] For example, the capability rewriting information is transmitted to the target input terminal. Specifically, the multi-port switcher, through the protocol channel corresponding to the target input terminal, writes the capability rewriting information into the memory of the target input terminal or directly provides it to the source device in a format recognizable by the source device of the target input terminal (e.g., extended display identification data under the HDMI protocol or display capability information under the DP protocol) during the period when the hot-plug detection signal is invalid or after it is restored. After detecting a change in the hot-plug detection signal or receiving a capability information update notification, the target input terminal rereads the capability rewriting information and adjusts the parameters of its output signal according to the indicators such as video timing capability, color format capability, color depth capability, high dynamic range image capability, and audio format capability specified in the information, generating an input data stream that meets the constraints. This input data stream enters the multi-port switcher through the target input port, and after being processed by the internal routing configured by the switching chip according to the target port switching mode (and undergoing cross-protocol conversion if necessary), it is sent as output data to the display device connected to the target output terminal for display.

[0051] For example, when the target input is an HDMI source device, the target output is a DP protocol display, and the target port switching mode is cross-protocol switching mode, the multi-port switcher will send the generated capability rewriting information through the display data channel of the high-definition multimedia interface in an extended display identifier data format. The source device will adjust its output accordingly to a 1080p resolution, 4:2:0 color format video stream. This video stream is converted into a DP protocol signal by the switcher and then output to the display, thereby avoiding black screen or screen distortion problems caused by the source device outputting a resolution exceeding the 4K resolution of the conversion link bandwidth.

[0052] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 4 , Figure 4This document provides a schematic diagram of the functional modules of a single-chip multi-protocol cross-switching chip. The chip integrates four main modules: an input receiver, a routing and conversion core, an output transmitter, and a control and interface module. The input receiver includes N receiver front-ends, each corresponding to one input port. Internally, it integrates DP RX (DP Receiver) or HDMI RX (HDMI Receiver) receiving circuits and features automatic identification and equalization functions. These are used to receive signals from the source device. DP RX is the receiver component for the DP interface, and HDMI RX is the receiver component for the HDMI interface, responsible for receiving video and audio signals from the transmitter (such as a graphics card or media player). The routing and conversion core includes a cross-routing / selection matrix for selecting the current input; a cross-protocol conversion engine supporting bidirectional conversion between DP and HDMI; a capability mapping / constraint module for mapping and deleting extended display identifier data or capability fields during cross-protocol switching; and AUX (Auxiliary) channel management for handling auxiliary channel communication for the first display interface protocol. The output transmitter is for the output port OUT and includes DP TX (DP Transmitter) and HDMI TX (HDMI Transmitter) transmission circuits. It also has display data channel / hot-plug detection signal / extended display identifier data content protection management functions. The output protocol is selected as the first display interface protocol or high-definition multimedia interface according to the port protocol type Type[OUT]. DP TX and HDMI TX are the transmitter components of DP and HDMI interfaces, respectively, responsible for converting video and audio signals into digital signals that conform to the interface standard and transmitting them to the display device through the interface. The control and interface section includes a simulation and handshake management module, which maintains EDID simulation, caching and rewriting, and optional DPCP simulation and capability tables for each input port; an HPD gating control module is used to trigger rereading or retraining of the source input port; a DP link training management module is responsible for triggering, retrying and parameter caching; HDCP (High-bandwidth Digital Content Protection) compatibility and relay coordination modules are optional functions; the external control interface supports button, remote control, I2C (Inter-Integrated Circuit) or UART (Universal Asynchronous Receiver / Transmitter) methods; the state machine and policy control are executed by the MCU.

[0053] Additionally, it should be noted that when the target input or output involves a first display interface protocol (DP) link, link training management is performed. Specifically, when the MCU detects that the protocol type of the target input or output is the first display interface protocol, it caches the training parameters related to the current link (i.e., the DP protocol digital communication channel established between the target input or output via the switch's internal routing). The training parameters may include link speed, number of channels, and equalization level. After switching to the target input, fast recovery training is triggered based on the cached training parameters to enable the source device and display device to quickly restore stable communication on the established link. Furthermore, if the current link training fails or an error is detected, one or more retraining processes are automatically executed until the link stabilizes, thereby restoring stable output. The training process for the DP link can be referenced from existing solutions and will not be elaborated upon here.

[0054] Additionally, it should be noted that to reduce the black screen time during the switching process, the MCU controls according to the following timing sequence: After receiving the switching command, it reads the protocol types of the target input and output terminals; enters the switching window, performs output hot-plug detection signal gating, invalidates the output hot-plug detection signal and maintains it for a first duration, the first duration of which can range from 50 milliseconds to 1000 milliseconds; during the period when the hot-plug detection signal is invalid, it configures the receiving mode, transmitting mode, internal cross-routing, and cross-protocol conversion path of the switching chip; reads the display capability information of the output display device and synthesizes it according to preset capability constraints, then maps, deletes, and rewrites it according to the current input protocol, output protocol, and switching mode before sending it to the target input source; when the first display interface protocol link is involved, it performs training parameter recovery and triggers link training or fast recovery; restores the hot-plug detection signal to be valid and enters stable detection; when an anomaly is detected, it triggers retraining or re-handshake.

[0055] Additionally, it should be noted that when the multi-port switcher is a KVM switcher, the MCU synchronously outputs a USB selection signal during video switching, controlling the USB switching module to switch to the host corresponding to the target input, thus achieving synchronous switching between the video signal and the USB signal. Furthermore, the USB switching can be delayed or staged according to the video recovery timing to coordinate with the video signal recovery sequence.

[0056] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 5 , Figure 5A block diagram of the KVM switch is provided, illustrating the complete architecture of video switching and USB linkage. The host side includes N computers, PC1 to PCn, each providing both video signals and a USB host interface. Video signals are connected to a multi-protocol video switching and conversion unit via DP / HDMI combination interface sockets IN1 to INn. This unit has an N-in, 1-out architecture and automatically identifies whether the input is a DP or HDMI interface, supporting same-protocol switching and DP / HDMI protocol conversion. The switched and converted video signals are output to a display device, which can be a DP monitor or an HDMI monitor, via the output DP / HDMI combination interface socket. For USB signals, each computer's USB host interface is connected to a USB switching unit, which works in conjunction with the video switching unit to switch from N hosts to multiple USB devices. The USB device side includes multiple peripheral interfaces, USB device 1 to USB device n. The control interface connects to buttons, a remote control, or indicator lights to receive user commands and indicate status. The power module supplies power to the entire KVM switch.

[0057] Understandably, existing switches struggle to simultaneously handle capability reading and handshake negotiation under different protocols during switching, resulting in low switching success rates and long black screen times. Therefore, step S03 is performed to actively constrain and control the output capabilities of the source end by sending the adjusted capability information back to the source end. This ensures the correct transmission and display of signals from the input end to the output end, significantly improving the switching stability and compatibility in multi-interface mixed scenarios, reducing black screen time and handshake failure rate, and solving the drawbacks of lack of dynamic capability negotiation and poor compatibility during switching.

[0058] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 6 In step S02, the step of adjusting the display capability information of the target output terminal based on the target port switching mode to obtain the capability rewriting information includes steps S11~S12: Step S11: Obtain the display capability information of the target output terminal, and generate composite capability information based on the display capability information and the preset capability constraints of the multi-port switch; It's important to note that preset capability constraints refer to the inherent processing limits of the multi-port switch's hardware architecture. These constraints are defined by parameters such as the switching chip's physical bandwidth, pixel clock frequency, and the range of supported color and audio formats. Independent of the external display device, these constraints represent hard boundaries that the switch must adhere to in any operating mode, ensuring that signals processed internally by the switch do not exceed its hardware capabilities, leading to distortion or interruption. For example, if a switch's internal circuitry can only support a 4:2:0 color format at 4K resolution and 60Hz refresh rate, but cannot handle a 4:4:4 format at the same resolution, this bandwidth limitation is part of the preset capability constraint. Composite capability information is an intermediate capability description generated by trimming the original capabilities of the target output display device based on these preset capability constraints.

[0059] For example, when acquiring display capability information of the target output terminal, if the protocol type of the target output terminal is HDMI, the EDID is read from the connected display device via DDC (Display Data Channel). This data is stored in the read-only memory of the display device and includes basic description information of the device, as well as capability parameters such as supported resolution, refresh rate, color format, color depth, audio format, and high dynamic range imaging. If the protocol type of the target output terminal is DP, the EDID or equivalent display capability information is read from the connected display device via AUX (Auxiliary Audio Interface). This information also includes parameters such as video timing, color capabilities, and audio capabilities supported by the display device, but its data structure and transmission mechanism are different from the extended display identifier data of the High Definition Multimedia Interface and need to be parsed according to the specifications of the first display interface protocol.

[0060] In one feasible implementation, step S11, which involves generating composite capability information based on display capability information and preset capability constraints of the multi-port switch, includes steps B01-B02: Step B01 converts the display capability information into a capability description, where the capability description is used to characterize the display feature indicators of the target output. It should be noted that the capability description is internal structured data generated after parsing the raw display capability information read from the target output display device. This data structurally records the various capability parameters supported by the display device, facilitating subsequent comparison, cropping, and adjustment operations. For example, the capability description parsed from EDID may include entries such as "supports 4K@60Hz resolution," "supports RGB 4:4:4 color format," and "supports 8-bit color depth." Display feature indicators are the specific parameter items that constitute the capability description, used to characterize the capability features of the target output display device in various dimensions. These may include resolution indicators (such as 1920×1080, 3840×2160), refresh rate indicators (such as 60Hz, 120Hz), color format indicators (such as RGB4:4:4, YCbCr 4:2:2), color depth indicators (such as 8-bit, 10-bit), audio format indicators (such as LPCM 2.0, Dolby Atmos), and high dynamic range image indicators (such as HDR10, Dolby Vision).

[0061] Step B02: Adjust the target feature index in the display feature index based on the preset capability constraints of the multi-port switch to obtain the composite capability information. The target feature index is the display feature index that exceeds the preset capability constraints. The preset capability constraints are used to characterize the processing limit of the multi-port switch. The composite capability information is the display feature index that adapts to the preset capability constraints.

[0062] It should be noted that target characteristic indicators refer to specific indicators that exceed the preset capability constraints of the multi-port switcher among all display characteristic indicators. Processing limits refer to the maximum capability boundary that the internal hardware of the multi-port switcher (including single-chip multi-protocol cross-switching chips, circuit board traces, interface physical layers, etc.) can withstand during signal processing. Examples include: maximum pixel clock frequency (e.g., 600MHz), maximum transmission bandwidth (e.g., 18Gbps), supported color format set (e.g., only supporting RGB 4:4:4 and YCbCr 4:2:2, not supporting YCbCr 4:2:0), supported color depth range (e.g., only supporting 8-bit and 10-bit, not supporting 12-bit), and a list of supported audio formats.

[0063] For example, each display feature indicator in the capability description is compared one by one with preset capability constraints to identify target feature indicators that exceed the constraints. For instance, if the display device supports 4K@120Hz (requiring a pixel clock of approximately 594MHz), but the switcher's maximum pixel clock is only 600MHz and its bandwidth is limited, actually only supporting 4K@60Hz, then 4K@120Hz is a target feature indicator that exceeds the constraints. Similarly, if the display device supports 10-bit color depth, but the switcher only supports 8-bit, then 10-bit color depth is a target feature indicator. These target feature indicators are then adjusted: 4K@120Hz is reduced to 4K@60Hz, 10-bit color depth is reduced to 8-bit, and color or audio formats that exceed the supported range are removed. The adjusted results are converted to EDID format to obtain composite capability information, which is a set of display feature indicators adapted to the preset capability constraints.

[0064] Step S12: Adjust the synthesized capability information based on the target port switching mode to obtain capability rewriting information.

[0065] In one feasible implementation, step S12 includes steps B11-B12: Step B11: When the target port switching mode is the same protocol switching mode, the synthesized capability information is converted into a format compatible with the first protocol type corresponding to the target input terminal to obtain capability rewriting information, wherein the target input terminal is associated with the target output terminal. For example, when the target port switching mode is the same protocol switching mode, a format conversion operation is performed. Since the synthesized capability information is generated based on the display capabilities of the target output, its internal expression is closer to the data structure of the output protocol (e.g., stored using the DP display capability data structure). To ensure it can be correctly recognized by the source device connected to the target input, the synthesized capability information needs to be converted from the expression method of the output protocol to a format compatible with the target input protocol. For example, if the target input is an HDMI interface, the synthesized capability information is encapsulated into an Extended Display Identifier data block structure conforming to the HDMI interface specification; if the target input is a DP interface protocol, it is encapsulated into a display capability data structure conforming to the DP interface protocol specification. The converted capability rewriting information and the synthesized capability information remain consistent in capability content, only changing the data format and protocol encapsulation method.

[0066] Step B12: When the target port switching mode is cross-protocol switching mode, adjust the synthesized capability information based on the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal to obtain capability rewriting information.

[0067] In one feasible implementation, step B12, the step of adjusting the synthesis capability information based on the first protocol type corresponding to the target input and the second protocol type corresponding to the target output, includes steps B21 to B23: Step B21: Determine the common protocol index of the target input terminal and the target output terminal based on the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal; It should be noted that shared protocol metrics refer to display capability dimensions that exist simultaneously between the first protocol type and the second protocol type and can be mapped to each other. The shared protocol metrics can be extracted by taking the intersection of the capability metrics of the first and second protocol types. For example, both the first display interface protocol and the high-definition multimedia interface protocol support describing 3840×2160 resolution, 60Hz refresh rate, and RGB 4:4:4 color format; these are shared protocol metrics.

[0068] For example, a comparative analysis of the two protocol systems represented by the first and second protocol types identifies common indicator dimensions that correspond to each other at the capability description level. These common protocol indicators refer to capability parameters that both protocols possess and can map to each other, including but not limited to video timing capabilities (such as the combination of resolution and refresh rate), color format capabilities (such as RGB and YCbCr sampling methods), color depth capabilities (such as bits per pixel), high dynamic range image capabilities (such as HDR metadata format), and audio format capabilities (such as the number of channels and encoding format). For example, if the target input is a DP source device, its capability expression may include unique parameters such as link rate and number of channels, while the target output is an HDMI display device, its capability expression includes the timing descriptor block specified by EDID. Through protocol parsing, it is determined that the common capability indicators that need to be kept consistent during the conversion process are resolution set, color format type, color depth value, and audio format, while DP-specific link training parameters are excluded from the common indicators. This solves the problem of clarifying which capability dimensions can be mapped between the two protocols in cross-protocol conversion, providing a precise target for subsequent adjustments.

[0069] Step B22: Adjust the range of each indicator in the synthetic capability information based on the shared protocol indicators so that the adjusted synthetic capability information meets the shared protocol indicators. It should be noted that the index range refers to the specific set or range of values ​​corresponding to each common protocol index. For example, the index range of the resolution index is all resolution modes supported by the display device (such as 640×480, 1280×720, 1920×1080, 3840×2160, etc.).

[0070] For example, based on the actual achievable capability of the switching chip when performing cross-protocol conversion between the first and second protocol types, the range of parameters belonging to common protocol indicators in the synthesis capability information is constrained and adjusted. The adjustment operations specifically include: limiting video timing within the range allowed by the conversion link bandwidth, for example, removing high-resolution or high-refresh-rate modes that exceed bandwidth limits in the synthesis capability information; constraining high-bandwidth color formats to lower-bandwidth formats supported by the conversion chip, for example, downgrading RGB 4:4:4 to YCbCr 4:2:0; reducing color depth values ​​to the number of bits supported by the conversion chip, for example, reducing 10 bits to 8 bits; and removing high dynamic range image or audio formats, removing types not supported by the conversion chip. This solves the problem of limited conversion link capability and inability to transmit all the capabilities of the display device in cross-protocol scenarios, ensuring that every indicator in the adjusted synthesis capability information is within the processing range of the conversion chip.

[0071] Step B23: Map the capability representation of the adjusted synthetic capability information to a capability representation that matches the target input to obtain capability rewriting information.

[0072] It's important to note that capability representation refers to the data structures and encoding standards used by different protocols to describe display capabilities. For example, DisplayPort uses its own unique display capability data structures (such as specific implementations of DisplayID or EDID), while HDMI uses an extended display identifier data structure conforming to the CTA-861 standard. Although these two representations may semantically describe the same capability metrics (such as resolution and refresh rate), they differ significantly in data format, field definitions, and encoding methods.

[0073] For example, the adjusted synthetic capability information is converted from the capability expression of the second protocol type to the capability expression of the first protocol type, so that it can be correctly identified and parsed by the source device connected to the target input. This mapping operation includes two aspects: data structure conversion and semantic mapping. At the data structure level, the standard capability data block format of the second protocol type (such as the extended display identifier data structure of the High Definition Multimedia Interface) is converted into the standard capability data block format of the first protocol type (such as the display capability data structure of the first display interface protocol). At the semantic level, the parameter definitions and value ranges of the second protocol type are mapped to the equivalent expressions of the first protocol type. For example, the adjusted synthesis capability information includes capabilities such as 4K@60Hz, YCbCr 4:2:0, 8-bit color depth, and LPCM audio. These capabilities are mapped from the extended display identifier data format of the High Definition Multimedia Interface (HDMI) to the display capability data structure of the First Display Interface Protocol (DIMP). Specifically, the 4K@60Hz timing is converted into the main link rate and channel number configuration parameters of the DIMP, the color format and color depth are converted into the color format field of the DIMP, and the audio format is converted into the audio capability description block of the DIMP. Finally, capability rewriting information that can be recognized by the source device of the DIMP is generated. This solves the problem that the source end cannot parse the output capability information after cross-protocol conversion. Precise protocol mapping ensures that the source end can correctly understand and adopt the constrained capability parameters, thereby outputting signals that meet the requirements of the conversion link and the display device.

[0074] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 7 , Figure 7A flowchart illustrating the EDID rewriting process is provided, demonstrating the complete processing flow from triggering conditions to final delivery to the source. The process begins with triggering conditions, including display device access, output protocol changes, or switching to a new input source. Then, the output port protocol type (Type[OUT]) is determined: if it's HDMI, the EDID is read via DDC, and SCDC is read if necessary; if it's DP, the DPCD is read via AUX, and extended display identifier data is read via an auxiliary channel in I2C-over-AUX mode. The read information is parsed into an internal capability structure, including parameters such as resolution, refresh rate, color depth, color, HDR, and audio. Based on this, local capabilities and policy constraints are superimposed, including bandwidth limitations, conversion capability boundaries, and compatibility policies. Finally, it is determined whether a cross-protocol switching mode is in effect, i.e., whether the target input protocol type (Type[IN]) and the output protocol type (Type[OUT]) are consistent. If it's a same-protocol switch, same-protocol capability data is generated, including mode, color, color depth, HDR, and audio fields. If it's a cross-protocol switch, cross-protocol capability mapping is rewritten, mapping the capability representations of the HDMI and DP sides to each other, removing incompatible items if necessary, and generating the EDID for the HDMI side or the DPCD and EDID for the DP side. Finally, the generated capability data is written to the input port simulation data, updating the EDID_EMU (Extended Display Identifier Data Simulation Cache) at the input end, and optionally updating the DPCD_EMU (DPCD Simulation Cache). This is triggered by the source-side HPD gating, causing the source end to reread the EDID, retrain, or re-handshake.

[0075] In this embodiment, by comparing the protocol specifications of the first protocol type and the second protocol type, common capability indicators supported by both are identified, which solves the problem of incompatibility in cross-protocol scenarios due to differences in protocol capability sets, and provides a clear range of indicators for subsequent adjustments. Based on the actual achievable capabilities of the switching chip during cross-protocol conversion, the range of each common indicator in the synthesized capability information is constrained, which solves the problem that the source end may output signals exceeding the processing limits of the conversion link, ensuring that the adjusted capabilities strictly adapt to the hardware limits of the link. The adjusted capabilities are mapped from the expression of the second protocol type to a format recognizable by the first protocol type, which solves the problem that the source end cannot correctly parse capability constraints due to differences in protocol semantics.

[0076] For example, to aid in understanding the technical concept or principles of this application, please refer to Figure 8 , Figure 8A flowchart of the port switching method is provided, illustrating the complete switching control process from initialization to entering the running state. After system startup, initialization is performed first, acquiring the protocol types Type[INi] and Type[OUT] of each input port IN1 to INn and the output port OUT, and initializing the EDID / DPCD simulation area and state machine. Then, it enters a waiting state for switching commands, receiving user commands via buttons, remote control, or host computer to select the target input. For the target source, the HPD gating window is entered, disabling the hot-plug detection signal and maintaining it for a first duration. The path is configured according to the target input protocol type Type[IN] and the output protocol type Type[OUT]. For the same protocol, a direct path is configured; for cross-protocols, bidirectional conversion between DP and HDMI is enabled. The display capabilities are read; if the output is HDMI, the EDID is read via DDC and can be selected. Read SCDC; if the output is DP, read DPCD and EDID via AUX; synthesize capability information and apply policy constraints, including bandwidth limits, conversion boundaries, and compatibility policies; generate and write simulation data to the input source, update EDID_EMU[IN], and optionally update DPCD_EMU[IN]; exit the hot-plug detection signal gating window, trigger the source end to reread or retrain via HPD pulse or window release; determine if the path involves a DP link, if so, trigger and monitor DP link training, retry or rollback if it fails, otherwise perform HDMI handshake management, including DDC / SCDC / HDCP, etc.; perform stability detection, and re-execute gating, retraining, or handshake if abnormal; finally enter the running state and complete the switch.

[0077] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the port switching method of this application. Any simple modifications based on this technical concept are within the protection scope of this application.

[0078] This application also provides a port switching device, please refer to... Figure 9 This is applied to a multi-port switch, which includes input ports and output ports. The port switching device includes: The mode determination module 10 is used to collect the identification pin level status of each input port and each output port, and determine the target port switching mode based on the received target port information and the identification pin level status. The target port information is used to determine the target input terminal and the target output terminal. The information rewriting module 20 is used to adjust the display capability information of the target output terminal based on the target port switching mode to obtain capability rewriting information, wherein the capability rewriting information is determined by the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal; The data output module 30 is used to transmit capability rewriting information to the target input terminal so that the target input terminal rewrites the input data according to the capability rewriting information, obtains output data, and sends it to the target output terminal. The input data conforms to the first protocol type, and the output data conforms to the second protocol type.

[0079] The port switching device provided in this application, employing the port switching method in the above embodiments, can solve the technical problem of poor compatibility. Compared with the prior art, the beneficial effects of the port switching device provided in this application are the same as those of the port switching method provided in the above embodiments, and other technical features in the port switching device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.

[0080] This application provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the port switching method in Embodiment 1 above.

[0081] The following is for reference. Figure 10 The diagram illustrates a structural schematic of an electronic device suitable for implementing embodiments of this application. The electronic devices in these embodiments may include, but are not limited to, mobile terminals such as mobile phones, laptops, and PADs (Portable Application Description: Tablet computers), as well as fixed terminals such as digital TVs and desktop computers. Figure 10 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0082] like Figure 10As shown, the electronic device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory 1002 or a program loaded from a storage device 1003 into a random access memory 1004. The random access memory 1004 also stores various programs and data required for the operation of the electronic device. The processing unit 1001, the read-only memory 1002, and the random access memory 1004 are interconnected via a bus 1005. An input / output interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, touchscreens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. The communication device 1009 allows the electronic device to communicate wirelessly or wiredly with other devices to exchange data. Although the diagrams show electronic devices with various systems, it should be understood that it is not required to implement or have all of the systems shown. More or fewer systems may be implemented alternatively.

[0083] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from read-only memory 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.

[0084] The electronic device provided in this application, employing the port switching method described in the above embodiments, can solve the technical problem of poor compatibility. Compared with the prior art, the beneficial effects of the electronic device provided in this application are the same as those of the port switching method provided in the above embodiments, and other technical features of the electronic device are the same as those disclosed in the method of the previous embodiment, and will not be repeated here.

[0085] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.

[0086] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

[0087] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the port switching method in the above embodiments.

[0088] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.

[0089] The aforementioned computer-readable storage medium may be included in an electronic device or may exist independently without being assembled into an electronic device.

[0090] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by an electronic device, they cause a port switching device to be applied to a multi-port switcher. The multi-port switcher includes input ports and output ports. It is capable of acquiring the identification pin level states of each input port and each output port, determining a target port switching mode based on the received target port information and the identification pin level states, wherein the target port information is used to determine the target input terminal and the target output terminal; adjusting the display capability information of the target output terminal based on the target port switching mode to obtain capability rewriting information, wherein the capability rewriting information is determined by a first protocol type corresponding to the target input terminal and a second protocol type corresponding to the target output terminal; transmitting the capability rewriting information to the target input terminal so that the target input terminal rewrites the input data according to the capability rewriting information, obtaining output data and sending it to the target output terminal, wherein the input data conforms to the first protocol type and the output data conforms to the second protocol type.

[0091] Computer program code for performing the operations of this application can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a Local Area Network (LAN) or a Wide Area Network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0092] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0093] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.

[0094] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described port switching method, thereby solving the technical problem of poor compatibility. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the port switching method provided in the above embodiments, and will not be repeated here.

[0095] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the port switching method described above.

[0096] The computer program product provided in this application can solve the technical problem of poor compatibility. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as the beneficial effects of the port switching method provided in the above embodiments, and will not be repeated here.

[0097] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.

Claims

1. A port switching method, characterized in that, Applied to a multi-port switch, the multi-port switch including input ports and output ports, the port switching method includes: The identification pin level status of each input port and each output port is collected, and the target port switching mode is determined based on the received target port information and the identification pin level status, wherein the target port information is used to determine the target input terminal and the target output terminal; Based on the target port switching mode, the display capability information of the target output terminal is adjusted to obtain capability rewriting information, wherein the capability rewriting information is determined by the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal; The capability rewriting information is transmitted to the target input terminal so that the target input terminal rewrites the input data according to the capability rewriting information, obtains output data, and sends it to the target output terminal, wherein the input data conforms to the first protocol type and the output data conforms to the second protocol type.

2. The port switching method as described in claim 1, characterized in that, The step of determining the target port switching mode based on the received target port information and the identified pin level status includes: Determine the target input and target output based on the received target port information; The first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal are determined by the identification pin level state; Determine whether the first protocol type and the second protocol type are consistent, and determine the target port switching mode based on the determination result.

3. The port switching method as described in claim 2, characterized in that, The target port switching modes include same-protocol switching mode and cross-protocol switching mode; The steps for determining the target port switching mode based on the judgment result include: If the determination result is that the first protocol type and the second protocol type are the same, the target port switching mode is determined to be the same protocol switching mode; If the determination result is that the first protocol type and the second protocol type are inconsistent, the target port switching mode is determined to be a cross-protocol switching mode.

4. The port switching method as described in claim 1, characterized in that, The step of adjusting the display capability information of the target output terminal based on the target port switching mode to obtain capability rewriting information includes: Obtain the display capability information of the target output terminal, and generate composite capability information based on the display capability information and the preset capability constraints of the multi-port switch; The synthesized capability information is adjusted based on the target port switching mode to obtain capability rewriting information.

5. The port switching method as described in claim 4, characterized in that, The step of generating composite capability information based on the display capability information and the preset capability constraints of the multi-port switch includes: The display capability information is converted into a capability description, wherein the capability description is used to characterize the display feature indicators of the target output terminal; Based on the preset capability constraints of the multi-port switcher, the target feature index in the display feature index is adjusted to obtain the synthesized capability information. The target feature index is a display feature index that exceeds the preset capability constraints. The preset capability constraints are used to characterize the processing limit of the multi-port switcher. The synthesized capability information is a display feature index that adapts to the preset capability constraints.

6. The port switching method as described in claim 4, characterized in that, The step of adjusting the synthesized capability information based on the target port switching mode to obtain capability rewriting information includes: When the target port switching mode is the same protocol switching mode, the synthesized capability information is converted into a format compatible with the first protocol type corresponding to the target input terminal to obtain capability rewriting information, wherein the target input terminal is associated with the target output terminal; When the target port switching mode is a cross-protocol switching mode, the synthesized capability information is adjusted based on the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal to obtain capability rewriting information.

7. The port switching method as described in claim 6, characterized in that, The step of adjusting the synthesis capability information based on the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal includes: The common protocol index of the target input terminal and the target output terminal is determined based on the first protocol type corresponding to the target input terminal and the second protocol type corresponding to the target output terminal; The range of each indicator in the synthetic capability information is adjusted based on the shared protocol indicators so that the adjusted synthetic capability information meets the shared protocol indicators. The capability representation of the adjusted synthetic capability information is mapped to a capability representation that matches the target input to obtain capability rewriting information.

8. An electronic device, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the port switching method as described in any one of claims 1 to 7.

9. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the port switching method as described in any one of claims 1 to 7.

10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps of the port switching method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • HDMI and DP compatible interface circuit

    CN107302677A

  • Video interface conversion device and method

    TW202126021A

  • Apparatus and method for switching and converting video signals

    US20190373211A1

  • Display device without HDMI interface and method for enabling type interface to be compatible with HDMI

    WO2022151769A1