Summary of the invention
For overcoming Problems existing in correlation technique, disclosure embodiment provides a kind of method and the device that detect charged state, the charging caused in order to avoid None-identified charge protocol failure phenomenon.
According to the first aspect of disclosure embodiment, provide a kind of method detecting charged state, application on the terminal device, comprising:
The real-time current of monitoring USB interface on the power lead of the insertion end of described terminal device;
The charged state of described terminal device is determined according to described real-time current;
If charged state represents that charging is abnormal, instruction identifies the charging process of charger again.
In one embodiment, the real-time current of described monitoring USB interface on the power lead of the insertion end of described terminal device, can comprise:
Obtain the voltage difference being connected to the resistance of USB interface on the power lead of the insertion end of described terminal device;
According to the real-time current of resistance monitoring stream on described power lead of described voltage difference and described resistance.
In one embodiment, the real-time current of described monitoring USB interface on the power lead of the insertion end of described terminal device, can comprise:
Monitoring is connected to the electric current of the solenoid of USB interface on the power lead of the insertion end of described terminal device.
In one embodiment, the described charged state determining described terminal device according to described electric current, can comprise:
Monitor the change of described real-time current;
If the change of described real-time current exceeds preset range, determine that the charged state of described terminal device is in abnormality;
If the change of described real-time current is within described preset range, determine that the charged state of described terminal device is in normal condition.
In one embodiment, described method also can comprise:
If the charged state of described terminal device is in abnormality, turns off and be connected to described USB interface in the data line of the insertion end of described terminal device, each self-corresponding gauge tap of described power lead.
According to the second aspect of disclosure embodiment, provide a kind of device detecting charged state, application on the terminal device, comprising:
Current monitoring module, is configured to the real-time current of monitoring USB interface on the power lead of the insertion end of described terminal device;
Determination module, is configured to the charged state determining described terminal device according to the described electric current of described real-time current monitoring module monitors;
Indicating module, if be configured to the described charged state that described determination module determines to represent that charging is abnormal, instruction identifies the charging process of charger again.
In one embodiment, described current monitoring module can comprise:
Obtain submodule, be configured to obtain the voltage difference being connected to the resistance of USB interface on the power lead of the insertion end of described terminal device;
First monitoring submodule, is configured to the real-time current of resistance monitoring stream on described power lead of described voltage difference and the described resistance got according to described acquisition submodule.
In one embodiment, described current monitoring module can comprise:
Second monitoring submodule, is configured to monitor the real-time current being connected to the solenoid of USB interface on the power lead of the insertion end of described terminal device.
In one embodiment, described determination module can comprise:
3rd monitoring submodule, is configured to the change of monitoring described real-time current;
First determines submodule, if be configured to the change that described 3rd monitoring submodule monitors described real-time current to exceed preset range, determines that the charged state of described terminal device is in abnormality;
Second determines submodule, if be configured to described 3rd monitoring submodule to monitor the change of described real-time current within described preset range, determines that the charged state of described terminal device is in normal condition.
In one embodiment, described device also can comprise:
Control module, if be configured to described determination module to determine that the charged state of described terminal device is in abnormality, control linkage in described USB interface at the data line of the insertion end of described terminal device, each self-corresponding switch OFF of described power lead.
According to the third aspect of disclosure embodiment, a kind of device detecting charged state is provided, comprises:
Processor;
For the storer of storage of processor executable instruction;
Wherein, described processor is configured to:
The real-time current of monitoring USB interface on the power lead of the insertion end of described terminal device;
The charged state of described terminal device is determined according to described real-time current;
If charged state represents that charging is abnormal, instruction identifies the charging process of charger again.
The technical scheme that embodiment of the present disclosure provides can comprise following beneficial effect: by the real-time current of monitoring USB interface on the power lead of the insertion end of terminal device, when terminal device application QC2.0 agreement is charged by USB interface, if abnormal according to the charging of real-time current determination terminal device, instruction identifies the charging process of charger again, thus the charging that causes due to correctly charge protocol cannot be identified can be avoided abnormal, promote Consumer's Experience, improve the charge function of terminal device.
Should be understood that, it is only exemplary and explanatory that above general description and details hereinafter describe, and can not limit the disclosure.
Embodiment
Here will be described exemplary embodiment in detail, its sample table shows in the accompanying drawings.When description below relates to accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawing represents same or analogous key element.Embodiment described in following exemplary embodiment does not represent all embodiments consistent with the present invention.On the contrary, they only with as in appended claims describe in detail, the example of apparatus and method that aspects more of the present invention are consistent.
" extracting slowly " in the disclosure refers to, by USB cable from after terminal device is extracted, the data line of terminal (D+/D-) is caused to disconnect with the data line (D+/D-) of USB cable end, but terminal device and power lead (the Vbus)/ground wire (GND) of USB cable end still keep the state be connected, and cause the reason of above-mentioned phenomenon to be that the cable end power supply signal of USB-IF defined is different with D+/D-signal pins length, now, can cause after again terminal device being plugged USB cable cannot charging to terminal device.
Fig. 1 is process flow diagram when charging to terminal device according to the USB charger in correlation technique; As shown in Figure 1, identifying of charging under detecting normal condition in correlation technique comprises the steps:
In step S101, charger inserts USB interface, and the data line of charger end is in short circuit state, and the data line of terminal is in off-state.
In step S102 and step S103, need to carry out the detection first (primarydetect) of BC1.2 agreement and the detection (seconddetect) of secondary QC2.0 agreement, namely, between charger and terminal device, first perform the communication of BC1.2 agreement, perform the communication of QC2.0 agreement afterwards.
In step S104, according to the voltage on the data line of QC2.0 protocol configuration charger, require that charger exports the voltage of 9 volts on the power line.
In step S105, the voltage on the data line of terminal and the short data line of charger keeps, and charger is in high-voltage charging state, the power lead of terminal is the voltage of 9 volts.
Fig. 2 is according to the process flow diagram of charging exception during USB cable plug in correlation technique; As shown in Figure 2, the charging identification process of USB cable of charging in correlation technique when plugging abnormal comprises the steps:
In step s 201, pull out USB cable slowly, cause the data line of the data line of terminal and the insertion end of USB to disconnect, but the power lead of the insertion end of the power lead of terminal device and USB is still in connection status, charge mode is QC2.0 pattern.Under QC2.0 pattern, the D+/D-signal wire of terminal remains correct connection and output, and such charger obtains the D+/D-instruction table of comparisons (as shown in table 1) that terminal device provides could provide corresponding voltage on Vbus.
Table 1QC2.0 configures voltage and the Vbus output valve table of comparisons
In step S202, again turn back to USB cable, terminal device is the magnitude of voltage that charger exports D+/D-.
In step S203, charger cannot Direct Recognition QC2.0 agreement, provides the Vbus value of BC1.2 agreement acquiescence.
In above process, if the output of D+/D-is interrupted, (USB line is extracted slowly, D+/D-disconnects, Vbus connects), by the magnitude of voltage causing charger cannot obtain the D+/D-that terminal provides, at this moment charger can come back to the Vbus voltage output of the 5V of BC1.2 agreement acquiescence, even if the D+/D-more subnormal charger (USB line turns back to charger again) that is connected to provides normal command voltage and also cannot export normal magnitude of voltage on Vbus, and now charger can only keep the voltage of the acquiescence Vbus5V of BC1.2 to export, terminal then still maintains in the requirement of QC2.0 agreement, namely, the Vbus of terminal requires that charger is with the high-voltage charging of 7.3V-10.3V, now charger can only provide 5V voltage on Vbus, and because the Vbus of terminal does not have middle connection breaking all the time, so the identifying of charger cannot be restarted, then report an error, at charger end, although D+/D-has the contrast tabular value of QC2.0, but magnitude of voltage now is not through the flow process of BC1.2 agreement, so charger is considered as the identification not carrying out BC1.2 agreement, then the charge mode of QC2.0 agreement can not be entered, therefore make charging identifying enter endless loop, even if terminal device is plugged in USB cable, also cannot charge.
Fig. 3 is the process flow diagram of the method for detection charged state according to an exemplary embodiment; This can be applied in terminal device (such as: the rechargeable devices such as intelligent terminal, panel computer) for the method controlling the pilot lamp be arranged on smart machine, as shown in Figure 3, the method for this detection charged state comprises the following steps S301-S303:
In step S301, the real-time current of monitoring USB interface on the power lead of the insertion end of terminal device.
In one embodiment, can by increasing the precision resistance of a milliohm level on the VBUS line of terminal, the voltage difference at Real-Time Monitoring resistance two ends, the real-time current of resistance is flow through according to the computing the resistor value of voltage difference and resistance.In another embodiment, can by increasing inductor winding on the VBUS line of terminal, the real-time current of Real-Time Monitoring induction winding.
In step s 302, according to the charged state of real-time current determination terminal device.
In step S303, if charged state represents that charging is abnormal, instruction identifies the charging process of charger again.
In one embodiment, when terminal device is in normal charged state, real-time current is in a constant current state, now real-time current is in a preset range, if the change of real-time current exceeds a preset range, can determine that the charged state of terminal device is in abnormality, now can control power management chip deenergization line (Vbus) and the connection of charger again, re-execute charger testing process.
In the present embodiment, by the real-time current of monitoring USB interface on the power lead of the insertion end of terminal device, when terminal device application QC2.0 agreement is charged by USB interface, if abnormal according to the charging of real-time current determination terminal device, instruction identifies the charging process of charger again, thus the charging that causes due to correctly charge protocol cannot be identified can be avoided abnormal, promote Consumer's Experience, improve the charge function of terminal device.
In one embodiment, the real-time current of monitoring USB interface on the power lead of the insertion end of terminal device, can comprise:
Obtain the voltage difference being connected to the resistance of USB interface on the power lead of the insertion end of terminal device;
According to the real-time current of resistance monitoring stream on power lead of voltage difference and resistance.
In one embodiment, the real-time current of monitoring USB interface on the power lead of the insertion end of terminal device, can comprise:
Monitoring is connected to the electric current of the solenoid of USB interface on the power lead of the insertion end of terminal device.
In one embodiment, according to the charged state of electric current determination terminal device, can comprise:
The change of monitoring real-time current;
If the change of electric current exceeds preset range, determine that the charged state of terminal device is in abnormality;
If the change of real-time current is within preset range, determine that the charged state of terminal device is in normal condition.
In one embodiment, method also can comprise:
If the charged state of terminal device is in abnormality, turns off and be connected to data line, the power lead each self-corresponding gauge tap of USB interface in the insertion end of terminal device.
The charged state of concrete how sense terminals equipment, please refer to subsequent embodiment.
So far, the said method that disclosure embodiment provides, can avoid the charging exception caused owing to correctly cannot identify charge protocol, promote Consumer's Experience, improve the charge function of terminal device.
With specific embodiment, the technical scheme that disclosure embodiment provides is described below.
Fig. 4 A is the process flow diagram of the method for detection charged state according to an exemplary embodiment one, and Fig. 4 B is the schematic diagram of the identification circuit according to an exemplary embodiment one; The said method that the present embodiment utilizes disclosure embodiment to provide, exemplary illustration is carried out for the real-time current obtained on power lead by being connected to the resistance of USB interface on the power lead of the insertion end of terminal device, as shown in Figure 4 A, comprise the steps:
In step S401, obtain the voltage difference being connected to the resistance of USB interface on the power lead of the insertion end of terminal device.
In step S402, according to the real-time current of resistance monitoring stream on power lead of voltage difference and resistance.
In step S403, whether the change of monitoring real-time current exceeds preset range, if the change of real-time current exceeds preset range, performs step S404, if the change of real-time current is within preset range, performs step S407.
In one embodiment, the charging current of charger comprises 3 stages, namely, pre-charge current (Ipre_chg), constant-current charge (Icc_chg), constant-voltage charge (Icv_chg), the charging current in these 3 stages is set by the power management chip on terminal device, when the normal range of the real-time current (Ibat) being filled with terminal below or above the electric current in 3 stages, then can determine that the change of real-time current exceeds preset range.
In step s 404, if the change of real-time current exceeds preset range, determine that the charged state of terminal device is in abnormality, perform step S405.
In step S405, if the charged state of terminal device is in abnormality, turns off and be connected to data line, the power lead each self-corresponding gauge tap of USB interface in the insertion end of terminal device.
In step S406, the charging process again identifying charger of indicating terminal equipment.
In step S 407, if the change of real-time current is within preset range, determine that the charged state of terminal device is in normal condition.
As shown in Figure 4 B, voltage V1 and V2 at resistance 411 two ends during by connecting high-precision sensitive resistance 411 real-time monitoring terminal equipment 41 in charged state on the VBUS line of terminal, power management chip 412 goes out to flow through the real-time current Ibus of resistance according to the computing the resistor value of magnitude of voltage V1 and V2 and resistance 411, thus in charging process, can reflect the charged state of charger 43 and terminal device 41 in real time.
Wherein, Vbus=V2, the voltage difference delta V=V at resistance two ends2-V1, real-time current Ibus=Δ V/Rsense.
When the charged state of terminal device 41 is in abnormality, power management chip 412 can turn off and be connected to USB interface in the data line of the insertion end of terminal device 41, gauge tap group 413 that power lead is corresponding.
In the present embodiment, by the real-time current of monitoring stream on power lead, the charged state of terminal device can be real-time monitored, resistance due to resistance is less and be connect on the power line, therefore can not have influence on the power consumption of whole terminal device, also then can not have influence on the charge efficiency of terminal device owing to affecting charging current, ensure that the highly compatible of terminal device, in addition, the low cost of resistance also guarantees that the hardware cost of terminal device can not significantly increase.
Fig. 5 A is the process flow diagram of the method for detection charged state according to an exemplary embodiment two, and Fig. 5 B is the schematic diagram of the identification circuit according to an exemplary embodiment two; The said method that the present embodiment utilizes disclosure embodiment to provide, exemplary illustration is carried out for the real-time current obtained on power lead by being connected to the solenoid of USB interface on the power lead of the insertion end of terminal device, as shown in Figure 5A, comprise the steps:
In step S501, monitoring is connected to the real-time current of the solenoid of USB interface on the power lead of the insertion end of terminal device.
In step S502, whether the change of monitoring real-time current exceeds preset range, if the change of electric current exceeds preset range, performs step S503, if the change of electric current is within preset range, performs step S506.
In step S503, if the change of real-time current exceeds preset range, determine that the charged state of terminal device is in abnormality, perform step S504.
In step S504, if the charged state of terminal device is in abnormality, turns off and be connected to data line, the power lead each self-corresponding gauge tap of USB interface in the insertion end of terminal device.
In step S505, the charging process again identifying charger of indicating terminal equipment.
In step S506, if the change of real-time current is within preset range, determine that the charged state of terminal device is in normal condition.
As shown in Figure 5 B, when electric current Rapid Variable Design, the coupled end of solenoid 511 can produce couple current, if couple current slowly changes, then on the coupled end of solenoid 511 without impact, during current anomaly on the coil of the coupled end on power lead (Vbus), electric current can increase instantaneously or diminish, also there is transient changing in the induction current that the mutual inductor of the other end produces, the two ends curent change that power management chip 412 detects inductive coil can learn the change of the real-time current Ibus flowing through solenoid 511 when charged state, thus in charging process, the charged state of charger 43 and terminal device 41 can be reflected in real time.
When the charged state of terminal device 41 is in abnormality, power management chip 412 can turn off and be connected to USB interface in the data line of the insertion end of terminal device 41, gauge tap group 413 that power lead is corresponding.
In the present embodiment, by the real-time current of monitoring stream on power lead, the charged state of terminal device can be real-time monitored, because solenoid is to the susceptibility of curent change, whether the charged state that therefore can monitor terminal device when electric current has subtle change there is exception, improves the susceptibility to charged state monitoring.
Fig. 6 is a kind of block diagram detecting the device of charged state according to an exemplary embodiment, and as shown in Figure 6, the device detecting charged state comprises:
Current monitoring module 61, is configured to the real-time current of monitoring USB interface on the power lead of the insertion end of terminal device;
Determination module 62, is configured to the charged state of the real-time current determination terminal device of monitoring according to current monitoring module 61;
Indicating module 63, if be configured to the charged state that determination module 62 determines to represent that charging is abnormal, instruction identifies the charging process of charger again.
Fig. 7 is the block diagram that another kind according to an exemplary embodiment detects the device of charged state, and as shown in Figure 7, on above-mentioned basis embodiment illustrated in fig. 6, in one embodiment, current monitoring module 61 can comprise:
Obtain submodule 611, be configured to obtain the voltage difference being connected to the resistance of USB interface on the power lead of the insertion end of terminal device;
First monitoring submodule 612, is configured to the real-time current of resistance monitoring stream on power lead of voltage difference and the resistance got according to acquisition submodule 611.
In one embodiment, current monitoring module 61 can comprise:
Second monitoring submodule 613, is configured to monitor the real-time current being connected to the solenoid of USB interface on the power lead of the insertion end of terminal device.
In one embodiment, determination module 62 can comprise:
3rd monitoring submodule 621, is configured to the change of monitoring real-time current;
First determines submodule 622, if be configured to the change that the 3rd monitoring submodule 621 monitors real-time current to exceed preset range, determines that the charged state of terminal device is in abnormality;
Second determines submodule 623, if be configured to the 3rd monitoring submodule 621 to monitor the change of real-time current within preset range, determines that the charged state of terminal device is in normal condition.
In one embodiment, device also can comprise:
Control module 64, if be configured to determination module 62 to determine that the charged state of terminal device is in abnormality, control linkage is at data line, the power lead each self-corresponding switch OFF of USB interface in the insertion end of terminal device.
About the device in above-described embodiment, wherein the concrete mode of modules executable operations has been described in detail in about the embodiment of the method, will not elaborate explanation herein.
Fig. 8 is a kind of block diagram being applicable to the device detecting charged state according to an exemplary embodiment.Such as, device 800 can be mobile phone, computing machine, digital broadcast terminal, messaging devices, game console, tablet device, Medical Devices, body-building equipment, personal digital assistant etc.
With reference to Fig. 8, device 800 can comprise following one or more assembly: processing components 802, storer 804, power supply module 806, multimedia groupware 808, audio-frequency assembly 810, the interface 812 of I/O (I/O), sensor module 814, and communications component 816.
The integrated operation of the usual control device 800 of processing components 802, such as with display, call, data communication, camera operation and record operate the operation be associated.Treatment element 802 can comprise one or more processor 820 to perform instruction, to complete all or part of step of above-mentioned method.In addition, processing components 802 can comprise one or more module, and what be convenient between processing components 802 and other assemblies is mutual.Such as, processing element 802 can comprise multi-media module, mutual with what facilitate between multimedia groupware 808 and processing components 802.
Storer 804 is configured to store various types of data to be supported in the operation of equipment 800.The example of these data comprises for any application program of operation on device 800 or the instruction of method, contact data, telephone book data, message, picture, video etc.Storer 804 can be realized by the volatibility of any type or non-volatile memory device or their combination, as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM), Erasable Programmable Read Only Memory EPROM (EPROM), programmable read only memory (PROM), ROM (read-only memory) (ROM), magnetic store, flash memory, disk or CD.
The various assemblies that electric power assembly 806 is device 800 provide electric power.Electric power assembly 806 can comprise power-supply management system, one or more power supply, and other and the assembly generating, manage and distribute electric power for device 800 and be associated.
Multimedia groupware 808 is included in the screen providing an output interface between described device 800 and user.In certain embodiments, screen can comprise liquid crystal display (LCD) and touch panel (TP).If screen comprises touch panel, screen may be implemented as touch-screen, to receive the input signal from user.Touch panel comprises one or more touch sensor with the gesture on sensing touch, slip and touch panel.Described touch sensor can the border of not only sensing touch or sliding action, but also detects the duration relevant to described touch or slide and pressure.In certain embodiments, multimedia groupware 808 comprises a front-facing camera and/or post-positioned pick-up head.When equipment 800 is in operator scheme, during as screening-mode or video mode, front-facing camera and/or post-positioned pick-up head can receive outside multi-medium data.Each front-facing camera and post-positioned pick-up head can be fixing optical lens systems or have focal length and optical zoom ability.
Audio-frequency assembly 810 is configured to export and/or input audio signal.Such as, audio-frequency assembly 810 comprises a microphone (MIC), and when device 800 is in operator scheme, during as call model, logging mode and speech recognition mode, microphone is configured to receive external audio signal.The sound signal received can be stored in storer 804 further or be sent via communications component 816.In certain embodiments, audio-frequency assembly 810 also comprises a loudspeaker, for output audio signal.
I/O interface 812 is for providing interface between processing components 802 and peripheral interface module, and above-mentioned peripheral interface module can be keyboard, some striking wheel, button etc.These buttons can include but not limited to: home button, volume button, start button and locking press button.
Sensor module 814 comprises one or more sensor, for providing the state estimation of various aspects for device 800.Such as, sensor module 814 can detect the opening/closing state of equipment 800, the relative positioning of assembly, such as described assembly is display and the keypad of device 800, the position of all right pick-up unit 800 of sensor module 814 or device 800 1 assemblies changes, the presence or absence that user contacts with device 800, the temperature variation of device 800 orientation or acceleration/deceleration and device 800.Sensor module 814 can comprise proximity transducer, be configured to without any physical contact time detect near the existence of object.Sensor module 814 can also comprise optical sensor, as CMOS or ccd image sensor, for using in imaging applications.In certain embodiments, this sensor module 814 can also comprise acceleration transducer, gyro sensor, Magnetic Sensor, pressure transducer or temperature sensor.
Communications component 816 is configured to the communication being convenient to wired or wireless mode between device 800 and other equipment.Device 800 can access the wireless network based on communication standard, as WiFi, 2G or 3G, or their combination.In one exemplary embodiment, communication component 816 receives from the broadcast singal of external broadcasting management system or broadcast related information via broadcast channel.In one exemplary embodiment, described communication component 816 also comprises near-field communication (NFC) module, to promote junction service.Such as, can based on radio-frequency (RF) identification (RFID) technology in NFC module, Infrared Data Association (IrDA) technology, ultra broadband (UWB) technology, bluetooth (BT) technology and other technologies realize.
In the exemplary embodiment, device 800 can be realized, for performing said method by one or more application specific integrated circuit (ASIC), digital signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD) (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components.
In the exemplary embodiment, additionally provide a kind of non-transitory computer-readable recording medium comprising instruction, such as, comprise the storer 804 of instruction, above-mentioned instruction can perform said method by the processor 820 of device 800.Such as, described non-transitory computer-readable recording medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc.
Those skilled in the art, at consideration instructions and after putting into practice disclosed herein disclosing, will easily expect other embodiment of the present disclosure.The application is intended to contain any modification of the present disclosure, purposes or adaptations, and these modification, purposes or adaptations are followed general principle of the present disclosure and comprised the undocumented common practise in the art of the disclosure or conventional techniques means.Instructions and embodiment are only regarded as exemplary, and true scope of the present disclosure and spirit are pointed out by claim below.
Should be understood that, the disclosure is not limited to precision architecture described above and illustrated in the accompanying drawings, and can carry out various amendment and change not departing from its scope.The scope of the present disclosure is only limited by appended claim.