CN104238960A - Hard disk formatting method, block data storage method based on hard disk and block data storage device based on hard disk - Google Patents

Hard disk formatting method, block data storage method based on hard disk and block data storage device based on hard disk Download PDF

Info

Publication number
CN104238960A
CN104238960A CN201410431452.5A CN201410431452A CN104238960A CN 104238960 A CN104238960 A CN 104238960A CN 201410431452 A CN201410431452 A CN 201410431452A CN 104238960 A CN104238960 A CN 104238960A
Authority
CN
China
Prior art keywords
hard disk
data block
sector
card
formatd
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
CN201410431452.5A
Other languages
Chinese (zh)
Other versions
CN104238960B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410431452.5A priority Critical patent/CN104238960B/en
Publication of CN104238960A publication Critical patent/CN104238960A/en
Application granted granted Critical
Publication of CN104238960B publication Critical patent/CN104238960B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The application provides a hard disk formatting method, a block data storage method based on a hard disk and a block data storage device based on a hard disk. According to the hard disk formatting method, a to-be-formatted disk surface is formatted according to the principle that sectors of each to-be-formatted disk surface are same in size, at least one to-be-formatted disk surface has different size with the sectors of residual to-be-formatted disk surfaces, and furthermore the sector size is not subjected to single restriction and can be approximate to or even equal to those of block data, so that block data different in size can be selectively stored in the sectors with sizes most approximate to those of the block data, the problem that multiple disk surfaces of the hard disk store one data block can be avoided, and the risk of whole data block invalidation caused by incapability of reading and writing the data of the disk surface if a magnetic head corresponding to one certain disk surface has a fault when multiple disk surfaces of the hard disk are used for storing data blocks in the prior art can be reduced.

Description

Formatting hard disk method and based on the data block storage means of hard disk and device
Technical field
The application relates to technical field of data storage, particularly relates to a kind of formatting hard disk method and based on the data block storage means of hard disk and device.
Background technology
Hard disk is a kind of External memory equipment of magnetic medium, its the most basic ingredient is the disc scribbling magnetic medium, the hard disk of different capabilities has the disc of varying number, each disc has two cards, in each card, take rotation axis as axle center, magnetic track is divided into some concentric circless that certain magnetic density is interval, each magnetic track is divided into again several sectors, and data on hard disk, each card have a magnetic head for reading and writing data by sector storage.
If be stored in hard disk by a file, the data block this file being divided into multiple fixed data size is needed to store.At present, in the prior art, all cards of all discs all adopt identical format mode, namely, the sector of 512 bytes that to be several sizes by each magnetic track universal formulation in each card be, or the sector of 4096 bytes that to be several sizes by each magnetic track universal formulation in each card be, to carry out data storage.
But, in this case, for larger data block, may store by multiple cards of hard disk, accordingly, multiple magnetic head can be used and read and write data, if magnetic head corresponding to some cards breaks down, by causing the data cannot reading and writing this card, whole data block is caused to lose efficacy the most at last.Further, need the card of use more when storing data block, the risk of this data block ultimate failure is larger.
Summary of the invention
The application a kind of formatting hard disk method can be provided and based on the data block storage means of hard disk and device, can reduce when may carry out storage data block by multiple cards of hard disk in prior art, if magnetic head corresponding to some cards breaks down, by causing the data cannot reading and writing this card, cause the risk that whole data block lost efficacy the most at last.
This application provides following scheme:
According to the first possible implementation of the first aspect of the application, the application provides a kind of formatting hard disk method, comprising:
Determine card to be formatd in hard disk;
Format card described to be formatd, wherein, the sector-size in each card to be formatd is identical, has at least a card to be formatd different from the sector-size remaining card to be formatd;
Described card described to be formatd to be formatd, specifically comprises:
The default magnetic track of card to be formatd described in magnetic head is moved to;
Described default magnetic track is divided into the sector of default size;
According to preset order, another default magnetic track of card to be formatd described in described magnetic head is moved to;
Another default magnetic track described is divided into the sector of default size, until divide complete to whole magnetic tracks of card described to be formatd.
In conjunction with the implementation that the second of first aspect is possible, described formatting hard disk method also comprises:
Described card described to be formatd formatd before, according to different preset range, the data block of described hard disk accumulative different sizes stored in predetermined period is divided into many groups;
Add up the quantity of the data block in every group;
Calculate the ratio of the quantity of the data block in each group;
Card to be formatd described in dividing according to described ratio, obtains many groups of cards to be formatd;
Then described card described to be formatd to be formatd, specifically comprises:
Respectively each group of card to be formatd is formatted into the sector of formed objects,
Wherein, the sector-size respectively in the card formatd in each group is the average of the size of all data blocks corresponding with the quantity used when dividing this group.
According to the first possible implementation of the second aspect of the application, the application provides a kind of hard disk form gasifying device, comprising:
Card determining unit, for determining card to be formatd in hard disk;
Formatting unit, for formaing card described to be formatd, wherein, the sector-size in each card to be formatd is identical, has at least a card to be formatd different from the sector-size remaining card to be formatd;
Described formatting unit is specifically for the default magnetic track of card to be formatd described in being moved to by magnetic head;
Described default magnetic track is divided into the sector of default size;
According to preset order, another default magnetic track of card to be formatd described in described magnetic head is moved to;
Another default magnetic track described is divided into the sector of default size, until divide complete to whole magnetic tracks of card described to be formatd.
In conjunction with the implementation that the second of second aspect is possible, described hard disk form gasifying device also comprises:
Data block grouped element, for described card described to be formatd formatd before, according to different preset range, the data block of described hard disk accumulative different sizes stored in predetermined period is divided into many groups;
Statistic unit, for adding up the quantity of the data block in every group;
Computing unit, for calculating the ratio of the quantity of the data block in each group;
Card grouped element, for card to be formatd described in dividing according to described ratio, obtains many groups of cards to be formatd;
Then described formatting unit, specifically for:
Respectively each group of card to be formatd is formatted into the sector of formed objects,
Wherein, the sector-size respectively in the card formatd in each group is the average of the size of all data blocks corresponding with the quantity used when dividing this group.
According to the first possible implementation of the third aspect of the application, the application provides a kind of hard disk, comprise: at least one disc, wherein, the card of at least one disc described adopts formatting hard disk method recited above and hard disk form gasifying device to format.
According to the first possible implementation of the fourth aspect of the application, the application provides a kind of data block storage means, is applied to hard disk recited above, and described data block storage means comprises:
Determine the size of data block to be stored;
According to the size of described data block to be stored, from described hard disk, search target sector;
Described data block to be stored is stored in described target sector.
In conjunction with the implementation that the second of fourth aspect is possible, the described size according to described data block to be stored, from described hard disk, search target sector, comprising:
Judge in described hard disk, whether to there is the equal-sized sector with described data block to be stored;
If there is the equal-sized sector with described data block to be stored in described hard disk, using the equal-sized sector with described data block to be stored as described target sector;
If there is not the equal-sized sector with described data block to be stored in described hard disk, judge whether described data block to be stored is more than or equal to sector maximum in described hard disk;
If described data block to be stored is more than or equal to the maximum sector in described hard disk, using described maximum sector as described target sector;
If described data block to be stored is less than the maximum sector in described hard disk, using in described hard disk with the immediate sector of size of described data block to be stored as described target sector.
According to the first possible implementation of the 5th aspect of the application, the application provides a kind of data block memory storage, is applied to hard disk recited above, and described data block memory storage comprises:
Data block determining unit, for determining the size of data block to be stored;
Search unit, for the size according to described data block to be stored, from described hard disk, search target sector;
Storage unit, for being stored to described data block to be stored in described target sector.
In conjunction with the implementation that the second of the 5th aspect is possible, described in search unit specifically for:
Judge in described hard disk, whether to there is the equal-sized sector with described data block to be stored;
If there is the equal-sized sector with described data block to be stored in described hard disk, using the equal-sized sector with described data block to be stored as described target sector;
If there is not the equal-sized sector with described data block to be stored in described hard disk, judge whether described data block to be stored is more than or equal to sector maximum in described hard disk;
If described data block to be stored is more than or equal to the maximum sector in described hard disk, using described maximum sector as described target sector;
If described data block to be stored is less than the maximum sector in described hard disk, using in described hard disk with the immediate sector of size of described data block to be stored as described target sector.
According to the specific embodiment that the application provides, this application discloses following technique effect:
Formatting hard disk method disclosed in the present application and based on the data block storage means of hard disk and device, can be identical according to the sector-size in each card to be formatd, the principle having at least card to be formatd different from the sector-size remaining card to be formatd formats card described to be formatd, and then sector-size can be made no longer to be subject to single restriction, but can be close with the size of data block even equal, like this, the data block of different size can be selected to be stored in its size in immediate sector, thus avoid adopting multiple cards of hard disk to store a data block as far as possible, and then reduce when may carry out storage data block by multiple cards of hard disk in prior art, if magnetic head corresponding to some cards breaks down, the data cannot reading and writing this card will be caused, cause the risk that whole data block lost efficacy the most at last.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present application or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment below, apparently, accompanying drawing in the following describes is only some embodiments of the application, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the process flow diagram of the formatting hard disk embodiment of the method 1 of the application;
Fig. 2 is a kind of structural representation of hard disk;
Fig. 3 is the process flow diagram of the formatting hard disk embodiment of the method 2 of the application;
Fig. 4 is the structural drawing of the hard disk form gasifying device embodiment 1 of the application;
Fig. 5 is the structural drawing of the hard disk form gasifying device embodiment 2 of the application;
Fig. 6 is the process flow diagram of the data block storage means embodiment 1 of the application;
Fig. 7 is the structural drawing of the data block memory storage embodiment 1 of the application;
Fig. 8 is the structural drawing of the computing node of the application.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present application, be clearly and completely described the technical scheme in the embodiment of the present application, obviously, described embodiment is only some embodiments of the present application, instead of whole embodiments.Based on the embodiment in the application, the every other embodiment that those of ordinary skill in the art obtain, all belongs to the scope of the application's protection.
From background technology, in prior art when carrying out storage data block by multiple cards of hard disk, if magnetic head corresponding to some cards breaks down, by causing the data cannot reading and writing this card, whole data block is caused to lose efficacy the most at last.
For this reason, this application discloses a kind of formatting hard disk method and based on the data block storage means of hard disk and device, can be identical according to the sector-size in each card to be formatd, the principle having at least card to be formatd different from the sector-size remaining card to be formatd formats card described to be formatd, and then sector-size can be made no longer to be subject to single restriction, but can be close with the size of data block even equal, like this, the data block of different size can be selected to be stored in its size in immediate sector, thus avoid adopting multiple cards of hard disk to store a data block as far as possible, and then reduce when may carry out storage data block by multiple cards of hard disk in prior art, if magnetic head corresponding to some cards breaks down, the data cannot reading and writing this card will be caused, cause the risk that whole data block lost efficacy the most at last.
For enabling above-mentioned purpose, the feature and advantage of the application more become apparent, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
Refer to the process flow diagram that accompanying drawing 1, Fig. 1 is the formatting hard disk embodiment of the method 1 of the application.As shown in Figure 1, the method can comprise:
S101: determine card to be formatd in hard disk.
S102: card described to be formatd is formatd.
It should be noted that, in this step, the sector-size in each card to be formatd is identical, has at least a card to be formatd different from the sector-size remaining card to be formatd;
Further, a kind of concrete mode that card described to be formatd is formatd is disclosed in the present embodiment:
The default magnetic track of card to be formatd described in magnetic head is moved to;
Described default magnetic track is divided into the sector of default size;
According to preset order, another default magnetic track of card to be formatd described in described magnetic head is moved to;
Another default magnetic track described is divided into the sector of default size, until divide complete to whole magnetic tracks of card described to be formatd.
It should be noted that further, the extended formatting mode that those skilled in the art expect according to the above-mentioned mode formatd card described to be formatd is also within the application's protection domain.
Fig. 2 illustrates a kind of structural representation of hard disk, for Fig. 2, determine that card 1 in hard disk, card 2, card 3 and card 4 are all cards to be formatd, in prior art, card 1, card 2, card 3 and card 4 are all format according to identical mode, that is, card 1, card 2, card 3 and card 4 are all divided into the sector of formed objects.And in the present embodiment, the sector-size in card same to be formatd is identical, the sector-size in the card that difference is to be formatd can be different, for card 1 and card 2, and sector 1, 2, 3, 13, 14, the size of 15 is identical, sector 4, 5, 6, 16, 17, the size of 18 is identical, but sector 1, 2, 3, 13, 14, 15 with sector 4, 5, 6, 16, 17, 18 vary in size, sector-size mentioned here can be 512 bytes conventional in prior art or 4096 bytes, but be not limited only to above-mentioned two kinds, due to, different user groups, it uses the size of the data block of hard-disc storage also not identical, therefore, sector-size in the card that difference is to be formatd can be determined according to the size of data block to be stored, concrete, can before certain batch of hard disk dispatches from the factory, the user group corresponding according to this batch of hard disk order uses the card of data block size to this batch of hard disk of hard-disc storage to format, such as, after user group corresponding to this batch of hard disk order is often divided into the data block of multiple 1M or 2M size a large packet, again by it stored in the sector in hard disk, so, before dispatching from the factory, just the card each to be formatd of this batch of hard disk is formatted into the sector of 1M or 2M size, as for the card quantity that two kinds of size sectors are corresponding, can determine further the frequency of utilization of the data block of two kinds of sizes according to this user group, if use the frequency of 1M larger, then most card is formatted into the sector of 1M size, minority card is formatted into the sector of 2M size, also can after it dispatches from the factory, hard disk is formatd according to the data block size of hard-disc storage during its actual use by user oneself, concrete format mode with dispatch from the factory before format mode similar, to this, the present embodiment repeats no more.
As shown in the above, formatting hard disk method of the present invention compared with prior art, maximum difference is: be the sector that disposablely can only arrange all cards in prior art be specific size, and different cards can be formatted into the sector of different size by the present invention, also be, the size of sector in each card can be provided separately, and, concrete size is not by the restriction of some particular values, but, sector-size can change due to different use scenes (such as different user groups), therefore, the present embodiment does not limit the sector-size adopted during formatting hard disk, different application scenarioss, as long as adopt said formatting hard disk method in this enforcement, all within the protection domain of the application.
Present embodiment discloses a kind of formatting hard disk method, can be identical according to the sector-size in each card to be formatd, the principle having at least card to be formatd different from the sector-size remaining card to be formatd formats card described to be formatd, and then sector-size can be made no longer to be subject to single restriction, but can be close with the size of data block even equal, like this, the data block of different size can be selected to be stored in its size in immediate sector, thus avoid adopting multiple cards of hard disk to store a data block as far as possible, and then reduce when may carry out storage data block by multiple cards of hard disk in prior art, if magnetic head corresponding to some cards breaks down, the data cannot reading and writing this card will be caused, cause the risk that whole data block lost efficacy the most at last.
Refer to the process flow diagram that accompanying drawing 3, Fig. 3 is the formatting hard disk embodiment of the method 2 of the application.As shown in Figure 3, the method can comprise:
S200: determine card to be formatd in hard disk.
It should be noted that, card to be formatd can be whole cards of hard disk can be also part card, and concrete, said whole card herein, refers to the card of not carrying out the hard disk formatd when dispatching from the factory.Said a part of card herein, the hard disk referred to after only formaing a part of card when dispatching from the factory remains card.Wherein, formatted card both can adopt existing format mode, also can adopt the formatting method described in formatting hard disk embodiment of the method 1.
S201: the data block of described hard disk accumulative different sizes stored in predetermined period is divided into many groups according to different preset range.
Predetermined period mentioned here can be one week or one month, but is not limited thereto.This predetermined period can be set to certain attribute of hard disk before hard disk dispatches from the factory, and also can be arranged by user.
And different preset range also can be set to certain attribute of hard disk before hard disk dispatches from the factory, also can be arranged by user, such as, 512 byte ~ 1024 bytes are the first scope, then, be everyly more than or equal to 512 bytes, be less than the data of 1024 bytes, can assign in group corresponding to the first scope, 1024 byte ~ 2048 bytes are the second scope, then, be everyly more than or equal to 1024 bytes, be less than the data of 2048 bytes, can assign in group corresponding to the second scope.
S202: the quantity of adding up the data block in every group.
S203: the ratio calculating the quantity of the data block in each group.
S204: card to be formatd described in dividing according to described ratio, obtains many groups of cards to be formatd.
S205: the sector respectively each group of card to be formatd being formatted into formed objects.
It should be noted that, the sector-size respectively in the card formatd in each group is the average of the size of all data blocks corresponding with the quantity used when dividing this group.
In the present embodiment, the format of hard disk card is relevant to the service condition of hard disk, that is, if the data block of a certain size of hard-disc storage is more, so, just have relatively many cards in this hard disk to format according to the data block of this size, if the data block of a certain size of hard-disc storage is less, so, have relatively less card in this hard disk to format according to the data block of this size.In this case, can ensure that the data block of all size can be stored in the sector close with its size as far as possible, and then reduce the risk of data block inefficacy further.
Based on foregoing, the embodiment of the invention also discloses a kind of hard disk form gasifying device, refer to the structural drawing that accompanying drawing 4, Fig. 4 is the hard disk form gasifying device embodiment 1 of the application, this hard disk form gasifying device comprises:
Card determining unit 11, for determining card to be formatd in hard disk;
Formatting unit 12, for formaing card described to be formatd, wherein, the sector-size in each card to be formatd is identical, has at least a card to be formatd different from the sector-size remaining card to be formatd;
It should be noted that, described formatting unit 12 is specifically for the default magnetic track of card to be formatd described in being moved to by magnetic head;
Described default magnetic track is divided into the sector of default size;
According to preset order, another default magnetic track of card to be formatd described in described magnetic head is moved to;
Another default magnetic track described is divided into the sector of default size, until divide complete to whole magnetic tracks of card described to be formatd.
It should be noted that further, the concrete function about above-mentioned unit realizes being described in detail in formatting hard disk embodiment of the method 1, repeats no more in the present embodiment.
Refer to the structural drawing that accompanying drawing 5, Fig. 5 is the hard disk form gasifying device embodiment 2 of the application, this hard disk form gasifying device comprises:
Card determining unit 21, for determining card to be formatd in hard disk.
Data block grouped element 22, for described card described to be formatd formatd before, according to different preset range, the data block of described hard disk accumulative different sizes stored in predetermined period is divided into many groups;
Statistic unit 23, for adding up the quantity of the data block in every group;
Computing unit 24, for calculating the ratio of the quantity of the data block in each group;
Card grouped element 25, for card to be formatd described in dividing according to described ratio, obtains many groups of cards to be formatd;
Formatting unit 26, specifically for:
Respectively each group of card to be formatd is formatted into the sector of formed objects,
Wherein, the sector-size respectively in the card formatd in each group is the average of the size of all data blocks corresponding with the quantity used when dividing this group.
It should be noted that, the concrete function about above-mentioned unit realizes being described in detail in formatting hard disk embodiment of the method 2, repeats no more in the present embodiment.
It should be noted that, the embodiment of the invention also discloses a kind of hard disk, hard disc structure shown in the structure of this hard disk and Fig. 2 is similar, namely at least one disc is comprised, wherein, the card of at least one disc described adopts the formatting hard disk method described in any one embodiment in above-mentioned formatting hard disk embodiment of the method 1 ~ 2 and the hard disk form gasifying device described in any one embodiment in above-mentioned hard disk form gasifying device embodiment 1 ~ 2 to carry out formaing.
Refer to the process flow diagram that accompanying drawing 6, Fig. 6 is the data block storage means embodiment 1 of the application.This data block storage means is applied to the disk after adopting the formatting hard disk method described in any one embodiment in above-mentioned formatting hard disk embodiment of the method 1 ~ 2 and the hard disk form gasifying device described in any one embodiment in above-mentioned hard disk form gasifying device embodiment 1 ~ 2 to format.As shown in Figure 6, the method can comprise:
S501: the size determining data block to be stored.
Data block to be stored can be polytype data, and the present embodiment does not do any restriction.
S502: according to the size of described data block to be stored, search target sector from described hard disk.
Wherein, this step specifically comprises:
Judge in described hard disk, whether to there is the equal-sized sector with described data block to be stored;
If there is the equal-sized sector with described data block to be stored in described hard disk, using the equal-sized sector with described data block to be stored as described target sector;
If there is not the equal-sized sector with described data block to be stored in described hard disk, judge whether described data block to be stored is more than or equal to sector maximum in described hard disk;
If described data block to be stored is more than or equal to the maximum sector in described hard disk, using described maximum sector as described target sector;
If described data block to be stored is less than the maximum sector in described hard disk, using in described hard disk with the immediate sector of size of described data block to be stored as described target sector.
S503: described data block to be stored is stored in described target sector.
Present embodiment discloses a kind of data block storage means, the data block of different size can be selected to be stored in its size in immediate sector, thus avoid adopting multiple cards of hard disk to store a data block as far as possible, and then reduce when may carry out storage data block by multiple cards of hard disk in prior art, if magnetic head corresponding to some cards breaks down, by causing the data cannot reading and writing this card, cause the risk that whole data block lost efficacy the most at last.
Refer to the structural drawing that accompanying drawing 7, Fig. 7 is data block memory storage embodiment 1 disclosed in the present application.This data block memory storage is applied to the hard disk after adopting the formatting hard disk method described in any one embodiment in above-mentioned formatting hard disk embodiment of the method 1 ~ 2 and the hard disk form gasifying device described in any one embodiment in above-mentioned hard disk form gasifying device embodiment 1 ~ 2 to format.As shown in Figure 7, this device can comprise:
Data block determining unit 51, for determining the size of data block to be stored.
Search unit 52, for the size according to described data block to be stored, from described hard disk, search target sector.
Storage unit 53, for being stored to described data block to be stored in described target sector.
Wherein, described in search unit specifically for, judge in described hard disk, whether to there is the equal-sized sector with described data block to be stored;
If there is the equal-sized sector with described data block to be stored in described hard disk, using the equal-sized sector with described data block to be stored as described target sector;
If there is not the equal-sized sector with described data block to be stored in described hard disk, judge whether described data block to be stored is more than or equal to sector maximum in described hard disk;
If described data block to be stored is more than or equal to the maximum sector in described hard disk, using described maximum sector as described target sector;
If described data block to be stored is less than the maximum sector in described hard disk, using in described hard disk with the immediate sector of size of described data block to be stored as described target sector.
It should be noted that, the concrete function about unit in above-mentioned data block memory storage embodiment 1 realizes, and be described in detail in data block storage means embodiment 1, specifically refer to the associated description of embodiment of the method, the present embodiment repeats no more
In addition, the embodiment of the present application additionally provides a kind of computing node, computing node may be the host server comprising computing power, or personal computer PC, or portable portable computer or terminal etc., the application's specific embodiment does not limit the specific implementation of computing node.
Fig. 8 is the structural drawing of the computing node of the application.As shown in Figure 8, computing node 700 comprises:
Processor (processor) 710, communication interface (Communications Interface) 720, storer (memory) 730, bus 740.
Processor 710, communication interface 720, storer 730 completes mutual communication by bus 740.
Processor 710, for executive routine 732.
Particularly, program 732 can comprise program code, and described program code comprises computer-managed instruction.This instruction has been used to indicate the data block storage means in formatting hard disk method in formatting hard disk embodiment of the method 1 ~ 2 disclosed in any one embodiment and data block storage means embodiment 1 disclosed in any one embodiment.
Processor 710 may be a central processor CPU, or specific integrated circuit ASIC (Application Specific Integrated Circuit), or is configured to the one or more integrated circuit implementing the embodiment of the present application.
Storer 730, for depositing program 732.Storer 730 may comprise high-speed RAM storer, still may comprise nonvolatile memory (non-volatile memory), such as at least one magnetic disk memory.
Finally, also it should be noted that, in this article, the such as relational terms of first and second grades and so on is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply the relation that there is any this reality between these entities or operation or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thus make to comprise the process of a series of key element, method, article or equipment and not only comprise those key elements, but also comprise other key elements clearly do not listed, or also comprise by the intrinsic key element of this process, method, article or equipment.When not more restrictions, the key element limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment comprising described key element and also there is other identical element.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the application can add required hardware platform by software and realize, can certainly all be implemented by hardware, but in a lot of situation, the former is better embodiment.Based on such understanding, what the technical scheme of the application contributed to background technology can embody with the form of software product in whole or in part, this computer software product can be stored in storage medium, as ROM/RAM, magnetic disc, CD etc., comprising some instructions in order to make a computer equipment (can be personal computer, server, or the network equipment etc.) perform the method described in some part of each embodiment of the application or embodiment.
In this instructions, each embodiment adopts the mode of going forward one by one to describe, and what each embodiment stressed is the difference with other embodiments, between each embodiment identical similar portion mutually see.For system disclosed in embodiment, because it corresponds to the method disclosed in Example, so description is fairly simple, relevant part illustrates see method part.
Apply specific case herein to set forth the principle of the application and embodiment, the explanation of above embodiment is just for helping method and the core concept thereof of understanding the application; Meanwhile, for one of ordinary skill in the art, according to the thought of the application, all will change in specific embodiments and applications.In sum, this description should not be construed as the restriction to the application.

Claims (9)

1. a formatting hard disk method, is characterized in that, comprising:
Determine card to be formatd in hard disk;
Format card described to be formatd, wherein, the sector-size in each card to be formatd is identical, has at least a card to be formatd different from the sector-size remaining card to be formatd;
Described card described to be formatd to be formatd, specifically comprises:
The default magnetic track of card to be formatd described in magnetic head is moved to;
Described default magnetic track is divided into the sector of default size;
According to preset order, another default magnetic track of card to be formatd described in described magnetic head is moved to;
Another default magnetic track described is divided into the sector of default size, until divide complete to whole magnetic tracks of card described to be formatd.
2. according to the formatting hard disk method described in claim 1, it is characterized in that, described formatting hard disk method also comprises:
Described card described to be formatd formatd before, according to different preset range, the data block of described hard disk accumulative different sizes stored in predetermined period is divided into many groups;
Add up the quantity of the data block in every group;
Calculate the ratio of the quantity of the data block in each group;
Card to be formatd described in dividing according to described ratio, obtains many groups of cards to be formatd;
Then described card described to be formatd to be formatd, specifically comprises:
Respectively each group of card to be formatd is formatted into the sector of formed objects,
Wherein, the sector-size respectively in the card formatd in each group is the average of the size of all data blocks corresponding with the quantity used when dividing this group.
3. a hard disk form gasifying device, is characterized in that, comprising:
Card determining unit, for determining card to be formatd in hard disk;
Formatting unit, for formaing card described to be formatd, wherein, the sector-size in each card to be formatd is identical, has at least a card to be formatd different from the sector-size remaining card to be formatd;
Described formatting unit is specifically for the default magnetic track of card to be formatd described in being moved to by magnetic head;
Described default magnetic track is divided into the sector of default size;
According to preset order, another default magnetic track of card to be formatd described in described magnetic head is moved to;
Another default magnetic track described is divided into the sector of default size, until divide complete to whole magnetic tracks of card described to be formatd.
4. hard disk form gasifying device according to claim 3, is characterized in that, also comprise:
Data block grouped element, for described card described to be formatd formatd before, according to different preset range, the data block of described hard disk accumulative different sizes stored in predetermined period is divided into many groups;
Statistic unit, for adding up the quantity of the data block in every group;
Computing unit, for calculating the ratio of the quantity of the data block in each group;
Card grouped element, for card to be formatd described in dividing according to described ratio, obtains many groups of cards to be formatd;
Then described formatting unit, specifically for:
Respectively each group of card to be formatd is formatted into the sector of formed objects,
Wherein, the sector-size respectively in the card formatd in each group is the average of the size of all data blocks corresponding with the quantity used when dividing this group.
5. a hard disk, it is characterized in that, comprise: at least one disc, wherein, the card of at least one disc described adopts as the hard disk form gasifying device in the formatting hard disk method in claim 1 ~ 2 as described in any one and claim 3 ~ 4 as described in any one formats.
6. a data block storage means, is characterized in that, is applied to hard disk according to claim 5, and described data block storage means comprises:
Determine the size of data block to be stored;
According to the size of described data block to be stored, from described hard disk, search target sector;
Described data block to be stored is stored in described target sector.
7. data block storage means according to claim 6, is characterized in that, the described size according to described data block to be stored, searches target sector, comprising from described hard disk:
Judge in described hard disk, whether to there is the equal-sized sector with described data block to be stored;
If there is the equal-sized sector with described data block to be stored in described hard disk, using the equal-sized sector with described data block to be stored as described target sector;
If there is not the equal-sized sector with described data block to be stored in described hard disk, judge whether described data block to be stored is more than or equal to sector maximum in described hard disk;
If described data block to be stored is more than or equal to the maximum sector in described hard disk, using described maximum sector as described target sector;
If described data block to be stored is less than the maximum sector in described hard disk, using in described hard disk with the immediate sector of size of described data block to be stored as described target sector.
8. a data block memory storage, is characterized in that, is applied to hard disk according to claim 5, and described data block memory storage comprises:
Data block determining unit, for determining the size of data block to be stored;
Search unit, for the size according to described data block to be stored, from described hard disk, search target sector;
Storage unit, for being stored to described data block to be stored in described target sector.
9. data block memory storage according to claim 8, is characterized in that, described in search unit specifically for:
Judge in described hard disk, whether to there is the equal-sized sector with described data block to be stored;
If there is the equal-sized sector with described data block to be stored in described hard disk, using the equal-sized sector with described data block to be stored as described target sector;
If there is not the equal-sized sector with described data block to be stored in described hard disk, judge whether described data block to be stored is more than or equal to sector maximum in described hard disk;
If described data block to be stored is more than or equal to the maximum sector in described hard disk, using described maximum sector as described target sector;
If described data block to be stored is less than the maximum sector in described hard disk, using in described hard disk with the immediate sector of size of described data block to be stored as described target sector.
CN201410431452.5A 2014-08-28 2014-08-28 Formatting hard disk method and data block storage method and device based on hard disk Active CN104238960B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410431452.5A CN104238960B (en) 2014-08-28 2014-08-28 Formatting hard disk method and data block storage method and device based on hard disk

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410431452.5A CN104238960B (en) 2014-08-28 2014-08-28 Formatting hard disk method and data block storage method and device based on hard disk

Publications (2)

Publication Number Publication Date
CN104238960A true CN104238960A (en) 2014-12-24
CN104238960B CN104238960B (en) 2017-11-24

Family

ID=52227127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410431452.5A Active CN104238960B (en) 2014-08-28 2014-08-28 Formatting hard disk method and data block storage method and device based on hard disk

Country Status (1)

Country Link
CN (1) CN104238960B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016115920A1 (en) * 2015-01-23 2016-07-28 中兴通讯股份有限公司 Storage management method and apparatus and streaming media system
CN107229422A (en) * 2017-05-31 2017-10-03 郑州云海信息技术有限公司 Data processing method and device
CN107992267A (en) * 2017-11-23 2018-05-04 郑州云海信息技术有限公司 A kind of method and system of the serial automatically formatting of more hard disks
CN110427157A (en) * 2019-07-19 2019-11-08 苏州浪潮智能科技有限公司 A kind of formatting method and relevant apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5778650A (en) * 1980-10-30 1982-05-17 Toshiba Corp Optical recording body
JPH06342345A (en) * 1992-11-12 1994-12-13 Mitsumi Electric Co Ltd Disk drive and method for formatting magnetic disk
CN1874490A (en) * 2006-06-30 2006-12-06 华中科技大学 Disk buffering method in use for video on demand system of peer-to-peer network
US20090168230A1 (en) * 2007-12-28 2009-07-02 Kirk Hwang Mixed format disk drive
CN103678026A (en) * 2012-09-18 2014-03-26 杭州海康威视***技术有限公司 Storing and repairing method and storing and repairing device for repairable video monitoring data

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5778650A (en) * 1980-10-30 1982-05-17 Toshiba Corp Optical recording body
JPH06342345A (en) * 1992-11-12 1994-12-13 Mitsumi Electric Co Ltd Disk drive and method for formatting magnetic disk
CN1874490A (en) * 2006-06-30 2006-12-06 华中科技大学 Disk buffering method in use for video on demand system of peer-to-peer network
US20090168230A1 (en) * 2007-12-28 2009-07-02 Kirk Hwang Mixed format disk drive
CN103678026A (en) * 2012-09-18 2014-03-26 杭州海康威视***技术有限公司 Storing and repairing method and storing and repairing device for repairable video monitoring data

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016115920A1 (en) * 2015-01-23 2016-07-28 中兴通讯股份有限公司 Storage management method and apparatus and streaming media system
CN105867836A (en) * 2015-01-23 2016-08-17 中兴通讯股份有限公司 Storage management method and apparatus as well as stream media system
CN107229422A (en) * 2017-05-31 2017-10-03 郑州云海信息技术有限公司 Data processing method and device
CN107229422B (en) * 2017-05-31 2020-05-26 苏州浪潮智能科技有限公司 Data processing method and device
CN107992267A (en) * 2017-11-23 2018-05-04 郑州云海信息技术有限公司 A kind of method and system of the serial automatically formatting of more hard disks
CN110427157A (en) * 2019-07-19 2019-11-08 苏州浪潮智能科技有限公司 A kind of formatting method and relevant apparatus
CN110427157B (en) * 2019-07-19 2022-07-22 苏州浪潮智能科技有限公司 Formatting method and related device

Also Published As

Publication number Publication date
CN104238960B (en) 2017-11-24

Similar Documents

Publication Publication Date Title
CN103577336B (en) A kind of stored data processing method and device
US10545683B2 (en) Asymmetric storage data distribution
CN103500072A (en) Data migration method and data migration device
CN103778071A (en) Cache space distribution method and device
CN103136243A (en) File system duplicate removal method and device based on cloud storage
CN103324533A (en) distributed data processing method, device and system
CN104238960A (en) Hard disk formatting method, block data storage method based on hard disk and block data storage device based on hard disk
CN103513938A (en) System expansion method and device of redundant array of independent disks (RAID)
CN104239518A (en) Repeated data deleting method and device
CN103678143A (en) File storage method and device and electronic equipment
CN105487823A (en) Data migration method and device
US11385823B2 (en) Method, electronic device and computer program product for rebuilding disk array
CN110147203B (en) File management method and device, electronic equipment and storage medium
KR20180013771A (en) Weighted data striping
CN104951342A (en) Method and device for adjusting starting sequence
CN107291392A (en) A kind of solid state hard disc and its reading/writing method
CN102945275B (en) File defragmentation method, device and equipment
CN115657960B (en) Disk array initialization method, device, equipment and readable storage medium
US8924642B2 (en) Monitoring record management method and device
US8352707B2 (en) Implementing enhanced host to physical storage mapping using numerical compositions for persistent media
CN104714957A (en) List structure changing method and device
CN104007938A (en) Key value generating method and device in storage network
CN103827837B (en) Access the method in solid state hard disc space, Apparatus and system
CN103049391B (en) Data processing method and equipment
CN104657216A (en) Resource allocation method and device for resource pool

Legal Events

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