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

Electronic equipment, control method, device and medium Download PDF

Info

Publication number
CN113934661A
CN113934661A CN202111157180.0A CN202111157180A CN113934661A CN 113934661 A CN113934661 A CN 113934661A CN 202111157180 A CN202111157180 A CN 202111157180A CN 113934661 A CN113934661 A CN 113934661A
Authority
CN
China
Prior art keywords
usb interface
electronic device
cpu
electronic equipment
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.)
Granted
Application number
CN202111157180.0A
Other languages
Chinese (zh)
Other versions
CN113934661B (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

Images

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, an apparatus and a medium. Because the electronic equipment is provided with the first USB interface and the second USB interface which are different in interface types, the electronic equipment can be connected with first other electronic equipment through the first USB interface, and the second USB interface is connected with second other electronic equipment. Meanwhile, because the electronic equipment is also provided with the multi-channel repeater, 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 multi-channel converter through the first line so as to control the multi-channel converter to send the signal sent by the CPU to the first USB interface and/or the second USB interface, the electronic equipment can be interacted with the first other electronic equipment and the second electronic equipment at the same time, and the electronic equipment can provide services with different interface types conveniently and simultaneously.

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
At present, although the interface types of Universal Serial Bus (USB) interfaces of electronic devices on the market mainly include Type-C and Type-a interface types, a USB interface of only one interface Type exists on a general electronic device, for example, only one USB interface of a Type-C interface Type exists on some mobile phones, and only one USB interface of a Type-a interface Type exists on some mobile phones, so that the electronic device can only provide services of one interface Type. When the electronic equipment is required to provide services of another interface type, the services cannot be realized through the USB interface on the electronic equipment, the performance of the electronic equipment is reduced, inconvenience is brought to the use of the electronic equipment by a user, and user experience is influenced.
Disclosure of Invention
The application provides electronic equipment, a control method, a control device and a medium, which are used for solving the problems that the existing electronic equipment can only provide one interface type of service and the performance of the electronic equipment is reduced.
The application provides an electronic device, the electronic device includes: the USB interface comprises a first USB interface, a second USB interface, a multiplexer and a Central Processing Unit (CPU); the first USB interface and the second USB interface are different in interface type;
the CPU is used for electrically connecting with the multiplexer through a first line if the first USB interface is determined to be connected with first other electronic equipment and the second USB interface is determined to be connected with second other electronic equipment; 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 the first USB interface on the electronic equipment is determined to be connected with first other electronic equipment and the second USB interface on the electronic equipment is determined to be connected with second other electronic equipment, controlling a CPU on the electronic equipment to be electrically connected with a multiplexer on the electronic equipment 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 a CPU on the electronic equipment to be electrically connected with a multiplexer on the electronic equipment through a first line if it is determined that a first USB interface on the electronic equipment is connected with first other electronic equipment and a second USB interface on the electronic equipment is connected with 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 present application provides that the electronic device comprises at least a processor and a memory, the processor being configured 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, in which a computer program is stored, which computer program, when being executed by a processor, realizes 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 which are different in interface types, the electronic equipment can be connected with first other electronic equipment through the first USB interface, and the second USB interface is connected with second other electronic equipment. Meanwhile, because the electronic equipment is also provided with the multi-channel repeater, 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 multi-channel converter through the first line so as to control the multi-channel converter to send the signal sent by the CPU to the first USB interface and/or the second USB interface, the electronic equipment can be interacted with the first other electronic equipment and the second electronic equipment at the same time, the electronic equipment can provide services with different interface types at the same time conveniently, and the performance of the electronic equipment is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
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 illustrating that a Type-a interface and a Type-C interface provided in some embodiments of the present application are respectively connected to a CPU;
fig. 3 is a schematic circuit connection structure diagram of an electronic device according to some embodiments of the present application;
fig. 4 is a schematic circuit structure diagram of another electronic device according to some embodiments of the present application;
FIG. 5 is a schematic diagram of a control process provided in some embodiments of the present application;
FIG. 6 is a schematic structural diagram of a control device according to some embodiments of the present disclosure;
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 provide services with different interface types at the same time and improve the performance of the electronic equipment, the application provides the electronic equipment, a control method, a device and a medium.
In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be described in further detail with reference to the accompanying drawings, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In an actual application process, when a user wants to interact with other electronic devices of different interface types through the electronic device at the same time, the other electronic device of a certain interface type (for convenience of description, denoted as a first electronic device) may be connected with a USB interface of a corresponding interface type (for convenience of description, denoted as a first USB interface) on the electronic device, and the other electronic device of another interface type (for convenience of description, denoted as a second electronic device) may be connected with a USB interface of a corresponding interface type (for convenience of description, denoted as a second USB interface) on the electronic device. If 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 is electrically connected with the multiplexer through the first line so as to control the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface, and therefore the electronic equipment can interact with the first other electronic equipment and the second electronic equipment 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 central processing unit CPU 14; the first USB interface and the second USB interface are different in interface type;
the CPU is used for electrically connecting with the multiplexer through a first line if the first USB interface is determined to be connected with first other electronic equipment and the second USB interface is determined to be connected with second other electronic equipment; 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 an actual application process, when a user wants to interact with other electronic devices of different interface types through the electronic device at the same time, the other electronic device of a certain interface type (for convenience of description, denoted as a first electronic device) may be connected with a USB interface of a corresponding interface type (for convenience of description, denoted as a first USB interface) on the electronic device, and the other electronic device of another interface type (for convenience of description, denoted as a second electronic device) may be connected with a USB interface of a corresponding interface type (for convenience of description, denoted as a second USB interface) on the electronic device.
Wherein, 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 a Type of Type-a interface, the USB interface can only be connected to other electronic devices (for convenience of description, referred to as otg devices) with a data connection (otg) Type, such as a USB disk, a mouse, a keyboard, and the like; for the USB interface with the Type of Type-C interface, the USB interface may be connected to other electronic devices with otg Type, or may be connected to other electronic devices with display interface (dp) Type (for convenience of description, denoted as dp devices), such as a display, a projector, and the like.
In order that the electronic equipment can provide services with different interface types at the same time, the performance of the electronic equipment is improved, and the electronic equipment 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 equipment can determine whether other electronic equipment is connected with the current first USB interface and the current second USB interface, and when the CPU of the electronic equipment determines that other electronic equipment is connected with the current first USB interface and the current second USB interface, the CPU of the electronic equipment is electrically connected with a multiplexer of the electronic equipment, and the multiplexer is controlled to send signals sent by the CPU to the first USB interface and/or the second USB interface, so that the electronic equipment can provide services with different interface types at the same time.
In a possible implementation manner, since the first other electronic device is connected to the first USB interface of 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 with 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 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 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.
And the CPU can also determine the type of the first other electronic equipment connected with the current first USB interface according to the state of the first CC pin.
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 a second other electronic device is connected to the second USB interface of the 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 the second USB interface of the electronic equipment is connected with 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.
And the CPU can also determine the type of the second other electronic equipment connected with the current second USB interface according to the state of the second CC pin.
In one possible implementation, since the USB2.0 port physical layer (phy) of the USB interface of Type-a (for convenience of description, referred to as Type-a interface) can only be connected to the CPU through the multiplexer (hub), the USB2.0 phy of the USB interface of Type-C (for convenience of description, referred to 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 provided in some embodiments of the present application, respectively connected to a CPU. As shown in FIG. 2, the USB2.0 phy of the Type-A interface can be connected with the USB phy of the CPU only through the hub, and the USB2.0 phy of the Type-C interface can also be connected with the USB phy of the CPU through the hub. Therefore, in order to realize that an electronic device can provide services of different interface types at the same time, in the present application, a multiplexer is provided in the electronic device, and the multiplexer can be connected to the CPU through a line (for convenience of description, referred to as a first line). In a specific implementation process, when a CPU in the electronic device determines that the first USB interface is connected with first other electronic devices and the second USB interface is connected with second other electronic devices, the CPU is electrically connected with the multiplexer through the first line, and the subsequent CPU can send signals to the multiplexer through the first line. 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 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 CPU and the multiplexer to be electrically connected, in this application, a switch (for convenience of description, referred to as a first switch) supporting the USB2.0 protocol is provided on the first line. When the CPU of the electronic equipment determines that the first USB interface is connected with first other electronic equipment and the second USB interface is connected with second other electronic equipment, in order to realize the electric connection of the CPU and the multiplexer, the CPU controls the first circuit to be provided with a first switch which supports the USB2.0 protocol to be closed.
In a possible implementation manner, when the electronic device determines that its own USB interface (including the first USB interface and the second USB interface) is connected with the otg device, the first otg loading process is triggered, so that the otg device can normally operate after being connected with the electronic device.
In a possible implementation manner, when the electronic device determines that the USB interface of the electronic device is connected to a dp device, the second otg loading process is triggered to implement transmission of a Power Delivery (PD) protocol, and dp event triggering is completed, so that data sent by the electronic device can be acquired after the dp device is connected to the electronic device.
In one possible implementation, the user may disconnect the first USB interface of the electronic device from the first other electronic device and disconnect the second USB interface of the electronic device from the second other electronic device without requiring the electronic device to simultaneously provide services of different interface types. 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 indicates that the electronic device is no longer required to interact with the first other electronic device and the second other electronic device at the same time, and the CPU may stop being electrically connected to the multiplexer through the first line.
In a possible embodiment, in order to accurately control the CPU not to be electrically connected to the multiplexer, in this 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 switched from on to off.
In the practical application process, the state of the first CC pin included in the first USB interface is changed due to the disconnection between the first other electronic device and 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 with 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 is changed due to the disconnection of the second other electronic device from the second USB interface on the electronic device. Therefore, the CPU of the electronic device may determine whether a second other electronic device is connected to the second USB interface of the 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 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 which are different in interface types, the electronic equipment can be connected with first other electronic equipment through the first USB interface, and the second USB interface is connected with second other electronic equipment. Meanwhile, because the electronic equipment is also provided with the multi-channel repeater, 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 multi-channel converter through the first line so as to control the multi-channel converter to send the signal sent by the CPU to the first USB interface and/or the second USB interface, the electronic equipment can be interacted with the first other electronic equipment and the second electronic equipment at the same time, the electronic equipment can provide services with different interface types at the same time conveniently, 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, on the basis of the above embodiment, 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 the first switch supporting the USB2.0 protocol on the first line to be opened, and keep the second switch supporting the USB3.0 protocol on the second line to be closed; the second line is used for connecting the CPU and the second USB interface.
In the practical application process, both the USB2.0 phy and the USB3.0 of the Type-C interface can directly interact with the CPU, the USB2.0 phy of the Type-C interface can also 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 can also interact directly with the CPU's USB phy. Therefore, in the present application, a line (for convenience of description, referred to as a second line) for directly connecting the CPU and the second USB interface is provided in advance in the electronic device, and a switch (for convenience of description, referred to as a second switch) supporting the USB3.0 protocol is provided in 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 and affects the interaction between the CPU and the first USB interface and the interaction between the CPU and the second USB interface simultaneously, when the CPU determines that the first USB interface is not connected with first other electronic equipment and determines that the second USB interface is not connected with second other electronic equipment, the electronic equipment does not need to interact with the first other electronic equipment and the second other electronic equipment simultaneously, the CPU can be controlled to be disconnected with a first switch supporting the USB2.0 protocol on a first line, namely, the CPU is electrically connected with the multiplexer, and a second switch supporting the USB3.0 protocol on a second line is kept closed, so that the CPU can be directly electrically connected with the second USB interface, the CPU is convenient to 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 rapidly realized to directly interact with the CPU based on the USB3.0 protocol, the efficiency of the electronic equipment and the second other electronic equipment interacting is improved.
The second line 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 CPU may control the first switch supporting the USB2.0 protocol on the first line to be turned on, that is, the CPU and the multiplexer are electrically connected, and control the second switch supporting the USB3.0 protocol on the second line to be turned off, so as to prevent the second line from affecting the CPU to interact with the second USB interface through the multiplexer.
As a possible implementation manner, if the first USB interface is a Type-a interface, since the physical layer of the USB2.0 port of the Type-a interface can only be connected to the CPU through the multiplexer, and there may be a situation that 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 the user disconnects the second USB interface from the second other electronic device after connecting the electronic device to the second other electronic device and the first other electronic device at the same time, 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 CPU needs to interact with the USB interface through the multiplexer, the first switch supporting the USB2.0 protocol on the first line may be controlled to close, i.e. to electrically connect the CPU and the multiplexer. And the second USB interface is not connected with second other electronic equipment, and 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, and the interaction of the CPU and the first USB interface through the multiplexer is not influenced, therefore, a second switch supporting the USB3.0 protocol on the second line can be kept closed.
As another possible implementation manner, in an actual application process, there may be a case where a user only wants the electronic device to provide a service for a 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 the user disconnects the first USB interface from the first other electronic device after connecting the electronic device with the first other electronic device and the second other electronic device at the same time, so that when the second USB interface is a 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 rate of the CPU and the second USB interface, when the CPU on the electronic device determines that the first USB interface is not connected to the first other electronic device and determines that the second USB interface is connected to the second other electronic device, it indicates that the current CPU does not need to interact with the USB interface through the multiplexer, and may control the first switch supporting the USB2.0 protocol on the first line to be turned off, that is, the electrical connection between the CPU and the multiplexer is turned off, and keep the second switch supporting the USB3.0 protocol on the second line to be turned on, so that the CPU may be directly electrically connected to the second USB interface, thereby conveniently implementing that the second USB interface may directly interact with the CPU based on the USB3.0 protocol, and improving the interaction efficiency of the electronic device and the second other electronic device.
By the method, the CPU can accurately adjust the on-off of the first line and the second line in the electronic equipment according to the condition whether the first USB interface is connected with the first other electronic equipment and the condition whether the second USB interface is connected with the second other electronic equipment, 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 interaction quality between the electronic equipment and at least one piece of electronic equipment is ensured.
Example 3:
in order to ensure the quality of the interaction between the CPU and the second USB interface through the multiplexer, in the present application, on the basis of the foregoing embodiments, 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 CPU is further configured to control a third switch supporting the USB2.0 protocol to be closed on a third line; 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 this application, a third line is further provided in the electronic device, and a third switch supporting the USB2.0 protocol is provided on the third line, and the third line is used for connecting the multiplexer and the second USB interface. When a CPU on the electronic equipment determines that the first USB interface is connected with first other electronic equipment and the second USB interface is connected with second other electronic equipment, in order to ensure that the CPU interacts with the second USB interface through the multiplexer, the CPU controls a third switch supporting a USB2.0 protocol on a third line to be closed so as to realize the electric connection of the multiplexer and the second USB interface, so that the multiplexer can conveniently send a signal sent by the CPU to the second USB interface, and the interaction quality of the CPU and the second USB interface through the multiplexer is ensured.
In a possible implementation manner, in order to ensure that the interaction between the CPU and the USB interface is accurately controlled, in this 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 on the interaction between the CPU and the second USB, which is caused by the presence of multiple lines on the electronic device, and the interaction between the CPU and any 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, the third switch supporting the USB2.0 protocol on the third line is controlled to be turned off.
In one possible implementation mode, connection conditions of other electronic devices possibly connected by the electronic device and types of the other electronic devices are obtained, and the working mode of the electronic device is determined according to the on-off conditions of the lines (including the first line, the second line and the third line) of the electronic device in each connection condition. If the first USB interface is a Type-a interface and the second USB interface is a Type-C interface, several working modes of the embodiment of the present application are introduced as follows with reference to a schematic circuit connection structure diagram 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 first other electronic devices, and the second USB interface of the electronic device is not connected with second other electronic devices. It is understood that this connection situation is a situation where the electronic device does not interact with any other electronic device, for example, where the electronic device is charged using a Type-C interface. Under the connection condition, the on-off condition of each line of the electronic equipment is that the first switch on the first line is disconnected, the second switch on the second line is closed, the third switch on the third line is disconnected, that is, the first line and the third line are not electrified, and the second line is electrified, so that the CPU of the electronic equipment can still interact with the second USB interface in 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 a user does not connect a first USB interface of an electronic device with a first other electronic device, the state of the first CC pin in the first USB interface is not changed, and the state of the first pin should be a state where the first other electronic device is not connected. Similarly, if the user does not connect the second other electronic device to the second USB interface of the electronic device, the state of the second CC pin in the second USB interface is not changed, and the state of the second pin is the state of the second other electronic device. Therefore, the CPU of the electronic device determines that the first USB interface is not connected to the first other electronic device and the second USB interface is not connected to the second other electronic 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, 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 the electronic device to operate in the default mode, and only the second USB interface can be normally used in the default mode. Fig. 4 is a schematic circuit structure diagram of 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 CPU controls USB3.0SWITCH × 2 to be on, USB2.0 SWITCH1 to be off, and USB2.0 SWITCH2 to be off, so that in the default mode, the CPU can charge the electronic device through the second USB interface, or transmit a file to a computer, a notebook, or the like.
The working mode 1 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 connected with the 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 this mode of connection is where the electronic device interacts only with a second other electronic device. In this connection situation, the on-off condition of each line of the electronic device is that the first switch on the first line is open, the second switch on the second line is closed, and the third switch on the third line is open, that is, the first line and the third line are not powered, and the second line is powered on, so that in the working mode 1, the second other electronic device connected with the second USB interface can directly interact with the CPU based on the USB3.0 protocol.
For example, if the second other electronic device is an otg device, after the user connects the second other electronic device to the second USB interface of the electronic device, the state of the second CC pin in the second USB interface changes, so that the changed state is the state when the otg device is connected to the second USB interface. Since the first USB interface of the electronic device is not connected to the first other electronic device, the state of the first CC pin in the first USB interface is not changed, and the state of the first pin is not connected to the first other electronic device. Therefore, if the CPU of the electronic device determines that the current 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 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 the otg device can normally operate after being connected to the electronic device. Fig. 4 is a schematic circuit structure 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 currently, and the second other electronic device connected to the second USB interface is an otg device, the CPU controls USB3.0SWITCH × 2 to be turned on, USB2.0 SWITCH1 to be turned off, and USB2.0 SWITCH2 to be turned off, that is, controls the electronic device to interact with the second other electronic device in the operating mode 1.
Taking the above as an 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 otg device is not connected to the second USB interface. Since the first USB interface of the electronic device is not connected to the first other electronic device, the state of the first CC pin in the first USB interface is not changed, and the state of the first pin is still the state of the first other electronic device. Therefore, if the CPU of the electronic device determines that the second electronic device connected to the second USB interface is currently 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 CPU 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, and triggers the otg unloading process. 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 CPU controls USB3.0SWITCH × 2 to be on, USB2.0 SWITCH1 to be off, and USB2.0 SWITCH2 to be off, that is, controls the electronic device to resume the operation mode 1 to the default mode.
For example, if the second other electronic device is a dp device, when the user connects the second other electronic device to the second USB interface of the electronic device, the state of the second CC pin in the second USB interface changes, so that the changed state is the state when the dp device is connected to the second USB interface. Since the first USB interface of the electronic device is not connected to the first other electronic device, the state of the first CC pin in the first USB interface is not changed, and the state of the first pin is not connected to 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 currently and the second other electronic device connected with the second USB interface is a 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 turned off, the second switch on the second line to be turned on, the third switch on the third line to be turned off, and triggers the second otg loading process to implement transmission of the PD protocol, and completes dp event triggering, so that data sent by the electronic device can be acquired after the dp device is connected with the electronic device conveniently. Fig. 4 is a schematic circuit structure 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 currently, and the second other electronic device connected to the second USB interface is a dp device, the CPU controls USB3.0SWITCH × 2 to be on, USB2.0 SWITCH1 to be off, and USB2.0 SWITCH2 to be off, that is, controls the electronic device to interact with the dp device in the operating mode 1.
Taking the above as an 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 dp device is not connected to the second USB interface. Since the first USB interface of the electronic device is not connected to the first other electronic device, the state of the first CC pin in the first USB interface is not changed, and the state of the first pin is still the state of the first other electronic device. Therefore, if the CPU of the electronic device determines that the second electronic device connected to the second USB interface is currently 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 CPU 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, and triggers the otg unloading process. 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 CPU controls USB3.0SWITCH × 2 to be on, USB2.0 SWITCH1 to be off, and USB2.0 SWITCH2 to be off, that is, controls the electronic device to resume the operation mode 1 to the default mode.
The working mode 2 and the connection condition corresponding to the working mode are as follows: the first USB interface of the electronic equipment is connected with first other electronic equipment, the second USB interface of the electronic equipment is not connected with second other electronic equipment, and the type of the first other electronic equipment is otg equipment. It will be appreciated that this mode of connection is the case where the electronic device interacts only with the first other electronic device. In this connection situation, the on-off conditions of the lines of the electronic device are that the first switch on the first line is closed, the second switch on the second line is closed, and the third switch on the third line is open, that is, the third line is not powered, and the first line and the second line are powered on, so that in the working mode 2, the first other electronic device connected to the first USB interface can interact with the CPU through the multi-channel converter based on the 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 changes, so that the changed state is the state when the otg device is connected to the first USB interface. Since the second USB interface of the electronic device is not connected to a second other electronic device, the state of the second CC pin in the second USB interface is not changed, and the state of the second pin is not connected to 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 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 open, and triggers the first otg loading process, so that the otg device can normally operate after being connected to the electronic device. As shown in fig. 4, when the CPU of the electronic device determines that the second other electronic device is not connected to the second USB interface currently, and the first other electronic device connected to the first USB interface is an otg device, the CPU controls USB3.0SWITCH × 2 to be on, USB2.0 SWITCH1 to be on, and USB2.0 SWITCH2 to be off, that is, controls the electronic device to interact with the first other electronic device in the operating mode 2.
Taking the above as an example, after 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 otg device is not connected to the first USB interface. And because the second USB interface of the electronic device is not connected with the second other electronic device, the state of the second CC pin in the second USB interface is not changed, and the state of the second pin is still the state of 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 currently 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 CPU controls the first switch on the first line to be turned off, keeps the second switch on the second line closed and the third switch on the third line open, and triggers the otg unloading process. 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 CPU controls USB3.0SWITCH × 2 to be on, USB2.0 SWITCH1 to be off, and USB2.0 SWITCH2 to be off, that is, controls the electronic device to resume the operation mode 2 to the default mode.
The working mode 3 and the connection condition corresponding to the working mode are as follows: the first USB interface of the electronic equipment is connected with first other electronic equipment, the second USB interface of the electronic equipment is connected with second other electronic equipment, the type of the first other electronic equipment is otg equipment, and the type of the second other electronic equipment is otg equipment. It will be appreciated that this mode of connection is the case where the electronic device interacts with both the first further electronic device and the second further electronic device. Under the connection condition, the on-off condition of each line of the electronic equipment is that the first switch on the first line is closed, the second switch on the second line is opened, the third switch on the third line is closed, namely the second line is not electrified, and the first line and the third line 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 the multi-channel converter based on the USB2.0 protocol, and the dp equipment and the otg equipment can interact with the electronic equipment at the same time.
For example, after the user connects the first other electronic device to the first USB interface of the electronic device first, the state of the first CC pin in the first USB interface changes, so that the changed state is the state when the first USB interface is connected to the otg device, and the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is currently the otg device by detecting the state of the first CC pin in the first USB interface, and controls the first SWITCH on the first line to be closed, keeps the second SWITCH on the second line to be closed, and controls the third SWITCH on the third line to be open, that is, controls the USB3.0SWITCH × 2, the USB2.0 SWITCH1, and the USB2.0 SWITCH2 shown in fig. 4 to SWITCH the first otg loading process, so that the first other electronic device can normally operate after being connected to the electronic device. It will be appreciated that the control electronics transition from the default mode to the operating mode 2. Then, after the user connects the second other electronic device to the second USB interface of the electronic device, the state of the second CC pin in the second USB interface changes, so that the changed state is the state when the second USB interface is connected to the otg device, and the CPU of the electronic device determines that the second other electronic device connected to the second USB interface is the otg device by detecting the state of the second CC pin in the second USB interface, and then keeps the first SWITCH on the first line closed, and controls the second SWITCH on the second line to be opened, and the third SWITCH on the third line to be closed, that is, controls the USB3.0SWITCH 2 SWITCH, the USB2.0 SWITCH1 to be opened, and the USB2.0 SWITCH2 to be opened, and triggers the first otg loading process, so that the second other electronic device can normally operate after being connected to the electronic device. It will be appreciated that the control electronics transition from operating mode 2 to operating mode 3.
For any example, after the user first connects the second electronic device to the second USB interface of the electronic device, the CPU of the electronic device determines that the second electronic device connected to 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, the USB3.0SWITCH × 2, the USB2.0 SWITCH1, and the USB2.0 SWITCH2 shown in fig. 4 are controlled to be turned on, and the first otg loading process is triggered, so that the second electronic device can normally operate after being connected to the electronic device. It will be appreciated that the control electronics transition from the default mode to operating mode 1. Then, 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 to 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, and 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.0SWITCH 2 SWITCH, the USB2.0 SWITCH1 to be opened, and the USB2.0 SWITCH2 to be opened, as shown in fig. 4, and triggers the first otg loading process, so that the first other electronic device can normally operate after being connected to the electronic device. It will be appreciated that the control electronics transition from operating mode 1 to operating mode 3.
Taking the above as an example, after 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 otg device is not connected to the first USB interface. And because the second USB interface of the electronic device is still connected with the second other electronic device, 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 otg device. Therefore, the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is currently 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 opened, the second SWITCH on the second line to be closed, and the third SWITCH on the third line to be opened, that is, controls USB3.0SWITCH 2 on, USB2.0 SWITCH1 off, and USB2.0 SWITCH2 off shown in fig. 4, and triggers the otg offload process to disconnect the first other electronic device from the CPU. It will be appreciated that the control electronics transition from operating mode 3 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 otg device is not connected to the second USB interface, and the state of the first CC pin of the first USB interface is not changed. Therefore, the CPU of the electronic device determines that the second electronic device connected to the second 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 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 USB3.0SWITCH 2 on, USB2.0 SWITCH1 off, and USB2.0 SWITCH2 off as shown in fig. 4, and triggers the otg offload process to disconnect the second electronic device from the CPU. It will be appreciated that the control electronics revert from operating mode 1 to the default mode.
Taking the above as an 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 currently 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 USB3.0SWITCH × 2 on, USB2.0 SWITCH1 on, and USB2.0 SWITCH2 off 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 transition 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 open, and keeps the second SWITCH on the second line to close, and the third SWITCH on the third line to open, that is, the switches shown in fig. 4 keep USB3.0SWITCH × 2 on, USB2.0 SWITCH1 off, and USB2.0 SWITCH2 off, and triggers an otg unloading procedure to disconnect the first other electronic device from the CPU. It will be appreciated that the control electronics transition 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 equipment is connected with first other electronic equipment, the second USB interface of the electronic equipment is connected with second other electronic equipment, the type of the first other electronic equipment is otg equipment, and the type of the second other electronic equipment is dp equipment. It will be appreciated that this mode of connection is the case where the electronic device interacts with both the first further electronic device and the second further electronic device. In this connection situation, the on-off conditions of the lines of the electronic device are that the first switch on the first line is closed, the second switch on the second line is opened, the third switch on the third line is closed, that is, the second line is not powered, and the first line and the third line are powered on, so that in the working mode 4, both the first other electronic device and the second other electronic device can interact with the CPU through the multi-channel converter based on the USB2.0 protocol.
For example, after the user connects the first other electronic device to the first USB interface of the electronic device first, the state of the first CC pin in the first USB interface changes, so that the changed state is the state when the first USB interface is connected to the otg device, and the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is currently the otg device by detecting the state of the first CC pin in the first USB interface, and controls the first SWITCH on the first line to be closed, keeps the second SWITCH on the second line to be closed, and controls the third SWITCH on the third line to be open, that is, controls the USB3.0SWITCH × 2, the USB2.0 SWITCH1, and the USB2.0 SWITCH2 shown in fig. 4 to SWITCH the first otg loading process, so that the first other electronic device can normally operate after being connected to the electronic device. It will be appreciated that the control electronics transition from the default mode to the operating mode 2. Then, after the user connects a second other electronic device with a second USB interface of the electronic device, the state of a 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 a dp device, the CPU of the electronic equipment determines that the second other electronic equipment connected with the current second USB interface is dp equipment by detecting the state of a second CC pin in the second USB interface, keeping the first switch on the first line closed, controlling the second switch on the second line to be opened and the third switch on the third line to be closed, namely, the control USB3.0SWITCH x 2 off, USB2.0 SWITCH1 on, USB2.0 SWITCH2 on shown in fig. 4, and triggers a second otg loading flow to realize the transmission of the PD protocol, completes dp event triggering, therefore, the dp device can conveniently acquire the data sent by the electronic device after being connected with the electronic device. It will be appreciated that the control electronics transition from operating mode 2 to operating mode 4.
For example, when the user first connects the second electronic device to the second USB interface of the electronic device, the CPU of the electronic device determines that the second electronic device connected to the second USB interface is a 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 open, the second SWITCH on the second line to be closed, and the third SWITCH on the third line to be open, that is, controls USB3.0SWITCH 2 to be open, USB2.0 SWITCH1 to be closed, and USB2.0 SWITCH2 to be closed as shown in fig. 4, and triggers the second otg loading process to implement transmission of the PD protocol, complete dp event triggering, so that the dp device can acquire data sent by the electronic device after being connected to the electronic device. It will be appreciated that the control electronics transition from the default mode to operating mode 1. Then, 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 to 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, and 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.0SWITCH 2 SWITCH, the USB2.0 SWITCH1 to be opened, and the USB2.0 SWITCH2 to be opened, as shown in fig. 4, and triggers the first otg loading process, so that the first other electronic device can normally operate after being connected to the electronic device. It will be appreciated that the control electronics transition from operating mode 1 to operating mode 4.
Taking the above as an example, after 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 otg device is not connected to the first USB interface. And because the second USB interface of the electronic device is still connected with 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 dp devices. Therefore, the CPU of the electronic device determines that the first other electronic device connected to the first USB interface is currently 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 opened, the second SWITCH on the second line to be closed, and the third SWITCH on the third line to be opened, that is, the controls USB3.0SWITCH × 2 on, USB2.0 SWITCH1 off, and USB2.0 SWITCH2 off shown in fig. 4, and triggers the otg offload procedure to disconnect the first other electronic device from the CPU. It will be appreciated that the control electronics transition 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 dp device is not connected to the second USB interface, and the state of the first CC pin of the first USB interface is not changed. Therefore, the CPU of the electronic device determines that the second electronic device connected to the second 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 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 USB3.0SWITCH 2 on, USB2.0 SWITCH1 off, and USB2.0 SWITCH2 off as shown in fig. 4, and triggers the otg offload process to disconnect the second electronic device from the CPU. It will be appreciated that the control electronics revert from operating mode 1 to the default mode.
Taking the above as an 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 currently 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 USB3.0SWITCH × 2 on, USB2.0 SWITCH1 on, and USB2.0 SWITCH2 off 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 transition 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 open, and keeps the second SWITCH on the second line to close, and the third SWITCH on the third line to open, that is, the switches shown in fig. 4 keep USB3.0SWITCH × 2 on, USB2.0 SWITCH1 off, and USB2.0 SWITCH2 off, and triggers an otg unloading procedure to disconnect the first other electronic device from the CPU. It will be appreciated that the control electronics transition from operating mode 2 to the default mode.
It will be appreciated that dp devices are master devices and otg devices are slave devices.
In the prior art, although electronic equipment such as a PC, a notebook computer and the like also has a plurality of USB interfaces, the electronic equipment can only work as a main equipment in a control host mode and can not work as a slave equipment in a service device mode. The electronic equipment in the application 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 works in a host mode, all other electronic devices connected to the interface on the electronic device are otg devices, for example, the Type-a interface is connected to a usb disk, a mouse or other otg devices, and meanwhile, the Type-C interface is also connected to a mouse, a keyboard, a usb 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 a pc and a notebook computer, and the ype-A interface on the electronic equipment is connected with a USB flash disk, a mouse or other otg equipment.
Example 4:
the present application further provides a control method, and fig. 5 is a schematic control process diagram provided in some embodiments of the present application, where the process includes:
s501: and if the first USB interface on the electronic equipment is determined to be connected with first other electronic equipment and the second USB interface on the electronic equipment is determined to be connected with second other electronic equipment, controlling the CPU on the electronic equipment to be electrically connected with the multiplexer on the electronic equipment through a first line.
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 and an intelligent brain, and can also be a server.
It should be noted that, descriptions of the control method provided in the embodiment of the present application have been given in the foregoing embodiment, and repeated descriptions are omitted.
In some possible embodiments, the CPU is electrically connected to the multiplexer through a first line, and includes:
and if the first USB interface is determined to be connected with first other electronic equipment and the second USB interface is determined to be connected with second other electronic equipment, controlling a first switch supporting a 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 not to be connected with the first other electronic equipment and the second USB interface is determined not to be connected with the second other electronic equipment, controlling a first switch supporting a USB2.0 protocol on the first line to be switched off and keeping a second switch supporting a USB3.0 protocol on the second line to be switched on; the second line 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, and includes:
and if the first USB interface is determined to be connected with first other electronic equipment and the second USB interface is determined to be connected with 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 switched off and keeping the second switch to be switched on.
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 not to be connected with the second other electronic equipment, controlling the first switch to be closed, keeping the second switch closed, and keeping the third switch open.
In some possible embodiments, the method further comprises:
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 connected with the second other electronic equipment, controlling a third switch supporting a USB2.0 protocol on a third line to be closed; the third line is used for connecting the line converter and the second USB interface.
Example 5:
the present application further provides a control method, and fig. 6 is a schematic structural diagram of a control device according to some embodiments of the present application, where the process includes:
the first processing unit 61 is configured to, if it is determined that the first USB interface on the electronic device is connected to the first other electronic device and the second USB interface on the electronic device is connected to the second other electronic device, control the CPU on the electronic device to be electrically connected to the multiplexer on the electronic device through the 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 a first switch supporting the USB2.0 protocol to be closed on the first line if it is determined that the first other electronic device is connected to the first USB interface and the second other electronic device is connected to the second USB interface.
In some possible embodiments, the first processing unit 61 is further configured to, 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, control the first switch supporting the USB2.0 protocol on the first line to be opened and keep the second switch supporting the USB3.0 protocol on the second line to be closed; the second line is used for connecting the CPU and the second USB interface.
In some possible embodiments, the first processing unit 61 is specifically configured to, 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, control the first switch to be closed, and control the second switch to be opened.
In some possible embodiments, the first processing unit 61 is further configured to, if it is determined that the first other electronic device is not connected to the first USB interface and it is determined that the second other electronic device is connected to the second USB interface, control the first switch to be opened and keep the second switch closed.
In some possible embodiments, the first processing unit 61 is further configured to, if it is determined that the first other electronic device is connected to the first USB interface and it is determined that the second other electronic device is not connected to the second USB interface, control the first switch to be closed, keep the second switch closed, and keep the third switch open.
In some possible embodiments, the first processing unit 61 is further configured to control a third switch supporting the USB2.0 protocol to close on a third line if it is determined that the first other electronic device is connected to the first USB interface and the second other electronic device is connected to the second USB interface; 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 system comprises a processor 71, a communication interface 72, a memory 73 and a communication bus 74, wherein the processor 71, the communication interface 72 and the memory 73 are communicated 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 the first USB interface on the electronic equipment is determined to be connected with first other electronic equipment and the second USB interface on the electronic equipment is determined to be connected with second other electronic equipment, controlling a CPU on the electronic equipment to be electrically connected with a multiplexer on the electronic equipment 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 repeated details are not repeated.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 72 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital instruction processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
Example 7:
on the basis of the foregoing embodiments, the present application further provides a computer-readable storage medium, in which a computer program executable by a processor is stored, and when the program is run on the processor, the processor is caused to execute the following steps:
if the first USB interface on the electronic equipment is determined to be connected with first other electronic equipment and the second USB interface on the electronic equipment is determined to be connected with second other electronic equipment, controlling a CPU on the electronic equipment to be electrically connected with a multiplexer on the electronic equipment 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 the problem solving by 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 implementation steps can be referred to as the implementation of the method, and repeated parts are not described again.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. An electronic device, characterized in that the electronic device comprises: the USB interface comprises a first USB interface, a second USB interface, a multiplexer and a Central Processing Unit (CPU); the first USB interface and the second USB interface are different in interface type;
the CPU is used for electrically connecting with the multiplexer through a first line if the first USB interface is determined to be connected with first other electronic equipment and the second USB interface is determined to be connected with second other electronic equipment; and controlling the multiplexer to send the signal sent by the CPU to the first USB interface and/or the second USB interface.
2. The electronic device of claim 1, wherein the CPU is specifically configured to control a first switch supporting a USB2.0 protocol to be closed on the first line if it is determined that a first other electronic device is connected to the first USB interface and a second other electronic device is connected to the second USB interface.
3. The electronic device of claim 1, wherein the CPU is further configured to, 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, control a first switch supporting a USB2.0 protocol on the first line to be opened and keep a second switch supporting a USB3.0 protocol on the second line to be closed; the second line is used for connecting the CPU and the second USB interface.
4. The electronic device according to claim 3, 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 to a first other electronic device and the second USB interface is connected to a second other electronic device.
5. The electronic device of claim 3, wherein the CPU is further configured to control the first switch to open and keep the second switch closed if it is determined that the first USB interface is not connected with the first other electronic device and it is determined that the second USB interface is connected with the second other electronic device.
6. The electronic device of claim 3, wherein the CPU is further configured to control the first switch to close, keep the second switch closed, and keep the third switch open if it is determined that the first USB interface is connected with the first other electronic device and it is determined that the second USB interface is not connected with the second other electronic device.
7. The electronic device according to any of claims 1-6, wherein the CPU is further configured to control a third switch supporting USB2.0 protocol on a third line to close 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.
8. A control method, characterized in that the method comprises:
if the first USB interface on the electronic equipment is determined to be connected with first other electronic equipment and the second USB interface on the electronic equipment is determined to be connected with second other electronic equipment, controlling a CPU on the electronic equipment to be electrically connected with a multiplexer on the electronic equipment 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.
9. A control device, characterized in that the device comprises:
the first processing unit is used for controlling a CPU on the electronic equipment to be electrically connected with a multiplexer on the electronic equipment through a first line if it is determined that a first USB interface on the electronic equipment is connected with first other electronic equipment and a second USB interface on the electronic equipment is connected with 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.
10. A computer-readable storage medium, characterized in that it stores a computer program which, when being executed by a processor, carries out the steps of the control method according to claim 8.
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 true CN113934661A (en) 2022-01-14
CN113934661B 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)

Cited By (1)

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

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180060270A1 (en) * 2016-08-23 2018-03-01 Dell Products L. P. Automatically configuring a universal serial bus (usb) type-c port of a computing device
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
US20200151129A1 (en) * 2018-11-09 2020-05-14 Cypress Semiconductor Corporation Usb signal switch circuitry using standard usb hub and method of operation the same
CN112799985A (en) * 2021-04-14 2021-05-14 智道网联科技(北京)有限公司 USB interface control method, USB control circuit and intelligent networking equipment mainboard

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180060270A1 (en) * 2016-08-23 2018-03-01 Dell Products L. P. Automatically configuring a universal serial bus (usb) type-c port of a computing device
CN109286838A (en) * 2017-07-20 2019-01-29 青岛海信电器股份有限公司 Electric terminal equipment, television terminal, signal input circuit and method
US20200151129A1 (en) * 2018-11-09 2020-05-14 Cypress Semiconductor Corporation Usb signal switch circuitry using standard usb hub and method of operation the same
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

Cited By (2)

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

Also Published As

Publication number Publication date
CN113934661B (en) 2024-06-04

Similar Documents

Publication Publication Date Title
CN108666826B (en) Adapter, terminal equipment and adapter system
CN105893304B (en) A kind of terminal and its implementation for supporting double network data transmission
CN110851387B (en) Interface function configuration method and electronic equipment
US10025351B2 (en) System for controlling peripherals connected to a docking station
WO2013152662A1 (en) Power supply method for terminal device, and terminal device thereof
CN107707000B (en) OTG power supply and wireless charging compatible circuit, related method and terminal equipment
CN108733609B (en) Switching circuit, intelligent switching device and switching method of double USB interfaces
EP3084557A1 (en) Method and apparatus for charging electronic device with usb connection
CN102981916B (en) A kind of mobile terminal and control method thereof and device
CN106597143B (en) Test equipment and test method
CN107885683B (en) Terminal and current testing method thereof
CN111480152A (en) Interface configuration method, terminal equipment and interface
CN113934661A (en) Electronic equipment, control method, device and medium
CN107885688B (en) Signal switching method and device
WO2024094068A1 (en) Communication connection control method, vehicle-mounted device, communication system and storage medium
CN108153626B (en) USB, serial port multiplexing and safety isolation system
CN106451628A (en) OTG charging control circuit and charging control method
JP6434630B2 (en) USB OTG device identification system and apparatus
CN106774769B (en) Terminal working mode switching method and device and handheld terminal
CN111433756A (en) Terminal and Type C interface anti-corrosion method
WO2022166698A1 (en) Charging control method and apparatus, electronic device, and charger
CN106899061B (en) Mobile terminal, charging device and charging method
CN112825401B (en) Charging line, charger, charging control method and charging device
CN113672067B (en) Lightning docking station and configuration device
CN216530587U (en) Power supply connector for supplying power to master equipment and slave equipment

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
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

GR01 Patent grant
GR01 Patent grant