Summary of the invention
In view of this, the embodiment of the invention provides a kind of method, Apparatus and system of write data, to improve the performance of non-volatile memory medium.
A kind of data writing method comprises:
Send the disc information inquiring command;
The disc information that reception is returned comprises the size of the Physical Page that non-volatile memory medium is supported in the said disc information;
The base unit that writes data in the write operation order is changed to the size of said Physical Page, and what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit;
Send the write operation order after changing.
A kind of disc information querying method comprises:
Receive the disc information inquiring command;
Controller through non-volatile memory medium obtains the size of the Physical Page that said non-volatile memory medium supports;
Return disc information, comprise the size of the Physical Page that said non-volatile memory medium is supported in the said disc information.
A kind of data writing device comprises:
First transmitting element is used to send the disc information inquiring command;
First receiving element is used to receive the disc information that returns, and comprises the size of the Physical Page that non-volatile memory medium is supported in the said disc information;
The change unit; The base unit that is used for write operation order is write data changes to the size of said Physical Page, and what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit;
Second transmitting element is used to send the write operation order after the change.
A kind of disc information inquiry unit comprises:
Second receiving element is used to receive the disc information inquiring command;
Acquiring unit is used for the size that controller through non-volatile memory medium obtains the Physical Page that said non-volatile memory medium supports;
Return the unit, be used to return disc information, comprise the size of the Physical Page that said non-volatile memory medium is supported in the said disc information.
A kind of write data system comprises:
Data writing device; Be used to send the disc information inquiring command; The disc information that reception is returned comprises the size of the Physical Page that non-volatile memory medium is supported in the said disc information, the base unit that writes data in the write operation order is changed to the size of said Physical Page; And what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit, sends the write operation order after the change;
The disc information inquiry unit; Be used to receive the disc information inquiring command; Controller through non-volatile memory medium obtains disc information, returns disc information to the write data device, comprises the size of the Physical Page that said non-volatile memory medium is supported in the said disc information;
Memory controller; Be used to receive the disc information querying command that said disc information inquiry unit sends; The disc information of said non-volatile memory medium is back to the disc information inquiry unit, and wherein, said disc information comprises the size of the Physical Page that non-volatile memory medium is supported; Receive the write operation order after changing, write data according to this order.
A kind of write data system comprises:
Data writing device; Be used to send the disc information inquiring command; The disc information that reception is returned comprises the size of the Physical Page that non-volatile memory medium is supported in the said disc information, the base unit that writes data in the write operation order is changed to the size of said Physical Page; And what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit, sends the write operation order after the change;
Memory controller; Be used to receive the disc information querying command that the write data device sends; The disc information of non-volatile memory medium is back to the disc information inquiry unit, and wherein, said disc information comprises the size of the Physical Page that non-volatile memory medium is supported; Receive the write operation order after changing, write data according to this order.
Can find out; In embodiments of the present invention; Can know the size of the Physical Page that non-volatile memory medium is supported; And the base unit that writes data in the write operation order changed to the size of the Physical Page that non-volatile memory medium supports, the sector reference position that writes data is changed to the reference position of Physical Page, thereby avoided the sector reference position of write operation and the reference position of Physical Page not to line up; And then need not to stride Physical Page execution write operation, improved the performance of non-volatile memory medium.
Embodiment
For the above-mentioned characteristic, the advantage that make the embodiment of the invention is more obviously understandable, be elaborated below in conjunction with embodiment.
SSD can be storage medium with FLASH, and the characteristics of FLASH comprise:
1, write operation must be unit with the Physical Page, and the data of at every turn writing are necessary for the integral multiple of Physical Page;
2, the Physical Page among the FLASH must be wiped earlier again and write, and the least unit of wiping is a physical block, and according to different FLASH, the size of a physical block is divided into 64 Physical Page or 128 Physical Page.
The size of supposing a sector is 512 bytes, and the size of the Physical Page of SSD is 4KB, then the sector of corresponding 8 512 bytes of the Physical Page of a 4KB.If main frame issues the write operation order of 4KB to SSD, but the reference position of this write operation do not align with the reference position of Physical Page, like Fig. 1, Fig. 1 is the synoptic diagram that sector reference position and the reference position of Physical Page of write operation do not alignd.
Please refer to Fig. 2, be the method flow diagram of a kind of write data that the embodiment of the invention provided, can may further comprise the steps:
Step 201: send the disc information inquiring command;
Step 202: receive the disc information that returns, comprise the size of the Physical Page that non-volatile memory medium is supported in the said disc information;
Step 203: the base unit that writes data in the write operation order is changed to the size of said Physical Page, and what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit;
Step 204: send the write operation order after changing.
Said non-volatile memory medium is the storage unit among the SSD.
Can find out; In embodiments of the present invention; Can know the size of the Physical Page that non-volatile memory medium is supported; And the base unit that writes data in the write operation order changed to the size of the Physical Page that non-volatile memory medium supports, the sector reference position that writes data is changed to the reference position of Physical Page, thereby avoided the sector reference position of write operation and the reference position of Physical Page not to line up; And then need not to stride Physical Page execution write operation, improved the performance of non-volatile memory medium.
Only be that example describes below with SSD.
It is to be noted; The embodiment of the invention can be developed a kind of driver for SSD, and the mutual of main frame and SSD accomplished through this driver, and this driver receives the disc information querying command from operating system; Obtain disc information from SSD; Comprising the physical page size that SSD supported, and the disc information that obtains is back to operating system, after operating system is known the physical page size that SSD supports; The sector-size that writes data in the write operation order is changed to physical page size; With what write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit, and the order of the write operation after the change is sent to this driver, by this driver the write operation order is sent to SSD again.The embodiment of the invention can also directly be sent the disc information inquiring command to SSD by operating system, and in the disc information querying command, adds the order of the physical page size of inquiry SSD.Be elaborated respectively below.
Please refer to Fig. 3, be the method flow diagram of the another kind of write data that the embodiment of the invention provided, can may further comprise the steps:
Step 301: operating system is sent the disc information inquiring command to the driver of SSD;
The aforesaid operations system can be Windows operating system or (SuSE) Linux OS.
Disc information comprises: the size of the sector that the max cap. of SSD, the monitor state of SSD (SMART) information and SSD support etc.
The driver of step 302:SSD obtains disc information according to the disc information querying command after receiving the disc information querying command from operating system from SSD, and obtains the physical page size that SSD supports;
The physical page size that SSD supported can comprise 2KB, 4KB, 8KB.
The driver of step 303:SSD returns the disc information Query Result to operating system;
Comprise the physical page size that SSD supports in the disc information Query Result.
Step 304: operating system changes to the physical page size that SSD supports with the base unit that writes data in the write operation order by sector-size, and what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit;
For example: suppose that sector-size is 512 bytes, the physical page size of SSD is 4KB, and then operating system changes to 4KB with the base unit that writes data in the write operation order by 512 bytes.
Step 305: the write operation order after operating system will be changed sends to the driver of SSD;
The driver of step 306:SSD sends to SSD with the write operation order that receives.
The base unit that writes data in the write operation order that SSD receives is a physical page size.
Please refer to Fig. 4, be the method flow diagram of the another kind of write data that the embodiment of the invention provided, can may further comprise the steps:
Step 401: operating system is sent the disc information inquiring command to SSD, comprises the order of the physical page size of inquiring about SSD in the disc information querying command;
Step 402:SSD returns disc information to operating system after receiving the disc information querying command from operating system;
The disc information that SSD returns comprises: the size of the Physical Page that the max cap. of SSD, the monitor state of SSD (SMART) information and SSD support etc.
Step 403: after operating system receives the disc information that SSD returns; The base unit that writes data in the write operation order is changed to the physical page size that SSD supports by sector-size, and what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit;
Step 404: operating system is sent the write operation order to SSD, and the base unit that writes data in the write operation order is the physical page size that SSD supports.
It is to be noted; It is storage medium that the method that the embodiment of the invention provides can be applied to the Flash chip; And has quick peripheral hardware interconnect standard (PCIE; Peripheral Component InterconnectExpress) on the various memory device of interface or Serial Advanced Technology Attachment (SATA, Serial Advanced TechnologyAttachment) interface.
Can find out; The size of the Physical Page that operating system writes data in the order of write operation that SSD issues base unit has changed to SSD to be supported; The sector reference position that writes data is changed to the reference position of Physical Page; The situation that can not exist this moment the reference position of the sector reference position that writes data and Physical Page not line up has avoided striding Physical Page execution write operation, has improved the performance of SSD.
Please refer to Fig. 5, the apparatus structure synoptic diagram of a kind of write data that provides for the embodiment of the invention can comprise:
First transmitting element 501 is used to send the disc information inquiring command;
First receiving element 502 is used to receive the disc information that returns, and comprises the size of the Physical Page that non-volatile memory medium is supported in the said disc information;
Change unit 503; The base unit that is used for write operation order is write data changes to the size of said Physical Page, and what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit;
Second transmitting element 504 is used to send the write operation order after the change.
Can find out; In embodiments of the present invention; Can know the size of the Physical Page that non-volatile memory medium is supported; And the base unit that writes data in the write operation order changed to the size of the Physical Page that non-volatile memory medium supports, the sector reference position that writes data is changed to the reference position of Physical Page, thereby avoided the sector reference position of write operation and the reference position of Physical Page not to line up; And then need not to stride Physical Page execution write operation, improved the performance of non-volatile memory medium.
Please refer to Fig. 6, a kind of disc information inquiry unit structural representation for the embodiment of the invention provides on the basis of Fig. 5, can also comprise:
Second receiving element 601 is used to receive the disc information inquiring command;
Acquiring unit 602 is used for the size that controller through non-volatile memory medium obtains the Physical Page that said non-volatile memory medium supports;
Return unit 603, be used to return disc information, comprise the size of the Physical Page that said non-volatile memory medium is supported in the said disc information.
Above-mentioned non-volatile memory medium is the storage unit among the SSD.
Please refer to Fig. 7, a kind of write data system architecture synoptic diagram for the embodiment of the invention provides can comprise:
Data writing device 701; Be used to send the disc information inquiring command; The disc information that reception is returned comprises the size of the Physical Page that non-volatile memory medium is supported in the said disc information, the base unit that writes data in the write operation order is changed to the size of said Physical Page; And what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit, sends the write operation order after the change;
Disc information inquiry unit 702; Be used to receive the disc information inquiring command; Controller through non-volatile memory medium obtains disc information, returns disc information to the write data device, comprises the size of the Physical Page that said non-volatile memory medium is supported in the said disc information;
Memory controller 703; Be used to receive the disc information querying command that said disc information inquiry unit 702 sends; The disc information of said non-volatile memory medium is back to said disc information inquiry unit 702; Wherein, said disc information comprises the size of the Physical Page that non-volatile memory medium is supported; Receive the write operation order after changing, write data according to this order.
Please refer to Fig. 8, the another kind of write data system architecture synoptic diagram for the embodiment of the invention provides can comprise:
Data writing device 701; Be used to send the disc information inquiring command; The disc information that reception is returned comprises the size of the Physical Page that non-volatile memory medium is supported in the said disc information, the base unit that writes data in the write operation order is changed to the size of said Physical Page; And what will write data be that the reference position of the LBA of unit changes to the Physical Page with the sector is the reference position of the LBA of unit, sends the write operation order after the change;
Memory controller 703; Be used to receive the disc information querying command that write data device 701 sends; The disc information of said non-volatile memory medium is back to write data device 701, and wherein, said disc information comprises the size of the Physical Page that non-volatile memory medium is supported; Receive the write operation order after changing, write data according to this order.
At last; Also need to prove; In this article; Relational terms such as first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint relation or the order that has any this reality between these entities or the operation.And; Term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability; Thereby make and comprise that process, method, article or the equipment of a series of key elements not only comprise those key elements; But also comprise other key elements of clearly not listing, or also be included as this process, method, article or equipment intrinsic key element.Under the situation that do not having much more more restrictions, the key element that limits by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises said key element and also have other identical element.
Description through above embodiment; Those skilled in the art can be well understood to the present invention and can realize by the mode that software adds essential hardware platform; Can certainly all implement, but the former is better embodiment under a lot of situation through hardware.Based on such understanding; All or part of can the coming out that technical scheme of the present invention contributes to background technology with the embodied of software product; This computer software product can be stored in the storage medium, like ROM/RAM, magnetic disc, CD etc., comprises that some instructions are with so that a computer equipment (can be a personal computer; Server, the perhaps network equipment etc.) carry out the described method of some part of each embodiment of the present invention or embodiment.
More than the present invention has been carried out detailed introduction, used concrete example among this paper principle of the present invention and embodiment 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 on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.