CN110069659A - Alarm event video pictures store method based on round-robin queue - Google Patents

Alarm event video pictures store method based on round-robin queue Download PDF

Info

Publication number
CN110069659A
CN110069659A CN201910326378.3A CN201910326378A CN110069659A CN 110069659 A CN110069659 A CN 110069659A CN 201910326378 A CN201910326378 A CN 201910326378A CN 110069659 A CN110069659 A CN 110069659A
Authority
CN
China
Prior art keywords
frame
video
list
alarm event
index
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910326378.3A
Other languages
Chinese (zh)
Inventor
魏晓林
陈宏亮
花红艳
汤贤巍
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Tiancheng Biji Technology Co Ltd
Original Assignee
Shanghai Tiancheng Biji Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Tiancheng Biji Technology Co Ltd filed Critical Shanghai Tiancheng Biji Technology Co Ltd
Priority to CN201910326378.3A priority Critical patent/CN110069659A/en
Publication of CN110069659A publication Critical patent/CN110069659A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/71Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/41Higher-level, semantic clustering, classification or understanding of video scenes, e.g. detection, labelling or Markovian modelling of sport events or news items
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/44Event detection

Abstract

The invention discloses a kind of alarm event video pictures store method based on round-robin queue, by in the list of a fixed length, the video frame of certain time length is prestored in advance, is then marked next position of middle position and latest frame as replacement position, is realized round-robin queue's function.The video of middle position frame is detected with this, if there is alarm event, the video frame in fixed length list is rearranged to new list sequentially in time, and the video frame picture of the new list and mark middle position is saved.Alarm event video pictures store method based on round-robin queue of the invention, the video of alarm event certain period of time before and after generation can only be stored, storage efficiency is high, storage precision is high, timeliness is strong, simultaneously, frame Warning_frame can be occurred according to alarm event in storage and alarm event stream arranges other Warning_video_list and arranged, storage logic is strong.

Description

Alarm event video pictures store method based on round-robin queue
Technical field
It is high that the present invention relates to a kind of video image store method more particularly to a kind of storage efficiencies, and it is strong to save logic Alarm event video pictures store method based on round-robin queue.
Background technique
With the development of intelligentize and informatization, some intelligent equipments and technical concept are constantly introduced in intelligence community, come Improve community management cost and quality of life.In cell, there are many alarm events to occur often, timely warning system is Through very universal, the video of certain period of time before and after alarm event then how is effectively stored, as event handling and is quickly taken The foundation of card, and the high efficiency of work, it appears particularly important.At present for this problem, picture is often reported according to the time The time point of display searches corresponding video flowing, carries out long video stream and is accurately positioned search, not only needs to store a large amount of view in this way Frequency flow data, and search the problem of there is also inefficiency, especially some accurate alarm events and timeliness requirement High alarm event, it appears particularly difficult.
Therefore, it is necessary to a kind of improvement be proposed, to overcome the prior art difficult.
Summary of the invention
Present invention aim to address the problems of the prior art, provide a kind of alarm event video based on round-robin queue Picture store method.The list of present invention proposition clearance one limit length of creation and two flag bits, are realized with this and use list The function of realizing queue is then based on the round-robin queue, when realizing picture and the specific front and back of awareness apparatus alarm event evidence obtaining The preservation mechanism of long video flowing.
The technical scheme is that
A kind of alarm event video pictures store method based on round-robin queue, comprising the following steps: S1, initialization creation Queue frame_list is monitored, the monitoring queue maximum length list_maxsize=L is set;S2, in the monitoring queue Definition replacement label change_index and inspection tag check_index in frame_list;Initialize installation change_ Index and check_index is -1;S3, video frame is filled into the monitoring queue frame_list, until the monitoring The length of queue frame_list is L;Assignment change_index=0, check_index L/2;S4, alarm event is carried out Monitoring and alarm event video pictures save;Specific steps step are as follows: a, read the monitoring middle position queue frame_list Video frame frame_mid is the corresponding video frame of inspection tag check_index namely frame_mid=frame_list [check_index];B, alarm event monitoring is carried out to video frame frame_mid, Initialize installation event identifies Flag=false;If not finding alarm event, e is turned to;If it was found that alarm event, mark flag=occurs for setting event True turns to c;C, it is video frame frame_mid that frame Warning_fram, which occurs, for setting alarm event, initializes alarm event Stream arranges other Warning_video_list, from the replacement label change_index video frame position of monitoring queue frame_list Place starts to read video flow processing, monitors the position start frame start_index and the replacement label of queue frame_list at this time Change_index video frame position is identical namely start_index=change_index, turns to d;D, monitoring queue is read Video frame at the position start frame start_index of frame_list is added to alarm event stream and arranges other Warning_ Video_list, then, above-mentioned start frame start_index be moved to monitoring queue frame_list in video frame it is next Position;If alarm event stream, which arranges other Warning_video_list length, is less than L, d is repeated;Otherwise, e is turned to;E, it reads newly Video frame frame_new is replaced in the monitoring queue frame_list with new video frame frame_new and is replaced label The video frame of the position change_index, and label change_index and inspection tag check_index will be replaced simultaneously One is moved down, f is turned to;If f, mark flag=true occurs for event, frame Warning_frame and announcement are occurred into for alarm event Alert flow of event arranges other Warning_video_list and reports and saved, later repeatedly step S4.
As a kind of perferred technical scheme, the step S3 method particularly includes: S3a, the setting monitoring queue Frame_list list length i=0;S3b, as i < L, then read a frame video and be added to the detection queue frame_list; S3c, when i be not less than L, then it is described monitoring queue frame_list length be maximum length L, assignment change_index =0, check_index L/2.
As a kind of further preferred technical solution, " reading a frame video " in the step S3b is to supervise from camera A frame video is read in control video recording.
As a kind of technical solution still more preferably, " new video frame frame_ is read in the step S4, e New " is newly to read a frame video from camera head monitor video recording.
As a kind of perferred technical scheme, " alarm event is carried out to video frame frame_mid in the step S4, b In monitoring ", including alarm event type is monitored;At this point, " frame Warning_frame and announcement are occurred for alarm event in f Alert flow of event arranges other Warning_video_list and reports and saved " it include that alarm event type is reported and carried out It saves.
A kind of alarm event video pictures store method based on round-robin queue of the invention, passes through the column in a fixed length In table, the video frame of certain time length is prestored in advance, the next position for then marking middle position and latest frame is used as replacement position, Realize round-robin queue's function.The video of middle position frame is detected with this, if there is alarm event, by the view in fixed length list Frequency frame rearranges new list sequentially in time, and the video frame picture of the new list and mark middle position is saved Come.Alarm event video pictures store method based on round-robin queue of the invention, can only store alarm event before generation The video of certain period of time afterwards, storage efficiency is high, storage precision is high, and timeliness is strong, meanwhile, it can be in storage according to alarm Frame Warning_frame occurs for event and alarm event stream arranges other Warning_video_list and arranged, and stores logic By force.
Detailed description of the invention
Fig. 1 is that the present invention is based on the alarm event video pictures store method flow charts of round-robin queue.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
The term used in embodiments of the present invention is only to be not intended to be limiting merely for for the purpose of describing particular embodiments The present invention.In the embodiment of the present invention and the "an" of singular used in the attached claims, " described " and "the" It is also intended to including most forms, unless the context clearly indicates other meaning, " a variety of " generally comprise at least two, but not It excludes to include at least one situation.
It should be appreciated that term "and/or" used herein is only a kind of incidence relation for describing affiliated partner, indicate There may be three kinds of relationships, for example, A and/or B, can indicate: individualism A, exist simultaneously A and B, individualism B these three Situation.In addition, character "/" herein, typicallys represent the relationship that forward-backward correlation object is a kind of "or".
Depending on context, word as used in this " if ", " if " can be construed to " ... when " or " when ... " or " in response to determination " or " in response to detection ".Similarly, context is depended on, phrase " if it is determined that " or " such as Fruit detection (condition or event of statement) " can be construed to " when determining " or " in response to determination " or " when detection (statement Condition or event) when " or " in response to detection (condition or event of statement) ".
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability Include, so that commodity or system including a series of elements not only include those elements, but also including not clear The other element listed, or further include for this commodity or the intrinsic element of system.In the feelings not limited more Under condition, the element that is limited by sentence "including a ...", it is not excluded that in the commodity or system for including the element also There are other identical elements.
It is as shown in Figure 1 a kind of alarm event video pictures store method based on round-robin queue of the invention, feature It is: the following steps are included:
S1, initialization creation monitoring queue frame_list, set the monitoring queue maximum length list_maxsize =L;In practical applications, initialization creation monitoring queue frame_list is frame_list=[];
S2, the definition replacement label change_index and inspection tag check_ in the monitoring queue frame_list index;Initialize installation change_index and check_index are -1;At this point, being set as change_index= Check_index=-1;
S3, video frame is filled into the monitoring queue frame_list, until the monitoring queue frame_list's Length is L;Assignment change_index=0, check_index L/2;
S4, alarm event monitoring and the preservation of alarm event video pictures are carried out;Specific steps step are as follows:
A, the video frame frame_mid for reading the monitoring middle position queue frame_list is inspection tag check_ The corresponding video frame of index namely frame_mid=frame_list [check_index];
B, alarm event monitoring is carried out to video frame frame_mid, mark flag=occurs for Initialize installation event false;If not finding alarm event, e is turned to;If mark flag=true occurs for setting event it was found that alarm event, turn To c;
C, it is video frame frame_mid (current detection frame) that frame Warning_fram, which occurs, for setting alarm event: Warning_frame=frame_mid;It initializes alarm event stream and arranges other Warning_video_list:Warning_ Video_list=[], since monitoring queue frame_list replacement label change_index video frame position from read Video flow processing is taken, monitors the position start frame start_index and the replacement label change_ of queue frame_list at this time Index video frame position is identical namely start_index=change_index, turns to d;
D, the video frame at the position start frame start_index of monitoring queue frame_list is read, alarm is added to Flow of event arranges other Warning_video_list:Warning_video.append (frame);Then, above-mentioned start frame Start_index is moved to next position of video frame in monitoring queue frame_list: start_index=(start_ Index+1) %L;If alarm event stream, which arranges other Warning_video_list length, is less than L, d is repeated;Otherwise, e is turned to;
E, new video frame frame_new is read, replaces the monitoring queue frame_ with new video frame frame_new The video frame of the replacement position label change_index in list: frame_list [change_index]=frame_new, and And replacement label change_index and inspection tag check_index is moved down one: change_index=simultaneously (change_index+1) %L, meanwhile, check_index=(check_index+1) %L turns to f;
If f, mark flag=true occurs for event, frame Warning_frame and alarm event are occurred into for alarm event Stream arranges other Warning_video_list and reports and saved, and together with the information of awareness apparatus perception event, is reported to backstage Warning system;Step S4 is repeated later, continues next round video frame event detection task, until awareness apparatus alarm-monitor system It closes, then stops.
In practical applications, step S3 method particularly includes:
S3a, the setting monitoring queue frame_list list length i=0;
S3b, as i < L, then read a frame video and be added to the detection queue frame_list:frame_ List.append (frame), i++;Namely circulation reads video frame and is filled into frame_list until queue length reaches List_maxsize=L, at this time chang_index=0 (mark next bit replace frame index position), check_index=int (list_masize);
S3c, when i be not less than L, then it is described monitoring queue frame_list length be maximum length L, assignment Change_index=0, check_index are L/2:check_index=int (L/2).
As a kind of possible application, the present invention is based on the alarm event video pictures store methods of round-robin queue to apply Alarm event video pictures in video monitoring save, at this point, " reading a frame video " in the step S3b is to supervise from camera A frame video is read in control video recording.Also, " reading new video frame frame_new " is to supervise from camera in the step S4, e A frame video is newly read in control video recording.Namely the height of the alarm event video pictures store method of the invention based on round-robin queue Storage efficiency, Gao Baocun logic allow to the Real-time Alarm event recognition applied to video monitoring and protect to evidence It deposits.
It is preferably, described in order to further increase the logic and specific aim of the storage of alarm event video pictures In " carrying out alarm event monitoring to video frame frame_mid " in step S4, b, including alarm event type is monitored; At this point, in f " frame Warning_frame being occurred for alarm event and alarm event stream arranges other Warning_video_list and reports And saved " it include that alarm event type is reported and saved.It can be according to the alarm event identified Specific type is reported and preservation of classifying, and to improve the efficiency of later period search, guarantee can be carried out for specific warnings event It is accurately positioned and searches, quickly search corresponding video flowing or picture.
A kind of alarm event video pictures store method based on round-robin queue of the invention, passes through the column in a fixed length In table, the video frame of certain time length is prestored in advance, the next position for then marking middle position and latest frame is used as replacement position, Realize round-robin queue's function.The video of middle position frame is detected with this, if there is alarm event, by the view in fixed length list Frequency frame rearranges new list sequentially in time, and the video frame picture of the new list and mark middle position is saved Come.Alarm event video pictures store method based on round-robin queue of the invention, can only store alarm event before generation The video of certain period of time afterwards, storage efficiency is high, storage precision is high, and timeliness is strong, meanwhile, it can be in storage according to alarm Frame Warning_frame occurs for event and alarm event stream arranges other Warning_video_list and arranged, and stores logic By force.
It is in summary only preferred embodiments of the present invention, practical range not for the purpose of limiting the invention.That is Fan Yiben Equivalence changes made by the content of patent application the scope of the patents and modification all should belong to technology scope of the invention.

Claims (5)

1. a kind of alarm event video pictures store method based on round-robin queue, it is characterised in that: the following steps are included:
S1, initialization creation monitoring queue frame_list, set the monitoring queue maximum length list_maxsize=L;
S2, the definition replacement label change_index and inspection tag check_ in the monitoring queue frame_list index;Initialize installation change_index and check_index are -1;
S3, video frame is filled into the monitoring queue frame_list, until the length of the monitoring queue frame_list For L;Assignment change_index=0, check_index L/2;
S4, alarm event monitoring and the preservation of alarm event video pictures are carried out;Specific steps step are as follows: a, read monitoring queue The video frame frame_mid in the middle position frame_list is the corresponding video frame of inspection tag check_index, namely Frame_mid=frame_list [check_index];B, alarm event monitoring is carried out to video frame frame_mid, initially Change setting event and mark flag=false occurs;If not finding alarm event, e is turned to;If it was found that alarm event, setting Mark flag=true occurs for event, turns to c;C, it is video frame frame_ that frame Warning_fram, which occurs, for setting alarm event Mid, initialization alarm event stream arrange other Warning_video_list, from the replacement label of monitoring queue frame_list Start to read video flow processing at change_index video frame position, monitors the start frame of queue frame_list at this time Label change_index video frame position is identical namely start_index=change_ with replacement for the position start_index Index turns to d;D, the video frame at the position start frame start_index of monitoring queue frame_list is read, is added to Alarm event stream arranges other Warning_video_list, and then, above-mentioned start frame start_index is moved to monitoring queue Next position of video frame in frame_list;If alarm event stream, which arranges other Warning_video_list length, is less than L, weight Multiple d;Otherwise, e is turned to;E, new video frame frame_new is read, replaces the monitoring team with new video frame frame_new The video frame of the replacement position label change_index in frame_list is arranged, and will replacement label change_index and inspection It looks into label check_index while moving down one, steering f;If f, mark flag=true occurs for event, alarm event is sent out Raw frame Warning_frame and alarm event stream arrange other Warning_video_list and report and saved, and repeat to walk later Rapid S4.
2. the alarm event video pictures store method according to claim 1 based on round-robin queue, it is characterised in that: institute State step S3's method particularly includes:
S3a, the setting monitoring queue frame_list list length i=0;
S3b, as i < L, then read a frame video and be added to the detection queue frame_list;
S3c, when i be not less than L, then it is described monitoring queue frame_list length be maximum length L, assignment change_ Index=0, check_index L/2.
3. the alarm event video pictures store method according to claim 2 based on round-robin queue, it is characterised in that: institute Stating in step S3b " reading a frame video " is to read a frame video from camera head monitor video recording.
4. the alarm event video pictures store method according to claim 3 based on round-robin queue, it is characterised in that: institute Step S4 is stated, " reading new video frame frame_new " is newly to read a frame video from camera head monitor video recording in e.
5. the alarm event video pictures store method according to claim 1 based on round-robin queue, it is characterised in that: institute It states step S4, in b " alarm event monitoring is carried out to video frame frame_mid ", including alarm event type is supervised It surveys;At this point, in f " frame Warning_frame being occurred for alarm event and alarm event stream arranges on other Warning_video_list Report and saved " it include that alarm event type is reported and saved.
CN201910326378.3A 2019-04-23 2019-04-23 Alarm event video pictures store method based on round-robin queue Pending CN110069659A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910326378.3A CN110069659A (en) 2019-04-23 2019-04-23 Alarm event video pictures store method based on round-robin queue

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910326378.3A CN110069659A (en) 2019-04-23 2019-04-23 Alarm event video pictures store method based on round-robin queue

Publications (1)

Publication Number Publication Date
CN110069659A true CN110069659A (en) 2019-07-30

Family

ID=67368318

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910326378.3A Pending CN110069659A (en) 2019-04-23 2019-04-23 Alarm event video pictures store method based on round-robin queue

Country Status (1)

Country Link
CN (1) CN110069659A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111696288A (en) * 2020-06-24 2020-09-22 深圳市法本信息技术股份有限公司 Large-capacity low-delay joint alarm system and method
CN112712702A (en) * 2019-10-24 2021-04-27 杭州海康威视系统技术有限公司 Illegal event duplicate removal method and device, electronic equipment and machine-readable storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867786A (en) * 2009-04-20 2010-10-20 中兴通讯股份有限公司 Method and device for monitoring video
CN102340625A (en) * 2010-07-16 2012-02-01 安讯士有限公司 Method for event initiated video capturing and a video camera for capture event initiated video
CN103227916A (en) * 2013-04-22 2013-07-31 安科智慧城市技术(中国)有限公司 Backup method, device and system of monitoring video

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867786A (en) * 2009-04-20 2010-10-20 中兴通讯股份有限公司 Method and device for monitoring video
CN102340625A (en) * 2010-07-16 2012-02-01 安讯士有限公司 Method for event initiated video capturing and a video camera for capture event initiated video
CN103227916A (en) * 2013-04-22 2013-07-31 安科智慧城市技术(中国)有限公司 Backup method, device and system of monitoring video

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112712702A (en) * 2019-10-24 2021-04-27 杭州海康威视系统技术有限公司 Illegal event duplicate removal method and device, electronic equipment and machine-readable storage medium
CN111696288A (en) * 2020-06-24 2020-09-22 深圳市法本信息技术股份有限公司 Large-capacity low-delay joint alarm system and method

Similar Documents

Publication Publication Date Title
US10410135B2 (en) Systems and/or methods for dynamic anomaly detection in machine sensor data
CN104407964B (en) A kind of centralized monitoring system and method based on data center
EP3382643A1 (en) Automated object tracking in a video feed using machine learning
CN105405150B (en) Anomaly detection method and device based on fusion feature
CN110069659A (en) Alarm event video pictures store method based on round-robin queue
CN106953766B (en) Alarm method and device
CN110866515A (en) Method and device for identifying object behaviors in plant and electronic equipment
CN111081017B (en) Vehicle information management system, method, computer device, and storage medium
CN100586202C (en) Fault positioning method and device
US10018895B2 (en) Projector, projector monitoring system, and projector monitoring method
KR102028930B1 (en) method of providing categorized video processing for moving objects based on AI learning using moving information of objects
CN116319858A (en) Intelligent ship Internet of things data operation and maintenance monitoring method and system
CN110347694A (en) A kind of apparatus monitoring method based on Internet of Things, apparatus and system
CA3173398A1 (en) Data processing for industrial machine learning
CN116986246A (en) Intelligent inspection system and method for coal conveying belt
CN110324588A (en) Video analysis Warning Event information storage means based on dictionary structure
CN108073854A (en) A kind of detection method and device of scene inspection
CN116595756A (en) Digital twinning-based intelligent operation and maintenance method and device for data center
KR20170104209A (en) Apparatus and method for trajectory processing of vessel
CN114550129B (en) Machine learning model processing method and system based on data set
CN103778218A (en) Cloud computation-based standard information consistency early warning system and method
US10867162B2 (en) Data processing apparatus, data processing method, and non-transitory storage medium
CN106368972B (en) A kind of fan-status monitoring method, device and web camera
CN115981950A (en) Monitoring alarm method, device, equipment and computer readable storage medium
CN115205761A (en) Accident reason off-line intelligent diagnosis system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190730

RJ01 Rejection of invention patent application after publication