CN108777810B - Video data storage method, device, equipment and storage medium - Google Patents

Video data storage method, device, equipment and storage medium Download PDF

Info

Publication number
CN108777810B
CN108777810B CN201810585472.6A CN201810585472A CN108777810B CN 108777810 B CN108777810 B CN 108777810B CN 201810585472 A CN201810585472 A CN 201810585472A CN 108777810 B CN108777810 B CN 108777810B
Authority
CN
China
Prior art keywords
storage
partition
video data
compression
frame
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
Application number
CN201810585472.6A
Other languages
Chinese (zh)
Other versions
CN108777810A (en
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 CN201810585472.6A priority Critical patent/CN108777810B/en
Publication of CN108777810A publication Critical patent/CN108777810A/en
Application granted granted Critical
Publication of CN108777810B publication Critical patent/CN108777810B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Abstract

The invention discloses a video data storage method, which comprises the following steps: when a request for storing video data is received, judging whether a first storage partition capable of storing all the video data exists in a storage space, wherein the storage space comprises a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to the storage partitions which do not store data, the first storage partition refers to the storage partition which stores partial video data, and the second storage partition refers to the storage partition which stores full video data; if the first storage partition capable of storing all the video data does not exist, the first storage partition is fully stored, and the remaining video data are stored in the idle partition, wherein the remaining video data refer to the video data in all the video data except the video data stored in the first storage partition, so that the dynamic adjustment of the storage partition in the video data storage is realized, and the expansion requirement of the video data storage is met. The invention also provides a video data storage device, equipment and a storage medium.

Description

Video data storage method, device, equipment and storage medium
Technical Field
The present invention relates to the field of video data storage technologies, and in particular, to a method, an apparatus, a device, and a computer-readable storage medium for storing video data.
Background
In a video surveillance system, video playback is an extremely important surveillance service, and therefore, storage of video data becomes a key of the video surveillance system. With the rapid development of semiconductor technology and the general application of high definition, video data in the same time period is larger and larger, the occupied storage space is larger and larger, and the demand for the storage space is higher and higher.
With the continuous progress of hardware technology, the storage space in the storage device is also rapidly increased, that is, although the storage space can be enlarged to meet the storage requirement of rapidly increasing video data, the storage space of a certain storage device is always fixed and limited, and after long-term use, the storage space is still insufficient, and the storage requirement of rapidly increasing video data cannot be met.
In summary, how to utilize the limited storage space to store video data as long as possible to achieve the expansion of the video data storage requirement becomes an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
Embodiments of the present invention provide a video data storage method, apparatus, device, and computer-readable storage medium, which can implement dynamic adjustment of a storage partition in a video data storage process, thereby more conveniently and intelligently implementing extension of a storage duration to meet an extension requirement of video data storage.
In a first aspect of the embodiments of the present invention, a method for storing video data is provided, including:
when a request for storing video data is received, judging whether a first storage partition capable of storing all the video data exists in a storage space, wherein the storage space comprises a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to the storage partitions which do not store data, the first storage partition refers to the storage partition which stores partial video data, and the second storage partition refers to the storage partition which stores full video data;
if the first storage partition capable of storing all the video data does not exist, the first storage partition is filled, and the remaining video data are stored in the idle partition, wherein the remaining video data refer to the video data except the video data stored in the first storage partition in all the video data.
Further, the storage space further comprises a first compression partition and a second compression partition, the first compression partition refers to a storage partition which stores partial I frame data, and the second compression partition refers to a storage partition which stores full I frame data;
when the sum of the number of the first storage subareas and the number of the second storage subareas reaches a preset frame extracting compression threshold value, extracting I frame data from the video data stored in the second storage subareas;
judging whether a first compression partition capable of storing all the I frame data exists in the storage space;
and if the first compression partition capable of storing all the I frame data does not exist, fully storing the first compression partition, and storing the rest I frame data to the idle partition, wherein the rest I frame data refers to the I frame data except the I frame data stored to the first compression partition in all the I frame data.
Preferably, the video data storage method further includes:
and when the sum of the numbers of the first storage partition, the second storage partition, the first compression partition and the second compression partition reaches a preset cycle coverage threshold, deleting all I frame data stored in the second compression partition which is full of I frame data at first.
Optionally, the extracting I frame data from the video data stored in the second storage partition includes:
determining a frame extraction compression ratio according to a preset code stream parameter;
and extracting the I frame data from the video data stored in the second storage partition by using the frame extraction compression ratio.
Further, the extracting I frame data from the video data stored in the second memory partition includes:
acquiring a second storage partition which is full of video data at first;
and extracting the I frame data from the video data stored in the second storage partition which is full of video data firstly.
Preferably, after extracting the I frame data from the video data stored in the second storage partition which is full of video data first, the method further comprises:
and deleting all video data stored in the second storage partition which is full of video data firstly.
Optionally, before receiving the request for storing the video data, the method further includes:
acquiring a preset division rule, and dividing the initial storage space into a plurality of idle partitions according to the preset division rule;
and setting the preset frame extraction compression threshold and the preset cycle coverage threshold according to the number of the idle partitions.
In a second aspect of the embodiments of the present invention, there is provided a video data storage apparatus, including:
the video data storage system comprises a storage partition judging module, a video data storage module and a video data storage module, wherein the storage partition judging module is used for judging whether a first storage partition capable of storing all video data exists in a storage space when a request for storing the video data is received, the storage space comprises a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to the storage partitions which do not store data, the first storage partition refers to the storage partition which stores partial video data, and the second storage partition refers to the storage partition which stores full video data;
and the video data storage module is used for filling up the first storage partition if the first storage partition capable of storing all the video data does not exist, and storing the remaining video data to the idle partition, wherein the remaining video data refers to the video data except the video data stored to the first storage partition in all the video data.
In a third aspect of the embodiments of the present invention, there is provided a video data storage device, including a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the video data storage method according to the foregoing first aspect when executing the computer program.
In a fourth aspect of the embodiments of the present invention, a computer-readable storage medium is provided, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the video data storage method according to the foregoing first aspect.
According to the technical scheme, the embodiment of the invention has the following advantages:
in the embodiment of the invention, when a request for storing video data is received, whether a first storage partition capable of storing all the video data exists in a storage space is judged, wherein the storage space comprises a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to the storage partitions which do not store data, the first storage partition refers to the storage partition which stores partial video data, and the second storage partition refers to the storage partition which stores full video data; if the first storage partition capable of storing all the video data does not exist, the first storage partition is fully stored, and the remaining video data are stored in the idle partition, wherein the remaining video data refer to the video data in all the video data except the video data stored in the first storage partition, so that the dynamic adjustment of the storage partition in the video data storage is realized, the storage duration is more conveniently and intelligently extended, and the extension requirement of video data storage is met.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions 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 to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a system structural diagram of a video data storage system according to an embodiment of the present invention;
fig. 2 is a flowchart of a method for storing video data according to an embodiment of the present invention;
fig. 3 is a schematic flowchart illustrating a frame extraction process performed by a video data storage method in an application scenario according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a video data storage device according to a second embodiment of the present invention;
fig. 5 is a schematic diagram of a video data storage device according to a third embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a video data storage method, a video data storage device, video data storage equipment and a video data storage medium, which are used for realizing dynamic adjustment of storage partitions in a video data storage process, so that the expansion of storage duration is realized more conveniently and intelligently, and the expansion requirement of video data storage is met.
In order to make the objects, features and advantages of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the embodiments described below 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.
As shown in fig. 1, the video data storage system provided by the embodiment of the present invention is provided with a video data storage device for managing a storage space, such as dividing the storage space into a plurality of storage partitions, and reasonably storing the video data input by the input unit into the corresponding storage partitions.
It is to be understood that the video data described in the embodiments of the present invention refers to continuous or discontinuous video data input by the input unit without being decimated or compressed.
A pair of video data storage methods according to an embodiment will be described below based on the above-described video data storage system. As shown in fig. 2, an embodiment of the present invention provides a video data storage method, where the video data storage method includes:
step S201, when a request for storing video data is received, determining whether a first storage partition capable of storing all the video data exists in a storage space, where the storage space includes a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to storage partitions in which data is not stored, the first storage partition refers to a storage partition in which part of the video data is stored, and the second storage partition refers to a storage partition in which video data is stored fully.
Further, in this embodiment, before receiving the request for storing the video data, the method further includes:
and acquiring a preset division rule, and dividing the initial storage space into a plurality of idle partitions according to the preset division rule.
It can be understood that, in this embodiment, before the storage of the video data is performed, the storage space of the storage device may be initialized, that is, the preset partition rule is first obtained, and then the storage space of the storage device is initialized to the plurality of storage partitions according to the preset partition rule, where none of the plurality of storage partitions stores any data initially, that is, all of the storage partitions in the storage space are idle partitions initially. Here, the preset partition rule may be determined according to the size of the storage space in the storage device, for example, 100G of storage space may be equally divided into 100 storage partitions of 1G, but the preset partition rule may also be determined according to actual requirements in this embodiment. It is understood that the storage space in this embodiment may be a continuous storage space, or may be a separate storage space,
it can be understood that, in the data storage process, the storage partitions in the storage space change the storage state according to the actually stored content, for example, when a certain free partition is full of video data, the free partition becomes a second storage partition full of video data; when a certain idle partition stores partial video data, the idle partition is changed into a first storage partition storing partial video data; when the first memory partition is full of video data, the first memory partition also becomes the second memory partition.
In this embodiment, when the input unit inputs video data to the storage space for storage, the video data storage device may determine whether a first storage partition capable of storing all video data exists in the storage space, that is, the video data storage device automatically determines whether the first storage partition not storing full video data in the storage space can store all video data requested to be stored next time, and if so, directly stores all video data requested to be stored this time into the first storage partition; otherwise, step S202 is performed.
Step S202, if there is no first storage partition capable of storing all the video data, the first storage partition is filled, and the remaining video data is stored in the free partition, where the remaining video data is video data of all the video data except the video data stored in the first storage partition.
It can be understood that, in this embodiment, if it is determined that the storage space does not have the first storage partition capable of storing all the video data, that is, the remaining capacity of the first storage partition is not enough to store all the video data, the video data storage device first stores a part of the video data requested to be stored to the first storage partition, so as to fully store the first storage partition, where the first storage partition can be automatically changed into the second storage partition after being fully stored; subsequently, the video data storage apparatus further selects one or more from the free partitions according to the remaining portion of the video data requested to be stored this time, and stores the remaining video data into the selected free partitions. In the selected free partition, the free partition which is filled with the remaining video data becomes the second storage partition, and the free partition which stores the video data but is not filled becomes the first storage partition, into which other video data may be subsequently stored.
It can be understood that, if it is determined that the first storage partition does not exist in the storage space, if the storage space is all free partitions initially, the video data storage apparatus directly selects one or more free partitions to store the video data requested to be stored this time, and automatically changes the selected free partitions according to the occupation of the video data, such as automatically changing to the first storage partition or automatically changing to the second storage partition.
Further, in this embodiment, the storage space further includes a first compressed partition and a second compressed partition, where the first compressed partition refers to a storage partition in which partial I frame data has been stored, and the second compressed partition refers to a storage partition in which I frame data has been stored completely. Accordingly, as shown in fig. 3, the video data storage method further includes:
step S301, when the sum of the numbers of the first storage partition and the second storage partition reaches a preset frame extraction compression threshold, extracting I frame data from the video data stored in the second storage partition.
It can be understood that, in the present embodiment, during the storage process of the video data, the number of each storage partition may be detected and counted in real time, and when it is counted that the sum of the number of the first storage partition and the number of the second storage partition reaches the preset frame extraction compression threshold, the frame extraction operation is started, that is, the key I frame data is extracted from the video data stored in the second storage partition. The preset frame compression threshold may be determined according to the number of storage partitions in the storage space, for example, may be determined according to the number of idle partitions initially divided.
For example, in a specific application, if the number of the idle partitions divided initially is 100, the preset frame extraction compression threshold may be determined to be 50, and in the storage process of the video data, when the number of the first storage partitions counted is 1 and the number of the second storage partitions counted is 49, that is, the sum of the numbers of the first storage partitions and the second storage partitions reaches 50, it is determined that a frame extraction condition is satisfied, and at this time, the frame extraction operation is started.
Further, the extracting I frame data from the video data stored in the second storage partition specifically includes: step a, determining a frame extraction compression ratio according to a preset code stream parameter; and b, extracting the I frame data from the video data stored in the second storage partition by using the frame extraction compression ratio.
It is understood that the frame compression ratio refers to the ratio of the storage time length of the storable I frame data to the storage time length of the storable video data in the same size of storage space, such as 10M storage space, which can store 0.6h of I frame data when used for storing I frame data, and 0.2h of video data when used for storing video data, so that a frame compression ratio of 3 can be obtained at this time. In this embodiment, the frame compression ratio may be determined according to preset code stream parameters such as resolution and code rate, for example, the frame compression ratio may be determined to be 3 or 4 according to specific resolution, so as to perform frame extraction processing on the video data according to 3 or 4, thereby reducing the requirement of the video data on the storage space and extending the storage duration. Here, the preset code stream parameter may be a maximum code stream parameter, an average code stream parameter, a minimum code stream parameter allowed by an input unit in the video data storage system, or another code stream parameter determined according to the code stream parameter allowed by the input unit, and of course, the preset code stream parameter may also be an actual code stream parameter of the video data requested to be stored in the storage space.
Step S302, judging whether a first compression partition capable of storing all the I frame data exists in the storage space.
It can be understood that, in this embodiment, the storage partitions into which the storage space is divided may be used to store video data and may also be used to store extracted I frame data, but each storage partition can store only one type of data, that is, each storage partition can store only video data or only I frame data, where the storage partition storing video data may be a first storage partition or a second storage partition, and the storage partition storing I frame data may be a first compression partition or a second compression partition, where the first compression partition refers to a storage partition that has stored part of I frame data, and the second compression partition refers to a storage partition that has been full of I frame data.
In this embodiment, after the I frame data is extracted, it is further determined whether a first compression partition capable of storing all I frame data exists in the storage space, if so, all the I frame data extracted this time is stored in the first compression partition, and after the storage is completed, if the first compression partition is full of the extracted I frame data, the first compression partition can be automatically changed into a second compression partition; if there is no first compressed partition that can store all I frame data, step S303 is performed.
Step S303, if there is no first compressed partition capable of storing all I frame data, fully storing the first compressed partition, and storing the remaining I frame data to the free partition, where the remaining I frame data is I frame data of all I frame data except the I frame data stored to the first compressed partition.
It can be understood that, if it is determined that the first compression partition capable of storing all I frame data does not exist in the storage space, that is, the remaining capacity of the first compression partition is not enough to store all I frame data, the video data storage device first stores a part of the I frame data extracted this time into the first compression partition, so as to fully store the first compression partition, and the first compression partition can be automatically changed into the second compression partition after being fully stored; subsequently, the video data storage device further selects one or more from the free partition according to the remaining portion of the I frame data extracted this time, and stores the I frame data into the selected free partition. In the selected free partition, the free partition full of I frame data becomes a second compressed partition; the free partition storing the I frame data but not being full becomes the first compressed partition, and other I frame data can be stored into the first compressed partition.
It is understood that, if the first compressed partition does not exist in the storage space, such as when the frame extracting operation is the first frame extracting operation, the video data storage device directly selects one or more of the free partitions to store the I frame data extracted this time, and automatically performs a transformation according to the occupation condition of the I frame data in the selected free partition, such as automatically changing to the first compressed partition or automatically changing to the second compressed partition.
Further, in this embodiment, the extracting I frame data from the video data stored in the second storage partition includes: step c, acquiring a second storage partition which is full of video data at first; and d, extracting the I frame data from the video data stored in the second storage partition which is full of the video data firstly.
It can be understood that, in this embodiment, when the storage space is initialized and the storage of the video data is started, one or more free partitions are selected from the free partitions to store the video data according to the size of the video data each time, for example, when the video data input by the input unit for the first time is small, a free partition may be selected first to store the video data, and in the subsequent video storage for the second time and the third time, after the free partition needs to be fully stored, a new free partition may be selected to store the subsequent video data. Therefore, the frame extraction processing of the present embodiment mainly aims at the old video with low use value, that is, extracts the most core and most critical I frame data from the oldest video data stored in the second storage partition which is full of video data first.
Preferably, after extracting the I frame data from the video data stored in the second storage partition which is full of video data first, the method further comprises:
and deleting all video data stored in the second storage partition which is full of video data firstly.
It should be understood that, in this embodiment, extracting I frame data from the video data stored in the second storage partition in which the video data is first stored fully means performing frame extraction processing on all the video data stored in the second storage partition. Therefore, when the I frame data is extracted from the video data stored in the second storage partition and the extracted I frame data is stored in the first compression partition, so as to keep the basic playback requirement of the oldest video data, all the video data in the second storage partition can be directly deleted, so that the storage space is saved for storing new data, and the purpose of prolonging the storage time is achieved. Here, the second storage partition after deleting all the video data may be automatically changed into a free partition, and may be subsequently used to store the video data, and may also be used to store the extracted I frame data.
Optionally, the video data storage method provided in this embodiment further includes:
and when the sum of the numbers of the first storage partition, the second storage partition, the first compression partition and the second compression partition reaches a preset cycle coverage threshold, deleting all I frame data stored in the second compression partition which is full of I frame data at first.
It is to be understood that the preset loop coverage threshold may be determined according to the number of memory partitions in the memory space, such as the number of free partitions divided at the beginning. Specifically, the preset cyclic coverage threshold may be set to a value smaller than 1 from the number of the initially divided idle partitions, that is, 1 idle partition is reserved when performing cyclic coverage of I frame data, so as to ensure that newly stored video data or newly extracted I frame data can find partition storage. In the embodiment, in the process of storing video data and I frame data, the number of each storage partition and compression partition can be detected and counted in real time, and when the sum of the number of the first storage partition, the number of the second storage partition, the number of the first compression partition and the number of the second compression partition reaches a preset cycle coverage threshold value, a cycle coverage operation is started to be executed, that is, all I frame data stored in the second compression partition which is full of I frame data at first is deleted, the second compression partition which is deleted of I frame data can be automatically changed into an idle partition, and new video data or newly extracted I frame data can be stored subsequently, so that the new video data or I frame data can be stored by covering the oldest data to release the storage space, thereby satisfying the continuously increased storage requirements and extending the storage time.
In the embodiment of the invention, when a request for storing video data is received, whether a first storage partition capable of storing all the video data exists in a storage space is judged, wherein the storage space comprises a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to the storage partitions which do not store data, the first storage partition refers to the storage partition which stores partial video data, and the second storage partition refers to the storage partition which stores full video data; if the first storage partition capable of storing all the video data does not exist, the first storage partition is fully stored, and the remaining video data are stored in the idle partition, wherein the remaining video data refer to the video data in all the video data except the video data stored in the first storage partition, so that the dynamic adjustment of the storage partition in the video data storage is realized, the storage duration is more conveniently and intelligently extended, and the extension requirement of video data storage is met.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
The above mainly describes a video data storage method, and a video data storage apparatus will be described in detail below.
As shown in fig. 4, a second embodiment of the present invention provides a video data storage apparatus, where the video data storage apparatus includes:
a storage partition determining module 401, configured to determine, when a request for storing video data is received, whether a first storage partition capable of storing all the video data exists in a storage space, where the storage space includes a plurality of idle partitions, a first storage partition, and a second storage partition, where the idle partition is a storage partition that does not store data, the first storage partition is a storage partition that already stores part of the video data, and the second storage partition is a storage partition that already stores full video data;
a video data storage module 402, configured to, if there is no first storage partition that can store all the video data, fill up the first storage partition, and store the remaining video data to the idle partition, where the remaining video data refers to video data of all the video data except the video data stored in the first storage partition.
Further, the storage space further comprises a first compression partition and a second compression partition, the first compression partition refers to a storage partition which stores partial I frame data, and the second compression partition refers to a storage partition which stores full I frame data;
accordingly, the video data storage device further comprises:
the I frame data extraction module is used for extracting I frame data from the video data stored in the second storage partition when the sum of the number of the first storage partition and the second storage partition reaches a preset frame extraction compression threshold;
the compression partition judging module is used for judging whether a first compression partition capable of storing all the I frame data exists in the storage space;
and the I frame data storage module is used for filling the first compression partition if the first compression partition capable of storing all the I frame data does not exist, and storing the rest I frame data to the idle partition, wherein the rest I frame data refers to the I frame data except the I frame data stored to the first compression partition in all the I frame data.
Preferably, the video data storage apparatus further includes:
and the I frame data deleting module is used for deleting all I frame data stored in the second compression partition which is full of I frame data at first when the sum of the number of the first storage partition, the second storage partition, the first compression partition and the second compression partition reaches a preset cycle coverage threshold.
Optionally, the I-frame data extraction module includes:
the frame extraction compression ratio determining unit is used for determining a frame extraction compression ratio according to preset code stream parameters;
and the first I frame data extracting unit is used for extracting the I frame data from the video data stored in the second storage partition by using the frame extracting compression ratio.
Further, the I-frame data extraction module includes:
a storage partition acquiring unit configured to acquire a second storage partition which is full of video data first;
and the second I frame data extracting unit is used for extracting the I frame data from the video data stored in the second storage partition which is full of the video data firstly.
Preferably, the video data storage apparatus further includes:
and the video data deleting module is used for deleting all the video data stored in the second storage subarea which is full of the video data at first.
Optionally, the video data storage apparatus further includes:
the storage space dividing module is used for acquiring a preset dividing rule and dividing the initial storage space into a plurality of idle partitions according to the preset dividing rule;
and the threshold setting module is used for setting the preset frame extraction compression threshold and the preset cycle coverage threshold according to the number of the idle partitions.
Fig. 5 is a schematic diagram of a video data storage device according to a third embodiment of the present invention. As shown in fig. 5, the video data storage device 500 of this embodiment includes: a processor 504, a memory 502 and a computer program 503, such as a video data storage program, stored in the memory 502 and executable on the processor 501. The processor 501, when executing the computer program 503, implements the steps in the above-described embodiments of the video data storage method, such as the steps S201 to S202 shown in fig. 2. Alternatively, the processor 501, when executing the computer program 503, implements the functions of each module/unit in the above-described device embodiments, for example, the functions of the modules 401 to 402 shown in fig. 4.
Illustratively, the computer program 503 may be partitioned into one or more modules/units that are stored in the memory 502 and executed by the processor 501 to implement the present 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 503 in the video data storage device 500. For example, the computer program 503 may be divided into a storage partition determining module and a video data storage module, and the specific functions of each module are as follows:
the video data storage system comprises a storage partition judging module, a video data storage module and a video data storage module, wherein the storage partition judging module is used for judging whether a first storage partition capable of storing all video data exists in a storage space when a request for storing the video data is received, the storage space comprises a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to the storage partitions which do not store data, the first storage partition refers to the storage partition which stores partial video data, and the second storage partition refers to the storage partition which stores full video data;
and the video data storage module is used for filling up the first storage partition if the first storage partition capable of storing all the video data does not exist, and storing the remaining video data to the idle partition, wherein the remaining video data refers to the video data except the video data stored to the first storage partition in all the video data.
The video data storage device 500 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The video data storage device may include, but is not limited to, a processor 501, a memory 502. It will be understood by those skilled in the art that fig. 5 is merely an example of a video data storage device 500 and does not constitute a limitation of video data storage device 500 and may include more or fewer components than shown, or some components may be combined, or different components, for example, the video data storage device may also include input output devices, network access devices, buses, etc.
The Processor 501 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 device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 502 may be an internal storage unit of the video data storage apparatus 500, such as a hard disk or a memory of the video data storage apparatus 500. The memory 502 may also be an external storage device of the video data storage device 500, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), etc. provided on the video data storage device 500. Further, the memory 502 may also include both an internal storage unit and an external storage device of the video data storage device 500. The memory 502 is used to store the computer programs and other programs and data required by the video data storage device. The memory 502 may also be used to temporarily store data that has been output or is to be output.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art would appreciate that the modules, elements, and/or method steps of the various embodiments described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may 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.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (8)

1. A video data storage method, comprising:
initializing the storage space of the storage device;
when a request for storing video data is received, judging whether a first storage partition capable of storing all the video data exists in a storage space, wherein the storage space comprises a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to the storage partitions which do not store data, the first storage partition refers to the storage partition which stores partial video data, and the second storage partition refers to the storage partition which stores full video data; in the data storage process, the storage partitions in the storage space transform the storage state according to the actually stored content;
if the first storage partition capable of storing all the video data does not exist, storing the first storage partition fully, and storing the remaining video data to the idle partition, wherein the remaining video data refers to the video data of all the video data except the video data stored to the first storage partition;
the storage space further comprises a first compression partition and a second compression partition, the first compression partition refers to a storage partition which stores partial I frame data, and the second compression partition refers to a storage partition which stores full I frame data;
when the sum of the number of the first storage subareas and the number of the second storage subareas reaches a preset frame extracting compression threshold value, extracting I frame data from the video data stored in the second storage subareas;
judging whether a first compression partition capable of storing all the I frame data exists in the storage space;
if the first compression partition capable of storing all the I frame data does not exist, the first compression partition is fully stored, and the rest I frame data is stored in the idle partition, wherein the rest I frame data refers to the I frame data except the I frame data stored in the first compression partition in all the I frame data;
and when the sum of the numbers of the first storage partition, the second storage partition, the first compression partition and the second compression partition reaches a preset cycle coverage threshold, deleting all I frame data stored in the second compression partition which is full of I frame data at first.
2. The method of claim 1, wherein said extracting I frame data from the video data stored in the second memory partition comprises:
determining a frame extraction compression ratio according to a preset code stream parameter;
and extracting the I frame data from the video data stored in the second storage partition by using the frame extraction compression ratio.
3. The method of claim 2, wherein said extracting I frame data from the video data stored in the second memory partition comprises:
acquiring a second storage partition which is full of video data at first;
and extracting the I frame data from the video data stored in the second storage partition which is full of video data firstly.
4. The video data storage method according to claim 3, further comprising, after extracting the I frame data from the video data stored in the second memory partition which is full of video data first:
and deleting all video data stored in the second storage partition which is full of video data firstly.
5. The video data storage method of claim 1, further comprising, prior to receiving the request to store video data:
acquiring a preset division rule, and dividing the initial storage space into a plurality of idle partitions according to the preset division rule;
and setting the preset frame extraction compression threshold and the preset cycle coverage threshold according to the number of the idle partitions.
6. A video data storage apparatus, comprising:
the video data storage system comprises a storage partition judging module, a video data storage module and a video data storage module, wherein the storage partition judging module is used for judging whether a first storage partition capable of storing all video data exists in a storage space when a request for storing the video data is received, the storage space comprises a plurality of idle partitions, a first storage partition and a second storage partition, the idle partitions refer to the storage partitions which do not store data, the first storage partition refers to the storage partition which stores partial video data, and the second storage partition refers to the storage partition which stores full video data; in the data storage process, the storage partitions in the storage space transform the storage state according to the actually stored content; before storing video data, initializing the storage space of the storage device;
the video data storage module is used for filling up the first storage partition if the first storage partition capable of storing all the video data does not exist, and storing the remaining video data to the idle partition, wherein the remaining video data refers to the video data of all the video data except the video data stored to the first storage partition;
the storage space further comprises a first compression partition and a second compression partition, the first compression partition refers to a storage partition which stores partial I frame data, and the second compression partition refers to a storage partition which stores full I frame data;
the video data storage device further comprises:
the I frame data extraction module is used for extracting I frame data from the video data stored in the second storage partition when the sum of the number of the first storage partition and the second storage partition reaches a preset frame extraction compression threshold;
the compression partition judging module is used for judging whether a first compression partition capable of storing all the I frame data exists in the storage space;
the I frame data storage module is used for filling the first compression partition if the first compression partition capable of storing all the I frame data does not exist, and storing the rest I frame data to the idle partition, wherein the rest I frame data refers to the I frame data except the I frame data stored to the first compression partition in all the I frame data;
and the I frame data deleting module is used for deleting all I frame data stored in the second compression partition which is full of I frame data at first when the sum of the number of the first storage partition, the second storage partition, the first compression partition and the second compression partition reaches a preset cycle coverage threshold.
7. A video data storage device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the video data storage method according to any one of claims 1 to 5 when executing said computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a video data storage method according to any one of claims 1 to 5.
CN201810585472.6A 2018-06-08 2018-06-08 Video data storage method, device, equipment and storage medium Active CN108777810B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810585472.6A CN108777810B (en) 2018-06-08 2018-06-08 Video data storage method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810585472.6A CN108777810B (en) 2018-06-08 2018-06-08 Video data storage method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN108777810A CN108777810A (en) 2018-11-09
CN108777810B true CN108777810B (en) 2021-12-31

Family

ID=64025944

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810585472.6A Active CN108777810B (en) 2018-06-08 2018-06-08 Video data storage method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN108777810B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109557937B (en) * 2018-12-07 2021-07-09 江西洪都航空工业集团有限责任公司 Multi-cycle data storage and playback method for flight simulator
CN109951665A (en) * 2019-03-18 2019-06-28 浙江大华技术股份有限公司 Storage method, device, storage medium and the electronic device of video data
CN113010116A (en) * 2021-03-23 2021-06-22 深圳市元征科技股份有限公司 Data processing method and device, terminal equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1592017B1 (en) * 1994-10-31 2009-10-14 Sony Corporation Recording and reproduction of video signals
CN101753936A (en) * 2008-12-08 2010-06-23 北京中星微电子有限公司 Configuration method of storage space and video server for video monitoring system
CN103826078A (en) * 2014-03-11 2014-05-28 深圳瑞信视讯技术有限公司 Linear storage method, device and terminal for video data
CN106527984A (en) * 2016-11-02 2017-03-22 郑州云海信息技术有限公司 Storage method and system used for solid state disk

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101308479A (en) * 2007-05-18 2008-11-19 鸿富锦精密工业(深圳)有限公司 Data memory apparatus and its data storage method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1592017B1 (en) * 1994-10-31 2009-10-14 Sony Corporation Recording and reproduction of video signals
CN101753936A (en) * 2008-12-08 2010-06-23 北京中星微电子有限公司 Configuration method of storage space and video server for video monitoring system
CN103826078A (en) * 2014-03-11 2014-05-28 深圳瑞信视讯技术有限公司 Linear storage method, device and terminal for video data
CN106527984A (en) * 2016-11-02 2017-03-22 郑州云海信息技术有限公司 Storage method and system used for solid state disk

Also Published As

Publication number Publication date
CN108777810A (en) 2018-11-09

Similar Documents

Publication Publication Date Title
CN108777810B (en) Video data storage method, device, equipment and storage medium
CN110704202B (en) Multimedia recording data sharing method and terminal equipment
CN107153620B (en) Data processing method and device
CN111681291A (en) Image processing method, device, equipment and computer readable storage medium
CN107155093B (en) Video preview method, device and equipment
CN111177025B (en) Data storage method and device and terminal equipment
CN105163135B (en) Method for down loading, apparatus and system and the mobile terminal of Internet resources
CN110895524B (en) Composite overdue method, device, server and storage medium of full-load redis time key
US20170308546A1 (en) File storage method and electronic device
CN107659509B (en) Application flow use control method and device, readable storage medium and terminal equipment
CN111104178A (en) Dynamic library loading method, terminal device and storage medium
CN109086105A (en) A kind of page layout conversion method, device and electronic equipment
CN108632624B (en) Image data processing method and device, terminal equipment and readable storage medium
CN111352957A (en) Remote dictionary service optimization method and related equipment
CN109088636B (en) Data processing method and system, electronic equipment and storage medium
CN109165712A (en) Distributed generation method, device and computer storage medium by stages number
CN112565886A (en) Video frame extraction method and device, electronic equipment and readable storage medium
CN108765503B (en) Skin color detection method, device and terminal
CN116541174A (en) Storage device capacity processing method, device, equipment and storage medium
CN109150593B (en) Method and device for managing resources in cloud data system
CN105898399A (en) Video resource loading method and device and smart television
CN112675535B (en) Display interface adjusting method, device, network equipment and storage medium
CN113377295B (en) Data storage and reading method, device and equipment for multi-producer single-consumer
CN111294377A (en) Network request sending method of dependency relationship, terminal device and storage medium
CN109597683B (en) Memory management method, device, equipment 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
GR01 Patent grant
GR01 Patent grant