Summary of the invention
To overcome the problems in correlation technique, the embodiment of the present disclosure provides a kind of method and dress for detecting charged stateIt sets, with to avoid can not identify charging failure phenomenon caused by charge protocol.
According to the first aspect of the embodiments of the present disclosure, a kind of method detecting charged state is provided, is applied in terminal deviceOn, comprising:
Monitor real-time current of the USB interface on the power supply line of the insertion end of the terminal device;
The charged state of the terminal device is determined according to the real-time current;
If charged state indicates that charging is abnormal, instruction re-recognizes the charging process of charger.
In one embodiment, the real-time electricity on the power supply line of insertion end of the monitoring USB interface in the terminal deviceStream, it may include:
Obtain the voltage difference for being connected to resistance of the USB interface on the power supply line of the insertion end of the terminal device;
The real-time current on the power supply line is flowed through according to the voltage difference and the monitoring of the resistance value of the resistance.
In one embodiment, the real-time electricity on the power supply line of insertion end of the monitoring USB interface in the terminal deviceStream, it may include:
Monitoring is connected to the electric current of electromagnetic coil of the USB interface on the power supply line of the insertion end of the terminal device.
In one embodiment, the charged state that the terminal device is determined according to the electric current, it may include:
Monitor the variation of the real-time current;
If the variation of the real-time current exceeds preset range, determine that the charged state of the terminal device is in abnormalState;
If at the charged state that the variation of the real-time current within the preset range, determines the terminal deviceIn normal condition.
In one embodiment, the method may also include that
If the charged state of the terminal device is in abnormality, shutdown is connected to the USB interface at the endThe data line of the insertion end of end equipment, the corresponding control switch of the power supply line.
According to the second aspect of an embodiment of the present disclosure, a kind of device detecting charged state is provided, is applied in terminal deviceOn, comprising:
Current monitoring module is configured as reality of the monitoring USB interface on the power supply line of the insertion end of the terminal deviceWhen electric current;
Determining module is configured as determining that the terminal is set according to the electric current of the real-time current monitoring module monitorsStandby charged state;
Indicating module, if being configured as the charged state that the determining module determines indicates that charging is abnormal, instructionRe-recognize the charging process of charger.
In one embodiment, the current monitoring module can include:
Acquisition submodule is configured as acquisition and is connected to USB interface on the power supply line of the insertion end of the terminal deviceResistance voltage difference;
First monitoring submodule, is configured as the voltage difference got according to the acquisition submodule and the resistanceResistance value monitoring flow through real-time current on the power supply line.
In one embodiment, the current monitoring module can include:
Second monitoring submodule, is configured as monitoring and is connected to USB interface in the power supply of the insertion end of the terminal deviceThe real-time current of electromagnetic coil on line.
In one embodiment, the determining module can include:
Third monitors submodule, is configured as monitoring the variation of the real-time current;
First determines submodule, if being configured as the variation that the third monitoring submodule monitors the real-time currentBeyond preset range, determine that the charged state of the terminal device is in abnormality;
Second determines submodule, if being configured as the variation that the third monitoring submodule monitors the real-time currentWithin the preset range, determine that the charged state of the terminal device is in normal condition.
In one embodiment, described device may also include that
Control module, if being configured as the determining module determines that the charged state of the terminal device is in abnormal shapeState, control be connected to the USB interface the insertion end of the terminal device data line, the power supply line is corresponding opensShutdown.
According to the third aspect of an embodiment of the present disclosure, a kind of device detecting charged state is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Monitor real-time current of the USB interface on the power supply line of the insertion end of the terminal device;
The charged state of the terminal device is determined according to the real-time current;
If charged state indicates that charging is abnormal, instruction re-recognizes the charging process of charger.
The technical scheme provided by this disclosed embodiment can include the following benefits: by monitoring USB interface at endReal-time current on the power supply line of the insertion end of end equipment, when terminal device application QC2.0 agreement is charged by USB interface,If determining that terminal device charging is abnormal according to real-time current, instruction re-recognizes the charging process of charger, so as to keep awayExempt to promote user experience due to the exception that charges caused by can not correctly identifying charge protocol, improve the charging function of terminal deviceEnergy.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, notThe disclosure can be limited.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related toWhen attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodimentDescribed in embodiment do not represent all embodiments consistented with the present invention.On the contrary, they be only with it is such as appendedThe example of device and method being described in detail in claims, some aspects of the invention are consistent.
" slow to extract " in the disclosure refers to, after USB cable is extracted from terminal device, leads to the number of terminalIt has been disconnected with the data line of USB line cable-end (D+/D-) according to line (D+/D-), but the electricity of terminal device and USB line cable-endSource line (Vbus)/ground line (GND) still maintains the state of connection, and the reason of causing above-mentioned phenomenon is USB-IF definedCable end power supply signal is different with D+/D- signal pins length, at this point, will lead to after terminal device is plugged USB cable againIt can not charge to terminal device.
Fig. 1 is flow chart when being charged according to USB charger in the related technology to terminal device;As shown in Figure 1,Charging identification process under normal condition is detected in the related technology to include the following steps:
In step s101, charger is inserted into USB interface, and the data line at charger end is in short circuit state, terminal deviceThe data line at end is in an off state.
In step S102 and step S103, need to carry out BC1.2 agreement detection for the first time (primary detect) andThe detection (second detect) of secondary QC2.0 agreement, that is, BC1.2 agreement is first carried out between charger and terminal deviceCommunication executes the communication of QC2.0 agreement later.
In step S104, according to the voltage on the data line of QC2.0 protocol configuration charger, it is desirable that charger is in power supply9 volts of voltage is exported on line.
In step s105, the voltage on the data line of terminal and the short data line of charger is kept, chargerThe voltage for being 9 volts in high-voltage charging state, the power supply line of terminal.
Fig. 2 is the abnormal flow chart of charging when being plugged according to USB cable in the related technology;As shown in Fig. 2, related skillCharging identification process of the USB cable that charges in art when plugging abnormal includes the following steps:
In step s 201, USB cable is pulled out slowly, leads to the data line of the data line of terminal and the insertion end of USBIt disconnects, but the power supply line of the insertion end of the power supply line of terminal device and USB, still in connection status, charge mode isQC2.0 mode.Under QC2.0 mode, the D+/D- signal wire of terminal remains correctly connection and output, in this wayCharger obtains the D+/D- instruction table of comparisons (as shown in table 1) that terminal device provides could provide corresponding voltage on Vbus.
1 QC2.0 of table configures voltage and Vbus exports value comparison table
In step S202, USB cable is turned back to again, and terminal device is the voltage value that charger exports D+/D-.
In step S203, charger can not Direct Recognition QC2.0 agreement, provide BC1.2 agreement default Vbus value.
In above process, it if the output of D+/D- is interrupted (USB line is extracted slowly, and D+/D- is disconnected, Vbus connection), will leadCharger is caused to be unable to get the voltage value for the D+/D- that terminal provides, at this moment it is silent to come back to BC1.2 agreement for chargerThe Vbus voltage output of the 5V recognized, even if the subnormal charger (USB line turns back to charger again) that is connected to provides just D+/D- againNormal command voltage can not also export normal voltage value on Vbus, and charger can only keep the default of BC1.2 at this timeThe voltage output of Vbus5V, and terminal then remains in the requirement of QC2.0 agreement, that is, terminalVbus requires charger with the high-voltage charging of 7.3V-10.3V, and charger can only provide 5V voltage on Vbus at this time, and byIn terminal Vbus always without middle connection breaking, so the identification process of charger can not be restarted, then report an error;At charger end, although D+/D- has the control tabular value of QC2.0, but voltage value at this time is not the stream by BC1.2 agreementJourney, so charger is considered as the identification for not carrying out BC1.2 agreement, after the charge mode without entering QC2.0 agreement, thereforeSo that charging identification process enters endless loop, even if terminal device is plugged in USB cable, can not also charge.
Fig. 3 is the flow chart of the method for detection charged state shown according to an exemplary embodiment;This is used to control peaceThe method of dress indicator light on intelligent devices can apply terminal device (such as: intelligent terminal, tablet computer etc. canCharging equipment) on, as shown in figure 3, the method for the detection charged state includes the following steps S301-S303:
In step S301, real-time current of the USB interface on the power supply line of the insertion end of terminal device is monitored.
In one embodiment, can by the VBUS line of terminal increase a milliohm grade precision resistance,The voltage difference at real-time monitoring resistance both ends, the real-time current of resistance is flowed through according to the computing the resistor value of voltage difference and resistance.Another, can be by increasing inductor winding on the VBUS line of terminal in embodiment, real-time monitoring incudes the real-time electricity of windingStream.
In step s 302, the charged state of terminal device is determined according to real-time current.
In step S303, if charged state indicates that charging is abnormal, instruction re-recognizes the charging process of charger.
In one embodiment, when terminal device is in normal charged state, real-time current is in a constant current state,Real-time current is in a preset range at this time, if the variation of real-time current exceeds a preset range, can determine endThe charged state of end equipment is in abnormality, can control power management chip at this time and backs off power supply line (Vbus) and fillThe connection of electric appliance re-executes charger testing process.
In the present embodiment, by real-time current of the monitoring USB interface on the power supply line of the insertion end of terminal device, at endWhen end equipment application QC2.0 agreement is charged by USB interface, if determining that terminal device charging is abnormal according to real-time current, refer toShow the charging process for re-recognizing charger, it is different due to charging caused by can not correctly identifying charge protocol so as to avoidOften, user experience is promoted, the charge function of terminal device is improved.
In one embodiment, real-time current of the monitoring USB interface on the power supply line of the insertion end of terminal device, can wrapIt includes:
Obtain the voltage difference for being connected to resistance of the USB interface on the power supply line of the insertion end of terminal device;
The real-time current on power supply line is flowed through according to voltage difference and the monitoring of the resistance value of resistance.
In one embodiment, real-time current of the monitoring USB interface on the power supply line of the insertion end of terminal device, can wrapIt includes:
Monitoring is connected to the electric current of electromagnetic coil of the USB interface on the power supply line of the insertion end of terminal device.
In one embodiment, the charged state of terminal device is determined according to electric current, it may include:
Monitor the variation of real-time current;
If the variation of electric current exceeds preset range, determine that the charged state of terminal device is in abnormality;
If the variation of real-time current within preset range, determines that the charged state of terminal device is in normal condition.
In one embodiment, method may also include that
If the charged state of terminal device is in abnormality, shutdown is connected to USB interface in the insertion of terminal deviceThe corresponding control switch of data line, power supply line at end.
The charged state of terminal device specifically how is detected, subsequent embodiment is please referred to.
So far, the above method that the embodiment of the present disclosure provides, can lead to avoid due to can not correctly identify charge protocolThe charging of cause is abnormal, promotes user experience, improves the charge function of terminal device.
The technical solution of embodiment of the present disclosure offer is provided below with specific embodiment.
Fig. 4 A is according to the flow chart of the method for the detection charged state shown in an exemplary embodiment one, and Fig. 4 B is basisThe schematic diagram of identification circuit shown in one exemplary embodiment one;The above-mentioned side that the present embodiment utilizes the embodiment of the present disclosure to provideMethod, with real-time on power supply line to obtain by being connected to resistance of the USB interface on the power supply line of the insertion end of terminal deviceIt illustrates for electric current, as shown in Figure 4 A, includes the following steps:
In step S401, the electricity for being connected to resistance of the USB interface on the power supply line of the insertion end of terminal device is obtainedPressure difference.
In step S402, the real-time current on power supply line is flowed through according to voltage difference and the monitoring of the resistance value of resistance.
In step S403, whether the variation for monitoring real-time current exceeds preset range, if the variation of real-time current is superPreset range out executes step S404, if the variation of real-time current within preset range, executes step S407.
In one embodiment, the charging current of charger includes 3 stages, that is, pre-charge current (Ipre_chg), constant currentCharge (Icc_chg), constant-voltage charge (Icv_chg), and the charging current in 3 stages passes through the power management core on terminal devicePiece is set, when being filled with the normal range (NR) of the real-time current (Ibat) of terminal below or above the electric current in 3 stages,It can then determine the variation of real-time current beyond preset range.
In step s 404, it if the variation of real-time current exceeds preset range, determines at the charged state of terminal deviceIn abnormality, step S405 is executed.
In step S405, if the charged state of terminal device is in abnormality, shutdown is connected to USB interface at endThe corresponding control switch of data line, power supply line of the insertion end of end equipment.
In step S406, the charging process for re-recognizing charger of instruction terminal equipment.
In step S 407, if the variation of real-time current is within preset range, the charged state of terminal device is determinedIn normal condition.
As shown in Figure 4 B, by connecting high-precision 411 real-time monitoring of sensitive resistance on the VBUS line of terminalThe voltage V1 and V2 at 411 both ends of resistance in charged state of terminal device 41, power management chip 412 is according to voltage value V1 and V2Go out to flow through the real-time current Ibus of resistance with the computing the resistor value of resistance 411, so as to reflection charging in real time during the charging processThe charged state of device 43 and terminal device 41.
Wherein, Vbus=V2, the voltage difference delta V=V at resistance both ends2-V1, real-time current Ibus=Δ V/Rsense。
When the charged state of terminal device 41 is when in an abnormal state, power management chip 412 can turn off and be connected to USBData line, power supply line corresponding control switch group 413 of the interface in the insertion end of terminal device 41.
In the present embodiment, by monitoring the real-time current flowed through on power supply line, filling for terminal device can be monitored in real timeElectricity condition does not interfere with the function of entire terminal device since the resistance value of resistance is smaller and is to connect on the power lineConsumption will not then influence the charge efficiency of terminal device due to influencing charging current, it is ensured that the height of terminal device is compatibleProperty, in addition, the low cost of resistance also ensures that the hardware cost of terminal device not will increase dramatically.
Fig. 5 A is according to the flow chart of the method for the detection charged state shown in an exemplary embodiment two, and Fig. 5 B is basisThe schematic diagram of identification circuit shown in one exemplary embodiment two;The above-mentioned side that the present embodiment utilizes the embodiment of the present disclosure to provideMethod, to be obtained on power supply line by being connected to electromagnetic coil of the USB interface on the power supply line of the insertion end of terminal deviceIt illustrates for real-time current, as shown in Figure 5A, includes the following steps:
In step S501, monitoring is connected to electromagnetic coil of the USB interface on the power supply line of the insertion end of terminal deviceReal-time current.
In step S502, whether the variation for monitoring real-time current exceeds preset range, if the variation of electric current is beyond pre-If range, step S503 is executed, if the variation of electric current within preset range, executes step S506.
In step S503, if the variation of real-time current exceeds preset range, determine at the charged state of terminal deviceIn abnormality, step S504 is executed.
In step S504, if the charged state of terminal device is in abnormality, shutdown is connected to USB interface at endThe corresponding control switch of data line, power supply line of the insertion end of end equipment.
In step S505, the charging process for re-recognizing charger of instruction terminal equipment.
In step S506, if the variation of real-time current within preset range, determines the charged state of terminal deviceIn normal condition.
As shown in Figure 5 B, when electric current quickly changes, the coupled end of electromagnetic coil 511 can generate couple current, if couplingElectric current is slowly varying, then on the coupled end of electromagnetic coil 511 without influence, when on the coil of the coupled end on power supply line (Vbus)When current anomaly, electric current can increase or become smaller moment, and transient state change also occurs for the induced current that the mutual inductor of the other end generatesChange, power management chip 412 detects the both ends curent change of induction coil it can be learnt that flowing through electromagnetic coil in charged stateThe variation of 511 real-time current Ibus, so as to which reflection charger 43 and terminal device 41 fill in real time during the charging processElectricity condition.
When the charged state of terminal device 41 is when in an abnormal state, power management chip 412 can turn off and be connected to USBData line, power supply line corresponding control switch group 413 of the interface in the insertion end of terminal device 41.
In the present embodiment, by monitoring the real-time current flowed through on power supply line, filling for terminal device can be monitored in real timeElectricity condition can monitor that terminal is set when electric current has minor change since electromagnetic coil is to the sensibility of curent changeWhether standby charged state is abnormal, and improves the susceptibility to charged state monitoring.
Fig. 6 is a kind of block diagram of device for detecting charged state shown according to an exemplary embodiment, as shown in fig. 6,Detection charged state device include:
It is real-time on the power supply line of the insertion end of terminal device to be configured as monitoring USB interface for current monitoring module 61Electric current;
Determining module 62 is configured as determining the charging of terminal device according to the real-time current that current monitoring module 61 monitorsState;
Indicating module 63 is configured as if it is determined that the charged state that module 62 determines indicates that charging is abnormal, and instruction is againIdentify the charging process of charger.
Fig. 7 is the block diagram of the device of another detection charged state shown according to an exemplary embodiment, such as Fig. 7 instituteShow, on the basis of above-mentioned embodiment illustrated in fig. 6, in one embodiment, current monitoring module 61 can include:
Acquisition submodule 611 is configured as acquisition and is connected to USB interface on the power supply line of the insertion end of terminal deviceThe voltage difference of resistance;
First monitoring submodule 612, is configured as the resistance value of the voltage difference and resistance that get according to acquisition submodule 611Monitoring flows through the real-time current on power supply line.
In one embodiment, current monitoring module 61 can include:
Second monitoring submodule 613, is configured as monitoring and is connected to USB interface in the power supply line of the insertion end of terminal deviceOn electromagnetic coil real-time current.
In one embodiment, determining module 62 can include:
Third monitors submodule 621, is configured as the variation of monitoring real-time current;
First determines submodule 622, if being configured as third monitoring submodule 621 monitors that the variation of real-time current is superPreset range out determines that the charged state of terminal device is in abnormality;
Second determines submodule 623, if being configured as third monitoring submodule 621 monitors that the variation of real-time current existsWithin preset range, determine that the charged state of terminal device is in normal condition.
In one embodiment, device may also include that
Control module 64, be configured as if it is determined that module 62 determine terminal device charged state be in abnormality,Control is connected to USB interface in the corresponding switch OFF of data line, power supply line of the insertion end of terminal device.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in related this methodEmbodiment in be described in detail, no detailed explanation will be given here.
Fig. 8 is a kind of block diagram suitable for detecting the device of charged state shown according to an exemplary embodiment.For example,Device 800 can be mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, doctorTreat equipment, body-building equipment, personal digital assistant etc..
Referring to Fig. 8, device 800 may include following one or more components: processing component 802, memory 804, power supplyComponent 806, multimedia component 808, audio component 810, the interface 812 of input/output (I/O), sensor module 814, andCommunication component 816.
The integrated operation of the usual control device 800 of processing component 802, such as with display, telephone call, data communication, phaseMachine operation and record operate associated operation.Processing element 802 may include that one or more processors 820 refer to executeIt enables, to perform all or part of the steps of the methods described above.In addition, processing component 802 may include one or more modules, justInteraction between processing component 802 and other assemblies.For example, processing component 802 may include multi-media module, it is more to facilitateInteraction between media component 808 and processing component 802.
Memory 804 is configured as storing various types of data to support the operation in equipment 800.These data are shownExample includes the instruction of any application or method for operating on device 800, contact data, and telephone book data disappearsBreath, picture, video etc..Memory 804 can be by any kind of volatibility or non-volatile memory device or their groupIt closes and realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compileJourney read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flashDevice, disk or CD.
Electric power assembly 806 provides electric power for the various assemblies of device 800.Electric power assembly 806 may include power management systemSystem, one or more power supplys and other with for device 800 generate, manage, and distribute the associated component of electric power.
Multimedia component 808 includes the screen of one output interface of offer between described device 800 and user.OneIn a little embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screenCurtain may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touch sensingsDevice is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding actionBoundary, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more matchmakersBody component 808 includes a front camera and/or rear camera.When equipment 800 is in operation mode, such as screening-mode orWhen video mode, front camera and/or rear camera can receive external multi-medium data.Each front camera andRear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 810 is configured as output and/or input audio signal.For example, audio component 810 includes a MikeWind (MIC), when device 800 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone is matchedIt is set to reception external audio signal.The received audio signal can be further stored in memory 804 or via communication setPart 816 is sent.In some embodiments, audio component 810 further includes a loudspeaker, is used for output audio signal.
I/O interface 812 provides interface between processing component 802 and peripheral interface module, and above-mentioned peripheral interface module canTo be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lockDetermine button.
Sensor module 814 includes one or more sensors, and the state for providing various aspects for device 800 is commentedEstimate.For example, sensor module 814 can detecte the state that opens/closes of equipment 800, and the relative positioning of component, for example, it is describedComponent is the display and keypad of device 800, and sensor module 814 can be with 800 1 components of detection device 800 or devicePosition change, the existence or non-existence that user contacts with device 800,800 orientation of device or acceleration/deceleration and device 800Temperature change.Sensor module 814 may include proximity sensor, be configured to detect without any physical contactPresence of nearby objects.Sensor module 814 can also include optical sensor, such as CMOS or ccd image sensor, atAs being used in application.In some embodiments, which can also include acceleration transducer, gyro sensorsDevice, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 816 is configured to facilitate the communication of wired or wireless way between device 800 and other equipment.Device800 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.In an exemplary implementationIn example, communication component 816 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel.In one exemplary embodiment, the communication component 816 further includes near-field communication (NFC) module, to promote short range communication.ExampleSuch as, NFC module can be based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band (UWB) technology,Bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 800 can be believed by one or more application specific integrated circuit (ASIC), numberNumber processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array(FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally providedIt such as include the memory 804 of instruction, above-metioned instruction can be executed by the processor 820 of device 800 to complete the above method.For example,The non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy diskWith optical data storage devices etc..
Those skilled in the art will readily occur to its of the disclosure after considering specification and practicing disclosure disclosed hereinIts embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes orPerson's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosureOr conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by followingClaim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, andAnd various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.