CN106802775A - A kind of date storage method and device - Google Patents

A kind of date storage method and device Download PDF

Info

Publication number
CN106802775A
CN106802775A CN201710033969.2A CN201710033969A CN106802775A CN 106802775 A CN106802775 A CN 106802775A CN 201710033969 A CN201710033969 A CN 201710033969A CN 106802775 A CN106802775 A CN 106802775A
Authority
CN
China
Prior art keywords
separate storage
storage region
available
memory space
writing 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.)
Pending
Application number
CN201710033969.2A
Other languages
Chinese (zh)
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.)
Zhengzhou Yunhai Information Technology Co Ltd
Original Assignee
Zhengzhou Yunhai Information 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 Zhengzhou Yunhai Information Technology Co Ltd filed Critical Zhengzhou Yunhai Information Technology Co Ltd
Priority to CN201710033969.2A priority Critical patent/CN106802775A/en
Publication of CN106802775A publication Critical patent/CN106802775A/en
Pending legal-status Critical Current

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/0604Improving or facilitating administration, e.g. storage management
    • 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
    • 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/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a kind of date storage method and device, including:At least two separate storage regions are created on hard disk, is also included:Data storage request is received, wherein, the data storage request carries data to be stored;Determine each described completed reading and writing data number of times of separate storage region;Corresponding completed reading and writing data number of times is distinguished according to each described separate storage region, at least one available separate storage region is determined from least two separate storage region;By the data storage to be stored to described at least one available separate storage region.The present invention can improve the service life of hard disk.

Description

A kind of date storage method and device
Technical field
The present invention relates to network communication technology field, more particularly to a kind of date storage method and device.
Background technology
With the development of cloud computing technology, rate request more and more higher of the user for data storage.To better meet This demand of user, SSD (Solid State Drives, solid state hard disc) arises at the historic moment.SSD is to store core with solid-state electronic The hard disk that chip arrays are made, and the mechanical part in traditional magnetic disk using the activity such as magnetic head has been abandoned, so as to improve data deposit The speed of storage.
At present, SSD is when data storage is carried out, mainly by one point of same business datum fixed storage to SSD In area.So, when the business datum of the species is continually changing, it is necessary to carry out continuous read-write operation to corresponding subregion, And constantly read-write operation can increase the abrasion of the partitioned storage chip, and then shorten the service life of whole SSD.
The content of the invention
A kind of date storage method and device are the embodiment of the invention provides, the service life of hard disk can be effectively improved.
In a first aspect, the embodiment of the invention provides a kind of date storage method, at least two are created on hard disk independent Storage region, also includes:
Data storage request is received, wherein, the data storage request carries data to be stored;
Determine each described completed reading and writing data number of times of separate storage region;
Corresponding completed reading and writing data number of times is distinguished according to each described separate storage region, from described at least two At least one available separate storage region is determined in individual separate storage region;
By the data storage to be stored to described at least one available separate storage region.
Preferably,
It is described reception data storage request before, it is described created on hard disk at least two separate storage regions it Afterwards, further include:
Statistical table is set;It is corresponding complete each described separate storage region difference to be stored using the statistical table Into reading and writing data number of times;
Described each described completed reading and writing data number of times of separate storage region of determination, including:
The statistical table is inquired about, and determines that each described separate storage region has been completed in the statistical table Reading and writing data number of times;
It is described that corresponding completed reading and writing data number of times is distinguished according to each described separate storage region, from it is described to At least one available separate storage region is determined in few two separate storage regions, including:
In each described completed reading and writing data number of times, at least one relatively minimal described completed number is selected According to read-write number of times;Determine each described relatively minimal corresponding separate storage region of described completed reading and writing data number of times It is available separate storage region.
Preferably,
Further include:
Determine the memory space of each available separate storage region;
It is described by the data storage to be stored to described at least one available separate storage region, including:
According to the memory space of each available separate storage region, available independently deposited from described at least one Target separate storage region is determined in storage area domain;
By the data storage to be stored to the target separate storage region.
Preferably,
Further include:
Determine that each block in each described available separate storage region distinguishes corresponding memory space;
The memory space according to each available separate storage region, it is available only from described at least one Available target separate storage region is determined in vertical storage region, including:
Using equation below (1), the memory space utilization rate of each available separate storage region is calculated;
Wherein, μiCharacterize the memory space utilization rate of available separate storage region described in i-th;mijCharacterize i-th institute State the memory space of block described in j-th in available separate storage region;UiCharacterize and available independently deposited described in i-th The memory space in storage area domain;kiCharacterize the quantity of the block in available separate storage region described in i-th;
The minimum corresponding available separate storage region of the memory space utilization rate is defined as available mesh Mark separate storage region.
Preferably,
It is described by the data storage to be stored to the target separate storage region after, further include:
The corresponding completed reading and writing data number of times of the target separate storage region in the statistical table is added 1.
Preferably,
It is described by the data storage to be stored to described at least one available separate storage region, including:
By the data storage to be stored to available separate storage region each described.
Second aspect, the embodiment of the invention provides a kind of data storage device, including:
Creating unit, for creating at least two separate storage regions on hard disk;
Receiving unit, for receiving data storage request, wherein, the data storage request carries data to be stored;
First determining unit, for determining that each described separate storage region that the creating unit is created has been completed Reading and writing data number of times;
Second determining unit, for each the described separate storage region point determined according to first determining unit Not corresponding completed reading and writing data number of times, determines that at least one is available from least two separate storage region Separate storage region;
First memory cell, for by the data storage to be stored to second determining unit determine described at least One available separate storage region.
Preferably,
Further include:
Setting unit, for setting statistical table;
Second memory cell, it is corresponding for storing each described separate storage region difference using the statistical table Completed reading and writing data number of times;
First determining unit, for inquiring about the statistical table, and determines each in the statistical table The completed reading and writing data number of times of separate storage region;
Second determining unit, in each described completed reading and writing data number of times, selecting at least one phase To minimum described completed reading and writing data number of times;Determine each described relatively minimal described completed reading and writing data The corresponding separate storage region of number of times is available separate storage region.
Preferably,
Further include:
3rd determining unit, the memory space for determining each available separate storage region;
First memory cell, including:Determination subelement and storing sub-units;Wherein,
The determination subelement, for the memory space according to each available separate storage region, from described Target separate storage region is determined at least one available separate storage region;
The storing sub-units, for the mesh for determining the data storage to be stored to the determination subelement Mark separate storage region.
Preferably,
Further include:
4th determining unit, for determining that each block in each described available separate storage region is corresponded to respectively Memory space;
The determination subelement, for using equation below (1), calculating each available separate storage region Memory space utilization rate;
Wherein, μiCharacterize the memory space utilization rate of available separate storage region described in i-th;mijCharacterize i-th institute State the memory space of block described in j-th in available separate storage region;UiCharacterize and available independently deposited described in i-th The memory space in storage area domain;kiCharacterize the quantity of the block in available separate storage region described in i-th;
The minimum corresponding available separate storage region of the memory space utilization rate is defined as target independence Storage region.
A kind of date storage method and device are the embodiment of the invention provides, at least two are created independently by hard disk Storage region, wherein, each separate storage region can be used to store various different types of business datums, therefore, no matter When being that any business datum needs storage, the completed read-write number of times of each separate storage region is can first determine that, so Corresponding completed read-write number of times is distinguished according to each separate storage region afterwards, is determined from all of separate storage region Go out at least one available separate storage region, finally stored.Due to being no longer to store data into fixed a certain area Domain, but according to the completed read-write number of times position that dynamically adjustment is stored of each separate storage region, therefore, can effectively keep away The storage chip for exempting to cause some region of read-write repeatedly weares and teares, and improve the service life of DISK to Image.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are the present invention Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis These accompanying drawings obtain other accompanying drawings.
Fig. 1 is a kind of flow chart of date storage method that one embodiment of the invention is provided;
Fig. 2 is a kind of flow chart of date storage method that another embodiment of the present invention is provided;
Fig. 3 is the hardware structure figure of equipment where data storage device provided in an embodiment of the present invention;
Fig. 4 is a kind of structural representation of data storage device that one embodiment of the invention is provided;
Fig. 5 is a kind of structural representation of data storage device that another embodiment of the present invention is provided;
Fig. 6 is a kind of structural representation of data storage device that further embodiment of the present invention is provided;
Fig. 7 is a kind of structural representation of data storage device that another embodiment of the invention is provided.
Specific embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is A part of embodiment of the present invention, rather than whole embodiments, based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained on the premise of creative work is not made, belongs to the scope of protection of the invention.
As shown in figure 1, the embodiment of the invention provides a kind of date storage method, the method may comprise steps of:
Step 101:At least two separate storage regions are created on hard disk.
Step 102:Data storage request is received, wherein, the data storage request carries data to be stored.
Step 103:Determine each described completed reading and writing data number of times of separate storage region.
Step 104:Corresponding completed reading and writing data number of times is distinguished according to each described separate storage region, from institute State and determine at least one available separate storage region at least two separate storage regions.
Step 105:By the data storage to be stored to described at least one available separate storage region.
In the embodiment illustrated in fig. 1, by creating at least two separate storage regions on hard disk, wherein, each Separate storage region can be used to store various different types of business datums, therefore, either any business datum is needed When storing, the completed read-write number of times of each separate storage region is can first determine that, then according to each separate storage Corresponding completed read-write number of times is distinguished in region, and at least one available independence is determined from all of separate storage region Storage region, is finally stored.Due to being no longer to store data into fixed a certain region, but according to each independence The completed read-write number of times position that dynamically adjustment is stored of storage region, therefore, can be prevented effectively from and read repeatedly some region of The storage chip abrasion write and cause, improve the service life of DISK to Image.
In an embodiment of the invention, corresponding completion is distinguished in order to determine each separate storage region Read-write number of times, before the step 102, after the step 101, further include:Statistical table is set;Using institute State statistical table and store each described separate storage region and distinguish corresponding completed reading and writing data number of times;The step 103 specific embodiment may include:The statistical table is inquired about, and determines that each is described solely in the statistical table The completed reading and writing data number of times of vertical storage region;The specific embodiment of the step 104 may include:Complete described in each Into reading and writing data number of times in, select at least one relatively minimal described completed reading and writing data number of times;Determine each The relatively minimal corresponding separate storage region of described completed reading and writing data number of times is available separate storage region.
For example, create 5 separate storage regions in a hard disk, and it is indicated with A, B, C, D, E respectively, then is independently deposited Storage area domain A, B, C, D, E distinguish corresponding completed reading and writing data number of times can be as shown in table 1 below.
Table 1
Can be drawn by above statistical table, the corresponding completed data of separate storage region A, B, C, D, E difference are read The magnitude relationship between number of times is write for A > B > D > C > E, and wherein, the corresponding completed reading and writing data number of times phase of A, B and D To maximum, and the corresponding completed reading and writing data number of times of C, E is relatively minimal, so that next when data storage is carried out, can Preferentially C, E are defined as into available separate storage region carries out data storage.
By setting statistical table, fast quickly the completed data of current each separate storage region can be determined Read-write number of times, and by the way that the completed reading and writing data number of times of data storage to be stored at least one minimum is corresponding solely Vertical storage region, and then avoid reading and writing a certain region repeatedly, so as to improve the service life of hard disk.
In an embodiment of the invention, it is the operating efficiency of raising hard disk, further includes:Determining can described in each The memory space of separate storage region;The specific embodiment of the step 105 may include:Can be used according to each Separate storage region memory space, determine target separate storage from described at least one available separate storage region Region;By the data storage to be stored to the target separate storage region.
For example, 4 available separate storage regions are a, b, c, d, and corresponding completed reading and writing data number of times respectively Between 1500 to 2000 times, and corresponding memory space is followed successively by 100G, 90G, 95G and 10G respectively, it is seen then that although this 4 Individual separate storage region difference on completed reading and writing data number of times is smaller, but still has very big difference on memory space , especially separate storage region d.So being can be while hard disk service life be improved, also with respect to the work for improving hard disk Make efficiency, it is to avoid the data of memory space less separate storage region d storages are more and reduce the operating efficiency of hard disk, because This, is when data storage is carried out, can preferentially by any one in data Cun Chudao a, b, c to be stored or multiple.
When determining at least one available independence according to the completed reading and writing data number of times of each separate storage region After storage region, determine that target is independently deposited by further with the corresponding memory space of each available separate storage region Storage area domain, can avoid the data of and storage smaller because of some separate storage region memory space more and have influence on whole hard The operating efficiency of disk.
In an embodiment of the invention, for target separate storage region is determined more accurately out, can further include: Determine that each block in each described available separate storage region distinguishes corresponding memory space;It is described according to each The memory space of the individual available separate storage region, being determined from described at least one available separate storage region can Target separate storage region, including:Using equation below (1), each available separate storage region is calculated Memory space utilization rate;
Wherein, μiCharacterize the memory space utilization rate of available separate storage region described in i-th;mijCharacterize i-th institute State the memory space of block described in j-th in available separate storage region;UiCharacterize and available independently deposited described in i-th The memory space in storage area domain;kiCharacterize the quantity of the block in available separate storage region described in i-th;By minimum The corresponding available separate storage region of the memory space utilization rate is defined as target separate storage region.
For example, with define 3 available separate storage area e, f, g and respectively corresponding memory space 100G, 95G, As a example by 90G, then when determining target separate storage region in e, f, g, be determined using formula (1).Below with the 1st 10 are included in separate storage region e altogether9As a example by individual block, in e is determined 109Block distinguishes corresponding memory spaceAfterwards, the memory space utilization rate of separate storage region e can be calculated by data above (specific calculating process is not given), in addition, it is assumed that separate storage The corresponding memory space utilization rate of region f and g is respectively μ2=50%, μ3=60%, it is not difficult to draw μ1< μ2< μ3, therefore, can Preferentially by data storage to be stored to e.
In addition, if the μ for calculating1、μ2And μ3Between difference be almost 0, then data to be stored can also be put down Share and store in this 3 separate storage regions.
When determining at least one available independence according to the completed reading and writing data number of times of each separate storage region After storage region, by further calculating the memory space utilization rate of each available separate storage region, and minimum is selected The corresponding separate storage region of memory space utilization rate carry out data storage, more accurate, reliable can improve hard disk Operating efficiency.
In an embodiment of the invention, in order to ensure the completed number of each separate storage region for determining each time According to read-write number of times accuracy, it is described by the data storage to be stored to the target separate storage region after, enter one Step includes:The corresponding completed reading and writing data number of times of the target separate storage region in the statistical table is added 1.
For example, the completed reading and writing data number of times that target separate storage region is the e of storage in e, and statistical table is 1500 times, then, it is necessary to be updated to the data in statistical table, i.e. 1500+1 after by data Cun Chudao e to be stored =1501, then when data storage is carried out next time, the corresponding completed reading and writing datas of e in the statistical table for inquiring Number of times will be 1501.
And for example, data to be stored are respectively stored into n (>=2) individual separate storage region, then after storage is completed, should The corresponding completed reading and writing data number of times of this n separate storage region in statistical table is added 1.
After a data storage is completed, read by by the completed data of corresponding separate storage region in statistical table Write number of times and plus 1, can effectively ensure that the accuracy of the completed reading and writing data number of times of storage, and then can more accurately make The read-write of data is evenly distributed on DISK to Image, for the service life for improving hard disk lays the foundation.
In an embodiment of the invention, the specific implementation step of the step 104 may include:By the data to be stored Store to available separate storage region each described.
For example, with determine 4 available separate storage area a, c, e, f, respectively corresponding residual memory space as 20G, 10G, 25G, 15G and size of data to be stored are for as a example by 30G, then can be according to each available separate storage region 4 Residual memory space percentage in individual available separate storage region is stored, and e.g., the residual memory space percentage of a isSimilarly, it may be determined that go out c, e, f to distinguish corresponding residual memory space percentage is λ2 =14.3%, λ3=35.7%, λ4=21.4%, such that it is able to determine size of data to be stored in a, c, e, f, such as a respectively Size of data to be stored is 28.6%*30G=8.58G, and other can similarly be obtained.
And for example, when the size of data to be stored is respectively less than 4 available separate storage area a, c, e, the f for determining, may be used also Data to be stored are stored in this 4 separate storage regions according to 25% ratio uniform.
A kind of date storage method provided in an embodiment of the present invention will be described in detail below, as shown in Fig. 2 the party Method may comprise steps of:
Step 201:N (>=2) individual separate storage region is created on SSD in advance.
For example, can be by running NVMECLI create-ns orders under corresponding operating system, when the control in SSD After chip gets the order, the control chip just can according in the order carry corresponding information (e.g., the quantity of establishment and The memory space of each separate storage region to be created) N (>=2) individual separate storage region is created that, wherein, 2≤N≤16.
Step 202:Pre-set statistical table.
Separate storage region and the completed column information of reading and writing data number of times two should be corresponded in the statistical table.
Step 203:N number of separate storage region is stored using statistical table distinguish corresponding completed reading and writing data Number.
For example, creating the common N=5 separate storage region of a, b, c, d and e in above-mentioned steps 201, then can just lead to Cross in the statistical table of setting in step 202. and store a, b, c, d and e and distinguish corresponding completed reading and writing data number of times, Such as, respectively 8000 times, 3000 times, 2000 times, 7000 times and 2500 times.
What deserves to be explained is, the storage form of the completed reading and writing data number of times of separate storage region is not limited to this hair Statistical table in bright embodiment, can also be other diversified forms, such as blank document.
Step 204:Reception carries the data storage request of data to be stored.
Step 205:Query statistic form, and determine that N number of separate storage region difference is corresponding in statistical table The reading and writing data number of times of completion.
By taking a, b, c, d and e in step 203 as an example.
Step 206:In N number of completed reading and writing data number of times, n (>=1) is selected individual relatively minimal completed Reading and writing data number of times.
According to step 205, then separate storage region a, b, c, d and e distinguish corresponding completed reading and writing data number of times it Between magnitude relationship be a > d > b > e > c, and the wherein corresponding completed reading and writing data number of times of b, c, e is relatively minimal, and The corresponding completed reading and writing data number of times relative maximum of a, d.
Step 207:It is determined that the n relatively minimal corresponding separate storage area of completed reading and writing data number of times selected Domain is available separate storage region.
Because the corresponding completed reading and writing data number of times of b, c, e is relatively minimal, it is possible to by this 3 separate storage areas Domain is defined as available separate storage region, and avoids that data Cun Chudao to be stored currently has been carried out into excessive secondary data read-write A, d in.
Step 208:It is determined that the n memory space of available separate storage region selected.
For example, the corresponding memory space of b, c, e is respectively 200G, 50G and 80G.
Step 209:It is determined that each block in the n available separate storage region selected distinguishes corresponding storage Space.
For example, including 2*10 in b105*10 is included in individual block, c98*10 is included in individual block and e9Individual block, wherein, Because the quantity of block is more, therefore each block in available separate storage region b, c and e uses space m1j(j From 1 to 2*1010)、m2j(j is from 1 to 5*109) and m3j(j is from 1 to 8*109) the present is indicated.
Step 210:Calculate the n memory space utilization rate μ of available separate storage regioni(1≤i≤n)。
By taking b as an example, using formula (1)Calculate memory space utilization rate Similarly, the memory space utilization rate μ of c and e2And μ3Also can be drawn by formula, specific calculating process is similar to, and number of times is repeated no more, Such as, there is μ2=65%, μ3=45%.
Step 211:In n μiIn, by minimum μx(1≤x≤n) corresponding available separate storage region is defined as mesh Mark separate storage region.
Then had by step 210, μ2> μ1> μ3, therefore, μ3Corresponding available separate storage region e is independently deposited for target Storage area domain.
Step 212:By data storage to be stored to target separate storage region.
In this step, can be by data storage to be stored to e.
Step 213:The corresponding completed reading and writing data number of times of target separate storage region in statistical table is added 1.
After this storage is completed, the completed reading and writing data number of times 2500+1 of the e that will should be stored in statistical table =2501, therefore, when data storage is carried out again next time, the completed data of the e got by query statistic form Read-write number of times is 2501 times.
As shown in Figure 3, Figure 4, the embodiment of the invention provides a kind of data storage device.Device embodiment can be by soft Part is realized, it is also possible to realized by way of hardware or software and hardware combining.From for hardware view, as shown in figure 3, being this hair A kind of hardware structure diagram of equipment where the data storage device that bright embodiment is provided, except the processor shown in Fig. 3, internal memory, Outside network interface and nonvolatile memory, the equipment in embodiment where device can also generally include other hardware, Such as it is responsible for the forwarding chip for the treatment of message.As a example by implemented in software, as shown in figure 4, as the dress on a logical meaning Put, transported during corresponding computer program instructions in nonvolatile memory are read into internal memory by the CPU of equipment where it What row was formed.A kind of data storage device that the present embodiment is provided, including:
Creating unit 401, for creating at least two separate storage regions on hard disk;
Receiving unit 402, for receiving data storage request, wherein, the data storage request carries number to be stored According to;
First determining unit 403, for determining each described separate storage region that the creating unit 401 is created Completed reading and writing data number of times;
Second determining unit 404, for each the described separate storage determined according to first determining unit 403 Corresponding completed reading and writing data number of times is distinguished in region, and at least one is determined from least two separate storage region Available separate storage region;
First memory cell 405, for the institute that the data storage to be stored is determined to second determining unit 404 State at least one available separate storage region.
As shown in figure 5, in an embodiment of the invention, further including:
Setting unit 501, for setting statistical table;
Second memory cell 502 is right respectively for storing each described separate storage region using the statistical table The completed reading and writing data number of times answered;
First determining unit 403, for inquiring about the statistical table, and determines each in the statistical table The individual completed reading and writing data number of times of the separate storage region;
Second determining unit 404, in each described completed reading and writing data number of times, selecting at least one Relatively minimal described completed reading and writing data number of times;Determine that each described relatively minimal described completed data is read The corresponding separate storage region of number of times is write for available separate storage region.
As shown in fig. 6, in an embodiment of the invention,
Further include:
3rd determining unit 601, the memory space for determining each available separate storage region
First memory cell 405, including:Determination subelement 602 and storing sub-units 603;Wherein,
The determination subelement 602, for the memory space according to each available separate storage region, from institute State and determine target separate storage region at least one available separate storage region;
The storing sub-units 603, for determine the data storage to be stored to the determination subelement 602 The target separate storage region.
As shown in fig. 7, in an embodiment of the invention, further including:
4th determining unit 701, for determining that each block in each described available separate storage region is distinguished Corresponding memory space;
The determination subelement 602, for using equation below (1), calculating each described available separate storage area The memory space utilization rate in domain;
Wherein, μiCharacterize the memory space utilization rate of available separate storage region described in i-th;mijCharacterize i-th institute State the memory space of block described in j-th in available separate storage region;UiCharacterize and available independently deposited described in i-th The memory space in storage area domain;kiCharacterize the quantity of the block in available separate storage region described in i-th;
The minimum corresponding available separate storage region of the memory space utilization rate is defined as target independence Storage region.
To sum up, each embodiment of the invention at least has the advantages that:
1st, in embodiments of the present invention, by creating at least two separate storage regions on hard disk, wherein, each is only Vertical storage region can be used to store various different types of business datums, therefore, either any business datum needs During storage, the completed read-write number of times of each separate storage region is can first determine that, then according to each separate storage area Corresponding completed read-write number of times is distinguished in domain, determines that at least one available independently deposits from all of separate storage region Storage area domain, is finally stored.Due to being no longer to store data into fixed a certain region, but independently deposited according to each The completed read-write number of times position that dynamically adjustment is stored in storage area domain, therefore, can be prevented effectively from and be read and write repeatedly to some region of And the storage chip for causing weares and teares, improve the service life of DISK to Image.
2nd, in embodiments of the present invention, by setting statistical table, fast quickly current each independence can be determined The completed reading and writing data number of times of storage region, and by by the completed of data storage to be stored at least one minimum The corresponding separate storage region of reading and writing data number of times, and then avoid reading and writing a certain region repeatedly, so as to improve hard disk Service life.
3rd, in embodiments of the present invention, determined when according to the completed reading and writing data number of times of each separate storage region After at least one available separate storage region, by further with the corresponding storage of each available separate storage region Space determines target separate storage region, can avoid the data of and storage smaller because of some separate storage region memory space Operating efficiency that is more and having influence on DISK to Image.
4th, in embodiments of the present invention, determined when according to the completed reading and writing data number of times of each separate storage region After at least one available separate storage region, by the memory space for further calculating each available separate storage region Utilization rate, and select the corresponding separate storage region of memory space utilization rate of minimum to carry out data storage, can it is more accurate, The reliable operating efficiency for improving hard disk.
5th, in embodiments of the present invention, after a data storage is completed, independently deposited by by corresponding in statistical table The completed reading and writing data number of times in storage area domain adds 1, can effectively ensure that the accuracy of the completed reading and writing data number of times of storage, enters And the read-write of data is evenly distributed on DISK to Image, for the service life for improving hard disk establishes base Plinth.
The contents such as the information exchange between each unit, implementation procedure in said apparatus, due to implementing with the inventive method Example is based on same design, and particular content can be found in the narration in the inventive method embodiment, and here is omitted.
It should be noted that herein, such as first and second etc relational terms are used merely to an entity Or operation makes a distinction with another entity or operation, and not necessarily require or imply these entities or exist between operating Any this actual relation or order.And, term " including ", "comprising" or its any other variant be intended to it is non- It is exclusive to include, so that process, method, article or equipment including a series of key elements not only include those key elements, But also other key elements including being not expressly set out, or also include by this process, method, article or equipment are solid Some key elements.In the absence of more restrictions, the key element limited by sentence " including ", does not arrange Except also there is other identical factor in the process including the key element, method, article or equipment.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through Programmed instruction related hardware is completed, and foregoing program can be stored in the storage medium of embodied on computer readable, the program Upon execution, the step of including above method embodiment is performed;And foregoing storage medium includes:ROM, RAM, magnetic disc or light Disk etc. is various can be with the medium of store program codes.
It is last it should be noted that:Presently preferred embodiments of the present invention is the foregoing is only, skill of the invention is merely to illustrate Art scheme, is not intended to limit the scope of the present invention.All any modifications made within the spirit and principles in the present invention, Equivalent, improvement etc., are all contained in protection scope of the present invention.

Claims (10)

1. a kind of date storage method, it is characterised in that at least two separate storage regions are created on hard disk, is also included:
Data storage request is received, wherein, the data storage request carries data to be stored;
Determine each described completed reading and writing data number of times of separate storage region;
Corresponding completed reading and writing data number of times is distinguished according to each described separate storage region, it is only from described at least two At least one available separate storage region is determined in vertical storage region;
By the data storage to be stored to described at least one available separate storage region.
2. method according to claim 1, it is characterised in that
It is described reception data storage request before, it is described at least two separate storage regions are created on hard disk after, enter One step includes:
Statistical table is set;It is corresponding completed each described separate storage region difference to be stored using the statistical table Reading and writing data number of times;
Described each described completed reading and writing data number of times of separate storage region of determination, including:
The statistical table is inquired about, and each described completed number of separate storage region is determined in the statistical table According to read-write number of times;
It is described that corresponding completed reading and writing data number of times is distinguished according to each described separate storage region, from described at least two At least one available separate storage region is determined in individual separate storage region, including:
In each described completed reading and writing data number of times, the relatively minimal described completed data of selection at least one are read Write number of times;Determine each described relatively minimal corresponding separate storage region of described completed reading and writing data number of times for can Separate storage region.
3. method according to claim 2, it is characterised in that
Further include:
Determine the memory space of each available separate storage region;
It is described by the data storage to be stored to described at least one available separate storage region, including:
According to the memory space of each available separate storage region, from described at least one available separate storage area Target separate storage region is determined in domain;
By the data storage to be stored to the target separate storage region.
4. method according to claim 3, it is characterised in that
Further include:
Determine that each block in each described available separate storage region distinguishes corresponding memory space;
The memory space according to each available separate storage region, available independently deposits from described at least one Available target separate storage region is determined in storage area domain, including:
Using equation below, the memory space utilization rate of each available separate storage region is calculated;
μ i = Σ j = 1 k i m i j U i
Wherein, μiCharacterize the memory space utilization rate of available separate storage region described in i-th;mijCharacterizing can described in i-th The memory space of block described in j-th in separate storage region;UiCharacterize available separate storage area described in i-th The memory space in domain;kiCharacterize the quantity of the block in available separate storage region described in i-th;
The minimum corresponding available separate storage region of the memory space utilization rate is defined as target separate storage Region.
5. according to any described method of claim 3 or 4, it is characterised in that
It is described by the data storage to be stored to the target separate storage region after, further include:
The corresponding completed reading and writing data number of times of the target separate storage region in the statistical table is added 1.
6. according to any described method of claim 1 or 2, it is characterised in that
It is described by the data storage to be stored to described at least one available separate storage region, including:
By the data storage to be stored to available separate storage region each described.
7. a kind of data storage device, it is characterised in that including:
Creating unit, for creating at least two separate storage regions on hard disk;
Receiving unit, for receiving data storage request, wherein, the data storage request carries data to be stored;
First determining unit, for determining each described completed number of separate storage region that the creating unit is created According to read-write number of times;
Second determining unit, each described separate storage region for being determined according to first determining unit is right respectively The completed reading and writing data number of times answered, determines at least one available independence from least two separate storage region Storage region;
First memory cell, for the data storage to be stored to second determining unit is determined described at least one Available separate storage region.
8. device according to claim 7, it is characterised in that
Further include:
Setting unit, for setting statistical table;
Second memory cell, it is corresponding complete for storing each described separate storage region difference using the statistical table Into reading and writing data number of times;
First determining unit, for inquiring about the statistical table, and determines described in each in the statistical table The completed reading and writing data number of times of separate storage region;
Second determining unit, in each described completed reading and writing data number of times, selection at least one to be relatively most Small described completed reading and writing data number of times;Determine each described relatively minimal described completed reading and writing data number of times Corresponding separate storage region is available separate storage region.
9. device according to claim 8, it is characterised in that
Further include:
3rd determining unit, the memory space for determining each available separate storage region;
First memory cell, including:Determination subelement and storing sub-units;Wherein,
The determination subelement, for the memory space according to each available separate storage region, from it is described at least Target separate storage region is determined in one available separate storage region;
The storing sub-units, the target for the data storage to be stored to the determination subelement to be determined is only Vertical storage region.
10. device according to claim 9, it is characterised in that
Further include:
4th determining unit, it is corresponding for determining the difference of each block in each described available separate storage region Memory space;
The determination subelement, for utilizing equation below, the storage for calculating each available separate storage region is empty Between utilization rate;
μ i = Σ j = 1 k i m i j U i
Wherein, μiCharacterize the memory space utilization rate of available separate storage region described in i-th;mijCharacterizing can described in i-th The memory space of block described in j-th in separate storage region;UiCharacterize available separate storage area described in i-th The memory space in domain;kiCharacterize the quantity of the block in available separate storage region described in i-th;
The minimum corresponding available separate storage region of the memory space utilization rate is defined as target separate storage Region.
CN201710033969.2A 2017-01-18 2017-01-18 A kind of date storage method and device Pending CN106802775A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710033969.2A CN106802775A (en) 2017-01-18 2017-01-18 A kind of date storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710033969.2A CN106802775A (en) 2017-01-18 2017-01-18 A kind of date storage method and device

Publications (1)

Publication Number Publication Date
CN106802775A true CN106802775A (en) 2017-06-06

Family

ID=58984484

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710033969.2A Pending CN106802775A (en) 2017-01-18 2017-01-18 A kind of date storage method and device

Country Status (1)

Country Link
CN (1) CN106802775A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357523A (en) * 2017-06-27 2017-11-17 联想(北京)有限公司 A kind of data processing method and electronic equipment
CN109857342A (en) * 2019-01-16 2019-06-07 盛科网络(苏州)有限公司 A kind of data read-write method and device, exchange chip and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576837A (en) * 2009-06-12 2009-11-11 成都市华为赛门铁克科技有限公司 Storage control system and method
CN101719050A (en) * 2009-11-25 2010-06-02 成都市华为赛门铁克科技有限公司 Data storage method and equipment
CN102622189A (en) * 2011-12-31 2012-08-01 成都市华为赛门铁克科技有限公司 Storage virtualization device, data storage method and system
CN105550122A (en) * 2015-12-07 2016-05-04 联想(北京)有限公司 Data processing method, storage device and electronic device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101576837A (en) * 2009-06-12 2009-11-11 成都市华为赛门铁克科技有限公司 Storage control system and method
CN101719050A (en) * 2009-11-25 2010-06-02 成都市华为赛门铁克科技有限公司 Data storage method and equipment
CN102622189A (en) * 2011-12-31 2012-08-01 成都市华为赛门铁克科技有限公司 Storage virtualization device, data storage method and system
CN105550122A (en) * 2015-12-07 2016-05-04 联想(北京)有限公司 Data processing method, storage device and electronic device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107357523A (en) * 2017-06-27 2017-11-17 联想(北京)有限公司 A kind of data processing method and electronic equipment
WO2019000675A1 (en) * 2017-06-27 2019-01-03 联想(北京)有限公司 Data processing method and electronic device
CN109857342A (en) * 2019-01-16 2019-06-07 盛科网络(苏州)有限公司 A kind of data read-write method and device, exchange chip and storage medium

Similar Documents

Publication Publication Date Title
CN109189785A (en) Date storage method, device, computer equipment and storage medium
CN102725753B (en) Method and apparatus for optimizing data access, method and apparatus for optimizing data storage
US7873763B2 (en) Multi-reader multi-writer circular buffer memory
CN107315533A (en) A kind of date storage method and device
CN106484330A (en) A kind of hybrid magnetic disc individual-layer data optimization method and device
CN109446174A (en) Logdata record method, apparatus and computer readable storage medium
CN107622020A (en) A kind of date storage method, access method and device
CN107885788A (en) A kind of business datum check method
CN107943542A (en) A kind of configuration information management method, device, computer-readable recording medium and storage control
CN104615684A (en) Mass data communication concurrent processing method and system
CN109597979A (en) Inventory table generation method, device, computer equipment and storage medium
CN106802775A (en) A kind of date storage method and device
CN103631831B (en) A kind of data back up method and device
CN106384389A (en) Method for texture combination of model data
CN111125088A (en) Multi-level data processing method and device
CN106202374A (en) A kind of data processing method and device
CN110084476A (en) Case method of adjustment, device, computer equipment and storage medium
CN115907949A (en) Bank transaction data processing method and device
CN115712654A (en) Method and device for inquiring transaction state
CN109901796A (en) Sequencing selection method, apparatus, peripheral storage device and storage medium based on external memory
CN106775450B (en) A kind of data distribution method in mixing storage system
CN115129590A (en) Test case generation method and device, electronic equipment and storage medium
CN107632880A (en) Method for exporting excel data, storage medium and electronic equipment
CN111045959B (en) Complex algorithm variable mapping method based on storage optimization
CN107391440A (en) A kind of processing unit and method of fast fourier transform algorithm output 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20170606