Video retrieval method, device and storage medium for cigarette production site

By extracting frames, identifying and aggregating events from video data at the cigarette production site, a structured alarm event index is generated, solving the problem of low recording query efficiency in traditional video surveillance systems and achieving fast and accurate video retrieval.

CN123138464APending Publication Date: 2026-11-20CHINA TOBACCO GUANGDONG IND
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611260033.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-19
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Traditional video surveillance systems have low efficiency in querying recordings at cigarette production sites, requiring users to manually locate abnormal events, which is time-consuming and resource-intensive.

Method used

By extracting multiple frames of image data from video data, calling the event recognition model to detect original security events, filtering valid target security events, and aggregating them into structured target alarm events in time and space, relevant video clips are extracted to generate event index information, enabling rapid retrieval.

Benefits of technology

It improves video retrieval efficiency, reduces the proportion of false alarms, adapts to the dispersed locations and complex scenarios in industrial settings, and achieves standardized customization and flexible video retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123138464A_ABST
    Figure CN123138464A_ABST
Patent Text Reader

Abstract

The application provides a cigarette production site video retrieval method and device and a storage medium. The method comprises the following steps: when video data collected by a security device in a cigarette production site during a monitoring task is received, multiple frames of image data are extracted from the video data; an event recognition model is called to detect original security events from the image data; valid original security events are screened according to the event types of the original security events and the monitoring areas, and the valid original security events are used as target security events; multiple target security events belonging to the same monitoring task, the same security device, the same monitoring area and the same event type are aggregated in time and space to form a structured target alarm event; a video clip related to the target alarm event is intercepted from the video data; event index information is generated according to the target alarm event and the video clip; and the target alarm event and the video clip are retrieved in the index information according to an event retrieval request, so that an event retrieval result is obtained. The method has both landing flexibility and video retrieval efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of computer vision, and in particular relates to a video retrieval method, equipment and storage medium for a cigarette production site. Background Technology

[0002] In cigarette production sites, a large number of security devices are usually deployed to monitor situations such as personnel entering restricted areas, abnormal smoke and fire, abnormal vehicle parking, abnormal equipment areas, personnel violating regulations, and abnormal material stacking.

[0003] Currently, users have various needs for video recording retrieval, such as "unresolved incident of personnel intrusion into Warehouse No. 1 yesterday", "video footage of smoke alarm on Line 3", "abnormal vehicle stop incident in Area A", and so on.

[0004] However, traditional video surveillance systems mainly rely on the security device's serial number, date, and time period to create an index and then use the index to query the recorded video. As a result, users need to initially locate the video and manually replay it for precise location, which takes a long time to locate the actual abnormal event, consumes a lot of bandwidth and memory resources, and has low retrieval efficiency. Summary of the Invention

[0005] In view of this, the present invention provides a video retrieval method, device and storage medium for cigarette production sites, so as to improve the retrieval efficiency of surveillance videos.

[0006] The first aspect of the present invention provides a video retrieval method for a cigarette production site, comprising: When receiving video data collected by security equipment performing monitoring tasks at the cigarette production site, multiple frames of image data are extracted from the video data; the monitoring task is configured with an event recognition model and a monitoring area. The event recognition model is invoked to detect raw security events in the image data; the raw security events have event types. Based on the event type of the original security event and the monitoring area, valid original security events are selected as target security events; Multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type are aggregated in time and space into a structured target alarm event; Extract video segments related to the target alarm event from the video data; Generate event index information based on the target alarm event and the video clip; Upon receiving an event retrieval request, the target alarm event and the video clip are retrieved from the index information according to the event retrieval request to obtain the event retrieval results.

[0007] A second aspect of the present invention provides a video retrieval device for a cigarette production site, comprising: The video frame extraction module is used to extract multiple frames of image data from the video data collected by security equipment performing monitoring tasks in the cigarette production site; the monitoring task is configured with an event recognition model and a monitoring area. The original security event detection module is used to call the event recognition model to detect original security events in the image data; the original security event has an event type. The target security event filtering module is used to filter valid original security events as target security events based on the event type of the original security event and the monitoring area. The target alarm event aggregation module is used to aggregate multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type into a structured target alarm event in time and space. A video clip extraction module is used to extract video clips related to the target alarm event from the video data. The index information generation module is used to generate event index information based on the target alarm event and the video segment; The event retrieval module is used to retrieve the target alarm event and the video clip from the index information according to the event retrieval request when an event retrieval request is received, and to obtain the event retrieval result.

[0008] A third aspect of the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the video retrieval method for cigarette production sites as described in the first aspect above.

[0009] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the video retrieval method for cigarette production sites as described in the first aspect above.

[0010] The fifth aspect of the present invention provides a computer program product that, when run on a computer, causes the computer to execute the video retrieval method for cigarette production sites as described in the first aspect above.

[0011] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: In this embodiment, upon receiving video data collected by security equipment performing monitoring tasks at the cigarette production site, multiple frames of image data are extracted from the video data; the monitoring task is configured with an event recognition model and a monitoring area; the event recognition model is invoked to detect original security events in the image data; the original security events have event types; valid original security events are selected as target security events based on the event type and monitoring area; multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type are aggregated in time and space into structured target alarm events; video segments related to the target alarm events are extracted from the video data; event index information is generated based on the target alarm events and video segments; upon receiving an event retrieval request, the target alarm events and video segments are retrieved from the index information based on the event retrieval request to obtain the event retrieval results. This embodiment provides standardized customization and closed-loop management of the entire process for industrial monitoring, adapting to the characteristics of dispersed locations, complex scenarios, and significant differences in monitoring targets in industrial settings. It covers the complete process from video frame extraction, event recognition, effective frame filtering, event aggregation, video segment binding, index construction to accurate retrieval, transforming fragmented single-frame recognition results into structured, traceable alarm events and video resources. It significantly reduces the proportion of false alarms through multi-stage verification, and solves the pain points of slow alarm location and difficult video retrieval under massive industrial video data by relying on the indexing mechanism. At the same time, the standardized configuration template can be quickly reused to different industrial monitoring scenarios, combining flexibility in implementation with high video retrieval efficiency. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 This is a schematic diagram of a video retrieval method for a cigarette production site provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of a video retrieval device for a cigarette production site provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0014] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the present invention. However, those skilled in the art will recognize that the present application may be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted to avoid unnecessary detail that could obscure the description of the present application.

[0015] The technical solution of the present invention will be illustrated below through specific embodiments.

[0016] Reference Figure 1 The diagram illustrates a video retrieval method for a cigarette production site according to an embodiment of the present invention, which may specifically include the following steps: Step 101: When receiving video data collected by security equipment in the cigarette production site to perform monitoring tasks, extract multiple frames of image data from the video data.

[0017] This embodiment can be applied to an industrial video surveillance platform. The industrial video surveillance platform has a built-in industrial monitoring task configuration table. Each monitoring task record in the industrial monitoring task configuration table corresponds to one or more industrial video analysis tasks. The monitoring task record records the correlation between factors such as the identification of the monitoring task, the identification of the security equipment, industrial location information, monitoring area, event recognition model, event type, frame extraction strategy, valid frame determination rules, event aggregation rules, video segment extraction rules, and alarm event index template.

[0018] Furthermore, the industrial monitoring task configuration table includes task base fields, video source fields, monitoring area fields, model fields, alarm generation fields, video clip fields, and index fields.

[0019] The basic task fields include the task identifier, task name, task priority, task start / stop status, and task effective time; the video source fields include the security equipment identifier, security equipment location name, production line, and warehouse or equipment area.

[0020] The monitoring area field includes the monitoring area identifier, the monitoring area type, the monitoring area boundary coordinates, and the monitoring area version number.

[0021] The model fields include the identifier of the event recognition model, the type of the event recognition model, the version of the event recognition model, and the average processing time per frame for the event recognition model.

[0022] The alarm generation fields include event type, target category, target confidence threshold, number of consecutive valid frames threshold, event duration threshold, event merging time interval, spatial correlation threshold, and event end window threshold.

[0023] The video clip fields include the duration before the video clip is extracted, the duration after the video clip is extracted, the keyframe selection rules, and the target location annotation rules.

[0024] The index fields include the event master index field, video segment detail index field, composite index key, time partition field, and event group compression rules, etc.

[0025] For example, in a scenario where personnel are prohibited from entering the storage area of ​​a cigarette production site, the industrial monitoring task configuration table can record the monitoring task identifier TASK-PERSON-001, the security equipment identifier CAM-001, the industrial location information as the east gate of Warehouse No. 1, the monitoring area ROI-A, the event recognition model M-PERSON-V1, the event type as personnel intrusion, the target category as person, the confidence threshold as 0.75, the threshold for the number of consecutive valid frames as 3 frames, the event merging time interval as 5 seconds, the event end window threshold as 8 seconds, and the video segment extraction rules as 10 seconds before and 20 seconds after.

[0026] When an industrial video surveillance platform receives video data collected by a security device performing a monitoring task at a cigarette production site, it can extract multiple frames of image data from the video data based on a frame extraction strategy.

[0027] Diverse frame extraction strategies provide a flexible computing power adaptation solution for industrial video monitoring. Fixed-frequency frame extraction ensures detection stability in conventional scenarios, while dynamic-frequency frame extraction adapts to scenarios with fluctuating computing power and time constraints. Keyframe extraction maximizes the saving of computing resources, and frame extraction based on task priority enables resources to be tilted towards high-value monitoring. Segmented parallel frame extraction improves the processing efficiency of long videos. The design with multiple optional strategies can match the monitoring requirements and computing power conditions of different industrial locations, finding a suitable balance between detection accuracy and resource consumption.

[0028] In one frame extraction method, the duration D of the video data, the frame rate Rv of the video data, the target processing time T, the number of computing units C, the utilization rate eta of the computing units, and the average single-frame processing time L of the event recognition model can be obtained.

[0029] The maximum number of frames Fmax that a computing unit can process within the target processing time T is obtained by dividing the product of the target processing time T, the number of computing units C, and the utilization rate eta of the computing units by the average single-frame processing time L of the event recognition model.

[0030] In general, the maximum number of frames Fmax is rounded up (including rounding up and rounding down).

[0031] For example, Fmax = floor((T×C×eta) / L), where floor is the floor function.

[0032] The frame skipping interval I is obtained by dividing the product of the video data duration D and the video data frame rate Rv by the maximum number of frames Fmax.

[0033] In general, the frame skipping interval I is rounded (including rounding up and rounding down).

[0034] For example, I = ceil((D×Rv) / Fmax), where ceil is the floor function.

[0035] The basic frame-sampling frequency Rbase is obtained by calculating the ratio between the frame rate Rv of the video data and the frame-sampling interval I, i.e., Rbase = Rv / I.

[0036] Subsequently, the base frame sampling frequency Rbase can be corrected according to the monitoring task to obtain the actual frame sampling frequency Ractual.

[0037] In the specific implementation, the event types covered by the monitoring task can be queried as target types, the priority is determined according to the target types, the product between the base frame extraction frequency Rbase and the priority is calculated to obtain the actual frame extraction frequency Ractual, and then multiple frames of image data are extracted from the video data according to the actual frame extraction frequency Ractual.

[0038] Among them, the priority is positively correlated with the risk level of the target type. That is, the higher the risk level of the target type, the lower the priority and the higher the actual frame sampling frequency (Ractual) in order to sample more frequently and improve the risk response speed. Conversely, the lower the risk level of the target type, the higher the priority, in order to sample more frequently and sample more sparsely to reduce resource consumption, thereby achieving a balance between risk prevention and resource consumption.

[0039] For example, when the event type corresponding to the monitoring task is a preset high-risk event type, the basic frame sampling frequency Rbase is multiplied by the priority K1 to obtain the actual frame sampling frequency Ractual, Ractual = Rbase × K1; when the event type corresponding to the monitoring task is a normal inspection event type, the basic frame sampling frequency Rbase is multiplied by the priority K2 to obtain the actual frame sampling frequency Ractual, Ractual = Rbase × K2, where priority K1 is greater than priority K2.

[0040] In this embodiment, the dynamic frequency frame extraction method based on the quantization formula incorporates parameters such as video duration, processing time limit, number and utilization of computing units, single frame processing time, and original frame rate into a unified calculation. It accurately derives the maximum number of frames that can be processed within the target time limit and the optimal frame extraction interval, breaking through the limitation that a fixed frame extraction frequency can easily lead to idle computing power or processing timeouts. It can maximize the effective frame processing volume under given computing power resources and time constraints, and realize the fine-grained scheduling and utilization of computing resources. It is especially suitable for the multi-task concurrent operation scenario of industrial monitoring platforms with limited computing power resources, ensuring the real-time performance and resource utilization of video analysis under high load.

[0041] Furthermore, the frame sampling frequency correction mechanism based on monitoring task priority can allocate computing resources differently according to the event risk level. For high-risk events, the frame sampling density is increased to ensure detection sensitivity and avoid missing key anomalies. For ordinary inspection events, the frame sampling frequency is reduced to control computing power consumption. Under the premise of a fixed overall computing power budget, resources are accurately tilted towards high-value and high-risk monitoring tasks, taking into account the detection reliability of high-risk scenarios and the operating cost of routine inspections. This is in line with the monitoring characteristics of significant differences in risk levels at different locations in industrial scenarios.

[0042] Step 102: Call the event recognition model to detect the original security events in the image data.

[0043] In this embodiment, the event recognition model includes target detection model, classification model, semantic segmentation model, etc. The industrial video surveillance platform can call the corresponding event recognition model to detect the original security events at the frame level of image data according to the industrial monitoring task configuration table.

[0044] For example, personnel intrusion tasks call personnel detection models (event recognition models), smoke and fire detection tasks call flame and smoke detection models (event recognition models), vehicle anomaly tasks call vehicle detection models (event recognition models), and so on.

[0045] The original security event contains information such as the image data identifier frame_id, the monitoring task identifier task_id, the security device identifier camera_id, the timestamp, the monitoring area identifier region_id, the event recognition model identifier model_id, the event recognition model version model_version, the target category object_type, the detection box bbox, the event confidence, and the event type event_type.

[0046] Step 103: Select valid original security events as target security events based on the event type and monitoring area of ​​the original security events.

[0047] In this embodiment, the industrial video surveillance platform can filter frame-level original security events based on the event type and monitoring area of ​​the original security events to obtain valid original security events, which are recorded as target security events.

[0048] In one embodiment of the present invention, step 103 may further include the following steps: Step 1031: Query the event confidence and occurrence location of the original security event.

[0049] For each frame of image data, the original security event can be queried for its event confidence level and location.

[0050] Step 1032: Determine the relationship between the location of the original security event and the location of the monitoring area.

[0051] In this embodiment, the location relationship between the original security event location and the monitoring area can be determined from multiple dimensions to determine whether the original security event location is located within the monitoring area.

[0052] In one judgment method, the center point of the detection box to which the original security event belongs is determined to characterize the location where the original security event occurred, and the center point of the detection box is compared with the monitoring area.

[0053] If the center point of the detection frame is located within the monitoring area, then the positional relationship between the location of the original security event and the monitoring area is determined as the location of the original security event being located within the monitoring area.

[0054] In another method of judgment, the overlap ratio between the detection box to which the original security event belongs and the monitoring area is calculated, and the overlap ratio is compared with the preset area overlap threshold.

[0055] If the overlap area ratio reaches the preset regional overlap threshold, then the location relationship between the original security event location and the monitoring area is determined to be that the original security event location is located within the monitoring area.

[0056] In another method of judgment, the midpoint of the lower boundary of the detection frame to which the original security event belongs is determined to characterize the location of the original security event, and the midpoint of the lower boundary of the detection frame is compared with the monitoring area.

[0057] If the midpoint of the lower boundary of the detection box is located within the monitoring area, then the positional relationship between the location of the original security event and the monitoring area is determined as the location of the original security event being located within the monitoring area.

[0058] Step 1033: For the same original security event, if the event confidence level reaches the preset confidence threshold, the event type of the original security event belongs to the type set corresponding to the monitoring task, and the location of the original security event is within the monitoring area, then the original security event is determined to be a valid target security event.

[0059] An industrial video surveillance platform can determine a valid target security event if it meets three conditions simultaneously: the event confidence level reaches a preset confidence threshold, the event type of the original security event belongs to the type set corresponding to the monitoring task, and the location of the original security event is within the monitoring area.

[0060] In this embodiment, the single-frame recognition results are filtered from three levels: confidence threshold, target category matching, and monitoring area location constraints. This can eliminate low-confidence false detections, non-target category recognition results, and invalid data where the target deviates from the monitoring area, thereby reducing the amount of data processed in the subsequent event aggregation stage. At the same time, it can significantly reduce false alarms caused by background interference and targets entering non-monitoring areas in industrial scenarios, thereby improving the overall accuracy of alarm data and the efficiency of subsequent processing.

[0061] Furthermore, the three target location determination methods provide adapted spatial verification logic for different industrial monitoring scenarios. The center point determination is adapted to monitoring needs centered on the location of the main body, such as personnel on duty and equipment in place. The overlapping area ratio determination is adapted to regional matching scenarios of large targets, such as large equipment intrusion and materials occupying the road. The lower boundary center point determination is adapted to monitoring scenarios related to the contact surface, such as ground foreign objects and materials falling to the ground. The flexible determination options can match the spatial characteristics of different monitoring targets and improve the scenario adaptability and determination accuracy of effective frame determination.

[0062] Step 104: Aggregate multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type into a structured target alarm event in time and space.

[0063] In this embodiment, the industrial video surveillance platform can aggregate multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type into a structured target alarm event in time and space.

[0064] Furthermore, for long videos (i.e., video data length greater than or equal to a threshold), parallel processing can be provided. During parallel processing, the video data is split into multiple detection sub-tasks according to the placement device, time period, or monitoring task; overlapping time windows are set for adjacent detection sub-tasks; multiple detection sub-tasks are assigned to multiple computing units to execute steps 101-104 in parallel, and target security events that meet the same monitoring task, the same placement device, the same monitoring area, and the same event type within the overlapping time window of adjacent detection sub-tasks are aggregated in time and space into structured target alarm events.

[0065] In one embodiment of the present invention, step 104 may further include the following steps: Step 1041: Group multiple target security events that belong to the same monitoring task, the same security equipment, the same monitoring area, and the same event type into the same group.

[0066] In this embodiment, the industrial video surveillance platform can group target security events according to the monitoring task_id, security device camera_id, monitoring area region_id, and event type event_type, and classify multiple target security events belonging to the same monitoring task_id, the same security device camera_id, the same monitoring area region_id, and the same event type event_type into the same group.

[0067] Step 1042: Sort multiple target security events within the same group according to time order to obtain a time series.

[0068] For each group, multiple target security events within the same group can be sorted in chronological order to obtain a time series.

[0069] Step 1043: In the time series, when the time interval between two adjacent target security events is less than or equal to a preset merging time threshold, and the two adjacent target security events meet the preset spatial correlation conditions, the two adjacent target security events are merged into a candidate alarm event.

[0070] In the time series, each target security event is traversed. When the time interval delta_t between two adjacent target security events in the timestamp order is less than or equal to the preset merging time threshold T_merge (i.e., delta_t <= T_merge), and the two adjacent target security events meet the preset spatial correlation conditions, the two adjacent target security events are merged into a candidate alarm event.

[0071] Spatial association conditions indicate the existence of spatial association relationships, including at least one of the following: The intersection-union ratio (IoU) between the detection boxes to which two adjacent target security events belong reaches the preset intersection-union threshold Theta_iou (i.e., IoU>=Theta_iou). The distance Dist(center_i,center_j) between the center points of two adjacent target security event attribution detection boxes (such as center_i and center_j) is less than the preset center distance threshold Theta_dist (i.e., Dist(center_i,center_j)<=Theta_dist). The trajectory direction formed by the center points of the detection boxes belonging to two adjacent target security events satisfies the preset trajectory continuity condition.

[0072] Step 1044: When the duration of a candidate alarm event reaches a preset duration threshold, or when the number of target security events contained in a candidate alarm event reaches a preset continuous number threshold, the candidate alarm event is constructed into a structured target alarm event.

[0073] If the duration of a candidate alarm event reaches a preset duration threshold, or if the number of target security events contained in a candidate alarm event reaches a preset continuous number threshold, the candidate alarm event will be constructed into a structured target alarm event.

[0074] The structured target alarm event includes at least one of the following: event identifier, monitoring task identifier, security equipment identifier, industrial location name, monitoring area identifier, event identification model identifier, event identification model version, event type, target category, event start time, event end time, event duration, target location set, event confidence level, event tag, event summary, and event handling status.

[0075] In this embodiment, the scattered valid frame results are classified by multi-dimensional grouping, and the valid frames of the same event are merged by combining temporal continuity and spatial correlation. Finally, the event confirmation threshold is used by the duration or the number of valid frames. This can integrate the fragmented single-frame identification results into a structured alarm that fully reflects the event process. It can filter out the interfering false detections that occur momentarily, and ensure the complete temporal and spatial consistency of the same event. This solves the problem of scattered single-frame alarms and the inability to restore the whole picture of the event, and greatly improves the readability and reference value of industrial alarms.

[0076] Multi-dimensional spatial association judgment conditions cover the motion characteristics of various targets in industrial scenarios. The intersection-merge ratio threshold is suitable for target events that move slowly or are located in a fixed area. The center point distance threshold is suitable for monitoring small targets that move quickly. The trajectory continuity condition is suitable for monitoring equipment or personnel whose motion patterns are predictable. The same area judgment is suitable for intrusion events in a large area. The diverse judgment options can select the optimal spatial association logic for different monitoring targets, improve the target matching accuracy of event aggregation, and reduce the problem of confusion and merging of different targets.

[0077] In a specific implementation, an event state machine can be determined; the event state machine includes no event state, candidate event state, stable alarm event state, event end state, and event group state.

[0078] In the absence of events, when a target security event is detected, the control event state machine enters the candidate event state.

[0079] In the candidate event state, when the duration of the candidate alarm event reaches a preset duration threshold, or when the number of target security events contained in the candidate alarm event reaches a preset continuous number threshold, the control event state machine enters the stable alarm event state.

[0080] In a stable alarm event state, candidate alarm events are constructed into structured target alarm events. When the window time during which no target security event is detected reaches the preset end window threshold, the control event state machine enters the event end state.

[0081] In the event-end state, when the alarm events of adjacent targets meet the preset event group compression rules, the control event state machine enters the event group state.

[0082] The structured alarm generation mechanism based on event state machines achieves standardized management and control of the entire lifecycle of alarm events through clearly defined five-state transition logic. Each state transition is set with clear trigger conditions, which can effectively suppress the problem of frequent alarm start and stop caused by single-frame recognition fluctuations and improve the stability of alarm output. At the same time, the design of event group states supports the compressed management of similar adjacent events, making the alarm generation process more interpretable and traceable, which meets the requirements of industrial monitoring for alarm stability, continuity and replayability.

[0083] Step 105: Extract video clips related to the target alarm event from the video data.

[0084] In this embodiment, the industrial video surveillance platform can extract video segments related to the target alarm event according to video segment extraction rules, and bind the structured target alarm event with the video segment.

[0085] In practice, the pre-capture duration and post-capture duration can be determined according to the event type based on the configuration of the industrial monitoring task.

[0086] On the one hand, the start time of the target alarm event is subtracted from the pre-capture duration to obtain the start time of the initial segment.

[0087] On the other hand, the end time of the target alarm event is added to the truncation duration to be used as the end time of the initial segment.

[0088] The start and end times of the initial segment are aligned with the keyframe positions in the video data to obtain the actual start and end times of the segment.

[0089] Extract a video segment from the video data that falls between the actual start time and the actual end time of the segment.

[0090] For example, if the start time of a personnel intrusion event is 10:05:30 and the end time is 10:05:42, and the interception rule is 10 seconds before and 20 seconds after, then the initial video segment interception time window is from 10:05:20 to 10:06:02. The industrial video monitoring platform aligns the start and end times of the segments according to the key frame position of the video encoding to ensure that the video segments can be played independently.

[0091] This embodiment combines video segment extraction rules that align the pre- and post-event durations with keyframes. By reserving buffer time before and after the event, it fully preserves the cause and subsequent development of the event, meeting the needs of post-event traceability and evidence collection for industrial alarms. At the same time, based on the video encoding keyframe alignment with the extraction boundary, it avoids problems such as video opening screen distortion and playback stuttering caused by non-keyframe extraction, ensuring that the extracted video segments can be played smoothly and normally, and improving the usability and viewing experience of alarm video evidence collection.

[0092] Step 106: Generate event index information based on the target alarm event and video clips.

[0093] In this embodiment, the industrial video surveillance platform generates a hierarchical alarm event index based on the index template of the target alarm event.

[0094] The hierarchical alarm event index includes the main event index, video segment detail index, event group index, and composite index.

[0095] The main event index is used to store the main retrieval fields of structured alarm events, including the monitoring task, location, region, model, event type, timestamp, event confidence, tag, summary, and handling status of the target alarm event.

[0096] The video clip detail index is used to store the binding relationship between the target alarm event identifier (event_id) and the video clip identifier (clip_id), video clip address (clip_address), keyframe address (key_frame_address), event start offset (event_start_offset), event end offset (event_end_offset), and target location annotation data (overlay_data).

[0097] The event group index is used to record the event group formed by merging multiple adjacent structured alarm events, which facilitates the compression of adjacent duplicate alarms; Composite indexes are used to generate composite index keys based on at least two fields from the following: the identifier of the monitoring task, the identifier of the security equipment, the identifier of the monitoring area, the event type, the time partition, the identifier of the event identification model, and the handling status. This facilitates improved efficiency in composite retrieval.

[0098] Step 107: Upon receiving an event retrieval request, retrieve the target alarm event and video clip from the index information according to the event retrieval request to obtain the event retrieval results.

[0099] In this embodiment, the industrial video surveillance platform receives an event retrieval request sent by the client, retrieves the target alarm event and video clip from the index information according to the event retrieval request, obtains the event retrieval results, and sends the event retrieval results to the client for display.

[0100] In one embodiment of the present invention, step 107 may further include the following steps: Step 1071: Calculate the alarm confidence of the target alarm event based on the event confidence of the target security event.

[0101] In this embodiment, the alarm confidence of a target alarm event can be calculated based on the event confidence of each target security event in the target alarm event.

[0102] In the specific implementation, the average confidence level of the target security events in the same target alarm event is calculated to obtain the average confidence level Conf_avg.

[0103] The maximum confidence score (Conf_max) is obtained by selecting the event with the highest confidence score from the target security events among the same target alarm events.

[0104] The effective frame ratio Frame_ratio is obtained by calculating the ratio between the number of target security events in the same target alarm event and the number of frames in the video segment.

[0105] The location stability (Stability) is constructed using the location elements of target security events within the same target alarm event, in either a linear or non-linear manner.

[0106] The positional elements include at least one of the following: The average crossover ratio between the target security event detection boxes, the variance of the trajectory formed by the center points of the target security event detection boxes, and the proportion of the target security event's occurrence location located within the monitoring area.

[0107] The spatial characteristics of the target are quantified from three perspectives: overlap of detection boxes, degree of trajectory fluctuation, and regional dwell ratio. This approach is adapted to different scenarios such as fixed equipment anomalies, moving object events, and regional dwell alarms, enriching the evaluation dimensions of event confidence. This allows confidence calculation to fit the spatial characteristics of different types of events, further improving the scenario adaptability and reasonableness of event confidence assessment.

[0108] The alarm confidence score Conf_event of the target alarm event is obtained by weighting and summing the average confidence score, maximum confidence score, effective frame ratio, and location stability.

[0109] Then, the alarm confidence Conf_event of the target alarm event can be expressed as: Conf_event=a×Conf_avg+b×Conf_max+c×Frame_ratio+d×Stability, where a, b, c and d are weight coefficients, and a+b+c+d=1.

[0110] In this embodiment, four types of features are integrated: the mean and extreme values ​​of single-frame recognition confidence, the proportion of valid event frames, and the stability of target location. The importance of different dimensions is adjusted through weight configuration. Compared with a single frame confidence, it can more comprehensively reflect the credibility of the entire alarm event. It not only covers the confidence level of the algorithm recognition, but also incorporates the event's persistence characteristics and spatial stability. It can more accurately distinguish between real alarms and occasional false alarms, and provides a reliable quantitative basis for alarm classification, handling, retrieval and ranking.

[0111] Step 1072: When the target alarm event and video clip are retrieved from the index information according to the event retrieval request, the target alarm events are sorted according to the alarm confidence level to obtain the event location.

[0112] In this embodiment, the target alarm event and video clip can be retrieved from the index information according to the event retrieval request. During this process, the retrieved target alarm events are sorted according to the alarm confidence level to obtain the event location.

[0113] In the specific implementation, the fields in the event retrieval request include time conditions, task conditions related to the monitoring task, equipment conditions related to security equipment, location conditions related to industrial locations, type conditions related to the event type, area conditions related to the monitoring area, model conditions related to the event identification model, and handling conditions related to the handling status.

[0114] The index information includes time-partitioned index sub-information.

[0115] Then, based on the time condition, the target alarm event is retrieved from the time partition index sub-information to obtain the first event set; wherein, the target alarm event in the first event set has the first matching degree FieldScore on the event.

[0116] The first event set is filtered by location based on at least one of the task conditions, equipment conditions, and location conditions to obtain the second event set.

[0117] The second event set is filtered based on at least one of the type condition, region condition, and model condition to obtain the third event set.

[0118] The third event set is filtered by state based on the handling conditions to obtain the fourth event set.

[0119] This embodiment provides a layered retrieval process with progressive filtering, following the logic of first narrowing the scope, then fine-tuning, and finally sorting. It first quickly narrows down the candidate data range through time partitioning index, then filters and selects data step by step through location attributes, event attributes, and handling status, and finally outputs the results based on keyword matching degree. This can significantly reduce the amount of computation required for full data scanning and significantly improve the retrieval response speed in scenarios with massive industrial alarm data. At the same time, the multi-dimensional filtering conditions ensure the accuracy of the retrieval results, which is highly in line with the usage habits of industrial users to quickly locate alarms by time, location, and event type.

[0120] Calculate the second match score (TimeScore) between fields in the event retrieval request and the target alarm event.

[0121] For the fourth event set, the first matching degree FieldScore, the second matching degree TimeScore, the alarm confidence degree Conf_event, the priority of the monitoring task PriorityScore, the priority of the handling status StatusScore, and the occurrence time FreshScore (i.e., recent time) of the target alarm event are weighted and summed to obtain the relevance score of the target alarm event.

[0122] Then, the correlation score of the target alarm event can be expressed as: Score = w1 × FieldScore + w2 × TimeScore + w3 × Conf_event + w4 × PriorityScore + w5 × StatusScore + w6 × FreshScore, where w1, w2, w3, w4, w5, and w6 are weight coefficients, and w1 + w2 + w3 + w4 + w5 + w6 = 1.

[0123] This embodiment integrates dimensions such as field matching degree, time matching degree, event confidence degree, task priority, handling status, and event relevance. By adjusting the weights, it adapts to different search scenario preferences. Replacing single-dimensional sorting, it can better match the search intent of industrial users, allowing high-confidence, high-priority, unhandled, and recently occurring alarms to be displayed first. This helps users quickly locate the most important events among a large number of search results, effectively improving the efficiency of alarm retrieval and handling.

[0124] For the fourth event set, the target alarm events are sorted in descending order of relevance to obtain the event locations.

[0125] Step 1073: Write the event location into the event retrieval results.

[0126] In this embodiment, the event location of the target alarm event is written into the event retrieval results, so that the client displays the target alarm events according to the event location, and prioritizes the display of target alarm events with high relevance.

[0127] Furthermore, when a playback request for a certain video segment is received, the corresponding video segment is loaded according to the address of the video segment, and the playback progress is positioned to the location of the target alarm event based on the offset of the event start time of the corresponding target alarm event in the video segment; at least one of the following is overlaid on the video segment playback interface: the annotation data of the location of the target alarm event, the monitoring area boundary, the event start time, the event end time, the event type, and the event handling status.

[0128] In this embodiment, upon receiving video data collected by security equipment performing monitoring tasks at the cigarette production site, multiple frames of image data are extracted from the video data; the monitoring task is configured with an event recognition model and a monitoring area; the event recognition model is invoked to detect original security events in the image data; the original security events have event types; valid original security events are selected as target security events based on the event type and monitoring area; multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type are aggregated in time and space into structured target alarm events; video segments related to the target alarm events are extracted from the video data; event index information is generated based on the target alarm events and video segments; upon receiving an event retrieval request, the target alarm events and video segments are retrieved from the index information based on the event retrieval request to obtain the event retrieval results. This embodiment provides standardized customization and closed-loop management of the entire process for industrial monitoring, adapting to the characteristics of dispersed locations, complex scenarios, and significant differences in monitoring targets in industrial settings. It covers the complete process from video frame extraction, event recognition, effective frame filtering, event aggregation, video segment binding, index construction to accurate retrieval, transforming fragmented single-frame recognition results into structured, traceable alarm events and video resources. It significantly reduces the proportion of false alarms through multi-stage verification, and solves the pain points of slow alarm location and difficult video retrieval under massive industrial video data by relying on the indexing mechanism. At the same time, the standardized configuration template can be quickly reused to different industrial monitoring scenarios, combining flexibility in implementation with high video retrieval efficiency.

[0129] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0130] Reference Figure 2 The diagram illustrates a video retrieval device for a cigarette production site according to an embodiment of the present invention, which may specifically include the following modules: The video frame extraction module 201 is used to extract multiple frames of image data from the video data when receiving video data collected by security equipment performing monitoring tasks in the cigarette production site; the monitoring task is configured with an event recognition model and a monitoring area. The original security event detection module 202 is used to call the event recognition model to detect original security events in the image data; the original security event has an event type; The target security event filtering module 203 is used to filter valid original security events as target security events based on the event type of the original security event and the monitoring area. The target alarm event aggregation module 204 is used to aggregate multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area and the same event type into a structured target alarm event in time and space; The video clip extraction module 205 is used to extract video clips related to the target alarm event from the video data; Index information generation module 206 is used to generate event index information based on the target alarm event and the video segment; The event retrieval module 207 is used to retrieve the target alarm event and the video clip from the index information according to the event retrieval request when an event retrieval request is received, and to obtain the event retrieval result.

[0131] In one embodiment of the present invention, the video frame extraction module 201 is further configured to: The duration of the video data, the frame rate of the video data, the target processing time limit, the number of computing units, the utilization rate of the computing units, and the average single-frame processing time of the event recognition model are obtained. The maximum number of frames that the computing unit can process within the target processing time limit is obtained by dividing the product of the target processing time limit, the number of computing units, and the utilization rate of the computing units by the average single-frame processing time of the event recognition model. The frame skipping interval is obtained by dividing the product of the duration of the video data and the frame rate of the video data by the maximum number of frames. The basic frame-sampling frequency is obtained by calculating the ratio of the frame rate of the video data to the frame-sampling interval. Query the event types covered by the monitoring task as the target type; Priorities are determined according to the target type; the priorities are positively correlated with the risk level of the target type. The actual frame-sampling frequency is obtained by calculating the product between the base frame-sampling frequency and the priority. Multiple frames of image data are extracted from the video data according to the actual frame extraction frequency.

[0132] In one embodiment of the present invention, the target security event filtering module 203 is further configured to: Query the event confidence and occurrence location of the original security event; Determine the relationship between the location of the original security event and the location of the monitoring area; For the same original security event, if the event confidence level reaches a preset confidence threshold, the event type of the original security event belongs to the type set corresponding to the monitoring task, and the location of the original security event is within the monitoring area, then the original security event is determined to be a valid target security event.

[0133] In one embodiment of the present invention, the target security event filtering module 203 is further configured to: Determine the center point of the detection box to which the original security event belongs, so as to characterize the location where the original security event occurred; If the center point of the detection frame is located within the monitoring area, then the positional relationship between the location of the original security event and the monitoring area is determined to be that the location of the original security event is located within the monitoring area. or, Calculate the overlap ratio between the detection frame to which the original security event belongs and the monitoring area; If the overlapping area ratio reaches a preset regional overlap threshold, then the positional relationship between the location of the original security event and the monitoring area is determined to be that the location of the original security event is located within the monitoring area. or, Determine the midpoint of the lower boundary of the detection box to which the original security event belongs, so as to characterize the location where the original security event occurred; If the midpoint of the lower boundary of the detection frame is located within the monitoring area, then the positional relationship between the location of the original security event and the monitoring area is determined to be that the location of the original security event is located within the monitoring area.

[0134] In one embodiment of the present invention, the target alarm event aggregation module 204 is further configured to: Multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type are grouped into the same group; The target security events within the same group are sorted according to frame time order to obtain a time series. In the time series, when the time interval between two adjacent target security events is less than or equal to a preset merging time threshold, and when the two adjacent target security events meet a preset spatial correlation condition, the two adjacent target security events are merged into a candidate alarm event. When the duration of the candidate alarm event reaches a preset duration threshold, or when the number of target security events contained in the candidate alarm event reaches a preset consecutive number threshold, the candidate alarm event is constructed into a structured target alarm event.

[0135] In one embodiment of the present invention, the spatial association condition includes at least one of the following: The cross-union ratio between the detection boxes to which two adjacent target security events belong reaches a preset cross-union threshold; The distance between the center points of two adjacent target security event attribution detection boxes is less than a preset center distance threshold; The trajectory direction formed by the center points of two adjacent target security event attribution detection boxes satisfies the preset trajectory continuity condition.

[0136] In one embodiment of the present invention, the target alarm event aggregation module 204 is further configured to: Determine the event state machine; the event state machine includes no event state, candidate event state, stable alarm event state, event end state, and event group state; In the event-free state, when the target security event is detected, the event state machine is controlled to enter the candidate event state; In the candidate event state, when the duration of the candidate alarm event reaches a preset duration threshold, or when the number of the target security events included in the candidate alarm event reaches a preset continuous number threshold, the event state machine is controlled to enter the stable alarm event state. In the stable alarm event state, the candidate alarm events are constructed into a structured target alarm event. When the window time during which no target security event is detected for a continuous period reaches a preset end window threshold, the event state machine is controlled to enter the event end state. In the event end state, when adjacent target alarm events meet the preset event group compression rules, the event state machine is controlled to enter the event group state.

[0137] In one embodiment of the present invention, the video segment extraction module 205 is further configured to: The pre-truncation duration and post-truncation duration are determined according to the event type. The start time of the initial segment is obtained by subtracting the pre-capture duration from the start time of the target alarm event. Add the end time of the target alarm event to the truncated post-duration time to obtain the initial segment end time; Align the initial segment start time and the initial segment end time with the keyframe positions in the video data to obtain the actual segment start time and the actual segment end time; Extract a video segment from the video data that falls between the start time and the end time of the actual segment.

[0138] In one embodiment of the present invention, the event retrieval module 207 is further configured to: Calculate the alarm confidence of the target alarm event based on the event confidence of the target security event; When the target alarm event and the video segment are retrieved from the index information according to the event retrieval request, the target alarm event is sorted according to the alarm confidence level to obtain the event location; Write the event location into the event retrieval results.

[0139] In one embodiment of the present invention, the event retrieval module 207 is further configured to: The average confidence level is obtained by calculating the average confidence level of the target security events in the same target alarm event; The highest confidence score is obtained by selecting the target security event with the highest value among the target alarm events; The effective frame ratio is obtained by calculating the ratio between the number of target security events in the same target alarm event and the number of frames in the video segment. Location stability is constructed using location elements of the target security events within the same target alarm event; the location elements include at least one of the following: the average crossover ratio between the detection boxes to which the target security events belong, the variance of the trajectory formed by the center points of the detection boxes to which the target security events belong, and the proportion of the location where the target security event occurs within the monitoring area; The alarm confidence of the target alarm event is obtained by weighted summing of the average confidence, the maximum confidence, the effective frame ratio, and the position stability.

[0140] In one embodiment of the present invention, the fields in the event retrieval request include time conditions, task conditions related to the monitoring task, equipment conditions related to the security equipment, location conditions related to the industrial location, type conditions related to the event type, area conditions related to the monitoring area, model conditions related to the event identification model, and handling conditions related to the handling status. The index information includes time partition index sub-information; When the target alarm event and the video segment are retrieved from the index information according to the event retrieval request, the target alarm events are sorted according to the alarm confidence level to obtain the event location, including: The target alarm event is retrieved from the time partition index sub-information according to the time condition to obtain a first event set; the target alarm event in the first event set has a first matching degree on the event; The first event set is filtered by location based on at least one of the task conditions, the equipment conditions, and the location conditions to obtain the second event set. The second event set is filtered according to at least one of the type condition, the region condition, and the model condition to obtain a third event set. The third event set is filtered according to the aforementioned processing conditions to obtain a fourth event set; Calculate the second matching degree between the fields in the event retrieval request and the target alarm event; For the fourth event set, the correlation of the target alarm event is obtained by weighted summing of the first matching degree, the second matching degree, the alarm confidence degree, the priority of the monitoring task, the priority of the handling status, and the occurrence time of the target alarm event. For the fourth event set, the target alarm events are sorted according to the correlation to obtain the event location.

[0141] The present invention provides a video retrieval device for a cigarette production site. By using the video retrieval device for a cigarette production site, the various steps in the aforementioned video retrieval method embodiments for various cigarette production sites can be realized.

[0142] It should be noted that the module division in the various video retrieval devices for cigarette production sites provided in the above embodiments is illustrative and only represents a logical functional division. In actual implementation, other division methods may also be used. Furthermore, the functional modules in the various embodiments of this invention can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0143] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the embodiments of the present invention can be embodied in the form of a computer program product, which is stored in a computer storage medium and includes several instructions to cause an electronic device or processor to execute all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned computer storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0144] Furthermore, the video retrieval device for the cigarette production site provided in the above embodiments and the video retrieval method for the cigarette production site belong to the same concept. For details of its implementation process, please refer to the method embodiments, which will not be repeated here.

[0145] Reference Figure 3 The diagram illustrates an electronic device according to an embodiment of the present invention. Figure 3 As shown, the electronic device in this embodiment of the invention includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the above-described embodiment of the video retrieval method for cigarette production sites. Alternatively, when the processor executes the computer program, it implements the functions of each module in the above-described embodiment of the video retrieval device for cigarette production sites.

[0146] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which can be used to describe the execution process of the computer program in the electronic device.

[0147] The electronic device may be a desktop computer, a cloud server, or other computing device. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 3 This is merely one example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0148] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0149] The memory can be an internal storage unit of the electronic device, such as a hard drive or RAM. Alternatively, it can be an external storage device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory can include both internal and external storage units. The memory is used to store the computer program and other programs and data required by the electronic device. The memory can also be used to temporarily store data that has been output or will be output.

[0150] This invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the video retrieval method for the cigarette production site as described in the foregoing embodiments.

[0151] This invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the video retrieval method for cigarette production sites as described in the foregoing embodiments.

[0152] This invention also discloses a computer program product that, when run on a computer, causes the computer to execute the video retrieval method for the cigarette production site described in the foregoing embodiments.

[0153] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A video retrieval method for a cigarette production site, characterized in that, include: When receiving video data collected by security equipment performing monitoring tasks at the cigarette production site, multiple frames of image data are extracted from the video data; The monitoring task is configured with an event recognition model and a monitoring area; The event recognition model is invoked to detect original security events in the image data; The original security event has an event type; Based on the event type of the original security event and the monitoring area, valid original security events are selected as target security events; Multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type are aggregated in time and space into a structured target alarm event; Extract video segments related to the target alarm event from the video data; Generate event index information based on the target alarm event and the video clip; Upon receiving an event retrieval request, the target alarm event and the video clip are retrieved from the index information according to the event retrieval request to obtain the event retrieval results.

2. The method according to claim 1, characterized in that, The step of extracting multiple frames of image data from the video data includes: The duration of the video data, the frame rate of the video data, the target processing time limit, the number of computing units, the utilization rate of the computing units, and the average single-frame processing time of the event recognition model are obtained. The maximum number of frames that the computing unit can process within the target processing time limit is obtained by dividing the product of the target processing time limit, the number of computing units, and the utilization rate of the computing units by the average single-frame processing time of the event recognition model. The frame skipping interval is obtained by dividing the product of the duration of the video data and the frame rate of the video data by the maximum number of frames. The basic frame-sampling frequency is obtained by calculating the ratio of the frame rate of the video data to the frame-sampling interval. Query the event types covered by the monitoring task as the target type; Priorities are determined according to the target type; the priorities are positively correlated with the risk level of the target type. The actual frame-sampling frequency is obtained by calculating the product between the base frame-sampling frequency and the priority. Multiple frames of image data are extracted from the video data according to the actual frame extraction frequency.

3. The method according to claim 1, characterized in that, The step of filtering valid original security events as target security events based on the event type of the original security event and the monitoring area includes: Query the event confidence and occurrence location of the original security event; Determine the relationship between the location of the original security event and the location of the monitoring area; For the same original security event, if the event confidence level reaches a preset confidence threshold, the event type of the original security event belongs to the type set corresponding to the monitoring task, and the location of the original security event is within the monitoring area, then the original security event is determined to be a valid target security event. The determination of the location relationship between the original security event and the monitoring area includes: Determine the center point of the detection box to which the original security event belongs, so as to characterize the location where the original security event occurred; If the center point of the detection frame is located within the monitoring area, then the positional relationship between the location of the original security event and the monitoring area is determined to be that the location of the original security event is located within the monitoring area. or, Calculate the overlap ratio between the detection frame to which the original security event belongs and the monitoring area; If the overlapping area ratio reaches a preset regional overlap threshold, then the positional relationship between the location of the original security event and the monitoring area is determined to be that the location of the original security event is located within the monitoring area. or, Determine the midpoint of the lower boundary of the detection box to which the original security event belongs, so as to characterize the location where the original security event occurred; If the midpoint of the lower boundary of the detection frame is located within the monitoring area, then the positional relationship between the location of the original security event and the monitoring area is determined to be that the location of the original security event is located within the monitoring area.

4. The method according to claim 1, characterized in that, The aggregation of multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type into a structured target alarm event in time and space includes: Multiple target security events belonging to the same monitoring task, the same security equipment, the same monitoring area, and the same event type are grouped into the same group; The target security events within the same group are sorted according to frame time order to obtain a time series. In the time series, when the time interval between two adjacent target security events is less than or equal to a preset merging time threshold, and when the two adjacent target security events meet a preset spatial correlation condition, the two adjacent target security events are merged into a candidate alarm event. When the duration of the candidate alarm event reaches a preset duration threshold, or when the number of target security events contained in the candidate alarm event reaches a preset consecutive number threshold, the candidate alarm event is constructed into a structured target alarm event. The spatial association conditions include at least one of the following: The cross-union ratio between the detection boxes to which two adjacent target security events belong reaches a preset cross-union threshold; The distance between the center points of two adjacent target security event attribution detection boxes is less than a preset center distance threshold; The trajectory direction formed by the center points of two adjacent target security event attribution detection boxes satisfies the preset trajectory continuity condition.

5. The method according to claim 4, characterized in that, When the duration of the candidate alarm event reaches a preset duration threshold, or when the number of target security events included in the candidate alarm event reaches a preset consecutive number threshold, the candidate alarm event is constructed into a structured target alarm event, including: Determine the event state machine; the event state machine includes no event state, candidate event state, stable alarm event state, event end state, and event group state; In the event-free state, when the target security event is detected, the event state machine is controlled to enter the candidate event state; In the candidate event state, when the duration of the candidate alarm event reaches a preset duration threshold, or when the number of the target security events included in the candidate alarm event reaches a preset continuous number threshold, the event state machine is controlled to enter the stable alarm event state. In the stable alarm event state, the candidate alarm events are constructed into a structured target alarm event. When the window time during which no target security event is detected for a continuous period reaches a preset end window threshold, the event state machine is controlled to enter the event end state. In the event end state, when adjacent target alarm events meet the preset event group compression rules, the event state machine is controlled to enter the event group state.

6. The method according to claim 1, characterized in that, Extracting video segments related to the target alarm event from the video data includes: The pre-truncation duration and post-truncation duration are determined according to the event type. The start time of the initial segment is obtained by subtracting the pre-capture duration from the start time of the target alarm event. Add the end time of the target alarm event to the truncated post-duration time to obtain the initial segment end time; Align the initial segment start time and the initial segment end time with the keyframe positions in the video data to obtain the actual segment start time and the actual segment end time; Extract a video segment from the video data that falls between the start time and the end time of the actual segment.

7. The method according to any one of claims 1-6, characterized in that, The step of retrieving the target alarm event and the video clip from the index information according to the event retrieval request, and obtaining the event retrieval results, includes: Calculate the alarm confidence of the target alarm event based on the event confidence of the target security event; When the target alarm event and the video segment are retrieved from the index information according to the event retrieval request, the target alarm event is sorted according to the alarm confidence level to obtain the event location; Write the event location into the event retrieval results.

8. The method according to claim 7, characterized in that, The step of calculating the alarm confidence of the target alarm event based on the event confidence of the target security event includes: The average confidence level is obtained by calculating the average confidence level of the target security events in the same target alarm event; The highest confidence score is obtained by selecting the target security event with the highest value among the target alarm events; The effective frame ratio is obtained by calculating the ratio between the number of target security events in the same target alarm event and the number of frames in the video segment. Location stability is constructed using location elements of the target security events within the same target alarm event; the location elements include at least one of the following: the average crossover ratio between the detection boxes to which the target security events belong, the variance of the trajectory formed by the center points of the detection boxes to which the target security events belong, and the proportion of the location where the target security event occurs within the monitoring area; The alarm confidence of the target alarm event is obtained by weighted summing of the average confidence, the maximum confidence, the effective frame ratio and the position stability. The fields in the event retrieval request include time conditions, task conditions related to the monitoring task, equipment conditions related to the security equipment, location conditions related to the industrial location, type conditions related to the event type, area conditions related to the monitoring area, model conditions related to the event identification model, and handling conditions related to the handling status. The index information includes time partition index sub-information; When the target alarm event and the video segment are retrieved from the index information according to the event retrieval request, the target alarm events are sorted according to the alarm confidence level to obtain the event location, including: The target alarm event is retrieved from the time partition index sub-information according to the time condition to obtain a first event set; the target alarm event in the first event set has a first matching degree on the event; The first event set is filtered by location based on at least one of the task conditions, the equipment conditions, and the location conditions to obtain the second event set. The second event set is filtered according to at least one of the type condition, the region condition, and the model condition to obtain a third event set. The third event set is filtered according to the aforementioned processing conditions to obtain a fourth event set; Calculate the second matching degree between the fields in the event retrieval request and the target alarm event; For the fourth event set, the correlation of the target alarm event is obtained by weighted summing of the first matching degree, the second matching degree, the alarm confidence degree, the priority of the monitoring task, the priority of the handling status, and the occurrence time of the target alarm event. For the fourth event set, the target alarm events are sorted according to the correlation to obtain the event location.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the video retrieval method for cigarette production sites as described in any one of claims 1-8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the video retrieval method for cigarette production sites as described in any one of claims 1-8.