CN101539884B - Method and device for data storage - Google Patents

Method and device for data storage Download PDF

Info

Publication number
CN101539884B
CN101539884B CN2009101361612A CN200910136161A CN101539884B CN 101539884 B CN101539884 B CN 101539884B CN 2009101361612 A CN2009101361612 A CN 2009101361612A CN 200910136161 A CN200910136161 A CN 200910136161A CN 101539884 B CN101539884 B CN 101539884B
Authority
CN
China
Prior art keywords
file
grade
folder
passage
grade file
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
CN2009101361612A
Other languages
Chinese (zh)
Other versions
CN101539884A (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.)
New H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN2009101361612A priority Critical patent/CN101539884B/en
Publication of CN101539884A publication Critical patent/CN101539884A/en
Application granted granted Critical
Publication of CN101539884B publication Critical patent/CN101539884B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for data storage. The method comprises the following steps of: assigning a first-level file folder for an established channel in a plurality of established first-level file folders; assigning a secondary-level file folder in a plurality of established secondary-level file folders under the first-level file folders; and establishing a file with a fixed size used for storing the data in the channel. In the invention, the form of assigning multilevel file folders for the channel realizes the data storage in the channel, which has no need to spend large amount of time for pre-establishing a file at the very start; and the form also realizes the dynamic addition and deletion, and the dynamic expansion or reduction of the capacity of the storage channel. Furthermore, by cycle overwriting of the files with fixed sizes, the invention completely avoids the generation of the file fragmentation, thus leading the storage performance of arrays or disks to have no reduction with the increasing of the service time.

Description

Date storage method and device
Technical field
The present invention relates to networking technology area, relate in particular to a kind of date storage method and device.
Background technology
Along with expanding economy is increasingly high to the demand of security protection; Video monitoring is as the important component part of safety-security area; Also obtain develop rapidly in recent years, developed into the video monitoring system of present digitizing, many sites, multi-field, big data quantity from early stage specific area dedicated system.
The technology of video monitoring mainly comprises audio-video collection, data readback and data storage.The basic functional principle of video monitoring system is to utilize camera/video camera to obtain video information, is encoded by scrambler, the video data digitizing again.Digitized video data can also store earlier except being used for real-time monitoring, supplies follow-up playback.
The topmost purpose of video monitoring be the record previous event, so data storage in a major function of video monitoring, its stability has determined the stability of whole video supervisory system.
Current in field of video monitoring, the storage mode of most of audio, video datas is on array or disk, to create file system.Network encoder or DVR read, write the management of all passing through file system to audio, video data.Because file system is the management system of a logic, it has shielded discontinuous difference on the file data physical presence hard disk, and it all is continuous that file is seemed.The deletion that does not stop, the position that the establishment file that does not stop can make file data reality on hard disk, store is more and more discontinuous. and discontinuous as time passes probability is just high more, has promptly produced the file system fragment.File fragmentation is more will to make the frequent tracking of disk, and memory property can descend, and requires memory device to have stable disk read-write performance in the monitoring storage, so in the monitoring storage, must solve the problem of file system fragment.
Date storage method in a kind of video monitoring system is provided in the prior art.It earlier with array or formatting hard disk, all writes all arrays or hard disk the file (for example array size is 8T, and the glue file size is 100M, then need write 83886 files) of full fixed size again after having created file system when system initialization; The storage space (for example equipment has 10 passages, then the glue file of 8T/10=819G size is distributed to each passage) of distributing fixed size then for fixing memory channel.Zone of specific assigned in storage space (for example reserving the 1G space for each passage) is used for the glue file that management channels distributes, and is used for representing that which passage file belongs to, whether this document is being stored, whether is storing information such as full.After a memory channel all was filled with, removing to search which file according to management area (refer to just now to reserve for each passage 1G space) can specifically cover, and then carried out write operation after finding this document.
There is following problem in implementation of the prior art: adopt a series of complex data structures and special-purpose management area that glue file is managed, realize complicated and the waste storage space.In addition, when initialized, need all arrays or hard disk are all write the file of full fixed size, and at present in the supervisory system capacity of a memory device all finish writing file and will consume the plenty of time basically more than 8T.In addition, because memory capacity all is that fixed allocation is given memory channel, therefore do not support the dynamic interpolation and the deletion of memory channel.
Summary of the invention
The present invention provides a kind of date storage method and device, is used for when reducing file fragmentation, safeguarding storage device performance, realizing the efficient and easy management to video monitoring system file data.
For achieving the above object, the present invention provides a kind of date storage method, comprising:
In a plurality of first grade file folders of having set up, be first grade file folder of channel allocation of having created;
In a plurality of second grade file folders of under said first grade file folder, having set up, distribute a second grade file folder;
Under said second grade file folder, set up the file of a fixed size, be used for the storage of said passage data.
Wherein, said in a plurality of first grade file folders of having set up, before first grade file folder of channel allocation of having created, also comprise:
In the root directory of storage space, set up a plurality of first grade file folders, under each first grade file folder, create a plurality of second grade file folders; The name of said a plurality of first grade file folders is called first grade file and presss from both sides initial title and different; The name of said a plurality of second grade file folders is called second grade file and presss from both sides initial title and different;
In storage space, set up the fixed block file of a free time.
Wherein, also comprise:
For a first grade file folder of the channel allocation created back, before said second grade file folder is set up the file of a fixed size down, said first grade file for the channel allocation created pressed from both sides carry out rename;
Before in a plurality of second grade files folders that said first grade file folder has been set up down, distributing a second grade file folder back, under said second grade file folder, setting up the file of a fixed size, the second grade file of said distribution pressed from both sides carry out rename.
Wherein, the said file of under said second grade file folder, setting up a fixed size, the storage that is used for said passage data comprises:
Judge in the fixed block file of said free time and whether have file;
After then setting up the new file and name of a fixed size when not existing, be linked to said second grade file folder down, be used for the storage of said passage data; Then the arbitrary file in the said already present file is carried out being linked at said second grade file folder down after the rename when existing, be used for the storage of said passage data, the file of said already present file is called the initial title of file.
Wherein, also comprise:
After data in the said passage will all take for the space of said channel allocation, be retrieved as the first grade file folder of said channel allocation;
Obtain said first grade file folder down in each second grade file folder Time Created file the earliest, with the initial title of the deletion of the content in said file back RNTO file, and be linked to the fixed block file of said free time.
Wherein, also comprise:, increase or be reduced to the space of said channel allocation through revising the passage stored configuration;
Data in the said passage surpass when being the space of said channel allocation in the said passage stored configuration, are retrieved as the first grade file folder of said channel allocation; According to the quantity of documents of difference needs deletions that in data in the said passage and the said passage stored configuration is the space of said channel allocation; According to pressing from both sides the file in following each second grade file folder by early obtaining said first grade file Time Created to the order in evening; Content in the said file that gets access to is deleted the initial title of back RNTO file, and be linked to the fixed block file of said free time.
Wherein, also comprise:
When needing the data in the deletion passage, be retrieved as the first grade file folder of said channel allocation;
Obtain the file in each second grade file folder under the said first grade file folder, with the initial title of the deletion of the content in said file back RNTO file, and the fixed block file of said free time is added in link to;
The filename RNTO second grade file of said each second grade file folder is pressed from both sides initial title, and the filename RNTO first grade file that said first grade file is pressed from both sides presss from both sides initial title.
The present invention also provides a kind of data storage device, comprising:
First allocation units are used at a plurality of first grade file folders of having set up, are first grade file folder of channel allocation of having created;
Second allocation units, a plurality of second grade files that are used under the first grade file folder that said first allocation units distribute, having set up press from both sides, and distribute a second grade file folder;
File storage unit is used under the second grade file folder that said second allocation units distribute, setting up the file of a fixed size, is used for the storage of said passage data.
Wherein, also comprise:
Initialization unit is used for setting up a plurality of first grade file folders at the root directory of storage space, under each first grade file folder, creates a plurality of second grade file folders; The name of said a plurality of first grade file folders is called first grade file and presss from both sides initial title and different; The name of said a plurality of second grade file folders is called second grade file and presss from both sides initial title and different; In storage space, set up the fixed block file of a free time.
Wherein, said first allocation units also are used to a first grade file folder of the channel allocation created back, before said second grade file folder is set up the file of a fixed size down, said first grade file for the channel allocation created is pressed from both sides carry out rename;
Said second allocation units; Before also being used for distributing a second grade file folder back, under said second grade file folder, setting up the file of a fixed size, the second grade file of said distribution pressed from both sides carry out rename at a plurality of second grade files folders that said first grade file folder has been set up down.
Wherein, said file storage unit comprises:
Judgment sub-unit is used for judging whether the fixed block file of said free time exists file;
The first file storage subelement is used in the judged result of said judgment sub-unit when not existing, set up the new file and name of a fixed size after, be linked to said second grade file folder down, be used for the storage of said passage data;
The second file storage subelement; Be used in the judged result of said judgment sub-unit when existing; Arbitrary file in the said already present file is carried out being linked at said second grade file folder down after the rename; Be used for the storage of said passage data, the file of said already present file is called the initial title of file.
Wherein, also comprise:
The file delete unit is used for after the data of said passage will all take for the space of said channel allocation, is retrieved as the first grade file folder of said channel allocation; Obtain said first grade file folder down in each second grade file folder Time Created file the earliest, with the initial title of the deletion of the content in said file back RNTO file, and be linked to the fixed block file of said free time.
Wherein, also comprise:
The space management unit is used for increasing or be reduced to the space of said channel allocation through revising the passage stored configuration; Data in the said passage surpass when being the space of said channel allocation in the said passage stored configuration, are retrieved as the first grade file folder of said channel allocation; According to the quantity of documents of difference needs deletions that in data in the said passage and the said passage stored configuration is the space of said channel allocation; According to pressing from both sides the file in following each second grade file folder by early obtaining said first grade file Time Created to the order in evening; Content in the said file that gets access to is deleted the initial title of back RNTO file, and be linked to the fixed block file of said free time.
Wherein, also comprise:
The passage delete cells is used for when needs are deleted the data of passage, is retrieved as the first grade file folder of said channel allocation; Obtain the file in each second grade file folder under the said first grade file folder, with the initial title of the deletion of the content in said file back RNTO file, and the fixed block file of said free time is added in link to; The filename RNTO second grade file of said each second grade file folder is pressed from both sides initial title, and the filename RNTO first grade file that said first grade file is pressed from both sides presss from both sides initial title.
Compared with prior art, the present invention has the following advantages:
Through having realized storage for the form of the multistage file of channel allocation to data in the passage; It need not spend the plenty of time for creating file in advance at the beginning, and has realized the dynamic interpolation of memory channel and the dynamic capacity-expanding or the reduction of deletion and memory channel capacity.Circulation through file overrides in addition, has stopped the generation of file fragmentation, makes the memory property of array or disk can not reduce with the growth of service time.
Description of drawings
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
Fig. 1 is the process flow diagram of the date storage method that provides among the present invention;
Fig. 2 is the structural representation of the array after the initialization or disk structure in the application scenarios of the present invention;
Fig. 3 is the channel allocation passage file created and the synoptic diagram of date file in the application scenarios of the present invention;
Fig. 4 is the establishment synoptic diagram of video file in the application scenarios of the present invention;
Fig. 5 is the deletion synoptic diagram of video file in the application scenarios of the present invention;
Fig. 6 is the deletion synoptic diagram of the passage created in the application scenarios of the present invention;
Fig. 7 is the structural representation of the data storage device that provides among the present invention;
Fig. 8 is another structural representation of the data storage device that provides among the present invention.
Embodiment
In order to be illustrated more clearly in the embodiment of the invention or technical scheme of the prior art; To do to introduce simply to the accompanying drawing of required use in embodiment or the description of the Prior Art below; Obviously, the accompanying drawing in describing below only is some embodiments of the present invention, for those of ordinary skills; Under the prerequisite of not paying creative work property, can also obtain other accompanying drawing according to these accompanying drawings.
The present invention provides a kind of date storage method, in storage space, sets up a plurality of first grade file folders, under each first grade file folder, creates a plurality of second grade file folders; The first grade file folder can be the passage file, and the second grade file folder can be the date file, can also use different naming methods certainly.As shown in Figure 1, this method comprises:
Step s101, in a plurality of first grade files folder of having set up, be first grade file folder of channel allocation of having created.
During step s102, a plurality of second grade files of under the first grade file folder, having set up press from both sides, distribute a second grade file folder.
Step s103, under second grade file folder, set up the file of a fixed size, be used for the storage of passage data.
Below in conjunction with an application scenarios of the present invention, describe the embodiment of the date storage method that provides among the present invention in detail.Wherein, the first grade file folder is the passage file, and the second grade file folder is the date file.
After array or disk carry out the establishment of file system, under root directory, create N (N is a fixed value, as 100) passage file.The title of passage file can according to preset naming rule name into first grade file press from both sides initial title (as passage catalogue 1, passage catalogue 2 ..., passage catalogue N); Under each passage file, create and generate M (M is that fixed value is as 500) date file; The date Folder Name can according to preset naming rule name into second grade file press from both sides initial title (as date catalogue 1, date catalogue 2 ..., date catalogue M); And under root directory, generate one " idle fixed block file ", be used for set up but the file chaining that is not linked to any date file to should " fixed block file of free time " safeguarding.Because just spanned file presss from both sides, so initialization speed is very fast.Owing to need not write the operation of the file of full fixed size as prior art array disk, initialization operation just can be accomplished at once in addition, and array or disk structure after the initialization are as shown in Figure 2.When the present invention adopts the mode of a file of each passage to organize data, therefore realize simply, and need not come the file of management channels self, so practiced thrift storage space for each passage does not distribute a zone separately.
After creating storage space for passage, the passage file of channel allocation for having created carries out rename with " first grade file presss from both sides initial title " of this passage file according to the title of passage.For video monitoring system, the passage here is appreciated that the audio-visual data of this image collecting device collection will store in this array or the disk into corresponding with a video acquisition device (like camera).In addition, in a plurality of date files of under the passage file, having set up, distribute a date file and " second grade file presss from both sides initial title " that should the date file to carry out rename according to the current date.With situation shown in Figure 3 is example; The one passage file that has been assumed to be the pairing channel allocation of video acquisition device that is positioned at the crossing, the Changjiang river; With its title RNTO " crossing, the Changjiang river ", distribute a date file down at this " crossing, the Changjiang river ", and RNTO " 20090311 ".Through this process, can realize the dynamic interpolation of passage.
After passage file and date folder allocation finish, can carry out the establishment and the storage of video file.In the method provided by the invention, when beginning to write video file, judge that at first file total volumies all under this passage is whether more than or equal to the max cap. of this preset passage; Judged result can directly be carried out the establishment and the storage of new file for not the time; Judged result then need be deleted the file of having created when being, carries out the establishment and the storage of new file afterwards again.Created the process of file about this deletion, literary composition will detail in the back.When the establishment of carrying out new file and storage; At first search in " idle fixed block file " and whether have file; If not then the file that to create a size be Z (Z is preset fixed value such as 256MB, and this size is the setting value of All Files size in the file system), after according to preset rules this document being named; This document is linked to (like " 20090311 ") under the corresponding date catalogue, and carries out writing of audio, video data.If there is file (the file initial title of file by name that has had file in " idle fixed block file " in " idle fixed block file "; As initial file 1, original document 2 ...; For the file with the initial name nominating of file, it is from the file of once creating that is used to store audio, video data, when one be used for storing the file of audio, video data content deleted after; Its filename will be by the initial title of RNTO file; And be linked in " idle fixed block file ", use when treating need to be created file, for already present file in " idle fixed block file " by self passage or other passage; The initial title of its file is different promptly); Then need not to create new file, directly the file chaining in " idle fixed block file " is arrived under the corresponding date catalogue (like " 20090311 "), according to carrying out writing of audio, video data behind preset rules rename this document.With situation shown in Figure 4 is example; For channel allocation passage file " crossing, the Changjiang river " and after setting up date file " 20090311 "; Judge in " idle fixed block file " and whether have file; The file that then to create a size when not existing be Z, file " B130500E132000.H3CRD " by name is linked under the date catalogue " 20090311 ", and carries out writing of audio, video data; File chaining in then will " idle fixed block file " when existing under date catalogue " 20090311 ", with its filename by the initial title of file (like initial file 2) rename
For carrying out writing of audio, video data after " B130500E132000.H3CRD ".When file " B 130500E132000.H3CRD " write full after (in the file content arrive in Z); Repeat above-mentioned steps; Obtain the file of by name " B 1320000E000000.H3CRD " and be linked under the date catalogue " 20090311 ", proceed writing of audio, video data.Through this process, can realize the dynamic interpolation of video file.
File in a passage has surpassed the channel capacity threshold values, when the space that is about to distribute to this passage is filled with, need carry out having created in the passage deletion of video file.For the video file of needs deletion,, be linked in " idle fixed block file " with its RNTO " the initial title of file " and after deleting the content of wherein preserving.Use when treating to be created file, thereby the circulation that has realized file covers by self passage or other passage.In the system of selection of the video file that needs are deleted, can find creation-time storage file the earliest according to the date file, with its video file as the needs deletion; Can certainly adopt the additive method selection to need the video file of deletion, the present invention does not limit this.With situation shown in Figure 5 is example; When the space that storage in passage file " crossing, the Changjiang river " video recording will have been distributed to it is filled with; After the file RNTO " the initial title of file " of establishment is also deleted the file content of wherein preserving the earliest in the date file " 20090311 ", be linked to (different the getting final product of the initial title of file of already present alternative document in " the initial title of file " after the rename and " the fixed block file of free time ") in " idle fixed block file ".When the deleted file content, can be with all the elements Delete All in the file; Also can be only with the deletion of the file index in the file, the other guide in the file of file index deletion back promptly can't read again, and therefore a deleted file index gets final product.Write the operation compared of the file of full fixed size in advance with prior art array disk; File in the application scenarios of the present invention is dynamically to set up as required, and after the file delete operation with in file chaining to the fixing file of deletion with in follow-up recycling
Application scenarios of the present invention also relates to the method that increases or be reduced to the space of channel allocation.Through revising the passage stored configuration, can increase or be reduced to the space of channel allocation.When need be the time for the storage space dilatation of certain passage; Statistic chain is received the file size and the hard disk remaining space size of " idle fixed block file "; If be linked to the file size of " idle fixed block file " and hard disk remaining space size sum needs dilatation greater than this passage capacity; Then satisfy the dilatation demand, can increase the channel capacity threshold values.Storage space when certain passage of needs reduction; Then at first reduce the channel capacity threshold values; When the size that has had file in the passage surpasses the channel capacity threshold values; The value that surpasses the channel capacity threshold values according to the file of passage; Obtain the quantity of the file that needs deletion, and after the file rename that will delete one-tenth " the initial title of file " content that also deletion is wherein preserved, be linked to (different the getting final product of the initial title of file of already present alternative document in " the initial title of file " after the rename and " the fixed block file of free time ") in " idle fixed block file ".The dynamic capacity-expanding and the reduction of channel capacity have been realized through above-mentioned steps.
When certain passage of needs deletion, after at first all rename becomes " the initial title of file " and deletes the content of wherein preserving with the All Files under this passage catalogue, be linked in " idle fixed block file ".Be " date initialization title " with all the date folder rename below this passage again, at last with passage folder name RNTO " passage initialization title ".With situation shown in Figure 6 is example; With the file RNTO of having created in passage file " crossing, the Changjiang river " file of following date " 20090311 " " the initial title of file " and after deleting the file index of wherein preserving, be linked to (different the getting final product of the initial title of file of already present alternative document in " the initial title of file " after the rename and " the idle fixed block file ") in " idle fixed block file "; Again with all the date files below this passage like " 20090311 " RNTO " second grade file presss from both sides initial title " like date directory A (pressing from both sides initial title with existing each second grade file does not repeat to get final product), at last with passage folder name " crossing, the Changjiang river " RNTO " first grade file presss from both sides initial title " like passage catalogue B (pressing from both sides initial title with existing each first grade file does not repeat to get final product).
The file system that is used to store array of data or disk in the above-mentioned application scenarios can be EXT3 (Third extended file system; A kind of Journal File System), FAT32 (File AllocationTable32; A kind of file system of Windows operating system), NTFS (New Technology FileSystem; A kind of file system of Windows operating system) file system such as; Operations such as the establishment that file or folder is carried out, read-write, deletion can pass through the handling function realization of operating system (like operating systems such as Windows, Linux), and the present invention does not limit this.
In the said method provided by the invention; Through having realized storage for the form of the multistage file of channel allocation to data in the passage; It need not spend the plenty of time for creating file in advance at the beginning, and has realized the dynamic interpolation of memory channel and the dynamic capacity-expanding or the reduction of deletion and memory channel capacity.Circulation through file overrides in addition, has stopped the generation of file fragmentation, makes the memory property of array or disk can not reduce with the growth of service time.
The present invention also provides a kind of data storage device, and is as shown in Figure 7, comprising:
First allocation units 10 are used at a plurality of first grade file folders of having set up, are first grade file folder of channel allocation of having created; Also be used to a first grade file folder of the channel allocation created back, before the second grade file folder is set up the file of a fixed size down, will press from both sides for the first grade file of the channel allocation created and carry out rename.
Second allocation units 20, a plurality of second grade files that are used under the first grade file folder that first allocation units 10 distribute, having set up press from both sides, and distribute a second grade file folder; Also be used for distributing a second grade file folder back at a plurality of second grade files folders that first grade file folder has been set up down, before the second grade file folder is set up the file of a fixed size down, the second grade file of distribution pressed from both sides carries out rename.
File storage unit 30 is used under the second grade file folder that second allocation units 20 distribute, setting up the file of a fixed size, is used for the storage of said passage data.
In the data storage device provided by the invention, as shown in Figure 8, also comprise:
Initialization unit 40 is used for setting up a plurality of first grade file folders at the root directory of storage space, under each first grade file folder, creates a plurality of second grade file folders; The name of a plurality of first grade file folders is called first grade file and presss from both sides initial title and different; The name of a plurality of second grade file folders is called second grade file and presss from both sides initial title and different; In storage space, set up the fixed block file of a free time.
In addition, file storage unit 30 comprises:
Judgment sub-unit 31 is used for judging whether idle fixed block file exists file;
The first file storage subelement 32 is used in the judged result of judgment sub-unit 31 when not existing, set up the new file and name of a fixed size after, be linked to the second grade file folder down, be used for the storage of passage data;
The second file storage subelement 33; Be used in the judged result of judgment sub-unit 31 when existing; Arbitrary file in the said already present file is carried out being linked at the second grade file folder down after the rename; Be used for the storage of passage data, the file of said already present file is called the initial title of file.
Also comprise:
File delete unit 50 is used for after the data of passage will all take for the space of channel allocation, obtains the first grade file folder of first allocation units 10 for channel allocation; Obtain first grade file folder down in each second grade file folder of distributing of second allocation units 20 Time Created file the earliest, with the initial title of the deletion of the content in file back RNTO file, and be linked to idle fixed block file.
Also comprise:
Space management unit 60 is used for increasing or be reduced to the space of channel allocation through revising the passage stored configuration; When the data in the passage surpass in the passage stored configuration space for channel allocation, obtain the first grade file folder of first allocation units 10 for channel allocation; According to the quantity of documents of difference needs deletions that in data in this passage and the passage stored configuration is the space of this channel allocation; According to Time Created by early obtaining the first grade file folder file in each second grade file folder of distributing of second allocation units 20 down to the order in evening; With the initial title of the deletion of the content in the file that gets access to back RNTO file, and be linked to idle fixed block file.
Also comprise:
Passage delete cells 70 is used for when needs are deleted the data of passage, obtains the first grade file folder of first allocation units 10 for channel allocation; Obtain the first grade file folder file in each second grade file folder of distributing of second allocation units 20 down, with the initial title of the deletion of the content in file back RNTO file, and idle fixed block file is added in link to; The filename RNTO second grade file of each second grade file folder is pressed from both sides initial title, and the filename RNTO first grade file that this first grade file is pressed from both sides presss from both sides initial title.
In the said apparatus provided by the invention; Through having realized storage for the form of the multistage file of channel allocation to data in the passage; It need not spend the plenty of time for creating file in advance at the beginning, and has realized the dynamic interpolation of memory channel and the dynamic capacity-expanding or the reduction of deletion and memory channel capacity.Circulation through file overrides in addition, has stopped the generation of file fragmentation, makes the memory property of array or disk can not reduce with the growth of service time.
Through the description of above embodiment, those skilled in the art can be well understood to the present invention and can realize through hardware, also can realize by the mode that software adds necessary general hardware platform.Based on such understanding; Technical scheme of the present invention can be come out with the embodied of software product, this software product can be stored in a non-volatile memory medium (can be CD-ROM, USB flash disk; Portable hard drive etc.) in; Comprise some instructions with so that computer equipment (can be personal computer, server, the perhaps network equipment etc.) carry out the described method of each embodiment of the present invention.
More than disclosedly be merely several specific embodiment of the present invention, still, the present invention is not limited thereto, any those skilled in the art can think variation all should fall into protection scope of the present invention.

Claims (14)

1. a date storage method is characterized in that, is applied to video monitoring system, comprising:
In a plurality of first grade file folders of having set up, be first grade file folder of channel allocation of having created;
In a plurality of second grade file folders of under said first grade file folder, having set up, distribute a second grade file folder;
When writing the data of said passage correspondence, under said second grade file folder, set up the file of a fixed size, be used for the storage of said passage data.
2. the method for claim 1 is characterized in that, and is said in a plurality of first grade file folders of having set up, before first grade file folder of channel allocation of having created, also comprises:
In the root directory of storage space, set up a plurality of first grade file folders, under each first grade file folder, create a plurality of second grade file folders; The name of said a plurality of first grade file folders is called first grade file and presss from both sides initial title and different; The name of said a plurality of second grade file folders is called second grade file and presss from both sides initial title and different;
In storage space, set up the fixed block file of a free time.
3. according to claim 1 or claim 2 method is characterized in that, also comprises:
For a first grade file folder of the channel allocation created back, before said second grade file folder is set up the file of a fixed size down, said first grade file for the channel allocation created pressed from both sides carry out rename;
Before in a plurality of second grade files folders that said first grade file folder has been set up down, distributing a second grade file folder back, under said second grade file folder, setting up the file of a fixed size, the second grade file of said distribution pressed from both sides carry out rename.
4. method as claimed in claim 2 is characterized in that, the said file of under said second grade file folder, setting up a fixed size, and the storage that is used for said passage data comprises:
Judge in the fixed block file of said free time and whether have file;
After then setting up the new file and name of a fixed size when not existing, be linked to said second grade file folder down, be used for the storage of said passage data; Then the arbitrary file in the said already present file is carried out being linked at said second grade file folder down after the rename when existing, be used for the storage of said passage data, the file of said already present file is called the initial title of file.
5. like claim 2 or 4 described methods, it is characterized in that, also comprise:
After data in the said passage will all take for the space of said channel allocation, be retrieved as the first grade file folder of said channel allocation;
Obtain said first grade file folder down in each second grade file folder Time Created file the earliest, with the initial title of the deletion of the content in said file back RNTO file, and be linked to the fixed block file of said free time.
6. like claim 2 or 4 described methods, it is characterized in that, also comprise:, increase or be reduced to the space of said channel allocation through revising the passage stored configuration;
Data in the said passage surpass when being the space of said channel allocation in the said passage stored configuration, are retrieved as the first grade file folder of said channel allocation; According to the quantity of documents of difference needs deletions that in data in the said passage and the said passage stored configuration is the space of said channel allocation; According to pressing from both sides the file in following each second grade file folder by early obtaining said first grade file Time Created to the order in evening; Content in the said file that gets access to is deleted the initial title of back RNTO file, and be linked to the fixed block file of said free time.
7. like claim 2 or 4 described methods, it is characterized in that, also comprise:
When needing the data in the deletion passage, be retrieved as the first grade file folder of said channel allocation;
Obtain the file in each second grade file folder under the said first grade file folder, with the initial title of the deletion of the content in said file back RNTO file, and the fixed block file of said free time is added in link to;
The filename RNTO second grade file of said each second grade file folder is pressed from both sides initial title, and the filename RNTO first grade file that said first grade file is pressed from both sides presss from both sides initial title.
8. a data storage device is characterized in that, is applied to video monitoring system, comprising:
First allocation units are used at a plurality of first grade file folders of having set up, are first grade file folder of channel allocation of having created;
Second allocation units, a plurality of second grade files that are used under the first grade file folder that said first allocation units distribute, having set up press from both sides, and distribute a second grade file folder;
File storage unit is used for when writing the data of said passage correspondence, under the second grade file folder that said second allocation units distribute, sets up the file of a fixed size, is used for the storage of said passage data.
9. device as claimed in claim 8 is characterized in that, also comprises:
Initialization unit is used for setting up a plurality of first grade file folders at the root directory of storage space, under each first grade file folder, creates a plurality of second grade file folders; The name of said a plurality of first grade file folders is called first grade file and presss from both sides initial title and different; The name of said a plurality of second grade file folders is called second grade file and presss from both sides initial title and different; In storage space, set up the fixed block file of a free time.
10. like claim 8 or 9 described devices, it is characterized in that:
Said first allocation units also are used to a first grade file folder of the channel allocation created back, before said second grade file folder is set up the file of a fixed size down, said first grade file for the channel allocation created is pressed from both sides carry out rename;
Said second allocation units; Before also being used for distributing a second grade file folder back, under said second grade file folder, setting up the file of a fixed size, the second grade file of said distribution pressed from both sides carry out rename at a plurality of second grade files folders that said first grade file folder has been set up down.
11. device as claimed in claim 9 is characterized in that, said file storage unit comprises:
Judgment sub-unit is used for judging whether the fixed block file of said free time exists file;
The first file storage subelement is used in the judged result of said judgment sub-unit when not existing, set up the new file and name of a fixed size after, be linked to said second grade file folder down, be used for the storage of said passage data;
The second file storage subelement; Be used in the judged result of said judgment sub-unit when existing; Arbitrary file in the said already present file is carried out being linked at said second grade file folder down after the rename; Be used for the storage of said passage data, the file of said already present file is called the initial title of file.
12. like claim 9 or 11 described devices, it is characterized in that, also comprise:
The file delete unit is used for after the data of said passage will all take for the space of said channel allocation, is retrieved as the first grade file folder of said channel allocation; Obtain said first grade file folder down in each second grade file folder Time Created file the earliest, with the initial title of the deletion of the content in said file back RNTO file, and be linked to the fixed block file of said free time.
13. like claim 9 or 11 described devices, it is characterized in that, also comprise:
The space management unit is used for increasing or be reduced to the space of said channel allocation through revising the passage stored configuration; Data in the said passage surpass when being the space of said channel allocation in the said passage stored configuration, are retrieved as the first grade file folder of said channel allocation; According to the quantity of documents of difference needs deletions that in data in the said passage and the said passage stored configuration is the space of said channel allocation; According to pressing from both sides the file in following each second grade file folder by early obtaining said first grade file Time Created to the order in evening; Content in the said file that gets access to is deleted the initial title of back RNTO file, and be linked to the fixed block file of said free time.
14. like claim 9 or 11 described devices, it is characterized in that, also comprise:
The passage delete cells is used for when needs are deleted the data of passage, is retrieved as the first grade file folder of said channel allocation; Obtain the file in each second grade file folder under the said first grade file folder, with the initial title of the deletion of the content in said file back RNTO file, and the fixed block file of said free time is added in link to; The filename RNTO second grade file of said each second grade file folder is pressed from both sides initial title, and the filename RNTO first grade file that said first grade file is pressed from both sides presss from both sides initial title.
CN2009101361612A 2009-04-30 2009-04-30 Method and device for data storage Active CN101539884B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009101361612A CN101539884B (en) 2009-04-30 2009-04-30 Method and device for data storage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009101361612A CN101539884B (en) 2009-04-30 2009-04-30 Method and device for data storage

Publications (2)

Publication Number Publication Date
CN101539884A CN101539884A (en) 2009-09-23
CN101539884B true CN101539884B (en) 2012-07-11

Family

ID=41123083

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009101361612A Active CN101539884B (en) 2009-04-30 2009-04-30 Method and device for data storage

Country Status (1)

Country Link
CN (1) CN101539884B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102375694B (en) * 2010-08-20 2014-09-10 浙江宇视科技有限公司 Data processing method and device
CN102364941A (en) * 2011-10-26 2012-02-29 广东威创视讯科技股份有限公司 Method for storing recorded signals
CN104268672A (en) * 2014-09-11 2015-01-07 郑州华源超硬材料工具有限公司 Wood floor processing cutting tool electronic drawing management method and classification steps thereof
CN104980680B (en) * 2015-06-30 2017-11-03 银江股份有限公司 A kind of method of video data access
CN105049769B (en) * 2015-08-26 2018-06-05 浙江宇视科技有限公司 A kind of iSCSI blocks directly deposit the method and apparatus for supporting the change of video recording space
CN107122133B (en) * 2017-04-24 2020-08-07 珠海全志科技股份有限公司 Data storage method and device
CN111090617B (en) * 2018-10-23 2023-03-31 ***通信有限公司研究院 File management method and device in monitoring system and computer readable storage medium
CN110262752B (en) * 2019-05-16 2020-08-11 罗普特科技集团股份有限公司 Method, device and storage medium for storing streaming media data

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996283A (en) * 2005-12-31 2007-07-11 英保达股份有限公司 File sorting-save management method and system therefor

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1996283A (en) * 2005-12-31 2007-07-11 英保达股份有限公司 File sorting-save management method and system therefor

Also Published As

Publication number Publication date
CN101539884A (en) 2009-09-23

Similar Documents

Publication Publication Date Title
CN101539884B (en) Method and device for data storage
CN101908073B (en) Method for deleting duplicated data in file system in real time
CN103064639B (en) Date storage method and device
CN101957836B (en) Configurable real-time transparent compressing method in file system
US7236992B2 (en) Storage system
CN100583832C (en) Data management method and system
CN104065906B (en) Video recording method and device of digital video recording equipment
CN103229173A (en) Metadata management method and system
CN102930060B (en) A kind of method of database quick indexing and device
CN107436725A (en) A kind of data are write, read method, apparatus and distributed objects storage cluster
CN109766312A (en) A kind of block chain storage method, system, device and computer readable storage medium
CN102332029A (en) Hadoop-based mass classifiable small file association storage method
CN107315533A (en) A kind of date storage method and device
CN101739310A (en) Method and device for cycling backup
CN101382948A (en) File memory method, apparatus and system
WO2021082422A1 (en) Compatibility processing method, system and device for space reclamation of storage system
CN104123237A (en) Hierarchical storage method and system for massive small files
CN102902709A (en) Space allocation fixing file memory system and implementation method
CN103425435A (en) Disk storage method and disk storage system
CN102932622A (en) Video recording method and video recording device of digital recording equipment
CN102023821A (en) Disc space management method and system
CN103942301A (en) Distributed file system oriented to access and application of multiple data types
CN100543748C (en) A kind of method and system of utilizing file allocation table to carry out the file tracking
CN102609508B (en) High-speed access method of files in network storage
KR100907477B1 (en) Apparatus and method for managing index of data stored in flash memory

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Patentee after: Xinhua three Technology Co., Ltd.

Address before: 310053 Hangzhou hi tech Industrial Development Zone, Zhejiang province science and Technology Industrial Park, No. 310 and No. six road, HUAWEI, Hangzhou production base

Patentee before: Huasan Communication Technology Co., Ltd.

CP03 Change of name, title or address