WO2021017823A1 - 一种充电方法、电子设备以及存储介质 - Google Patents

一种充电方法、电子设备以及存储介质 Download PDF

Info

Publication number
WO2021017823A1
WO2021017823A1 PCT/CN2020/101929 CN2020101929W WO2021017823A1 WO 2021017823 A1 WO2021017823 A1 WO 2021017823A1 CN 2020101929 W CN2020101929 W CN 2020101929W WO 2021017823 A1 WO2021017823 A1 WO 2021017823A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
time
time period
charging
current
Prior art date
Application number
PCT/CN2020/101929
Other languages
English (en)
French (fr)
Inventor
刘凡帆
郑志勇
袁兵
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021017823A1 publication Critical patent/WO2021017823A1/zh

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

Definitions

  • This application relates to the field of communication technology, and in particular to a charging method, electronic equipment and storage medium.
  • the prior art can realize the mutual charging between the two electronic devices through the connection line (on the go, OTG).
  • the purpose of charging is carried out through OTG, two electronic devices are connected through a charging cable, and one electronic device is manually selected as the power supplier and the other electronic device is used as the charging party.
  • the embodiments of the present application provide a charging method, an electronic device, and a storage medium, which are used to charge the electronic device, and the charging process does not require a dedicated charging cable, and the power supply can be automatically determined without manual operation by the user.
  • the charging efficiency is improved by the party and the power receiving party.
  • the first aspect of the embodiments of the present invention provides a charging method, the charging method is used for a first electronic device, the charging method includes: the first electronic device determines the first electronic device remaining power Usage duration; the first electronic device receives the second usage duration of the remaining power of the second electronic device from the second electronic device; the first electronic device determines whether the first usage duration is greater than the second usage Duration; if the first usage duration is greater 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 the first electronic device Output a charging current to the second electronic device; if the first use time is less than the second use time, the first electronic device determines that the first electronic device is in the forward charging mode, and the forward The charging mode is that the first electronic device receives the charging current output by the second electronic device.
  • the first electronic device can automatically determine 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, No manual operation by the user is required in the process, which effectively improves the charging efficiency. Moreover, the power supplier and the power receiver are judged through the use time, so that the process of determining the power supplier and the power receiver fully considers the degree of use of the first electronic device. For example, although the remaining power of the first electronic device is relatively large, However, the first electronic device runs a number of power-consuming applications, that is, the first electronic device is used very heavily.
  • the method shown in this aspect is adopted to determine the power supplier and the power receiver through the use time, so as to prevent the first electronic device with a high degree of use from being a second electronic device with a light degree of use.
  • the emergence of an electronic device supplying power effectively guarantees the normal use of the first electronic device.
  • the first electronic device determining the first use duration of the remaining power of the first electronic device includes: The first electronic device obtains the remaining power of the first electronic device; the first electronic device obtains the operating current of the first electronic device; the first electronic device obtains the remaining power and the operating current according to the Determine the first use duration.
  • the first electronic device can directly determine the first use time of the remaining power of the first electronic device according to the current remaining power and working power of the first electronic device, because manual operation by the user is not required, It is convenient to automatically determine whether the first electronic device is the power supplier or the power receiver during the mutual charging process, thereby effectively improving the charging efficiency.
  • acquiring, by the first electronic device, the operating current of the first electronic device includes: the first electronic device Determine the amount of change in the first battery power of the first electronic device in a first time period, wherein the time start of the first time period is a time before the current time, and the time end of the first time period Is the current moment or a moment before the current moment; the first electronic device determines the operating current according to the amount of change in the first battery power and the first time period.
  • the first electronic device can determine according to the amount of change in the first battery power of the first electronic device in the past period of time (that is, the first period of time) and the first period of time The operating current is generated so that the first electronic device can estimate the first use time of the first electronic device based on the amount of change in the battery power of the first electronic device in the first time period that has passed.
  • acquiring, by the first electronic device, the operating current of the first electronic device includes: the first electronic device Acquire a second time period, the time starting point of the second time period is the current time or a time after the current time; the first electronic device obtains the corresponding third time period according to the second time period, so The start time and end time of the third time period are the same as the start time and end time of the second time period, and the date on which the third time period is located is earlier than the date on which the second time period is located Date; the first electronic device acquires the amount of change in the second battery power of the first electronic device in the third time period; the first electronic device according to the amount of change in the second battery power and the first Determine the operating current for three time periods.
  • the first electronic device fully considers the possible change in battery power in the future time period (the second time period), so as to respond to the change in the battery power in the future time period of the first electronic device Estimate the working current so that the first use time determined by the first electronic device fully takes into account the use of the first electronic device in the future time period, thereby avoiding large power consumption in the future time period
  • the first electronic device becomes the power supplier, thereby effectively ensuring that the first electronic device that consumes a lot of power in the future time period is used as the power supplier, so that the first electronic device cannot be used normally.
  • the method further includes: the first electronic device acquires a second time period, the second time period The time starting point of is the current time or a time after the current time; the first electronic device obtains the corresponding third time period according to the second time period, and the start time and end time of the third time period The start time and end time of the second time period are the same, and the date on which the third time period is located is earlier than the date on which the second time period is located; the first electronic device is determining the In the case that the first electronic device runs the target application within the third time period, trigger execution of the step of determining that the first electronic device is in the forward charging mode by the first electronic device, and the target application is that the running power is greater than Or the application equal to the preset value.
  • the first electronic device fully considers whether it is possible to run a target application that consumes a lot of power in the future time period. If the first use time of the first electronic device is longer than that of the second device The second use time, but the probability of the first electronic device running the target application in the future time period (the third time period) is very high, so that the first electronic device cannot guarantee the first electronic device in the third time period after being the power supplier.
  • the electronic device successfully runs the target application. It can be seen that the method shown in this embodiment can fully guarantee the operation of the target application, and avoid the situation that the first electronic device cannot normally use the target application because it is a power supplier.
  • the method further includes: An electronic device receives first indication information, where the first indication information is used to indicate that the first electronic device has the highest charging priority; the first electronic device determines the The first electronic device is in the forward charging mode.
  • the first electronic device in the case where the first electronic device determines that the first use time is greater than the second use time, the first electronic device detects whether the first electronic device inputted by the user is received An instruction message. If the first electronic device receives the first instruction information, it means that the user needs the first electronic device to act as the power receiver according to his own use needs. Even if the first electronic device determines the first electronic device In the case that the use time is longer than the second use time, the first electronic device is controlled to receive the charging current output by the second electronic device for the power receiver. It can be seen that the method shown in this aspect can be fully considered The user's needs in the process of mutual charging between the first electronic device and the second electronic device.
  • the method further includes: The first electronic device receives second indication information, where the second indication information is used to indicate that the second electronic device has the highest charging priority; the first electronic device determines the charging priority according to the indication of the second indication information.
  • the first electronic device is in the reverse charging mode.
  • the first electronic device in the case that the first electronic device determines that the first use time is less than the second use time, the first electronic device detects whether the first electronic device input by the user is received. The second instruction information. If the first electronic device receives the second instruction information, it means that the user needs the second electronic device to act as the power receiver according to his own use needs. Even if the first electronic device determines that the first electronic device When the use time is less than the second use time, the first electronic device is controlled to charge the second electronic device. It can be seen that the method shown in this aspect can fully consider the first electronic device. The user's needs in the process of mutual charging between the device and the second electronic device.
  • the method further includes: if the first use duration is equal to the second use duration, the The first electronic device determines that the first electronic device is in a standby mode.
  • 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, nor does it use the second electronic device to charge the first electronic device, thereby avoiding power consumption of the first electronic device.
  • the first electronic device determining the first use duration of the remaining power of the first electronic device includes: When 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 time of the first electronic device is infinite, and the wired charging mode means that there is external The power supply continuously charges the first electronic device through the charging cable.
  • the first electronic device detects that it is in the limited charging mode, it means that an external power source supplies power to the first electronic device, and the first electronic device The device determines that its first use time is infinite, and when the first electronic device and the second electronic device are in a mutual charging state, the first electronic device whose first time is infinite is always the power supplier and is the second electronic device Charge it.
  • a second aspect of the embodiments of the present invention provides an electronic device, where the electronic device is a first electronic device, and the first electronic device includes: a processing unit configured to determine the first electronic device of the remaining power of the first electronic device Usage duration; a receiving unit for receiving a second usage duration of the remaining power of the second electronic device from a second electronic device; the processing unit is also configured to determine whether the first usage duration is greater than the second usage duration ; If the first use duration is greater than the second use 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 pairs the The second electronic device outputs a charging current; if the first use duration is less than the second use duration, the processing unit determines that the first electronic device is in the forward charging mode, and the forward charging mode is the The first electronic device receives the charging current output by the second electronic device.
  • the processing unit is specifically configured to: obtain the remaining power of the first electronic device; Working current of the electronic device; determining the first use time period according to the remaining power and the working current.
  • the processing unit is specifically configured to: determine the first time period of the first electronic device in the first time period.
  • the amount of change in battery power wherein the time start of the first time period is a time before the current time, and the time end of the first time period is the current time or a time before the current time;
  • the amount of change in the first battery capacity and the first time period determine the operating current.
  • the processing unit is specifically configured to: obtain a second time period, and the time starting point of the second time period is The current time or a time after the current time; the corresponding third time period is acquired according to the second time period, and the start time and end time of the third time period are the same as the start time of the second time period The time and the end time are the same, and the date on which the third time period is located is earlier than the date on which the second time period is located; acquiring the change in the second battery power of the first electronic device in the third time period ⁇ ; according to the amount of change in the second battery power and the third time period, determine the working current.
  • the processing unit is further configured to: obtain a second time period, where the time starting point of the second time period is The current time or a time after the current time; the corresponding third time period is acquired according to the second time period, and the start time and end time of the third time period are the same as the start time of the second time period The time and the end time are the same, and the date on which the third time period is located is earlier than the date on which the second time period is located; when it is determined that the first electronic device runs the target application in the third time period In this case, the execution of the step of determining that the first electronic device is in the forward charging mode is triggered, and the target application is an application whose running power is greater than or equal to a preset value.
  • the receiving unit is further configured to: Receiving first indication information, where the first indication information is used to indicate that the first electronic device has the highest charging priority; the processing unit is further configured to determine the first indication information according to the indication of the first indication information An electronic device is in the forward charging mode.
  • the receiving unit is further configured to: Receiving second indication information, where the second indication information is used to indicate that the second electronic device has the highest charging priority; the processing unit is further configured to determine the second indication information according to the indication of the second indication information An electronic device is in the reverse charging mode.
  • the processing unit is further configured to: if the first use duration is equal to the second use duration, then It is determined that the first electronic device is in a standby mode.
  • the processing unit is specifically configured to: if it is detected that the first electronic device is in a wired charging mode, determine The first use time of the first electronic device is infinite, and the wired charging mode means that an external power source continuously charges the first electronic device through a charging cable.
  • a third aspect of the embodiments of the present invention 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 is caused to execute Any one of the methods.
  • a fourth aspect of the embodiments of the present invention provides a chip, including a communication interface, a memory, and a processor, the memory is used to store a computer program, and the processor is used to read and execute the computer program in the memory in the memory , To perform the method according to any one of the above-mentioned first aspects.
  • the fifth aspect of the embodiments of the present invention provides an electronic device, including a transceiver, a memory, and a processor.
  • the memory is used to store a computer program
  • the processor is used to read and execute the computer in the memory. Program to perform the method as described in any one of the first aspect above.
  • Figure 1 is a schematic structural diagram of an embodiment of an electronic device provided by this application.
  • FIG 2 is an example scene diagram of an embodiment of the charging method provided by this application.
  • FIG. 3 is a flowchart of the steps of an embodiment of the charging method provided by this application.
  • FIG. 5 is a flowchart of the steps of another embodiment of the charging method provided by this application.
  • FIG. 6 is an example scene diagram of another embodiment of the charging method provided by this application.
  • FIG. 7 is a flowchart of the steps of another embodiment of the charging method provided by this application.
  • FIG. 8 is a structural example diagram of an embodiment of an electronic device provided by this application.
  • the embodiment of the present invention provides a charging method.
  • the charging method shown in this embodiment is applied to an electronic device.
  • the structure is illustrated as an example:
  • 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 other components.
  • FIG. 1 does not constitute a limitation to the present invention. It may be a bus-shaped structure or a star-shaped structure, and may include more or more Few parts, or combination of some parts, or different parts arrangement.
  • the electronic device may be any mobile or portable electronic device, including but not limited to smart phones, mobile computers, tablet computers, personal digital assistants (personal digital assistants, PDAs), media players, smart TVs Wait.
  • smart phones mobile computers
  • tablet computers personal digital assistants (personal digital assistants, PDAs)
  • PDAs personal digital assistants
  • media players smart TVs Wait.
  • the electronic equipment includes:
  • the output unit 101 is used to output an image to be displayed.
  • the processor unit 103 is configured to run corresponding codes and process the received information to generate and output corresponding interfaces.
  • the processor unit 103 is the control center of the electronic device, which uses various interfaces and lines to connect the various parts of the entire electronic device, runs or executes software programs and/or modules stored in the storage unit, and calls the storage Data in the storage unit to perform various functions of the electronic device and/or process data.
  • the processor unit 103 may be composed of an integrated circuit (IC), for example, may be composed of a single packaged IC, or may be composed of connecting multiple packaged ICs with the same function or different functions.
  • IC integrated circuit
  • the processor unit 103 may only include a central processing unit (CPU), or a graphics processing unit (GPU), a digital signal processor (DSP), And the combination of the control chip (such as the baseband chip) in the communication unit.
  • the CPU may be a single computing core or may include multiple computing cores.
  • the storage unit 104 is used to store code and data, and the code is used by the processor unit 103 to run.
  • 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 realizes 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.
  • the program storage area can store an operating system and at least one application program required by at least one function, such as a sound playback program, an image playback program, etc.; the data storage area can store Data (such as audio data, phone book, etc.) created by the use of the device, etc.
  • the storage unit 104 may include volatile memory, and may also include non-volatile memory, such as at least one disk storage device, electronically erasable programmable read-only memory, flash memory device, such as reverse or Flash memory or reverse flash memory.
  • non-volatile memory such as at least one disk storage device, electronically erasable programmable read-only memory, flash memory device, such as reverse or Flash memory or reverse flash memory.
  • the non-volatile memory stores the operating system and application programs executed by the processor unit 103.
  • the processor unit 103 loads running programs and data from the non-volatile memory to the memory and stores digital content in a mass storage device.
  • 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 various components and/or drivers that facilitate communication between various software and hardware.
  • the application program includes any application installed on an electronic device, including but not limited to browsers, emails, instant messaging services, word processing, keyboard virtualization, widgets, encryption, digital rights management, voice recognition, Voice reproduction, positioning (for example, functions provided by the global positioning system), music playback, etc.
  • the input unit 105 is used to implement interaction between the user and the electronic device and/or input information into the electronic device.
  • the input unit 105 may receive numeric or character information input by the user to generate signal input related to user settings or function control.
  • the input unit 105 may be a touch screen, or other human-computer interaction interfaces, such as physical input keys, microphones, etc., or other external information capture devices, such as cameras.
  • the touch screen shown in the embodiment of the present invention can collect the operation actions of the user touching or approaching it.
  • the user uses fingers, stylus and other suitable objects or accessories to operate on the touch screen or close to the touch screen, and drive the corresponding connection device according to a preset program.
  • the touch screen may include two parts: a touch detection device and a touch controller.
  • the touch detection device detects the user's touch operation, converts the detected touch operation into an electric signal, and transmits the electric signal to the touch controller;
  • the touch controller receives the electric signal from the touch detection device, and It is converted into contact coordinates, and then sent to the processor unit 103.
  • the touch controller may also receive and execute commands sent by the processor unit 103.
  • the touch screen may adopt multiple types such as resistive, capacitive, infrared, and surface acoustic wave to realize the touch screen.
  • the physical input keys used by the input unit 105 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackball, mouse, joystick, etc.
  • function keys such as volume control buttons, switch buttons, etc.
  • trackball mouse
  • joystick etc.
  • the input unit 105 in the form of a microphone can collect the voice input by the user or the environment and convert it into an electrical signal form executable command by the processor unit 103.
  • the input unit 105 may also be various sensor devices, such as Hall devices, for detecting physical quantities of electronic equipment, such as force, moment, pressure, stress, position, displacement, Speed, acceleration, angle, angular velocity, number of revolutions, rotation speed, and the time when the working status changes, etc., are converted into electricity for detection and control.
  • sensor devices can also include gravity sensors, three-axis accelerometers, gyroscopes, electronic compasses, ambient light sensors, proximity sensors, temperature sensors, humidity sensors, pressure sensors, heart rate sensors, fingerprint readers, etc.
  • the communication unit 107 is configured to establish a communication channel so that the electronic device can connect to a remote server through the communication channel, and download media data from the remote server.
  • the communication unit 107 may include communication modules such as a wireless local area network (wireless local area network, wireless LAN) module, a Bluetooth module, and a baseband module, and a radio frequency (RF) circuit corresponding to the communication module for performing wireless local area network Network 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 to control the communication of each component in the electronic device, and can support direct memory access.
  • the various communication modules in the communication unit 107 generally appear in the form of integrated circuit chips, and can be selectively combined without including all communication modules and corresponding Antenna group.
  • the communication unit 107 may only include a baseband chip, a radio frequency chip, and a corresponding antenna to provide a communication function in a cellular communication system.
  • the wireless communication connection established by the communication unit 107 such as wireless local area network access or WCDMA access
  • the electronic device can be connected to a cellular network or the Internet.
  • the communication module in the communication unit 107 such as a baseband module, may be integrated into the processor unit 103.
  • the radio frequency circuit 108 is used to receive and send signals during information transmission and reception or during a call. For example, after receiving the downlink information of the base station, it is processed by the processor unit 103; in addition, the designed uplink data is sent to the base station.
  • the radio frequency circuit 108 includes well-known circuits for performing these functions, including but not limited to antenna systems, radio frequency transceivers, one or more amplifiers, tuners, one or more oscillators, digital signal processors, Decoding chipset, user identity module card, memory, etc.
  • the radio frequency circuit 108 can also communicate with the network and other devices through wireless communication.
  • the battery 109 is used to charge different parts of the electronic device to maintain its operation.
  • the battery 109 may be a built-in battery, such as a common lithium-ion battery, a nickel-hydrogen battery, and the like.
  • the battery 109 can also be defined more broadly. For example, it can also include a battery management system, a charging system, a battery failure detection circuit, a battery converter or inverter, and a battery status indicator. (Such as light-emitting diodes), and any other components associated with the generation, management and distribution of electrical energy in electronic devices.
  • the charging method shown in this application can realize wireless charging between two different electronic devices, and the electronic device needs to support the wireless charging function.
  • the structure of the electronic device with the wireless charging function is shown in FIG. 1 ,
  • the electronic device further includes a wireless charging module 111 connected to the battery 109 and also includes a transceiver coil 110 connected to the wireless charging module 111.
  • the first electronic device 201 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 Charging the second electronic device 202;
  • the wireless charging module included in the first electronic device 201 performs conversion processing such as power control, inversion, voltage stabilization, and filtering on the DC power provided by the battery to obtain AC power with a fixed power, and the transceiver coil can convert the AC power Into electromagnetic energy and transmitted to the second electronic device 202;
  • the transceiving coil can convert the electromagnetic energy from the first electronic device 201 into electric energy (that is, into induction alternating current), and transmit the induced alternating current to the wireless charging module of the second electronic device 202;
  • the charging module can perform transformation processing such as power control, rectification, voltage stabilization, and filtering on the induced AC power to obtain a fixed-power induced DC power, and use the induced DC power to charge the battery of the second electronic device to realize that the electric energy is transferred from the first electronic device. Transmission from the device 201 to the second electronic device 202.
  • the transceiver coil 110 can specifically realize the transmission of electric energy by means of electromagnetic induction, magnetic resonance transmission, etc., which is not limited here.
  • the wireless charging module of the first electronic device inputs a fixed-power alternating current 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 will transmit and receive in this changing magnetic field.
  • the coil can generate induced alternating current to realize the transmission of electric energy.
  • an electromagnetic induction type electric energy transmission method is taken as an example for description.
  • the second electronic device 202 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 For charging the first electronic device 201, the specific charging process can be referred to the above description, and the details are not described in detail.
  • Step 301 The first electronic device and the second electronic device establish a radio connection.
  • a radio connection between the first electronic device and the second electronic device needs to be established.
  • the first electronic device may periodically send a detection signal, and the detection signal is used to detect whether there is a second electronic device that can perform mutual charging with the first electronic device around the first electronic device.
  • the second electronic device that needs to perform mutual charging with the first electronic device is close to the first electronic device, that is, the transceiver coil of the first electronic device and the transceiver coil of the second electronic device are close to each other to
  • Figure 2 shows an example, that is, the back of the first electronic device is attached to the back of the second electronic device.
  • the second electronic device can receive the detection signal sent by the first electronic device, and the second electronic device can send a response signal corresponding to the detection signal to the first electronic device; In the case that the first electronic device receives the response signal, the first electronic device and the second electronic device can achieve a radio connection through electromagnetic coupling. When a wireless point connection is established between the second electronic devices, mutual charging can be performed between the first electronic device and the second electronic device.
  • the foregoing description is exemplified by taking the first electronic device sending the detection signal to the second electronic device as an example.
  • the second electronic device may also send the detection signal to the first electronic device. It is not specifically limited in this embodiment.
  • Step 302 The first electronic device determines the first use duration of the remaining power of the first electronic device
  • the first electronic device shown in this embodiment can obtain the remaining power of the first electronic device and the working current of the first electronic device, and the first electronic device can be The remaining power of the first electronic device and the operating current of the first electronic device determine the first use duration of the remaining power of the first electronic device.
  • This embodiment does not limit the specific process of how the first electronic device determines the first use duration according to the remaining power of the first electronic device, as long as the first electronic device can determine the first use
  • the time length is sufficient, and several optional implementation manners for determining the first use time length by the first electronic device are exemplified below:
  • the first electronic device obtains the current working current of the first electronic device, and the first electronic device can determine the first use duration according to formula 1:
  • First use time remaining power of the first electronic device/current working current of the first electronic device*60;
  • the unit of the first use time may be minutes (min), the unit of the remaining power of the first electronic device may be milliampere-hour (mAh), and the unit of the current working current of the first electronic device is milliamp. (mA).
  • the first electronic device acquires the amount of change in the first battery power of the first electronic device in the first time period determined by the first electronic device;
  • the time start point of the first time period is a time before the current time
  • the time end point of the first time period is the current time or a time before the current time. For example, if the first electronic The device determines that the current time is 13:30, then the time start of the first time period may be 12:00, and the time end of the first time period may be 13:30, then the first electronic device is sufficient Acquire the amount of change of the first battery power of the first electronic device in the first time period (12:00 to 13:30) of the first electronic device.
  • the first electronic device determines the first use duration according to formula 2:
  • First usage duration remaining power of the first electronic device/change of battery power in the first time period*first time period
  • the unit of the first use time and the first time period may be minutes (min), and the unit of the remaining power of the first electronic device may be milliamp-hour (mAh).
  • This embodiment does not limit the size of the duration of the first time period.
  • the duration of the first time period may be 60 minutes, or 5 minutes.
  • 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 Manner 3, the first electronic device may estimate the first time period The amount of change in the battery power of an electronic device at a future time, so as to estimate the first use time;
  • Step A1 The first electronic device acquires a second time period, and the time starting point of the second time period is the current time or a time after the current time;
  • the first electronic device may determine that the time start of the second time period is 13:00, and may also be 13:30, etc., as long as the The time starting point of the second time period may be at the current time or a time after the current time;
  • This embodiment does not limit the duration of the second time period. For example, it can be 60 minutes, or, for example, it can be 10 minutes. It is not specifically limited in this embodiment.
  • This embodiment uses the second time The duration of the segment is 60min as an example to illustrate:
  • Step A2 The first electronic device obtains a corresponding third time period according to the second time period, the start time and end time of the third time period and the start time and end time of the second time period The time is the same, and the date on which the third time period is located is earlier than the date on which the second time period is located;
  • the second time period determined by the first electronic device may be between 13:00-14:00, and the date in which the second time period is located is the current date, that is, the The date when the first electronic device executes the method shown in this embodiment.
  • the date shown in this embodiment refers to the year, month and day, such as June 20, 19, that is, the first electronic device is on June 20, 19 There is a need for mutual charging with the second electronic device every day;
  • the third time period determined by the electronic device is between 13:00 and 14:00, and the date on which the third time period is located is earlier than the date on which the second time period is located.
  • the date where the second time period is located is June 20, 19, and the date where the third time period is located may be June 19, 19, etc., which is not specifically limited in this embodiment, as long as The date on which the third time period is located is earlier than the date on which the second time period is located.
  • Step A3 The first electronic device acquires the amount of change in the second battery power of the first electronic device in a third time period
  • the first electronic device can count the change in the second battery power of the first electronic device during the third time period the amount;
  • the first electronic device may be based on the second battery power in the third time period on different days
  • the change amount of the target list is generated, the target list is sorted according to the priority of the second battery power from large to small, and the first electronic device obtains the second battery with the highest priority in the target list
  • the first electronic device determines step A4 according to the third time period with the highest priority
  • Step A4 The first electronic device determines the operating current according to the amount of change in the second battery power and the third time period.
  • the first electronic device may calculate the operating current according to formula 3;
  • the unit of the third time period may be minutes (min), and the unit of the amount of change of the battery power in the third time period may be milliamp-hours (mAh).
  • Step A5 The first electronic device determines the first use duration according to the operating current. Specifically, the first electronic device may calculate the first use duration according to formula 4 shown below;
  • the working current is the working current obtained through step A4, and the first use time period.
  • Step 303 The first electronic device receives from the second electronic device the second usage duration of the remaining power of the second electronic device;
  • Step 304 The first electronic device judges whether the first use time period is greater than the second use time period, if yes, execute step 305, and if not, execute step 306.
  • the mutual charging between the first electronic device and the second electronic device can be realized without manual operation by the user, the first electronic device needs to determine,
  • the specific determination process between the first electronic device and the second electronic device, the electronic device as the power supplier and the electronic device as the power receiver, is as follows:
  • the first electronic device may determine whether the first use duration is greater than the second use duration, and if the first use duration is greater than the second use duration, it indicates that the first electronic device can be used normally If the time period is greater than the time period during which the second electronic device can be used normally, the first electronic device can be used as a power supplier to charge the second electronic device;
  • the first use time is shorter than the second use time, it means that the normal use time of the first electronic device is shorter than the normal use time of the second electronic device, and the first electronic device can be used as On the power receiver, 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.
  • the first electronic device can determine that the first electronic device is in the reverse charging mode
  • the reverse charging mode refers to that the first electronic device outputs a charging current to the second electronic device. It can be seen that the first electronic device at this time is the power supplier.
  • Step 306 The first electronic device determines that the first electronic device is in a forward charging mode.
  • the first electronic device determines that the first use duration is less than the second use duration, the first electronic device determines that the first electronic device is in the forward charging mode, and the positive The charging mode is that the first electronic device receives the charging current output by the second electronic device. It can be seen that the first electronic device at this time is the power receiver.
  • the first electronic device can periodically detect the first use duration of the first electronic device, and the first electronic device periodically receives the second use period sent by the second electronic device. Time length, the first electronic device may periodically perform steps 302 to 305 shown above. For example, in the first charging period, if the first use time period is greater than the second use time period, then the first An electronic device charges the second electronic device. In the second charging period, if the first use time is less than the second use time, the second electronic device charges the first electronic device.
  • the embodiment does not limit the length of the period, or it can be configured by the user as required.
  • the first electronic device and the second electronic device can be mutually charged through wireless charging. During the charging process, there is no need to use a dedicated data cable, thereby improving the first electronic device and the second electronic device. For the convenience of mutual charging, when mutual charging is required, the first electronic device and the second electronic device only need to be close to each other;
  • the first electronic device can automatically determine 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, No manual operation by the user is required during the process, thus effectively improving the charging efficiency;
  • the power supplier and the power receiver are judged by the length of use, so that the process of determining the power supplier and the power receiver fully takes into account the degree of use of the electronic device. For example, although the remaining power of the electronic device is relatively large, the electronic device The device runs multiple power-consuming applications, that is, the electronic device is used very heavily. If the electronic device is used as a power supplier to supply power to other electronic devices, the electronic device will not be able to be used normally in the future. However, the method shown in this embodiment is used to determine the power supplier and the power receiver through the use time, so as to avoid the occurrence of the situation that the electronic equipment with the heavy usage is powering the electronic equipment with the light usage, and the electronic equipment is effectively protected. Normal use of equipment.
  • Step 401 The first electronic device and the second electronic device establish a radio connection.
  • Step 402 The first electronic device determines a first use duration of the remaining power of the first electronic device
  • Step 403 The first electronic device receives from the second electronic device the second usage duration of the remaining power of the second electronic device;
  • Step 404 The first electronic device judges whether the first use time period is greater than the second use time period, if yes, execute step 405, and if not, execute step 408.
  • step 401 to step 404 shown in this embodiment please refer to step 301 to step 304 shown in FIG. 3 for details, and the specific execution process is not described in detail in this embodiment.
  • Step 405 The first electronic device obtains a second time period.
  • the first electronic device when the first electronic device determines that the first use time is greater than the second use time, the first electronic device first determines that the first electronic device is the power supplier, and It is the acquisition of the second time period, where the time starting point of the second time period is the current time or a time after the current time.
  • the second time period For a specific description of the second time period, please refer to Figure 3 The illustrated embodiment will not be described in detail in this embodiment.
  • Step 406 The first electronic device obtains a corresponding third time period according to the second time period.
  • the start time and end time of the third time period are the same as the start time and end time of the second time period, and the date on which the third time period is located is earlier than the second time period
  • the third time period for the date on which it is located please refer to the embodiment shown in FIG. 3 for details, and details are not repeated in this embodiment.
  • Step 407 The first electronic device judges whether the first electronic device is running the target application in the third time period, if yes, execute step 408, and if not, execute step 409;
  • the first electronic device when the first electronic device determines the third time period, the first electronic device can determine whether there is a target application running in the third time period;
  • the current time is 21:00
  • the third time period is 21:00 to 22:00
  • the target application is a video application
  • the current time is on June 20, 19
  • the first The date of the three time periods is June 19, 19, and the first electronic device determines that between 21:00 and 22:00 on June 19, 19, the first electronic device consumes For video applications with large battery power, between 21:00 and 22:00 on June 20, 19, the probability of the first electronic device running the video application is very high.
  • the first electronic device If it is determined as the power supplier, after the first electronic device charges the second electronic device, the remaining power of the first electronic device will not be able to meet the operation of the target application that consumes a lot of power, in order to prevent the first electronic device from failing to operate normally In the case of the target application, if the first electronic device determines that the target application is running in the third time period, the first electronic device will not supply power to the second electronic device;
  • This embodiment does not limit the specific application type of the target application, as long as the target application is an application whose running power is greater than or equal to a preset value, for example, the target application is a video application, a navigation application, etc. .
  • Step 408 The first electronic device determines that the first electronic device is in a forward charging mode.
  • the first electronic device determines that the first use duration is less than the second use duration, the first electronic device determines that the first electronic device is in the forward charging mode, In the forward charging mode, the first electronic device receives the charging current output by the second electronic device. It can be seen that the first electronic device at this time is the power receiver.
  • the first electronic device determines that the first electronic device runs the target application within the third time period, in order to ensure the normal operation of the target application, the first electronic device The device determines that the first electronic device is in the forward charging mode.
  • the forward charging mode please refer to FIG. 3 for details, and details are not described in this embodiment.
  • Step 409 The first electronic device determines that the first electronic device is in a reverse charging mode.
  • step 407 if 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 can serve as the power supplier for the second electronic device.
  • the device is charged.
  • Fig. 3 For a specific description of the reverse charging mode, please refer to Fig. 3, which is not described in detail in this embodiment.
  • the first electronic device fully considers whether it is possible to run a target application that consumes a lot of power in the future time period, such as a video application in the low shift time period, such as the morning peak time period. If the first use time of the first electronic device is greater than the second use time of the second device, but the probability of the first electronic device running the target application in the future time period (third time period) is very high , After the first electronic device is used as the power supplier, it is impossible to ensure that the first electronic device successfully runs the target application in the third time period. It can be seen that the method shown in this embodiment can fully guarantee the operation of the target application and avoid The first electronic device is unable to use the target application normally because it is the power supplier.
  • Step 501 The first electronic device and the second electronic device establish a radio connection.
  • Step 502 The first electronic device determines the first use duration of the remaining power of the first electronic device
  • Step 503 The first electronic device receives from the second electronic device the second usage duration of the remaining power of the second electronic device.
  • Step 504 The first electronic device judges whether the first use time period is greater than the second use time period, if yes, execute step 505, and if not, execute step 508.
  • step 501 to step 504 shown in this embodiment please refer to step 301 to step 304 shown in FIG. 3 for details, and the specific execution process will not be repeated in this embodiment.
  • Step 505 The first electronic device detects whether the first indication information is received, if yes, then execute step 506, if not, execute step 507.
  • the first electronic device in a case where the first electronic device determines that the first use duration is greater than the second use duration, the first electronic device does not directly determine the first electronic device as the power supplier, Instead, it detects whether the first indication information input by the user is received.
  • the first indication information is used to indicate that the first electronic device has the highest charging priority.
  • the highest charging priority refers to the first Electronic equipment can only act as a power receiver.
  • the first electronic device may display an operation interface 601 through the display screen 600;
  • Prompt information may be displayed on the operation interface 601, and the prompt information is exemplarily "whether to charge”;
  • the operation interface 601 also displays a first operation button 602 and a second operation button 603.
  • the first operation button 602 can display the character "No", and the second operation button 603 can display the character "Yes”. ;
  • the first electronic device determines that the first use time is greater than the second use time
  • the first electronic device will automatically display the operation interface 601 through the display screen 600. If the user determines that the first electronic device is the recipient On the other hand, the user can touch the second operation button 603. When the first electronic device determines that the second operation button 603 receives a touch event, it can generate the first indication information, and the second electronic device needs to be The first electronic device is charged.
  • Step 506 The first electronic device determines that the first electronic device is in a forward charging mode.
  • the first electronic device determines that the first use time is greater than the second use time, but if the user needs the first electronic device as the power receiver according to his own needs In this case, the user can input the first instruction information through the operation interface as shown in FIG. 6, so that the second electronic device can charge the first electronic device, and the details of the forward charging mode
  • the details of the forward charging mode please refer to the above-mentioned embodiment for details, and details are not repeated in this embodiment.
  • step 508 when the first electronic device determines that the first use duration is less than the second use duration, and the second indication information is not received, the first electronic device An electronic device can 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.
  • the first electronic device may determine The first electronic device is used as a charging party to charge the second electronic device.
  • the reverse charging mode please refer to the above-mentioned embodiment for details, which will not be repeated in this embodiment.
  • step 508 if through step 508, if the first use duration is less than the second use duration, and the first electronic device receives the second indication information, the first electronic device That is, it can be determined 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 instruction information is received, if yes, execute step 507, and if not, execute step 506.
  • the first electronic device determines that the first use duration is less than the second use duration, the first electronic device does not directly determine the first electronic device as the power recipient , But to detect whether the second instruction information input by the user is received.
  • the second instruction information is used to indicate that the second electronic device has the highest charging priority.
  • the highest charging priority refers to the first 2.
  • Electronic equipment can only act as a power receiver.
  • the user can touch the first operation button 602.
  • the first electronic device detects that the first operation button 602 receives a touch event, it indicates that the user touches
  • the first operation button 602 is used to input the second instruction information, and the first electronic device can determine according to the second instruction information that the first electronic device is the power supplier and the second electronic device is the receiver. If it is the electricity supplier, the first electronic device can determine that the first electronic device is in the reverse charging mode.
  • the first electronic device may determine the first electronic device The device acts as the power receiver.
  • the first electronic device detects whether a user input is received The first instruction information. If the first electronic device receives the first instruction information, it means that the user needs the first electronic device to act as the power receiver according to his own use needs, and even if the first electronic device determines that the In the case that the first use time is greater than the second use time, the first electronic device is controlled to receive the charging current output by the second electronic device for the power receiver, and the first electronic device determines the first When the use time is less than the second use time, the first electronic device detects whether the second instruction information input by the user is received, and if the first electronic device receives the second instruction information, it indicates that the user uses If demand, the second electronic device is required as the power receiver, even if the first electronic device determines that the first use time is less than the second use time, the first electronic device is controlled The electric party charges the second electronic device. It can be seen that
  • Step 701 The first electronic device and the second electronic device establish a radio connection.
  • Step 702 The first electronic device determines the first use duration of the remaining power of the first electronic device.
  • Step 703 The first electronic device receives from the second electronic device the second usage duration of the remaining power of the second electronic device;
  • step 701 to step 703 shown in this embodiment please refer to step 301 to step 303 shown in FIG. 3 for details, and the specific execution process is not repeated in this embodiment.
  • Step 704 The first electronic device determines that the first use duration is equal to the second use duration, then the first electronic device determines that the first electronic device is in a standby mode.
  • the first electronic device determines that the first use duration and the second use duration are equal, then in this embodiment, the first electronic device determines that the first electronic device is in Standby mode, that is, the first electronic device does not charge the second electronic device, nor does the second electronic device charge the first electronic device.
  • the method shown in the foregoing embodiment can also be executed to determine the location of the first electronic device.
  • the first electronic device can perform step 405 to step 409 shown in FIG. 4, another example is that when the first use time period is equal to the second use time period, the The first electronic device can perform steps 505 to 508 shown in FIG. 5, so that when the first use duration and the second use duration are equal, the first electronic device and the second Wireless mutual charging can also be performed between electronic devices.
  • the first electronic device may detect whether the first electronic device is in a wired charging mode in real time or periodically, where the wired charging mode means that an external power source passes through the charging cable.
  • the first electronic device can determine that the first use time of the first electronic device is infinite.
  • the first electronic device and the first electronic device When the two electronic devices perform wireless mutual charging, regardless of the size of the second use period of the second electronic device, the first electronic device can determine that the first use period is greater than the second use period, then The first electronic device determines that the first electronic device continuously charged by the external power supply serves as the power supplier, and the second electronic device serves as the power receiver.
  • the charging method provided by the present application is described in detail above in conjunction with FIGS. 3 to 7, and the structure of the electronic device provided by the present application will be exemplified from the perspective of the functional module shown in FIG. 8.
  • the electronic device shown in the embodiment may be the first electronic device used to execute any of the above method embodiments.
  • the first electronic device executes the specific execution process of the charging method shown in this application. Please refer to the above method implementation for details. As shown in the example, details will not be repeated in this embodiment;
  • the electronic device shown in this embodiment includes:
  • the processing unit 801 is configured to determine the first use duration of the remaining power of the first electronic device
  • the receiving unit 802 is configured to receive from the second electronic device the second usage duration of the remaining power of the second electronic device;
  • the processing unit 801 is further configured to determine whether the first use duration is greater than the second use duration; if the first use duration is greater than the second use duration, the processing unit 801 determines the first use duration An electronic device is in a reverse charging mode, where the first electronic device outputs a charging current to the second electronic device; if the first use time is less than the second use time, then The processing unit 801 determines that the first electronic device is in a forward charging mode, and the forward charging mode is that the first electronic device receives the charging current output by the second electronic device.
  • the processing unit 801 is specifically configured to: obtain the remaining power of the first electronic device; obtain the working current of the first electronic device; determine the first electronic device according to the remaining power and the working current One use time.
  • the processing unit 801 is specifically configured to: determine the amount of change in the first battery power of the first electronic device in a first time period, where the time starting point of the first time period is at the current time At the previous time, the time end of the first time period is the current time or a time before the current time; the operating current is determined according to the amount of change in the first battery power and the first time period .
  • the processing unit 801 is specifically configured to: obtain a second time period, where the time starting point of the second time period is the current time or a time after the current time; and obtain the corresponding time period according to the second time period.
  • the third time period, the start time and end time of the third time period are the same as the start time and end time of the second time period, and the date on which the third time period is located is earlier than the The date on which the second time period is located; obtain the amount of change in the second battery power of the first electronic device in the third time period; determine according to the amount of change in the second battery power and the third time period The working current.
  • the processing unit 801 is further configured to: obtain a second time period, where the time starting point of the second time period is the current time or a time after the current time; and obtain the corresponding time period according to the second time period.
  • the third time period, the start time and end time of the third time period are the same as the start time and end time of the second time period, and the date on which the third time period is located is earlier than the The date on which the second time period is located; in the case of determining that the first electronic device is running the target application in the third time period, trigger execution of the step of determining that the first electronic device is in the forward charging mode ,
  • the target application is an application whose running power is greater than or equal to a preset value.
  • the receiving unit 802 is further configured to: receive first indication information, where the first indication information is used to indicate the first electronic device It 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.
  • the receiving unit 802 is further configured to: receive second indication information, where the second indication information is used to indicate the second electronic device It 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.
  • the processing unit 801 is further configured to, if the first use duration is equal to the second use duration, determine that the first electronic device is in a standby mode.
  • the charging device included in the electronic device may be used to perform the charging method shown in the present application.
  • the charging device may be a chip or an integrated circuit.
  • the receiving unit 802 may be a communication interface
  • the processing unit 801 may be a logic circuit.
  • the communication interface may be an input/output interface or a transceiver circuit.
  • the input and output interface may include an input interface and an output interface.
  • the transceiver circuit may include an input interface circuit and an output interface circuit.
  • the processing unit 801 may be a processing device, and the functions of the processing device may be partially or fully implemented by software.
  • the functions of the processing device may be partially or fully implemented by software.
  • the processing device may include a memory and a processor, where the memory is used to store a computer program, and the processor reads and executes the computer program stored in the memory to perform corresponding processing and/or steps in any method embodiment.
  • the processing device may only include a processor.
  • the memory for storing the computer program is located outside the processing device, and the processor is connected to the memory through a circuit/wire to read and execute the computer program stored in the memory.
  • the functions of the processing device may be partially or fully implemented by hardware.
  • the processing device may include an input interface circuit, a logic circuit, and an output interface circuit.
  • the embodiment of the present application provides a computer-readable storage medium in which a computer program is stored.
  • the computer program When the computer program is executed on a computer, the computer can execute any of the above The method corresponding to the method embodiment.
  • the embodiment of the present application provides a chip, including a communication interface, a memory, and a processor.
  • the memory is used to store a computer program
  • the processor is used to read and execute the memory in the memory.
  • the disclosed system, device, and method can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present invention essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method in each embodiment of the present invention.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .

Abstract

一种充电方法、电子设备以及存储介质,方法包括:第一电子设备(201)确定第一电子设备(201)的剩余电量的第一使用时长;第一电子设备(201)从第二电子设备(202)接收第二电子设备(202)的剩余电量的第二使用时长;第一电子设备(201)判断第一使用时长是否大于第二使用时长;若第一使用时长大于第二使用时长,则第一电子设备(201)确定第一电子设备(201)处于反向充电模式,若第一使用时长小于第二使用时长,则第一电子设备(201)确定第一电子设备(201)处于正向充电模式,第一电子设备(201)能够根据第一电子设备(201)的第一使用时长和第二电子设备(202)的使用时长,自动判断出供电方和受电方,在充电的过程中无需用户的手动操作,从而有效的提高了充电效率。

Description

一种充电方法、电子设备以及存储介质
本申请要求于2019年7月30日提交中国专利局、申请号为201910695658.1、发明名称为“一种充电方法、电子设备以及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及通信技术领域,尤其涉及一种充电方法、电子设备以及存储介质。
背景技术
随着如智能手机等电子设备使用的越来越频繁,同时电子设备的性能也越来越强多样,使得电子设备在使用过程中所耗费的功耗也越来越高,则需要在使用的过程中,频繁的对电子设备进行充电。
在户外或难以找到固定插座的场景下,为实现两个不同的电子设备之间进行互相充电的目的,现有技术可通过连接线(on the go,OTG)实现两个电子设备之间的互充的目的。通过OTG进行不同的电子设备之间的互充,通过充电线将2台电子设备连接好,手动操作选择一台电子设备作为供电方,另外一台电子设备作为充电方。
但是,通过OTG实现2台电子设备之间的互充,需要专用的充电线,降低了对电子设备进行充电的便利性,而且充电过程中需要用户手动操作选定供电方和充电方,降低了对电子设备进行充电的效率。
发明内容
本申请实施例提供了一种充电方法、电子设备以及存储介质,其用于对电子设备进行充电,且充电的过程无需专用的充电线,无需用户手动操作的情况下,即可自动确定出供电方和受电方,提高了充电效率。
本发明实施例第一方面提供了一种充电方法,所述充电方法用于第一电子设备,所述充电方法包括:所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长;所述第一电子设备从第二电子设备接收所述第二电子设备的剩余电量的第二使用时长;所述第一电子设备判断所述第一使用时长是否大于所述第二使用时长;若所述第一使用时长大于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于反向充电模式,所述反向充电模式为所述第一电子设备对所述第二电子设备输出充电电流;若所述第一使用时长小于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于正向充电模式,所述正向充电模式为所述第一电子设备接收所述第二电子设备输出的充电电流。
可见,采用本方面所示的充电方法,所述第一电子设备能够根据第一电子设备的第一使用时长和第二电子设备的使用时长,自动判断出供电方和受电方,在充电的过程中无需用户的手动操作,从而有效的提高了充电效率。而且通过使用时长判断供电方和受电方,从而使得确定供电方和受电方的过程中,充分的考虑到了第一电子设备的使用程度,例如,虽然第一电子设备的剩余电量比较大,但是,该第一电子设备运行了多个耗电量大的应用,即该第一电子设备的使用程度非常重,若使得该第一电子设备作为供电方为其他电子设备进行供电,则会导致该第一电子设备后续无法正常使用的情况的出现,而采用本方面所示的方法,通过使用时长确定供电方和受电方,避免了使用程度重的第一电子设备为使用程 度轻的第一电子设备进行供电的情况的出现,有效的保障了第一电子设备的正常使用。
基于本发明实施例第一方面,本发明实施例第一方面的一种可选的实现方式中,所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长包括:所述第一电子设备获取所述第一电子设备的剩余电量;所述第一电子设备获取所述第一电子设备的工作电流;所述第一电子设备根据所述剩余电量和所述工作电流,确定所述第一使用时长。
采用本方面所示的方法,第一电子设备可根据第一电子设备当前所剩余的剩余电量和工作电量可直接确定出第一电子设备的剩余电量的第一使用时长,因无需用户手动操作,可便于自动确定该第一电子设备在互充过程中,是供电方还是受电方,以有效的提高了充电效率。
基于本发明实施例第一方面,本发明实施例第一方面的一种可选的实现方式中,所述第一电子设备获取所述第一电子设备的工作电流包括:所述第一电子设备确定第一时间段内的所述第一电子设备的第一电池电量的变化量,其中,所述第一时间段的时间起点为位于当前时刻之前的时刻,所述第一时间段的时间终点为所述当前时刻或所述当前时刻之前的时刻;所述第一电子设备根据所述第一电池电量的变化量以及所述第一时间段,确定所述工作电流。
采用本方面所示的方法,所述第一电子设备可根据过去一段时间(即第一时间段)内,所述第一电子设备的第一电池电量的变化量和所述第一时间段确定出所述工作电流,从而使得第一电子设备能够基于该第一电子设备在已过去的第一时间段内的电池电量的变化量,估计出第一电子设备的第一使用时长。
基于本发明实施例第一方面,本发明实施例第一方面的一种可选的实现方式中,所述第一电子设备获取所述第一电子设备的工作电流包括:所述第一电子设备获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;所述第一电子设备根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;所述第一电子设备获取第三时间段内的所述第一电子设备的第二电池电量的变化量;所述第一电子设备根据所述第二电池电量的变化量以及所述第三时间段,确定所述工作电流。
采用本方面所示的方法,所述第一电子设备充分考虑到了未来时间段内(第二时间段)的电池电量可能的变化量,从而根据第一电子设备未来时间段内的电池电量的变化量估计出工作电流,以使所述第一电子设备所确定出的第一使用时长充分考虑到了在未来时间段内该第一电子设备的使用情况,从而使得避免在未来时间段内耗电量较大的第一电子设备成为供电方的情况,从而有效的保障了未来时间段内耗电量大的第一电子设备作为供电方,以使第一电子设备无法正常使用的情况的出现。
基于本发明实施例第一方面,本发明实施例第一方面的一种可选的实现方式中,所述方法还包括:所述第一电子设备获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;所述第一电子设备根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻 相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;所述第一电子设备在确定所述第一电子设备在所述第三时间段内运行目标应用的情况下,触发执行所述第一电子设备确定所述第一电子设备处于正向充电模式的步骤,所述目标应用为运行电量大于或等于预设值的应用。
采用本实施例所示的方法,所述第一电子设备充分考虑到了未来时间段内是否有可能运行有耗电量大的目标应用,若第一电子设备的第一使用时长大于第二设备的第二使用时长,但是第一电子设备在未来时间段(第三时间段)内运行目标应用的概率非常大,则使得第一电子设备作为供电方后,无法在第三时间段内保障第一电子设备成功运行目标应用,可见,采用本实施例所示的方法,能够充分保障目标应用的运行,避免了第一电子设备因作为供电方,无法正常使用目标应用的情况的出现。
基于本发明实施例第一方面,本发明实施例第一方面的一种可选的实现方式中,若所述第一使用时长大于所述第二使用时长,所述方法还包括:所述第一电子设备接收第一指示信息,所述第一指示信息用于指示所述第一电子设备具有最高的充电优先级;所述第一电子设备根据所述第一指示信息的指示,确定所述第一电子设备处于所述正向充电模式。
可见,采用本方面所示的方法,在所述第一电子设备确定出所述第一使用时长大于所述第二使用时长的情况下,所述第一电子设备检测是否接收到用户输入的第一指示信息,若第一电子设备接收到第一指示信息,则说明用户根据自身的使用需求,需要所述第一电子设备作为受电方,则所述第一电子设备即便判断出所述第一使用时长大于所述第二使用时长的情况下,控制所述第一电子设备为受电方接收第二电子设备的输出的充电电流,可见,采用本方面所示的方法,能够充分考虑到第一电子设备和第二电子设备之间互充的过程中用户的需求。
基于本发明实施例第一方面,本发明实施例第一方面的一种可选的实现方式中,若所述第一使用时长小于所述第二使用时长,所述方法还包括:若所述第一电子设备接收第二指示信息,所述第二指示信息用于指示所述第二电子设备具有最高的充电优先级;所述第一电子设备根据所述第二指示信息的指示,确定所述第一电子设备处于所述反向充电模式。
可见,采用本方面所示的方法,在所述第一电子设备确定出所述第一使用时长小于所述第二使用时长的情况下,所述第一电子设备检测是否接收到用户输入的第二指示信息,若第一电子设备接收到第二指示信息,则说明用户根据自身的使用需求,需要所述第二电子设备作为受电方,则所述第一电子设备即便判断出所述第一使用时长小于所述第二使用时长的情况下,控制所述第一电子设备为冲电方为第二电子设备进行充电,可见,采用本方面所示的方法,能够充分考虑到第一电子设备和第二电子设备之间互充的过程中用户的需求。
基于本发明实施例第一方面,本发明实施例第一方面的一种可选的实现方式中,所述方法还包括:若所述第一使用时长等于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于待机模式。
采用本方面所示的方法,若所述第一电子设备确定出所述第一使用时长和所述第二使用时长相等,则所述第一电子设备确定所述第一电子设备处于待机模式,即所述第一电子 设备不为所述第二电子设备充电,也不用第二电子设备为第一电子设备进行充电,从而避免了对第一电子设备的电量的耗费。
基于本发明实施例第一方面,本发明实施例第一方面的一种可选的实现方式中,所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长包括:若所述第一电子设备检测到所述第一电子设备处于有线充电模式,则所述第一电子设备确定所述第一电子设备的第一使用时长为无穷大,所述有线充电模式是指有外部电源通过充电线为所述第一电子设备持续充电。
可以理解的是,采用本方面所示的方法,若所述第一电子设备检测到其处于有限充电模式下,则说明有外部电源为所述第一电子设备进行供电,则所述第一电子设备确定其第一使用时长为无穷大,则在第一电子设备和第二电子设备处于互充状态时,第一时长时长处于无穷大的第一电子设备始终作为供电方,为所述第二电子设备进行充电。
本发明实施例第二方面提供了一种电子设备,所述电子设备为第一电子设备,所述第一电子设备包括:处理单元,用于确定所述第一电子设备的剩余电量的第一使用时长;接收单元,用于从第二电子设备接收第二电子设备的剩余电量的第二使用时长;所述处理单元还用于,判断所述第一使用时长是否大于所述第二使用时长;若所述第一使用时长大于所述第二使用时长,则所述处理单元确定所述第一电子设备处于反向充电模式,所述反向充电模式为所述第一电子设备对所述第二电子设备输出充电电流;若所述第一使用时长小于所述第二使用时长,则所述处理单元确定所述第一电子设备处于正向充电模式,所述正向充电模式为所述第一电子设备接收所述第二电子设备输出的充电电流。
本方面所示电子设备执行充电方法的具体过程以及有益效果的具体说明,请详见上述第一方面所示,具体不做赘述。
基于本发明实施例第二方面,本发明实施例第二方面的一种可选的实现方式中,所述处理单元具体用于:获取所述第一电子设备的剩余电量;获取所述第一电子设备的工作电流;根据所述剩余电量和所述工作电流,确定所述第一使用时长。
基于本发明实施例第二方面,本发明实施例第二方面的一种可选的实现方式中,所述处理单元具体用于:确定第一时间段内的所述第一电子设备的第一电池电量的变化量,其中,所述第一时间段的时间起点为位于当前时刻之前的时刻,所述第一时间段的时间终点为所述当前时刻或所述当前时刻之前的时刻;根据所述第一电池电量的变化量以及所述第一时间段,确定所述工作电流。
基于本发明实施例第二方面,本发明实施例第二方面的一种可选的实现方式中,所述处理单元具体用于:获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;获取第三时间段内的所述第一电子设备的第二电池电量的变化量;根据所述第二电池电量的变化量以及所述第三时间段,确定所述工作电流。
基于本发明实施例第二方面,本发明实施例第二方面的一种可选的实现方式中,所述 处理单元还用于:获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;在确定所述第一电子设备在所述第三时间段内运行目标应用的情况下,触发执行所述确定所述第一电子设备处于正向充电模式的步骤,所述目标应用为运行电量大于或等于预设值的应用。
基于本发明实施例第二方面,本发明实施例第二方面的一种可选的实现方式中,若所述第一使用时长大于所述第二使用时长,则所述接收单元还用于:接收第一指示信息,所述第一指示信息用于指示所述第一电子设备具有最高的充电优先级;所述处理单元还用于,根据所述第一指示信息的指示,确定所述第一电子设备处于所述正向充电模式。
基于本发明实施例第二方面,本发明实施例第二方面的一种可选的实现方式中,若所述第一使用时长小于所述第二使用时长,则所述接收单元还用于:接收第二指示信息,所述第二指示信息用于指示所述第二电子设备具有最高的充电优先级;所述处理单元还用于,根据所述第二指示信息的指示,确定所述第一电子设备处于所述反向充电模式。
基于本发明实施例第二方面,本发明实施例第二方面的一种可选的实现方式中,所述处理单元还用于,若所述第一使用时长等于所述第二使用时长,则确定所述第一电子设备处于待机模式。
基于本发明实施例第二方面,本发明实施例第二方面的一种可选的实现方式中,所述处理单元具体用于:若检测到所述第一电子设备处于有线充电模式,则确定所述第一电子设备的第一使用时长为无穷大,所述有线充电模式是指有外部电源通过充电线为所述第一电子设备持续充电。
本发明实施例第三方面提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在计算机上执行时,使得计算机执行如上述第一方面中任一项所述的方法。
本发明实施例第四方面提供了一种芯片,包括通信接口、存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于读取并执行所述存储器中存储器的所述计算机程序,以执行如上述第一方面中任一项所述的方法。
本发明实施例第五方面提供了一种电子设备,包括收发器、存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于读取并执行所述存储器中存储器的所述计算机程序,以执行如上述第一方面中任一项所述的方法。
附图说明
图1为本申请所提供的电子设备的一种实施例结构示意图;
图2为本申请所提供的充电方法的一种实施例场景示例图;
图3为本申请所提供的充电方法的一种实施例步骤流程图;
图4为本申请所提供的充电方法的另一种实施例步骤流程图;
图5为本申请所提供的充电方法的另一种实施例步骤流程图;
图6为本申请所提供的充电方法的另一种实施例场景示例图;
图7为本申请所提供的充电方法的另一种实施例步骤流程图;
图8为本申请所提供的电子设备的一种实施例结构示例图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本申请中出现的术语“和/或”,可以是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本申请中字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或模块的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或模块,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或模块。
本发明实施例提供了一种充电方法,本实施例所示的充电方法应用电子设备,为更好的理解本申请所提供的充电方法,以下首先结合图1所示对所述电子设备的具体结构进行示例性说明:
所述电子设备包括输入单元105、处理器单元103、输出单元101、通信单元107、存储单元104、射频电路108等组件。
这些组件通过一条或多条总线进行通信。本领域技术人员可以理解,图1中示出的电子设备的结构并不构成对本发明的限定,它既可以是总线形结构,也可以是星型结构,还可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
在本发明实施方式中,所述电子设备可以是任何移动或便携式电子设备,包括但不限于智能手机、移动电脑、平板电脑、个人数字助理(personal digital assistant,PDA)、媒体播放器、智能电视等。
所述电子设备包括:
输出单元101,用于输出待显示的图像。
处理器单元103,用于运行相应的代码,对接收信息进行处理,以生成并输出相应的界面。
具体的,所述处理器单元103为电子设备的控制中心,利用各种接口和线路连接整个电子设备的各个部分,通过运行或执行存储在存储单元内的软件程序和/或模块,以及调用存储在存储单元内的数据,以执行电子设备的各种功能和/或处理数据。所述处理器单元103可以由集成电路(integrated circuit,IC)组成,例如可以由单颗封装的IC所组成,也可以由连接多颗相同功能或不同功能的封装IC而组成。
举例来说,所述处理器单元103可以仅包括中央处理器(central processing unit,CPU),也可以是图形处理器(graphics processing unit,GPU),数字信号处理器(digital signal processor,DSP)、及通信单元中的控制芯片(例如基带芯片)的组合。在本发明实施方式中,CPU可以是单运算核心,也可以包括多运算核心。
存储单元104,用于存储代码和数据,代码供处理器单元103运行。
具体的,存储单元104可用于存储软件程序以及模块,处理器单元103通过运行存储在存储单元104的软件程序以及模块,从而执行电子设备的各种功能应用以及实现数据处理。存储单元104主要包括程序存储区和数据存储区,其中,程序存储区可存储操作系统、至少一个功能所需的应用程序,比如声音播放程序、图像播放程序等等;数据存储区可存储根据电子设备的使用所创建的数据(比如音频数据、电话本等)等。在本发明具体实施方式中,存储单元104可以包括易失性存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、电子可擦除可编程只读存储器、闪存器件,例如反或闪存或是反及闪存。
非易失存储器储存处理器单元103所执行的操作系统及应用程序。所述处理器单元103从所述非易失存储器加载运行程序与数据到内存并将数字内容储存于大量储存装置中。所述操作系统包括用于控制和管理常规系统任务,例如内存管理、存储设备控制、电源管理等,以及有助于各种软硬件之间通信的各种组件和/或驱动器。
所述应用程序包括安装在电子设备上的任何应用,包括但不限于浏览器、电子邮件、即时消息服务、文字处理、键盘虚拟、窗口小部件(Widget)、加密、数字版权管理、语音识别、语音复制、定位(例如由全球定位系统提供的功能)、音乐播放等等。
输入单元105,用于实现用户与电子设备的交互和/或信息输入到电子设备中。
例如,所述输入单元105可以接收用户输入的数字或字符信息,以产生与用户设置或功能控制有关的信号输入。在本发明具体实施方式中,输入单元105可以是触摸屏,也可以是其他人机交互界面,例如实体输入键、麦克风等,还可是其他外部信息撷取装置,例如摄像头等。
本发明实施例所示的触摸屏,可收集用户在其上触摸或接近的操作动作。比如用户使用手指、触笔等任何适合的物体或附件在触摸屏上或接近触摸屏的位置的操作动作,并根据预先设定的程式驱动相应的连接装置。可选的,触摸屏可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸操作,并将检测到的触摸操作转换为电信号,以及将所述电信号传送给触摸控制器;触摸控制器从触摸检测装置上接收所述电信号,并将它转换成触点坐标,再送给所述处理器单元103。
所述触摸控制器还可以接收处理器单元103发来的命令并执行。此外,所述触摸屏可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触摸屏。
在本发明的其他实施方式中,所述输入单元105所采用的实体输入键可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。麦克风形式的输入单元105可以收集用户或环境输入的语音并将其转换成电信号形式的、处理器单元103可执行的命令。
在本发明的其他一些实施方式中,所述输入单元105还可以是各类传感器件,例如霍 尔器件,用于侦测电子设备的物理量,例如力、力矩、压力、应力、位置、位移、速度、加速度、角度、角速度、转数、转速以及工作状态发生变化的时间等,转变成电量来进行检测和控制。其他的一些传感器件还可以包括重力感应计、三轴加速计、陀螺仪、电子罗盘、环境光传感器、接近传感器、温度传感器、湿度传感器、压力传感器、心率传感器、指纹识别器等。
通信单元107,用于建立通信信道,使电子设备通过所述通信信道以连接至远程服务器,并从所述远程服务器下媒体数据。所述通信单元107可以包括无线局域网(wireless local area network,wireless LAN)模块、蓝牙模块、基带模块等通信模块,以及所述通信模块对应的射频(radio frequency,RF)电路,用于进行无线局域网络通信、蓝牙通信、红外线通信及/或蜂窝式通信系统通信,例如宽带码分多重接入(wideband code division multiple access,W-CDMA)及/或高速下行封包存取(high speed downlink packet access,HSDPA)。所述通信模块用于控制电子设备中的各组件的通信,并且可以支持直接内存存取。
在本发明的不同实施方式中,所述通信单元107中的各种通信模块一般以集成电路芯片(integrated circuit chip)的形式出现,并可进行选择性组合,而不必包括所有通信模块及对应的天线组。例如,所述通信单元107可以仅包括基带芯片、射频芯片以及相应的天线以在一个蜂窝通信系统中提供通信功能。经由所述通信单元107建立的无线通信连接,例如无线局域网接入或WCDMA接入,所述电子设备可以连接至蜂窝网或因特网。在本发明的一些可选实施方式中,所述通信单元107中的通信模块,例如基带模块可以集成到处理器单元103中。
射频电路108,用于信息收发或通话过程中接收和发送信号。例如,将基站的下行信息接收后,给处理器单元103处理;另外,将设计上行的数据发送给基站。通常,所述射频电路108包括用于执行这些功能的公知电路,包括但不限于天线系统、射频收发机、一个或多个放大器、调谐器、一个或多个振荡器、数字信号处理器、编解码芯片组、用户身份模块卡、存储器等等。此外,射频电路108还可以通过无线通信与网络和其他设备通信。
电池109,用于给电子设备的不同部件进行充电以维持其运行。作为一般性理解,所述电池109可以是内置的电池,例如常见的锂离子电池、镍氢电池等。在本发明的一些实施方式中,所述电池109还可以作更为广泛的定义,例如还可以包括电池管理系统、充电系统、电池故障检测电路、电池转换器或逆变器、电池状态指示器(如发光二极管),以及与电子设备的电能生成、管理及分布相关联的其他任何组件。
本申请所示的充电方法,能够实现不同的两个电子设备之间的无线充电,则需要所述电子设备支持无线充电功能,具有所述无线充电功能的电子设备的结构继续参见图1所示,
所述电子设备还包括与所述电池109连接的无线充电模块111,还包括与所述无线充电模块111连接的收发线圈110。
以下基于图1和图2所示,对第一电子设备201和第二电子设备202之间的无线充电的具体过程进行示例性说明:
可选的,在所述第一电子设备201处于反向充电模式的情况下,即所述第一电子设备201对所述第二电子设备202输出充电电流,以使所述第一电子设备201对所述第二电子设备202进行充电;
具体的,所述第一电子设备201所包括的无线充电模块对电池提供的直流电进行功率控制、逆变、稳压、滤波等变换处理,以得到功率固定的交流电,收发线圈可将该交流电转换成电磁能并传递给第二电子设备202;
在第二电子设备202内,收发线圈可将来自第一电子设备201的电磁能转换成电能(即转换成感应交流电),并将该感应交流电传输至第二电子设备202的无线充电模块;无线充电模块可对该感应交流电进行功率控制、整流、稳压、滤波等变换处理以得到功率固定的感应直流电,并通过该感应直流电为第二电子设备的电池进行充电,以实现电能由第一电子设备201向第二电子设备202的传输。
这里,需要说明的是,收发线圈110具体可通过电磁感应、磁共振传输等方式实现电能的传输,此处不作限定。例如,当第一电子设备的无线充电模块将功率固定的交流电输入至第二电子设备202的收发线圈,第二电子设备的收发线圈会产生一个不断变化的磁场,在这个变化的磁场中的收发线圈即可产生感应交流电,从而实现电能的传递。本发明实施例中以电磁感应式的电能传输方式为例进行描述。
可选的,在所述第一电子设备201处于正向充电模式的情况下,即所述第二电子设备202对所述第一电子设备201输出充电电流,以使所述第二电子设备202对所述第一电子设备201进行充电,具体充电过程,可参见上述所示,具体不做赘述。
基于图1和图2所示,以下结合图3所示对本申请所提供的充电方法的一种实施例进行示例性说明:
步骤301、所述第一电子设备和所述第二电子设备建立无线电连接。
具体的,在本实施例所示的第一电子设备和第二电子设备进行互充之前,需要建立所述第一电子设备和所述第二电子设备之间的无线电连接,以下对建立无线电连接的可选方式进行示例性说明:
所述第一电子设备可周期性的发送探测信号,所述探测信号用于探测所述第一电子设备的周围是否存在能够与第一电子设备进行互充的第二电子设备。在需要与第一电子设备进行互充的第二电子设备靠近所述第一电子设备的情况下,即所述第一电子设备的收发线圈和所述第二电子设备的收发线圈相靠近,以图2所示为例,即所述第一电子设备的背面与所述第二电子设备的背面相贴合。所述第二电子设备即可接收到所述第一电子设备所发送的所述探测信号,所述第二电子设备即可向所述第一电子设备发送与所述探测信号对应的响应信号;在所述第一电子设备接收到该响应信号的情况下,所述第一电子设备和所述第二电子设备之间即可通过电磁耦合实现无线电连接,在所述第一电子设备和所述第二电子设备之间建立了无线点连接的情况下,所述第一电子设备和所述第二电子设备之间即可进行互充。
上述以所述第一电子设备向所述第二电子设备发送探测信号为例进行示例性说明,在 其他场景下,也可由所述第二电子设备向所述第一电子设备发送所述探测信号,具体在本实施例中不做限定。
步骤302、所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长;
具体的,本实施例所示的所述第一电子设备可获取所述第一电子设备的剩余电量和第一电子设备的工作电流,所述第一电子设备即可根据所述第一电子设备的剩余电量和所述第一电子设备的工作电流确定出所述第一电子设备的剩余电量的第一使用时长。
本实施例对所述第一电子设备如何根据所述第一电子设备的剩余电量确定所述第一使用时长的具体过程不做限定,只要所述第一电子设备能够确定出所述第一使用时长即可,以下对所述第一电子设备确定所述第一使用时长的几种可选的实现方式进行示例性说明:
方式1
在本方式中,所述第一电子设备获取所述第一电子设备当前的工作电流,所述第一电子设备即可根据公式1确定出第一使用时长:
公式1:第一使用时长=第一电子设备的剩余电量/第一电子设备当前的工作电流*60;
其中,第一使用时长的单位可为分钟(min),所述第一电子设备的剩余电量的单位可为毫安时(mAh),所述第一电子设备当前的工作电流的单位为毫安(mA)。
方式2
在本方式中,所述第一电子设备获取所述第一电子设备确定第一时间段内的所述第一电子设备的第一电池电量的变化量;
其中,所述第一时间段的时间起点为位于当前时刻之前的时刻,所述第一时间段的时间终点为所述当前时刻或所述当前时刻之前的时刻,例如,若所述第一电子设备确定当前时刻为13:30,则所述第一时间段的时间起点可为时刻12:00,所述第一时间段的时间终点可为13:30,则所述第一电子设备即可获取第一电子设备在所述第一时间段(12:00至13:30)内所述第一电子设备的第一电池电量的变化量。
所述第一电子设备根据公式2确定出第一使用时长:
公式2:第一使用时长=第一电子设备的剩余电量/所述第一时间段内的电池电量的变化量*第一时间段;
其中,第一使用时长和所述第一时间段的单位可为分钟(min),所述第一电子设备的剩余电量的单位可为毫安时(mAh)。
本实施例对所述第一时间段的持续时间的大小不做限定,例如,所述第一时间段的持续时间可为60min,或5min等。
方式3,在方式2中,所述第一电子设备确定的所述第一时间段为所述第一电子设备的当前时刻之前的时间段,方式3中,所述第一电子设备可估计第一电子设备在未来时刻的电池电量的变化量,从而估计出所述第一使用时长;
具体执行流程可参见如下步骤所示:
步骤A1、所述第一电子设备获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;
例如,所述第一电子设备确定当前时刻为13:00,则所述第一电子设备可确定所述第 二时间段的时间起点为13:00,还可为13:30等,只要所述第二时间段的时间起点位于所述当前时刻或当前时刻之后的时刻即可;
本实施例对所述第二时间段的持续时间不做限定,例如,可为60min,又如,可为10min等,具体在本实施例中不做限定,本实施例以所述第二时间段的持续时间为60min为例进行示例性说明:
步骤A2、所述第一电子设备根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;
在上述示例中,所述第一电子设备所确定的所述第二时间段可为13:00-14:00之间,而所述第二时间段所位于的日期为当前日期,即所述第一电子设备执行本实施例所示的方法的日期,本实施例所示的日期的是指年月日,如19年6月20日,即所述第一电子设备在19年6月20日有需要与第二电子设备进行互充的需求;
所述电子设备所确定的第三时间段为13:00-14:00之间,且所述第三时间段所位于的日期早于第二时间段所位于的日期,在上述示例中,所述第二时间段所位于的日期为19年6月20日,则所述第三时间段所位于的日期可为19年6月19日等,具体在本实施例中不做限定,只要所述第三时间段所位于的日期早于所述第二时间段所位于的日期即可。
步骤A3、所述第一电子设备获取第三时间段内的所述第一电子设备的第二电池电量的变化量;
在所述第一电子设备确定出所述第三时间段的情况下,所述第一电子设备即可统计在所述第三时间段内,所述第一电子设备的第二电池电量的变化量;
可选的,因位于不同日期的所述第三时间段的第二电池电量的变化量是不同的,则所述第一电子设备可根据不同日期的所述第三时间段的第二电池电量的变化量生成目标列表,所述目标列表按所述第二电池电量由大到小的优先级进行排序,所述第一电子设备获取所述目标列表中位于最高优先级的所述第二电池电量的变化量,所述第一电子设备根据该具有最高优先级的第三时间段确定步骤A4;
步骤A4、所述第一电子设备根据所述第二电池电量的变化量以及所述第三时间段,确定所述工作电流。
具体的,所述第一电子设备可根据公式3计算出所述工作电流;
公式3:所述第一电子设备的工作电流=所述第三时间段内的电池电量的变化量*第三时间段;
其中,所述第三时间段的单位可为分钟(min),所述第三时间段内的电池电量的变化量的单位可为毫安时(mAh)。
步骤A5、所述第一电子设备根据所述工作电流确定出所述第一使用时长,具体的,所述第一电子设备可根据如下所示的公式4计算出所述第一使用时长;
公式5:第一使用时长=第一电子设备的剩余电量/所述工作电流;
所述工作电流为通过步骤A4所得到的工作电流,第一使用时长。
步骤303、所述第一电子设备从第二电子设备接收所述第二电子设备的剩余电量的第 二使用时长;
本实施例对所述第二电子设备确定第二使用时长的具体过程,请详见上述所示的第一电子设备确定所述第一使用时长的具体过程,具体在本实施例中不做赘述。
步骤304、所述第一电子设备判断所述第一使用时长是否大于所述第二使用时长,若是,则执行步骤305,若否,则执行步骤306。
为使得采用本实施例所示的充电方法,在无需用户手动操作的情况下,即可实现所述第一电子设备和第二电子设备之间的互充,则需要第一电子设备确定出,第一电子设备和第二电子设备之间,作为供电方的电子设备以及作为受电方的电子设备,具体确定过程如下:
所述第一电子设备可判断所述第一使用时长是否大于所述第二使用时长,若所述第一使用时长大于所述第二使用时长,则说明所述第一电子设备能够正常使用的时长大于所述第二电子设备能够正常使用的时长,所述第一电子设备即可作为供电方为所述第二电子设备进行充电;
若所述第一使用时长小于所述第二使用时长,则说明所述第一电子设备能够正常使用的时长小于所述第二电子设备能够正常使用的时长,所述第一电子设备即可作为受电方,第二电子设备为所述第一电子设备进行充电。
步骤305、所述第一电子设备确定所述第一电子设备处于反向充电模式。
本实施例中,若所述第一电子设备确定出所述第一使用时长大于所述第二使用时长,则所述第一电子设备即可确定出所述第一电子设备处于反向充电模式,所述反向充电模式是指,所述第一电子设备对所述第二电子设备输出充电电流,可见,此时的所述第一电子设备为供电方。
步骤306、所述第一电子设备确定所述第一电子设备处于正向充电模式。
本实施例中,若所述第一电子设备确定所述第一使用时长小于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于正向充电模式,所述正向充电模式为所述第一电子设备接收所述第二电子设备输出的充电电流,可见,此时的所述第一电子设备为受电方。
本实施例中,所述第一电子设备可周期性的检测第一电子设备的第一使用时长,且所述第一电子设备周期性的接收到所述第二电子设备所发送的第二使用时长,则所述第一电子设备可周期性的执行上述所示的步骤302至305,例如,在第一充电周期内,所述第一使用时长大于所述第二使用时长,则所述第一电子设备为所述第二电子设备充电,在第二充电周期内,所述第一使用时长小于所述第二使用时长,则所述第二电子设备为所述第一电子设备充电,本实施例对所述周期的长度不做限定,或该可由用户根据需要进行配置。
采用本实施例所示的方法的优势在于:
所述第一电子设备和所述第二电子设备可通过无线充电的方式进行互充,在充电的过程中,无需使用专用的数据线,从而提高了第一电子设备和所述第二电子设备之间的互充的便利性,在需要互充时,只要将所述第一电子设备和所述第二电子设备进行相互靠近即可;
而且采用本实施例所示的充电方法,所述第一电子设备能够根据第一电子设备的第一使用时长和第二电子设备的使用时长,自动判断出供电方和受电方,在充电的过程中无需用户的手动操作,从而有效的提高了充电效率;
而且通过使用时长判断供电方和受电方,从而使得确定供电方和受电方的过程中,充分的考虑到了电子设备的使用程度,例如,虽然电子设备的剩余电量比较大,但是,该电子设备运行了多个耗电量大的应用,即该电子设备的使用程度非常重,若使得该电子设备作为供电方为其他电子设备进行供电,则会导致该电子设备后续无法正常使用的情况的出现,而采用本实施例所示的方法,通过使用时长确定供电方和受电方,避免了使用程度重的电子设备为使用程度轻的电子设备进行供电的情况的出现,有效的保障了电子设备的正常使用。
以下结合图4所示,对本实施例所示的充电方法的另一种实现过程进行示例性说明:
步骤401、所述第一电子设备和所述第二电子设备建立无线电连接。
步骤402、所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长;
步骤403、所述第一电子设备从第二电子设备接收所述第二电子设备的剩余电量的第二使用时长;
步骤404、所述第一电子设备判断所述第一使用时长是否大于所述第二使用时长,若是,则执行步骤405,若否,则执行步骤408。
本实施例所示的步骤401至步骤404的具体执行过程,请详见图3所示的步骤301至步骤304所示,具体执行过程在本实施例中不做赘述。
步骤405、所述第一电子设备获取第二时间段。
在本实施例中,在所述第一电子设备确定出所述第一使用时长大于所述第二使用时长的情况下,所述第一电子设备先不确定第一电子设备为供电方,而是进行第二时间段的获取,其中,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻,对所述第二时间段的具体说明,请详见图3所示的实施例,具体在本实施例中不做赘述。
步骤406、所述第一电子设备根据所述第二时间段获取对应的第三时间段。
其中,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期,对所述第三时间段的具体说明,请详见图3所示的实施例,具体在本实施例中不做赘述。
步骤407、所述第一电子设备判断所述第一电子设备在所述第三时间段内是否运行目标应用,若是,则执行步骤408,若否,则执行步骤409;
本实施例中,在所述第一电子设备确定出所述第三时间段的情况下,所述第一电子设备即可判断,在所述第三时间段内,是否运行有目标应用;
例如,当前时刻是21:00,而第三时间段为21:00至22:00,所述目标应用为视频类应用,且当前时刻所位于的日期为19年6月20,而所述第三时间段所位于的日期为19年6月19日,所述第一电子设备确定出,在19年6月19日,21:00至22:00之间,所述第一电子设备运行耗电量大的视频类应用,则在19年6月20,21:00至22:00之间,所述第一 电子设备运行该视频类应用的概率很大,若将所述第一电子设备确定为供电方,则在第一电子设备为第二电子设备充电后,所述第一电子设备的剩余电量将无法满足耗电量大的目标应用的运行,为避免第一电子设备无法正常运行目标应用的情况下,则所述第一电子设备在确定出所述第三时间段内运行有目标应用的情况下,所述第一电子设备将不会为所述第二电子设备进行供电;
本实施例对所述目标应用的具体应用类型不做限定,只要所述目标应用为运行电量大于或等于预设值的应用即可,例如,所述目标应用为视频类应用、导航类应用等。
步骤408、所述第一电子设备确定所述第一电子设备处于正向充电模式。
可选的,若经由步骤404,所述第一电子设备确定所述第一使用时长小于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于正向充电模式,所述正向充电模式为所述第一电子设备接收所述第二电子设备输出的充电电流,可见,此时的所述第一电子设备为受电方。
可选的,若经由步骤407,若所述第一电子设备确定出所述第一电子设备在所述第三时间段内运行目标应用,为保障目标应用的正常运行,则所述第一电子设备确定所述第一电子设备处于正向充电模式,对正向充电模式的具体说明,请详见图3所示,具体在本实施例中不做赘述。
步骤409、所述第一电子设备确定所述第一电子设备处于反向充电模式。
若经由步骤407,若所述第一电子设备确定出所述第一电子设备在所述第三时间段内未运行目标应用,则所述第一电子设备可作为供电方为所述第二电子设备进行充电,对所述反向充电模式的具体说明,请详见图3所示,具体在本实施例中不做赘述。
采用本实施例所示的方法,所述第一电子设备充分考虑到了未来时间段内是否有可能运行有耗电量大的目标应用,如下班时间段内的视频类应用,如早高峰时间段内的导航类应用等,若第一电子设备的第一使用时长大于第二设备的第二使用时长,但是第一电子设备在未来时间段(第三时间段)内运行目标应用的概率非常大,则使得第一电子设备作为供电方后,无法在第三时间段内保障第一电子设备成功运行目标应用,可见,采用本实施例所示的方法,能够充分保障目标应用的运行,避免了第一电子设备因作为供电方,无法正常使用目标应用的情况的出现。
以下结合图5所示,对本实施例所示的充电方法的另一种实现过程进行示例性说明:
步骤501、所述第一电子设备和所述第二电子设备建立无线电连接。
步骤502、所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长;
步骤503、所述第一电子设备从第二电子设备接收所述第二电子设备的剩余电量的第二使用时长;
步骤504、所述第一电子设备判断所述第一使用时长是否大于所述第二使用时长,若是,则执行步骤505,若否,则执行步骤508。
本实施例所示的步骤501至步骤504的具体执行过程,请详见图3所示的步骤301至步骤304所示,具体执行过程在本实施例中不做赘述。
步骤505、所述第一电子设备检测是否接收到第一指示信息,若是,则执行步骤506,若否,则执行步骤507。
本实施例中,在所述第一电子设备确定出所述第一使用时长大于所述第二使用时长的情况下,所述第一电子设备不会直接将第一电子设备确定为供电方,而是检测是否接收到用户输入的第一指示信息,所述第一指示信息用于指示所述第一电子设备具有最高的充电优先级,所述最高的充电优先级是指,所述第一电子设备只能作为受电方。
本实施例对所述第一电子设备接收所述第一指示信息的具体过程不做限定,以图6所示为例,所述第一电子设备可通过显示屏600显示有操作界面601;
所述操作界面601上可显示有提示信息,所述提示信息示例性的为“是否进行充电”;
所述操作界面601上还显示有第一操作按键602以及第二操作按键603,所述第一操作按键602可显示有字符“否”,所述第二操作按键603可显示有字符“是”;
在第一电子设备确定出所述第一使用时长大于所述第二使用时长的情况下,所述第一电子设备会通过显示屏600自动显示操作界面601,若用户确定第一电子设备作为受电方,则用户可触摸第二操作按键603,第一电子设备确定所述第二操作按键603接收到触摸事件的情况下,即可生成所述第一指示信息,则第二电子设备需要为第一电子设备进行充电。
步骤506、所述第一电子设备确定所述第一电子设备处于正向充电模式。
可选的,若经由步骤505,在第一电子设备确定出所述第一使用时长大于所述第二使用时长的情况下,但是若用户根据自身需求,需要第一电子设备作为受电方的情况下,用户即可通过如图6所示的操作界面输入所述第一指示信息,以使所述第二电子设备为所述第一电子设备进行充电,对所述正向充电模式的具体说明,请详见上述实施例所示,具体在本实施例中不做赘述。
可选的,若经由步骤508,在第一电子设备确定出所述第一使用时长小于所述第二使用时长的情况下,且未接收到所述第二指示信息的情况下,所述第一电子设备即可确定所述第一电子设备处于所述正向充电模式。
步骤507、所述第一电子设备确定所述第一电子设备处于反向充电模式。
可选的,若经由步骤505,若所述第一使用时长大于所述第二使用时长,且第一电子设备未接收到用户输入的第一指示信息,则所述第一电子设备即可确定所述第一电子设备作为充电方为所述第二电子设备充电,对所述反向充电模式的具体说明,请详见上述实施例所示,具体在本实施例中不做赘述。
可选的,若经由步骤508,若所述第一使用时长小于所述第二使用时长,且所述第一电子设备接收到所述第二指示信息的情况下,则所述第一电子设备即可确定所述第一电子设备作为充电方为所述第二电子设备充电。
步骤508、所述第一电子设备检测是否接收到第二指示信息,若是,则执行步骤507,若否,则执行步骤506。
本实施例中,在所述第一电子设备确定出所述第一使用时长小于所述第二使用时长的情况下,所述第一电子设备不会直接将第一电子设备确定为受电方,而是检测是否接收到用户输入的第二指示信息,所述第二指示信息用于指示所述第二电子设备具有最高的充电 优先级,所述最高的充电优先级是指,所述第二电子设备只能作为受电方。
可选的,在所述操作界面601中,用户可触摸第一操作按键602,所述第一电子设备在检测到所述第一操作按键602接收到触摸事件的情况下,则说明用户通过触摸所述第一操作按键602以输入所述第二指示信息,所述第一电子设备即可根据所述第二指示信息确定所述第一电子设备作为供电方,所述第二电子设备作为受电方,则所述第一电子设备即可确定所述第一电子设备处于反向充电模式。
可选的,若所述第一使用时长小于所述第二使用时长,且第一电子设备未接收到用户输入的第二指示信息,则所述第一电子设备即可确定所述第一电子设备作为受电方。
可见,采用本实施例所示的方法,在所述第一电子设备确定出所述第一使用时长大于所述第二使用时长的情况下,所述第一电子设备检测是否接收到用户输入的第一指示信息,若第一电子设备接收到第一指示信息,则说明用户根据自身的使用需求,需要所述第一电子设备作为受电方,则所述第一电子设备即便判断出所述第一使用时长大于所述第二使用时长的情况下,控制所述第一电子设备为受电方接收第二电子设备的输出的充电电流,在所述第一电子设备确定出所述第一使用时长小于所述第二使用时长的情况下,所述第一电子设备检测是否接收到用户输入的第二指示信息,若第一电子设备接收到第二指示信息,则说明用户根据自身的使用需求,需要所述第二电子设备作为受电方,则所述第一电子设备即便判断出所述第一使用时长小于所述第二使用时长的情况下,控制所述第一电子设备为冲电方为第二电子设备进行充电,可见,采用本实施例所示的方法,能够充分考虑到第一电子设备和第二电子设备之间互充的过程中用户的需求。
以下结合图7所示,对本实施例所示的充电方法的另一种实现过程进行示例性说明:
步骤701、所述第一电子设备和所述第二电子设备建立无线电连接。
步骤702、所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长;
步骤703、所述第一电子设备从第二电子设备接收所述第二电子设备的剩余电量的第二使用时长;
本实施例所示的步骤701至步骤703的具体执行过程,请详见图3所示的步骤301至步骤303所示,具体执行过程在本实施例中不做赘述。
步骤704、所述第一电子设备确定所述第一使用时长等于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于待机模式。
本实施例中,若所述第一电子设备确定出所述第一使用时长和所述第二使用时长相等,则在本实施例中,所述第一电子设备确定所述第一电子设备处于待机模式,即所述第一电子设备不为所述第二电子设备充电,也不用第二电子设备为第一电子设备进行充电。
可选的,本实施例所示的,在所述第一使用时长和所述第二使用时长相等的情况下,也可执行上述实施例所示的方式,以确定所述第一电子设备所处于的充电模式,例如,所述第一电子设备可执行图4所示的步骤405至步骤409,又如,在所述第一使用时长和所述第二使用时长相等的情况下,所述第一电子设备可执行图5所示的步骤505至508所示,以使在所述第一使用时长和所述第二使用时长相等的情况下,所述第一电子设备和所述第 二电子设备之间也可进行无线互充。
可选的,在上述任一方法实施例中,所述第一电子设备可实时或周期性的检测第一电子设备是否处于有线充电模式,其中,有线充电模式是指有外部的电源通过充电线为所述第一电子设备进行持续充电,则所述第一电子设备即可确定出所述第一电子设备的第一使用时长为无穷大,在此种示例性下,若第一电子设备和第二电子设备进行无线互充时,无论所述第二电子设备的第二使用时长的大小,第一电子设备均能够确定出所述第一使用时长大于所述第二使用时长的情况下,则所述第一电子设备确定有外部电源持续充电的所述第一电子设备作为供电方,而第二电子设备作为受电方。
上述结合图3至图7所示对本申请所提供的充电方法进行了详细说明,以下结合图8所示从功能模块的角度,对本申请所提供的电子设备的结构进行示例性说明,其中,本实施例所示的电子设备可为用于执行上述任一方法实施例中的第一电子设备,所述第一电子设备执行本申请所示的充电方法的具体执行过程,请详见上述方法实施例所示,具体在本实施例中不做赘述;
如图8所示,本实施例所示的电子设备包括:
处理单元801,用于确定所述第一电子设备的剩余电量的第一使用时长;
接收单元802,用于从第二电子设备接收第二电子设备的剩余电量的第二使用时长;
所述处理单元801还用于,判断所述第一使用时长是否大于所述第二使用时长;若所述第一使用时长大于所述第二使用时长,则所述处理单元801确定所述第一电子设备处于反向充电模式,所述反向充电模式为所述第一电子设备对所述第二电子设备输出充电电流;若所述第一使用时长小于所述第二使用时长,则所述处理单元801确定所述第一电子设备处于正向充电模式,所述正向充电模式为所述第一电子设备接收所述第二电子设备输出的充电电流。
可选的,所述处理单元801具体用于:获取所述第一电子设备的剩余电量;获取所述第一电子设备的工作电流;根据所述剩余电量和所述工作电流,确定所述第一使用时长。
可选的,所述处理单元801具体用于:确定第一时间段内的所述第一电子设备的第一电池电量的变化量,其中,所述第一时间段的时间起点为位于当前时刻之前的时刻,所述第一时间段的时间终点为所述当前时刻或所述当前时刻之前的时刻;根据所述第一电池电量的变化量以及所述第一时间段,确定所述工作电流。
可选的,所述处理单元801具体用于:获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;获取第三时间段内的所述第一电子设备的第二电池电量的变化量;根据所述第二电池电量的变化量以及所述第三时间段,确定所述工作电流。
可选的,所述处理单元801还用于:获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;根据所述第二时间段获取对应的第三时间段, 所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;在确定所述第一电子设备在所述第三时间段内运行目标应用的情况下,触发执行所述确定所述第一电子设备处于正向充电模式的步骤,所述目标应用为运行电量大于或等于预设值的应用。
可选的,若所述第一使用时长大于所述第二使用时长,则所述接收单元802还用于:接收第一指示信息,所述第一指示信息用于指示所述第一电子设备具有最高的充电优先级;所述处理单元801还用于,根据所述第一指示信息的指示,确定所述第一电子设备处于所述正向充电模式。
可选的,若所述第一使用时长小于所述第二使用时长,则所述接收单元802还用于:接收第二指示信息,所述第二指示信息用于指示所述第二电子设备具有最高的充电优先级;所述处理单元801还用于,根据所述第二指示信息的指示,确定所述第一电子设备处于所述反向充电模式。
可选的,所述处理单元801还用于,若所述第一使用时长等于所述第二使用时长,则确定所述第一电子设备处于待机模式。
在一个实施例中,执行本申请所示的充电方法的可为电子设备所包括的充电装置,其中,在一种实现方式中,充电装置可以为芯片或集成电路。此时,接收单元802可以为通信接口,处理单元801可以为逻辑电路。
可选地,通信接口可以是输入输出接口或者收发电路。输入输出接口可以包括输入接口和输出接口。收发电路可以包括输入接口电路和输出接口电路。
在一种实现方式中,处理单元801可以是一个处理装置,处理装置的功能可以部分或全部通过软件实现。
可选地,处理装置的功能可以部分或全部通过软件实现。此时,处理装置可以包括存储器和处理器,其中,存储器用于存储计算机程序,处理器读取并执行存储器中存储的计算机程序,以执行任意一个方法实施例中的相应处理和/或步骤。
可选地,处理装置可以仅包括处理器。用于存储计算机程序的存储器位于处理装置之外,处理器通过电路/电线与存储器连接,以读取并执行存储器中存储的计算机程序。
可选地,处理装置的功能可以部分或全部通过硬件实现。此时,处理装置可以包括输入接口电路,逻辑电路和输出接口电路。
在一个实施例中,本申请实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在计算机上执行时,使得计算机执行如上述任一方法实施例对应的方法。
在一个实施例中,本申请实施例提供一种芯片,包括通信接口、存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于读取并执行所述存储器中存储器的所述计算机程序,以执行如上述任一方法实施例对应的方法。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通 过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims (21)

  1. 一种充电方法,其特征在于,所述充电方法用于第一电子设备,所述充电方法包括:
    所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长;
    所述第一电子设备从第二电子设备接收所述第二电子设备的剩余电量的第二使用时长;
    所述第一电子设备判断所述第一使用时长是否大于所述第二使用时长;
    若所述第一使用时长大于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于反向充电模式,所述反向充电模式为所述第一电子设备对所述第二电子设备输出充电电流;
    若所述第一使用时长小于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于正向充电模式,所述正向充电模式为所述第一电子设备接收所述第二电子设备输出的充电电流。
  2. 根据权利要求1所述的充电方法,其特征在于,所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长包括:
    所述第一电子设备获取所述第一电子设备的剩余电量;
    所述第一电子设备获取所述第一电子设备的工作电流;
    所述第一电子设备根据所述剩余电量和所述工作电流,确定所述第一使用时长。
  3. 根据权利要求2所述的充电方法,其特征在于,所述第一电子设备获取所述第一电子设备的工作电流包括:
    所述第一电子设备确定第一时间段内的所述第一电子设备的第一电池电量的变化量,其中,所述第一时间段的时间起点为位于当前时刻之前的时刻,所述第一时间段的时间终点为所述当前时刻或所述当前时刻之前的时刻;
    所述第一电子设备根据所述第一电池电量的变化量以及所述第一时间段,确定所述工作电流。
  4. 根据权利要求2所述的充电方法,其特征在于,所述第一电子设备获取所述第一电子设备的工作电流包括:
    所述第一电子设备获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;
    所述第一电子设备根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;
    所述第一电子设备获取第三时间段内的所述第一电子设备的第二电池电量的变化量;
    所述第一电子设备根据所述第二电池电量的变化量以及所述第三时间段,确定所述工作电流。
  5. 根据权利要求1所述的充电方法,其特征在于,所述方法还包括:
    所述第一电子设备获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;
    所述第一电子设备根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;
    所述第一电子设备在确定所述第一电子设备在所述第三时间段内运行目标应用的情况下,触发执行所述第一电子设备确定所述第一电子设备处于正向充电模式的步骤,所述目标应用为运行电量大于或等于预设值的应用。
  6. 根据权利要求1所述的充电方法,其特征在于,若所述第一使用时长大于所述第二使用时长,所述方法还包括:
    所述第一电子设备接收第一指示信息,所述第一指示信息用于指示所述第一电子设备具有最高的充电优先级;
    所述第一电子设备根据所述第一指示信息的指示,确定所述第一电子设备处于所述正向充电模式。
  7. 根据权利要求1所述的充电方法,其特征在于,若所述第一使用时长小于所述第二使用时长,所述方法还包括:
    若所述第一电子设备接收第二指示信息,所述第二指示信息用于指示所述第二电子设备具有最高的充电优先级;
    所述第一电子设备根据所述第二指示信息的指示,确定所述第一电子设备处于所述反向充电模式。
  8. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    若所述第一使用时长等于所述第二使用时长,则所述第一电子设备确定所述第一电子设备处于待机模式。
  9. 根据权利要求1至8任一项所述的方法,其特征在于,所述第一电子设备确定所述第一电子设备的剩余电量的第一使用时长包括:
    若所述第一电子设备检测到所述第一电子设备处于有线充电模式,则所述第一电子设备确定所述第一电子设备的第一使用时长为无穷大,所述有线充电模式是指有外部电源通过充电线为所述第一电子设备持续充电。
  10. 一种电子设备,其特征在于,所述电子设备为第一电子设备,所述第一电子设备包括:
    处理单元,用于确定所述第一电子设备的剩余电量的第一使用时长;
    接收单元,用于从第二电子设备接收第二电子设备的剩余电量的第二使用时长;
    所述处理单元还用于,判断所述第一使用时长是否大于所述第二使用时长;若所述第一使用时长大于所述第二使用时长,则所述处理单元确定所述第一电子设备处于反向充电模式,所述反向充电模式为所述第一电子设备对所述第二电子设备输出充电电流;若所述第一使用时长小于所述第二使用时长,则所述处理单元确定所述第一电子设备处于正向充电模式,所述正向充电模式为所述第一电子设备接收所述第二电子设备输出的充电电流。
  11. 根据权利要求10所述的电子设备,其特征在于,所述处理单元具体用于:
    获取所述第一电子设备的剩余电量;
    获取所述第一电子设备的工作电流;
    根据所述剩余电量和所述工作电流,确定所述第一使用时长。
  12. 根据权利要求11所述的电子设备,其特征在于,所述处理单元具体用于:
    确定第一时间段内的所述第一电子设备的第一电池电量的变化量,其中,所述第一时间段的时间起点为位于当前时刻之前的时刻,所述第一时间段的时间终点为所述当前时刻或所述当前时刻之前的时刻;
    根据所述第一电池电量的变化量以及所述第一时间段,确定所述工作电流。
  13. 根据权利要求11所述的电子设备,其特征在于,所述处理单元具体用于:
    获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;
    根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;
    获取第三时间段内的所述第一电子设备的第二电池电量的变化量;
    根据所述第二电池电量的变化量以及所述第三时间段,确定所述工作电流。
  14. 根据权利要求10所述的电子设备,其特征在于,所述处理单元还用于:
    获取第二时间段,所述第二时间段的时间起点为当前时刻或位于所述当前时刻之后的时刻;
    根据所述第二时间段获取对应的第三时间段,所述第三时间段的起始时刻和结束时刻与所述第二时间段的起始时刻和结束时刻相同,且所述第三时间段所位于的日期早于所述第二时间段所位于的日期;
    在确定所述第一电子设备在所述第三时间段内运行目标应用的情况下,触发执行所述确定所述第一电子设备处于正向充电模式的步骤,所述目标应用为运行电量大于或等于预设值的应用。
  15. 根据权利要求10所述的电子设备,其特征在于,若所述第一使用时长大于所述第二使用时长,则所述接收单元还用于:接收第一指示信息,所述第一指示信息用于指示所述第一电子设备具有最高的充电优先级;
    所述处理单元还用于,根据所述第一指示信息的指示,确定所述第一电子设备处于所述正向充电模式。
  16. 根据权利要求10所述的电子设备,其特征在于,若所述第一使用时长小于所述第二使用时长,则所述接收单元还用于:接收第二指示信息,所述第二指示信息用于指示所述第二电子设备具有最高的充电优先级;
    所述处理单元还用于,根据所述第二指示信息的指示,确定所述第一电子设备处于所述反向充电模式。
  17. 根据权利要求10所述的电子设备,其特征在于,所述处理单元还用于,若所述第一使用时长等于所述第二使用时长,则确定所述第一电子设备处于待机模式。
  18. 根据权利要求10至17任一项所述的电子设备,其特征在于,所述处理单元具体 用于:
    若检测到所述第一电子设备处于有线充电模式,则确定所述第一电子设备的第一使用时长为无穷大,所述有线充电模式是指有外部电源通过充电线为所述第一电子设备持续充电。
  19. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机程序,当所述计算机程序在计算机上执行时,使得计算机执行如权利要求1-9中任一项所述的方法。
  20. 一种芯片,其特征在于,包括通信接口、存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于读取并执行所述存储器中存储器的所述计算机程序,以执行如权利要求1-9中任一项所述的方法。
  21. 一种电子设备,其特征在于,包括收发器、存储器和处理器,所述存储器用于存储计算机程序,所述处理器用于读取并执行所述存储器中存储器的所述计算机程序,以执行如权利要求1-9中任一项所述的方法。
PCT/CN2020/101929 2019-07-30 2020-07-14 一种充电方法、电子设备以及存储介质 WO2021017823A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910695658.1A CN112311029B (zh) 2019-07-30 2019-07-30 一种充电方法、电子设备以及存储介质
CN201910695658.1 2019-07-30

Publications (1)

Publication Number Publication Date
WO2021017823A1 true WO2021017823A1 (zh) 2021-02-04

Family

ID=74228346

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/101929 WO2021017823A1 (zh) 2019-07-30 2020-07-14 一种充电方法、电子设备以及存储介质

Country Status (2)

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

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301111A (zh) * 2021-11-29 2022-04-08 浙江中控技术股份有限公司 分体式过程校验仪的充电方法、系统及存储介质
CN116707048A (zh) * 2022-09-06 2023-09-05 荣耀终端有限公司 一种基于otg的充电控制方法及相关装置

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112821515A (zh) * 2021-02-20 2021-05-18 北京小米移动软件有限公司 充电方法、装置及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105098273A (zh) * 2015-07-20 2015-11-25 小米科技有限责任公司 充电方法及装置
CN105680510A (zh) * 2016-01-29 2016-06-15 宇龙计算机通信科技(深圳)有限公司 用于电子设备的充电控制方法及充电控制装置
CN106375561A (zh) * 2016-08-29 2017-02-01 上海摩软通讯技术有限公司 移动终端及其剩余使用时间的检测方法
CN108235795A (zh) * 2017-12-20 2018-06-29 深圳前海达闼云端智能科技有限公司 充电方法、装置、终端设备及计算机可读存储介质
US20180269702A1 (en) * 2017-03-15 2018-09-20 Halo2Cloud, LLC Portable power charger with customizable aesthetic feature

Family Cites Families (2)

* 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
CN105790349A (zh) * 2016-01-27 2016-07-20 努比亚技术有限公司 移动终端互相充电控制方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105098273A (zh) * 2015-07-20 2015-11-25 小米科技有限责任公司 充电方法及装置
CN105680510A (zh) * 2016-01-29 2016-06-15 宇龙计算机通信科技(深圳)有限公司 用于电子设备的充电控制方法及充电控制装置
CN106375561A (zh) * 2016-08-29 2017-02-01 上海摩软通讯技术有限公司 移动终端及其剩余使用时间的检测方法
US20180269702A1 (en) * 2017-03-15 2018-09-20 Halo2Cloud, LLC Portable power charger with customizable aesthetic feature
CN108235795A (zh) * 2017-12-20 2018-06-29 深圳前海达闼云端智能科技有限公司 充电方法、装置、终端设备及计算机可读存储介质

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114301111A (zh) * 2021-11-29 2022-04-08 浙江中控技术股份有限公司 分体式过程校验仪的充电方法、系统及存储介质
CN116707048A (zh) * 2022-09-06 2023-09-05 荣耀终端有限公司 一种基于otg的充电控制方法及相关装置

Also Published As

Publication number Publication date
CN112311029A (zh) 2021-02-02
CN112311029B (zh) 2023-02-03

Similar Documents

Publication Publication Date Title
JP7176051B2 (ja) 電子デバイスおよび装置の電力消費を削減する方法
WO2021017823A1 (zh) 一种充电方法、电子设备以及存储介质
CN105743158B (zh) 用于为具有电池的电子设备充电的装置和方法
US11086387B2 (en) Management of near field communications using a low power express mode of an electronic device
KR102193181B1 (ko) 전력 공유 방법 및 이를 구현하는 전자 장치
EP3005525B1 (en) Apparatus and method for providing device charging information
KR102599383B1 (ko) 분할된 화면 상에서 실행 가능한 어플리케이션 리스트를 디스플레이하는 전자 장치 및 전자 장치의 동작 방법
WO2017128639A1 (zh) 一种终端设备
WO2018103191A1 (zh) 一种无线充电方法及装置
KR20150051816A (ko) 메시지 어플리케이션 운영 방법 및 이를 구현하는 전자 장치
WO2016045027A1 (zh) 屏幕灵敏度调整方法和移动终端
US9769757B2 (en) Method and apparatus for saving power in access point network
US20140281962A1 (en) Mobile device of executing action in display unchecking mode and method of controlling the same
WO2018209555A1 (zh) 连接蓝牙设备的方法及终端设备
KR20150057085A (ko) 전력 소모를 줄일 수 있는 전자 장치 및 방법
EP3570404B1 (en) Power supply control method and apparatus, storage medium, and electronic device
EP2991289A1 (en) Electronic device and method for sending messages using the same
EP2996316A1 (en) Methods and systems for communication management between an electronic device and a wearable electronic device
US11556158B2 (en) On-the-go (OTG) control and configuration method, mobile terminal, and storage medium
US20220046395A1 (en) Electronic device and method of controlling electronic device
EP3503332A1 (en) Electric charging protection method, terminal, and charger
CN107291213B (zh) 模式选择方法、装置、终端及计算机可读存储介质
CN111404242A (zh) 充电方法、装置、存储介质及移动终端
CN115499792A (zh) 用于提供通知消息的电子装置及其方法
WO2017096533A1 (zh) 消息处理方法及移动终端

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20847554

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20847554

Country of ref document: EP

Kind code of ref document: A1