CN112311029B - Charging method, electronic device and storage medium - Google Patents

Charging method, electronic device and storage medium Download PDF

Info

Publication number
CN112311029B
CN112311029B CN201910695658.1A CN201910695658A CN112311029B CN 112311029 B CN112311029 B CN 112311029B CN 201910695658 A CN201910695658 A CN 201910695658A CN 112311029 B CN112311029 B CN 112311029B
Authority
CN
China
Prior art keywords
electronic device
time
time period
electronic equipment
duration
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
CN201910695658.1A
Other languages
Chinese (zh)
Other versions
CN112311029A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910695658.1A priority Critical patent/CN112311029B/en
Priority to PCT/CN2020/101929 priority patent/WO2021017823A1/en
Publication of CN112311029A publication Critical patent/CN112311029A/en
Application granted granted Critical
Publication of CN112311029B publication Critical patent/CN112311029B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • 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
    • 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

Abstract

The embodiment of the invention discloses a charging method, electronic equipment and a storage medium, wherein the method comprises the following steps: the method comprises the steps that first electronic equipment determines a first use duration of the residual capacity of the first electronic equipment; the first electronic equipment receives a second use duration of the residual capacity of the second electronic equipment from the second electronic equipment; the first electronic equipment judges whether the first use duration is longer than the second use duration; if the first using time length is longer than the second using time length, the first electronic equipment determines that the first electronic equipment is in a reverse charging mode, and if the first using time length is shorter than the second using time length, the first electronic equipment determines that the first electronic equipment is in a forward charging mode.

Description

Charging method, electronic device and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a charging method, an electronic device, and a storage medium.
Background
Along with the use of electronic devices such as smart phones and the like, the performance of the electronic devices is also stronger and more varied, so that the power consumption consumed by the electronic devices in the use process is higher and higher, and the electronic devices need to be frequently charged in the use process.
In order to realize the purpose of mutual charging between two different electronic devices outdoors or in a scene that a fixed socket is difficult to find, the prior art can realize the purpose of mutual charging between two electronic devices through a connecting wire (on the go, OTG). Carry out mutual charging between the different electronic equipment through the OTG, connect 2 electronic equipment through the charging wire, manual operation selects an electronic equipment as the power supply side, and another electronic equipment is as the side of charging.
However, the mutual charging among 2 electronic devices is realized through the OTG, a special charging wire is needed, the convenience of charging the electronic devices is reduced, and the efficiency of charging the electronic devices is reduced by selecting a power supply party and a charging party through manual operation of a user in the charging process.
Disclosure of Invention
The embodiment of the application provides a charging method, an electronic device and a storage medium, which are used for charging the electronic device, a special charging wire is not needed in the charging process, and a power supply party and a power receiving party can be automatically determined without manual operation of a user, so that the charging efficiency is improved.
A first aspect of an embodiment of the present invention provides a charging method, where the charging method is used for a first electronic device, and the charging method includes: the first electronic equipment determines a first use duration of the residual capacity of the first electronic equipment; the first electronic equipment receives a second use duration of the residual capacity of the second electronic equipment from the second electronic equipment; the first electronic equipment judges whether the first use duration is longer than the second use duration; if the first using time length is longer than the second using time length, the first electronic device determines that the first electronic device is in a reverse charging mode, and the reverse charging mode is that the first electronic device outputs charging current to the second electronic device; if the first using time length is shorter than the second using time length, the first electronic device determines that the first electronic device is in a forward charging mode, and the forward charging mode is that the first electronic device receives charging current output by the second electronic device.
Therefore, by adopting the charging method of the invention, the first electronic device can automatically judge the power supplier and the power receiver according to the first use time of the first electronic device and the use time of the second electronic device, and the manual operation of a user is not needed in the charging process, thereby effectively improving the charging efficiency. The power supplier and the power receiver are judged through the use duration, so that the use degree of the first electronic device is fully considered in the process of determining the power supplier and the power receiver, for example, although the residual electric quantity of the first electronic device is relatively large, the first electronic device runs a plurality of applications with large power consumption, namely, the use degree of the first electronic device is very heavy, if the first electronic device is used as the power supplier to supply power to other electronic devices, the situation that the first electronic device cannot be used normally subsequently can be caused, and by adopting the method shown in the aspect, the power supplier and the power receiver are determined through the use duration, the situation that the first electronic device with the heavy use degree supplies power to the first electronic device with the light use degree is avoided, and the normal use of the first electronic device is effectively guaranteed.
Based on the first aspect of the embodiment of the present invention, in an optional implementation manner of the first aspect of the embodiment of the present invention, the determining, by the first electronic device, the first usage duration of the remaining capacity of the first electronic device includes: the first electronic equipment acquires the residual electric quantity of the first electronic equipment; the first electronic equipment acquires the working current of the first electronic equipment; and the first electronic equipment determines the first service life according to the residual electric quantity and the working current.
By adopting the method shown in the aspect, the first electronic equipment can directly determine the first use duration of the residual electric quantity of the first electronic equipment according to the residual electric quantity and the working electric quantity currently left by the first electronic equipment, and the first electronic equipment can be conveniently and automatically determined to be a power supply side or a power receiving side in the mutual charging process due to no need of manual operation of a user, so that the charging efficiency is effectively improved.
Based on the first aspect of the embodiment of the present invention, in an optional implementation manner of the first aspect of the embodiment of the present invention, the acquiring, by the first electronic device, the working current of the first electronic device includes: the first electronic device determines a variation of a first battery capacity of the first electronic device within a first time period, wherein a time starting point of the first time period is a time before a current time, and a time ending point of the first time period is the current time or the time before the current time; and the first electronic equipment determines the working current according to the variable quantity of the first battery electric quantity and the first time period.
With the method of this aspect, the first electronic device may determine the operating current according to a variation of a first battery capacity of the first electronic device in a past period (i.e., a first period) and the first period, so that the first electronic device can estimate the first usage time of the first electronic device based on the variation of the battery capacity of the first electronic device in the past first period.
Based on the first aspect of the embodiment of the present invention, in an optional implementation manner of the first aspect of the embodiment of the present invention, the acquiring, by the first electronic device, the working current of the first electronic device includes: the first electronic equipment acquires a second time period, wherein the time starting point of the second time period is the current time or the time behind the current time; the first electronic device acquires a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period; the first electronic equipment acquires the variation of the second battery capacity of the first electronic equipment in a third time period; and the first electronic equipment determines the working current according to the variation of the second battery capacity and the third time period.
By adopting the method shown in the present aspect, the first electronic device fully considers the possible variation of the battery capacity in the future time period (the second time period), so as to estimate the operating current according to the variation of the battery capacity in the future time period of the first electronic device, so that the first usage duration determined by the first electronic device fully considers the usage situation of the first electronic device in the future time period, thereby avoiding the situation that the first electronic device with larger power consumption becomes a power supplier in the future time period, and effectively ensuring that the first electronic device with larger power consumption in the future time period serves as the power supplier, so that the first electronic device cannot be normally used.
Based on the first aspect of the embodiment of the present invention, in an optional implementation manner of the first aspect of the embodiment of the present invention, the method further includes: the first electronic equipment acquires a second time period, wherein the time starting point of the second time period is the current time or the time behind the current time; the first electronic device acquires a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period; and the first electronic equipment triggers and executes a step that the first electronic equipment determines that the first electronic equipment is in a forward charging mode under the condition that the first electronic equipment is determined to run a target application in the third time period, wherein the target application is an application with running electric quantity greater than or equal to a preset value.
By adopting the method shown in this embodiment, whether the target application with high power consumption is likely to be operated in the future time period is fully considered by the first electronic device, and if the first usage duration of the first electronic device is longer than the second usage duration of the second device, but the probability that the target application is operated in the future time period (third time period) by the first electronic device is very high, the first electronic device cannot guarantee that the first electronic device successfully operates the target application in the third time period after being used as a power supplier.
Based on the first aspect of the embodiment of the present invention, in an optional implementation manner of the first aspect of the embodiment of the present invention, if the first duration of use is longer than the second duration of use, the method further includes: the first electronic equipment receives first indication information, wherein the first indication information is used for indicating that the first electronic equipment has the highest charging priority; and the first electronic equipment determines that the first electronic equipment is in the forward charging mode according to the indication of the first indication information.
It can be seen that, by using the method shown in this aspect, when the first electronic device determines that the first duration of use is greater than the second duration of use, the first electronic device detects whether first indication information input by a user is received, and if the first electronic device receives the first indication information, it indicates that the user needs the first electronic device as a power receiver according to the user's own use requirement, and even if the first electronic device determines that the first duration of use is greater than the second duration of use, the first electronic device is controlled to receive, by the power receiver, a charging current output by the second electronic device.
Based on the first aspect of the embodiment of the present invention, in an optional implementation manner of the first aspect of the embodiment of the present invention, if the first duration of use is less than the second duration of use, the method further includes: if the first electronic device receives second indication information, the second indication information is used for indicating that the second electronic device has the highest charging priority; and the first electronic equipment determines that the first electronic equipment is in the reverse charging mode according to the indication of the second indication information.
It can be seen that, by using the method shown in this aspect, when the first electronic device determines that the first usage duration is less than the second usage duration, the first electronic device detects whether second indication information input by a user is received, and if the first electronic device receives the second indication information, it indicates that the second electronic device is required to be used as a power receiver according to a usage requirement of the user, and even if the first electronic device determines that the first usage duration is less than the second usage duration, the first electronic device is controlled to be a power charging party to charge the second electronic device.
Based on the first aspect of the embodiment of the present invention, in an optional implementation manner of the first aspect of the embodiment of the present invention, the method further includes: if the first usage duration is equal to the second usage duration, the first electronic device determines that the first electronic device is in a standby mode.
By adopting the method of the present aspect, if the first electronic device determines that the first usage duration and the second usage duration are equal, the first electronic device determines that the first electronic device is in the standby mode, that is, the first electronic device does not charge the second electronic device, and the second electronic device is not used to charge the first electronic device, thereby avoiding consumption of the electric quantity of the first electronic device.
Based on the first aspect of the embodiment of the present invention, in an optional implementation manner of the first aspect of the embodiment of the present invention, the determining, by the first electronic device, the first usage duration of the remaining capacity of the first electronic device includes: if the first electronic device detects that the first electronic device is in a wired charging mode, the first electronic device determines that the first use duration of the first electronic device is infinite, and the wired charging mode means that an external power supply continuously charges the first electronic device through a charging wire.
It can be understood that, with the method shown in this aspect, if the first electronic device detects that it is in the limited charging mode, it indicates that an external power source supplies power to the first electronic device, and the first electronic device determines that the first usage time length of the first electronic device is infinite, and when the first electronic device and the second electronic device are in a mutual charging state, the first electronic device with the first time length being infinite is always used as a power supply side to charge the second electronic device.
A second aspect of an embodiment of the present invention provides an electronic device, where the electronic device is a first electronic device, and the first electronic device includes: the processing unit is used for determining a first use duration of the residual electric quantity of the first electronic equipment; the receiving unit is used for receiving a second use duration of the residual capacity of the second electronic equipment from the second electronic equipment; the processing unit is further configured to determine whether the first duration of use is greater than the second duration of use; if the first usage duration is longer than the second usage duration, the processing unit determines that the first electronic device is in a reverse charging mode, and the reverse charging mode is that the first electronic device outputs a charging current to the second electronic device; if the first usage duration is less than the second usage duration, the processing unit determines that the first electronic device is in a forward charging mode, and the forward charging mode is that the first electronic device receives a charging current output by the second electronic device.
For a detailed description of a specific process and a beneficial effect of the electronic device executing the charging method in this aspect, please refer to the first aspect, which is not described in detail.
Based on the second aspect of the embodiment of the present invention, in an optional implementation manner of the second aspect of the embodiment of the present invention, the processing unit is specifically configured to: acquiring the residual electric quantity of the first electronic equipment; acquiring the working current of the first electronic equipment; and determining the first service time according to the residual electric quantity and the working current.
Based on the second aspect of the embodiment of the present invention, in an optional implementation manner of the second aspect of the embodiment of the present invention, the processing unit is specifically configured to: determining a variation of a first battery capacity of the first electronic device within a first time period, wherein a time start point of the first time period is a time before a current time, and a time end point of the first time period is the current time or the time before the current time; and determining the working current according to the variable quantity of the first battery electric quantity and the first time period.
Based on the second aspect of the embodiment of the present invention, in an optional implementation manner of the second aspect of the embodiment of the present invention, the processing unit is specifically configured to: acquiring a second time period, wherein the time starting point of the second time period is the current time or the time after the current time; acquiring a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period; acquiring the variation of the second battery capacity of the first electronic equipment in a third time period; and determining the working current according to the variation of the second battery capacity and the third time period.
Based on the second aspect of the embodiment of the present invention, in an optional implementation manner of the second aspect of the embodiment of the present invention, the processing unit is further configured to: acquiring a second time period, wherein the time starting point of the second time period is the current time or the time after the current time; acquiring a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period; and under the condition that the first electronic device is determined to run a target application in the third time period, triggering and executing the step of determining that the first electronic device is in a forward charging mode, wherein the target application is an application with a running electric quantity greater than or equal to a preset value.
Based on the second aspect of the embodiment of the present invention, in an optional implementation manner of the second aspect of the embodiment of the present invention, if the first duration of use is greater than the second duration of use, the receiving unit is further configured to: receiving first indication information, wherein the first indication information is used for indicating that the first electronic equipment has the highest charging priority; the processing unit is further configured to determine that the first electronic device is in the forward charging mode according to the indication of the first indication information.
Based on the second aspect of the embodiment of the present invention, in an optional implementation manner of the second aspect of the embodiment of the present invention, if the first duration of use is less than the second duration of use, the receiving unit is further configured to: receiving second indication information, wherein the second indication information is used for indicating that the second electronic equipment has the highest charging priority; the processing unit is further configured to determine that the first electronic device is in the reverse charging mode according to the indication of the second indication information.
Based on the second aspect of the embodiment of the present invention, in an optional implementation manner of the second aspect of the embodiment of the present invention, the processing unit is further configured to determine that the first electronic device is in the standby mode if the first duration of use is equal to the second duration of use.
Based on the second aspect of the embodiment of the present invention, in an optional implementation manner of the second aspect of the embodiment of the present invention, the processing unit is specifically configured to: if the first electronic device is detected to be in a wired charging mode, determining that the first use time of the first electronic device is infinite, wherein the wired charging mode is that an external power supply continuously charges the first electronic device through a charging wire.
A third aspect of embodiments of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program is configured to, when executed on a computer, cause the computer to perform the method according to any one of the first aspect.
A fourth aspect of embodiments of the present invention provides a chip, including a communication interface, a memory for storing a computer program, and a processor for reading and executing the computer program stored in the memory to perform the method according to any one of the first aspect.
A fifth aspect of embodiments of the present invention provides an electronic device, comprising a transceiver, a memory for storing a computer program, and a processor for reading and executing the computer program stored in the memory to perform the method according to any one of the first aspect.
Drawings
Fig. 1 is a schematic structural diagram of an embodiment of an electronic device provided in the present application;
fig. 2 is a diagram illustrating an exemplary scenario of a charging method provided in the present application;
FIG. 3 is a flowchart illustrating steps of a charging method according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating steps of another embodiment of a charging method provided herein;
FIG. 5 is a flowchart illustrating steps of another embodiment of a charging method according to the present disclosure;
fig. 6 is a diagram illustrating another exemplary scenario of a charging method provided in the present application;
FIG. 7 is a flowchart illustrating steps of another embodiment of a charging method provided herein;
fig. 8 is a diagram illustrating a structure of an electronic device according to an embodiment of the present disclosure.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The term "and/or" appearing in the present application may be an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in this application generally indicates that the former and latter related objects are in an "or" relationship.
The terms "first," "second," and the like in the description and in the claims of the present application and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It will be appreciated that the data so used may be interchanged under appropriate circumstances such that the embodiments described herein may be practiced otherwise than as specifically illustrated or described herein. Moreover, the terms "comprises," "comprising," and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not expressly listed or inherent to such process, method, article, or apparatus.
In order to better understand the charging method provided by the present application, a specific structure of the electronic device is first exemplarily illustrated with reference to fig. 1 as follows:
the electronic device includes an input unit 105, a processor unit 103, an output unit 101, a communication unit 107, a storage unit 104, a radio frequency circuit 108, and the like.
These components communicate over one or more buses. Those skilled in the art will appreciate that the configuration of the electronic device shown in fig. 1 is not intended to limit the present invention, and may be a bus or star configuration, and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
In the embodiment of the present invention, the electronic device may be any mobile or portable electronic device, including but not limited to a smart phone, a mobile computer, a tablet computer, a Personal Digital Assistant (PDA), a media player, a smart television, and the like.
The electronic device includes:
an output unit 101 for outputting an image to be displayed.
And the processor unit 103 is used for executing corresponding codes, processing the received information and generating and outputting a corresponding interface.
Specifically, the processor unit 103 is a control center of the electronic device, connects various parts of the whole electronic device by using various interfaces and lines, and executes various functions of the electronic device and/or processes data by running or executing software programs and/or modules stored in the storage unit and calling data stored in the storage unit. The processor unit 103 may be composed of an Integrated Circuit (IC), for example, a single packaged IC, or a plurality of packaged ICs with the same or different functions connected.
For example, the processor unit 103 may include only a Central Processing Unit (CPU), or may be a combination of a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), and a control chip (e.g., a baseband chip) in the communication unit. In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
A memory unit 104 for storing code and data, the code for execution by the processor unit 103.
Specifically, the storage unit 104 may be used to store software programs and modules, and the processor unit 103 executes various functional applications of the electronic device and implements data processing by running the software programs and modules stored in the storage unit 104. The storage unit 104 mainly includes a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function, such as a sound playing program, an image playing program, and the like; the data storage area may store data (such as audio data, a phonebook, etc.) created according to the use of the electronic device, and the like. In an embodiment of the present invention, the storage unit 104 may include a volatile memory, and may further include a non-volatile memory, such as at least one magnetic disk storage device, an electrically erasable programmable read-only memory, a flash memory device, such as a nand flash memory or a nand flash memory.
The non-volatile memory stores an operating system and application programs executed by the processor unit 103. The processor unit 103 loads operating programs and data from the non-volatile memory into memory and stores digital content in mass storage devices. The operating system includes various components and/or drivers for controlling and managing conventional system tasks, such as memory management, storage device control, power management, etc., as well as facilitating communication between various hardware and software components.
The application programs include any application installed on the electronic device including, but not limited to, browser, email, instant messaging service, word processing, keyboard virtualization, widget (Widget), encryption, digital rights management, voice recognition, voice replication, positioning (e.g., functions provided by the global positioning system), music playing, and so forth.
An input unit 105 for enabling user interaction with the electronic device and/or information input into the electronic device.
For example, the input unit 105 may receive numeric or character information input by a user to generate a signal input related to user setting or function control. In the embodiment of the present invention, the input unit 105 may be a touch screen, other human-computer interaction interfaces such as physical input keys and a microphone, or other external information capturing devices such as a camera.
The touch screen disclosed by the embodiment of the invention can collect the operation actions touched or approached by the user. For example, the user can use any suitable object or accessory such as a finger, a stylus, etc. to operate on or near the touch screen, and drive the corresponding connection device according to a preset program. Alternatively, the touch screen may include two parts, a touch detection device and a touch controller. The touch detection device detects touch operation of a user, converts the detected touch operation into an electric signal and transmits the electric signal to the touch controller; the touch controller receives the electrical signal from the touch sensing device and converts it to touch point coordinates, which are fed to the processor unit 103.
The touch controller can also receive and execute commands sent by the processor unit 103. In addition, the touch screen can be realized by various types such as a resistive type, a capacitive type, an infrared ray, a surface acoustic wave and the like.
In other embodiments of the present invention, the physical input keys used by the input unit 105 may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a track ball, a mouse, a joystick, etc. The input unit 105 in the form of a microphone may collect speech input by a user or the environment and convert it into commands in the form of electrical signals executable by the processor unit 103.
In some other embodiments of the present invention, the input unit 105 may also be various sensing devices, such as hall devices, for detecting physical quantities of the electronic device, such as force, moment, pressure, stress, position, displacement, speed, acceleration, angle, angular velocity, number of rotations, rotation speed, and time of change of operating state, and converting the physical quantities into electric quantities for detection and control. Other sensing devices may include gravity sensors, three-axis accelerometers, gyroscopes, electronic compasses, ambient light sensors, proximity sensors, temperature sensors, humidity sensors, pressure sensors, heart rate sensors, fingerprint identifiers, and the like.
A communication unit 107 for establishing a communication channel through which the electronic device connects to a remote server and downloads media data from the remote server. The communication unit 107 may include a wireless local area network (wlan) module, a bluetooth module, a baseband module, and other communication modules, and a Radio Frequency (RF) circuit corresponding to the communication module, and is configured to perform wlan communication, bluetooth communication, infrared communication, and/or cellular communication system communication, such as wideband code division multiple access (W-CDMA) and/or High Speed Downlink Packet Access (HSDPA). The communication module is used for controlling communication of each component in the electronic equipment and can support direct memory access.
In different embodiments of the present invention, the various communication modules in the communication unit 107 are generally in the form of integrated circuit chips (integrated circuit chips), and can be selectively combined, without including all the communication modules and corresponding antenna groups. For example, the communication unit 107 may comprise only a baseband chip, a radio frequency chip and a corresponding antenna to provide communication functions in a cellular communication system. The electronic device may be connected to a cellular network or the internet via a wireless communication connection established by the communication unit 107, such as a wireless local area network access or a WCDMA access. In some optional embodiments of the present invention, a communication module, for example, a baseband module, in the communication unit 107 may be integrated into the processor unit 103.
And the radio frequency circuit 108 is used for receiving and sending signals in the process of information transceiving or conversation. For example, after receiving downlink information of the base station, the downlink information is processed by the processor unit 103; in addition, the data for designing uplink is transmitted to the base station. Generally, the radio frequency circuitry 108 includes well-known circuitry for performing these functions, including but not limited to an antenna system, a radio frequency transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a codec chipset, a subscriber identity module card, memory, and so forth. In addition, the radio frequency circuitry 108 may also communicate with networks and other devices via wireless communications.
A battery 109 for charging the different components of the electronic device to maintain its operation. As a general understanding, the battery 109 may be a built-in battery, such as a common lithium ion battery, nickel hydrogen battery, or the like. In some embodiments of the present invention, the battery 109 may be more broadly defined and may include, for example, a battery management system, a charging system, a battery failure detection circuit, a battery converter or inverter, a battery status indicator (e.g., a light emitting diode), and any other components associated with power generation, management, and distribution of an electronic device.
The charging method described in the present application can realize wireless charging between two different electronic devices, and the electronic device is required to support the wireless charging function, and the structure of the electronic device with the wireless charging function is shown in fig. 1,
the electronic device further comprises a wireless charging module 111 connected with the battery 109, and further comprises a transceiver coil 110 connected with the wireless charging module 111.
The following describes an exemplary procedure of wireless charging between the first electronic device 201 and the second electronic device 202 based on fig. 1 and 2:
optionally, when the first electronic device 201 is in the reverse charging mode, that is, the first electronic device 201 outputs a charging current to the second electronic device 202, so that the first electronic device 201 charges the second electronic device 202;
specifically, the wireless charging module included in the first electronic device 201 performs power control, inversion, voltage stabilization, filtering and other conversion processes on the direct current provided by the battery to obtain an alternating current with fixed power, and the transceiver coil can convert the alternating current into electromagnetic energy and transmit the electromagnetic energy to the second electronic device 202;
within the second electronic device 202, the transceiver coil may convert electromagnetic energy from the first electronic device 201 into electrical energy (i.e., into induced alternating current) and transmit the induced alternating current to the wireless charging module of the second electronic device 202; the wireless charging module can perform power control, rectification, voltage stabilization, filtering and other conversion processing on the induced alternating current to obtain induced direct current with fixed power, and charges a battery of the second electronic device through the induced direct current to realize transmission of electric energy from the first electronic device 201 to the second electronic device 202.
Here, the transceiver coil 110 may specifically realize the transmission of electric energy through electromagnetic induction, magnetic resonance transmission, and the like, and is not limited herein. For example, when the wireless charging module of the first electronic device inputs the alternating current with fixed power to the transceiver coil of the second electronic device 202, the transceiver coil of the second electronic device will generate a constantly changing magnetic field, and the transceiver coil in the changing magnetic field can generate the induced alternating current, thereby realizing the transmission of the electric energy. In the embodiment of the present invention, an electromagnetic induction type power transmission method is described as an example.
Optionally, when the first electronic device 201 is in the forward charging mode, that is, the second electronic device 202 outputs a charging current to the first electronic device 201, so that the second electronic device 202 charges the first electronic device 201, and a specific charging process may be as shown above and is not described in detail.
Based on fig. 1 and fig. 2, an embodiment of the charging method provided by the present application is exemplarily described below with reference to fig. 3:
step 301, establishing a radio connection between the first electronic device and the second electronic device.
Specifically, before the first electronic device and the second electronic device shown in this embodiment are mutually charged, a radio connection between the first electronic device and the second electronic device needs to be established, and the following exemplary descriptions are provided for an alternative way of establishing a radio connection:
the first electronic device may periodically send a detection signal, where the detection signal is used to detect whether a second electronic device capable of performing mutual charging with the first electronic device exists around the first electronic device. When a second electronic device that needs to be mutually charged with a first electronic device is close to the first electronic device, that is, a transceiver coil of the first electronic device and a transceiver coil of the second electronic device are close to each other, taking fig. 2 as an example, that is, a back surface of the first electronic device is attached to a back surface of the second electronic device. The second electronic device may receive the detection signal sent by the first electronic device, and the second electronic device may send a response signal corresponding to the detection signal to the first electronic device; under the condition that the first electronic device receives the response signal, the first electronic device and the second electronic device can be in radio connection through electromagnetic coupling, and under the condition that wireless point connection is established between the first electronic device and the second electronic device, the first electronic device and the second electronic device can be charged mutually.
In the above, the first electronic device is taken as an example to transmit the probe signal to the second electronic device, and in other scenarios, the second electronic device may also transmit the probe signal to the first electronic device, and the present embodiment is not limited specifically.
Step 302, the first electronic device determines a first usage duration of the remaining power of the first electronic device;
specifically, in this embodiment, the first electronic device may obtain the remaining power of the first electronic device and the working current of the first electronic device, and the first electronic device may determine the first usage duration of the remaining power of the first electronic device according to the remaining power of the first electronic device and the working current of the first electronic device.
In this embodiment, a specific process of how the first electronic device determines the first usage duration according to the remaining power of the first electronic device is not limited, as long as the first electronic device can determine the first usage duration, and several optional implementation manners of determining the first usage duration by the first electronic device are exemplarily described as follows:
mode 1
In this mode, the first electronic device obtains the current working current of the first electronic device, and the first electronic device can determine a first usage duration according to formula 1:
equation 1: the first usage duration = the remaining capacity of the first electronic device/the current operating current of the first electronic device 60;
the unit of the first usage time period may be minutes (min), the unit of the remaining capacity of the first electronic device may be milliampere hours (mAh), and the unit of the current operating current of the first electronic device may be milliamperes (mA).
Mode 2
In this manner, the first electronic device obtains a variation of a first battery level of the first electronic device within a first time period determined by the first electronic device;
for example, if the first electronic device determines that the current time is 13, the time starting point of the first time period may be time 12, and the time ending point of the first time period may be 13.
The first electronic device determines a first usage duration according to formula 2:
equation 2: the first usage duration = the remaining capacity of the first electronic device/the variation of the battery capacity in the first time period × (first time period);
wherein the first usage time period and the first time period may be in minutes (min), and the remaining capacity of the first electronic device may be in milliampere hours (mAh).
In this embodiment, the duration of the first time period is not limited, for example, the duration of the first time period may be 60min, or 5 min.
Mode 3, in mode 2, the first time period determined by the first electronic device is a time period before the current time of the first electronic device, and in mode 3, the first electronic device may estimate a change amount of a battery capacity of the first electronic device at a future time, so as to estimate the first usage time period;
the specific execution flow can be seen in the following steps:
step A1, the first electronic equipment acquires a second time period, wherein the time starting point of the second time period is the current time or the time after the current time;
for example, if the first electronic device determines that the current time is 13;
in this embodiment, the duration of the second time period is not limited, for example, the duration may be 60min, and for example, the duration may be 10min, and specifically, the present embodiment is not limited, and the example that the duration of the second time period is 60min is taken as an example to exemplarily describe:
step A2, the first electronic device obtains a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period;
in the above example, the second period determined by the first electronic device may be 13;
the third time period determined by the electronic device is between 13 and 00.
Step A3, the first electronic equipment acquires the variation of the second battery capacity of the first electronic equipment in a third time period;
under the condition that the first electronic device determines the third time period, the first electronic device can count the variation of the second battery capacity of the first electronic device in the third time period;
optionally, because the variation of the second battery power in the third time period on different dates is different, the first electronic device may generate a target list according to the variation of the second battery power in the third time period on different dates, the target list is sorted according to the priority of the second battery power from high to low, the first electronic device obtains the variation of the second battery power in the highest priority in the target list, and the first electronic device determines step A4 according to the third time period with the highest priority;
and step A4, the first electronic device determines the working current according to the variation of the second battery capacity and the third time period.
Specifically, the first electronic device may calculate the operating current according to formula 3;
equation 3: the operating current of the first electronic device = the change of the battery power in the third time period;
the unit of the third time period may be minutes (min), and the unit of the variation of the battery capacity in the third time period may be milliampere-hours (mAh).
Step A5, the first electronic device determines the first usage duration according to the working current, and specifically, the first electronic device may calculate the first usage duration according to a formula 4 shown below;
equation 5: the first usage duration = remaining capacity/the operating current of the first electronic device;
the working current is obtained through the step A4, and the first service life is long.
Step 303, the first electronic device receives, from a second electronic device, a second usage duration of the remaining power of the second electronic device;
for the specific process of determining the second duration by the second electronic device, please refer to the specific process of determining the first duration by the first electronic device in detail, which is not described in detail in this embodiment.
Step 304, the first electronic device determines whether the first duration of use is greater than the second duration of use, if so, step 305 is executed, and if not, step 306 is executed.
In order to enable the charging method shown in this embodiment to implement mutual charging between the first electronic device and the second electronic device without manual operation of a user, the first electronic device is required to determine that the electronic device serving as a power supplier and the electronic device serving as a power receiver are located between the first electronic device and the second electronic device, and the specific determination process is as follows:
the first electronic device can judge whether the first use duration is longer than the second use duration, if the first use duration is longer than the second use duration, it is indicated that the normal use duration of the first electronic device is longer than the normal use duration of the second electronic device, and the first electronic device can be used as a power supplier to charge the second electronic device;
if the first usage duration is shorter than the second usage duration, it indicates that the duration in which the first electronic device can be normally used is shorter than the duration in which the second electronic device can be normally used, the first electronic device can be used as a power receiver, and the second electronic device charges the first electronic device.
Step 305, the first electronic device determines that the first electronic device is in a reverse charging mode.
In this embodiment, if the first electronic device determines that the first usage duration is longer than the second usage duration, the first electronic device may determine that the first electronic device is in a reverse charging mode, where the reverse charging mode is that the first electronic device outputs a charging current to the second electronic device, and thus the first electronic device is a power supplier at this time.
Step 306, the first electronic device determines that the first electronic device is in a forward charging mode.
In this embodiment, if the first electronic device determines that the first usage duration is less than the second usage duration, the first electronic device determines that the first electronic device is in a forward charging mode, where the forward charging mode is that the first electronic device receives a charging current output by the second electronic device, and thus the first electronic device is a power receiver at this time.
In this embodiment, the first electronic device may periodically detect a first usage duration of the first electronic device, and the first electronic device periodically receives a second usage duration sent by the second electronic device, and then the first electronic device may periodically perform the above-mentioned steps 302 to 305, for example, in a first charging period, if the first usage duration is greater than the second usage duration, the first electronic device charges the second electronic device, and in a second charging period, if the first usage duration is less than the second usage duration, the second electronic device charges the first electronic device.
The method shown by the embodiment has the advantages that:
the first electronic device and the second electronic device can be charged mutually in a wireless charging mode, and a special data line is not needed in the charging process, so that the convenience of mutual charging between the first electronic device and the second electronic device is improved;
by adopting the charging method shown in the embodiment, the first electronic device can automatically judge the power supplier and the power receiver according to the first use duration of the first electronic device and the use duration of the second electronic device, and the manual operation of a user is not needed in the charging process, so that the charging efficiency is effectively improved;
the power supplier and the power receiver are judged through the use duration, so that the use degree of the electronic equipment is fully considered in the process of determining the power supplier and the power receiver, for example, although the residual capacity of the electronic equipment is relatively large, the electronic equipment runs a plurality of applications with large power consumption, namely, the use degree of the electronic equipment is very heavy, if the electronic equipment is used as the power supplier to supply power to other electronic equipment, the situation that the electronic equipment cannot be used normally subsequently can be caused, and by adopting the method shown in the embodiment, the power supplier and the power receiver are determined through the use duration, the situation that the electronic equipment with the heavy use degree supplies power to the electronic equipment with the light use degree is avoided, and the normal use of the electronic equipment is effectively ensured.
Another implementation of the charging method shown in this embodiment is described below with reference to fig. 4:
step 401, the first electronic device and the second electronic device establish a radio connection.
Step 402, the first electronic device determines a first usage duration of the remaining power of the first electronic device;
step 403, the first electronic device receives a second usage duration of the remaining power of the second electronic device from the second electronic device;
step 404, the first electronic device determines whether the first usage duration is greater than the second usage duration, if yes, step 405 is executed, and if not, step 408 is executed.
For details of the specific execution process from step 401 to step 404 shown in this embodiment, please refer to step 301 to step 304 shown in fig. 3, and the specific execution process is not described in detail in this embodiment.
Step 405, the first electronic device obtains a second time period.
In this embodiment, when the first electronic device determines that the first usage duration is longer than the second usage duration, the first electronic device does not determine that the first electronic device is a power supplier, but obtains a second time period, where a time start point of the second time period is a current time or a time after the current time, and a detailed description of the second time period is please refer to the embodiment shown in fig. 3, which is not repeated in this embodiment.
And step 406, the first electronic device acquires a corresponding third time period according to the second time period.
For a specific description of the third time period, please refer to the embodiment shown in fig. 3 in detail, which is not repeated in this embodiment specifically.
Step 407, the first electronic device determines whether the first electronic device runs the target application in the third time period, if yes, step 408 is executed, and if not, step 409 is executed;
in this embodiment, when the first electronic device determines the third time period, the first electronic device may determine whether a target application is running in the third time period;
for example, when the current time is 21;
the specific application type of the target application is not limited in this embodiment, as long as the target application is an application with an operation power greater than or equal to a preset value, for example, the target application is a video application, a navigation application, or the like.
Step 408, the first electronic device determines that the first electronic device is in a forward charging mode.
Optionally, in step 404, if the first electronic device determines that the first usage duration is shorter than the second usage duration, the first electronic device determines that the first electronic device is in a forward charging mode, where the forward charging mode is that the first electronic device receives a charging current output by the second electronic device, and thus the first electronic device is a power receiver.
Optionally, in step 407, if the first electronic device determines that the first electronic device runs the target application in the third time period, to ensure that the target application runs normally, the first electronic device determines that the first electronic device is in the forward charging mode, and please refer to fig. 3 for a specific description of the forward charging mode, which is not described in this embodiment specifically.
Step 409, the first electronic device determines that the first electronic device is in a reverse charging mode.
If, in step 407, the first electronic device determines that the first electronic device does not run the target application in the third time period, the first electronic device may be used as a power supplier to charge the second electronic device, and please refer to fig. 3 for details of the reverse charging mode, which is not described in this embodiment.
By adopting the method shown in this embodiment, the first electronic device fully considers whether the target application with high power consumption is likely to be operated in a future time period, such as a video application in a next time period, such as a navigation application in an early peak time period, and the like, and if the first usage duration of the first electronic device is longer than the second usage duration of the second device but the probability that the target application is operated by the first electronic device in the future time period (third time period) is very high, the first electronic device cannot guarantee that the first electronic device successfully operates the target application in the third time period after being used as a power supplier.
Another implementation of the charging method shown in this embodiment is described below with reference to fig. 5:
step 501, establishing a radio connection between the first electronic device and the second electronic device.
Step 502, the first electronic device determines a first usage duration of the remaining power of the first electronic device;
step 503, the first electronic device receives, from a second electronic device, a second usage duration of the remaining power of the second electronic device;
step 504, the first electronic device determines whether the first usage duration is greater than the second usage duration, if so, step 505 is executed, and if not, step 508 is executed.
For details of the specific execution process from step 501 to step 504 shown in this embodiment, please refer to steps 301 to 304 shown in fig. 3, which are not repeated in this embodiment.
Step 505, the first electronic device detects whether the first indication information is received, if so, step 506 is executed, and if not, step 507 is executed.
In this embodiment, when the first electronic device determines that the first usage duration is longer than the second usage duration, the first electronic device does not directly determine the first electronic device as a power supplier, but detects whether first indication information input by a user is received, where the first indication information is used to indicate that the first electronic device has a highest charging priority, and the highest charging priority is that the first electronic device can only serve as a power receiver.
In this embodiment, a specific process of the first electronic device receiving the first indication information is not limited, and taking fig. 6 as an example, the first electronic device may display an operation interface 601 through a display screen 600;
prompt information can be displayed on the operation interface 601, and the prompt information is exemplarily "whether to charge or not";
a first operation key 602 and a second operation key 603 are also displayed on the operation interface 601, the first operation key 602 may display a character "no", and the second operation key 603 may display a character "yes";
under the condition that the first electronic device determines that the first using time length is longer than the second using time length, the first electronic device can automatically display an operation interface 601 through a display screen 600, if the user determines that the first electronic device is used as a power receiving party, the user can touch a second operation key 603, and under the condition that the first electronic device determines that the second operation key 603 receives a touch event, the first indication information can be generated, and then the second electronic device needs to charge the first electronic device.
Step 506, the first electronic device determines that the first electronic device is in a forward charging mode.
Optionally, in step 505, if the first electronic device determines that the first usage duration is longer than the second usage duration, but if the user needs the first electronic device as a power receiver according to his own needs, the user may input the first indication information through the operation interface shown in fig. 6, so that the second electronic device charges the first electronic device, and please see the above embodiment for a specific description of the forward charging mode, which is not repeated in this embodiment.
Optionally, in step 508, if the first electronic device determines that the first usage duration is less than the second usage duration and the second indication information is not received, the first electronic device may determine that the first electronic device is in the forward charging mode.
Step 507, the first electronic device determines that the first electronic device is in a reverse charging mode.
Optionally, in step 505, if the first duration of use is longer than the second duration of use, and the first electronic device does not receive the first indication information input by the user, the first electronic device may determine that the first electronic device is used as a charging party to charge the second electronic device, and for a specific description of the reverse charging mode, please refer to the foregoing embodiment, which is not repeated in this embodiment.
Optionally, in step 508, if the first duration of use is less than the second duration of use and the first electronic device receives the second indication information, the first electronic device may determine that the first electronic device is used as a charging party to charge the second electronic device.
Step 508, the first electronic device detects whether the second indication information is received, if yes, step 507 is executed, and if not, step 506 is executed.
In this embodiment, when the first electronic device determines that the first usage duration is less than the second usage duration, the first electronic device does not directly determine the first electronic device as a power receiver, but detects whether second indication information input by a user is received, where the second indication information is used to indicate that the second electronic device has a highest charging priority, and the highest charging priority indicates that the second electronic device can only serve as a power receiver.
Optionally, in the operation interface 601, a user may touch the first operation key 602, and when the first electronic device detects that the first operation key 602 receives a touch event, it indicates that the user inputs the second indication information by touching the first operation key 602, and the first electronic device may determine that the first electronic device is used as a power supplier according to the second indication information, and the second electronic device is used as a power receiver, and then the first electronic device may determine that the first electronic device is in a reverse charging mode.
Optionally, if the first duration of use is less than the second duration of use, and the first electronic device does not receive the second indication information input by the user, the first electronic device may determine that the first electronic device is the power-receiving party.
It can be seen that, by using the method shown in this embodiment, when the first electronic device determines that the first usage duration is longer than the second usage duration, the first electronic device detects whether first indication information input by a user is received, if the first electronic device receives the first indication information, it indicates that the user needs the first electronic device to be a power receiver according to the usage requirement of the user, even if the first electronic device determines that the first usage duration is longer than the second usage duration, the first electronic device controls the first electronic device to receive a charging current output by the second electronic device for the power receiver, when the first electronic device determines that the first usage duration is shorter than the second usage duration, the first electronic device detects whether the second indication information input by the user is received, if the first electronic device receives the second indication information, it indicates that the user needs the second electronic device to be a power receiver according to the usage requirement of the user, even if the first electronic device determines that the first usage duration is shorter than the second usage duration, the first electronic device controls the first electronic device to be a charging device capable of charging between the first electronic device and the second electronic device.
Another implementation of the charging method shown in this embodiment is described below with reference to fig. 7:
step 701, establishing a radio connection between the first electronic device and the second electronic device.
Step 702, the first electronic device determines a first usage duration of the remaining power of the first electronic device;
step 703, the first electronic device receives, from a second electronic device, a second usage duration of the remaining power of the second electronic device;
for details of the specific execution process from step 701 to step 703 shown in this embodiment, please refer to step 301 to step 303 shown in fig. 3, and the specific execution process is not described in detail in this embodiment.
Step 704, if the first electronic device determines that the first usage duration is equal to the second usage duration, the first electronic device determines that the first electronic device is in a standby mode.
In this embodiment, if the first electronic device determines that the first usage duration and the second usage duration are equal, in this embodiment, the first electronic device determines that the first electronic device is in a standby mode, that is, the first electronic device does not charge the second electronic device, and does not charge the first electronic device with the second electronic device.
Optionally, as shown in this embodiment, under the condition that the first duration of use and the second duration of use are equal, the manner shown in the foregoing embodiment may also be executed to determine the charging mode in which the first electronic device is located, for example, the first electronic device may execute steps 405 to 409 shown in fig. 4, and as another example, under the condition that the first duration of use and the second duration of use are equal, the first electronic device may execute steps 505 to 508 shown in fig. 5, so that under the condition that the first duration of use and the second duration of use are equal, wireless mutual charging may also be performed between the first electronic device and the second electronic device.
Optionally, in any one of the method embodiments, the first electronic device may detect in real time or periodically whether the first electronic device is in a wired charging mode, where the wired charging mode is that an external power source continuously charges the first electronic device through a charging line, and the first electronic device may determine that the first usage time period of the first electronic device is infinite.
The charging method provided by the present application is described in detail with reference to fig. 3 to fig. 7, and a structure of an electronic device provided by the present application is exemplarily described with reference to a function module shown in fig. 8, where the electronic device shown in this embodiment may be a first electronic device used for executing any one of the method embodiments, and the first electronic device executes a specific execution process of the charging method shown in this application, which is shown in the method embodiments and is not specifically described in this embodiment;
as shown in fig. 8, the electronic device shown in the present embodiment includes:
the processing unit 801 is configured to determine a first usage duration of the remaining power of the first electronic device;
a receiving unit 802, configured to receive, from a second electronic device, a second usage duration of a remaining power of the second electronic device;
the processing unit 801 is further configured to determine whether the first duration of use is greater than the second duration of use; if the first usage duration is longer than the second usage duration, the processing unit 801 determines that the first electronic device is in a reverse charging mode, where the reverse charging mode is that the first electronic device outputs a charging current to the second electronic device; if the first usage duration is less than the second usage duration, the processing unit 801 determines that the first electronic device is in a forward charging mode, where the forward charging mode is that the first electronic device receives a charging current output by the second electronic device.
Optionally, the processing unit 801 is specifically configured to: acquiring the residual electric quantity of the first electronic equipment; acquiring the working current of the first electronic equipment; and determining the first service time according to the residual electric quantity and the working current.
Optionally, the processing unit 801 is specifically configured to: determining a variation of a first battery capacity of the first electronic device within a first time period, wherein a time start point of the first time period is a time before a current time, and a time end point of the first time period is the current time or the time before the current time; and determining the working current according to the variable quantity of the first battery electric quantity and the first time period.
Optionally, the processing unit 801 is specifically configured to: acquiring a second time period, wherein the time starting point of the second time period is the current time or the time after the current time; acquiring a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period; acquiring the variation of the second battery capacity of the first electronic equipment in a third time period; and determining the working current according to the variation of the second battery capacity and the third time period.
Optionally, the processing unit 801 is further configured to: acquiring a second time period, wherein the time starting point of the second time period is the current time or the time after the current time; acquiring a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period; under the condition that the first electronic device is determined to run a target application in the third time period, triggering and executing the step of determining that the first electronic device is in a forward charging mode, wherein the target application is an application with a running electric quantity larger than or equal to a preset value.
Optionally, if the first duration of use is greater than the second duration of use, the receiving unit 802 is further configured to: receiving first indication information, wherein the first indication information is used for indicating that the first electronic equipment has the highest charging priority; the processing unit 801 is further configured to determine that the first electronic device is in the forward charging mode according to the indication of the first indication information.
Optionally, if the first duration of use is smaller than the second duration of use, the receiving unit 802 is further configured to: receiving second indication information, wherein the second indication information is used for indicating that the second electronic equipment has the highest charging priority; the processing unit 801 is further configured to determine that the first electronic device is in the reverse charging mode according to the indication of the second indication information.
Optionally, the processing unit 801 is further configured to determine that the first electronic device is in a standby mode if the first duration of use is equal to the second duration of use.
In one embodiment, the charging device for performing the charging method disclosed herein may be a charging device included in an electronic device, wherein in one implementation, the charging device may be a chip or an integrated circuit. In this case, the receiving unit 802 may be a communication interface, and the processing unit 801 may be a logic circuit.
Alternatively, the communication interface may be an input-output interface or a transceiving circuit. The input-output interface may include an input interface and an output interface. The transceiver circuitry may include input interface circuitry and output interface circuitry.
In one implementation, the processing unit 801 may be a processing device, and the functions of the processing device may be partially or wholly implemented by software.
Alternatively, the functions of the processing means may be partly or wholly implemented by software. At this time, the processing device may include a memory for storing the computer program and a processor for reading and executing the computer program stored in the memory to perform the corresponding processes and/or steps in any one of the method embodiments.
Alternatively, the processing means may comprise only a processor. The memory for storing the computer program is located outside the processing means and the processor is connected to the memory by means of circuits/wires for reading and executing the computer program stored in the memory.
Alternatively, the functions of the processing means may be partly or wholly implemented by hardware. At this time, the processing device may include an input interface circuit, a logic circuit, and an output interface circuit.
In one embodiment, the present application provides a computer-readable storage medium, in which a computer program is stored, and when the computer program is executed on a computer, the computer program causes the computer to execute a method corresponding to any one of the above method embodiments.
In one embodiment, the present application provides a chip including a communication interface, a memory for storing a computer program, and a processor for reading and executing the computer program stored in the memory to perform a method corresponding to any one of the above method embodiments.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (19)

1. A charging method, for a first electronic device, the charging method comprising:
the first electronic equipment determines a first use duration of the residual capacity of the first electronic equipment;
the first electronic equipment receives a second use duration of the residual capacity of the second electronic equipment from the second electronic equipment;
the first electronic equipment judges whether the first use duration is longer than the second use duration;
if the first usage duration is longer than the second usage duration, the first electronic device determines that the first electronic device is in a reverse charging mode, and the reverse charging mode is that the first electronic device outputs a charging current to the second electronic device;
if the first using time length is less than the second using time length, the first electronic device determines that the first electronic device is in a forward charging mode, and the forward charging mode is that the first electronic device receives a charging current output by the second electronic device;
the method further comprises the following steps: the first electronic equipment acquires a second time period, wherein the time starting point of the second time period is the current time or the time after the current time;
the first electronic device acquires a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period;
and the first electronic equipment triggers and executes a step that the first electronic equipment determines that the first electronic equipment is in a forward charging mode under the condition that the first electronic equipment is determined to run a target application in the third time period, wherein the target application is an application with running electric quantity greater than or equal to a preset value.
2. The charging method of claim 1, wherein the first electronic device determining a first usage duration of a remaining charge of the first electronic device comprises:
the first electronic equipment acquires the residual electric quantity of the first electronic equipment;
the first electronic equipment acquires the working current of the first electronic equipment;
and the first electronic equipment determines the first service life according to the residual electric quantity and the working current.
3. The charging method of claim 2, wherein the first electronic device obtaining the operating current of the first electronic device comprises:
the first electronic device determines a variation of a first battery capacity of the first electronic device within a first time period, wherein a time starting point of the first time period is a time before a current time, and a time ending point of the first time period is the current time or the time before the current time;
and the first electronic equipment determines the working current according to the variation of the first battery capacity and the first time period.
4. The charging method of claim 2, wherein the first electronic device obtaining the operating current of the first electronic device comprises:
the first electronic equipment acquires a second time period, wherein the time starting point of the second time period is the current time or the time behind the current time;
the first electronic equipment acquires a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period;
the first electronic equipment acquires the variation of the second battery capacity of the first electronic equipment in a third time period;
and the first electronic equipment determines the working current according to the variation of the second battery capacity and the third time period.
5. The charging method according to claim 1, wherein if the first usage period is longer than the second usage period, the method further comprises:
the first electronic equipment receives first indication information, wherein the first indication information is used for indicating that the first electronic equipment has the highest charging priority;
and the first electronic equipment determines that the first electronic equipment is in the forward charging mode according to the indication of the first indication information.
6. The charging method according to claim 1, wherein if the first usage duration is less than the second usage duration, the method further comprises:
if the first electronic device receives second indication information, the second indication information is used for indicating that the second electronic device has the highest charging priority;
and the first electronic equipment determines that the first electronic equipment is in the reverse charging mode according to the indication of the second indication information.
7. The method of claim 1, further comprising:
if the first usage duration is equal to the second usage duration, the first electronic device determines that the first electronic device is in a standby mode.
8. The method of any of claims 1-7, wherein determining, by the first electronic device, the first usage duration of the remaining power of the first electronic device comprises:
if the first electronic device detects that the first electronic device is in a wired charging mode, the first electronic device determines that the first service life of the first electronic device is infinite, and the wired charging mode means that an external power supply continuously charges the first electronic device through a charging wire.
9. An electronic device, wherein the electronic device is a first electronic device, the first electronic device comprising:
the processing unit is used for determining a first use duration of the residual electric quantity of the first electronic equipment;
the receiving unit is used for receiving a second use duration of the residual capacity of the second electronic equipment from the second electronic equipment;
the processing unit is further configured to determine whether the first duration of use is greater than the second duration of use; if the first usage duration is longer than the second usage duration, the processing unit determines that the first electronic device is in a reverse charging mode, and the reverse charging mode is that the first electronic device outputs a charging current to the second electronic device; if the first usage duration is less than the second usage duration, the processing unit determines that the first electronic device is in a forward charging mode, and the forward charging mode is that the first electronic device receives a charging current output by the second electronic device;
the processing unit is further to:
acquiring a second time period, wherein the time starting point of the second time period is the current time or the time after the current time;
acquiring a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period;
and under the condition that the first electronic device is determined to run a target application in the third time period, triggering and executing the step of determining that the first electronic device is in a forward charging mode, wherein the target application is an application with a running electric quantity greater than or equal to a preset value.
10. The electronic device of claim 9, wherein the processing unit is specifically configured to:
acquiring the residual electric quantity of the first electronic equipment;
acquiring the working current of the first electronic equipment;
and determining the first service time according to the residual electric quantity and the working current.
11. The electronic device of claim 10, wherein the processing unit is specifically configured to:
determining a variation of a first battery capacity of the first electronic device within a first time period, wherein a time starting point of the first time period is a time before a current time, and a time ending point of the first time period is the current time or the time before the current time;
and determining the working current according to the variable quantity of the first battery electric quantity and the first time period.
12. The electronic device according to claim 10, wherein the processing unit is specifically configured to:
acquiring a second time period, wherein the time starting point of the second time period is the current time or the time after the current time;
acquiring a corresponding third time period according to the second time period, wherein the starting time and the ending time of the third time period are the same as the starting time and the ending time of the second time period, and the date of the third time period is earlier than the date of the second time period;
acquiring the variation of the second battery capacity of the first electronic equipment in a third time period;
and determining the working current according to the variation of the second battery electric quantity and the third time period.
13. The electronic device of claim 9, wherein if the first duration of use is greater than the second duration of use, the receiving unit is further configured to: receiving first indication information, wherein the first indication information is used for indicating that the first electronic equipment has the highest charging priority;
the processing unit is further configured to determine that the first electronic device is in the forward charging mode according to the indication of the first indication information.
14. The electronic device of claim 9, wherein if the first duration of use is less than the second duration of use, the receiving unit is further configured to: receiving second indication information, wherein the second indication information is used for indicating that the second electronic equipment has the highest charging priority;
the processing unit is further configured to determine that the first electronic device is in the reverse charging mode according to the indication of the second indication information.
15. The electronic device of claim 9, wherein the processing unit is further configured to determine that the first electronic device is in the standby mode if the first duration of use is equal to the second duration of use.
16. The electronic device according to any one of claims 9 to 15, wherein the processing unit is specifically configured to:
if the first electronic device is detected to be in a wired charging mode, determining that the first use time of the first electronic device is infinite, wherein the wired charging mode is that an external power supply continuously charges the first electronic device through a charging wire.
17. A computer-readable storage medium, in which a computer program is stored which, when executed on a computer, causes the computer to carry out the method according to any one of claims 1 to 8.
18. A chip comprising a communication interface, a memory for storing a computer program, and a processor for reading and executing the computer program stored in the memory to perform the method of any one of claims 1-8.
19. An electronic device, comprising a transceiver, a memory for storing a computer program, and a processor for reading and executing the computer program stored in the memory to perform the method of any one of claims 1-8.
CN201910695658.1A 2019-07-30 2019-07-30 Charging method, electronic device and storage medium Active CN112311029B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910695658.1A CN112311029B (en) 2019-07-30 2019-07-30 Charging method, electronic device and storage medium
PCT/CN2020/101929 WO2021017823A1 (en) 2019-07-30 2020-07-14 Charging method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910695658.1A CN112311029B (en) 2019-07-30 2019-07-30 Charging method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN112311029A CN112311029A (en) 2021-02-02
CN112311029B true CN112311029B (en) 2023-02-03

Family

ID=74228346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910695658.1A Active CN112311029B (en) 2019-07-30 2019-07-30 Charging method, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN112311029B (en)
WO (1) WO2021017823A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112821515A (en) * 2021-02-20 2021-05-18 北京小米移动软件有限公司 Charging method, device and system
CN114301111A (en) * 2021-11-29 2022-04-08 浙江中控技术股份有限公司 Charging method and system of split process calibrator and storage medium
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
CN105790349A (en) * 2016-01-27 2016-07-20 努比亚技术有限公司 Mutual charging control method and device for mobile terminals
CN106375561A (en) * 2016-08-29 2017-02-01 上海摩软通讯技术有限公司 Mobile terminal and method of detecting surplus use time thereof
CN108235795A (en) * 2017-12-20 2018-06-29 深圳前海达闼云端智能科技有限公司 Charging method, device, terminal device and computer readable storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140304529A1 (en) * 2013-04-08 2014-10-09 Ford Meazell System and Method for Battery Power Transfer Between Mobile Devices
CN105098273B (en) * 2015-07-20 2018-11-02 小米科技有限责任公司 charging method and device
CN105680510A (en) * 2016-01-29 2016-06-15 宇龙计算机通信科技(深圳)有限公司 Charging control method and charging control device used for electronic equipment
US20180269702A1 (en) * 2017-03-15 2018-09-20 Halo2Cloud, LLC Portable power charger with customizable aesthetic feature

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105790349A (en) * 2016-01-27 2016-07-20 努比亚技术有限公司 Mutual charging control method and device for mobile terminals
CN106375561A (en) * 2016-08-29 2017-02-01 上海摩软通讯技术有限公司 Mobile terminal and method of detecting surplus use time thereof
CN108235795A (en) * 2017-12-20 2018-06-29 深圳前海达闼云端智能科技有限公司 Charging method, device, terminal device and computer readable storage medium

Also Published As

Publication number Publication date
WO2021017823A1 (en) 2021-02-04
CN112311029A (en) 2021-02-02

Similar Documents

Publication Publication Date Title
CN106786962B (en) Charging control method and device and terminal
CN112311029B (en) Charging method, electronic device and storage medium
CN106549451B (en) A kind of wireless charging method and device
JP5987121B2 (en) Battery, battery protection method, battery protection device, battery protection system, program, and recording medium therefor
CN107870666B (en) Terminal control method and terminal
CN106484326B (en) A kind of data transmission processing method and mobile terminal
CN106786961B (en) Charging method, device and terminal
CN109714476B (en) Data processing method and device, mobile terminal and storage medium
EP3570404B1 (en) Power supply control method and apparatus, storage medium, and electronic device
CN111008090B (en) Battery electric quantity control method and device, storage medium and terminal equipment
CN111273955B (en) Thermal restoration plug-in optimization method and device, storage medium and electronic equipment
CN110191215B (en) Terminal and processing method
US11556158B2 (en) On-the-go (OTG) control and configuration method, mobile terminal, and storage medium
CN111404242A (en) Charging method, charging device, storage medium and mobile terminal
CN110489177B (en) Application control method and device, storage medium and terminal equipment
CN111596827B (en) Icon display control method and device, storage medium and mobile terminal
US20150102670A1 (en) Method for operating booting and electronic device thereof
CN112367428A (en) Electric quantity display method and system, storage medium and mobile terminal
CN114503390A (en) Method for controlling charging of battery of electronic device and electronic device thereof
CN112256610B (en) Connection control method, system, storage medium and mobile terminal
US10706255B2 (en) Processing method and electronic device
CN111654848B (en) NFC card detection method and device, storage medium and mobile terminal
CN111988059B (en) Wireless data transmission method, device, storage medium and mobile terminal
CN111384754B (en) Charging method, charging device, storage medium and mobile terminal
CN111987764B (en) Discharge control method and device, storage medium and mobile terminal

Legal Events

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