CN115425711A - Charging current obtaining method and device, terminal equipment and storage medium - Google Patents

Charging current obtaining method and device, terminal equipment and storage medium Download PDF

Info

Publication number
CN115425711A
CN115425711A CN202211105428.3A CN202211105428A CN115425711A CN 115425711 A CN115425711 A CN 115425711A CN 202211105428 A CN202211105428 A CN 202211105428A CN 115425711 A CN115425711 A CN 115425711A
Authority
CN
China
Prior art keywords
adapter
charging current
terminal device
instruction
parameter
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211105428.3A
Other languages
Chinese (zh)
Inventor
李志杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN202211105428.3A priority Critical patent/CN115425711A/en
Publication of CN115425711A publication Critical patent/CN115425711A/en
Pending legal-status Critical Current

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
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • H02J7/00034Charger exchanging data with an electronic device, i.e. telephone, whose internal battery is under charge
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0047Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/007Regulation of charging or discharging current or voltage
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

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

Abstract

The application discloses a charging current obtaining method and device, terminal equipment and a storage medium, and belongs to the technical field of charging control. The method is applied to the terminal equipment and comprises the following steps: when the terminal equipment is electrically connected with the adapter, receiving a first instruction sent by the adapter, wherein the first instruction is used for acquiring the battery voltage of the terminal equipment; when the first inquiry parameter is a first target parameter, returning first preset data to the adapter according to the first instruction; and receiving the charging current returned by the adapter according to the first preset data. According to the method and the device, the first inquiry parameter is set in the terminal device, the first inquiry parameter is detected based on the first instruction sent by the adapter, and when the first inquiry parameter is the first target parameter, the first preset data are returned to the adapter according to the first instruction, so that the adapter returns the charging current according to the first preset data, the charging current of the adapter is monitored in real time by the terminal device, and the accuracy of the terminal device in adjusting the charging current of the adapter is improved.

Description

Charging current obtaining method and device, terminal equipment and storage medium
Technical Field
The present disclosure relates to the field of charging control technologies, and in particular, to a method and an apparatus for acquiring a charging current, a terminal device, and a storage medium.
Background
With the development of information technology and internet technology, the phenomenon that users use terminal equipment in daily life is very common, batteries are used as main power supply devices of the terminal equipment, and when the electric quantity of the batteries of the terminal equipment is insufficient, the users need to charge the terminal equipment.
At present, along with the development of the quick charging technology, most terminal devices also gradually adopt the quick charging technology to charge their batteries. Wherein, to most terminal equipment on the market, all can adopt adapter and terminal equipment to be connected when charging, when charging through the adapter, terminal equipment's battery state can change, for example, battery voltage is higher and higher, phenomenon such as battery temperature is higher and higher. The terminal equipment can adjust the current output by the adapter to the terminal equipment by acquiring the current battery state of the battery, so that the charging current of the terminal equipment can be adjusted in real time.
In the scheme, the charging current output by the terminal equipment to the adapter is not monitored, and the problem of low accuracy exists when the charging current of the adapter is adjusted.
Disclosure of Invention
In order to solve the problems in the prior art, the charging current output by the adapter is acquired in real time, and the accuracy of the terminal device in adjusting the charging current of the adapter is improved, embodiments of the application provide a method and a device for acquiring the charging current, the terminal device and a storage medium. The technical scheme is as follows:
in one aspect, the present application provides a method for acquiring a charging current, which is applied to a terminal device, and the method includes:
when the terminal equipment is electrically connected with the adapter, receiving a first instruction sent by the adapter, wherein the first instruction is used for acquiring the battery voltage of the terminal equipment;
detecting a first inquiry parameter, and returning first preset data to the adapter according to the first instruction when the first inquiry parameter is a first target parameter;
and receiving the charging current returned by the adapter according to the first preset data.
In one aspect, the present application provides an apparatus for obtaining a charging current, the apparatus being applied to a terminal device, the apparatus including:
the terminal equipment comprises a first receiving module, a second receiving module and a control module, wherein the first receiving module is used for receiving a first instruction sent by an adapter when the terminal equipment is electrically connected with the adapter, and the first instruction is used for acquiring the battery voltage of the terminal equipment;
the first returning module is used for returning first preset data to the adapter according to the first instruction when the first inquiry parameter is a first target parameter;
and the second receiving module is used for receiving the charging current returned by the adapter according to the first preset data.
In another aspect, the present application provides a terminal device, which includes a processor and a memory, where at least one instruction, at least one program, a code set, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by the processor to implement the method for acquiring a charging current according to one aspect.
In another aspect, the present application provides a computer-readable storage medium having at least one instruction, at least one program, a set of codes, or a set of instructions stored therein, which is loaded and executed by a processor to implement the method for acquiring a charging current according to an aspect.
In another aspect, the present application provides a computer program product, which when running on a computer, causes the computer to execute the method for acquiring a charging current according to the above aspect.
In another aspect, an application distribution platform is provided, and the application distribution platform is configured to distribute a computer program product, wherein when the computer program product runs on a computer, the computer is caused to execute the method for acquiring a charging current according to the above aspect.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
when the terminal equipment is electrically connected with the adapter, a first instruction sent by the adapter is received, wherein the first instruction is used for acquiring the battery voltage of the terminal equipment; detecting a first inquiry parameter, and returning first preset data to the adapter according to a first instruction when the first inquiry parameter is a first target parameter; and receiving the charging current returned by the adapter according to the first preset data. According to the method and the device, the first inquiry parameter is detected based on the first instruction sent by the adapter, when the first inquiry parameter is the first target parameter, the first preset data are returned to the adapter according to the first instruction, so that the adapter returns the charging current according to the first preset data, the effect of monitoring the charging current of the adapter in real time by the terminal device is achieved, and the accuracy of the charging current of the adapter adjusted by the terminal device is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic diagram of a scenario architecture for charging a terminal device according to an exemplary embodiment of the present application;
fig. 2 is a schematic diagram of an exemplary embodiment of the present application relating to a structure of the terminal device of fig. 1;
fig. 3 is a flowchart of a method for obtaining a charging current according to an exemplary embodiment of the present application;
fig. 4 is a flowchart of a method for obtaining a charging current according to an exemplary embodiment of the present application;
fig. 5 is a schematic diagram of a charging structure of a terminal device according to an exemplary embodiment of the present application;
FIG. 6 is a flowchart illustrating an interaction between an MCU and an adapter according to an exemplary embodiment of the present application;
FIG. 7 is a flowchart illustrating an interaction between an MCU and a CPU according to an exemplary embodiment of the present application;
fig. 8 is a block diagram of a device for acquiring a charging current according to an exemplary embodiment of the present application;
fig. 9 is a schematic structural diagram of a terminal device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
And (3) quick charging: the terminal equipment is connected with the adapter, and then the terminal equipment is rapidly charged through the rapid charging control chip. In the Fast charging process, the terminal device may comply with a Fast charging Protocol, for example, common Fast charging protocols may include a PD (Power Delivery) Fast charging Protocol, a high-pass QC (Quick Charge) Fast charging Protocol, a PE (Pump Express) Fast charging Protocol, a VOOC/SVOOC Fast charging Protocol, an FCP (Fast Charge Protocol) Fast charging Protocol, and the like, and the terminal device is charged based on the Fast charging Protocol during charging.
With the rapid development of science and technology, various terminal devices have been applied to daily life of people, and people need to use the terminal devices in work, life and study, for example, people use the terminal devices to surf the internet, browse webpages, view videos and the like. The battery is used as a main power supply device of the terminal equipment, and when the battery power of the terminal equipment is insufficient, a user can charge the battery.
At present, various terminal devices have a quick charging function, after the terminal devices are connected with an adapter, the terminal devices and the adapter can be activated after mutual authentication of handshake, after the terminal devices and the adapter, the terminal devices can adjust parameters such as voltage and current output by the adapter and input by the terminal devices according to a quick charging protocol, and management and control of a charging process of the terminal devices are achieved.
Referring to fig. 1, a schematic diagram of a scenario architecture for charging a terminal device according to an exemplary embodiment of the present application is shown. As shown in fig. 1, the terminal device 110, the adaptor 120, and the charging cable 130 are included.
Wherein, the terminal device 110 may be a mobile phone, a tablet computer, a notebook computer, smart glasses, a smart watch, an MP3 player (Moving Picture Experts Group Audio Layer III, moving Picture Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, moving Picture Experts compression standard Audio Layer 4), a laptop portable computer, a smart wearable device, etc.
Optionally, when the terminal device 110 needs to be charged, the user may connect the terminal device 110, the adapter 120, and the charging line 130 as shown in fig. 1, and plug the adapter 120 into a socket to charge the terminal device. In practical application, the terminal device generally controls the charging speed and the charging temperature rise of the terminal device based on the use scene of the terminal device besides controlling the current output by the adapter based on the fast charging protocol.
In order to balance the charging speed and the charging temperature rise in the quick charging process, at present, the terminal device can intelligently control the charging current based on different scenes so as to avoid rapid deterioration of the temperature of the mobile phone. For example, for a light-load scene in which a long video and a short video run in the terminal device at 500mA, the terminal device can increase the charging speed by 10%. Because the current intelligent temperature control in the terminal device is only controlled based on the scene, but because the application programs running in the scene can be superposed, and the superposed temperature rises of a single scene and a complex scene are different, in order to better control the temperature rise condition of the battery of the terminal device, a system power consumption strategy is introduced to assist the intelligent charging (wherein, the larger the system power consumption is, the serious the heat generated by the CPU is, and then, the temperature of the battery is naturally relatively higher).
However, for some adapters, due to hardware reasons, the terminal device cannot acquire the output current of the adapter, and therefore, the system power consumption cannot be accurately calculated. For example, in an adapter and a terminal device based on the SVOOC fast charging protocol, since the terminal device and the adapter do not have an actual physical hardware channel (e.g., analog-to-digital converter (ADC)) to collect an output current of the adapter, it is necessary to design a scheme capable of dynamically monitoring and acquiring a current output of the adapter in real time so as to control fast charging.
For example, in the terminal device, an MCU (Microcontroller Unit) is used as a main control chip for fast charging, in which a hardware transceiving logic for fast charging and a software logic control for fast charging are integrated, and the terminal device performs data interaction with a D + D-transmission channel of the adapter through its own MCU. For example, the adapter sends a frame signal to the MCU of the terminal device through D + D-, the MCU of the terminal device receives the data interrupt, reads the data level on D-, assembles the data, processes the data, and sends the data to be replied to the adapter after processing the data. Because the MCU of the terminal equipment does not relate to a channel of the hardware ADC to obtain the current output by the adapter in real time, and the power consumption of the system cannot be calculated in time, the problem of low accuracy exists when the charging current of the adapter is adjusted.
Referring to fig. 2, a schematic structural diagram of a terminal device related to fig. 1 according to an exemplary embodiment of the present application is shown. As shown in fig. 2, the terminal device includes a processor 210, a transceiver 220, and a display unit 270. The display unit 270 may include a display screen, among others.
Optionally, the terminal device may further include a memory 230. The processor 210, the transceiver 220 and the memory 230 may communicate with each other via internal connection paths to transfer ranging data, the memory 230 is used for storing a computer program, and the processor 210 is used for calling and running the computer program from the memory 230.
The processor 210 may be combined with the memory 230 into a processing device, and more generally, separate components, and the processor 210 is configured to execute the program code stored in the memory 230 to implement the functions described above. In particular implementations, the memory 230 may be integrated into the processor 210 or may be separate from the processor 210.
It will be appreciated that the terminal device shown in fig. 2 may comprise one or more processing units, for example: the processor 210 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and/or a neural-Network Processing Unit (NPU), etc. The different processing units may be separate devices or may be integrated into one or more processors.
A memory may also be provided in processor 210 for storing instructions and data. In some embodiments, the memory in the processor 210 is a cache memory. The memory may hold instructions or data that have just been used or recycled by processor 210. If the processor 210 needs to use the instruction or data again, it can be called directly from the memory. Avoiding repeated accesses reduces the latency of the processor 210, thereby increasing the efficiency of the system.
In some embodiments, processor 210 may include one or more interfaces. The interface may include an integrated circuit (I2C) interface, an integrated circuit built-in audio (I2S) interface, a Pulse Code Modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a Mobile Industry Processor Interface (MIPI), a general-purpose input/output (GPIO) interface, a Subscriber Identity Module (SIM) interface, and/or a Universal Serial Bus (USB) interface, etc.
The UART interface is a universal serial data bus used for asynchronous communications. The bus may be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, a UART interface is generally used to connect the processor 210 and the transceiver 220. For example: the processor 210 communicates with the bluetooth module in the transceiver 220 through the UART interface to implement the bluetooth function.
The MIPI interface may be used to connect the processor 210 with peripheral devices such as the display unit 270. The MIPI interface includes a Camera Serial Interface (CSI), a Display Serial Interface (DSI), and the like. In some embodiments, the processor 210 and the display unit 270 communicate through a DSI interface to implement a display function of the terminal device.
The GPIO interface may be configured by software. The GPIO interface may be configured as a control signal and may also be configured as a data signal. In some embodiments, a GPIO interface may be used to connect the processor 210 with the display unit 270, the transceiver 220, and the like. The GPIO interface may also be configured as an I2C interface, I2S interface, UART interface, MIPI interface, and the like.
The transceiver 220 may provide solutions for wireless communication applied to a terminal device, including Wireless Local Area Networks (WLANs) (e.g., wireless fidelity (Wi-Fi) networks), bluetooth (BT), global Navigation Satellite System (GNSS), frequency Modulation (FM), near Field Communication (NFC), infrared (IR), and the like. The transceiver 220 may be one or more devices that integrate at least one communication processing module, for example, may include a bluetooth module.
Memory 230 may be used to store computer-executable program code, which includes instructions. The memory 230 may include a program storage area and a data storage area. The storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required by at least one function, and the like. The storage data area can store data (such as positioning data) created in the use process of the terminal equipment and the like. Further, the memory 230 may include a high-speed random access memory, and may further include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), and the like. The processor 210 executes various functional applications of the terminal device and data processing by executing instructions stored in the memory 230 and/or instructions stored in a memory provided in the processor.
In addition, in order to make the functions of the terminal device more complete, the terminal device may further include one or more of a power supply 250, an input unit 260, an audio circuit 280, a sensor 202, and the like.
And a power supply 250 for supplying power to various devices or circuits in the terminal device. Preferably, the power supply 250 may be logically connected to the processor 210 through a power management device, so that the power management device can manage charging, discharging, power consumption management, and the like.
The input unit 260 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the input unit 260 may include a touch panel and other input devices. The touch panel, also called a touch screen, may collect touch operations of a user on or near the touch panel, such as operations of the user on or near the touch panel using any suitable object or accessory, such as a finger, a stylus, etc., and drive the corresponding connection device according to a preset program. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 210, and can receive and execute commands sent by the processor 210. In addition, the touch panel may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 260 may include other input devices in addition to the touch panel. In particular, other input devices may include, but are not limited to, one or more of function keys, a trackball, a joystick, and the like.
The display unit 270 may be used to display information input by a user or information provided to the user and various menus of the terminal device. The Display unit 270 may include a Display panel, and optionally, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. Further, the touch panel may cover the display panel, and when the touch panel detects a touch operation on or near the touch panel, the touch panel transmits the touch operation to the processor 210 to determine the type of the touch event, and then the processor 210 provides a corresponding visual output on the display panel according to the type of the touch event.
The terminal device may also include at least one sensor 202, such as a gyroscope sensor, a motion sensor, and other sensors. In particular, a gyro sensor may be used to determine the motion attitude of the terminal device. In some embodiments, the angular velocity of the terminal device about three axes (i.e., the x, y, and z axes) may be determined by the gyro sensors. The gyroscope sensor can also be used for navigation and body feeling game scenes. As one type of motion sensor, the acceleration sensor can detect the magnitude of acceleration in various directions (i.e., x, y, and z axes), detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of the terminal device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), and the like; other sensors such as a pressure gauge, a barometer, a hygrometer, a thermometer and an infrared sensor, which are also configurable to the terminal device, are not described herein again.
Audio circuitry 280 may include a speaker and microphone to provide an audio interface between the user and the terminal device. The audio circuit 280 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electric signal, which is received by the audio circuit 280 and converted into audio data, which is then processed by the audio data output processor 210, and then transmitted to, for example, another terminal device via the RF circuit, or the audio data is output to the memory 230 for further processing.
It is to be understood that the illustrated structure of the embodiments of the present application does not constitute a specific limitation to the terminal device. In other embodiments of the present application, a terminal device may include more or fewer components than shown, or some components may be combined, some components may be split, or a different arrangement of components may be used. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
In addition, the terminal device according to the embodiment of the present application may be installed with an operating system, and an application program may be installed and run on the operating system, for example, the terminal device may be an Android (Android) system, an iOS system, a Linux system, and the like, which is not limited in the embodiment of the present application.
For the shielding scheme, when a user switches the terminal device to the child mode, and a child uses an application program, if a certain link exists and needs to enter a webpage or call a certain application program, the terminal device can still directly enter or call the webpage or the application program. For example, in a browser application, a user may access a website through a certain link, and a child may also enter the website, which may cause a safety hazard if there is content in the website that is not suitable for being displayed to the child, thereby reducing the safety of the terminal device in use.
In order to solve the problems in the related art, the charging current output by the adapter is acquired in real time, and the accuracy of the terminal device in adjusting the charging current of the adapter is improved.
Referring to fig. 3, a flowchart of a method for acquiring a charging current according to an exemplary embodiment of the present application is shown, where the method for acquiring a charging current may be used in a terminal device. As shown in fig. 3, the method for obtaining the charging current may include the following steps:
step 301, when the terminal device is electrically connected to the adapter, receiving a first instruction sent by the adapter, where the first instruction is used to obtain a battery voltage of the terminal device.
Optionally, when the user uses the terminal device, the terminal device may be connected to the adapter at any time, so as to charge the terminal device. When the terminal equipment is connected with the adapter, the terminal equipment can activate the adapter in a mode of sending a pulse string, and after activation, the adapter and the terminal equipment start to enter a quick charging flow.
Optionally, after the activation, the adapter may interact with the terminal device in a manner of actively sending an instruction. For example, the adapter actively sends a first instruction to the terminal device, so as to obtain the battery voltage of the terminal device.
Step 302, detecting a first query parameter, and returning first preset data to the adapter according to the first instruction when the first query parameter is a first target parameter.
Optionally, the terminal device is preset with a first query parameter, where the first query parameter may indicate whether the terminal device may access the output current of the adapter, when the first query parameter is a first target parameter, the terminal device may access the output current of the adapter, and when the first query parameter is not the first target parameter, the terminal device may not access the output current of the adapter.
After receiving the first instruction, the terminal device may detect whether a first query parameter of the terminal device is a first target parameter, acquire first preset data when the first query parameter is the first target parameter, and return the first preset data to the adapter as the battery voltage acquired this time. Wherein the first preset data may be preset in the terminal device. For example, in the terminal device, when the terminal device replies to the adapter with the battery voltage, the terminal device replies in a data mode of a 3-bit frame header + the battery voltage, where a bit reserved for the battery voltage has 7 bits, and then selects one unused data as the first preset data to reply to the adapter, for example, (1111111), thereby indicating that the terminal device needs to acquire the charging current output by the adapter in the next frame data.
And step 303, receiving the charging current returned by the adapter according to the first preset data.
Optionally, after the data returned to the adapter by the terminal device is the first preset data, the charging current returned by the adapter according to the first preset data may be received. That is, for the adapter, once the adapter receives the first preset data, the adapter acquires the output charging current of the adapter and sends the charging current acquired by the adapter to the terminal device, and the terminal device receives the charging current acquired by the adapter according to the first preset data in the acquisition process.
In summary, when the terminal device is electrically connected with the adapter, the method receives a first instruction sent by the adapter, wherein the first instruction is used for acquiring the battery voltage of the terminal device; detecting a first inquiry parameter, and returning first preset data to the adapter according to a first instruction when the first inquiry parameter is a first target parameter; and receiving the charging current returned by the adapter according to the first preset data. According to the method and the device, the first inquiry parameter is detected based on the first instruction sent by the adapter, when the first inquiry parameter is the first target parameter, the first preset data are returned to the adapter according to the first instruction, so that the adapter returns the charging current according to the first preset data, the effect of monitoring the charging current of the adapter in real time by the terminal device is achieved, and the accuracy of the charging current of the adapter adjusted by the terminal device is improved.
In a possible implementation manner, after the charging current of the adapter is obtained, the system power consumption can be calculated by using the charging current based on a preset system power consumption calculation scheme, so that the charging process of the adapter is controlled, the charging current of the adapter is adjusted to better meet the power consumption scene of a terminal device system, and the accuracy of the terminal device in adjusting the charging current of the adapter is improved.
Referring to fig. 4, a flowchart of a method for acquiring a charging current according to an exemplary embodiment of the present application is shown, where the method for acquiring a charging current may be used in a terminal device. As shown in fig. 4, the method for obtaining the charging current may include the following steps:
step 401, when the terminal device is electrically connected to the adapter, receiving a second instruction sent by the adapter.
When the terminal equipment is connected with the adapter, the terminal equipment can activate the adapter in a mode of sending a pulse string, and after activation, the adapter and the terminal equipment start to enter a quick charging flow. Optionally, the adapter may support the terminal device to access the output current of the adapter by programming firmware, and after activation, the adapter may interact with the terminal device in a manner of actively sending an instruction.
Optionally, the second instruction is used to instruct the adapter to support the terminal device to access the charging current output by the adapter. That is to say, after the terminal device is electrically connected to the adapter, the burst activation adapter is triggered to enter the fast charging process, and when the adapter supports the terminal device to access the charging current output by the adapter, a second instruction is actively sent to the terminal device, so that the terminal device adjusts the first query parameter to the first target parameter according to the second instruction.
Step 402, adjusting the first query parameter to the first target parameter according to the second instruction.
Optionally, after receiving the second instruction, the terminal device adjusts the preset first query parameter to the first target parameter. For example, the first query parameter is represented by request _ ibus, the first target parameter is true, and after the terminal device receives the second instruction, the terminal device instructs request _ ibus = true to complete the adjustment of the first query parameter to the first target parameter. Optionally, the first target parameter may also be represented by binary data, 1 represents true, and 0 represents false, and the specific form of the first target parameter is not limited in the present application.
Step 403, adjusting the second query parameter to the second target parameter according to the first preset period.
Optionally, after the first query parameter is set to be the first target parameter, the terminal device may periodically obtain the charging current output by the adapter when querying the charging current output by the adapter subsequently, and indicate, through the second query parameter, that the terminal device may obtain the charging current output by the adapter. For example, the terminal device may start a first timer and adjust the second query parameter according to a first preset period, that is, adjust the second query parameter to the second target parameter every other first preset period. For example, the second query parameter is represented by a should _ request, and the second target parameter may also be true, so that after the first timer is started, the terminal device may cause the should _ request = true every first preset period. And when the shade _ request = true, indicating that the terminal device can obtain the charging current output by the adapter, and when the shade _ request = false, indicating that the terminal device cannot obtain the charging current output by the adapter.
In a possible implementation manner, taking the first preset period as 10 seconds as an example, after the terminal device receives the second instruction sent by the adapter, a specific piece of code may be executed, and the specific piece of code may be preset in the terminal device by a developer. After receiving the second instruction, the terminal device sets the request _ ibus equal to the true, starts the first timer, and executes a preset specific code every 10 seconds, so as to set the shouldjrequest equal to the true, that is, the terminal device may ask the output current of the adapter every 10 seconds.
Step 404, receiving a first instruction sent by the adapter, where the first instruction is used to obtain a battery voltage of the terminal device.
Optionally, after the adapter sends the second instruction to the terminal device, the adapter may further continue to actively send the first instruction to the terminal device to obtain the battery voltage of the terminal device, and correspondingly, the terminal device receives the first instruction sent by the adapter. The first instruction may be sent in the same manner as the second instruction.
Step 405, detecting the first query parameter, and returning first preset data to the adapter according to the first instruction when the first query parameter is the first target parameter and the second query parameter is the second target parameter.
Optionally, through the adjustment from step 401 to step 404, the establishment of the fast charge between the terminal device and the adapter is completed, and from step 405, the terminal device may interact with the adapter to obtain the charging current output by the adapter, so as to perform management and control.
Optionally, in this step, the terminal device may return the first preset data to the adapter according to the first instruction by detecting the first query parameter and the second query parameter, when the first query parameter is the first target parameter and the second query parameter is the second target parameter. Optionally, the first preset data is preset in the terminal device by a developer. For example, the first preset data may be any one of a fixed symbol, a character string, a number, and the like.
In one possible implementation, the data format of the first preset data is the same as the data format when the terminal device returns the battery voltage to the adapter. For example, in the terminal device, when the terminal device replies to the adapter with the battery voltage, the terminal device replies in a data mode of a 3-bit frame header + the battery voltage, where a bit reserved for the battery voltage has 7 bits, and then selects one unused data as the first preset data to reply to the adapter, for example, (1111111), thereby indicating that the terminal device needs to acquire the charging current output by the adapter in the next frame data.
And 406, receiving the charging current returned by the adapter according to the first preset data.
Optionally, after the adapter receives the first preset data sent by the terminal device, the adapter may collect the charging current of the adapter and send the charging current to the terminal device. That is, the first preset data may also instruct the adapter to collect its own charging current.
Optionally, the charging current is the charging current of the adapter collected through the analog-to-digital conversion channel ADC after the adapter receives the first preset data. Namely, the adapter may be provided with an ADC module, and after receiving the first preset data, the ADC module performs ADC acquisition to acquire the charging current of the adapter itself, and sends the acquired charging current to the terminal device. Taking the first preset data 1111111 as an example, when the terminal device detects that the first inquiry parameter is the first target parameter and the second inquiry parameter is the second target parameter, the terminal device returns 1111111 to the adapter, the adapter analyzes the received data to obtain the first preset data 1111111, starts to perform ADC acquisition, obtains the charging current output by the terminal device, and feeds the charging current back to the terminal device.
Optionally, after receiving the charging current returned by the adapter, the terminal device may record the charging current, readjust the second query parameter to false, readjust the second query parameter to the second target parameter after the next first preset period, and cycle sequentially to obtain the charging current output by the adapter in real time.
Step 407, obtaining the output voltage of the adapter, the battery voltage of the terminal device and the battery current.
Optionally, in this application, the terminal device may further obtain an output voltage of the adapter, a battery voltage of the terminal device, and a battery current. The terminal device may read the output voltage VBUS of the adapter through its ADC module, and read the battery voltage and the battery current of the terminal device through an I2C (Inter-Integrated Circuit) bus.
Optionally, the system of the terminal device may be an Android (Android) system, an iOS system, a Linux system, etc., the Android system is taken as an example, the terminal device includes an MCU and a system processor (Android processor, AP), optionally, after the mos is opened by the MCU in the terminal device, a direct connection channel is established between the adapter and the terminal device, at this time, the MCU in the terminal device also interacts with the AP, the AP is reported with the fast-charging state of the MCU, and the AP is used for displaying the fast-charging state and monitoring the abnormality of the fast-charging burying point. The AP controlling and displaying the fast charging state may be that the terminal device controls display of a fast charging display pattern in the display screen through the AP.
For example, after the MCU of the terminal device turns on the mos, the second timer may be started; detecting a first inquiry parameter according to a second preset period; and when the first inquiry parameter is the first target parameter, acquiring the charging current recorded by the terminal equipment. For example, the second preset period is 2 seconds, and in the timer of 2s, the terminal device may determine whether the request _ IBUS is equal to true, and send a special identifier + IBUS to the AP if the request _ IBUS = true, where IBUS represents the received charging current.
In some embodiments, the interaction between the AP and the MCU of the terminal device may be performed in a manner of 8-bit data, in this application, when the MCU transmits the received charging current to the AP, it may be indicated that the MCU of the terminal device has acquired the charging current of the adapter through a special identifier in the first bit, and at this time, the AP of the terminal device may analyze the data of the following 7 bits to obtain the IBUS. For example, 1 indicates that the MCU of the terminal device has acquired the charging current of the adapter, 0 indicates that the MCU of the terminal device has not acquired the charging current of the adapter, and the recorded charging current may be acquired when the AP determines that the first bit is 1 after receiving data transmitted by the MCU every 2 seconds.
In a possible implementation manner, when the first bit of the data transmitted to the AP by the MCU is 0, the terminal device may further obtain the charging current output by the adapter in the following manner. For example, the terminal device may continuously obtain the battery voltage of the terminal device within a second preset time period; and acquiring the charging current of the adapter according to the battery voltage within the second preset time and the preset voltage value.
For example, when the battery voltage of the terminal device is continuously greater than the voltage value in the preset voltage-current curve within the second preset time period, the charging current output by the adapter is less than or equal to the current value corresponding to the preset voltage-current curve. Based on the principle, when the terminal equipment does not obtain the charging current of the adapter, the battery voltage of the terminal equipment within a second preset time can be continuously obtained; and calculating corresponding current according to the battery voltage within the second preset time and the preset voltage value, and regarding the calculated current as the charging current output by the adapter.
For example, the second preset time period is 10 seconds, the terminal device obtains the battery voltage within 10 seconds of itself and detects the battery voltage, and if the battery voltage is continuously greater than the preset voltage value (4134 mv) in the preset voltage-current curve for 10 seconds, the charging current output by the adapter is 6a. The preset voltage-current curve may be a battery voltage curve acquired by a developer in advance by collecting a battery of the terminal device. In a possible implementation manner, the terminal device may establish a corresponding relationship between the estimated charging current and the magnitude relationship between the battery voltage and the preset voltage value within the second preset time period. Referring to table 1, a table of correspondence between the magnitude relationship between the battery voltage and the preset voltage value in the second preset time period and the charging current is shown according to an exemplary embodiment of the present application.
Voltage of battery Charging current
Continuously greater than the first voltage value within 10s Charging current one
Continuously exceeds the second voltage value within 10s Charging current two
Continuously exceeds the third voltage value within 10s Charging current three
…… ……
TABLE 1
As shown in table 1, the terminal device obtains the corresponding charging current by obtaining the battery voltage within 10s and comparing with the preset voltage value in the preset voltage-current curve. For example, when the terminal device obtains the battery voltage within 10s to be continuously greater than the first voltage value, the charging current of the adapter obtained by the terminal device is the charging current one.
And step 408, calculating the system power consumption of the terminal device according to the charging current of the adapter, the output voltage of the adapter, the battery voltage and the battery current of the terminal device.
Optionally, the terminal device obtains the charging current of the adapter, the output voltage of the adapter, the battery voltage of the terminal device and the battery current, and the above values may be introduced into a calculation formula of the system power consumption to calculate the system power consumption of the terminal device. For example, the calculation formula is as follows:
Psys=Padapter-Pbatt=(VBUS*BIUS*LOSS-VBATT*IBATT);
where Psys represents system power consumption, padapter represents adapter output power, pbatt represents power into the battery, VBUS represents adapter output voltage, BIUS represents adapter charging current, LOSS represents path LOSS between the adapter and the terminal device, VBATT represents terminal device battery voltage, and IBATT represents terminal device battery current.
Step 409, adjusting the charging current of the adapter according to the system power consumption.
Optionally, after the terminal device calculates the system power consumption, the calculated system power consumption may be obtained through an event notification framework (frame) layer, so as to perform charging control and adjust the charging current of the adapter. Optionally, when the system power consumption is large, the terminal device may decrease the charging current of the adapter, and when the system power consumption is small, the terminal device may increase the charging current of the adapter.
In a possible implementation manner, when the first query parameter is the third target parameter, acquiring a battery voltage of the terminal device according to the first instruction; and returning the battery voltage to the adapter, so that the adapter determines a battery curve of the terminal device according to the battery voltage, and adjusts the charging current of the adapter according to the battery curve. That is, when the first query parameter is detected as described above, if the first query parameter is the third target parameter (for example, false), the terminal device normally acquires its own battery voltage and returns the battery voltage to the adapter. Optionally, when the terminal device detects the second query parameter, if the second query parameter is a fourth target parameter (for example, false), the terminal device may also normally obtain its battery voltage, and return the battery voltage to the adapter.
Optionally, after the adapter receives the battery voltage returned by the terminal device, the adapter may determine a battery curve of the terminal device according to the battery voltage, and adjust the charging current of the adapter according to the battery curve. Alternatively, the battery curve may be established by the adapter based on the resulting battery voltage.
In a possible implementation manner, when the terminal device is electrically connected with the adapter, the second instruction is not received within a first preset time period; acquiring the battery voltage of the terminal equipment within a second preset time; and acquiring the charging current of the adapter according to the battery voltage within the second preset time and the preset voltage value. For example, the first preset time is 5 seconds, when the terminal device is electrically connected with the adapter, if the second instruction sent by the adapter is not received within 5 seconds, it indicates that the terminal device does not have the capability of acquiring the charging current output by the adapter, and the terminal device calculates the charging current of the adapter based on its own battery voltage, so as to obtain the charging current of the adapter. Optionally, the calculation method may refer to the method in table 1 described above and is not described herein again.
It should be noted that the charging current of the adapter corresponds to the current in the charging wire in fig. 1 during the charging process of the terminal device.
In summary, when the terminal device is electrically connected with the adapter, the method receives a first instruction sent by the adapter, wherein the first instruction is used for acquiring the battery voltage of the terminal device; detecting a first inquiry parameter, and returning first preset data to the adapter according to a first instruction when the first inquiry parameter is a first target parameter; and receiving the charging current returned by the adapter according to the first preset data. According to the method and the device, the first inquiry parameter is detected based on the first instruction sent by the adapter, when the first inquiry parameter is the first target parameter, the first preset data are returned to the adapter according to the first instruction, so that the adapter returns the charging current according to the first preset data, the effect of monitoring the charging current of the adapter in real time by the terminal device is achieved, and the accuracy of the charging current of the adapter adjusted by the terminal device is improved.
In addition, the scheme sets the relation between the battery voltage and the preset voltage value in the preset time period according to the terminal equipment without the inquiry adapter, and the flexibility of monitoring the charging current of the adapter in real time is improved.
In the following, the solutions in fig. 3 and fig. 4 are exemplified by taking the terminal device as a mobile phone and performing fast charging between the mobile phone and the adapter by using the SVOOC fast charging protocol, and details that are not disclosed in the embodiment of the present application may refer to the description in fig. 4, and are not described herein again. Please refer to fig. 5, which illustrates a schematic diagram of a charging structure of a terminal device according to an exemplary embodiment of the present application. As shown in fig. 5, the CPU module 501, the mcu module 502, the fuel gauge module 503, the charge pump module 504, the adc module 505, the adapter 506, and the ADSP module 507 are included. The connection relationship between the respective modules is shown in fig. 5.
The MCU module 502 of the terminal device can transmit data with the adapter 506 through D + D-. In the SVOOC protocol, an adapter is a master device, an MCU is a slave device, and usually the adapter issues a command to the MCU of a mobile phone, but the MCU cannot actively issue a command to the adapter. Therefore, in the scheme provided by the application, the MCU of the terminal device determines the next command sent by the adapter by returning the preset data.
Optionally, please refer to fig. 6, which shows a flowchart of an interaction between the MCU and the adapter according to an exemplary embodiment of the present application. As shown in fig. 6, the interaction flow includes the following steps:
step 601, the adapter itself detects whether the charging current is supported by the MCU query.
If so, go to step 602, otherwise go to step 606.
In step 602, the adapter sends command A to the MCU.
Optionally, the command a sent by the adapter indicates that the MCU that can support the terminal device itself can query the charging current.
In step 603, the mcu receives command a and adjusts request _ ibus = true.
The command a corresponds to the second instruction, the request _ ibus corresponds to the first query parameter, and the terminal device adjusts the first query parameter according to the second instruction.
In step 604, the MCU starts a first timer.
In step 605, the shouldjrequest = true is set every 10 s.
Wherein the shouldjrequest is equivalent to the second query parameter. Wherein the setting of 10 seconds may be preset by a developer. For example, the rated maximum output current of the adapter is 7.3A, and the preset battery curve is: i _ curve _ 1; ..; i _ current _ 5. Optionally, the developer may detect according to the above-mentioned curve: when the adapter is just inserted, the battery voltage of the terminal device is 3.7v, then the battery voltage of the terminal device is charged to the battery voltage 4.134mv at 7.3A, at which time, a downshift is required beyond 4.134mv, and 7.3A is not an integer multiple of 500ma, then it needs to be decreased to 7A, the battery voltage drops back to less than 4.134mv due to the current reduction, then the charging continues to 4.134mv at 7A, then to 4.134mv, the terminal device is downshifted again, the battery is charged to 4.134mv until it drops to the second gear curve i _ curve 2 cure, 6a, v _curv _. Therefore, the mcu is required to send the battery voltage to the adapter in real time to select the curve, and the output current of the adapter within 10s is stable and cannot be out of gear.
Step 606, the adapter sends command B to the MCU.
The command B is used to obtain the battery voltage of the terminal device, and corresponds to the first command.
In step 607, the mcu receives command B.
In step 608, the MCU checks whether request _ ibus is true and the should _ request is true.
Optionally, when the request _ ibus is true and the should _ request is true, step 609 is executed, otherwise step 610 is executed.
In step 609, the MCU replies the first special data C.
Optionally, the first special data C corresponds to the first preset data. In the application, the actual battery voltage is generally 4.5v, the data format returned to the adapter by the MCU is still 3bit frame header + battery voltage, and the bit reserved for the battery voltage has 7 bits, so that 1111111 can be adopted to identify the first special data C and return to the adapter.
And step 610, the MCU replies the battery voltage collected by the MCU.
In step 611, the adapter detects whether the first special data C is received.
The adapter detects whether the data replied by the MCU belongs to the first special data C, if so, step 612 is executed, otherwise step 613 is executed.
In step 612, the adapter executes the ADC to collect the charging current.
Optionally, the adapter may collect the charging current through its own ADC module, in fig. 5, the ADC module in the MCU may also establish a channel with the ADC module of the adapter, and the MCU obtains the charging current collected by the adapter through the ADC module.
Step 613, the adapter sends the collected charging current to the MCU.
In step 614, the MCU records the charging current and adjusts the should _ request to false.
And step 615, the adapter acquires a battery curve according to the battery voltage replied by the MCU, and adjusts the charging current of the adapter according to the battery curve.
Optionally, when the MCU of the terminal device cannot inquire about the charging current of the adapter, the adapter can control the output charging current by itself through the battery curve, so as to achieve the effect of intelligent adjustment.
In summary, according to the application, when the terminal device is electrically connected with the adapter, the command a sent by the adapter is received, the request _ ibus is detected, and when the request _ ibus = true, the first special data C is returned to the adapter; receiving the charging current returned by the adapter according to the first special data C, realizing the effect of monitoring the charging current of the adapter in real time by the terminal equipment, and improving the accuracy of adjusting the charging current of the adapter by the terminal equipment.
Optionally, after the fast charge between the terminal device and the adapter is established, the MCU may turn on the MOS, and the MCU may interact with a CPU (equivalent to the AP in fig. 4) of the terminal device. Please refer to fig. 7, which shows a flowchart of an interaction between the MCU and the CPU according to an exemplary embodiment of the present application. As shown in fig. 7, the interaction flow includes the following steps:
in step 701, the MCU starts a second timer.
Optionally, the interaction between the MCU and the CPU may be performed every 2 seconds.
In step 702, the MCU checks whether request _ ibus is true.
When request _ ibus is true, step 703 is performed, and when request _ ibus = false, step 704 is performed.
And step 703, the MCU replies the special identifier and the recorded charging current to the CPU.
The special identifier can be represented by 1bit of data, for example, the interaction between the CPU and the MCU is also 8 bits, and since it is sufficient that the charging current of the battery also uses 7 bits of data, 1bit of the data is useless, the MCU can use the bit identifier to interact with the IBUS data, if 1, the MCU obtains the charging current of the adapter, and if 0, the MCU does not obtain the charging current of the adapter.
And step 704, the MCU replies a command D to the CPU.
Optionally, the command D may instruct the CPU to acquire IBUS in a preset manner.
In step 705, the cpu determines whether the data returned by the MCU includes a special identifier.
If yes, go to step 706, otherwise go to step 707.
In step 706, the CPU obtains the recorded charging current.
In step 707, the cpu obtains the battery voltage for a preset duration.
In step 708, the CPU determines the charging current of the adapter based on the battery voltage for a predetermined period of time.
In the steps 707 to 708, the determination of the charging current of the adapter may refer to table 1, which is not described herein again.
In step 709, the cpu reads the output voltage of the adapter through the ADC module in the MCU, and reads the battery voltage and the battery current in the fuel gauge through the I2C bus.
Step 710, the CPU calculates the system power consumption.
Alternatively, the terminal device may calculate according to the above calculation formula of Psys = Padapter-Pbatt = (VBUS × BIUS × LOSS-VBATT × IBATT).
In step 711, the cpu notifies the framework layer via an evevevevevevev event to obtain the system power consumption.
To sum up, this application calculates the system consumption of terminal equipment based on the charging current that MCU visited under the charging current condition that terminal equipment's MCU has the inquiry adapter, and under the charging current condition that terminal equipment's MCU does not have the inquiry adapter, calculates the charging current of adapter according to predetermined calculation mode, and then calculates terminal equipment's system consumption, realizes terminal equipment to the effect of the charging current real-time supervision of adapter, improves the accuracy of terminal equipment adjustment adapter's charging current.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 8, a block diagram of a device for obtaining a charging current according to an exemplary embodiment of the present application is shown. The charging current obtaining apparatus 800 may be used in a terminal device to perform all or part of the steps performed by the terminal device in the methods provided by the embodiments shown in fig. 3, fig. 4, fig. 6, or fig. 7. The charging current obtaining apparatus 800 includes:
a first receiving module 801, configured to receive a first instruction sent by an adapter when the terminal device is electrically connected to the adapter, where the first instruction is used to obtain a battery voltage of the terminal device;
a first returning module 802, configured to, when the first query parameter is a first target parameter, return first preset data to the adapter according to the first instruction;
a second receiving module 803, configured to receive a charging current returned by the adapter according to the first preset data.
In summary, when the terminal device is electrically connected with the adapter, the method receives a first instruction sent by the adapter, wherein the first instruction is used for acquiring the battery voltage of the terminal device; detecting a first query parameter, and returning first preset data to the adapter according to a first instruction when the first query parameter is a first target parameter; and receiving the charging current returned by the adapter according to the first preset data. According to the method and the device, the first inquiry parameter is detected based on the first instruction sent by the adapter, when the first inquiry parameter is the first target parameter, the first preset data are returned to the adapter according to the first instruction, so that the adapter returns the charging current according to the first preset data, the effect of monitoring the charging current of the adapter in real time by the terminal device is achieved, and the accuracy of the charging current of the adapter adjusted by the terminal device is improved.
Optionally, a data format of the first preset data is the same as a data format of the terminal device when the terminal device returns the battery voltage to the adapter.
Optionally, the charging current is acquired by the adapter through an analog-to-digital conversion channel ADC after the adapter receives the first preset data.
Optionally, the apparatus further comprises:
the third receiving module is used for receiving a second instruction sent by the adapter when the terminal device is electrically connected with the adapter before the first instruction sent by the adapter is received;
and the first adjusting module is used for adjusting the first inquiry parameter to the first target parameter according to the second instruction.
Optionally, the apparatus further comprises:
a second adjusting module, configured to adjust a second query parameter to a second target parameter according to a first preset period after the first query parameter is adjusted to the first target parameter according to the second instruction;
and the first execution module is used for executing the step of returning first preset data to the adapter according to the first instruction when the first inquiry parameter is the first target parameter and the second inquiry parameter is the second target parameter.
Optionally, the suspending further includes:
the first obtaining module is used for obtaining the battery voltage of the terminal equipment within a second preset time length when the terminal equipment is electrically connected with the adapter and the second instruction is not received within the first preset time length;
and the second acquisition module is used for acquiring the charging current of the adapter according to the battery voltage and the preset voltage value within a second preset time length.
Optionally, the apparatus further comprises:
a third obtaining module, configured to obtain an output voltage of the adapter, a battery voltage of the terminal device, and a battery current after receiving the charging current returned by the adapter according to the first preset data;
the first calculation module is used for calculating the system power consumption of the terminal equipment according to the charging current of the adapter, the output voltage of the adapter, the battery voltage of the terminal equipment and the battery current;
and the third adjusting module is used for adjusting the charging current of the adapter according to the system power consumption.
Optionally, the apparatus further comprises:
the second detection module is used for detecting the first inquiry parameter according to a second preset period before the output voltage of the adapter, the battery voltage of the terminal equipment and the battery current are obtained;
a fourth obtaining module, configured to obtain the charging current recorded by the terminal device when the first query parameter is the first target parameter.
Optionally, the apparatus further comprises:
a fifth obtaining module, configured to, when the first query parameter is a third target parameter, obtain a battery voltage of the terminal device according to the first instruction;
and the second returning module is used for returning the battery voltage to the adapter so that the adapter determines a battery curve of the terminal equipment according to the battery voltage and adjusts the charging current of the adapter according to the battery curve.
Fig. 9 is a schematic structural diagram of a terminal device according to an exemplary embodiment of the present application. The terminal apparatus 900 includes: a processor 901 and memory 902, a communication interface 903, and a bus 904. Wherein the memory 902 is used for storing instructions, and the processor 901 is used for executing the instructions stored in the memory 902. The processor 901, the memory 902 and the communication interface 903 are communicatively connected to each other by a bus 904.
Wherein the processor 901 is configured to: acquiring a first parameter of the apparatus 900, where the first parameter is used to indicate a current communication quality of the terminal device 900; and controlling the terminal device 900 to perform network connection again when the communication quality of the terminal device 900 is determined to be lower than the preset communication quality threshold value according to the first parameter.
The terminal device 900 may be configured to perform each step and/or flow corresponding to the first device or the second device in the above method embodiments.
Alternatively, the memory 902 may include a read-only memory and a random access memory, and provides instructions and data to the processor 901. A portion of the memory 902 may also include non-volatile random access memory. For example, memory 902 may also store device type information. The processor 901 may be configured to execute the instructions stored in the memory, and when the processor executes the instructions, the processor 901 may perform each step and/or flow corresponding to the first device or the second device in the above method embodiments.
It should be understood that, in the embodiment of the present application, the processor may be a Central Processing Unit (CPU), and the processor may also be other general processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The embodiment of the present application further provides a computer-readable medium, where at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement all or part of the steps performed by the terminal device in the method for obtaining a charging current according to the above various embodiments.
The embodiment of the present application further provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded and executed by the processor to implement all or part of the steps performed by the terminal device or the server, the method for obtaining a charging current according to the above various embodiments.
It should be noted that: in the apparatus provided in the foregoing embodiment, when the control of the terminal device is executed, only the division of the functional modules is illustrated, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus and method embodiments provided by the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments for details, which are not described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description, and do not represent the advantages and disadvantages of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is intended only to illustrate the alternative embodiments of the present application, and should not be construed as limiting the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (12)

1. A method for acquiring a charging current is applied to a terminal device, and comprises the following steps:
when the terminal equipment is electrically connected with the adapter, receiving a first instruction sent by the adapter, wherein the first instruction is used for acquiring the battery voltage of the terminal equipment;
detecting a first query parameter, and returning first preset data to the adapter according to the first instruction when the first query parameter is a first target parameter;
and receiving the charging current returned by the adapter according to the first preset data.
2. The method according to claim 1, wherein the data format of the first preset data is the same as the data format when the terminal device returns the battery voltage to the adapter.
3. The method of claim 1, wherein the charging current is a charging current of the adapter collected through an analog-to-digital conversion channel (ADC) after the adapter receives the first preset data.
4. The method of claim 1, prior to said receiving the first instruction sent by the adapter, further comprising:
when the terminal equipment is electrically connected with the adapter, receiving a second instruction sent by the adapter, wherein the second instruction is used for adjusting the first inquiry parameter;
and adjusting the first inquiry parameter to the first target parameter according to the second instruction.
5. The method of claim 4, wherein after said adjusting said first query parameter to said first target parameter according to said second instruction, further comprising:
adjusting the second inquiry parameter to a second target parameter according to a first preset period;
and when the first query parameter is the first target parameter and the second query parameter is the second target parameter, executing the step of returning first preset data to the adapter according to the first instruction.
6. The method according to claim 4 or 5, characterized in that the method further comprises:
when the terminal equipment is electrically connected with the adapter, if the second instruction is not received within a first preset time period, acquiring the battery voltage of the terminal equipment within a second preset time period;
and acquiring the charging current of the adapter according to the battery voltage and the preset voltage value within a second preset time.
7. The method according to any one of claims 1 to 5, further comprising, after said receiving a charging current returned by said adapter according to said first preset data:
acquiring the output voltage of the adapter, the battery voltage and the battery current of the terminal equipment;
calculating the system power consumption of the terminal equipment according to the charging current of the adapter, the output voltage of the adapter, the battery voltage of the terminal equipment and the battery current;
and adjusting the charging current of the adapter according to the system power consumption.
8. The method of claim 7, wherein prior to said obtaining the output voltage of the adapter, the battery voltage of the terminal device, and the battery current, further comprising:
detecting the first inquiry parameter according to a second preset period;
when the first inquiry parameter is the first target parameter, acquiring the charging current recorded by the terminal equipment.
9. The method of any of claims 1 to 5, further comprising:
when the first inquiry parameter is a third target parameter, acquiring the battery voltage of the terminal equipment according to the first instruction;
and returning the battery voltage to the adapter, so that the adapter determines a battery curve of the terminal equipment according to the battery voltage, and adjusting the charging current of the adapter according to the battery curve.
10. An apparatus for acquiring a charging current, the apparatus being applied to a terminal device, the apparatus comprising:
the terminal equipment comprises a first receiving module, a second receiving module and a control module, wherein the first receiving module is used for receiving a first instruction sent by an adapter when the terminal equipment is electrically connected with the adapter, and the first instruction is used for acquiring the battery voltage of the terminal equipment;
the first returning module is used for returning first preset data to the adapter according to the first instruction when the first inquiry parameter is a first target parameter;
and the second receiving module is used for receiving the charging current returned by the adapter according to the first preset data.
11. A terminal device comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a set of codes, or a set of instructions, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the method for obtaining a charging current according to any one of claims 1 to 9.
12. A computer-readable storage medium, wherein at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the storage medium, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by a processor to implement the method for obtaining the charging current according to any one of claims 1 to 9.
CN202211105428.3A 2022-09-09 2022-09-09 Charging current obtaining method and device, terminal equipment and storage medium Pending CN115425711A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211105428.3A CN115425711A (en) 2022-09-09 2022-09-09 Charging current obtaining method and device, terminal equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211105428.3A CN115425711A (en) 2022-09-09 2022-09-09 Charging current obtaining method and device, terminal equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115425711A true CN115425711A (en) 2022-12-02

Family

ID=84202877

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211105428.3A Pending CN115425711A (en) 2022-09-09 2022-09-09 Charging current obtaining method and device, terminal equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115425711A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117041413A (en) * 2023-05-05 2023-11-10 荣耀终端有限公司 Charging control method, device, electronic equipment and readable storage medium
TWI845152B (en) * 2022-12-09 2024-06-11 大陸商昂寶電子(上海)有限公司 Method and device for calibrating output current of fast charging charger and computer-readable medium storing instructions used therein

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130076314A1 (en) * 2010-06-09 2013-03-28 Hayato Nagakura Charging control system
CN103269106A (en) * 2013-05-31 2013-08-28 Tcl通讯(宁波)有限公司 Charging method for setting charging current automatically and mobile terminal
CN104242385A (en) * 2014-08-26 2014-12-24 东莞莱玛电子科技有限公司 Battery pack, charger, charging system, discharging device and discharging system
CN112152282A (en) * 2016-10-12 2020-12-29 Oppo广东移动通信有限公司 Device to be charged and charging method
CN112448450A (en) * 2020-11-16 2021-03-05 Oppo广东移动通信有限公司 Charging control method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130076314A1 (en) * 2010-06-09 2013-03-28 Hayato Nagakura Charging control system
CN103269106A (en) * 2013-05-31 2013-08-28 Tcl通讯(宁波)有限公司 Charging method for setting charging current automatically and mobile terminal
CN104242385A (en) * 2014-08-26 2014-12-24 东莞莱玛电子科技有限公司 Battery pack, charger, charging system, discharging device and discharging system
CN112152282A (en) * 2016-10-12 2020-12-29 Oppo广东移动通信有限公司 Device to be charged and charging method
CN112448450A (en) * 2020-11-16 2021-03-05 Oppo广东移动通信有限公司 Charging control method and device, electronic equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI845152B (en) * 2022-12-09 2024-06-11 大陸商昂寶電子(上海)有限公司 Method and device for calibrating output current of fast charging charger and computer-readable medium storing instructions used therein
CN117041413A (en) * 2023-05-05 2023-11-10 荣耀终端有限公司 Charging control method, device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US11368039B2 (en) Battery charging method and electronic device
CN115425711A (en) Charging current obtaining method and device, terminal equipment and storage medium
CN110085934B (en) Charging method of terminal battery and mobile terminal
CN106786961B (en) Charging method, device and terminal
CN106231433B (en) A kind of methods, devices and systems playing network video
WO2018166204A1 (en) Method for controlling fingerprint recognition module, and mobile terminal and storage medium
CN106549465B (en) Charge control method, device, system and terminal
CN106294168B (en) A kind of method and system carrying out Application testing
CN111293744B (en) Charging method, charging device, electronic device, and medium
CN109962514A (en) A kind of charging method and mobile terminal
CN107734618B (en) Application program closing method and device, storage medium and electronic equipment
CN111443803A (en) Mode switching method, device, storage medium and mobile terminal
CN106066769B (en) A kind of processing method and mobile terminal of mobile terminal
CN111491292B (en) Internet access mode adjusting method and device, storage medium and mobile terminal
CN108448177B (en) Charging method and terminal
CN111404242A (en) Charging method, charging device, storage medium and mobile terminal
WO2016187842A1 (en) Charging method and mobile terminal
CN111725864B (en) Electric quantity transfer method, electronic equipment and readable storage medium
CN112312542B (en) Ephemeris information collection method, device, storage medium and mobile terminal
CN112286849A (en) Wireless charging base data switching method and system, storage medium and terminal equipment
CN112542867A (en) Mobile terminal power supply control method and device, terminal equipment and storage medium
CN111651299A (en) Wireless chip reset control method and device, storage medium and mobile terminal
CN112256610B (en) Connection control method, system, storage medium and mobile terminal
CN111988059B (en) Wireless data transmission method, device, storage medium and mobile terminal
CN109617660B (en) Method and device for setting carrier aggregation frequency band, storage medium and mobile terminal

Legal Events

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