Disclosure of Invention
The embodiment of the application provides a power supply switching system of a USB socket, the USB socket and electronic equipment, which at least solve the problem of unstable data transmission when at least two USB interfaces supply power simultaneously in the related technology.
In a first aspect, an embodiment of the present application provides a power supply switching system, including a first interface, a second interface, a first power supply switching switch, a second power supply switching switch, and a charging module, where,
The first interface is connected with the first power supply change-over switch, the second interface is connected with the second power supply change-over switch, the first power supply change-over switch and the second power supply change-over switch are both connected with the charging module, and the first power supply change-over switch is electrically connected with the second power supply change-over switch;
when the first interface and the second interface are connected to external equipment, the first interface sends a first control signal to the first power supply change-over switch;
the first power supply change-over switch sends a second control signal to the second power supply change-over switch according to the received first control signal;
the second power supply change-over switch is disconnected with the second interface according to the second control signal, and the first interface is communicated with the charging module through the first power supply change-over switch to supply power.
In some embodiments, the first interface sends a first control signal to the first power switch if and only if the first interface accesses an external device;
detecting whether a third control signal is received or not when the first power supply change-over switch receives the first control signal;
if yes, the first interface supplies power to the charging module through the first power supply change-over switch.
In some embodiments, the power supply switching system further comprises a control module, wherein the control module is connected with the first power supply switching switch, the second interface and the charging module;
If and only if the second interface is connected with the external equipment, the control module detects an OTG signal provided by the external equipment;
When the control module does not receive the OTG signal, the second power supply change-over switch detects whether a fourth control signal is received or not;
If so, the second interface supplies power to the charging module through the second power supply change-over switch.
In some of these embodiments, the control module detects an OTG signal provided by the OTG device if and only if said second interface is connected to the OTG device;
When the control module receives the OTG signal, a fifth control signal is sent to the second power supply change-over switch so that the second power supply change-over switch is switched to a reverse conducting state;
The control module controls the charging module to enter an OTG mode;
the charging module supplies power to the OTG equipment through the second power supply change-over switch.
In some embodiments, the first interface is connected with a first data switch and a second data switch, and the second interface is connected with the first data switch and the second data switch
If and only if the first interface is connected with external equipment, the first interface sends a first control signal to the first data transfer switch;
and the first data change-over switch cuts off the connection with the second interface according to the received first control signal and switches over the connection to the first interface.
In some embodiments, the first interface is connected with a first data switch and a second data switch, and the second interface is connected with the first data switch and the second data switch
When the first interface and the second interface are connected with external equipment, the first interface sends a first control signal to the first data change-over switch and the second data change-over switch;
and the first data change-over switch cuts off the connection with the second interface according to the received first control signal and switches over the connection to the first interface.
And the second data change-over switch cuts off the connection with the second interface according to the received first control signal.
In some embodiments, the first data switch and the second data switch are respectively connected to the second interface if and only if the second interface is connected to an external device, so that the external device can perform data communication with the control module through the second interface.
In some embodiments, the first interface is a USB interface and the second interface is a Microusb interface.
In a second aspect, the present application provides a USB socket comprising a power switching system as described in the first aspect above.
In a third aspect, an embodiment of the present application provides an electronic device, including a USB socket as described in the second aspect.
Compared with the related art, the power supply switching system of the USB socket, the USB socket and the electronic equipment provided by the embodiment of the application have the advantages that when the first interface and the second interface are connected with the external equipment, the first interface sends the first control signal to the first power supply switching switch, the first power supply switching switch sends the second control signal to the second power supply switching switch according to the received first control signal, the second power supply switching switch disconnects the connection with the second interface according to the second control signal, and the switching of the power supply mode when the two interfaces are connected with the external equipment is realized, so that the current backflow caused by the voltage difference of the interfaces when the two interfaces are connected with the external equipment can be effectively avoided, the power supply stability is improved, and the normal power supply realization of the equipment is ensured.
The details of one or more embodiments of the application are set forth in the accompanying drawings and the description below to provide a more thorough understanding of the other features, objects, and advantages of the application.
Detailed Description
The present application will be described and illustrated with reference to the accompanying drawings and examples in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by a person of ordinary skill in the art based on the embodiments provided by the present application without making any inventive effort, are intended to fall within the scope of the present application.
It is apparent that the drawings in the following description are only some examples or embodiments of the present application, and it is possible for those of ordinary skill in the art to apply the present application to other similar situations according to these drawings without inventive effort. Moreover, it should be appreciated that while such a development effort might be complex and lengthy, it would nevertheless be a routine undertaking of design, fabrication, or manufacture for those of ordinary skill having the benefit of this disclosure, and thus should not be construed as having the benefit of this disclosure.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment may be included in at least one embodiment of the application. The appearances of such phrases in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is to be expressly and implicitly understood by those of ordinary skill in the art that the described embodiments of the application can be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms used herein should be given the ordinary meaning as understood by one of ordinary skill in the art to which this application belongs. The terms "a," "an," "the," and similar referents in the context of the application are not to be construed as limiting the quantity, but rather as singular or plural. The terms "comprises," "comprising," "includes," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to only those steps or elements but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The terms "connected," "coupled," and the like in connection with the present application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The term "plurality" as used herein means two or more. "and/or" describes the association relationship of the association object, and indicates that three relationships may exist, for example, "a and/or B" may indicate that a exists alone, a and B exist simultaneously, and B exists alone. The character "/" generally indicates that the context-dependent object is an "or" relationship. The terms "first," "second," "third," and the like, as used herein, are merely distinguishing between similar objects and not representing a particular ordering of objects.
The USB socket is a universal socket with a USB interface and is safe and power-saving, and is a weak-current electronic product. The USB socket generally includes a housing, a base secured within the housing, and an outwardly extending USB interface. The USB interface is mainly characterized by having a hot plug function, being capable of adopting a daisy chain mode to carry out interface expansion, and being internally provided with a charger module, wherein the output end of the charger module is connected with the USB interface, so that common peripheral equipment can be charged through USB. The USB socket has strong practicability and is easy to popularize and use.
The embodiment provides a power supply switching system. The power supply switching system may be integrated in a USB socket or an electronic device having a USB socket, and the present application is not particularly limited. The electronic equipment can be connected with the external equipment to realize charging through the USB socket arranged on the electronic equipment, and can also be connected with the external equipment to perform data transmission.
Fig. 1 is a control schematic block diagram of a power supply switching system according to an embodiment of the present application. As shown in fig. 1, the power supply switching system includes a first interface, a second interface, a first power supply switching switch, a second power supply switching switch, and a charging module. The first interface is connected with the first power supply change-over switch, the second interface is connected with the second power supply change-over switch, the first power supply change-over switch and the second power supply change-over switch are both connected with the charging module, and the first power supply change-over switch is electrically connected with the second power supply change-over switch.
In some embodiments, the first interface and the second interface are both USB interfaces, in other embodiments, the first interface and the second interface may be both Microusb interfaces, in other embodiments, the first interface is a USB interface and the second interface is a Microusb interface, or the first interface is a Microusb interface and the second interface is a USB interface. Wherein, the USB interface can be USB TPYE-C interface, USB TPYE-A interface, etc. It will be appreciated that the first interface and the second interface may also be two-pin or three-pin power jacks, network interfaces, television interfaces, telephone interfaces, etc., and the number thereof may be one or more, and the application is not particularly limited herein. Wherein the priority order of interface power supply and/or communication can be set, so that interface communication and power supply are controlled according to the priority order.
The charging module may be a capacitive storage device such as a battery, super capacitor, and the like.
The first power supply change-over switch and the second power supply change-over switch are used for switching the connection state of the corresponding external equipment and the charging module according to a control signal, and can be a single-pole double-set switch or a transistor (such as a field effect transistor or a bipolar junction transistor). In some embodiments, the first power supply switch and the second power supply switch may be selected from MOS transistors, and of course, the first power supply switch and the second power supply switch may be selected from different types of MOS transistors, for example, the first power supply switch adopts an N-channel MOS transistor, the second power supply switch adopts a P-channel MOS transistor, and so on, so long as the controllable switch of the connection state switching function with the charging module in the embodiment of the present application can be implemented, all belong to the protection scope of the present application.
It will be appreciated by those skilled in the art that the power switching system architecture shown in fig. 1 is not limiting of the power switching system and may include more or fewer components than shown, or certain components may be combined, or a different arrangement of components.
The following uses the first interface as a priority to perform interface communication and power supply, and the power supply switching system is specifically described with reference to fig. 1:
In some embodiments, when the first interface and the second interface are both connected to an external device, the first interface sends a first control signal to the first power supply switching switch, the first power supply switching switch sends a second control signal to the second power supply switching switch according to the received first control signal, and the second power supply switching switch disconnects the connection with the second interface according to the second control signal.
In this embodiment, the first interface is used as a priority to perform interface power supply, that is, when the first interface and the second interface are simultaneously connected to an external device, the power supply of the first interface is mainly used, and the power supply of the second interface is cut off. Specifically, whether the corresponding interfaces are communicated with each other or not can be controlled to supply power by controlling the on-off state of the first power supply change-over switch and the second power supply change-over switch, when the external equipment is required to be supplied with power, the corresponding switches of the external equipment are communicated, and when the external equipment is not required to be supplied with power, the corresponding switches of the external equipment are disconnected. More specifically, the first control signal and the second control signal may be level signals, and the first power supply change-over switch and the second power supply change-over switch control their respective on states by using the change of the high-low level signals.
In a specific embodiment, the first interface is a USB interface, the second interface is a Microusb interface, the USB interface is connected to the first power switch, and the Microusb interface is connected to the second power switch. And when the USB interface and the Microusb interface are simultaneously connected with external equipment, the USB interface provides a first control level for the first power supply change-over switch, and after the first control level is received by the first power supply change-over switch, a second control level is sent to the second power supply change-over switch. At this time, the second power supply change-over switch is disconnected with the second interface according to the second control level, so that the passage between the external equipment and the charging module is disconnected, and the first interface is communicated with the charging module for supplying power through the first power supply change-over switch. In this embodiment, the first control signal may be a low level signal and the second control signal may be a high level signal, and of course, the first control signal may also be a high level signal and the second control signal may be a low level signal.
Of course, in other embodiments, the second interface may be used as a priority to perform interface communication and power supply, and the priority order may be configured in a customized manner according to the interface setting in practical application, which is not limited herein.
In summary, in the power supply switching system of the USB socket provided by the embodiment of the application, when the first interface and the second interface are connected with the external equipment, the first interface sends the first control signal to the first power supply switching switch, the first power supply switching switch sends the second control signal to the second power supply switching switch according to the received first control signal, and the second power supply switching switch disconnects the connection with the second interface according to the second control signal, so that the switching of the power supply modes when the two interfaces are connected with the external equipment is realized, and the current backflow caused by the voltage difference of the interfaces when the two interfaces are connected with the external equipment is effectively avoided, the power supply stability is improved, and the normal power supply realization of the equipment is ensured.
In some of the above embodiments, as shown in fig. 2, the first interface sends a first control signal to the first power switch if and only if the first interface is connected to an external device, detects whether a third control signal is received when the first power switch receives the first control signal, and if so, the first interface supplies power to the charging module through the first power switch.
In this embodiment, if and only if the first interface is connected to an external device, the first power supply change-over switch may be controlled to connect to the charging module for power supply. In a specific embodiment, the first control signal may be a level signal, and the third control signal may be a VBUS signal provided by the external device. If and only if the first interface is connected with external equipment, the first power supply change-over switch controls the conducting state of the first power supply change-over switch by utilizing the change of high-low level signals, and if the first power supply change-over switch receives a first control level, whether a VBUS signal provided by the external equipment is received or not is detected; when the VBUS signal is detected, the first interface is communicated to the charging module through the first power supply change-over switch to supply power to the charging module.
As shown in fig. 3, in some embodiments, the power supply switching system further includes a control module, where the control module connects the first power supply switching switch, the second interface, and the charging module.
In the embodiment, if and only if the second interface is connected with the external device, the control module detects an OTG signal provided by the external device, and if the control module does not receive the OTG signal, the second power supply change-over switch detects whether a fourth control signal is received, and if so, the second interface supplies power to the charging module through the second power supply change-over switch.
In this embodiment, the OTG device refers to an external device having an OTG function. OTG (On-The-Go, inter-host-less data transfer) technology is mainly applied to The connection of various different device times, i.e., the data transfer between slave devices is realized without a master device. A variety of different connectors between devices such as digital cameras, video cameras, printers, etc. are changed.
In a specific embodiment, the second interface is taken as Microusb interface, and when detecting the OTG device, according to the USB interface protocol, if the OTG function needs to be supported, an Identification (ID) detection pin inside the USB interface needs to be set to a high level by default. Because the ID detection pin of the USB interface is always at a high level, when the Microusb interface is connected with the OTG device, the control module detects the OTG signal provided by the external device, and then the voltage is at a low level, and at the moment, the control module detects that the Microusb interface is inserted into the OTG device. Otherwise, when the control module does not receive the OTG signal, the control module detects that the Microusb interface is not inserted into the OTG device. And when the VBUS signal is detected, the Microusb interface is communicated to the charging module through the second power supply change-over switch to supply power to the charging module.
The control module may be a chip with a data processing function, for example, a single chip microcomputer or the like.
On the basis of the above embodiments, in some embodiments, if and only if the second interface is connected to the OTG device, the control module detects an OTG signal provided by the OTG device, when the control module receives the OTG signal, a fifth control signal is sent to the second power supply switch to switch the second power supply switch to a reverse conduction state, the control module controls the charging module to enter an OTG mode, and the charging module supplies power to the OTG device through the second power supply switch.
In this embodiment, after the control module detects the OTG signal provided by the OTG device, it is determined Microusb that the OTG device is inserted into the interface, and at this time, the control module sends a fifth control signal to the second power switch, so that the second power switch is switched to the on state. And the charging module is controlled to enter an OTG mode through I2C, and the charging module supplies power to the OTG equipment through the second power supply change-over switch.
As shown in fig. 4, in some of the above embodiments, the first interface is connected to a first data switch and a second data switch, and the second interface is connected to the first data switch and the second data switch. And if and only if the first interface is connected with an external device, the data switching process is that the first interface sends a first control signal to the first data switching switch, and the first data switching switch cuts off the connection with the second interface and switches the connection to the first interface according to the received first control signal.
In this embodiment, the communication link connection may be controlled by controlling the on-off of the first data switch and the second data switch. The first data switch and the second data switch are existing devices, and the data channel is selected by controlling the connection state of the pins, which is not described herein. More specifically, the first control signal and the second control signal may be level signals, and the first data switch and the second data switch control their turn-on states by using the change of the high and low level signals.
In a specific embodiment, each of the first interface and the second interface has at least 5 pins including a VBUS pin, a DM pin, a DP pin, an ID pin, and a GND pin. The first interface provides a first control level to the first data transfer switch if and only if the first interface accesses an external device. And after the first control level is received by the first data switching switch, the connection between the first data switching switch and the DM2 pin and the DP2 pin of the second interface is cut off, the connection between the first data switching switch and the DM1 pin and the DP1 pin of the first interface are switched, and the first interface is used as a data communication interface. And meanwhile, the ID2 pin of the second interface is switched to a suspension state, so that the external equipment is prevented from being mistakenly identified as OTG equipment when being accessed.
On the basis of the above embodiments, in some embodiments, the first interface is connected with a first data switch and a second data switch, the second interface is connected with the first data switch and the second data switch, and when the first interface and the second interface are both connected to an external device, the data switching process is that the first interface sends a first control signal to the first data switch and the second data switch, the first data switch cuts off connection with the second interface according to the received first control signal and switches connection with the first interface, and the second data switch cuts off connection with the second interface according to the received first control signal.
In this embodiment, when the first interface and the second interface are both connected to an external device, interface communication is performed with the first interface as a priority, and communication connection between the control module and the second interface is cut off. Specifically, the first interface provides a first control level to the first data switch. And after the first control level is received by the first data switching switch, the connection between the first data switching switch and the DM2 pin and the DP2 pin of the second interface is cut off, the connection between the first data switching switch and the DM1 pin and the DP1 pin of the first interface are switched, and the first interface is used as a data communication interface. After the second data change-over switch receives the first control level, the connection between the DM2 pin and the DP2 pin of the second interface is cut off, so that the hardware connection channel between the second interface and the control module can be completely cut off when an external device is inserted, and the first interface and the control module are used for data communication. Therefore, the data transmission switching between the two communication interfaces is realized, the data error caused by the simultaneous data transmission can be effectively avoided when the two external devices are simultaneously inserted in the data transmission process, and the stability of the data transmission process is ensured.
On the basis of the above embodiments, in some embodiments, if and only if the second interface is connected to an external device, the data switching process is that the first data switching switch and the second data switching switch are respectively connected to the second interface, so that the external device communicates data with the control module through the second interface.
In this embodiment, the data switching process when and only when the second interface is connected to the external device is the same as the control principle when and only when the first interface is connected to the external device, and for brevity, reference may be made to the related content of the above embodiment, and the description of the present application is not repeated here. It will be appreciated that in other embodiments, a default hardware configuration may be provided such that the first data switch and the second data switch are respectively connected to the second interface, at which time data communication is performed according to the default configuration if and only if the second interface is connected to an external device.
Through the steps, the embodiment further realizes the data switching of the two interfaces on the basis of realizing the switching of the power supply mode when the two interfaces are both connected with the external equipment, and can effectively avoid data errors caused by the simultaneous transmission of the data when the two interfaces are both connected with the external equipment in the data transmission process.
The power supply switching system described in the above embodiment can be applied to a USB socket.
The embodiment also provides electronic equipment comprising the USB socket.
In some embodiments, the electronic device may be a law enforcement recorder, for example, a handheld law enforcement recorder. The law enforcement recorder is evidence obtaining technical equipment which is worn with the user when the official business is executed and integrates functions of real-time video and audio shooting, photographing, recording and the like. The system integrates functions of shooting, photographing, intercom, positioning and storage, can transmit video in real time, can digitally record dynamic and static site conditions in the law enforcement process, and is convenient for law enforcement in various environments.
The law enforcement recorder comprises a mobile terminal and a camera. The mobile terminal is provided with the USB socket, the USB socket is provided with the first interface and the second interface, and interface communication and power supply can be carried out with external equipment through the first interface and the second interface.
Of course, in other embodiments, the USB socket may further include a USB adapter (such as a USB-to-mini USB type, a USB-to-micro USB type, or a USB-to-Lightning interface), an overshoot protection device, a signal indication device, a wireless communication module, etc., which are not described herein. The electronic device may also be a portable product such as a cell phone, a Portable Media Player (PMP), a Mobile Internet Device (MID), etc.
The above-described embodiments do not limit the scope of protection of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the above embodiments should be included in the scope of the present invention.
The embodiment also provides a power supply switching method which is applied to the power supply switching system. Fig. 5 is a flowchart of a power supply switching method according to an embodiment of the present application, as shown in fig. 5, for performing interface communication and power supply with the first interface as a priority, where the flowchart includes the following steps:
First, it is determined whether the first interface is a first control signal sent to the first power supply changeover switch. When the first interface sends a first control signal to the first power supply change-over switch, the first power supply change-over switch controls the self-conduction state by utilizing the change of the high-low level signal. When the first control signal is received, the first power supply change-over switch sends a second control signal to the second power supply change-over switch according to the received first control signal, and the second power supply change-over switch disconnects the connection with the second interface according to the second control signal. And detecting whether a third control signal is received or not when the first power supply change-over switch receives the first control signal, and if so, supplying power to the charging module by the first interface through the first power supply change-over switch.
Meanwhile, when the first power supply change-over switch does not receive the first control signal sent by the first interface, the control module detects an OTG signal provided by external equipment. And when the control module does not receive the OTG signal, the second power supply change-over switch detects whether a fourth control signal is received, and if so, the second interface supplies power to the charging module through the second power supply change-over switch. When the control module receives the OTG signal, the control module sends a fifth control signal to the second power supply change-over switch so as to enable the second power supply change-over switch to be switched to a reverse conducting state, and meanwhile the control module controls the charging module to enter an OTG mode so as to enable the charging module to supply power to the OTG equipment through the second power supply change-over switch.
In this embodiment, the first interface and the second interface are both USB interfaces, in other embodiments, the first interface and the second interface may be both Microusb interfaces, in other embodiments, the first interface is a USB interface and the second interface is a Microusb interface, or the first interface is a Microusb interface and the second interface is a USB interface. Wherein, the USB interface can be USB TPYE-C interface, USB TPYE-A interface, etc. It will be appreciated that the first interface and the second interface may also be two-pin or three-pin power jacks, network interfaces, television interfaces, telephone interfaces, etc., and the number thereof may be one or more, and the application is not particularly limited herein. Wherein the priority order of interface power supply and/or communication can be set, so that interface communication and power supply are controlled according to the priority order.
Through the steps, the switching of the power supply mode when the two interfaces are connected to the external equipment is realized, so that the current backflow caused by the voltage difference of the interfaces when the two interfaces are connected to the external equipment can be effectively avoided, the power supply stability is improved, and the normal power supply of the equipment is ensured.
It should be noted that the steps illustrated in the above-described flow or flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order other than that illustrated herein.
The technical features of the above-described embodiments may be arbitrarily combined, and all possible combinations of the technical features in the above-described embodiments are not described for brevity of description, however, as long as there is no contradiction between the combinations of the technical features, they should be considered as the scope of the description.
The above examples illustrate only a few embodiments of the application, which are described in detail and are not to be construed as limiting the scope of the application. It should be noted that it will be apparent to those skilled in the art that several variations and modifications can be made without departing from the spirit of the application, which are all within the scope of the application. Accordingly, the scope of protection of the present application is to be determined by the appended claims.