[go: up one dir, main page]

CN106299515B - Charging method and device - Google Patents

Charging method and device Download PDF

Info

Publication number
CN106299515B
CN106299515B CN201610827192.2A CN201610827192A CN106299515B CN 106299515 B CN106299515 B CN 106299515B CN 201610827192 A CN201610827192 A CN 201610827192A CN 106299515 B CN106299515 B CN 106299515B
Authority
CN
China
Prior art keywords
terminal
power supply
remaining capacity
role exchange
capacity information
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
CN201610827192.2A
Other languages
Chinese (zh)
Other versions
CN106299515A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610827192.2A priority Critical patent/CN106299515B/en
Publication of CN106299515A publication Critical patent/CN106299515A/en
Application granted granted Critical
Publication of CN106299515B publication Critical patent/CN106299515B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/44Methods for charging or discharging
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/44Methods for charging or discharging
    • H01M10/441Methods for charging or discharging for several batteries or cells simultaneously or sequentially
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • H01M10/46Accumulators structurally combined with charging apparatus
    • 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
    • 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
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

  • Engineering & Computer Science (AREA)
  • Manufacturing & Machinery (AREA)
  • Chemical & Material Sciences (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Electrochemistry (AREA)
  • General Chemical & Material Sciences (AREA)
  • Power Engineering (AREA)
  • Charge And Discharge Circuits For Batteries Or The Like (AREA)
  • Telephone Function (AREA)

Abstract

The disclosure is directed to a kind of charging method and devices.Method includes: to acquire the remaining capacity information of first terminal;Obtain the remaining capacity information for the second terminal being connected with the first terminal;When determining that the first terminal and the second terminal meet preset power supply role exchange condition according to the remaining capacity information of the master slave mode information of the first terminal, the remaining capacity information of the first terminal and the second terminal, change the power supply direction between the first terminal and the second terminal.Thus, it is possible to the problem of avoiding the terminal that remaining capacity is low in the related technology from powering to the high terminal of remaining capacity, cause itself that can not continue data interaction because of electricity shortage.In addition, the charging method haves no need to change the master slave mode of two terminals, the change in power supply direction can be realized, because without impacting to data interaction.

Description

Charging method and device
Technical field
This disclosure relates to field of terminal more particularly to a kind of charging method and device.
Background technique
With the appearance of Type C interface, more and more terminal devices start using the interface.Terminal device with its When the interaction of his terminal device, which can be at three kinds of different modes, it may be assumed that main equipment mode (DFP mode), from equipment Mode (UFP mode) and master-slave equipment mode (DRP mode).When two terminal devices establish connection by Type C interface, The two be in master slave mode probability be it is equal, i.e., it can be used as main equipment, can also be used as from equipment.When two terminals When equipment establishes connection by Type C interface, always main equipment is powered to from equipment, at this point, if the electricity of main equipment not Foot, then will affect data interaction.In addition, in the related art, changing the power supply direction between two terminal devices and needing to pass through Change the master slave mode of two terminal devices to realize.
Summary of the invention
To overcome the problems in correlation technique, the disclosure provides a kind of charging method and device.
According to the first aspect of the embodiments of the present disclosure, a kind of charging method is provided, which comprises
Acquire the remaining capacity information of the first terminal;
Obtain the remaining capacity information for the second terminal being connected with the first terminal;
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and described second When the remaining capacity information of terminal determines that the first terminal and the second terminal meet preset power supply role exchange condition, Change the power supply direction between the first terminal and the second terminal.
Optionally, the first terminal is connected with the second terminal by Type C interface;And
The remaining capacity information for obtaining the second terminal being connected with the first terminal, comprising:
The remaining capacity information for the second terminal being connected with the first terminal is obtained by the Type C interface.
Optionally, when the master slave mode information indicates that the first terminal is in main equipment mode, and described first When the remaining capacity of terminal is less than the remaining capacity of the second terminal, determine that the first terminal and the second terminal meet The power supply role exchange condition;
When the master slave mode information indicates that the first terminal is in from equipment mode, and the first terminal is surplus When remaining electricity is greater than the remaining capacity of the second terminal, determine that the first terminal and the second terminal meet the power supply Role exchange condition.
Optionally, described to believe when according to the master slave mode information of the first terminal, the remaining capacity of the first terminal It is preset for electric angle that the remaining capacity information of breath and the second terminal determines that the first terminal and the second terminal meet When color exchanges condition, change the power supply direction between the first terminal and the second terminal, comprising:
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and described second When the remaining capacity information of terminal determines that the first terminal and the second terminal meet preset power supply role exchange condition, Power supply role exchange request is sent to the second terminal;
Receive the power supply role exchange response message that the second terminal is sent, wherein the power supply role exchange response Message is used to indicate the second terminal and receives the power supply role exchange request or refuse the power supply role exchange request;
When the power supply role exchange response message indicates that the second terminal receives power supply role exchange request, Change the power supply direction between the first terminal and the second terminal.
Optionally, the method also includes:
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and described second The remaining capacity information of terminal determines that the first terminal and the second terminal are unsatisfactory for preset power supply role exchange condition When, or when the power supply role exchange response message indicates that the second terminal refuses power supply role exchange request, protect The power supply direction held between the first terminal and the second terminal is constant.
According to the second aspect of an embodiment of the present disclosure, a kind of charging unit is provided, described device includes:
Acquisition module is configured as acquiring the remaining capacity information of the first terminal;
Module is obtained, is configured as obtaining the remaining capacity information for the second terminal being connected with the first terminal;
Power supply direction changes module, is configured as working as the master slave mode information according to the first terminal, described first eventually The remaining capacity information at end and the remaining capacity information of the second terminal determine that the first terminal and the second terminal are full When the preset power supply role exchange condition of foot, change the power supply direction between the first terminal and the second terminal.
Optionally, the first terminal is connected with the second terminal by Type C interface;And
The module that obtains is configured as obtaining the to be connected with the first terminal by the Type C interface The remaining capacity information of two terminals.
Optionally, the power supply direction changes module and is configured as indicating the first terminal when the master slave mode information In main equipment mode, and when the remaining capacity of the first terminal is less than the remaining capacity of the second terminal, institute is determined It states first terminal and the second terminal meets the power supply role exchange condition;When the master slave mode information indicates described the One terminal is in from equipment mode, and when the remaining capacity of the first terminal is greater than the remaining capacity of the second terminal, Determine that the first terminal and the second terminal meet the power supply role exchange condition.
Optionally, the power supply direction change module includes:
Sending submodule, be configured as when according to the master slave mode information of the first terminal, the first terminal it is surplus It is default that the remaining capacity information of remaining information about power and the second terminal determines that the first terminal and the second terminal meet Power supply role exchange condition when, Xiang Suoshu second terminal send power supply role exchange request;
Receiving submodule is configured as receiving the power supply role exchange response message that the second terminal is sent, wherein institute Power supply role exchange response message is stated to be used to indicate described in the second terminal receiving power supply role exchange request or refusal Role exchange of powering is requested;
Power supply direction changes submodule, is configured as indicating the second terminal when the power supply role exchange response message When receiving power supply role exchange request, change the power supply direction between the first terminal and the second terminal.
Optionally, described device further include:
Power supply direction keeps module, is configured as working as the master slave mode information according to the first terminal, described first eventually The remaining capacity information at end and the remaining capacity information of the second terminal determine the first terminal and the second terminal not When meeting preset power supply role exchange condition, or when the power supply role exchange response message indicates the second terminal refusal When the power supply role exchange is requested, keep the power supply direction between the first terminal and the second terminal constant.
According to the third aspect of an embodiment of the present disclosure, a kind of charging unit is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Acquire the remaining capacity information of first terminal;
Obtain the remaining capacity information for the second terminal being connected with the first terminal;
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and described second When the remaining capacity information of terminal determines that the first terminal and the second terminal meet preset power supply role exchange condition, Change the power supply direction between the first terminal and the second terminal.
According to a fourth aspect of embodiments of the present disclosure, a kind of non-transitorycomputer readable storage medium is provided, when described When instruction in storage medium is executed by the processor of first terminal, so that first terminal is able to carry out a kind of charging method, institute The method of stating includes:
Acquire the remaining capacity information of the first terminal;
Obtain the remaining capacity information for the second terminal being connected with the first terminal;
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and described second When the remaining capacity information of terminal determines that the first terminal and the second terminal meet preset power supply role exchange condition, Change the power supply direction between the first terminal and the second terminal.
The technical scheme provided by this disclosed embodiment can include the following benefits: by according to first terminal The remaining capacity information of master slave mode information, the remaining capacity information of first terminal and second terminal determines first terminal and second Terminal changes the power supply direction between first terminal and second terminal when meeting preset power supply role exchange condition, can be to avoid The low terminal of remaining capacity causes itself that can not continue asking for data interaction because of electricity shortage to the high terminal power supply of remaining capacity Topic.In addition, the charging method haves no need to change the master slave mode of two terminals, can realize the change in power supply direction, because without Data interaction can be impacted.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Example, and together with specification for explaining the principles of this disclosure.
Figure 1A is a kind of structural schematic diagram of implementation environment shown according to an exemplary embodiment.
Figure 1B is a kind of structural schematic diagram of the implementation environment shown according to another exemplary embodiment.
Fig. 2A is a kind of flow chart of charging method shown according to an exemplary embodiment.
Fig. 2 B is a kind of supplier of electricity changed between first terminal and second terminal shown according to an exemplary embodiment To the flow chart of process.
Fig. 2 C is a kind of flow chart of the charging method shown according to another exemplary embodiment.
Fig. 3 A is a kind of block diagram of charging unit shown according to an exemplary embodiment.
A kind of block diagram for charging unit that Fig. 3 B is shown according to another exemplary embodiment.
Fig. 4 is a kind of block diagram of charging unit shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of some aspects be described in detail in claims, the disclosure consistent device and device.
Figure 1A is a kind of structural schematic diagram of implementation environment shown according to an exemplary embodiment.The implementation environment can be with Including first terminal 110 and second terminal 120, also, first terminal 110 and second terminal 120 may belong to it is same type of Terminal, the two can be communicated by Type C interface.Wherein, first terminal 110 and first terminal 120 can be intelligent hand Machine, tablet computer, laptop etc..Illustrate in Figure 1A with first terminal 110 and second terminal 120 are smart phones.
After first terminal 110 and second terminal 120 establish communication connection, first terminal 110 and second terminal 120 Locating master slave mode also determines that.Under normal conditions, when first terminal 110 is in main equipment mode, at second terminal 120 When from equipment mode, first terminal 110 is powered to second terminal 120;When first terminal 110 is in from equipment mode, second When terminal 120 is in main equipment mode, first terminal 110 is powered by second terminal 120.
Figure 1B is a kind of structural schematic diagram of the implementation environment shown according to another exemplary embodiment.The implementation environment can To include first terminal 110 and second terminal 120, also, first terminal 110 and second terminal 120 may belong to not seed type Terminal, the two can be communicated by Type C interface.It with first terminal 110 is smart phone, second terminal in Figure 1B 120 be laptop to illustrate.
Fig. 2A is a kind of flow chart of charging method shown according to an exemplary embodiment, wherein this method can answer For first terminal, for example, terminal 110 shown in Figure 1A or Figure 1B.As shown in Figure 2 A, this method may comprise steps of:
In step 201, the remaining capacity information of first terminal is acquired.
In the disclosure, which is used to indicate the current capacities for the battery being arranged on first terminal.The One terminal can acquire the remaining capacity information of itself by built-in sensor, and the mode of acquisition can be according to scheduled Period is acquired, and is also possible to be acquired when establishing connection with second terminal.
In step 202, the remaining capacity information for the second terminal being connected with first terminal is obtained.
In one embodiment of the present disclosure, which can be connected by Type C interface with second terminal It connects, in this way, first terminal can obtain the collected remaining capacity information of second terminal by the Type C interface.The residue Information about power is used to indicate the current capacities for the battery being arranged in second terminal.Second terminal can pass through built-in sensor Carry out the acquisition of remaining capacity information.The mode that first terminal obtains the remaining capacity information of second terminal can be second terminal Periodicity sending, first terminal receive automatically.The mode that first terminal obtains the remaining capacity information of second terminal is also possible to First terminal sends remaining capacity information request to second terminal and refers to when establishing connection by Type C interface with second terminal It enables;Second terminal sends self residual after receiving the remaining capacity information request instruction that first terminal is sent, to first terminal Information about power is to respond the request;First terminal receives the remaining capacity information that second terminal is sent.
In step 203, when master slave mode information, the remaining capacity information and second of first terminal according to first terminal When the remaining capacity information of terminal determines that first terminal and second terminal meet preset power supply role exchange condition, change first Power supply direction between terminal and second terminal.
In the disclosure, master slave mode information is used to indicate the master slave mode that terminal is presently in, wherein the master slave mode It may include main equipment mode and from equipment mode.
It in one embodiment of the present disclosure, can be by comparing the remaining capacity of first terminal and the residue of second terminal The size of electricity, and the master slave mode information of first terminal is combined, to judge it is default whether first terminal and second terminal meet Power supply role exchange condition.When master slave mode information indicates that first terminal be in main equipment mode, and first terminal remains When remaining electricity is less than the remaining capacity of second terminal, it is mutual can to determine that first terminal and second terminal meet preset power supply role Change condition;When master slave mode information indicates that first terminal is in from equipment mode, and the remaining capacity of first terminal is greater than the When the remaining capacity of two terminals, it can determine that first terminal and second terminal meet preset power supply role exchange condition.
When determining that first terminal and second terminal meet preset power supply role exchange condition, change first terminal and the Power supply direction between two terminals powers in the terminal from equipment mode to the terminal in main equipment mode.
Illustratively, after first terminal and second terminal establish connection, when master slave mode information instruction first terminal is current When in main equipment mode, first terminal is powered to second terminal.When the remaining capacity of first terminal is less than the surplus of second terminal When remaining electricity, it can determine that first terminal and second terminal meet preset power supply role exchange condition.At this point, changing first eventually The power supply direction at end and second terminal, i.e. first terminal are powered by second terminal.
Illustratively, after first terminal and second terminal establish connection, when master slave mode information instruction first terminal is current When in from equipment mode, first terminal is powered by second terminal.When the remaining capacity of first terminal is greater than the surplus of second terminal When remaining electricity, it can determine that first terminal and second terminal meet preset power supply role exchange condition.At this point, changing first eventually The power supply direction at end and second terminal, i.e. first terminal power to second terminal.
The technical scheme provided by this disclosed embodiment can include the following benefits: by according to first terminal The remaining capacity information of master slave mode information, the remaining capacity information of first terminal and second terminal determines first terminal and second Terminal changes the power supply direction between first terminal and second terminal when meeting preset power supply role exchange condition, can be to avoid The low terminal of remaining capacity causes itself that can not continue asking for data interaction because of electricity shortage to the high terminal power supply of remaining capacity Topic.In addition, the charging method haves no need to change the master slave mode of two terminals, can realize the change in power supply direction, because without Data interaction can be impacted.
In one embodiment, when master slave mode information, the remaining capacity information of first terminal according to first terminal It, can when determining that first terminal and second terminal meet preset power supply role exchange condition with the remaining capacity information of second terminal To change the power supply direction between first terminal and second terminal in the following manner.As shown in Figure 2 B, above-mentioned steps 203 can To include:
In step 2031, when according to the master slave mode information of first terminal, the remaining capacity information of first terminal and When the remaining capacity information of two terminals determines that first terminal and second terminal meet preset power supply role exchange condition, to second Terminal sends power supply role exchange request.
In step 2032, the power supply role exchange response message that second terminal is sent is received, wherein power supply role is mutual Change response message be used to indicate second terminal receive power supply role exchange request or refusal power supply role exchange request.
In step 2033, when power supply role exchange response message instruction second terminal receives power supply role exchange request When, change the power supply direction between first terminal and second terminal.
Illustratively, after first terminal and second terminal establish connection, when master slave mode information instruction first terminal is current When in main equipment mode, first terminal is powered to second terminal.When the remaining capacity information of two terminals of combination determines first When terminal and second terminal meet preset power supply role exchange condition, first terminal sends power supply role exchange to second terminal Request.Second terminal sends power supply role to first terminal when receiving the power supply role exchange request from first terminal Response message is exchanged, to indicate whether it receives role exchange request of powering.When power supply role exchange response message instruction second When terminal receives power supply role exchange request, change the power supply direction between first terminal and second terminal, i.e. first terminal quilt Second terminal power supply.
Illustratively, after first terminal and second terminal establish connection, when master slave mode information instruction first terminal is current When in from equipment mode, first terminal is powered by second terminal.When the remaining capacity information of two terminals of combination determines first When terminal and second terminal meet preset power supply role exchange condition, first terminal sends power supply role exchange to second terminal Request.Second terminal sends power supply role to first terminal when receiving the power supply role exchange request from first terminal Response message is exchanged, to indicate whether it receives role exchange request of powering.When power supply role exchange response message instruction second When terminal receives power supply role exchange request, change the power supply direction between first terminal and second terminal, i.e., first terminal to Second terminal power supply.
Fig. 2 C is a kind of flow chart of the charging method shown according to another exemplary embodiment, wherein this method can be with Applied to first terminal, for example, first terminal 110 shown in Figure 1A or Figure 1B.As shown in Figure 2 C, above-mentioned charging method may be used also To include:
In step 204, when master slave mode information, the remaining capacity information and second of first terminal according to first terminal When the remaining capacity information of terminal determines that first terminal and second terminal are unsatisfactory for preset power supply role exchange condition, or works as and supply When the instruction second terminal refusal power supply role exchange request of electric role exchange response message, keep first terminal and second terminal it Between power supply direction it is constant.
In one embodiment, when master slave mode information, the remaining capacity information of first terminal according to first terminal When determining that first terminal and second terminal are unsatisfactory for preset power supply role exchange condition with the remaining capacity information of second terminal, Keep the power supply direction between first terminal and second terminal constant.
Illustratively, after first terminal and second terminal establish connection, when master slave mode information instruction first terminal is current When in main equipment mode, first terminal is powered to second terminal.When according to the master slave mode information of first terminal, first terminal Remaining capacity information and the remaining capacity information of second terminal determine that first terminal and second terminal are unsatisfactory for preset power supply When role exchange condition, keep the power supply direction between first terminal and second terminal constant, i.e., first terminal continues to second Terminal power supply.
Illustratively, after first terminal and second terminal establish connection, when master slave mode information instruction first terminal is current When in from equipment mode, first terminal is powered by second terminal.When according to the master slave mode information of first terminal, first terminal Remaining capacity information and the remaining capacity information of second terminal determine that first terminal and second terminal are unsatisfactory for preset power supply When role exchange condition, keep the power supply direction between first terminal and second terminal constant, i.e., first terminal continues by second Terminal power supply.
In another embodiment, believe when according to the master slave mode information of first terminal, the remaining capacity of first terminal When the remaining capacity information of breath and second terminal determines that first terminal and second terminal meet preset power supply role exchange condition, First terminal sends power supply role exchange request to second terminal.When second terminal refuses power supply role exchange request, keep Power supply direction between first terminal and second terminal is constant.
Illustratively, after first terminal and second terminal establish connection, when master slave mode information instruction first terminal is current When in main equipment mode, first terminal is powered to second terminal.When the remaining capacity information of two terminals of combination determines first When terminal and second terminal meet preset power supply role exchange condition, first terminal sends power supply role exchange to second terminal Request.When second terminal refuses power supply role exchange request, the power supply direction between holding first terminal and second terminal is not Become, i.e., first terminal continues to power to second terminal.
Illustratively, after first terminal and second terminal establish connection, when master slave mode information instruction first terminal is current When in from equipment mode, first terminal is powered by second terminal.When the remaining capacity information of two terminals of combination determines first When terminal and second terminal meet preset power supply role exchange condition, first terminal sends power supply role exchange to second terminal Request.When second terminal refuses power supply role exchange request, the power supply direction between holding first terminal and second terminal is not Become, i.e. first terminal continuation is powered by second terminal.
Fig. 3 A is a kind of block diagram of charging unit 300 shown according to an exemplary embodiment, wherein the device 300 can To be applied to first terminal, for example, first terminal 110 shown in Figure 1A or Figure 1B.Referring to Fig. 3 A, which be can wrap Include: acquisition module 301 is configured as acquiring the remaining capacity information of the first terminal;Module 302 is obtained, is configured as obtaining Take the remaining capacity information for the second terminal being connected with the first terminal;Power supply direction changes module 303, is configured as working as According to the master slave mode information of the first terminal, the residue of the remaining capacity information of the first terminal and the second terminal When information about power determines that the first terminal and the second terminal meet preset power supply role exchange condition, change described the Power supply direction between one terminal and the second terminal.
Optionally, the first terminal is connected with the second terminal by Type C interface;And
It is described obtain module 302 and be configured as obtaining by the Type C interface be connected with the first terminal The remaining capacity information of second terminal.
Optionally, the power supply direction changes module 303 and is configured as indicating described first when the master slave mode information Terminal is in main equipment mode, and when the remaining capacity of the first terminal is less than the remaining capacity of the second terminal, really The fixed first terminal and the second terminal meet the power supply role exchange condition;When the master slave mode information indicates institute It states first terminal to be in from equipment mode, and the remaining capacity of the first terminal is greater than the remaining capacity of the second terminal When, determine that the first terminal and the second terminal meet the power supply role exchange condition.
Optionally, the power supply direction change module 303 includes:
Sending submodule, be configured as when according to the master slave mode information of the first terminal, the first terminal it is surplus It is default that the remaining capacity information of remaining information about power and the second terminal determines that the first terminal and the second terminal meet Power supply role exchange condition when, Xiang Suoshu second terminal send power supply role exchange request;
Receiving submodule is configured as receiving the power supply role exchange response message that the second terminal is sent, wherein institute Power supply role exchange response message is stated to be used to indicate described in the second terminal receiving power supply role exchange request or refusal Role exchange of powering is requested;
Power supply direction changes submodule, is configured as indicating the second terminal when the power supply role exchange response message When receiving power supply role exchange request, change the power supply direction between the first terminal and the second terminal.
Fig. 3 B is a kind of block diagram of the charging unit 300 shown according to another exemplary embodiment, wherein the device 300 It can be applied to first terminal, for example, first terminal 110 shown in Figure 1A or Figure 1B.As shown in Figure 3B, above-mentioned charging unit 300 can also include:
Power supply direction keeps module 304, is configured as working as the master slave mode information according to the first terminal, described first The remaining capacity information of terminal and the remaining capacity information of the second terminal determine the first terminal and the second terminal When being unsatisfactory for preset power supply role exchange condition, or when the power supply role exchange response message indicates that the second terminal is refused When exhausted power supply role exchange request, keep the power supply direction between the first terminal and the second terminal constant.
The technical scheme provided by this disclosed embodiment can include the following benefits: by according to first terminal The remaining capacity information of master slave mode information, the remaining capacity information of first terminal and second terminal determines first terminal and second Terminal changes the power supply direction between first terminal and second terminal when meeting preset power supply role exchange condition, can be to avoid The low terminal of remaining capacity causes itself that can not continue asking for data interaction because of electricity shortage to the high terminal power supply of remaining capacity Topic.In addition, the charging method haves no need to change the master slave mode of two terminals, the change in power supply direction can be realized, thus not Data interaction can be impacted.
About the device in above-described embodiment, wherein modules execute the concrete mode of operation in the related device Embodiment in be described in detail, no detailed explanation will be given here.
A kind of Fig. 4 block diagram of charging unit 400 shown according to an exemplary embodiment.For example, device 400 can be shifting Mobile phone, computer, digital broadcasting terminal, messaging device, game console, tablet device, Medical Devices, body-building are set It is standby, personal digital assistant etc..
Referring to Fig. 4, device 400 may include following one or more components: processing component 402, memory 404, electric power Component 406, multimedia component 408, audio component 410, the interface 412 of input/output (I/O), sensor module 414, and Communication component 416.
The integrated operation of the usual control device 400 of processing component 402, such as with display, telephone call, data communication, phase Machine operation and record operate associated operation.Processing component 402 may include that one or more processors 420 refer to execute It enables, to complete all or part of the steps of above-mentioned charging method.In addition, processing component 402 may include one or more moulds Block, convenient for the interaction between processing component 402 and other assemblies.For example, processing component 402 may include multi-media module, with Facilitate the interaction between multimedia component 408 and processing component 402.
Memory 404 is configured as storing various types of data to support the operation in device 400.These data are shown Example includes instruction for any application program or device that operate on device 400, contact data, and telephone book data disappears Breath, picture, video etc..Memory 404 can be by any kind of volatibility or non-volatile memory device or their group It closes and realizes, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM) is erasable to compile Journey read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash Device, disk or CD.
Electric power assembly 406 provides electric power for the various assemblies of device 400.Electric power assembly 406 may include power management system System, one or more power supplys and other with for device 400 generate, manage, and distribute the associated component of electric power.
Multimedia component 408 includes the screen of one output interface of offer between described device 400 and user.One In a little embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, screen Curtain may be implemented as touch screen, to receive input signal from the user.Touch panel includes one or more touch sensings Device is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding action Boundary, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more matchmakers Body component 408 includes a front camera and/or rear camera.When device 400 is in operation mode, such as screening-mode or When video mode, front camera and/or rear camera can receive external multi-medium data.Each front camera and Rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 410 is configured as output and/or input audio signal.For example, audio component 410 includes a Mike Wind (MIC), when device 400 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone is matched It is set to reception external audio signal.The received audio signal can be further stored in memory 404 or via communication set Part 416 is sent.In some embodiments, audio component 410 further includes a loudspeaker, is used for output audio signal.
I/O interface 412 provides interface between processing component 402 and peripheral interface module, and above-mentioned peripheral interface module can To be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and lock Determine button.
Sensor module 414 includes one or more sensors, and the state for providing various aspects for device 400 is commented Estimate.For example, sensor module 414 can detecte the state that opens/closes of device 400, and the relative positioning of component, for example, it is described Component is the display and keypad of device 400, and sensor module 414 can be with 400 1 components of detection device 400 or device Position change, the existence or non-existence that user contacts with device 400,400 orientation of device or acceleration/deceleration and device 400 Temperature change.Sensor module 414 may include proximity sensor, be configured to detect without any physical contact Presence of nearby objects.Sensor module 414 can also include optical sensor, such as CMOS or ccd image sensor, at As being used in application.In some embodiments, which can also include acceleration transducer, gyro sensors Device, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 416 is configured to facilitate the communication of wired or wireless way between device 400 and other equipment.Device 400 can access the wireless network based on communication standard, such as WiFi, 2G or 3G or their combination.In an exemplary implementation In example, communication component 416 receives broadcast singal or broadcast related information from external broadcasting management system via broadcast channel. In one exemplary embodiment, the communication component 416 further includes near-field communication (NFC) module, to promote short range communication.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 400 can be believed by one or more application specific integrated circuit (ASIC), number Number processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic components are realized, for executing above-mentioned charging method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory 404 of instruction, above-metioned instruction can be executed by the processor 420 of device 400 to complete above-mentioned charging method. For example, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, Floppy disk and optical data storage devices etc..
Those skilled in the art will readily occur to other embodiment party of the disclosure after considering specification and practicing the disclosure Case.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or adaptability Variation follows the general principles of this disclosure and including the undocumented common knowledge or usual skill in the art of the disclosure Art means.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following claim It points out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.

Claims (12)

1. a kind of charging method, which is characterized in that the method is applied to first terminal, which comprises
Acquire the remaining capacity information of the first terminal;
Obtain the remaining capacity information for the second terminal being connected with the first terminal;
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and the second terminal Remaining capacity information when determining that the first terminal and the second terminal meet preset power supply role exchange condition, change Power supply direction between the first terminal and the second terminal.
2. the method according to claim 1, wherein the first terminal and the second terminal pass through Type C Interface is connected;And
The remaining capacity information for obtaining the second terminal being connected with the first terminal, comprising:
The remaining capacity information for the second terminal being connected with the first terminal is obtained by the Type C interface.
3. the method according to claim 1, wherein when the master slave mode information indicates at the first terminal In main equipment mode, and when the remaining capacity of the first terminal is less than the remaining capacity of the second terminal, determine described in First terminal and the second terminal meet the power supply role exchange condition;
When the master slave mode information indicates that the first terminal is in from equipment mode, and the residue electricity of the first terminal When amount is greater than the remaining capacity of the second terminal, determine that the first terminal and the second terminal meet the power supply role Exchange condition.
4. the method according to claim 1, wherein described believe when according to the master slave mode of the first terminal The remaining capacity information of breath, the remaining capacity information of the first terminal and the second terminal determines the first terminal and institute When stating second terminal and meeting preset power supply role exchange condition, change the confession between the first terminal and the second terminal Electric direction, comprising:
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and the second terminal Remaining capacity information when determining that the first terminal and the second terminal meet preset power supply role exchange condition, to institute It states second terminal and sends power supply role exchange request;
Receive the power supply role exchange response message that the second terminal is sent, wherein the power supply role exchange response message The second terminal is used to indicate to receive the power supply role exchange request or refuse the power supply role exchange request;
When the power supply role exchange response message indicates that the second terminal receives power supply role exchange request, change Power supply direction between the first terminal and the second terminal.
5. according to the method described in claim 4, it is characterized in that, the method also includes:
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and the second terminal Remaining capacity information when determining that the first terminal and the second terminal are unsatisfactory for preset power supply role exchange condition, or When the power supply role exchange response message indicates that the second terminal refuses power supply role exchange request, described in holding Power supply direction between first terminal and the second terminal is constant.
6. a kind of charging unit, which is characterized in that described device is applied to first terminal, and described device includes:
Acquisition module is configured as acquiring the remaining capacity information of the first terminal;
Module is obtained, is configured as obtaining the remaining capacity information for the second terminal being connected with the first terminal;
The direction that powers changes module, is configured as when according to the master slave mode information of the first terminal, the first terminal It is pre- that the remaining capacity information of remaining capacity information and the second terminal determines that the first terminal and the second terminal meet If power supply role exchange condition when, change the power supply direction between the first terminal and the second terminal.
7. device according to claim 6, which is characterized in that the first terminal and the second terminal pass through Type C Interface is connected;And
The module that obtains is configured as obtaining second to be connected with the first terminal by the Type C interface eventually The remaining capacity information at end.
8. device according to claim 6, which is characterized in that the power supply direction changes module and is configured as the master Slave pattern information indicates that the first terminal be in main equipment mode, and the remaining capacity of the first terminal is less than described the When the remaining capacity of two terminals, determine that the first terminal and the second terminal meet the power supply role exchange condition;When The master slave mode information indicates that the first terminal is in from equipment mode, and the remaining capacity of the first terminal is greater than When the remaining capacity of the second terminal, determine that the first terminal and the second terminal meet the power supply role exchange item Part.
9. device according to claim 6, which is characterized in that the power supply direction changes module and includes:
Sending submodule is configured as when electric according to master slave mode information, the residue of the first terminal of the first terminal The remaining capacity information of amount information and the second terminal determines that the first terminal and the second terminal meet preset confession When electric role exchange condition, Xiang Suoshu second terminal sends power supply role exchange request;
Receiving submodule is configured as receiving the power supply role exchange response message that the second terminal is sent, wherein the confession Electric role exchange response message is used to indicate the second terminal and receives the power supply role exchange request or refuse the power supply Role exchange request;
Power supply direction changes submodule, is configured as indicating that the second terminal receives when the power supply role exchange response message When the power supply role exchange is requested, change the power supply direction between the first terminal and the second terminal.
10. device according to claim 9, which is characterized in that described device further include:
The direction that powers keeps module, is configured as when according to the master slave mode information of the first terminal, the first terminal The remaining capacity information of remaining capacity information and the second terminal determines that the first terminal and the second terminal are unsatisfactory for When preset power supply role exchange condition, or when the power supply role exchange response message indicates described in the second terminal refusal When role exchange of powering is requested, keep the power supply direction between the first terminal and the second terminal constant.
11. a kind of charging unit characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
Acquire the remaining capacity information of first terminal;
Obtain the remaining capacity information for the second terminal being connected with the first terminal;
When according to the master slave mode information of the first terminal, the remaining capacity information of the first terminal and the second terminal Remaining capacity information when determining that the first terminal and the second terminal meet preset power supply role exchange condition, change Power supply direction between the first terminal and the second terminal.
12. a kind of computer readable storage medium, is stored thereon with computer program instructions, which is characterized in that the program instruction The step of any one of claim 1-5 the method is realized when being executed by processor.
CN201610827192.2A 2016-09-14 2016-09-14 Charging method and device Active CN106299515B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610827192.2A CN106299515B (en) 2016-09-14 2016-09-14 Charging method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610827192.2A CN106299515B (en) 2016-09-14 2016-09-14 Charging method and device

Publications (2)

Publication Number Publication Date
CN106299515A CN106299515A (en) 2017-01-04
CN106299515B true CN106299515B (en) 2019-04-16

Family

ID=57711694

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610827192.2A Active CN106299515B (en) 2016-09-14 2016-09-14 Charging method and device

Country Status (1)

Country Link
CN (1) CN106299515B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111713176B (en) * 2018-05-16 2023-01-13 华为技术有限公司 Data transmission method and terminal
CN114498784A (en) 2020-10-26 2022-05-13 北京小米移动软件有限公司 Charging method, charging device, electronic device and storage medium
CN113078709B (en) * 2021-04-01 2024-10-25 博阳能源科技有限公司 A fast charging circuit role control method, protocol processing system and circuit
CN116231815B (en) * 2023-05-10 2023-09-08 荣耀终端有限公司 Method for controlling charging and electronic equipment

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025001A (en) * 2009-09-21 2011-04-20 联想(北京)有限公司 Terminal and charging and power supplying method thereof
CN104900927A (en) * 2014-03-07 2015-09-09 世和能源科技股份有限公司 Method for detecting and displaying mobile power charging information

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9276430B2 (en) * 2013-05-24 2016-03-01 Qualcomm, Incorporated Master-slave multi-phase charging

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102025001A (en) * 2009-09-21 2011-04-20 联想(北京)有限公司 Terminal and charging and power supplying method thereof
CN104900927A (en) * 2014-03-07 2015-09-09 世和能源科技股份有限公司 Method for detecting and displaying mobile power charging information

Also Published As

Publication number Publication date
CN106299515A (en) 2017-01-04

Similar Documents

Publication Publication Date Title
CN105068958B (en) Method for handover control and device
US20170064182A1 (en) Method and device for acquiring image file
CN104159218B (en) Internetwork connection establishing method and device
CN106547663B (en) Key management method and device
CN105373464A (en) Charging warning method and device of wearable equipment
CN105098888A (en) Charging method and device
CN109658927A (en) Wake-up processing method, device and the management equipment of smart machine
CN105208215A (en) Locating control method, device and terminal
CN105071473B (en) USB charging methods and device
CN105098273A (en) Charging method and device
CN104320542A (en) Method and device for sending reminding message
CN106299515B (en) Charging method and device
CN106604230B (en) The method and device of region configuration
CN109644457A (en) Resource allocation method and device
CN105120505A (en) Method, apparatus and system for making intelligent equipment accessed to router
CN109451877A (en) Unmanned aerial vehicle (UAV) control method and device, unmanned plane and remote control equipment
CN104090655A (en) Terminal and terminal control method and device.
CN104486490A (en) Method and device for notifying battery capacity
CN106532367B (en) The method and apparatus of intelligent socket electricity consumption warning
CN105068651A (en) Method, device, terminal and server for controlling alarm clock
CN109451811A (en) Unmanned plane management method and device, electronic equipment and computer readable storage medium
CN105183309B (en) Method for handover control and device
CN105517144A (en) Equipment positioning method and device
CN106453846A (en) Display method and device for two-dimensional code business card
CN105491518A (en) Method and device for social reminding based on wearable devices

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