CN105677596B - Control method and electronic equipment - Google Patents

Control method and electronic equipment Download PDF

Info

Publication number
CN105677596B
CN105677596B CN201410678054.3A CN201410678054A CN105677596B CN 105677596 B CN105677596 B CN 105677596B CN 201410678054 A CN201410678054 A CN 201410678054A CN 105677596 B CN105677596 B CN 105677596B
Authority
CN
China
Prior art keywords
interfaces
interface
connecting device
connection
power supply
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410678054.3A
Other languages
Chinese (zh)
Other versions
CN105677596A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201410678054.3A priority Critical patent/CN105677596B/en
Publication of CN105677596A publication Critical patent/CN105677596A/en
Application granted granted Critical
Publication of CN105677596B publication Critical patent/CN105677596B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Power Sources (AREA)
  • Measurement Of Levels Of Liquids Or Fluent Solid Materials (AREA)

Abstract

The invention discloses a control method and electronic equipment, which are used for optimizing effective control of an I/O interface when charging and supplying power to the electronic equipment through a connection interface. The method comprises the following steps: when detecting that a first I/O interface in the N I/O interfaces is connected with a first connecting device with first identification information, obtaining a voltage fluctuation parameter corresponding to the first connecting device; judging whether the voltage fluctuation parameter is within a preset range or not to obtain a judgment result; and controlling the on-off connection state between N-1I/O interfaces except the first I/O interface in the N I/O interfaces and the power supply circuit based on the judgment result. The invention also discloses electronic equipment using the method.

Description

Control method and electronic equipment
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a control method and an electronic device.
Background
With the rapid development of science and technology and the increasingly intense market competition, the performance and appearance of electronic devices are greatly improved, and notebook computers are popular with more and more people due to the advantages of being small, light, convenient to carry, high in entertainment and the like, and become an indispensable part in study and life. More and more things users can do with electronic devices, such as: the user can communicate, watch videos, play games and the like through the tablet computer with the communication function.
Generally, in the process of using the electronic device, the electronic device can be connected with other peripheral devices through an interface of the electronic device. For example, a connection circuit for data, information exchange, and control between a central processing unit CPU of an electronic device and an external device may be connected through an Input/Output (I/O) interface of a notebook computer. Therefore, to meet the use requirements of users, electronic devices typically have multiple I/O interfaces. However, currently, there is still a need for improvement in the control of I/O interfaces during charging and powering using these I/O interfaces.
Disclosure of Invention
The embodiment of the invention provides a control method and electronic equipment, which are used for optimizing effective control on an I/O interface when charging and supplying power to the electronic equipment through a connection interface.
A control method is applied to an electronic device, the electronic device comprises N input/output (I/O) interfaces, the N I/O interfaces are connected with a power supply line and a data line, N is a positive integer, and the method comprises the following steps:
when detecting that a first I/O interface in the N I/O interfaces is connected with a first connecting device with first identification information, obtaining a voltage fluctuation parameter corresponding to the first connecting device;
judging whether the voltage fluctuation parameter is within a preset range or not to obtain a judgment result;
and controlling the on-off connection state between N-1I/O interfaces except the first I/O interface in the N I/O interfaces and the power supply circuit based on the judgment result.
Optionally, when the on-off connection state between the N I/O interfaces and the power supply line is a connection state, the level corresponding to each I/O interface in the N I/O interfaces is a high level.
Optionally, the controlling, based on the determination result, on/off connection states between N-1I/O interfaces, except for the first I/O interface, of the N I/O interfaces and the power supply line includes:
and if the judgment result is yes, controlling the on-off connection state to be the off state.
Optionally, if the determination result is yes, controlling the on-off connection state to be the disconnection state specifically includes:
if the judgment result is yes, the electronic equipment is controlled to switch the level corresponding to the N-1I/O interfaces from the high level to the low level so as to control the on-off connection state to be switched from the connection state to the disconnection state.
Optionally, when detecting that a first I/O interface of the N I/O interfaces is connected to a first connection device, obtaining a voltage fluctuation parameter corresponding to the first connection device specifically includes:
at a first moment, detecting and determining that M connecting devices connected with the electronic equipment through M I/O interfaces in the N I/O interfaces exist, and acquiring M pin identifiers corresponding to the M connecting devices, wherein M is an integer greater than or equal to 1 and less than or equal to N;
identifying whether the M pin identifications contain the first identification;
if so, determining the connecting device corresponding to the first identification mark as the first connecting device;
and detecting and obtaining a voltage fluctuation parameter corresponding to the first connecting device at a second moment which is a preset time after the first moment and has a difference with the first moment.
Optionally, if the determination result is yes, the on-off connection state is controlled to be the disconnection state, and the method further includes:
and controlling the electronic equipment to be in a power supply state, and controlling the first connecting device to output a corresponding first adaptive voltage.
An electronic device including N input/output I/O interfaces connected to a power supply line and a data line, N being a positive integer, the electronic device comprising:
the acquisition unit is used for acquiring voltage fluctuation parameter information corresponding to a first connecting device when the connection of the first I/O interface in the N I/O interfaces and the first connecting device with first identification information is detected;
the judging unit is used for judging whether the voltage fluctuation parameter is within a preset range or not to obtain a judging result;
and the processing unit is used for controlling the on-off connection state between N-1I/O interfaces except the first I/O interface in the N I/O interfaces and the power supply circuit based on the judgment result.
Optionally, when the on-off connection state between the N I/O interfaces and the power supply line is a connection state, the level corresponding to each I/O interface in the N I/O interfaces is a high level.
Optionally, the processing unit is specifically configured to:
and if the judgment result shows that the voltage fluctuation parameter is within the preset range, controlling the on-off connection state to be the off state.
Optionally, the processing unit is further specifically configured to:
and if the judgment result shows that the voltage fluctuation parameter is in the preset range, controlling the electronic equipment to switch the level corresponding to the N-1I/O interfaces from the high level to the low level so as to control the on-off connection state to be switched from the connection state to the off-connection state.
Optionally, the obtaining unit is specifically configured to:
at a first moment, detecting and determining that M connecting devices connected with the electronic equipment through M I/O interfaces in the N I/O interfaces exist, and acquiring M pin identifiers corresponding to the M connecting devices, wherein M is an integer greater than or equal to 1 and less than or equal to N;
identifying whether the M pin identifications contain the first identification;
if so, determining the connecting device corresponding to the first identification mark as the first connecting device;
and detecting and obtaining a voltage fluctuation parameter corresponding to the first connecting device at a second moment which is a preset time after the first moment and has a difference with the first moment.
Optionally, the electronic device further includes:
and the output unit is used for controlling the electronic equipment to be in a power supply state and controlling the first connecting device to output corresponding first adaptive voltage.
In the embodiment of the invention, because the electronic device comprises N input/output I/O interfaces, and the N I/O interfaces are connected with a power supply line and a data line, when a first connecting device with the first identification mark information is detected, the on-off connection state between N-1I/O interfaces except the first I/O interface and the power supply line is controlled by further judging the voltage fluctuation parameter according to the judgment result. For example, if the voltage fluctuation parameter is within the preset range, the connection between the first I/O interfaces connected by the first connection means may be preserved, while disconnecting the N-1I/O interfaces from the power supply lines, that is, the on-off connection state is in an off state, and only the first connection device connected with the first I/O interface is kept to supply power to the electronic equipment, so that the connection device preferentially connected with the I/O interface can be used as the only power supply device connected with the power supply circuit in the electronic equipment, and the N-1I/O interfaces only reserve the functions of the USB interface, therefore, the electronic equipment is prevented from being powered by devices connected with other I/O interfaces, electric leakage between adapters is prevented, and the safety and the user experience of ports of the electronic equipment are improved.
Drawings
FIG. 1 is a main flow chart of a control method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a circuit connection of an electronic device according to an embodiment of the present invention;
FIG. 3 is a schematic illustration of an identification mark in an embodiment of the invention;
fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the invention.
Detailed Description
The embodiment of the invention discloses a control method, which is applied to electronic equipment, wherein the electronic equipment comprises N input/output (I/O) interfaces, the N I/O interfaces are connected with a power supply circuit and a data circuit, N is a positive integer, and the method comprises the following steps: when detecting that a first I/O interface in the N I/O interfaces is connected with a first connecting device with first identification information, obtaining a voltage fluctuation parameter corresponding to the first connecting device; judging whether the voltage fluctuation parameter is within a preset range or not to obtain a judgment result; and controlling the on-off connection state between N-1I/O interfaces except the first I/O interface in the N I/O interfaces and the power supply circuit based on the judgment result.
In the embodiment of the invention, because the electronic device comprises N input/output I/O interfaces, and the N I/O interfaces are connected with a power supply line and a data line, when a first connecting device with the first identification mark information is detected, the on-off connection state between N-1I/O interfaces except the first I/O interface and the power supply line is controlled by further judging the voltage fluctuation parameter according to the judgment result. For example, if the voltage fluctuation parameter is within the preset range, the connection between the first I/O interfaces connected by the first connection means may be preserved, while disconnecting the N-1I/O interfaces from the power supply lines, that is, the on-off connection state is in an off state, and only the first connection device connected with the first I/O interface is kept to supply power to the electronic equipment, so that the connection device preferentially connected with the I/O interface can be used as the only power supply device connected with the power supply circuit in the electronic equipment, and the N-1I/O interfaces only reserve the functions of the USB interface, therefore, the electronic equipment is prevented from being powered by devices connected with other I/O interfaces, electric leakage between adapters is prevented, and the safety and the user experience of ports of the electronic equipment are improved.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
In the embodiment of the present invention, the electronic device may be a notebook, a PAD (tablet computer), a mobile phone, and other different electronic devices, which is not limited in the present invention.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, the present invention provides a control method applied to an electronic device, where the electronic device includes N input/output I/O interfaces, the N I/O interfaces are connected to a power supply line and a data line, and N is a positive integer, and the method may include the following steps:
step 11: when detecting that a first I/O interface in the N I/O interfaces is connected with a first connecting device with first identification information, obtaining a voltage fluctuation parameter corresponding to the first connecting device.
In the embodiment of the present invention, the I/O interface may be an electronic circuit (in the form of an IC chip or an interface board) which is internally provided with a plurality of special registers and corresponding control logic circuits, and is a medium and bridge for exchanging information between the CPU and the I/O device.
Generally speaking, the function of the I/O interface is to enable the CPU to connect the I/O circuit and the peripheral device together through the system bus, and the hardware of the I/O interface may be mainly divided into an I/O interface chip and an I/O interface control card according to the complexity of the circuit and the device, wherein the I/O interface chip is mostly an integrated circuit, and inputs different commands and parameters through the CPU and controls the relevant I/O circuit and simple peripheral devices to perform corresponding operations, and common interface chips such as a timer/counter, an interrupt controller, a DMA controller, a parallel interface, etc.; the I/O interface control card is a part composed of several integrated circuits according to a certain logic, or is directly mounted on the main board together with CPU or a plug-in unit is inserted into the system bus slot. In the embodiment of the present invention, the N I/O interfaces may mainly refer to USB interfaces (Universal Serial Bus interfaces) capable of supporting adapters in the parallel electronic device.
In the embodiment of the invention, the N I/O interfaces can be connected with peripheral equipment through connectors, such as a mouse, an adapter and the like, and have plug-and-play and hot plug functions. Specifically, the connection relationship between the N I/O interfaces, the power supply circuit, and the data line is shown in fig. 2. Wherein, the connecting device which is USB or adapter is connected with the circuit inside the electronic equipment through the N I/O interfaces.
It should be noted that, the electronic device may be provided with a latch connected to the N I/O interfaces, where the latch may be connected to a circuit of the N I/O interfaces, and in a specific system line, please refer to fig. 2, the latch may be in a block representing an I/O interface, and when it is determined that the M connection devices are connected to the M I/O interfaces by detection, the latch is triggered, and latches and records pin identifiers of devices corresponding to the M I/O interfaces in real time according to a connection time sequence, so as to distinguish the insertion time sequence of each connection device, and further determine a first connection device that is first connected to the M I/O interfaces.
Optionally, in this embodiment of the present invention, when the N I/O interfaces are in a connection state with the power supply line, a level corresponding to each I/O interface in the N I/O interfaces is a high level. The protocol signal of the USB adapter function is realized through the ID pin, and when the ID pin is at a high level, the working state of the adapter is opened, so that the electronic equipment responds to the accessed adapter.
In an actual implementation process, when the first connection device is connected to the first I/O interface, the connector of the first connection device may serve as a male connector, that is, a part where the connector protrudes out, and the first I/O interface may serve as a female connector, that is, a part where the interface is recessed to be connected. Therefore, the first identification mark may refer to an ID pin identification of the first connection apparatus, and the first I/O interface has a function of identifying the ID pin identification. Referring to fig. 3, a represents an ID pin ID in the first connection device, i.e. a male pin; b represents an interface, namely a female head, which is used for identifying and is matched with the first identification mark in the N I/O interfaces. Wherein IDa is used as system identification, IDb is used as adapter function identification, and IDa 'and IDb' are respectively matched with IDa and IDb.
Specifically, the first identification mark may be a device identification mark specific to the first connection device, and when the first connection device is inserted into the first I/O interface, whether the first connection device is connectable to a power supply line in the electronic device may be identified through a detection line connected to the first I/O interface. For example, if the first connection device is an adapter, the first identification mark is a mark corresponding to the adapter, and when the adapter is plugged into the first I/O interface, the electronic device may detect and obtain a voltage fluctuation parameter corresponding to the first connection device.
Specifically, the process of determining the voltage fluctuation parameter is as follows:
1) at a first moment, detecting and determining that M connecting devices connected with the electronic equipment through M I/O interfaces in the N I/O interfaces exist, and acquiring M pin identification information corresponding to the M connecting devices, wherein M is an integer greater than or equal to 1 and less than or equal to N;
2) identifying whether the M pin identifications contain the first identification;
3) if so, determining the connecting device corresponding to the first identification mark as the first connecting device;
4) and detecting and acquiring voltage fluctuation parameter information corresponding to the first connecting device at a second moment which is a preset time after the first moment and is different from the first moment.
The electronic device may perform real-time detection on the N I/O interfaces, and when it is determined that there is a connected device, a time at which the device is connected may be used as the first time, so as to determine the M pin identifiers corresponding to the M connected devices, and then determine whether the first identifier exists through identification of the M pin identifiers, and if so, determine that the corresponding connection device is determined to be the first connection device. Therefore, the first connecting device with the first identification mark in the M connecting devices can be determined relatively quickly through real-time detection, so that corresponding circuit control can be performed through an interface corresponding to the first connecting device.
Optionally, a latch connected to the N I/O interfaces may be disposed in the electronic device, where the latch may be connected to an I/O interface circuit in the circuit shown in fig. 2, that is, the latch may be located in a block representing an I/O interface, and when it is determined by detection that the M connection devices are connected to the M I/O interfaces, the latch is triggered, and according to the connection time sequence, the pin identifiers of the devices corresponding to the M I/O interfaces are latched and recorded in real time, so as to distinguish the insertion time sequence of each connection device, and further determine a first connection device that is first connected to the M I/O interfaces.
Further, after the first connection device is determined, an I/O interface corresponding to the first connection device may be determined as the first I/O interface, and at a second time different from the first time by a preset time period, a voltage parameter of the first connection device is detected, and the voltage parameter is determined as a corresponding voltage fluctuation parameter. The voltage fluctuation parameter refers to voltage fluctuation of the first connecting device caused by frequency hopping of pins of the first connecting device due to connection with an internal system of the electronic equipment when the first connecting device is inserted into the first I/O interface. Therefore, the preset duration may be a time when pin hopping occurs after the connection device is inserted. For example, the preset time period may be 100 ms. Therefore, the electronic device may take the voltage parameter of the first connection device detected at the first timing as a voltage fluctuation. For example, if the default voltage of the adapter pin is 5V, and the corresponding voltage after the frequency hopping occurs in the plugged I/O interface is 3.0V, the voltage fluctuation parameter measured at the second time is 3.0V.
Step 12: and judging whether the voltage fluctuation parameter is within a preset range to obtain a judgment result.
In an embodiment of the present invention, the preset range may be determined according to a pin operating voltage of the first connection device. Generally, the pin voltage of the adapter is maintained at 3.3V, and under the influence of frequency hopping, a voltage fluctuation of up and down 10%, that is, a voltage fluctuation of about 0.3V, occurs, so that the preset range may be set to 3.0V-3.6V, and it may be determined whether the first connection device is an adapter by detecting whether the voltage fluctuation parameter corresponding to the first connection device is within the preset range at the second time.
Step 13: and controlling the on-off connection state between N-1I/O interfaces except the first I/O interface in the N I/O interfaces and the power supply circuit based on the judgment result.
In the embodiment of the invention, the on-off connection state between the N-1I/O interfaces and the power supply circuit specifically comprises a disconnection state and a connection state. When the on-off connection state is a disconnection state, only a first I/O interface in the N I/O interfaces keeps connection with the power supply line; and when the on-off connection state is the connection state, each I/O interface in the N I/O interfaces is communicated with the power supply circuit, so that the N I/O interfaces can detect whether the connection device has the first identification mark.
Optionally, in this embodiment of the present invention, if it is determined that the voltage fluctuation parameter is within the preset range, the on-off connection state is controlled to be a disconnected state, and the first connection device is determined to be the only device connected to the power supply line, that is, the adapter function of the first connection device may be implemented through the first I/O interface. At this time, the N-1I/O interfaces except the first I/O interface among the N I/O interfaces are disconnected from the power supply line, so that the N-1I/O interfaces only maintain the USB connection function.
In practice, before the connection device is connected, the levels corresponding to the N I/O interfaces are all high levels, and the protocol signal of the USB adapter function is realized through the ID pin, and the high voltage of the ID pipe will open the operating state of the adapter, so when the on-off connection state is in the disconnected state, only the first I/O interface corresponds to the high level, and has the adapter function.
Specifically, when the function of prohibiting the adapter power supply of the N-1I/O interfaces is implemented, the electronic device may be controlled to switch the levels corresponding to the N-1I/O interfaces from the high level to the low level, and since the ID management module is in the high level, the adapter is turned on to operate, when the levels of the N-1I/O interfaces are pulled down from the high level to the low level, the N-1I/O interfaces do not respond to the adapter any more, and only provide USB functions, such as connecting a USB disk, a mouse, and a keyboard.
Wherein, when the level corresponding to the N-1I/O interfaces is pulled down, the pulling can be performed through a latch. When the M connecting devices are connected with the M I/O interfaces, pin identifications of the connecting devices corresponding to the interfaces are recorded in the latch, so that after a first I/O interface corresponding to the first connecting device is identified and determined, pin levels corresponding to the N-1I/O interfaces except the first I/O interface can be pulled down from a high level to a low level through coding, and therefore the N I/O interfaces are prevented from being connected with a plurality of adapters at the same time, and electric leakage among the adapters is avoided.
Optionally, in the embodiment of the present invention, while controlling the on-off connection state to be switched from the connection state to the disconnection state, the method may further include: and controlling the electronic equipment to be in a power supply state, and controlling the first connecting device to output a corresponding first adaptive voltage. In this case, the first connection device may supply power to the electronic device through the first I/O interface, for example, output a supply voltage of 19V, thereby implementing an adapter power supply function. Meanwhile, the N-1I/O interfaces are in low level and can not respond to the adapter function of other connecting devices, and only the USB connecting function is reserved.
In the embodiment of the invention, the first connecting device with the first identification mark is connected with the power supply circuit through the corresponding first I/O interface by adopting a first-in-first mode through the latch, and meanwhile, the level corresponding to other I/O interfaces is forcibly pulled down through coding, so that only one interface in the N I/O interfaces is ensured to have an adapter function, the electric leakage among the adapters is avoided when a plurality of adapters are simultaneously connected with the electronic equipment, and the safety among the interfaces of the electronic equipment is ensured.
Referring to fig. 4, based on the same concept, the present invention further discloses an electronic device, which includes N input/output I/O interfaces, where the N I/O interfaces are connected to a power supply line and a data line, where N is a positive integer, and the electronic device may include an obtaining unit 401, a determining unit 402, and a processing unit 403.
The obtaining unit 401 may be configured to obtain voltage fluctuation parameter information corresponding to a first connection device having first identification information when detecting that a first I/O interface of the N I/O interfaces is connected to the first connection device.
The determining unit 402 may be configured to determine whether the voltage fluctuation parameter is within a preset range, and obtain a determination result.
The processing unit 403 may be configured to control, if the determination result is yes, N-1I/O interfaces of the N I/O interfaces, except for the first I/O interface, to be in a disconnected state with the power supply line.
Optionally, in this embodiment of the present invention, when the N I/O interfaces are in a connection state with the power supply line, a level corresponding to each I/O interface in the N I/O interfaces is a high level.
Optionally, in this embodiment of the present invention, the obtaining unit 401 may specifically be configured to:
at a first moment, detecting and determining that M connecting devices connected with the electronic equipment through M I/O interfaces in the N I/O interfaces exist, and acquiring M pin identifiers corresponding to the M connecting devices, wherein M is an integer greater than or equal to 1 and less than or equal to N;
identifying whether the M pin identifications contain the first identification;
if so, determining the connecting device corresponding to the first identification mark as the first connecting device;
and detecting and obtaining a voltage fluctuation parameter corresponding to the first connecting device at a second moment which is a preset time after the first moment and has a difference with the first moment.
Optionally, in this embodiment of the present invention, the processing unit 403 may specifically be configured to: if the judgment result is yes, the electronic equipment is controlled to switch the level corresponding to the N-1I/O interfaces from the high level to the low level so as to control the N-1I/O interfaces and the power supply line to be in a disconnected state.
Optionally, in this embodiment of the present invention, the electronic device may further include: and the output unit is used for controlling the electronic equipment to be in a power supply state and controlling the first connecting device to output corresponding first adaptive voltage.
The embodiment of the invention discloses a control method, which is applied to electronic equipment, wherein the electronic equipment comprises N input/output (I/O) interfaces, the N I/O interfaces are connected with a power supply circuit and a data circuit, N is a positive integer, and the method comprises the following steps: when detecting that a first I/O interface in the N I/O interfaces is connected with a first connecting device with first identification information, obtaining a voltage fluctuation parameter corresponding to the first connecting device; judging whether the voltage fluctuation parameter is within a preset range or not to obtain a judgment result; and controlling the on-off connection state between N-1I/O interfaces except the first I/O interface in the N I/O interfaces and the power supply circuit based on the judgment result.
In the embodiment of the invention, because the electronic device comprises N input/output I/O interfaces, and the N I/O interfaces are connected with a power supply line and a data line, when a first connecting device with the first identification mark information is detected, the on-off connection state between N-1I/O interfaces except the first I/O interface and the power supply line is controlled by further judging the voltage fluctuation parameter according to the judgment result. For example, if the voltage fluctuation parameter is within the preset range, the connection between the first I/O interfaces connected by the first connection means may be preserved, while disconnecting the N-1I/O interfaces from the power supply lines, that is, the on-off connection state is in an off state, and only the first connection device connected with the first I/O interface is kept to supply power to the electronic equipment, so that the connection device preferentially connected with the I/O interface can be used as the only power supply device connected with the power supply circuit in the electronic equipment, and the N-1I/O interfaces only reserve the functions of the USB interface, therefore, the electronic equipment is prevented from being powered by devices connected with other I/O interfaces, electric leakage between adapters is prevented, and the safety and the user experience of ports of the electronic equipment are improved.
Specifically, the computer program instructions corresponding to the frequency adjustment method in the embodiment of the present application may be stored on a storage medium such as an optical disc, a hard disc, or a usb disk, and when the computer program instructions corresponding to the control method in the storage medium are read or executed by an electronic device, the method includes the following steps:
when detecting that a first I/O interface in the N I/O interfaces is connected with a first connecting device with first identification information, obtaining a voltage fluctuation parameter corresponding to the first connecting device;
judging whether the voltage fluctuation parameter is within a preset range or not to obtain a judgment result;
and controlling the on-off connection state between N-1I/O interfaces except the first I/O interface in the N I/O interfaces and the power supply circuit based on the judgment result.
Optionally, the step of storing in the storage medium: controlling computer instructions corresponding to the on-off connection state between the N-1I/O interfaces except the first I/O interface and the power supply circuit in the N I/O interfaces to be executed specifically based on the judgment result, which specifically comprises the following steps:
and if the judgment result is yes, controlling the on-off connection state to be the off state.
Optionally, the step of storing in the storage medium: if the judgment result is yes, controlling the computer instruction corresponding to the on-off connection state as the off state to be in a specific executed process, and the method comprises the following steps:
if the judgment result is yes, the electronic equipment is controlled to switch the level corresponding to the N-1I/O interfaces from the high level to the low level so as to control the N-1I/O interfaces and the power supply line to be in a disconnected state.
Optionally, the step of storing in the storage medium: when detecting that a first I/O interface of the N I/O interfaces is connected with a first connecting device, obtaining a voltage fluctuation parameter corresponding to the first connecting device, wherein a corresponding computer instruction comprises the following steps in a specific executed process:
at a first moment, detecting and determining that M connecting devices connected with the electronic equipment through M I/O interfaces in the N I/O interfaces exist, and acquiring M pin identifiers corresponding to the M connecting devices, wherein M is an integer greater than or equal to 1 and less than or equal to N;
identifying whether the M pin identifications contain the first identification;
if so, determining the connecting device corresponding to the first identification mark as the first connecting device;
and detecting and obtaining a voltage fluctuation parameter corresponding to the first connecting device at a second moment which is a preset time after the first moment and has a difference with the first moment.
Optionally, the storage medium further stores other computer instructions, and the computer instructions perform the following steps: if the judgment result is yes, controlling the computer instruction corresponding to the on-off connection state as the off state to be executed at the same time, and when the computer instruction is executed, the method comprises the following steps:
and controlling the electronic equipment to be in a power supply state, and controlling the first connecting device to output a corresponding first adaptive voltage.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (6)

1. A control method is applied to an electronic device, the electronic device comprises N input/output (I/O) interfaces, the N I/O interfaces are connected with a power supply line and a data line, N is a positive integer, and the method comprises the following steps:
when the on-off connection state between the N I/O interfaces and the power supply circuit is a connection state, the level corresponding to each I/O interface in the N I/O interfaces is a high level;
when detecting that a first I/O interface of the N I/O interfaces is connected with a first connection device with first identification information, obtaining a voltage fluctuation parameter corresponding to the first connection device, including: after the first connecting device is determined, determining an I/O interface corresponding to the first connecting device as the first I/O interface, and detecting a voltage parameter of the first connecting device and determining the voltage parameter as a corresponding voltage fluctuation parameter at a second time after the first time and different from the first time by a preset time length, wherein the preset time length is the time of pin frequency hopping of the first connecting device after the first connecting device is connected;
judging whether the voltage fluctuation parameter is within a preset range or not to obtain a judgment result;
controlling the on-off connection state between N-1I/O interfaces except the first I/O interface in the N I/O interfaces and the power supply circuit based on the judgment result, including: if the judgment result is yes, controlling the on-off connection state to be the off state, specifically, controlling the electronic device to switch the level corresponding to the N-1I/O interfaces from the high level to the low level so as to control the on-off connection state to be switched from the connection state to the off state.
2. The method according to claim 1, wherein the obtaining the voltage fluctuation parameter corresponding to a first connection device when detecting that the first I/O interface of the N I/O interfaces is connected to the first connection device specifically comprises:
at a first moment, detecting and determining that M connecting devices connected with the electronic equipment through M I/O interfaces in the N I/O interfaces exist, and acquiring M pin identifiers corresponding to the M connecting devices, wherein M is an integer greater than or equal to 1 and less than or equal to N;
identifying whether the M pin identifications contain the first identification;
if so, determining the connecting device corresponding to the first identification mark as the first connecting device;
and detecting and obtaining a voltage fluctuation parameter corresponding to the first connecting device at the second moment.
3. The method according to claim 1 or 2, wherein if the determination result is yes, the method further comprises, while controlling the on-off connection state to be an off state:
and controlling the electronic equipment to be in a power supply state, and controlling the first connecting device to output a corresponding first adaptive voltage.
4. An electronic device includes N I/O interfaces, the N I/O interfaces are connected with a power supply line and a data line, N is a positive integer, when the N I/O interfaces and the on-off connection state between the power supply line are in a connection state, the level corresponding to each I/O interface in the N I/O interfaces is a high level, and the electronic device includes:
the obtaining unit, configured to obtain voltage fluctuation parameter information corresponding to a first connection device having first identification information when detecting that a first I/O interface of the N I/O interfaces is connected to the first connection device, includes: after the first connecting device is determined, determining an I/O interface corresponding to the first connecting device as the first I/O interface, and detecting a voltage parameter of the first connecting device and determining the voltage parameter as a corresponding voltage fluctuation parameter at a second time after the first time and different from the first time by a preset time length, wherein the preset time length is the time of pin frequency hopping of the first connecting device after the first connecting device is connected;
the judging unit is used for judging whether the voltage fluctuation parameter is within a preset range or not to obtain a judging result;
a processing unit, configured to control, based on the determination result, on/off connection states between N-1I/O interfaces, except for the first I/O interface, of the N I/O interfaces and the power supply line, where the processing unit includes: if the judgment result is yes, controlling the on-off connection state to be the off state, specifically, controlling the electronic device to switch the level corresponding to the N-1I/O interfaces from the high level to the low level so as to control the on-off connection state to be switched from the connection state to the off state.
5. The electronic device of claim 4, wherein the obtaining unit is specifically configured to:
at a first moment, detecting and determining that M connecting devices connected with the electronic equipment through M I/O interfaces in the N I/O interfaces exist, and acquiring M pin identifiers corresponding to the M connecting devices, wherein M is an integer greater than or equal to 1 and less than or equal to N;
identifying whether the M pin identifications contain the first identification;
if so, determining the connecting device corresponding to the first identification mark as the first connecting device;
and detecting and obtaining a voltage fluctuation parameter corresponding to the first connecting device at the second moment.
6. The electronic device of claim 4 or 5, wherein the electronic device further comprises:
and the output unit is used for controlling the electronic equipment to be in a power supply state and controlling the first connecting device to output corresponding first adaptive voltage.
CN201410678054.3A 2014-11-21 2014-11-21 Control method and electronic equipment Active CN105677596B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410678054.3A CN105677596B (en) 2014-11-21 2014-11-21 Control method and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410678054.3A CN105677596B (en) 2014-11-21 2014-11-21 Control method and electronic equipment

Publications (2)

Publication Number Publication Date
CN105677596A CN105677596A (en) 2016-06-15
CN105677596B true CN105677596B (en) 2021-09-14

Family

ID=56957966

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410678054.3A Active CN105677596B (en) 2014-11-21 2014-11-21 Control method and electronic equipment

Country Status (1)

Country Link
CN (1) CN105677596B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106300501B (en) * 2016-07-26 2019-02-12 Oppo广东移动通信有限公司 A kind of adapter recognition methods and intelligent mobile terminal
CN106249083A (en) * 2016-08-30 2016-12-21 王竞 Detection method that data-interface takies and DIU data interface unit
CN109638970A (en) * 2019-01-25 2019-04-16 南方电网科学研究院有限责任公司 It is a kind of based on PnP device, the distribution network of interface and its control method
CN114801521B (en) * 2021-01-21 2024-04-16 林威 Printer head detection method
TWI800344B (en) * 2022-04-07 2023-04-21 緯穎科技服務股份有限公司 Main board, hot swap control signal generator and control signal generating method thereof
CN116049070B (en) * 2022-05-30 2023-11-10 荣耀终端有限公司 Camera module identification method and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2092407B1 (en) * 2006-12-08 2013-01-23 Nokia Corporation Multiple connections to a single serial interface
KR101494637B1 (en) * 2008-03-10 2015-02-23 삼성전자주식회사 Method and apparatus for detecting of connecting device in a portable device
CN103002042B (en) * 2012-12-14 2016-06-01 广州杰赛科技股份有限公司 Cloud terminal with multiple power supply modes and cloud computing system

Also Published As

Publication number Publication date
CN105677596A (en) 2016-06-15

Similar Documents

Publication Publication Date Title
CN105677596B (en) Control method and electronic equipment
US8762746B1 (en) Power management in electronic devices
JP3819658B2 (en) Portable electronic devices with a common serial bus connector
WO2013168289A1 (en) Electronic device and control method therefor
TWI482034B (en) Interface card
US20100060233A1 (en) Charger with USB detection
CN104081368A (en) Mobile device automatic detection apparatus and method
US20110320837A1 (en) Power supply circuit, power supply method, and signal processing apparatus
WO2014179232A1 (en) Usb charging with data communication
CN109672950B (en) Power saving circuit and power saving method based on Type-C earphone
CN106786960B (en) Charge control method, device and terminal
US8458376B1 (en) USB peripheral device with automatic mode switch
US20180323563A1 (en) USB Type-C Plug and Cable
US20200117633A1 (en) Methods and apparatus to enable status change detection in a low power mode of a microcontroller unit
CN105446424A (en) Host computer
CN106685018A (en) Reverse charging method and device as well as terminal
CN105809233B (en) A kind of intelligent modules card and its application method
CN106774769B (en) Terminal working mode switching method and device and handheld terminal
CN112799985A (en) USB interface control method, USB control circuit and intelligent networking equipment mainboard
CN107153456A (en) OTG connections control method, OTG connection control devices and electronic equipment
TWM496204U (en) Universal power delivery cable, power delivery controller applied to a universal serial bus cable, and universal serial bus cable
CN101105761A (en) Emulator of contact type intelligent card with USB interface
CN102544919A (en) Cable
CN113946530A (en) Control method and device of expansion card and nonvolatile storage medium
CN103605624A (en) Communication device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant