Battery offline detection method and device, electronic equipment and storage medium
By defining a preset hysteresis voltage range in battery offline detection, avoiding abnormal battery offline caused by external interference, the problem of battery access determination in the prior art is solved, and the stability and reliability of the system are improved .
Patent Information
- Application Number
- CN202411380370.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2024-12-31
AI Technical Summary
In the prior art, the determination of whether the battery is connected to the system depends solely on the voltage detected by the pin pin of the IC, which is susceptible to external interference and causes abnormal shutdown of the computer.
By defining the preset hysteresis voltage range, determine whether high and low level conversion is required. If the voltage of the detection pin is within this range, it will remain in its original state to avoid abnormal battery offline caused by external interference.
It effectively overcomes the abnormal offline problem caused by external interference of the battery, improves the abnormal shutdown of the computer, and improves the stability and reliability of the system.
Smart Images

Figure CN119224606A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of consumer products, and specifically relates to a battery offline detection method, device, electronic device and storage medium. Background Art
[0002] At present, the industry has clear regulations on whether the battery is allowed to discharge, and the basis for judgment is whether the battery is connected to the system. The judgment of whether the battery is connected to the system only relies on the voltage detected by the pin of the IC (Integrated Circuit) as the basis for judgment. The current detection method is easily affected by external interference, which may cause the computer to shut down abnormally. Summary of the invention
[0003] Purpose of the invention: The present application discloses a battery offline detection method, device, electronic device and storage medium, aiming to solve the problem of abnormal offline of the battery due to external interference.
[0004] Technical solution: In a first aspect, an embodiment of the present application provides a battery offline detection method, wherein the battery is connected to an electronic device and discharges to the electronic device, the electronic device has a detection pin, and the detection pin is connected to the battery, the method comprising:
[0005] Determine that the initial level of the detection pin is a first level;
[0006] If the real-time voltage of the detection pin is within the preset hysteresis voltage range, confirming that the level state of the detection pin maintains the first level;
[0007] If the real-time voltage of the detection pin meets the preset switching condition, the level state of the detection pin is controlled to switch from the first level to the second level, the second level is different from the first level, and the second level is used to indicate that the battery is in an offline state.
[0008] In some embodiments, the first level is a low level, and the second level is a high level; the preset hysteresis voltage range includes a first voltage threshold and a second voltage threshold, and the second voltage threshold is greater than the first voltage threshold;
[0009] Determining that the initial level of the detection pin is a first level includes:
[0010] Get the initial voltage of the detection pin;
[0011] If the initial voltage of the detection pin is less than the first voltage threshold, it is determined that the initial level of the detection pin is the first level.
[0012] In some embodiments, after the step of confirming that the level state of the detection pin maintains the first level, the method further includes:
[0013] If the real-time voltage of the detection pin is less than the first voltage threshold, it is confirmed that the level state of the detection pin maintains the first level.
[0014] In some embodiments, the preset switching condition includes that the real-time voltage of the detection pin is greater than a second voltage threshold; determining that the real-time voltage of the detection pin satisfies the preset switching condition includes:
[0015] When the real-time voltage of the detection pin is greater than the second voltage threshold, it is determined that the real-time voltage of the detection pin meets the preset switching condition.
[0016] In some embodiments, the first level is a high level, and the second level is a low level; the preset hysteresis voltage range includes a first voltage threshold and a second voltage threshold, and the second voltage threshold is greater than the first voltage threshold;
[0017] Determining that the initial level of the detection pin is a first level includes:
[0018] Get the initial voltage of the detection pin;
[0019] If the initial voltage of the detection pin is greater than the second voltage threshold, it is determined that the initial level of the detection pin is the first level.
[0020] In some embodiments, after the step of confirming that the level state of the detection pin maintains the first level, the method further includes:
[0021] If the real-time voltage of the detection pin is greater than the second voltage threshold, it is confirmed that the level state of the detection pin maintains the first level.
[0022] In some embodiments, the preset switching condition includes that the real-time voltage of the detection pin is less than a first voltage threshold; determining that the real-time voltage of the detection pin satisfies the preset switching condition includes:
[0023] When the real-time voltage of the detection pin is less than the first voltage threshold, it is determined that the real-time voltage of the detection pin meets the preset switching condition.
[0024] In a second aspect, an embodiment of the present application provides a battery offline detection device, wherein the battery is connected to an electronic device and discharges to the electronic device, the electronic device has a detection pin, and the detection pin is connected to the battery, and the device includes:
[0025] A determination module, used to determine that the initial level of the detection pin is a first level, used to determine that the real-time voltage of the detection pin is within a preset hysteresis voltage range, and used to determine that the real-time voltage of the detection pin meets a preset switching condition;
[0026] The control module is used to confirm that the level state of the detection pin maintains the first level, and is used to control the detection pin to switch from the first level to the second level.
[0027] In a third aspect, an embodiment of the present application provides an electronic device, wherein the electronic device is connected to a battery, the battery discharges to the electronic device, the electronic device has a detection pin, the detection pin is connected to the battery, the electronic device includes a memory and at least one processor, the memory stores instructions, the processor calls the instructions in the memory, so that the electronic device executes any of the above-mentioned battery offline detection methods.
[0028] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of any of the above-mentioned battery offline detection methods are implemented.
[0029] Beneficial effects:
[0030] Multiple embodiments of the present application have one of the following beneficial effects: in the present application, a battery is connected to an electronic device and discharges to the electronic device, the electronic device has a detection pin, and the detection pin is connected to the battery; the present application determines that the initial level of the detection pin is a first level; if the real-time voltage of the detection pin is within a preset hysteresis voltage range, it is confirmed that the level state of the detection pin maintains the first level; if the real-time voltage of the detection pin meets the preset switching condition, the detection pin is controlled to switch from the first level to the second level, the second level is different from the first level, and the second level is used to characterize that the battery is in an offline state; the present application determines whether a high-low level conversion is required by a preset hysteresis voltage range. If the voltage of the detection pin is within this preset hysteresis voltage range, the high-low level conversion will not be performed, but the original level state will be maintained unchanged, thereby overcoming the problem of abnormal offline of the battery due to external interference, thereby improving the situation of abnormal computer shutdown. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0032] Figure 1 An overall flow chart of the battery offline detection method provided in an embodiment of the present application;
[0033] Figure 2 A flow chart of the steps for determining the first level when the first level of the battery offline detection method provided in an embodiment of the present application is a low level;
[0034] Figure 3 A specific flow chart of the battery offline detection method provided in an embodiment of the present application when the first level is a low level;
[0035] Figure 4A specific flow chart of the battery offline detection method provided in an embodiment of the present application when the first level is a high level;
[0036] Figure 5 A simple logic circuit diagram between the detection pin and the IC of the battery offline detection method provided in an embodiment of the present application;
[0037] Figure 6 A specific flow chart of the battery offline detection method provided in the embodiment of the present application;
[0038] Figure 7 Another specific flow chart of the battery offline detection method provided in the embodiment of the present application;
[0039] Figure 8 A schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
[0040] Reference numerals: 510 - switch; 520 - detection pin; 810 - memory; 820 - processor; 830 - communication interface; 840 - bus. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0042] It should be understood that although the terms first, second, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the concepts of the present application. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.
[0043] Those skilled in the art will appreciate that the drawings are only schematic diagrams of example embodiments and may not be to scale. The modules or processes in the drawings are not necessarily required to implement the present application and therefore cannot be used to limit the scope of protection of the present application.
[0044] At present, the industry stipulates whether the battery is allowed to discharge based on whether the battery is connected to the system. The system consists of batteries and electronic devices. Discharging is allowed only when the battery is determined to be connected to the input terminal of the electronic device. Otherwise, the battery's C / D-MOS (Cascaded / Differential Metal-Oxide-Semiconductor) will be turned off.
[0045] However, the determination of whether the battery is connected to the system is based solely on the voltage detected by the pin of the IC connected to the input terminal of the electronic device. Due to the limitation of the hardware process technology, the high and low level conversion of the pin is not a uniform value, and can only guarantee a certain voltage value within a certain range.
[0046] When the voltage of the pin exceeds or falls below the threshold of the high-low level conversion, the high and low levels will be converted immediately. This may cause some problems. For example, if the battery has been connected to the input of the electronic device, but the pin voltage is abnormal due to external interference, it may trigger the computer to go offline abnormally, causing user complaints.
[0047] In view of this, an embodiment of the present application provides a battery offline detection method, which determines whether a high-low level conversion is required by preset a hysteresis voltage range. If the voltage detected by the detection pin is within this preset hysteresis voltage range, the high-low level conversion will not be performed, but the original state will be maintained without change. That is, even if the interference reaches the point where the pin high-low level conversion occurs, the pin will maintain the original level unchanged, thereby overcoming the problem of abnormal offline of the battery due to external interference, and further improving the situation of abnormal shutdown of the computer, so as to solve at least part of the above-mentioned technical problems.
[0048] See also Figure 1 , Figure 1 The overall process of a battery offline detection method provided in an embodiment of the present application. The battery is connected to an electronic device and discharges to the electronic device. The electronic device has a detection pin, and the detection pin is connected to the battery. The method includes the following steps:
[0049] Step 101: Determine that the initial level of the detection pin is a first level.
[0050] In step 101, it is necessary to first obtain the initial level of the detection pin. The detection pin is a pin connected to the IC of the electronic device, and the voltage detected by the detection pin is the basis for judging whether the battery is connected to the electronic device. The initial level of the detection pin can be the voltage detected by the detection pin before the battery is powered on after the IC leaves the factory, or the voltage detected by the detection pin when the electronic device is just powered on.
[0051] It should be noted that when the initial level of the detection pin is the voltage detected by the detection pin before the battery is powered on, the detection pin is at a low level, that is, the initial level of the detection pin is a first level, and the first level is a low level. Such a setting can ensure that when the battery is not powered on, the detection pin is in a known state so that the IC can correctly process and respond to input signals. When the initial level of the detection pin is the voltage detected by the detection pin when the electronic device is just powered on, the detection pin is at a low level or a high level, that is, the initial level of the detection pin is a first level, and the first level is a low level or a high level.
[0052] Step 102: If the real-time voltage of the detection pin is within the preset hysteresis voltage range, confirm that the level state of the detection pin maintains the first level.
[0053] Among them, electrical specification parameters play a key role in the design and manufacturing process of integrated circuits (ICs). Among them, the level threshold is an important indicator in the electrical specification parameters, which is used to determine the switching conditions of high and low levels. The level threshold refers to the voltage level that is identified as a high level or a low level in the input signal. When the real-time voltage of the detection pin is within the preset hysteresis voltage range, that is, between the high level threshold and the low level threshold, the IC will determine that the level state of the detection pin is the first level. The preset hysteresis voltage range is determined by the electrical specification parameters that come with the IC when it leaves the factory. This range is usually determined during the design and manufacturing process based on the characteristics and application requirements of the IC. It takes into account factors such as the operating voltage range, noise tolerance, and stability of the IC to ensure reliable level switching and signal processing. By using the preset hysteresis voltage range, the IC can provide a certain tolerance when the input signal fluctuates or noise exists, avoiding misjudgment and unstable level states. This ensures the reliability and stability of the IC under various environmental conditions, thereby achieving accurate signal processing and functional operation.
[0054] In some embodiments, the preset hysteresis voltage range includes a first voltage threshold and a second voltage threshold, which are two boundary values of the preset hysteresis voltage range and are used to determine the switching conditions of the high and low levels. The first voltage threshold is one of the level thresholds in the electrical specification parameters of the IC. It represents the voltage level that is identified as a low level in the input signal. When the real-time voltage of the detection pin is lower than the first voltage threshold, the IC will determine that the level state of the detection pin is a low level. The second voltage threshold is also one of the level thresholds in the electrical specification parameters of the IC. It represents the voltage level that is identified as a high level in the input signal. When the real-time voltage of the detection pin is higher than the second voltage threshold, the IC will determine that the level state of the detection pin is a high level.
[0055] It should be noted that the second voltage threshold is usually greater than the first voltage threshold, in order to ensure that there is a sufficient hysteresis range during level switching to avoid misjudgment and unstable level state caused by fluctuations or noises of the input signal.
[0056] By defining a preset hysteresis voltage range and using a first voltage threshold and a second voltage threshold, the IC can provide a certain tolerance to adapt to different input signal conditions and environmental noise, thereby ensuring the reliability and stability of the IC in various situations, thereby achieving accurate level switching and signal processing.
[0057] In some embodiments, when the battery of the electronic device is not powered, the initial level of the detection pin is determined by the voltage of the detection pin. Typically, this initial level is defined as a first level, i.e., a low level. Such a setting can ensure that when the battery is not powered, the detection pin is in a known state so that the IC can correctly process and respond to input signals.
[0058] When the electronic device is powered on, the real-time voltage of the detection pin will change according to the change of the input signal. Within the preset hysteresis voltage range, that is, between the first voltage threshold and the second voltage threshold, the IC will determine that the level state of the detection pin is low. This setting allows a certain tolerance to adapt to fluctuations, noise or interference in the input signal, thereby ensuring accurate recognition and processing of low-level signals.
[0059] By defining a preset hysteresis voltage range and setting the initial level to the first level, a stable and reliable level state determination can be provided when the battery is not powered and after the electronic device is powered on. This setting helps ensure the normal operation and reliability of the system and avoids misjudgment and unstable level states caused by voltage changes or environmental noise during the power startup process.
[0060] In some embodiments, when the electronic device is just powered on, the detection pin detects a specific voltage, which is defined as the initial level of the detection pin. Typically, this initial level is called the first level, i.e., a low level. Such a setting can ensure that the detection pin is in a known state when the electronic device is just powered on, so that the IC can correctly process and respond to input signals.
[0061] When the electronic device is powered on, the real-time voltage of the detection pin will change with the input signal. Within the preset hysteresis voltage range, that is, between the first voltage threshold and the second voltage threshold, the IC will determine that the level state of the detection pin is low. This setting allows a certain tolerance to accommodate fluctuations, noise or interference in the input signal, thereby ensuring accurate recognition and processing of low-level signals.
[0062] By defining a preset hysteresis voltage range and setting the initial level to the first level, a stable and reliable level state determination can be provided when the electronic device is just powered on and after it is powered on. This setting helps ensure the normal operation and reliability of the system and avoids misjudgment and unstable level states caused by voltage changes or environmental noise during the power startup process.
[0063] In some embodiments, when the electronic device is just powered on, the detection pin detects a specific voltage, which is defined as the initial level of the detection pin. Different from the previous description, this initial level is set to the first level, that is, the high level. Such a setting can ensure that the detection pin is in a known state when the electronic device is just powered on, so that the IC can correctly process and respond to the input signal.
[0064] When the electronic device is powered on, the real-time voltage of the detection pin will change with the input signal. Within the preset hysteresis voltage range, that is, between the first voltage threshold and the second voltage threshold, the IC will determine that the level state of the detection pin is high. This setting allows a certain tolerance to adapt to fluctuations, noise or interference in the input signal, thereby ensuring accurate recognition and processing of high-level signals.
[0065] By defining a preset hysteresis voltage range and setting the initial level to the first level, a stable and reliable level state determination can be provided when the electronic device is just powered on and after it is powered on. This setting helps ensure the normal operation and reliability of the system and avoids misjudgment and unstable level states caused by voltage changes or environmental noise during the power startup process.
[0066] Step 103: If the real-time voltage of the detection pin meets the preset switching condition, the level state of the detection pin is controlled to switch from the first level to the second level, where the second level is different from the first level and is used to indicate that the battery is in an offline state.
[0067] The preset switching condition is that the real-time voltage of the detection pin is greater than the second voltage threshold or the real-time voltage of the detection pin is less than the first voltage threshold.
[0068] In some embodiments, when the battery is not powered, the initial level of the detection pin is set to a first level, and the first level is a low level. Such a setting can ensure that the detection pin is in a known state when the battery is not connected or powered, so that the IC can correctly process and respond to input signals. The preset switching condition is based on the comparison of the real-time voltage of the detection pin with the second voltage threshold. If the real-time voltage of the detection pin is greater than the second voltage threshold, it will be determined that the switching condition is met. When the preset switching condition is met, the corresponding control operation is performed to switch the level state of the detection pin from the first level to the second level. This switching can be used to indicate that the battery is in an offline state, that is, the battery is not connected or powered.
[0069] By defining a suitable second voltage threshold and preset switching conditions, the connection status of the battery can be accurately determined, and the level state of the detection pin can be changed accordingly. This can provide accurate battery status information and help the IC to perform corresponding processing and control to ensure the normal operation of the electronic device and the effective management of the battery.
[0070] In some embodiments, when the electronic device is just powered on, the detection pin detects a specific voltage, which is defined as the initial level of the detection pin. According to the description, the initial level is set to a first level, and the first level is a low level. Such a setting can ensure that the detection pin is in a known state when the electronic device is just powered on, so that the IC can correctly process and respond to the input signal. The preset switching condition is based on the comparison between the real-time voltage of the detection pin and the second voltage threshold. If the real-time voltage of the detection pin is greater than the second voltage threshold, it will be determined that the switching condition is met. When the preset switching condition is met, the corresponding control operation is performed to switch the level state of the detection pin from the first level to the second level. This switching can be used to indicate that the battery is in an offline state, that is, the battery is not connected or powered on.
[0071] By defining a suitable second voltage threshold and preset switching conditions, the connection status of the battery can be accurately determined, and the level state of the detection pin can be changed accordingly. This can provide accurate battery status information and help the IC to perform corresponding processing and control to ensure the normal operation of the electronic device and the effective management of the battery.
[0072] In some embodiments, when the electronic device is just powered on, the detection pin detects a specific voltage, which is defined as the initial level of the detection pin. According to the description, the initial level is set to a first level, and the first level is a high level. Such a setting can ensure that the detection pin is in a known state when the electronic device is just powered on, so that the IC can correctly process and respond to the input signal. The preset switching condition is based on the comparison between the real-time voltage of the detection pin and the first voltage threshold. If the real-time voltage of the detection pin is less than the first voltage threshold, it will be determined that the switching condition is met. When the preset switching condition is met, the corresponding control operation is performed to switch the level state of the detection pin from the first level to the second level. This switching can be used to indicate that the battery is in an offline state, that is, the battery is not connected or powered on.
[0073] By defining a suitable first voltage threshold and preset switching conditions, the connection status of the battery can be accurately determined, and the level state of the detection pin can be changed accordingly. This can provide accurate battery status information and help the IC to perform corresponding processing and control to ensure the normal operation of the electronic device and the effective management of the battery.
[0074] In view of this, the present embodiment has a determination of the first level, and when the real-time voltage of the detection pin is within the preset hysteresis voltage range, the level state of the detection pin will not switch, and will be maintained at the first level. Such a design takes into account other possible electrical signal interference to avoid abnormal battery offline due to voltage fluctuations. If the first level is a low level, the second level is a high level, and when the real-time voltage of the detection pin exceeds the second voltage threshold, the switching of high and low levels will occur, and the battery will be in an offline state. That is, when the detection pin is interfered by other electrical signals and the voltage of the detection pin fluctuates, the switching of high and low levels will not occur immediately, that is, the battery will not be abnormally offline, and when the voltage of the detection pin is greater than the second voltage threshold, the battery will be offline. If the first level is a high level, the second level is a low level, and when the real-time voltage of the detection pin is lower than the first voltage threshold, the switching of high and low levels will occur, and the battery will be in an offline state. That is, when the detection pin is interfered by other electrical signals and the voltage of the detection pin fluctuates, the high and low levels will not be switched immediately, that is, the battery will not be abnormally offline, and the battery will be offline only when the voltage of the detection pin is less than the first voltage threshold. Through this design, the present embodiment can effectively avoid voltage fluctuations caused by interference from other electrical signals during actual use, thereby avoiding abnormal offline conditions of the battery. This can improve the stability and reliability of the system, ensure that the electronic equipment can operate normally and effectively manage the status of the battery.
[0075] In some embodiments, see Figure 2 , Figure 2The present invention illustrates the steps for determining the first level when the first level of a battery offline detection method provided by an embodiment of the present application is a low level. The first level is a low level, and the second level is a high level; the preset hysteresis voltage range includes a first voltage threshold and a second voltage threshold, and the second voltage threshold is greater than the first voltage threshold.
[0076] Determining that the initial level of the detection pin is a first level includes the following steps:
[0077] Step 201: Obtaining the initial voltage of the detection pin;
[0078] Before the electronic device is powered on or just after it is powered on, measure the initial voltage of the detection pin.
[0079] Step 202: If the initial voltage of the detection pin is less than the first voltage threshold, determine that the initial level of the detection pin is a first level.
[0080] The measured initial voltage of the detection pin is compared with the first voltage threshold. If the initial voltage is less than the first voltage threshold, it is determined that the initial level of the detection pin is the first level, that is, a low level.
[0081] In view of this, through these steps, the initial level of the detection pin can be accurately determined. Such a setting helps the IC to correctly process and respond to input signals when the electronic device is just powered on, and provides an accurate basis for subsequent operations and controls. In implementation, it is necessary to select a suitable first voltage threshold according to specific application requirements and the characteristics of the electronic device. This ensures that the initial level of the detection pin can be accurately determined, and corresponding operations and controls can be performed as needed.
[0082] In some embodiments, see Figure 3 , Figure 3 The specific process of a battery offline detection method provided by an embodiment of the present application when the first level is a low level is illustrated. After the step of confirming that the level state of the detection pin maintains the first level, the embodiment further includes:
[0083] Step 104: If the real-time voltage of the detection pin is less than the first voltage threshold, confirm that the level state of the detection pin maintains the first level.
[0084] That is, when it is determined that the initial level of the detection pin is the first level and the first level is a low level, even during use, the real-time voltage of the detection pin is lower than the first voltage threshold, the level state of the detection pin remains in a low level state, and it will not trigger high and low level switching, that is, the battery will not go offline.
[0085] In view of this, when it is determined that the initial level of the detection pin is the first level and the first level is a low level, this embodiment can ensure that even if the voltage of the detection pin is lower than the first voltage threshold during use, the switching of the high and low levels will not be triggered immediately, thereby avoiding the abnormal offline of the battery. This design takes into account the misjudgment that may be caused by voltage fluctuations and interference, and ensures the stability and reliability of the system.
[0086] In some embodiments, see Figure 4 , Figure 4 The specific process of a battery offline detection method provided by an embodiment of the present application when the first level is a high level is illustrated. After the step of confirming that the level state of the detection pin maintains the first level, the present embodiment further includes:
[0087] Step 105: If the real-time voltage of the detection pin is greater than the second voltage threshold, confirm that the level state of the detection pin maintains the first level.
[0088] That is, when it is determined that the initial level of the detection pin is the first level and the first level is a high level, even during use, the real-time voltage of the detection pin is greater than the second voltage threshold, the level state of the detection pin remains in a high level state, and it will not trigger high and low level switching, that is, the battery will not go offline.
[0089] In view of this, when it is determined that the initial level of the detection pin is the first level and the first level is a high level, this embodiment can ensure that even if the voltage of the detection pin is greater than the second voltage threshold during use, the switching of the high and low levels will not be triggered immediately, thereby avoiding the abnormal offline of the battery. This design takes into account the misjudgment that may be caused by voltage fluctuations and interference, and ensures the stability and reliability of the system.
[0090] In some embodiments, see Figure 5 , Figure 5 A simple logic circuit between a detection pin and an IC of a battery offline detection method provided in an embodiment of the present application is illustrated. A switch 510 is provided on the circuit connecting the detection pin 520 and the electronic device, and one end of the switch 510 is grounded. When the detection pin 520 undergoes a high-low level conversion, the switch 510 receives a signal to close, and the battery is offline and does not discharge. When the switch 510 is in the open state, the battery can discharge normally.
[0091] In some embodiments, see Figure 6 , Figure 6 The specific process of a battery offline detection method provided in an embodiment of the present application is illustrated. The specific steps are as follows:
[0092] Determine whether the current voltage of the detection pin is less than the first voltage threshold, if so, the level state of the detection pin is at a low level, if not, proceed to the next step;
[0093] It is determined whether the current voltage of the detection pin is within a preset hysteresis voltage range. If not, the current voltage of the detection pin is greater than a second threshold value, and the level state of the detection pin is at a high level.
[0094] If the current voltage of the detection pin does not satisfy the condition that it is less than the first voltage threshold, it is determined whether the current voltage of the detection pin is within the preset hysteresis voltage range. If so, it is determined whether the level state of the detection pin is at a low level before the current voltage of the detection pin is within the preset hysteresis voltage range.
[0095] If it is at a low level, the level state of the detection pin is at a low level, and if it is at a high level, the level state of the detection pin is at a high level.
[0096] In some embodiments, see Figure 7 , Figure 7 Another specific process of a battery offline detection method provided in an embodiment of the present application is illustrated. The specific steps are as follows:
[0097] Determine whether the current voltage of the detection pin is greater than the second voltage threshold, if so, the level state of the detection pin is at a high level, if not, proceed to the next step;
[0098] It is determined whether the current voltage of the detection pin is within a preset hysteresis voltage range. If not, the current voltage of the detection pin is less than a first voltage threshold, and the level state of the detection pin is at a low level.
[0099] If the current voltage of the detection pin does not satisfy the condition that it is greater than the second voltage threshold, it is determined whether the current voltage of the detection pin is within the preset hysteresis voltage range. If so, it is determined whether the level state of the detection pin is at a low level before the current voltage of the detection pin is within the preset hysteresis voltage range.
[0100] If it is at a low level, the level state of the detection pin is at a low level, and if it is at a high level, the level state of the detection pin is at a high level.
[0101] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and does not constitute any limitation on the implementation process of the embodiments of the present application.
[0102] Accordingly, an embodiment of the present application further provides a battery offline detection device, wherein the battery is connected to an electronic device and discharges to the electronic device, the electronic device has a detection pin, and the detection pin is connected to the battery, and the device comprises:
[0103] A determination module, used to determine that the initial level of the detection pin is a first level, used to determine that the real-time voltage of the detection pin is within a preset hysteresis voltage range, and used to determine that the real-time voltage of the detection pin meets a preset switching condition;
[0104] The control module is used to confirm that the level state of the detection pin maintains the first level, and is used to control the detection pin to switch from the first level to the second level.
[0105] The device adopts the battery offline detection method in any of the above embodiments to prevent abnormal battery offline. Since the battery offline detection method is described in detail above, it will not be repeated here.
[0106] Accordingly, an embodiment of the present application further provides an electronic device, the electronic device is connected to a battery, the battery discharges to the electronic device, the electronic device has a detection pin, and the detection pin is connected to the battery. Figure 8 , Figure 8 The hardware structure of an electronic device provided by an embodiment of the present application is illustrated. The electronic device includes a memory 810 and at least one processor 820, the memory 810 stores instructions, and the at least one processor 820 calls the instructions in the memory 810, so that the electronic device executes the battery offline detection method according to any of the aforementioned embodiments of the present application.
[0107] Specifically, the processor 820 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0108] The memory 810 may include a large capacity memory 810 for data or instructions. By way of example and not limitation, the memory 810 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. In appropriate cases, the memory 810 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 810 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 810 is a non-volatile solid-state memory. In a specific embodiment, the memory 810 includes a read-only memory (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM), or a flash memory, or a combination of two or more of these.
[0109] In some embodiments, the electronic device may further include a communication interface 830 and a bus 840. The processor 820, the memory 810, and the communication interface 830 are connected via the bus 840 and communicate with each other.
[0110] The communication interface 830 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0111] Bus 840 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-end bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory 810 bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 840 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.
[0112] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. The above-mentioned computer-readable storage medium stores one or more programs. The above-mentioned one or more programs can be executed by one or more processors and applied to a battery cell detection system. The computer program implements the battery cell detection method as described above.
[0113] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0114] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a central processing unit, a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, and the embodiments of the present application are not specifically limited.
[0115] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0116] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0117] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.
[0118] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
[0119] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0120] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0121] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0122] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.
[0123] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0124] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A battery offline detection method, characterized in that: The battery is connected to an electronic device and discharges to the electronic device, the electronic device has a detection pin, and the detection pin is connected to the battery. The method includes: Determining that the initial level of the detection pin is a first level; If the real-time voltage of the detection pin is within the preset hysteresis voltage range, confirming that the level state of the detection pin maintains the first level; If the real-time voltage of the detection pin meets the preset switching condition, the level state of the detection pin is controlled to switch from the first level to a second level, the second level is different from the first level, and the second level is used to indicate that the battery is in an offline state.
2. A battery offline detection method as claimed in claim 1, characterized in that: The first level is a low level, and the second level is a high level; the preset hysteresis voltage range includes a first voltage threshold and a second voltage threshold, and the second voltage threshold is greater than the first voltage threshold; Determining that the initial level of the detection pin is a first level includes: Obtaining the initial voltage of the detection pin; If the initial voltage of the detection pin is less than the first voltage threshold, the initial level of the detection pin is determined to be the first level.
3. A battery offline detection method as claimed in claim 2, characterized in that: After the step of confirming that the level state of the detection pin maintains the first level, the method further includes: If the real-time voltage of the detection pin is less than the first voltage threshold, it is confirmed that the level state of the detection pin maintains the first level.
4. A battery offline detection method as claimed in claim 2, characterized in that: The preset switching condition includes that the real-time voltage of the detection pin is greater than the second voltage threshold; Determining that the real-time voltage of the detection pin meets the preset switching condition includes: When the real-time voltage of the detection pin is greater than the second voltage threshold, it is determined that the real-time voltage of the detection pin meets the preset switching condition.
5. A battery offline detection method as claimed in claim 1, characterized in that: The first level is a high level, and the second level is a low level; the preset hysteresis voltage range includes a first voltage threshold and a second voltage threshold, and the second voltage threshold is greater than the first voltage threshold; Determining that the initial level of the detection pin is a first level includes: Obtaining the initial voltage of the detection pin; If the initial voltage of the detection pin is greater than the second voltage threshold, the initial level of the detection pin is determined to be the first level.
6. A battery offline detection method as claimed in claim 5, characterized in that: After the step of confirming that the level state of the detection pin maintains the first level, the method further includes: If the real-time voltage of the detection pin is greater than the second voltage threshold, it is confirmed that the level state of the detection pin maintains the first level.
7. A battery offline detection method as claimed in claim 5, characterized in that: The preset switching condition includes that the real-time voltage of the detection pin is less than the first voltage threshold; Determining that the real-time voltage of the detection pin meets a preset switching condition includes: When the real-time voltage of the detection pin is less than the first voltage threshold, it is determined that the real-time voltage of the detection pin meets the preset switching condition.
8. A battery offline detection device, characterized in that: The battery is connected to an electronic device and discharges to the electronic device. The electronic device has a detection pin, and the detection pin is connected to the battery. The device includes: a determination module, used to determine that the initial level of the detection pin is a first level, used to determine that the real-time voltage of the detection pin is within a preset hysteresis voltage range, and used to determine that the real-time voltage of the detection pin satisfies a preset switching condition; The control module is used to confirm that the level state of the detection pin maintains the first level, and is used to control the detection pin to switch from the first level to a second level.
9. An electronic device, characterized in that: The electronic device is connected to a battery, the battery discharges to the electronic device, the electronic device has a detection pin, the detection pin is connected to the battery, the electronic device includes a memory and at least one processor, the memory stores instructions, the processor calls the instructions in the memory, so that the electronic device executes the battery offline detection method as described in any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the battery offline detection method according to any one of claims 1 to 7 are implemented.
