CN114461151B - Video storage method, computer equipment and storage medium of national standard camera - Google Patents
Video storage method, computer equipment and storage medium of national standard camera Download PDFInfo
- Publication number
- CN114461151B CN114461151B CN202210371168.8A CN202210371168A CN114461151B CN 114461151 B CN114461151 B CN 114461151B CN 202210371168 A CN202210371168 A CN 202210371168A CN 114461151 B CN114461151 B CN 114461151B
- Authority
- CN
- China
- Prior art keywords
- national
- video stream
- stream data
- camera
- video
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0619—Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/18—Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
- H04N7/181—Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast for receiving images from a plurality of remote sources
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
The application discloses a video storage method, computer equipment and a storage medium of a national standard camera, wherein the method comprises the following steps: storing the received video stream data to a video data queue in a local operation memory; continuously writing the video stream data stored in the video data queue into the mounted network attached storage equipment; the length of a video data queue is obtained regularly; if the change trend is an increasing trend, judging that the write operation aiming at the network attached storage equipment is abnormal; and when the write operation is abnormal, stopping storing the received video stream data to the video data queue, and storing the received video stream data to a local disk. According to the embodiment of the application, whether the writing of the network attached storage equipment is abnormal is judged according to the length of the video data queue, and the video stream data is written into the local disk when the writing is abnormal, so that the situation that the local running memory where the video data queue is located is exhausted to lose data is avoided, and the reliability of video storage is improved.
Description
Technical Field
The application relates to the technical field of national standard cameras, in particular to a video storage method, computer equipment and storage medium of a national standard camera.
Background
In the field of security monitoring, a national standard camera arranged at the front end can continuously transmit video recording data to a video monitoring platform at the rear end, and the video monitoring platform stores the video recording data in a cloud Storage NAS (Network Attached Storage) disk.
However, when the NAS disk is abnormal or the network shakes, the video monitoring platform often cannot write data into the NAS disk normally, so that a large amount of video recording data is accumulated in a video data transmission queue of the video monitoring platform. If the memory of the video data transmission queue is exhausted, the video recording data can be lost, and the reliability of video storage is reduced.
Disclosure of Invention
The embodiment of the application provides a video storage method, computer equipment and a storage medium of a national standard camera, and aims to improve the reliability of video storage.
In one aspect, the present application provides a video storage method for a national standard camera, including:
continuously receiving video stream data sent by a plurality of national standard cameras at the front end;
storing the received video stream data to a video data queue in a local operation memory;
continuously writing the video stream data stored in the video data queue into the mounted network attached storage equipment;
the length of the video data queue is obtained at fixed time to determine the change trend of the length of the video data queue;
if the change trend is an increasing trend, judging that the writing operation aiming at the network attached storage equipment is abnormal, and sending a prompt message of abnormal writing to a preset terminal;
and when the write operation aiming at the network attached storage equipment is abnormal, stopping storing the received video stream data to the video data queue and storing the received video stream data to a local disk.
In some embodiments, after the step of stopping storing the received video stream data to the video data queue and storing the received video stream data to the local disk, the method further includes:
when the change trend is detected to be a reduction trend, judging whether the length of the video data queue is reduced to a preset length or not;
if the length of the video data queue is reduced to a preset length, judging that the writing operation aiming at the network attached storage equipment is recovered to be normal;
if the writing operation for the network attached storage equipment is recovered to be normal, stopping storing the received video stream data to the local disk, storing the received video stream data to the video data queue, and writing the video stream data stored in the local disk into the network attached storage equipment.
In some embodiments, after the step of stopping storing the received video stream data to the video data queue and storing the received video stream data to the local disk when an abnormality occurs in the write operation to the network attached storage device, the method further includes:
acquiring the residual storage capacity of the local disk;
when the residual storage capacity is smaller than a preset capacity, determining a first national standard camera in the plurality of national standard cameras;
deleting the video stream data of the first national camera stored in the local disk, and stopping storing the received video stream data of the first national camera to the local disk.
In some embodiments, the step of determining a first national camera of a plurality of the national cameras comprises:
acquiring a monitoring area corresponding to each national standard camera;
acquiring the region type of the monitoring region;
determining the priority of the national standard camera according to the region type of the monitoring region corresponding to the national standard camera;
and determining a first national camera in the plurality of national cameras according to the priority, wherein the priority of the first national camera is lower than the priority of a second national camera in the plurality of national cameras.
In some embodiments, the plurality of national cameras includes a third national camera and a fourth national camera, and the step of stopping storing the received video stream data to the video data queue and storing the received video stream data to a local disk includes:
and stopping storing the received video stream data of the third national standard camera to the video data queue and storing the received video stream data of the third national standard camera to the local disk, wherein stopping storing the received video stream data of the fourth national standard camera to the video data queue and deleting the received video stream data of the fourth national standard camera.
In some embodiments, the step of stopping storing the received video stream data to the video data queue and storing the received video stream data to the local disk when an abnormality occurs in a write operation to the network attached storage device comprises:
when the write operation aiming at the network attached storage equipment is abnormal, determining the abnormal type of the write operation;
and if the abnormal type of the writing operation is the abnormality that the network attached storage equipment cannot be accessed, stopping storing the received video stream data to the video data queue, and storing the received video stream data to the local disk.
In some embodiments, after the step of determining the exception type of the write operation, the method further includes:
if the abnormal type of the writing operation is the abnormal of network jitter, acquiring the writing speed aiming at the network attached storage equipment;
if the writing speed is less than the first preset speed and greater than the second preset speed, the received video stream data of the third national standard camera is kept to be stored in the video data queue, the received video stream data of the fourth national standard camera is stopped to be stored in the video data queue, and the received video stream data of the fourth national standard camera is stored in the local disk.
In some embodiments, the step of stopping storing the received video stream data to the video data queue and storing the received video stream data to the local disk when an abnormality occurs in a write operation to the network attached storage device comprises:
when the write operation aiming at the network attached storage equipment is abnormal, acquiring the residual capacity of a local running memory where the video data queue is located;
if the residual capacity of the local running memory where the video data queue is located is smaller than a preset threshold value, stopping storing the received video stream data to the video data queue, and storing the received video stream data to the local disk, wherein if the residual capacity of the local running memory where the video data queue is located is larger than or equal to the preset threshold value, the received video stream data is kept to be stored to the video data queue.
On the other hand, an embodiment of the present application provides a video storage device of a national standard camera, including:
the receiving module is used for continuously receiving video stream data sent by a plurality of national standard cameras at the front end;
the storage module is used for storing the received video stream data to a video data queue in a local operation memory;
the writing module is used for continuously writing the video stream data stored in the video data queue into the mounted network attached storage equipment;
the detection module is used for acquiring the length of the video data queue at regular time to determine the change trend of the length of the video data queue, if the change trend is an increasing trend, judging that the writing operation aiming at the network attached storage equipment is abnormal, and sending the prompt information of the abnormal writing to a preset terminal;
and the storage module is further used for stopping storing the received video stream data to the video data queue and storing the received video stream data to a local disk when the write operation aiming at the network attached storage equipment is abnormal.
In another aspect, the present application further provides a computer device, including:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps in the video storage method of any one of the national standard cameras.
In another aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is loaded by a processor to execute the steps in the video storage method of a national standard camera.
The video storage method, the computer device and the storage medium of the national standard camera provided by the embodiment of the application comprise the following steps: continuously receiving video stream data sent by a plurality of national standard cameras at the front end; storing the received video stream data to a video data queue in a local operation memory; continuously writing the video stream data stored in the video data queue into the mounted network attached storage equipment; the method comprises the steps of obtaining the length of a video data queue at regular time to determine the change trend of the length of the video data queue; if the change trend is an increasing trend, judging that the writing operation aiming at the network attached storage equipment is abnormal, and sending a prompt message of the abnormal writing to a preset terminal; and when the write operation aiming at the network attached storage equipment is abnormal, stopping storing the received video stream data to the video data queue and storing the received video stream data to the local disk. According to the embodiment of the application, whether the writing of the network attached storage equipment is abnormal is judged according to the length of the video data queue, and the video stream data is written into the local disk when the writing is abnormal, so that the data loss caused by the exhaustion of the local running memory where the video data queue is located is avoided, and the reliability of video storage is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of an embodiment of a video storage method of a national standard camera provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of another embodiment of a video storage method of a national standard camera provided in an embodiment of the present application;
fig. 3 is a schematic flowchart of a video storage method of a national standard camera provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of a video storage method of a national standard camera provided in an embodiment of the present application;
FIG. 5 is a schematic structural diagram of an embodiment of a video storage device of a national standard camera provided in an embodiment of the present application;
fig. 6 is a schematic terminal structure diagram of an embodiment of a computer device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In the description of the present application, it is to be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate orientations or positional relationships based on those shown in the drawings, and are used merely for convenience of description and for simplicity of description, and do not indicate or imply that the referenced device or element must have a particular orientation, be constructed in a particular orientation, and be operated, and thus should not be considered as limiting the present application. Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first", "second", may explicitly or implicitly include one or more of the described features. In the description of the present application, "a plurality" means two or more unless specifically limited otherwise.
In this application, the word "exemplary" is used to mean "serving as an example, instance, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. The following description is presented to enable any person skilled in the art to make and use the application. In the following description, details are set forth for the purpose of explanation. It will be apparent to one of ordinary skill in the art that the present application may be practiced without these specific details. In other instances, well-known structures and processes are not set forth in detail in order to avoid obscuring the description of the present application with unnecessary detail. Thus, the present application is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed herein.
It should be noted that, because the system in the embodiment of the present application is executed in a computer device, processing objects of each computer device all exist in the form of data or information, for example, time, which is substantially time information, and it is understood that, in the subsequent embodiments, if size, number, position, and the like are mentioned, corresponding data exist so as to be processed by the computer device, and details are not described herein.
The embodiment of the application provides a video storage method, a computer device and a storage medium of a national standard camera, which are respectively described in detail below.
Referring to fig. 1, in an embodiment, a video storage method of a national camera is applied to a video monitoring platform, and a video monitoring terminal realizes a video storage function through the video storage method of the national camera. The method comprises the following steps:
101. continuously receiving video stream data sent by a plurality of national standard cameras at the front end;
102. storing the received video stream data to a video data queue in a local operation memory;
103. continuously writing the video stream data stored in the video data queue into the mounted network attached storage equipment;
in this embodiment, the video monitoring platform establishes connections with the plurality of national cameras at the front end respectively, so as to receive video stream data sent by each national camera at the front end. The video stream data sent by the national camera is generated by pictures collected by the national camera in real time, so that the national camera can continuously send the video stream data to the video monitoring platform, and the video monitoring platform can continuously receive the video stream data sent by the national camera.
In some embodiments, a video surveillance platform is provided with a streaming media service and a storage service. The streaming media service is used for continuously receiving video stream data sent by each national standard camera and sending the video stream data and the camera identifier of the national standard camera corresponding to the video stream data to the storage service. The Storage service is used for classifying video stream data sent by the streaming media service according to each camera identifier, and writing the classified video stream data into Network Attached Storage (NAS) equipment which is mounted on the Storage service of the video monitoring platform, so that management personnel can conveniently view the video stream data in the NAS equipment.
In some embodiments, the storage service includes a plurality of receiving threads, a plurality of video data queues, and a plurality of write file threads, and the national cameras are in a one-to-one correspondence with the receiving threads, the video data queues, and the write file threads, i.e., one receiving thread, video data queue, and write file thread are used to independently process video stream data of a single national camera. Therefore, when the storage service is started, the storage service can acquire the number of national standard cameras connected to the video monitoring platform to create receiving threads, video data queues and file writing threads which are the same as the number of the national standard cameras. When a receiving thread, a video data queue and a file writing thread independently process video stream data of a single national standard camera, the receiving thread continuously receives the video stream data of the single national standard camera sent by a streaming media service, analyzes the video stream data to obtain video stream data of one frame, writes the video stream data of one frame into the video data queue, and the file writing thread continuously reads the video stream data from the video data queue and writes the read video stream data into NAS equipment. It should be noted that the video data queues are set in the local running memory of the video monitoring platform, and the video data queues of different national standard cameras are different.
104. The length of the video data queue is obtained at regular time, so that the variation trend of the length of the video data queue is determined;
105. if the change trend is an increasing trend, judging that the write operation aiming at the network attached storage equipment is abnormal, and sending a prompt message of the abnormal write to a preset terminal;
in this embodiment, the storage service is also provided with a watcher thread. The observer thread is used for acquiring the length of each video data queue in a timing mode to determine the variation trend of the length of each video data queue. Since the lengths of all the video data queues are often affected when the write operation to the NAS device is abnormal, the observer thread can determine whether the write operation is abnormal according to the variation trend of the lengths of all or part of the video data queues.
In some embodiments, the trend of change may include an increasing trend, a decreasing area, and the like. Specifically, when the variation trend of the length of the video data queue is determined, if the length of the video data queue continuously increases and the duration of the increase is longer than a first preset time period, for example, longer than 4 seconds, it is determined that the variation trend of the length of the video data queue is an increase trend. If the length of the video data queue is continuously reduced, and the duration of the reduction is longer than a first preset duration, for example, longer than 4 seconds, the trend of the change of the length of the video data queue is determined to be a reduction trend.
In some embodiments, if the trend of change is an increasing trend, it indicates that the rate at which the receiving thread stores the video stream data in the video data queue is greater than the rate at which the file writing thread writes the video stream data stored in the video data queue into the NAS device, and since the rate at which the file writing thread writes the video stream data stored in the video data queue into the NAS device is far greater than the rate at which the receiving thread stores the video stream data in the video data queue under normal conditions, when the trend of change is an increasing trend, it may be determined that an abnormality occurs in the writing operation for the NAS device, and a notification message of the writing abnormality is sent to the preset terminal, so as to prompt an administrator of the preset terminal to manually handle the writing abnormality fault.
In some embodiments, if the trend of the change is an increasing trend, whether a prompt message of a write error fed back by the file-writing thread is received or not can also be detected. If the prompt information of the write error fed back by the write file thread is received and the write operation is actually abnormal, the fact that the write operation aiming at the NAS device is abnormal can be judged, and therefore the abnormal detection of the write operation aiming at the NAS device is more accurate. And if the prompt message of the write error fed back by the write file thread is not received and indicates that the write operation is not abnormal, it can be determined that the write operation aiming at the NAS device is not abnormal. When the file writing thread writes video stream data into the NAS device, the writing speed of the file writing thread is detected and/or whether writing fails is detected, so that whether a writing error occurs is judged according to the writing speed and/or whether writing fails. If the write-in error is judged to occur, the file-writing thread can actively feed back prompt information of the write-in error to the observer thread.
106. And when the write operation aiming at the network attached storage equipment is abnormal, stopping storing the received video stream data to the video data queue and storing the received video stream data to a local disk.
In this embodiment, when the write operation for the NAS device is abnormal, the length of the video data queue is continuously increased, so that the video data queue occupies too much operating memory, and since the video monitoring platform is often connected to a large number of national cameras at the same time, a large amount of video stream data sent by a large number of national cameras is received, the operating memory is easily exhausted, and data is lost. Therefore, when the write operation aiming at the NAS device is abnormal, the receiving thread can be controlled to stop storing the received video stream data into the video data queue and store the received video stream data into the local disk space of the video monitoring platform, namely, the storage position of the video stream data is changed from the video data queue in the local running memory to the local disk, so that the running memory is prevented from being exhausted.
In some embodiments, when the write operation for the NAS device is abnormal, the remaining capacity of the local running memory where the video data queue is located may also be obtained, and if the remaining capacity of the local running memory where the video data queue is located is smaller than a preset threshold, it indicates that the local running memory is about to be exhausted, so that the storage of the received video stream data in the video data queue may be stopped, and the received video stream data may be temporarily stored in the local disk. If the residual capacity of the local running memory where the video data queue is located is larger than or equal to a preset threshold value, the received video stream data is kept to be stored in the video data queue, and therefore the local storage capacity of the video monitoring platform is improved through the local running memory.
In the technical scheme disclosed by the embodiment, whether the writing of the NAS device is abnormal is judged according to the length of the video data queue, and the video stream data is written into the local disk when the writing is abnormal, so that the data loss caused by the exhaustion of the local running memory where the video data queue is located is avoided, and the reliability of video storage is improved.
In another embodiment, as shown in fig. 2, on the basis of the embodiment shown in fig. 1, after step 106, the method further includes:
201. when the change trend is detected to be a reduction trend, judging whether the length of the video data queue is reduced to a preset length or not;
202. if the length of the video data queue is reduced to a preset length, judging that the writing operation aiming at the network attached storage equipment is recovered to be normal;
in this embodiment, after an abnormality occurs in the write operation to the NAS device, it needs to be detected whether the write operation to the NAS device returns to normal. Specifically, the file writing thread continuously reads the video stream data from the video data queue and writes the read video stream data into the NAS device to wait for the writing operation for the NAS device to return to normal, so that the variation trend of the length of the video data queue can be determined according to the video data queue length acquired at regular time. If the trend of change is a decreasing trend, it indicates that the write operation for the NAS device may have recovered to normal. At this time, it may be determined whether the length of the video data queue has decreased to a preset length, and if the length of the video data queue has decreased to the preset length, it is determined that the write operation for the NAS device has resumed. For example, the preset length may be 0, and after an exception occurs in the write operation to the NAS device, if it is detected that the trend of the change in the length of the video data queue is a decreasing trend and the length has decreased to 0, the write operation to the NAS device has recovered to be normal.
203. If the writing operation for the network attached storage equipment is recovered to be normal, stopping storing the received video stream data to the local disk, storing the received video stream data to the video data queue, and writing the video stream data stored in the local disk into the network attached storage equipment.
In this embodiment, when the write operation for the NAS device has recovered to normal, the run memory will not run out, so the receiving thread may be controlled to stop storing the received video stream data to the local disk and store the received video stream data to the video data queue, that is, to recover the storage location of the video stream data from the local disk to the video data queue.
In some embodiments, for the video stream data temporarily stored in the local disk during the abnormal write operation for the NAS device, the video stream data may also be written into the NAS device by the file write thread after the write operation has recovered to normal. The video stream data are provided with corresponding video acquisition timestamps, so that the sequence of the video stream data can be determined according to the video acquisition timestamps, and corresponding video files and video pictures can be restored according to the sequence.
In the technical solution disclosed in this embodiment, when the write operation for the NAS device has recovered to normal, the storage location of the video stream data is recovered from the local disk to the video data queue, so as to recover the operation of writing the video stream data into the NAS device.
In still another embodiment, as shown in fig. 3, on the basis of any one of the embodiments shown in fig. 1 to fig. 2, after step 106, the method further includes:
301. acquiring the residual storage capacity of the local disk;
302. determining a first national standard camera of the plurality of national standard cameras when the remaining storage capacity is less than a preset capacity;
303. deleting the video stream data of the first national camera stored in the local disk, and stopping storing the received video stream data of the first national camera to the local disk.
In this embodiment, after an exception occurs in the write operation for the NAS device, the receiving thread may store the received video stream data to the local disk before the write operation for the NAS device is recovered to normal. The storage capacity of the local disk is limited, and a large amount of video stream data sent by the national standard camera cannot be received and stored for a long time. Therefore, the remaining storage capacity of the local disk can be obtained, if the remaining storage capacity is smaller than the preset capacity, it is indicated that the storage capacity of the local disk is exhausted, at this time, at least one first national camera in the plurality of national cameras at the front end can be determined, the video stream data of the at least one first national camera stored in the local disk is deleted, and the received video stream data of the first national camera is stopped being stored in the local disk, that is, when the storage capacity of the local disk is exhausted, the video stream data of the first national camera is abandoned to be stored, more storage space is provided for the video stream data of other national cameras, and the storage capacity of the local disk for the video stream data is improved.
In some embodiments, when determining a first national camera of the plurality of national cameras, a monitoring region corresponding to each national camera at the front end may be obtained, a region category to which each monitoring region belongs may be obtained, priorities among the plurality of national cameras may be determined according to the region categories to which the monitoring regions corresponding to the national cameras belong, and the first national camera of the plurality of national cameras may be determined according to the priorities, where the priority of the first national camera is lower than the priority of a second national camera of the plurality of national cameras. Namely, the national camera with lower priority is used as the first national camera, so as to abandon the storage of the video stream data of the first national camera when the storage capacity of the local disk is about to be exhausted. It is understood that the priority characterizes the importance between national cameras, i.e. the importance between the video stream data of the national cameras.
In some embodiments, the zone category to which the monitoring zone belongs may include an entrance, a hall, a room, outdoors, and the like. The importance of different region types is different, and the corresponding priority is also different. For example, the national camera at the entrance may be used as the second national camera, and the national camera at the lobby may be used as the first national camera.
In some embodiments, when an exception occurs in the write operation to the NAS device, the received video stream data of the third national standard camera may also be stopped from being stored to the video data queue only for the third national standard camera, and the received video stream data of the third national standard camera may also be stored to the local disk. And for the fourth national standard camera, stopping storing the received video stream data of the fourth national standard camera into the video data queue, directly deleting the received video stream data of the fourth national standard camera, and not storing the video stream data of the fourth national standard camera. That is, only the video stream data of the third national standard camera is stored to the local disk, and the video stream data of the fourth national standard camera is not stored, so that the storage capacity of the local disk for the video stream data is improved. The plurality of national standard cameras comprise a third national standard camera and a fourth national standard camera.
In some embodiments, when determining a third and fourth national camera of the plurality of national cameras, the manner is similar to determining the first and second national cameras. For example, monitoring regions corresponding to national cameras of the front end can be acquired, region types to which the monitoring regions belong can be acquired, priorities among the national cameras are determined according to the region types to which the monitoring regions corresponding to the national cameras belong, and a fourth national camera of the national cameras is determined according to the priorities, wherein the priority of the fourth national camera is lower than the priority of the third national camera. That is, the national standard camera with a lower priority is used as the fourth national standard camera, so that when an abnormality occurs in the write operation to the NAS device, the video stream data of the fourth national standard camera is discarded from being stored. It is understood that the priority characterizes the importance between national cameras, i.e. the importance between the video stream data of the national cameras.
In the technical scheme disclosed in this embodiment, after the write operation for the NAS device is abnormal, before the write operation for the NAS device is recovered to normal, if the remaining storage capacity of the local disk is smaller than the preset capacity, the video stream data of the first national standard camera stored in the local disk is deleted, and the received video stream data of the first national standard camera is stopped being stored in the local disk, so that the storage capacity of the local disk for the video stream data is improved.
In yet another embodiment, as shown in fig. 4, based on the embodiment shown in any one of fig. 1 to 3, step 106 includes:
401. when the write operation aiming at the network attached storage equipment is abnormal, determining the abnormal type of the write operation;
402. and if the abnormal type of the writing operation is the abnormality that the network attached storage equipment cannot be accessed, stopping storing the received video stream data to the video data queue, and storing the received video stream data to the local disk.
In this embodiment, when an exception occurs in a write operation to the NAS device, the type of the exception of the write operation may be determined, and different processing may be performed according to different exception types, where when the exception type is an exception that the NAS device cannot be accessed, the storage of the received video stream data in the video data queue is stopped for video stream data sent by all national cameras, and the received video stream data is stored in the local disk.
In some embodiments, the write operation to the NAS device may be affected due to a failure of the NAS device or network jitter. Thus, the exception type of the write operation may include an exception that the NAS device is inaccessible, an exception of network jitter, and the like. When the type of the abnormality of the write operation is an abnormality of network jitter, the write speed for the NAS device can be acquired. If the writing speed is less than the first preset speed and greater than the second preset speed, it indicates that the writing speed is slow, but the writing of the video stream data to the NAS device is not completely impossible, so that the received video stream data of the third national standard camera can be maintained to be stored in the video data queue, and the video stream data of the third national standard camera can be continuously written into the NAS device. In some embodiments, if the write speed is less than the first preset speed and greater than the second preset speed, the received video stream data of the fourth national standard camera may be stopped from being stored in the video data queue, and the received video stream data of the fourth national standard camera may be stored in the local disk, so that the NAS device is written with the video stream data of the fourth national standard camera after the write operation is recovered to normal. In this way, by stopping the writing of the video stream data of the fourth national standard camera which is not important, the full-speed writing of the video stream data of the third national standard camera which is important is ensured.
In some embodiments, when determining the exception type of the write operation, it may be determined whether the exception type of the write operation is an exception that does not enable access to the NAS device by attempting to access the NAS device. If the abnormal type of the write-in operation is not the abnormity that the NAS device cannot be accessed, the write-in speed fed back by the write file thread can be obtained, and whether the write-in speed is smaller than a first preset speed and larger than a second preset speed or not is judged so as to judge whether the abnormal type of the write-in operation is the abnormity of network jitter or not.
In some embodiments, after the received video stream data of the third national standard camera is maintained to be stored in the video data queue, the length of the video data queue may further continue to be detected, and if the trend of the change of the length of the video data queue is still an increasing trend, the received video stream data of the third national standard camera may also be stopped from being stored in the video data queue, and the received video stream data of the third national standard camera may also be stored in the local disk.
In the technical scheme disclosed in this embodiment, when an exception occurs in a write operation for NAS equipment, the exception type of the write operation may be determined, and different processing is performed according to different exception types, so as to ensure the reliability of video storage of a national standard camera.
In order to better implement the video storage method of the national camera in the embodiment of the present application, on the basis of the video storage method of the national camera, the embodiment of the present application further provides a video storage device of the national camera, as shown in fig. 5, the video storage device 500 of the national camera includes a receiving module 501, a storage module 502, a writing module 503, and a detection module 504, which are specifically as follows:
a receiving module 501, configured to continuously receive video stream data sent by multiple national standard cameras at a front end;
a storage module 502, configured to store the received video stream data in a video data queue in a local operating memory;
a writing module 503, configured to write the video stream data stored in the video data queue into the mounted network attached storage device continuously;
the detection module 504 is configured to obtain the length of the video data queue at regular time to determine a variation trend of the length of the video data queue, determine that a write operation for the network attached storage device is abnormal if the variation trend is an increasing trend, and send a prompt message indicating that the write operation is abnormal to a preset terminal;
the storage module 502 is further configured to stop storing the received video stream data to the video data queue and store the received video stream data to a local disk when an exception occurs in a write operation for the network attached storage device.
The embodiment of the application also provides computer equipment which integrates the video storage device of any national standard camera provided by the embodiment of the application. As shown in fig. 6, it shows a schematic structural diagram of a computer device according to an embodiment of the present application, specifically:
the computer device may include components such as a processor 601 of one or more processing cores, memory 602 of one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will appreciate that the computer device configuration shown in FIG. 6 is not intended to constitute a limitation of computer devices and may include more or fewer components than those shown, or some of the components may be combined, or a different arrangement of components. Wherein:
the processor 601 is a control center of the computer device, connects various parts of the whole computer device by using various interfaces and lines, and performs various functions of the computer device and processes data by running or executing software programs and/or modules stored in the memory 602 and calling data stored in the memory 602, thereby monitoring the computer device as a whole. Alternatively, processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 601.
The memory 602 may be used to store software programs and modules, and the processor 601 executes various functional applications and data processing by operating the software programs and modules stored in the memory 602. The memory 602 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data created according to use of the computer device, and the like. Further, the memory 602 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
The computer device further comprises a power supply 603 for supplying power to the various components, and preferably, the power supply 603 is logically connected to the processor 601 through a power management system, so that functions of managing charging, discharging, and power consumption are realized through the power management system. The power supply 603 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
The computer device may also include an input unit 604, the input unit 604 being operable to receive input numeric or character information and to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
Although not shown, the computer device may further include a display unit and the like, which are not described in detail herein. Specifically, in this embodiment, the processor 601 in the computer device loads the executable file corresponding to the process of one or more application programs into the memory 602 according to the following instructions, and the processor 601 runs the application programs stored in the memory 602, thereby implementing various functions as follows:
continuously receiving video stream data sent by a plurality of national standard cameras at the front end;
storing the received video stream data to a video data queue in a local operation memory;
continuously writing the video stream data stored in the video data queue into the mounted network attached storage equipment;
the method comprises the steps of obtaining the length of a video data queue at regular time to determine the change trend of the length of the video data queue;
if the change trend is an increasing trend, judging that the writing operation aiming at the network attached storage equipment is abnormal, and sending a prompt message of the abnormal writing to a preset terminal;
and when the write operation aiming at the network attached storage equipment is abnormal, stopping storing the received video stream data to the video data queue and storing the received video stream data to the local disk.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, an embodiment of the present application provides a computer-readable storage medium, which may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like. The system comprises a video storage device, a processor and a computer program, wherein the video storage device stores the computer program, and the computer program is loaded by the processor to execute the steps in any one of the video storage methods of the national standard camera provided by the embodiment of the application. For example, the computer program may be loaded by a processor to perform the steps of:
continuously receiving video stream data sent by a plurality of national standard cameras at the front end;
storing the received video stream data to a video data queue in a local operation memory;
continuously writing the video stream data stored in the video data queue into the mounted network attached storage equipment;
the method comprises the steps of obtaining the length of a video data queue at regular time to determine the change trend of the length of the video data queue;
if the change trend is an increasing trend, judging that the writing operation aiming at the network attached storage equipment is abnormal, and sending a prompt message of the abnormal writing to a preset terminal;
when the write operation aiming at the network attached storage equipment is abnormal, stopping storing the received video stream data into the video data queue, and storing the received video stream data into a local disk.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and parts that are not described in detail in a certain embodiment may refer to the above detailed descriptions of other embodiments, and are not described herein again.
In specific implementation, each unit or structure may be implemented as an independent entity, or may be combined arbitrarily to be implemented as the same entity or several entities, and specific implementation of each unit or structure may refer to the foregoing method embodiment, which is not described herein again.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
The video storage method, the computer device and the storage medium of the national standard camera provided by the embodiment of the application are introduced in detail, a specific example is applied in the text to explain the principle and the implementation of the application, and the description of the embodiment is only used for helping to understand the method and the core idea of the application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.
Claims (7)
1. A video storage method of a national standard camera is characterized by comprising the following steps:
continuously receiving video stream data sent by a plurality of national standard cameras at the front end;
storing the received video stream data to a video data queue in a local operation memory;
continuously writing the video stream data stored in the video data queue into the mounted network attached storage equipment;
the length of the video data queue is obtained at regular time, so that the variation trend of the length of the video data queue is determined;
if the change trend is an increasing trend, judging that the writing operation aiming at the network attached storage equipment is abnormal, and sending a prompt message of abnormal writing to a preset terminal;
when the write operation aiming at the network attached storage equipment is abnormal, determining the abnormal type of the write operation;
if the abnormal type of the write operation is an abnormality that the network attached storage equipment cannot be accessed, stopping storing the received video stream data to the video data queue, and storing the received video stream data to a local disk, wherein if the abnormal type of the write operation is an abnormality of network jitter, acquiring a write speed for the network attached storage equipment, if the write speed is less than a first preset speed and greater than a second preset speed, determining a third national standard camera and a fourth national standard camera of the plurality of national standard cameras, maintaining the received video stream data of the third national standard camera to be stored to the video data queue, stopping storing the received video stream data of the fourth national standard camera to the video data queue, and storing the received video stream data of the fourth national standard camera to the local disk, wherein the step of determining a third national standard camera and a fourth national standard camera of the plurality of national standard cameras comprises: acquiring monitoring areas corresponding to national cameras at the front end, acquiring area types to which the monitoring areas belong, determining priorities among the national cameras according to the area types to which the monitoring areas corresponding to the national cameras at the front end belong, and determining a third national camera and a fourth national camera in the national cameras according to the priorities, wherein the priority of the fourth national camera is lower than that of the third national camera;
when the change trend is detected to be a reduction trend, judging whether the length of the video data queue is reduced to a preset length or not;
if the length of the video data queue is reduced to a preset length, judging that the writing operation aiming at the network attached storage equipment is recovered to be normal;
if the writing operation for the network attached storage equipment is recovered to be normal, stopping storing the received video stream data to the local disk, storing the received video stream data to the video data queue, and writing the video stream data stored in the local disk into the network attached storage equipment.
2. The method for storing video of a national camera as claimed in claim 1, wherein if the type of the exception of the write operation is an exception that the network attached storage device cannot be accessed, the method further comprises, after the step of stopping storing the received video stream data in the video data queue and storing the received video stream data in a local disk:
acquiring the residual storage capacity of the local disk;
determining a first national standard camera of the plurality of national standard cameras when the remaining storage capacity is less than a preset capacity;
and deleting the video stream data of the first national camera stored in the local disk, and stopping storing the received video stream data of the first national camera to the local disk.
3. A method for video storage of a national camera as defined in claim 2 wherein the step of determining a first national camera of the plurality of national cameras comprises:
acquiring a monitoring area corresponding to each national standard camera;
acquiring the region type of the monitoring region;
determining the priority of the national standard camera according to the region type of the monitoring region corresponding to the national standard camera;
and determining a first national camera in the plurality of national cameras according to the priority, wherein the priority of the first national camera is lower than the priority of a second national camera in the plurality of national cameras.
4. The video storage method of a national camera as claimed in claim 1, wherein the plurality of national cameras includes a third national camera and a fourth national camera, and the step of stopping storing the received video stream data to the video data queue and storing the received video stream data to a local disk comprises:
and stopping storing the received video stream data of the third national standard camera to the video data queue and storing the received video stream data of the third national standard camera to the local disk, wherein stopping storing the received video stream data of the fourth national standard camera to the video data queue and deleting the received video stream data of the fourth national standard camera.
5. The method for storing video of a national camera as claimed in claim 1, wherein the step of stopping storing the received video stream data to the video data queue and storing the received video stream data to a local disk if the type of the exception of the write operation is an exception that the network attached storage device cannot be accessed comprises:
if the abnormal type of the write-in operation is the abnormality that the network attached storage equipment cannot be accessed, acquiring the residual capacity of a local running memory where the video data queue is located;
if the residual capacity of the local running memory where the video data queue is located is smaller than a preset threshold value, stopping storing the received video stream data to the video data queue, and storing the received video stream data to the local disk, wherein if the residual capacity of the local running memory where the video data queue is located is larger than or equal to the preset threshold value, the received video stream data is kept to be stored to the video data queue.
6. A computer device, characterized in that the computer device comprises:
one or more processors;
a memory; and
one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to implement the steps in the video storage method of a national standard camera of any one of claims 1 to 5.
7. A computer-readable storage medium, having stored thereon a computer program which is loaded by a processor to perform the steps in the video storage method of a national standard camera as claimed in any one of claims 1 to 5.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210371168.8A CN114461151B (en) | 2022-04-11 | 2022-04-11 | Video storage method, computer equipment and storage medium of national standard camera |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202210371168.8A CN114461151B (en) | 2022-04-11 | 2022-04-11 | Video storage method, computer equipment and storage medium of national standard camera |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN114461151A CN114461151A (en) | 2022-05-10 |
| CN114461151B true CN114461151B (en) | 2022-08-26 |
Family
ID=81417480
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202210371168.8A Active CN114461151B (en) | 2022-04-11 | 2022-04-11 | Video storage method, computer equipment and storage medium of national standard camera |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114461151B (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN115437577B (en) * | 2022-11-04 | 2023-07-18 | 平安银行股份有限公司 | Data writing method, computer device and storage medium |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111311911A (en) * | 2020-02-24 | 2020-06-19 | 武汉中科通达高新技术股份有限公司 | Data management method and device for electronic police system and electronic equipment |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101437134A (en) * | 2008-11-29 | 2009-05-20 | 成都市华为赛门铁克科技有限公司 | Data storage method and system |
| WO2017201646A1 (en) * | 2016-05-23 | 2017-11-30 | 深圳市大疆创新科技有限公司 | Data storage method and device |
| CN108076317B (en) * | 2016-11-17 | 2020-08-11 | 杭州海康威视数字技术股份有限公司 | Video data storage method and system, video access method and node |
| CN111125022A (en) * | 2019-11-15 | 2020-05-08 | 浙江大华技术股份有限公司 | Method, device, equipment and storage medium for determining video coverage weight |
| CN111651631B (en) * | 2020-04-28 | 2023-11-28 | 长沙证通云计算有限公司 | High concurrency video data processing method, electronic equipment, storage medium and system |
-
2022
- 2022-04-11 CN CN202210371168.8A patent/CN114461151B/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111311911A (en) * | 2020-02-24 | 2020-06-19 | 武汉中科通达高新技术股份有限公司 | Data management method and device for electronic police system and electronic equipment |
Also Published As
| Publication number | Publication date |
|---|---|
| CN114461151A (en) | 2022-05-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US9058110B2 (en) | Managing a cache in a multi-node virtual tape controller | |
| TW201338537A (en) | System and method for dynamic dispatching of video recording | |
| US10075326B2 (en) | Monitoring file system operations between a client computer and a file server | |
| CN114461151B (en) | Video storage method, computer equipment and storage medium of national standard camera | |
| CN115190044B (en) | Device connection state checking method, device and storage medium | |
| CN112052088A (en) | Adaptive process CPU resource limitation method, device, terminal and storage medium | |
| WO2020078355A1 (en) | Device state monitoring method and apparatus | |
| CN113382056A (en) | Data reporting method, device, equipment, storage medium and system | |
| CN111723064A (en) | Log collection method and device, server and storage medium | |
| CN113741814A (en) | Data processing method, apparatus, computer readable storage medium and computer equipment | |
| US7830811B2 (en) | Terminal apparatus, terminal apparatus control method, network system, network system control method, program and recording medium | |
| CN114495399B (en) | National standard camera alarm information processing system, method, computer equipment and medium | |
| US8612524B2 (en) | Cessation of sending network status messages to a server | |
| CN110413573B (en) | Log storage control method and device, computer equipment and storage medium | |
| US11706050B2 (en) | Polling method and system for server sensors, and related apparatus | |
| CN114466151B (en) | Video storage system, computer equipment and storage medium of national standard camera | |
| CN110837428B (en) | Storage device management method and device | |
| CN112181737A (en) | Message processing method and device, electronic equipment and medium | |
| CN111708676A (en) | Example cluster monitoring method and device and server | |
| CN115576783B (en) | Blade server out-of-band log storage method and system of VPX case | |
| CN115037652A (en) | Operation monitoring system for background module of sleeve protection system | |
| CN115934845A (en) | Self-adaptive data synchronization system, method and storage medium | |
| CN110336701B (en) | High-density two-way server management method and system | |
| CN107733702A (en) | The method and apparatus that operational state of mainframe is managed in group system | |
| CN114116645A (en) | Log management method, device, storage medium and electronic device for multiple processing units |
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 | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |