Nothing Special   »   [go: up one dir, main page]

CN116707050B - Method and device for recording charge and discharge times, electronic equipment and readable storage medium - Google Patents

Method and device for recording charge and discharge times, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN116707050B
CN116707050B CN202211188224.0A CN202211188224A CN116707050B CN 116707050 B CN116707050 B CN 116707050B CN 202211188224 A CN202211188224 A CN 202211188224A CN 116707050 B CN116707050 B CN 116707050B
Authority
CN
China
Prior art keywords
charge
discharge
battery
real
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211188224.0A
Other languages
Chinese (zh)
Other versions
CN116707050A (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 CN202211188224.0A priority Critical patent/CN116707050B/en
Publication of CN116707050A publication Critical patent/CN116707050A/en
Application granted granted Critical
Publication of CN116707050B publication Critical patent/CN116707050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0047Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits
    • HELECTRICITY
    • H01ELECTRIC ELEMENTS
    • H01MPROCESSES OR MEANS, e.g. BATTERIES, FOR THE DIRECT CONVERSION OF CHEMICAL ENERGY INTO ELECTRICAL ENERGY
    • H01M10/00Secondary cells; Manufacture thereof
    • H01M10/42Methods or arrangements for servicing or maintenance of secondary cells or secondary half-cells
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/00032Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries characterised by data exchange
    • H02J7/00045Authentication, i.e. circuits for checking compatibility between one component, e.g. a battery or a battery charger, and another component, e.g. a power source
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0029Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with safety or protection devices or circuits
    • HELECTRICITY
    • H02GENERATION; CONVERSION OR DISTRIBUTION OF ELECTRIC POWER
    • H02JCIRCUIT ARRANGEMENTS OR SYSTEMS FOR SUPPLYING OR DISTRIBUTING ELECTRIC POWER; SYSTEMS FOR STORING ELECTRIC ENERGY
    • H02J7/00Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries
    • H02J7/0047Circuit arrangements for charging or depolarising batteries or for supplying loads from batteries with monitoring or indicating devices or circuits
    • H02J7/005Detection of state of health [SOH]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E60/00Enabling technologies; Technologies with a potential or indirect contribution to GHG emissions mitigation
    • Y02E60/10Energy storage using batteries

Landscapes

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

Abstract

The application relates to the technical field of terminals, and provides a method and a device for recording charge and discharge times, electronic equipment and a readable storage medium, wherein the method comprises the following steps: when the first battery of the electronic equipment completes one charge and discharge event, recording first real-time charge and discharge times in a first register, and synchronously recording the first real-time charge and discharge times in a nonvolatile memory; after the first real-time charge and discharge times recorded by the first register are cleared, when the first battery is detected to finish a charge and discharge event again, recording the second real-time charge and discharge times in the first register, and synchronously recording the second real-time charge and discharge times in the nonvolatile memory; the real charge and discharge times of the first battery are the sum of the first real-time charge and discharge times and the second real-time charge and discharge times in the nonvolatile memory, so that even if the first real-time charge and discharge times are cleared, the real charge and discharge times of the battery can be obtained through the nonvolatile memory, and the use condition of the battery can be monitored conveniently.

Description

Method and device for recording charge and discharge times, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of terminal technologies, and in particular, to a method and an apparatus for recording charge and discharge times, an electronic device, and a readable storage medium.
Background
At present, after the battery is charged and discharged once, the electronic device records the charge and discharge times of the battery. When the electronic equipment needs to be maintained, a maintainer or a service staff can quickly know the service condition of the battery through the recorded charge and discharge times, so that the electronic equipment or the battery can be maintained conveniently.
In practical applications of electronic devices, when the electronic device is repaired or when the battery of the electronic device is replaced and tested, the BTB (connection button between the battery and the electronic device) is pulled out, and the interface end of the battery is disconnected. If the interface end of the battery is disconnected, the charge and discharge times of the battery recorded by the electronic equipment are cleared, and after the next charge and discharge is completed, the charge and discharge times are recorded again, and the recorded charge and discharge times are not the actual charge and discharge times of the battery. Therefore, if the interface end of the battery of the electronic device is disconnected, a maintainer or a service personnel cannot obtain the real charge and discharge times of the battery, which is not beneficial to battery safety protection of the battery and influences battery health monitoring.
Disclosure of Invention
The application provides a method and a device for recording charge and discharge times, electronic equipment and a readable storage medium, and aims to prevent the charge and discharge times of a battery from being lost, so that health monitoring of the battery is facilitated, and safety protection of the battery is facilitated.
In a first aspect, the present application provides a method for recording the number of charge and discharge, where the method includes:
when detecting that a first battery of the electronic equipment completes one charge and discharge event, the electronic equipment records first real-time charge and discharge times in a first register, and synchronously records the first real-time charge and discharge times in a nonvolatile memory;
when a disconnection signal of an interface end of the first battery is detected, the first real-time charge and discharge times recorded by the first register are cleared, and the nonvolatile memory records that the first real-time charge and discharge times are not cleared;
when the first battery is detected to finish a charging and discharging event, the electronic equipment records a second real-time charging and discharging frequency in the first register, and synchronously records the second real-time charging and discharging frequency in the nonvolatile memory;
in response to a received first query request, the electronic device obtains the real charge-discharge frequency of the first battery, wherein the real charge-discharge frequency is the sum of the first real-time charge-discharge frequency and the second real-time charge-discharge frequency in the nonvolatile memory.
According to the charge and discharge frequency recording method, when the electronic equipment completes one charge and discharge event, the first register records the first real-time charge and discharge frequency, the first real-time charge and discharge frequency is synchronously recorded in the nonvolatile memory, and the first register is disconnected at the interface end of the first battery, so that the first real-time charge and discharge frequency recorded by the first register is cleared, and then the first real-time charge and discharge frequency recorded by the nonvolatile memory is kept not cleared; and when the first battery finishes charging and discharging again, and the second real-time charging and discharging times are recorded in the first register, the second real-time charging and discharging times are synchronously recorded in the nonvolatile memory, so that the real charging and discharging times of the first battery can be obtained through the first real-time charging and discharging times and the second charging and discharging times. The maintenance personnel or service personnel can obtain the real charge and discharge times of the battery through the nonvolatile memory, and the battery safety protection and health monitoring are facilitated.
In one possible implementation manner, when detecting that the first battery of the electronic device completes one charge and discharge event, the electronic device records a first real-time charge and discharge frequency in a first register, and the step of synchronously recording the first real-time charge and discharge frequency in a nonvolatile memory includes:
When detecting that a first battery of the electronic equipment completes one charge and discharge event, the electronic equipment records first real-time charge and discharge times in a first register;
when a charging signal is detected and the first real-time charging and discharging times recorded in the first register are not cleared, synchronously recording the first real-time charging and discharging times into a first field of a first storage area of the nonvolatile memory to obtain first charging and discharging times;
when a charge and discharge signal is detected and the first real-time charge and discharge times recorded in the first register are cleared, synchronously recording the first charge and discharge times in the first field into a second field of the first storage area to obtain second charge and discharge times.
In another possible implementation manner, when the first battery is detected to complete a charging and discharging event again, the electronic device records a second real-time charging and discharging number in the first register, and the step of synchronously recording the second real-time charging and discharging number in the nonvolatile memory includes:
when the first battery is detected to finish one charge and discharge event, the electronic equipment records second real-time charge and discharge times in the first register;
When a charging signal is detected, synchronously recording the sum of the second real-time charging and discharging times of the first battery and the second charging and discharging times into a first field of the first storage area to obtain the first charging and discharging times, wherein the first charging and discharging times are real charging and discharging times of the first battery.
In another possible implementation manner, when detecting that the first battery of the electronic device completes one charge and discharge event, the electronic device records a first real-time charge and discharge number in a first register, and the step of synchronously recording the first real-time charge and discharge number in a nonvolatile memory includes:
when detecting that a first battery of the electronic equipment completes one charge and discharge event, the electronic equipment records first real-time charge and discharge times in a first register;
when a charging signal is detected and the first real-time charging and discharging times recorded in the first register are cleared, synchronously recording the first real-time charging and discharging times into a first field of a first storage area of the nonvolatile memory to obtain first charging and discharging times;
when a charge and discharge signal is detected and the first real-time charge and discharge times recorded in the first register are cleared, accumulating the first charge and discharge times into a second field of the first storage area to obtain second charge and discharge times.
In another possible implementation manner, when the first battery is detected to complete a charging and discharging event again, the electronic device records a second real-time charging and discharging number in the first register, and the step of synchronously recording the second real-time charging and discharging number in the nonvolatile memory includes:
when the first battery is detected to finish one charge and discharge event, the electronic equipment records second real-time charge and discharge times in the first register;
when a charging signal is detected, synchronously recording the second real-time charging and discharging times of the first battery into a first field of the first storage area to obtain the first charging and discharging times, wherein the first charging and discharging times and the second charging and discharging times are the real charging and discharging times.
In another possible implementation manner, when detecting that the first battery of the electronic device completes one charge and discharge event, the electronic device records a first real-time charge and discharge number in a first register, and the step of synchronously recording the first real-time charge and discharge number in a nonvolatile memory includes:
when detecting that a first battery of the electronic equipment completes one charge and discharge event, the electronic equipment records first real-time charge and discharge times in a first register;
Acquiring target identity information corresponding to an identity port of the first battery;
searching whether the nonvolatile memory stores the identification information of the battery or not;
and if the nonvolatile memory stores the identification information of the battery, and the identification information of the battery is the same as the target identification information, synchronously recording the first real-time charge and discharge times in the nonvolatile memory.
In another possible implementation manner, when the first battery of the electronic device is detected to complete a charging and discharging event, the electronic device records a first real-time charging and discharging frequency in a first register, and synchronously records the first real-time charging and discharging frequency in a nonvolatile memory, and the method further includes:
if the non-volatile memory does not store the identification information of the battery, or the stored identification information of the battery is different from the target identification information, storing the target identification information in the non-volatile memory, and synchronously recording the first real-time charge and discharge times in a storage area corresponding to the target identification information.
In another possible implementation manner, if the nonvolatile memory stores the identity information of the battery, and the identity information of the battery is the same as the target identity information, the step of synchronously recording the first real-time charge and discharge times in the nonvolatile memory includes:
if the nonvolatile memory stores the identity information of the battery, judging whether the first identity information stored in a first storage area of the nonvolatile memory is consistent with the target identity information, wherein the identity information of the battery stored in the first storage area is the first identity information;
and if the charge and discharge times are consistent, synchronously recording the first real-time charge and discharge times in a first storage area of the nonvolatile memory.
In another possible implementation manner, if the nonvolatile memory stores the identity information of the battery, and the identity information of the battery is the same as the target identity information, the step of synchronously recording the first real-time charge and discharge times in the nonvolatile memory further includes:
if the identification information is inconsistent with the target identification information, judging whether the second identification information stored in a second storage area of the nonvolatile memory is consistent with the target identification information, wherein the identification information of the battery stored in the second storage area is the second identification information;
And if the historical charge and discharge times corresponding to the second identity information are consistent, recording the second identity information and the historical charge and discharge times into the first storage area.
In another possible implementation manner, after the step of obtaining the target id information corresponding to the id port of the battery, the method further includes:
verifying the target identity information according to the anti-counterfeiting mark information of the battery;
and verifying the target identity information effectively, and executing the step of searching whether the identity information of the battery is stored in the nonvolatile memory.
In another possible implementation, the method further includes:
when a disconnection signal of an interface end of the first battery is detected, if the interface end is reconnected, acquiring target identity information corresponding to an identity port of the reconnected first battery;
judging whether the target identity information is consistent with first identity information recorded in a first storage area of the nonvolatile memory;
if the first identity identification information and the first charge and discharge times and/or the second charge and discharge times recorded in the first storage area are inconsistent, the first identity identification information and the first charge and discharge times and/or the second charge and discharge times recorded in the first storage area are stored in the second storage area of the nonvolatile memory, and the historical charge and discharge times of the first battery are obtained, wherein the historical charge and discharge times are the first charge and discharge times or the sum of the first charge and discharge times and/or the second charge and discharge times.
In another possible implementation, the method further includes:
when the fact that the second battery of the electronic equipment completes one charge and discharge event is detected, the electronic equipment records third real-time charge and discharge times in a second register, and synchronously records the third real-time charge and discharge times in a nonvolatile memory;
when the disconnection signal of the interface end of the second battery is detected, the third real-time charge and discharge times recorded by the second register are cleared, and the nonvolatile memory records that the third real-time charge and discharge times are not cleared;
when the second battery is detected to finish a charging and discharging event, the electronic equipment records a fourth real-time charging and discharging frequency in the second register, and synchronously records the fourth real-time charging and discharging frequency in the nonvolatile memory;
and responding to the received second inquiry request, the electronic equipment acquires the real charge and discharge times of the second battery, wherein the real charge and discharge times are the sum of the third real-time charge and discharge times and the fourth real-time charge and discharge times in the nonvolatile memory.
In another possible implementation manner, when detecting that the second battery of the electronic device completes one charge-discharge event, the electronic device records a third real-time charge-discharge number in a second register, and the step of synchronously recording the third real-time charge-discharge number in the nonvolatile memory includes:
When detecting that the second battery of the electronic equipment completes one charge and discharge event, the electronic equipment records third real-time charge and discharge times in a second register;
when a charge-discharge signal is detected and the third real-time charge-discharge times recorded in the second register are not cleared, synchronously recording the third real-time charge-discharge times into a first field of a third storage area of the nonvolatile memory to obtain third charge-discharge times;
when a charge and discharge signal is detected and the third real-time charge and discharge times recorded in the second register are cleared, the third charge and discharge times in the first field are synchronously recorded to obtain the fourth charge and discharge times in the second field of the third storage area.
In another possible implementation manner, when the second battery is detected to complete a charging and discharging event again, the electronic device records a fourth real-time charging and discharging number in the second register, and the step of synchronously recording the fourth real-time charging and discharging number in the nonvolatile memory includes:
when the second battery is detected to finish a charging and discharging event, the electronic equipment records fourth real-time charging and discharging times in the second register;
And when a charging signal is detected, synchronously recording the sum of the fourth real-time charging and discharging times of the second battery and the fourth charging and discharging times into a first field of the third storage area to obtain the third charging and discharging times, wherein the third charging and discharging times are the actual charging and discharging times of the second battery.
In a second aspect, the present application provides a charge-discharge number recording apparatus, including: the device comprises a first recording module, a second recording module and an acquisition module.
The first recording module is configured to record a first real-time charge-discharge number of times of the first battery in a first register when the first battery of the electronic device completes a charge-discharge event, and record a second real-time charge-discharge number of times of the first battery in the first register when the first battery is detected to complete a charge-discharge event after the first real-time charge-discharge number of times is cleared, where the first real-time charge-discharge number of times recorded by the first register is cleared when a disconnection signal of an interface end of the first battery is detected;
the second recording module is configured to synchronously record the first real-time charge-discharge times and the second real-time charge-discharge times in a nonvolatile memory, where when an off signal of an interface end of the first battery is detected, the nonvolatile memory records that the first real-time charge-discharge times and the second real-time charge-discharge times are not cleared;
The acquisition module is used for acquiring the real charge and discharge times of the first battery when receiving a first query request, wherein the real charge and discharge times are the sum of the first real-time charge and discharge times and the second real-time charge and discharge times in the nonvolatile memory.
In a third aspect, the present application provides an electronic device, including:
one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform the charge and discharge number recording method as described above in the first aspect or any of the possible implementations of the first aspect.
In a fourth aspect, the present application provides a computer readable storage medium having stored therein a computer program which, when executed by a processor, causes the processor to perform the charge and discharge number recording method as described in the first aspect or any one of the possible implementation manners of the first aspect.
In a fifth aspect, the present application provides a chip, where the chip includes a processor and a data interface, where the processor reads an instruction stored on a memory through the data interface, and performs the method for recording the number of charge and discharge times according to the first aspect or any one of possible implementation manners of the first aspect.
Optionally, as a possible implementation manner, the chip may further include a memory, where the memory stores instructions, and the processor is configured to execute the instructions stored on the memory, where the instructions, when executed, are configured to perform the method for recording the number of charge and discharge times according to the first aspect or any one of the possible implementation manners of the first aspect.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 2 is a software structural block diagram of an electronic device according to an embodiment of the present application;
FIG. 3 is a flowchart of a method for recording the number of charge and discharge according to an embodiment of the present disclosure;
fig. 4 is a block interaction diagram of a method for recording charge and discharge times according to an embodiment of the present application;
FIG. 5 is a detailed flowchart of a step of a method for recording the number of charge and discharge according to another embodiment of the present disclosure;
fig. 6 is a flowchart of a method for recording the number of charge and discharge according to another embodiment of the present disclosure;
fig. 7 is a flowchart of a method for recording the number of charge and discharge according to still another embodiment of the present application;
fig. 8 is a schematic structural diagram of a charge/discharge frequency recording device provided in the present application.
Detailed Description
The terms first, second, third and the like in the description and in the claims and drawings are used for distinguishing between different objects and not for limiting the specified sequence.
In the embodiments of the present application, words such as "exemplary" or "such as" are used to mean serving as examples, illustrations, or descriptions. 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.
At present, after the battery is charged and discharged once, the electronic device can record the charge and discharge times of the battery in a register of the electronic device. When the electronic equipment needs to be maintained, a maintainer or a service staff can quickly know the service condition of the battery through the recorded charge and discharge times, so that the electronic equipment or the battery can be maintained conveniently.
In practical applications of electronic devices, when the electronic device is repaired or when the battery of the electronic device is replaced and tested, the BTB (connection button between the battery and the electronic device) is pulled out, and the interface end of the battery is disconnected. If the interface end of the battery is disconnected, the charge and discharge times of the battery recorded by the electronic equipment are cleared, and after the next charge and discharge is completed, the charge and discharge times are recorded again, and the recorded charge and discharge times are not the actual charge and discharge times of the battery. Therefore, if the interface end of the battery of the electronic device is disconnected, a maintainer or a service personnel cannot obtain the real charge and discharge times of the battery, which is not beneficial to battery safety protection of the battery and influences battery health monitoring.
Based on the problems in the technical scheme, the application provides a method for recording the charge and discharge times, which uses a nonvolatile memory to store the old charge and discharge times of the battery before the interface end of the battery is disconnected, and can also store the new charge and discharge times which are recorded again after the interface end is disconnected, so that maintenance personnel or service personnel can obtain the real charge and discharge times of the battery through the nonvolatile memory, and the battery safety protection and health monitoring are facilitated.
Illustrating the implementation of the present application: the charging and discharging times directly recorded by the preset electronic equipment in a conventional mode are real-time charging and discharging times, namely the charging and discharging times recorded in the register are real-time charging and discharging times. The charge and discharge times stored in the first field of the first storage area of the nonvolatile memory are first charge and discharge times, and the charge and discharge times stored in the second field of the first storage area are second charge and discharge times.
After the battery finishes one-time charge and discharge, the electronic equipment records the real-time charge and discharge times and records the real-time charge and discharge times in a first field of a first storage area of the nonvolatile memory. That is, if the interface end of the battery is not disconnected (the battery is not pulled out), the real-time charge and discharge times recorded by the electronic device are the same as the first charge and discharge times.
When the interface end of the battery is disconnected (the battery is pulled out), the real-time charge and discharge times are cleared, but the first charge and discharge times stored in the nonvolatile memory are not cleared, and the first charge and discharge times in the first field are stored in the second field. That is, the second field stores the old charge and discharge times of the battery when the interface terminal is disconnected.
And when the battery is charged and discharged again, the electronic equipment records the real-time charging and discharging times again, and records the re-recorded real-time charging and discharging times in a first field of the first storage area. That is, the first field stores the new charge and discharge times recorded again after the interface terminal is disconnected. Therefore, even if the electronic equipment has a battery pulling scene in the actual use process, a maintainer or service personnel can acquire the real charge and discharge times (namely the real charge and discharge times) of the battery through the first charge and discharge times and/or the second charge and discharge times of the nonvolatile memory.
The charge and discharge times recording method can be applied to electronic devices such as mobile phones, tablet computers, desktop computers, laptops, notebook computers, ultra-mobile personal computers (UMPC), handheld computers, netbooks, personal digital assistants (Personal Digital Assistant, PDA), wearable electronic devices, intelligent watches and the like. The structure of the electronic device to which the charge/discharge number recording method is applied may be as shown in fig. 1.
As shown in fig. 1, fig. 1 is a diagram illustrating an example of the composition of an electronic device provided herein, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195.
The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the present embodiment does not constitute a specific limitation on the electronic apparatus 100. In other embodiments, the electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. The charging management module 140 may also supply power to the electronic device 100 through the power management module 141 while charging the battery 142.
The power management module 141 is configured to connect to the battery 142, and the charge management module 140 is connected to the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 to power the processor 110, the internal memory 121, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor the battery capacity, the number of times of charging and discharging the battery in real time recorded in the register, the state of health (leakage, impedance) of the battery, and the identification information of the battery of the electronic device, such as sn. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
In this embodiment, when the power management module 141 receives the charging input from the charger, it generates a charging signal, or broadcasts the charging signal to trigger the processor 110 to execute the process of recording the number of charging and discharging times in this embodiment. In the process of recording the charge and discharge times, the power management module 141 obtains the real-time charge and discharge times of the battery and the identification information of the battery.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the electronic device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution for wireless communication including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc., as applied to the electronic device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices through wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division code division multiple access (time-division code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GLONASS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (flex), a mini, a Micro-OLED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
A series of graphical user interfaces (graphical user interface, GUIs) may be displayed on the display 194 of the electronic device 100, all of which are home screens of the electronic device 100. Generally, the size of the display 294 of the electronic device 100 is fixed and only limited controls can be displayed in the display 194 of the electronic device 100. A control is a GUI element that is a software component contained within an application program that controls all data processed by the application program and interactive operations on that data, and a user can interact with the control by direct manipulation (direct manipulation) to read or edit information about the application program. In general, controls may include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, and the like. For example, in the present embodiment, the display 191 may display virtual keys (one-key arrangement, start arrangement, scene arrangement).
The electronic device 100 may implement photographing functions through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, electronic device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the electronic device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 may play or record video in a variety of encoding formats, such as: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The NPU is a neural-network (NN) computing processor, and can rapidly process input information by referencing a biological neural network structure, for example, referencing a transmission mode between human brain neurons, and can also continuously perform self-learning. Applications such as intelligent awareness of the electronic device 100 may be implemented through the NPU, for example: image recognition, face recognition, speech recognition, text understanding, etc.
The external memory interface 120 may be used to connect an external memory card, such as a MicroSD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 210 through the external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. For example, in the present embodiment, the processor 110 may perform the charge-discharge number recording process by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a battery safety monitoring function, a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data created during use of the electronic device 100 (e.g., the number of times the battery is charged and discharged), etc. The internal memory 121 may include a high-speed random access memory, such as at least one disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), etc.
The internal memory 121 may further include a nonvolatile memory, where the present embodiment uses the nonvolatile memory to store the actual charge/discharge times (such as the first charge/discharge times and/or the second charge/discharge times) of the battery, so as to avoid losing the actual charge/discharge times of the battery. The nonvolatile memory is configured with a first storage area and a second storage area, the first storage area is used for storing the real charge and discharge times (such as the first charge and discharge times and/or the second charge and discharge times) of the battery used by the electronic equipment, and the second storage area is used for storing the real charge and discharge times of the battery used by the electronic equipment. The first storage area is configured with a first field and a second field, the first charge and discharge times stored in the first field are updated along with the real-time charge and discharge times recorded by the register, and the second charge and discharge times stored in the second field are real charge and discharge times of the battery recorded before the real-time charge and discharge times of the battery are cleared. The nonvolatile memory of this embodiment may be oemiinfo, where countoffset in oemiinfo is configured as a first field of the first storage area, countbase is a second field of the first storage area, and oldbattery is a second storage area.
After the real-time charge and discharge times recorded by the register are obtained by the power management module 141, the first charge and discharge times in the first field of the first storage area are updated according to the real-time charge and discharge times, and if the real-time charge and discharge times are cleared, the first charge and discharge times in the first field are updated into the second field and stored as the second charge and discharge times.
The processor 110 performs various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
The electronic device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The audio module 170 is used to convert digital audio information into an analog audio signal output and also to convert an analog audio input into a digital audio signal. The audio module 170 may also be used to encode and decode audio signals. In some embodiments, the audio module 170 may be disposed in the processor 110, or a portion of the functional modules of the audio module 170 may be disposed in the processor 110.
The speaker 170A, also referred to as a "horn," is used to convert audio electrical signals into sound signals. The electronic device 100 may listen to music, or to hands-free conversations, through the speaker 170A.
A receiver 170B, also referred to as a "earpiece", is used to convert the audio electrical signal into a sound signal. When electronic device 100 is answering a telephone call or voice message, voice may be received by placing receiver 170B in close proximity to the human ear.
Microphone 170C, also referred to as a "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or transmitting voice information, the user can sound near the microphone 170C through the mouth, inputting a sound signal to the microphone 170C. The electronic device 100 may be provided with at least one microphone 170C. In other embodiments, the electronic device 100 may be provided with two microphones 170C, and may implement a noise reduction function in addition to collecting sound signals. In other embodiments, the electronic device 100 may also be provided with three, four, or more microphones 170C to enable collection of sound signals, noise reduction, identification of sound sources, directional recording functions, etc.
The earphone interface 170D is used to connect a wired earphone. The headset interface 170D may be a USB interface 130 or a 3.5mm open mobile electronic device platform (open mobile terminal platform, OMTP) standard interface, a american cellular telecommunications industry association (cellular telecommunications industry association of the USA, CTIA) standard interface.
The electronic device may also include one or more of keys 190, motors 191, indicators 192, SIM card interface 195 (eSIM card), and the like, for example.
In addition, an operating system is run on the components. Such as the hong Monte System, the iOS operating system, the Android open source operating system, the Windows operating system, and the like. An operating application may be installed on the operating system.
The software system of the electronic device 100 may employ a layered architecture, an event driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. In this embodiment, taking an Android (Android) system with a hierarchical architecture as an example, a software system of the electronic device 100 is illustrated.
Fig. 2 is a block diagram of a software system of the electronic device 100 according to an embodiment of the present application. Referring to fig. 2, the hierarchical architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run time) and system layer, and a kernel layer, respectively.
The application layer may include a series of application packages. As shown in fig. 2, the application package may include applications such as instant messaging, screen casting, sharing, cameras, maps, navigation, WLAN, bluetooth, music, video, short messages, etc. In the embodiment of the application program layer, the battery safety protection APP or the maintenance APP is further included. And sending a charge and discharge acquisition request or a battery use information query request and the like to the application program framework layer or the hardware abstraction layer through the battery security protection APP or the maintenance APP.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. As shown in FIG. 3, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is for providing communication functions of the electronic device. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system. The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android. The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules, such as: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc. The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications. Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as: MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc. The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like. The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software, the hardware including nonvolatile memory. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver. In some embodiments of the present application, the kernel layer further includes a charge and discharge number recording process driver, and when the charge and discharge number recording process is driven, the real-time charge and discharge number of the battery and the identification information of the battery, such as sn, are obtained by calling hal. In the running process of the charge and discharge frequency recording process, whether the real-time charge and discharge frequency is zero is identified, if the real-time charge and discharge frequency is not zero, the real-time charge and discharge frequency is updated to a first field of a first storage area of the nonvolatile memory through hal, and if the real-time charge and discharge frequency is zero, the first charge and discharge frequency in the first field is stored to a second field of the first storage area through hal. Wherein hal is a hardware abstraction layer, which is an interface layer between the operating system kernel and the hardware circuitry.
In some embodiments of the present application, when an application layer or an application framework layer requests a request for obtaining usage information of a power generation pool, for example, a request for inquiring the number of charging and discharging times, the kernel invokes the first number of charging and discharging times in a first field of the nonvolatile memory and/or the second number of charging and discharging times in a second field through hal, and uploads the actual number of charging and discharging times to the application layer after obtaining the actual number of charging and discharging times of the battery based on the first number of charging and discharging times and/or the second number of charging and discharging times, where the application layer outputs usage information of the battery according to the actual number of charging and discharging times.
Or when the external fuel gauge triggers a battery use information acquisition request, such as a charge and discharge frequency inquiry request, the kernel invokes the first charge and discharge frequency in the first field and/or the second charge and discharge frequency in the second field of the nonvolatile memory through hal, obtains the real charge and discharge frequency of the battery based on the first charge and discharge frequency and/or the second charge and discharge frequency, and transmits the real charge and discharge frequency to the fuel gauge, and the power supply gauge displays the real charge and discharge frequency.
For easy understanding, the following embodiments of the present application will take the electronic device 200 having the structure shown in fig. 1 and fig. 2 as an example, and the method for recording the number of charge and discharge provided in the embodiments of the present application will be specifically described with reference to the drawings and application scenarios.
Fig. 3 is a flowchart of a method for recording the number of charge and discharge according to an embodiment of the present application, and fig. 4 is a block interaction diagram of the method for recording the number of charge and discharge according to an embodiment of the present application.
As shown in fig. 3, the above method for recording the number of charge and discharge times is applied to an electronic device, and may include:
step S301: acquiring the real-time charge and discharge times of the battery recorded by the electronic equipment;
the electronic device includes a battery that is a rechargeable battery, and in a single cell electronic device, the battery includes a first battery; in the multi-battery device, the battery at least comprises a first battery and a second battery, and correspondingly, a first register of the electronic device records a first real-time charge-discharge frequency, a second real-time charge-discharge frequency and the like of the first battery, and a second register of the electronic device records a third real-time charge-discharge frequency, a fourth real-time charge-discharge frequency and the like of the second battery. A single-cell electronic device will be described below as an example.
When the electronic equipment finishes charging and discharging once, the charging and discharging times of the battery are recorded in a register, and the recorded charging and discharging times of the electronic equipment are the real-time charging and discharging times. After the battery interface end is disconnected (for example, after the connection button of the battery is scratched), the electronic equipment clears the real-time charge and discharge times recorded in the register, that is to say, clears the real-time charge and discharge times. Therefore, the real-time charge and discharge times are the charge and discharge times of the battery recorded before the interface end of the battery is from the connection state to the disconnection state, wherein the connection state of the interface end of the battery refers to the connection of the battery with the control circuit of the electronic equipment, and the disconnection state of the interface end of the battery refers to the disconnection of the battery from the control circuit of the electronic equipment. Optionally, when receiving a connection port disconnection signal, resetting the real-time charge and discharge times recorded by the register.
In the using process of the electronic device, the electric quantity of the battery is detected in real time, whether the electronic device completes one charge and discharge event is determined by monitoring the electric quantity of the battery, specifically, the electronic device monitors the electric quantity to change from the first electric quantity to the second electric quantity and then changes from the second electric quantity to the first electric quantity, and then judges that the battery completes one charge and discharge, for example, the electric quantity is from 0 to 100 and then from 100 to 0, and then completes one charge and discharge. When the battery finishes charging and discharging, the electronic equipment records the times of charging and discharging once in a register and stores the times of charging and discharging in real time. Because the battery interface end of the electronic equipment is disconnected, when the connecting buckle of the battery is scratched, the real-time charge and discharge times can be cleared. After the real-time charge and discharge is cleared, the real charge and discharge times of the battery cannot be obtained. Based on the above, in the usage process of the electronic device, the method for recording the charge and discharge times provided in the embodiment of the present application stores the real charge and discharge times in the nonvolatile memory in synchronization with the real charge and discharge times, so that the real charge and discharge times of the battery are saved.
For example, when the electronic device enters a charging state during use, the recorded real-time charge and discharge times are obtained from the register, and then the real-time charge and discharge times are stored in the nonvolatile memory at the same time. For example, the acquired real-time charge and discharge times are stored in a first field of a first storage area of a nonvolatile memory, the charge and discharge times stored in the first field are defined as first charge and discharge times, the first charge and discharge times are charge and discharge times of a battery associated with the real-time charge and discharge times before the real-time charge and discharge times are not cleared, for example, the first charge and discharge times are real-time charge and discharge times, or the first charge and discharge times are charge and discharge times of the battery after the real-time charge and discharge times are accumulated.
Optionally, when the charging port of the electronic device is plugged into the charger, the electronic device receives a charging signal, and determines that the electronic device is in a charging state. Optionally, the charging signal may be a connection signal of a charging interface of the electronic device, and may also be an input voltage/current signal of the battery. The electronic device may trigger and acquire the real-time charge and discharge times at other occasions besides the real-time charge and discharge times when entering the charge state. For example, the electronic device acquires the real-time charge and discharge times according to a preset period (for example, 11 points per night), which is not limited in any way in the embodiment of the present application.
Or in another possible implementation manner, in a use state of the electronic device, the process of the embodiment of the application may be triggered based on the fact that the battery completes one charge and discharge, for example, the recorded real-time charge and discharge times are obtained from a register, and then the real-time charge and discharge times are stored in the nonvolatile memory at the same time. The manner of storing the number of times of charging and discharging in real time in the nonvolatile memory is the same as that of the above-described embodiment. In this implementation manner, when the battery completes a charge-discharge event, the electronic device records the real-time charge-discharge times in the register, and records the charge-discharge times in the nonvolatile memory at the same time before the real-time charge-discharge times are not cleared. And after the charge and discharge are completed each time, the charge and discharge times are recorded in the nonvolatile memory, so that the real charge and discharge times of the battery are obtained by accumulating the recorded real-time charge and discharge times for a plurality of times.
Or in a possible implementation manner, in a use state of the electronic device, the process of the embodiment of the application may be triggered based on the time clearing of the real-time charge and discharge times, for example, the recorded real-time charge and discharge times are obtained from a register, and then the real-time charge and discharge times are stored in the nonvolatile memory at the same time. The manner of storing the number of times of charging and discharging in real time in the nonvolatile memory is the same as that of the above-described embodiment.
Step S302: judging whether the real-time charge and discharge times are zero or not;
when the real-time charge and discharge times are non-zero, step S303 is executed: updating the first charge and discharge times in a first field of a first storage area of a preset nonvolatile memory according to the real-time charge and discharge times;
when the number of times of real-time charging and discharging is zero, step S304 is executed: updating the second charge-discharge times in the second field of the first storage area according to the first charge-discharge times;
when the battery interface end of the electronic equipment is disconnected (the battery is pulled out), the real-time charge and discharge times recorded in the register by the electronic equipment can be cleared. Therefore, in the process of recording the charge and discharge times, after the trigger obtains the real-time charge and discharge times, whether the connecting buckle of the battery of the electronic equipment is scratched or not is determined by judging whether the real-time charge and discharge times are zero. For example, if the real-time charge and discharge times is not zero, it is indicated that the connection buckle of the battery is not scratched, and at this time, the real-time charge and discharge times in the register can be synchronously stored in the nonvolatile memory, so as to record the charge and discharge times of the electronic device after the current charge and discharge are completed. If the real-time charge and discharge times are zero, the connection buckle of the battery is not scratched in the current charge and discharge period, and at the moment, the first charge and discharge times synchronized with the real-time charge and discharge times in the storage of the nonvolatile memory can be stored as second charge and discharge times, so that the first charge and discharge times stored before the real-time charge and discharge are prevented from being updated simultaneously when the real-time charge and discharge times are re-recorded, and the first charge and discharge times stored before the real-time charge and discharge are cleared are prevented from being covered or lost.
Specifically, the first storage area of the nonvolatile memory is preset to include a first field and a second field, the first field is used for storing the charge and discharge times updated according to the real-time charge and discharge times update, and the second field is used for storing the charge and discharge times recorded before the connecting buckle of the battery is scratched. The charge and discharge times stored in the first field are first charge and discharge times, that is to say, the first charge and discharge times are newly updated charge and discharge times of the battery; the number of charge and discharge times stored in the second field is a second number of charge and discharge times, that is, the second number of charge and discharge times is the number of charge and discharge times recorded before the connecting buckle of the battery is scratched.
After the real-time charge and discharge times are obtained, judging whether the real-time charge and discharge times are zero, if not, updating the first charge and discharge times in a first field of a first storage area of a preset nonvolatile memory according to the real-time charge and discharge times to store the charge and discharge times of the battery in the nonvolatile memory, so that even if the real-time charge and discharge times are cleared by being scratched based on the connection buckles of the battery, the real charge and discharge times of the battery can be obtained through the nonvolatile memory.
When the interface end is disconnected due to the fact that the battery is scratched, the real-time charging and discharging times are cleared, although the first charging and discharging times in the first field cannot be cleared, maintenance personnel or service personnel can obtain the real charging and discharging times of the battery from the first field of the first storage area of the nonvolatile memory. However, when the battery continues to be used, the electronic device needs to update the re-recorded real-time charge and discharge times in the first field at the same time, so that the first charge and discharge times recorded before the battery is pulled out are stored in the second field, and the first charge and discharge times stored before the connecting buckle of the battery is scratched out are prevented from being covered or lost when the re-recorded real-time charge and discharge times are updated in the first field at the same time. Therefore, if the real-time charge and discharge times is zero, the second charge and discharge times in the second field of the first storage area are updated according to the first charge and discharge times.
The following list two implementation manners illustrate the process of recording the number of charge and discharge in the embodiment of the present application:
in one possible implementation manner, after the real-time charge and discharge times recorded by the electronic device are obtained, whether the real-time charge and discharge times are zero is judged, and if the real-time charge and discharge times are not zero, that is, the connecting buckle of the battery is not scratched, the real-time charge and discharge times are copied into the first field of the first storage area. In this implementation manner, the first charge-discharge frequency in the first field is the same as the real-time charge-discharge frequency. For example, when the real-time charge and discharge times is 2, 2 is copied to the first field, so that the first charge and discharge times stored in the first field are 2.
In this implementation manner, the first field of the first storage area synchronously updates the real-time charge and discharge times. If the connection buckle of the battery is scratched to zero the real-time charge and discharge times, the battery is continuously used, the real-time charge and discharge times are recorded again, the first charge and discharge times in the first field are recorded again, and the first charge and discharge times stored in the first field before the connection buckle of the battery is scratched are deleted. Therefore, when the real-time charge and discharge times are determined to be zero, the first charge and discharge times in the first field are stored in the second field, the first charge and discharge times of the battery recorded before the connecting buckle of the battery is scratched are stored in the second field, and the first charge and discharge times (also the actual charge and discharge times of the battery) of the battery recorded before the battery is scratched cannot be obtained after the first charge and discharge times are updated.
The second field stores the first charge and discharge times of the battery recorded before the battery is scratched, and if the battery is scratched for multiple times, the second charge and discharge times stored for multiple times are accumulated to obtain the real charge and discharge times of the battery. Therefore, in this implementation manner, since the first charge-discharge frequency is the same as the real-time charge-discharge frequency, after the connection button of the battery is scratched, the first field is re-recorded as the new charge-discharge frequency, so that when the first charge-discharge frequency in the first field is stored in the second field each time, the real charge-discharge frequency of the battery is stored in the second field by adding the first charge-discharge frequency to the second charge-discharge frequency. For example, if the current second charge/discharge number is zero and the first charge/discharge number is 2, 2 is accumulated to zero, and the second charge/discharge number stored in the second field is 2. If the current second charge and discharge times is 2 and the first charge and discharge times is 2, adding 2 to 2, and the second charge and discharge times stored in the second field is 4. That is, the second charge-discharge number, or the sum of the second charge-discharge number and the first charge-discharge number, is the actual charge-discharge number of the battery.
When maintenance personnel or service personnel need to check the charge and discharge times of the battery, the system can call the second charge and discharge times stored in the second field, or the first charge and discharge times stored in the first field and the second charge and discharge times stored in the second field, so as to provide the maintenance personnel or service personnel with the actual charge and discharge times of the battery.
In another possible implementation manner, after the real-time charge and discharge times recorded by the electronic device are obtained, whether the real-time charge and discharge times are zero is judged, if the real-time charge and discharge times are not zero, that is, the connecting buckle of the battery is not scratched, the real-time charge and discharge times are the real charge and discharge times of the battery, so that the real-time charge and discharge times are copied into the first field, and the first charge and discharge times of the first field are updated. If the real-time charge and discharge times are zero, that is, the connection button of the battery is scratched, the first charge and discharge times are copied to the second field of the first storage area, and the old charge and discharge times (that is, the first charge and discharge times recorded before the real-time charge and discharge times are cleared) of the battery recorded before the battery is scratched are stored in the second field. When the battery is charged and discharged again, the electronic equipment is triggered again to acquire the real-time charging and discharging times recorded by the electronic equipment, if the acquired charging and discharging times are no longer zero, the connection buckle of the battery is not scratched in the current charging and discharging process, and the first charging and discharging times are updated based on the real-time charging and discharging times and the second charging and discharging times in the second field (namely, the sum of the re-recorded real-time charging and discharging times and the old charging and discharging times recorded before the battery is the real charging and discharging times of the battery). The real-time charge and discharge times and the second charge and discharge times can be accumulated and copied into the first field to update the first charge and discharge times; the second charge and discharge times may be copied to the first field, and then the real-time charge and discharge times may be added to the first charge and discharge times of the first field.
That is, in this implementation, the first field holds the latest actual charge/discharge number of the battery (i.e., the first charge/discharge number is the actual charge/discharge number). The real-time charge and discharge times are the charge and discharge times of the battery recorded by the electronic equipment. If the connecting buckle of the battery is not scratched, the real-time charge and discharge times recorded by the electronic equipment are real charge and discharge times of the battery, and the real-time charge and discharge times are directly copied to the first field. If the connecting buckle of the battery is scratched, the real-time charge and discharge times recorded by the electronic equipment are the charge and discharge times recorded again after the connecting buckle of the battery is scratched. In this scenario, the actual charge and discharge times of the battery are: the second charge and discharge times recorded before the connecting buckle of the battery is scratched and the real-time charge and discharge times recorded again after the connecting buckle of the battery is scratched. The second field stores the old charge-discharge times (i.e., the second charge-discharge times) recorded before the battery is scratched, so that when the first charge-discharge times are updated, updating is performed based on the real-time charge-discharge times and the second charge-discharge times in the second field, so that the first charge-discharge times stored in the first field are the latest real charge-discharge times of the battery.
Illustrating: when the obtained real-time charge and discharge times is 2 and the second charge and discharge times of the second field is 0 (the connecting buckle of the battery is not scratched), the real-time charge and discharge times are copied to the first field, and the first charge and discharge times in the first field are 2. And when the battery is charged again, triggering again to acquire the real-time charge and discharge times recorded by the electronic equipment, and when the real-time charge and discharge times is 0, copying the first charge and discharge times into the second field, wherein the second charge and discharge times in the second field are 2. And when the battery is charged again, triggering again to acquire the real-time charge and discharge times recorded by the electronic equipment, and when the real-time charge and discharge times is 1, accumulating the real-time charge and discharge times and the first charge and discharge times and updating the accumulated real-time charge and discharge times and the first charge and discharge times into a first field, wherein the first charge and discharge times in the first field are 3.
Thus, when the maintenance personnel or the service personnel need to check the charge and discharge times of the battery, the system can adjust the first charge and discharge times stored in the first field so as to provide the maintenance personnel or the service personnel with the actual charge and discharge times of the battery.
It can be understood that the method for implementing the record of the number of charge and discharge in the embodiment of the present application includes, but is not limited to, the above two methods, for example, a plurality of second fields may be further provided to respectively store the number of charge and discharge stored in the first field, and the number of charge and discharge recorded before the connection buckle of the battery is scratched multiple times may be obtained by accumulating the second number of charge and discharge in the plurality of second fields.
Step S305: and when a query request of the battery is received, outputting the actual charge and discharge times of the battery according to the first charge and discharge times and/or the second charge and discharge times.
Optionally, since the nonvolatile memory stores the first charge-discharge frequency and the second charge-discharge frequency, when a serviceman or service personnel detects the service condition of the battery, the first charge-discharge frequency and the second charge-discharge frequency in the nonvolatile memory can be adjusted to obtain the actual charge-discharge frequency of the battery. For example, a serviceman may connect an electricity meter to the electronic device, and read the actual number of charges and discharges in the nonvolatile memory through the electricity meter. Subsequently, the maintenance personnel or service personnel can evaluate or optimize the service life, the health condition and the like of the local battery based on the real charge and discharge times, and the embodiment of the application does not limit the service life, the health condition and the like.
In a possible implementation manner, the fuel gauge is connected with an interface of the nonvolatile memory, when the fuel gauge reads the nonvolatile memory, a query request of the battery, such as a charge and discharge frequency acquisition request, is triggered, the electronic device outputs the real charge and discharge frequency to the fuel gauge, and the fuel gauge displays the real charge and discharge frequency.
In another possible implementation manner, when the maintenance APP or the battery safety APP of the electronic device is triggered, a query request, such as a charge/discharge number acquisition request, of the battery is triggered, the electronic device invokes the real charge/discharge number of the battery to the nonvolatile memory, and the maintenance APP or the battery safety APP analyzes the usage information of the battery according to the real charge/discharge number of the battery and outputs the usage information on a display interface.
As shown in FIG. 4, one of the interactive processes is used to enumerate the method for recording the charge and discharge times of the electronic device in the embodiment of the application.
When the charging module of the electronic equipment is connected with the power supply, the charging management module generates a charging signal to trigger the charging and discharging frequency recording process. And acquiring real-time charge and discharge times recorded by the electronic equipment through a charge management module, judging whether the real-time charge and discharge times are zero, and if the charge and discharge times are not zero, updating the first charge and discharge times of the first field of the first storage area of the nonvolatile memory according to the real-time charge and discharge times. And if the real-time charge and discharge times are zero, updating the second charge and discharge times of the second field of the first storage area according to the first charge and discharge times in the first field, so that the data related to the charge and discharge times of the battery are stored in the nonvolatile memory. When a maintenance worker or service worker triggers a maintenance APP, the maintenance APP sends a charge-discharge acquisition request to the electronic equipment; or a serviceman or service personnel externally connects an electric quantity timer on the electronic equipment and sends a charge and discharge frequency acquisition request. The electronic equipment invokes the first charge and discharge times and/or the second charge and discharge times stored in the nonvolatile memory to output the actual charge and discharge times of the battery according to the first charge and discharge times and/or the second charge and discharge times.
According to the charge and discharge frequency recording method, the use scene of the battery is determined according to the real-time charge and discharge frequency recorded by the electronic equipment, and the charge and discharge frequency of the battery is recorded in different recording modes according to different use scenes. If the interface end of the battery is not disconnected and the real-time charge and discharge times are not clear, the real-time charge and discharge times are simultaneously stored in a first field of a first storage area of the nonvolatile memory so as to store the charge and discharge times after the battery is updated; if the interface end of the battery is disconnected and the real-time charge and discharge times are zero, the first charge and discharge times in the first field are stored in the second field of the first storage area so as to save the charge and discharge times of the battery before the real-time charge and discharge times are zero. The first field of the first storage area is used for storing the old charge and discharge times of the battery when the interface end of the battery is disconnected, and the first field is used for storing the new charge and discharge times which are recorded again after the interface end is disconnected, so that the real charge and discharge times of the battery can be reserved through the data of the first field and the second field. The maintenance personnel or service personnel can obtain the real charge and discharge times of the battery through the nonvolatile memory, and the battery safety protection and health monitoring are facilitated.
In the above embodiment, the disconnection of the interface end of the battery is based on the reason that the battery is scratched, and the scratched battery includes the following scenarios:
first scene:
the connection button of the battery is scratched to disconnect the interface end, but the battery is not replaced. For example, a serviceman or service person disconnects the interface end of the battery, but does not remove the battery.
And after the interface of the battery is disconnected, the real-time charge and discharge times recorded by the electronic equipment are cleared. Whether the battery is replaced or not can be determined by the identification information of the battery currently used by the electronic equipment. The identification information can be sn number on the battery.
Based on the first scenario, another embodiment of the present application provides a method for recording the number of charge and discharge, as shown in fig. 5, where the method includes:
step S501: when a charging signal is received, acquiring real-time charging and discharging times of a battery recorded by the electronic equipment and acquiring target identity information corresponding to an identity port of the battery;
when the battery finishes charging and discharging, the electronic equipment records the times of charging and discharging once and stores the times of charging and discharging in real time. Because the battery interface end of the electronic equipment is disconnected, when the connecting buckle of the battery is scratched, the real-time charge and discharge times can be cleared. When receiving a charging signal of the electronic equipment, the embodiment of the application acquires the real-time charging and discharging times of the battery recorded by the electronic equipment. And acquiring target identity information of the battery passing through battery anti-counterfeiting through inquiring a battjd node of the electronic equipment, such as sn of the battery. It can be understood that when the battery leaves the factory, after anti-counterfeiting authentication, the anti-counterfeiting mark sn number is arranged on the battery, and the sn number can be read through the battid node of the battery.
Step S502: searching whether the preset nonvolatile memory stores the identification information of the battery or not;
and when the charge and discharge times of the battery are stored in the nonvolatile memory, the identity information of the battery is stored. And each identity information is associated with the charge and discharge times. That is, the nonvolatile memory stores the number of times of charge and discharge per battery.
In the embodiment of the application, whether the charge and discharge times of the battery are stored for the first time in the nonvolatile memory is determined in advance through the identity information of the battery, and if not, the specific scene that the connecting buckle of the battery is scratched is identified. If the non-volatile memory does not store the identification information, the non-volatile memory is not stored with any charge and discharge times of the battery before, and the record is the first record. If the non-volatile memory stores the identification information, the specific scene that the connecting buckle of the battery is scratched is determined through the comparison of the identification information if the non-volatile memory does not store the charge and discharge times of the battery for the first time.
If the identification information of the battery is stored, step S503 is executed: acquiring first identity identification information stored in a first storage area of the nonvolatile memory;
Step S504: judging whether the first identity information is the same as the target identity information;
the first storage area of the nonvolatile memory is updated along with the real-time charge and discharge times, and the real-time charge and discharge times are the charge and discharge times of the battery currently used by the electronic equipment, so that the battery corresponding to the charge and discharge times stored in the first storage area is the battery currently used by the electronic equipment. If the battery stored in the first storage area is different from the battery currently used by the electronic equipment, the battery of the electronic equipment is replaced, and if the battery is the same, the battery of the electronic equipment is not replaced. Based on this, the present embodiment recognizes a scenario of whether the battery is replaced in the following manner.
Optionally, the battery identification information corresponding to the number of charging and discharging stored in the first storage area is first identification information, and the first identification information may be the same as the target identification information, if the battery is not replaced. Thus, it can be determined whether the battery is replaced by comparing the first identification information with the target identification information. If the identification information is found in the nonvolatile memory and the first identification information is the same as the target identification information corresponding to the battery currently used by the electronic equipment, the battery is not replaced.
In this embodiment, when it is determined that the battery is not replaced through the first identity information, it is determined whether an interface end of the currently used battery is disconnected, that is, whether a connector of the battery is scratched, and specifically, whether the situation that the connector of the battery is scratched but the battery is not replaced is determined. If the connecting buckle of the battery is scratched, the real-time charge and discharge times recorded by the electronic equipment are zero, and if the connecting buckle of the battery is not scratched, the real-time charge and discharge times recorded by the electronic equipment are not zero.
Therefore, when the first identity information is the same as the target identity information, step S505 is performed: judging whether the real-time charge and discharge times are zero or not;
if yes, that is, the real-time charge/discharge frequency is zero, step S506 is executed: and updating the second charge-discharge times in the second field of the first storage area according to the first charge-discharge times.
The method of updating the second charge/discharge number in the second field of the first storage area according to the first charge/discharge number refers to the embodiment shown in fig. 3.
If not, that is, the real-time charge and discharge times are non-zero, step S507 is executed: and updating the first charge and discharge times in a first field of a first storage area of a preset nonvolatile memory according to the real-time charge and discharge times.
The method of updating the first charge/discharge number in the first field of the first storage area of the preset nonvolatile memory according to the real-time charge/discharge number refers to the embodiment shown in fig. 3.
If the identification information is not stored, step S508 is executed: and storing the target identity information and the real-time charge and discharge times in the nonvolatile memory.
If the non-volatile memory does not store the identification information, the non-volatile memory is indicated that the charge and discharge times of any battery are not stored before, and the current record is the first record of the charge and discharge times. When the nonvolatile memory of the electronic equipment records the charge and discharge times for the first time, the obtained target identity information of the battery and the real-time charge and discharge times are stored in the nonvolatile memory.
Optionally, in an embodiment, the target identity information and the real-time charge-discharge number are stored in a first storage area of the nonvolatile memory, and are stored as the first charge-discharge number, or are stored as the first charge-discharge number and the second charge-discharge number.
In this embodiment, whether the battery is replaced is determined through the identity information, so that the recorded actual charge and discharge times are not corresponding to the battery, and the error in the record of the charge and discharge times of the battery is avoided, so that the analysis of the actual service condition of the battery is affected.
In an implementation manner, after the step of obtaining the target identity information corresponding to the identity port of the battery, the method further includes:
verifying the target identity information according to the anti-counterfeiting mark information of the battery;
and verifying the target identity information effectively, and executing the step of searching whether the preset nonvolatile memory stores the identity information or not.
That is, before comparing the identity information, the obtained target identity information is subjected to anti-counterfeiting authentication again to determine the validity of the target identity information.
The second scenario:
the battery is scratched and replaced with the battery that was originally used. For example, a service person or service person removes the battery, tests with a new battery, and then replaces the original battery.
And after the interface of the battery is disconnected, the real-time charge and discharge times recorded by the electronic equipment are cleared. Whether the battery is replaced or not can be determined by the identification information of the battery currently used by the electronic equipment. The identification information may be SN identification on the battery, for example.
Based on the second scenario, a method for recording the number of charge and discharge according to still another embodiment of the present application, as shown in fig. 6, includes:
Step S601: when a charging signal is received, acquiring real-time charging and discharging times of a battery recorded by the electronic equipment and acquiring target identity information corresponding to an identity port of the battery;
in the embodiment of the present application, step S601 may be referred to the embodiment shown in fig. 5, and the detailed description of step S501 is omitted here.
Step S602: searching whether the preset nonvolatile memory stores the identification information of the battery or not;
in the embodiment of the present application, step S602 may be referred to the embodiment shown in fig. 5, and the detailed description of step S502 is omitted here.
If the identity information of the battery is stored, step S603 is executed: acquiring first identity identification information stored in a first storage area of the nonvolatile memory;
step S604: judging whether the first identity information is the same as the target identity information;
the first storage area of the nonvolatile memory is updated along with the real-time charge and discharge times, and the real-time charge and discharge times are the charge and discharge times of the battery currently used by the electronic equipment, so that the battery corresponding to the charge and discharge times stored in the first storage area is the battery currently used by the electronic equipment. If the battery stored in the first storage area is different from the battery currently used by the electronic equipment, the battery of the electronic equipment is replaced, and if the battery is the same, the battery of the electronic equipment is not replaced. Based on this, the present embodiment recognizes a scenario of whether the battery is replaced in the following manner.
Optionally, the battery identification information corresponding to the first charge and discharge times stored in the first storage area is first identification information, where the first identification information may be different from the target identification information, such as changing the battery scenario. Thus, it can be determined whether the battery is replaced by comparing the first identification information with the target identification information. If the identification information of the battery is found in the nonvolatile memory and the first identification information in the first storage area is different from the target identification information corresponding to the battery currently used by the electronic equipment, the battery is indicated to be replaced.
In the case where the battery is replaced, the old battery which is used by the electronic device may be replaced on the electronic device, or new electronic which is not used may be replaced on the electronic device. In different scenes, the corresponding recording modes of the charge and discharge times are different. Based on this, the embodiment of the present application determines a specific scenario in which the battery is replaced in the following manner in the case where the replacement of the electron is recognized.
If the first identity information is different from the target identity information, step S605 is executed: acquiring second identity information stored in a second storage area of the nonvolatile memory;
In this embodiment of the present application, a second storage area of the nonvolatile storage is defined, where the second storage area is used to store identification information of an old battery that has been used by the electronic device and historical charge and discharge times of the old battery.
Therefore, if the first identity information is different from the target identity information, it is indicated that the battery currently used by the electronic device is the replaced battery. Whether the replaced battery is a used slave battery or not can be determined by the second identification information stored in the second storage area of the nonvolatile memory.
Step S606: judging whether the second identity information is the same as the target identity information;
if the same, step S607 is executed: and acquiring historical charge and discharge times corresponding to the second identity information, updating the first charge and discharge times and the second charge and discharge times stored in the first storage area by adopting the historical charge and discharge times, and updating the first identity information stored in the first storage area by adopting the second identity information.
If the second identity information is the same as the target identity information, the situation that the replaced battery is the battery used by the electronic equipment, namely the battery is determined to be scratched and replaced with the battery used originally, is indicated.
If the battery of the electronic device is replaced by an old battery which is used once, based on the fact that a certain amount of charge and discharge times exist before the old battery is removed, the old battery is removed to clear the real-time charge and discharge times, if the old battery is reloaded, the register reloads the real-time charge and discharge times recorded from 0, the recorded real-time charge and discharge times are not actually the real charge and discharge times of the battery, and the authenticity of the charge and discharge times is affected. Therefore, the present embodiment stores the number of charge and discharge of the removed battery using the second storage area. When the old battery is reloaded, the historical charge and discharge times and the second identity information stored in the second storage area are updated into the first storage area, so that the charge and discharge times are continuously accumulated on the basis of the historical charge and discharge times in the process of using the battery by the electronic equipment, and the times of the true middle-aged side of the battery are obtained.
Optionally, the historical charge-discharge times are adopted to further increase the first charge-discharge times and/or the second charge-discharge times of the first storage area. That is, the first field and the second field of the first storage area are updated synchronously.
Optionally, in this embodiment of the present application, after the battery is mounted on the electronic device, if the battery completes charging and discharging again, the number of times of charging and discharging of the battery is stored in the first storage area, where the number of times of charging and discharging is a sum of the historical actual number of times of charging and discharging and the newly recorded number of times of charging and discharging, and is a new actual number of times of charging and discharging of the battery. The method for recording the number of charge and discharge of the battery uses the embodiment shown in fig. 3 and 4.
In this embodiment, the second storage area is defined as oldbatey, and is used for storing the identity information of the old battery used by the electronic device and the historical charge and discharge times of the old battery. If the battery is detected to be replaced in the using process of the electronic equipment, the system stores the identity information of the replaced battery and the corresponding actual charge and discharge times in the second storage area so as to store the old battery and the charge and discharge times of the electronic equipment, and the historical charge and discharge times of the old battery cannot be obtained when the old battery is used again. The implementation manner can be as follows: when the electronic equipment detects a disconnection signal of an interface end of the battery, if the interface end is reconnected, acquiring target identity information corresponding to an identity port of the reconnected battery; judging whether the target identity information is consistent with first identity information recorded in a first storage area of the nonvolatile memory; if the first identity information and the first charge and discharge times and/or the second charge and discharge times recorded in the first storage area are inconsistent, the first identity information and the first charge and discharge times and/or the second charge and discharge times recorded in the first storage area are stored in the second storage area of the nonvolatile memory, and the historical charge and discharge times of the battery are obtained, wherein the historical charge and discharge times are the first charge and discharge times or the sum of the first charge and discharge times and/or the second charge and discharge times.
That is, when it is detected that the battery is replaced, the first charge/discharge number and the second charge/discharge number of the replaced battery stored in the nonvolatile memory are stored in the second storage area as the history charge/discharge number of the old battery. When the old battery is replaced again, the historical charge and discharge times of the old battery can be obtained through the second storage area, and then the actual charge and discharge times of the battery can be obtained based on the historical charge and discharge times and the real-time charge and discharge times which are recorded again after the old battery is replaced again.
Optionally, if the electronic device includes a plurality of batteries, the corresponding relationship between the identity information of the batteries and the historical charge and discharge times is used for storing the identity information of the batteries in the second storage area respectively. In this embodiment, the configuration of the storage area of the nonvolatile memory can be reduced, and the recording process of the charge and discharge times can be simplified.
Alternatively, in other embodiments, if the electronic device includes a plurality of batteries, a plurality of second storage areas may be configured to store the historical charge and discharge times of each battery, so as to distinguish the historical charge and discharge times of different batteries.
In order to realize simultaneous recording of the charge and discharge times of the new battery and the relevant battery, the embodiment avoids the charge and discharge times of the new battery from covering the charge and discharge times of the old battery after battery replacement. The first storage area of the nonvolatile memory is defined as storing the identity information and the charge and discharge times of the currently used battery, and the second storage area stores the identity information and the charge and discharge times of all used old batteries. Through the combination of the first storage area and the second storage area, each battery is flexibly switched to conduct charge and discharge recording, and applicability is improved.
Third scenario:
the battery is scratched and the battery is replaced with a new battery. For example, a maintenance person or service person removes the battery, detects that the battery is defective, and replaces the battery with a new one for use.
And after the interface of the battery is disconnected, the real-time charge and discharge times recorded by the electronic equipment are cleared. Whether the battery is replaced or not can be determined by the identification information of the battery currently used by the electronic equipment. The identification information may be SN identification on the battery, for example.
As shown in fig. 7, another embodiment of the present application provides a method for recording the number of charge and discharge times, including:
step S701: when a charging signal is received, acquiring real-time charging and discharging times of a battery recorded by the electronic equipment and acquiring target identity information corresponding to an identity port of the battery;
in the embodiment of the present application, step S701 can be referred to the embodiment shown in fig. 5, and the detailed description of step S501 is omitted here.
Step S702: searching whether the preset nonvolatile memory stores the identity information or not;
in the embodiment of the present application, step S702 may be referred to in the embodiment shown in fig. 5, and the detailed description of step S502 is omitted here.
If the identity information is stored, step S603 is executed: acquiring first identity identification information stored in a first storage area of the nonvolatile memory;
step S704: judging whether the first identity information is the same as the target identity information;
the first storage area of the nonvolatile memory is updated along with the real-time charge and discharge times, and the real-time charge and discharge times are the charge and discharge times of the battery currently used by the electronic equipment, so that the battery corresponding to the charge and discharge times stored in the first storage area is the battery currently used by the electronic equipment. If the battery stored in the first storage area is different from the battery currently used by the electronic equipment, the battery of the electronic equipment is replaced, and if the battery is the same, the battery of the electronic equipment is not replaced. Based on this, the present embodiment recognizes a scenario of whether the battery is replaced in the following manner.
Optionally, the battery identification information corresponding to the first charge and discharge times stored in the first storage area is first identification information, where the first identification information may be different from the target identification information, such as changing the battery scenario. Thus, it can be determined whether the battery is replaced by comparing the first identification information with the target identification information. If the identification information is found in the nonvolatile memory and the first identification information in the first storage area is different from the target identification information corresponding to the battery currently used by the electronic equipment, the battery is indicated to be replaced.
In the case where the battery is replaced, the old battery which is used by the electronic device may be replaced on the electronic device, or new electronic which is not used may be replaced on the electronic device. In different scenes, the corresponding recording modes of the charge and discharge times are different. Based on this, the embodiment of the present application determines a specific scenario in which the battery is replaced in the following manner in the case where the replacement of the electron is recognized.
If the first identity information is different from the target identity information, step S705 is executed: acquiring second identity information stored in a second storage area of the nonvolatile memory;
in this embodiment of the present application, a second storage area of the nonvolatile storage is defined, where the second storage area is used to store identification information of an old battery that has been used by the electronic device and historical charge and discharge times of the old battery.
Therefore, if the first identity information is different from the target identity information, it is indicated that the battery currently used by the electronic device is the replaced battery. Whether the replaced battery is a used slave battery or not can be determined by the second identification information stored in the second storage area of the nonvolatile memory.
Step S706: judging whether the second identity information is the same as the target identity information;
if not, step S707 is executed: and storing the target identity information and the real-time charge and discharge times in the nonvolatile memory.
If the second identity information is different from the target identity information, the situation that the replaced battery is a battery which is not used by the electronic equipment, namely the battery is determined to be scratched and replaced with a new battery, is indicated.
If the battery of the electronic equipment is replaced by a new battery, the identity information and the real-time charge and discharge times are stored in the nonvolatile memory in order to record the charge and discharge times of the new battery conveniently in the subsequent use process.
Optionally, in one possible implementation manner, if the identity information stored in the nonvolatile memory is different from the target identity information, the replaced battery is not used on the electronic device, may be completely new, or may be used on another electronic device, and if the battery is completely new, the step S707 may be directly executed. If the battery is used on other electronic equipment, the historical charge and discharge times input port corresponding to the target identity information can be output for a user to input the historical charge and discharge times of the battery. In this implementation, if the replaced old battery is used on another electronic device, but not used on the local electronic device, the historical charge and discharge times of the battery can be obtained through a user input mode.
Optionally, in this embodiment of the present application, after the battery is mounted on the electronic device, if the battery completes charging and discharging again, the number of times of charging and discharging of the battery is stored in the first storage area, where the number of times of charging and discharging is a sum of the historical actual number of times of charging and discharging and the newly recorded number of times of charging and discharging, and is a new actual number of times of charging and discharging of the battery. The method for recording the number of charge and discharge of the battery uses the embodiment shown in fig. 3 and 4.
Optionally, in combination with the scenario in each embodiment, one implementation manner is proposed that the number of times of charging and discharging the battery in each scenario can be recorded:
the method comprises the steps of presetting a storage area of one nonvolatile memory of the electronic equipment, defining a first storage area and a second storage area, defining two storage fields of the first storage area, such as a first field and a second field, wherein data stored in the first storage area are identification information of a currently used battery and charge and discharge times of the battery, the first charge and discharge times stored in the first field are updated based on real-time charge and discharge times of the electronic equipment, and the second charge and discharge times stored in the second field are used for storing actual charge and discharge times of currently used electrons. The data stored in the second storage area are the identification information of all used old batteries and the corresponding historical charge and discharge times.
When the electronic equipment is charged, acquiring target identity information of a battery currently used by the electronic equipment and real-time charge and discharge times recorded by the electronic equipment;
determining whether a storage area in the nonvolatile memory is empty;
if yes, the target identity information and the acquired real-time charge and discharge times are stored in the nonvolatile memory. Taking the first charge of the electronic device as an example, the non-volatile memory does not store the identification information and the charge and discharge times of the battery of the electronic device, so the non-volatile memory stores the identification information and the corresponding charge and discharge times of the battery as 0.
If not, comparing the target identity information with the first identity information stored in the first storage area;
and if the target identity information is matched with the first identity information, indicating that the battery of the electronic equipment is not replaced.
Determining whether the real-time charge and discharge times are zero;
if the real-time charge and discharge times are not zero, the real-time charge and discharge times are updated to a first field of the first storage area, and the actual charge and discharge times of the battery are recorded. Taking the battery as a second charging example, when the battery is charged for the first time, the identity information of the new battery and the corresponding charge and discharge times are stored in a nonvolatile memory to be 0. And after the first charge is completed and the discharge is completed, the real-time charge and discharge times of the electronic equipment are recorded as 1, and when the second charge is completed, the real-time charge and discharge times are obtained as 1 (non-zero), and then the real-time charge and discharge times are updated into a first field of the first storage area, namely, the first charge and discharge times are 1. After the third charge and discharge is completed, the real-time charge and discharge times of the electronic equipment are recorded as 2, and the real-time charge and discharge times are updated into the first field of the first storage area, namely, the first charge and discharge times are 2.
If the real-time charge and discharge times are zero, the interface end of the battery is disconnected, the real-time charge and discharge times are cleared, the first charge and discharge times of the first field of the first storage area are updated into the second field, and after the real-time charge and discharge times are recorded again by the battery, the actual charge and discharge times of the battery are obtained based on the second charge and discharge times and the real-time charge and discharge times stored in the second field. Taking the fourth charging of the battery as an example, after the third charging and discharging of the battery are completed and before the fourth charging, the interface end of the battery is disconnected, the real-time charging and discharging times are 0, at this time, the first charging and discharging times in the first field are updated to the second field, and the second charging and discharging times are 2 (or the corresponding charging and discharging times are 3 when the first charging and discharging times are updated and the count is increased by 1). When the battery is charged for the fifth time, if the real-time charge and discharge times are recorded again as 1, the second charge and discharge times are copied into the first field, the first charge and discharge times are updated as 2 or 3, and thus, the actual charge and discharge times are obtained by accumulation based on the real-time charge and discharge times of 1 and the first charge and discharge times of 2 or 3.
If the target identity information is not matched with the first identity information, indicating that the battery of the electronic equipment is replaced, wherein the real-time charge and discharge times are zero after the battery is replaced;
In this case, the currently used battery may be a new battery (a battery not recorded in the nonvolatile memory) or may be a used old battery. Based on the identification information of all used batteries stored in the second storage area, determining whether the currently used battery is a used old battery or not by searching the identification information in the second storage area;
when the target identity information is matched with the second identity information in the second storage area, the currently used battery is a used old battery, and at the moment, the second identity information in the second storage area and the corresponding historical electricity times are updated into the first storage area, so that after the battery finishes charging and discharging and the charging and discharging times are recorded again, the recorded charging and discharging times and the historical charging and discharging times are accumulated, and the actual charging and discharging times of the battery are obtained.
If the target identity information is not matched with the second identity information in the second storage area, the battery which is currently used is a new battery, and the battery which is not recorded in the nonvolatile memory is indicated. And recording the target identity information and the corresponding real-time charge and discharge times in the first storage area at the moment so as to record the battery in the nonvolatile memory.
Different scenes have different influences on the actual charge and discharge times, and if the same recording mode is adopted, the recording accuracy of the actual charge and discharge times can be influenced. Based on the recording process of the charge and discharge times, different recording modes can be adopted for the actual charge and discharge times of the battery under different scenes, and the accuracy of the actual charge and discharge times recording is improved.
In an implementation manner, when the electronic device includes at least two batteries, target identity information corresponding to the identity ports of the batteries is obtained respectively. And comparing the target identity information of each battery with the identity information stored in the nonvolatile memory, and recording the charge and discharge times corresponding to the target identity information according to different comparison results, so that the battery is not influenced by the service conditions of other batteries.
If the electronic device includes at least two batteries, the charging and discharging times may be acquired separately or simultaneously. In one implementation, when a request for acquiring the charge and discharge times of the battery is received, all the actual charge and discharge times in the nonvolatile memory are output. In an achievable mode, a battery charge and discharge frequency acquisition request is received, and the acquisition request is determined to acquire the identity information of the battery; outputting corresponding actual charge and discharge times according to the identity information; i.e. the actual charge and discharge times of each battery are obtained respectively.
Fig. 8 shows a schematic structural diagram of a charge/discharge number recording device provided in the present application. The charge and discharge number recording device 800 provided by the application includes a first recording module 801, a second recording module 802, and an obtaining module 803.
In a possible implementation manner, the first recording module 801 is configured to record, in a first register, a first real-time charge-discharge number of times of the first battery when the first battery of the electronic device completes a charge-discharge event, and record, after the first real-time charge-discharge number of times is cleared, a second real-time charge-discharge number of times of the first battery in the first register when the first battery is detected to complete a charge-discharge event again, where the first real-time charge-discharge number of times recorded by the first register is cleared when a disconnection signal at an interface end of the first battery is detected;
the second recording module 802 is configured to synchronously record the first real-time charge-discharge number and the second real-time charge-discharge number in a nonvolatile memory, where when a disconnection signal of an interface end of the first battery is detected, the nonvolatile memory records that the first real-time charge-discharge number and the second real-time charge-discharge number are not cleared;
The obtaining module 803 is configured to obtain, when receiving a first query request, a real charge-discharge number of times of the first battery, where the real charge-discharge number of times is a sum of the first real-time charge-discharge number of times and the second real-time charge-discharge number of times in the nonvolatile memory.
It should be understood that the electronic device herein is embodied in the form of functional modules. The term "module" herein may be implemented in software and/or hardware, and is not specifically limited thereto. For example, a "module" may be a software program, a hardware circuit, or a combination of both that implements the functionality described above. The hardware circuitry may include application specific integrated circuits (application specific integrated circuit, ASICs), electronic circuits, processors (e.g., shared, proprietary, or group processors, etc.) and memory for executing one or more software or firmware programs, merged logic circuits, and/or other suitable components that support the described functions.
The application also provides an electronic device comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform the charge and discharge number recording method as described above in the first aspect or any of the possible implementations of the first aspect.
The present application also provides a computer readable storage medium having a computer program stored therein, which when executed by a processor, causes the processor to perform the charge and discharge number recording method as described in the first aspect or any one of the possible implementation manners of the first aspect.
The application further provides a chip, the chip comprises a processor and a data interface, the processor reads instructions stored on a memory through the data interface, and the method for recording the charge and discharge times of the first aspect or any one of possible implementation manners of the first aspect is executed.
Optionally, the chip may further include a memory, where the memory stores instructions, and the processor is configured to execute the instructions stored on the memory, where the instructions, when executed, are configured to perform the method for recording the number of charge and discharge times according to the first aspect or any one of the possible implementation manners of the first aspect.
The memory may be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (random access memory, RAM) or other types of dynamic storage devices that can store information and instructions, electrically erasable programmable read-only memory (electrica llyerasable programmable read-only memory, EEPROM), compact disc read-only memory (compact disc read-only memory) or other optical disk storage, optical disk storage (including compact disc, laser disc, optical disc, digital versatile disc, blu-ray disc, etc.), magnetic disk storage media, or any other magnetic storage device 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, etc.
In this embodiment, "and/or" describes an association relationship of an association object, which means that there may be three relationships, for example, a and/or B, and may mean that there is 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 the following" and the like means any combination of these items, including any combination of single or plural items. For example, at least one of a, b and 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.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in the embodiments disclosed herein can be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In several embodiments provided herein, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely specific embodiments of the present application, and any person skilled in the art may easily conceive of changes or substitutions within the technical scope of the present application, which should be covered by the protection scope of the present application. The protection scope of the present application shall be subject to the protection scope of the claims.

Claims (17)

1. A method for recording the number of charge and discharge times, which is applied to an electronic device, the method comprising:
when detecting that a first battery of the electronic equipment completes one charge and discharge event, the electronic equipment records first real-time charge and discharge times in a first register, and synchronously records the first real-time charge and discharge times in a nonvolatile memory;
when a disconnection signal of an interface end of the first battery is detected, the first real-time charge and discharge times recorded by the first register are cleared, and the nonvolatile memory records that the first real-time charge and discharge times are not cleared;
when the first battery is detected to finish a charging and discharging event, the electronic equipment records a second real-time charging and discharging frequency in the first register, and synchronously records the second real-time charging and discharging frequency in the nonvolatile memory;
In response to a received first query request, the electronic device obtains the real charge-discharge frequency of the first battery, wherein the real charge-discharge frequency is the sum of the first real-time charge-discharge frequency and the second real-time charge-discharge frequency in the nonvolatile memory.
2. The method for recording the number of charge and discharge operations of claim 1, wherein when it is detected that the first battery of the electronic device completes one charge and discharge event, the electronic device records a first real-time number of charge and discharge operations in the first register, and the step of synchronously recording the first real-time number of charge and discharge operations in the nonvolatile memory includes:
when detecting that a first battery of the electronic equipment completes one charge and discharge event, the electronic equipment records first real-time charge and discharge times in a first register;
when a charging signal is detected and the first real-time charging and discharging times recorded in the first register are not cleared, synchronously recording the first real-time charging and discharging times into a first field of a first storage area of the nonvolatile memory to obtain first charging and discharging times;
when a charge and discharge signal is detected and the first real-time charge and discharge times recorded in the first register are cleared, synchronously recording the first charge and discharge times in the first field into a second field of the first storage area to obtain second charge and discharge times.
3. The charge and discharge number recording method according to claim 2, wherein the electronic device records a second real-time charge and discharge number in the first register when it is detected that the first battery completes one more charge and discharge event, and the step of synchronously recording the second real-time charge and discharge number in the nonvolatile memory includes:
when the first battery is detected to finish one charge and discharge event, the electronic equipment records second real-time charge and discharge times in the first register;
when a charging signal is detected, synchronously recording the sum of the second real-time charging and discharging times of the first battery and the second charging and discharging times into a first field of the first storage area to obtain the first charging and discharging times, wherein the first charging and discharging times are real charging and discharging times of the first battery.
4. The method for recording the number of charge and discharge operations of claim 1, wherein when it is detected that the first battery of the electronic device completes one charge and discharge event, the electronic device records a first real-time number of charge and discharge operations in the first register, and the step of synchronously recording the first real-time number of charge and discharge operations in the nonvolatile memory includes:
When detecting that a first battery of the electronic equipment completes one charge and discharge event, the electronic equipment records first real-time charge and discharge times in a first register;
when a charging signal is detected and the first real-time charging and discharging times recorded in the first register are cleared, synchronously recording the first real-time charging and discharging times into a first field of a first storage area of the nonvolatile memory to obtain first charging and discharging times;
when a charge and discharge signal is detected and the first real-time charge and discharge times recorded in the first register are cleared, accumulating the first charge and discharge times into a second field of the first storage area to obtain second charge and discharge times.
5. The charge and discharge number recording method according to claim 4, wherein the electronic device records a second real-time charge and discharge number in the first register when it is detected that the first battery completes one more charge and discharge event, and the step of synchronously recording the second real-time charge and discharge number in the nonvolatile memory includes:
when the first battery is detected to finish one charge and discharge event, the electronic equipment records second real-time charge and discharge times in the first register;
When a charging signal is detected, synchronously recording the second real-time charging and discharging times of the first battery into a first field of the first storage area to obtain the first charging and discharging times, wherein the first charging and discharging times and the second charging and discharging times are the real charging and discharging times.
6. The charge/discharge number recording method according to any one of claims 1 to 5, wherein when it is detected that the first battery of the electronic device completes one charge/discharge event, the electronic device records a first real-time charge/discharge number in a first register, and the step of synchronously recording the first real-time charge/discharge number in a nonvolatile memory includes:
when detecting that a first battery of the electronic equipment completes one charge and discharge event, the electronic equipment records first real-time charge and discharge times in a first register;
acquiring target identity information corresponding to an identity port of the first battery;
searching whether the nonvolatile memory stores the identification information of the battery or not;
and if the nonvolatile memory stores the identification information of the battery, and the identification information of the battery is the same as the target identification information, synchronously recording the first real-time charge and discharge times in the nonvolatile memory.
7. The method for recording the number of charge and discharge operations of claim 6, wherein when the first battery of the electronic device is detected to complete a charge and discharge event, the electronic device records a first real-time number of charge and discharge operations in a first register, and the step of synchronously recording the first real-time number of charge and discharge operations in a nonvolatile memory, further comprises:
if the non-volatile memory does not store the identification information of the battery, or the stored identification information of the battery is different from the target identification information, storing the target identification information in the non-volatile memory, and synchronously recording the first real-time charge and discharge times in a storage area corresponding to the target identification information.
8. The method for recording the number of charge and discharge operations of claim 6, wherein if the nonvolatile memory stores the identification information of the battery, and the identification information of the battery is the same as the target identification information, the step of synchronously recording the first real-time number of charge and discharge operations in the nonvolatile memory includes:
if the nonvolatile memory stores the identity information of the battery, judging whether the first identity information stored in a first storage area of the nonvolatile memory is consistent with the target identity information, wherein the identity information of the battery stored in the first storage area is the first identity information;
And if the charge and discharge times are consistent, synchronously recording the first real-time charge and discharge times in a first storage area of the nonvolatile memory.
9. The method for recording the number of charge and discharge operations of claim 8, wherein if the nonvolatile memory stores the identification information of the battery, and the identification information of the battery is the same as the target identification information, the step of synchronously recording the first real-time number of charge and discharge operations in the nonvolatile memory further comprises:
if the identification information is inconsistent with the target identification information, judging whether the second identification information stored in a second storage area of the nonvolatile memory is consistent with the target identification information, wherein the identification information of the battery stored in the second storage area is the second identification information;
and if the historical charge and discharge times corresponding to the second identity information are consistent, recording the second identity information and the historical charge and discharge times into the first storage area.
10. The method for recording the number of charge and discharge operations according to claim 6, wherein after the step of obtaining the target identification information corresponding to the identification port of the battery, the method further comprises:
Verifying the target identity information according to the anti-counterfeiting mark information of the battery;
and verifying the target identity information effectively, and executing the step of searching whether the identity information of the battery is stored in the nonvolatile memory.
11. The charge-discharge number recording method according to claim 1, characterized in that the method further comprises:
when a disconnection signal of an interface end of the first battery is detected, if the interface end is reconnected, acquiring target identity information corresponding to an identity port of the reconnected first battery;
judging whether the target identity information is consistent with first identity information recorded in a first storage area of the nonvolatile memory;
if the first identity identification information and the first charge and discharge times and/or the second charge and discharge times recorded in the first storage area are inconsistent, the first identity identification information and the first charge and discharge times and/or the second charge and discharge times recorded in the first storage area are stored in the second storage area of the nonvolatile memory, and the historical charge and discharge times of the first battery are obtained, wherein the historical charge and discharge times are the first charge and discharge times or the sum of the first charge and discharge times and/or the second charge and discharge times.
12. The charge-discharge number recording method according to claim 1, characterized in that the method further comprises:
when the fact that the second battery of the electronic equipment completes one charge and discharge event is detected, the electronic equipment records third real-time charge and discharge times in a second register, and synchronously records the third real-time charge and discharge times in a nonvolatile memory;
when the disconnection signal of the interface end of the second battery is detected, the third real-time charge and discharge times recorded by the second register are cleared, and the nonvolatile memory records that the third real-time charge and discharge times are not cleared;
when the second battery is detected to finish a charging and discharging event, the electronic equipment records a fourth real-time charging and discharging frequency in the second register, and synchronously records the fourth real-time charging and discharging frequency in the nonvolatile memory;
and responding to the received second inquiry request, the electronic equipment acquires the real charge and discharge times of the second battery, wherein the real charge and discharge times are the sum of the third real-time charge and discharge times and the fourth real-time charge and discharge times in the nonvolatile memory.
13. The method of recording the number of charge and discharge operations of claim 12, wherein when it is detected that the second battery of the electronic device completes one charge and discharge event, the electronic device records a third real-time number of charge and discharge operations in the second register, and the step of synchronously recording the third real-time number of charge and discharge operations in the nonvolatile memory includes:
when detecting that the second battery of the electronic equipment completes one charge and discharge event, the electronic equipment records third real-time charge and discharge times in a second register;
when a charge-discharge signal is detected and the third real-time charge-discharge times recorded in the second register are not cleared, synchronously recording the third real-time charge-discharge times into a first field of a third storage area of the nonvolatile memory to obtain third charge-discharge times;
when a charge and discharge signal is detected and the third real-time charge and discharge times recorded in the second register are cleared, the third charge and discharge times in the first field are synchronously recorded to obtain the fourth charge and discharge times in the second field of the third storage area.
14. The charge and discharge number recording method of claim 13, wherein the electronic device records a fourth real-time charge and discharge number in the second register when it is detected that the second battery completes one more charge and discharge event, and the step of synchronously recording the fourth real-time charge and discharge number in the nonvolatile memory includes:
When the second battery is detected to finish a charging and discharging event, the electronic equipment records fourth real-time charging and discharging times in the second register;
and when a charging signal is detected, synchronously recording the sum of the fourth real-time charging and discharging times of the second battery and the fourth charging and discharging times into a first field of the third storage area to obtain the third charging and discharging times, wherein the third charging and discharging times are the actual charging and discharging times of the second battery.
15. A charge/discharge number recording apparatus, comprising: the device comprises a first recording module, a second recording module and an acquisition module;
the first recording module is configured to record a first real-time charge-discharge number of times of the first battery in a first register when the first battery of the electronic device completes a charge-discharge event, and record a second real-time charge-discharge number of times of the first battery in the first register when the first battery is detected to complete a charge-discharge event after the first real-time charge-discharge number of times is cleared, where the first real-time charge-discharge number of times recorded by the first register is cleared when a disconnection signal of an interface end of the first battery is detected;
The second recording module is configured to synchronously record the first real-time charge-discharge times and the second real-time charge-discharge times in a nonvolatile memory, where when an off signal of an interface end of the first battery is detected, the nonvolatile memory records that the first real-time charge-discharge times and the second real-time charge-discharge times are not cleared;
the acquisition module is used for acquiring the real charge and discharge times of the first battery when receiving a first query request, wherein the real charge and discharge times are the sum of the first real-time charge and discharge times and the second real-time charge and discharge times in the nonvolatile memory.
16. An electronic device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs comprising instructions that, when executed by the electronic device, cause the electronic device to perform the charge-discharge number recording method of any of claims 1-14.
17. A computer-readable storage medium, in which a computer program is stored which, when executed by a processor, causes the processor to perform the charge-discharge number recording method according to any one of claims 1 to 14.
CN202211188224.0A 2022-09-28 2022-09-28 Method and device for recording charge and discharge times, electronic equipment and readable storage medium Active CN116707050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211188224.0A CN116707050B (en) 2022-09-28 2022-09-28 Method and device for recording charge and discharge times, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211188224.0A CN116707050B (en) 2022-09-28 2022-09-28 Method and device for recording charge and discharge times, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN116707050A CN116707050A (en) 2023-09-05
CN116707050B true CN116707050B (en) 2024-04-12

Family

ID=87829949

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211188224.0A Active CN116707050B (en) 2022-09-28 2022-09-28 Method and device for recording charge and discharge times, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116707050B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1858805A (en) * 2005-12-17 2006-11-08 华为技术有限公司 Method for recording cell work information, cell and its electronic product and charger
CN101286651A (en) * 2007-02-14 2008-10-15 株式会社电装 Charge control device for batteries
CN107910607A (en) * 2017-11-22 2018-04-13 北京新能源汽车股份有限公司 Method and device for correcting SOH (state of health) of battery, electric vehicle and storage medium
CN110148992A (en) * 2019-06-25 2019-08-20 无锡睿勤科技有限公司 A kind of charge control method, terminal device and storage medium
CN110176795A (en) * 2019-05-30 2019-08-27 Oppo广东移动通信有限公司 Charging method and device, charging system, electronic equipment, storage medium
CN110429672A (en) * 2019-07-15 2019-11-08 百富计算机技术(深圳)有限公司 Battery charging management method, terminal device and storage medium
CN113839438A (en) * 2021-08-19 2021-12-24 荣耀终端有限公司 Battery recharging protection method and electronic equipment
CN114665526A (en) * 2020-12-24 2022-06-24 九号智能(常州)科技有限公司 Control method and device for battery charging and discharging, server and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102906961B (en) * 2010-05-21 2016-01-13 奇诺沃公司 Give the Method and circuits system of battery/battery unit charging adaptively

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1858805A (en) * 2005-12-17 2006-11-08 华为技术有限公司 Method for recording cell work information, cell and its electronic product and charger
CN101286651A (en) * 2007-02-14 2008-10-15 株式会社电装 Charge control device for batteries
CN107910607A (en) * 2017-11-22 2018-04-13 北京新能源汽车股份有限公司 Method and device for correcting SOH (state of health) of battery, electric vehicle and storage medium
CN110176795A (en) * 2019-05-30 2019-08-27 Oppo广东移动通信有限公司 Charging method and device, charging system, electronic equipment, storage medium
CN110148992A (en) * 2019-06-25 2019-08-20 无锡睿勤科技有限公司 A kind of charge control method, terminal device and storage medium
CN110429672A (en) * 2019-07-15 2019-11-08 百富计算机技术(深圳)有限公司 Battery charging management method, terminal device and storage medium
CN114665526A (en) * 2020-12-24 2022-06-24 九号智能(常州)科技有限公司 Control method and device for battery charging and discharging, server and storage medium
CN113839438A (en) * 2021-08-19 2021-12-24 荣耀终端有限公司 Battery recharging protection method and electronic equipment

Also Published As

Publication number Publication date
CN116707050A (en) 2023-09-05

Similar Documents

Publication Publication Date Title
CN113905179B (en) Method for switching cameras by terminal and terminal
CN114422340B (en) Log reporting method, electronic equipment and storage medium
CN113254409B (en) File sharing method, system and related equipment
CN114079893B (en) Bluetooth communication method, terminal device and computer readable storage medium
CN113973398B (en) Wireless network connection method, electronic equipment and chip system
CN114915747B (en) Video call method, electronic device and readable storage medium
US11792631B2 (en) Emergency call method and user terminal
CN117014859A (en) Address book-based device discovery method, audio and video communication method and electronic device
CN114554012B (en) Incoming call answering method, electronic equipment and storage medium
CN116389884B (en) Thumbnail display method and terminal equipment
CN116055859B (en) Image processing method and electronic device
CN114173286B (en) Method and device for determining test path, electronic equipment and readable storage medium
CN114765768B (en) Network selection method and device
CN116707050B (en) Method and device for recording charge and discharge times, electronic equipment and readable storage medium
CN114466238B (en) Frame demultiplexing method, electronic device and storage medium
CN116709220B (en) Network connection method, network connection device, electronic equipment and computer readable storage medium
CN116719376B (en) Voltage control method, device, equipment and storage medium
CN115460445B (en) Screen projection method of electronic equipment and electronic equipment
CN116346982B (en) Method for processing audio, electronic device and readable storage medium
CN115734323B (en) Power consumption optimization method and device
CN115495716B (en) Local authentication method and electronic equipment
CN114520870B (en) Display method and terminal
CN117390604B (en) Local authentication method and electronic equipment
CN116321265B (en) Network quality evaluation method, electronic device and storage medium
CN116095223B (en) Notification display method and terminal device

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