Event-driven video monitoring resource optimization method and device

By using an event-driven video surveillance resource optimization method, structured event signals are generated at the front end and resources are dynamically scheduled at the back end. This solves the problem of wasted network bandwidth and computing power in video surveillance systems, achieves efficient resource utilization and on-demand analysis, and improves the system's operating efficiency and economy.

CN121547554APending Publication Date: 2026-02-17CHINA UNICOM ONLINE INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511594955.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-03
Publication Date
2026-02-17

AI Technical Summary

Technical Problem

Existing video surveillance systems suffer from massive network bandwidth consumption and insufficient computing power utilization in deployment scenarios with tens of thousands of channels. The traditional continuous streaming mode leads to invalid data processing, lacks a dynamic resource scheduling system, and cannot achieve coordinated optimization of bandwidth cost and computing power utilization.

Method used

An event-driven video surveillance resource optimization method is adopted. A structured event start signal is generated by a lightweight event detection module at the front end. The back end dynamic scheduling controller parses and allocates computing resources. When the front end detects the disappearance of the target or a static timeout, it generates a termination signal. The back end stops pulling video streams and triggers resource reclamation based on the termination signal. If no termination signal is received, the GPU/TPU cluster is forcibly reclaimed through a watchdog mechanism.

Benefits of technology

It significantly reduces network bandwidth consumption and backend computing resource waste in video surveillance systems, improves system resource utilization and operating efficiency, enables on-demand transmission and analysis, and enhances the utilization rate of GPU/TPU clusters and the overall system economy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121547554A_ABST
    Figure CN121547554A_ABST
Patent Text Reader

Abstract

The invention provides a video monitoring resource optimization method and device based on event driving, and the method comprises the steps: enabling front-end equipment to operate a lightweight event detection module, calculating the pixel change area and texture features of continuous frames through a frame difference method or a background modeling algorithm, and carrying out the calculation of the pixel change area and texture features of the continuous frames; generating a structured event initial signal containing the device ID, the timestamp and the event type; the back-end dynamic scheduling controller analyzes the event signal, pulls a video stream based on an RTSP / ONVIF protocol, and dynamically allocates computing power from a GPU / TPU resource pool through a resource management module to start an AI analysis task; when target disappearance or static timeout is detected, the front end generates an event termination signal, and the rear end stops the video stream and triggers resource recovery according to the event termination signal; and if the termination signal is missing, forcibly recovering the computing power resource according to the maximum analysis duration through a watchdog mechanism. According to the invention, on-demand allocation and intelligent release of computing power resources in the video monitoring system are realized, and long-term occupation of computing power and resource waste are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of monitoring, in particular to a video monitoring resource optimization method and device based on event driving. BACKGROUND

[0002] As the core infrastructure of smart city and industrial security, video monitoring system is widely used in real-time monitoring of large-scale scenes. With the deployment of millions of high-definition / ultra-high-definition cameras, the traditional video monitoring technology system has formed a fixed architecture of "continuous front-end push stream + back-end full-time analysis". Specifically, this technology covers the complete processing link from image acquisition, streaming media transmission to AI analysis, in which the front-end device transmits the original video stream to the cloud in real time through the RTSP / ONVIF protocol, and the back-end relies on GPU / TPU cluster to perform deep analysis tasks such as target detection and behavior recognition on full-quantity video stream. Based on this, the existing system realizes picture change detection through basic algorithms such as frame difference method and GMM background modeling, but the detection result is only used as the trigger condition of front-end push stream, and a complete event life cycle management mechanism has not been formed.

[0003] However, in the existing video monitoring method, the continuous push stream mode is directly used, and a dynamic resource scheduling system is not established, which may cause a large amount of consumption of network bandwidth resources (especially uplink), and the cost ratio can reach more than 70% of the operating cost. Specifically, when the picture is in a static state, the existing technology usually transmits the video stream with a fixed code rate, resulting in the processing of invalid data for more than 90% of the time, causing the GPU / TPU cluster resources to be idle. In wireless / cross-border transmission scenarios, the bandwidth bottleneck is particularly prominent, and the problem of less than 10% utilization of computing power resources exacerbates the demand for hardware cluster size and operation and maintenance cost. In addition, the traditional event triggering mechanism lacks termination signal control, and only starts the back-end analysis through the front-end detection result, which cannot realize the active recovery of resources, and may cause abnormal occupation of container instances or GPU resource deadlock. This one-way triggering mode and the lack of resource pooling management make it difficult for the system to realize the coordinated optimization of bandwidth cost and computing power utilization in the scenario of millions of deployments. SUMMARY

[0004] The present application aims to at least partially solve one of the technical problems in the related art.

[0005] To this end, a first object of the present application is to propose a video monitoring resource optimization method based on event driving.

[0006] A second object of the present application is to propose a video monitoring resource optimization device based on event driving.

[0007] A third object of the present application is to propose an electronic device.

[0008] The fourth objective of this invention is to provide a computer-readable storage medium.

[0009] The fifth objective of this invention is to provide a computer program product.

[0010] To achieve the above objectives, a first aspect of the present invention proposes an event-driven video surveillance resource optimization method, comprising: S1, a front-end device runs a lightweight event detection module, calculates the pixel change area and texture features of consecutive frames using frame difference or background modeling algorithms, and generates a structured event start signal containing a device ID, timestamp, and event type; S2, a back-end dynamic scheduling controller parses the event start signal, initiates a video stream pull request to the front-end device based on the RTSP / ONVIF protocol, and allocates computing power resources from the GPU / TPU resource pool through a resource management module to start an AI analysis task; S3, when the front-end device detects target disappearance or static timeout conditions, it generates a structured event termination signal containing a unique event ID and an end timestamp, and the back-end dynamic scheduling controller stops video stream pull and triggers a resource reclamation process based on the termination signal; S4, if the event termination signal is not received, the back-end dynamic scheduling controller forcibly reclaims computing power resources and releases the GPU / TPU cluster through a watchdog mechanism based on a preset maximum analysis duration and last heartbeat time.

[0011] In one embodiment of the present invention, the front-end device runs a lightweight event detection module, which calculates the pixel change area and texture features of consecutive frames using frame difference or background modeling algorithms, and generates a structured event start signal containing device ID, timestamp, and event type. The module further includes: S11, calculating the pixel change area of ​​consecutive frames using the inter-frame difference method, and using the formula... Calculate the sum of absolute differences, where and These represent the height and width of the video frame, respectively; S12, extracts texture features using a Gaussian Mixture Model (GMM), and when the texture gradient magnitude of the changing region exceeds a preset threshold... And the consistency of the direction of movement exceeds The event is then determined to be a valid event.

[0012] In one embodiment of the present invention, the backend dynamic scheduling controller parses the event start signal, initiates a video stream pull request to the frontend device based on the RTSP / ONVIF protocol, and allocates computing resources from the GPU / TPU resource pool through the resource management module to start the AI ​​analysis task, further comprising: S21, encapsulating the event signal in JSON or Protocol Buffers format, wherein the Start signal contains fields , , , and S22, event signals are transmitted via a publish / subscribe (Pub / Sub) message queue. Backend subscribers dynamically adjust the streaming priority based on load conditions, using a formula... Calculate task priority, where Indicates the idle time of computing power. Indicates the duration of the event. These are the weighting coefficients.

[0013] In one embodiment of the present invention, when the front-end device detects the disappearance of the target or a static timeout condition, generating a structured event termination signal containing a unique event ID and an end timestamp further includes: S31, when the visibility of the target within the monitoring area is continuous... Frames below the threshold S32, when the target disappears; Exceeding the user-configured silent timeout period The termination signal is triggered at time, where Available Dynamically adjusted within a second.

[0014] In one embodiment of the present invention, if the event termination signal is not received, the backend dynamic scheduling controller forcibly reclaims computing resources and releases the GPU / TPU cluster through a watchdog mechanism based on a preset maximum analysis time and the last heartbeat time, further includes: S41, when the event analysis time... Exceeding the preset maximum allowed duration Forced recycling is triggered at time S42, when the device's last heartbeat time... The difference from the current time exceeds If no valid event signal is received, the device is deemed abnormal and resource reclamation is performed.

[0015] In one embodiment of the present invention, it further includes: S5, the front-end device performs a preprocessing step after video acquisition, including image noise reduction processing, fisheye lens geometric correction, and resolution scaling. ,in and Image size parameters adapted for the detection module.

[0016] To achieve the above objectives, a second aspect of the present invention proposes an event-driven video surveillance resource optimization device, comprising: an event detection and signal generation module, used by a front-end device to run a lightweight event detection module, calculate the pixel change area and texture features of consecutive frames using frame difference method or background modeling algorithm, and generate a structured event start signal containing device ID, timestamp, and event type; an event parsing and resource scheduling module, used by a back-end dynamic scheduling controller to parse the event start signal, initiate a video stream pull request to the front-end device based on the RTSP / ONVIF protocol, and allocate computing power resources from the GPU / TPU resource pool through a resource management module to start an AI analysis task; an event termination signal generation module, used by the front-end device to generate a structured event termination signal containing a unique event ID and an end timestamp when the target disappears or a static timeout condition is detected, and the back-end dynamic scheduling controller stops video stream pull and triggers a resource reclamation process according to the termination signal; and a resource forced reclamation module, used by the back-end dynamic scheduling controller to forcibly reclaim computing power resources and release the GPU / TPU cluster if the event termination signal is not received, based on a watchdog mechanism and a preset maximum analysis time and last heartbeat time.

[0017] To achieve the above objectives, a third aspect of the present invention provides an electronic device, comprising: a processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of the first aspects.

[0018] To achieve the above objectives, a fourth aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of the first aspects.

[0019] To achieve the above objectives, a fifth aspect of the present invention provides a computer program product that, when executed by a processor, implements the method described in any one of the first aspects.

[0020] The technical solutions provided by the embodiments of the present invention bring at least the following beneficial effects: they can significantly reduce the network bandwidth consumption and backend computing resource waste of video surveillance systems, realize on-demand transmission and analysis of video streams through event-driven mechanisms, and improve system resource utilization and operating efficiency.

[0021] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0022] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of an event-driven video surveillance resource optimization method according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of an event-driven video surveillance resource optimization device according to an embodiment of the present invention. Detailed Implementation

[0023] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.

[0024] Figure 1 This is a flowchart of an event-driven video surveillance resource optimization method according to an embodiment of the present invention.

[0025] like Figure 1 As shown, the event-driven video surveillance resource optimization method includes the following steps: S1, the front-end device runs a lightweight event detection module, which calculates the pixel change area and texture features of consecutive frames through frame difference method or background modeling algorithm, and generates a structured event start signal containing device ID, timestamp and event type.

[0026] Specifically, in some implementations, the front-end device runs a lightweight event detection module. This module is based on frame difference or background modeling algorithms (such as Gaussian Mixture Model) to calculate the area of ​​pixel changes and texture features between consecutive video frames in real time, thereby generating a structured event initiation signal. This module is deployed at the edge, typically running on a low-power embedded platform (such as an ARM-based SoC or NPU) to ensure efficient, low-latency event detection with limited computing power.

[0027] The specific operation is as follows: The video acquisition module acquires raw image data at a fixed frame rate (e.g., 25 fps), and the lightweight event detection module performs differential processing on consecutive frames to calculate the area of ​​pixel variation regions. For example, when using the inter-frame difference method, the pixel difference matrix between the current frame and the previous frame is calculated. ,in Indicates the first Frame image, This represents the difference image. Subsequently, [the following is done / does something]... Perform connected component analysis on the non-zero pixel regions and calculate the area of ​​change. ,in The set differential threshold (e.g., 10~255) is used to distinguish between valid variations and noise.

[0028] Furthermore, to improve the accuracy of event recognition, this module also incorporates texture feature analysis, such as using Local Binary Pattern (LBP) or Histogram of Oriented Gradients (HOG) to extract texture information of moving regions and determine whether they match the characteristics of moving objects. When the area changes... Furthermore, when the texture features meet the preset conditions, the signal generation module will trigger the event start signal.

[0029] This signal includes the device ID (such as a MAC address or unique serial number), a timestamp (accurate to milliseconds), the event type (such as "personnel entry" or "vehicle movement"), and the coordinates of the changed area. In some implementations, an initial snapshot image (JPEG compressed format, resolution adjustable) can also be attached. or ) and environmental parameters (such as light intensity and weather conditions).

[0030] This step is widely applicable in practical applications for large-scale video surveillance scenarios such as smart cities, industrial parks, and transportation hubs. It is particularly valuable for resource optimization in deployment environments with limited wireless network bandwidth or high cross-border transmission costs. Through lightweight detection at the front end, the system can effectively filter invalid video frames, sending structured signals to the back end only when an event occurs. This significantly reduces the amount of invalid data transmission, improves backend computing power utilization, and enables an event-driven intelligent video analytics architecture.

[0031] Furthermore, S1 includes: S11, the inter-frame difference method is used to calculate the pixel change area of ​​consecutive frames, using the formula... Calculate the sum of absolute differences, where and These represent the height and width of the video frame, respectively.

[0032] Specifically, in some implementations, this step uses the frame difference method to perform pixel-level difference analysis on consecutive video frames to calculate the sum of absolute differences (SAD) of image changes, which is mathematically expressed as follows:

[0033] in, and These represent the positions of the current frame and the previous frame, respectively. Pixel value at that location, and Here, represents the height and width of the video frame. This formula quantifies the degree of dynamic change in the image by calculating the absolute value of the difference between adjacent frames pixel by pixel and summing them over the entire frame.

[0034] From a technical implementation perspective, this step typically runs within a lightweight event detection module of the front-end device. This module is deployed on an embedded platform (such as ARM architecture or NPU) to ensure low power consumption and real-time performance. In practice, the video acquisition module outputs raw image data (such as YUV 420 or RGB format), which then enters a preprocessing stage, including image noise reduction, geometric correction, and resolution scaling. The inter-frame difference method is then applied, using a sliding window mechanism (such as differencing each frame with the previous frame) to achieve dynamic detection of consecutive frames. To improve computational efficiency, SIMD instruction sets or GPU acceleration can be optionally employed to support real-time processing capabilities exceeding 30 frames per second (30fps).

[0035] At the parameter level, the calculated SAD value needs to be compared with the dynamic threshold. The threshold can be adaptively adjusted based on factors such as changes in lighting and background complexity. For example, under low-light conditions, the threshold... The sensitivity can be appropriately increased to avoid false triggers, while it can be decreased in high-dynamic scenarios to enhance sensitivity. Furthermore, this step serves as the initial judgment basis for front-end event detection, and its output will be used in conjunction with multi-dimensional indicators such as texture feature analysis and target confidence to generate a reliable Start signal.

[0036] In application scenarios, this step is widely applicable to large-scale video surveillance scenarios such as smart cities, industrial parks, and transportation hubs. By quickly determining whether there are valid changes in the image at the edge, the transmission of invalid video streams can be effectively reduced, thereby significantly reducing network bandwidth consumption and waste of backend computing resources. For example, in inactive monitoring areas, the SAD value is usually below a set threshold, and the system will remain silent, triggering the backend analysis process only when a significant change is detected.

[0037] The technical advantage of this step lies in its ability to achieve rapid response to dynamic changes in the image through low-complexity inter-frame difference calculation, providing a reliable basis for subsequent event signal generation and resource scheduling. Its innovation lies in transforming the traditional "continuous processing" mode of video analysis into an "event-driven" intelligent perception mechanism, thereby significantly improving the system's resource utilization and operational efficiency while ensuring analytical accuracy.

[0038] S12 extracts texture features using a Gaussian Mixture Model (GMM). When the texture gradient magnitude in a changing region exceeds a preset threshold... And the consistency of the direction of movement exceeds The event is then determined to be a valid event.

[0039] Specifically, in some implementations, this step uses a Gaussian Mixture Model (GMM) to extract texture features from changing areas in the video frame to help determine whether an event is valid. GMM is a probabilistic background modeling method whose core principle is to model the grayscale values ​​or color features of background pixels as a weighted sum of multiple Gaussian distributions, thereby achieving robust detection of dynamic foregrounds. In this system, the GMM model runs in the lightweight event detection module of the front-end device, modeling and updating continuous video frames, calculating the difference between the current frame and the background model, and extracting regions that may contain moving objects.

[0040] Furthermore, texture feature extraction is based on the local gradient magnitude and directional consistency of the changing regions. The gradient magnitude reflects the intensity of edges and textures in the image and is typically calculated using the Sobel or Scharr operator, with a value range of [range missing]. When the gradient magnitude in the changing region exceeds a preset threshold... This indicates significant texture changes in the area, likely due to a real moving object rather than noise or lighting variations. Simultaneously, there is consistency in the direction of motion. This measure assesses the uniformity of motion directions within a changing region. Its calculation is based on the concentration of the gradient orientation histogram (GOH), typically using the entropy of the direction distribution or the proportion of the dominant direction as quantitative indicators. When this uniformity exceeds... This indicates that the motion has directionality, further enhancing the judgment of the validity of the event.

[0041] In practical implementation, the parameters of the GMM model include the number of Gaussian distributions. (usually taken) to Learning rate (Used for background model updates, generally set to) and background threshold (Used to determine whether a pixel belongs to the background, usually set to) Threshold for texture gradient magnitude and direction consistency threshold It can adaptively adjust according to the actual scenario, such as in urban road monitoring. In indoor low-light scenarios To adapt to noise levels and motion characteristics in different environments.

[0042] This step operates at the edge computing layer of the front-end device, suitable for low-power, low-computing-power embedded platforms (such as ARM-based smart cameras). By combining GMM background modeling and texture feature analysis, the system can effectively distinguish between real motion events and false disturbances, thereby improving the accuracy and robustness of event detection. After an event is determined to be valid, the signal generation module will trigger a Start signal to notify the backend to start a deep AI analysis task, achieving on-demand scheduling and efficient utilization of resources.

[0043] S2, the backend dynamic scheduling controller parses the event start signal, initiates a video stream pull request to the front-end device based on the RTSP / ONVIF protocol, and allocates computing resources from the GPU / TPU resource pool through the resource management module to start the AI ​​analysis task.

[0044] Specifically, in some implementations, after receiving the event initiation signal from the front-end device, the back-end dynamic scheduling controller first performs identity authentication and data validity verification to ensure the signal source is legitimate and the content is complete. This event initiation signal typically uses a structured data format (such as JSON or Protocol Buffers) and includes key information such as device ID, timestamp, event type, trigger area coordinates, and target type (e.g., person / vehicle), used by the back-end to accurately identify the event source and nature. The controller, based on the RTSP (Real-Time Streaming Protocol) or ONVIF (Open Network Video Interface Forum) protocol, initiates a video stream retrieval request to the specified front-end device, establishing a point-to-point real-time video stream transmission channel. The RTSP protocol supports session control based on SIP (Session Initiation Protocol), enabling on-demand start and stop of the video stream, while the ONVIF protocol provides a standardized device control interface, facilitating the integration of front-end devices from different manufacturers.

[0045] Furthermore, the dynamic scheduling controller allocates computing resources from the GPU / TPU resource pool through the resource management module. The resource management module dynamically selects available GPUs or TPU units based on the current system load, task priority, and the computational complexity of the required model. For example, it can allocate two GPU cores and 4GB of video memory to launch a YOLOv7 object detection task, or load more complex models such as SlowFast based on behavioral analysis requirements. Each analysis task is typically encapsulated in an independent Docker container to achieve environment and resource isolation, ensuring high concurrency and stability of the task.

[0046] Regarding specific parameter settings, resource allocation strategies can be configured differently based on task type. For example, the maximum concurrency for an object detection task can be set to [number missing]. The behavior analysis task was set as follows: This balances system throughput with resource utilization. Simultaneously, the system supports load balancing algorithms (such as round-robin and least-load priority) to ensure efficient use of computing resources.

[0047] This step is widely applicable in practical applications to large-scale video surveillance scenarios such as smart cities, industrial parks, and transportation hubs. Through an event-driven resource scheduling mechanism, the system only initiates video stream retrieval and AI analysis tasks when a change in the image occurs, significantly reducing invalid data transmission and idle computing power, and improving the overall system's resource utilization and response efficiency.

[0048] Furthermore, S2 includes: S21 encapsulates the event signal in JSON or Protocol Buffers format, where the Start signal contains fields. , , , and .

[0049] Specifically, in some implementations, event signals are encapsulated using structured data formats such as JSON or Protocol Buffers (Protobuf) to ensure efficient data transmission and parsing. This step is completed by the signal generation module in the front-end perception unit, whose core function is to transmit the detected image change events to the back-end analysis unit in a standardized and parsable manner, thereby triggering subsequent video stream retrieval and AI analysis tasks. This mechanism is a key link in realizing the "event-driven on-demand analysis mode," effectively supporting the system's fine-grained scheduling of resources.

[0050] In terms of specific technical implementation, the Start signal includes the following fields: (A unique device identifier, typically a 16-bit MAC address or a 128-bit UUID) (The timestamp of the event trigger time, in ISO8601 standard format, such as "2024-04-05T14:30:00Z") (Event types, such as "motion_detected" and "object_entered", support extended definitions) (The coordinate information of the changing region is expressed in quadruplets) (Represents the top-left and bottom-right coordinates of the ROI region, in pixels) (Environmental information, such as light intensity and weather conditions, is an optional field used to assist backend decision analysis strategies.)

[0051] At the parameter level, Used to uniquely identify front-end devices, ensuring that the back-end can accurately identify and allocate resources; Ensure the consistency of event timing and support collaborative analysis across multiple devices; Defining events through enumeration makes it easier for the backend to classify and process them. The accuracy of the coordinates directly affects the analysis efficiency. Typically, the coordinate error is required to be less than 5 pixels to ensure accurate target positioning. It can be configured according to the deployment environment, such as including in outdoor scenarios. (Light intensity, in lux) and (Weather conditions, such as "rainy" or "sunny").

[0052] At the application level, this encapsulation mechanism is widely applicable to large-scale video surveillance scenarios such as smart cities, industrial parks, and transportation hubs. After the front end detects a change in the image, the signal is transmitted to the back end through a low-overhead control channel (such as MQTT or Kafka), and the back end then... and Decide whether to initiate the AI ​​analysis task, and through Precisely locate the analysis area to improve processing efficiency and reduce invalid calculations.

[0053] The technical advantage of this step lies in achieving standardized expression and efficient transmission of event information through structured signal encapsulation, providing a reliable basis for dynamic scheduling in the backend. Simultaneously, due to the high compression and parsing efficiency of Protobuf or JSON, the signal size is typically controlled between 100 and 500 bytes, significantly reducing the bandwidth consumption of the control channel and laying the foundation for resource optimization in large-scale deployments.

[0054] S22 transmits event signals via a publish / subscribe (Pub / Sub) message queue. Backend subscribers dynamically adjust the streaming priority based on load conditions, using a formula... Calculate task priority, where Indicates the idle time of computing power. Indicates the duration of the event. These are the weighting coefficients.

[0055] Specifically, in this invention, the step "transmits event signals through the publish / subscribe (Pub / Sub) mode of the message queue, and the backend subscriber dynamically adjusts the pull priority according to the load status, using a formula..." "Task prioritization" is one of the core mechanisms for achieving efficient resource scheduling and event-driven analysis. This step, based on structured transmission of event signals and dynamic response of backend scheduling strategies, has significant system optimization value.

[0056] At the technical implementation level, after detecting a screen change event, the front-end device generates a structured event signal through a lightweight event detection module, including key information such as device ID, timestamp, event type, and area coordinates. This signal is transmitted via a message queue system (such as Apache Kafka, RabbitMQ, or Alibaba Cloud MNS) in a publish / subscribe (Pub / Sub) mode. The Pub / Sub mode of the message queue allows the front-end to act as a publisher to publish event signals to a specific topic, while the back-end subscribers can flexibly subscribe to multiple topics, realizing an event-driven asynchronous communication mechanism. This mode features low latency, high throughput, and reconnection after disconnection, making it suitable for concurrent access and event distribution of large-scale monitoring devices.

[0057] At the parameter level, the backend subscriber dynamically adjusts the priority of video stream retrieval based on the current load status, and its core formula is: ,in This indicates the current idle time of computing resources (in seconds). Indicates an event The duration (in seconds). Configurable weighting coefficients (typically ranging from...) This formula is used to balance the impact of event duration and computing power idle time on priority. It is designed so that tasks with shorter idle times and longer events have higher priority, thus achieving optimal utilization of computing resources.

[0058] At the application level, this step is widely applicable to large-scale video surveillance systems such as smart cities, industrial parks, and transportation hubs. In these scenarios, the backend analysis unit needs to process event signals from tens of thousands of front-end devices. Through a priority scheduling mechanism, it can be ensured that high-value events (such as long-term activities or high-risk areas) receive computing resources first, while low-value or short-term static events are reasonably delayed, thereby improving the overall system's response efficiency and resource utilization.

[0059] From a technical perspective, this step effectively alleviates the problem of ineffective use of backend computing resources by introducing a dynamic priority calculation mechanism. In event-driven mode, the backend only pulls video streams and starts AI analysis tasks when necessary, avoiding resource idleness in traditional continuous analysis mode. Experiments show that this mechanism can improve GPU / TPU utilization by more than 40% while reducing the amount of invalid video stream transmission by more than 70%, significantly optimizing the overall energy consumption and operating costs of the system.

[0060] S3, when the front-end device detects the disappearance of the target or a static timeout condition, it generates a structured event termination signal containing a unique event ID and an end timestamp. The back-end dynamic scheduling controller stops video stream retrieval and triggers a resource reclamation process based on the termination signal. Specifically, in some implementations, when the front-end device detects that a target has disappeared or the screen has been in a static state for more than a preset silence timeout, a structured event termination signal will be generated. This signal contains a unique identifier for the event (Event ID) and an end timestamp for the event, used to identify the end of the lifecycle of a specific event. The unique event ID is generated when the front-end device receives the start signal and is bound to information such as the start timestamp and trigger area coordinates of the event, ensuring the consistency and traceability of the event state between the front-end and back-end.

[0061] From a technical implementation perspective, the front-end device continuously monitors the dynamics of the screen through a lightweight event detection module. When continuous... The area of ​​pixel change in a frame is less than a set threshold. Furthermore, object detection models (such as MobileNet-SSD) are in continuous No intra-frame detection with confidence level higher than When the target is not found, it is determined as "target disappeared" or "static timeout". At this time, the signal generation module will trigger the generation of a Stop signal and send the signal to the backend dynamic scheduling controller through a low-overhead control channel (such as a message queue based on MQTT or Kafka).

[0062] At the parameter level, the silent timeout period is typically configured as follows: The time stamp is in seconds and can be dynamically adjusted according to the actual scenario (such as traffic monitoring, security monitoring). The unique event ID is generated using the UUID v4 standard to ensure global uniqueness. The timestamp uses the ISO 8601 standard format, accurate to the millisecond level, to support high-precision event timing analysis.

[0063] In application scenarios, this step is widely applicable to large-scale video surveillance systems, such as smart cities, industrial parks, and transportation hubs. In these scenarios, front-end devices may be deployed on edge nodes or locally on the cameras, while the back-end dynamic scheduling controller runs on a central cloud platform or edge cloud nodes. By sending a Stop signal, the back-end can immediately stop pulling video streams from the specified front-end device and trigger a resource reclamation process, including closing RTSP sessions, destroying Docker containers, and releasing GPU / TPU resources.

[0064] The technical benefit of this step is a significant improvement in system resource utilization. By proactively stopping the transmission and analysis of invalid video streams, the idle time of backend GPU / TPU resources can be reduced, lowering energy consumption and hardware maintenance costs. Simultaneously, this mechanism effectively alleviates excessive uplink bandwidth consumption, enabling the system to achieve greater scalability and economic feasibility in wireless or cross-border transmission scenarios.

[0065] Furthermore, S3 includes: S31, when the target's visibility within the monitored area is continuous Frames below the threshold The target is determined to have disappeared.

[0066] Specifically, in some implementations, when the visibility of the target within the monitored area is continuous... Frames below the threshold When the target disappears, this step is one of the key judgment logics in the "termination signal" mechanism of this invention, used to trigger the backend resource recycling process. Its technical implementation is based on a lightweight target detection and tracking module on the front-end device, combined with time series analysis and confidence assessment, to achieve dynamic judgment of the target's state.

[0067] At the technical implementation level, this step is typically embedded in the edge computing module of the front-end device, running on a low-power embedded platform (such as an ARM-based NPU or a lightweight GPU). Target visibility assessment is based on the confidence score output by the target detection model (such as MobileNet-SSD, YOLOv5s) and the target's bounding box area in the image. After processing each frame, the system records the target visibility index. It is defined as the weighted sum of the confidence score of the detection model output and the area of ​​the target region, i.e. ,in This is the weighting coefficient (usually ranging from 0.6 to 0.8). The area of ​​the target in the current frame. This represents the maximum area of ​​the target during the event. If continuous... Frames If the target is no longer visible, it will enter the "disappeared" state.

[0068] In terms of parameters and indicators, It is usually set to 3 to 5 frames to adapt to the target motion characteristics at different frame rates (such as 15 to 30 FPS); The value is typically set between 0.2 and 0.4 to ensure that there are no misjudgments under conditions of brief target occlusion or low light. This parameter can be dynamically adjusted according to specific scenarios (such as traffic monitoring and personnel behavior analysis) to balance the misjudgment rate and response speed.

[0069] In application scenarios, this step is widely applicable to large-scale video surveillance systems such as urban security, industrial inspection, and smart parks. For example, in traffic monitoring scenarios, if a vehicle fails to detect multiple consecutive frames due to obstruction or leaving the monitoring range, the system can automatically stop pulling and analyzing the video stream, thereby freeing up backend GPU resources and reducing invalid data transmission.

[0070] The technical advantage of this step lies in its ability to effectively improve the robustness and accuracy of target state judgment by introducing a time-series-based visibility assessment mechanism, thus avoiding resource waste caused by misjudgment in a single frame. Combined with backend dynamic scheduling and containerized resource management, it enables refined recycling and reuse of computing resources, significantly reducing the overall energy consumption and operation and maintenance costs of the system. This is one of the core supporting technologies for resource optimization and event-driven analysis in this invention.

[0071] S32, when the target remains stationary for a certain period of time Exceeding the user-configured silent timeout period The termination signal is triggered at time, where Available Dynamically adjusted within a second.

[0072] Specifically, in some implementations, when the target's static state lasts for a certain period of time... Exceeding the user-configured silent timeout period When this occurs, the system will trigger a stop signal to notify the backend to stop pulling the video stream and performing AI analysis tasks. This mechanism is a key component of the "dual-signal control mechanism" of this invention, used to achieve fine-grained management and efficient recycling of resources.

[0073] From a technical implementation perspective, the front-end sensing unit continuously monitors the state of targets in the scene through a lightweight event detection module. When the system detects that a target has entered a stationary state (such as a person sitting down or a vehicle stopping), it starts timing. And continuously assess whether the target is still stationary. If the target is determined to be stationary, then... If the signal generation module generates a Stop signal, it will then generate the device ID, a unique event identifier, an end timestamp, and event summary information, such as... The specific values, target types, and maximum number of targets are provided to the backend for status updates and resource reclamation decisions.

[0074] At the parameter level, The range of values ​​is The time limit can be dynamically configured by the user according to the actual needs of the scenario. For example, in industrial park monitoring, if the target is a vehicle, the time limit can be set to [number of seconds]. The time limit is set to 30 seconds; however, in crowded public places, it can be extended to 60 seconds to avoid misjudgment. This adjustability enhances the system's adaptability and flexibility.

[0075] At the application level, this step is widely applicable to large-scale video surveillance systems, especially in scenarios with limited bandwidth or scarce computing resources. For example, in smart city projects deploying 5G edge computing nodes, this mechanism can effectively reduce the transmission of invalid video streams, thereby reducing network load and the idle rate of backend GPUs / TPUs.

[0076] The technical advantage of this step is that, by setting a reasonable silent timeout, the system can proactively identify and terminate invalid analysis tasks, thereby releasing occupied computing resources and network bandwidth. In actual testing, this mechanism can improve backend computing power utilization by more than 30% and significantly reduce the transmission volume of invalid video streams, achieving on-demand allocation and reclamation of resources, and improving the overall system's operating efficiency and economy.

[0077] S4. If the event termination signal is not received, the backend dynamic scheduling controller will forcibly reclaim computing resources and release the GPU / TPU cluster through the watchdog mechanism based on the preset maximum analysis time and the last heartbeat time.

[0078] Specifically, in some implementations, if the stop signal is not received, the backend dynamic scheduling controller will use a watchdog mechanism to forcibly reclaim computing resources and release the GPU / TPU cluster based on a preset maximum analysis duration and last heartbeat time. This mechanism is a key technical means to ensure efficient utilization of system resources and controllable task lifecycles.

[0079] From a technical implementation perspective, the watchdog mechanism runs in the backend system as a scheduled task or asynchronous monitoring thread, periodically checking the activity status of each analysis task. Each frontend device maintains a status record table in the backend system, containing fields such as device ID, event ID, event start timestamp, and last heartbeat timestamp. When a frontend device continuously sends heartbeat signals during an event, the system updates its last heartbeat timestamp. If the preset maximum analysis duration is exceeded... No Stop signal was received, and the difference between the last heartbeat time and the current time exceeds the set timeout threshold. If the event is abnormally terminated or the front-end device is disconnected, the resource recycling process will be triggered.

[0080] In terms of parameters and indicators, Typically, the configuration depends on the specific scenario; for example, in industrial park monitoring, it can be set to... Seconds, while in urban road monitoring, it can be set to seconds. Second. Generally set to This ensures that the backend can respond promptly and release resources in the event of an abnormal disconnection from the front-end device. Furthermore, the heartbeat signal is typically sent every [number] seconds. Once per second, to ensure real-time state synchronization.

[0081] In application scenarios, this mechanism is widely applicable to large-scale video surveillance systems, especially in situations where front-end devices are deployed at edge nodes, the network environment is unstable, or device resources are limited. For example, in a 5G edge computing architecture, front-end devices may be unable to actively send a Stop signal due to power outages, network interruptions, or software malfunctions. In this case, the watchdog mechanism can prevent back-end GPU / TPU resources from being ineffectively occupied, ensuring efficient turnover of the resource pool.

[0082] From a technical perspective, this step effectively avoids resource deadlock issues caused by front-end anomalies and improves the utilization rate of back-end computing resources. Through the forced reclamation mechanism, the system can reallocate GPU / TPU resources to other pending tasks, thereby achieving elastic resource scheduling and load balancing, significantly reducing hardware maintenance costs and improving the overall system's response efficiency and stability.

[0083] The event-driven video surveillance resource optimization method of this invention effectively reduces the bandwidth and computing power consumption of the video surveillance system, improves resource utilization, and achieves efficient collaboration between front-end event-driven and back-end on-demand analysis.

[0084] Furthermore, S4 includes: S41, when the event analysis duration Exceeding the preset maximum allowed duration Forced recycling is triggered at certain times.

[0085] Specifically, in some implementations, when the event analysis duration... Exceeding the preset maximum allowed duration At this time, the system will trigger a forced resource reclamation mechanism. This step is an important component of the dual-signal control mechanism of "start signal" and "termination signal" in this invention, used to ensure the efficient utilization of backend computing resources and the stability of system operation.

[0086] From a technical implementation perspective, this mechanism relies on a backend dynamic scheduling controller to monitor the event lifecycle in real time. Upon receiving a Start signal from the frontend, the system allocates an independent resource container (such as a Docker instance) for the event and starts the corresponding AI analysis task. Simultaneously, the system maintains an internal event timer to record the time interval from the triggering of the Start signal to the current moment. .when When the system determines that the event may have entered an invalid state (such as the target being stationary, abnormal interruption, or loss of connection of the front-end device), it will trigger a forced recycling process.

[0087] At the parameter level, This is a configurable system-level parameter, typically set between 30 seconds and 5 minutes depending on the scenario requirements. For example, in industrial park monitoring, if an area remains unoccupied for an extended period, then... It can be set to 60 seconds; however, in traffic monitoring, considering that vehicles may stop briefly, It can be set to 180 seconds. This parameter setting needs to be optimized in conjunction with factors such as front-end detection sensitivity, network latency, and back-end load to ensure a balance between resource reclamation and event integrity.

[0088] At the application level, this step is widely applicable to large-scale video surveillance systems, especially in scenarios where wireless network bandwidth is limited and backend computing resources are scarce. For example, in smart city projects, tens of thousands of cameras use edge computing devices to detect changes in the footage, and the backend scheduling system dynamically controls resource allocation based on the duration of event analysis, preventing long-term resource occupation due to frontend anomalies or invalid events.

[0089] From a technical perspective, this step effectively prevents resource deadlock caused by the front end failing to send a Stop signal, ensuring the elastic reclamation and reallocation of backend resource pools. By introducing a watchdog mechanism, the system can automatically execute the TEARDOWN operation after an event timeout, closing the RTSP streaming session, destroying the container instance, and releasing GPU, CPU, and memory resources, thereby significantly improving the overall resource utilization and response efficiency of the system.

[0090] S42, when the device's last heartbeat time The difference from the current time exceeds If no valid event signal is received, the device is deemed abnormal and resource reclamation is performed.

[0091] Specifically, in some implementations, when the device's last heartbeat time... With current time The difference exceeds the preset threshold time. If no valid event signal (such as a Start or Stop signal) is received within this time period, the system will determine that the front-end device is in an abnormal state and trigger the resource reclamation mechanism. This step is one of the key control logics of the resource management module in this invention, used to ensure the efficient utilization of back-end computing resources and the stability of the system.

[0092] From a technical implementation perspective, this decision-making logic is based on the differential calculation of timestamps and the Boolean state judgment of event signals. Specifically, the system maintains a device status table in the backend, recording the last heartbeat time of each frontend device. This time is typically updated by health status signals periodically sent by the front-end device, with the interval generally set to... Seconds. Simultaneously, the system also maintains an event signal queue to record whether the front-end device has recently... A Start signal was sent within the time window. If no event signal is detected within the window, the device is considered not in a valid analysis state.

[0093] In terms of parameters and indicators, The settings need to balance network latency and device stability, and are usually set to a value of [value missing]. Seconds. If If the event signal queue is false, the device is considered faulty. This mechanism conforms to the timer control logic defined in IETF RFC 5234, ensuring that the system can respond promptly when the device is disconnected or malfunctions.

[0094] In application scenarios, this step is widely applicable to large-scale video surveillance systems, such as smart cities, industrial parks, and transportation hubs. In these scenarios, the number of devices is vast, the network environment is complex, and devices may become disconnected due to power outages, network interruptions, or software malfunctions. Through this mechanism, the backend can automatically identify disconnected devices and reclaim the GPU / TPU resources they occupy, avoiding resource idleness and deadlocks, and improving overall resource utilization.

[0095] From a technical perspective, this step enables real-time monitoring and anomaly response of the front-end device status, ensuring the dynamic scheduling capability of the back-end resource pool. By introducing a watchdog mechanism, the system can proactively reclaim resources even without signal feedback, thereby effectively reducing unnecessary computing power consumption and improving the system's robustness and resource management efficiency.

[0096] The event-driven video surveillance resource optimization method of this invention effectively reduces the bandwidth and computing power consumption of the video surveillance system, improves resource utilization, and achieves efficient collaboration between front-end event-driven and back-end on-demand analysis.

[0097] S5, the front-end device performs preprocessing steps after video acquisition, including image noise reduction, fisheye lens geometric correction, and resolution scaling. ,in and Image size parameters adapted for the detection module.

[0098] Specifically, in some implementations, the preprocessing steps performed by the front-end device after video acquisition are a crucial foundational step in the entire event-driven video analytics system. These steps primarily include image noise reduction, fisheye lens geometric correction, and resolution scaling. ,in and The image size parameters adapted for the detection module are typically set based on the input requirements of the lightweight detection model (such as MobileNet-SSD) running on the front-end device, for example... Pixels Pixels, in order to reduce computational load while ensuring detection accuracy.

[0099] Image denoising typically employs algorithms based on Fast Non-Local Means (FNL-Means) or Gaussian filtering to perform spatial or frequency domain filtering on the acquired raw YUV or RGB images to suppress sensor noise and environmental interference. In practical deployments, the denoising intensity can be dynamically adjusted through a noise variance estimation module to adapt to changes in image quality under different lighting and weather conditions.

[0100] Fisheye lens geometric correction involves reprojecting the image using preset camera calibration parameters (such as intrinsic matrix and distortion coefficients) to eliminate barrel distortion and restore the image's planar geometry. This process is typically based on the fisheye module in OpenCV or a spherical projection correction algorithm based on a pinhole model, ensuring that subsequent detection modules do not cause false positives or false negatives due to distortion when processing the image.

[0101] Resolution scaling employs bilinear interpolation or the more efficient image pyramid method to resize the original image. This step adapts to the input requirements of the detection model. It not only reduces the computational complexity of front-end processing but also decreases memory usage and processing latency during image transmission and analysis.

[0102] In practical applications, this preprocessing process runs on the edge computing unit of the front-end device (such as an embedded GPU or NPU), and its processing latency is typically controlled within... Within milliseconds to ensure real-time event detection. This step provides high-quality, standardized image input for subsequent image change detection, and is a key prerequisite for achieving a low-power, low-bandwidth, and high-response-efficiency event triggering mechanism.

[0103] The event-driven video surveillance resource optimization method of this invention further optimizes video data quality and transmission efficiency by adding preprocessing steps such as image noise reduction, fisheye lens geometric correction, and resolution scaling to the size adapted to the detection module in the front-end device, and reduces the complexity of back-end processing. Thus, while ensuring analysis accuracy, it significantly improves the overall system's collaborative efficiency and resource utilization.

[0104] To achieve the above embodiments, the present invention also proposes an event-driven video surveillance resource optimization device. Figure 2 This is a schematic diagram of an event-driven video surveillance resource optimization device provided in an embodiment of the present invention. Figure 2 As shown, the device includes: The event detection and signal generation module 100 is used by the front-end device to run a lightweight event detection module, calculate the pixel change area and texture features of consecutive frames through frame difference method or background modeling algorithm, and generate a structured event start signal containing device ID, timestamp and event type. The event parsing and resource scheduling module 200 is used by the backend dynamic scheduling controller to parse the event start signal, initiate a video stream pull request to the front-end device based on the RTSP / ONVIF protocol, and allocate computing power resources from the GPU / TPU resource pool through the resource management module to start the AI ​​analysis task; The event termination signal generation module 300 is used to generate a structured event termination signal containing a unique event ID and an end timestamp when the front-end device detects the disappearance of the target or a static timeout condition. The back-end dynamic scheduling controller stops video stream retrieval and triggers a resource reclamation process based on the termination signal. The resource forced reclamation module 400 is used to, if the event termination signal is not received, the backend dynamic scheduling controller forcibly reclaims computing resources and releases the GPU / TPU cluster through a watchdog mechanism based on the preset maximum analysis time and the last heartbeat time.

[0105] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.

[0106] To implement the above embodiments, the present invention also proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory to implement the method provided in the foregoing embodiments.

[0107] To implement the above embodiments, the present invention also proposes a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the methods provided in the foregoing embodiments.

[0108] To implement the above embodiments, the present invention also proposes a computer program product, including a computer program that, when executed by a processor, implements the methods provided in the foregoing embodiments.

[0109] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this invention all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0110] It should be noted that personal information collected from users should be used for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. Furthermore, such collection / sharing should only be conducted after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign an agreement / authorization that includes authorization of relevant user information before the user uses the function. In addition, any necessary steps must be taken to protect and safeguard access to such personal information data and ensure that others with access to personal information data comply with their privacy policies and procedures.

[0111] This invention is intended to provide implementation schemes for users to selectively prevent the use or access to personal information data. That is, this disclosure is intended to provide hardware and / or software to prevent or block access to such personal information data. Once personal information data is no longer needed, risks can be minimized by restricting data collection and deleting data. Furthermore, where applicable, such personal information can be de-identified to protect user privacy.

[0112] In the foregoing descriptions of the embodiments, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0113] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0114] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of the invention pertain.

[0115] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.

[0116] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any of the following techniques known in the art, or a combination thereof: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0117] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0118] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0119] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.

[0120] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0121] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. An event-driven video surveillance resource optimization method, characterized in that, include: S1, the front-end device runs a lightweight event detection module, which calculates the pixel change area and texture features of consecutive frames through frame difference method or background modeling algorithm, and generates a structured event start signal containing device ID, timestamp and event type; S2, the backend dynamic scheduling controller parses the event start signal, initiates a video stream pull request to the front-end device based on the RTSP / ONVIF protocol, and allocates computing power resources from the GPU / TPU resource pool through the resource management module to start the AI ​​analysis task; S3, when the front-end device detects the disappearance of the target or a static timeout condition, it generates a structured event termination signal containing a unique event ID and an end timestamp. The back-end dynamic scheduling controller stops video stream retrieval and triggers a resource reclamation process based on the termination signal. S4. If the event termination signal is not received, the backend dynamic scheduling controller will forcibly reclaim computing resources and release the GPU / TPU cluster through the watchdog mechanism based on the preset maximum analysis time and the last heartbeat time.

2. The method as described in claim 1, characterized in that, The front-end device runs a lightweight event detection module, which calculates the pixel change area and texture features of consecutive frames using frame difference or background modeling algorithms, and generates a structured event initiation signal containing device ID, timestamp, and event type. S11, the inter-frame difference method is used to calculate the pixel change area of ​​consecutive frames, using the formula... Calculate the sum of absolute differences, where and These represent the height and width of the video frame, respectively. S12, extract texture features using a Gaussian Mixture Model (GMM), when the texture gradient magnitude in a changing region exceeds a preset threshold. And the consistency of the direction of movement exceeds The event is then determined to be a valid event.

3. The method as described in claim 1, characterized in that, The backend dynamic scheduling controller parses the event initiation signal, initiates a video stream retrieval request to the frontend device based on the RTSP / ONVIF protocol, and allocates computing resources from the GPU / TPU resource pool through the resource management module to start the AI ​​analysis task, which also includes: S21 encapsulates the event signal in JSON or Protocol Buffers format, where the Start signal contains fields. , , , and ; S22 transmits event signals using a publish / subscribe message queue pattern. Backend subscribers dynamically adjust the streaming priority based on load conditions, using a formula... Calculate task priority, where Indicates the idle time of computing power. Indicates the duration of the event. These are the weighting coefficients.

4. The method as described in claim 1, characterized in that, When the front-end device detects the disappearance of the target or a static timeout condition, the generation of a structured event termination signal containing a unique event ID and an end timestamp also includes: S31, when the target's visibility within the monitored area is continuous Frames below the threshold The target is determined to have disappeared at that time; S32, when the target remains stationary for a certain period of time Exceeding the user-configured silent timeout period The termination signal is triggered at time, where Available Dynamically adjusted within a second.

5. The method as described in claim 1, characterized in that, If the event termination signal is not received, the backend dynamic scheduling controller, through a watchdog mechanism, forcibly reclaims computing resources and releases the GPU / TPU cluster based on a preset maximum analysis time and the last heartbeat time. This also includes: S41, when the event analysis duration Exceeding the preset maximum allowed duration Forced garbage collection is triggered at certain times; S42, when the device's last heartbeat time The difference from the current time exceeds If no valid event signal is received, the device is deemed abnormal and resource reclamation is performed.

6. The method as described in claim 1, characterized in that, Also includes: S5, the front-end device performs preprocessing steps after video acquisition, including image noise reduction, fisheye lens geometric correction, and resolution scaling. ,in and Image size parameters adapted for the detection module.

7. An event-driven video surveillance resource optimization device, characterized in that, include: The event detection and signal generation module is used by the front-end device to run a lightweight event detection module. It calculates the pixel change area and texture features of consecutive frames through frame difference method or background modeling algorithm, and generates a structured event start signal containing device ID, timestamp and event type. The event parsing and resource scheduling module is used by the backend dynamic scheduling controller to parse the event start signal, initiate a video stream pull request to the front-end device based on the RTSP / ONVIF protocol, and allocate computing resources from the GPU / TPU resource pool through the resource management module to start the AI ​​analysis task; The event termination signal generation module is used to generate a structured event termination signal containing a unique event ID and an end timestamp when the front-end device detects the disappearance of the target or a static timeout condition. The back-end dynamic scheduling controller stops video stream retrieval and triggers a resource reclamation process based on the termination signal. The resource forced reclamation module is used so that if the event termination signal is not received, the backend dynamic scheduling controller will forcibly reclaim computing resources and release the GPU / TPU cluster through a watchdog mechanism based on the preset maximum analysis time and the last heartbeat time.

8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-6.

10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-6.