CN104362687A - Bidirectional power balance method and device based on USB-OTG - Google Patents

Bidirectional power balance method and device based on USB-OTG Download PDF

Info

Publication number
CN104362687A
CN104362687A CN201410576624.8A CN201410576624A CN104362687A CN 104362687 A CN104362687 A CN 104362687A CN 201410576624 A CN201410576624 A CN 201410576624A CN 104362687 A CN104362687 A CN 104362687A
Authority
CN
China
Prior art keywords
equipment
usb
unit
electric quantity
battery
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.)
Granted
Application number
CN201410576624.8A
Other languages
Chinese (zh)
Other versions
CN104362687B (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.)
Yinjie Nico Fujian Technology Co ltd
Original Assignee
Fujian Landi Commercial Equipment Co Ltd
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 Fujian Landi Commercial Equipment Co Ltd filed Critical Fujian Landi Commercial Equipment Co Ltd
Priority to CN201410576624.8A priority Critical patent/CN104362687B/en
Publication of CN104362687A publication Critical patent/CN104362687A/en
Application granted granted Critical
Publication of CN104362687B publication Critical patent/CN104362687B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0013Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries acting upon several batteries simultaneously or sequentially
    • H02J7/0014Circuits for equalisation of charge between batteries
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J2207/00Indexing scheme relating to details of circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J2207/40Indexing scheme relating to details of circuit arrangements for charging or depolarising batteries or for supplying loads from batteries adapted for charging from various sources, e.g. AC, DC or multivoltage
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0047Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits
    • H02J7/0048Detection of remaining charge capacity or state of charge [SOC]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B40/00Technologies aiming at improving the efficiency of home appliances, e.g. induction cooking or efficient technologies for refrigerators, freezers or dish washers

Landscapes

  • Engineering & Computer Science (AREA)
  • Power Engineering (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)

Abstract

The invention relates to the field of power detection, in particular to a bidirectional power balance method and device based on USB-OTG. According to the key design, the method includes judging whether ID pins of USB-OTG interfaces of first equipment or second equipment are grounded or not; judging the master-slave relationship between the first equipment and the second equipment, reading the power information of the slave one from the master one, judging whether the charging is performed or not by comparing the power information of the slave one with that of the master one, if the residual standby time is larger than a threshold, charging the slave one through the master one, and allowing the equipment to acquire power information mutually and execute mutual charging. By the aid of the method, the equipment power can be complemented mutually, balance is maintained, and the maximum standby time is guaranteed since the system utilizes the batteries of the equipment completely.

Description

A kind of method based on the bidirectional balanced electricity of USB-OTG and device
Technical field
The present invention relates to electric power detection field, particularly relate to a kind of method based on the bidirectional balanced electricity of USB-OTG and device.
Background technology
Along with popularizing of smart mobile phone, various smart mobile phone corollary equipment is more and more general, the functions such as these equipment and mobile phone supporting formation system complete as paid, Data Enter; If but in two equipment, had a device battery electricity to exhaust, then whole system could use.
Recent existing portioned product applies two equipment and mutually charges, but need the information about power being carried out acquisition two equipment by third party device, control two equipment according to information about power mutually to charge, if time third party device is non-existent, two equipment just cannot charge mutually, therefore there is limitation.
The equipment such as the smart mobile phone of the existing overwhelming majority all have USB-OTG interface, and described USB-OTG interface has VBUS, GND, D+, D-and ID five pins.
Summary of the invention
Technical problem to be solved by this invention is: provide a kind of method based on the bidirectional balanced electricity of USB-OTG and device, realizes two equipment and mutually can obtain the other side's information about power and perform charging mutually.
In order to solve the problems of the technologies described above, the technical solution used in the present invention is:
Based on a method for the bidirectional balanced electricity of USB-OTG, comprising:
S101, identify the ID pin whether ground connection of the USB-OTG interface of the first equipment, described first equipment is provided with the first battery, if recognize the ID pin ground connection of the first equipment, then enters step S102;
If the ID pin ground connection of the unidentified USB-OTG interface to the first equipment, then identify the ID pin whether ground connection of the USB-OTG interface of the second equipment, described second equipment is provided with the second battery, if recognize the ID pin ground connection of the second equipment, then enters step S103;
If the unidentified ID pin ground connection to the second equipment, then enter step S104;
S102, when recognizing the ID pin ground connection of the first equipment, described second equipment reads the first battery electric quantity of described first equipment, the first residue stand-by time of the first equipment is calculated according to gained first battery meter, described second equipment reads the second battery electric quantity, the second residue stand-by time is calculated according to gained second battery meter, described second residue stand-by time and described first is remained stand-by time compare, if residue stand-by time difference is greater than pre-set threshold value, then calculate the first charging duration according to gained first battery electric quantity and the second battery meter, second equipment charges duration to the first equipment charge according to described first, if residue stand-by time difference is less than or equal to pre-set threshold value, then enter step S104,
S103, when recognizing the ID pin ground connection of the second equipment, described first equipment reads the second battery electric quantity of described second equipment, the second residue stand-by time of the second equipment is calculated according to gained second battery meter, described first equipment reads the first battery electric quantity, the first residue stand-by time is calculated according to gained first battery meter, described first residue stand-by time and described second is remained stand-by time compare, if residue stand-by time difference is greater than pre-set threshold value, then calculate the second charging duration according to gained second battery electric quantity and the first battery meter, first equipment charges duration to the second equipment charge according to described second, if residue stand-by time difference is less than or equal to pre-set threshold value, then enter step S104,
S104, end current process.
Another technical scheme that the present invention adopts is:
Based on a device for the bidirectional balanced electricity of USB-OTG, comprising: identification module, the first processing module, the second processing module and end module;
Described identification module comprises the first recognition unit and the second recognition unit;
Described first recognition unit, for identifying the ID pin whether ground connection of described first equipment;
Described second recognition unit, for identifying the ID pin whether ground connection of described second equipment;
Described first processing module comprises the first reading unit, the first computing unit, the first comparing unit and the first charhing unit;
Described first reading unit, reads the first battery electric quantity of the second battery electric quantity and the first equipment for the second equipment;
Described first computing unit, for calculating the first residue stand-by time of the first equipment and calculating the second residue stand-by time of the second equipment according to the first reading unit gained second battery meter according to the first reading unit gained first battery meter;
Described first comparing unit, compares for second of described first computing unit gained the residue stand-by time and first is remained stand-by time;
Described first charhing unit, if be greater than pre-set threshold value for residue stand-by time difference, then calculate the first charging duration according to gained first battery electric quantity and the second battery meter, the second equipment charges duration to the first equipment charge according to described first;
Described second processing module comprises the second reading unit, the second computing unit, the second comparing unit and the second charhing unit;
Described second reading unit, reads the second battery electric quantity of the first battery electric quantity and the second equipment for the first equipment;
Described second computing unit, for calculating the second residue stand-by time of the second equipment and calculating the first residue stand-by time of the first equipment according to the second reading unit gained first battery meter according to the second reading unit gained second battery meter;
Described second comparing unit, compares for first of described second computing unit gained the residue stand-by time and second is remained stand-by time;
Described second charhing unit, if be greater than pre-set threshold value for residue stand-by time difference, then calculate the second charging duration according to gained second battery electric quantity and the first battery meter, the first equipment charges duration to the second equipment charge according to described second;
Described end module, for terminating current process.
Beneficial effect of the present invention is: by identifying the ID pin whether ground connection of the USB-OTG interface of the first equipment or the second equipment, judge the master slave relation of the first equipment and the second equipment, if the ID pin ground connection of the first equipment, then the second equipment is main, first equipment be from, described second equipment is to the first equipment charge, if the ID pin ground connection of the second equipment, then the first equipment is main, second equipment be from, described first equipment is to the second equipment charge, by be read as main equipment from the information about power of equipment, judge whether to charge with for main equipment information about power compares, if residue stand-by time difference is greater than pre-set threshold value, then by for main equipment to for from equipment charge, realize two equipment mutually to obtain the other side's information about power and perform charging mutually.The electricity being realized two equipment by the present invention is complementary, and keeps balance, ensures that whole system makes full use of battery on two equipment to realize maximum stand-by time.
Accompanying drawing explanation
Fig. 1 is the flow chart of the method based on the bidirectional balanced electricity of USB-OTG of the specific embodiment of the invention;
Fig. 2 is the structural representation of the device based on the bidirectional balanced electricity of USB-OTG of the specific embodiment of the invention;
Fig. 3 is the schematic diagram of the embodiment one of the specific embodiment of the invention;
Fig. 4 is the schematic diagram of the embodiment two of the specific embodiment of the invention;
Label declaration:
1, identification module; 11, the first recognition unit; 12, the second recognition unit; 2, the first processing module; 21, the first reading unit; 22, the first computing unit; 23, the first comparing unit; 24, the first charhing unit; 3, the second processing module; 31, the second reading unit; 32, the second computing unit; 33, the second comparing unit; 34, the second charhing unit; 4, module is terminated.
Embodiment
By describing technology contents of the present invention in detail, realized object and effect, accompanying drawing is coordinated to be explained below in conjunction with execution mode.
The design of most critical of the present invention is: by identifying the ID pin whether ground connection of the USB-OTG interface of the first equipment or the second equipment, judge the master slave relation of the first equipment and the second equipment, compare according to the information about power of the first equipment and the second equipment and judge whether to charge, if, by for main equipment to for from equipment charge, realize two equipment and mutually can obtain the other side's information about power and perform and mutually charge.
Please refer to Fig. 1, is the flow chart of the method based on the bidirectional balanced electricity of USB-OTG in the specific embodiment of the invention, specific as follows:
Based on a method for the bidirectional balanced electricity of USB-OTG, comprising:
S101, identify the ID pin whether ground connection of the USB-OTG interface of the first equipment, described first equipment is provided with the first battery, if recognize the ID pin ground connection of the first equipment, then enters step S102;
If the ID pin ground connection of the unidentified USB-OTG interface to the first equipment, then identify the ID pin whether ground connection of the USB-OTG interface of the second equipment, described second equipment is provided with the second battery, if recognize the ID pin ground connection of the second equipment, then enters step S103;
If the unidentified ID pin ground connection to the second equipment, then enter step S104;
S102, when recognizing the ID pin ground connection of the first equipment, described second equipment reads the first battery electric quantity of described first equipment, the first residue stand-by time of the first equipment is calculated according to gained first battery meter, described second equipment reads the second battery electric quantity, the second residue stand-by time is calculated according to gained second battery meter, described second residue stand-by time and described first is remained stand-by time compare, if residue stand-by time difference is greater than pre-set threshold value, then calculate the first charging duration according to gained first battery electric quantity and the second battery meter, second equipment charges duration to the first equipment charge according to described first, if residue stand-by time difference is less than or equal to pre-set threshold value, then enter step S104,
S103, when recognizing the ID pin ground connection of the second equipment, described first equipment reads the second battery electric quantity of described second equipment, the second residue stand-by time of the second equipment is calculated according to gained second battery meter, described first equipment reads the first battery electric quantity, the first residue stand-by time is calculated according to gained first battery meter, described first residue stand-by time and described second is remained stand-by time compare, if residue stand-by time difference is greater than pre-set threshold value, then calculate the second charging duration according to gained second battery electric quantity and the first battery meter, first equipment charges duration to the second equipment charge according to described second, if residue stand-by time difference is less than or equal to pre-set threshold value, then enter step S104,
S104, end current process.
From foregoing description, beneficial effect of the present invention is: by identifying the ID pin whether ground connection of the USB-OTG interface of the first equipment or the second equipment, judge the master slave relation of the first equipment and the second equipment, if the ID pin ground connection of the first equipment, then the second equipment is main, first equipment be from, described second equipment is to the first equipment charge, if the ID pin ground connection of the second equipment, then the first equipment is main, second equipment be from, described first equipment is to the second equipment charge, by be read as main equipment from the information about power of equipment, judge whether to charge with for main equipment information about power compares, if residue stand-by time difference is greater than pre-set threshold value, then by for main equipment to for from equipment charge, realize two equipment mutually to obtain the other side's information about power and perform charging mutually.The electricity being realized two equipment by the present invention is complementary, and keeps balance, ensures that whole system makes full use of battery on two equipment to realize maximum stand-by time.
Further, described step S102 also comprises: be connected with power electric by pull-up resistor by D+ or the D-pin of the first equipment with the USB-OTG interface of the second equipment.
Seen from the above description, D+ or the D-pin of the USB-OTG interface of the first equipment and the second equipment electrically connects as the prerequisite of identification id pin by pull-up resistor and power supply.
Further, " calculate the first charging duration " in described step S103 to be specially: the first battery electric quantity the second battery electric quantity of described second equipment being deducted described first equipment, second equipment that electricity difference is multiplied by, to unit capacity charging interval coefficient during the first equipment charge, obtains the first charging duration of the second equipment to the first equipment;
" calculate the second charging duration " in described step S104 to be specially: the second battery electric quantity the first battery electric quantity of described first equipment being deducted described second equipment, first equipment that electricity difference is multiplied by, to unit capacity charging interval coefficient during the second equipment charge, obtains the second charging duration of the first equipment to the second equipment.
Seen from the above description, according to calculating first charge duration or second charging duration obtain charging duration, according to charging duration charge, two equipment can be made to reach the electricity of balance.
Further, in described step S102, " described first equipment reads the second battery electric quantity of described second equipment " is read by USB interface; In described step S103, " described second equipment reads the first battery electric quantity of described first equipment " is read by USB interface.
Seen from the above description, the battery electric quantity obtaining another equipment is read by USB interface, and current most smart mobile phone all possesses USB interface, has generality, is convenient to application.
Further, described step S104 also comprises and returns S101 step, is specially: after waiting for the interval duration of 5 minutes, return step S101.Wait for that interval duration is to calibrate the dump energy ratio of two equipment, reducing the electric quantity loss that unnecessary charging causes.Wait for that the installation warrants of interval duration is that the electricity of initial judgement two equipment room is poor, interval duration balances the charging interval needed for electricity difference, interval duration=electricity difference (mAh unit)/charging current (mA unit)/2* charge efficiency.(except 2 is because an equipment electricity increase, an equipment electricity reduce).
Referring to Fig. 2, is the structural representation of the device based on the bidirectional balanced electricity of USB-OTG in the specific embodiment of the invention, specific as follows:
Based on a device for the bidirectional balanced electricity of USB-OTG, comprising: identification module 1, first processing module 2, second processing module 3 and end module 4;
Described identification module 1 comprises the first recognition unit 11 and the second recognition unit 12;
Described first recognition unit 11, for identifying the ID pin whether ground connection of described first equipment;
Described second recognition unit 12, for identifying the ID pin whether ground connection of described second equipment;
Described first processing module 2 comprises the first reading unit 21, first computing unit 22, first comparing unit 23 and the first charhing unit 24;
Described first reading unit 21, reads the first battery electric quantity of the second battery electric quantity and the first equipment for the second equipment;
Described first computing unit 22, for calculating the first residue stand-by time of the first equipment and calculating the second residue stand-by time of the second equipment according to the first reading unit 21 gained second battery meter according to the first reading unit 21 gained first battery meter;
Described first comparing unit 23, compares for second of described first computing unit 22 gained the residue stand-by time and first is remained stand-by time;
Described first charhing unit 24, if be greater than pre-set threshold value for residue stand-by time difference, then calculate the first charging duration according to gained first battery electric quantity and the second battery meter, the second equipment charges duration to the first equipment charge according to described first;
Described second processing module 3 comprises the second reading unit 31, second computing unit 32, second comparing unit 33 and the second charhing unit 34;
Described second reading unit 31, reads the second battery electric quantity of the first battery electric quantity and the second equipment for the first equipment;
Described second computing unit 32, for calculating the second residue stand-by time of the second equipment and calculating the first residue stand-by time of the first equipment according to the second reading unit 31 gained first battery meter according to the second reading unit 31 gained second battery meter;
Described second comparing unit 33, compares for first of described second computing unit 32 gained the residue stand-by time and second is remained stand-by time;
Described second charhing unit 34, if be greater than pre-set threshold value for residue stand-by time difference, then calculate the second charging duration according to gained second battery electric quantity and the first battery meter, the first equipment charges duration to the second equipment charge according to described second;
Described end module 4, for terminating current process.
From foregoing description, beneficial effect of the present invention is: by identifying the ID pin whether ground connection of the USB-OTG interface of the first equipment or the second equipment, judge the master slave relation of the first equipment and the second equipment, if the ID pin ground connection of the first equipment, then the second equipment is main, first equipment be from, described second equipment is to the first equipment charge, if the ID pin ground connection of the second equipment, then the first equipment is main, second equipment be from, described first equipment is to the second equipment charge, by be read as main equipment from the information about power of equipment, judge whether to charge with for main equipment information about power compares, if residue stand-by time difference is greater than pre-set threshold value, then by for main equipment to for from equipment charge, realize two equipment mutually to obtain the other side's information about power and perform charging mutually.The electricity being realized two equipment by the present invention is complementary, and keeps balance, ensures that whole system makes full use of battery on two equipment to realize maximum stand-by time.
Further, described identification module 1 also comprises power subsystem, for being connected with power electric by pull-up resistor by D+ or the D-pin of the first equipment with the USB-OTG interface of the second equipment.
Seen from the above description, D+ or the D-pin of the first equipment and the second equipment electrically connects as the prerequisite of identification id pin by pull-up resistor and power supply.
Further, described first computing unit 22 also comprises the first subtracter, the first multiplier and the first parameter setting device;
Described first subtracter, for deducting the first battery electric quantity of described first equipment by the second battery electric quantity of described second equipment;
Described first multiplier, for being multiplied by the second equipment to unit capacity charging interval coefficient during the first equipment charge by electricity difference;
Described first parameter setting device, for arranging the second equipment to unit capacity charging interval coefficient during the first equipment charge;
Described second computing unit 32 also comprises the second subtracter, the second multiplier and the second parameter setting device;
Described second subtracter, for deducting the second battery electric quantity of described second equipment by the first battery electric quantity of described first equipment;
Described second multiplier, for being multiplied by the first equipment to unit capacity charging interval coefficient during the second equipment charge by electricity difference;
Described second parameter setting device, for arranging the first equipment to unit capacity charging interval coefficient during the second equipment charge.
Seen from the above description, according to calculating first charge duration or second charging duration obtain charging duration, according to charging duration charge, two equipment can be made to reach the electricity of balance.
Further, described first reading unit 21 comprises the first USB interface, for obtaining the second battery electric quantity of described second equipment; Described second reading unit 31 comprises secondary USB interface, for obtaining the first battery electric quantity of described first equipment.
Seen from the above description, the battery electric quantity obtaining another equipment is obtained by USB, and current most smart mobile phone all possesses USB interface, has generality, is convenient to application.
Further, described end module comprises wait unit and returns unit;
Described wait unit, for waiting for the interval duration of 5 minutes; Interval duration=electricity difference (mAh unit)/charging current (mA unit)/2* charge efficiency
Describedly returning unit, identifying for turning back to identification module.
Seen from the above description, wait for that certain interval duration carries out identification id pin whether ground connection again, avoid lasting identification to cause the wasting of resources, separately prove through test: the interval duration waiting for 5 minutes, can reach the highest resource utilization.
Refer to Fig. 3 to Fig. 4, by arranging the first controllable electronic switch K1 at the ID pin of the first equipment and the second equipment, according to control electronic switch, the ID pin ground connection of which equipment can be controlled, by arranging the second controllable electronic switch K2, D+ or the D-network that can control the USB of two equipment by a 1.5K pull-up resistor Electricity Federation to power supply, object be in order to can allow be in master slave relation for from equipment repeatedly enumerated, by arranging the 3rd controllable electronic switch K3, be used for controlling to be switched on or switched off the VBUS network of the first equipment and the second equipment, can Artificial Control cut off where necessary the charging of two equipment rooms with by the relation of charging.According to above three controllable electronic switches, by the charge condition of manual observation two equipment, then result hand-guided three controllable electronic switches according to the observation, realize control be by the first equipment to the second equipment charge or by the second equipment to the first equipment charge.
Further, the bidirectional switch function of the first controllable electronic switch K1 can be realized with two metal-oxide-semiconductors and not gate.
Further, under Android system, device battery electricity can be obtained by function.
Further, provided by the inventionly judge whether that the condition of carrying out charging is two equipment residue stand-by time differences and the comparing of pre-set threshold value, described in judge whether that the condition of carrying out charging can also be the cell voltage of two equipment or the battery dump energy of two equipment.
In sum, a kind of method based on the bidirectional balanced electricity of USB-OTG provided by the invention and device, by identifying the ID pin whether ground connection of the USB-OTG interface of the first equipment or the second equipment, judge the master slave relation of the first equipment and the second equipment, if the ID pin ground connection of the first equipment, then the second equipment is main, first equipment be from, described second equipment is to the first equipment charge, if the ID pin ground connection of the second equipment, then the first equipment is main, second equipment be from, described first equipment is to the second equipment charge, by be read as main equipment from the information about power of equipment, judge whether to charge with for main equipment information about power compares, if residue stand-by time difference is greater than pre-set threshold value, then by for main equipment to for from equipment charge, realize two equipment mutually to obtain the other side's information about power and perform charging mutually.The electricity being realized two equipment by the present invention is complementary, and keeps balance, ensures that whole system makes full use of battery on two equipment to realize maximum stand-by time.D+ or the D-pin of the first equipment and the second equipment is the prerequisite of identification id pin by pull-up resistor Electricity Federation power supply.According to calculating first charge duration or second charging duration obtain charging duration, according to charging duration charge, two equipment can be made to reach the electricity of balance.The battery electric quantity obtaining another equipment is obtained by USB, and current most smart mobile phone all possesses USB interface, has generality, is convenient to application.
The foregoing is only embodiments of the invention; not thereby the scope of the claims of the present invention is limited; every equivalents utilizing specification of the present invention and accompanying drawing content to do, or be directly or indirectly used in relevant technical field, be all in like manner included in scope of patent protection of the present invention.

Claims (10)

1. based on a method for the bidirectional balanced electricity of USB-OTG, it is characterized in that, comprising:
S101, identify the ID pin whether ground connection of the USB-OTG interface of the first equipment, described first equipment is provided with the first battery, if recognize the ID pin ground connection of the first equipment, then enters step S102;
If the ID pin ground connection of the unidentified USB-OTG interface to the first equipment, then identify the ID pin whether ground connection of the USB-OTG interface of the second equipment, described second equipment is provided with the second battery, if recognize the ID pin ground connection of the second equipment, then enters step S103;
If the unidentified ID pin ground connection to the second equipment, then enter step S104;
S102, when recognizing the ID pin ground connection of the first equipment, described second equipment reads the first battery electric quantity of described first equipment, the first residue stand-by time of the first equipment is calculated according to gained first battery meter, described second equipment reads the second battery electric quantity, the second residue stand-by time is calculated according to gained second battery meter, described second residue stand-by time and described first is remained stand-by time compare, if residue stand-by time difference is greater than pre-set threshold value, then calculate the first charging duration according to gained first battery electric quantity and the second battery meter, second equipment charges duration to the first equipment charge according to described first, if residue stand-by time difference is less than or equal to pre-set threshold value, then enter step S104,
S103, when recognizing the ID pin ground connection of the second equipment, described first equipment reads the second battery electric quantity of described second equipment, the second residue stand-by time of the second equipment is calculated according to gained second battery meter, described first equipment reads the first battery electric quantity, the first residue stand-by time is calculated according to gained first battery meter, described first residue stand-by time and described second is remained stand-by time compare, if residue stand-by time difference is greater than pre-set threshold value, then calculate the second charging duration according to gained second battery electric quantity and the first battery meter, first equipment charges duration to the second equipment charge according to described second, if residue stand-by time difference is less than or equal to pre-set threshold value, then enter step S104,
S104, end current process.
2. the method based on the bidirectional balanced electricity of USB-OTG according to claim 1, is characterized in that, described step S101 also comprises: be connected with power electric by pull-up resistor by D+ or the D-pin of the first equipment with the USB-OTG interface of the second equipment.
3. the method based on the bidirectional balanced electricity of USB-OTG according to claim 1, it is characterized in that, " calculate the first charging duration " in described step S102 to be specially: the first battery electric quantity the second battery electric quantity of described second equipment being deducted described first equipment, second equipment that electricity difference is multiplied by, to unit capacity charging interval coefficient during the first equipment charge, obtains the first charging duration of the second equipment to the first equipment;
" calculate the second charging duration " in described step S103 to be specially: the second battery electric quantity the first battery electric quantity of described first equipment being deducted described second equipment, first equipment that electricity difference is multiplied by, to unit capacity charging interval coefficient during the second equipment charge, obtains the second charging duration of the first equipment to the second equipment.
4. the method based on the bidirectional balanced electricity of USB-OTG according to claim 1, is characterized in that, in described step S102, " described first equipment reads the second battery electric quantity of described second equipment " is read by USB interface; In described step S103, " described second equipment reads the first battery electric quantity of described first equipment " is read by USB interface.
5. the method based on the bidirectional balanced electricity of USB-OTG according to claim 1, is characterized in that, described step S104 also comprises and returns S101 step, is specially: after waiting for the interval duration of 5 minutes, return step S101.
6. based on a device for the bidirectional balanced electricity of USB-OTG, it is characterized in that, comprising: identification module, the first processing module, the second processing module and end module;
Described identification module comprises the first recognition unit and the second recognition unit;
Described first recognition unit, for identifying the ID pin whether ground connection of the USB-OTG interface of described first equipment;
Described second recognition unit, for identifying the ID pin whether ground connection of the USB-OTG interface of described second equipment;
Described first processing module comprises the first reading unit, the first computing unit, the first comparing unit and the first charhing unit;
Described first reading unit, reads the first battery electric quantity of the second battery electric quantity and the first equipment for the second equipment;
Described first computing unit, for calculating the first residue stand-by time of the first equipment and calculating the second residue stand-by time of the second equipment according to the first reading unit gained second battery meter according to the first reading unit gained first battery meter;
Described first comparing unit, compares for second of described first computing unit gained the residue stand-by time and first is remained stand-by time;
Described first charhing unit, if be greater than pre-set threshold value for residue stand-by time difference, then calculate the first charging duration according to gained first battery electric quantity and the second battery meter, the second equipment charges duration to the first equipment charge according to described first;
Described second processing module comprises the second reading unit, the second computing unit, the second comparing unit and the second charhing unit;
Described second reading unit, reads the second battery electric quantity of the first battery electric quantity and the second equipment for the first equipment;
Described second computing unit, for calculating the second residue stand-by time of the second equipment and calculating the first residue stand-by time of the first equipment according to the second reading unit gained first battery meter according to the second reading unit gained second battery meter;
Described second comparing unit, compares for first of described second computing unit gained the residue stand-by time and second is remained stand-by time;
Described second charhing unit, if be greater than pre-set threshold value for residue stand-by time difference, then calculate the second charging duration according to gained second battery electric quantity and the first battery meter, the first equipment charges duration to the second equipment charge according to described second;
Described end module, for terminating current process.
7. the device based on the bidirectional balanced electricity of USB-OTG according to claim 6, it is characterized in that, described identification module also comprises power subsystem, for being connected with power electric by pull-up resistor by D+ or the D-pin of the first equipment with the USB-OTG interface of the second equipment.
8. the device based on the bidirectional balanced electricity of USB-OTG according to claim 6, is characterized in that, described first computing unit also comprises the first subtracter, the first multiplier and the first parameter setting device;
Described first subtracter, for deducting the first battery electric quantity of described first equipment by the second battery electric quantity of described second equipment;
Described first multiplier, for being multiplied by the second equipment to unit capacity charging interval coefficient during the first equipment charge by electricity difference;
Described first parameter setting device, for arranging the second equipment to unit capacity charging interval coefficient during the first equipment charge;
Described second computing unit also comprises the second subtracter, the second multiplier and the second parameter setting device;
Described second subtracter, for deducting the second battery electric quantity of described second equipment by the first battery electric quantity of described first equipment;
Described second multiplier, for being multiplied by the first equipment to unit capacity charging interval coefficient during the second equipment charge by electricity difference;
Described second parameter setting device, for arranging the first equipment to unit capacity charging interval coefficient during the second equipment charge.
9. the device based on the bidirectional balanced electricity of USB-OTG according to claim 6, is characterized in that, described first reading unit comprises the first USB interface, for obtaining the second battery electric quantity of described second equipment; Described second reading unit comprises secondary USB interface, for obtaining the first battery electric quantity of described first equipment.
10. the device based on the bidirectional balanced electricity of USB-OTG according to claim 6, is characterized in that, described end module comprises to be waited for unit and returns unit;
Described wait unit, for waiting for the interval duration of 5 minutes;
Describedly returning unit, identifying for turning back to identification module.
CN201410576624.8A 2014-10-24 2014-10-24 Bidirectional power balance method and device based on USB-OTG Active CN104362687B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410576624.8A CN104362687B (en) 2014-10-24 2014-10-24 Bidirectional power balance method and device based on USB-OTG

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410576624.8A CN104362687B (en) 2014-10-24 2014-10-24 Bidirectional power balance method and device based on USB-OTG

Publications (2)

Publication Number Publication Date
CN104362687A true CN104362687A (en) 2015-02-18
CN104362687B CN104362687B (en) 2017-01-25

Family

ID=52529925

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410576624.8A Active CN104362687B (en) 2014-10-24 2014-10-24 Bidirectional power balance method and device based on USB-OTG

Country Status (1)

Country Link
CN (1) CN104362687B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104953678A (en) * 2015-07-20 2015-09-30 广东欧珀移动通信有限公司 Control method and system for mutual charging of mobile terminals
CN107276180A (en) * 2017-08-04 2017-10-20 上海青橙实业有限公司 Charge control method, equipment, system and user equipment
CN108023376A (en) * 2017-11-08 2018-05-11 卓尔悦欧洲控股有限公司 Charging wire, charging assembly, charging method and device
CN108199430A (en) * 2017-12-31 2018-06-22 深圳市秦墨科技有限公司 A kind of charge control method and its device, hand-held holder
CN108616148A (en) * 2016-12-09 2018-10-02 手持产品公司 Intelligent battery balance system and method
CN108683236A (en) * 2018-06-27 2018-10-19 河南省航丰智能科技有限公司 A kind of mobile terminal OTG charging methods and device
CN108808798A (en) * 2018-07-10 2018-11-13 中国联合网络通信集团有限公司 The method and apparatus of reverse charging
CN111030226A (en) * 2019-12-20 2020-04-17 维沃移动通信有限公司 Equipment detection method and electronic equipment
CN112345013A (en) * 2020-10-29 2021-02-09 怀化智信能源科技有限公司 Water meter electric quantity management method, device and system and storage medium
CN112467834A (en) * 2020-11-19 2021-03-09 珠海格力电器股份有限公司 Electric quantity control method and scanning device
CN116707048A (en) * 2022-09-06 2023-09-05 荣耀终端有限公司 OTG-based charging control method and related device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006099354A (en) * 2004-09-29 2006-04-13 Matsushita Electric Ind Co Ltd Data transfer control device and data transfer control method
CN203387203U (en) * 2013-05-09 2014-01-08 上海斐讯数据通信技术有限公司 Charging switching system possessing USB on-the-go (OTG) function
CN103812150A (en) * 2012-11-08 2014-05-21 国家电网公司 Cell equalization method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006099354A (en) * 2004-09-29 2006-04-13 Matsushita Electric Ind Co Ltd Data transfer control device and data transfer control method
CN103812150A (en) * 2012-11-08 2014-05-21 国家电网公司 Cell equalization method and device
CN203387203U (en) * 2013-05-09 2014-01-08 上海斐讯数据通信技术有限公司 Charging switching system possessing USB on-the-go (OTG) function

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104953678B (en) * 2015-07-20 2018-01-16 广东欧珀移动通信有限公司 A kind of control method and system mutually to be charged for mobile terminal
CN104953678A (en) * 2015-07-20 2015-09-30 广东欧珀移动通信有限公司 Control method and system for mutual charging of mobile terminals
CN108616148A (en) * 2016-12-09 2018-10-02 手持产品公司 Intelligent battery balance system and method
CN107276180A (en) * 2017-08-04 2017-10-20 上海青橙实业有限公司 Charge control method, equipment, system and user equipment
CN107276180B (en) * 2017-08-04 2020-09-29 上海青橙实业有限公司 Charging control method, device and system and user equipment
CN108023376A (en) * 2017-11-08 2018-05-11 卓尔悦欧洲控股有限公司 Charging wire, charging assembly, charging method and device
CN108023376B (en) * 2017-11-08 2021-10-22 卓尔悦欧洲控股有限公司 Charging wire, charging assembly, charging method and device
CN108199430A (en) * 2017-12-31 2018-06-22 深圳市秦墨科技有限公司 A kind of charge control method and its device, hand-held holder
CN108683236A (en) * 2018-06-27 2018-10-19 河南省航丰智能科技有限公司 A kind of mobile terminal OTG charging methods and device
CN108808798A (en) * 2018-07-10 2018-11-13 中国联合网络通信集团有限公司 The method and apparatus of reverse charging
CN111030226A (en) * 2019-12-20 2020-04-17 维沃移动通信有限公司 Equipment detection method and electronic equipment
CN112345013A (en) * 2020-10-29 2021-02-09 怀化智信能源科技有限公司 Water meter electric quantity management method, device and system and storage medium
CN112467834A (en) * 2020-11-19 2021-03-09 珠海格力电器股份有限公司 Electric quantity control method and scanning device
CN116707048A (en) * 2022-09-06 2023-09-05 荣耀终端有限公司 OTG-based charging control method and related device

Also Published As

Publication number Publication date
CN104362687B (en) 2017-01-25

Similar Documents

Publication Publication Date Title
CN104362687A (en) Bidirectional power balance method and device based on USB-OTG
CN203387203U (en) Charging switching system possessing USB on-the-go (OTG) function
CN102820682B (en) A kind of communicated by USB interface and be external equipment charging device and method
US9483093B2 (en) Electronic device and method for controlling a setting of a maximum consumption current
CN103166289B (en) A kind of mobile terminal and detection method detecting cell voltage when charging
CN107332208B (en) A kind of protection circuit, mainboard guard method and terminal
CN204883583U (en) A reverse big electricity charging system for intelligent terminal
CN102868820A (en) Mobile terminal, primary data communication device and mobile terminal charging system and method
CN104538996B (en) Mobile terminal and its matching and recognition method with charging unit
KR20160030261A (en) Apparatus and method to change current limit
CN105068959A (en) Terminal and charging method and apparatus for terminal with data exchange function
CN105071484B (en) A kind of charging method and device of the terminal with data exchanging function
CN102593930A (en) Charging system of mobile terminal
CN105762883B (en) Method and electronic equipment for charging for electronic equipment
CN106340780A (en) Terminal device and control method thereof
CN105048018B (en) The charging method and device of a kind of terminal with data exchanging function
CN204761115U (en) Multifunctional mobile power supply
CN102263423B (en) Universal serial bus charging system and charging method thereof
CN105826962A (en) Power control method and device in charging process
CN106502558A (en) Terminal device and its method of operating and operation device
CN203883502U (en) Power source adapter enabling quick charging
CN205863955U (en) A kind of USB fast charging device of main frame front interface
CN104682518A (en) Device and method for charging over-discharged smart lithium batteries
CN202474946U (en) Multi-path power supply
CN203014439U (en) Automatic identification apparatus of charger

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20221103

Address after: Floor 3-4, Building 3A, Area A, Fuzhou Software Park, No. 89, Software Avenue, Gulou District, Fuzhou City, Fujian Province 350003

Patentee after: Fujian Liandi Commercial Technology Co.,Ltd.

Address before: Building 23, Zone 1, Fuzhou Software Park, No. 89, Software Avenue, Fuzhou, Fujian 350003

Patentee before: FUJIAN LANDI COMMERCIAL EQUIPMENT Co.,Ltd.

TR01 Transfer of patent right
CP01 Change in the name or title of a patent holder

Address after: Floor 3-4, Building 3A, Area A, Fuzhou Software Park, No. 89, Software Avenue, Gulou District, Fuzhou City, Fujian Province 350003

Patentee after: Yinjie Nico (Fujian) Technology Co.,Ltd.

Address before: Floor 3-4, Building 3A, Area A, Fuzhou Software Park, No. 89, Software Avenue, Gulou District, Fuzhou City, Fujian Province 350003

Patentee before: Fujian Liandi Commercial Technology Co.,Ltd.

CP01 Change in the name or title of a patent holder