Door lock monitoring method and device for energy storage box, storage medium and terminal
By applying different colors of reflective paint on the door lock of the energy storage system and using image processing technology to identify the lock lever and lock position, the safety hazards and system operation impacts when the door lock is not closed are solved, and an accurate and reliable door is achieved Lock monitoring and alarm reduce maintenance costs and security risks.
Patent Information
- Application Number
- CN202411295587.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-01-07
AI Technical Summary
The door locks of the energy storage system are not closed or opened by mistake, which increases safety risks and affects the normal operation of the system. The existing sensor methods have problems such as high hardware costs, complex installation and susceptible to environmental factors.
By applying reflective paint of different colors on the door lock, the monitoring device takes pictures and the positional relationship between the lock lever and the lock is identified through image processing technology, and combining the HSV color model and thresholding process, the opening and closing status of the door lock is accurately identified. , and send an alarm signal when it is not closed normally.
Accurate, reliable, real-time and remote monitoring of the door lock status of the energy storage system, reduce maintenance costs and safety risks, and ensure the safe and stable operation of the system.
Smart Images

Figure CN119274128A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of door lock monitoring, and in particular to a door lock monitoring method, device, storage medium and terminal for use on an energy storage box. Background Art
[0002] Key areas of the energy storage system, such as various equipment rooms and battery rooms, are equipped with door locks to restrict the entry of unauthorized personnel and prevent equipment damage or safety accidents caused by human factors or natural factors (such as dust, foreign objects, small animals, etc.). However, in practice, the door locks of the energy storage system are often not closed or opened by mistake, which not only increases safety risks, but also may have a serious impact on the normal operation of the energy storage system.
[0003] Traditional door lock monitoring methods mostly rely on physical methods such as magnetic switches and contact sensors to detect the open and closed status of door locks. Although these methods can achieve door lock status monitoring to a certain extent, installing sensors will increase additional hardware costs and installation complexity, and the sensors themselves may malfunction due to environmental factors such as moisture and corrosion or long-term use, resulting in false alarms or missed alarms.
[0004] Therefore, how to solve the deficiencies and shortcomings of existing technologies through effective door lock monitoring methods has become an important issue that researchers in this field need to solve urgently. Summary of the invention
[0005] The purpose of the present invention is to address the above-mentioned problems and to provide a door lock monitoring method, device, storage medium and terminal for an energy storage box.
[0006] The technical solution of the present invention is: a door lock monitoring method for an energy storage box, wherein the energy storage box is provided with a monitoring device for photographing the door lock; the door lock comprises a lock rod and a lock buckle, when the door lock is in a closed state, the lock rod is placed in the lock buckle, the lock buckle is coated with a first color of reflective paint around it, and the lock rod is coated with a second color of reflective paint, and the door lock monitoring method comprises the following steps: obtaining a to-be-detected picture of the door lock, an HSV range of a first color, and an HSV range of a second color, wherein the to-be-detected picture is an RGB picture; converting the color type of the to-be-detected picture into an HSV color model, and thresholding the to-be-detected picture based on the HSV range of the first color to obtain a first image containing only a first color area; if the pixel values in the first image are all 0, the door lock is in an open state; if the first image contains a number of non-zero pixels, obtaining a first coordinate set P of the number of non-zero pixels 1 =
[0007] {(x 1 ,y 1 ),(x 2 ,y2 ),...(x i ,y i ),...,(x n ,y n )}; Based on the first coordinate set P 1 In the picture to be detected, intercept the first color area to obtain an intercepted picture; Based on the HSV range of the second color, perform thresholding on the intercepted picture to obtain a second image that only contains the second color area; If the pixel values in the second image are all 0, the door lock is in the open state, where i and n are both positive integers, 0 < i ≤ n; If there are several non-zero pixels in the second image, obtain the second coordinate set P 2 ={(x ′ 1 ,y ′ 1 ),(x ′ 2 ,y ′ 2 ),...,(x j ′ ,y j ′ ),...,(x ′ m ,y ′ m )}; If x ′ min,j >x min,i , x ′ max,j <x max,i and y ′ min,j >y min,i , y ′ max,j <y max,i , then the door lock is in the closed state, where j and m are both positive integers, 0 < j ≤ m.
[0008] As an improvement of the embodiment of the present invention, the monitoring device is further provided with a flash light, and the flashing interval of the flash light is m minutes, where m is a constant greater than 0; The door lock photo taken by the monitoring device when the flash light flashes is the photo to be detected.
[0009] As an improvement of the embodiment of the present invention, the energy storage box is further provided with an alarm device, and the alarm device is used to send an alarm signal indicating that the door lock is not normally closed when the door lock is in the open state.
[0010] As an improvement of the embodiment of the present invention, the first color is blue and the second color is white.
[0011] As an improvement of the embodiment of the present invention, the HSV range of the first color is 100. <h 1 <124,43 1 <255,46 <v 1 <255, the HSV range of the second color is 0 <h 2 <180,0 2 <30,221 <v 2 <255.
[0012] As an improvement to the embodiment of the present invention, the first image is a binary image containing only the first color region, and the second image is a binary image containing only the second color region.
[0013] As an improvement to the embodiment of the present invention, the shapes of the first color area and the second color area are both rectangular.
[0014] To achieve one of the above-mentioned objects, an embodiment of the present invention provides a door lock monitoring device for an energy storage system, wherein the energy storage box is provided with a monitoring device for photographing the door lock; the door lock comprises a lock rod and a lock buckle, and when the door lock is in a closed state, the lock rod is placed in the lock buckle, the lock buckle is coated with a first color of reflective paint around it, and the lock rod is coated with a second color of reflective paint, and the door lock monitoring device comprises the following modules:
[0015] An information acquisition module, used to acquire a to-be-detected picture of the door lock, an HSV range of a first color, and an HSV range of a second color, wherein the to-be-detected picture is an RGB picture;
[0016] A processing module, used for converting the color type of the image to be detected into an HSV color model, and performing threshold processing on the image to be detected based on the HSV range of the first color to obtain a first image containing only the first color area;
[0017] A monitoring module, for obtaining a first coordinate set of the plurality of non-zero pixels if the pixel values in the first image are all 0, indicating that the door lock is in an open state; and for obtaining a first coordinate set of the plurality of non-zero pixels if the first image contains a plurality of non-zero pixels.
[0018] P 1 ={(x 1 ,y 1 ),(x 2 ,y 2 ),...(x i ,y i ),...,(x n ,y n )}; Based on the first coordinate set P 1 In the to-be-detected picture, intercept a first color area to obtain an intercepted picture; perform thresholding processing on the intercepted picture based on the HSV range of the second color to obtain a second image only containing the second color area; if the pixel values in the second image are all 0, the door lock is in an open state, where both i and n are positive integers, and 0 < i ≤ n; if there are several non-zero pixels in the second image, obtain a second coordinate set P 2 = {(x ′ 1 , y ′ 1 ), (x ′ 2 , y ′ 2 ),..., (x j ′ , y j ′ ),..., (x ′ m , y ′ m )}; if x ′ min,j > x min,i , x ′ max,j < x max,i and y ′ min,j > y min,i , y ′ max,j < y max,i , the door lock is in a closed state, where both j and m are positive integers, and 0 < j ≤ m.
[0019] To achieve one of the above-mentioned invention purposes, an embodiment of the present invention provides a storage medium storing program instructions, and when the program instructions are executed, the door lock monitoring method described in any one of the above is implemented.
[0020] To achieve one of the above-mentioned invention purposes, an embodiment of the present invention provides a terminal including a processor and a memory, the memory stores program instructions, and the processor runs the program instructions to implement the door lock monitoring method described in any one of the above.
[0021] The door lock monitoring method, device, storage medium and terminal provided in the embodiments of the present invention have the following advantages: the present invention coats the lock rod and lock buckle of the energy storage system door lock with reflective paint of different colors, uses a monitoring device to take a picture of the door lock and obtains the position relationship between the lock rod and the lock buckle (that is, the relative position of the non-zero pixel coordinate set) through image processing and recognition technology, accurately identifies the open and closed state of the door lock, and sends an alarm signal when the door lock is not closed normally, thereby realizing accurate, reliable, real-time and remote monitoring of the door lock state of the energy storage system, effectively reducing maintenance costs and safety risks, and providing a strong guarantee for the safe and stable operation of the energy storage system. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 It is a flow chart of the door lock monitoring method of the present invention. DETAILED DESCRIPTION
[0023] The present invention will be described in detail below in conjunction with the specific embodiments shown in the accompanying drawings. However, these embodiments do not limit the present invention, and any structural, methodological, or functional changes made by a person skilled in the art based on these embodiments are all within the scope of protection of the present invention.
[0024] If the present invention involves directions (for example, up, down, left, right, front, back, outside, inside, etc.) when describing, it is necessary to define the directions involved.
[0025] The scope of the embodiments herein includes the entire scope of the claims, and all available equivalents of the claims.Herein, the terms "first", "second", etc. are only used to distinguish one element from another, without requiring or implying any actual relationship or order between these elements.In fact, the first element can also be called the second element, and vice versa.Moreover, the terms "include", "comprise" or any other variant thereof are intended to cover non-exclusive inclusion, so that the structure, device or equipment including a series of elements not only include those elements, but also include other elements not clearly listed, or also include elements inherent to such structure, device or equipment.In the absence of more restrictions, the elements limited by the statement "include one..." do not exclude the existence of other identical elements in the structure, device or equipment including the elements.Each embodiment herein is described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same similar parts between each embodiment can be referred to each other.
[0026] The terms "longitudinal", "lateral", "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc. in this document indicate the orientation or position relationship based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing this document and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as a limitation on the present invention. In the description of this document, unless otherwise specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a mechanical connection or an electrical connection, it can also be the internal communication of two elements, it can be a direct connection, or it can be indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0027] Embodiment 1 of the present invention provides a door lock monitoring method for an energy storage box, wherein the energy storage box is provided with a monitoring device for photographing the door lock, the monitoring device is provided with a flash, the flashing interval of the flash is m minutes, wherein m is a constant greater than 0; the door lock comprises a locking rod and a lock buckle, when the door lock is in a closed state, the locking rod is placed in the lock buckle, the lock buckle is coated with a first color of reflective paint around it, and the locking rod is coated with a second color of reflective paint.
[0028] like Figure 1 As shown, the door lock monitoring method comprises the following steps:
[0029] Step 101: Obtain a to-be-detected picture of the door lock, an HSV range of a first color, and an HSV range of a second color, wherein the to-be-detected picture is an RGB picture;
[0030] Here, a monitoring video stream can be obtained from the monitoring device, and a key frame when a flash light flashes can be identified in the monitoring video stream as a picture to be detected. In practice, a method for identifying a key frame can be to convert any frame in the monitoring video stream into a grayscale image and calculate the average brightness of the grayscale image corresponding to each frame. When the difference in average brightness of any two adjacent frames is greater than a preset threshold, the frame with a larger average brightness is a key frame.
[0031] In practice, the first color and the second color may be a color combination with high contrast. Preferably, in the present invention, the first color is blue, the second color is white, and the HSV range of the first color is 100. <h 1 <124,43 1 <255,46 <v 1 <255, the HSV range of the second color is 0 <h 2 <180,0 2 <30,221 <v 2 <255, it is understandable that the combination of blue and white high-contrast color reflective paint will reflect strong light when the flash light flashes, which is convenient for identifying the position of the lock rod and lock buckle in the door lock and improves the accuracy of monitoring.
[0032] Step 102: converting the color type of the image to be detected into an HSV color model, and performing threshold processing on the image to be detected based on the HSV range of the first color to obtain a first image containing only the first color area;
[0033] Here, the HSV (Hue, Saturation, Value) color model is a color space established based on the intuitive characteristics of color. The color parameters in the HSV color model are: hue, saturation and brightness. In practice, the color type of the image to be detected can be converted to the HSV color model by the following method: Get the R, G, B values of the image to be detected, R ′ =R / 255, G ′ =G / 255,B ′ =B / 255,C max =max(R ′ ,G ′ ,B ′ ), C min =min(R ′ ,G ′ ,B ′ ), ΔC=C max -C min ; V=C max The first image is a binary image containing only the first color area, and the second image is a binary image containing only the second color area. The image to be detected can be thresholded using a bimodal method, a P parameter method, an iterative method, or an OTSU method to obtain a binary image containing only the second color and a binary image containing only the first color.
[0034] Step 103: If the pixel values in the first image are all 0, the door lock is in an open state; if the first image contains a number of non-zero pixels, obtain a first coordinate set of the number of non-zero pixels
[0035] P 1 ={(x 1 ,y 1 ),(x 2 ,y 2 ),...(x i ,y i ),...,(x n ,y n)}; Based on the first coordinate set P 1 In the image to be detected, intercept the first color area to obtain an intercepted image; perform thresholding processing on the intercepted image based on the HSV range of the second color to obtain a second image containing only the second color area; if the pixel values in the second image are all 0, then the door lock is in the open state, where both i and n are positive integers, 0 < i ≤ n; if there are several non-zero pixels in the second image, obtain the second coordinate set P 2 ={(x ′ 1 , y ′ 1 ), (x ′ 2 , y ′ 2 ),..., (x h ′ , y h ′ ),..., (x ′ m , y ′ m )}; if x ′ min,j > x min,i , x ′ max,j < x max,i and y ′ min,j > y min,i , y ′ max,j < y max,i , then the door lock is in the closed state, where both j and m are positive integers, 0 < j ≤ m.
[0036] In practice, when the image to be detected contains both the area of the first color and the area of the second color, and the area of the second color is within the area of the first color, it indicates that the door lock is in the closed state. Preferably, the shapes of the first color area and the second color area are both rectangles. It can be understood that the boundaries of the rectangles are clear and regular, which are easy to be accurately recognized by image processing technology. Therefore, when the door lock state is reflected by the relative positions of the rectangles, the monitoring efficiency can be improved and the misjudgment rate can be reduced.
[0037] In this embodiment, the energy storage box body is further provided with an alarm device, and the alarm device is used to emit an alarm signal indicating that the door lock is not normally closed when the door lock is in the open state.
[0038] In practice, the alarm device notifies the supervisor that the door lock of the energy storage system is not in a normal closed state through alarm signals in forms such as sound reminder, text reminder, and touch reminder, so as to achieve accurate, reliable, real-time, and remote monitoring of the door lock state of the energy storage system.
[0039] Embodiment 2 of the present invention provides a door lock monitoring device for an energy storage system. The energy storage box body is provided with a monitoring device for photographing the door lock. The door lock includes a lock rod and a lock catch. When the door lock is in a closed state, the lock rod is placed inside the lock catch. The periphery of the lock catch is coated with a reflective paint of a first color, and the lock rod is coated with a reflective paint of a second color. The door lock monitoring device includes the following modules:
[0040] An information acquisition module, configured to acquire a to-be-detected picture of the door lock, the HSV range of the first color, and the HSV range of the second color, where the to-be-detected picture is an RGB picture;
[0041] A processing module, configured to convert the color type of the to-be-detected picture into an HSV color model, and perform thresholding processing on the to-be-detected picture based on the HSV range of the first color to obtain a first image only including the first color area;
[0042] A monitoring module, configured to: if the pixel values in the first image are all 0, then the door lock is in an open state; if there are several non-zero pixels in the first image, then acquire a first coordinate set P of the several non-zero pixels 1 ={(x 1 ,y 1 ),(x 2 ,y 2 ),...(x i ,y i ),...,(x n ,y n )}; based on the first coordinate set P 1 intercept the first color area in the to-be-detected picture to obtain an intercepted picture; perform thresholding processing on the intercepted picture based on the HSV range of the second color to obtain a second image only including the second color area; if the pixel values in the second image are all 0, then the door lock is in an open state, where i and n are both positive integers, 0 < i ≤ n; if there are several non-zero pixels in the second image, then acquire a second coordinate set P of the several non-zero pixels 2 ={(x ′ 1 ,y ′ 1 ),(x ′ 2 ,y ′ 2 ),...,(xj ′ ,y j ′ ),...,(x ′ m ,y ′ m )}; if x ′ min,j >x min,i , x ′ max,j <x max,i And y ′ min,j >y min,i ,y ′ max,j <y max,i , then the door lock is in the closed state, where j and m are both positive integers, 0 <j≤m。
[0043] Embodiment 3 of the present invention provides a storage medium storing program instructions, which, when executed, implement the door lock monitoring method as described in Embodiment 1 and Embodiment 2.
[0044] Embodiment 4 of the present invention provides a terminal, including a processor and a memory, wherein the memory stores program instructions, and the processor executes the program instructions to implement the door lock monitoring method as described in Embodiment 1 and Embodiment 2.
[0045] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0046] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0047] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0048] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0049] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention.
Claims
1. A method for monitoring a door lock on an energy storage box, wherein the energy storage box is provided with a monitoring device for photographing the door lock; the door lock comprises a lock rod and a lock buckle, when the door lock is in a closed state, the lock rod is placed in the lock buckle, the outer surface of the energy storage box is coated with a reflective paint of a first color in the area around the lock buckle, and the lock rod is coated with a reflective paint of a second color, characterized in that: It includes the following steps: Obtain a picture to be detected of the door lock, the HSV range of the first color, and the HSV range of the second color, where the picture to be detected is an RGB picture; Convert the color type of the picture to be detected into the HSV color model, and perform threshold processing on the picture to be detected based on the HSV range of the first color to obtain a first image that only contains the area of the first color; if the pixel values in the first image are all 0, the door lock is in the open state; If the first image contains a number of non-zero pixels, a first coordinate set P1 of the non-zero pixels is obtained, which is equal to {(x1, y1), (x2, y2), ... (x i ,y i ),...,(x n ,y n )}; based on the first coordinate set P1, a first color area is intercepted in the image to be detected to obtain a intercepted image; based on the HSV range of the second color, the intercepted image is thresholded to obtain a second image containing only the second color area; If the pixel values in the second image are all 0, the door lock is in the open state, where both i and n are positive integers, and 0 < i ≤ n; If the second image contains a number of non-zero pixels, then obtain a second coordinate set P2 of the number of non-zero pixels = {(x ′ 1,y ′ 1),(x ′ 2,y ′ 2),...,(x j ′ ,y j ′ ),...,(x ′ m ,y ′ m )}; if x ′ min,j >x min,i , x ′ max,j <x max,i And y ′ min,j >y min,i ,y ′ max,j <y max,i , then the door lock is in the closed state, where j and m are both positive integers, 0 <j≤m。 2. The door lock monitoring method according to claim 1, characterized in that: The monitoring device is also provided with a flash, and the flashing interval of the flash is m minutes, where m is a constant greater than 0; the picture of the door lock taken by the monitoring device when the flash flashes is the picture to be detected.
3. The door lock monitoring method according to claim 1, characterized in that: The energy storage box is also provided with an alarm device, and the alarm device is used to emit an alarm signal indicating that the door lock is not normally closed when the door lock is in the open state.
4. The door lock monitoring method according to claim 1, characterized in that: The first color is blue, and the second color is white.
5. The door lock monitoring method according to claim 1, characterized in that: The HSV range of the first color is 100 < h1 < 124, 43 < s1 < 255, 46 < v1 < 255, and the HSV range of the second color is 0 < h2 < 180, 0 < s2 < 30, 221 < v2 < 255.
6. The door lock monitoring method according to claim 1, characterized in that: The first image is a binary image that only contains the area of the first color, and the second image is a binary image that only contains the area of the second color.
7. The door lock monitoring method according to claim 1, characterized in that: The shapes of the area of the first color and the area of the second color are both rectangles.
8. A door lock monitoring device for an energy storage system, wherein the energy storage box is provided with a monitoring device for photographing the door lock; the door lock comprises a lock rod and a lock buckle, when the door lock is in a closed state, the lock rod is placed in the lock buckle, the lock buckle is coated with a first color of reflective paint around it, and the lock rod is coated with a second color of reflective paint, characterized in that: It includes the following modules: An information acquisition module, which is used to obtain a picture to be detected of the door lock, the HSV range of the first color, and the HSV range of the second color, where the picture to be detected is an RGB picture; A processing module, which is used to convert the color type of the picture to be detected into the HSV color model, and perform threshold processing on the picture to be detected based on the HSV range of the first color to obtain a first image that only contains the area of the first color; The monitoring module is used for obtaining a first coordinate set P1={(x1, y1), (x2, y2), ... (x i ,y i ),...,(x n ,y n )}; based on the first coordinate set P1, a first color area is intercepted in the image to be detected to obtain a intercepted image; based on the HSV range of the second color, the intercepted image is thresholded to obtain a second image containing only the second color area; If the pixel values in the second image are all 0, the door lock is in the open state, where both i and n are positive integers, and 0 < i ≤ n; if there are several non-zero pixels in the second image, obtain the second coordinate set P2 of the several non-zero pixels, P2 = {(x ′ 1, y ′ 1), (x ′ 2, y ′ 2),..., (x j ′ , y j ′ ),..., (x ′ m , y ′ m )}; if x ′ min,j > x min,i , x ′ max,j < x max,i and y ′ min,j > y min,i , y ′ max,j < y max,i , the door lock is in the closed state, where both j and m are positive integers, and 0 < j ≤ m.
9. A storage medium storing program instructions, characterized in that: When the program instructions are executed, the door lock monitoring method described in any one of claims 1 to 7 is implemented.
10. A terminal, characterized in that: It includes a processor and a memory, the memory stores program instructions, and the processor runs the program instructions to implement the door lock monitoring method described in any one of claims 1 to 7.