Data transmission methods for electronic devices, electronic devices and interface circuits

By employing a bidirectional interface and signal level detection technology in electronic devices, the function of simultaneously inputting and outputting video data on a single interface is achieved, solving the problems of interface complexity and misoperation in existing technologies, and improving the ease of use and accuracy of the equipment.

CN114911729BActive Publication Date: 2025-10-31HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202110186512.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-10
Publication Date
2025-10-31
Estimated Expiration
2041-02-10

AI Technical Summary

Technical Problem

Existing video transmission interfaces can only be used as video data input or output individually, which means that devices need to be equipped with multiple interfaces when they need to perform input and output simultaneously, resulting in a complex structure and a high risk of misoperation.

Method used

It adopts a bidirectional interface, which automatically identifies the type of peer device by detecting the signal level status on the interface, and realizes multiplexing of sending and receiving on a single interface, including role negotiation and switching processes, to ensure interface function matching.

Benefits of technology

It simplifies the device structure, reduces the probability of user misoperation, and improves the accuracy of device type identification and function matching.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114911729B_ABST
    Figure CN114911729B_ABST
Patent Text Reader

Abstract

This application relates to the terminal field and provides a data transmission method, electronic device, and interface circuit for an electronic device. The method includes: after inserting a bidirectional interface into the peer device, determining the device type of both the peer device and the electronic device. If the device type of the electronic device is determined to be a receiving device, multimedia data sent by the peer device is transmitted to the display receiving processor of the electronic device through the bidirectional interface. If the device type of the electronic device is determined to be a source device, multimedia data generated by the display transmitting processor on the electronic device is transmitted to the peer device through the bidirectional interface. This multiplexing of display transmission and reception on a single bidirectional interface results in a simpler structure and reduces the probability of user error.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more particularly to a data transmission method, electronic device, and interface circuit for an electronic device. Background Technology

[0002] With the increasing variety of forms of electronic products, they frequently exchange video data via video interfaces. For example, a laptop can connect to a large-screen device, transmitting its user interface as video data to the large screen for display. Alternatively, a laptop can connect to a mobile phone, receiving video data of the phone's user interface and displaying it on the laptop's screen.

[0003] Existing video transmission interfaces can often only be used for either video data input or output. When a device supports both video data input and output, multiple video interfaces are required, each used for either purpose. This results in a complex structure and is prone to misoperation. Summary of the Invention

[0004] This application provides a data transmission method, electronic device, and interface circuit for an electronic device, which can solve the problem that when a device needs both video data input and video data output, separate video input ports and video output ports must be set up, resulting in a complex structure and a high risk of misoperation.

[0005] In a first aspect, embodiments of this application provide a data transmission method for an electronic device, the electronic device including a bidirectional interface for receiving and transmitting multimedia data.

[0006] The method includes: after the peer device inserts a bidirectional interface, determining the device type of the peer device and the device type of the electronic device. After determining that the device type of the electronic device is a receiving device, sending multimedia data transmitted by the peer device to the display receiving processor of the electronic device through the bidirectional interface. After determining that the device type of the electronic device is a source device, sending multimedia data generated by the display transmitting processor on the electronic device to the peer device through the bidirectional interface.

[0007] The electronic devices (local device) and remote devices can include mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), large-screen devices, and other devices with multimedia data transmission and reception capabilities. For example, when the electronic device is a large-screen device, the remote device can be a mobile phone, laptop, or tablet. The bidirectional interface can be used for bidirectional data or power transmission. The data transmitted via the bidirectional interface can include multimedia data, such as video data, audio data, or audio-visual data.

[0008] In the first aspect, the data transmission method of the electronic device can identify whether the connected device is a receiving device or a source device. Based on the type of connected device, it connects the receiving device to the display transmitting processor or the source device to the display receiving processor. Multiplexing of display transmitting and receiving on a single bidirectional interface simplifies the structure and reduces the probability of user error.

[0009] In some embodiments, the method further includes: after determining that the device type of the electronic device is a receiving device, connecting the bidirectional interface to a display receiving processor. After determining that the device type of the electronic device is a source device, connecting the bidirectional interface to a display transmitting processor. In this application, by connecting the bidirectional interface to a display receiving processor or a display transmitting processor, the function of the bidirectional interface is changed, and multiplexing of display transmitting and display receiving is achieved on a single bidirectional interface.

[0010] In some implementations, determining the device type of the peer device and the device type of the electronic device includes: determining the device type of the peer device based on signals transmitted on the bidirectional interface; and determining the device type of the electronic device based on the device type of the peer device.

[0011] In some implementations, the bidirectional interface is a Universal Serial Bus Type-C interface.

[0012] Based on the signals transmitted on the bidirectional interface, the device type of the peer device is determined, including: detecting the voltage levels of the pins on the bidirectional interface; determining the device type based on the pin voltage levels; where a high voltage level indicates the peer device is a source device; a low voltage level indicates the peer device is a receiver device; and a switching voltage level between high and low indicates the peer device is a dual-role port device. By determining the device type of the peer device through the voltage levels of the pins in the Type-C interface, and thus the device type of the electronic device, automatic device type detection is achieved, making it easier to multiplex display transmission and reception on a single bidirectional interface.

[0013] In some implementations, determining the device type of the electronic device based on the device type of the peer device includes: when the peer device is a source device, determining the electronic device as a receiving device; when the peer device is a receiving device, determining the electronic device as a source device; and when the peer device is a dual-role port device, determining the device types of the electronic device and the peer device through a role negotiation process or a role switching process. Determining the device types of the electronic device and the peer device through a role negotiation process or a role switching process when the peer device is a dual-role port device allows for a more accurate confirmation of the expected device type of the peer device, thereby adjusting the device type of the electronic device to ensure a more accurate match between the electronic device and the peer device and reducing the probability of configuration errors.

[0014] In some implementations, before determining the device types of the electronic device and the peer device through a role negotiation process or a role switching process, the method further includes: determining the initial device type of the electronic device as the source device.

[0015] In some implementations, after determining the initial device type of the electronic device as the source device, the method further includes: obtaining information on whether the peer device supports displaying an uplink port through a bidirectional interface; and for peer devices that support displaying an uplink port, initiating a role negotiation process or a role switching process. Peer devices that do not support displaying an uplink port cannot send or receive video data. Initiating the role negotiation process or role switching process only for peer devices that support displaying an uplink port can exclude peer devices that cannot be used for video data transmission, reducing unnecessary pairing procedures.

[0016] In some implementations, after determining the initial device type of the electronic device as the source device, the method further includes: obtaining at least one of the following through a bidirectional interface: supplier information, manufacturer information, device type preference information, and device function information of the peer device; determining, based on the obtained information, whether the peer device and the electronic device are the same device; if they are the same, performing a role negotiation process; if they are different, performing a role switching process. By obtaining the VID / SVID and PID of the peer device, it is possible to more accurately determine whether to perform a role negotiation process or a role switching process based on the physical properties of the device.

[0017] In some implementations, the role negotiation process includes: displaying a query message on the electronic device to obtain the final device type of the electronic device; and setting the final device type of the peer device based on the final device type of the electronic device. The role switching process includes: sending a role switching request message to the peer device; and setting the final device types of both the peer device and the electronic device based on the response message from the peer device. The role negotiation process allows the final device type of the electronic device to be obtained, thereby determining the final device type of the peer device. Conversely, determining the final device types of both the peer device and the electronic device through the role switching process allows for a more accurate acquisition of the expected device type of the peer device, thus enabling the setting of the final device type of the electronic device. Both the role negotiation and role switching processes can make the matching between the electronic device and the peer device more accurate, reducing the probability of configuration errors.

[0018] In some implementations, the bidirectional interface is also used for bidirectional charging.

[0019] Secondly, embodiments of this application provide a data transmission device for an electronic device, the electronic device including a bidirectional interface for receiving and transmitting multimedia data.

[0020] The device includes: a determining module for determining the device type of the peer device and the device type of the electronic device after the peer device inserts a bidirectional interface; a transmitting module for transmitting multimedia data sent by the peer device to the display receiving processor of the electronic device via the bidirectional interface after determining that the device type of the electronic device is a receiving device; and a transmitting module further for transmitting multimedia data generated by the display transmitting processor on the electronic device to the peer device via the bidirectional interface after determining that the device type of the electronic device is a source device.

[0021] In some embodiments, the device further includes a connection module for connecting the bidirectional interface to a display receiving processor after determining that the device type of the electronic device is a receiving device, and connecting the bidirectional interface to a display transmitting processor after determining that the device type of the electronic device is a source device.

[0022] In some implementations, the determining module is specifically used to determine the device type of the peer device based on the signals transmitted on the bidirectional interface. The device type of the electronic device is then determined based on the device type of the peer device.

[0023] In some implementations, the bidirectional interface is a Universal Serial Bus Type-C interface.

[0024] The determination module is specifically used to detect the voltage level of the pins on the bidirectional interface and determine the device type of the peer device based on the voltage level of the pins. When the voltage level of the pin is high, the peer device is the source device; when the voltage level of the pin is low, the peer device is the receiver device; when the voltage level of the pin switches between high and low, the peer device is a dual-role port device.

[0025] In some implementations, the determination module is specifically used to determine the electronic device as the receiving device when the peer device is the source device. When the peer device is the receiving device, the electronic device is determined as the source device. When the peer device is a dual-role port device, the device types of the electronic device and the peer device are determined through a role negotiation process or a role switching process.

[0026] In some implementations, the determining module is also used to determine the initial device type of the electronic device as a source device.

[0027] In some implementations, the determining module is also used to obtain information on whether the peer device supports displaying the uplink port through a bidirectional interface, and to initiate a role negotiation process or a role switching process for peer devices that support displaying the uplink port.

[0028] In some implementations, the determining module is further configured to obtain at least one of the following through a bidirectional interface: supplier information, manufacturer information, device type preference information, and device function information of the peer device; determine whether the peer device and the electronic device are the same device based on the obtained information; if they are the same, perform a role negotiation process; if they are different, perform a role switching process.

[0029] In some implementations, the role negotiation process includes: displaying a query message on the electronic device to obtain the final device type of the electronic device; and setting the final device type of the peer device based on the final device type of the electronic device. The role switching process includes: sending a role switching request message to the peer device; and setting the final device types of both the peer device and the electronic device based on the response message from the peer device.

[0030] In some implementations, the bidirectional interface is also used for bidirectional charging.

[0031] Thirdly, embodiments of this application provide an electronic device, which includes a bidirectional interface, a controller, a display receiving processor, and a display transmitting processor. The bidirectional interface includes pins for connecting to a peer device inserted into the bidirectional interface. The controller is used to determine the device type of the peer device and the device type of the electronic device. After determining that the device type of the electronic device is a receiving device, the controller sends multimedia data sent by the peer device to the display receiving processor of the electronic device through the bidirectional interface. After determining that the device type of the electronic device is a source device, the controller sends multimedia data generated by the display transmitting processor of the electronic device to the peer device through the bidirectional interface. The display receiving processor is used to perform display processing on the received multimedia data. The display transmitting processor is used to process the obtained multimedia data.

[0032] In some embodiments, the electronic device also includes a switch module, which is used to connect the bidirectional interface to the display receiving processor after determining that the device type of the electronic device is a receiving device, and to connect the bidirectional interface to the display transmitting processor after determining that the device type of the electronic device is a source device.

[0033] In some implementations, the switch module includes a first switch, a second switch, and a third switch. The first switch is connected to the display transmitting processor, the second switch is connected to the display receiving processor, and the third switch is connected to a pin. After determining that the device type of the electronic device is a receiving device, the controller controls the second switch and the third switch to connect. After determining that the device type of the electronic device is a source device, the controller controls the first switch and the third switch to connect.

[0034] In some implementations, a controller is used to detect the voltage level of a pin on a bidirectional interface, determine the device type of the peer device based on the voltage level of the pin, and determine the device type of the electronic device based on the device type of the peer device.

[0035] In some implementations, the electronic device also includes a power module connected to pins; the controller is also used to control the power module to charge the peer device.

[0036] In some implementations, the power module is also used to receive power transmitted from the peer device via a bidirectional interface.

[0037] In some implementations, the bidirectional interface is a Universal Serial Bus Type-C interface or a Lightning interface.

[0038] In some implementations, the controller that detects the level state of the first pin on the bidirectional interface is a power transmission controller.

[0039] Fourthly, embodiments of this application provide an interface circuit for use on an electronic device, comprising an interface module, a switch module, and a controller. The interface module includes pins for connecting to a peer device that inserts a bidirectional interface. The controller determines the device type of the peer device and the device type of the electronic device. After determining that the electronic device is a receiving device, the controller connects the interface module to the display receiving processor of the electronic device via the switch module. After determining that the electronic device is a source device, the controller connects the interface module to the display transmitting processor of the electronic device via the switch module.

[0040] In some implementations, the switch module includes a first switch, a second switch, and a third switch. The first switch is connected to a display transmitting processor, the second switch is connected to a display receiving processor, and the third switch is connected to a pin. After determining that the electronic device is a receiving device, the controller controls the second switch and the third switch to connect; after determining that the electronic device is a source device, the controller controls the first switch and the third switch to connect.

[0041] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method provided in the first aspect.

[0042] Sixthly, embodiments of this application provide a computer program product that, when run on a terminal device, causes the terminal device to execute the method provided in the first aspect.

[0043] In a seventh aspect, embodiments of this application provide a chip system including a memory and a processor, wherein the processor executes a computer program stored in the memory to implement the method provided in the first aspect.

[0044] Eighthly, embodiments of this application provide a chip system including a processor coupled to a computer-readable storage medium provided in the fourth aspect. The processor executes a computer program stored in the computer-readable storage medium to implement the method provided in the first aspect.

[0045] It is understood that the beneficial effects of aspects two through eight above can be found in the relevant descriptions in aspect one above, and will not be repeated here. Attached Figure Description

[0046] Figure 1 A schematic diagram illustrating an application scenario of a data transmission method for an electronic device provided in this application embodiment;

[0047] Figure 2 This is a pin diagram of a Type-C interface;

[0048] Figure 3 A circuit diagram of the interface circuit provided in the embodiments of this application;

[0049] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;

[0050] Figure 5 A schematic flowchart illustrating a data transmission method for an electronic device provided in an embodiment of this application;

[0051] Figure 6 A schematic diagram of the structure of a data transmission device for an electronic device provided in an embodiment of this application;

[0052] Figure 7 A schematic diagram of the structure of a data transmission device for another electronic device provided in an embodiment of this application;

[0053] Figure 8 This is a schematic diagram of the structure of another electronic device provided in an embodiment of this application. Detailed Implementation

[0054] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.

[0055] It should be understood that the term "and / or" as used in this application specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0056] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection."

[0057] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0058] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0059] Figure 1 A schematic diagram of an electronic device connection scenario is shown. Electronic devices may include mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), etc. This application does not impose any restrictions on the specific type of electronic device.

[0060] refer to Figure 1 The system includes a smartphone 11, a laptop 12, and a monitor 13. The smartphone 11 can be connected to the laptop 12 via a data cable 14, and the laptop 12 can be connected to the monitor 13 via a data cable 14. When connected to the smartphone 11, the laptop 12 can act as a video input device, while the smartphone 11 acts as a video output device. The laptop 12 receives and displays the interface video data sent by the smartphone 11.

[0061] Alternatively, when the laptop 12 is connected to the monitor 13, it can function as a video output device, and the monitor 13 can function as a video input device. The laptop 12 sends its interface to the monitor 13 in the form of video data, and the monitor 13 displays the interface of the laptop 12.

[0062] In the prior art, when a laptop 12 is used as a video input device, it can use a High Definition Multimedia Interface (HDMI), a Type-C interface, or a DisplayPort (DP) as a video data input port. When the laptop 12 is used as a video output device, it will use different interfaces such as HDMI, Type-C, or DP as video data output ports.

[0063] When using the aforementioned electronic devices, if the display input port and display transmission port are of the same type (e.g., both are Type-C interfaces or both are DP interfaces), it may be impossible to accurately distinguish the function of each interface, resulting in situations where the data cable connected to the source device is inserted into the display transmission port, or the data cable connected to the receiving device is inserted into the display input port.

[0064] To address this, this application provides a data transmission method for an electronic device, an electronic device, and an interface circuit. This method can identify whether the connected device is a receiving device or a source device, and connect the receiving device to a display transmitting module or the source device to a display receiving module based on the type of the connected device. By implementing display transmitting and receiving multiplexed on a single interface, the structure is simplified, reducing the probability of user error.

[0065] It should be noted that although the data transmission method for electronic devices provided in this application is illustrated using bidirectional transmission of video data in multimedia data as an example, those skilled in the art should understand that bidirectional charging, bidirectional video signal transmission, bidirectional audio signal transmission, and other bidirectional transmissions implemented based on the data transmission method for electronic devices of this application are all within the scope of protection of this application.

[0066] This application also provides a bidirectional interface for realizing the aforementioned bidirectional signal or data transmission. The bidirectional interface described in this application refers to an interface capable of bidirectional transmission such as bidirectional charging, bidirectional video signal transmission, and bidirectional audio signal transmission. In some embodiments, the bidirectional interface of the electronic device provided in this application can be a Universal Serial Bus Type-C (Type-C) interface or a Lightning port. When the bidirectional interface is a Type-C interface, video data can be transmitted via DP1.2, DP1.4, or DP2.0 protocols.

[0067] In this embodiment, the bidirectional interface is described using the Type-C interface (female port) as an example.

[0068] Reference Figure 2 , Figure 2The diagram shows the pinout of a Type-C interface. The Type-C interface includes two symmetrically arranged sets of pins, allowing data cables to be inserted in any orientation without needing to distinguish between the correct orientation; it works correctly regardless of whether the data cable is plugged in correctly or incorrectly. When the electronic device (i.e., the local device) detects that a data cable connected to the remote device is plugged into the Type-C interface, it can determine the device type of the remote device by detecting the level states of Configuration Channel (CC) 1 and CC2 through the electronic device's power delivery (PD) controller. Device types can include sink devices (e.g., display receivers or video input devices) and source devices (e.g., display transmitters or video output devices). Device types can further include dual-role port (DRP) devices. DRP devices have a dual role, functioning as both sink and source devices.

[0069] For example, when the data cable connected to the peer device is plugged into the Type-C interface, if the peer device is a receiving device, the electronic device detects that the level states of CC1 and CC2 are low; if the peer device is a source device, the electronic device detects that the level states of CC1 and CC2 are high; if the peer device is a DRP device, the electronic device detects that the level states of CC1 and CC2 periodically switch between high and low levels.

[0070] It should be noted that the power transmission controller can also be used to detect the DP capability of the peer device. For example, the power transmission controller can send DP capability query commands to the peer device through CC1 and CC2 based on the power transmission protocol, and receive the DP capability information returned by the peer device.

[0071] DP capability includes whether the peer device supports DP video transmission and the channel mode during video data transmission. Video data transmission can include dual-channel mode (USB & DP mode) and quad-channel mode (DP ONLY mode). When the peer device supports dual-channel mode, refer to... Figure 2The Type-C interface shown includes data pins: a first transmit positive pin (TX1+), a first transmit negative pin (TX1-), a second transmit positive pin (TX2+), a second transmit negative pin (TX2-), a first receive positive pin (RX1+), a first receive negative pin (RX1-), a second receive positive pin (RX2+), and a second receive negative pin (RX2-). It should be noted that during data transmission, the data pins are divided into four groups based on whether they are for receiving or transmitting, and their polarity. For example, TX1+ and RX1- form one group, RX1+ and TX1- form another, TX2+ and RX2- form yet another, and RX2+ and TX2- form yet another. Each group of data pins can be used for both receiving and transmitting data.

[0072] When the peer device supports dual-channel mode, USB data signals (USB SS) can be transmitted via TX1+, RX1- and RX1+, TX1-, and two DP signals (DP Main Lane 1 and DP Main Lane 0) can be transmitted via TX2+, RX2- and RX2+, TX2- respectively. Since the Type-C interface is reversible, when the power transfer controller detects a match between the Type-C interface (female port) of the connected data cable and the Type-C interface (female port) of the electronic device via CC1 and CC2, no pin reversal is required, and the aforementioned pins can be used for the transmission of two DP signals and USB data signals. If the power transfer controller detects a mismatch between the Type-C interface of the connected data cable and the Type-C interface of the electronic device via CC1 and CC2, the Type-C pins need to be reversed. In this case, two DP signals can be transmitted via TX1+, RX1- and RX1+, TX1- respectively, and USB data signals can be transmitted via TX2+, RX2- and RX2+, TX2-.

[0073] When the peer device supports four-channel mode, two DP signals (DP Main Lane 2 and DP Main Lane 3) can be transmitted via TX1+, RX1- and RX1+, TX1- respectively, and two DP signals (DP Main Lane 1 and DP Main Lane 0) can be transmitted via TX2+, RX2- and RX2+, TX2- respectively. Similar to dual-channel mode, if the power transmission controller detects a need to toggle the Type-C pins via CC1 and CC2, two DP signals (DP Main Lane 1 and DP Main Lane 0) can be transmitted via TX1+, RX1- and RX1+, TX1- respectively, and two DP signals (DP Main Lane 2 and DP Main Lane 3) can be transmitted via TX2+, RX2- and RX2+, TX2- respectively.

[0074] It should be noted that when transmitting DP signals through the above pins, audio signals can also be transmitted through the sideband (SBU)1 and SBU2, enabling simultaneous transmission of audio and video.

[0075] In this embodiment, an electronic device is provided, whose bidirectional interface can be a Type-C interface. As an example, when the electronic device implements a data transmission method through a bidirectional interface, it can refer to... Figure 3 The circuit shown includes: a Type-C interface 21, a power module 22, a first controller 23, a second controller 24, a first switch 25, a second switch 26, a third switch 27, a display transmitting processor 28, and a display receiving processor 29. This circuit can be applied to electronic devices such as mobile phones, tablets, laptops, large-screen devices, etc., without limitation.

[0076] Among them, the first switch 25, the second switch 26, and the third switch 27 include, but are not limited to, digital switches, transistors (MOSFETs), bipolar junction transistors (BJTs), relays, etc.

[0077] Power modules include, but are not limited to, various voltage conversion modules such as buck converters, boost converters, buck-boost converters, and low-dropout regulators (LDOs).

[0078] The first controller includes, but is not limited to, embedded controllers (ECs), complex programmable logic devices (CPLDs), and field-programmable gate arrays (FPGAs). The second controller can be a power delivery controller; any processor capable of handling the PD protocol can serve as a power delivery controller.

[0079] It should be noted that the first controller and the second controller can also be implemented by a unified controller.

[0080] Display signal processors include, but are not limited to, central processing units (CPUs) and systems on chips (SOCs) capable of transmitting display signals.

[0081] Display receiver processors refer to any module that has the ability to receive and process DP signals, including but not limited to display processing chips (Scaler), timing controllers (Tcon), and other processors.

[0082] Display modules include, but are not limited to, liquid crystal displays (LCDs), micro light-emitting diode (micro LED) panels, organic light-emitting diode (OLED) panels, and other modules or devices with display functions.

[0083] refer to Figure 2 The pin diagram of the Type-C interface shown in the figure shows that the power module 22 is connected to the bus power (Vbus) pin 212 of the Type-C interface 21 and the first controller 23. When it is necessary to supply power to the other end device through the electronic device, the first controller 23 can control the power module 22 to supply power through the Vbus pin 212.

[0084] The second controller 24 is connected to the first controller 23 and the CC pin 213 of the Type-C interface 21 (i.e., Figure 2 As shown, CC1 and CC2 are connected. The second controller 24 can detect the level state of CC pin 213 to determine the device type of the peer device and obtain the DP capability of the peer device.

[0085] The display transmitting processor 28 includes a USB physical layer interface (USB PHY) 281 and a DP transmitting physical layer interface (DP TXPHY) 282. The first switch 25 is connected to both the USB physical layer interface 281 and the DP transmitting physical layer interface 282 of the display transmitting processor 28. The first switch 25 is also connected to a third switch 27 and a first controller 23.

[0086] The display receiver processor 29 includes a DP receiver physical layer interface (DPRX PHY) 291 and a display module 292 connected to the display receiver processor 29. A second switch 26 is connected to the DP receiver physical layer interface (DPRX PHY) 291 of the display receiver processor 29. The second switch 26 is also connected to a third switch 27 and a first controller 23.

[0087] The first controller 23 can control the on / off state of the first switch 25, the second switch 26 and the third switch 27 based on the device type and DP capability of the peer device obtained by the second controller 24, and set the electronic device as a receiving device or a source device.

[0088] As an example, if the peer device is determined to be the source device and the electronic device to be the receiver device, the path to DP TX PHY282 in the first switch 25 can be disconnected, and the second switch 26 and the third switch 27 can be connected to connect the data pins to DP RX PHY291. For example, if the peer device supports dual-channel mode, the TX1+, RX1- and RX1+, TX1- data pins can be connected to USB PHY281, and the TX2+, RX2- and RX2+, TX2- data pins can be connected to DP RX PHY291. Alternatively, if the peer device supports quad-channel mode, the path to USB PHY281 in the first switch 25 can also be disconnected, and the TX1+RX1-, RX1+TX1-, TX2+RX2-, and RX2+TX2- data pins can all be connected to DP RX PHY291.

[0089] In another example, if the peer device is determined to be the receiving device and the electronic device to be the source device, the second switch 26 can be disconnected, and the first switch 25 and the third switch 27 can be connected, connecting the data pins to the DP TX PHY282. For example, if the peer device supports dual-channel mode, the TX1+, RX1- and RX1+, TX1- data pins can be connected to the USB PHY281, and the TX2+, RX2- and RX2+, TX2- data pins can be connected to the DP TX PHY282. Alternatively, if the peer device supports quad-channel mode, the TX1+RX1-, RX1+TX1-, TX2+RX2-, and RX2+TX2- data pins can all be connected to the DP TXPHY282.

[0090] This application also provides a data transmission method for electronic devices, which can be applied to mobile phones, tablets, wearable devices, in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, smart screens, and other electronic devices. This application does not impose any limitations on the specific type of terminal device.

[0091] This explanation uses a mobile phone as an example. Figure 4 As shown, the electronic device may include components such as a processor 310, an audio module 320, a screen 330, a camera module 340, a storage module 350, an interface 360, a power module 370, an input module 380, and a communication module 390. Those skilled in the art will understand that... Figure 4 The terminal device structure shown does not constitute a limitation on the terminal device and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0092] The following is combined Figure 4 A detailed introduction to each component and module of the terminal device:

[0093] The processor 310 is the control center of the terminal device. The processor 310 may include a CPU 311 and a graphics processing unit (GPU) 332. The CPU 310 can connect to various parts of the terminal device using various interfaces and lines. It executes various functions and processes data by running or executing software programs and / or modules stored in the storage module 350, and by calling data stored in the storage module 350. The GPU 332 is a microprocessor capable of performing image and graphics-related calculations. The GPU 332 can take various forms; for example, it can be located in a graphics card, integrated into the CPU 311, or exist as a separate GPU chip.

[0094] When drawing and rendering images and graphics, the GPU draws or renders the images or graphics into a buffer. For a GPU integrated into a graphics card, the buffer is the integrated video memory (also called the frame buffer). For a GPU integrated into a CPU or existing as a separate GPU chip, the buffer can be a portion of the device's running memory, such as a portion of the random access memory (RAM).

[0095] In some implementations, CPU 311 may include one or more processing units. For example, it may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.

[0096] It should be noted that the display transmitting processor 333 and the display receiving processor 334 can be independent modules with display transmitting and receiving functions, or integrated into the GPU. Alternatively, they can be virtual processing modules with display transmitting and receiving functions implemented through the GPU; the specific implementation method is not limited here.

[0097] In some embodiments, a modem processor may also be integrated into the processor 310. The modem processor mainly processes data related to wireless communication. This application does not impose any limitations on this.

[0098] Audio module 320 is used to process audio signals. For example, audio module 320 can convert analog audio signals received by microphone 323 into digital audio data and send them to processor 310. Alternatively, it can convert digital audio data sent by processor 310 into analog signals that can be played by speaker 321 and receiver 322 and send them to speaker 321 or receiver 322.

[0099] Screen 330 is used to display content output by the terminal device through visual output. For example, it can display user-inputted information, information provided to the user, the system interface of the terminal device, and the interface of applications running on the terminal device. The display panel of screen 330 can be made of materials such as Liquid Crystal Display (LCD), Thin Film Transistor (TFT), Light-Emitting Diode (LED), and Organic Light-Emitting Diode (OLED), without limitation.

[0100] In some implementations, a touch panel may also be covered on the display panel of the screen. When the touch panel detects a touch operation on or near it, it transmits the information to the processor 310 to determine the type of touch event. Subsequently, the processor 310 provides corresponding visual output on the display panel based on the type of touch event. Although in Figure 2 The central screen and touch panel (not shown) are two independent components for realizing the input and output functions of the mobile phone. However, in some implementations, the touch panel can be integrated with the display panel to realize the input and output functions of the mobile phone.

[0101] The camera module 340 includes at least one camera, which can be a front-facing camera 341 or a rear-facing camera 342.

[0102] For illustrative purposes only, the terminal device may have a single camera, dual cameras, triple cameras, or quad cameras. For example, in the case of quad cameras, one camera is a front-facing camera 341, and the other three are rear-facing cameras 342. The three rear-facing cameras 342 may be cameras with different focal lengths, such as a main camera with an equivalent focal length of 35mm, a wide-angle camera with an equivalent focal length of 20mm, and a telephoto camera with an equivalent focal length of 105mm. This application does not limit the scope of the embodiments.

[0103] It should be noted that when the terminal device includes multiple cameras, these multiple cameras can all be front-facing, all be rear-facing, or some can be front-facing and others rear-facing. This application embodiment does not limit this.

[0104] The storage module 350 includes an internal memory 351 and an external memory interface 352. The internal memory 351 can be a flash memory, a hard disk, or a processing memory, etc. For example, the internal memory may include at least one hard disk or flash memory, and one processing memory. The external memory interface 352 is used to connect to external storage devices, which may include memory cards, portable hard drives, USB flash drives, optical discs, etc.

[0105] The storage module 350 can be used to store software programs and modules. The processor 310 executes various functional applications and data processing of the terminal device by running the software programs and modules stored in the storage module 350. The storage module 350 mainly includes a program storage area and a data storage area. The program storage area is usually located on the internal memory 351 and can store the operating system and applications required for at least one function (such as sound playback function and touch response function). The data storage area can be located on the internal memory 351, or on external memory connected to the external memory interface 352, or simultaneously on both internal and external memory. The data storage area can store data created according to the use of the mobile phone (such as audio data, image data, and video data).

[0106] Interface 360 ​​includes, but is not limited to, a Subscriber Identity Module (SIM) card interface 361, a USB interface 362, and a headphone jack 363. The SIM card interface is used to insert a SIM card provided by the operator, so that when the terminal device communicates with the base station through the mobile communication module 391, it can identify and verify the user's identity, and after successful verification, send call requests and data requests to the base station, as well as receive calls, data, and SMS messages forwarded by the base station.

[0107] The bidirectional interface of the electronic device may include a USB interface 362, a headphone jack 363, and a controller 364. Figure 3 The interface circuit shown can be applied to the USB Type-C interface in USB interface 362 to achieve bidirectional charging, bidirectional video transmission, bidirectional audio transmission, and bidirectional data transmission.

[0108] USB interface 362 allows terminal devices to connect to a computer via a USB data cable for data exchange. Simultaneously, USB interface 362 also connects to power module 370. When the USB data cable is connected to a computer or charging port, it can transfer input power to power module 370 to charge the terminal device. The USB interface 362 can be micro-USB, mini-USB, USB Type-C, etc., and there are no restrictions here.

[0109] The headphone jack 363 is used to connect headphones. The headphone jack 363 can be a standalone interface, for example, it can be a 3.5mm headphone jack. Alternatively, the headphone jack 363 can be integrated into the USB interface 362, for example, it can be integrated into a USB Type-C port. When headphones are plugged into the headphone jack 363, the audio module 320 can stop sending the output analog audio signal to the speaker 321 or receiver 322, and instead send it to the headphones via the headphone jack 363 for audio playback. When headphones are plugged in, if the audio module detects that the headphones do not include a microphone, it still receives the analog audio signal sent by the microphone 323. If the audio module detects that the headphones include a microphone, it receives the analog audio signal sent by the headphone microphone, processes it, and sends it to the processor 310.

[0110] The controller 364 may include a first controller and a second controller in the interface circuit. The first controller and the second controller may also be implemented by a unified controller, which is not limited here.

[0111] The terminal device also includes a power module 370 that supplies power to the various components. The power module may include a battery, a power management module, etc. The power management module can be logically connected to the processor 310, thereby enabling functions such as managing battery charging and discharging, and power consumption management.

[0112] The input module 380 can be used to receive input information and key signals. The input information includes numerical or character information, touch information, etc., and the key signals include physical key press signals, virtual key press signals, etc.

[0113] In one embodiment, the input module 380 may include a touch panel and other input devices. The touch panel and screen 330 can form a touch screen. The touch panel can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or other object or accessory that can generate touch signals on or near the touch panel), and execute corresponding functions according to a pre-set program. Optionally, the touch panel may include two parts: a touch detection device and a touch controller. The touch detection device detects the user's touch position and the signal generated by the touch operation, and transmits the signal to the touch controller. The touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends it to the processor 310. The processor 310 receives the sent touch point coordinates, converts them into touch commands, and executes them. The touch panel can be implemented using various types such as resistive, capacitive, infrared, and surface acoustic wave. Other input devices may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, and joystick.

[0114] The communication module 390 includes a mobile communication module 391 and a wireless communication module 392. The mobile communication module 391 can support any communication standard or protocol, including but not limited to Global System for Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), Time-Division WCDMA (TD-WCDMA), Time-Division LTE (TD-LTE), and the 5th generation New Radio (5G NR). The wireless communication module 392 can support Bluetooth, Wireless Fidelity (Wi-Fi), Near Field Communication (NFC), etc.

[0115] The mobile communication module 391 can be used to connect to a communication base station via an antenna to establish a call link between the terminal device and other terminal devices, and to send and receive call audio. The wireless communication module 392 is used to wirelessly connect to external devices, which can be external devices with sound playback and reception functions such as Bluetooth headsets and Bluetooth speakers, or external devices for input such as Bluetooth mice and Bluetooth keyboards, without any restrictions.

[0116] The following uses the Type-C interface as an example, combined with... Figure 3 The interface circuit shown and Figure 5 The flowchart shown illustrates the data transmission method of the electronic device provided in this application.

[0117] refer to Figure 5 The method includes:

[0118] S401. Obtain the device type of the peer device. If the device type of the peer device is a source device, execute S402. If the device type of the peer device is a receiving device or a DRP device, execute S404.

[0119] In some implementations, the device type of the peer device can be determined by obtaining the voltage level of the peer device's CC pin. It should be noted that after the peer device is connected to the bidirectional interface, the pins of the peer device's interface are connected to the pins of the bidirectional interface in the electronic device. The voltage level of the peer device's CC pin is the same as the voltage level of the CC pin in the bidirectional interface of the electronic device. (Refer to...) Figure 2 The CC pin includes CC1 and CC2.

[0120] As an example, when an electronic device detects a high level on the CC pin of the data line of a peer device connected to its Type-C interface via a power transmission controller, it can confirm that the peer device is the source device. When the CC pin is detected to be low, it can confirm that the peer device is the receiver device. When the CC pin on the peer device's data line periodically switches between high and low levels, it can confirm that the peer device is a DRP device.

[0121] S402. Set the electronic device as a receiving device.

[0122] In some implementation methods, reference can be made to Figure 3 Setting the electronic device as a receiving device includes disconnecting the path of DP TX PHY282 in the first switch 25, connecting the second switch 26 and the third switch 27, and connecting the data pin to DP RX PHY.

[0123] S403, Send the DP capability of electronic devices to the peer device.

[0124] In some implementations, DP capability includes dual-channel DP communication or quad-channel DP communication. As an example, the peer device acts as the source device, and the electronic device acts as the receiver device. The peer device receives the DP capability of the electronic device; for example, the electronic device can send DP capability information to the peer device through a power delivery controller. Circuit connections for different DP capabilities can be found in [reference needed]. Figure 3 Examples are not elaborated here.

[0125] It should be noted that when electronic devices send DP capability information to peer devices through the power transmission controller, they can do so via the "Response Discover Modes" message specified in the power transmission protocol. This message includes device function information of the electronic device, such as DP capability information and whether it supports Upstream Facing Port_Display (UFP_D).

[0126] S404. Set the electronic device as a source device. If the device type of the peer device is a DRP device, execute S405; if the device type of the peer device is a receiving device, execute S411.

[0127] In some implementation methods, reference can be made to Figure 3 To configure the electronic device as a source device, the second switch 26 can be disconnected, and the first switch 25 and the third switch 27 can be connected to connect the data pin to the DP TX PHY.

[0128] It should be noted that when the peer device is a receiving device, S411 can be executed directly after setting the electronic device as a source device. However, when the peer device is a DRP device, the device types of the electronic device and the peer device need to be determined through a role negotiation process or a role switching process.

[0129] S405. Determine whether the peer device supports displaying the uplink port. If it does, proceed to S406. If it does not, end the control flow.

[0130] In this embodiment, referring to the example in S403, the determination of whether the peer device supports UFP_D can also be achieved through the "Discover Modes" command. For example, according to the provisions of the power transmission protocol, the electronic device can send a "Discover Modes" command to the peer device. The peer device receives the "Discover Modes" command and returns a "Response Discover Modes" message, which includes the peer device's DP capability information and whether it supports UFP_D.

[0131] It should be noted that if the peer device supports UFP_D, it means that the peer device supports video data transmission via DP and can be used as either a receiving or source device, initiating a role negotiation or role switching process. If the peer device does not support UFP_D, it means that the peer device does not have the capability to transmit video data via DP and cannot transmit video data; therefore, the control flow can be terminated directly. Determining whether the peer device supports UFP_D can eliminate peer devices that cannot be used for video data transmission, reducing unnecessary pairing processes.

[0132] S406. Determine whether the device types of the peer device and the electronic device are the same. If they are the same, proceed to S407; if they are different, proceed to S409.

[0133] In some implementations, supplier information may include a vendor identity document (VID) or a subsystem vendor identity document (SVID), and manufacturer information may include a product identity document (PID). Based on the peer device's VID or SVID and PID, it can be determined whether the peer device's device type is the same as the electronic device. For example, after designating the electronic device as the source device, according to the power transmission protocol, "Discover Identity" and "Discover SVIDs" commands can be sent to the peer device, and "ACK Discover Identity" and "ACK Discover SVIDs" messages can be received in response. The "ACK Discover Identity" message includes the peer device's PID, and the "ACK Discover SVIDs" message includes the peer device's SVID. Based on the VID / SVID and PID, the supported device types of the peer device can be retrieved from a pre-stored USB VID & PID table. For example, if the peer device is identified as a monitor manufactured by brand A through the VID and PID, then the peer device is determined to be the receiving device, and its device type is different from that of the electronic device. Alternatively, if the VID and PID are used to determine that the peer device is a smart screen manufactured by brand C, then the peer device can be identified as a DRP device. It is necessary to determine whether the device type is the same as that of the electronic device based on the specific settings of the DRP device.

[0134] As an example, the "Response Discover Modes" message may also include device type preference information. If the device type preference information of the DRP device is obtained, the device type of the peer device can be determined based on the preference settings in the device type preference information. For example, the preference settings of the peer device may be "try sink" or "try source". "Try sink" means that the peer device will preferentially connect as a receiving device when establishing a connection, while "try source" means that the peer device will preferentially connect as a source device when establishing a connection. The DRP device can be determined as a source device (same device type as the electronic device) or a receiving device (different device type from the electronic device) based on the preference settings of the DRP device. If the device type preference information of the DRP device cannot be obtained, the device type of the peer device is randomly set, and then the device type of the peer device is determined based on the level of the CC pin, and then it is determined whether it is the same as the device type of the electronic device.

[0135] S407 to S408 are examples of the role negotiation process.

[0136] S407. Display an inquiry message on the electronic device and wait to receive a selection operation.

[0137] S408. Based on the received selection operation, determine whether to set the electronic device as the receiving device. If yes, execute S403; otherwise, execute S411.

[0138] In some implementations, the electronic device is the source device, and when the peer device is also a source device, the electronic device and the peer device have the same device type. In this case, a query message can be displayed on the electronic device, prompting the user to choose whether to set the electronic device as a source device or a receiving device. For example, a pop-up window can be displayed on the screen of the electronic device, providing the option to set the electronic device as a source device or a receiving device, awaiting the user's selection. If the received selection indicates that the electronic device should be set as a receiving device, then S403 can be executed to send the DP capability of the electronic device to the peer device and receive the video data sent by the peer device, which is then displayed on the electronic device.

[0139] Alternatively, if the received selection operation instruction sets the electronic device as the source device, S411 can be executed directly.

[0140] S409 and S410 are examples of the role switching process.

[0141] S409. The electronic device sends a data role conversion request to the peer device.

[0142] S410. Determine whether the peer device accepts the data role conversion request. If it accepts, execute S402; if it does not accept, execute S411.

[0143] In some implementations, the electronic device is a source device. When the peer device is randomly set as a receiving device, although the device types of the peer device and the electronic device are different, the device types of the electronic device and the peer device may not match the expected settings because the peer device was randomly set as a receiving device. To configure the electronic device and the peer device more accurately, the electronic device can send a data role conversion request command "DR_Swap" to the peer device according to the provisions of the power transmission protocol, asking whether the peer device wants to convert to a source device. If the peer device replies "Accept", it means that the peer device accepts the data role conversion request and converts to a source device. In this case, the electronic device will execute S402, setting the final device type of the electronic device to a receiving device. If the peer device replies "Reject", it means that the peer device rejects the data role conversion request and maintains the status quo, that is, the final device type of the electronic device is a source device.

[0144] S411. Electronic devices send video data to peer devices.

[0145] In some implementations, when an electronic device sends video data to a peer device, it can choose to transmit the video data via the DP1.2 protocol, DP1.4 protocol, or DP2.0 protocol according to the peer device's DP capability. In this application, no specific transmission protocol is limited.

[0146] Alternatively, in some embodiments, the electronic device supplies power to the peer device. For example, if the electronic device is a laptop and the peer device is a mobile phone, the laptop can charge the mobile phone while receiving video data sent by the mobile phone. In this case, the electronic device can also control the power module to supply power through the Vbus pin. The voltage and current supplied are not limited in this application.

[0147] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0148] Corresponding to the data transmission method of the electronic device described in the above embodiments, Figure 6 A structural block diagram of a data transmission device for an electronic device provided in an embodiment of this application is shown. For ease of explanation, only the parts related to the embodiments of this application are shown.

[0149] Reference Figure 6 The device includes: an electronic device including a bidirectional interface for receiving and transmitting multimedia data.

[0150] The device includes: a determination module 51, used to determine the device type of the peer device and the device type of the electronic device after the peer device inserts a bidirectional interface.

[0151] The sending module 52 is used to send the multimedia data sent by the peer device to the display receiving processor of the electronic device through a bidirectional interface after determining that the device type of the electronic device is a receiving device.

[0152] The sending module 52 is also used to send the multimedia data generated by the display sending processor on the electronic device to the peer device through a bidirectional interface after determining that the device type of the electronic device is a source device.

[0153] In some implementations, reference is made to Figure 7 The device also includes a connection module 53, used to connect the bidirectional interface to the display receiving processor after determining that the device type of the electronic device is a receiving device, and to connect the bidirectional interface to the display transmitting processor after determining that the device type of the electronic device is a source device.

[0154] In some implementations, the determining module 51 is specifically used to determine the device type of the peer device based on the signals transmitted on the bidirectional interface. The device type of the electronic device is then determined based on the device type of the peer device.

[0155] In some implementations, the bidirectional interface is a Universal Serial Bus Type-C interface.

[0156] The determination module 51 is specifically used to detect the level state of the pins on the bidirectional interface and determine the device type of the peer device based on the level state of the pins. When the level state of the pin is high, the peer device is the source device; when the level state of the pin is low, the peer device is the receiver device; when the level state of the pin switches between high and low, the peer device is a dual-role port device.

[0157] In some implementations, the determining module 51 is specifically used to determine the electronic device as a receiving device when the peer device is a source device. When the peer device is a receiving device, the electronic device is determined as a source device. When the peer device is a dual-role port device, the device types of the electronic device and the peer device are determined through a role negotiation process or a role switching process.

[0158] In some implementations, the determining module 51 is also configured to determine the initial device type of the electronic device as a source device.

[0159] In some implementations, the determining module 51 is also used to obtain information on whether the peer device supports displaying the uplink port through a bidirectional interface, and to initiate a role negotiation process or a role switching process for peer devices that support displaying the uplink port.

[0160] In some implementations, the determining module 51 is further configured to obtain at least one of the supplier information, manufacturer information, device type preference information, and device function information of the peer device through a bidirectional interface, and determine whether the peer device and the electronic device are the same device based on the obtained information. If they are the same, a role negotiation process is executed; if they are different, a role switching process is executed.

[0161] In some implementations, the role negotiation process includes: displaying a query message on the electronic device to obtain the final device type of the electronic device; and setting the final device type of the peer device based on the final device type of the electronic device. The role switching process includes: sending a role switching request message to the peer device; and setting the final device types of both the peer device and the electronic device based on the response message from the peer device.

[0162] In some implementations, the bidirectional interface is also used for bidirectional charging.

[0163] It should be noted that the information interaction and execution process between the above modules are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.

[0164] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0165] Figure 8 A schematic diagram of another electronic device structure is shown. (Reference) Figure 8 This application embodiment also provides an electronic device 6 including a bidirectional interface 605, a controller 604, and a processor 601, wherein the processor 601 includes a display receiving processor and a display transmitting processor. The bidirectional interface 605 includes pins for connecting to a peer device inserted into the bidirectional interface. The controller 604 is used to determine the device type of the peer device and the device type of the electronic device 6. After determining that the device type of the electronic device 6 is a receiving device, it sends multimedia data sent by the peer device to the display receiving processor of the electronic device through the bidirectional interface. After determining that the device type of the electronic device 6 is a source device, it sends multimedia data generated by the display transmitting processor on the electronic device 6 to the peer device through the bidirectional interface. The display receiving processor is used to perform display processing on the received multimedia data. The display transmitting processor is used to process the obtained multimedia data.

[0166] refer to Figure 8 The electronic device 6 may also include a memory 602 and a computer program 603 stored in the memory 602 and executable on the at least one processor 601. When the processor 601 executes the computer program 603, it implements the steps in the data transmission method embodiments of any of the above-described electronic devices.

[0167] Those skilled in the art will understand that Figure 8This is merely an example of electronic device 6 and does not constitute a limitation on electronic device 6. It may include more or fewer components than shown, or combine certain components, or different components, such as input / output devices, network access devices, etc.

[0168] The processor 601 may be a Central Processing Unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0169] In some embodiments, the memory 602 may be an internal storage unit of the electronic device 6, such as a hard disk or memory of the electronic device 6. In other embodiments, the memory 602 may be an external storage device of the electronic device 6, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 6. Further, the memory 602 may include both internal and external storage units of the electronic device 6. The memory 602 is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory 602 can also be used to temporarily store data that has been output or will be output.

[0170] In some embodiments, the electronic device 6 also includes a switch module. After determining that the device type of the electronic device 6 is a receiving device, the switch module is used to connect the bidirectional interface 605 to the display receiving processor. After determining that the device type of the electronic device is a source device, the switch module is used to connect the bidirectional interface 605 to the display transmitting processor.

[0171] In some embodiments, the switch module includes a first switch, a second switch, and a third switch. The first switch is connected to the display transmitting processor, the second switch is connected to the display receiving processor, and the third switch is connected to a pin. After determining that the device type of electronic device 6 is a receiving device, the controller 604 controls the second switch and the third switch to connect. After determining that the device type of electronic device 6 is a source device, the controller 604 controls the first switch and the third switch to connect.

[0172] In some implementations, controller 604 is configured to detect the voltage level of a pin on a bidirectional interface, determine the device type of the peer device based on the voltage level of the pin, and determine the device type of the electronic device based on the device type of the peer device.

[0173] In some embodiments, electronic device 6 also includes a power module connected to pins. Controller 604 is also used to control the power module to charge the peer device.

[0174] In some implementations, the power module is also used to receive power transmitted by the peer device through the bidirectional interface 605.

[0175] In some implementations, the bidirectional interface 605 is a Universal Serial Bus Type-C interface or a Lightning interface.

[0176] In some implementations, the controller that detects the voltage level of the first pin on the bidirectional interface 605 is a power delivery controller. Specifically, when the bidirectional interface 605 is a Type-C interface, refer to... Figure 2 The first pin can be either CC1 or CC2.

[0177] This application embodiment also provides an interface circuit for use on an electronic device, including an interface module, a switch module, and a controller. The interface module includes pins for connecting to a peer device that inserts into the bidirectional interface. The controller determines the device type of the peer device and the device type of the electronic device. If the device type of the electronic device is determined to be a receiving device, the controller connects the interface module to the display receiving processor of the electronic device via the switch module. If the device type of the electronic device is determined to be a source device, the controller connects the interface module to the display transmitting processor of the electronic device via the switch module.

[0178] In some implementations, the switch module includes a first switch, a second switch, and a third switch. The first switch is connected to a display transmitting processor, the second switch is connected to a display receiving processor, and the third switch is connected to a pin. After determining that the electronic device is a receiving device, the controller controls the second switch and the third switch to connect; after determining that the electronic device is a source device, the controller controls the first switch and the third switch to connect.

[0179] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.

[0180] This application provides a computer program product that, when run on a mobile terminal, enables the mobile terminal to implement the steps described in the above-described method embodiments.

[0181] This application provides a chip system including a memory and a processor. The processor executes a computer program stored in the memory to implement the steps in the various method embodiments described above.

[0182] This application provides a chip system including a processor coupled to a computer-readable storage medium. The processor executes a computer program stored in the computer-readable storage medium to implement the steps in the various method embodiments described above.

[0183] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to an electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.

[0184] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0185] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0186] In the embodiments provided in this application, it should be understood that the disclosed methods, apparatuses, and electronic devices can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.

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

[0188] Finally, it should be noted that 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 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.

Claims

1. A data transmission method for an electronic device, characterized in that, The electronic device includes a bidirectional interface for receiving and transmitting multimedia data; the method includes: After the peer device inserts the bidirectional interface, the device type of the peer device is determined based on the signals transmitted on the bidirectional interface. The device type of the electronic device is determined based on the device type of the peer device, including: when the peer device is a source device, the electronic device is determined to be a receiving device; when the peer device is a receiving device, the electronic device is determined to be a source device; when the peer device is a dual-role port device, the initial device type of the electronic device is determined to be a source device, and information on whether the peer device supports displaying an uplink port is obtained through the bidirectional interface. For peer devices that support displaying an uplink port, a role negotiation process or a role switching process is initiated. At least one of the following is obtained through the bidirectional interface: supplier information, manufacturer information, device type preference information, and device function information of the peer device. Based on the obtained information, it is determined whether the peer device and the electronic device are the same device. If they are the same, the role negotiation process is executed; if they are different, the role switching process is executed. The device types of the electronic device and the peer device are determined through the role negotiation process or the role switching process. If the peer device does not support displaying an uplink port, the control flow ends; if the peer device supports displaying an uplink port, it means that the peer device supports the ability to transmit video data through the display interface. After determining that the device type of the electronic device is a receiving device, the multimedia data sent by the peer device is sent to the display receiving processor of the electronic device through the bidirectional interface; After determining that the device type of the electronic device is a source device, the multimedia data generated by the display transmission processor on the electronic device is sent to the peer device through the bidirectional interface.

2. The method according to claim 1, characterized in that, The method further includes: After determining that the device type of the electronic device is a receiving device, the bidirectional interface is connected to the display receiving processor; After determining that the device type of the electronic device is a source device, the bidirectional interface is connected to the display sending processor.

3. The method according to claim 1, characterized in that, The bidirectional interface is a Universal Serial Bus Type-C interface; Determining the device type of the peer device based on the signals transmitted on the bidirectional interface includes: The voltage level of the pins on the bidirectional interface is detected, and the device type of the peer device is determined based on the voltage level of the pins. When the voltage level of the pins is high, the peer device is a source device; when the voltage level of the pins is low, the peer device is a receiver device; when the voltage level of the pins switches between high and low, the peer device is a dual-role port device.

4. The method according to claim 1, characterized in that, The role negotiation process includes: displaying an inquiry message on the electronic device, the inquiry message being used to obtain the final device type of the electronic device; The final device type of the peer device is set according to the final device type of the electronic device; The role switching process includes: sending a role switching request message to the peer device; The final device type of the peer device and the electronic device is set according to the response message of the peer device.

5. The method according to any one of claims 1-4, characterized in that, The bidirectional interface is also used for bidirectional charging.

6. An electronic device, characterized in that, The electronic device includes a bidirectional interface, a controller, a display receiving processor, and a display transmitting processor; The bidirectional interface includes pins for connecting to a peer device inserted into the bidirectional interface; The controller is configured to determine the device type of the peer device based on the level state of the pins detected on the bidirectional interface. Based on the device type of the peer device, the device type of the electronic device is determined. After determining that the device type of the electronic device is a receiving device, the multimedia data sent by the peer device is sent to the display receiving processor of the electronic device through the bidirectional interface. After determining that the device type of the electronic device is a source device, the multimedia data generated by the display sending processor on the electronic device is sent to the peer device through the bidirectional interface. Specifically, determining the device type of the electronic device based on the device type of the peer device includes: when the peer device is a source device, determining the electronic device as a receiving device; when the peer device is a receiving device, determining the electronic device as a source device; and when the peer device is a dual-role port device, determining the initial device type of the electronic device as a source device. The terminal device obtains information on whether the peer device supports displaying the uplink port through the bidirectional interface. For peer devices that support displaying the uplink port, a role negotiation process or a role switching process is initiated. The terminal device obtains at least one of the following information through the bidirectional interface: supplier information, manufacturer information, device type preference information, and device function information of the peer device. Based on the obtained information, it determines whether the peer device and the electronic device are the same device. If they are the same, the role negotiation process is executed; if they are different, the role switching process is executed. The role negotiation process or the role switching process determines the device type of the electronic device and the peer device. If the peer device does not support displaying the uplink port, the control flow ends. If the peer device supports displaying the uplink port, it indicates that the peer device supports the ability to transmit video data through the display interface. The display receiving processor is used to perform display processing on the received multimedia data; The display sending processor is used to process the obtained multimedia data.

7. The electronic device according to claim 6, characterized in that, The electronic device further includes a switch module. After determining that the device type of the electronic device is a receiving device, the switch module is used to connect the bidirectional interface to the display receiving processor. After determining that the device type of the electronic device is a source device, the switch module is used to connect the bidirectional interface to the display transmitting processor.

8. The electronic device according to claim 7, characterized in that, The switch module includes a first switch, a second switch, and a third switch. The first switch is connected to the display transmitting processor, the second switch is connected to the display receiving processor, and the third switch is connected to the pin. After determining that the device type of the electronic device is a receiving device, the controller controls the second switch to connect with the third switch. After determining that the device type of the electronic device is a source device, the controller controls the first switch to connect with the third switch.

9. The electronic device according to any one of claims 6-8, characterized in that, The electronic device further includes a power module connected to the pin; the controller is also used to control the power module to charge the peer device.

10. The electronic device according to claim 9, characterized in that, The power module is also used to receive power transmitted by the peer device through the bidirectional interface.

11. The electronic device according to any one of claims 6-8, characterized in that, The bidirectional interface is a Universal Serial Bus Type-C interface or a Lightning interface.

12. The electronic device according to any one of claims 6-8, characterized in that, The controller that detects the voltage level of the first pin on the bidirectional interface is a power transmission controller.

13. An interface circuit, characterized in that, The interface circuit is used to be installed on electronic devices and includes an interface module, a switch module, and a controller; The interface module includes pins for connecting to a peer device that inserts into the bidirectional interface; The controller is configured to determine the device type of the peer device based on the level state of the pins detected on the bidirectional interface. Based on the device type of the peer device, the device type of the electronic device is determined. After determining that the device type of the electronic device is a receiving device, the interface module is connected to the display receiving processor of the electronic device via the switch module. After determining that the device type of the electronic device is a source device, the interface module is connected to the display sending processor of the electronic device via the switch module. The process of determining the device type of the electronic device based on the device type of the peer device includes: when the peer device is a source device, determining the electronic device as a receiving device; when the peer device is a receiving device, determining the electronic device as a source device; when the peer device is a dual-role port device, determining the initial device type of the electronic device as a source device, and then... The bidirectional interface obtains information on whether the peer device supports displaying the uplink port. For peer devices that support displaying the uplink port, a role negotiation process or a role switching process is initiated. At least one of the following is obtained through the bidirectional interface: supplier information, manufacturer information, device type preference information, and device function information of the peer device. Based on the obtained information, it is determined whether the peer device and the electronic device are the same device. If they are the same, the role negotiation process is executed; if they are different, the role switching process is executed. The device types of the electronic device and the peer device are determined through the role negotiation process or the role switching process. If the peer device does not support displaying the uplink port, the control flow ends. If the peer device supports displaying the uplink port, it means that the peer device supports the ability to transmit video data through the display interface.

14. The interface circuit according to claim 13, characterized in that, The switch module includes a first switch, a second switch, and a third switch. The first switch is used to connect to the display transmitting processor, the second switch is used to connect to the display receiving processor, and the third switch is connected to the pin. After determining that the device type of the electronic device is a receiving device, the controller controls the second switch to connect with the third switch. After determining that the device type of the electronic device is a source device, the controller controls the first switch to connect with the third switch.

Citation Information

Patent Citations

  • Charging method and apparatus

    CN106026240A

  • Bi-directional signal adjusting chip of USB Type-C cable and USB Type-C cable

    CN107544934A

  • Method and terminal device for establishing connection between devices with universal serial bus USB type-c interface

    CN108604218A