The content of the invention
The purpose of embodiment of the present invention is to provide a kind of terminal and electricity sharing method, such that it is able to realize different shiftingsElectricity is shared between dynamic terminal so that user is nearby without charging socket or without carrying portable power source or mobileCan be that the current terminal for there be not electricity is powered by other mobile terminals, such that it is able to multiple is mobile in the case that power supply does not have electricityThe battery power resources of terminal carry out reasonable employment.
In order to solve the above technical problems, embodiments of the present invention include there is provided a kind of terminal:Switching chip, power supply pipeReason circuit, charging circuit, USB interface, control circuit and battery;Electric power management circuit, charging circuit respectively with control circuit phaseEven;The identification pin and temperature pin of battery are electrically connected with the test side of electric power management circuit, the positive pole pin of battery and ground connectionPin is connected with the first feeder ear of charging circuit;Switching chip has control end, common port, the first connection end and the second connectionEnd, wherein, common port is connected with USB interface;First connection end middle part separates pin and is connected with the charging end of charging circuit, and other drawPin is connected with control circuit;The part pin of the second connection end is electrically connected with the first feeder ear of charging circuit, other pins withThe test side electrical connection of electric power management circuit;Wherein, when being applied in first voltage in control end, common port is connected to the second companyConnect end;Controlling circuit is used to detect the voltage on the power supply VBUS pins of USB interface, and in the voltage for detecting in preset rangeWhen interior, first voltage is applied to control end;Or, control circuit is used to detect electricity shared instruction, and is total to electricity is receivedWhen enjoying instruction, first voltage is applied to control end.
Embodiments of the present invention additionally provide a kind of electricity sharing method, based in any terminal embodiment of the inventionTerminal, and the supplier of electricity that terminal is shared as electricity, the electricity sharing method include:There is USB to connect in USB interface is detectedWiring is inserted, and when detecting electricity shared instruction, control circuit applies first voltage to the control end of switching chip;SwitchingThe common port of chip is connected to the second connection end, the electrical connection between turn-on battery and USB interface.
Embodiments of the present invention additionally provide a kind of electricity sharing method, based in any terminal embodiment of the inventionTerminal, and terminal as electricity share by electricity side, the electricity sharing method includes:Detect that the power supply VBUS of USB interface drawsVoltage on pin;The voltage for detecting within a preset range when, to switching chip control end apply first voltage;Switching coreThe common port of piece is connected to first feeder ear and electric power management circuit of the second connection end, conducting USB interface and charging circuitTest side between electrical connection.
Embodiment of the present invention in terms of existing technologies, a switching chip is set by terminal inner, and willEach pin of USB interface is connected with the common port of switching chip, will be used to realize that the D+ and D- of data interaction draw in USB interfacePin is connected on control circuit by switching the first connection end of chip, and the VBUS pins and GND pin in USB interface are passed throughThe first connection end for switching chip is connected to the charging end of charging circuit, and the first of charging circuit is connected to by the second connection endFeeder ear, other pins are then electrically connected with the test side of electric power management circuit.By the improvement of the annexation to internal wiring,Circuit is controlled by detecting the electricity shared instruction that the voltage on VBUS pins or user operate, according to testing result to switchingThe control end of chip applies corresponding voltage, and the common port of control switching chip is connected to the second connection end, it is achieved thereby that eventuallyEnd can switch different circuits according to device type external in USB interface, and the electricity for reaching battery between different terminals canWith the purpose shared.
In addition, control circuit includes processor and voltage checking chip;Processor have a GPIO pin, GPIO pin withSwitch the control end connection of chip;Voltage checking chip is used to detect the voltage on VBUS pins, and exists in the voltage for detectingWhen in preset range, interrupt signal is sent to processor;Processor applies the first electricity when interrupt signal is received to control endPressure.A kind of detection circuit of voltage on VBUS pins to USB interface is the embodiment of the invention provides, specifically using voltage detectingChip realizes the detection to voltage, and when voltage is detected in preset range, interrupt signal is sent to processor so thatProcessor can apply first voltage by the control end to switching chip, be connected to the common port for switching chip so as to reachThe purpose of the second connection end.
In addition, control circuit includes processor;Processor has a GPIO pin, GPIO pin and the control for switching chipEnd connection;Processor also has an ADC pins, and ADC pins are connected with VBUS pins;Processor detects VBUS by ADC pinsVoltage on pin, and the voltage for detecting within a preset range when, to control end apply first voltage.By using existingThe ADC pins of processor, in the case where hardware is not increased, realize the detection to VBUS pin voltages, and to switching chipControl, and simplify terminating circuit.
In addition, terminal also includes electronic switch array;Wherein, the control end of electronic switch array and control circuit electricity phaseEven, under the control of control circuit, electronic switch array is switched on or off each pin and charging circuit or power supply of batteryConnection between management circuit.By setting electronic switch array between battery and charging circuit, obtained from external terminalDuring electric current, the connection between the battery of this terminal and charging circuit is disconnected, make foreign current by switching the second connection of chipAfter end enters charging circuit, directly for terminal to be charged is powered, prevent electric current from flowing into battery so that the battery of power supply terminal can be withSupport two loads of terminal.
In addition, when there is USB connecting lines to insert in detecting USB interface, providing electricity in the display interface of terminal and sharingSelection entrance;When choosing operation of entrance of selection is shared to electricity user is detected, judgement detects electricity shared instruction.It is logicalCross and provide the manipulable electricity of user shared selection entrance in display interface, such that it is able to reach between different terminals are neededWhen electricity is shared, user can conveniently open, and meet actual demand.
In addition, after electrical connection between turn-on battery and USB interface, closing display screen.Connect with USB in turn-on batteryAfter electrical connection between mouthful, the display screen of supplier of electricity is automatically switched off so that supplier of electricity enters death of monks or nuns screen battery saving mode, such that it is able toEnsure that the battery of supplier of electricity is supported itself and loaded by electricity side enough.
In addition, between first feeder ear and the test side of electric power management circuit of conducting USB interface and charging circuitElectrical connection after, control circuit controling electronic switch arrays disconnect each pin and charging circuit or power management of batteryConnection between circuit.Conducting USB interface and charging circuit the first feeder ear and electric power management circuit test side itBetween electrical connection after, controlled circuit to pass through control by electricity side and be arranged at electronic switch array between battery and charging circuitEach pin of battery and the connection between charging circuit or electric power management circuit are disconnected, such that it is able to prevent supplier of electricity batteryDischarge and flow through the USB connecting lines battery of inflow by electricity side after USB interface enters by electricity side so that the battery institute of supplier of electricityDischarge stream is directly entered charging circuit, is, by the power supply of electricity side, further to reduce the power supply pressure of supplier of electricity battery so that supplier of electricityBattery can support two loads of terminal.
In addition, between first feeder ear and the test side of electric power management circuit of conducting USB interface and charging circuitElectrical connection after, electricity sharing method also includes:There is provided in the display interface of terminal and stop the shared selection entrance of electricity;In inspectionMeasure user and share when choosing operation of entrance of selection to stopping electricity, processor applies the second electricity to the control end of switching chipFlat, the common port for switching chip is connected to the first connection end.Realizing that the battery of supplier of electricity is after being powered by electricity side, to pass throughStop the shared selection entrance of electricity being provided by the display interface of electricity side, and according to the testing result to the entrance, by processorControl end to switching chip applies second electrical level, and common port is connected into the first connection end, recovers existing power supply circuit, fromAnd the side's of stopping power supply battery institute discharge stream enters interior by electricity side, facilitate user to stop the electricity between terminal at any time and share, meetActual demand.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to each reality of the inventionThe mode of applying is explained in detail.However, it will be understood by those skilled in the art that in each implementation method of the invention,In order that reader more fully understands the application and proposes many ins and outs.But, even if without these ins and outs and baseMany variations and modification in following implementation method, it is also possible to realize the application technical scheme required for protection.
First embodiment of the invention is related to a kind of terminal, as shown in Figure 1.The terminal includes:Switching chip 101, electricityPower management circuits 102, charging circuit 103, usb 1 04, control circuit 105 and battery 106.Electric power management circuit 102, fillCircuit 103 is connected with control circuit 105 respectively;The identification pin (the ID pins in Fig. 1) and temperature pin of battery 106 and electricityThe test side of power management circuits 102 is electrically connected, positive pole pin and grounding pin (GND pin in Fig. 1) and the charging of battery 106The first feeder ear connection of circuit 103.
Wherein, switching chip 101 has control end, common port, the first connection end and the second connection end, is connect with USB respectivelyMouth 104, charging circuit 103, control circuit 105 and electric power management circuit 102 are connected.Specifically, common port connects with USB respectivelyEach pin connection of mouth 104;First connection end middle part separates pin and be connected with the charging end of charging circuit 103, other pins and controlsCircuit processed 105 is connected;The part pin of the second connection end is electrically connected with the first feeder ear of charging circuit 103, other pins withThe test side electrical connection of electric power management circuit 102.
Control circuit 105 includes processor 105-1 and voltage detecting circuit 105-2, mainly for detection of the electricity of USB interfaceVoltage on the VBUS pins of source, and the voltage for detecting within a preset range when, to control end apply first voltage.
In addition, control circuit 105 is additionally operable to detect electricity shared instruction, and when electricity shared instruction is received, to controlEnd processed applies first voltage.
Specifically, voltage checking chip 105-2 is used to detect the voltage on the VBUS pins of usb 1 04, and is examiningThe voltage for measuring within a preset range when, send interrupt signal to processor 105-1.Processor 105-1 is receiving interruption letterNumber when, the GPIO pin having by it applies first voltage to the control end of switching chip 101, and switching chip 101 is being receivedTo processor 105-1 apply first voltage when, common port is connected to the second connection end.
It should be noted that in 04 external different types of terminal device of usb 1, the voltage on VBUS pinsIt is different, therefore the voltage that voltage checking chip 105-2 is detected would also vary from, and report the letter of processor 105-1Breath would also vary from, therefore, processor 105-1 can apply corresponding first voltage to switching core according to different testing resultsIn the control end of piece 101.When first voltage is applied in the control end for switching chip 101, the common port for switching chip 101 connectsIt is connected to the second connection end.
Specifically, when usb 1 04 inserts other-end equipment by USB connecting lines, voltage checking chip 105-2 voltages that can detect on the VBUS pins of now usb 1 04 are how many, detecting voltage for 5V, or more than 5V, such as9V etc., it is possible to determine that the terminal equipment type that the usb 1 04 of present terminal is external is HOST main equipments, such as computer, mobile electricitySource, or charger etc., the magnitude of voltage 5V or other mark external equipments that now processor 105-1 will can be detected be computer,The magnitude of voltage of portable power source, charger etc. is applied in the control end of switching chip 101, and control switching chip 101 will be by public affairsThe VBUS pins of the UBS interfaces 104 for terminating altogether and the connection of GND pin turn on UBS interfaces on the first connection endConnection between 104 and charging circuit 103, makes foreign current enter terminal by UBS interfaces 104, is embodied as the battery of terminal106 functions of charging and power for terminal.
It is more than 3V, during less than 4.5V voltage is detected, it is possible to determine that the usb 1 04 of present terminal external endEnd equipment type is similar with present terminal, that is, be mobile terminal device, such as mobile phone, panel computer, now processor 105-1The magnitude of voltage (being located at the magnitude of voltage between 3V~4.5V) that will can be detected, or mark external equipment is the electricity of mobile terminal devicePressure value is applied in the control end of switching chip 101, the UBS interfaces 104 that control switching chip 101 will be accessed by common portThe connection of VBUS pins and GND pin on the second connection end, the company between conducting UBS interfaces 104 and charging circuit 103Connect, foreign current is entered terminal by UBS interfaces 104, be embodied as the work(that the battery 106 of terminal charges and powers for terminalEnergy.
In addition, it is noted that in actual applications, one can also be set between battery 106 and charging circuit 103Individual electronic switch array 107, each pin and the annexation between electric power management circuit 102 and charging circuit 103 of battery 106As shown in Figure 2.
Specifically, the control end of electronic switch array 107 is electrically connected with control circuit 105, in the control of control circuit 105Under system, the connection between each pin of battery 106 and charging circuit 103 or electric power management circuit 102 is switched on or off.
It should be noted that when the electricity of battery 106 of present terminal can not support that this terminal is loaded, and external setDuring for for mobile terminal, the VBUS pins and GND pin of the UBS interfaces 104 that control switching chip 101 will be accessed by common portConnection on the second connection end, after the connection between conducting UBS interfaces 104 and charging circuit 103, electronic switch arrayThe control command that the 107 control circuits 105 received according to control end send, disconnects each pin and the electricity that charges of battery 106Connection between road 103 or electric power management circuit 102, so as to reduce the power supply pressure of external mobile end cell so thatThe electricity of external mobile end cell output can ensure two loads of terminal.
If in addition, it is noted that there is provided electronic switch array 107, this can be supported in battery 106 in terminalWhen terminal is loaded, or in usb 1 04 without external any equipment, also or usb 1 04 it is external be that HOST master setsDuring standby or charger, electronic switch array 107 is in the conduction state, i.e. each pin of battery 106 and charging circuit 103Or the connection between electric power management circuit 102 is conducting.
In addition, the electronic switch array 107 being arranged in present embodiment between battery 106 and charging circuit 103, can be withIt is triode switch, or other have each pin and charging circuit 103 or electric power management circuit of control battery 106The device that connection between 102 is switched on or off, is not limited here.
Compared with prior art, the terminal in present embodiment, a switching chip is set by terminal inner, and willEach pin of USB interface is connected with the common port of switching chip, will be used to realize that the D+ and D- of data exchange draw in USB interfacePin is connected on control circuit by switching the first connection end of chip, and the VBUS pins and GND pin in USB interface are passed throughThe first connection end for switching chip is connected to the charging end of charging circuit, and the first of charging circuit is connected to by the second connection endFeeder ear, other pins are then electrically connected with the test side of electric power management circuit.By the improvement of the annexation to internal wiring,Circuit is controlled by detecting the electricity shared instruction that the voltage on VBUS pins or user operate, according to testing result to switchingThe control end of chip applies corresponding voltage, and the common port of control switching chip is connected to the second connection end, it is achieved thereby that eventuallyEnd can switch different circuits according to device type external in USB interface, and the electricity for reaching battery between different terminals canWith the purpose shared.
Second embodiment of the present invention is related to a kind of terminal.Present embodiment is done on the basis of first embodimentFurther improve, specific improvements are:The voltage on USB interface VBUS pins is entered using the ADC pins of processor directlyRow detection, and the voltage of the control end of switching chip is applied to according to testing result control, concrete structure is as shown in Figure 4.
Terminal in present embodiment compared with the terminal shown in Fig. 2, directly using processor as control circuit, by willOne ADC pin cramp joint of processor realizes the detection to VBUS pin voltages on the VBUS pins of USB interface, so thatDirectly according to testing result, different voltages to the control end of switching chip are applied by GPIO pin, control switching chipCommon port alternative is connected to the first connection end and the second connection end, is realizing that battery electric quantity between terminal and terminal is sharedMeanwhile, also simplify terminal inner circuit.In addition, the terminal in present embodiment, it is also possible between battery and charging circuitOne electronic switch array is set, and the control end of electronic switch array is electrically connected on processor, so as to realize control electricitySub switch array disconnects or each pin of turn-on battery and the connection between charging circuit or electric power management circuit.
Third embodiment of the present invention is related to a kind of electricity sharing method, and the electricity sharing method shown in Fig. 5 can beUsed in user terminal, wherein, the supplier of electricity that the user terminal is shared as electricity can be such as smart mobile phone, flat board electricityBrain, personal digital assistant and wearable electronic equipment, etc..Specifically, the flow of the electricity sharing method that Fig. 5 is related toCan include:
In step 501, whether USB connecting lines insert in detection USB interface.
Specifically, step is performed when there are USB connecting lines to insert in detecting its USB interface as the terminal of supplier of electricityRapid 502;Otherwise, continue to detect in USB interface whether there is the insertion of USB connecting lines, untill into step 502.
In step 502, the display interface in terminal provides electricity shared selection entrance.
Specifically, when there are USB connecting lines to insert in detecting USB interface, carried in the display interface of supplier of electricity terminalThe shared selection entrance of delivery, such as in arbitrary interface in pop-up mode, there is provided the shared selection entrance of electricity, or in terminalIncrease electricity is shared in setting interface selects, into confession user operation, etc., to will not enumerate here.
In addition, it is necessary to explanation, if electricity shares selection entrance to be provided in interface is set, in initial shapeWhen USB connecting lines are not inserted into state, i.e. USB interface, the shared selection entrance of electricity can be set to not optional state, i.e. userThe entrance cannot be operated, when USB connecting lines are inserted in detecting USB interface, the shared selection entrance of electricity optional state is set to.In actual applications, can be provided in the display interface of terminal according to the application scenarios of terminal or the use habit of userElectricity is shared to be selected to be operated into confession user, is not limited here.
In step 503, detect whether that user shares selection entrance to electricity and chooses operation.
Specifically, detect user to electricity share selection when choosing operation of entrance, judgement detect electricity be total toInstruction is enjoyed, step 504 is performed;Otherwise, continue to detect whether that what user shared selection entrance to electricity chooses operation, until sentencingRegular inspection measures electricity shared instruction, untill being extracted into the USB connecting lines in step 504, or USB interface.
In step 504, control circuit applies first voltage to the control end of switching chip.
Specifically, USB connecting lines insert in USB interface is detected, and when detecting electricity shared instruction, controlCircuit processed applies first voltage to the control end of switching chip.
It should be noted that it is pre- to the first voltage that the control end of switching chip applies that circuit is controlled in present embodimentFirst set, and the magnitude of voltage can be not unique fixation according to actual specific setting, as long as receiving the shared finger of electricityWhen making, can notify that switching chip present terminal is needed as supplier of electricity, the common port that chip is switched when as supplier of electricity is neededThe second connection end is connected to, is not limited here.
In step 505, the electrical connection between turn-on battery and USB interface.
Specifically, after control circuit applies first voltage to the control end of switching chip, the common port of chip is switchedThe second connection end is connected to, so that the electrical connection between turn-on battery and USB interface.
Compared with prior art, when thering are USB connecting lines to insert in UBS interfaces in present embodiment, by providing oneThe shared selection entrance of electricity that user can be operated, and by the detection to the entrance, determining whether user needs oughtThe supplier of electricity that preceding terminal is shared as electricity, is that another terminal connected by USB connecting lines is powered, and is judging to examineMeasure electricity shared instruction, i.e. user and when choosing operation of entrance of selection is shared to electricity, by controlling circuit to switching chipControl end apply first voltage, control switching chip common port be connected to the second connection end, each pin of turn-on batteryWith the electrical connection of each pin of USB interface, so as to the electric current that the battery for realizing supplier of electricity terminal is put, by current conductingCircuit enters another terminal being attached thereto through USB connecting lines, is embodied as the terminal and powers, and has reached battery between different terminalsThe purpose that electricity can be shared, is effectively utilized the electricity of supplier of electricity battery.
It is seen that, present embodiment is the device embodiment corresponding with first embodiment, and present embodiment can be withFirst embodiment is worked in coordination implementation.The relevant technical details mentioned in first embodiment still have in the present embodimentEffect, in order to reduce repetition, repeats no more here.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable inIn first embodiment.
4th implementation method of the invention is related to a kind of electricity sharing method.Base of the present embodiment in the 3rd implementation methodFurther improvement is done on plinth, specific improvements are:After electrical connection between turn-on battery and USB interface, close aobviousDisplay screen.Idiographic flow is as shown in Figure 6.
In step 601, whether USB connecting lines insert in detection USB interface.Terminal as supplier of electricity is being detectedWhen there are USB connecting lines to insert in its USB interface, step 602 is performed;Otherwise, continue whether there is USB to connect in detection USB interfaceLine is inserted, untill into step 602.
In step 602, the display interface in terminal provides electricity shared selection entrance.
In step 603, detect whether that user shares selection entrance to electricity and chooses operation.Detecting user coupleElectricity shares when choosing operation of entrance of selection, and judgement detects electricity shared instruction, performs step 604;Otherwise, continue to detectWhether there is user that selection entrance is shared to electricity and choose operation, until judgement detects electricity shared instruction, into stepUntill USB connecting lines in 604, or USB interface are extracted.
In step 604, control circuit applies first voltage to the control end of switching chip.
In step 605, the electrical connection between turn-on battery and USB interface.
Because step 601 is big to step 505 to step 605 and step 501 in the 3rd implementation method in present embodimentCause identical, it is intended to which detecting in USB interface has USB connecting lines to insert, and when detecting electricity shared instruction control circuit toThe control end for switching chip applies first voltage;So as to the common port for switching chip is connected into the second connection end, conducting is realizedElectrical connection between battery and USB interface, here is omitted.
In step 606, display screen is closed.
Specifically, after the electrical connection between turn-on battery and USB interface, display screen is closed so that supplier of electricity entersDeath of monks or nuns screen battery saving mode, thereby may be ensured that the battery of supplier of electricity is supported itself and loaded by electricity side enough.
It should be noted that terminal electric current maximum of mean consumption under normal bright screen state can reach 800mA, nowIf in itself with the terminal for receiving to power all in normal bright screen state, the operating pressure of supplier of electricity battery can accordingly increase supplier of electricityGreatly, after the electrical connection therefore between turn-on battery and USB interface, supplier of electricity will averagely disappear automatically into the screen battery saving mode that goes outThe electric current of consumption drops to 30mA, while electricity is shared between two terminals are realized, reduces the loss of electric current.
Compared with prior art, in present embodiment as the terminal of supplier of electricity between turn-on battery and USB interfaceAfter electrical connection, by closing display screen, enter death of monks or nuns screen battery saving mode, while electricity is shared between two terminals are realized,Ensure that the battery of supplier of electricity is supported itself and loaded by electricity side enough, so as to ensure that two terminals can normal Standby workMake.
5th implementation method of the invention is related to a kind of electricity sharing method, and the electricity sharing method shown in Fig. 7 can beUsed in user terminal, wherein, the user terminal as electricity share by electricity side, can be that such as smart mobile phone, flat board are electricBrain, personal digital assistant and wearable electronic equipment, etc..Specifically, the flow of the electricity sharing method that Fig. 7 is related toCan include:
In step 701, whether within a preset range the voltage on the power supply VBUS pins of detection USB interface.
Specifically, when the voltage on the power supply VBUS pins for detecting USB interface is in default scope, step is performedRapid 702;Otherwise, continue detect USB interface power supply VBUS pins on voltage whether within a preset range, until entering stepUntill 702.
It should be noted that preset range described in present embodiment is 3V~4.5V, due to passing through in UBS interfacesWhen the power supply unit that USB connecting lines are accessed is the terminal as supplier of electricity, the voltage on its VBUS pin will be generally less than 4.3V,And in order to the battery institute discharge stream for ensureing external supplier of electricity terminal can smoothly enter by electricity side, therefore VBUS pinsVoltage is generally required more than 3V, therefore whether preset range is set into can accurately judge external equipment between 3V~4.5VIt is as the terminal of supplier of electricity.
In addition, when the voltage on VBUS pins is not in preset range, if the voltage for detecting is more than 4.5V, oneAs can be determined that external power supply unit is charger, portable power source, host main equipments etc. (VBUS pin voltages are usually 5V),Or quick charger (VBUS pin voltages are usually 9V);If the voltage for detecting is less than 3V, it is believed that currently withoutExternal equipment, or selection is data interaction etc., after inserting USB connecting lines to UBS interfaces in actual applications, external setsThe judgement of standby or execution power supply, here is omitted, and those skilled in the art can be according to existing detection and judgementMethod is accurately obtained.
In a step 702, first voltage is applied to the control end of switching chip.
Specifically, when the voltage on the power supply VBUS pins for detecting USB interface is in default scope, to switchingThe control end of chip applies first voltage.
It should be noted that it is pre- to the first voltage that the control end of switching chip applies that circuit is controlled in present embodimentFirst set, and the magnitude of voltage can be not unique fixation according to actual specific setting, after USB connecting lines are inserted, not haveWhen receiving electricity shared instruction, but detecting on VBUS pins voltage within a preset range, can notify that switching chip is currentTerminal is needed as electricity side is received, and the common port that chip is switched when as by electricity side requires connect to the second connection end, thisIn be not limited.
In step 703, USB interface and the electrical connection between charging circuit and electric power management circuit are turned on.
Specifically, after first voltage is applied to the control end of switching chip, switching chip is according to being applied to control endFirst voltage, common port is connected on the second connection end, thus turn on the first feeder ear of USB interface and charging circuit withAnd the electrical connection between the test side of electric power management circuit.
In step 704, control circuit controling electronic switch arrays disconnect battery with charging circuit or power management electricityConnection between road.
Specifically, in first feeder ear of the conducting USB interface with charging circuit and the test side of electric power management circuitBetween electrical connection after, control circuit controling electronic switch arrays disconnect each pin of battery, that is, recognize that pin, temperature drawPin, positive pole pin, the connection between grounding pin, with charging circuit or electric power management circuit, so as to prevent supplier of electricity batteryDischarge and flow through USB connecting lines into by behind electricity side, electric current is flowed into the battery by electricity side.
It should be noted that in order to ensure each pin for controlling circuit controling electronic switch arrays to disconnect battery and chargeConnection between circuit or electric power management circuit, is the first feeder ear and power supply in conducting USB interface with charging circuitManage after the electrical connection between the test side of circuit, one time delayed turn-off can be set in application layer and instruct, such as 50ms, so thatAvoid what is be also not turned between the first feeder ear and the test side of electric power management circuit in USB interface and charging circuitIn the case of be just disconnected by electricity side's battery each pin and charging circuit or electric power management circuit between connecting, cause endThere is shutdown in end, influences the problem of the experience of user.
Compared with prior art, by the detection of the power supply VBUS pin voltages to USB interface in present embodiment, andWhen detecting voltage on VBUS pins within a preset range, first voltage is applied by the control end to switching chip, so thatThe common port of control switching chip is connected on the second connection end, realizes the first feeder ear of conducting USB interface and charging circuitAnd the electrical connection between the test side of electric power management circuit, reach from external supplier of electricity and obtain electric current for receiving what electricity side usedPurpose;In addition, after the circuit is turned on, disconnecting each pin of battery and charging by controlling circuit controling electronic switch arraysConnection between circuit or electric power management circuit, USB connecting lines are flowed through into by electricity so as to prevent supplier of electricity battery from dischargingFang Hou, electric current is flowed into the battery by electricity side so that directly can be operated using the battery of supplier of electricity by electricity side, satisfaction is receivedThe load of electricity side, and by the method that this terminal is power supply between terminal, after by electricity side's dead battery blank screen, pass throughUSB connecting lines can at once wake up screen from supplier of electricity direct access electricity, into mode of operation so that Consumer's Experience more preferably,
It is seen that, present embodiment is the device embodiment corresponding with first embodiment, and present embodiment can be withFirst embodiment is worked in coordination implementation.The relevant technical details mentioned in first embodiment still have in the present embodimentEffect, in order to reduce repetition, repeats no more here.Correspondingly, the relevant technical details mentioned in present embodiment are also applicable inIn first embodiment.
6th implementation method of the invention is related to a kind of electricity sharing method.Base of the present embodiment in the 5th implementation methodFurther improvement is done on plinth, specific improvements are:In conducting USB interface and first feeder ear and power supply of charging circuitManage after the electrical connection between the test side of circuit, provided in the display interface of terminal and stop the shared selection entrance of electricity, andOperation is chosen according to selection entrance is shared to stopping electricity, the common port of switching chip is connected to the first connection end.SpecificallyFlow is as shown in Figure 8.
In step 801, detection USB interface power supply VBUS pins on voltage whether within a preset range.In detectionWhen voltage on to the power supply VBUS pins of USB interface is in default scope, step 802 is performed;Otherwise, continue to detect USBVoltage on the power supply VBUS pins of interface whether within a preset range, until enter step 802 untill.
In step 801, first voltage is applied to the control end of switching chip.
In step 803, USB interface and the electrical connection between charging circuit and electric power management circuit are turned on.
In step 804, control circuit controling electronic switch arrays disconnect battery with charging circuit or power management electricityConnection between road.
Due to the step 701 in the step 801 in present embodiment to step 804 and the 5th implementation method to step 704It is roughly the same, it is intended to when detecting voltage on the power supply VBUS pins of USB interface within a preset range, to the control of switching chipEnd processed applies first voltage, and the common port for switching chip is connected into the second connection end, conducting USB interface and charging circuitAfter electrical connection between first feeder ear and the test side of electric power management circuit, control circuit controling electronic switch arrays disconnectConnection between battery and charging circuit or electric power management circuit, here is omitted.
In step 805, the display interface in terminal is provided and stops the shared selection entrance of electricity.
Specifically, in first feeder ear of the conducting USB interface with charging circuit and the test side of electric power management circuitBetween electrical connection after, provided in the display interface of terminal and stop the shared selection entrance of electricity, such as in arbitrary interface with pop-upMode, there is provided stop the shared selection entrance of electricity, or increase in the setting interface of terminal stop electricity it is shared select intoConfession user operation, etc., will not enumerate here.
In addition, it is necessary to explanation, if stop electricity sharing selection entrance is provided in interface is set, initialWhen USB connecting lines are not inserted into state, i.e. USB interface, can will stop the shared selection entrance of electricity and be set to not optional state,I.e. user cannot operate the entrance, in first feeder ear of the conducting USB interface with charging circuit and the inspection of electric power management circuitAfter the electrical connection surveyed between end, the shared selection entrance of electricity will be stopped and be set to optional state.In actual applications, can basisThe application scenarios of terminal or the use habit of user, offer stopping electricity is shared in the display interface of terminal selects into confessionUser operates, and is not limited here.
In addition, not limiting to it is noted that stopping the shared mode of electricity between two terminals in actual applicationsIn a kind of above-mentioned situation, stopping the shared operation of electricity can also be determined by supplier of electricity, such as detect the screen quilt of supplier of electricityAfter wake-up, provided in the display interface of supplier of electricity and stop the shared selection entrance of electricity, by stopping the shared selection entrance of electricityOperation, the common port of control switching chip is connected to the first connection end, and the battery of supplier of electricity stops outwards electric discharge;Or will be forElectricity side's terminal or the physical button by electricity side's terminal, such as key, volume key, display screen etc. set interdependent snoop-operations, such asDouble click operation etc., after the operation for detecting user, the common port of control switching chip is connected to the first connection end, supplier of electricityBattery stops outwards electric discharge, is stopped obtaining electricity, etc. from supplier of electricity by electricity side, will not enumerate herein, does not also do specificLimitation.
In step 806, detect whether that user shares selection entrance to stopping electricity and chooses operation.
Specifically, user is being detected to stopping when choosing operation of electricity shared port, performing step 807;OtherwiseContinue to detect whether that user chooses operation to stop that electricity shares selection entrance, it is known that untill entrance step 807.
It should be noted that in actual applications, user is when electricity is shared between two terminals are stopped, it is also possible to not rightStop the shared selection entrance of electricity to be operated, but the USB connecting lines inserted in directly pulling out USB interface, therefore in detectionVoltage on to VBUS pins changes, when not within a preset range, it is also possible to be directly entered step 807.
In step 807, processor applies second voltage to the control end of switching chip, switches the common port connection of chipTo the first connection end.
Specifically, detect user to stop electricity sharing selection when choosing operation of entrance, processor is to switchingThe control end of chip applies second voltage, first feeder ear and electric power management circuit of disconnection USB interface and charging circuitElectrical connection between test side, the connection between the charging end and CPU of conducting USB interface and charging circuit, realization will switch coreThe common port of piece is connected to the first connection end, recovers existing terminal inner normal power supply circuit connection.
It should be noted that in present embodiment control circuit to switching chip control end apply second voltage with it is upperState the first voltage mentioned in implementation method to be similar to, be to preset, and the magnitude of voltage can specifically set according to actualIt is fixed, it is not unique fixation, detect whether that user shares when choosing operation of entrance of selection to stopping electricity, place can be triggeredReason device applies second voltage to the control end of switching chip, and the common port for switching chip is connected to the first connection end, stops twoElectricity between terminal is shared, and is not limited here.
Compared with prior art, in conducting USB interface and first feeder ear and electricity of charging circuit in present embodimentAfter electrical connection between the test side of power management circuits, shared by stopping electricity in the display interface offer by electricity side's terminalSelection entrance, such that it is able to decide whether that stopping the electricity between terminal shares, and more conforms to actual demand by user.
Above the step of various methods divide, be intended merely to description it is clear, can be merged into when realizing a step orSome steps are split, multiple steps are decomposed into, as long as comprising identical logical relation, all in the protection domain of this patentIt is interior;To adding inessential modification in algorithm or in flow or introducing inessential design, but its algorithm is not changedWith the core design of flow all in the protection domain of the patent.
It will be appreciated by those skilled in the art that all or part of step in realizing above-described embodiment method can be byProgram is completed to instruct the hardware of correlation, and the program storage is in a storage medium, including some instructions are used to so that oneIndividual equipment (can be single-chip microcomputer, chip etc.) or processor (processor) perform the whole of each embodiment method of the applicationOr part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-OnlyMemory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journeyThe medium of sequence code.
It will be understood by those skilled in the art that the respective embodiments described above are to realize specific embodiment of the invention,And in actual applications, can to it, various changes can be made in the form and details, without departing from the spirit and scope of the present invention.