CN116699422A - Battery electric quantity calculating method and related device - Google Patents

Battery electric quantity calculating method and related device Download PDF

Info

Publication number
CN116699422A
CN116699422A CN202211732786.7A CN202211732786A CN116699422A CN 116699422 A CN116699422 A CN 116699422A CN 202211732786 A CN202211732786 A CN 202211732786A CN 116699422 A CN116699422 A CN 116699422A
Authority
CN
China
Prior art keywords
electronic equipment
battery
electronic device
electric quantity
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202211732786.7A
Other languages
Chinese (zh)
Other versions
CN116699422B (en
Inventor
许新云
李凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211732786.7A priority Critical patent/CN116699422B/en
Publication of CN116699422A publication Critical patent/CN116699422A/en
Application granted granted Critical
Publication of CN116699422B publication Critical patent/CN116699422B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • G01R31/36Arrangements for testing, measuring or monitoring the electrical condition of accumulators or electric batteries, e.g. capacity or state of charge [SoC]
    • G01R31/382Arrangements for monitoring battery or accumulator variables, e.g. SoC
    • G01R31/3835Arrangements for monitoring battery or accumulator variables, e.g. SoC involving only voltage measurements
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Abstract

The embodiment of the application provides a battery electric quantity calculating method and a related device. The method is applied to electronic equipment, at least one corresponding relation is stored in the electronic equipment, and the corresponding relation comprises the following steps: the corresponding relation between the working scenes, the battery voltages and the internal resistance values, wherein the internal resistance values corresponding to different working scenes and/or different battery voltages are different, and the method comprises the following steps: obtaining M battery voltage values obtained by the electronic equipment at M sampling moments; m is a positive integer; combining the working scene and the corresponding relation of the electronic equipment to obtain M battery voltage values which respectively correspond to the internal resistance values; according to the battery power change values of the M current values of the electronic equipment, the M current values comprise: ratio of the M battery voltage values to the respective corresponding internal resistance values. Therefore, the accuracy of the calculation of the battery electric quantity of the electronic equipment can be improved, more accurate electric quantity indication is given to the user, and the use experience of the user is improved.

Description

Battery electric quantity calculating method and related device
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method and an apparatus for calculating battery power.
Background
Along with the development of touch screen technology, handwriting pens matched with the touch screen are also gradually developed and applied. Electronic devices with touch screens typically support users in controlling the electronic device by touching the touch screen with a stylus.
At present, when the battery electric quantity of the handwriting pen is measured, the battery electric quantity of the handwriting pen can be measured through an entity electric quantity meter, and the battery electric quantity of the handwriting pen can be calculated through a software code mode.
However, in the process of calculating the battery power of the handwriting pen by using a software code, a situation of large battery power calculation error may occur, which affects the use experience of the user.
Disclosure of Invention
The embodiment of the application provides a battery electric quantity calculation method and a related device, which are applied to the technical field of terminals. According to the method, the battery electric quantity can be calculated according to the actual working scene of the electronic equipment and through the internal resistance corresponding to the working scene.
In a first aspect, an embodiment of the present application provides a method for calculating battery power, which is applied to an electronic device, where at least one correspondence is stored in the electronic device, where the correspondence includes: the corresponding relation between the working scenes, the battery voltages and the internal resistance values, wherein the internal resistance values corresponding to different working scenes and/or different battery voltages are different, and the method comprises the following steps: obtaining M battery voltage values obtained by the electronic equipment at M sampling moments; m is a positive integer; combining the working scene and the corresponding relation of the electronic equipment to obtain the internal resistance values corresponding to the voltage values of the M batteries respectively; according to the battery power change values of the M current values of the electronic equipment, the M current values comprise: ratio of the M battery voltage values to the respective corresponding internal resistance values. According to the method provided by the embodiment of the application, the electronic equipment can obtain the internal resistance corresponding to each voltage value of the battery in the working scene according to the working scene, so that the current value can be obtained through the voltage value and the internal resistance value of the battery, and the calculation of the change value of the electric quantity of the battery is performed based on the current value. Therefore, the accuracy of the calculation of the battery electric quantity of the electronic equipment can be improved, more accurate electric quantity indication is given to the user, and the use experience of the user is improved.
In a possible implementation, before obtaining the M battery voltage values obtained by the electronic device at the M sampling moments, the method further includes: judging whether the electronic equipment is being charged; obtaining M battery voltage values obtained by the electronic device at M sampling moments includes: and when the electronic equipment is not charged, obtaining M battery voltage values obtained by the electronic equipment at M sampling moments. Thus, the battery electric quantity calculation method provided by the embodiment of the application can accurately calculate the electric quantity of the battery when the electronic equipment is in a discharging state.
In a possible implementation, the method further includes: subtracting the battery power change value from the power value of the electronic equipment to obtain an updated power value of the electronic equipment. Therefore, the residual electric quantity of the electronic equipment can be obtained rapidly and accurately by subtracting the battery electric quantity change value from the electric quantity value of the electronic equipment, and the user can estimate the usable time of the electronic equipment according to the residual electric quantity of the electronic equipment, so that the user experience is improved.
In a possible implementation, the method further includes: and when the electronic equipment is being charged, obtaining a battery electric quantity change value of the electronic equipment based on the preset charging current of the electronic equipment. Therefore, when the electronic equipment is being charged, the electronic equipment can accurately calculate the change value of the battery electric quantity during charging, and the calculation resource can be saved.
In a possible implementation, the method further includes: when the electronic equipment is being charged, a first battery electric quantity change value of the electronic equipment is obtained based on a preset charging current of the electronic equipment, and a second battery electric quantity change value of the electronic equipment is obtained according to M current values; and calculating the difference value between the first battery power change value and the second battery power change value to obtain the battery power change value of the electronic equipment. Therefore, the electronic equipment can accurately calculate the change value of the electric quantity of the battery based on the charging current and the discharging current of the battery.
In a possible implementation, the method further includes: and adding a battery power change value to the power value of the electronic equipment to obtain an updated power value of the electronic equipment. Therefore, the battery power change value is added to the power value of the electronic equipment, so that the battery power of the electronic equipment in a charged state can be accurately obtained in real time, the electronic equipment can stop charging in time according to the battery power of the electronic equipment, the battery is prevented from being overcharged, and the service life of the battery is prolonged.
In one possible implementation, determining whether an electronic device is charging includes: judging whether a Universal Serial Bus (USB) interface of the electronic equipment is in an in-place state or not; when the USB interface is in a bit state, judging that the electronic equipment is being charged; when the USB interface is not in a bit state, the electronic equipment is judged not to be charged. Therefore, whether the electronic equipment is being charged or not can be rapidly and accurately judged according to the in-place state of the USB interface of the electronic equipment.
In one possible implementation, the method specifically includes: and carrying out time integration on the M current values to obtain a battery power change value of the electronic equipment. Therefore, the electronic equipment can accurately calculate the battery power change value of the electronic equipment according to the obtained current value, and further can acquire the battery power of the electronic equipment in real time.
In one possible implementation, the working scenario includes any one of the following scenarios: a write stroke scene, an air mouse scene, a rest unused scene, or a dormant scene. Thus, the discharge electric quantity of the handwriting pen under different scenes can be accurately calculated.
In a second aspect, an embodiment of the present application provides a battery power calculation apparatus. The battery power calculation device may be an electronic device, or may be a chip or a chip system in the electronic device, and the battery power calculation device may include a processing unit, and may further include a communication unit and a storage unit, where the processing unit is configured to implement any method related to processing performed by the electronic device in any one of possible implementations of an aspect or aspect. When the battery level computing device is an electronic device, the processing unit may be a processor. The communication unit is for supporting the battery level computing device to interact with other devices. The battery charge calculation device may further include a storage unit, which may be a memory. The storage unit is configured to store instructions, and the processing unit executes the instructions stored by the storage unit, so as to cause the electronic device to implement the aspect or the method performed by the electronic device described in any one of possible implementations of the aspect. When the battery charge calculation means is a chip or a system of chips within an electronic device, the processing unit may be a processor. The processing unit executes instructions stored by the storage unit to cause the electronic device to implement aspects or methods performed by the electronic device described in any one of its possible implementations. The memory unit may be a memory unit (e.g., a register, a cache, etc.) within the chip, or a memory unit (e.g., a read-only memory, a random access memory, etc.) within the electronic device that is external to the chip.
The processing unit is used for acquiring M battery voltage values obtained by the electronic equipment at M sampling moments; m is a positive integer; the processing unit is also used for combining the working scene and the corresponding relation of the electronic equipment to obtain the internal resistance values corresponding to the voltage values of the M batteries; the processing unit is further configured to determine, according to the M current values, a battery power change value of the electronic device, where the M current values include: ratio of the M battery voltage values to the respective corresponding internal resistance values.
In a possible implementation, the processing unit is further configured to determine whether the electronic device is being charged; and the processing unit is also used for acquiring M battery voltage values obtained by the electronic equipment at M sampling moments when the electronic equipment is not being charged.
In a possible implementation, the processing unit is further configured to subtract the battery power change value from the power value of the electronic device to obtain an updated power value of the electronic device.
In a possible implementation, the processing unit is further configured to obtain, when the electronic device is being charged, a battery power change value of the electronic device based on a preset charging current of the electronic device.
In a possible implementation, the processing unit is further configured to obtain, when the electronic device is being charged, a first battery power change value of the electronic device based on a preset charging current of the electronic device, and a second battery power change value of the electronic device according to the M current values; the processing unit is further used for calculating a difference value between the first battery power change value and the second battery power change value to obtain the battery power change value of the electronic device.
In one possible implementation, the processing unit is further configured to add a battery power change value to a power value of the electronic device, to obtain an updated power value of the electronic device.
In a possible implementation, the processing unit is further configured to determine whether a universal serial bus USB interface of the electronic device is in an on-bit state; the processing unit is also used for judging that the electronic equipment is being charged when the USB interface is in a bit state; and the processing unit is also used for judging that the electronic equipment is not being charged when the USB interface is not in a bit state.
In one possible implementation, the processing unit is specifically configured to time integrate the M current values to obtain a battery power variation value of the electronic device.
In one possible implementation, the working scenario includes any one of the following scenarios: a write stroke scene, an air mouse scene, a rest unused scene, or a dormant scene.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, the memory being configured to store code instructions, the processor being configured to execute the code instructions to perform the method described in the first aspect or any one of the possible implementations of the first aspect.
In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing a computer program. The computer program, when executed by a processor, implements a method as in the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product comprising a computer program which, when run, causes a computer to perform the method as in the first aspect.
In a sixth aspect, an embodiment of the present application provides a chip comprising a processor for invoking a computer program in a memory to perform a method according to the first aspect.
It should be understood that, the second aspect to the sixth aspect of the present application correspond to the technical solutions of the first aspect of the present application, and the advantages obtained by each aspect and the corresponding possible embodiments are similar, and are not repeated.
Drawings
FIG. 1 is a computational flow diagram of a software fuel gauge in some implementations;
fig. 2 is a schematic diagram of an application scenario provided in an embodiment of the present application;
fig. 3 is a schematic hardware structure of a handwriting pen according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electric quantity display device according to an embodiment of the present application;
fig. 5 is a schematic diagram of a method for calculating battery power according to an embodiment of the present application;
FIG. 6 is a flowchart of a specific battery power calculation according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a battery power calculating device according to an embodiment of the present application;
Fig. 8 is a schematic hardware structure of an electronic device according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a chip according to an embodiment of the present application.
Detailed Description
For purposes of clarity in describing the embodiments of the present application, the words "exemplary" or "such as" are used herein to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "for example" should not be construed as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relationship of an association object, and indicates that there may be three relationships, for example, a and/or B, and may indicate: a alone, a and B together, and B alone, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
The "at … …" in the embodiment of the present application may be an instant when a certain situation occurs, or may be a period of time after a certain situation occurs, which is not particularly limited. In addition, the display interface provided by the embodiment of the application is only used as an example, and the display interface can also comprise more or less contents.
When the battery power of the electronic device is measured, the battery power of the electronic device can be measured by an entity power meter, or the battery power of the electronic device can be calculated by using a software code, wherein the mode of calculating the battery power by using the software code can be called a software power meter.
Because the physical electricity meter needs to occupy the volume of the electronic device and has high cost, in some implementations, the physical electricity meter is not used, but the battery power of the electronic device is calculated by means of a software electricity meter due to the consideration of the volume and the cost of the electronic device.
In the embodiment of the application, the electronic device may be a handwriting pen, a bluetooth headset, an intelligent watch, a Virtual Reality (VR) terminal device (such as VR glasses and VR game handle), etc., and the battery power of the electronic device may be calculated by means of a software power meter without using an entity power meter due to the consideration of the volume and cost of the electronic device.
FIG. 1 is a flow chart of the calculation of a software fuel gauge in some implementations. In fig. 1 and the following embodiments, a handwriting pen (stylus) is taken as an example.
As shown in fig. 1, a specific flow of the software fuel gauge calculation is as follows.
S101, initializing a software electricity meter algorithm.
In some implementations, the initialization of the software coulomb calculation may be assigning values to an initial battery charge, an initial battery voltage, etc., that are involved in the calculation process.
S102, judging whether a universal serial bus (universal serial bus, USB) interface of the handwriting pen is in place or not.
When the USB interface is in place, that is, when the handwriting pen is connected with the charging power supply, for example, the USB interface of the handwriting pen is connected with the USB interface of the electronic equipment, or the USB interface of the handwriting pen is connected with the charging power supply through a USB connecting wire, and the handwriting pen is in a charging state.
When the USB interface is not in place, that is, when the handwriting pen is not connected to the charging power supply, for example, the USB interface of the handwriting pen is not connected to the USB interface of the electronic device, or the USB interface of the handwriting pen is not connected to the charging power supply through the USB connection line, the handwriting pen is in a discharging state.
In a possible implementation, for a handwriting pen supporting wireless charging, whether the handwriting pen is in a charging state or a discharging state can be judged through whether a wireless charging coil of the handwriting pen is overlapped with a wireless charging coil of the electronic device. When the wireless charging coil of the handwriting pen is overlapped with the wireless charging coil of the electronic equipment, the handwriting pen is in a charging state; when the wireless charging coil of the handwriting pen is not overlapped with the wireless charging coil of the electronic equipment, the handwriting pen is in a discharging state.
S103, when the USB interface is in place, the handwriting pen executes a software fuel gauge charging algorithm.
When the USB interface is in place, namely the handwriting pen is in a charging state, the handwriting pen can calculate the battery electric quantity of the handwriting pen during charging through a software electric quantity meter charging algorithm. Specifically, the software electricity meter charging algorithm may calculate an increase value of the battery electricity through a preset charging current, so as to obtain the battery electricity when the handwriting pen is charged in real time.
For example, the stylus pen has a preset charging current i (t), according to the formulaThe time integration is carried out on the preset charging current, and the moment t1 is calculatedThe time period from the time t2 to the time when the electric quantity of the handwriting pen increases. According to the electric quantity of the handwriting pen at the time t1 and the calculated increment value of the electric quantity from the time t1 to the time t2, the electric quantity of the handwriting pen at the time t2 can be obtained.
S104, when the USB interface is out of place, the handwriting pen executes a software fuel gauge discharging algorithm.
When the USB interface is out of place, namely the stylus is in a discharging state, the stylus can calculate the battery power during discharging through a software fuel gauge discharging algorithm. Specifically, the software electricity meter discharging algorithm may be that, through a voltage detection device inside the handwriting pen, voltage values on two sides of a handwriting pen battery are periodically measured, a time integral is performed on a ratio of the measured battery voltage value to the internal resistance, and a decrease value of the battery electric quantity, that is, the discharging electric quantity of the battery is calculated, so that the battery electric quantity when the handwriting pen is discharged can be obtained in real time.
For example, the internal resistance value of the stylus is R, the time t1 is to the time t2, the voltage at two sides of the battery is periodically detected by the voltage detection device in the stylus, the voltage at two sides of the battery is detected to be u (t), and the formula is based on the following formulaAnd (3) performing time integration on the ratio of the battery voltage to the battery resistance, and calculating to obtain the reduction value of the electric quantity of the handwriting pen in the time period from the time t1 to the time t 2. According to the electric quantity of the handwriting pen at the time t1 and the calculated reduction value of the electric quantity from the time t1 to the time t2, the electric quantity of the handwriting pen at the time t2 can be obtained.
S105, judging whether the battery power of the handwriting pen is changed or not.
And after the battery electric quantity of the handwriting pen is obtained through calculation of a software electric quantity meter charging algorithm or a software electric quantity meter discharging algorithm, judging whether the battery electric quantity is changed or not.
When the battery power is not changed, the handwriting pen does not update the battery power.
And S106, when the battery power changes, the handwriting pen updates the battery power.
The stylus pen can send the updated battery power to a matched power display device, such as a tablet computer, through Bluetooth, and the electronic device can display the updated battery power of the stylus pen.
It can be understood that, according to the determination in step S105, after the battery power of the handwriting pen is not updated, or after the battery power of the handwriting pen is updated, the handwriting pen can continue to execute step S102 and subsequent steps, so as to realize continuous updating of the battery power of the handwriting pen.
However, in some implementations, the internal resistance used in calculating the battery level of the stylus in step S104 is fixed, and the internal resistance of the stylus may be different when the stylus is in different operating scenarios.
For example, a stylus operating scenario may include: write, empty mouse, stand unused, sleep, etc. The writing and drawing work scene can be that a user can use a handwriting pen to complete writing or drawing functions on the electronic equipment with the touch screen, for example, the user can use the handwriting pen to conduct writing and drawing operations on the touch screen of the electronic equipment to complete drawing of images or editing of characters; the working scene of the empty mouse can be that the handwriting pen can replace a mouse to operate the electronic equipment, for example, when the presentation is played, a user can use the empty mouse mode of the handwriting pen to replace the mouse to play the presentation; the work scene which is not used for standing can be a scene in which a user does not operate the handwriting pen temporarily; the dormant working scene can be a scene that a user does not use a handwriting pen for a period of time, and the handwriting pen enters a low-energy consumption state.
The internal resistance of the stylus may be different in different operating scenarios. If the internal resistances adopted in calculating the battery power are the same constant value for different working scenes, the deviation between the calculated battery power and the actual battery power may be larger.
In view of this, the embodiment of the application provides a method for calculating the battery power, which calculates the battery discharge power according to the internal resistance values corresponding to the same voltage under different scenes. That is, the calculation of the battery power can be performed according to the actual working scene of the electronic device through the internal resistance corresponding to the working scene, so that the accuracy of the calculation of the battery discharge power of the electronic device can be improved, more accurate power indication is given to the user, and the use experience of the user is improved.
The embodiment of the application can be applied to an application scene shown in fig. 2. As shown in fig. 2, the handwriting pen 100 and the power display device 200 are included in the scene, and the power display device 200 is illustrated in fig. 2 as a tablet computer (tablet).
The stylus 100 may provide an input to the power display device 200, and the power display device 200 performs an operation responsive to the input based on the input of the stylus 100.
In one embodiment, the stylus 100 and the power display device 200 may be interconnected by a communication network to enable interaction of wireless signals. The communication network includes, but is not limited to: a WiFi hotspot network, a WiFi peer-to-peer (P2P) network, a bluetooth network, a zigbee network, or a near field communication (near field communication, NFC) network.
After the handwriting pen 100 and the electric quantity display device 200 are interconnected through the communication network, the handwriting pen can send information of battery electric quantity of the handwriting pen to the electric quantity display device 200 through the communication network, for example, through a Bluetooth mode or the like, the battery electric quantity of the handwriting pen can be displayed on the touch screen 201 of the electric quantity display device 200, and a user can check the battery electric quantity of the handwriting pen, so that the handwriting pen can be used as a reference of the using duration of the handwriting pen.
It will be appreciated that the touch screen 201 in the power display device 200 may also be referred to as a touch screen and the stylus 100 may also be referred to as a stylus.
Fig. 3 is a schematic diagram of a hardware structure of a stylus according to an embodiment of the present application. Referring to fig. 3, the stylus 100 may have a processor 110. The processor 110 may include storage and processing circuitry for supporting the operation of the stylus 100. The storage and processing circuitry may include storage devices such as non-volatile memory (e.g., flash memory or other electrically programmable read-only memory configured as a solid state drive), volatile memory (e.g., static or dynamic random access memory), and the like. Processing circuitry in processor 110 may be used to control the operation of stylus 100. The processing circuitry may be based on one or more microprocessors, microcontrollers, digital signal processors, baseband processors, power management units, audio chips, application specific integrated circuits, and the like. In the embodiment of the application, the storage and processing circuit can be used for storing the corresponding relation among the working scene, the battery voltage and the internal resistance value.
One or more sensors may be included in stylus 100. For example, the sensor may include a pressure sensor 120. In one embodiment, processor 110 may adjust the thickness of the line as the tip of stylus 100 writes based on the amount of pressure detected by pressure sensor 120.
The sensors may also include inertial sensors 130. Inertial sensor 130 may include a three-axis accelerometer and a three-axis gyroscope, and/or other components for measuring motion of stylus 100, for example, a three-axis magnetometer may be included in the sensor in a nine-axis inertial sensor configuration. The sensors may also include additional sensors such as temperature sensors, ambient light sensors, light-based proximity sensors, contact sensors, magnetic sensors, pressure sensors, and/or other sensors.
Status indicators 140 such as light emitting diodes and buttons 150 may be included in the stylus 100. The status indicator 140 is used to alert the user of the status of the stylus 100. The buttons 150 may include mechanical buttons and non-mechanical buttons, and the buttons 150 may be used to collect button press information from a user.
In embodiments of the present application, one or more electrodes 160 may be included in stylus 100.
The stylus 100 may include a sensing circuit 170 therein. The sensing circuit 170 may sense capacitive coupling between the electrodes 160 and drive lines of a capacitive touch sensor panel that interacts with the stylus pen 100.
It will be appreciated that microphones, speakers, audio generators, vibrators, cameras, data ports, and other devices may be included in stylus 100 as may be desired. The user may control the operation of the stylus 100 and the power display device 200 interacting with the stylus 100 by providing commands with these devices, and receive status information and other outputs.
The processor 110 may be used to run software on the stylus 100 that controls the operation of the stylus 100. During operation of stylus 100, software running on processor 110 may process sensor inputs, button inputs, and inputs from other devices to monitor movement of stylus 100 and other user inputs. Software running on the processor 110 may detect user commands and may communicate with the power display device 200.
To support wireless communication of the stylus 100 with the power display device 200, the stylus 100 may include a wireless module. In fig. 3, a bluetooth module 180 is taken as an example of the wireless module. The wireless module may also be a WI-FI hotspot module, a WI-FI point-to-point module, or the like. The bluetooth module 180 may include a radio frequency transceiver, such as a transceiver. Bluetooth module 180 may also include one or more antennas. The transceiver may transmit and/or receive wireless signals using an antenna, which may be based on the type of wireless module, bluetooth signals, wireless local area network signals, remote signals such as cellular telephone signals, near field communication signals, or other wireless signals.
Stylus 100 may also include a charging module 190, and charging module 190 may support charging of stylus 100 to provide power to stylus 100.
Fig. 4 is a schematic structural diagram of an electric quantity display device 200 according to an embodiment of the present application.
It should be understood that the power display device 200 in the embodiment of the present application may be referred to as a User Equipment (UE), a terminal (terminal), or the like, and for example, the power display device 200 may be a tablet (portable android device, PAD), a personal digital assistant (personal digital assistant, PDA), a handheld device with a wireless communication function, a computing device, an in-vehicle device, or a wearable device, a Virtual Reality (VR) terminal device, an augmented reality (augmented reality, AR) terminal device, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote medical (remote medical), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation security (transportation safety), a mobile terminal with a touch screen or a fixed terminal in smart city (smart city), a wireless terminal in smart home, or the like. The form of the terminal device in the embodiment of the application is not particularly limited.
Referring to fig. 4, the power display device 200 may include a plurality of subsystems that cooperate to perform, coordinate, or monitor one or more operations or functions of the power display device 200. The power display device 200 includes a processor 210, an input surface 220, a coordination engine 230, a power subsystem 240, a power connector 250, a wireless interface 260, and a display 270.
Illustratively, coordination engine 230 may be used to communicate and/or process data with other subsystems of power display device 200; communication and/or transaction data with stylus 100; measuring and/or obtaining an output of one or more analog or digital sensors (such as touch sensors); measuring and/or obtaining an output of one or more sensor nodes of an array of sensor nodes (such as an array of capacitive sensing nodes); receiving and locating tip and ring signals from stylus 100; stylus 100, etc., is positioned based on the locations of the tip signal crossing region and the ring signal crossing region.
The coordination engine 230 of the power display device 200 includes or is otherwise communicatively coupled to a sensor layer located below or integral with the input surface 220. In one embodiment, the input surface 220 may be referred to as a touch screen.
In general, the processor 210 may be configured to perform, coordinate, and/or manage the functions of the power display device 200. Such functions may include, but are not limited to: communication and/or transaction data with other subsystems of the power display device 200, communication and/or transaction data with the stylus 100, data communication and/or transaction data via a wireless interface, data communication and/or transaction data via a wired interface, facilitating power exchange via a wireless (e.g., inductive, resonant, etc.) or wired interface, receiving a position and angular position of one or more styluses, etc.
Processor 210 may be implemented as any electronic device capable of processing, receiving, or transmitting data or instructions. For example, the processor may be a microprocessor, a central processing unit, an application specific integrated circuit, a field programmable gate array, a digital signal processor, an analog circuit, a digital circuit, or a combination of these devices. The processor may be a single-threaded or multi-threaded processor. The processor may be a single core or multi-core processor.
During use, processor 210 may be configured to access a memory storing instructions. The instructions may be configured to cause the processor to perform, coordinate, or monitor one or more operations or functions of the power display device 200.
The power display device 200 also includes a power subsystem 240. The power subsystem 240 may include a battery or other power source. The power subsystem 240 may be configured to provide power to the power display device 200. The power subsystem 240 may also be coupled to a power connector 250. The power connector 250 may be any suitable connector or port that may be configured to receive power from an external power source and/or to provide power to an external load. For example, in some embodiments, the power connector 250 may be used to recharge a battery within the power subsystem 240. In an embodiment of the present application, the power connector 250 may be used to transfer power stored in (or available to) the power subsystem 240 to the stylus 100, and the power connector 250 may be a USB interface of the power display device 200.
The power display device 200 also includes a wireless interface 260 to facilitate electronic communication between the power display device 200 and the stylus 100. In one embodiment, the power display device 200 may be configured to communicate with the stylus 100 via a low energy bluetooth communication interface or a near field communication interface. In other examples, the communication interface facilitates electronic communication between the power display device 200 and an external communication network, device, or platform.
The wireless interface 260 (whether the communication interface between the power display device 200 and the stylus 100 or another communication interface) may be implemented as one or more wireless interfaces, bluetooth interfaces, near field communication interfaces, magnetic interfaces, universal serial bus interfaces, inductive interfaces, resonant interfaces, capacitively coupled interfaces, wi-Fi interfaces, TCP/IP interfaces, network communication interfaces, optical interfaces, acoustical interfaces, or any conventional communication interfaces.
The power display device 200 also includes a display 270. The display 270 may be located behind the input surface 220 or may be integral therewith. A display 270 may be communicatively coupled to the processor 210. Processor 210 may present information to a user using display 270. In many cases, the processor 210 uses the display 270 to present an interface with which a user may interact. In many cases, the user manipulates stylus 100 to interact with the interface.
It will be apparent to one skilled in the art that some of the specific details presented above with respect to the power display device 200 may not be required to practice a particular embodiment or equivalent thereof. Similarly, other electronic devices may include a greater number of subsystems, modules, components, etc. Some of the sub-modules may be implemented as software or hardware, where appropriate. It should be understood, therefore, that the foregoing description is not intended to be exhaustive or to limit the disclosure to the precise form disclosed herein. On the contrary, many modifications and variations will be apparent to those of ordinary skill in the art in light of the above teachings.
Next, a method for calculating battery power according to an embodiment of the present application will be described with reference to fig. 5 to 6, where the method is applied to an electronic device, and at least one correspondence is stored in the electronic device, and the correspondence includes: the corresponding relation between the working scenes, the battery voltage and the internal resistance value, wherein the internal resistance values corresponding to different working scenes and/or different battery voltages are different.
In the embodiment of the application, the electronic equipment can have one or more working scenes, and the working scenes of the electronic equipment can also be called as working modes of the electronic equipment.
Taking the example that the electronic device is a stylus, the working scenario may include any of the following scenarios: a write stroke scene, an air mouse scene, a rest unused scene, or a dormant scene.
The above scenario may refer to the relevant description of the handwriting pen working scenario in fig. 1, and will not be repeated here.
Taking the example that the electronic device is a bluetooth headset, the working scenario may include any one of the following scenarios: playing audio scenes, dormant scenes or shutdown scenes.
Under the audio playing scene, the Bluetooth headset is matched with the electric quantity display equipment for use, and the Bluetooth headset can play audio such as music, conversation and the like; when the user does not use the Bluetooth headset for a period of time, the Bluetooth headset can be in a dormant scene; when the user turns off the bluetooth headset, for example, after the user operates a shutdown button on the bluetooth headset, the bluetooth headset may be in a shutdown scene.
Taking the example that the electronic device is a smart watch, the working scenario may include any of the following scenarios: a normal operation scenario, a power saving operation scenario, a night operation scenario, or a shutdown scenario.
Under a conventional working scene, each functional module provided by the intelligent watch can normally operate, for example, the intelligent watch can normally provide functions such as music, games, short messages, telephones, heart rate detection, step count, clocks and the like. Under the power-saving working scene, part of functional modules provided by the intelligent watch can normally operate, for example, functions such as short messages, telephones, heart rate detection, step count, clocks and the like can normally operate, and functions such as music, games and the like are disabled. In a night work scene, the intelligent watch only allows key functional modules to normally operate, such as heart rate detection, clock and other functional modules to be disabled. Under the shutdown scene, all functions provided by the intelligent watch can not normally run.
The battery voltage may refer to the voltage of the battery of the electronic device.
The internal resistance value may refer to an internal resistance value of a battery of the electronic device.
The correspondence may be based on multiple experimental tests performed on the electronic device. For example, in each working scene, measuring the measured internal resistance values of a plurality of electronic devices with the same model under each voltage, and calculating an average value or a value near the average value of the measured internal resistance values measured under each voltage to obtain the corresponding relation between the battery voltage and the internal resistance value in each working scene; or under each working scene, measuring the measured internal resistance value of one electronic device under each voltage for multiple times, and calculating an average value or a value near the average value of the measured internal resistance values measured under each voltage to obtain the corresponding relation between the battery voltage and the internal resistance value under each working scene.
The obtained corresponding relation can be loaded into the electronic equipment, and when the subsequent electronic equipment calculates the battery power, the internal resistance value of the electronic equipment can be obtained based on the working scene and the battery voltage of the electronic equipment. For example, the electronic device may store the following correspondence: and under each working scene of the electronic equipment, the corresponding relation between the battery voltage and the internal resistance value. For example, for a first operating scenario, the battery voltage has a first correspondence with the internal resistance value; for the second working scene, the battery voltage and the internal resistance value have a second corresponding relation. In a possible implementation, the internal resistance value obtained according to the first corresponding relation of the battery voltages with equal magnitudes in the first working scene may be different from the internal resistance value obtained according to the second corresponding relation in the second working scene.
As shown in fig. 5, the method for calculating the battery power according to the embodiment of the present application is as follows:
s501, obtaining M battery voltage values obtained by the electronic equipment at M sampling moments; m is a positive integer.
In the embodiment of the application, the time interval between the M sampling moments may be a constant value, for example, the time interval of sampling is 0.5 seconds, which means that the voltage detection circuit obtains the voltage of the primary battery every 0.5 s; the time interval between the M sampling moments may also be a non-constant value, which is not particularly limited in the embodiment of the present application.
In one possible implementation, the electronic device may obtain, through a voltage detection circuit in the electronic device, a battery voltage value of the electronic device at M sampling moments. The voltage detection circuit may include an analog-to-digital converter (ADC) for converting a continuously varying analog voltage signal into a discrete digital voltage signal, and the voltage circuit may sample the battery voltage value based on the ADC.
Thus, in a period of time, the electronic device samples the battery voltage value through the voltage detection circuit, and if M sampling moments are T 1 ,T 2 ,……,T M-1 ,T M The battery voltage values that the electronic device can obtain at the M sampling moments include V 1 ,V 2 ,……,V M-1 ,V M Wherein M may be 1 or an integer greater than 1.
S502, combining the working scene and the corresponding relation of the electronic equipment to obtain the internal resistance values corresponding to the voltage values of the M batteries.
According to the working scene of the electronic equipment and the corresponding relation stored in the electronic equipment, the electronic equipment can obtain the internal resistance values corresponding to the M battery voltage values. For example, during a period of time, the electronic device obtains M battery voltage values V through the voltage detection circuit 1 ,V 2 ,……,V M-1 ,V M According to the working scene of the electronic equipment in the period of time and the corresponding relation stored in the electronic equipment, the electronic equipment can obtain the internal resistance value R corresponding to each of M battery voltage values 1 ,R 2 ,……,R M-1 ,R M Wherein M is a positive integer.
S503, according to the battery power change values of the electronic equipment, M current values comprise: ratio of the M battery voltage values to the respective corresponding internal resistance values.
According to ohm law i=u/R, where I is a current value, U is a voltage value, and R is a resistance value, the electronic device may obtain M current values by using ratios of M battery voltage values and respective corresponding internal resistance values. For example, between the first time and the second time, the electronic device obtains M battery voltage values as V based on step S501 1 ,V 2 ,……,V M-1 ,V M Based on step S502, the electronic device obtains internal resistance values R corresponding to the M battery voltage values 1 ,R 2 ,……,R M-1 ,R M According to ohm's law, M current values I are obtained 1= V 1 /R 1 ,I 2= V 2 /R 2 ,……,I M-1= V M-1 /R M-1 ,I M= V M /R M
It will be appreciated that the charge is a current accumulated over time, and thus a battery charge change value for the electronic device may be derived based on the resulting M current values. The embodiment of the application does not limit the specific implementation of obtaining the battery power change value of the electronic equipment based on the M current values.
That is, by the method provided by the embodiment of the application, the electronic equipment can obtain the internal resistance corresponding to each voltage value of the battery in the working scene according to the working scene, so that the current value can be obtained through the voltage value and the internal resistance value of the battery, and the calculation of the change value of the electric quantity of the battery is performed based on the current value. Therefore, the accuracy of the calculation of the battery electric quantity of the electronic equipment can be improved, more accurate electric quantity indication is given to the user, and the use experience of the user is improved.
In a possible implementation, according to the battery power change values of the electronic device, the method specifically includes: and carrying out time integration on the M current values to obtain a battery power change value of the electronic equipment.
It can be understood that the current is the amount of charge passing through any cross section of the conductor in a unit time, and therefore, the battery power change value of the electronic device can be obtained by integrating the M current values in time.
The calculation formula for performing time integration on the M current values may be: wherein t is calculated in the formula 1 To t M This period is a period for the electronic device to acquire the M battery voltage values in step S501, and Δt may be a time interval of M sampling moments.
It will be appreciated that in some implementations, the M current values may also be integrated over time by other calculation methods, which is not particularly limited by the embodiment of the present application.
Therefore, the electronic equipment can accurately calculate the battery power change value of the electronic equipment according to the obtained current value, and further can acquire the battery power of the electronic equipment in real time.
In a possible implementation, before obtaining the M battery voltage values obtained by the electronic device at the M sampling moments, the method further includes: it is determined whether the electronic device is being charged. And when the electronic equipment is not charged, obtaining M battery voltage values obtained by the electronic equipment at M sampling moments.
That is, before the electronic device executes the method for calculating the battery power according to the embodiment of the present application, the electronic device needs to determine whether the electronic device is in a charging state. When the electronic device is not being charged, that is, when the electronic device is in a discharge state, the electronic device may perform steps S501 to S503.
Thus, the battery electric quantity calculation method provided by the embodiment of the application can accurately calculate the electric quantity of the battery when the electronic equipment is in a discharging state.
In a possible implementation, determining whether the electronic device is charging includes: judging whether a Universal Serial Bus (USB) interface of the electronic equipment is in an in-place state or not; when the USB interface is in a bit state, judging that the electronic equipment is being charged; when the USB interface is not in a bit state, the electronic equipment is judged not to be charged.
When the USB interface is in place, namely when the electronic equipment is connected to a charging power supply, the electronic equipment is judged to be charged. Taking a handwriting pen and a tablet computer as an example, when the USB interface of the handwriting pen is connected with the USB interface of the tablet computer, or the USB interface of the handwriting pen is connected with a charging power supply through a USB connecting wire, the handwriting pen is judged to be charged.
When the USB interface is out of place, namely the electronic equipment is not connected to the charging power supply, the electronic equipment is judged not to be charged. Taking a handwriting pen and a tablet computer as examples, when the USB interface of the handwriting pen is not connected with the USB interface of the tablet computer, or the USB interface of the handwriting pen is not connected with a charging power supply through a USB connecting wire, the handwriting pen is not in a charging state.
It will be appreciated that in some implementations, for an electronic device that supports wireless charging, it may also be determined whether the electronic device is charging or not charging by whether the wireless charging coil of the electronic device coincides with the wireless charging coil of the electronic device that is used to power the electronic device. When the wireless charging coil of the electronic device is overlapped with the wireless charging coil of the electronic device for supplying power, the electronic device is in a charging state; when the wireless charging coil of the electronic device is not coincident with the wireless charging coil of the electronic device for supplying power, the stylus pen is not in a charged state.
Therefore, whether the electronic equipment is being charged or not can be rapidly and accurately judged according to the in-place state of the USB interface of the electronic equipment.
In a possible implementation, when the electronic device is not charged, the battery power change value is subtracted from the power value of the electronic device to obtain an updated power value of the electronic device.
In the embodiment of the application, when the electronic equipment is not charged, the battery of the electronic equipment is continuously discharged, the battery electric quantity is lower and lower, and the battery electric quantity change value is subtracted from the electric quantity value of the electronic equipment, so that the updated electric quantity value of the electronic equipment can be obtained.
For example, the electronic device is not being charged from the first time to the second time, the power value of the electronic device corresponding to the first time is Q1, and the electronic device obtains, based on steps S501 to S503, the battery power change value of the electronic device between the first time and the second time is Q ', where the battery power corresponding to the second time, that is, the updated power value of the electronic device is Q1-Q'.
The residual electric quantity of the electronic equipment can be obtained rapidly and accurately by subtracting the battery electric quantity change value from the electric quantity value of the electronic equipment, and a user can estimate the usable time of the electronic equipment according to the residual electric quantity of the electronic equipment, so that the user experience is improved.
In a possible implementation, when the electronic device is being charged, the battery power variation value of the electronic device is obtained based on a preset charging current of the electronic device.
In the embodiment of the application, the preset charging current is based on a preset current value of the battery, and the preset charging current is usually a fixed value. It can be appreciated that the specific manner of obtaining the battery power change value based on the preset charging current of the electronic device may refer to the description of the software fuel gauge charging algorithm in step S103, which is not repeated herein.
It will be appreciated that the manner in which the software fuel gauge charging algorithm is calculated in accordance with embodiments of the present application is not particularly limited.
When the electronic device is being charged, the electronic device will also typically discharge, and in one possible implementation, the electronic device may obtain a battery power change value of the electronic device based on its preset charging current, without considering the discharging current of the electronic device, because the charging current of the electronic device is typically much greater than the discharging current, so that neglecting the discharging current has little influence on the accuracy of calculating the battery power change value.
Therefore, when the electronic equipment is being charged, the electronic equipment can accurately calculate the change value of the battery electric quantity during charging, and the calculation resource can be saved.
In the implementation, when the electronic equipment is being charged, a battery power change value is added to the power value of the electronic equipment, so as to obtain an updated power value of the electronic equipment.
It can be understood that when the electronic device is charged, the battery power of the electronic device is higher and higher, and the battery power change value is added to the power value of the electronic device, so that the updated power value of the electronic device can be obtained.
For example, from the first moment to the second moment, the electronic device is in a charging state, the electric quantity value of the electronic device corresponding to the first moment is Q1, the electronic device obtains, based on a preset charging current, a change value of the battery electric quantity of the electronic device between the first moment and the second moment is Q ', and then the battery electric quantity corresponding to the second moment, that is, the updated electric quantity value of the electronic device is q1+q'.
Through adding battery electric quantity change value in the electric quantity value of electronic equipment, can be accurate, real-time obtain the battery electric quantity of electronic equipment under the state of charge, electronic equipment can in time stop the charging according to self battery electric quantity, prevents that the battery from overcharging, prolongs the life of battery.
When the electronic device is being charged, in another possible implementation, a first battery power change value of the electronic device may be obtained based on a preset charging current of the electronic device, and a second battery power change value of the electronic device may be obtained according to the M current values; and calculating the difference value between the first battery power change value and the second battery power change value to obtain the battery power change value of the electronic equipment.
That is, when the electronic device is being charged, the electronic device will also discharge, and the electronic device may obtain the change value of the battery power according to the increase value of the battery power during charging and the decrease value of the battery power during discharging.
For example, the electronic device obtains a first battery power change value of the electronic device between the first time and the second time to be Q1 based on a preset charging current from the first time to the second time; based on the steps S501 to S503, the electronic device obtains the change value of the battery power of the electronic device from the first time to the second time as Q2, and the change value of the battery power of the electronic device from the first time to the second time is Q1-Q2.
In the implementation, when the electronic equipment is being charged, a battery power change value is added to the power value of the electronic equipment, so as to obtain an updated power value of the electronic equipment.
Therefore, when the electronic equipment is being charged, the electronic equipment can accurately calculate the change value of the electric quantity of the battery based on the charging current and the discharging current of the battery.
Fig. 6 is a flowchart illustrating a specific battery power calculation according to an embodiment of the present application.
S601, initializing a software electricity meter algorithm.
S602, judging whether a USB interface of the electronic equipment is in place.
S603, when the USB interface is in place, the electronic device executes a software fuel gauge charging algorithm.
It is understood that steps S601 to S603 may refer to descriptions of steps S101 to S103, and will not be described herein.
S6041, when the USB interface is out of place, acquiring the working scene of the electronic equipment.
Taking a handwriting pen as an example, the manner of judging the working scene by the handwriting pen can be as follows: an acceleration chip can be arranged in the handwriting pen, and the handwriting pen can be judged to be in a dormant scene or a static unused scene according to a preset value obtained by the acceleration chip; the pressure sensing chip can be arranged in the handwriting pen, and when the pressure sensing chip detects that the pen point of the handwriting pen has pressure, the handwriting pen can be judged to be in a writing scene; the handwriting pen can be provided with a key for switching the air mouse scene, and when the handwriting pen detects that the key is used for switching the working scene of the handwriting pen to the air mouse scene, the handwriting pen can be judged to be in the air mouse scene.
It may be appreciated that, in some implementations, the electronic device may also determine the working scenario of the electronic device by other manners, and the manner of determining the working scenario is not specifically limited in the embodiments of the present application.
S6042, the electronic equipment executes a battery electric quantity calculation method.
Corresponding to steps S501 to S503, the electronic device may sample M battery voltage values in a period of time. And obtaining the internal resistance values corresponding to the M battery voltage values according to the corresponding relation between the battery voltage and the internal resistance value stored in the electronic equipment and the working scene of the electronic equipment.
Obtaining a current value according to the M battery voltage values and the internal resistance values corresponding to the M battery voltages, and calculating a battery electric quantity change value according to the current value.
It is to be understood that the order of steps S6041 and S6042 is not fixed, and the electronic apparatus may execute step S6041 first and then step S6042, or may execute steps S6041 and S6042 simultaneously, which is not particularly limited in the embodiment of the present application.
S605, judging whether the battery power of the electronic equipment is changed.
And after the battery electric quantity of the electronic equipment is calculated by a software electric quantity meter charging algorithm or a battery electric quantity calculation method, judging whether the battery electric quantity is changed or not.
When the battery power change value is 0, the electronic device does not update the battery power.
And S606, when the battery power changes, the electronic equipment updates the battery power.
When the battery power change value is not 0, the electronic equipment updates the battery power. For the electronic equipment which is being charged, the method for updating the battery power of the electronic equipment is that the battery power change value is added to the power value of the electronic equipment; for a discharging electronic device, the electronic device updates the battery charge by subtracting the battery charge change value from the electronic device charge value.
It can be understood that, according to the determination in step S605, the battery power of the electronic device is not updated, or after the battery power of the electronic device is updated, the electronic device may continue to execute step S602 and the subsequent steps, so as to implement continuous updating of the battery power of the electronic device.
It can be understood that, after determining that the electronic device is in the charging state according to step S602, the electronic device will also discharge, and when calculating the battery power change value, the discharged power change value may be ignored in consideration of the battery power change value relative to the charging, so that the battery power change value may be calculated only according to the preset charging current; the charged battery power variation value and the discharged battery power variation value can also be calculated at the same time, that is, the electronic device executes step S603 and steps S6041-S6042 at the same time, and the battery power variation value of the electronic device is obtained according to the difference value of the charged battery power variation value and the discharged battery power variation value.
Thus, the electronic equipment can calculate the battery power of the electronic equipment in real time based on the software power meter charging algorithm and the battery power calculation method provided by the embodiment of the application. When the electronic equipment discharges, the calculation of the battery electric quantity can be carried out according to the actual working scene of the electronic equipment through the internal resistance corresponding to the working scene, the accuracy of the calculation of the battery discharge electric quantity of the electronic equipment can be improved, more accurate electric quantity indication is given to a user, and the use experience of the user is improved.
The method provided by the embodiment of the present application is described above with reference to fig. 5 to 6, and the device for performing the method provided by the embodiment of the present application is described below. As shown in fig. 7, fig. 7 is a schematic structural diagram of a battery power calculating device according to an embodiment of the present application, where the battery power calculating device may be an electronic device according to an embodiment of the present application, or may be a chip or a chip system in the electronic device.
As shown in fig. 7, a battery charge calculation device 700 may be used in a circuit, a hardware component, or a chip, the battery charge calculation device including a processing unit 701. The processing unit 701 is used to support the steps performed by the battery level calculating device, for example, the processing unit is used to process steps S501 to S503 in fig. 5.
In one possible implementation, the battery power calculation apparatus may further include: a storage unit 703. The memory unit 703 may include one or more memories, which may be one or more devices, circuits, or devices for storing programs or data.
The memory unit 703 may exist independently and is connected to the processing unit 701 via a communication bus. The memory unit 703 may also be integrated with the processing unit 701.
Taking the example that the battery power calculating device may be a chip or a chip system of the electronic device in the embodiment of the present application, the storage unit 703 may store computer-executed instructions of a method of the electronic device, so that the processing unit 701 executes the method of the electronic device in the embodiment described above. The memory unit 703 may be a register, a cache or a random access memory (random access memory, RAM) etc., and the memory unit 703 may be integrated with the processing unit 701. The memory unit 703 may be a read-only memory (ROM) or other type of static storage device that may store static information and instructions, and the memory unit 703 may be independent of the processing unit 701.
In a possible implementation manner, the battery power calculation device may further include: a communication unit 702. Wherein the communication unit 702 is configured to support the battery level computing device to interact with other devices. For example, when the battery level computing device is an electronic device, the communication unit 702 may be a communication interface or interface circuit. When the battery level computing device is a chip or a system-on-chip within an electronic device, the communication unit 702 may be a communication interface. For example, the communication interface may be an input/output interface, pins or circuitry, etc.
The apparatus of this embodiment may be correspondingly configured to perform the steps performed in the foregoing method embodiments, and the implementation principle and technical effects are similar, which are not described herein again.
Fig. 8 is a schematic hardware structure of an electronic device according to an embodiment of the present application, as shown in fig. 8, where the electronic device includes a processor 801, a communication line 804 and at least one communication interface (illustrated in fig. 8 by taking a communication interface 803 as an example).
The processor 801 may be a general purpose central processing unit (central processing unit, CPU), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the programs of the present application.
Communication line 804 may include circuitry to communicate information between the components described above.
Communication interface 803, using any transceiver-like device, is used to communicate with other devices or communication networks, such as ethernet, wireless local area network (wireless local area networks, WLAN), etc.
Possibly, the electronic device may also comprise a memory 802.
The memory 802 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory, RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), a compact disc read-only memory (compact disc read-only memory) or other optical disk storage, a compact disc storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be self-contained and coupled to the processor via communication line 804. The memory may also be integrated with the processor.
The memory 802 is used for storing computer-executable instructions for executing the aspects of the present application, and is controlled by the processor 801 for execution. The processor 801 is configured to execute computer-executable instructions stored in the memory 802 to implement the methods provided by the embodiments of the present application.
Possibly, the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not limited in particular.
In a particular implementation, the processor 801 may include one or more CPUs, such as CPU0 and CPU1 of FIG. 8, as an embodiment.
In a particular implementation, as one embodiment, an electronic device may include multiple processors, such as processor 801 and processor 805 in FIG. 8. Each of these processors may be a single-core (single-CPU) processor or may be a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
Fig. 9 is a schematic structural diagram of a chip according to an embodiment of the present application. Chip 900 includes one or more (including two) processors 920 and a communication interface 930.
In some implementations, memory 940 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.
In an embodiment of the application, memory 940 may include read only memory and random access memory, and provides instructions and data to processor 920. A portion of memory 940 may also include non-volatile random access memory (NVRAM).
In an embodiment of the application, memory 940, communication interface 930, and processor 920 are coupled together by bus system 910. The bus system 910 may include a power bus, a control bus, a status signal bus, and the like, in addition to a data bus. For ease of description, the various buses are labeled as bus system 910 in FIG. 9.
The methods described in the embodiments of the present application may be applied to the processor 920 or implemented by the processor 920. The processor 920 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry in hardware or instructions in software in processor 920. The processor 920 may be a general purpose processor (e.g., a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), an off-the-shelf programmable gate array (field-programmable gate array, FPGA) or other programmable logic device, discrete gates, transistor logic, or discrete hardware components, and the processor 920 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the application.
The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a state-of-the-art storage medium such as random access memory, read-only memory, programmable read-only memory, or charged erasable programmable memory (electrically erasable programmable read only memory, EEPROM). The storage medium is located in a memory 940, and the processor 920 reads information in the memory 940 and performs the steps of the method in combination with its hardware.
In the above embodiments, the instructions stored by the memory for execution by the processor may be implemented in the form of a computer program product. The computer program product may be written in the memory in advance, or may be downloaded in the form of software and installed in the memory.
The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL), or wireless (e.g., infrared, wireless, microwave, etc.), or semiconductor medium (e.g., solid state disk, SSD)) or the like.
The embodiment of the application also provides a computer readable storage medium. The methods described in the above embodiments may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. Computer readable media can include computer storage media and communication media and can include any medium that can transfer a computer program from one place to another. The storage media may be any target media that is accessible by a computer.
As one possible design, the computer-readable medium may include compact disk read-only memory (CD-ROM), RAM, ROM, EEPROM, or other optical disk memory; the computer readable medium may include disk storage or other disk storage devices. Moreover, any connection is properly termed a computer-readable medium. For example, if the software is transmitted from a website, server, or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. Disk and disc, as used herein, includes Compact Disc (CD), laser disc, optical disc, digital versatile disc (digital versatile disc, DVD), floppy disk and blu-ray disc where disks usually reproduce data magnetically, while discs reproduce data optically with lasers.
Combinations of the above should also be included within the scope of computer-readable media. The foregoing is merely illustrative embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about variations or substitutions within the technical scope of the present application, and the application should be covered. Therefore, the protection scope of the application is subject to the protection scope of the claims.
It should be noted that, the user information (including but not limited to user equipment information, user personal information, etc.) and the data (including but not limited to data for analysis, stored data, presented data, etc.) related to the present application are information and data authorized by the user or fully authorized by each party, and the collection, use and processing of the related data need to comply with related laws and regulations and standards, and provide corresponding operation entries for the user to select authorization or rejection.

Claims (12)

1. The battery power calculation method is characterized by being applied to electronic equipment, wherein at least one corresponding relation is stored in the electronic equipment, and the corresponding relation comprises the following steps: the method comprises the following steps of:
Obtaining M battery voltage values obtained by the electronic equipment at M sampling moments; m is a positive integer;
combining the working scene of the electronic equipment and the corresponding relation to obtain the internal resistance values corresponding to the M battery voltage values;
obtaining a battery power change value of the electronic equipment according to M current values, wherein the M current values comprise: and the ratio of the M battery voltage values to the respective corresponding internal resistance values.
2. The method of claim 1, wherein the acquiring the M battery voltage values obtained by the electronic device at M sampling times further comprises:
judging whether the electronic equipment is being charged;
the obtaining the M battery voltage values obtained by the electronic device at the M sampling moments includes: and when the electronic equipment is not charged, acquiring M battery voltage values obtained by the electronic equipment at M sampling moments.
3. The method as recited in claim 2, further comprising:
subtracting the battery power change value from the power value of the electronic equipment to obtain an updated power value of the electronic equipment.
4. The method as recited in claim 2, further comprising:
And when the electronic equipment is being charged, obtaining a battery electric quantity change value of the electronic equipment based on a preset charging current of the electronic equipment.
5. The method as recited in claim 2, further comprising:
when the electronic equipment is being charged, a first battery electric quantity change value of the electronic equipment is obtained based on a preset charging current of the electronic equipment, and a second battery electric quantity change value of the electronic equipment is obtained according to the M current values;
and calculating the difference value of the first battery electric quantity change value and the second battery electric quantity change value to obtain the battery electric quantity change value of the electronic equipment.
6. The method according to claim 4 or 5, further comprising:
and adding the battery power change value to the power value of the electronic equipment to obtain the updated power value of the electronic equipment.
7. The method of any of claims 2-6, wherein the determining whether the electronic device is charging comprises:
judging whether a Universal Serial Bus (USB) interface of the electronic equipment is in an in-place state or not;
when the USB interface is in a bit state, judging that the electronic equipment is being charged;
And when the USB interface is not in a bit state, judging that the electronic equipment is not being charged.
8. The method according to any one of claims 1-7, wherein obtaining the battery power variation value of the electronic device according to M current values specifically includes:
and performing time integration on the M current values to obtain a battery power change value of the electronic equipment.
9. The method of any one of claims 1-8, wherein the work scenario comprises any one of the following scenarios:
a write stroke scene, an air mouse scene, a rest unused scene, or a dormant scene.
10. An electronic device, comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executing computer-executable instructions stored in the memory to cause the electronic device to perform the method of any one of claims 1-9.
11. A computer readable storage medium storing a computer program, which when executed by a processor implements the method according to any one of claims 1-9.
12. A computer program product comprising a computer program which, when run, causes a computer to perform the method of any of claims 1-9.
CN202211732786.7A 2022-12-30 2022-12-30 Battery electric quantity calculating method and related device Active CN116699422B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211732786.7A CN116699422B (en) 2022-12-30 2022-12-30 Battery electric quantity calculating method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211732786.7A CN116699422B (en) 2022-12-30 2022-12-30 Battery electric quantity calculating method and related device

Publications (2)

Publication Number Publication Date
CN116699422A true CN116699422A (en) 2023-09-05
CN116699422B CN116699422B (en) 2024-04-02

Family

ID=87843981

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211732786.7A Active CN116699422B (en) 2022-12-30 2022-12-30 Battery electric quantity calculating method and related device

Country Status (1)

Country Link
CN (1) CN116699422B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102854471A (en) * 2012-09-06 2013-01-02 北京百纳威尔科技有限公司 Method and device for metering electric quantity of battery
CN106501730A (en) * 2016-12-06 2017-03-15 歌尔科技有限公司 A kind of battery electric quantity processing method and equipment
CN107505577A (en) * 2017-09-19 2017-12-22 上海斐讯数据通信技术有限公司 A kind of circuit for measuring capacity of battery, battery capacity Method for Accurate Calculation and system
US20180095135A1 (en) * 2016-10-04 2018-04-05 Fujitsu Limited Integrated current value measuring device, remaining battery level measuring device, electronic device, integrated current value measuring method, and information collecting system
CN109061515A (en) * 2018-09-30 2018-12-21 北京空间飞行器总体设计部 A kind of charge/discharge electricity amount measurement method of battery
CN111142032A (en) * 2019-12-31 2020-05-12 深圳移航通信技术有限公司 Method, device and equipment for determining battery electric quantity and storage medium
CN111142030A (en) * 2019-12-30 2020-05-12 Oppo广东移动通信有限公司 Method, device and equipment for detecting internal short-circuit current and readable storage medium
WO2021142678A1 (en) * 2020-01-15 2021-07-22 深圳市大疆创新科技有限公司 Battery parameter determination method and device, and storage medium
US20210405124A1 (en) * 2020-06-24 2021-12-30 Compal Electronics, Inc. Battery control device and battery capacity estimation method
CN114062957A (en) * 2020-08-10 2022-02-18 北京小米移动软件有限公司 Method and device for acquiring remaining battery capacity, electronic equipment and storage medium
CN114578130A (en) * 2021-11-30 2022-06-03 荣耀终端有限公司 Electric quantity calibration method and related device
CN115514841A (en) * 2021-06-10 2022-12-23 荣耀终端有限公司 Method, device, chip and storage medium for prompting device electric quantity information

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102854471A (en) * 2012-09-06 2013-01-02 北京百纳威尔科技有限公司 Method and device for metering electric quantity of battery
US20180095135A1 (en) * 2016-10-04 2018-04-05 Fujitsu Limited Integrated current value measuring device, remaining battery level measuring device, electronic device, integrated current value measuring method, and information collecting system
CN106501730A (en) * 2016-12-06 2017-03-15 歌尔科技有限公司 A kind of battery electric quantity processing method and equipment
CN107505577A (en) * 2017-09-19 2017-12-22 上海斐讯数据通信技术有限公司 A kind of circuit for measuring capacity of battery, battery capacity Method for Accurate Calculation and system
CN109061515A (en) * 2018-09-30 2018-12-21 北京空间飞行器总体设计部 A kind of charge/discharge electricity amount measurement method of battery
CN111142030A (en) * 2019-12-30 2020-05-12 Oppo广东移动通信有限公司 Method, device and equipment for detecting internal short-circuit current and readable storage medium
CN111142032A (en) * 2019-12-31 2020-05-12 深圳移航通信技术有限公司 Method, device and equipment for determining battery electric quantity and storage medium
WO2021142678A1 (en) * 2020-01-15 2021-07-22 深圳市大疆创新科技有限公司 Battery parameter determination method and device, and storage medium
US20210405124A1 (en) * 2020-06-24 2021-12-30 Compal Electronics, Inc. Battery control device and battery capacity estimation method
CN114062957A (en) * 2020-08-10 2022-02-18 北京小米移动软件有限公司 Method and device for acquiring remaining battery capacity, electronic equipment and storage medium
CN115514841A (en) * 2021-06-10 2022-12-23 荣耀终端有限公司 Method, device, chip and storage medium for prompting device electric quantity information
CN114578130A (en) * 2021-11-30 2022-06-03 荣耀终端有限公司 Electric quantity calibration method and related device

Also Published As

Publication number Publication date
CN116699422B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
CN108475935B (en) Battery charging management method and terminal
KR102546249B1 (en) output device outputting audio signal and method for controlling thereof
CN106786962B (en) Charging control method and device and terminal
US11690018B2 (en) Systems and methods for power consumption management
CN109061481B (en) Battery state of charge determining method and device and storage medium
US10663521B2 (en) Method and device for ascertaining required charging time
KR102548932B1 (en) Electronic apparatus and method for controlling time measurement
KR102061072B1 (en) Method for checking sealing condition of housing and apparatus for the same
CN109040467A (en) Interface electricity determines method, apparatus, storage medium and mobile terminal
US20180040290A1 (en) Display Screen Control Method and Apparatus and Terminal
CN108592947B (en) Gyroscope calibration method and device, storage medium and terminal equipment
CN107450029B (en) Battery state checking method and device, computer equipment and computer readable storage medium
CN109240479A (en) Air navigation aid, device, storage medium and electronic equipment
CN108764530A (en) The running parameter configuration method and device of pumping unit of well
CN115766490A (en) Calibration data acquisition method, calibration data storage method, device and equipment
US11141098B2 (en) Electronic device for measuring hydrature using display and method for operating the same
CN104102560B (en) The method and device of system performance testing
CN110765182A (en) Data statistical method and device, electronic equipment and storage medium
CN112311029A (en) Charging method, electronic device and storage medium
CN116699422B (en) Battery electric quantity calculating method and related device
CN114995665B (en) Method for prompting pen point service life of touch pen, touch pen and electronic equipment
EP4099037B1 (en) Prediction method and apparatus of battery health, and storage medium
US11307743B2 (en) Method, electronic device and storage medium for providing mode switching
CN111294253A (en) Test data processing method and device, computer equipment and storage medium
CN109561415B (en) NFC function detection method and device, storage medium and mobile terminal

Legal Events

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