Summary of the invention
The embodiment of the invention provides a kind of method, controller and storage system of Data Update, can improve write performance so that the data storage of disk after will upgrading at new physical block, avoids writing punishment.
For solving the problems of the technologies described above, embodiment provided by the present invention is achieved through the following technical solutions:
A kind of method of Data Update comprises:
Receive to upgrade the request and the data updated of data in magnetic disk, described request comprises the former data initial logical address and the length of new data more;
According to described former data initial logical address and more the length of new data determine needs data updated piece;
Need the disk transmission at data updated piece place to write read request and data updated to described, the described read request of writing is indicated the incidence relation of described disk according to data block and physical block, in the new physical block related, write data updated, read former data from the physical block at former data place with the data updated piece.
A kind of method of Data Update comprises:
Receive to upgrade the request and the data updated of data in magnetic disk, described request comprises the former data initial logical address and the length of new data more;
According to described former data initial logical address and more the length of new data determine needs data updated piece;
Need the disk transmission at data updated piece place to write XOR request and data updated to described, describedly write the XOR request and indicate the incidence relation of described disk according to data block and physical block, in the new physical block related, write data updated, read former data from the physical block at former data place with the data updated piece.
A kind of controller comprises:
The update request receiving element is used to receive request and the data updated of upgrading data in magnetic disk, and described request comprises the former data initial logical address and the length of new data more;
The data block determining unit, be used for the described former data initial logical address that comprises according to the request that described update request receiving element receives and more the length of new data determine needs data updated piece;
The write-read request transmitting unit, be used for writing read request and data updated to the disk transmission that needs data updated piece place that described data block determining unit is determined, the described read request of writing is indicated the incidence relation of described disk according to data block and physical block, writes data updated in the new physical block related with the data updated piece; Read former data from the physical block at former data place.
A kind of controller comprises:
The update request receiving element is used to receive request and the data updated of upgrading data in magnetic disk, and described request comprises the former data initial logical address and the length of new data more;
The data block determining unit, be used for the described former data initial logical address that comprises according to the request that described reception update request unit receives and more the length of new data determine needs data updated piece;
Write the XOR request transmitting unit, be used for writing XOR request and data updated to the disk transmission that needs data updated piece place that described specified data module unit is determined, describedly write the XOR request and indicate the incidence relation of described disk, in the new physical block related, write data updated with the data updated piece according to data block and physical block; And read former data from the physical block at former data place.
A kind of storage system comprises:
Controller, be used to receive request and the data updated of upgrading data in magnetic disk, according to the former data initial logical address that comprises in the described request and more the length of new data determine needs data updated piece, send to the described disk that needs data updated piece place and write read request and data updated;
Disk is used for according to the read request of writing from described controller, and the incidence relation of data block and physical block, writes data updated in the new physical block related with the data updated piece; Read former data from the physical block at former data place.
A kind of storage system comprises:
Controller, be used to receive request and the data updated of upgrading data in magnetic disk, according to the former data initial logical address that comprises in the described request and more the length of new data determine needs data updated piece, send to the described disk that needs data updated piece place and write XOR request and data updated;
Disk is used for according to the XOR request of writing from described controller, and the incidence relation of data block and physical block, writes data updated in the new physical block related with the data updated piece; Read former data from the physical block at former data place.
By technique scheme as can be seen, the embodiment of the invention issues by controller and writes read request or write the XOR request to needing the more disk of new data, data storage after the indication disk will upgrade is at new physical block, and need before writing new data, legacy data not read, avoid writing punishment, then improved write performance.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that is obtained under the creative work prerequisite.
The following embodiment of the invention issues different orders by controller, and the indication disk writes new data at new physical block, and reads legacy data or read legacy data and the XOR of old check data, makes that read operation and write operation can parallel processings.
Embodiment one, describe in detail referring to Fig. 1, Fig. 1 is the method flow synoptic diagram of present embodiment, can comprise:
Step 101: receive to upgrade the request and the data updated of data in magnetic disk, described request comprises the former data initial logical address and the length of new data more.
Disk can be solid magnetic disc (Solid-State Disk, SSD) etc.
The corresponding relation of carrying out each the data in magnetic disk piece of this method and the check data on the monitor desk can be as shown in Figure 2, wherein, it is 40 to 49 data that data block D4 on the hard disk 0 comprises logical address, it is 50 to 59 data that data block D5 on the hard disk 1 comprises logical address, it is 30 to 39 data that data block D3 on the hard disk 3 comprises logical address, and the check data P3-5 on the hard disk 2 and data block D3, D4, D5 are corresponding.Request comprises that former data initial logical address is 30, and more the length of new data is 20.
Step 102: according to described former data initial logical address and more the length of new data determine needs data updated piece.
According to shown in Figure 2, the data block that former data initial logical address is 30 correspondences is D3, is positioned at hard disk 3; More the length of new data is 20, and promptly logical address is that 30 to 50 former data all need to upgrade, and then the data block D4 on the hard disk 0 also needs to upgrade.
Step 103: need the disk transmission at data updated piece place to write read request and data updated to described, the described read request of writing is indicated the incidence relation of described disk according to data block and physical block, in the new physical block related, write the data updated piece, and read former data from the physical block at former data place with the data updated piece.
Step 102 determines that to need the data updated piece be data block D3 on the hard disk 3 and the data block D4 on the hard disk 0, promptly issues to hard disk 3 and hard disk 0 and writes read request and data updated.Hard disk 3 and hard disk 0 be according to the incidence relation of data block D3, D4 and physical block, reads former data from the physical block at former data place, writes data updated in the new physical block related with the data updated piece.
Embodiment of the invention method can be based on the Raid5 algorithm.Embodiment of the invention method can be adjusted each sequence of steps according to actual needs.The executive agent of above-mentioned steps can be a controller; Controller is after receiving the request of upgrading data in magnetic disk, issue to associative disk and to write read request and data updated, in new physical block, write data updated with the indication associative disk, read former data, improve the write operation performance from the physical block at former data place; Thereby when avoiding adopting prior art to upgrade data in magnetic disk, owing to be that physical block at former data place writes new data, the scheme that must before physical block writes new data, earlier legacy data be read out then.
The embodiment of the invention issues by controller and writes read request to needing the more disk of new data, and the data storage of indication disk after will upgrading be at new physical block, the raising write performance.
The treatment scheme of two couples of embodiment one of following examples in actual application is elaborated, comprising that controller issues to disk writes read request and data updated, and after obtaining former data of disk and corresponding checking data, generate and issue the overall process of new checking data.
Embodiment two, describe in detail referring to Fig. 3, Fig. 3 is the method flow synoptic diagram of present embodiment, can comprise:
Step 201: receive request and the data updated of upgrading data in magnetic disk, described request comprises the former data initial logical address and the length of new data more.
Disk can be a solid magnetic disc etc.
Step 202: according to described former data initial logical address and more the length of new data determine needs data updated piece.
Step 203: issue to the described disk that needs data updated piece place and to write read request and data updated, the described read request of writing is indicated the incidence relation of described disk according to data block and physical block, in the new physical block related, write the data updated piece, and read former data from the physical block at former data place with the data updated piece.
The above-mentioned data updated piece that writes in new physical block can be to carry out simultaneously with reading former data from the physical block at former data place, also can be to write the data updated piece earlier to read former data again, does not influence the realization of the embodiment of the invention.
Step 204: obtain the former data of described disk and the corresponding former checking data on the check disk.
Disk responds former data content to controller after reading former data.
The executive agent of above-mentioned steps can be a controller; The corresponding checking data that controller obtains on the check disk can be by issuing read request to check disk, indication check disk feedback and the corresponding former checking data of described data in magnetic disk that upgrades.Issuing read request to check disk can issue simultaneously or issue thereafter with the described read request of writing of step 203, does not influence the realization of the embodiment of the invention.
Step 205: the former data of described disk, corresponding former checking data and data updated are carried out XOR, generate new checking data.
Controller can carry out the corresponding former checking data that XOR has obtained removing former data influence with the former data of described disk, corresponding former checking data; Again the described corresponding former checking data of having removed former data influence and data updated are carried out XOR and obtain new checking data.
XOR claims the false add computing again, and its operation rule is:
0 with 0 XOR, and the result is 0;
0 with 1 XOR, and the result is 1;
1 with 0 XOR, and the result is 1;
1 with 1 XOR, and the result is 0.
Promptly when several values of two participation computings were different, operation result was 1, otherwise is 0.Therefore, after the corresponding former checking data of former data and former data are carried out XOR once more, can obtain carrying out checking data before the XOR with former data.
Step 206: issue write request and new checking data to check disk, described write request indicates described check disk to write new checking data.
The embodiment of the invention issues by controller and writes read request to needs data updated disk, data storage after the indication disk will upgrade is at new physical block, make that write operation and read operation can parallel processings, improve write performance, thereby when avoiding adopting prior art to upgrade data in magnetic disk, owing to be that physical block at former data place writes new data, the scheme that must before physical block writes new data, earlier legacy data be read out then.
Embodiment of the invention method can be adjusted each sequence of steps according to actual needs.Embodiment of the invention method can be based on the Raid5 algorithm.The described controller of the embodiment of the invention can be the Raid5 controller.
Above embodiment one and two issues with controller that to write read request be that example describes, and following examples three and four fundamental rules issue with controller that to write the XOR request be that example describes.
Embodiment three, describe in detail referring to Fig. 4, Fig. 4 is the method flow synoptic diagram of present embodiment, can comprise:
Step 301: receive to upgrade the request and the data updated of data in magnetic disk, described request comprises the former data initial logical address and the length of new data more.
Disk can be a solid magnetic disc.
Step 302: according to described former data initial logical address and more the length of new data determine needs data updated piece.
Step 303: need the disk transmission at data updated piece place to write XOR request and data updated to described, describedly write the XOR request and indicate the incidence relation of described disk according to data block and physical block, in the new physical block related, write the data updated piece, read former data from the physical block at former data place with the data updated piece.
The above-mentioned data updated piece that writes in new physical block can be to carry out simultaneously with reading former data from the physical block at former data place, also can be to write the data updated piece earlier to read former data again, does not influence the realization of the embodiment of the invention.
The executive agent of above-mentioned steps can be a controller; Controller is after receiving the request of upgrading data in magnetic disk, issue to described disk and to write XOR request and data updated, to indicate described disk in new physical block, to write data updated, read former data from the physical block at former data place, and feed back the XOR result of former data block and data updated, further improve the write operation performance; Thereby when avoiding adopting prior art to upgrade data in magnetic disk, owing to be that physical block at former data place writes new data, the scheme that must before physical block writes new data, earlier legacy data be read out then.
The embodiment of the invention issues by controller and writes the XOR request to needing the more disk of new data, data storage after the indication disk will upgrade is at new physical block, make that write operation and read operation can parallel processings, improve write performance, thereby when avoiding adopting prior art to upgrade data in magnetic disk, owing to be that physical block at former data place writes new data, the scheme that must before physical block writes new data, earlier legacy data be read out then; And feed back new legacy data XOR result, save the controller resource.
The present embodiment scheme is compared controller and is issued the scheme of writing read request, is the XOR result who directly reads new legacy data, the resource of more saving algorithmic controller, and the write performance of algorithm further improves.
Embodiment of the invention method can be adjusted each sequence of steps according to actual needs.Embodiment of the invention method can be based on the Raid5 algorithm.The described controller of the embodiment of the invention can be the Raid5 controller.
The treatment scheme of four couples of embodiment three of following examples in actual application is elaborated, comprising that controller issues to disk writes XOR request and data updated, and after obtaining the XOR result and corresponding checking data of former data of disk and data updated, generate and issue the overall process of new checking data.
Embodiment four, describe in detail referring to Fig. 5, Fig. 5 is the method flow synoptic diagram of present embodiment, can comprise:
Step 401: receive request and the data updated of upgrading data in magnetic disk, described request comprises the former data initial logical address and the length of new data more.
Disk can be a solid magnetic disc etc.
Step 402: according to described former data initial logical address and more the length of new data determine needs data updated piece.
Step 403: issue to the described disk that needs data updated piece place and to write XOR request and data updated, describedly write the XOR request and indicate the incidence relation of described disk according to data block and physical block, in the new physical block related, write the data updated piece with the data updated piece, read former data from the physical block at former data place, and the indication disk feeds back the XOR result of former data and data updated.
The above-mentioned data updated piece that writes in new physical block can be to carry out simultaneously with reading former data from the physical block at former data place, also can be to write the data updated piece earlier to read former data again, does not influence the realization of the embodiment of the invention.
Step 404: obtain the corresponding former checking data on described XOR result and the check disk.
Disk responds described XOR result to controller after calculating the XOR result of former data and data updated.
The corresponding checking data that controller obtains on the check disk can be by issuing read request to check disk, response of indication check disk and the corresponding former checking data of described data in magnetic disk that upgrades.Issuing read request to check disk can issue simultaneously or issue thereafter with the described read request of writing of step 403, does not influence the realization of the embodiment of the invention.
Step 405: described XOR result, corresponding former checking data piece are carried out XOR, generate new checking data.
Controller can carry out XOR with the XOR result and the former checking data piece of described new legacy data, according to the XOR rule, then can directly remove former data influence from corresponding former checking data, obtains new checking data.
Step 406: issue write request and new checking data to check disk, described write request indicates described check disk to write new checking data.
Embodiment of the invention method can be adjusted each sequence of steps according to actual needs.Embodiment of the invention method can be based on the Raid5 algorithm.The described controller of the embodiment of the invention can be the Raid5 controller.
Controller issues the XOR request of writing, controller was given in response after disk then calculated the XOR result of former data and data updated, make that write operation and read operation can parallel processings, thereby when avoiding adopting prior art to upgrade data in magnetic disk, owing to be that physical block at former data place writes new data, the scheme that must before physical block writes new data, earlier legacy data be read out then.
The present embodiment scheme is compared controller and is issued the scheme of writing read request, is the XOR result who directly reads new legacy data, the resource of more saving algorithmic controller, and the write performance of algorithm further improves.
Need to prove, for aforesaid each method embodiment, for simple description, so it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
In the above-described embodiments, the description of each embodiment is all emphasized particularly on different fields, do not have the part that describes in detail among certain embodiment, can be referring to the associated description of other embodiment.
A kind of method of Data Update more than is provided, and the embodiment of the invention also provides the storage system of controller, disk and updatable data.
A kind of controller 50, referring to Fig. 6, Fig. 6 is the structural representation of the invention process csr controller, can comprise:
Update request receiving element 51 is used to receive request and the data updated of upgrading data in magnetic disk, and described request comprises the former data initial logical address and the length of new data more;
Data block determining unit 52, be used for the described former data initial logical address that comprises according to the request that described update request receiving element 51 receives and more the length of new data determine needs data updated piece;
Write-read request transmitting unit 53, be used for issuing and write read request and data updated to the disks that need data updated piece place that described data block determining unit 52 is determined, the described read request of writing is indicated the incidence relation of described disk according to data block and physical block, in the new physical block related, write the data updated piece, and read former data from the physical block at former data place with the data updated piece.Writing the data updated piece in new physical block can be to carry out simultaneously with reading former data from the physical block at former data place, also can be to write the data updated piece earlier to read former data again, does not influence the realization of the embodiment of the invention.
Described controller 50 also can comprise with lower unit:
Former data capture unit 54 is used to obtain the former data that need the data updated piece, the corresponding former checking data on the check disk, and described check disk is corresponding with the described disk at data updated piece place that needs;
New check data generation unit 55 is used for the former data that former data capture unit 54 is obtained, corresponding former checking data carries out XOR, and the data updated that receives with update request receiving element 51 is carried out XOR again, generates new checking data;
Write request transmitting element 56, be used for the new checking data of write request and new check data generation unit 55 generations is sent to check disk, described write request indicates described check disk to write new checking data, and described check disk is corresponding with the described disk at data updated piece place that needs.
Each module of embodiment of the invention equipment can be integrated in one, and also can separate deployment.Above-mentioned module can be merged into a module, also can further split into a plurality of submodules.
The embodiment of the invention issues by controller and writes read request to needing the more disk of new data, and the data storage of indication disk after will upgrading be at new physical block, makes that write operation and read operation can parallel processings, the raising write performance.
A kind of controller 60, referring to Fig. 7, Fig. 7 is the structural representation of another controller of the embodiment of the invention, can comprise:
Update request receiving element 61 is used to receive request and the data updated of upgrading data in magnetic disk, and described request comprises the former data initial logical address and the length of new data more;
Data block determining unit 62, be used for the described former data initial logical address that comprises according to the request that described update request receiving element 61 receives and more the length of new data determine needs data updated piece;
Write XOR request transmitting unit 63, be used for writing XOR request and data updated to the disk transmission that needs data updated piece place that described data block determining unit 62 is determined, describedly write the XOR request and indicate the incidence relation of described disk according to data block and physical block, in the new physical block related, write the data updated piece with the data updated piece, read former data from the physical block at former data place, and the indication disk feeds back the XOR result of former data and data updated.
Described controller 60 also can comprise following subelement:
XOR is acquiring unit 64 as a result, is used to obtain from the XOR result of disk and the corresponding checking data on the check disk, and described check disk is corresponding with the described disk at data updated piece place that needs;
New check data generation unit 65, be used for XOR as a result the XOR result, the corresponding former checking data that obtain of acquiring unit 64 carry out XOR, generate new checking data;
Write request transmitting element 66, be used for the new checking data of write request and new check data generation unit 65 generations is sent to check disk, described write request indicates described check disk to write new checking data, and described check disk is corresponding with the described disk at data updated piece place that needs.
Each module of embodiment of the invention equipment can be integrated in one, and also can separate deployment.Above-mentioned module can be merged into a module, also can further split into a plurality of submodules.
Controller 50 and controller 60 can be the Raid5 algorithmic controllers.
The embodiment of the invention issues by controller and writes the XOR request to needing the more disk of new data, and the data storage after the indication disk will upgrade is at new physical block, makes that write operation and read operation can parallel processings, the raising write performance; And feed back new legacy data XOR result, save the controller resource.The XOR result that controller 60 directly reads new legacy data compares the resource that controller 50 is more saved algorithmic controller, and the write performance of algorithm further improves.
A kind of storage system 70, referring to Fig. 8, Fig. 8 is the structural representation of embodiment of the invention storage system, can comprise:
Controller 71, be used to receive request and the data updated of upgrading data in magnetic disk, according to the former data initial logical address that comprises in the described request and more the length of new data determine needs data updated piece, send to the described disk that needs data updated piece place and write read request and data updated; And renewal and the described disk corresponding check dish that needs data updated piece place.
Upgrade monitor desk and can obtain the former data that need the data updated piece, the corresponding former checking data on the check disk, described check disk is corresponding with the described disk at data updated piece place that needs; Former data, corresponding former checking data are carried out XOR, carry out XOR with data updated again, generate new checking data; Write request and new checking data are sent to check disk, and described write request indication writes described check disk with new checking data.
Disk 72 is used for according to the read request of writing from described controller, and the incidence relation of data block and physical block, writes the data updated piece in the new physical block related with the data updated piece, and reads former data from the physical block at former data place.
The system of the embodiment of the invention can be based on the Raid5 algorithm.The embodiment of the invention issues by controller and writes read request to needing the more disk of new data, and the data storage of indication disk after will upgrading be at new physical block, makes that write operation and read operation can parallel processings, the raising write performance.
A kind of storage system 80, referring to Fig. 9, Fig. 9 is the structural representation of another storage system of the embodiment of the invention, can comprise:
Controller 81, be used to receive request and the data updated of upgrading data in magnetic disk, according to the former data initial logical address that comprises in the described request and more the length of new data determine needs data updated piece, need the disk transmission at data updated piece place to write XOR request and data updated to described, described write the XOR request and indicate described disk to read former data from the physical block at former data place after, in the XOR result who calculates former data block and data updated, in new physical block, write data updated.
Disk 82, be used for basis from the XOR request of writing of described controller 81 and the incidence relation of data block and physical block, in the new physical block related, write the data updated piece with the data updated piece, read former data from the physical block at former data place, and the XOR result of former data and data updated is fed back to controller.
Each unit of embodiment of the invention system can be integrated in a device, also can be distributed in multiple arrangement.Said units can be merged into a unit, also can further split into a plurality of subelements.The system of the embodiment of the invention can be based on the Raid5 algorithm.
The embodiment of the invention issues by controller and writes the XOR request to needing the more disk of new data, and the data storage after the indication disk will upgrade is at new physical block, makes that write operation and read operation can parallel processings, the raising write performance; And feed back new legacy data XOR result, save the controller resource.
Above-described the invention process csr controller and storage system issue by controller and write read request or write the XOR request to needing the more disk of new data, data storage after the indication disk just upgrades is at new physical block, read operation and write operation carry out simultaneously, improve write performance.
One of ordinary skill in the art will appreciate that, realize all or part of flow process in the foregoing description method, be to instruct relevant hardware to finish by computer program, described program can be stored in the computer read/write memory medium, this program can comprise the flow process as the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-OnlyMemory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
More than method, controller and the storage system of a kind of Data Update that the embodiment of the invention provided is described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.