Unsafe behavior monitoring method and device and medium

By using electronic fences and cache queues in video monitoring and combining video frames to judge target behavior, the low accuracy and misjudgment problems of existing monitoring methods are solved, and higher monitoring accuracy and convenience of manual review are achieved.

CN120635977APending Publication Date: 2025-09-12SHENHUA SHENDONG COAL GRP +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510651149.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2025-09-12

AI Technical Summary

Technical Problem

Existing unsafe behavior monitoring methods have the problems of low accuracy and easy misjudgment.

Method used

A combination of electronic fences and cache queues is used to determine whether the monitored target enters or leaves the pre-demarcated electronic fence through video frames, and the relevant video frames are stored in the cache queue as a basis for manual review to avoid misjudgment.

Benefits of technology

It improves the monitoring accuracy of unsafe behaviors, reduces misjudgments, and facilitates manual review and archiving.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120635977A_ABST
    Figure CN120635977A_ABST
Patent Text Reader

Abstract

The invention discloses an unsafe behavior monitoring method and device and a medium. The method comprises the following steps: acquiring a video frame needing to be monitored; determining whether a monitoring target enters a pre-divided electronic fence or not according to the video frame; if yes, storing the video frame into a cache queue corresponding to the monitoring target; and if not, storing the video frame in the cache queue corresponding to the target determined as the unsafe behavior. According to the method, the electronic fence and the buffer queue are combined to monitor the unsafe behaviors, the video frames entering the electronic fence are used for joint monitoring, manual review is facilitated, and the monitoring accuracy of the unsafe behaviors is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of video monitoring, and in particular to a method, device and medium for monitoring unsafe behavior. Background Art

[0002] In our daily lives, for management and safety reasons, it's necessary to prohibit unsafe behaviors, such as the entry or exit of people or vehicles. Traditional monitoring methods rely on manual monitoring by personnel such as monitors or security personnel. However, this approach lacks objectivity, is significantly influenced by subjective factors, and cannot achieve real-time monitoring.

[0003] With the continuous development and popularization of information and intelligent technologies, the use of cameras to collect data and integrate it with artificial intelligence for real-time monitoring is gradually gaining popularity. This approach enables real-time, comprehensive monitoring, continuous monitoring and analysis of areas, and timely detection of anomalies and the implementation of appropriate measures, effectively maintaining regional safety and order. However, existing monitoring methods suffer from low accuracy and are prone to misjudgment. Summary of the Invention

[0004] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, the present invention provides a method for monitoring unsafe behaviors, which can improve the monitoring accuracy of unsafe behaviors.

[0005] The present invention also provides a device and a medium having the above-mentioned unsafe behavior monitoring method.

[0006] The method for monitoring unsafe behavior according to the first embodiment of the present invention includes:

[0007] Obtain the video frames required for monitoring;

[0008] Determining, based on the video frame, whether the monitored target enters a pre-demarcated electronic fence;

[0009] If yes, storing the video frame into the cache queue corresponding to the monitoring target;

[0010] If not, the video frames in the cache queue corresponding to the target determined to be the unsafe behavior are saved.

[0011] A method for monitoring unsafe behavior according to an embodiment of the present invention has at least the following beneficial effects: the present invention combines an electronic fence to determine unsafe behavior. If a monitoring target enters a pre-divided electronic fence, the video frame capturing the scene is stored in a cache queue corresponding to the monitoring target. If the monitoring target does not enter the pre-divided electronic fence, the monitoring target leaves the electronic fence, and then the video frames in the cache queue are used to determine whether the monitoring target has engaged in unsafe behavior. The video frames in the cache queue corresponding to the target determined to have engaged in unsafe behavior are stored as a basis for manual review to avoid misjudgment. The present invention combines an electronic fence and a cache queue to monitor unsafe behavior. By jointly monitoring video frames entering the electronic fence and facilitating manual review, the accuracy of monitoring unsafe behavior is improved.

[0012] According to some embodiments of the present invention, storing the video frame in a cache queue corresponding to the monitoring target includes:

[0013] Update the status queue corresponding to the monitoring target according to the video frame;

[0014] Storing the video frame in a cache queue corresponding to the monitoring target;

[0015] The state of the monitoring target is set to enter the electronic fence.

[0016] According to some embodiments of the present invention, saving the video frames in the cache queue corresponding to the target determined to have unsafe behavior includes:

[0017] Determine whether the state of the monitoring target is entering the electronic fence; if not, continue to obtain the video frame required for monitoring;

[0018] If so, setting the state of the monitoring target to leaving the electronic fence;

[0019] Determine whether the monitoring target has any unsafe behavior according to the status queue corresponding to the monitoring target; if not, continue to obtain the video frame required for monitoring;

[0020] If so, the video frames in the cache queue corresponding to the monitoring target are saved.

[0021] According to some embodiments of the present invention, if it is determined according to the status queue corresponding to the monitoring target that the monitoring target has unsafe behavior, after saving the video frames in the cache queue corresponding to the monitoring target, the method further includes:

[0022] Clear the status queue corresponding to the monitoring target;

[0023] Clear the cache queue corresponding to the monitoring target.

[0024] According to some embodiments of the present invention, determining whether the monitoring target has unsafe behavior according to the status queue corresponding to the monitoring target includes:

[0025] Determining the order in which the monitoring targets enter the electronic fences in sequence according to the status queues corresponding to the monitoring targets;

[0026] Determine whether the monitoring target has unsafe behavior according to the electronic fence sequence and a preset unsafe sequence.

[0027] According to some embodiments of the present invention, determining whether the monitoring target has unsafe behavior according to the status queue corresponding to the monitoring target includes:

[0028] Determine the electronic fence set that the monitoring target enters according to the status queue corresponding to the monitoring target;

[0029] Determine whether the monitoring target has unsafe behavior based on the electronic fence set and a preset unsafe set.

[0030] According to some embodiments of the present invention, determining, based on the video frame, whether the monitored target enters a pre-divided electronic fence includes:

[0031] Determining whether to start monitoring according to the video frame;

[0032] If not, the video frames in the cache queue corresponding to the target determined to be the unsafe behavior are saved;

[0033] If so, it is determined whether the monitoring target enters a pre-divided electronic fence.

[0034] According to some embodiments of the present invention, determining whether to start monitoring based on the video frame includes: determining whether a target enters an area to be monitored, or determining whether a signal sent by a device to be monitored is received based on the video frame;

[0035] If so, it is determined whether the monitored target enters a pre-divided electronic fence; if not, the video frames in the cache queue corresponding to the target determined to have unsafe behavior are saved.

[0036] An electronic device according to an embodiment of a second aspect of the present invention includes:

[0037] Memory, used to store programs;

[0038] A processor is used to execute the program stored in the memory. When the processor executes the program stored in the memory, the processor is used to execute the method as described in any one of the first aspects.

[0039] According to a third aspect of an embodiment of the present invention, a storage medium stores computer-executable instructions, where the computer-executable instructions are used to execute the method as described in any one of the first aspects.

[0040] Other features and advantages of the present invention will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present invention. The purposes and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The accompanying drawings are used to provide a further understanding of the technical solution of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the technical solution of the present invention and do not constitute a limitation to the technical solution of the present invention.

[0042] Figure 1 This is a flow chart of a method for monitoring unsafe behavior provided by one embodiment of the present invention;

[0043] Figure 2 is a flow chart of a method for monitoring unsafe behavior provided by another embodiment of the present invention;

[0044] Figure 3 This is a flow chart of a method for monitoring unsafe behavior provided by another embodiment of the present invention. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0046] It should be understood that in the description of the embodiments of the present invention, "multiple" (or multiple) means more than two, "greater than," "less than," and "exceed" are understood to exclude the number itself, and "above," "below," and "within" are understood to include the number itself. The terms "first," "second," and so on are used solely to distinguish technical features and are not to be construed as indicating or implying relative importance, or implicitly indicating the number of the indicated technical features, or implicitly indicating the order of the indicated technical features.

[0047] like Figure 1 As shown, an embodiment of the present invention provides a method for monitoring unsafe behavior, including:

[0048] Step S100: obtaining the video frame to be monitored;

[0049] Step S200: Determine whether the monitored target enters a pre-defined electronic fence based on the video frame;

[0050] If yes, execute step S300;

[0051] Step S300: storing the video frame into a cache queue corresponding to the monitoring target;

[0052] If not, proceed to step S400;

[0053] Step S400: Save the video frames in the cache queue corresponding to the target determined to have unsafe behavior.

[0054] This embodiment combines electronic fences to determine unsafe behavior. If a monitored target enters a pre-defined electronic fence, the video frames capturing the scene are stored in a cache queue corresponding to the monitored target. If the monitored target does not enter the pre-defined electronic fence, the monitored target has left the electronic fence. The video frames in the cache queue are then used to determine whether the monitored target has engaged in unsafe behavior. The video frames in the cache queue corresponding to the target determined to have engaged in unsafe behavior are then saved as a basis for manual review, thereby avoiding misjudgments. The present invention combines electronic fences and cache queues to monitor unsafe behavior. By jointly monitoring video frames entering the electronic fence and facilitating manual review and archiving, the accuracy of unsafe behavior monitoring is improved.

[0055] It should be noted that electronic fences may not be adjacent to each other and are suitable for complex scenarios (such as road intersections and factory restricted areas); the unsafe behavior monitored by this embodiment is entering a certain area, such as running a red light and entering a restricted area; technical personnel in this field can use this embodiment to monitor unsafe behaviors such as leaving a certain area.

[0056] like Figure 2 As shown, in one embodiment, in step S300, storing the video frame into the cache queue corresponding to the monitoring target includes:

[0057] Step S310: updating the status queue corresponding to the monitoring target according to the video frame;

[0058] Step S320: storing the video frame into a cache queue corresponding to the monitoring target;

[0059] Step S330: Set the state of the monitored target to enter the electronic fence.

[0060] In one embodiment, in step S310, updating the status queue corresponding to the monitoring target according to the video frame includes:

[0061] Determine whether there is a status queue corresponding to the monitoring target in the status list;

[0062] If so, update the status queue corresponding to the monitoring target according to the video frame;

[0063] If not, a state queue corresponding to the monitoring target is created in the state list and the state queue corresponding to the monitoring target is updated according to the video frame.

[0064] It should be noted that the status list includes a status queue corresponding to at least one monitoring target.

[0065] In one embodiment, updating a status queue corresponding to a monitoring target according to a video frame includes:

[0066] Obtaining the number of the electronic fence entered by the monitoring target and the time point when the monitoring target entered the electronic fence according to the video frame;

[0067] The number of the electronic fence entered by the monitoring target and the time point when the monitoring target enters the electronic fence are updated to the status queue corresponding to the monitoring target.

[0068] like Figure 2 As shown, in one embodiment, in step S400, saving the video frames in the cache queue corresponding to the target determined to be the unsafe behavior includes:

[0069] Step S410: Determine whether the state of the monitoring target is entering the electronic fence;

[0070] If not, continue to execute step S100;

[0071] If yes, proceed to step S420;

[0072] Step S420: setting the state of the monitored target to leaving the electronic fence;

[0073] Step S430: Determine whether the monitoring target has any unsafe behavior according to the status queue corresponding to the monitoring target; if not, continue to step S100;

[0074] If yes, execute step S440;

[0075] Step S440: Save the video frames in the cache queue corresponding to the monitoring target.

[0076] Only when the monitored target leaves the electronic fence can it be determined whether the monitored target has engaged in unsafe behavior; when there are multiple electronic fences, multiple electronic fences are combined for monitoring to improve monitoring accuracy.

[0077] It should be noted that the status of the monitoring target is a parameter, which can be stored in a status queue or in other containers. The status of the monitoring target includes entering the electronic fence and leaving the electronic fence, which is used to indicate the current positional relationship between the monitoring target and the electronic fence; the status queue corresponding to the monitoring target includes: the number of the electronic fence entered by the monitoring target and the time point when the monitoring target enters the electronic fence.

[0078] It should also be noted that the status queue corresponding to the monitoring target is stored in the status list. If the monitoring target leaves the monitoring area, step S410 includes determining whether the status of the monitoring target in the status list is entering the electronic fence.

[0079] like Figure 2 As shown, in one embodiment, if it is determined according to the status queue corresponding to the monitoring target that the monitoring target has unsafe behavior, after saving the video frames in the cache queue corresponding to the monitoring target, the method further includes:

[0080] Step S450: Clear the status queue corresponding to the monitoring target;

[0081] Step S460: Clear the cache queue corresponding to the monitoring target.

[0082] After determining that the monitored target has unsafe behavior and saving the video frames in the cache queue as a basis for review, the status queue and cache queue are cleared respectively; on the one hand, it can save storage space and avoid data redundancy causing slowdown; on the other hand, the monitored target may have a second (or multiple) unsafe behavior, which requires a second judgment. The unsafe behaviors that occur are saved separately to avoid misjudgment and improve accuracy.

[0083] In one embodiment, in step S430, determining whether the monitoring target has unsafe behavior according to the status queue corresponding to the monitoring target includes: a sequential mode and a non-sequential mode;

[0084] Sequential mode includes: the monitoring target enters all electronic fences in a preset unsafe order and is determined to have unsafe behavior;

[0085] The non-sequential mode includes: monitoring targets entering all electronic fences regardless of the order are determined to be unsafe behaviors.

[0086] Users can switch the drawn electronic fence between sequential mode and non-sequential mode in advance for each camera according to actual conditions.

[0087] For example, there are 6 electronic fences, numbered 1-6. Taking the sequential mode as an example, it is stipulated that entering 1-5 in sequence is determined to be an unsafe behavior. In this case, the monitoring target can only be determined to have an unsafe behavior if it enters 1-5 in sequence; taking the non-sequential mode as an example, it is stipulated that entering 1-6 in sequence is determined to be an unsafe behavior. In this case, the monitoring target can be determined to have an unsafe behavior if it enters 1-6, or enters 2-3-6-5-4-1 in sequence.

[0088] In one embodiment, in step S430, determining whether the monitoring target has unsafe behavior according to the status queue corresponding to the monitoring target includes:

[0089] Determine the order in which the monitoring targets enter the electronic fences according to the status queues corresponding to the monitoring targets;

[0090] Determine whether the monitored target has unsafe behavior based on the electronic fence sequence and the preset unsafe sequence.

[0091] In one embodiment, determining whether the monitoring target has unsafe behavior according to the electronic fence sequence and the preset unsafe sequence includes: if the electronic fence sequence is consistent with the preset unsafe sequence, then unsafe behavior exists; otherwise, no unsafe behavior exists.

[0092] In one embodiment, determining the order in which the monitoring targets enter the electronic fences in sequence according to the status queues corresponding to the monitoring targets includes:

[0093] The order of the electronic fences that the monitoring target enters is determined according to the number of the electronic fence entered by the monitoring target and the time point when the monitoring target enters the electronic fence; the number of the electronic fence entered by the monitoring target and the time point when the monitoring target enters the electronic fence are stored in the status queue corresponding to the monitoring target.

[0094] In one embodiment, in step S430, determining whether the monitoring target has unsafe behavior according to the status queue corresponding to the monitoring target includes:

[0095] Determine the electronic fence set that the monitoring target enters according to the status queue corresponding to the monitoring target;

[0096] Determine whether the monitoring target has unsafe behavior based on the electronic fence set and the preset unsafe set.

[0097] In one embodiment, determining whether the monitoring target has unsafe behavior according to the electronic fence set and the preset unsafe set includes: if the electronic fence set is consistent with the preset unsafe set, then the unsafe behavior exists; otherwise, no unsafe behavior exists.

[0098] In one embodiment, determining the set of electronic fences that the monitoring target enters according to the status queue corresponding to the monitoring target includes:

[0099] The set of electronic fences that the monitoring target enters in sequence is determined according to the numbers of the electronic fences that the monitoring target enters; wherein the numbers of the electronic fences that the monitoring target enters are stored in the state queue corresponding to the monitoring target.

[0100] like Figure 2 As shown, in one embodiment, in step S200, determining whether the monitored target enters a pre-divided electronic fence according to the video frame includes:

[0101] Step S210: Determine whether to start monitoring based on the video frame;

[0102] If not, proceed to step S400;

[0103] Step S400: saving the video frames in the cache queue corresponding to the target determined to be the unsafe behavior;

[0104] If yes, proceed to step S220;

[0105] Step S220: Determine whether the monitored target enters a pre-demarcated electronic fence.

[0106] It should be noted that the monitoring area is continuous, while the electronic fence is discontinuous; when the monitoring target leaves the monitoring area, it is considered that the monitoring target is not monitored; it is applicable to the situation where the monitoring target appears in the electronic fence and disappears from the monitoring area at the next monitoring moment, which improves applicability and accuracy and reduces missed judgments.

[0107] When entering non-connected electronic fences in sequence (taking entering electronic fence 1 and electronic fence 2 in sequence as an example) is determined to be an unsafe behavior, the monitored target enters electronic fence 1, the status queue is updated to "entered electronic fence 1", and the cache queue contains video frames of entering electronic fence 1 and the status is entering the electronic fence; but at the next monitoring moment, the monitored target disappears from the monitoring area, and it is considered that the monitored target has only entered electronic fence 1; and in the next video frame, the monitored target disappears from electronic fence 1 but appears in electronic fence 2, the status queue is updated to "entered electronic fence 2", the cache queue contains video frames of entering electronic fence 2 and the status is entering the electronic fence, and the monitored target then disappears from the monitoring area. At this time, the status queue knows that the monitored target has entered electronic fence 1 and electronic fence 2 in sequence, which is an unsafe behavior, so the video frames in the cache queue are saved to reduce missed judgments.

[0108] In one embodiment, determining whether to start monitoring based on the video frame includes: determining whether a target enters an area to be monitored based on the video frame, or determining whether a signal sent by a device to be monitored is received;

[0109] If so, it is determined whether the monitored target enters the pre-divided electronic fence; if not, the video frames in the cache queue corresponding to the target determined to have unsafe behavior are saved.

[0110] like Figure 3 As shown, in one embodiment, in step S220, if it is determined that the monitoring target has not entered the pre-divided electronic fence, step S420 is executed;

[0111] Step S420: The state of the monitored object is set to leaving the electronic fence. Since it has been determined that the monitored object has not entered the pre-defined electronic fence, there is no need to determine whether the state is entering the electronic fence.

[0112] like Figure 3 As shown, in one embodiment, in step S330, the state of the monitored target is set to enter the electronic fence; step S430 is executed;

[0113] Step S430: Determine whether the monitoring target has any unsafe behavior according to the status queue corresponding to the monitoring target. Since it has been determined that the monitoring target has entered the electronic fence, there is no need to set the status.

[0114] In one embodiment, determining whether a target has entered an area to be monitored based on a video frame includes:

[0115] The video frame is input into the target detection model, and the output result is used to determine whether there is a target entering the area to be monitored.

[0116] It should be noted that in order to speed up inference, redundant convolutional layers (mainly used for feature extraction, about 10% of the parameters) in target detection models (such as YOLOv5) were removed, reducing the amount of computation while maintaining detection accuracy (mAP@0.5 dropped by less than 5%) and adapting to edge devices.

[0117] In one embodiment, a method for tracking a monitoring target includes:

[0118] Obtaining a target tracking algorithm based on the resolution of the video frame, the speed of the monitored target, and the number of monitored targets in the video frame;

[0119] Track the detected target based on the target tracking algorithm and video frames.

[0120] Users can select target tracking algorithms such as deepsort and bot-sort. Furthermore, the input resolution is adjusted from the default 640x640 to the actual resolution of the video frame (e.g., 1920x1080) to minimize information loss caused by scaling. Within the target tracking algorithm, the matching distance threshold (default 0.7, adjustable to 0.5-1.0) is dynamically adjusted based on target speed and scene density, improving tracking stability in fast-moving scenes.

[0121] Dynamic adjustment is primarily based on preset values ​​in the solution, which include speed and density. When position variations between video frames increase, the threshold needs to be increased to tolerate larger position deviations and prevent tracking loss. Scene density is determined by the number of objects in the video frame. High-density scenes can easily cause object confusion, so the threshold needs to be reduced to increase the difficulty of matching.

[0122] In one embodiment, the electronic fence division method includes:

[0123] Get the coordinate points of the electronic fence according to the preset video frame resolution;

[0124] Draw a closed polygon based on the coordinate points of the electronic fence; the closed polygon is the electronic fence.

[0125] It should be noted that the geo-fence is defined by a set of points (x, y) to form a closed polygon. The coordinates are based on the actual resolution of the video frame (such as 1920x1080 or 2560x1440);

[0126] Point coordinates are stored in normalized form (range [0,1]), for example {"x":0.4,"y":0.21}, and are converted to pixel coordinates at runtime based on the actual resolution (e.g. x = 0.4*1920);

[0127] Multi-zone support: The system supports multiple electronic fences (for example, 1 to 5 zones), and each zone is assigned a unique ID (starting from 1 and increasing).

[0128] In one embodiment, in step S220, determining whether the monitored target enters a pre-defined electronic fence includes:

[0129] The bottom center point of the monitoring frame of the monitoring target or the center line of the bottom line of the detection frame is used as the judgment point;

[0130] Whether the monitored target enters the pre-divided electronic fence is determined based on the number of intersections between the closed polygon formed by the electronic fence and the judgment point; if it is an odd number, it is determined that the monitored target enters the pre-divided electronic fence; otherwise, it has not entered.

[0131] An embodiment of the present invention further provides an electronic device, which includes but is not limited to:

[0132] Memory, used to store programs;

[0133] The processor is used to execute the program stored in the memory. When the processor executes the program stored in the memory, the processor is used to execute the above-mentioned method for monitoring unsafe behavior.

[0134] The processor and the memory may be connected via a bus or other means.

[0135] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs, such as the method described in the embodiments of the present invention. The processor implements the above method by executing the non-transitory software programs and instructions stored in the memory.

[0136] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system and application programs required for at least one function; the data storage area may store and execute the above method. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0137] The non-transitory software program and instructions required to implement the above-mentioned terminal selection method are stored in the memory, and when executed by one or more processors, the above-mentioned method is executed.

[0138] An embodiment of the present invention further provides a storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to execute the above method.

[0139] In one embodiment, the storage medium stores computer-executable instructions that are executed by one or more control processors.

[0140] The embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

[0141] Those skilled in the art will appreciate that all or some of the steps and systems in the method disclosed above can be implemented as software, firmware, hardware, and appropriate combinations thereof. Some physical components or all physical components can be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, and the computer-readable medium can include computer storage media (or non-transitory media) and communication media (or temporary media). As known to those skilled in the art, the term computer storage media is included in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data) and is volatile and non-volatile, removable, and non-removable. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory, or other memory technology, CD-ROM, digital versatile disks (DVD), or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage, or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, as is well known to those skilled in the art, communication media typically includes computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0142] Embodiments of the present invention are described herein, including preferred embodiments known to the inventor for performing the present invention. After reading the above description, variations of these described embodiments will become apparent to those skilled in the art. The inventors expect that the skilled person will adopt such variations as appropriate, and the inventors intend to practice the embodiments of the present invention in a manner different from that specifically described herein. Therefore, as permitted by applicable law, the scope of the present invention includes all modifications and equivalents of the subject matter recited in the claims appended hereto. In addition, the scope of the present invention encompasses any combination of the above-mentioned elements in all possible variations thereof, unless otherwise indicated herein or otherwise clearly contradicted by the context.

Claims

1. A method for monitoring unsafe behavior, characterized in that: include: Obtain the video frames required for monitoring; Determining, based on the video frame, whether the monitored target enters a pre-demarcated electronic fence; If yes, storing the video frame into the cache queue corresponding to the monitoring target; If not, the video frames in the cache queue corresponding to the target determined to be the unsafe behavior are saved.

2. The method for monitoring unsafe behavior according to claim 1, characterized in that: Storing the video frame in a cache queue corresponding to the monitoring target includes: Update the status queue corresponding to the monitoring target according to the video frame; Storing the video frame in a cache queue corresponding to the monitoring target; The state of the monitoring target is set to enter the electronic fence.

3. The method for monitoring unsafe behavior according to claim 1, characterized in that: Saving the video frames in the cache queue corresponding to the target determined to be the unsafe behavior includes: Determine whether the state of the monitoring target is entering the electronic fence; if not, continue to obtain the video frame required for monitoring; If so, setting the state of the monitoring target to leaving the electronic fence; Determine whether the monitoring target has any unsafe behavior according to the status queue corresponding to the monitoring target; if not, continue to obtain the video frame required for monitoring; If so, the video frames in the cache queue corresponding to the monitoring target are saved.

4. The method for monitoring unsafe behavior according to claim 3, characterized in that: If it is determined according to the status queue corresponding to the monitoring target that the monitoring target has unsafe behavior, after saving the video frames in the cache queue corresponding to the monitoring target, the method further includes: Clear the status queue corresponding to the monitoring target; Clear the cache queue corresponding to the monitoring target.

5. The method for monitoring unsafe behavior according to claim 3, characterized in that: Determining whether the monitoring target has unsafe behavior according to the status queue corresponding to the monitoring target includes: Determining the order in which the monitoring targets enter the electronic fences in sequence according to the status queues corresponding to the monitoring targets; Determine whether the monitoring target has unsafe behavior according to the electronic fence sequence and a preset unsafe sequence.

6. The method for monitoring unsafe behavior according to claim 3, characterized in that: Determining whether the monitoring target has unsafe behavior according to the status queue corresponding to the monitoring target includes: Determine the electronic fence set that the monitoring target enters according to the status queue corresponding to the monitoring target; Determine whether the monitoring target has unsafe behavior based on the electronic fence set and a preset unsafe set.

7. The method for monitoring unsafe behavior according to claim 1, characterized in that: The determining, based on the video frame, whether the monitored target enters a pre-divided electronic fence includes: Determining whether to start monitoring according to the video frame; If not, the video frames in the cache queue corresponding to the target determined to be the unsafe behavior are saved; If so, it is determined whether the monitoring target enters a pre-divided electronic fence.

8. The method for monitoring unsafe behavior according to claim 7, characterized in that: The determining whether to start monitoring according to the video frame includes: determining whether a target enters an area to be monitored, or determining whether a signal sent by a device to be monitored is received according to the video frame; If so, it is determined whether the monitored target enters a pre-divided electronic fence; if not, the video frames in the cache queue corresponding to the target determined to have unsafe behavior are saved.

9. An electronic device, characterized in that: include: Memory, used to store programs; A processor, configured to execute the program stored in the memory. When the processor executes the program stored in the memory, the processor is configured to execute the method according to any one of claims 1 to 8.

10. A storage medium, characterized in that: Computer-executable instructions are stored, and the computer-executable instructions are used to execute the method according to any one of claims 1 to 8.