CN104967174B - Charge control method and device - Google Patents

Charge control method and device Download PDF

Info

Publication number
CN104967174B
CN104967174B CN201510395485.3A CN201510395485A CN104967174B CN 104967174 B CN104967174 B CN 104967174B CN 201510395485 A CN201510395485 A CN 201510395485A CN 104967174 B CN104967174 B CN 104967174B
Authority
CN
China
Prior art keywords
terminal equipment
usb
connecting line
pins
opposite side
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510395485.3A
Other languages
Chinese (zh)
Other versions
CN104967174A (en
Inventor
刘山荣
吴鸣
范杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xiaomi Inc
Original Assignee
Xiaomi Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xiaomi Inc filed Critical Xiaomi Inc
Priority to CN201510395485.3A priority Critical patent/CN104967174B/en
Publication of CN104967174A publication Critical patent/CN104967174A/en
Application granted granted Critical
Publication of CN104967174B publication Critical patent/CN104967174B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The disclosure is directed to a kind of charge control method and device, for realizing the charging/discharging function between two station terminal equipment, so as to avoid the situation that terminal device can not be used by low battery.Methods described includes:Receive preset instructions;When preset instructions are the first charging instruction, the ID pins of the USB of first terminal equipment are converted into ground connection;Whether the opposite side for monitoring the connecting line on the USB of first terminal equipment is connected with the USB of second terminal equipment;When the opposite side of the connecting line is connected with the USB of second terminal equipment, whether the ID pins for monitoring the USB of second terminal equipment are vacant state;When the ID pins of the USB of second terminal equipment are vacant state, to second terminal equipment charge.The technical scheme can avoid the situation that terminal device can not be used due to low battery, improve the Experience Degree of user.

Description

Charge control method and device
Technical field
This disclosure relates to communication technical field, more particularly to charge control method and device.
Background technology
With the development of USB technologies so that can carry out data transmission between PC and peripheral equipment.But, due to standard USB use principal and subordinate framework, line number only can be entered between usb host end (" master ", i.e. computer) and USB peripheral devices (" from ") According to transmission, it can not be carried out data transmission between USB peripheral devices by USB port.Therefore, OTG (On The Go) is used as USB2.0 The supplement of version, applied to the connection between different equipment or mobile device, in the case of there are currently no host side in fact, equipment room Data transmission.USB otg standards add power management (saving power consumption) work(on the basis of completely compatible USB2.0 standards Can, the function allows equipment to can not only be used for main frame, can also be used as peripheral hardware operation equipment, i.e., dual-purpose OTG (On-The-Go).OTG two USB2.0 standards are complied fully with equipment, and certain Host Detection ability can be provided, support that (HNP is assisted main frame circular order agreement View) and session request agreement (SRP agreements).
In correlation technique, mobile phone is obtained as most commonly used electronic product, the visual and recreational of its giant-screen To greatly improving, thus the power consumption of mobile phone is also caused to be multiplied, but the electricity of battery can not but be multiplied so that hand The use time of machine shortens, and brings work to user and inconvenient and trouble in life, although have miscellaneous charging at present Treasured can be charged for mobile phone at any time, but user is often reluctant to carry or left behind because charger baby is too heavy, or even carrying It can not but be charged afterwards because of charger baby not enough power supply for mobile phone, especially in the case where user is in the urgent need to using mobile phone, this Very big influence may be brought to user by planting inconvenience.
The content of the invention
The disclosure provides a kind of charge control method and device, for realizing the charge and discharge electric work between two station terminal equipment Can, so as to avoid the situation that terminal device can not be used by low battery.
According to the first aspect of the embodiment of the present disclosure there is provided a kind of charge control method, for first terminal equipment, bag Include:
Receive preset instructions;
When the preset instructions are the first charging instruction, by the USB of the first terminal equipment ID pins are converted to ground connection;
Monitor connecting line on the USB of the first terminal equipment opposite side whether with second eventually The USB connection of end equipment;
When the opposite side and second terminal equipment of the connecting line on the USB of the first terminal equipment USB connection when, monitor the second terminal equipment USB ID pins whether be Vacant state;
When the ID pins of the USB of the second terminal equipment are vacant state, to described second eventually End equipment charges.
In one embodiment, the connecting line is OTG connecting lines, and two side interfaces of the OTG connecting lines lead to described Matched with serial bus interface.
In one embodiment, the connecting line when on the USB of the first terminal equipment is another When side is connected with the USB of second terminal equipment, the USB of the second terminal equipment is monitored Whether the ID pins of interface are vacant state, including:
When the opposite side and second terminal equipment of the connecting line on the USB of the first terminal equipment USB connection after, receive and change the ID pins of the USB of the second terminal equipment For the status information of vacant state;Or
When the opposite side and second terminal equipment of the connecting line on the USB of the first terminal equipment USB connection when, the ID pins of the USB of the second terminal equipment are changed automatically For vacant state.
In one embodiment, it is described to the second terminal equipment charge, including:
According to default maximum charging current to the second terminal equipment charge.
In one embodiment, connecting line on the USB of the monitoring first terminal equipment Whether opposite side is connected with the USB of second terminal equipment, including:
Monitoring the opposite side of the connecting line in preset duration on the USB of the first terminal equipment is The no USB with second terminal equipment is connected.
In one embodiment, in the monitoring preset duration on the USB of the first terminal equipment Connecting line opposite side whether be connected with the USB of second terminal equipment after, methods described also includes:
When the opposite side of the connecting line in preset duration on the USB of the first terminal equipment does not have When being connected with the USB of second terminal equipment, by the USB of the first terminal equipment ID pins revert to the default setting of the first terminal equipment.
In one embodiment, methods described also includes:
When the connecting line on the USB of the second terminal equipment and the first terminal equipment disconnects During connection, the ID pins of the USB of the first terminal equipment are reverted into the silent of the first terminal equipment Recognize setting.
In one embodiment, methods described also includes:
When the preset instructions are the second charging instruction, by the USB of the first terminal equipment ID pins are converted to vacant state;
Monitor connecting line on the USB of the first terminal equipment opposite side whether with the 3rd eventually The USB connection of end equipment;
When the opposite side and third terminal equipment of the connecting line on the USB of the first terminal equipment USB connection when, whether the ID pins for monitoring the USB of the third terminal equipment connect Ground;
When the ID pins ground connection of the USB of the third terminal equipment, set by the third terminal It is standby to be charged.
The technical scheme provided by this disclosed embodiment can include the following benefits:
The technical scheme is connected between first terminal equipment and second terminal equipment by connecting line and first terminal is set When the ID pins of the USB of standby and second terminal equipment connect correct respectively, can in first terminal equipment and The process of discharge and recharge is completed between second terminal equipment so that the high terminal device of electricity can fill to the low terminal device of electricity Electricity, so that the situation that wherein a station terminal equipment can not be used due to low battery is avoided, and the mutually terminal of discharge and recharge Equipment need not carry out larger change and charging/discharging function can be achieved, so as to improve the Experience Degree of user.
According to the second aspect of the embodiment of the present disclosure there is provided a kind of battery charge controller, for first terminal equipment, bag Include:
Receiving module, for receiving preset instructions;
First modular converter, for when the preset instructions are the first charging instruction, by the first terminal equipment The ID pins of USB are converted to ground connection;
First monitoring modular, the connecting line on USB for monitoring the first terminal equipment it is another Whether side is connected with the USB of second terminal equipment;
Second monitoring modular, for another when the connecting line on the USB of the first terminal equipment When side is connected with the USB of second terminal equipment, the USB for monitoring the second terminal equipment connects Whether the ID pins of mouth are vacant state;
First charging module, the ID pins for the USB when the second terminal equipment are hanging shape During state, to the second terminal equipment charge.
In one embodiment, second monitoring modular includes:
Receiving submodule, for when the opposite side of the connecting line on the USB of the first terminal equipment After being connected with the USB of second terminal equipment, reception connects the USB of the second terminal equipment The ID pins of mouth are converted to the status information of vacant state;Or
Transform subblock, for when the opposite side of the connecting line on the USB of the first terminal equipment When being connected with the USB of second terminal equipment, the USB of the second terminal equipment is connect automatically The ID pins of mouth are converted to vacant state.
In one embodiment, first charging module includes:
Charge submodule, for according to default maximum charging current to the second terminal equipment charge.
In one embodiment, first monitoring modular includes:
Submodule is monitored, for monitoring the company in preset duration on the USB of the first terminal equipment Whether the opposite side of wiring is connected with the USB of second terminal equipment.
In one embodiment, described device also includes:
First recovery module, for when the company in preset duration on the USB of the first terminal equipment When the opposite side of wiring is not connected with the USB of second terminal equipment, by the logical of the first terminal equipment The default setting of the first terminal equipment is reverted to the ID pins of serial bus interface.
In one embodiment, described device also includes:
Second recovery module, for being connect when the USB of the second terminal equipment and the first terminal equipment When connecting line on mouth is disconnected, the ID pins of the USB of the first terminal equipment are reverted to described The default setting of first terminal equipment.
In one embodiment, described device also includes:
Second modular converter, for when the preset instructions are the second charging instruction, by the first terminal equipment The ID pins of USB are converted to vacant state;
3rd monitoring modular, the connecting line on USB for monitoring the first terminal equipment it is another Whether side is connected with the USB of third terminal equipment;
4th monitoring modular, for another when the connecting line on the USB of the first terminal equipment When side is connected with the USB of third terminal equipment, the USB for monitoring the third terminal equipment connects Whether the ID pins of mouth are grounded;
Second charging module, when the ID pins for the USB when the third terminal equipment are grounded, Charged by the first terminal equipment.
The technical scheme provided by this disclosed embodiment can include the following benefits:
The device connected between first terminal equipment and second terminal equipment by connecting line and first terminal equipment and , can be in first terminal equipment and second when the ID pins of the USB of second terminal equipment connect correct respectively The process of discharge and recharge is completed between terminal device so that the high terminal device of electricity can charge to the low terminal device of electricity, So as to avoid the situation that wherein a station terminal equipment can not be used due to low battery, and the mutually terminal device of discharge and recharge Larger change need not be carried out charging/discharging function can be achieved, so as to improve the Experience Degree of user.
According to the third aspect of the embodiment of the present disclosure there is provided a kind of battery charge controller, including:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
Receive preset instructions;
When the preset instructions are the first charging instruction, by the USB of the first terminal equipment ID pins are converted to ground connection;
Monitor connecting line on the USB of the first terminal equipment opposite side whether with second eventually The USB connection of end equipment;
When the opposite side and second terminal equipment of the connecting line on the USB of the first terminal equipment USB connection when, monitor the second terminal equipment USB ID pins whether be Vacant state;
When the ID pins of the USB of the second terminal equipment are vacant state, to described second eventually End equipment charges.
It should be appreciated that the general description of the above and detailed description hereinafter are only exemplary and explanatory, not The disclosure can be limited.
Brief description of the drawings
Accompanying drawing herein is merged in specification and constitutes the part of this specification, shows the implementation for meeting the disclosure Example, and be used to together with specification to explain the principle of the disclosure.
Fig. 1 is a kind of flow chart of charge control method according to an exemplary embodiment.
Fig. 2 is a kind of flow chart of charge control method according to an exemplary embodiment.
Fig. 3 is a kind of flow chart of the charge control method exemplified according to a specific implementation.
Fig. 4 is the flow chart of another charge control method according to an exemplary embodiment.
Fig. 5 is a kind of block diagram of battery charge controller according to an exemplary embodiment.
Fig. 6 is the block diagram of the second monitoring modular in a kind of battery charge controller according to an exemplary embodiment.
Fig. 7 is the block diagram of the first charging module in a kind of battery charge controller according to an exemplary embodiment.
Fig. 8 is the block diagram of another battery charge controller according to an exemplary embodiment.
Fig. 9 is the block diagram of another battery charge controller according to an exemplary embodiment.
Figure 10 is the block diagram of another battery charge controller according to an exemplary embodiment.
Figure 11 is a kind of block diagram of device for charge control according to an exemplary embodiment.
Embodiment
Here exemplary embodiment will be illustrated in detail, its example is illustrated in the accompanying drawings.Following description is related to During accompanying drawing, unless otherwise indicated, the same numbers in different accompanying drawings represent same or analogous key element.Following exemplary embodiment Described in embodiment do not represent all embodiments consistent with the disclosure.On the contrary, they be only with it is such as appended The example of the consistent apparatus and method of some aspects be described in detail in claims, the disclosure.
Fig. 1 is a kind of flow chart of charge control method according to an exemplary embodiment, as shown in figure 1, this fills Electric control method is used in first terminal equipment, comprises the following steps S11-S15:
In step s 11, preset instructions are received.
In step s 12, when preset instructions are the first charging instruction, the USB of first terminal equipment is connect The ID pins of mouth are converted to ground connection.
Wherein, it using first terminal equipment is instruction that other equipment is charged that the first charging instruction, which is,.
In step s 13, whether the opposite side of the connecting line on the USB of monitoring first terminal equipment It is connected with the USB of second terminal equipment.
Wherein, the connecting line on the USB of first terminal equipment is that by different equipment or shifting The connecting line of connection and data exchange between dynamic equipment, such as OTG connecting lines, two side interfaces of OTG connecting lines are with being connected USB (Universal Serial Bus, USB) interface of two equipment matches.
In step S14, when the opposite side of the connecting line on the USB of first terminal equipment and second During the USB connection of terminal device, monitoring the ID pins of the USB of second terminal equipment is No is vacant state.
In step S15, when the ID pins of the USB of second terminal equipment are vacant state, to the Two terminal devices charge.
The technical scheme provided using the embodiment of the present disclosure, by even between first terminal equipment and second terminal equipment Wiring is connected and the ID pins of the USB of first terminal equipment and second terminal equipment are connected correctly respectively When, the process of discharge and recharge can be completed between first terminal equipment and second terminal equipment so that the high terminal device of electricity It can be charged to the low terminal device of electricity, so as to avoid what a wherein station terminal equipment can not be used due to low battery Situation, and the terminal device of mutually discharge and recharge need not carry out the i.e. achievable charging/discharging function of larger change, so as to improve user Experience Degree.
The above method, it is another with the connecting line on the USB of first terminal equipment in step S14 The second terminal equipment that side is connected, the ID pins of its USB interface can be manually set to vacant state with user, can also be by One terminal device is automatically set as vacant state.Therefore, step S14 may be embodied as following two modes:Mode one, when first The opposite side of connecting line on the USB of terminal device and the USB of second terminal equipment After connection, the status information that the ID pins of the USB of second terminal equipment are converted to vacant state is received; Using which for the moment, the state by user to the ID pins of USB interface in second terminal equipment carries out equipment, is provided with Afterwards, first terminal equipment has also been received by the ID pins of the USB interface of second terminal equipment and has been converted into vacant state Status information.Or, mode two, when the opposite side of the connecting line on the USB of first terminal equipment and second During the USB connection of terminal device, automatically by the ID pins of the USB of second terminal equipment Be converted to vacant state.During using which two, first terminal equipment can set second automatically eventually according to itself connection status The ID pin states of end equipment USB interface, for example, the ID pins of first terminal equipment USB interface are set to ground connection, then first eventually The ID pins of second terminal equipment USB interface will be set to vacant state by end equipment, if first terminal equipment USB interface ID pins be set to vacant state, then the ID pins of second terminal equipment USB interface will be set to by first terminal equipment Ground connection, in this case for using second terminal equipment to first terminal equipment charge.
In one embodiment, step S15 may be embodied as following steps:According to default maximum charging current to second Terminal device charges.For example, default maximum charging current be 500 milliamperes, then first terminal equipment will according to 500 milliamperes or Electric current less than 500 milliamperes is second terminal equipment charge, so as to protect two terminal devices connected by connecting line.
In one embodiment, step S13 may be embodied as following steps:Monitor first terminal equipment in preset duration Whether the opposite side of the connecting line on USB is connected with the USB of second terminal equipment.When The opposite side of connecting line in preset duration on the USB of first terminal equipment is logical with second terminal equipment When being connected with serial bus interface, step S14-S15 is continued executing with.When the general serial of first terminal equipment in preset duration is total When the opposite side of connecting line on line interface is not connected with the USB of second terminal equipment, by first terminal The ID pins of the USB of equipment revert to the default setting of first terminal equipment.
In one embodiment, the above method is further comprising the steps of:When second terminal equipment and first terminal equipment When connecting line on USB is disconnected, by the ID pins of the USB of first terminal equipment Revert to the default setting of first terminal equipment.
In one embodiment, as shown in Fig. 2 the further comprising the steps of S21-S25 of the above method.
In the step s 21, preset instructions are received.
In step S22, when preset instructions are the second charging instruction, the USB of first terminal equipment is connect The ID pins of mouth are converted to vacant state.
Wherein, the second charging instruction is to utilize instruction of the other-end to first terminal equipment charge.The step can be by User directly sets the state of the ID pins of USB interface in first terminal equipment, can also be received in first terminal equipment It is automatically vacant state by the State Transferring of the ID pins of the USB interface of itself during the second charging instruction.
In step S23, whether the opposite side of the connecting line on the USB of monitoring first terminal equipment It is connected with the USB of third terminal equipment.
In step s 24, when the opposite side of the connecting line on the USB of first terminal equipment and the 3rd During the USB connection of terminal device, monitoring the ID pins of the USB of third terminal equipment is No ground connection.
In step s 25, when the ID pins ground connection of the USB of third terminal equipment, by the 3rd eventually End equipment is charged.
In the present embodiment, drawn by the ID of the connection between first terminal equipment and third terminal equipment, and USB interface The conversion of the connection status of pin, realizes the process from third terminal equipment to first terminal equipment charge, and the process need not Larger change is carried out to equipment, so as to improve the Experience Degree of user.
During Fig. 3 is a kind of flow chart of the charge control method exemplified according to a specific implementation, the embodiment, the charging Control method is used for first terminal equipment, and first terminal equipment can be the electronic equipments such as smart mobile phone, tablet personal computer, for even The connecting line for connecing two terminal devices is OTG connecting lines.As shown in figure 3, comprising the following steps S31-S37:
In step S31, the first charging instruction is received.Wherein, the first charging instruction be using first terminal equipment to its The instruction of his terminal charge.
In step s 32, the ID pins of the USB interface of first terminal equipment are converted into ground connection.
In step S33, the opposite side of the OTG connecting lines in monitoring preset duration on the USB interface of first terminal equipment Whether it is connected with the USB interface of second terminal equipment;If the opposite side of OTG connecting lines and second terminal equipment in preset duration USB interface connection, then continue executing with step S34;If there there is no and second terminal the opposite side of OTG connecting lines in preset duration The USB interface connection of equipment, then perform step S36;For example, preset duration could be arranged to 10 seconds.
In step S34, whether the ID pins for monitoring the USB interface of second terminal equipment are vacant state;If second The ID pins of the USB interface of terminal device are vacant state, then continue executing with step S35;If the USB of second terminal equipment connects The ID pins of mouth are not vacant states, then perform step S36.In the step, the ID pins of the USB interface of second terminal equipment can Vacant state is manually set to user, vacant state can also be automatically set as by first terminal equipment.
In step s 35, to second terminal equipment charge.
In step S36, the acquiescence that the ID pins of the USB interface of first terminal equipment are reverted into first terminal equipment is set Put.
In step S37, prompt message is sent.First terminal equipment can will be prompted to presentation of information on screen, be used to The ID pin connection status mistakes of user's second terminal equipment USB interface are pointed out, or whether are sent by second terminal equipment USB The ID pins of interface are set to the request of vacant state, if user receives the request, first terminal equipment is automatic by second The ID pins of terminal device USB interface are set to vacant state, and carry out charging operations.
In the embodiment, connected between first terminal equipment and second terminal equipment by OTG connecting lines and first is whole , can be in first terminal equipment and second when the ID pins of the USB interface of end equipment and second terminal equipment connect correct respectively The process of discharge and recharge is completed between terminal device so that the high terminal device of electricity can charge to the low terminal device of electricity, So as to avoid the situation that wherein a station terminal equipment can not be used due to low battery, and the mutually terminal device of discharge and recharge Larger change need not be carried out charging/discharging function can be achieved, so as to improve the Experience Degree of user.
Fig. 4 is a kind of flow chart of charge control method according to an exemplary embodiment.As shown in figure 4, including Following steps S41-S45:
In step S41, the second charging instruction is received.Wherein, the second charging instruction is whole to first using other-end The instruction of end equipment charging.
In step S42, the ID pins of the USB of first terminal equipment are converted into vacant state.
In step S43, monitor first terminal equipment USB interface on connecting line opposite side whether with second terminal The USB connection of equipment.
In step S44, when the opposite side of connecting line is connected with the USB of second terminal equipment, prison Whether the ID pins for surveying the USB of second terminal equipment are grounded.
In step S45, when the ID pins ground connection of the USB of second terminal equipment, by second terminal Equipment is to first terminal equipment charge.
In the embodiment, according to the ID pins of first terminal equipment and the USB of second terminal equipment Connection status realizes the purpose of discharge and recharge, to complete the high terminal device of electricity to the process of the low terminal device charging of electricity, So as to avoid the situation that wherein a station terminal equipment can not be used due to low battery, the Experience Degree of user is improved.
Fig. 5 is a kind of block diagram of battery charge controller according to an exemplary embodiment.Reference picture 5, the device is used In first terminal equipment, including receiving module 51, the first modular converter 52, the first monitoring modular 53, the He of the second monitoring modular 54 First charging module 55;Wherein:
Receiving module 51 is configured as receiving preset instructions.
When first modular converter 52 is configured as preset instructions for the first charging instruction, by the general of first terminal equipment The ID pins of serial bus interface are converted to ground connection.
First monitoring modular 53 is configured as monitoring the connecting line on the USB of first terminal equipment Whether opposite side is connected with the USB of second terminal equipment.
Second monitoring modular 54 is configured as the another of the connecting line on the USB of first terminal equipment When side is connected with the USB of second terminal equipment, the USB of second terminal equipment is monitored ID pins whether be vacant state.
The ID pins that first charging module 55 is configured as the USB of second terminal equipment are hanging During state, to second terminal equipment charge.
In one embodiment, as shown in fig. 6, the second monitoring modular 54 includes receiving submodule 541 or conversion submodule Block 542;Wherein:
Receiving submodule 541 is configured as the another of the connecting line on the USB of first terminal equipment After side is connected with the USB of second terminal equipment, receive the USB of second terminal equipment ID pins be converted to the status information of vacant state.
Transform subblock 542 is configured as the another of the connecting line on the USB of first terminal equipment When side is connected with the USB of second terminal equipment, automatically by the USB of second terminal equipment ID pins be converted to vacant state.
In one embodiment, as shown in fig. 7, the first charging module 55 includes charging submodule 551, the charging submodule 551 are configured as according to default maximum charging current to second terminal equipment charge.
In one embodiment, as shown in figure 8, the first monitoring modular 53 includes monitoring submodule 531, the monitoring submodule 531 be configured as monitor preset duration in first terminal equipment USB on connecting line opposite side whether It is connected with the USB of second terminal equipment.Now, said apparatus may also include the first recovery module 56, and this One recovery module 56 is configured as the another of the connecting line in preset duration on the USB of first terminal equipment When side is not connected with the USB of second terminal equipment, the USB of first terminal equipment is connect The ID pins of mouth revert to the default setting of first terminal equipment.
In one embodiment, as shown in figure 9, said apparatus also includes the second recovery module 57, second recovery module When 57 connecting lines being configured as on the USB of second terminal equipment and first terminal equipment are disconnected, The ID pins of the USB of first terminal equipment are reverted into the default setting of first terminal equipment.
In one embodiment, as shown in Figure 10, said apparatus also includes:
When second modular converter 58 is configured as preset instructions for the second charging instruction, by the general of first terminal equipment The ID pins of serial bus interface are converted to vacant state.
3rd monitoring modular 59 is configured as monitoring the connecting line on the USB of first terminal equipment Whether opposite side is connected with the USB of third terminal equipment.
4th monitoring modular 510 is configured as the another of the connecting line on the USB of first terminal equipment When side is connected with the USB of third terminal equipment, the USB of third terminal equipment is monitored ID pins whether be grounded.
Second charging module 511 is configured as the ID pins ground connection of the USB of third terminal equipment When, charged by first terminal equipment.
The device provided using the embodiment of the present disclosure, connecting line is passed through between first terminal equipment and second terminal equipment , can be first eventually when the ID pins of connection and the USB interface of first terminal equipment and second terminal equipment connect correct respectively The process of discharge and recharge is completed between end equipment and second terminal equipment so that the high terminal device of electricity can be to electricity low end End equipment charges, so that the situation that wherein a station terminal equipment can not be used due to low battery is avoided, and mutually charge and discharge The terminal device of electricity need not carry out larger change and charging/discharging function can be achieved, so as to improve the Experience Degree of user.
In the exemplary embodiment, the embodiment of the present disclosure also provides a kind of battery charge controller, including:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
Receive preset instructions;
When the preset instructions are the first charging instruction, by the USB of the first terminal equipment ID pins are converted to ground connection;
Monitor connecting line on the USB of the first terminal equipment opposite side whether with second eventually The USB connection of end equipment;
When the opposite side and second terminal equipment of the connecting line on the USB of the first terminal equipment USB connection when, monitor the second terminal equipment USB ID pins whether be Vacant state;
When the ID pins of the USB of the second terminal equipment are vacant state, to described second eventually End equipment charges.
On the device in above-described embodiment, wherein modules perform the concrete mode of operation in relevant this method Embodiment in be described in detail, explanation will be not set forth in detail herein.
Figure 11 is a kind of block diagram of device 900 for charge control according to an exemplary embodiment.For example, dress It can be mobile phone, computer, digital broadcast terminal, messaging devices, game console, tablet device, medical treatment to put 900 Equipment, body-building equipment, personal digital assistant etc..
Reference picture 11, device 900 can include following one or more assemblies:Processing assembly 902, memory 904, power supply Component 906, multimedia groupware 908, audio-frequency assembly 910, the interface 912 of input/output (I/O), sensor cluster 914, and Communication component 916.
The integrated operation of the usual control device 900 of processing assembly 902, such as with display, call, data communication, phase Machine operates the operation associated with record operation.Treatment element 902 can refer to including one or more processors 920 to perform Order, to complete all or part of step of above-mentioned method.In addition, processing assembly 902 can include one or more modules, just Interaction between processing assembly 902 and other assemblies.For example, processing component 902 can include multi-media module, it is many to facilitate Interaction between media component 908 and processing assembly 902.
Memory 904 is configured as storing various types of data supporting the operation in equipment 900.These data are shown Example includes the instruction of any application program or method for being operated on device 900, and contact data, telephone book data disappears Breath, picture, video etc..Memory 904 can be by any kind of volatibility or non-volatile memory device or their group Close and realize, such as static RAM (SRAM), Electrically Erasable Read Only Memory (EEPROM) is erasable to compile Journey read-only storage (EPROM), programmable read only memory (PROM), read-only storage (ROM), magnetic memory, flash Device, disk or CD.
Electric power assembly 906 provides electric power for the various assemblies of device 900.Electric power assembly 906 can include power management system System, one or more power supplys, and other components associated with generating, managing and distributing electric power for device 900.
Multimedia groupware 908 is included in the screen of one output interface of offer between described device 900 and user.One In a little embodiments, screen can include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen Curtain may be implemented as touch-screen, to receive the input signal from user.Touch panel includes one or more touch sensings Device is with the gesture on sensing touch, slip and touch panel.The touch sensor can not only sensing touch or sliding action Border, but also detection touches or slide related duration and pressure with described.In certain embodiments, many matchmakers Body component 908 includes a front camera and/or rear camera.When equipment 900 be in operator scheme, such as screening-mode or During video mode, front camera and/or rear camera can receive the multi-medium data of outside.Each front camera and Rear camera can be a fixed optical lens system or with focusing and optical zoom capabilities.
Audio-frequency assembly 910 is configured as output and/or input audio signal.For example, audio-frequency assembly 910 includes a Mike Wind (MIC), when device 900 be in operator scheme, when such as call model, logging mode and speech recognition mode, microphone by with It is set to reception external audio signal.The audio signal received can be further stored in memory 904 or via communication set Part 916 is sent.In certain embodiments, audio-frequency assembly 910 also includes a loudspeaker, for exports audio signal.
I/O interfaces 912 is provide interface between processing assembly 902 and peripheral interface module, above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include but be not limited to:Home button, volume button, start button and lock Determine button.
Sensor cluster 914 includes one or more sensors, and the state for providing various aspects for device 900 is commented Estimate.For example, sensor cluster 914 can detect opening/closed mode of equipment 900, the relative positioning of component is for example described Component is the display and keypad of device 900, and sensor cluster 914 can be with 900 1 components of detection means 900 or device Position change, the existence or non-existence that user contacts with device 900, the orientation of device 900 or acceleration/deceleration and device 900 Temperature change.Sensor cluster 914 can include proximity transducer, be configured to detect in not any physical contact The presence of neighbouring object.Sensor cluster 914 can also include optical sensor, such as CMOS or ccd image sensor, for into As being used in application.In certain embodiments, the sensor cluster 914 can also include acceleration transducer, gyro sensors Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 916 is configured to facilitate the communication of wired or wireless way between device 900 and other equipment.Device 900 can access the wireless network based on communication standard, such as WiFi, 2G or 3G, or combinations thereof.In an exemplary implementation In example, communication component 916 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, the communication component 916 also includes near-field communication (NFC) module, to promote junction service.Example Such 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 900 can be believed by one or more application specific integrated circuits (ASIC), numeral Number processor (DSP), digital signal processing appts (DSPD), PLD (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for performing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instructing, example are additionally provided Such as include the memory 904 of instruction, above-mentioned instruction can be performed to complete the above method by the processor 920 of device 900.For example, The non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk With optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processing of mobile terminal When device is performed so that mobile terminal is able to carry out a kind of charge control method, methods described is used for first terminal equipment, including:
Receive preset instructions;
When the preset instructions are the first charging instruction, by the USB of the first terminal equipment ID pins are converted to ground connection;
Monitor connecting line on the USB of the first terminal equipment opposite side whether with second eventually The USB connection of end equipment;
When the opposite side and second terminal equipment of the connecting line on the USB of the first terminal equipment USB connection when, monitor the second terminal equipment USB ID pins whether be Vacant state;
When the ID pins of the USB of the second terminal equipment are vacant state, to described second eventually End equipment charges.
The connecting line is OTG connecting lines, two side interfaces of the OTG connecting lines and the USB phase Matching.
The opposite side and second terminal of the connecting line when on the USB of the first terminal equipment During the USB connection of equipment, monitoring the ID pins of the USB of the second terminal equipment is No is vacant state, including:
When the opposite side and second terminal equipment of the connecting line on the USB of the first terminal equipment USB connection after, receive and change the ID pins of the USB of the second terminal equipment For the status information of vacant state;Or
When the opposite side and second terminal equipment of the connecting line on the USB of the first terminal equipment USB connection when, the ID pins of the USB of the second terminal equipment are changed automatically For vacant state.
It is described to the second terminal equipment charge, including:
According to default maximum charging current to the second terminal equipment charge.
Whether the opposite side of the connecting line on the USB of the monitoring first terminal equipment is with the The USB connection of two terminal devices, including:
Monitoring the opposite side of the connecting line in preset duration on the USB of the first terminal equipment is The no USB with second terminal equipment is connected.
Connecting line in the monitoring preset duration on the USB of the first terminal equipment it is another After whether side is connected with the USB of second terminal equipment, methods described also includes:
When the opposite side of the connecting line in preset duration on the USB of the first terminal equipment does not have When being connected with the USB of second terminal equipment, by the USB of the first terminal equipment ID pins revert to the default setting of the first terminal equipment.
Methods described also includes:
When the connecting line on the USB of the second terminal equipment and the first terminal equipment disconnects During connection, the ID pins of the USB of the first terminal equipment are reverted into the silent of the first terminal equipment Recognize setting.
Methods described also includes:
When the preset instructions are the second charging instruction, by the USB of the first terminal equipment ID pins are converted to vacant state;
Monitor connecting line on the USB of the first terminal equipment opposite side whether with the 3rd eventually The USB connection of end equipment;
When the opposite side and third terminal equipment of the connecting line on the USB of the first terminal equipment USB connection when, whether the ID pins for monitoring the USB of the third terminal equipment connect Ground;
When the ID pins ground connection of the USB of the third terminal equipment, set by the third terminal It is standby to be charged.
Those skilled in the art will readily occur to other realities of the disclosure after considering specification and putting into practice disclosure herein Apply scheme.The application is intended to any modification, purposes or the adaptations of the disclosure, these modifications, purposes or suitable The change of answering property follows the general principle of the disclosure and including the undocumented common knowledge or used in the art of the disclosure Use technological means.Description and embodiments are considered only as exemplary, and the true scope of the disclosure and spirit are by following right It is required that pointing out.
It should be appreciated that the precision architecture that the disclosure is not limited to be described above and is shown in the drawings, and And various modifications and changes can be being carried out without departing from the scope.The scope of the present disclosure is only limited by appended claim.

Claims (12)

1. a kind of charge control method, it is characterised in that for first terminal equipment, including:
Receive preset instructions;
When the preset instructions are the first charging instruction, the ID of the USB of the first terminal equipment is drawn Pin is converted to ground connection;
Whether the opposite side for monitoring the connecting line on the USB of the first terminal equipment sets with second terminal Standby USB connection;
When the opposite side of the connecting line on the USB of the first terminal equipment and leading to for second terminal equipment When being connected with serial bus interface, whether the ID pins for monitoring the USB of the second terminal equipment are hanging State;
When the ID pins of the USB of the second terminal equipment are vacant state, set to the second terminal Standby charging;
The opposite side of connecting line on the USB of the monitoring first terminal equipment whether with second eventually The USB connection of end equipment, including:
Monitor preset duration in the first terminal equipment USB on connecting line opposite side whether with The USB connection of second terminal equipment;
The opposite side of connecting line in the monitoring preset duration on the USB of the first terminal equipment is After the no USB with second terminal equipment is connected, methods described also includes:
When the opposite side of the connecting line in preset duration on the USB of the first terminal equipment is not with During the USB connection of two terminal devices, the ID of the USB of the first terminal equipment is drawn Pin reverts to the default setting of the first terminal equipment.
2. according to the method described in claim 1, it is characterised in that the connecting line is OTG connecting lines, the OTG connecting lines Two side interfaces match with the USB.
3. according to the method described in claim 1, it is characterised in that
The opposite side of the connecting line when on the USB of the first terminal equipment and second terminal equipment USB connection when, monitor the second terminal equipment USB ID pins whether be Vacant state, including:
When the opposite side of the connecting line on the USB of the first terminal equipment and leading to for second terminal equipment After being connected with serial bus interface, reception is converted to the ID pins of the USB of the second terminal equipment outstanding The status information of dummy status;Or
When the opposite side of the connecting line on the USB of the first terminal equipment and leading to for second terminal equipment When being connected with serial bus interface, the ID pins of the USB of the second terminal equipment are converted to automatically outstanding Dummy status.
4. according to the method described in claim 1, it is characterised in that
It is described to the second terminal equipment charge, including:
According to default maximum charging current to the second terminal equipment charge.
5. according to the method described in claim 1, it is characterised in that methods described also includes:
When the connecting line on USB of the second terminal equipment with the first terminal equipment is disconnected When, the acquiescence that the ID pins of the USB of the first terminal equipment are reverted into the first terminal equipment is set Put.
6. according to the method described in claim 1, it is characterised in that methods described also includes:
When the preset instructions are the second charging instruction, the ID of the USB of the first terminal equipment is drawn Pin is converted to vacant state;
Whether the opposite side for monitoring the connecting line on the USB of the first terminal equipment sets with third terminal Standby USB connection;
When the opposite side of the connecting line on the USB of the first terminal equipment and leading to for third terminal equipment When being connected with serial bus interface, whether the ID pins for monitoring the USB of the third terminal equipment are grounded;
When the ID pins ground connection of the USB of the third terminal equipment, entered by the third terminal equipment Row charging.
7. a kind of battery charge controller, it is characterised in that for first terminal equipment, including:
Receiving module, for receiving preset instructions;
First modular converter, for when the preset instructions are the first charging instruction, by the general of the first terminal equipment The ID pins of serial bus interface are converted to ground connection;
First monitoring modular, the opposite side of the connecting line on USB for monitoring the first terminal equipment Whether it is connected with the USB of second terminal equipment;
Second monitoring modular, for the opposite side when the connecting line on the USB of the first terminal equipment with During the USB connection of second terminal equipment, the USB of the second terminal equipment is monitored Whether ID pins are vacant state;
First charging module, the ID pins for the USB when the second terminal equipment are vacant state When, to the second terminal equipment charge;
First monitoring modular includes:
Submodule is monitored, for monitoring the connecting line in preset duration on the USB of the first terminal equipment Opposite side whether be connected with the USB of second terminal equipment;
Described device also includes:
First recovery module, for when the connecting line in preset duration on the USB of the first terminal equipment Opposite side when not being connected with the USB of second terminal equipment, by the general string of the first terminal equipment The ID pins of row bus interface revert to the default setting of the first terminal equipment.
8. device according to claim 7, it is characterised in that second monitoring modular includes:
Receiving submodule, for the opposite side when the connecting line on the USB of the first terminal equipment and After the USB connection of two terminal devices, receive the USB of the second terminal equipment ID pins are converted to the status information of vacant state;Or
Transform subblock, for the opposite side when the connecting line on the USB of the first terminal equipment and During the USB connection of two terminal devices, automatically by the USB of the second terminal equipment ID pins are converted to vacant state.
9. device according to claim 7, it is characterised in that first charging module includes:
Charge submodule, for according to default maximum charging current to the second terminal equipment charge.
10. device according to claim 9, it is characterised in that described device also includes:
Second recovery module, for when the USB of the second terminal equipment and the first terminal equipment Connecting line when disconnecting, the ID pins of the USB of the first terminal equipment are reverted to described first The default setting of terminal device.
11. device according to claim 7, it is characterised in that described device also includes:
Second modular converter, for when the preset instructions are the second charging instruction, by the general of the first terminal equipment The ID pins of serial bus interface are converted to vacant state;
3rd monitoring modular, the opposite side of the connecting line on USB for monitoring the first terminal equipment Whether it is connected with the USB of third terminal equipment;
4th monitoring modular, for the opposite side when the connecting line on the USB of the first terminal equipment with During the USB connection of third terminal equipment, the USB of the third terminal equipment is monitored Whether ID pins are grounded;
Second charging module, when the ID pins for the USB when the third terminal equipment are grounded, passes through The first terminal equipment is charged.
12. a kind of battery charge controller, for first terminal equipment, it is characterised in that including:
Processor;
Memory for storing processor-executable instruction;
Wherein, the processor is configured as:
Receive preset instructions;
When the preset instructions are the first charging instruction, the ID of the USB of the first terminal equipment is drawn Pin is converted to ground connection;
Whether the opposite side for monitoring the connecting line on the USB of the first terminal equipment sets with second terminal Standby USB connection;
When the opposite side of the connecting line on the USB of the first terminal equipment and leading to for second terminal equipment When being connected with serial bus interface, whether the ID pins for monitoring the USB of the second terminal equipment are hanging State;
When the ID pins of the USB of the second terminal equipment are vacant state, set to the second terminal Standby charging;
The opposite side of connecting line on the USB of the monitoring first terminal equipment whether with second eventually The USB connection of end equipment, including:
Monitor preset duration in the first terminal equipment USB on connecting line opposite side whether with The USB connection of second terminal equipment;
The opposite side of connecting line in the monitoring preset duration on the USB of the first terminal equipment is After the no USB with second terminal equipment is connected, when in preset duration the first terminal equipment it is general When the opposite side of connecting line on serial bus interface is not connected with the USB of second terminal equipment, by institute The ID pins for stating the USB of first terminal equipment revert to the default setting of the first terminal equipment.
CN201510395485.3A 2015-07-07 2015-07-07 Charge control method and device Active CN104967174B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510395485.3A CN104967174B (en) 2015-07-07 2015-07-07 Charge control method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510395485.3A CN104967174B (en) 2015-07-07 2015-07-07 Charge control method and device

Publications (2)

Publication Number Publication Date
CN104967174A CN104967174A (en) 2015-10-07
CN104967174B true CN104967174B (en) 2017-10-31

Family

ID=54221167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510395485.3A Active CN104967174B (en) 2015-07-07 2015-07-07 Charge control method and device

Country Status (1)

Country Link
CN (1) CN104967174B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107276180B (en) * 2017-08-04 2020-09-29 上海青橙实业有限公司 Charging control method, device and system and user equipment
CN108023376B (en) * 2017-11-08 2021-10-22 卓尔悦欧洲控股有限公司 Charging wire, charging assembly, charging method and device
CN108054794A (en) * 2017-12-12 2018-05-18 广东小天才科技有限公司 Charging and discharging method and device for intelligent terminal, terminal and storage medium
CN110601312B (en) * 2019-09-30 2021-12-24 联想(北京)有限公司 Electronic device and energy transmission system

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103457458A (en) * 2012-05-28 2013-12-18 华为终端有限公司 Current switching control device and electronic device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007272341A (en) * 2006-03-30 2007-10-18 Toshiba Corp Arithmetic device, arithmetic device system, and power control method

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103457458A (en) * 2012-05-28 2013-12-18 华为终端有限公司 Current switching control device and electronic device

Also Published As

Publication number Publication date
CN104967174A (en) 2015-10-07

Similar Documents

Publication Publication Date Title
CN104318741B (en) Bluetooth equipment control method and device
CN104362703B (en) Wireless charging method and device
CN105373464A (en) Charging warning method and device of wearable equipment
CN104077208A (en) Application program icon display method and apparatus
CN104219388A (en) Voice control method and device
CN105098888A (en) Charging method and device
CN104598093A (en) Method and device for prompting message during screen locking
CN108038034A (en) Electronic equipment adjustment method, adapter, device and storage medium
CN104967174B (en) Charge control method and device
CN105204804A (en) Mode switching method, device and system
CN105098273A (en) Charging method and device
CN105117033A (en) Connection method and device of external equipment
CN106792448A (en) Bluetooth connecting method and device, system
CN106067571A (en) Method and electronic equipment for battery charging
CN105160320A (en) Fingerprint identification method and apparatus, and mobile terminal
CN104935729B (en) Audio-frequency inputting method and device
CN105068848A (en) System upgrading method and apparatus
CN105630655B (en) A kind of method and apparatus of prompt charging connection
CN107703348A (en) The detection method and device of smart jack
CN104577235B (en) For the method for portable set charging, the method, apparatus and system of control charging
CN107329520B (en) USB interface connection method, device and system of mobile terminal
CN105975038A (en) Prompt method and device of charging port detection result
CN104463047A (en) Device and method for control modules to work
CN106026232A (en) Detecting method and apparatus for USB port type
CN106774802A (en) The reminding method of terminal power, device and terminal

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant