Summary of the invention
In view of this, the embodiment of the invention provides a kind of charger, terminal, controller, system and charger recognition methods, uses the negative consequences that second-rate charger may cause with in order to solve.Described technical scheme is as follows:
First aspect provides a kind of charger, and described charger comprises:
The first switch and identification chip;
The control end of described the first switch links to each other with the first data terminal in the USB charging inlet, one end of described the first switch links to each other with the second data terminal in the described USB charging inlet, and the other end of described the first switch links to each other with the output of described identification chip when the first enable signal that described control end receives;
Described identification chip when being used for linking to each other with the other end of described the first switch, utilizes described the second data terminal to send identification code to terminal, so that described terminal is identified charger according to described identification code.
Further, when the other end of described the first switch disconnects at the output with described identification chip, link to each other with described the first data terminal.
Further, described identification chip is encryption chip, and the identification code that described identification chip sends is Encrypted-identification-code.
Further, described the first data terminal is the D+ data terminal in the described USB charging inlet, and described the second data terminal is the D-data terminal in the described USB charging inlet;
Perhaps, described the first data terminal is the D-data terminal in the described USB charging inlet, and described the second data terminal is the D+ data terminal in the described USB charging inlet.
Second aspect provides a kind of terminal, and described terminal comprises:
Second switch, the 3rd switch and controller;
The control end of described second switch enables transmitting terminal with second of described controller and links to each other, one end of described second switch links to each other with the first data terminal in the USB charging inlet, and the signal that the other end of described second switch receives according to described control end enables to switch between the transmitting terminal at first of the first data terminal of described controller and described controller and links to each other;
The control end of described the 3rd switch enables transmitting terminal with second of described controller and links to each other, one end of described the 3rd switch links to each other with the second data terminal in the described USB charging inlet, and the signal that the other end of described the 3rd switch receives according to described control end switches between the identification code input of the second data terminal of described controller and described controller and links to each other;
Described controller, be used for satisfying when charging normal condition detecting described USB charging inlet, send the second enable signal so that the other end of described second switch enables transmitting terminal with first of described controller links to each other, and so that the other end of described the 3rd switch link to each other with the identification code input of described controller; Utilize described the first data terminal to send the first enable signal; After sending the first enable signal, utilize described the second data terminal to receive identification code; Described identification code is identified, and identification is by then allowing charging.
Further, described controller, it is obstructed out-of-date also to be used in the described identification code of identification, stops to charge and pointing out.
Further, described controller, also be used for not satisfying when charging normal condition detecting described USB charging inlet, the other end of controlling described second switch links to each other with the first data terminal of described controller, and the other end of controlling described the 3rd switch links to each other with the second data terminal of described controller.
Further, described the first data terminal is the D+ data terminal in the described USB charging inlet, and described the second data terminal is the D-data terminal in the described USB charging inlet;
Perhaps, described the first data terminal is the D-data terminal in the described USB charging inlet, and described the second data terminal is the D+ data terminal in the described USB charging inlet.
The third aspect provides a kind of charging recognition system, comprises charger and the terminal described in second aspect described in first aspect.
Fourth aspect provides a kind of charger recognition methods, is used for charger, and described method comprises:
The first enable signal that receiving terminal sends;
After receiving described the first enable signal, send identification code to described terminal, so that described terminal is identified described charger according to described identification code.
Further, if described charger is for adopting the charger of USB charging inlet;
The first enable signal that described receiving terminal sends comprises:
Utilize the first data terminal in the described USB charging inlet to receive described the first enable signal;
Described after receiving described the first enable signal, send identification code to described terminal, comprising:
After receiving described the first enable signal, utilize the second data terminal in the described USB charging inlet to send identification code.
Further, if described charger is the charger described in first aspect;
The first enable signal that described receiving terminal sends comprises:
Utilize the first data terminal in the described USB charging inlet to receive described the first enable signal;
Described after receiving described the first enable signal, send identification code to described terminal, comprising:
After receiving described the first enable signal, the other end of controlling described the first switch links to each other with the output of described identification chip;
Utilize the second data terminal in the described USB charging inlet to send identification code.
The 5th aspect provides a kind of charger recognition methods, is used for terminal, and described method comprises:
Send the first enable signal to charger;
After sending the first enable signal, receive the identification code that described charger sends;
Described identification code is identified, and identification is by then allowing charging.
Further, if described terminal is for adopting the terminal of USB charging inlet;
Describedly send the first enable signal to charger, comprising:
Utilize the first data terminal in the described USB charging inlet to send the first enable signal to charger;
The identification code that the described charger of described reception sends comprises:
Utilize the second data terminal in the described USB charging inlet to receive the identification code that described charger sends.
Further, if described terminal is such as the described terminal of second aspect;
Described send the first enable signal to charger before, also comprise:
Detect described USB charging inlet and whether satisfy the condition that charges normal;
If detecting described USB charging inlet satisfies when charging normal condition, send the second enable signal so that the other end of described second switch enables transmitting terminal with first of described controller links to each other, and so that the other end of described the 3rd switch link to each other with the identification code input of described controller.
The 6th aspect provides a kind of controller, is used for terminal, comprising:
Sending module is used for sending the first enable signal to charger;
Receiver module is used for receiving the identification code that described charger sends after described sending module sends the first enable signal;
Identification module is used for described identification code is identified, and identification is by then allowing charging.
Further, if described terminal is for adopting the terminal of USB charging inlet;
Described sending module, concrete being used for utilizes the first data terminal of described USB charging inlet to send the first enable signal to charger;
Described receiver module, concrete the second data terminal for utilizing described USB charging inlet receives the identification code that described charger sends.
Further, if described terminal is the described terminal of second aspect; Described controller also comprises:
Detection module and control module;
Whether described detection module satisfies the condition that charges normal for detection of described USB charging inlet;
Described control module, if being used for described detection module detects when described USB charging inlet is satisfied to charge normal condition, send the second enable signal so that the other end of described second switch enables transmitting terminal with first of described controller links to each other, and so that the other end of described the 3rd switch link to each other with the identification code input of described controller.
The beneficial effect that the technical scheme that the embodiment of the invention provides is brought is:
Send identification code by charger, terminal is identified charger according to identification code, and then select whether to allow charging by terminal, and solved and used the negative consequences that second-rate charger may cause with, reached the effect that terminal only allows to use the special charger charging.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, embodiment of the present invention is described further in detail below in conjunction with accompanying drawing.
Please refer to Fig. 1, it shows the structural representation of the related a kind of charger system of the embodiment of the invention.This charger system comprises charger 120, usb data line 140 and terminal 160.
Charger 120 comprises that Switching Power Supply is elementary 122, switch power supply secondary 124 and USB charging inlet 126.
Switching Power Supply elementary 122 is used for connecting common power, such as: magnitude of voltage is the winding displacement plate of resident with normal voltage 220V.
Switch power supply secondary 124 links to each other by transformer and Switching Power Supply elementary 122, is used for charging voltage and the charging current of stable output, such as, charging voltage is 5V, charging current is 0.5A.
USB charging inlet 126 links to each other with switch power supply secondary by four terminals, and these four terminals are respectively power supply terminal VBUS, data terminal D+, data terminal D-and earth terminal GND.Wherein, the voltage on the power supply terminal VBUS is charging voltage usually; Data terminal D+ and data terminal D-be usually mutual short circuit when charging, and at this moment, two data terminals all are low level.
Usb data line 140 comprises four connecting lines, respectively corresponding power terminal VBUS, data terminal D+, data terminal D-and earth terminal GND.Usually, an end of usb data line 140 can adopt standard USB charging inlet, and the other end of usb data line 140 then can adopt MINI USB(Chinese: mini USB) charging inlet, perhaps Micro USB(Chinese: micro USB) charging inlet.
Terminal 160 is corresponding with usb data line 140, includes MINI USB charging inlet, perhaps the MicroUSB charging inlet.This MINI USB or Micro USB charging inlet specifically include power supply terminal VBUS, data terminal D+, data terminal D-, identity terminal ID and earth terminal GND.Wherein, identity terminal ID is used for supporting USB OTG function.
As one of Focal point and difficult point of the embodiment of the invention, the embodiment of the invention is improved above-mentioned charger system, by terminal and the corresponding charger that includes the charger recognition function is provided, realizes that terminal can only use the purpose of special charger.
Embodiment one
Please refer to Fig. 2, it shows the structural representation of the charger recognition system that the embodiment of the invention one provides.In the present embodiment, main the first data terminal in the USB charging inlet is as the D+ data terminal; The second data terminal in the USB charging inlet is that the D-data are brought in and illustrated.This charger recognition system comprises charger 220 and terminal 240.Wherein:
Charger 220 comprises the first switch S 1 and identification chip 222.
The control end of the first switch S 1 links to each other with the first data terminal D+ in the USB charging inlet; One end of the first switch S 1 links to each other with the second data terminal D-in the USB charging inlet; The other end of the first switch S 1 links to each other with the input of identification chip 222 when the first enable signal that control end receives;
Identification chip 222 when being used for linking to each other with the other end of the first switch S 1, utilizes the second data terminal D-to terminal 240 transmission identification codes, so that terminal 240 is identified charger 220 according to identification code.Identification chip 222 can directly be powered by power supply terminal VBUS, need not external power source.
Terminal 240 comprises second switch S2, the 3rd switch S 3 and controller 242.
The control end of second switch S2 enables transmitting terminal (not specifically illustrating) with second of controller 242 and links to each other, and the end of second switch S2 links to each other with the first data terminal D+ in the USB charging inlet; The signal that the other end of second switch S2 receives according to self control end enables to switch between the transmitting terminal M at first of the first data terminal D+ of controller 242 and controller 242 and links to each other;
The control end of the 3rd switch S 3 enables transmitting terminal (not specifically illustrating) with second of controller 242 and links to each other; One end of the 3rd switch S 3 links to each other with the second data terminal D-in the USB charging inlet; The signal that the other end of the 3rd switch S 3 receives according to self control end switches between the identification code input N of the second data terminal D-of controller 242 and controller 242 and links to each other;
Controller 242, be used for satisfying when charging normal condition detecting the USB charging inlet, send the second enable signal so that the other end of second switch S2 enables transmitting terminal M with first of controller 242 links to each other, and so that the other end of the 3rd switch S 3 link to each other with the identification code input N of controller; Utilize the first data terminal D+ to send the first enable signal; After sending the first enable signal, utilize the second data terminal D-to receive identification code; The identification code that receives is identified, and identification is by then allowing charging.
In sum, the charger recognition system that the present embodiment provides, send identification code by charger, terminal is identified charger according to identification code, and then select whether to allow charging by terminal, solved and used the negative consequences that second-rate charger may cause with, reached the effect that terminal only allows to use the special charger charging.
Because the charger that a upper embodiment provides remains the USB charging inlet of employing, can also be common terminal charge in order to make this improved charger, please refer to following embodiment:
Embodiment two
Please refer to Fig. 3, it shows the structural representation of the charger recognition system that the embodiment of the invention two provides.In the present embodiment, still the first data terminal in the USB charging inlet is as the D+ data terminal; The second data terminal in the USB charging inlet is that the D-data are brought in and illustrated.This charger recognition system comprises charger 220 and terminal 240.Wherein:
Charger 220 comprises the first switch S 1 and identification chip 222.
The first switch S 1 specifically can be single-pole double throw type switch, and the control end of the first switch S 1 links to each other with the first data terminal D+ in the USB charging inlet; One end of the first switch S 1 links to each other with the second data terminal D-in the USB charging inlet; The signal that the other end of the first switch S 1 receives according to control end switches between the input of identification chip 222 and the second data terminal D+ and links to each other.Specifically,
The other end of the first switch S 1 can link to each other with the input of identification chip 222 when control end receives the first enable signal;
The other end of the first switch S 1 can not receive the first enable signal at control end, when perhaps receiving other control signal that is different from the first enable signal, links to each other with the second data terminal D+.
Identification chip 222 when being used for linking to each other with the other end of the first switch S 1, utilizes the second data terminal D-to terminal 240 transmission identification codes, so that terminal 240 is identified charger 220 according to identification code.Specifically, identification chip 222 can be an encryption chip, and the identification code that then sends also is Encrypted-identification-code.Identification chip 222 can directly be powered by power supply terminal VBUS, need not external power source.
240 at terminal comprises second switch S2, the 3rd switch S 3 and controller 242.
Second switch S2 also can be single-pole double throw type switch.The control end of second switch S2 enables transmitting terminal (not specifically illustrating) with second of controller 242 and links to each other, and the end of second switch S2 links to each other with the first data terminal D+ in the USB charging inlet; The signal that the other end of second switch S2 receives according to self control end enables to switch between the transmitting terminal M at first of the first data terminal D+ of controller 242 and controller 242 and links to each other;
The 3rd switch S 3 also can be single-pole double throw type switch.The control end of the 3rd switch S 3 enables transmitting terminal (not specifically illustrating) with second of controller 242 and links to each other; One end of the 3rd switch S 3 links to each other with the second data terminal D-in the USB charging inlet; The signal that the other end of the 3rd switch S 3 receives according to self control end switches between the identification code input N of the second data terminal D-of controller 242 and controller 242 and links to each other;
Controller 242, be used for satisfying when charging normal condition detecting the USB charging inlet, send the second enable signal so that the other end of second switch S2 enables transmitting terminal M with first of controller 242 links to each other, and so that the other end of the 3rd switch S 3 link to each other with the identification code input N of controller; Utilize the first data terminal D+ to send the first enable signal; After sending the first enable signal, utilize the second data terminal D-to receive identification code; The identification code that receives is identified, and identification is by then allowing charging.
Wherein, charge condition is divided into two kinds of the condition of charging normal and USB charge conditions.Charge normal situation and just refer to the situation of utilizing charger to charge; The USB charge condition then is to use the usb data line directly to be connected to the situation of charging on the USB mouth of computer.
Do not satisfy when charging normal condition if controller 242 detects the USB charging inlet, also be that the USB charging inlet satisfies the USB charge condition, then the other end of controller 242 control second switch S2 links to each other with the first data terminal D+ of controller 242, and the other end of controlling the 3rd switch S 3 links to each other with the second data terminal D-of controller.At this moment, terminal can also normally utilize the first data terminal D+ and the second data terminal D-to carry out the transmission of usb data.
Controller 242 can adopt following strategy when the identification code that receives is identified: at first, the pre-stored identification code of the memory in the terminal, the identification code that sends in this identification code and the charger that is complementary is identical; Controller 242 judges whether identification code pre-stored in the identification code receive and the terminal is identical after receiving identification code, if identical, think that then identification passes through, and then allow to charge; If different, then think to identify and do not pass through, do not allow charging.Simultaneously, the combination that controller 242 can also control loudspeaker sends one or several modes in predetermined sound, the predetermined literal of control screen display and the control vibrator vibration-generating comes reminding user, is the information of unmatched charger so that the user is known the charger of current connection.
After controller 242 sent the first enable signal, the other end that controller 242 can also be controlled the first switch S 1 linked to each other with the second data terminal D+.Send after the first enable signal after 0.5 second such as, controller 242, controller 242 sends other control signal of being different from the first enable signal so that the other end of the first switch S 1 links to each other with the second data terminal D+ by the first data terminal D+.
Easily full of beard and be, if the identification code of storage be identification code expressly, be Encrypted-identification-code and controller receives, controller 242 also need to be decrypted Encrypted-identification-code according to corresponding manner of decryption before Encrypted-identification-code is identified.On the other hand, controller 242 also may adopt alternate manner that identification code is identified, and carries out the calculating of predetermined formula such as 242 pairs of identification codes that receive of controller, judges then whether result of calculation belongs to the predetermined result scope, if so, then think identification pass through.This moment, terminal can not pre-stored identification code.
The situation that links to each other with common charger for the terminal in the present embodiment, specific as follows: common charger is according to the requirement of country's charging standard, the first data terminal D+ and the mutual short circuit of the second data terminal D-when charging, if the terminal in the present embodiment has sent the first enable signal to charger, then the identification code input of terminal will receive this first enable signal, this first enable signal obviously can be not identical with identification code, also be that controller can not be identified as correct identification code with the first enable signal, at this moment, controller does not allow charging, simultaneously can reminding user.
But what need special supplementary notes is that the charger that provides in the present embodiment although passed through improvement, still can be applied to common terminal is charged.Specifically, if the charger that provides in the present embodiment links to each other with common terminal, at this moment, short circuit between the first data terminal D+ in the charger and the second data terminal D-, common terminal meets when charging normal condition detecting the USB charging inlet, can detect the first data terminal D+ and the second data terminal D-is low level, common terminal can continue charging process as the charger that meets national charging standard with this charger.
In sum, the charger recognition system that the present embodiment provides, send identification code by charger, terminal is identified charger according to identification code, and then select whether to allow charging by terminal, solved and used the negative consequences that second-rate charger may cause with, reached the effect that terminal only allows to use the special charger charging.Simultaneously, the charger that the present embodiment provides has also reached namely and can charge to the terminal that is complementary, the effect that can also charge to common terminal.
Above-described embodiment all the first data terminal in the USB charging inlet as the D+ data terminal; The second data terminal in the USB charging inlet is that the D-data are brought in and illustrated.Obviously, the first data terminal in the USB charging inlet is as the D-data terminal; The second data terminal in the USB charging inlet is the enforcement that the D+ data terminal also can be realized technique scheme.
Embodiment three
Please refer to Fig. 4, it shows the method flow diagram of the charger recognition methods that the embodiment of the invention three provides.This charger recognition methods can be used for the charger recognition system that embodiment one or two provides, and this charger recognition methods comprises:
Step 402, controller detect the USB charging inlet and whether satisfy the condition that charges normal;
After terminal connected the usb data line, controller detected the USB charging inlet and whether satisfies the condition that charges normal, and charges normal condition if satisfy, and also was current use charger charging, then continued subsequent step; If satisfy the USB charge condition, then do not continue subsequent step.
Step 404, controller satisfy when charging normal condition detecting the USB charging inlet, send the second enable signal to second switch and the 3rd switch;
Step 406, the other end of second switch enable transmitting terminal with first of controller and link to each other, and so that the other end of the 3rd switch link to each other with the identification code input of controller.
Second switch and the 3rd switch receive after the second enable signal, and the other end of second switch enables transmitting terminal with first of controller and links to each other, and so that the other end of the 3rd switch link to each other with the identification code input of controller.
Step 408, controller utilize the first data terminal to send the first enable signal;
Controller utilizes the first data terminal to send the first enable signal to charger.
Step 410, the other end of the first switch links to each other with the output of identification chip;
The first switch is after receiving the first enable signal, and the other end of the first switch will link to each other with the output of identification chip.
Step 412, identification chip utilize the second data terminal to send identification code;
Identification chip utilizes the second data terminal to send identification code to terminal.
Step 414, controller is identified the identification code that receives, and identification is by then allowing charging;
Specifically, controller can adopt following strategy when the identification code that receives is identified: at first, the pre-stored identification code of the memory in the terminal, the identification code that sends in this identification code and the charger that is complementary is identical; Controller judges whether identification code pre-stored in the identification code receive and the terminal is identical after receiving identification code, if identical, think that then identification passes through, and then allow to charge; If different, then think to identify and do not pass through, do not allow charging.Simultaneously, the combination that controller can also control loudspeaker sends one or several modes in predetermined sound, the predetermined literal of control screen display and the control vibrator vibration-generating comes reminding user, is the information of unmatched charger so that the user is known the charger of current connection.
Certainly, controller also may adopt alternate manner that identification code is identified, and the identification code that receives is carried out the calculating of predetermined formula such as controller, judges then whether result of calculation belongs to the predetermined result scope, if so, then thinks to identify and passes through.This moment, terminal can not pre-stored identification code.
If the identification code that receives is Encrypted-identification-code, controller can be decrypted Encrypted-identification-code first, to obtain identification code.
At last, the controller other end that can also control the first switch links to each other with the first data terminal.Such as, controller stops to send the first enable signal or sends the control signal that other are different from the first enable signal, so that the other end of the first switch links to each other with the first data terminal.
In sum, the charger recognition methods that the present embodiment provides, send identification code by charger, terminal is identified charger according to identification code, and then select whether to allow charging by terminal, solved and used the negative consequences that second-rate charger may cause with, reached the effect that terminal only allows to use the special charger charging.
Embodiment four
Please refer to Fig. 5, it shows the block diagram of the controller that the embodiment of the invention four provides.This controller is used for the terminal that embodiment two provides, and this controller comprises:
Detection module 512, control module 514, sending module 520, receiver module 540 and identification module 560.
Whether detection module 512 satisfies the condition that charges normal for detection of the USB charging inlet;
Control module 514, if being used for described detection module 512 detects when described USB charging inlet is satisfied to charge normal condition, send the second enable signal so that the other end of described second switch enables transmitting terminal with first of described controller links to each other, and so that the other end of described the 3rd switch link to each other with the identification code input of described controller.
Sending module 520 is used for utilizing the first data terminal of described USB charging inlet to send the first enable signal to charger;
Receiver module 540 is used for utilizing the second data terminal of described USB charging inlet to receive the identification code that described charger sends.
Identification module 560 is used for the identification code that described receiver module 540 receives is identified, and identification is by then allowing charging.
In sum, the controller that the present embodiment provides, send identification code by the control charger, then according to identification code charger is identified, and then select whether to allow to charge, solved and used the negative consequences that second-rate charger may cause with, reached the effect that terminal only allows to use the special charger charging.
Embodiment five
Please refer to Fig. 6, it shows the method flow diagram of the charger recognition methods that the embodiment of the invention five provides.This charger recognition methods is used for terminal, and described method comprises:
Step 602 sends the first enable signal to charger;
If described terminal then utilizes the first data terminal in the USB charging inlet to send the first enable signal to charger for adopting the terminal of USB charging inlet.
Step 604 after sending the first enable signal, receives the identification code that charger sends;
If terminal for adopting the terminal of USB charging inlet, then utilizes the second data terminal in the USB charging inlet to receive the identification code that charger sends
Step 606 is identified identification code, and identification is by then allowing charging.
If after identification code identified, identification is not passed through, and does not then allow charging and prompting user.
In sum, the charger recognition methods that the present embodiment provides, send identification code by the control charger, then according to identification code charger is identified, and then select whether to allow to charge, solved and used the negative consequences that second-rate charger may cause with, reached the effect that terminal only allows to use the special charger charging.
Embodiment six
Please refer to Fig. 7, it shows the block diagram of the controller that the embodiment of the invention six provides.This controller can be used for terminal, and this controller comprises: sending module 520, receiver module 540 and identification module 560.
Sending module 520 is used for sending the first enable signal to charger;
Receiver module 540 is used for receiving the identification code that described charger sends after described sending module 520 sends the first enable signal;
Identification module 560 is used for the identification code that described receiver module 540 receives is identified, and identification is by then allowing charging.
Preferably, if described terminal is for adopting the terminal of USB charging inlet, then:
Described sending module 520, concrete being used for utilizes the first data terminal of described USB charging inlet to send the first enable signal to charger;
Described receiver module 540, concrete the second data terminal for utilizing described USB charging inlet receives the identification code that described charger sends.
In sum, the controller that the present embodiment provides, send identification code by the control charger, then according to identification code charger is identified, and then select whether to allow to charge, solved and used the negative consequences that second-rate charger may cause with, reached the effect that terminal only allows to use the special charger charging.
Need to prove: the controller that above-described embodiment provides is when carrying out identification to charger, only the division with above-mentioned each functional module is illustrated, in the practical application, can as required the above-mentioned functions distribution be finished by different functional modules, the internal structure of the equipment of being about to is divided into different functional modules, to finish all or part of function described above.In addition, the controller that above-described embodiment provides and charger recognition methods embodiment belong to same design, and its specific implementation process sees embodiment of the method for details, repeats no more here.
The invention described above embodiment sequence number does not represent the quality of embodiment just to description.
The all or part of step that one of ordinary skill in the art will appreciate that realization above-described embodiment can be finished by hardware, also can come the relevant hardware of instruction to finish by program, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
The above only is preferred embodiment of the present invention, and is in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, is equal to replacement, improvement etc., all should be included within protection scope of the present invention.