Equipment cover opening detection method and device, equipment and storage medium

By pairing Hall sensors with magnetic triggers and combining on-chip storage technology of microcontroller devices, precise detection of cover opening events and recording in the server power outage state, solving the problems of complex structure and information loss in the existing technology, and improving the security and reliability of the server.

CN120597344AInactive Publication Date: 2025-09-05INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202511094124.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-06
Publication Date
2025-09-05
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing server cover detection method has a complex structure and cannot retain important information during power outage, which poses a safety hazard.

Method used

The Hall sensor is used to pair with the magnetic trigger, and the target interface of the microcontroller device receives the status change signal, generates a cover opening event, and records the event through the on-chip memory in the power-off state, and then reports it to the management device after restarting.

Benefits of technology

It realizes high sensitivity and high precision cover opening detection, reduces material costs and system complexity, has the ability to hold power outages, ensures that the cover opening event can be recorded in the power outage state, and improves reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120597344A_ABST
    Figure CN120597344A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment cover opening detection method and device, equipment and a storage medium, and relates to the technical field of server safety monitoring, and the method comprises the steps: receiving a state change signal generated when the position of a magnetic trigger corresponding to a Hall sensor in target equipment changes through a preset micro-control device, obtaining a real-time clock timestamp, and transmitting the real-time clock timestamp to a server; generating an equipment uncovering event based on the real-time clock timestamp and the equipment information of the target equipment; when the target equipment is in the power-off state, storing the equipment uncovering event into an on-chip memory of a preset micro-control device, and reading the equipment uncovering event after the target equipment is restarted; and generating a corresponding first alarm signal according to the equipment uncovering event and sending the first alarm signal to the management equipment. Precise detection of equipment cover opening is achieved through pairing of the Hall element and the magnet, system complexity is reduced, cover opening event states are stored and recorded on a chip under the condition that a server is powered off, persistent recording of events is achieved, and the advantages of being high in power failure maintaining capacity and reliability are achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of server security monitoring, and in particular to a device cover opening detection method, apparatus, device and storage medium. Background Art

[0002] With the widespread use of server equipment, data centers and enterprises are increasingly demanding physical security. This is especially true in critical information infrastructure. Unauthorized access, equipment tampering, and hardware replacement can lead to risks such as data leaks, system crashes, and backdoors. Some existing servers use mechanical switches, rely on specific motherboard pins, or rely on infrared sensors for detection. However, these methods are complex and lack the ability to retain important information even when the server is powered off. Summary of the Invention

[0003] The present application provides a device cover opening detection method, apparatus, equipment and storage medium to at least solve the problems in the related art of complex structure and inability to retain important information when the server is powered off, thereby achieving high-sensitivity server chassis cover opening detection.

[0004] This application provides a device cover opening detection method, comprising:

[0005] Utilizing a target interface of a preset microcontroller, a state change signal of a Hall sensor in a target device is received; the state change signal is a real-time signal generated by the Hall sensor when the position of a magnetic trigger element corresponding to the Hall sensor changes;

[0006] A real-time clock timestamp is obtained by using a preset microcontroller based on the state change signal, and a device cover opening event is generated based on the real-time clock timestamp and device information of the target device;

[0007] When the target device is in a power-off state, a device cover opening event is stored in an on-chip memory of the preset microcontroller by using a preset microcontroller, and after the target device is restarted, the device cover opening event in the on-chip memory is read;

[0008] A corresponding first alarm signal is generated according to the device cover opening event, and the first alarm signal is sent to the management device through a preset bus.

[0009] The present application also provides a device for detecting a cover opening of a device, comprising:

[0010] A signal receiving module is used to receive a state change signal of a Hall sensor in a target device using a target interface of a preset microcontroller; the state change signal is a real-time signal generated by the Hall sensor when the position of a magnetic trigger corresponding to the Hall sensor changes;

[0011] An event generation module is used to obtain a real-time clock timestamp using a preset microcontroller based on the state change signal, and generate a device cover opening event based on the real-time clock timestamp and device information of the target device;

[0012] an event reading module, configured to store the device cover opening event in an on-chip memory of the preset microcontroller using a preset microcontroller when the target device is in a power-off state, and to read the device cover opening event in the on-chip memory after the target device is restarted;

[0013] The signal sending module is used to generate a corresponding first alarm signal according to the device cover opening event, and send the first alarm signal to the management device through a preset bus.

[0014] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned device cover opening detection methods when executing the computer program.

[0015] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned device cover opening detection methods are implemented.

[0016] The present application can first utilize the target interface of the microcontroller to receive the state change signal generated when the position of the magnetic trigger corresponding to the Hall sensor in the target device changes, and obtain the real-time clock timestamp, and generate a device cover opening event based on the real-time clock timestamp and the device information of the target device. When the target device is in a power-off state, the microcontroller is used to store the device cover opening event in the on-chip memory of the preset microcontroller. After the target device is restarted, the device cover opening event in the on-chip memory is read to generate a first alarm signal and send it to the management device. Through the present application, the Hall element and the magnet are paired to achieve accurate detection of device cover opening, reducing material cost and system complexity. In addition, the on-chip storage of the microcontroller is used to record the cover opening event status on the chip when the main power of the server is cut off, realizing persistent recording of the event. When the system is restarted, the microcontroller reads the event data from the on-chip storage and reports it to the management device, thereby realizing operations such as alarm. It has the advantages of power-off retention capability and high reliability, avoiding the problem of not being able to retain important information when the server is powered off, and realizing high-sensitivity and high-precision server chassis cover opening detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0018] Figure 1 A flow chart of a device cover opening detection method provided in an embodiment of the present application;

[0019] Figure 2 A structural diagram of a device cover opening detection system provided in an embodiment of the present application;

[0020] Figure 3 A flow chart of device cover opening detection provided in an embodiment of the present application;

[0021] Figure 4 A flow chart of a specific device cover opening detection method provided in an embodiment of the present application;

[0022] Figure 5 A schematic structural diagram of a device cover opening detection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0024] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0025] Some existing servers use mechanical switches, rely on specific motherboard pins, or rely on infrared light sensors to detect lid openings. However, these methods have disadvantages such as complex structures and an inability to retain important information when the server is powered off. This application can achieve accurate detection of device lid openings by pairing Hall elements with magnets, reducing material costs and system complexity. Furthermore, the microcontroller's on-chip storage can be used to record lid opening events even when the server's main power is cut off, achieving persistent recording of events. When the system is restarted, the microcontroller reads the event data from the on-chip storage, providing the advantages of power-off retention and high reliability.

[0026] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0027] like Figure 1 As shown, the embodiment of the present application provides a device cover opening detection method, which is described in detail in conjunction with the execution process of the device cover opening detection method, including:

[0028] Step S11: using a target interface of a preset microcontroller to receive a state change signal of a Hall sensor in a target device; the state change signal is a real-time signal generated by the Hall sensor when the position of a magnetic trigger corresponding to the Hall sensor changes.

[0029] First of all, it should be pointed out that Figure 2 As shown, the hardware for implementing device cover opening detection in this embodiment primarily consists of key components, including an MCU (microcontroller unit), a Hall effect sensor, a magnetic trigger, and a supercapacitor. Specifically, the pre-set microcontroller in this embodiment can be an MCU. Specifically, this embodiment uses an STM32L433 series MCU as the core controller, responsible for Hall signal acquisition, interrupt processing, debounce logic, and I2C (Inter-Integrated Circuit) communication. The Hall effect sensor is used to detect position changes of a magnet (i.e., a magnetic trigger) to determine whether the server cover is closed. The magnetic trigger is attached to the inside of the chassis cover, corresponding to the Hall sensor. The supercapacitor is used to store historical events in the event of a power outage, powering the MCU immediately upon power failure to preserve data.

[0030] This embodiment utilizes a target interface of a pre-set microcontroller to receive a state change signal from a Hall effect sensor in a target device. This state change signal is a real-time signal generated by the Hall effect sensor when the position of a magnetic trigger element corresponding to the Hall effect sensor changes. It will be appreciated that in this embodiment, the magnetic trigger element (magnet) is affixed to the inside of the chassis cover, corresponding to the position of the Hall effect sensor fixed inside the chassis. When the chassis cover is opened, the magnet moves away from the Hall effect sensor along with the cover, causing the magnetic field strength around the Hall effect sensor to change, thereby triggering a change in the Hall effect sensor's output level signal (i.e., the Hall state change signal).

[0031] Before receiving the Hall effect sensor state change signal from the target device using the target interface of the preset microcontroller, the preset microcontroller must be initialized, its operating mode set to a preset low-power mode, and its preset external interrupt interface set as the target interface to receive the state change signal. Accordingly, after receiving the Hall effect sensor state change signal from the target device, the preset microcontroller, currently in the preset low-power mode, can be awakened based on the state change signal. The preset microcontroller can then initiate a preset interrupt service routine to obtain the real-time clock timestamp and generate a device cover-open event. Specifically, during initialization, the STM32L433 can be set to low-power standby mode and a GPIO (general-purpose input / output) external interrupt configured to receive the Hall effect state change signal. When the magnet is removed (the cover is opened), triggering a Hall effect state change, the MCU, currently in low-power mode, is immediately awakened, triggering an interrupt and executing subsequent processing logic.

[0032] Step S12: obtaining a real-time clock timestamp using a preset microcontroller based on the state change signal, and generating a device cover opening event based on the real-time clock timestamp and device information of the target device.

[0033] In this embodiment, after the state change signal is detected, a real-time clock (RTC) timestamp can be obtained based on the state change signal using a preset microcontroller, and a device cover opening event can be generated based on the real-time clock timestamp and device information of the target device.

[0034] Step S13: When the target device is in a power-off state, the device cover opening event is stored in the on-chip memory of the preset microcontroller by using the preset microcontroller, and after the target device is restarted, the device cover opening event in the on-chip memory is read.

[0035] In this embodiment, when the target device is powered off, a preset microcontroller can be used to store a device cover-opening event in the preset microcontroller's on-chip memory (Flash). After the target device is restarted, the device cover-opening event from the on-chip memory can be read. Furthermore, during the process of storing the device cover-opening event in the preset microcontroller's on-chip memory, a preset supercapacitor can be controlled to power the preset microcontroller. After the device cover-opening event is stored, the preset microcontroller's operating mode is set to standby mode. Furthermore, when the target device is powered on, a corresponding third alarm signal can be directly generated based on the device cover-opening event and transmitted to the management device via a preset bus.

[0036] This means that while the device is powered on, it sends alarm data to the BMC (Baseboard Management Controller) via the I2C interface and can optionally control an alarm indicator. The BMC reads the MCU's event data in real time and generates an alarm SEL (System Event Log). If the server power is interrupted at the same time as the cover opening event, the supercapacitor continues to provide short-term power to the STM32 until the MCU completes writing to the Flash memory, then enters deep standby or powers down. By designing a power-off state retention mechanism, utilizing the supercapacitor power supply and the STM32L433's on-chip Flash memory, the cover opening event status is persistently recorded in a specific page of the on-chip Flash memory even when the server's main power is disconnected. After the system restarts, the MCU reads the event data from the Flash memory and reports it to the BMC, enabling alarm and logging operations. This ensures power-off retention and high reliability.

[0037] Step S14: Generate a corresponding first alarm signal according to the device cover opening event, and send the first alarm signal to the management device through a preset bus.

[0038] In this embodiment, a corresponding first alarm signal can be generated based on a device cover-opening event and sent to a management device via a preset bus. Specifically, when the server is powered on again, the MCU reads data from a specific address in the Flash memory during system initialization to determine whether there are any unreported cover-opening events. If so, it immediately sends a cover-opening status alarm to the BMC via I2C.

[0039] This embodiment can initialize a preset microcontroller, set the operating mode of the preset microcontroller to a preset low-power mode, and use the target interface of the microcontroller to receive a state change signal generated when the position of the magnetic trigger corresponding to the Hall sensor in the target device changes. Then, a real-time clock timestamp is obtained, and a device cover opening event is generated based on the real-time clock timestamp and the device information of the target device. When the target device is in a power-off state, the device cover opening event is stored in the on-chip memory of the preset microcontroller using the microcontroller. After the target device is restarted, the device cover opening event in the on-chip memory is read to generate a first alarm signal and send it to the management device. In addition, during the process of storing the device cover opening event in the on-chip memory of the preset microcontroller, a preset supercapacitor can be controlled to power the preset microcontroller. After the device cover opening event is stored, the operating mode of the preset microcontroller is set to standby mode. The supercapacitor is used for temporary power supply and the MCU on-chip Flash is written to ensure that the chassis cover opening event can still be recorded under power-off conditions. In this way, the Hall element and the magnet can be paired to achieve accurate detection of the device cover opening, reducing material costs and system complexity. At the same time, through the low-power mode of the microcontroller (such as STM32L433), the interrupt is triggered to wake up the main control only when the state changes, which greatly reduces the standby energy consumption. In addition, by utilizing the on-chip storage of the microcontroller, when the main power of the server is cut off, the cover opening event status is recorded on the chip to achieve persistent recording of the event. When the system is restarted, the microcontroller reads the event data from the on-chip storage and reports it to the management device, thereby realizing operations such as alarm. It has the advantages of power-off retention capability and high reliability, and can achieve high-sensitivity and high-precision detection of server chassis cover opening.

[0040] Based on the previous embodiment, it can be seen that the present application can realize accurate detection of device cover opening by pairing Hall elements with magnets, and utilize the on-chip storage of the microcontroller to record the cover opening event status when the main power of the server is cut off. Next, the process of generating and recording the cover opening event will be described in detail in this embodiment. Figure 4 As shown, the embodiment of the present application provides a specific device cover opening detection method, including:

[0041] Step S21: receiving a state change signal of a Hall sensor in a target device, and waking up a preset microcontroller currently in a preset low power consumption mode according to the state change signal.

[0042] In this embodiment, before receiving the state change signal of the Hall effect sensor in the target device, the preset microcontroller can be used to obtain the server configuration information of the target device sent by the management device, and a corresponding first hash value can be determined based on the server configuration information, and the first hash value can be stored in the on-chip memory of the preset microcontroller. Accordingly, after waking up the preset microcontroller, which is currently in the preset low-power mode, according to the state change signal, the preset microcontroller can also be used to re-acquire the server configuration information of the target device sent by the management device, and re-determine the corresponding second hash value based on the server configuration information. The first hash value and the second hash value are compared; if the first hash value and the second hash value are the same, the preset microcontroller is controlled to start the preset interrupt service routine; if the first hash value and the second hash value are different, it is determined that the target device has been tampered with with its hardware, and a corresponding second alarm signal is generated and sent to the management device.

[0043] That is to say, if Figure 3As shown, during the initial factory shipment or power-on configuration phase of a server, the BMC shares hardware information with the MCU based on the server configuration. It calculates a SHA-256 hash of the unique hardware serial number (such as the CPU ID (Central Processing Unit Identification), motherboard SN (Serial Number), hard drive serial number, and memory SN) and stores it in the MCU's on-chip flash memory. Upon waking up, the MCU automatically retrieves the hardware information, recalculates the SHA256 hash of the hardware serial number, and compares it with the previously stored hash value to determine whether the hardware has been replaced or tampered with. This approach allows the STM32L433 to be awakened only when the Hall effect sensor detects an abnormal magnetic field (e.g., when the chassis cover is open). Upon awakening, it immediately processes event detection and data logging, automatically retrieves hardware information, recalculates the SHA256 hash of the hardware serial number, and compares it with the previously stored hash value to determine whether the hardware has been replaced or tampered with. This approach offers the advantages of fast response and low power consumption, enabling low-power controller wakeup and immediate device intrusion detection. It should also be pointed out that when determining whether the hardware has been tampered with, in addition to the hardware SN, multiple factors such as BIOS / BMC Version, MAC address (Media Access Control Address), CPUID, etc. can be added and hashed to increase the difficulty of forgery. At the same time, in order to prevent tampering with the MCU's Flash information, the MCU Flash protection bit (WRP to prevent write protection) can be configured when the MCU is started, and PCROP (Proprietary Code Read-Out Protection) can be used to prevent reading of specified code segments. After certain data is written, the relevant area can be locked immediately, and it cannot be rewritten subsequently, further improving the security when the device is opened.

[0044] Step S22: obtaining a real-time clock timestamp using a preset microcontroller based on the state change signal, and generating a device cover opening event based on the real-time clock timestamp and device information of the target device.

[0045] In this embodiment, after receiving a state change signal, a preset microcontroller can be used to obtain a real-time clock timestamp based on the state change signal, and a device cover opening event can be generated based on the real-time clock timestamp and device information of the target device. Furthermore, before obtaining the real-time clock timestamp using the preset microcontroller, the preset microcontroller can be controlled to wait for a preset time period according to a preset delay waiting rule. If the sensor level represented by the state change signal remains unchanged during the preset time period, the state change signal is determined to be a valid signal, allowing the preset microcontroller to initiate a preset interrupt service routine. If the sensor level represented by the state change signal returns to a preset level within the preset time period, the state change signal is determined to be an invalid signal, and the preset interrupt service routine is stopped.

[0046] That is, after receiving the state change signal, a delay and debounce are first performed to determine whether the current lid opening event is a valid event. If it is a valid event, the RTC timestamp is obtained, event information is generated, and written to the MCU's on-chip Flash. In other words, after receiving the interrupt signal, the MCU does not immediately determine it as a "valid lid opening event." Instead, it uses a software-level delay (for example, setting a delay of several tens of milliseconds) to filter out false signals that may be caused by mechanical vibration, momentary contact problems, etc. If the Hall sensor state continues to maintain the "magnet away" level during the delay period (i.e., the lid is indeed open), it is considered a valid event. If the state recovers during the delay period (for example, the magnet reappears after a brief vibration), it is considered an invalid interference and no subsequent event recording is performed. In this way, only when the delay de-bouncing is determined to be a valid event, the MCU will execute the next step to obtain the RTC timestamp, generate event information and write it into the on-chip Flash, and detect whether the hardware has been tampered with through hash comparison. Finally, it will report to the BMC when powered on or rely on the supercapacitor to complete data storage when powered off. The interference signal is filtered through software delay to ensure that it only responds to the real chassis cover opening action, reducing the probability of false triggering and improving detection accuracy.

[0047] Step S23: Generate a corresponding first alarm signal according to the device cover opening event, and send the first alarm signal to the management device through a preset bus.

[0048] In this embodiment, after generating a corresponding first alarm signal based on the device cover opening event and sending the first alarm signal to the management device via a preset bus, the microcontroller can also receive a data clear instruction sent by the management device, clear the device cover opening event stored in the on-chip memory of the preset microcontroller based on the data clear instruction, and reset the operating mode of the preset microcontroller to the preset low-power mode. In other words, after the reporting is completed, the BMC issues a clear instruction, triggering the MCU to clear the record in the Flash memory, and the MCU returns to the low-power monitoring standby state, waiting for the next trigger.

[0049] Based on the above technical solution, this embodiment provides a cover-opening detection and intrusion alarm device based on the STM32L433 microcontroller. This simplifies the installation process and accurately identifies changes in the server cover status, promptly records hardware information, and reports chassis cover-opening alarm events. This device can track abnormal behavior even in the event of a main control power outage or reboot, enhancing physical layer security. Furthermore, by storing the hardware serial number using a SHA-256 hash, it enables accurate detection of hardware tampering, addressing current issues such as high cost, poor reliability, high false trigger rate, and insufficient power-off detection.

[0050] like Figure 5 As shown, an embodiment of the present application further provides a device for detecting a cover opening of a device, comprising:

[0051] The signal receiving module 11 is used to receive the state change signal of the Hall sensor in the target device using the target interface of the preset microcontroller; the state change signal is a real-time signal generated by the Hall sensor when the position of the magnetic trigger corresponding to the Hall sensor changes;

[0052] An event generating module 12 is configured to obtain a real-time clock timestamp using a preset microcontroller based on the state change signal, and generate a device cover opening event based on the real-time clock timestamp and device information of the target device;

[0053] An event reading module 13 is configured to store the device cover opening event in an on-chip memory of the preset microcontroller using a preset microcontroller when the target device is in a power-off state, and to read the device cover opening event from the on-chip memory after the target device is restarted;

[0054] The signal sending module 14 is configured to generate a corresponding first alarm signal according to the device cover opening event, and send the first alarm signal to the management device via a preset bus.

[0055] This embodiment can utilize a target interface of a microcontroller to receive a state change signal generated when the position of a magnetic trigger corresponding to a Hall effect sensor in a target device changes, obtain a real-time clock timestamp, and generate a device cover opening event based on the real-time clock timestamp and device information of the target device. When the target device is in a power-off state, the microcontroller stores the device cover opening event in a preset on-chip memory of the microcontroller. After the target device is restarted, the device cover opening event in the on-chip memory is read to generate a first alarm signal and send it to a management device. Through the above technical solution, accurate detection of device cover opening can be achieved by pairing a Hall effect element with a magnet, reducing material cost and system complexity. Moreover, the on-chip storage of the microcontroller can be used to record the cover opening event status on-chip when the main power of the server is cut off, thereby achieving persistent recording of the event. When the system is restarted, the microcontroller reads the event data from the on-chip storage and reports it to the management device, thereby implementing alarm and other operations. The solution has the advantages of power-off retention capability and high reliability, avoiding the problem of not being able to retain important information when the server is powered off, and achieving high-sensitivity and high-precision server chassis cover opening detection.

[0056] In some specific embodiments, the device cover opening detection apparatus further includes:

[0057] an interface setting module, configured to initialize a preset microcontroller, set an operating mode of the preset microcontroller to a preset low-power mode, and use a preset external interrupt interface of the preset microcontroller as a target interface so as to receive a state change signal via the preset external interrupt interface;

[0058] The device wake-up module is used to wake up a preset microcontroller currently in a preset low-power mode according to a state change signal, so that the preset microcontroller starts a preset interrupt service program to obtain a real-time clock timestamp and generate a device cover opening event.

[0059] In some specific embodiments, the device cover opening detection apparatus further includes:

[0060] The device delay module is used to control a preset microcontroller to wait for a preset time period according to a preset delay waiting rule; if the sensor level represented by the state change signal remains unchanged within the preset time period, the state change signal is determined to be a valid signal, so that the preset microcontroller starts a preset interrupt service program; if the sensor level represented by the state change signal returns to a preset level within the preset time period, the state change signal is determined to be an invalid signal, and the preset interrupt service program is stopped.

[0061] In some specific embodiments, the device cover opening detection apparatus further includes:

[0062] a configuration storage module, configured to obtain server configuration information of the target device sent by the management device using a preset microcontroller, determine a corresponding first hash value based on the server configuration information, and store the first hash value in an on-chip memory of the preset microcontroller;

[0063] The device verification module is used to use a preset microcontroller to re-acquire the server configuration information of the target device sent by the management device, and re-determine the corresponding second hash value based on the server configuration information; compare the first hash value and the second hash value; if the first hash value and the second hash value are the same, control the preset microcontroller to start the preset interrupt service program; if the first hash value and the second hash value are different, determine that the target device currently has hardware tampering, and generate a corresponding second alarm signal, and send the second alarm signal to the management device.

[0064] In some specific embodiments, the device cover opening detection apparatus further includes:

[0065] An instruction sending module is used to use a microcontroller to obtain a data clearing instruction sent by a management device;

[0066] The event clearing module is used to clear the device cover opening event stored in the on-chip memory of the preset microcontroller based on the data clearing instruction, and reset the operation mode of the preset microcontroller to the preset low power consumption mode.

[0067] In some specific embodiments, the device cover opening detection apparatus further includes:

[0068] The signal generating module is used to directly generate a corresponding third alarm signal according to the device cover opening event when the target device is in a powered-on state, and send the third alarm signal to the management device through a preset bus.

[0069] In some specific embodiments, the device cover opening detection apparatus further includes:

[0070] The device power supply module is used to control the preset supercapacitor to power the preset microcontroller and set the operation mode of the preset microcontroller to the standby mode after the device cover opening event is stored.

[0071] For the description of the features in the embodiment corresponding to the device for detecting opening the cover of the device, please refer to the relevant description of the embodiment corresponding to the method for detecting opening the cover of the device, and no further details will be given here.

[0072] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0073] An embodiment of the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any of the above-mentioned device cover opening detection method embodiments.

[0074] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above-mentioned device cover opening detection method embodiments when running.

[0075] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0076] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of any of the above-mentioned device cover opening detection method embodiments are implemented.

[0077] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any of the above-mentioned device cover opening detection method embodiments are implemented.

[0078] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0079] The above is a detailed introduction to the device cover opening detection method, device, equipment and storage medium provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.

Claims

1. A device cover opening detection method, characterized in that: include: Utilizing a target interface of a preset microcontroller, a state change signal of a Hall sensor in a target device is received; the state change signal is a real-time signal generated by the Hall sensor when the position of a magnetic trigger element corresponding to the Hall sensor changes; Obtaining a real-time clock timestamp using the preset microcontroller based on the state change signal, and generating a device cover opening event based on the real-time clock timestamp and device information of the target device; When the target device is in a power-off state, storing the device cover-opening event in an on-chip memory of the preset microcontroller by using the preset microcontroller, and reading the device cover-opening event in the on-chip memory after the target device is restarted; A corresponding first alarm signal is generated according to the device cover opening event, and the first alarm signal is sent to the management device through a preset bus.

2. The device cover opening detection method according to claim 1, characterized in that: Before receiving the state change signal of the Hall sensor in the target device by using the target interface of the preset microcontroller, the method further includes: Initializing the preset microcontroller, setting the operation mode of the preset microcontroller to a preset low power consumption mode, and using a preset external interrupt interface of the preset microcontroller as the target interface so as to receive the state change signal by using the preset external interrupt interface; Accordingly, after receiving the state change signal of the Hall sensor in the target device, the method further includes: The preset microcontroller currently in the preset low power consumption mode is awakened according to the state change signal, so that the preset microcontroller starts a preset interrupt service program to obtain the real-time clock timestamp and generate the device cover opening event.

3. The device cover opening detection method according to claim 2, characterized in that: Before obtaining a real-time clock timestamp using the preset microcontroller based on the state change signal, the method further includes: Control the preset microcontroller to wait for a preset time period according to a preset delay waiting rule; If the sensor level represented by the state change signal remains unchanged within the preset time period, determining that the state change signal is a valid signal, so that the preset microcontroller starts the preset interrupt service routine; If the sensor level represented by the state change signal returns to a preset level within the preset time period, the state change signal is determined to be an invalid signal, and the preset interrupt service routine is stopped.

4. The device cover opening detection method according to claim 2, characterized in that: Before receiving the state change signal of the Hall sensor in the target device by using the target interface of the preset microcontroller, the method further includes: Using the preset microcontroller to obtain the server configuration information of the target device sent by the management device, determining a corresponding first hash value according to the server configuration information, and storing the first hash value in the on-chip memory of the preset microcontroller; Correspondingly, after waking up the preset microcontroller currently in the preset low power consumption mode according to the state change signal, the method further includes: Re-acquiring the server configuration information of the target device sent by the management device using the preset microcontroller, and re-determining the corresponding second hash value based on the server configuration information; comparing the first hash value and the second hash value; If the first hash value and the second hash value are the same, controlling the preset microcontroller to start the preset interrupt service routine; If the first hash value and the second hash value are different, it is determined that hardware tampering has occurred on the target device, and a corresponding second alarm signal is generated and sent to the management device.

5. The device cover opening detection method according to claim 2, characterized in that: After generating a corresponding first alarm signal according to the device cover opening event and sending the first alarm signal to the management device via a preset bus, the method further includes: Using the microcontroller to obtain a data clearing instruction sent by the management device; The device cover opening event stored in the on-chip memory of the preset microcontroller is cleared based on the data clearing instruction, and the operation mode of the preset microcontroller is reset to a preset low power consumption mode.

6. The device cover opening detection method according to claim 1, characterized in that: After generating the device cover opening event based on the real-time clock timestamp and the device information of the target device, the method further includes: When the target device is in a powered-on state, a corresponding third alarm signal is directly generated according to the device cover-opening event, and the third alarm signal is sent to the management device through the preset bus.

7. The device cover opening detection method according to any one of claims 1 to 6, characterized in that: The process of using the preset microcontroller to store the device cover opening event in the on-chip memory of the preset microcontroller further includes: The preset supercapacitor is controlled to supply power to the preset microcontroller, and after the device cover opening event is stored, the operation mode of the preset microcontroller is set to the standby mode.

8. A device for detecting when a cover is opened, characterized in that: include: A signal receiving module is configured to receive a state change signal from a Hall sensor in a target device using a target interface of a preset microcontroller; the state change signal is a real-time signal generated by the Hall sensor when the position of a magnetic trigger element corresponding to the Hall sensor changes; an event generating module, configured to obtain a real-time clock timestamp using the preset microcontroller based on the state change signal, and generate a device cover opening event based on the real-time clock timestamp and device information of the target device; an event reading module, configured to store the device cover opening event in an on-chip memory of the preset microcontroller by using the preset microcontroller when the target device is in a power-off state, and to read the device cover opening event from the on-chip memory after the target device is restarted; The signal sending module is used to generate a corresponding first alarm signal according to the device cover opening event, and send the first alarm signal to the management device through a preset bus.

9. An electronic device, characterized in that: include: memory for storing computer programs; A processor, configured to implement the steps of the device cover opening detection method as claimed in any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the device cover opening detection method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Server case monitoring and alarming system and method

    CN111158976A

  • Uncovering detection circuit integrated in MCU and uncovering detection method based on MCU

    CN111323626A

  • Uncovering detection system of server and server

    CN115906203A

  • Quick boot from halt by hall sensor smart cover

    US9971608B1