CN112954244A - Method, device and equipment for realizing storage of monitoring video and storage medium - Google Patents

Method, device and equipment for realizing storage of monitoring video and storage medium Download PDF

Info

Publication number
CN112954244A
CN112954244A CN202110068635.5A CN202110068635A CN112954244A CN 112954244 A CN112954244 A CN 112954244A CN 202110068635 A CN202110068635 A CN 202110068635A CN 112954244 A CN112954244 A CN 112954244A
Authority
CN
China
Prior art keywords
data
cache
video data
write
ipc
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110068635.5A
Other languages
Chinese (zh)
Inventor
许海涛
黄建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
TP Link Technologies Co Ltd
Original Assignee
TP Link Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN202110068635.5A priority Critical patent/CN112954244A/en
Publication of CN112954244A publication Critical patent/CN112954244A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention discloses a method, a device, equipment and a storage medium for realizing storage of a monitoring video, wherein the method comprises the following steps: pre-distributing a write cache; storing the received IPC video data of a plurality of IPCs into a video data cache; reading IPC video data from the video data cache, and storing the read IPC video data to a write-in cache; when the write-in cache meets the preset condition, writing the IPC video data read from the write-in cache into a data partition of the hard disk, and generating a data index to be written into an index area of the hard disk; the preset condition comprises that the write-in cache is full or the cache time is more than or equal to the set duration; the IPC video data of a plurality of IPCs can be stored in a single data partition, so that more data can be written when the total cache data is less, the writing speed is improved, the memory occupation is reduced, and the memory requirement caused by the increase of the accessible IPCs of the storage server is met.

Description

Method, device and equipment for realizing storage of monitoring video and storage medium
Technical Field
The present invention relates to the field of storage technologies for surveillance videos, and in particular, to a method, an apparatus, a device, and a storage medium for implementing storage of a surveillance video.
Background
With the wide popularization of the cloud security video monitoring technology, the problem of efficient storage of the monitoring video is particularly prominent. At present, the existing storage method of the surveillance video is generally to divide one IPC into one data partition with the size of 1GB to be stored separately, and if n IPCs are recorded simultaneously, n data partitions with the size of 1GB are divided to be used simultaneously. However, since the hard disk has the characteristic of low random writing performance, high performance can be achieved only by writing after more data is cached by each IPC. However, as storage servers are designed to have more and more IPCs (IP cameras), for example, 256, 512, or even 768 IPCs can be accessed by existing storage servers, and the memory requirement on the storage servers is increasing, and the storage manner of one IPC corresponding to one data partition cannot meet the memory requirement of the existing storage servers.
Disclosure of Invention
In view of the foregoing problems, an object of the present invention is to provide a method, an apparatus, a device and a storage medium for implementing storage of a surveillance video, which can meet the memory requirement caused by the increase of IPC accessible to a storage server, and improve the real-time property of IPC video data writing.
In a first aspect, an embodiment of the present invention provides a method for implementing storage of a monitoring video, including:
pre-distributing a write cache;
storing the received IPC video data of a plurality of IPCs into a video data cache;
reading IPC video data from the video data cache, and storing the read IPC video data to the write-in cache;
when the write-in cache meets a preset condition, writing the IPC video data read from the write-in cache into a data partition of a hard disk; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: and the write-in cache is full or the cache time is more than or equal to the set time length. As an improvement of the above, the method further comprises:
when the read IPC video data is stored in the write-in cache, the IPC video data which is being written into the write-in cache and the IPC video data which is currently stored in the write-in cache are merged.
As an improvement of the above scheme, the size of the data partition is k × nGB; wherein n is equal to the maximum IPC number allowed to be accessed by the storage server, and k is a set value.
As an improvement of the above, the method further comprises:
judging whether the write cache is full;
when the write-in cache is full, confirming that the write-in cache meets the preset condition;
when the write-in cache is not fully written, judging whether the current cache time is more than or equal to the set duration;
when the current cache time is longer than or equal to the set time length, confirming that the write-in cache meets the preset condition;
and when the current cache time is shorter than the set time length, confirming that the write-in cache does not meet the preset condition.
As an improvement of the above scheme, the reading of IPC video data from the video data cache includes:
checking whether IPC video data exist in the video data cache;
and when the IPC video data exist in the video data cache, reading the IPC video data stored in the video data cache.
As an improvement of the above-mentioned solution,
the writing the IPC video data read from the write cache into a data partition of a hard disk comprises the following steps:
checking whether the hard disk has a data partition with a residual space;
when the hard disk has a data partition with a residual space, writing the IPC video data into the data partition with the residual space;
when the hard disk does not have a data partition with a residual space, checking whether the hard disk has a blank data partition;
when the hard disk has blank data partitions, writing the IPC video data into the blank data partitions;
when no blank data partition exists in the hard disk, acquiring data writing time of each data partition;
comparing the data writing time of each data partition, and clearing IPC video data stored in the data partition with the earliest data writing time; and writing the IPC video data read out from the write cache into the data partition after the IPC video data is cleared.
As an improvement of the above, the method further comprises:
searching a data index of any IPC video data within a set time range from the index area;
according to the address information of the data index, reading IPC video data corresponding to the data index from the data partition according to the time sequence;
and sending the read IPC video data to a receiving terminal.
In a second aspect, an embodiment of the present invention further provides a device for implementing storage of a monitoring video, including:
a write cache allocation module for allocating a write cache in advance;
the data storage module is used for storing the received IPC video data of the IPCs into a video data cache;
the first data writing module is used for reading IPC video data from the video data cache and storing the read IPC video data to the writing cache;
the second data writing module is used for writing the IPC video data read from the writing cache into a data partition of the hard disk when the writing cache meets a preset condition; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: and the write-in cache is full or the cache time is more than or equal to the set time length.
In a third aspect, an embodiment of the present invention further provides a storage implementation device for a monitoring video, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, where the processor implements the storage implementation method for a monitoring video according to any one of the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, where when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to perform the storage implementation method for a monitoring video according to any one of the first aspects.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: the read multiple IPC video data are stored in a write-in cache which is pre-allocated with a fixed size, and the multiple IPC video data are allocated to a continuous memory, so that the problem of discontinuous IPC video data is avoided; then when the write-in cache meets a preset condition, writing the IPC video data read from the write-in cache into a data partition of a hard disk; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: the write-in cache is full or the cache time is more than or equal to the set duration; when data is written into the write-in cache every time, new IPC video data are obtained from all IPC video data caches, the new IPC video data are combined with old IPC video data kept in the write-in cache, and each IPC does not need to have more caches, so that the storage efficiency is improved; writing the data block into a data partition of a hard disk, and generating a data index to be written into an index area of the hard disk; the IPC video data of multiple IPCs can be stored in a single data partition, so that more data can be written when the total cache data is less, the writing speed is improved, the memory occupation is reduced, the memory requirement caused by the fact that the storage server can access IPCs is met, the storage efficiency is improved, meanwhile, the data is not written after the IPC cache more data is not needed, the data can be written as soon as possible after the IPC data is received, the real-time performance of data writing is improved, and the risk of data loss caused by power failure is reduced.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a storage implementation method of a monitoring video according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a surveillance video system according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a storage structure of a hard disk according to an embodiment of the present invention;
FIG. 4 is a layout diagram of data partitions provided by an embodiment of the invention;
FIG. 5 is a schematic diagram of a storage flow of a surveillance video according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a storage implementation apparatus for a monitoring video according to an embodiment of the present invention;
fig. 7 is a schematic diagram of a storage implementation device for a monitoring video according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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 invention.
Referring to fig. 1, a first embodiment of the present invention provides a method for implementing storage of a monitoring video, including:
s1: pre-distributing a write cache;
s2: storing the received IPC video data of a plurality of IPCs into a video data cache;
s3: reading IPC video data from the video data cache, and storing the read IPC video data to the write-in cache;
s4: when the write-in cache meets a preset condition, writing the IPC video data read from the write-in cache into a data partition of a hard disk; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: and the write-in cache is full or the cache time is more than or equal to the set time length.
For ease of understanding, the surveillance video system architecture is briefly described below with reference to fig. 2. The monitoring video system mainly comprises IPC: a source of video data; a video receiving unit: the IPC video data is used for receiving the IPC video data generated by the IPC and caching the IPC video data into the memory; video data caching: the data cache stored in the memory has the characteristics of high random read-write performance and capability of reading and writing data blocks; writing into a cache: the video data cache is specially used for writing data, the data to be written are continuous in the memory when the data are written, and a continuous memory (namely the write-in cache) is additionally allocated because the data in the video data cache are not necessarily continuous, and the memory is copied into the continuous memory for writing; a data writing unit: reading the data written into the cache, writing the data into a data area in the hard disk, generating an index and writing the index into an index area in the hard disk; hard disk: the data is solidified and stored, and the method has the characteristics of poor random writing performance and good continuous writing performance; after a long section of data is continuously written from a certain address, jumping to the next position where the data needs to be written, and writing the next long section of data, wherein the performance is better at the moment; if the length of writing after each jump is short, the performance is poor. A data area: a portion of the hard disk that stores data; an index area: the hard disk holds the indexed portion.
In the implementation of the present invention, the cache time is the time length from the current time to the time when the IPC video data is read from the write cache last time. When the write-in cache has the residual space, the IPC video data is read from the video cache and is stored in the write-in cache, the space written in the write-in cache is released after the write-in is finished, and new IPC video data can be continuously stored after the space is released. When the write cache has no remaining space, it indicates that the write cache is performing write operation, and needs to wait for the write completion and then release the space to perform caching of the IPC video data. The IPC video data are read out from the video data cache and stored in a write-in cache which is pre-allocated with a fixed size, and the IPC video data are allocated to a continuous memory, so that the problem of incontinuity of the IPC video data is avoided; then when the current cache time exceeds the set duration or the write-in cache is full, reading the stored IPC video data from the write-in cache, and combining the IPC video data read from the write-in cache into a data block; when data is written in each time, IPC video data are obtained from all IPC video data caches and combined into a larger data to be written in, and each IPC does not need to have more caches, so that the storage efficiency is improved; writing the data block into a data partition of a hard disk, and generating a data index to be written into an index area of the hard disk; the IPC video data of multiple IPCs can be stored in a single data partition, so that more data can be written when the total cache data is less, the writing speed is improved, the memory occupation is reduced, the memory requirement caused by the fact that the storage server can access IPCs is met, the storage efficiency is improved, meanwhile, the data is not written after the IPC cache more data is not needed, the data can be written as soon as possible after the IPC data is received, the real-time performance of data writing is improved, and the risk of data loss caused by power failure is reduced.
In an optional embodiment, the method further comprises:
when the read IPC video data is stored in the write-in cache, the IPC video data which is being written into the write-in cache and the IPC video data which is currently stored in the write-in cache are merged.
In an alternative embodiment, the size of the data partition is k × nGB; wherein n is equal to the maximum IPC number allowed to be accessed by the storage server, and k is a set value.
As shown in fig. 3, the hard disk of the storage server is divided into an index area and a data area, where the index area is used to store a data index of the IPC video data, and the data index includes start and end times and address information of the IPC video data. The data area is used for storing IPC video data. As shown in fig. 4, the data area is divided into a plurality of data partitions (1, 2, …, m) with equal size, so as to allow IPC video data of a plurality of IPCs to be stored in the same data partition, and when the number of channels stored in each data partition increases, the size of the data partition also needs to be increased, thereby avoiding the problems that the number of files is large due to too small video files, the retrieval speed is slow, and the searching is inconvenient. When all data partitions are full of IPC video data, all data of one data partition can be emptied for use by a new video. In the embodiment of the present invention, the size of the data partition is designed to be k × nGB, n is equal to the maximum number of IPCs allowed to be accessed by the storage server, different values are taken for different storage servers n, and k is a set value.
In an optional embodiment, the method further comprises:
judging whether the write cache is full;
when the write-in cache is full, confirming that the write-in cache meets the preset condition;
when the write-in cache is not fully written, judging whether the current cache time is more than or equal to a set time length;
when the current cache time is longer than or equal to the set time length, confirming that the write-in cache meets the preset condition;
and when the current cache time is shorter than the set time length, confirming that the write-in cache does not meet the preset condition.
In the embodiment of the invention, in order to avoid that the write-in cache can not be filled all the time, a set time length is set as the timeout time, if the write-in cache is not filled all the time, the write-in cache is directly written into the hard disk when the set time length is reached, and the data storage delay is avoided.
In an alternative embodiment, the reading IPC video data from the video data cache comprises:
checking whether IPC video data exist in the video data cache;
and when the IPC video data exist in the video data cache, reading the IPC video data stored in the video data cache.
And when the IPC video data does not exist in the video data cache, continuously waiting for the IPC video data to be stored in the video data cache.
Referring to fig. 5, before the IPC video data is stored in the write cache, it is necessary to verify whether the video data cache has data, so as to avoid the write operation under the condition of no data.
In an alternative embodiment, the writing the IPC video data read from the write buffer into a data partition of a hard disk includes:
checking whether the hard disk has a data partition with a residual space;
when the hard disk has a data partition with a residual space, writing the IPC video data into the data partition with the residual space;
when the hard disk does not have a data partition with a residual space, checking whether the hard disk has a blank data partition;
when the hard disk has blank data partitions, writing the IPC video data into the blank data partitions;
when no blank data partition exists in the hard disk, acquiring data writing time of each data partition;
comparing the data writing time of each data partition, and clearing IPC video data stored in the data partition with the earliest data writing time; and writing the IPC video data read out from the write cache into the data partition after the IPC video data is cleared.
In the embodiment of the invention, when the data partition with the residual space exists, the data block is directly written into the data partition with the residual space according to the time sequence; when the data partition with the residual space does not exist, further checking whether a blank data partition exists; when blank data partitions exist, the data blocks are directly written into the blank data partitions according to the time sequence; when no blank data partition exists, the old data needs to be overwritten according to the time sequence, namely, the whole data partition is cleared at one time for new video recording aiming at the data partition with the earliest data writing time. Compared with the existing data partition with the size of only 1GB, the data partition is enlarged, the data volume deleted at one time is enlarged, but because the number of IPCs stored in a single data partition is large, the data volume deleted in the single IPC is similar to that in the prior art when the single data partition is cleared, and the data is prevented from being deleted in a large batch when the single data partition is cleared.
In an optional embodiment, the method further comprises:
searching a data index of any IPC video data within a set time range from the index area;
according to the address information of the data index, reading IPC video data corresponding to the data index from the data partition according to the time sequence;
and sending the read IPC video data to a receiving terminal.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: the IPC video data are read out from the video data cache and stored in a write-in cache which is pre-allocated with a fixed size, and the IPC video data are allocated to a continuous memory, so that the problem of incontinuity of the IPC video data is avoided; then when the current cache time is more than or equal to the set duration or the write-in cache is full, writing the IPC video data read from the write-in cache into a data partition of the hard disk; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: the write-in cache is full or the cache time is more than or equal to the set duration; when data is written into the write-in cache every time, new IPC video data are obtained from all IPC video data caches, the new IPC video data are combined with old IPC video data kept in the write-in cache, and each IPC does not need to have more caches, so that the storage efficiency is improved; writing the data block into a data partition of a hard disk, and generating a data index to be written into an index area of the hard disk; the IPC video data of multiple IPCs can be stored in a single data partition, so that more data can be written when the total cache data is less, the writing speed is improved, the memory occupation is reduced, the memory requirement caused by the fact that the storage server can access IPCs is met, the storage efficiency is improved, meanwhile, the data is not written after the IPC cache more data is not needed, the data can be written as soon as possible after the IPC data is received, the real-time performance of data writing is improved, and the risk of data loss caused by power failure is reduced.
Referring to fig. 6, a second embodiment of the present invention further provides a device for implementing storage of a monitoring video, including:
a write-in cache allocation module 1 for allocating a write-in cache in advance;
the data storage module 2 is used for storing the received IPC video data of the IPCs into a video data cache;
the first data writing module 3 is used for reading IPC video data from the video data cache and storing the read IPC video data to the writing cache;
the second data writing module 4 is used for writing the IPC video data read from the write-in cache into a data partition of the hard disk when the write-in cache meets a preset condition; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: and the write-in cache is full or the cache time is more than or equal to the set time length. In an alternative embodiment, the first data writing module 3 includes, a data merging unit;
and the data merging unit is used for merging the IPC video data which is being written into the write-in cache and the IPC video data which is currently stored in the write-in cache when the read IPC video data is stored in the write-in cache.
In an alternative embodiment, the size of the data partition is k × nGB; wherein n is equal to the maximum IPC number allowed to be accessed by the storage server, and k is a set value.
In an alternative embodiment, the apparatus further comprises:
the first judgment module is used for judging whether the write cache is full; when the write-in cache is full, confirming that the write-in cache meets the preset condition;
the second judging module is used for judging whether the current cache time is more than or equal to the set time length or not when the write-in cache is not fully written; when the current cache time is longer than or equal to the set time length, confirming that the write-in cache meets the preset condition; and when the current cache time is shorter than the set time length, confirming that the write-in cache does not meet the preset condition.
In an alternative embodiment, the first data writing module 3 includes:
the data checking unit is used for checking whether IPC video data exist in the video data cache;
and the data reading unit is used for reading the IPC video data stored in the video data cache when the IPC video data exists in the video data cache.
In an alternative embodiment, the second data writing module 4 comprises:
a residual space checking unit for checking whether a data partition of a residual space exists in the hard disk;
the first writing unit is used for writing the IPC video data into the data partition with the residual space when the data partition with the residual space exists in the hard disk;
a blank data partition checking unit, configured to check whether a blank data partition exists in the hard disk when the data partition with the remaining space does not exist in the hard disk;
the second writing unit is used for writing the IPC video data into a blank data partition when the blank data partition exists in the hard disk;
a write-in time acquiring unit, configured to acquire data write-in time of each data partition when there is no blank data partition in the hard disk;
the data covering unit is used for comparing the data writing time of each data partition and clearing IPC video data stored in the data partition with the earliest data writing time; and writing the IPC video data read out from the write cache into the data partition after the IPC video data is cleared.
In an alternative embodiment, the apparatus further comprises:
the data index searching module is used for searching a data index of any IPC video data within a set time range from the index area;
the IPC data reading module is used for reading IPC video data corresponding to the data index from the data partition according to the address information of the data index and the time sequence;
and the IPC data sending module is used for sending the read IPC video data to the receiving terminal.
The working principle of the apparatus for implementing storage of a surveillance video according to the embodiment of the present invention please refer to the method for implementing storage of a surveillance video according to the first embodiment, which will not be described in detail herein.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: the IPC video data are read out from the video data cache and stored in a write-in cache which is pre-allocated with a fixed size, and the IPC video data are allocated to a continuous memory, so that the problem of incontinuity of the IPC video data is avoided; then when the current cache time is more than or equal to the set duration or the write-in cache is full, writing the IPC video data read from the write-in cache into a data partition of the hard disk; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: the write-in cache is full or the cache time is more than or equal to the set duration; when data is written into the write-in cache every time, new IPC video data are obtained from all IPC video data caches, the new IPC video data are combined with old IPC video data kept in the write-in cache, and each IPC does not need to have more caches, so that the storage efficiency is improved; writing the data block into a data partition of a hard disk, and generating a data index to be written into an index area of the hard disk; the IPC video data of multiple IPCs can be stored in a single data partition, so that more data can be written when the total cache data is less, the writing speed is improved, the memory occupation is reduced, the memory requirement caused by the fact that the storage server can access IPCs is met, the storage efficiency is improved, meanwhile, the data is not written after the IPC cache more data is not needed, the data can be written as soon as possible after the IPC data is received, the real-time performance of data writing is improved, and the risk of data loss caused by power failure is reduced.
Referring to fig. 7, a third embodiment of the present invention further provides a device for implementing storage of a monitoring video, including: at least one processor 11, such as a CPU, at least one network interface 14 or other user interface 13, a memory 15, at least one communication bus 12, the communication bus 12 being used to enable connectivity communications between these components. The user interface 13 may optionally include a USB interface, and other standard interfaces, wired interfaces. The network interface 14 may optionally include a Wi-Fi interface as well as other wireless interfaces. The memory 15 may comprise a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 15 may optionally comprise at least one memory device located remotely from the aforementioned processor 11.
In some embodiments, memory 15 stores the following elements, executable modules or data structures, or a subset thereof, or an expanded set thereof:
an operating system 151, which contains various system programs for implementing various basic services and for processing hardware-based tasks;
and (5) a procedure 152.
Specifically, the processor 11 is configured to call the program 152 stored in the memory 15, and execute the storage implementation method of the monitoring video record according to the foregoing embodiment, for example, step S1 shown in fig. 1. Alternatively, the processor implements the functions of the modules/units in the above device embodiments when executing the computer program, for example, writes to a buffer allocation module.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor to implement the invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the storage-enabled device of the surveillance video.
The storage implementation device of the monitoring video can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The storage implementation device of the monitoring video may include, but is not limited to, a processor and a memory. It will be appreciated by those skilled in the art that the schematic diagram is merely an example of a storage implementation of a surveillance video and is not intended to be limiting, and may include more or fewer components than those shown, or some components in combination, or different components.
The Processor 11 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may be any conventional processor, and the processor 11 is a control center of the storage implementation device of the monitoring video, and various interfaces and lines are used to connect various parts of the storage implementation device of the whole monitoring video.
The memory 15 may be used to store the computer programs and/or modules, and the processor 11 implements various functions of the storage implementation device of the surveillance video by running or executing the computer programs and/or modules stored in the memory and calling up the data stored in the memory. The memory 15 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 (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 15 may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
The storage of the monitoring video realizes the module/unit integrated by the device, and if the module/unit is realized in the form of a software functional unit and sold or used as an independent product, the module/unit can be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
Compared with the prior art, the embodiment of the invention has the beneficial effects that: the read multiple IPC video data are stored in a write-in cache which is pre-allocated with a fixed size, and the multiple IPC video data are allocated to a continuous memory, so that the problem of discontinuous IPC video data is avoided; then when the write-in cache meets a preset condition, reading the stored IPC video data from the write-in cache, and combining the IPC video data read from the write-in cache into a data block; wherein the preset conditions include: the current cache time exceeds a set duration or the write cache is full; when data is written in each time, IPC video data are obtained from all IPC video data caches and combined into a larger data to be written in, and each IPC does not need to have more caches, so that the storage efficiency is improved; writing the data block into a data partition of a hard disk, and generating a data index to be written into an index area of the hard disk; the IPC video data of multiple IPCs can be stored in a single data partition, so that more data can be written when the total cache data is less, the writing speed is improved, the memory occupation is reduced, the memory requirement caused by the fact that the storage server can access IPCs is met, the storage efficiency is improved, meanwhile, the data is not written after the IPC cache more data is not needed, the data can be written as soon as possible after the IPC data is received, the real-time performance of data writing is improved, and the risk of data loss caused by power failure is reduced.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
The fourth embodiment of the present invention further provides a computer-readable storage medium, where the computer-readable storage medium includes a stored computer program, and when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute the storage implementation method of the monitoring video according to any one of the first embodiments.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.

Claims (10)

1. A storage implementation method for a monitoring video is characterized by comprising the following steps:
pre-distributing a write cache;
storing the received IPC video data of a plurality of IPCs into a video data cache;
reading IPC video data from the video data cache, and storing the read IPC video data to the write-in cache;
when the write-in cache meets a preset condition, writing the IPC video data read from the write-in cache into a data partition of a hard disk; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: and the write-in cache is full or the cache time is more than or equal to the set time length.
2. The method for implementing storage of a surveillance video in accordance with claim 1, further comprising:
when the read IPC video data is stored in the write-in cache, the IPC video data which is being written into the write-in cache and the IPC video data which is currently stored in the write-in cache are merged.
3. The method of claim 1, wherein the size of the data partition is k × nGB; wherein n is equal to the maximum IPC number allowed to be accessed by the storage server, and k is a set value.
4. The method for implementing storage of a surveillance video in accordance with claim 1, further comprising:
judging whether the write cache is full;
when the write-in cache is full, confirming that the write-in cache meets the preset condition;
when the write-in cache is not fully written, judging whether the current cache time is more than or equal to the set duration;
when the current cache time is longer than or equal to the set time length, confirming that the write-in cache meets the preset condition;
and when the current cache time is shorter than the set time length, confirming that the write-in cache does not meet the preset condition.
5. The method as claimed in claim 1, wherein said reading IPC video data from said video data cache comprises:
checking whether IPC video data exist in the video data cache;
and when the IPC video data exist in the video data cache, reading the IPC video data stored in the video data cache.
6. The method for implementing storage of a video cassette recorder as claimed in claim 1, wherein said writing the IPC video data read from said write buffer into a data partition of a hard disk comprises:
checking whether the hard disk has a data partition with a residual space;
when the hard disk has a data partition with a residual space, writing the IPC video data into the data partition with the residual space;
when the hard disk does not have a data partition with a residual space, checking whether the hard disk has a blank data partition;
when the hard disk has blank data partitions, writing the IPC video data into the blank data partitions;
when no blank data partition exists in the hard disk, acquiring data writing time of each data partition;
comparing the data writing time of each data partition, and clearing IPC video data stored in the data partition with the earliest data writing time; and writing the IPC video data read out from the write cache into the data partition after the IPC video data is cleared.
7. The method for implementing storage of a surveillance video in accordance with claim 1, further comprising:
searching a data index of any IPC video data within a set time range from the index area;
according to the address information of the data index, reading IPC video data corresponding to the data index from the data partition according to the time sequence;
and sending the read IPC video data to a receiving terminal.
8. A storage implementation device for a monitoring video, comprising:
a write cache allocation module for allocating a write cache in advance;
the data storage module is used for storing the received IPC video data of the IPCs into a video data cache;
the first data writing module is used for reading IPC video data from the video data cache and storing the read IPC video data to the writing cache;
the second data writing module is used for writing the IPC video data read out from the writing cache into a data partition of the hard disk; generating a data index to be written into an index area of the hard disk; wherein the preset conditions include: and the write-in cache is full or the cache time is more than or equal to the set time length.
9. A storage-implemented device for a surveillance video, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the storage-implemented method for a surveillance video according to any one of claims 1-7.
10. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls an apparatus in which the computer-readable storage medium is located to perform the storage implementation method of the monitoring video according to any one of claims 1 to 7.
CN202110068635.5A 2021-01-19 2021-01-19 Method, device and equipment for realizing storage of monitoring video and storage medium Pending CN112954244A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110068635.5A CN112954244A (en) 2021-01-19 2021-01-19 Method, device and equipment for realizing storage of monitoring video and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110068635.5A CN112954244A (en) 2021-01-19 2021-01-19 Method, device and equipment for realizing storage of monitoring video and storage medium

Publications (1)

Publication Number Publication Date
CN112954244A true CN112954244A (en) 2021-06-11

Family

ID=76235685

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110068635.5A Pending CN112954244A (en) 2021-01-19 2021-01-19 Method, device and equipment for realizing storage of monitoring video and storage medium

Country Status (1)

Country Link
CN (1) CN112954244A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113488082A (en) * 2021-07-02 2021-10-08 山东恒宇电子有限公司 Audio and video storage method for embedded equipment mechanical hard disk
CN113688139A (en) * 2021-08-30 2021-11-23 重庆紫光华山智安科技有限公司 Object storage method, gateway, device and medium
CN114363550A (en) * 2022-01-14 2022-04-15 天地伟业技术有限公司 Continuous writing and storage state monitoring method and system for network video recorder
CN114489492A (en) * 2021-12-31 2022-05-13 华能烟台八角热电有限公司 Data storage method, safety device and data storage system
CN115623151A (en) * 2022-12-20 2023-01-17 苏州万店掌网络科技有限公司 Audio and video storage method and network video recording equipment

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR970008108A (en) * 1995-07-22 1997-02-24 김광호 How to handle insufficient tape remaining during scheduled recording
JP2004146005A (en) * 2002-10-25 2004-05-20 Nec Micro Systems Ltd Storage module and sequential access storage device using it
US20090103203A1 (en) * 2007-10-22 2009-04-23 Fujitsu Limited Recording apparatus and control circuit
CN101644996A (en) * 2009-09-25 2010-02-10 杭州华三通信技术有限公司 Storage method of index data and storage control device
CN101968967A (en) * 2010-08-04 2011-02-09 深圳英飞拓科技股份有限公司 Prerecording method used for monitoring equipment
CN104809237A (en) * 2015-05-12 2015-07-29 百度在线网络技术(北京)有限公司 LSM-tree (The Log-Structured Merge-Tree) index optimization method and LSM-tree index optimization system
WO2017015891A1 (en) * 2015-07-29 2017-02-02 深圳市锐明技术股份有限公司 Monitoring data writing method and apparatus
WO2017113888A1 (en) * 2015-12-31 2017-07-06 华为技术有限公司 Device and method for data writing
US20190035067A1 (en) * 2017-07-26 2019-01-31 Canon Kabushiki Kaisha Image data management method, production apparatus, production system, image data management method for production system, and non-transitory computer-readable recording medium
CN109783321A (en) * 2019-01-24 2019-05-21 深圳市景阳信息技术有限公司 Monitoring data management method, device, terminal device
CN110413413A (en) * 2019-07-26 2019-11-05 北京蜜莱坞网络科技有限公司 A kind of method for writing data, device, equipment and storage medium
CN110764706A (en) * 2019-10-25 2020-02-07 普联技术有限公司 Storage system, data management method, and storage medium
WO2020102955A1 (en) * 2018-11-20 2020-05-28 浙江宇视科技有限公司 Monitoring video storage method and apparatus, and video storage device

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR970008108A (en) * 1995-07-22 1997-02-24 김광호 How to handle insufficient tape remaining during scheduled recording
JP2004146005A (en) * 2002-10-25 2004-05-20 Nec Micro Systems Ltd Storage module and sequential access storage device using it
US20090103203A1 (en) * 2007-10-22 2009-04-23 Fujitsu Limited Recording apparatus and control circuit
CN101644996A (en) * 2009-09-25 2010-02-10 杭州华三通信技术有限公司 Storage method of index data and storage control device
CN101968967A (en) * 2010-08-04 2011-02-09 深圳英飞拓科技股份有限公司 Prerecording method used for monitoring equipment
CN104809237A (en) * 2015-05-12 2015-07-29 百度在线网络技术(北京)有限公司 LSM-tree (The Log-Structured Merge-Tree) index optimization method and LSM-tree index optimization system
WO2017015891A1 (en) * 2015-07-29 2017-02-02 深圳市锐明技术股份有限公司 Monitoring data writing method and apparatus
WO2017113888A1 (en) * 2015-12-31 2017-07-06 华为技术有限公司 Device and method for data writing
US20190035067A1 (en) * 2017-07-26 2019-01-31 Canon Kabushiki Kaisha Image data management method, production apparatus, production system, image data management method for production system, and non-transitory computer-readable recording medium
WO2020102955A1 (en) * 2018-11-20 2020-05-28 浙江宇视科技有限公司 Monitoring video storage method and apparatus, and video storage device
CN109783321A (en) * 2019-01-24 2019-05-21 深圳市景阳信息技术有限公司 Monitoring data management method, device, terminal device
CN110413413A (en) * 2019-07-26 2019-11-05 北京蜜莱坞网络科技有限公司 A kind of method for writing data, device, equipment and storage medium
CN110764706A (en) * 2019-10-25 2020-02-07 普联技术有限公司 Storage system, data management method, and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
祖文强;王芳;李焱;万进;: "可配置及历史信息感知的多级缓存策略", 计算机研究与发展, no. 2, 15 December 2015 (2015-12-15) *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113488082A (en) * 2021-07-02 2021-10-08 山东恒宇电子有限公司 Audio and video storage method for embedded equipment mechanical hard disk
CN113688139A (en) * 2021-08-30 2021-11-23 重庆紫光华山智安科技有限公司 Object storage method, gateway, device and medium
CN113688139B (en) * 2021-08-30 2024-03-12 重庆紫光华山智安科技有限公司 Object storage method, gateway, device and medium
CN114489492A (en) * 2021-12-31 2022-05-13 华能烟台八角热电有限公司 Data storage method, safety device and data storage system
CN114489492B (en) * 2021-12-31 2024-01-30 华能烟台八角热电有限公司 Data storage method, safety device and data storage system
CN114363550A (en) * 2022-01-14 2022-04-15 天地伟业技术有限公司 Continuous writing and storage state monitoring method and system for network video recorder
CN115623151A (en) * 2022-12-20 2023-01-17 苏州万店掌网络科技有限公司 Audio and video storage method and network video recording equipment
CN115623151B (en) * 2022-12-20 2023-03-03 苏州万店掌网络科技有限公司 Audio and video storage method and network video recording equipment

Similar Documents

Publication Publication Date Title
CN112954244A (en) Method, device and equipment for realizing storage of monitoring video and storage medium
KR100690804B1 (en) Method for executing garbage collection of mobile terminal
CN108647151A (en) It is a kind of to dodge system metadata rule method, apparatus, equipment and storage medium entirely
CN110688062B (en) Cache space management method and device
CN105763602A (en) Data request processing method, server and cloud interactive system
CN110555001B (en) Data processing method, device, terminal and medium
CN107197359B (en) Video file caching method and device
CN109189772B (en) File management method and system for storage medium without file system
CN108415855A (en) It makes video recording file memory method and device, computer installation and storage medium
CN110727403B (en) Metadata management method and device
US20190026317A1 (en) Memory use in a distributed index and query system
US11907164B2 (en) File loading method and apparatus, electronic device, and storage medium
EP4016276A1 (en) Data deduplication method and apparatus
CN111984204B (en) Data reading and writing method and device, electronic equipment and storage medium
CN112199309B (en) Data reading method and device based on DMA engine and data transmission system
CN111857574A (en) Write request data compression method, system, terminal and storage medium
CN110543435B (en) Mixed mapping operation method, device and equipment of storage unit and storage medium
CN115639971A (en) Data writing method, data writing device, electronic device, storage medium, and program product
CN111803917A (en) Resource processing method and device
CN109144403B (en) Method and equipment for switching cloud disk modes
CN113377278A (en) Solid state disk, garbage recycling and controlling method, equipment, system and storage medium
CN114089912B (en) Data processing method and device based on message middleware and storage medium
CN103064926B (en) Data processing method and device
CN113360095B (en) Hard disk data management method, device, equipment and medium
CN114327260B (en) Data reading method, system, server and storage medium

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