CN115587005A - Battery plugging and unplugging state monitoring method, device, equipment and medium - Google Patents

Battery plugging and unplugging state monitoring method, device, equipment and medium Download PDF

Info

Publication number
CN115587005A
CN115587005A CN202211055988.2A CN202211055988A CN115587005A CN 115587005 A CN115587005 A CN 115587005A CN 202211055988 A CN202211055988 A CN 202211055988A CN 115587005 A CN115587005 A CN 115587005A
Authority
CN
China
Prior art keywords
state
battery
plugging
interrupt signal
pin
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211055988.2A
Other languages
Chinese (zh)
Inventor
陈言教
黄玉龙
刘清林
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology 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 Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202211055988.2A priority Critical patent/CN115587005A/en
Publication of CN115587005A publication Critical patent/CN115587005A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a battery plugging and unplugging state monitoring method, device, equipment and medium, comprising the following steps: receiving an off-site interrupt signal sent when the CPLD detects that the battery standby power unit is pulled out or an on-site interrupt signal sent when the CPLD detects that the battery standby power unit is inserted; marking a first unplugged state based on the out-of-bit interrupt signal or the in-bit interrupt signal; periodically acquiring the pin state of an in-place pin corresponding to the battery standby power unit, and executing a corresponding processing strategy based on the first plug-in state and the pin state; the position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted. Therefore, the plugging state of the battery power backup unit can be accurately identified and correspondingly processed, so that the normal operation of the battery power backup unit is guaranteed.

Description

Battery plugging and unplugging state monitoring method, device, equipment and medium
Technical Field
The present application relates to the field of battery plugging/unplugging status monitoring technologies, and in particular, to a method, an apparatus, a device, and a medium for monitoring a battery plugging/unplugging status.
Background
A BBU (Battery Backup Unit) is often used by a storage server as a power supply device for data Backup after power failure, and the effective in-place position of the BBU is a first step requirement for normal operation of a storage service. As a pluggable device, a BBU has a plugging and replacing scenario during the operation of a memory system, so how to effectively identify and process the plugging and unplugging actions and ensure the normal operation of the BBU is a problem to be solved at present.
Disclosure of Invention
In view of this, an object of the present application is to provide a method, an apparatus, a device and a medium for monitoring a battery plugging/unplugging state, which can accurately identify a plugging/unplugging state of a battery backup unit and perform corresponding processing, thereby ensuring normal operation of the battery backup unit. The specific scheme is as follows:
in a first aspect, the present application discloses a battery plugging/unplugging state monitoring method, including:
receiving an out-of-position interrupt signal sent when the CPLD detects that the battery standby power unit is pulled out or an in-position interrupt signal sent when the CPLD detects that the battery standby power unit is inserted;
marking a first unplugging state based on the no-bit interrupt signal or the in-bit interrupt signal;
periodically acquiring the pin state of an in-place pin corresponding to the battery standby power unit, and executing a corresponding processing strategy based on the first plug-in state and the pin state; the position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted.
Optionally, the marking a first unplugging and plugging state based on the off-bit interrupt signal or the on-bit interrupt signal includes:
if an off-position interrupt signal is received, marking the first plugging state as a first preset value;
if an in-place interrupt signal is received and the first plugging state is the first preset value, marking the first plugging state as a second preset value;
and if an in-place interrupt signal is received and the first plugging state is a third preset value, keeping the first plugging state unchanged.
Optionally, the executing the corresponding processing policy based on the first plug state and the pin state includes:
if the pin state is a high level, judging that the battery standby unit is not in place, reporting a battery out-of-place alarm, marking a second plugging state as a fourth preset value and resetting the first plugging state as the third preset value;
if the pin state is a low level, the battery standby power unit is judged to be in place, if the second plugging state is the fourth preset value, a battery out-of-place alarm is cleared, the second plugging state is reset to be a fifth preset value, the first plugging state is reset to be the third preset value, if the second plugging state is the fifth preset value, and the first plugging state is the second preset value, the battery standby power unit is judged to be rapidly plugged, a corresponding rapid plugging log is recorded, and the first plugging state is reset to be the third preset value.
Optionally, after the determining that the battery backup unit is in place, if the second plugging state is the fourth preset value, or the second plugging state is the fifth preset value and the first plugging state is the second preset value, the method further includes: and performing initial operation on the battery power-standby unit.
Optionally, after the determining that the battery backup unit is not in place, the method further includes: and generating a corresponding alarm log.
Optionally, the marking a first unplugging and plugging state based on the off-bit interrupt signal or the on-bit interrupt signal includes:
and calling a first interrupt processing program corresponding to the off-bit interrupt signal or a second interrupt processing program corresponding to the on-bit interrupt signal, and marking a first plug-pull state.
Optionally, the logic device connected to the battery backup unit pulls the on-site pin high when the battery backup unit is pulled out, and pulls the on-site pin low when the battery backup unit is inserted.
In a second aspect, the present application discloses a battery plugging status monitoring device, including:
the interrupt signal receiving module is used for receiving an off-position interrupt signal sent when the CPLD detects that the battery standby power unit is pulled out or an on-position interrupt signal sent when the CPLD detects that the battery standby power unit is inserted;
the plug state marking module is used for marking a first plug state based on a non-in-place interrupt signal or the in-place interrupt signal;
the pin state reading module is used for periodically acquiring the pin state of an in-place pin corresponding to the battery standby power unit; the on-site pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted;
and the processing strategy execution module is used for executing a corresponding processing strategy based on the first plug-in state and the pin state.
Optionally, the plug state marking module is specifically configured to mark the first plug state as a first preset value if an out-of-position interrupt signal is received; if an in-place interrupt signal is received and the first plugging state is the first preset value, marking the first plugging state as a second preset value; and if an in-place interrupt signal is received and the first plugging state is a third preset value, keeping the first plugging state unchanged.
Optionally, the processing policy executing module is specifically configured to: if the pin state is a high level, judging that the battery standby unit is not in place, reporting a battery out-of-place alarm, marking a second plugging state as a fourth preset value and resetting the first plugging state to the third preset value; if the pin state is a low level, the battery standby power unit is judged to be in place, if the second plugging state is the fourth preset value, a battery out-of-place alarm is cleared, the second plugging state is reset to be a fifth preset value, the first plugging state is reset to be a third preset value, if the second plugging state is the fifth preset value, and the first plugging state is the second preset value, the battery standby power unit is judged to be rapidly plugged, a corresponding rapid plugging log is recorded, and the first plugging state is reset to be the third preset value.
In a third aspect, the present application discloses an electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the battery plugging/unplugging state monitoring method.
In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the foregoing battery unplugging/plugging status monitoring method.
Therefore, the method comprises the steps of firstly receiving an off-position interrupt signal sent by a CPLD when the battery power backup unit is detected to be pulled out or an on-position interrupt signal sent by the CPLD when the battery power backup unit is inserted, then marking a first pulling and inserting state based on the off-position interrupt signal or the on-position interrupt signal, periodically obtaining a pin state of an on-position pin corresponding to the battery power backup unit, and executing a corresponding processing strategy based on the first pulling and inserting state and the pin state; the position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted. That is, this application receives CPLD because of the battery stand-by unit extracts or inserts the interrupt signal that triggers and according to the first state of inserting of interrupt signal mark to regularly acquire the pin state of the corresponding pin in place of battery stand-by unit, should be drawn high when battery stand-by unit extracts, draw low when battery stand-by unit inserts, combine first state of inserting and pin state to carry out corresponding tactics and handle, like this, can accurately discern the state of inserting of battery stand-by unit and carry out corresponding processing, thereby guarantee the normal operating of battery stand-by unit.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a battery plugging/unplugging state monitoring method disclosed in the present application;
FIG. 2 is a schematic diagram illustrating a specific battery plugging status monitoring disclosed herein;
fig. 3 is a flowchart illustrating a variation of a specific swap flag and an interrupt state flag disclosed in the present application;
fig. 4 is a schematic structural diagram of a battery plugging/unplugging state monitoring apparatus disclosed in the present application;
fig. 5 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The memory server usually uses BBU as a power supply device for data backup after power failure, and the effective in-place of BBU is the first step requirement for normal operation of memory service. As a pluggable device, a BBU has a plugging and replacing scenario during the operation of a memory system, so how to effectively identify and process the plugging and unplugging actions and ensure the normal operation of the BBU is a problem to be solved at present. Therefore, the battery plugging and unplugging state monitoring scheme is provided, the plugging and unplugging state of the battery standby power unit can be accurately identified, and corresponding processing is carried out, so that the normal operation of the battery standby power unit is guaranteed.
Referring to fig. 1, an embodiment of the present application discloses a battery plugging/unplugging state monitoring method, including:
step S11: and receiving an out-of-position interrupt signal transmitted when the CPLD detects that the battery standby power unit is pulled out or an in-position interrupt signal transmitted when the battery standby power unit is inserted.
In one embodiment, the logic device connected with the battery backup unit pulls up the on-bit pin indicating that the battery backup unit is in place when the battery backup unit is pulled out, pulls down the on-bit pin indicating that the battery backup unit is in place when the battery backup unit is inserted, and the battery backup unit informs the CPLD of the out-of-bit state or the in-bit state, and when the CPLD detects that the battery backup unit is pulled out or inserted, the NMI (namely Non-Maskable Interrupt is triggered, and a corresponding out-of-bit Interrupt signal or an in-bit Interrupt signal is sent out.
Step S12: a first unplugged state is marked based on the no-bit interrupt signal or the bit interrupt signal.
In a specific implementation manner, the embodiment of the present application may call a first interrupt handler corresponding to the off-bit interrupt signal or a second interrupt handler corresponding to the on-bit interrupt signal, and mark a first plug-and-play state.
Further, if an out-of-position interrupt signal is received, the first plugging state is marked as a first preset value; if an in-place interrupt signal is received and the first plugging state is the first preset value, marking the first plugging state as a second preset value; and if an on-site interrupt signal is received and the first plugging state is a third preset value, keeping the first plugging state unchanged.
For example, the first preset value may be 1, the second preset value may be 2, and the third preset value may be 0.
Step S13: and periodically acquiring the pin state of an in-place pin corresponding to the battery power backup unit, and executing a corresponding processing strategy based on the first plug-in state and the pin state.
The position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted. It should be understood that, in the embodiment of the present application, the execution sequence of step S13 and step S11 and step S12 is not limited, and step S13 is executed periodically in a preset period. For example, the preset period is 5s. A monitoring thread may be started, the pin state of the in-place pin corresponding to the battery power backup unit may be periodically obtained, and a corresponding processing policy may be executed based on the first plug-in state and the pin state.
In a specific embodiment, the pin status of the on-bit pin corresponding to the battery backup unit is periodically acquired through an I2C (i.e., an Inter-Integrated Circuit, bi-directional two-wire synchronous serial bus).
In one embodiment, if the pin state is a high level, it is determined that the battery power backup unit is not in place, a battery out-of-place alarm is reported, a second plugging state is marked as a fourth preset value, and the first plugging state is reset to the third preset value; if the pin state is a low level, the battery standby power unit is judged to be in place, if the second plugging state is the fourth preset value, a battery out-of-place alarm is cleared, the second plugging state is reset to be a fifth preset value, the first plugging state is reset to be a third preset value, if the second plugging state is the fifth preset value, and the first plugging state is the second preset value, the battery standby power unit is judged to be rapidly plugged, a corresponding rapid plugging log is recorded, and the first plugging state is reset to be the third preset value. For example, the fourth preset value is 0, and the fifth preset value is 1.
After the determining that the battery backup unit is in place, if the second plugging state is the fourth preset value, or the second plugging state is the fifth preset value and the first plugging state is the second preset value, the method further includes: and performing initial operation on the battery power-standby unit.
Further, after the determining that the battery backup unit is not in place, the method further includes: and generating a corresponding alarm log.
That is, the embodiment of the application periodically runs the monitoring thread, obtains the state of the in-place pin of the BBU through the I2C during the running process, and completes actions such as BBU out-of-place alarm reporting, BBU initialization using and the like by combining the plugging state.
For example, referring to fig. 2, fig. 2 is a schematic diagram illustrating a specific battery plugging/unplugging state monitoring disclosed in an embodiment of the present application. The method mainly comprises the following steps:
step 1, when the BBU is pulled out, a logic device PCA9551 directly connected with the BBU pulls up a pin indicating that the BBU is in place, indicates that the BBU is not in place, informs a CPLD of the out-of-place state, and triggers NMI interruption after the CPLD senses the out-of-place state.
And 2, after receiving the out-of-place interrupt signal, running an out-of-place interrupt processing program and marking the BBU interrupt plug-in state (namely the first plug-in state) as 1.
And 3, operating by taking 5s as a period, actively reading the state of the in-place pin in the operating process, judging that the BBU is not in place when the pin is in a high level, reporting an alarm that the BBU is not in place, setting a swap (namely the second plugging state) flag to be 1, resetting the BBU interrupt plugging state to be 0, and recording the status in a log.
And 4, when the BBU is inserted, pulling down the BBU on-position pin, informing the CPLD of the on-position state, and triggering NMI interruption after the CPLD senses the BBU.
Step 5, after receiving the on-site interrupt signal, running an on-site interrupt processing program, and performing the following processing according to the current BBU interrupt plugging and unplugging state:
(a) If the state is 1, the state is set to 2.
(b) If the state is 0, it remains unchanged.
And 6, when the status of the on-position pin is read to be low level, determining that the BBU is on position, and processing as follows:
(a) And when the swap mark is 1, clearing the BBU out-of-place alarm, resetting the swap mark and the BBU interrupt plugging mark to be 0, and initializing the BBU.
(b) And when the swap mark is 0 and the BBU interrupt plugging state is 2, recording a plugging log, resetting the interrupt plugging state to be 0 and initializing the BBU.
For example, referring to fig. 3, fig. 3 is a flowchart illustrating a variation of a specific swap flag and an interrupt status flag according to an embodiment of the present application.
It should be noted that, since the embodiment of the present application reads the status of the pin periodically and performs the corresponding processing, during this period, a fast plug-and-play may occur, for example, step 3 does not occur, and step 4 directly occurs. The embodiment of the application can identify the quick plugging state, so that the plugging state and the unplugging state can be identified, and the quick plugging state can also be identified.
In addition, in a specific implementation manner, the embodiment of the present application may be implemented in MCS (Multiple Controller System ) software, and first a hardware planning PCA9551 and a BBU on-site pin connection relationship is performed, and a CPLD interrupt signal sending manner, an MCS software planning interrupt signal receiving manner, an MCS software planning on-site pin state obtaining manner, an MCS software planning state skipping flow, a manner requiring MCS software planning alarm reporting and elimination, and an MCS software planning log storage manner are planned. And the MCS software receives an NMI interrupt signal sent by the CPLD after the BBU is detected to be not in place or in place. And running different interrupt processing programs according to different interrupt signal contents, and identifying the interrupt plugging and unplugging state of the BBU. And periodically running the monitoring thread, acquiring the in-place pin state of the BBU through the I2C in the running process, and finishing the actions such as BBU out-of-place alarm reporting, BBU out-of-place alarm clearing, plug-in action capture recording, BBU initialization using and the like by combining the interrupt plug-in state. Through interrupt processing and on-site pin control state change, different plugging scenes of the battery can be dealt with, the problem that system software cannot be sensed under the rapid plugging scene is solved, normal and correct operation of the BBU is guaranteed, clear recognition can be achieved on state change of the BBU, and the battery plugging device is more reasonable to use.
It can be seen that, in the embodiment of the present application, a non-in-place interrupt signal sent when the CPLD detects that the battery backup unit is pulled out or an in-place interrupt signal sent when the battery backup unit is inserted is received first, then a first pulling and inserting state is marked based on the non-in-place interrupt signal or the in-place interrupt signal, a pin state of an in-place pin corresponding to the battery backup unit is periodically obtained, and a corresponding processing strategy is executed based on the first pulling and inserting state and the pin state; the position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted. That is, the embodiment of the application receives an interrupt signal triggered by the pulling out or inserting of the battery power backup unit of the CPLD and marks the first pulling and inserting state according to the interrupt signal, and periodically obtains the pin state of the on-site pin corresponding to the battery power backup unit, the on-site pin is pulled high when the battery power backup unit is pulled out, and is pulled low when the battery power backup unit is inserted, and corresponding policy processing is performed by combining the first pulling and inserting state and the pin state, so that the pulling and inserting state of the battery power backup unit can be accurately identified and processed correspondingly, and the normal operation of the battery power backup unit is ensured.
Referring to fig. 4, an embodiment of the present application discloses a battery plugging/unplugging state monitoring device, including:
the interrupt signal receiving module 11 is used for receiving an off-position interrupt signal sent when the CPLD detects that the battery backup unit is pulled out or an on-position interrupt signal sent when the CPLD detects that the battery backup unit is inserted;
a plugging state marking module 12, configured to mark a first plugging state based on a non-in-place interrupt signal or the in-place interrupt signal;
a pin state reading module 13, configured to periodically obtain a pin state of an in-place pin corresponding to the battery backup unit; the on-site pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted;
and the processing policy executing module 14 is configured to execute a corresponding processing policy based on the first plugging state and the pin state.
It can be seen that, in the embodiment of the present application, a non-in-place interrupt signal sent when the CPLD detects that the battery power backup unit is pulled out or an in-place interrupt signal sent when the battery power backup unit is inserted is received first, then a first pulling and inserting state is marked based on the non-in-place interrupt signal or the in-place interrupt signal, a pin state of an in-place pin corresponding to the battery power backup unit is periodically obtained, and a corresponding processing strategy is executed based on the first pulling and inserting state and the pin state; the position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted. That is, the embodiment of the application receives an interrupt signal triggered by the CPLD due to the pulling out or insertion of the battery power backup unit and marks the first pulling out and inserting state according to the interrupt signal, and periodically obtains the pin state of the in-place pin corresponding to the battery power backup unit, the in-place pin is pulled high when the battery power backup unit is pulled out and pulled low when the battery power backup unit is inserted, and corresponding policy processing is performed by combining the first pulling out and inserting state and the pin state, so that the pulling out and inserting state of the battery power backup unit can be accurately identified and corresponding processing is performed, and the normal operation of the battery power backup unit is ensured.
In an embodiment, the unplugging and plugging status marking module 12 is specifically configured to mark the first unplugging and plugging status as a first preset value if an off-bit interrupt signal is received; if an in-place interrupt signal is received and the first plugging state is the first preset value, marking the first plugging state as a second preset value; and if an in-place interrupt signal is received and the first plugging state is a third preset value, keeping the first plugging state unchanged.
The processing policy executing module 14 is specifically configured to: if the pin state is a high level, judging that the battery standby unit is not in place, reporting a battery out-of-place alarm, marking a second plugging state as a fourth preset value and resetting the first plugging state as the third preset value; if the pin state is a low level, the battery standby power unit is judged to be in place, if the second plugging state is the fourth preset value, a battery out-of-place alarm is cleared, the second plugging state is reset to be a fifth preset value, the first plugging state is reset to be a third preset value, if the second plugging state is the fifth preset value, and the first plugging state is the second preset value, the battery standby power unit is judged to be rapidly plugged, a corresponding rapid plugging log is recorded, and the first plugging state is reset to be the third preset value.
Moreover, the processing policy executing module 14 is further configured to, after the determining that the battery backup unit is in place, if the second plugging state is the fourth preset value, or the second plugging state is the fifth preset value and the first plugging state is the second preset value, the method further includes: and carrying out initial operation on the battery power supply unit.
Further, the processing policy executing module 14 is further configured to generate a corresponding alarm log after it is determined that the battery backup unit is not in place.
It is understood that the processing policy executing module 14 is triggered by the executing action of the pin status reading module 13, that is, the processing policy executing module 14 triggers the executing after the pin status reading module 13 periodically obtains the pin status of the in-place pin corresponding to the battery power-standby unit, and thus, the executing is also performed periodically.
In an embodiment, the plug state marking module 12 is specifically configured to call a first interrupt handler corresponding to the off-bit interrupt signal or a second interrupt handler corresponding to the on-bit interrupt signal, and mark the first plug state.
In one embodiment, a logic device connected to the battery backup unit pulls the on-position pin high when the battery backup unit is removed and pulls the on-position pin low when the battery backup unit is inserted.
Referring to fig. 5, an embodiment of the present application discloses an electronic device 20, which includes a processor 21 and a memory 22; wherein, the memory 22 is used for saving computer programs; the processor 21 is configured to execute the computer program to implement the following steps:
receiving an out-of-position interrupt signal sent when the CPLD detects that the battery standby power unit is pulled out or an in-position interrupt signal sent when the CPLD detects that the battery standby power unit is inserted; marking a first unplugged state based on the out-of-bit interrupt signal or the in-bit interrupt signal; periodically acquiring the pin state of an in-place pin corresponding to the battery power supply unit, and executing a corresponding processing strategy based on the first plug-in state and the pin state; the position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted.
It can be seen that, in the embodiment of the present application, a non-in-place interrupt signal sent when the CPLD detects that the battery power backup unit is pulled out or an in-place interrupt signal sent when the battery power backup unit is inserted is received first, then a first pulling and inserting state is marked based on the non-in-place interrupt signal or the in-place interrupt signal, a pin state of an in-place pin corresponding to the battery power backup unit is periodically obtained, and a corresponding processing strategy is executed based on the first pulling and inserting state and the pin state; the position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted. That is, the embodiment of the application receives an interrupt signal triggered by the CPLD due to the pulling out or insertion of the battery power backup unit and marks the first pulling out and inserting state according to the interrupt signal, and periodically obtains the pin state of the in-place pin corresponding to the battery power backup unit, the in-place pin is pulled high when the battery power backup unit is pulled out and pulled low when the battery power backup unit is inserted, and corresponding policy processing is performed by combining the first pulling out and inserting state and the pin state, so that the pulling out and inserting state of the battery power backup unit can be accurately identified and corresponding processing is performed, and the normal operation of the battery power backup unit is ensured.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: if an off-position interrupt signal is received, marking the first plugging state as a first preset value; if an in-place interrupt signal is received and the first plugging state is the first preset value, marking the first plugging state as a second preset value; and if an in-place interrupt signal is received and the first plugging state is a third preset value, keeping the first plugging state unchanged.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: if the pin state is a high level, judging that the battery standby unit is not in place, reporting a battery out-of-place alarm, marking a second plugging state as a fourth preset value and resetting the first plugging state to the third preset value; if the pin state is a low level, the battery standby power unit is judged to be in place, if the second plugging state is the fourth preset value, a battery out-of-place alarm is cleared, the second plugging state is reset to be a fifth preset value, the first plugging state is reset to be the third preset value, if the second plugging state is the fifth preset value, and the first plugging state is the second preset value, the battery standby power unit is judged to be rapidly plugged, a corresponding rapid plugging log is recorded, and the first plugging state is reset to be the third preset value.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: after the determining that the battery backup unit is in place, if the second plugging state is the fourth preset value, or the second plugging state is the fifth preset value and the first plugging state is the second preset value, the method further includes: and performing initial operation on the battery power-standby unit.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and generating a corresponding alarm log after the battery power supply unit is judged not to be in place.
In this embodiment, when the processor 21 executes the computer subprogram stored in the memory 22, the following steps may be specifically implemented: and calling a first interrupt processing program corresponding to the off-bit interrupt signal or a second interrupt processing program corresponding to the on-bit interrupt signal, and marking a first plug-pull state.
The logic device connected with the battery standby power unit pulls the on-position pin high when the battery standby power unit is pulled out, and pulls the on-position pin low when the battery standby power unit is inserted.
The memory 22 is used as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk, or an optical disk, and the storage manner may be a transient storage manner or a permanent storage manner.
In addition, the electronic device 20 further includes a power supply 23, a communication interface 24, an input-output interface 25, and a communication bus 26; the power supply 23 is configured to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and a communication protocol followed by the communication interface is any communication protocol applicable to the technical solution of the present application, and is not specifically limited herein; the input/output interface 25 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to a specific application requirement, which is not specifically limited herein.
Further, an embodiment of the present application discloses a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the following steps:
receiving an out-of-position interrupt signal sent when the CPLD detects that the battery standby power unit is pulled out or an in-position interrupt signal sent when the CPLD detects that the battery standby power unit is inserted; marking a first unplugged state based on the out-of-bit interrupt signal or the in-bit interrupt signal; periodically acquiring the pin state of an in-place pin corresponding to the battery standby power unit, and executing a corresponding processing strategy based on the first plug-in state and the pin state; the position pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted.
It can be seen that, in the embodiment of the present application, a non-in-place interrupt signal sent when the CPLD detects that the battery backup unit is pulled out or an in-place interrupt signal sent when the battery backup unit is inserted is received first, then a first pulling and inserting state is marked based on the non-in-place interrupt signal or the in-place interrupt signal, a pin state of an in-place pin corresponding to the battery backup unit is periodically obtained, and a corresponding processing strategy is executed based on the first pulling and inserting state and the pin state; the in-place pin is pulled high when the battery power supply unit is pulled out, and pulled low when the battery power supply unit is inserted. That is, the embodiment of the application receives an interrupt signal triggered by the pulling out or inserting of the battery power backup unit of the CPLD and marks the first pulling and inserting state according to the interrupt signal, and periodically obtains the pin state of the on-site pin corresponding to the battery power backup unit, the on-site pin is pulled high when the battery power backup unit is pulled out, and is pulled low when the battery power backup unit is inserted, and corresponding policy processing is performed by combining the first pulling and inserting state and the pin state, so that the pulling and inserting state of the battery power backup unit can be accurately identified and processed correspondingly, and the normal operation of the battery power backup unit is ensured.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: if an off-position interrupt signal is received, marking the first plugging state as a first preset value; if an in-place interrupt signal is received and the first plugging state is the first preset value, marking the first plugging state as a second preset value; and if an in-place interrupt signal is received and the first plugging state is a third preset value, keeping the first plugging state unchanged.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: if the pin state is a high level, judging that the battery standby unit is not in place, reporting a battery out-of-place alarm, marking a second plugging state as a fourth preset value and resetting the first plugging state to the third preset value; if the pin state is a low level, the battery standby power unit is judged to be in place, if the second plugging state is the fourth preset value, a battery out-of-place alarm is cleared, the second plugging state is reset to be a fifth preset value, the first plugging state is reset to be a third preset value, if the second plugging state is the fifth preset value, and the first plugging state is the second preset value, the battery standby power unit is judged to be rapidly plugged, a corresponding rapid plugging log is recorded, and the first plugging state is reset to be the third preset value.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: after the determining that the battery backup unit is in place, if the second plugging state is the fourth preset value, or the second plugging state is the fifth preset value and the first plugging state is the second preset value, the method further includes: and performing initial operation on the battery power-standby unit.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and generating a corresponding alarm log after the battery standby unit is judged not to be in place.
In this embodiment, when the computer subprogram stored in the computer-readable storage medium is executed by the processor, the following steps may be specifically implemented: and calling a first interrupt processing program corresponding to the off-site interrupt signal or a second interrupt processing program corresponding to the on-site interrupt signal, and marking a first plug-in state.
The logic device connected with the battery standby power unit pulls the on-position pin high when the battery standby power unit is pulled out, and pulls the on-position pin low when the battery standby power unit is inserted.
In the present specification, the embodiments are described in a progressive manner, and each embodiment focuses on differences from other embodiments, and the same or similar parts between the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module may reside in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
The method, the device, the equipment and the medium for monitoring the plugging and unplugging state of the battery provided by the application are introduced in detail, a specific example is applied in the description to explain the principle and the implementation mode of the application, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A battery plug-in state monitoring method is characterized by comprising the following steps:
receiving an off-site interrupt signal sent when the CPLD detects that the battery standby power unit is pulled out or an on-site interrupt signal sent when the CPLD detects that the battery standby power unit is inserted;
marking a first unplugged state based on the out-of-bit interrupt signal or the in-bit interrupt signal;
periodically acquiring the pin state of an in-place pin corresponding to the battery power supply unit, and executing a corresponding processing strategy based on the first plug-in state and the pin state; the in-place pin is pulled high when the battery power supply unit is pulled out, and pulled low when the battery power supply unit is inserted.
2. The method for monitoring the battery plugging state according to claim 1, wherein the marking the first plugging state based on the off-bit interrupt signal or the on-bit interrupt signal comprises:
if an off-position interrupt signal is received, marking the first plugging state as a first preset value;
if an in-place interrupt signal is received and the first plugging state is the first preset value, marking the first plugging state as a second preset value;
and if an in-place interrupt signal is received and the first plugging state is a third preset value, keeping the first plugging state unchanged.
3. The method for monitoring the battery plugging state according to claim 1, wherein the executing the corresponding processing policy based on the first plugging state and the pin state comprises:
if the pin state is a high level, judging that the battery standby unit is not in place, reporting a battery out-of-place alarm, marking a second plugging state as a fourth preset value and resetting the first plugging state to the third preset value;
if the pin state is a low level, the battery standby power unit is judged to be in place, if the second plugging state is the fourth preset value, a battery out-of-place alarm is cleared, the second plugging state is reset to be a fifth preset value, the first plugging state is reset to be the third preset value, if the second plugging state is the fifth preset value, and the first plugging state is the second preset value, the battery standby power unit is judged to be rapidly plugged, a corresponding rapid plugging log is recorded, and the first plugging state is reset to be the third preset value.
4. The method according to claim 3, wherein after the determining that the battery backup unit is in place, if the second plugging state is the fourth preset value, or the second plugging state is the fifth preset value and the first plugging state is the second preset value, the method further comprises: and performing initial operation on the battery power-standby unit.
5. The battery plugging and unplugging state monitoring method according to claim 3, further comprising, after determining that the battery backup unit is not in place: and generating a corresponding alarm log.
6. The method for monitoring the battery plugging state according to claim 1, wherein the marking the first plugging state based on the off-bit interrupt signal or the on-bit interrupt signal comprises:
and calling a first interrupt processing program corresponding to the off-bit interrupt signal or a second interrupt processing program corresponding to the on-bit interrupt signal, and marking a first plug-pull state.
7. The battery unplugging and plugging status monitoring method according to claim 1, wherein a logic device connected with a battery backup unit pulls the on-site pin high when the battery backup unit is unplugged and pulls the on-site pin low when the battery backup unit is plugged.
8. A battery plug-in state monitoring device is characterized by comprising:
the interrupt signal receiving module is used for receiving an off-site interrupt signal sent when the CPLD detects that the battery standby unit is pulled out or an on-site interrupt signal sent when the CPLD detects that the battery standby unit is inserted;
the plug state marking module is used for marking a first plug state based on a non-in-place interrupt signal or the in-place interrupt signal;
the pin state reading module is used for periodically acquiring the pin state of an in-place pin corresponding to the battery standby power unit; the in-place pin is pulled high when the battery standby power unit is pulled out, and pulled low when the battery standby power unit is inserted;
and the processing strategy execution module is used for executing a corresponding processing strategy based on the first plug-in state and the pin state.
9. An electronic device comprising a memory and a processor, wherein:
the memory is used for storing a computer program;
the processor is configured to execute the computer program to implement the battery plug-in state monitoring method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the battery unplugging status monitoring method according to any one of claims 1 to 7.
CN202211055988.2A 2022-08-30 2022-08-30 Battery plugging and unplugging state monitoring method, device, equipment and medium Pending CN115587005A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211055988.2A CN115587005A (en) 2022-08-30 2022-08-30 Battery plugging and unplugging state monitoring method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211055988.2A CN115587005A (en) 2022-08-30 2022-08-30 Battery plugging and unplugging state monitoring method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN115587005A true CN115587005A (en) 2023-01-10

Family

ID=84771424

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211055988.2A Pending CN115587005A (en) 2022-08-30 2022-08-30 Battery plugging and unplugging state monitoring method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN115587005A (en)

Similar Documents

Publication Publication Date Title
CN112463689B (en) OCP card hot plug device, method and computer readable storage medium
CN112769652B (en) Node service monitoring method, device, equipment and medium
CN111694710A (en) Method, device and equipment for monitoring faults of substrate management controller and storage medium
CN111752776A (en) Cyclic power-on and power-off test method and system for server
CN112732616B (en) BMC starting method, device and equipment based on SPI controller
CN107423196B (en) Multi-card-slot state detection method, detection equipment and mobile terminal
CN108667515B (en) Port configuration method and communication equipment
CN115543872A (en) Equipment management method and device and computer storage medium
CN115587005A (en) Battery plugging and unplugging state monitoring method, device, equipment and medium
CN111857302A (en) Reset method, device and equipment of system management bus
CN108196617B (en) BMC time setting method, device and system and readable storage medium
CN110908947A (en) Hot plug method and device for frame type equipment line card, main control board and frame type equipment
CN115509333A (en) Server collaborative power-on and power-off device, method, system and medium
CN112214094B (en) Method and equipment for coping with power supply jitter of hard disk
CN113765504A (en) Universal dynamic delay jitter elimination method, device, terminal and storage medium
CN115098342A (en) System log collection method, system, terminal and storage medium
CN115269474A (en) Server and PCIe hot plug control method, device and medium thereof
CN110519098B (en) Method and device for processing abnormal single board
CN113179170A (en) Method and device for processing abnormity of power receiving end equipment, power supply end equipment and medium
CN114020670A (en) PCIE card management method, system, equipment and storage medium
CN113220091A (en) Supercomputing device, online detection method of force calculating plate and storage medium
CN111176909A (en) Method and device for recovering use of disk and storage equipment
CN112953788A (en) Network state detection method and device, BMC and storage medium
JPH10111737A (en) Resetting device
CN103049344B (en) The method and apparatus of hardware plug fault-tolerant processing

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