CN104866239B - A kind of video storage method of high availability - Google Patents

A kind of video storage method of high availability Download PDF

Info

Publication number
CN104866239B
CN104866239B CN201510278305.3A CN201510278305A CN104866239B CN 104866239 B CN104866239 B CN 104866239B CN 201510278305 A CN201510278305 A CN 201510278305A CN 104866239 B CN104866239 B CN 104866239B
Authority
CN
China
Prior art keywords
disk
video
block file
group
raid5
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
CN201510278305.3A
Other languages
Chinese (zh)
Other versions
CN104866239A (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.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview 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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201510278305.3A priority Critical patent/CN104866239B/en
Publication of CN104866239A publication Critical patent/CN104866239A/en
Application granted granted Critical
Publication of CN104866239B publication Critical patent/CN104866239B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Television Signal Processing For Recording (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The present invention provides a kind of video storage method of high availability, and this method includes:In each RAID5 bands, each video I frames group is sequentially stored according to the sequence of disk in band in each disk;Wherein, each video I frame groups only belong to a disk, and several video I frames group serial numbers stored on single disk in band are discontinuous.The present invention program is by I frame group separate storages on a disk in RAID5, and introduce intertexture video recording storage mode, to under RAID5 array damaged conditions, prevent the whole of Video data in each interval time section from losing as possible, to ensure that the availability of storage data to greatest extent.

Description

A kind of video storage method of high availability
Technical field
The present invention relates to technical field of memory more particularly to a kind of video storage methods of high availability.
Background technology
Video data reliability in video monitoring is a very key technology, and key is played for ex-post analysis case Effect.At present in video monitoring, common Video data reliability engineering is realized using disk redundancy technology RAID5 arrays.It should Technology can ensure to keep the integrality of video recording in one piece of hard disk corruptions.But when disk failures are to two pieces or more Afterwards, then complete array data can not be recovered by redundancy magnetic disk.For RAID5, since data are connected by striped patterns Continuous sequential storage, it is intermittent so as to cause the data of reading.There is certain dependence between vedio data, when some It waits, although reading section video data, but still the loss of entire data may be caused.
Invention content
In view of this, the present invention provides a kind of video storage method of high availability.
This method includes:In each RAID5 bands, by each video I frames group according to disk in band sequence successively It is stored in each disk;Wherein, each video I frame groups only belong to a disk, and if being stored on single disk in band Dry video I frames group serial number is discontinuous.
Preferably, one block file of the single disk storage in each band, which stores a block file group, described Block file includes:Superblock and data.
Preferably, which includes:Block file group ID, block file serial number, video time started and video end time.
Preferably, unit is stored distribution and recycling to each block file group as a whole.
Preferably, each block file group is made a summary with block file group, the correlation of the block file group summary record block file group Information, and the unique band for being directed toward RAID5 arrays of block file group abstract.
Preferably, in video frequency searching, corresponding block file group is retrieved according to retrieval time;When need to retrieve in block file group When the block file in portion, compares retrieval time and the I frame group times in block file successively, carry out the positioning of video.
Preferably, when the disk failures quantity of the RAID5 arrays reaches two pieces or two pieces or more, ignore the damage Disk and verification disk, the block file that the item of remaining disk is taken form block file group, carry out video recording storage and video retrieval And playback.
Preferably, the size of the block file is 256M or 128M.
Preferably, the RAID5 bands are the RAID5 bands of NVR device builds, and the video data is what IPC was transmitted Monitor video data.
Compared to the prior art, the present invention program is by I frame group separate storages on a disk in RAID5, and draws Enter to interweave video recording storage mode, under RAID5 array damaged conditions, prevent number of recording a video in each interval time section as possible According to it is whole lose, to ensure that the availability of storage data to greatest extent.
Description of the drawings
Fig. 1 is existing RAID array figure.
Fig. 2 is a kind of block file group video frame group storage mode figure.
Fig. 3 is block file group distribution map.
Fig. 4 is block file internal structure chart.
Fig. 5 is a kind of video recording organizational form figure.
Fig. 6 is a kind of RAID0+ array of figure.
Specific implementation mode
The technical issues of to solve to mention in background technology, the present invention provide a kind of high availability video storage scheme.This Scheme of the invention utilizes in video record data dependency and sequential storage feature in I frame groups, by each I frames group separate storage in On a disk of RAID5, each across polydisc storage of I frames group is avoided, to ensure that each I frames group is only associated with a disk.When When number of disks in RAID5 arrays is damaged more than two pieces or more, the video data in RAID5 array residue disks keeps phase To complete, the decoding that can remain valid plays, to remain Video data as far as possible for user.Pass through each I frames simultaneously Group carries out sequential interleaved storage by the sequence of positions of disk in RAID5 arrays.In this way, as long as the remaining disk in RAID5 is more than Equal to two pieces disks, you can the video recording for avoiding the occurrence of some period is integrally lost.It is described in detail below by way of specific embodiment.
It please join existing RAID5 storage organizations shown in FIG. 1.RAID5 arrays are generally by n (n>=3) block disk forms, Every piece of disk size in RAID5 arrays is equal.RAID5 arrays can to every piece of disk with the space demarcation interval of fixed size, The same position section of each disk forms a band, and each section is referred to as band block, and each band is by n-1 data strip Block and a verification band block composition, each band block size are identical.
The embodiment of the present invention is when storing video data, and in each RAID5 bands, each video I frame groups are pressed It is sequentially stored in each disk according to the sequence of disk in band;Wherein, each video I frame groups only belong to a disk, and item It is discontinuous with several video I frames group serial numbers stored on interior single disk.
It please join Fig. 2, which gives the RAID5 arrays of 8 pieces of disks.Video I frame groups are being stored in the RAID5 When array stripe n, I frame group 1~I frames group 7 is respectively stored in 1~disk of disk 7 in band n, I frame group 8~I frame groups 14 are respectively stored in 1~disk of disk 7 in band n;I frame group 15~I frames group 21 stores 1~magnetic of disk in band n respectively Disk 7, and so on.Each I frame groups only belong to a disk, i.e., will not the video data of an I frame group be stored in two simultaneously On a and more than two disks.Such as I frames group 1 only belongs to disk 1, I frames group 2 only belongs to disk 2.Single disk in band The video I frame group serial numbers of upper storage are discontinuous.Such as band n disks 1 include I frames group 1, I frames group 8, I frames group 15 etc.;Band N disks 2 include I frames group 2, I frames group 9, I frames group 16 etc..XOR operation is carried out to the data of 1~disk of disk 7 in band n to obtain Verification data on band n disks 8.RAID5 arrays of the present invention are can be seen that in video monitoring number from above-mentioned storage mode When according to being stored, no longer the concept with band block, data will not be brushed by under on each disk according to a band.
Since the I frames group of the embodiment of the present invention will not be across disk storage, the I frames group in healthy disk will not be by failure The influence of disk can be played by decoding.Simultaneously as the I frame group Laden Balances of each data disk, therefore be not in certain The whole loss recorded a video in a period only will appear interval I frame groups and play.This storage mode is to be directed to video monitoring data The characteristics of the storage mode designed and general RAID5 array storing datas be essentially different.
The storage mode of the above video data is particluarly suitable for executing in NVR equipment.The monitor video number of IPC equipment shooting After being sent to NVR equipment, NVR equipment executes the storage of video data according to above-mentioned storage mode.
In order to be better achieved the independence of every piece of Video data on every piece of disk in RAID5 arrays, in each band The size of disk storage space can be configured by the block file size of separate storage;As the block file size of storage is 256MB, then a disk storage space size is configured by 256MB in the band of RAID5 arrays.Such set-up mode, It ensure that the independence of overall data in block file, it can be independent of the data of other disks in band, to ensure block file In data directory and Video data integrality, be convenient for follow-up playing back videos.
It please join Fig. 3, the blocks of files in each band on each disk forms a block file group, and unit as a whole Carry out storage distribution and recycling.The sequence for the block file that each item takes is identical as the sequence of positions of RAID5 array mid-games, intermediate Skip check disk.For example there are 5 disks in band 1:1~disk of disk 5, wherein disk 1 are verification disk, and block file 1 is deposited Storage is in disk 2, and block file 2 is stored in disk 3, and block file 3 is stored in disk 4, and block file 4 is stored in disk 5.Each item takes Each block file it is upper relatively independent in video recording storage, i.e., each video I frames group can only belong to each block file, and cannot be across block File stores.
It please join block file structure chart shown in Fig. 4.Each block file includes superblock and video data two parts.It is wherein super Grade block includes the information such as a UUID field, block file serial number, channel number, video recording time started, video recording end time.UUID Field is block file group number, the block file group ID for uniquely indicating certain band composition;Block file serial number indicates the block file Sequence number in file group;Channel number uniquely indicates that the Video data belongs to that recording channel (if storage device is only deposited The Video data in a channel is stored up, then channel number can be omitted).
Each block file group carries out video retrieval and playback as a whole, is made a summary with block file group and is carried out to be aligned Description;Each unique band being directed toward in RAID5 arrays of block file group abstract, i.e. block file group, as shown in Figure 5.Such as Say that block file group abstract describes the relevant information of the block file group, and is directed toward for the block file group that UUID is abc The band n of the corresponding block file group of RAID5 arrays (including N number of disk), 1~block file of block file for being associated in band n N-1.Here block file 1, block file N-1 is block file serial number.Channel is recorded a video with one day as a directory node, and is worked out It is managed at video directory chained list.Such as video recording description in i-th day, the video recording description of jth day in Fig. 5.Daily catalogue then should All block file groups form a chained list to be managed in chronological order in it.If it is logical that storage device has accessed several The video in road then also needs to setting channel control block, the storage for controlling each channel video data in the storage device.
In video frequency searching, corresponding block file group is retrieved according to retrieval time;When the block inside block file group need to be retrieved When file, compares retrieval time and the I frame group times in block file successively, carry out the final positioning of video.Such as it to retrieve 00 00 video recording for dividing 00 second this hour when dividing 00 second~2015 on January 2,01 when 2 days 00 January in 2015, if UUID is The file group of xyz just has recorded the video recording of this hour, then the video recording of this document group is searched video recording;If wanted 00 10 divides video recording in 00 second when dividing 00 second~2015 on January 2,00 when retrieving 2 days 00 January in 2015, then finding UUID first is Then the file group of xyz determines whether the time of I frame groups in each blocks of files belongs to the time to be retrieved in this document group Otherwise section is not belonging to video recording to be found if it is, the I frame groups are video recording to be found.
For the high reliability of the present invention program, further illustrated again by an example below.
When the disk number of RAID5 arrays damages 2 pieces or more, which will be in array distress condition.Each item Data on the check block of band can not continue to play a role, and will directly be ignored, i.e., the data on check block will not be both read, Verification data will not be continued to write to.At this point, RAID5 arrays will be converted into a kind of modified RAID0 arrays, come with RAID0+ It indicates.The RAID0+ and standard RAID0 is distinguished as needing to ignore check disk, while being also required to ignore to the disk damaged.It please join Fig. 6, which includes 5 pieces of disks, when damaging that only disk 1,3,5 is available, by RAID0+ array managements module into Row management.Block file on disk 1 and disk 3 can only be formed a block file group, continued by RAID0+ for band m Video recording storage and video retrieval and playback, and carry out check disk and the disk of other damages to ignore processing.And RAID0+ is for item Block file on disk 1, disk 3, disk 5 can be formed a block file by band n since check disk is on the disk of damage Group.
Although 2 pieces of the hard disk corruptions of above-mentioned RAID5 arrays and make array damage, since I frames group will not be across magnetic Disk storage, therefore the influence of the video I frame groups disk without damage in each block file in normal disk, can continue to be decoded It plays.Simultaneously because I frames group presses block file serial number Laden Balance in block file group, as long as therefore the disk in RAID5 arrays Data are not damaged all, then are not in the whole loss recorded a video in some period, and the interval that only will appear I frame groups is lost. By taking Fig. 6 as an example, if I frames group (the I frames of serial number 4n+1 (n is since 0 until a certain value) are stored on the block file 1 of band m Group 1, I frames group 5, I frames group 9 ...), then the I frame groups of serial number 4n+2, the block of band m are stored on the block file 2 of band m The I frame groups of serial number 4n+3 are stored on file 3, and the I frame groups of serial number 4n+4 are stored on the block file 4 of band m.Due to magnetic Disk 2 and disk 4 damage, so when the video recording of a period of time of follow-up play since I frames group 1, the I frames group 1 of serial number 4n+1 With need the I frame groups for 4n+3 to will be decoded broadcasting, i.e. I frames group 1, I frames group 3, I frames group 5, I frames group 7, I frames group 9 ... To be played by decoding.Likewise, for the example of Fig. 2, if disk 2 and disk 3 damage, follow-up I frames group 1,4~I of I frame groups Frame group 8, I frame group 11~I frames group 15, I frame group 18~I frames group 22 ... can be played by decoding, and loss is only serial number 7n+ The I frame groups of 2 and 7n+3 (n is since 0 until a certain value).What is be only spaced in this way is lost some I frame groups, has avoided the occurrence of whole The whole of section video recording lose.In some cases, such as the entrance of personnel, several seconds may be continued, video per second is spaced and loses It loses, will not be by too much influence for analysis of cases, therefore greatly improve availability.
It is essentially identical with the storage mode of former RAID5 for the follow-up video recording storage on RAID0+.Or by item bring into Row block file group management, difference mainly can skip the disk and check disk damaged when I frame groups store, to ensure video recording Continue to store.
The present invention program introduces intertexture video recording storage side by I frame group separate storages on a disk in RAID5 Formula, under RAID5 array damaged conditions, prevent the whole of Video data in each interval time section from losing as possible, from And it ensure that the availability of storage data to greatest extent.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all essences in the present invention With within principle, any modification, equivalent substitution, improvement and etc. done should be included within the scope of protection of the invention god.

Claims (6)

1. a kind of video storage method of high availability, which is characterized in that this method includes:It, will be every in each RAID5 bands A video I frames group is sequentially stored according to the sequence of disk in band in each disk;Wherein, each video I frame groups only belong to One disk, and several video I frames group serial numbers stored on single disk in band are discontinuous;
One block file of single disk storage in each band, the band store a block file group, and the block file includes: Superblock and data;
Unit is stored distribution and recycling to each block file group as a whole;
When the disk failures quantity of the RAID5 arrays reaches two pieces or two pieces or more, ignore the damage disk and verification Disk, the block file that the item of remaining disk is taken form block file group, carry out video recording storage and video retrieval and playback.
2. the method as described in claim 1, which is characterized in that the superblock includes:Block file group ID, it block file serial number, regards Frequency time started and video end time.
3. the method as described in claim 1, which is characterized in that each block file group is made a summary with block file group, the block file The relevant information of group summary record block file group, and the unique band for being directed toward RAID5 arrays of block file group abstract.
4. the method as described in claim 1, which is characterized in that in video frequency searching, corresponding piece is retrieved according to retrieval time File group;When the block file inside block file group need to be retrieved, compare retrieval time and the I frame group times in block file successively, Carry out the positioning of video.
5. the method as described in claim 1, which is characterized in that the size of the block file is 256M or 128M.
6. the method as described in claim 1, which is characterized in that the RAID5 bands are the RAID5 bands of NVR device builds, The video data is the monitor video data that IPC is transmitted.
CN201510278305.3A 2015-05-26 2015-05-26 A kind of video storage method of high availability Active CN104866239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510278305.3A CN104866239B (en) 2015-05-26 2015-05-26 A kind of video storage method of high availability

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510278305.3A CN104866239B (en) 2015-05-26 2015-05-26 A kind of video storage method of high availability

Publications (2)

Publication Number Publication Date
CN104866239A CN104866239A (en) 2015-08-26
CN104866239B true CN104866239B (en) 2018-09-14

Family

ID=53912103

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510278305.3A Active CN104866239B (en) 2015-05-26 2015-05-26 A kind of video storage method of high availability

Country Status (1)

Country Link
CN (1) CN104866239B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107197324B (en) * 2017-05-15 2020-11-20 苏州浪潮智能科技有限公司 Video fault tolerance method and device of distributed file system
CN110515761B (en) * 2018-05-22 2022-06-03 杭州海康威视数字技术股份有限公司 Data acquisition method and device
CN112241238B (en) * 2019-07-18 2023-12-05 深圳市茁壮网络股份有限公司 Data exception handling method and device, storage medium and computer equipment
CN111007992B (en) * 2020-03-04 2020-08-04 广东电网有限责任公司佛山供电局 Disk data storage representation method, system and storage medium
CN111506259B (en) * 2020-03-20 2023-06-06 普联技术有限公司 Data storage method, data reading method, data storage device, data reading apparatus, data storage device, and readable storage medium
CN116301660B (en) * 2023-05-10 2023-08-22 深圳创新科技术有限公司 Video recording and writing method, device, equipment and medium based on raid

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976176A (en) * 2010-08-19 2011-02-16 北京同有飞骥科技有限公司 Method for constructing disk array of horizontal grouping parallel distribution check
CN103037203A (en) * 2012-12-11 2013-04-10 浙江宇视科技有限公司 Method and device for index recovery based on block storage

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI384413B (en) * 2006-04-24 2013-02-01 Sony Corp An image processing apparatus, an image processing method, an image processing program, and a program storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976176A (en) * 2010-08-19 2011-02-16 北京同有飞骥科技有限公司 Method for constructing disk array of horizontal grouping parallel distribution check
CN103037203A (en) * 2012-12-11 2013-04-10 浙江宇视科技有限公司 Method and device for index recovery based on block storage

Also Published As

Publication number Publication date
CN104866239A (en) 2015-08-26

Similar Documents

Publication Publication Date Title
CN104866239B (en) A kind of video storage method of high availability
US6934700B1 (en) File systems supported data sharing
US7676141B2 (en) Recording apparatus and recording method
CN109542342B (en) Metadata management and data reconstruction method, equipment and storage medium
US8495470B2 (en) Efficient rewrite technique for tape drives
CN107229418A (en) A kind of video file storage method and device
CN101008919A (en) Audio/video data access method and device based on raw device
CN102508733B (en) A kind of data processing method based on disk array and disk array manager
CN103226965A (en) Time-bitmap-based audio/video data access method
TW200501561A (en) Recording method, recorder, recording medium, reproduction method, reproduction apparatus, and camera
CN103546698A (en) Mobile terminal record video preservation method and device
KR101743411B1 (en) Method and apparatus for data access
CN103731625A (en) Method for simultaneously and synchronously playing multiple paths of audios and videos
CN104572764A (en) Multi-channel video data reading and writing method
CN103970869A (en) Large file storage method
Han et al. Analysis of the HIKVISION DVR file system
WO2010034990A2 (en) Program content recovery for multimedia devices and digital video recorder set-top boxes
CN105653385A (en) Vehicle-loaded videorecording method
CN105094704B (en) A kind of method and apparatus of high scalability RAID array storage video monitoring data
JP2006528862A (en) Optimizing stored video data
KR100950011B1 (en) System for managementing video data and method thereof
CN103198102A (en) Transfer method and device of Android equipment internal hard disk file system
CN110427282A (en) The method, apparatus and computer-readable medium restored for log fragment
CN109521961B (en) Method and system for improving read-write performance of solid state disk
Lu et al. A method of time code retrieval for special format surveillance video based on file header comparison

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant