Video recording method and device based on fire detection, fire detection equipment and medium
By implementing a fire detection-based video recording method in the fire detection equipment, backing up and transmitting video files to determine the fire process video, the problem of not being able to quickly obtain the fire process video in the prior art is solved, and the effect of quickly intercepting the fire video is achieved.
Patent Information
- Application Number
- CN202411665491.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art cannot quickly intercept the process video of the fire in fire detection, and it is necessary to find the video of the fire when it occurs frame by frame from the huge video file.
By implementing a video recording method based on fire detection in a fire detection device, a video frame to be processed is obtained and a first video recording file is written, the video frame writing is stopped when a target event is received, and the first video recording file is backed up to obtain the second Record the video file and transfer it to the file server to determine the fire process video corresponding to the alarm event.
It realizes the rapid intercepting of fire process videos corresponding to alarm events triggered by fire from the file server, improving the rapid acquisition efficiency of fire videos.
Smart Images

Figure CN119445752A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of image processing technology, and in particular to a video recording method, device, fire detection equipment and medium based on fire detection. Background Art
[0002] With the development of society, the scope of fire losses and fire hazards is expanding, and fire detection has become one of the focuses of researchers. In terms of fire detection, image-based fire detectors have the advantages of large detection range, strong anti-interference ability, rapid response, visibility, fire point location and easy integration, and have broad development prospects.
[0003] In practical applications, image-based fire detectors can be used to detect fires and record videos within the visible range. However, if a fire occurs, it is necessary to search for the video of the fire frame by frame from a large video file, and it is impossible to quickly capture the video of the fire process. Summary of the invention
[0004] The present invention provides a video recording method, device, fire detection equipment and medium based on fire detection, which can quickly capture the fire process video corresponding to the alarm event triggered by the fire from a file server.
[0005] In a first aspect, an embodiment of the present invention provides a video recording method based on fire detection, comprising:
[0006] Acquire a video frame to be processed and write the video frame to be processed into a first video file;
[0007] When it is determined that a target event is received in the event queue, the video frame writing of the first video file is stopped, and the first video file is backed up according to the event type of the target event to obtain a second video file, wherein the target event includes a timed event or an alarm event triggered by a fire;
[0008] The second video file is transmitted to a file server, so that the fire process video corresponding to the alarm event is determined in the file server through the stored second video file.
[0009] In a second aspect, an embodiment of the present invention provides a video recording device based on fire detection, comprising:
[0010] A writing module, used for acquiring a video frame to be processed and writing the video frame to be processed into a first video file;
[0011] A backup module, configured to stop writing video frames of the first video file when it is determined that a target event is received in the event queue, and to back up the first video file to obtain a second video file according to an event type of the target event, wherein the target event includes a timed event or an alarm event triggered by a fire;
[0012] The transmission module is used to transmit the second video file to the file server, so as to determine the fire process video corresponding to the alarm event in the file server through the stored second video file.
[0013] In a third aspect, an embodiment of the present invention provides a fire detection device, including:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to the first aspect.
[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0018] The technical solution of the embodiment of the present invention is that when a timed event or a fire-triggered alarm event is received in the event queue, the first video file is backed up according to the event type of the received event to obtain a second video file, and the second video file is transmitted to the file server, where the second video file corresponding to the alarm event can be determined from the stored second video files, and then the fire process video corresponding to the alarm event can be obtained. The above technical solution can quickly capture the fire process video corresponding to the fire-triggered alarm event from the second video file stored in the file server based on the event type of the target event corresponding to the stored second video file.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 is a flow chart of a video recording method based on fire detection provided according to Embodiment 1 of the present invention;
[0022] Figure 2 is a schematic diagram of a video recording system based on fire detection provided according to Embodiment 2 of the present invention;
[0023] Figure 3 is a flow chart of a video recording method based on fire detection provided according to Embodiment 2 of the present invention;
[0024] Figure 4 is a flow chart of another video recording method based on fire detection provided according to Embodiment 2 of the present invention;
[0025] Figure 5 is a schematic diagram of a video file provided according to Embodiment 2 of the present invention;
[0026] Figure 6 is a structural schematic diagram of a video recording device based on fire detection provided according to Embodiment 3 of the present invention;
[0027] Figure 7 It is a schematic diagram of the structure of the fire detection equipment implementing the embodiment of the present invention. DETAILED DESCRIPTION
[0028] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0029] It should be noted that the terms "first", "second", etc. in the present invention are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0030] Embodiment 1
[0031] Figure 1 This is a flow chart of a method for recording video based on fire detection provided according to the first embodiment of the present invention. The embodiment of the present invention can be applied to the case of saving video recordings to obtain a video of a fire process corresponding to an alarm event triggered by a fire. The method can be executed by a video recording device based on fire detection, which can be implemented in the form of software and / or hardware and integrated in a fire detection device. Furthermore, the fire detection device can be an image-type fire detector.
[0032] like Figure 1 As shown, the method includes:
[0033] S110: Acquire a video frame to be processed and write the video frame to be processed into a first video recording file.
[0034] The video frame to be processed may be any video frame to be recorded. The fire detection device may collect video frames within the visible range and encode the collected video frames, and the encoded video frames are the video frames to be processed.
[0035] The first video file may be a video file for storing the video frame to be processed. The first video file may be a pre-created video file or a newly created video file when the video frame to be processed is obtained. The specific determination may be based on whether file creation is required when the video frame to be processed is obtained, which is not limited here.
[0036] In this step, after obtaining the video frame to be processed and determining that the first video file has been created, the video frame to be processed can be written into the first video file.
[0037] In one embodiment, writing the to-be-processed video frame into the first video recording file includes:
[0038] When the file creation flag indicates that file creation is required, the file is created to obtain a first video file, the to-be-processed video frame is written into the created first video file, and the file creation flag is updated to indicate that file creation is not required;
[0039] When the file creation flag indicates that no file creation is required, writing the to-be-processed video frame into a pre-created first video file;
[0040] The created file name of the first video file at least includes the file creation time and the device information of the fire detection device that created the first video file.
[0041] The create file flag may be a flag used to indicate whether a file needs to be created. For example, if the create file flag is "yes", it indicates that a file needs to be created; and if the create file flag is "no", it indicates that a file does not need to be created. Optionally, the create file flag may be set to "yes" when initially recording a video frame.
[0042] When the video frame to be processed is obtained, the file creation flag is first determined. If the file creation flag is "yes", the file is created to obtain the first video file, and the video frame to be processed is written into the newly created first video file, and the file creation flag is set to "no"; if the file creation flag is "no", the video frame to be processed is written into the pre-created first video file.
[0043] In the embodiment of the present invention, the created file name of the first video file can be determined according to the file creation time and the device information of the fire detection device of the first video file, such as the created file name can be a combination of the file creation time and the device information. The created file name can be the file name when the first video file is created; the file creation time is the time when the first video file is created; the device information of the fire detection device can be information related to the fire detection device, such as the Internet Protocol (IP) address of the fire detection device.
[0044] S120: When it is determined that a target event is received in the event queue, stop writing video frames to the first video file, and back up the first video file to obtain a second video file according to an event type of the target event, wherein the target event includes a timed event or an alarm event triggered by a fire.
[0045] The event queue may be a queue for managing target events, and the target event will be written into the event queue when it occurs. When writing the target event into the event queue, the event type of the target event may also be recorded. The target event may include a timed event or an alarm event triggered by a fire. Accordingly, the event type corresponding to the timed event may be a timed type, and the event type corresponding to the alarm event may be an alarm type.
[0046] Among them, the timed event can be considered as an event triggered by a timer. For example, a timer program can be used to generate a timed event to save the video according to the timer period. The timer can run based on the saved configuration parameters, and the configuration parameters can be adjusted during the operation of the timer. For example, the timer period can be configured to be 10 minutes based on the size of the disk of the fire detection device and the actual length of time required for the video.
[0047] Among them, the alarm event can be an event triggered by a fire. When the fire detection equipment detects signs of fire, such as smoke, flames, abnormally high temperatures, etc., an alarm event can be automatically generated, the alarm system can be activated, and a warning can be issued to relevant personnel.
[0048] In this step, data can be obtained from the event queue to determine whether there is a target event in the event queue; if so, stop writing the video frame of the first video file, close and save the first video file, and back up the first video file according to the event type of the target event to obtain a second video file. For example, when naming the second video file, the event type of the target event can be considered; if not, it means that the target event has not been received, and continue to process the next video frame to be processed. The second video file can be a video file obtained by backing up the first video file.
[0049] In one embodiment, backing up the first video file to obtain the second video file according to the event type of the target event includes:
[0050] The first video file is backed up to obtain a second video file, wherein the backup file name of the second video file at least includes the event type of the target event, the occurrence time of the target event, and the device information of the fire detection device that triggers the target event.
[0051] The backup file name of the second video file can be determined according to the event type of the target event corresponding to the second video file, the occurrence time of the target event, and the device information of the fire detection device that triggers the target event. For example, the backup file name can be a combination of the event type, occurrence time, and device information of the target event. The backup file name can be the file name when the second video file is created; the occurrence time of the target event is the time when the target event is triggered.
[0052] In one embodiment, after the writing of the video frame of the first video file is stopped, the method further includes: setting a file creation flag to indicate that a file needs to be created. The reason for such setting is that, when the current first video file is closed and saved, when the next video frame to be processed is obtained, a new first video file can be created based on the updated file creation flag to continue processing the video frame. That is, after a timed event or an alarm event occurs, a new first video file can be created to continue recording the video frame.
[0053] S130: Transmit the second video file to a file server, so as to determine the fire process video corresponding to the alarm event in the file server through the stored second video file.
[0054] The file server may be a server for storing the second video file. The file server may be deployed in an electronic device. The electronic device may be a computer, a notebook computer, etc., which is not limited here.
[0055] The fire process video corresponding to the alarm event can be understood as the video of the entire process from the discovery of the fire to the triggering of the alarm event. In the actual application of fire detection equipment, the entire process from the discovery of the fire to the triggering of the alarm event should not exceed 20 seconds.
[0056] In this step, the fire detection device can communicate with the electronic device through the switch, and transmit the second video file to the file server deployed in the electronic device through the switch. In the file server, one or more second video files may be stored. Since the second video file is generated based on the event type of the target event, the second video file corresponding to the alarm event can be determined in one or more second video files based on the event type corresponding to the alarm event, that is, the alarm type. When the second video file corresponding to the alarm event stored in the file server is determined, the fire process video corresponding to the alarm event can be intercepted from the second video file.
[0057] In one embodiment, transmitting the second video file to a file server includes:
[0058] When the time period of the timer is reached, determining whether the second video file exists within the time period;
[0059] If it exists, then when the event type of the target event corresponding to the second video file is a timing type, the second video file is transferred to the first directory in the file server; or when the event type of the target event corresponding to the second video file is an alarm type, the second video file is transferred to the second directory in the file server.
[0060] In practical applications, various second video files can be transmitted to the file server at a fixed time through a timer program. The timer can be operated based on the saved configuration parameters, and the configuration parameters can be adjusted during the operation of the timer, such as configuring the time period of the timing to be 10s.
[0061] Each time the timer's time period is reached, it is determined whether there is a second video file within the time period, that is, whether the target event occurs within the time period. Specifically, it can be determined based on the name of the video file existing in the fire detection device. The backup file name of the second video file contains the event type of the target event, while the creation file name of the first video file does not contain the event type, so as to distinguish whether there is a second video file, and then determine whether it is within the time period based on the occurrence time of the target event contained in the backup file name of the existing second video file; it can also be that when each target event occurs, the time of occurrence of the target event and the event type of the target event are recorded in a text, and then it can be determined whether the target event occurs within the time period of the timer based on the text.
[0062] In the case where the second video file exists within the time period of the timer, the second video file is classified and transmitted based on the event type of the target event corresponding to the second video file. Specifically, if the event type of the target event corresponding to the second video file is a timing type, that is, the target event is a timing event, the second video file is transmitted to the first directory in the file server; if the event type is an alarm type, that is, the target event is an alarm event, the second video file is transmitted to the second directory in the file server. The first directory and the second directory are different directories in the file server.
[0063] In one embodiment, determining the fire process video corresponding to the alarm event through the second video file stored in the file server includes:
[0064] In the second directory of the file server, determining the second video file corresponding to the alarm event as the target video file;
[0065] The video within a set time period starting from the last frame of the video corresponding to the target video file is determined as the fire process video corresponding to the alarm event.
[0066] In the second directory of the file server, one or more second video files corresponding to the alarm event may be stored. In practical applications, if it is necessary to determine the second video file corresponding to the alarm event of the embodiment of the present invention, the second video file corresponding to the alarm event of the embodiment of the present invention can be determined as the target video file based on the backup file name of each second video file in the second directory.
[0067] The video within a set time period starting from the last frame of the video corresponding to the target video file is determined as the fire process video corresponding to the alarm event. For example, the video after 25 seconds of the video corresponding to the target video file is determined as the fire process video corresponding to the alarm event.
[0068] In one embodiment, the method further comprises:
[0069] When the time period of the timer is reached, if the second video file does not exist within the time period, determining the time difference between the current time and the file creation time of the first video file that exists within the time period;
[0070] When the time difference exceeds a set time difference threshold, the first video file existing within the time period is deleted.
[0071] When the timer reaches the time period, if there is no second video file in the time period, that is, no target event occurs in the time period, the time difference between the current time and the file creation time of the first video file in the time period is determined; if the time difference exceeds the set time difference threshold, such as more than 30 minutes, the first video file in the time period is deleted. The advantage of this setting is that the video without the target event can be deleted to reserve storage space for subsequent video frame recording.
[0072] The technical solution of the embodiment of the present invention is that when a timed event or a fire-triggered alarm event is received in the event queue, the first video file is backed up according to the event type of the received event to obtain a second video file, and the second video file is transmitted to the file server, where the second video file corresponding to the alarm event can be determined from the stored second video files, and then the fire process video corresponding to the alarm event can be obtained. The above technical solution can quickly capture the fire process video corresponding to the fire-triggered alarm event from the second video file stored in the file server based on the event type of the target event corresponding to the stored second video file.
[0073] Embodiment 2
[0074] The embodiments of the present invention are illustrative descriptions of the above embodiments.
[0075] Figure 2 FIG. 1 is a schematic diagram of a video recording system based on fire detection according to Embodiment 2 of the present invention. Figure 2 As shown, the fire detection video recording system may include multiple fire detection devices (i.e., image-type fire detectors), switches, and electronic devices. Any fire detection device may be used to execute a fire detection-based video recording method provided by the present invention.
[0076] Figure 3is a flow chart of a video recording method based on fire detection provided according to Embodiment 2 of the present invention. Figure 3 The process shown can be understood as being implemented through process one. Figure 4 is a flow chart of another method for recording video based on fire detection provided according to Embodiment 2 of the present invention. Figure 4 The process shown can be understood as being implemented through process 2. Figure 3 and Figure 4 The following instructions are given:
[0077] Obtaining the compressed video frame, that is, obtaining the video frame to be processed;
[0078] Determine whether the file creation flag is "yes", if so, create a first video file, write the video frame to be processed into the newly created first video file, and set the file creation flag to "no"; if not, write the video frame to be processed into the pre-created first video file;
[0079] Determine from the event queue whether the target event is received. The target event includes a timing event generated by a timer program or an alarm event triggered by a fire. If so, stop writing the video frame of the first video file, and back up the first video file according to the event type of the target event to obtain the second video file, and set the file creation flag to "yes"; otherwise, continue to obtain the compressed video frame.
[0080] When determining that the time period of the timer has been reached, the timer program 2 determines whether a target event occurs within the time period, that is, determines whether a second video file exists within the time period. If so, the video data is transmitted; otherwise, the video data is deleted.
[0081] The transmission of video data can be understood as the event type of the target event corresponding to the second video file is a timing type (ie Figure 2 In the case of event type A), the second video file is transferred to the first directory in the file server (ie Figure 2 Directory A shown); or the event type of the target event corresponding to the second video file is an alarm type (ie Figure 2 In the case of event type B), the second video file is transferred to the second directory in the file server (ie Figure 2 Directory B).
[0082] The deletion of video data can be understood as determining the time difference between the current time and the file creation time of the first video file in the time period; if the time difference exceeds the set time difference threshold, such as more than 30 minutes, the first video file in the time period is deleted.
[0083] Figure 5 FIG. 1 is a schematic diagram of a video file provided according to Embodiment 2 of the present invention. Figure 5 As shown, the recording is scheduled with a time period of 10 minutes. When the length of video 1 reaches 10 minutes, a timing event is received, the current recording is stopped and a new recording is started; when an alarm event is received during the recording of video 2, video 2 is divided into video 2-1 and video 2-2. Video 2-1 contains the entire process from fire to alarm, that is, the fire process video corresponding to the alarm event; when a timing event is received at the end of video 2-2, the current recording is stopped and a new video 3 is started.
[0084] When the electronic equipment deployed with the file server obtains the video 2-1 transmitted by each detector, it can quickly capture the video of the last 25 seconds as the fire process video corresponding to the alarm event, thereby providing alarm data for the deep learning algorithm and improving the efficiency of algorithm iteration. At the same time, it also provides fast video materials for rapid fire rescue, post-analysis of the entire process of the fire, and review and summary of fire prevention measures, promoting the improvement of the rapid response capability of the security prevention system.
[0085] The embodiment of the present invention provides a video recording system based on an image-based fire detector, which can periodically save video recording data and timely save videos according to fire-triggered alarm events, so that in subsequent video image data processing, the entire process from fire occurrence to alarm can be quickly located based on the saved video, thereby greatly improving the speed of algorithm training iteration and upgrading, and promoting the field deployment of the algorithm.
[0086] Embodiment 3
[0087] Figure 6 1 is a schematic diagram of a fire detection-based video recording device according to Embodiment 3 of the present invention. The embodiment of the present invention is applicable to the case of saving video recordings to obtain a fire process video corresponding to an alarm event triggered by a fire. Figure 6 As shown, the specific structure of the device includes:
[0088] A writing module 61 is used to obtain a video frame to be processed and write the video frame to be processed into a first video file;
[0089] The backup module 62 is used to stop writing video frames of the first video file when it is determined that a target event is received in the event queue, and to back up the first video file to obtain a second video file according to the event type of the target event, wherein the target event includes a timed event or an alarm event triggered by a fire;
[0090] The transmission module 63 is used to transmit the second video file to the file server, so as to determine the fire process video corresponding to the alarm event in the file server through the stored second video file.
[0091] The fire detection-based video recording device provided in this embodiment obtains the video frame to be processed through the writing module and writes the video frame to be processed into the first video file; when the target event is received in the event queue through the backup module, the video frame writing of the first video file is stopped, and the first video file is backed up according to the event type of the target event to obtain the second video file, and the target event includes a timed event or a fire-triggered alarm event; the second video file is transmitted to the file server through the transmission module, so that the fire process video corresponding to the alarm event is determined in the file server through the stored second video file. The above technical scheme can quickly capture the fire process video corresponding to the fire-triggered alarm event from the second video file stored in the file server based on the event type of the target event corresponding to the stored second video file.
[0092] Furthermore, the backup module 62 is specifically used for:
[0093] The first video file is backed up to obtain a second video file, wherein the backup file name of the second video file at least includes the event type of the target event, the occurrence time of the target event, and the device information of the fire detection device that triggers the target event.
[0094] Furthermore, the transmission module 63 is specifically used for:
[0095] When the time period of the timer is reached, determining whether the second video file exists within the time period;
[0096] If it exists, then when the event type of the target event corresponding to the second video file is a timing type, the second video file is transferred to the first directory in the file server; or when the event type of the target event corresponding to the second video file is an alarm type, the second video file is transferred to the second directory in the file server.
[0097] Furthermore, the transmission module 63 is specifically used for:
[0098] In the second directory of the file server, determining the second video file corresponding to the alarm event as the target video file;
[0099] The video within a set time period starting from the last frame of the video corresponding to the target video file is determined as the fire process video corresponding to the alarm event.
[0100] Furthermore, the writing module 61 is specifically used for:
[0101] When the file creation flag indicates that file creation is required, the file is created to obtain a first video file, the to-be-processed video frame is written into the created first video file, and the file creation flag is updated to indicate that file creation is not required;
[0102] When the file creation flag indicates that no file creation is required, writing the to-be-processed video frame into a pre-created first video file;
[0103] The created file name of the first video file at least includes the file creation time and the device information of the fire detection device that created the first video file.
[0104] Furthermore, the device also includes a deletion module, which is used to:
[0105] When the time period of the timer is reached, if the second video file does not exist within the time period, determining the time difference between the current time and the file creation time of the first video file that exists within the time period;
[0106] When the time difference exceeds a set time difference threshold, the first video file existing within the time period is deleted.
[0107] Furthermore, the device also includes a setting module, which is used to:
[0108] After stopping the writing of the video frames of the first video file, setting the file creation flag to indicate that file creation is required.
[0109] The fire detection-based video recording device provided in the embodiment of the present invention can execute the fire detection-based video recording method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0110] Embodiment 4
[0111] Figure 7 The components, their connections and relationships, and their functions shown herein are merely examples and are not intended to limit the implementation of the invention described and / or claimed herein.
[0112] like Figure 7As shown, the fire detection device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the fire detection device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0113] A number of components in the fire detection device 10 are connected to the I / O interface 15, including: an input unit 16; an output unit 17, such as various types of speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the fire detection device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0114] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a video recording method based on fire detection.
[0115] In some embodiments, the fire detection-based video recording method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the fire detection device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the fire detection-based video recording method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the fire detection-based video recording method in any other appropriate manner (e.g., by means of firmware).
[0116] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0117] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0118] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0119] To provide interaction with a user, the systems and techniques described herein may be implemented on a fire detection device having: a display device for displaying information to a user; a device for providing input to the fire detection device. Other types of devices may also be used to provide interaction with a user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback); and input from the user may be received in any form (including acoustic input, voice input).
[0120] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0121] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0122] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0123] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A video recording method based on fire detection, characterized in that: include: Acquire a video frame to be processed and write the video frame to be processed into a first video file; When it is determined that a target event is received in the event queue, the video frame writing of the first video file is stopped, and the first video file is backed up according to the event type of the target event to obtain a second video file, wherein the target event includes a timed event or an alarm event triggered by a fire; The second video file is transmitted to a file server, so that the fire process video corresponding to the alarm event is determined in the file server through the stored second video file.
2. The method according to claim 1, characterized in that Backing up the first video file according to the event type of the target event to obtain a second video file includes: The first video file is backed up to obtain a second video file, wherein the backup file name of the second video file at least includes the event type of the target event, the occurrence time of the target event, and the device information of the fire detection device that triggers the target event.
3. The method according to claim 1, characterized in that The step of transmitting the second video file to a file server includes: When the time period of the timer is reached, determining whether the second video file exists within the time period; If it exists, then when the event type of the target event corresponding to the second video file is a timing type, the second video file is transferred to the first directory in the file server; or when the event type of the target event corresponding to the second video file is an alarm type, the second video file is transferred to the second directory in the file server.
4. The method according to claim 3, characterized in that Determining the fire process video corresponding to the alarm event through the second video file stored in the file server includes: In the second directory of the file server, determining the second video file corresponding to the alarm event as the target video file; The video within a set time period starting from the last frame of the video corresponding to the target video file is determined as the fire process video corresponding to the alarm event.
5. The method according to claim 1, characterized in that Writing the to-be-processed video frame into a first video recording file includes: When the file creation flag indicates that file creation is required, the file is created to obtain a first video file, the to-be-processed video frame is written into the created first video file, and the file creation flag is updated to indicate that file creation is not required; When the file creation flag indicates that no file creation is required, writing the to-be-processed video frame into a pre-created first video file; The created file name of the first video file at least includes the file creation time and the device information of the fire detection device that created the first video file.
6. The method according to claim 1, characterized in that Also includes: When the time period of the timer is reached, if the second video file does not exist within the time period, determining the time difference between the current time and the file creation time of the first video file that exists within the time period; When the time difference exceeds a set time difference threshold, the first video file existing within the time period is deleted.
7. The method according to claim 1, characterized in that After stopping writing the video frame of the first video file, the method further includes: The create file flag is set to indicate that file creation is required.
8. A video recording device based on fire detection, characterized in that: include: A writing module, used for acquiring a video frame to be processed and writing the video frame to be processed into a first video file; A backup module, configured to stop writing video frames of the first video file when it is determined that a target event is received in the event queue, and to back up the first video file to obtain a second video file according to an event type of the target event, wherein the target event includes a timed event or an alarm event triggered by a fire; The transmission module is used to transmit the second video file to the file server, so as to determine the fire process video corresponding to the alarm event in the file server through the stored second video file.
9. A fire detection device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.