CN101853306A - Method for reading and writing hard disk storage - Google Patents
Method for reading and writing hard disk storage Download PDFInfo
- Publication number
- CN101853306A CN101853306A CN 201010198774 CN201010198774A CN101853306A CN 101853306 A CN101853306 A CN 101853306A CN 201010198774 CN201010198774 CN 201010198774 CN 201010198774 A CN201010198774 A CN 201010198774A CN 101853306 A CN101853306 A CN 101853306A
- Authority
- CN
- China
- Prior art keywords
- file
- data file
- hard
- data
- index
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Abstract
The invention discloses a method for writing hard disk storage, which comprises the following steps of: formatting a hard disk; searching for an available data file from an index file; writing the data into the corresponding data file; and meanwhile updating the index. The invention also discloses a method for reading the hard disk storage. The method for reading and writing the hard disk storage disclosed by the invention manages the file simply and reliably, searches for the file simply and has no hard disk fragments.
Description
[technical field]
The present invention relates to hard-disc storage, relate in particular to the reading/writing method of hard-disc storage.
[background technology]
Aspect hard-disc storage, method relatively more commonly used at present is to set up file according to the current time, as: begin video recording in 16: 30 on the 20th August in 2009, then create video file 200908201630.h264, in this file, write then, stop video recording with regard to close file.When hard disk is full, search for the oldest file delete, create new file then again, so continuous repetition.
Yet setting up file according to the current time has following defective: 1. file is a lot, and the time of retrieval can be long; 2. file is constantly created, is deleted, and is great test to the stability of the file system of operating system, and test finds that it is more and more slower that file read-write speed can become under Linux and Windows; 3. different file size differences is constantly covering in the process of writing, and the fragment of hard disk can constantly increase.Therefore, prior art need to be improved and enhanced.
[summary of the invention]
In order to solve the problems of the prior art, the invention provides a kind of hard-disc storage reading/writing method, more simple and reliable to the management of file.
The invention provides a kind of write method of hard-disc storage, may further comprise the steps: hard disk is formatd; Search available data file in the indexed file; Data are write in the corresponding data file; Upgrade index simultaneously.
As a further improvement on the present invention, hard disk is formatd may further comprise the steps: on hard disk, set up the identical data file of size; On hard disk, create 2 identical index files.
As a further improvement on the present invention, set up the backup file of 1 described data file of correspondence.
As a further improvement on the present invention, described 2 identical index files comprise 1 master index file and 1 archive index file.
As a further improvement on the present invention, upgrading index simultaneously may further comprise the steps: the start time of writing down each data file at described index file; The concluding time of each data file of record in described index file; The reference position of each data file of record in described index file; The end position of each data file of record in described index file.
The present invention also provides a kind of method of reading of hard-disc storage, is used to read by the resulting data file of the write method of described hard-disc storage, may further comprise the steps: search the described data file that satisfies condition in the indexed file and reach and Data Position; Open described data file; Read described data file; Read finish after, close described data file.
The invention has the beneficial effects as follows:
(1) simple and reliable to the management of file, file system there is not pressure;
(2) document retrieval is simple;
(3) do not have the hard disk fragment;
(4) read or write speed of hard disk can be not slack-off with the continuous covering of data.
[description of drawings]
Fig. 1 is the process flow diagram of the write method of hard-disc storage of the present invention;
Fig. 2 is the process flow diagram of the method for reading of hard-disc storage of the present invention.
[embodiment]
The present invention is further described below in conjunction with description of drawings and embodiment.
Be the process flow diagram of the write method of hard-disc storage as shown in Figure 1.In step S100, hard disk is formatd, be specially: on hard disk, set up the identical data file of size, and on hard disk, create 2 identical index files.2 identical index files comprise 1 master index file and 1 archive index file.Set up the backup file of 1 described data file of correspondence.In the present embodiment, if data file is extremely important, then set up the backup file of 1 correspondence.
In step S102, search available data file in the indexed file.
In step S104, data are write in the corresponding data file.
When writing data in the corresponding data file, carry out step S106, upgrade index.Be specially: indexed file writes down the start time of each data file; The concluding time of each data file of record in the indexed file; The reference position of each data file of record in the indexed file; The end position of each data file of record in the indexed file.
Be the process flow diagram of the method for reading of hard-disc storage as shown in Figure 2.The method of reading of the hard-disc storage in the present embodiment is used to read by the resulting data file of the write method of hard-disc storage.In step S200, to search the data file that satisfies condition in the indexed file and reach and Data Position, Data Position comprises data starting position and ED position.
In step S202, open data file.In step S204, read data files.In step S206, read finish after, close data file.
In the present embodiment, do not repeat to create file and deleted file, only the information in the corresponding indexed file of data file is handled getting final product.As carry out the processing of data effective length clear 0.
The reading/writing method of hard-disc storage provided by the present invention, simple and reliable to the management of file, file system there is not pressure; Document retrieval is simple; Do not have the hard disk fragment; The read or write speed of hard disk can be not slack-off with the continuous covering of data.
Above content be in conjunction with concrete preferred implementation to further describing that the present invention did, can not assert that concrete enforcement of the present invention is confined to these explanations.For the general technical staff of the technical field of the invention, without departing from the inventive concept of the premise, can also make some simple deduction or replace, all should be considered as belonging to protection scope of the present invention.
Claims (7)
1. the write method of a hard-disc storage is characterized in that, may further comprise the steps:
Hard disk is formatd;
Search available data file in the indexed file;
Data are write in the corresponding data file;
Upgrade index simultaneously.
2. the write method of hard-disc storage according to claim 1 is characterized in that, hard disk is formatd may further comprise the steps:
On hard disk, set up the identical data file of size;
On hard disk, create 2 identical index files.
3. the write method of hard-disc storage according to claim 2 is characterized in that: the backup file of setting up 1 described data file of correspondence.
4. the write method of hard-disc storage according to claim 2, it is characterized in that: described 2 identical index files comprise 1 master index file and 1 archive index file.
5. the write method of hard-disc storage according to claim 1 is characterized in that, upgrades index simultaneously and may further comprise the steps:
The start time of each data file of record in described index file;
The concluding time of each data file of record in described index file;
The reference position of each data file of record in described index file;
The end position of each data file of record in described index file.
6. the method for reading of a hard-disc storage is used to read by the resulting data file of the write method of described hard-disc storage, it is characterized in that, may further comprise the steps:
Search the described data file and the Data Position that satisfy condition in the indexed file;
Open described data file;
Read described data file;
Read finish after, close described data file.
7. the method for reading of hard-disc storage according to claim 6 is characterized in that: search the described data file that satisfies condition in the indexed file and comprise data starting position and ED position with Data Position in this step of Data Position.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010198774 CN101853306A (en) | 2010-06-11 | 2010-06-11 | Method for reading and writing hard disk storage |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN 201010198774 CN101853306A (en) | 2010-06-11 | 2010-06-11 | Method for reading and writing hard disk storage |
Publications (1)
Publication Number | Publication Date |
---|---|
CN101853306A true CN101853306A (en) | 2010-10-06 |
Family
ID=42804797
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN 201010198774 Pending CN101853306A (en) | 2010-06-11 | 2010-06-11 | Method for reading and writing hard disk storage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101853306A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017185616A1 (en) * | 2016-04-25 | 2017-11-02 | 乐视控股(北京)有限公司 | File storage method and electronic equipment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1124974A (en) * | 1997-07-08 | 1999-01-29 | Canon Inc | File managing device/method |
CN1632765A (en) * | 2004-12-31 | 2005-06-29 | 大唐微电子技术有限公司 | A flash memory file system management method |
KR20060068663A (en) * | 2004-12-16 | 2006-06-21 | 주식회사 대우일렉트로닉스 | Method for time search in digital video recording system |
CN101419828A (en) * | 2008-11-20 | 2009-04-29 | 杭州海康威视数字技术股份有限公司 | Hard disc video recording and retrieval method for analog magnetic tape serial schema |
-
2010
- 2010-06-11 CN CN 201010198774 patent/CN101853306A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH1124974A (en) * | 1997-07-08 | 1999-01-29 | Canon Inc | File managing device/method |
KR20060068663A (en) * | 2004-12-16 | 2006-06-21 | 주식회사 대우일렉트로닉스 | Method for time search in digital video recording system |
CN1632765A (en) * | 2004-12-31 | 2005-06-29 | 大唐微电子技术有限公司 | A flash memory file system management method |
CN101419828A (en) * | 2008-11-20 | 2009-04-29 | 杭州海康威视数字技术股份有限公司 | Hard disc video recording and retrieval method for analog magnetic tape serial schema |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017185616A1 (en) * | 2016-04-25 | 2017-11-02 | 乐视控股(北京)有限公司 | File storage method and electronic equipment |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101446984B (en) | Method and device for storing files and method and device for deleting files | |
US8806173B2 (en) | Elimination of duplicate written records | |
US10255235B2 (en) | Database storage system based on jukebox and method using the system | |
US20100280651A1 (en) | Data cartridge and tape library including flash memory | |
CN102902672B (en) | Method and device for cleaning file system | |
CN104239438A (en) | File information storage method and file information read-write method based on separate storage | |
CN101742263A (en) | Method for storing surveillance video data | |
US9916323B2 (en) | Support for worm cartridges realized by linear tape file system (LTFS) | |
KR20050053094A (en) | Method for recovering data in ext2 file system, and computer-readable storage medium recorded with data-recover program | |
KR20150122533A (en) | Method for generating secondary index and apparatus for storing secondary index | |
CN104811645A (en) | Embedded video-recording data storage method | |
CN103164528B (en) | A kind of index establishing method of audio, video data | |
US9659029B2 (en) | File system implementing write once read many (WORM) | |
CN107273449B (en) | Breakpoint processing method and system based on memory database | |
CN103092719B (en) | A kind of power-off protection method of file system | |
CN101853306A (en) | Method for reading and writing hard disk storage | |
CN105095418A (en) | Method and apparatus for processing write request | |
CN102117623B (en) | Method and device for recovering magnetic tape metadata | |
CN103077187A (en) | Log management method and log management system | |
CN112286720B (en) | Method for extracting deleted data after enabling TRIM command to solid state disk controlled by SM2246EN | |
CN102411696A (en) | Method for performing mass production copy on external storage device | |
CN101192226A (en) | Data access method based on fixed length record database | |
CN112181311B (en) | Cyclic recording method, equipment and storage medium | |
CN102662854B (en) | A kind of storage means based on the many hard disks of Large Copacity | |
CN104504349B (en) | A kind of Video data safe storage device and method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C12 | Rejection of a patent application after its publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20101006 |