CN109496292A - A kind of disk management method, disk management device and electronic equipment - Google Patents

A kind of disk management method, disk management device and electronic equipment Download PDF

Info

Publication number
CN109496292A
CN109496292A CN201880001664.6A CN201880001664A CN109496292A CN 109496292 A CN109496292 A CN 109496292A CN 201880001664 A CN201880001664 A CN 201880001664A CN 109496292 A CN109496292 A CN 109496292A
Authority
CN
China
Prior art keywords
data block
disk
mentioned
video file
data
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.)
Granted
Application number
CN201880001664.6A
Other languages
Chinese (zh)
Other versions
CN109496292B (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.)
Streamax Technology Co Ltd
Original Assignee
Streamax Technology 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 Streamax Technology Co Ltd filed Critical Streamax Technology Co Ltd
Publication of CN109496292A publication Critical patent/CN109496292A/en
Application granted granted Critical
Publication of CN109496292B publication Critical patent/CN109496292B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0619Improving the reliability of storage systems in relation to data integrity, e.g. data losses, bit errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1448Management of the data involved in backup or backup restore
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

This application discloses a kind of disk management method, disk management device, electronic equipment and computer readable storage mediums, wherein, the disk management method includes: that disk is divided into more than one data block, wherein the capacity of the data block is calculated by preset formula;Scan the use information of each data block of the disk;The use information for each data block that scanning obtains is deposited in preset first data block;In disk system starting, the disk is read by first data block.By application scheme, disk read-write performance can be improved to a certain extent.

Description

A kind of disk management method, disk management device and electronic equipment
Technical field
The application belongs to mobile unit technical field more particularly to a kind of disk management method, disk management device, electronics Equipment and computer readable storage medium.
Background technique
Mobile unit is normally operated under the mal-conditions such as voltage instability, abnormal power-down, high temperature, vibration, current common magnetic Disk often will appear partial data damage under this kind of mal-condition.Standard storage management system used by ordinary magnetic disc, such as FAT32, NTFS, EXT2 etc., it will usually minimum memory unit is arranged smaller, after duplicate deletion and write-in data, It just will appear a large amount of disk fragments, decline so as to cause the readwrite performance of disk.
Summary of the invention
It can in view of this, this application provides a kind of disk management method, disk management device, electronic equipment and computers Storage medium is read, disk read-write performance can be improved to a certain extent.
The first aspect of the application provides a kind of disk management method, comprising:
Disk is divided into more than one data block, wherein the capacity of above-mentioned data block is calculated by preset formula;
Scan the use information of each data block of above-mentioned disk;
The use information for each data block that scanning obtains is deposited in preset first data block;
In disk system starting, above-mentioned disk is read by above-mentioned first data block.
The second aspect of the application provides a kind of disk management device, comprising:
Division unit, for disk to be divided into more than one data block, wherein the capacity of above-mentioned data block is by presetting Formula is calculated;
Scanning element, the use information of each data block for scanning above-mentioned disk;
The use information of storage unit, each data block for obtaining scanning deposits in preset first data block In;
Reading unit, for reading above-mentioned disk by above-mentioned first data block in disk system starting.
The third aspect of the application provides a kind of electronic equipment, above-mentioned electronic equipment include memory, processor and It is stored in the computer program that can be run in above-mentioned memory and on above-mentioned processor, above-mentioned processor executes above-mentioned computer The step of method such as above-mentioned first aspect is realized when program.
The fourth aspect of the application provides a kind of computer readable storage medium, and above-mentioned computer readable storage medium is deposited The step of containing computer program, the method such as above-mentioned first aspect realized when above-mentioned computer program is executed by processor.
The 5th aspect of the application provides a kind of computer program product, and above-mentioned computer program product includes computer Program, when above-mentioned computer program is executed by one or more processors the step of the realization such as method of above-mentioned first aspect.
Therefore by application scheme, disk is divided into more than one data block first, wherein above-mentioned number It is calculated according to the capacity of block by preset formula, then scans the use information of each data block of above-mentioned disk, and will scanning The use information of obtained each data block is deposited in preset first data block, in disk system starting, by above-mentioned First data block reads above-mentioned disk.In application scheme, the use information of data block each in disk is deposited in one Specific data block, so that can realize quickly positioning, and certain journey by the specific data block when needing to read and write disk Disk read-write performance is improved on degree.
Detailed description of the invention
It in order to more clearly explain the technical solutions in the embodiments of the present application, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only some of the application Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is a kind of implementation flow chart of disk management method provided by the embodiments of the present application;
Fig. 2 is another implementation flow chart of disk management method provided by the embodiments of the present application;
Fig. 3 is the structural block diagram of disk management device provided by the embodiments of the present application;
Fig. 4 is the structural block diagram of electronic equipment provided by the embodiments of the present application.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, so as to provide a thorough understanding of the present application embodiment.However, it will be clear to one skilled in the art that there is no these specific The application also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, so as not to obscure the description of the present application with unnecessary details.
In order to illustrate the above-mentioned technical solution of the application, the following is a description of specific embodiments.
Embodiment one
A kind of disk management method provided by the embodiments of the present application is described below, referring to Fig. 1, the application is implemented Example in disk management method include:
In a step 101, disk is divided into more than one data block;
In the embodiment of the present application, the capacity of data block can not be too small, if too it is small can if will lead to video recording when, distribution Data block is more frequent, and the discreteness for also resulting in data is big, will affect the read-write efficiency of disk;The capacity of data block can not It is too big, since smallest allocation unit is data block size, so data block capacity is then easy to cause greatly very much space waste;Meanwhile In order not to allowing the use information dispersed record of disk in multiple data blocks, the complexity for increasing programmed logic is avoided, disk The sum of data block is no more than the size that a data block is able to record.Based on this, the size of data block is set not less than 4 Million, and the size of data block with 4,000,000 be incremented by, i.e., data block size be 4,000,000 integral multiple.Specifically, the capacity of above-mentioned data block The capacity of above-mentioned data block is calculated by preset formula, wherein the use information of setting one data block of record needs to occupy 32 bytes, then above-mentioned preset formula are as follows:
(4b×1024×1024)÷32×(4b×1024×1024)≥(a×1024×1024)
Wherein, the total capacity of above-mentioned disk is a million, and the capacity of said one data block is b times of 4,000,000, i.e. data block is held Amount finds out the minimum b value for meeting above-mentioned formula according to above-mentioned preset formula for 4b million, and above-mentioned data block capacity 4b can be obtained Million specific value.It should be noted that above-mentioned b is positive integer.
In a step 102, the use information of each data block of above-mentioned disk is scanned;
In the embodiment of the present application, in the embodiment of the present application, above-mentioned use information includes but is not limited to: data block ownership Stamp, data block location, in data block at the beginning of video file, the end time of video file, data block class in data block Type and Data block check position, wherein the data block ownership stamp indicates complete video file belonging to the data block.Example Such as, the video time span of a certain video file File1 is that 18:00-18:05 is needed since data are excessive through data block 1 And data block 2 the two data blocks store above-mentioned video file File1 jointly, then, the number of above-mentioned data block 1 and data block 2 The two, which is then indicated, according to block ownership stamp belongs to above-mentioned video file File1;What above-mentioned data block 1 was stored is video file In File1, time span is the video content of 18:00-18:03, and what above-mentioned data block 2 was stored is in video file File1, Time span is the video content of 18:03-18:05, then for above-mentioned data block 1, in data block at the beginning of video file Between be 18:00, the end time of video file is 18:03 in data block;For above-mentioned data block 2, video in data block It is 18:03 at the beginning of file, the end time of video file is 18:05 in data block;Above-mentioned video block type instruction The state of data block, including freed data blocks, record (backup) data block and video data block;Above-mentioned data block location is specific It is expressed by video file internal number, i.e., can determine the data block of the video file by above-mentioned video file internal number Position;Above-mentioned Data block check position is used to judge whether the data that the data block is stored are legal by the value.It is above-mentioned to use letter Breath together constitutes the use information structural body an of data block, occupies 32 bytes, to freed data blocks and video data block, Preceding 32 byte of data block stores the use information of notebook data block.
In step 103, the use information for each data block that scanning obtains is deposited in preset first data block;
In the embodiment of the present application, in the embodiment of the present application, using the data block of disk specific position as above-mentioned first Data block, above-mentioned first data block are exclusively used in storing the use information of each data block, in other words, above-mentioned first data block Data block type is record data block, wherein above-mentioned designated position can be first data block in disk, be also possible to use The specified other positions in family, do not define above-mentioned specific position herein.After having carried out scan full hard disk to disk, it will scan The use information of obtained each data block is deposited in above-mentioned first data block.
At step 104, when disk system starts, above-mentioned disk is read by above-mentioned first data block.
In the embodiment of the present application, under normal circumstances, in disk system, whole scan can be carried out to above-mentioned disk, obtained To the behaviour in service of disk, lay the foundation for subsequent read-write operation;However, need to rescan when due to starting every time, thus Certain time can be wasted;In order to realize the quick start of disk, the service condition of disk is understood in time, in step 103 The use information of each data block of disk is deposited in above-mentioned first data block, thus when disk is read, only need Above-mentioned first data block is read, can quickly know the behaviour in service of disk.
Specifically, the use information of each data block and the address of data block recorded in above-mentioned first data block are one One is corresponding, for example, first data in the i.e. corresponding disk of the use information of the first data block in above-mentioned first data block The use information of block, second data block in the i.e. corresponding disk of the use information of the Article 2 data block in above-mentioned first data block Use information so establish index relative without additional, each data that can be stored from the first data block The use information of block is mapped in actual storage unit (i.e. data block).
Therefore in the embodiment of the present application, by the use information of data block each in disk deposit in one it is specific Data block quickly positioning can be realized by the specific data block, and to a certain extent so that when needing to read and write disk Improve disk read-write performance.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
Embodiment two
On the basis of example 1, the embodiment of the present application two provides another disk management method.Below to this Shen Please embodiment two provide another disk management method be described, referring to Fig. 2, the disk pipe in the embodiment of the present application two Reason method includes:
In step 201, disk is divided into more than one data block;
In step 202, the use information of each data block of above-mentioned disk is scanned;
In step 203, the use information for each data block that scanning obtains is deposited in preset first data block;
In the embodiment of the present application, in the embodiment of the present application, above-mentioned steps 201,202 and 203 respectively with above-mentioned steps 101,102 and 103 is same or similar, and for details, reference can be made to the associated descriptions of above-mentioned steps 101,102 and 103, and details are not described herein.
In step 204, above-mentioned first data block is backed up in preset second data block, so that above-mentioned first data Block is mutually backups with above-mentioned second data block;
In the embodiment of the present application, since vehicle environment is severe, power-off suddenly or vibration often occur causes magnetic head that number is written According to exception, disk corresponding position is caused to break down, in some instances it may even be possible to adjacent position is also had an impact, thus, in order to first Data block can also achieve the purpose that fast quick-recovery when damaging, and the data backup that above-mentioned first data block can be stored is to pre- If the second data block in, even if being also able to achieve the fast quick-recovery of data so that information damaged condition occurs in the first data block.Institute The position for stating the second data block and first data block is at least separated by pre-determined distance, avoids above-mentioned first data block and the second number It is damaged simultaneously according to block.In order to it is simple, quickly find above-mentioned first data block and the second data block, to quickly obtain entire Above-mentioned first data block and the second data block can be assigned to the fixation position of disk, such as by disk by the behaviour in service of disk The 1st data block block be set as the first data block, the 401st data block of disk is set as the second data block, above-mentioned 400 data blocks of one data block and the second data block distance, the distance are empirical value, have physically been separated by several magnetic tracks, energy The two is effectively avoided to be damaged simultaneously, it is of course also possible to which the data block for the other positions that user specifies is set as the first data Block and the second data block, are not construed as limiting herein;It should be noted that in a disk, it is only necessary to set first data block and One the second data block.Specifically, the data block type of above-mentioned second data block is Backup Data block.
In step 205, when disk system starts, detect whether above-mentioned first data block is damaged, if so, executing step Rapid 207, if it is not, thening follow the steps 106;
In step 206, above-mentioned disk is read by above-mentioned first data block;
In step 207, above-mentioned disk is read by above-mentioned second data block.
In the embodiment of the present application, since above-mentioned first data block and the second data block have recorded the data of entire disk The use information of block, thus in disk starting, as long as there is no damages for the two data blocks, which data no matter read Block can accurately obtain the behaviour in service of above-mentioned disk.
Optionally, in above-described embodiment one and embodiment two, above-mentioned disk management method further include:
When receiving search instruction, map to obtain video file list based on first data block;
Obtain data block corresponding to each complete video file in the video file list;
In data block based on each data block at the beginning of video file and in data block at the end of video file Between, at the beginning of determining each complete video file and the end time;
The complete video file of the time conditions will be met as search result.
Wherein, when needing to retrieve, search instruction is inputted, wherein the search instruction includes time conditions, namely is needed At the beginning of retrieving obtained video file and the end time.Since the first data block stores the use letter of each data block Breath, and above-mentioned use information can indicate complete video file belonging to each data block, thus, according to the number of each data block Belong to according to block and stab, can map to obtain the list of the video file stored in disk, while getting each complete video text Data block corresponding to part, for example, above-mentioned video file File1 is corresponding with data block 1 and data block 2;Then, according to each number The end time of video file, determines each complete video at the beginning of according to video file in the data block of block and in data block At the beginning of file and the end time, for example, be 18:00 at the beginning of video file in the data block of above-mentioned data block 1, The end time of video file is 18:03 in data block;It is at the beginning of video file in the data block of above-mentioned data block 2 18:03, the end time of video file is 18:05 in data block, since statement data block 1 and data block 2 form complete view Frequency file, after being spliced, it is known that be 18:00, end time 18:05 at the beginning of complete video file File1.It is spelling It connects after completing each complete video file, the complete video files of the time conditions will be met as search result, and will examine Hitch fruit exports to screen;Each search result is then ranked up by multiple search results if it exists with the sequence such as time order and function, It is shown in a list, after user input selection instruction, plays the selected video file of selection instruction and checked for user.It is logical Above-mentioned retrieval flow is crossed, for the disk for the 1T to 4T that current mainstream uses, can be calculated according to the formula in above-described embodiment one The capacity of data block is 8,000,000 out, and current disk sequence reading speed is generally all in 120MB/s or more, that is, 8,000,000 data are not Completion can be read by 0.067 second;That is, can read and finish by the first data block for 0.067 second, can get entire The behaviour in service of disk completes the retrieval to video file.It, can be with if should be noted that the damage of above-mentioned first data block Above-mentioned retrieval flow is applied in the second data block, is retrieved by the second data block.
Optionally, in above-described embodiment one and embodiment two, above-mentioned disk management method further include:
When receiving data to be written, first data block is read;
Based on first data block, determine the freed data blocks in the disk as data block to be written;
The data to be written are written in the data block to be written;
After the data to be written are written in the data block to be written, first data block is updated.
Wherein it is possible to the data block type in the use information of each data block recorded by above-mentioned first data block The freed data blocks in disk are searched, if there are two the above freed data blocks in disk, it can will above-mentioned two above free time In data block, the most preceding freed data blocks in position are as data block to be written;Alternatively, any data block work can also be randomly assigned For data block to be written, the determination method for not treating writing data blocks herein makes restriction.It is written by the data to be written After in the data block to be written, above-mentioned data block to be written has had been written to data namely the use information of the data block It is changed, needs to be updated above-mentioned first data block at this time, while after the first data block updates, will be updated Data backup to the second data block, namely above-mentioned first data block and the second data block is kept to be mutually backups at any time.It needs to infuse Above-mentioned write-in process can be applied in the second data block by meaning if above-mentioned first data block is damaged, and pass through the second number It is written according to block.
Optionally, in above-described embodiment one and embodiment two, above-mentioned disk management method further include:
First data block is read, judges whether corresponding use information is damaged by the Data block check position;
Impaired use information if it exists then restores the use information by second data block.
Wherein, since above-mentioned first data block and the second data block are mutually backups, and the two is apart from each other, generally will not be same When the use information of data block that is damaged, thus is stored in above-mentioned first data block or the second data block be damaged When, it can be restored by the use information that above-mentioned second data block or the first data block store itself.Optionally, Even if the impaired situation of use information for the same data block that above-mentioned first data block and the second data block are stored occurs, Also preceding 32 bytes that need to only read corresponding data block obtain the use information of the data block again, and make what is read again With Information recovering to the corresponding position of the first data block and the second data block.By above-mentioned recovery process, even if entire first number It is damaged according to block and the second data block, also need to only read 32 bytes of starting of each data block, for example, being directed to the magnetic of 4T byte Disk, each data block is 8,000,000, then a total of 524288 data blocks, need to only read preceding 32 words of 524288 data blocks Section, i.e., the data that need to only read 524288*32 byte=16,000,000 can restore the data of entire 4T disk.Certainly, in the second number When needing data to restore according to block, it is also referred to above-mentioned recovery process, is believed by the use of above-mentioned first data block Recover from damaging Breath, is not construed as limiting herein.
Optionally, in above-described embodiment one and embodiment two, above-mentioned disk management method further include:
Read first data block;
Based on first data block, determine that the earliest data block of the video file of the storage in the disk is used as wait cover Lid data block;
The data dump that the data block to be covered is stored is Blank data block.
Wherein, it for the video file for monitoring, in order to guarantee lasting video recording under limited disk space, needs The mode for taking cover time data block earlier, just can guarantee the timeliness and fluency of video file.It should be noted that It is that, if above-mentioned first data block is damaged, above-mentioned covering process can be applied in the second data block, pass through the second data block It is covered.
Therefore in the embodiment of the present application, by the use information of data block each in disk deposit in one it is specific Data block quickly positioning can be realized by the specific data block, and to a certain extent so that when needing to read and write disk Improve disk read-write performance.When needing to use disk, either retrieval, write-in, recovery or the covering of data can be quick It executes.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in above-described embodiment, each process Execution sequence should be determined by its function and internal logic, the implementation process without coping with the embodiment of the present application constitutes any limit It is fixed.
Embodiment three
The embodiment of the present application three provides a kind of disk management device, and above-mentioned disk management device can be integrated in electronic equipment In, as shown in figure 3, the disk management device 300 in the embodiment of the present application includes:
Division unit 301, for disk to be divided into more than one data block, wherein the capacity of above-mentioned data block by Preset formula is calculated;
Scanning element 302, the use information of each data block for scanning above-mentioned disk;
The use information of storage unit 303, each data block for obtaining scanning deposits in preset first data In block;
Reading unit 304, for reading above-mentioned disk by above-mentioned first data block in disk system starting.
Optionally, above-mentioned disk management device 300 further include:
Backup units, for backing up to above-mentioned first data block in preset second data block, so that above-mentioned first number It is mutually backups according to block and above-mentioned second data block, wherein the position at least phase of above-mentioned second data block and above-mentioned first data block Every pre-determined distance;
Above-mentioned reading unit 304 includes:
First data block detection sub-unit, for detecting whether above-mentioned first data block is damaged;
First data block reading subunit passes through above-mentioned first data block if not damaging for above-mentioned first data block Read above-mentioned disk;
Second data block reading subunit passes through above-mentioned second data block if having damaged for above-mentioned first data block Read above-mentioned disk.
Optionally, above-mentioned use information includes: data block ownership stamp, data block location, video file opens in data block End time, data block type and the Data block check position of video file in time beginning, data block, wherein above-mentioned data block is returned Belong to stamp and indicates complete video file belonging to above-mentioned data block.
Optionally, above-mentioned disk management device 300 further include:
Listed files acquiring unit, for being mapped and being regarded based on above-mentioned first data block when receiving search instruction Frequency file list, wherein above-mentioned search instruction includes time conditions;
Data block acquiring unit, for obtaining data corresponding to each complete video file in above-mentioned video file list Block;
Time determination unit, for video file in the data block based on each data block at the beginning of and data block in The end time of video file, at the beginning of determining each complete video file and the end time;
Search result determination unit, for the complete video file of above-mentioned time conditions will to be met as search result.
Optionally, above-mentioned reading unit 304, is also used to when receiving data to be written, reads above-mentioned first data block;
Above-mentioned disk management device 300 further include:
Data block determination unit to be written determines the idle number in above-mentioned disk for being based on above-mentioned first data block According to block as data block to be written;
Writing unit, for above-mentioned data to be written to be written in above-mentioned data block to be written;
Updating unit, for updating above-mentioned first after above-mentioned data to be written are written in above-mentioned data block to be written Data block.
Optionally, above-mentioned reading unit 304 is also used to read above-mentioned first data block, passes through above-mentioned Data block check position Judge whether corresponding use information is damaged;
Above-mentioned disk management device 300 further include:
Recovery unit then restores above-mentioned use by above-mentioned second data block for impaired use information if it exists Information.
Therefore in the embodiment of the present application, disk management device deposits the use information of data block each in disk It is put in a specific data block, so that quickly positioning can be realized by the specific data block when needing to read and write disk, and And disk read-write performance is improved to a certain extent.Need use disk when, either the retrieval, write-in, recovery of data or Covering, can quick execution.
Example IV
The embodiment of the present application four provides a kind of electronic equipment, referring to Fig. 4, the electronic equipment packet in the embodiment of the present application Include: memory 401 and is stored on memory 401 and can locate one or more processors 402 (only showing one in Fig. 4) The computer program run on reason device.Wherein: for memory 401 for storing software program and module, processor 402 passes through fortune Row is stored in the software program and unit of memory 401, thereby executing various function application and data processing, on obtaining State the corresponding resource of predeterminable event.Specifically, processor 402 is stored in the above-mentioned computer program of memory 401 by operation When perform the steps of
Disk is divided into more than one data block, wherein the capacity of above-mentioned data block is calculated by preset formula;
Scan the use information of each data block of above-mentioned disk;
The use information for each data block that scanning obtains is deposited in preset first data block;
In disk system starting, above-mentioned disk is read by above-mentioned first data block.
Assuming that above-mentioned is the first possible embodiment, then provided based on the first possible embodiment Second of possible embodiment in, deposit in preset the in the above-mentioned use information of each data block for obtaining scanning After in one data block, processor 402 is stored by operation and also realizes following step in the above-mentioned computer program of memory 401 It is rapid:
Above-mentioned first data block is backed up in preset second data block, so that above-mentioned first data block and above-mentioned second Data block is mutually backups, wherein the position of above-mentioned second data block and above-mentioned first data block is at least separated by pre-determined distance;
It is above-mentioned in disk system starting, pass through above-mentioned first data block and read above-mentioned disk, comprising:
Detect whether above-mentioned first data block is damaged;
If above-mentioned first data block is not damaged, above-mentioned disk is read by above-mentioned first data block;
If above-mentioned first data block has been damaged, above-mentioned disk is read by above-mentioned second data block.
It is above-mentioned in the third the possible embodiment provided based on above-mentioned second of possible embodiment Use information include: data block ownership stamp, data block location, in data block at the beginning of video file, video in data block End time, data block type and the Data block check position of file, wherein above-mentioned data block ownership stamp indicates above-mentioned data block Affiliated complete video file.
In the 4th kind of possible embodiment provided based on the third above-mentioned possible embodiment, processing Device 402 is stored by operation and is also performed the steps of in the above-mentioned computer program of memory 401
When receiving search instruction, map to obtain video file list based on above-mentioned first data block, wherein above-mentioned inspection Suo Zhiling includes time conditions;
Obtain data block corresponding to each complete video file in above-mentioned video file list;
In data block based on each data block at the beginning of video file and in data block at the end of video file Between, at the beginning of determining each complete video file and the end time;
The complete video file of above-mentioned time conditions will be met as search result.
In the 5th kind of possible embodiment provided based on the third above-mentioned possible embodiment, processing Device 402 is stored by operation and is also performed the steps of in the above-mentioned computer program of memory 401
When receiving data to be written, above-mentioned first data block is read;
Based on above-mentioned first data block, determine the freed data blocks in above-mentioned disk as data block to be written;
Above-mentioned data to be written are written in above-mentioned data block to be written;
After above-mentioned data to be written are written in above-mentioned data block to be written, above-mentioned first data block is updated.
In the 6th kind of possible embodiment provided based on the third above-mentioned possible embodiment, processing Device 402 is stored by operation and is also performed the steps of in the above-mentioned computer program of memory 401
Above-mentioned first data block is read, judges whether corresponding use information is damaged by above-mentioned Data block check position;
Impaired use information if it exists then restores above-mentioned use information by above-mentioned second data block.
Further, as shown in figure 4, above-mentioned electronic equipment may also include that one or more input equipments 403 (only show in Fig. 4 One out) and one or more output equipments 404 (one is only shown in Fig. 4).Memory 401, processor 402, input equipment 403 and output equipment 404 connected by bus 405.
It should be appreciated that in the embodiment of the present application, alleged processor 402 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at Reason device is also possible to any conventional processor etc..
Input equipment 403 may include keyboard, Trackpad, fingerprint adopt sensor (for acquire user finger print information and The directional information of fingerprint), microphone etc., output equipment 404 may include display, loudspeaker etc..
Memory 401 may include read-only memory and random access memory, and provide instruction sum number to processor 402 According to.Part or all of memory 401 can also include nonvolatile RAM.For example, memory 401 may be used also With the information of storage device type.
Therefore in the embodiment of the present application, electronic equipment deposits in the use information of data block each in disk One specific data block, so that can realize quickly positioning, and one by the specific data block when needing to read and write disk Determine to improve disk read-write performance in degree.When needing to use disk, either retrieval, write-in, recovery or the covering of data, It can quick execution.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of above-mentioned apparatus is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or external equipment software and electronic hardware.These functions are studied carefully Unexpectedly it is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technique people Member can use different methods to achieve the described function each specific application, but this realization is it is not considered that super Scope of the present application out.
In embodiment provided herein, it should be understood that disclosed device and method can pass through others Mode is realized.For example, system embodiment described above is only schematical, for example, the division of above-mentioned module or unit, Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be with In conjunction with or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed Mutual coupling or direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING of device or unit or Communication connection can be electrical property, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the application realizes above-described embodiment method In all or part of the process, relevant hardware can also be instructed to complete by computer program, above-mentioned computer journey Sequence can be stored in a computer readable storage medium, and the computer program is when being executed by processor, it can be achieved that above-mentioned each The step of embodiment of the method.Wherein, above-mentioned computer program includes computer program code, and above-mentioned computer program code can be with For source code form, object identification code form, executable file or certain intermediate forms etc..Above-mentioned computer readable storage medium can With include: can carry above-mentioned computer program code any entity or device, recording medium, USB flash disk, mobile disk, magnetic disk, CD, computer-readable memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that above-mentioned It is appropriate that the content that computer readable storage medium includes can be carried out according to the requirement made laws in jurisdiction with patent practice Increase and decrease, such as in certain jurisdictions, according to legislation and patent practice, computer readable storage medium do not include be electric load Wave signal and telecommunication signal.
Above above-described embodiment is only to illustrate the technical solution of the application, rather than its limitations;Although referring to aforementioned reality Example is applied the application is described in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope of each embodiment technical solution of the application that it does not separate the essence of the corresponding technical solution should all Comprising within the scope of protection of this application.

Claims (10)

1. a kind of disk management method characterized by comprising
Disk is divided into more than one data block, wherein the capacity of the data block is calculated by preset formula;
Scan the use information of each data block of the disk;
The use information for each data block that scanning obtains is deposited in preset first data block;
In disk system starting, the disk is read by first data block.
2. disk management method as described in claim 1, which is characterized in that in each data block for obtaining scanning After use information is deposited in preset first data block, the disk management method further include:
First data block is backed up in preset second data block, so that first data block and second data Block is mutually backups, wherein the position of second data block and first data block is at least separated by pre-determined distance;
It is described in disk system starting, pass through first data block and read the disk, comprising:
Detect whether first data block is damaged;
If first data block is not damaged, the disk is read by first data block;
If first data block has been damaged, the disk is read by second data block.
3. disk management method as claimed in claim 1 or 2, which is characterized in that the use information includes: data block ownership Stamp, data block location, in data block at the beginning of video file, the end time of video file, data block class in data block Type and Data block check position, wherein the data block ownership stamp indicates complete video file belonging to the data block.
4. disk management method as claimed in claim 3, which is characterized in that the disk management method further include:
It when receiving search instruction, maps to obtain video file list based on first data block, wherein the retrieval refers to Enabling includes time conditions;
Obtain data block corresponding to each complete video file in the video file list;
In data block based on each data block at the beginning of video file and in data block video file end time, really At the beginning of fixed each complete video file and the end time;
The complete video file of the time conditions will be met as search result.
5. disk management method as claimed in claim 3, which is characterized in that the disk management method further include:
When receiving data to be written, first data block is read;
Based on first data block, determine the freed data blocks in the disk as data block to be written;
The data to be written are written in the data block to be written;
After the data to be written are written in the data block to be written, first data block is updated.
6. disk management method as claimed in claim 3, which is characterized in that the disk management method further include:
First data block is read, judges whether corresponding use information is damaged by the Data block check position;
Impaired use information if it exists then restores the use information by second data block.
7. a kind of disk management device characterized by comprising
Division unit, for disk to be divided into more than one data block, wherein the capacity of the data block is by preset formula It is calculated;
Scanning element, the use information of each data block for scanning the disk;
The use information of storage unit, each data block for obtaining scanning is deposited in preset first data block;
Reading unit, for reading the disk by first data block in disk system starting.
8. disk management device as claimed in claim 7, which is characterized in that the disk management device further include:
Backup units, for backing up to first data block in preset second data block, so that first data block It is mutually backups with second data block, wherein the position of second data block and first data block is at least separated by pre- If distance;
The reading unit includes:
First data block detection sub-unit, for detecting whether first data block is damaged;
First data block reading subunit is read if not damaging for first data block by first data block The disk;
Second data block reading subunit is read if having damaged for first data block by second data block The disk.
9. a kind of electronic equipment, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as claim 1 to 6 when executing the computer program The step of any one the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as claim 1 to 6 of realization the method.
CN201880001664.6A 2018-10-16 2018-10-16 Disk management method, disk management device and electronic equipment Active CN109496292B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/110489 WO2020077534A1 (en) 2018-10-16 2018-10-16 Disk management method, disk management apparatus, and electronic device

Publications (2)

Publication Number Publication Date
CN109496292A true CN109496292A (en) 2019-03-19
CN109496292B CN109496292B (en) 2022-02-22

Family

ID=65713834

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201880001664.6A Active CN109496292B (en) 2018-10-16 2018-10-16 Disk management method, disk management device and electronic equipment

Country Status (2)

Country Link
CN (1) CN109496292B (en)
WO (1) WO2020077534A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416454A (en) * 2020-11-17 2021-02-26 浙江大华技术股份有限公司 Method and device for controlling starting of disk
CN113608683A (en) * 2021-06-30 2021-11-05 山东海量信息技术研究院 Cleaning method, system and related device for double-active magnetic disk
CN113741807A (en) * 2021-07-29 2021-12-03 苏州浪潮智能科技有限公司 Method, system, equipment and storage medium for improving system storage performance

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732494B (en) * 2020-12-29 2024-02-13 北京浪潮数据技术有限公司 Bad disk replacement method, device, equipment and medium of storage system
CN113687777B (en) * 2021-07-23 2023-08-08 苏州浪潮智能科技有限公司 Method, device, equipment and medium for predicting usable time length of magnetic disk
CN114489479B (en) * 2021-12-23 2023-06-09 北京云宽志业网络技术有限公司 Method and device for powering up and powering down data storage disk

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6189118B1 (en) * 1998-10-22 2001-02-13 Matsushita Electric Industrial Co., Ltd. Information recording medium, and method and apparatus for managing defect thereof
US20070180303A1 (en) * 2003-11-24 2007-08-02 Corbett Peter F Uniform and symmetric double failure correcting technique for protecting against two disk failures in a disk array
CN101446976A (en) * 2008-12-26 2009-06-03 中兴通讯股份有限公司 File storage method in distributed file system
CN103049400A (en) * 2012-12-27 2013-04-17 华为技术有限公司 Disk reconfiguration method and disk reconfiguration device
CN104268040A (en) * 2014-09-16 2015-01-07 深圳市腾讯计算机系统有限公司 Method and device for detecting disk performance
CN105893188A (en) * 2014-09-30 2016-08-24 伊姆西公司 Method and device for speeding up data reconstruction of disk array

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100578470C (en) * 2007-01-31 2010-01-06 浙江大学 Audio/video data access method and device based on raw device
CN104065906B (en) * 2014-07-09 2017-02-15 珠海全志科技股份有限公司 Video recording method and device of digital video recording equipment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6189118B1 (en) * 1998-10-22 2001-02-13 Matsushita Electric Industrial Co., Ltd. Information recording medium, and method and apparatus for managing defect thereof
US20070180303A1 (en) * 2003-11-24 2007-08-02 Corbett Peter F Uniform and symmetric double failure correcting technique for protecting against two disk failures in a disk array
CN101446976A (en) * 2008-12-26 2009-06-03 中兴通讯股份有限公司 File storage method in distributed file system
CN103049400A (en) * 2012-12-27 2013-04-17 华为技术有限公司 Disk reconfiguration method and disk reconfiguration device
CN104268040A (en) * 2014-09-16 2015-01-07 深圳市腾讯计算机系统有限公司 Method and device for detecting disk performance
CN105893188A (en) * 2014-09-30 2016-08-24 伊姆西公司 Method and device for speeding up data reconstruction of disk array

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416454A (en) * 2020-11-17 2021-02-26 浙江大华技术股份有限公司 Method and device for controlling starting of disk
CN113608683A (en) * 2021-06-30 2021-11-05 山东海量信息技术研究院 Cleaning method, system and related device for double-active magnetic disk
CN113608683B (en) * 2021-06-30 2024-05-07 山东海量信息技术研究院 Dual-live-disk cleaning method, system and related device
CN113741807A (en) * 2021-07-29 2021-12-03 苏州浪潮智能科技有限公司 Method, system, equipment and storage medium for improving system storage performance
CN113741807B (en) * 2021-07-29 2023-08-11 苏州浪潮智能科技有限公司 Method, system, equipment and storage medium for improving system storage performance

Also Published As

Publication number Publication date
CN109496292B (en) 2022-02-22
WO2020077534A1 (en) 2020-04-23

Similar Documents

Publication Publication Date Title
CN109496292A (en) A kind of disk management method, disk management device and electronic equipment
US8838875B2 (en) Systems, methods and computer program products for operating a data processing system in which a file delete command is sent to an external storage device for invalidating data thereon
US20220413706A1 (en) Data Storage Method, Apparatus and Storage System
JP5881859B2 (en) Storage device
US7444460B2 (en) Data storage device, method for updating management information in data storage device, and computer program
EP2545435B1 (en) Systems and methods for garbage collection in deduplicated data systems
US8856469B2 (en) Apparatus and method for logging optimization using non-volatile memory
US6675180B2 (en) Data updating apparatus that performs quick restoration processing
CN109614055B (en) Snapshot creating method and device, electronic equipment and machine-readable storage medium
EP3438845A1 (en) Data updating method and device for a distributed database system
CN109976669B (en) Edge storage method, device and storage medium
CN112115002B (en) Method and device for recovering file from damaged or untrusted mechanical hard disk
JP6089890B2 (en) Storage control device, storage control device control method, and storage control device control program
CN111382126B (en) System and method for deleting file and preventing file recovery
US6823348B2 (en) File manager for storing several versions of a file
TWI461904B (en) Recovery method and device for linux using fat file system
CN105830067A (en) Document information processing method, apparatus, and document processing apparatus and system
CN109325005A (en) A kind of data processing method and electronic equipment
US20100077283A1 (en) Apparatus to manage data stability and methods of storing and recovering data
CN107301073B (en) Configuration information retrieval method and device based on solid state disk system
EP3674876A1 (en) System and method of deletion of files and counteracting their restoration
Kuts et al. Deleted Data Recovery on Solid-State Drives by Software Based Methods
CN111143110A (en) Raid data recovery method based on metadata in logical volume management
CN112162950B (en) Data processing method and device based on file system and computer equipment
KR100887547B1 (en) Method and apparatus for checking the ratio of damaged data

Legal Events

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