CN113934661B - Electronic equipment, control method, device and medium - Google Patents

Electronic equipment, control method, device and medium Download PDF

Info

Publication number
CN113934661B
CN113934661B CN202111157180.0A CN202111157180A CN113934661B CN 113934661 B CN113934661 B CN 113934661B CN 202111157180 A CN202111157180 A CN 202111157180A CN 113934661 B CN113934661 B CN 113934661B
Authority
CN
China
Prior art keywords
usb interface
electronic device
cpu
switch
line
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111157180.0A
Other languages
Chinese (zh)
Other versions
CN113934661A (en
Inventor
李宾
赵廷法
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Mobile Communications Technology Co Ltd
Original Assignee
Hisense Mobile Communications Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Mobile Communications Technology Co Ltd filed Critical Hisense Mobile Communications Technology Co Ltd
Priority to CN202111157180.0A priority Critical patent/CN113934661B/en
Publication of CN113934661A publication Critical patent/CN113934661A/en
Application granted granted Critical
Publication of CN113934661B publication Critical patent/CN113934661B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/382Information transfer, e.g. on bus using universal interface adapter
    • G06F13/387Information transfer, e.g. on bus using universal interface adapter for adaptation of different data processing systems to different peripheral devices, e.g. protocol converters for incompatible systems, open system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)

Abstract

The application discloses an electronic device, a control method, a device and a medium. Because the electronic equipment is provided with the first USB interface and the second USB interface with different interface types, the electronic equipment can be connected with the first other electronic equipment through the first USB interface, and the second USB interface is connected with the second other electronic equipment. Meanwhile, as the multipath transponder is further arranged in the electronic equipment, when the CPU in the electronic equipment determines that the first USB interface is connected with the first other electronic equipment and the second USB interface is connected with the second other electronic equipment, the CPU can be electrically connected with the multipath transponder through the first line so as to control the multipath transponder to send signals sent by the CPU to the first USB interface and/or the second USB interface, so that the electronic equipment can interact with the first other electronic equipment and the second electronic equipment at the same time, and services of different interface types can be provided for the electronic equipment conveniently.

Description

Electronic equipment, control method, device and medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to an electronic device, a control method, an apparatus, and a medium.
Background
Currently, although interface types of universal serial bus (Universal Serial Bus, USB) interfaces of electronic devices in the market mainly include Type-C and Type-a interface types, generally, only one Type of USB interface exists on an electronic device, for example, only one Type-C interface Type USB interface exists on some mobile phones, and only one Type-a interface Type USB interface exists on some mobile phones, which results in that the electronic device can only provide one Type of service. When the electronic equipment is required to provide the service of another interface type, the service cannot be realized through the USB interface on the electronic equipment, so that the performance of the electronic equipment is reduced, inconvenience is brought to the use of the electronic equipment by a user, and the user experience is influenced.
Disclosure of Invention
The application provides an electronic device, a control method, a device and a medium, which are used for solving the problem that the existing electronic device can only provide one interface type service and the performance of the electronic device is reduced.
The application provides an electronic device, comprising: the system comprises a first Universal Serial Bus (USB) interface, a second USB interface, a multiplexer and a Central Processing Unit (CPU); wherein, the interface types of the first USB interface and the second USB interface are different;
The CPU is used for electrically connecting with the multiplexer through a first circuit if the first USB interface is determined to be connected with a first other electronic device and the second USB interface is determined to be connected with a second other electronic device; and controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
The application provides a control method, which comprises the following steps:
if it is determined that a first USB interface on the electronic device is connected with a first other electronic device and a second USB interface on the electronic device is connected with a second other electronic device, controlling a CPU on the electronic device to be electrically connected with a multiplexer on the electronic device through a first line;
And controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
The present application provides a control device, the device comprising:
The first processing unit is used for controlling the CPU on the electronic equipment to be electrically connected with the multiplexer on the electronic equipment through a first line if the first USB interface on the electronic equipment is determined to be connected with the first other electronic equipment and the second USB interface on the electronic equipment is determined to be connected with the second other electronic equipment;
and the second processing unit is used for controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
The application provides an electronic device comprising at least a processor and a memory, the processor being arranged to implement the steps of the control method as described above when executing a computer program stored in the memory.
The present application provides a computer readable storage medium storing a computer program which when executed by a processor implements the steps of the control method as described above.
Because the electronic equipment is provided with the first USB interface and the second USB interface with different interface types, the electronic equipment can be connected with the first other electronic equipment through the first USB interface, and the second USB interface is connected with the second other electronic equipment. Meanwhile, as the multipath transponder is further arranged in the electronic equipment, when the CPU in the electronic equipment determines that the first USB interface is connected with the first other electronic equipment and the second USB interface is connected with the second other electronic equipment, the CPU can be electrically connected with the multipath transponder through the first line so as to control the multipath transponder to send signals sent by the CPU to the first USB interface and/or the second USB interface, the electronic equipment can interact with the first other electronic equipment and the second electronic equipment at the same time, and therefore the electronic equipment can conveniently provide services of different interface types at the same time, and the performance of the electronic equipment is improved.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic structural diagram of an electronic device according to some embodiments of the present application;
FIG. 2 is a schematic structural diagram of a Type-A interface and a Type-C interface respectively connected to a CPU according to some embodiments of the present application;
Fig. 3 is a schematic circuit connection structure of an electronic device according to some embodiments of the present application;
Fig. 4 is a schematic circuit diagram of still another electronic device according to some embodiments of the present application;
FIG. 5 is a schematic diagram of a control process according to some embodiments of the present application;
fig. 6 is a schematic structural diagram of a control device according to some embodiments of the present application;
Fig. 7 is a schematic structural diagram of an electronic device according to some embodiments of the present application.
Detailed Description
In order to realize that the electronic equipment can simultaneously provide services with different interface types and improve the performance of the electronic equipment, the application provides the electronic equipment, the control method, the control device and the medium.
For the purpose of promoting an understanding of the principles and advantages of the application, reference will now be made in detail to the drawings, in which embodiments illustrated in the drawings are intended to illustrate, but not limit the application to the specific embodiments illustrated. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In the practical application process, when a user wishes to interact with other electronic devices of different interface types through the electronic device at the same time, other electronic devices of one interface type (for convenience of explanation, denoted as first other electronic device) can be connected with a USB interface of a corresponding interface type (for convenience of explanation, denoted as first USB interface) on the electronic device, and other electronic devices of another interface type (for convenience of explanation, denoted as second other electronic device) can be connected with a USB interface of a corresponding interface type (for convenience of explanation, denoted as second USB interface) on the electronic device. If the CPU in the electronic device determines that the first USB interface is connected with the first other electronic device and the second USB interface is connected with the second other electronic device, the CPU is electrically connected with the multiplexer through the first circuit so as to control the multiplexer to send signals sent by the CPU to the first USB interface and/or the second USB interface, and therefore the electronic device can interact with the first other electronic device and the second electronic device at the same time.
Example 1:
Fig. 1 is a schematic structural diagram of an electronic device according to some embodiments of the present application, where the electronic device includes a first USB interface 11, a second USB interface 12, a multiplexer 13, and a CPU14; wherein, the interface types of the first USB interface and the second USB interface are different;
The CPU is used for electrically connecting with the multiplexer through a first circuit if the first USB interface is determined to be connected with a first other electronic device and the second USB interface is determined to be connected with a second other electronic device; and controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
The electronic equipment provided by the application can be intelligent equipment such as a mobile phone, a computer and the like, and can also be a server and the like.
In the practical application process, when a user wishes to interact with other electronic devices of different interface types through the electronic device at the same time, other electronic devices of one interface type (for convenience of explanation, denoted as first other electronic device) can be connected with a USB interface of a corresponding interface type (for convenience of explanation, denoted as first USB interface) on the electronic device, and other electronic devices of another interface type (for convenience of explanation, denoted as second other electronic device) can be connected with a USB interface of a corresponding interface type (for convenience of explanation, denoted as second USB interface) on the electronic device.
The interface Type comprises a Type-C interface Type and a Type-A interface Type.
It should be noted that, for a USB interface with an interface Type of Type-a interface, the USB interface can only connect with other electronic devices (noted as otg devices for convenience of description) with a data connection (otg) Type, such as a USB disk, a mouse, a keyboard, and the like; for a USB interface of interface Type-C, the USB interface may be connected to other electronic devices of otg Type, or may be connected to other electronic devices of display interface (dp) Type (dp device for convenience of explanation), such as a display, a projector, and the like.
In order to simultaneously provide services of different interface types for the electronic device, the performance of the electronic device is improved, and the electronic device comprises a first USB interface, a second USB interface, a multiplexer and a CPU. The first USB interface and the second USB interface are different in interface type and are used for being connected with other electronic equipment. The CPU of the electronic device can determine whether the current first USB interface and the second USB interface are connected with other electronic devices, and when the current first USB interface and the second USB interface are connected with other electronic devices, the CPU of the electronic device is electrically connected with a multiplexer of the electronic device, and the multiplexer is controlled to send signals sent by the CPU to the first USB interface and/or the second USB interface so as to realize that the electronic device can simultaneously provide services of different interface types.
In one possible implementation, since the first other electronic device is connected to the first USB interface on the electronic device, the state of the CC pin (for convenience of description, referred to as the first CC pin) included in the first USB interface is changed. Therefore, the CPU of the electronic device may determine whether the first USB interface of the electronic device is connected to the first other electronic device by detecting the state of the first CC pin. When the state of the first CC pin is determined to be the state that a first USB interface of the electronic equipment is connected with a first other electronic equipment, determining that the first USB interface of the electronic equipment is connected with the first other electronic equipment; and when the state of the first CC pin is determined not to be the state that the first USB interface of the electronic equipment is connected with the first other electronic equipment, determining that the first USB interface of the electronic equipment is not connected with the first other electronic equipment.
The CPU may further determine, according to the state of the first CC pin, a type of the first other electronic device to which the current first USB interface is connected.
Similarly, since a second other electronic device is connected to the second USB interface of the electronic device, the state of the CC pin (for convenience of description, referred to as the second CC pin) included in the second USB interface is changed. Therefore, the CPU of the electronic device may determine whether the second USB interface of the electronic device is connected to the second other electronic device by detecting the state of the second CC pin. When the state of the second CC pin is determined to be the state that a second USB interface of the electronic equipment is connected with a second other electronic equipment, determining that the second USB interface of the electronic equipment is connected with the second other electronic equipment; and when the state of the second CC pin is determined not to be the state that the second USB interface of the electronic equipment is connected with the second other electronic equipment, determining that the second USB interface of the electronic equipment is not connected with the second other electronic equipment.
The CPU may further determine, according to the state of the second CC pin, a type of a second other electronic device connected to the current second USB interface.
In one possible implementation, since the USB2.0 port physical layer (phy) of the Type-a interface Type USB interface (for convenience of explanation, denoted as Type-a interface) can only be connected to the CPU through the multiplexer (hub), while the USB2.0 phy of the Type-C interface Type USB interface (for convenience of explanation, denoted as Type-C interface) can also be connected to the CPU through the hub. Fig. 2 is a schematic structural diagram of a Type-a interface and a Type-C interface respectively connected to a CPU according to some embodiments of the present application. As shown in FIG. 2, the USB2.0 phy of the Type-A interface can only be connected with the USB phy of the CPU through the hub, while the USB2.0 phy of the Type-C interface Type USB interface can also be connected with the USB phy of the CPU through the hub. Therefore, in order to realize that the electronic device can simultaneously provide services of different interface types, in the present application, a multiplexer is provided in the electronic device, and the multiplexer can be connected with the CPU through a line (for convenience of explanation, denoted as a first line). In the implementation process, when a CPU in the electronic device determines that the first USB interface is connected with the first other electronic device and the second USB interface is connected with the second other electronic device, the CPU is electrically connected with the multiplexer through a first circuit, and then the subsequent CPU can send signals to the multiplexer through the first circuit. And after receiving the signal sent by the CPU, the multiplexer may send the signal to the corresponding USB interface, that is, to the first USB interface, and/or to the second USB interface.
The signal may be a data signal, a request signal, or the like.
In one possible embodiment, in order to accurately control the electrical connection between the CPU and the multiplexer, in the present application, a switch (referred to as a first switch for convenience of description) supporting the USB2.0 protocol is provided on the first line. When the CPU of the electronic device determines that the first USB interface is connected with the first other electronic device and the second USB interface is connected with the second other electronic device, in order to realize the electric connection between the CPU and the multiplexer, the CPU controls the first switch which supports the USB2.0 protocol to be closed and is arranged on the first line.
In one possible implementation manner, when the electronic device determines that the USB interface (including the first USB interface and the second USB interface) of the electronic device is connected to the otg device, the first otg loading procedure is triggered, so that after the otg device is connected to the electronic device, the electronic device can work normally.
In a possible implementation manner, when the electronic device determines that the self USB interface is connected to the dp device, the second otg loading procedure is triggered to implement transmission of a fast charging (Power Deliver, PD) protocol, so as to complete dp event triggering, thereby facilitating connection of the dp device to the electronic device and obtaining data sent by the electronic device.
In one possible implementation, the user may not need the electronic device to provide services of a different interface type at the same time, so as to disconnect the first USB interface from the first other electronic device on the electronic device and disconnect the second USB interface from the second other electronic device on the electronic device. And the CPU of the electronic device determines that the first USB interface is no longer connected to the first other electronic device and the second USB interface is no longer connected to the second other electronic device, which means that the electronic device is no longer needed to interact with the first other electronic device and the second other electronic device at the same time, the CPU may stop being electrically connected to the multiplexer through the first line.
In one possible implementation manner, in order to accurately control the CPU not to be electrically connected to the multiplexer, in the present application, when the CPU of the electronic device determines that the first USB interface is no longer connected to the first other electronic device and the second USB interface is no longer connected to the second other electronic device, the CPU may control the first switch on the first line to be turned off, that is, control the on-off state of the first switch to be converted from on to off.
In the actual application process, the state of the first CC pin included in the first USB interface is changed due to disconnection of the first other electronic device from the first USB interface on the electronic device. Therefore, the CPU of the electronic device may determine whether the first USB interface of the electronic device is connected to the first other electronic device by detecting the state of the first CC pin. And when the state of the first CC pin is determined to be the state that the first USB interface of the electronic equipment is not connected with the first other electronic equipment, determining that the first USB interface of the electronic equipment is not connected with the first other electronic equipment.
Similarly, the state of the second CC pin included in the second USB interface may be changed by disconnecting the second other electronic device from the second USB interface on the electronic device. Therefore, the CPU of the electronic device may determine whether the second USB interface of the electronic device is connected to the second other electronic device by detecting the state of the second CC pin. And when the state of the second CC pin is determined to be the state that the second USB interface of the electronic equipment is not connected with the second other electronic equipment, determining that the second USB interface of the electronic equipment is not connected with the second other electronic equipment.
Because the electronic equipment is provided with the first USB interface and the second USB interface with different interface types, the electronic equipment can be connected with the first other electronic equipment through the first USB interface, and the second USB interface is connected with the second other electronic equipment. Meanwhile, as the multipath transponder is further arranged in the electronic equipment, when the CPU in the electronic equipment determines that the first USB interface is connected with the first other electronic equipment and the second USB interface is connected with the second other electronic equipment, the CPU can be electrically connected with the multipath transponder through the first line so as to control the multipath transponder to send signals sent by the CPU to the first USB interface and/or the second USB interface, the electronic equipment can interact with the first other electronic equipment and the second electronic equipment at the same time, and therefore the electronic equipment can conveniently provide services of different interface types at the same time, and the performance of the electronic equipment is improved.
Example 2:
In order to further improve the performance of the electronic device, in the present application, if it is determined that the first USB interface is not connected to the first other electronic device and it is determined that the second USB interface is not connected to the second other electronic device, the CPU is further configured to control a first switch supporting the USB2.0 protocol on the first line to be opened and to keep a second switch supporting the USB3.0 protocol on the second line to be closed; the second circuit is used for connecting the CPU and the second USB interface.
In the practical application process, as the USB2.0 phy and the USB3.0 phy of the Type-C interface can be directly interacted with the CPU, the USB2.0 phy of the Type-C interface can be connected with the CPU through hub, and the interaction rate of the electronic equipment and other electronic equipment can be effectively improved through the USB3.0 phy. As shown in FIG. 2, the Type-C interface may also interact directly with the CPU's USB phy. Therefore, in the present application, a line (for convenience of explanation, referred to as a second line) for directly connecting the CPU and the second USB interface is preset in the electronic device, and a switch (for convenience of explanation, referred to as a second switch) supporting the USB3.0 protocol is provided on the second line, so that the second USB interface can directly interact with the CPU based on the USB3.0 protocol.
In order to avoid that the second USB interface directly interacts with the CPU, the interaction of the CPU with the first USB interface and the second USB interface is influenced, when the CPU determines that the first USB interface is not connected with the first other electronic equipment and the second USB interface is determined not to be connected with the second other electronic equipment, the electronic equipment is not required to interact with the first other electronic equipment and the second other electronic equipment at the same time, a first switch supporting the USB2.0 protocol on a first line can be controlled to be disconnected, namely, the electrical connection of the CPU and a multiplexer is disconnected, and a second switch supporting the USB3.0 protocol on a second line is kept to be closed, so that the CPU can be directly and electrically connected with the second USB interface, the CPU can conveniently determine that the second USB is connected with the second other electronic equipment, and when the first USB interface is not connected with the first other electronic equipment, the second USB interface can be quickly realized based on the USB3.0 protocol, and the interaction efficiency of the electronic equipment and the second other electronic equipment is improved.
The second circuit is used for connecting a CPU on the electronic equipment and a second USB interface on the electronic equipment.
Further, when the CPU determines that the first USB interface is connected to the first other electronic device and the second USB interface is connected to the second other electronic device, the first switch supporting the USB2.0 protocol on the first line may be controlled to be turned on, that is, the CPU is electrically connected to the multiplexer, and the second switch supporting the USB3.0 protocol on the second line is controlled to be turned off, so that the CPU is prevented from interacting with the second USB interface through the multiplexer by the second line.
As a possible implementation manner, if the first USB interface is a Type-a interface, since the USB2.0 port physical layer of the Type-a interface can only be connected to the CPU through the multiplexer, and there may be a case where the user only wants the electronic device to provide services for the first other electronic device, or the user connects the first USB interface to the first other electronic device before connecting the second USB interface to the second other electronic device, or disconnects the second USB interface from the second other electronic device after the user connects the electronic device to the second other electronic device and the first other electronic device, so that the CPU on the electronic device currently determines that the first USB interface is connected to the first other electronic device, and determines that the second USB interface is not connected to the second other electronic device, which indicates that the current CPU needs to interact with the USB interface through the multiplexer, then the first switch supporting the USB2.0 protocol on the first line can be controlled to be closed, and thus the electrical connection between the CPU and the multiplexer is achieved. In addition, the second USB interface is not connected with the second other electronic equipment, the CPU does not need to interact with the second other electronic equipment connected with the second USB interface at present, so that the CPU is directly connected with the second USB interface through a second line, interaction between the CPU and the first USB interface through a multiplexer is not influenced, and therefore a second switch supporting the USB3.0 protocol on the second line can be kept closed.
As another possible implementation manner, in the actual application process, there may be a case that the user only wants the electronic device to provide services for the second other electronic device, or the user connects the second USB interface with the second other electronic device before connecting the first USB interface with the first other electronic device, or disconnects the first USB interface from the first other electronic device after the user connects the electronic device with the first other electronic device and the second other electronic device simultaneously, so that when the second USB interface is the Type-a interface, the CPU on the electronic device determines that the first USB interface is not connected with the first other electronic device, and determines that the second USB interface is connected with the second other electronic device. In order to ensure the interaction speed of the CPU and the second USB interface, when the CPU on the electronic device determines that the first USB interface is not connected with the first other electronic device and determines that the second USB interface is connected with the second other electronic device, the CPU is not required to interact with the USB interface through the multiplexer, so that the first switch supporting the USB2.0 protocol on the first line can be controlled to be disconnected, namely, the CPU is disconnected from the multiplexer, and the second switch supporting the USB3.0 protocol on the second line is kept to be closed, so that the CPU can be directly electrically connected with the second USB interface, the second USB interface can be directly interacted with the CPU based on the USB3.0 protocol conveniently, and the interaction efficiency of the electronic device and the second other electronic device is improved.
By the method, the CPU can accurately adjust the on-off of the first circuit and the second circuit in the electronic equipment according to the condition that whether the first USB interface is connected with the first other electronic equipment and the condition that whether the second USB interface is connected with the second other electronic equipment at present, so that the interaction between the electronic equipment and the first other electronic equipment and the interaction between the electronic equipment and the second other electronic equipment are accurately realized, and the quality of the interaction between the electronic equipment and at least one electronic equipment is ensured.
Example 3:
In order to ensure the quality of interaction between the CPU and the second USB interface through the multiplexer, in the present application, if it is determined that the first USB interface is connected to the first other electronic device and the second USB interface is connected to the second other electronic device, the third switch supporting the USB2.0 protocol on the third line is controlled to be turned on; the third line is used for connecting the line converter and the second USB interface.
In order to ensure the quality of the interaction between the CPU and the second USB interface through the multiplexer, in the application, a third circuit is also arranged in the electronic equipment, a third switch supporting the USB2.0 protocol is arranged on the third circuit, and the third circuit is used for connecting the multiplexer and the second USB interface. When the CPU on the electronic device determines that the first USB interface is connected with the first other electronic device and the second USB interface is connected with the second other electronic device, in order to ensure that the CPU interacts with the second USB interface through the multiplexer, the CPU controls a third switch supporting the USB2.0 protocol on a third line to be closed so as to realize the electric connection between the multiplexer and the second USB interface, thereby facilitating the multiplexer to send signals sent by the CPU to the second USB interface and ensuring the quality of the interaction between the CPU and the second USB interface through the multiplexer.
In one possible implementation manner, in order to ensure that the interaction between the CPU and the USB interface is accurately controlled, in the present application, when the CPU on the electronic device does not need to interact with the second USB through the multiplexer, the third switch supporting the USB2.0 protocol on the third line may be controlled to be turned off, so that the influence of interaction between the CPU and any USB interface caused by the fact that multiple lines exist on the electronic device to implement the interaction between the CPU and the second USB interface is avoided. Specifically, if it is determined that the first USB interface is not connected to the first other electronic device and/or the second USB interface is not connected to the second other electronic device, a third switch supporting the USB2.0 protocol on a third line is controlled to be turned off.
In one possible implementation manner, connection conditions of other electronic devices possibly connected with the electronic device and types of other electronic devices are obtained, and an operation mode of the electronic device is determined according to on-off conditions of each circuit (including the first circuit, the second circuit and the third circuit) of the electronic device under each connection condition. If the first USB interface is a Type-a interface, and the second USB interface is a Type-C interface, the following description is made on several working modes of the embodiment of the present application by referring to a schematic circuit connection structure of an electronic device shown in fig. 3:
The default mode and the connection condition corresponding to the working mode are as follows: the first USB interface of the electronic device is not connected with the first other electronic device, and the second USB interface of the electronic device is not connected with the second other electronic device. It can be understood that the connection condition is a condition that the electronic device does not interact with any other electronic device, for example, a condition that the electronic device is charged by using a Type-C interface. Under the connection condition, the on-off condition of each circuit of the electronic equipment is that a first switch on a first circuit is opened, a second switch on a second circuit is closed, and a third switch on a third circuit is opened, namely the first circuit and the third circuit are not electrified, and the second circuit is electrified, so that a CPU of the electronic equipment can still interact with a second USB interface under the default mode, and the functions of charging, file transmission and the like of the electronic equipment can still be realized through the second USB interface.
For example, if the user does not connect the first USB interface of the electronic device with the first other electronic device, the state of the first CC pin in the first USB interface will not change, and the state of the first pin should be the state where the first other electronic device is not connected. Similarly, if the user does not connect the second other electronic device with the second USB interface of the electronic device, the state of the second CC pin in the second USB interface will not change, and the state of the second pin should be the state where the second other electronic device is not connected. Therefore, the CPU of the electronic device determines that the first USB interface is not connected with the first other electronic devices and the second USB interface is not connected with the second other electronic devices at present by detecting the state of the first CC pin in the first USB interface and the state of the second CC pin in the second USB interface, and controls the first switch on the first circuit to be opened, the second switch on the second circuit to be closed and the third switch on the third circuit to be opened, namely, controls the electronic device to work in a default mode, and only the second USB interface can be normally used in the default mode. Fig. 4 is a schematic circuit diagram of still another electronic device according to some embodiments of the present application. As shown in fig. 4, when the first USB interface of the CPU of the electronic device is not connected to the first other electronic device and the second USB interface is not connected to the second other electronic device, the USB3.0 SWITCH x 2 is controlled to be on, the USB2.0 SWITCH1 is controlled to be off, and the USB2.0 SWITCH2 is controlled to be off.
The working mode 1 and the corresponding connection condition of the working mode are as follows: the first USB interface of the electronic device is not connected with a first other electronic device, and the second USB interface of the electronic device is connected with a second other electronic device, wherein the type of the second other electronic device can be dp device or otg device. It will be appreciated that such a connection mode is the case where the electronic device only interacts with a second other electronic device. Under the connection condition, the on-off condition of each circuit of the electronic equipment is that a first switch on a first circuit is opened, a second switch on a second circuit is closed, and a third switch on a third circuit is opened, namely the first circuit and the third circuit are not electrified, and the second circuit is electrified, so that in the working mode 1, second other electronic equipment connected with a second USB interface can directly interact with a CPU based on a USB3.0 protocol.
For example, if the second other electronic device is an otg device, after the user connects the second other electronic device with the second USB interface of the electronic device, the state of the second CC pin in the second USB interface is changed, so that the changed state is the state when the second USB interface is connected with the otg device. The state of the first CC pin in the first USB interface will not change, and the state of the first pin should be the state of not being connected with the first other electronic device, because the first USB interface of the electronic device is not connected with the first other electronic device. Therefore, if the CPU of the electronic device determines that the first USB interface is not connected with the first other electronic device and the second other electronic device connected with the second USB interface is the otg device by detecting the state of the first CC pin in the first USB interface and the state of the second CC pin in the second USB interface, the CPU controls the first switch on the first line to be turned off, the second switch on the second line to be turned on, and the third switch on the third line to be turned off, and triggers the first otg loading process, so that after the otg device is connected with the electronic device, the CPU can work normally. Fig. 4 is a schematic circuit diagram of an electronic device according to some embodiments of the present application. As shown in fig. 4, when the CPU of the electronic device determines that the first USB interface is not connected to the first other electronic device and the second other electronic device connected to the second USB interface is an otg device, the CPU controls USB3.0 SWITCH x 2 on, USB2.0 SWITCH1 off, and USB2.0 SWITCH2 off, that is, the CPU controls the electronic device to interact with the second other electronic device in the working mode 1.
Taking the above example, after the user disconnects the second other electronic device from the second USB interface of the electronic device, the state of the second CC pin included in the second USB interface is changed, so that the changed state is the state when the second USB interface is not connected with the otg device. The state of the first CC pin in the first USB interface is unchanged, and the state of the first pin is still the state of the first other electronic device not connected. Therefore, if the CPU of the electronic device determines that the second other electronic device connected to the second USB interface is removed by detecting the state of the first CC pin in the first USB interface and the state of the second CC pin in the second USB interface, the first switch on the first line is kept open, the second switch on the second line is closed, and the third switch on the third line is opened, and triggers the otg unloading procedure. As shown in fig. 4, when the CPU of the electronic device determines that the second other electronic device connected to the current second USB interface is removed, the electronic device is controlled to operate in the default mode from the operation mode 1 by controlling the USB3.0 SWITCH x 2 on, the USB2.0 SWITCH1 off, and the USB2.0 SWITCH2 off.
For example, if the second other electronic device is a dp device, after the user connects the second other electronic device with the second USB interface of the electronic device, the state of the second CC pin in the second USB interface is changed, so that the changed state is the state when the dp device is connected to the second USB interface. The state of the first CC pin in the first USB interface will not change, and the state of the first pin should be the state of not being connected with the first other electronic device, because the first USB interface of the electronic device is not connected with the first other electronic device. Therefore, if the CPU of the electronic device determines that the first USB interface is not connected with the first other electronic device and the second other electronic device connected with the second USB interface is dp device by detecting the state of the first CC pin in the first USB interface and the state of the second CC pin in the second USB interface, the CPU controls the first switch on the first line to be opened, the second switch on the second line to be closed and the third switch on the third line to be opened, and triggers the second otg loading process, so as to implement transmission of the PD protocol, and complete dp event triggering, thereby facilitating connection between the dp device and the electronic device and obtaining data sent by the electronic device. Fig. 4 is a schematic circuit diagram of an electronic device according to some embodiments of the present application. As shown in fig. 4, when the CPU of the electronic device determines that the first USB interface is not connected to the first other electronic device and the second other electronic device connected to the second USB interface is dp device, the CPU controls USB3.0 SWITCH x2 on, USB2.0 SWITCH1 off, and USB2.0 SWITCH2 off, that is, controls the electronic device to interact with the dp device in the working mode 1.
For example, when the user disconnects the second other electronic device from the second USB interface of the electronic device, the state of the second CC pin included in the second USB interface is changed, so that the changed state is the state when the dp device is not connected to the second USB interface. The state of the first CC pin in the first USB interface is unchanged, and the state of the first pin is still the state of the first other electronic device not connected. Therefore, if the CPU of the electronic device determines that the second other electronic device connected to the second USB interface is removed by detecting the state of the first CC pin in the first USB interface and the state of the second CC pin in the second USB interface, the first switch on the first line is kept open, the second switch on the second line is closed, and the third switch on the third line is opened, and triggers the otg unloading procedure. As shown in fig. 4, when the CPU of the electronic device determines that the second other electronic device connected to the current second USB interface is removed, the electronic device is controlled to operate in the default mode from the operation mode 1 by controlling the USB3.0 SWITCH x 2 on, the USB2.0 SWITCH1 off, and the USB2.0 SWITCH2 off.
The working mode 2 and the connection condition corresponding to the working mode are as follows: the first USB interface of the electronic device is connected with a first other electronic device, and the second USB interface of the electronic device is not connected with a second other electronic device, wherein the type of the first other electronic device is otg equipment. It will be appreciated that such a connection mode is the case where the electronic device only interacts with the first other electronic device. Under the connection condition, the on-off condition of each circuit of the electronic equipment is that a first switch on a first circuit is closed, a second switch on a second circuit is closed, and a third switch on a third circuit is opened, namely the third circuit is not electrified, and the first circuit and the second circuit are electrified, so that under the working mode 2, first other electronic equipment connected with a first USB interface can interact with a CPU through a multiplexer based on a USB2.0 protocol.
For example, if the first other electronic device is an otg device, after the user connects the first other electronic device with the first USB interface of the electronic device, the state of the first CC pin in the first USB interface is changed, so that the changed state is the state when the first USB interface is connected with the otg device. The state of the second CC pin in the second USB interface will not change, and the state of the second pin should be the state of the second other electronic device not connected. Therefore, if the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is an otg device and the second USB interface is not connected to the second other electronic device by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, the CPU controls the first switch on the first line to be closed, keeps the second switch on the second line to be closed and the third switch on the third line to be opened, and triggers the first otg loading process, so that after the otg device is connected to the electronic device, the CPU can work normally. As shown in fig. 4, when the CPU of the electronic device determines that the second USB interface is not connected to the second other electronic device, and the first other electronic device connected to the first USB interface is an otg device, the CPU controls USB3.0 SWITCH x2 on, USB2.0 SWITCH1 on, and USB2.0 SWITCH2 off, that is, controls the electronic device to interact with the first other electronic device in the working mode 2.
Taking the above example, when the user disconnects the first other electronic device from the first USB interface of the electronic device, the state of the first CC pin included in the first USB interface is changed, so that the changed state is the state when the first USB interface is not connected with the otg device. The state of the second CC pin in the second USB interface is unchanged, and the state of the second pin is still the state of the second other electronic device not connected, because the second USB interface of the electronic device is not connected with the second other electronic device. Therefore, if the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is removed by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, the first switch on the first line is controlled to be turned off, the second switch on the second line is kept turned on, and the third switch on the third line is turned off, and the otg unloading procedure is triggered. As shown in fig. 4, when the CPU of the electronic device determines that the first other electronic device connected to the current first USB interface is removed, the electronic device is controlled to operate in the default mode from the operation mode 2 by controlling the USB3.0 SWITCH to be on, the USB2.0 SWITCH to be off, and the USB2.0 SWITCH to be off.
The working mode 3 and the connection condition corresponding to the working mode are as follows: the first USB interface of the electronic device is connected with a first other electronic device, the second USB interface of the electronic device is connected with a second other electronic device, the type of the first other electronic device is otg equipment, and the type of the second other electronic device is otg equipment. It is understood that this connection mode is the case when the electronic device interacts with the first other electronic device and the second other electronic device at the same time. Under the connection condition, the on-off condition of each circuit of the electronic equipment is that a first switch on a first circuit is closed, a second switch on a second circuit is opened, and a third switch on a third circuit is closed, namely the second circuit is not electrified, and the first circuit and the third circuit are electrified, so that under the working mode 3, the first other electronic equipment and the second other electronic equipment can interact with the CPU through a multiplexer based on a USB2.0 protocol, and the dp equipment and the otg equipment can interact with the electronic equipment simultaneously.
For example, after a user connects a first other electronic device with a first USB interface of an electronic device, a state of a first CC pin in the first USB interface is changed, so that the changed state is a state when the first USB interface is connected with an otg device, a CPU of the electronic device determines that the first other electronic device connected with the first USB interface is the otg device by detecting the state of the first CC pin in the first USB interface, and then controls a first SWITCH on a first line to be closed, keeps a second SWITCH on a second line to be closed, and keeps a third SWITCH on a third line to be opened, that is, controls USB3.0 SWITCH x2 to be opened, USB2.0 SWITCH2 to be opened, and USB2.0 SWITCH2 to be closed as shown in fig. 4, and triggers a first otg loading flow, so that after the first other electronic device is connected with the electronic device, the electronic device can work normally. It will be appreciated that the control electronics transitions from the default mode to the operational mode 2. After the user connects the second other electronic device with the second USB interface of the electronic device, the state of the second CC pin in the second USB interface is changed, so that the changed state is the state when the second USB interface is connected with the otg device, the CPU of the electronic device determines that the second other electronic device connected with the current second USB interface is the otg device by detecting the state of the second CC pin in the second USB interface, and then the first SWITCH on the first line is kept closed, the second SWITCH on the second line is controlled to be opened, and the third SWITCH on the third line is controlled to be closed, that is, the control USB3.0 SWITCH2 is closed, the USB2.0 SWITCH1 is opened, and the USB2.0 SWITCH2 is opened, so as to trigger the first otg loading flow, so that the second other electronic device can work normally after being connected with the electronic device. It will be appreciated that the control electronics switches from operating mode 2 to operating mode 3.
For example, when the user connects the second other electronic device with the second USB interface of the electronic device, the CPU of the electronic device determines that the second other electronic device connected with the second USB interface is an otg device by detecting the state of the second CC pin in the second USB interface, and then controls the first SWITCH on the first line to be turned off, the second SWITCH on the second line to be turned on, and the third SWITCH on the third line to be turned off, that is, controls USB3.0 SWITCH x2 to be turned on, USB2.0 SWITCH1 to be turned off, and USB2.0 SWITCH2 to be turned off, as shown in fig. 4, and triggers the first otg loading procedure, so that after the second other electronic device is connected with the electronic device, the electronic device can work normally. It will be appreciated that the control electronics transitions from the default mode to the operational mode 1. After the user connects the first other electronic device with the first USB interface of the electronic device, the CPU of the electronic device determines that the first other electronic device connected with the first USB interface is an otg device by detecting the state of the first CC pin in the first USB interface, and then controls the first SWITCH on the first line to be closed, controls the second SWITCH on the second line to be opened, and controls the third SWITCH on the third line to be closed, that is, controls the USB3.0 SWITCH x2 SWITCH, the USB2.0 SWITCH1 SWITCH, and the USB2.0 SWITCH2 SWITCH shown in fig. 4, and triggers the first otg loading procedure, so that the first other electronic device can work normally after being connected with the electronic device. It will be appreciated that the control electronics switches from operating mode 1 to operating mode 3.
Taking the above example, when the user disconnects the first other electronic device from the first USB interface of the electronic device, the state of the first CC pin included in the first USB interface is changed, so that the changed state is the state when the first USB interface is not connected with the otg device. The second USB interface of the electronic device is still connected to a second other electronic device, so that the state of the second CC pin in the second USB interface is unchanged, and the state of the second pin is still connected to the otg device. Therefore, the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is removed by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, and then controls the first SWITCH on the first line to be turned off, the second SWITCH on the second line is turned on, and the third SWITCH on the third line is turned off, that is, controls USB3.0 SWITCH x2 on, USB2.0 SWITCH1 off, USB2.0 SWITCH2 off, as shown in fig. 4, and triggers the otg offloading procedure to disconnect the first other electronic device from the CPU. It will be appreciated that the control electronics switches from operating mode 3 to operating mode 1. And then after the user disconnects the second other electronic equipment from the second USB interface of the electronic equipment, changing the state of a second CC pin contained in the second USB interface, so that the changed state is the state when the second USB interface is not connected with the otg equipment, and the state of a first CC pin of the first USB interface is unchanged. Therefore, by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, the CPU of the electronic device determines that the second other electronic device connected to the second USB interface is also removed, and keeps the first SWITCH on the first line open, the second SWITCH on the second line closed and the third SWITCH on the third line open, that is, keeps the USB3.0 SWITCH x2 open, the USB2.0 SWITCH1 closed, and the USB2.0 SWITCH2 closed as shown in fig. 4, and triggers the otg offloading procedure to disconnect the second other electronic device from the CPU. It will be appreciated that the control electronics reverts from operating mode 1 to the default mode.
For example, after the user disconnects the second other electronic device from the second USB interface of the electronic device, the CPU of the electronic device determines that the second other electronic device connected to the second USB interface is removed by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, and then keeps the first SWITCH on the first line closed, controls the second SWITCH on the second line to be closed and controls the third SWITCH on the third line to be opened, that is, controls the USB3.0 SWITCH x 2, the USB2.0 SWITCH1, and the USB2.0 SWITCH2 to be closed as shown in fig. 4, and triggers the otg unloading procedure to disconnect the second other electronic device from the CPU. It will be appreciated that the control electronics transitions from operating mode 3 to operating mode 2. Then, after the user disconnects the first other electronic device from the first USB interface of the electronic device, the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is also removed by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, and then controls the first SWITCH on the first line to be turned off, and keeps the second SWITCH on the second line to be turned on, and the third SWITCH on the third line to be turned off, that is, keeps the USB3.0 SWITCH on, the USB2.0 SWITCH off, and the USB2.0 SWITCH off as shown in fig. 4, and triggers the otg unloading procedure to disconnect the first other electronic device from the CPU. It will be appreciated that the control electronics transitions from operating mode 2 to the default mode.
The working mode 4 and the connection condition corresponding to the working mode are as follows: the first USB interface of the electronic device is connected with a first other electronic device, the second USB interface of the electronic device is connected with a second other electronic device, the type of the first other electronic device is otg device, and the type of the second other electronic device is dp device. It is understood that this connection mode is the case when the electronic device interacts with the first other electronic device and the second other electronic device at the same time. Under the connection condition, the on-off condition of each circuit of the electronic equipment is that a first switch on a first circuit is closed, a second switch on a second circuit is opened, and a third switch on a third circuit is closed, namely the second circuit is not electrified, and the first circuit and the third circuit are electrified, so that under the working mode 4, the first other electronic equipment and the second other electronic equipment can interact with the CPU through the multiplexer based on the USB2.0 protocol.
For example, after a user connects a first other electronic device with a first USB interface of an electronic device, a state of a first CC pin in the first USB interface is changed, so that the changed state is a state when the first USB interface is connected with an otg device, a CPU of the electronic device determines that the first other electronic device connected with the first USB interface is the otg device by detecting the state of the first CC pin in the first USB interface, and then controls a first SWITCH on a first line to be closed, keeps a second SWITCH on a second line to be closed, and keeps a third SWITCH on a third line to be opened, that is, controls USB3.0 SWITCH x 2 to be opened, USB2.0 SWITCH2 to be opened, and USB2.0 SWITCH2 to be closed as shown in fig. 4, and triggers a first otg loading flow, so that after the first other electronic device is connected with the electronic device, the electronic device can work normally. It will be appreciated that the control electronics transitions from the default mode to the operational mode 2. After the user connects the second other electronic device with the second USB interface of the electronic device, the state of the second CC pin in the second USB interface is changed, so that the changed state is the state when the second USB interface is connected with the dp device, and the CPU of the electronic device determines that the second other electronic device connected with the current second USB interface is the dp device by detecting the state of the second CC pin in the second USB interface, then the first SWITCH on the first line is kept closed, the second SWITCH on the second line is controlled to be opened, and the third SWITCH on the third line is controlled to be closed, that is, the USB3.0 SWITCH2 is controlled, the USB2.0 SWITCH1 is opened, and the USB2.0 SWITCH2 is opened, and triggers the second otg loading flow, so as to implement transmission of the PD protocol, and complete triggering of the dp event, thereby facilitating connection of the dp device with the electronic device, and obtaining data sent by the electronic device. It will be appreciated that the control electronics switches from operating mode 2 to operating mode 4.
For example, when the user connects the second other electronic device with the second USB interface of the electronic device, the CPU of the electronic device determines that the second other electronic device connected with the second USB interface is dp device by detecting the state of the second CC pin in the second USB interface, and then controls the first SWITCH on the first line to be turned off, the second SWITCH on the second line to be turned on, and the third SWITCH on the third line to be turned off, that is, controls USB3.0 SWITCH x2 SWITCH, USB2.0 SWITCH x1 SWITCH, USB2.0 SWITCH x2 SWITCH shown in fig. 4, and triggers the second otg loading procedure, so as to implement transmission of PD protocol, complete triggering of dp event, thereby facilitating connection of dp device with the electronic device, and obtaining data sent by the electronic device. It will be appreciated that the control electronics transitions from the default mode to the operational mode 1. After the user connects the first other electronic device with the first USB interface of the electronic device, the CPU of the electronic device determines that the first other electronic device connected with the first USB interface is an otg device by detecting the state of the first CC pin in the first USB interface, and then controls the first SWITCH on the first line to be closed, controls the second SWITCH on the second line to be opened, and controls the third SWITCH on the third line to be closed, that is, controls the USB3.0 SWITCH x2 SWITCH, the USB2.0 SWITCH1 SWITCH, and the USB2.0 SWITCH2 SWITCH shown in fig. 4, and triggers the first otg loading procedure, so that the first other electronic device can work normally after being connected with the electronic device. It will be appreciated that the control electronics switches from operating mode 1 to operating mode 4.
Taking the above example, when the user disconnects the first other electronic device from the first USB interface of the electronic device, the state of the first CC pin included in the first USB interface is changed, so that the changed state is the state when the first USB interface is not connected with the otg device. The second USB interface of the electronic device is still connected with the second other electronic devices, the state of the second CC pin in the second USB interface is not changed, and the state of the second pin is still connected with the dp device. Therefore, the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is removed by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, and then controls the first SWITCH on the first line to be turned off, the second SWITCH on the second line is turned on, and the third SWITCH on the third line is turned off, that is, the control USB3.0SWITCH ×2 SWITCH, the USB2.0 SWITCH1 SWITCH, the USB2.0 SWITCH2 SWITCH shown in fig. 4, and triggers the otg offloading procedure to disconnect the first other electronic device from the CPU. It will be appreciated that the control electronics transitions from operating mode 4 to operating mode 1. Then, after the user disconnects the second other electronic device from the second USB interface of the electronic device, the state of the second CC pin included in the second USB interface is changed, so that the changed state is the state when the second USB interface is not connected to the dp device, and the state of the first CC pin of the first USB interface is unchanged. Therefore, by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, the CPU of the electronic device determines that the second other electronic device connected to the second USB interface is also removed, and keeps the first SWITCH on the first line open, the second SWITCH on the second line closed and the third SWITCH on the third line open, that is, keeps the USB3.0SWITCH x 2 open, the USB2.0 SWITCH1 closed, and the USB2.0 SWITCH2 closed as shown in fig. 4, and triggers the otg offloading procedure to disconnect the second other electronic device from the CPU. It will be appreciated that the control electronics reverts from operating mode 1 to the default mode.
For example, after the user disconnects the second other electronic device from the second USB interface of the electronic device, the CPU of the electronic device determines that the second other electronic device connected to the second USB interface is removed by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, and then keeps the first SWITCH on the first line closed, controls the second SWITCH on the second line to be closed and controls the third SWITCH on the third line to be opened, that is, controls the USB3.0 SWITCH x 2, the USB2.0 SWITCH1, and the USB2.0 SWITCH2 to be closed as shown in fig. 4, and triggers the otg unloading procedure to disconnect the second other electronic device from the CPU. It will be appreciated that the control electronics transitions from operating mode 4 to operating mode 2. Then, after the user disconnects the first other electronic device from the first USB interface of the electronic device, the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is also removed by detecting the state of the second CC pin in the second USB interface and the state of the first CC pin in the first USB interface, and then controls the first SWITCH on the first line to be turned off, and keeps the second SWITCH on the second line to be turned on, and the third SWITCH on the third line to be turned off, that is, keeps the USB3.0 SWITCH on, the USB2.0 SWITCH off, and the USB2.0 SWITCH off as shown in fig. 4, and triggers the otg unloading procedure to disconnect the first other electronic device from the CPU. It will be appreciated that the control electronics transitions from operating mode 2 to the default mode.
It is understood that dp device is a master device and otg device is a slave device.
In the prior art, although electronic devices such as PCs and notebook computers have a plurality of USB interfaces, they can only operate in a control host mode as a master device and cannot operate in a service device mode as a slave device. The electronic equipment can work in the four working modes, so that the electronic equipment can be switched between a host mode and a device mode. When the electronic device is operated in host mode, all other electronic devices connected to the interface on the electronic device are otg devices, for example, a Type-A interface is connected with a USB flash disk, a mouse or other otg devices, and a Type-C interface is also connected with the mouse, the keyboard, the USB flash disk or other otg devices. When the electronic equipment works in the device mode, the Type-C interface on the electronic equipment can be connected with dp equipment such as pc, notebook computer and the like, and the Type-A interface on the electronic equipment is connected with a USB flash disk, a mouse or other otg equipment.
Example 4:
the application also provides a control method, and fig. 5 is a schematic diagram of a control process according to some embodiments of the application, where the process includes:
S501: if it is determined that the first USB interface on the electronic device is connected with the first other electronic device and the second USB interface on the electronic device is connected with the second other electronic device, controlling the CPU on the electronic device to be electrically connected with the multiplexer on the electronic device through the first circuit.
S502: and controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
The control method provided by the embodiment of the application is applied to the electronic equipment, and the electronic equipment can be intelligent equipment such as a mobile terminal, intelligent equipment, an intelligent brain and the like, and can also be a server.
It should be noted that, the specific description of the control method provided by the embodiment of the present application has been described in the foregoing embodiment, and the repetition is not repeated.
In some possible embodiments, the CPU is electrically connected to the multiplexer through a first line, comprising:
And if the first USB interface is connected with the first other electronic equipment and the second USB interface is connected with the second other electronic equipment, controlling a first switch supporting the USB2.0 protocol on the first line to be closed.
In some possible embodiments, the method further comprises:
If the first USB interface is determined to be not connected with the first other electronic equipment and the second USB interface is determined to be not connected with the second other electronic equipment, a first switch supporting a USB2.0 protocol on the first line is controlled to be opened, and a second switch supporting a USB3.0 protocol on the second line is controlled to be closed; the second circuit is used for connecting the CPU and the second USB interface.
In some possible embodiments, the CPU is electrically connected to the multiplexer through a first line, comprising:
And if the first USB interface is connected with the first other electronic equipment and the second USB interface is connected with the second other electronic equipment, controlling the first switch to be closed and controlling the second switch to be opened.
In some possible embodiments, the method further comprises:
And if the first USB interface is determined not to be connected with the first other electronic equipment and the second USB interface is determined to be connected with the second other electronic equipment, controlling the first switch to be opened and keeping the second switch to be closed.
In some possible embodiments, the method further comprises:
And if the first USB interface is determined to be connected with the first other electronic equipment and the second USB interface is determined to be not connected with the second other electronic equipment, controlling the first switch to be closed, keeping the second switch to be closed and keeping the third switch to be opened.
In some possible embodiments, the method further comprises:
If the first USB interface is connected with the first other electronic equipment and the second USB interface is connected with the second other electronic equipment, a third switch supporting a USB2.0 protocol on a third line is controlled to be closed; the third line is used for connecting the line converter and the second USB interface.
Example 5:
The application also provides a control method, and fig. 6 is a schematic structural diagram of a control device according to some embodiments of the application, where the process includes:
The first processing unit 61 is configured to control, if it is determined that a first USB interface on an electronic device is connected to a first other electronic device and a second USB interface on the electronic device is connected to a second other electronic device, the CPU on the electronic device to be electrically connected to the multiplexer on the electronic device through a first line;
And a second processing unit 62, configured to control the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
In some possible embodiments, the first processing unit 61 is specifically configured to control the first switch supporting the USB2.0 protocol on the first line to be closed if it is determined that the first USB interface is connected to a first other electronic device and the second USB interface is connected to a second other electronic device.
In some possible embodiments, the first processing unit 61 is further configured to control a first switch supporting the USB2.0 protocol on the first line to be opened and to keep a second switch supporting the USB3.0 protocol on the second line to be closed if it is determined that the first USB interface is not connected to the first other electronic device and it is determined that the second USB interface is not connected to the second other electronic device; the second circuit is used for connecting the CPU and the second USB interface.
In some possible embodiments, the first processing unit 61 is specifically configured to control the first switch to be closed and control the second switch to be opened if it is determined that the first USB interface is connected to a first other electronic device and the second USB interface is connected to a second other electronic device.
In some possible embodiments, the first processing unit 61 is further configured to control the first switch to be opened and keep the second switch to be closed if it is determined that the first USB interface is not connected to the first other electronic device and it is determined that the second USB interface is connected to the second other electronic device.
In some possible embodiments, the first processing unit 61 is further configured to, if it is determined that the first USB interface is connected to the first other electronic device and it is determined that the second USB interface is not connected to the second other electronic device, control the first switch to be closed, keep the second switch to be closed, and keep the third switch to be opened.
In some possible implementations, the first processing unit 61 is further configured to control a third switch supporting a USB2.0 protocol on a third line to be closed if it is determined that the first USB interface is connected to the first other electronic device and the second USB interface is connected to the second other electronic device; the third line is used for connecting the line converter and the second USB interface.
Example 6:
Fig. 7 is a schematic structural diagram of an electronic device according to some embodiments of the present application, and on the basis of the foregoing embodiments, the present application further provides an electronic device, as shown in fig. 7, including: the processor 71, the communication interface 72, the memory 73 and the communication bus 74, wherein the processor 71, the communication interface 72 and the memory 73 complete communication with each other through the communication bus 74;
The memory 73 has stored therein a computer program which, when executed by the processor 71, causes the processor 71 to perform the steps of:
if it is determined that a first USB interface on the electronic device is connected with a first other electronic device and a second USB interface on the electronic device is connected with a second other electronic device, controlling a CPU on the electronic device to be electrically connected with a multiplexer on the electronic device through a first line;
And controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
Because the principle of the electronic device for solving the problem is similar to that of the control method, the implementation of the electronic device can refer to the implementation of the method, and the repetition is not repeated.
The communication bus mentioned above for the electronic device may be a peripheral component interconnect standard (PERIPHERAL COMPONENT INTERCONNECT, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface 72 is used for communication between the above-described electronic device and other devices.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; but also digital instruction processors (DIGITAL SIGNAL Processing units, DSPs), application specific integrated circuits, field programmable gate arrays or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
Example 7:
On the basis of the above embodiments, the present application also provides a computer readable storage medium having stored therein a computer program executable by a processor, which when run on the processor, causes the processor to perform the steps of:
if it is determined that a first USB interface on the electronic device is connected with a first other electronic device and a second USB interface on the electronic device is connected with a second other electronic device, controlling a CPU on the electronic device to be electrically connected with a multiplexer on the electronic device through a first line;
And controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
Since the principle of solving the problem by using the computer readable medium is similar to that of the control method, after the processor executes the computer program in the computer readable medium, the steps of implementation can be referred to as implementation of the method, and the repetition is omitted.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.

Claims (9)

1. An electronic device, the electronic device comprising: the device comprises a first USB interface, a second USB interface, a multiplexer and a central processing unit CPU; wherein, the interface types of the first USB interface and the second USB interface are different;
The CPU is used for electrically connecting with the multiplexer through a first circuit if the first USB interface is determined to be connected with a first other electronic device and the second USB interface is determined to be connected with a second other electronic device; controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface;
the CPU is further configured to control, if it is determined that the first USB interface is not connected to the first other electronic device and it is determined that the second USB interface is not connected to the second other electronic device, to open a first switch supporting a USB2.0 protocol on the first line and to keep a second switch supporting a USB3.0 protocol on the second line closed; the second circuit is used for connecting the CPU and the second USB interface.
2. The electronic device of claim 1, wherein the CPU is specifically configured to control a first switch on the first line that supports a USB2.0 protocol to be closed if it is determined that the first USB interface is connected to a first other electronic device and the second USB interface is connected to a second other electronic device.
3. The electronic device of claim 1, wherein the CPU is specifically configured to control the first switch to be closed and control the second switch to be opened if it is determined that the first USB interface is connected with a first other electronic device and the second USB interface is connected with a second other electronic device.
4. The electronic device of claim 1, wherein the CPU is further configured to control the first switch to open and to keep the second switch closed if it is determined that the first USB interface is not connected to the first other electronic device and that the second USB interface is connected to the second other electronic device.
5. The electronic device of claim 1, wherein the CPU is further configured to control the first switch to be closed, keep the second switch to be closed, and keep a third switch supporting a USB2.0 protocol on a third line to be opened if it is determined that the first USB interface is connected to the first other electronic device and it is determined that the second USB interface is not connected to the second other electronic device; the third line is used for connecting the multiplexer and the second USB interface.
6. The electronic device of any of claims 1-5, wherein the CPU is further configured to control a third switch on a third line that supports a USB2.0 protocol to be closed if it is determined that the first USB interface is connected to the first other electronic device and the second USB interface is connected to the second other electronic device; the third line is used for connecting the multiplexer and the second USB interface.
7. A control method, characterized in that the method comprises:
If it is determined that a first USB interface on the electronic device is connected with a first other electronic device and a second USB interface on the electronic device is connected with a second other electronic device, controlling a CPU on the electronic device to be electrically connected with a multiplexer on the electronic device through a first line; controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface;
If the first USB interface is determined to be not connected with the first other electronic equipment and the second USB interface is determined to be not connected with the second other electronic equipment, a first switch supporting a USB2.0 protocol on the first line is controlled to be opened, and a second switch supporting a USB3.0 protocol on the second line is controlled to be closed; the second circuit is used for connecting the CPU and the second USB interface.
8. A control apparatus, characterized in that the apparatus comprises:
The first processing unit is used for controlling the CPU on the electronic equipment to be electrically connected with the multiplexer on the electronic equipment through a first line if the first USB interface on the electronic equipment is determined to be connected with the first other electronic equipment and the second USB interface on the electronic equipment is determined to be connected with the second other electronic equipment;
The second processing unit is used for controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface;
The first processing unit is further configured to control a first switch supporting a USB2.0 protocol on the first line to be opened and to keep a second switch supporting a USB3.0 protocol on the second line to be closed if it is determined that the first USB interface is not connected with the first other electronic device and that the second USB interface is not connected with the second other electronic device; the second circuit is used for connecting the CPU and the second USB interface.
9. A computer-readable storage medium, characterized in that it stores a computer program which, when executed by a processor, implements the steps of the control method according to claim 7.
CN202111157180.0A 2021-09-30 2021-09-30 Electronic equipment, control method, device and medium Active CN113934661B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111157180.0A CN113934661B (en) 2021-09-30 2021-09-30 Electronic equipment, control method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111157180.0A CN113934661B (en) 2021-09-30 2021-09-30 Electronic equipment, control method, device and medium

Publications (2)

Publication Number Publication Date
CN113934661A CN113934661A (en) 2022-01-14
CN113934661B true CN113934661B (en) 2024-06-04

Family

ID=79277738

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111157180.0A Active CN113934661B (en) 2021-09-30 2021-09-30 Electronic equipment, control method, device and medium

Country Status (1)

Country Link
CN (1) CN113934661B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116431038B (en) * 2023-06-13 2023-10-03 Tcl通讯科技(成都)有限公司 Connection on-off prompting method, device, medium and equipment for external storage equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109286838A (en) * 2017-07-20 2019-01-29 青岛海信电器股份有限公司 Electric terminal equipment, television terminal, signal input circuit and method
CN110311436A (en) * 2019-06-25 2019-10-08 合肥联宝信息技术有限公司 A kind of charging circuit and electronic equipment of USB interface
CN110618672A (en) * 2019-10-18 2019-12-27 深圳市道通科技股份有限公司 Interface circuit and interface communication method and device thereof
CN112799985A (en) * 2021-04-14 2021-05-14 智道网联科技(北京)有限公司 USB interface control method, USB control circuit and intelligent networking equipment mainboard

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10268627B2 (en) * 2016-08-23 2019-04-23 Dell Products L.P. Automatically configuring a universal serial bus (USB) type-C port of a computing device
US11176071B2 (en) * 2018-11-09 2021-11-16 Cypress Semiconductor Corporation USB signal switch circuitry using standard USB hub and method of operation the same

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109286838A (en) * 2017-07-20 2019-01-29 青岛海信电器股份有限公司 Electric terminal equipment, television terminal, signal input circuit and method
CN110311436A (en) * 2019-06-25 2019-10-08 合肥联宝信息技术有限公司 A kind of charging circuit and electronic equipment of USB interface
CN110618672A (en) * 2019-10-18 2019-12-27 深圳市道通科技股份有限公司 Interface circuit and interface communication method and device thereof
CN112799985A (en) * 2021-04-14 2021-05-14 智道网联科技(北京)有限公司 USB interface control method, USB control circuit and intelligent networking equipment mainboard

Also Published As

Publication number Publication date
CN113934661A (en) 2022-01-14

Similar Documents

Publication Publication Date Title
CN108666826B (en) Adapter, terminal equipment and adapter system
US10311000B2 (en) Integrated universal serial bus (USB) type-C switching
JP5055489B2 (en) Bidirectional single-wire interrupt line for communication bus
US8713209B2 (en) System, apparatus, and method for fast startup of USB devices
CN107391419B (en) Support general sequence busbar concentrator of many host computers and automobile-used host computer
CN108920397B (en) Device identification method and device, storage medium and electronic device
CN107885683B (en) Terminal and current testing method thereof
US10042800B2 (en) Active USB device and switching method for operating mode thereof
US20140280960A1 (en) Methods and apparatus for dynamically allocating devices between multiple controllers
CN109428727B (en) Power supply equipment and energy-saving method for power over Ethernet
CN113934661B (en) Electronic equipment, control method, device and medium
CN108399136B (en) Control method and device of serial interface and host
CN112732616A (en) BMC starting method, device and equipment based on SPI controller
US20210224216A1 (en) Configurable usb-c alternate mode for multi-level controller communication
WO2024094068A1 (en) Communication connection control method, vehicle-mounted device, communication system and storage medium
CN111433756B (en) Terminal and Type C interface anti-corrosion method
EP3547108A1 (en) Method, device for processing data of bluetooth speaker, and bluetooth speaker
JP6434630B2 (en) USB OTG device identification system and apparatus
CN114116415B (en) Hard disk backboard, hard disk lighting control system, method, device and medium
CN102821444B (en) Automatic power consumption control method and system
EP3048858A1 (en) Wireless customer premise equipment and accessing method therefor
CN212208279U (en) USB interface switching device and terminal equipment
CN112290639B (en) Interface circuit and electronic equipment charge
CN110442539B (en) Mobile phone OTG switching method and device
JP7149421B2 (en) ELECTRONIC DEVICE AND CONTROL METHOD OF ELECTRONIC DEVICE

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Applicant after: Qingdao Hisense Mobile Communication Technology Co.,Ltd.

Address before: 266071 Shandong city of Qingdao province Jiangxi City Road No. 11

Applicant before: HISENSE MOBILE COMMUNICATIONS TECHNOLOGY Co.,Ltd.

Country or region before: China

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant