The content of the invention
The embodiment of the present invention provides a kind of hard disc apparatus and information processing method, is set for solving hard disk of the prior art
It is standby the low technical problem of service life to be present, to realize the technique effect for the service life for improving hard disc apparatus.
A kind of hard disc apparatus, including:
Controller;
Nonvolatile storage, it is connected with the controller;
Hard disk main body, it is connected with the controller;
And internal memory, it is connected with the controller.
Optionally, when the hard disc apparatus is in "on" position and receives the write command sent by main frame, the control
Implement body processed is used for:
By in the first memory cell of the first data storage to the hard disk main body;
Mark corresponding with first memory cell first is patrolled in the first mapping table in the nonvolatile storage
Volume address and for characterize first data whether be effective read-write data significance bit information, obtain the second mapping table;
Mark the data message of second mapping table different from the data message of the 3rd mapping table in the internal memory, its
In, second mapping table is used to characterize between the logical address of the main frame transmission and the physical address of the hard disk main body
Mapping relations, the main frame are the electronic equipment being connected with the hard disc apparatus.
Optionally, marked in first mapping table in nonvolatile storage corresponding with first memory cell
The first logical address and for characterize first data whether be effective read-write data significance bit information, obtain second
After mapping table and when the main frame is not detected by input operation, the controller is additionally operable to:
Second mapping table is obtained from the nonvolatile storage;
Second mapping table is written in the internal memory, and mark the data message of the 3rd mapping table with it is described
The data message of second mapping table is identical.
Optionally, marked in first mapping table in nonvolatile storage corresponding with first memory cell
The first logical address and for characterize first data whether be effective read-write data significance bit information, obtain second
After mapping table, the controller is additionally operable to:
Obtain the number that each logical address is accessed in second mapping table within a period;
Based on the number, determine that the logical address that the number is more than the first preset value is first kind logical address;Institute
The logical address that number is stated less than the second preset value is the second logic of class address;The number is more than second preset value and small
In the logical address of first preset value be the 3rd logic of class address;
Will mapping table data information memory corresponding with the first kind logical address into the nonvolatile storage;Will
Mapping table data message corresponding with second logic of class address and mapping table number corresponding with the 3rd logic of class address
It is believed that breath is stored into the internal memory.
Optionally, it is described will mapping table data information memory corresponding with the 3rd logic of class address to the internal memory
In after and when the main frame is not detected by input operation, the controller is additionally operable to:
The mapping table data message corresponding with the 3rd logic of class address is obtained from the internal memory;
By the mapping table data information memory corresponding with the 3rd logic of class address into the hard disk main body.
Optionally, it is described when the hard disc apparatus is in "on" position and receives the reading instruction sent by the main frame
Controller is specifically used for:
The 4th mapping table for judging to store in the nonvolatile storage whether with stored in the internal memory the 5th mapping
Table is identical, obtains the first judged result;
If first judged result is no, the 4th mapping table is read from the nonvolatile storage;
Based on the 4th mapping table, it is determined that with the reading instruction and the corresponding things of logical address of the second data will be read
Manage address;
Based on the physical address, read from the hard disk main body in the second memory cell corresponding with the physical address
Take second data.
On the other hand, the embodiment of the present application also provides a kind of information processing method, including:
The controller of hard disc apparatus receives reads or writes instruction by what the main frame being connected with the hard disc apparatus was sent;
Based on it is described read or write instruction, the hard disc apparatus nonvolatile storage in the first mapping table and the hard disk
The second mapping table in the internal memory of equipment, to the number of the first memory cell write-in first of the hard disk main body of the hard disc apparatus
According to or from reading the second data in the second memory cell of the hard disk main body, wherein, first mapping table and described second
Mapping table is used to characterize the mapping relations between the logical address of the main frame transmission and the physical address of the hard disk main body.
Optionally, it is described after the first memory cell of the hard disk main body to the hard disc apparatus writes the first data
Method also includes:
The first logical address corresponding with first memory cell is marked in first mapping table and for characterizing
First data whether be effective read-write data significance bit information, obtain the 3rd mapping table;
Mark the data message of the 3rd mapping table different from the data message of second mapping table.
Optionally, when the main frame is not detected by input operation, the mark and described first in first mapping table
First logical address corresponding to memory cell and for characterize first data whether be effective read-write data significance bit
Information, after obtaining the 3rd mapping table, methods described also includes:
The 3rd mapping table is obtained from the nonvolatile storage;
3rd mapping table is written in the internal memory, and mark the data message of second mapping table with it is described
The data message of 3rd mapping table is identical.
Optionally, corresponding with first memory cell the first logical address and use are marked in first mapping table
In characterize first data whether be effective read-write data significance bit information, after obtaining the 3rd mapping table, the side
Method also includes:
Obtain the number that each logical address is accessed in the 3rd mapping table within a period;
Based on the number, determine that the logical address that the number is more than the first preset value is first kind logical address;Institute
The logical address that number is stated less than the second preset value is the second logic of class address;The number is more than second preset value and small
In the logical address of first preset value be the 3rd logic of class address;
Will mapping table data information memory corresponding with the first kind logical address into the nonvolatile storage;Will
Mapping table data message corresponding with second logic of class address and mapping table number corresponding with the 3rd logic of class address
It is believed that breath is stored into the internal memory.
Optionally, when the main frame is not detected by input operation, it is described will be corresponding with the 3rd logic of class address
Mapping table data information memory into the internal memory after, methods described also includes:
The mapping table data message corresponding with the 3rd logic of class address is obtained from the internal memory;
By the mapping table data information memory corresponding with the 3rd logic of class address into the hard disk main body.
The second data are read from the hard disk main body described in optional, are specifically included:
Judge whether first mapping table is identical with second mapping table, obtain the first judged result;
If first judged result is no, first mapping table is read from the nonvolatile storage;
Based on first mapping table, it is determined that physical address corresponding with the second logical address of second data;
Based on the physical address, read from the hard disk main body in the second memory cell corresponding with the physical address
Take second data.
Said one or multiple technical schemes in the embodiment of the present application, at least there is following one or more technology effects
Fruit:
First, due to the technical scheme in the embodiment of the present application be hard disc apparatus controller receive by with the hard disc apparatus
What the main frame of connection was sent reads or writes instruction;Based on it is described read or write instruction, the hard disc apparatus nonvolatile storage in
The second mapping table in the internal memory of first mapping table and the hard disc apparatus, to the of the hard disk main body of the hard disc apparatus
One memory cell writes the first data or reads the second data from the second memory cell of the hard disk main body, wherein, it is described
First mapping table and second mapping table are used for the physics for characterizing logical address and the hard disk main body that the main frame is sent
Mapping relations between address.I.e. will not be and frequent due to mapping table as in existing, mapping table is stored in hard disk main body
The characteristic that renewal and hard disk main body can not update on the spot, therefore, the hard disk main body memory cell where mapping table can continually more
Other memory cell are newly arrived, cause unnecessary erasable, reduce the service life of hard disc apparatus, and use this programme, will be reflected
Firing table is stored in nonvolatile storage, can be avoided to the erasable of hard disk main body memory cell, so, efficiently solve existing
There is the low technical problem of service life in the hard disc apparatus in technology, reached the technology effect for the service life for improving hard disc apparatus
Fruit.
2nd, due to the technical scheme in the embodiment of the present application be obtain within a period it is each in the 3rd mapping table
The accessed number of logical address;Based on the number, determine that the logical address that the number is more than the first preset value is first
Logic of class address;The logical address that the number is less than the second preset value is the second logic of class address;The number is more than described
Second preset value and be the 3rd logic of class address less than the logical address of first preset value;Will be with the first kind logically
Mapping table data information memory is into the nonvolatile storage corresponding to location;Corresponding with second logic of class address it will reflect
Firing table data message and mapping table data information memory corresponding with the 3rd logic of class address are into the internal memory, i.e., to
Data in three mapping tables are classified, the mapping table data Cun Chudao internal memories that will be changed once in a while or change frequency is relatively low
In, then the frequency for mapping table data being written to hard disk main body is greatly reduced, has reached reduction power consumption and has further reached
Improve the technique effect of the service life of hard disc apparatus.
3rd, because the technical scheme in the embodiment of the present application is that described and the 3rd logic of class is obtained from the internal memory
Mapping table data message corresponding to address;By the mapping table data information memory corresponding with the 3rd logic of class address extremely
In the hard disk main body.I.e. will not be as in the prior art, when there is write operation generation, it is necessary to frequently toward writing in hard disk main body
Map information, and when writing mapping table into hard disk main body, often runs into read-write operation, but due to by mapping table from
The speed that internal memory is written in hard disk main body is slow, therefore, it is desirable to after writing map operation and completing, could respond read-write
Operation, so as to influence readwrite performance, and in the embodiment of the present application, is in the host computer system free time, is just written to mapping table
In hard disk main body, and then improve the technique effect of readwrite performance.
Embodiment one
Fig. 1 is refer to, the embodiment of the present application provides a kind of hard disc apparatus, including:
Controller 10;
Nonvolatile storage 11, it is connected with the controller 10;
Hard disk main body 12, it is connected with the controller 10;
And internal memory 13, it is connected with the controller 10.
In specific implementation process, nonvolatile storage can be phase transition storage, magnetoresistive memory, variable resistance type storage
Device, Ferroelectric Random Access Memory etc., or other nonvolatile storages etc., are not especially limited in the embodiment of the present application.
The random read-write speed of nonvolatile storage, the read or write speed compared to hard disk main body want fast an order of magnitude
More than, specific is 30-50 times of hard disk main body read or write speed, and already close to the read or write speed of internal memory, therefore, this is in certain journey
The random read-write speed of hard disc apparatus can be improved on degree, so as to reduce between hard disc apparatus and internal memory random read-write data speed it
Between gap.
In addition, the cellar area of embedded NOR memory is 0.05 μm under same process2, and non-volatile phase change memory
The cellar area of device is 0.017 μm2, then under conditions of chip of the same area, the capacity of non-volatile phase transition storage is about
For 3 times of embedded NOR memory capacity.
For embedded NOR memory, it is required for carrying out erasing operation, and nonvolatile storage before data are write
Can be directly and without carrying out erasing operation when writing data.
Hard disk main body can be specifically NAND-type flash memory chip or NOR-type flash chip etc. in the embodiment of the present application;
Internal memory is specially dynamic RAM, synchronous DRAM or dual-magnification technique dynamic RAM etc., or its
Its dynamic RAM, is not especially limited in the embodiment of the present application.
During specific implementation, hard disc apparatus between HPI and main frame by being connected, in the embodiment of the present application,
HPI can be PCI (Peripheral Component Interconnect, external components interconnection standard), IDE
(Integrated Drive Electronics) or SATA (Serial ATA, serial ATA) interface, or other interfaces,
It is not especially limited in the embodiment of the present application.Interface between controller and hard disk main body can be Toggle DDR or ONF
Interface etc., and controller is used for performing the data such as operation sequence on hard disc apparatus, algorithm, firmware.
In the embodiment of the present application, it is in "on" position in the hard disc apparatus and receives the write command sent by main frame
When, the controller 10 is specifically used for:
By in the first memory cell of the first data storage to the hard disk main body;
Mark corresponding with first memory cell first is patrolled in the first mapping table in the nonvolatile storage
Volume address and for characterize first data whether be effective read-write data significance bit information, obtain the second mapping table;
Mark the data message of second mapping table different from the data message of the 3rd mapping table in the internal memory, its
In, second mapping table is used to characterize between the logical address of the main frame transmission and the physical address of the hard disk main body
Mapping relations, the main frame are the electronic equipment being connected with the hard disc apparatus.
In the embodiment of the present application, mark in first mapping table in nonvolatile storage and deposited with described first
First logical address corresponding to storage unit and for characterize first data whether be effective read-write data significance bit letter
Breath, the second mapping table is obtained afterwards and when the main frame is not detected by input operation, the controller 10 is additionally operable to:
Second mapping table is obtained from the nonvolatile storage;
Second mapping table is written in the internal memory, and mark the data message of the 3rd mapping table with it is described
The data message of second mapping table is identical.
In the embodiment of the present application, mark in first mapping table in nonvolatile storage and deposited with described first
First logical address corresponding to storage unit and for characterize first data whether be effective read-write data significance bit letter
Breath, after obtaining the second mapping table, the controller 10 is additionally operable to:
Obtain the number that each logical address is accessed in second mapping table within a period;
Based on the number, determine that the logical address that the number is more than the first preset value is first kind logical address;Institute
The logical address that number is stated less than the second preset value is the second logic of class address;The number is more than second preset value and small
In the logical address of first preset value be the 3rd logic of class address;
Will mapping table data information memory corresponding with the first kind logical address into the nonvolatile storage;Will
Mapping table data message corresponding with second logic of class address and mapping table number corresponding with the 3rd logic of class address
It is believed that breath is stored into the internal memory.
In the embodiment of the present application, it is described will mapping table data information memory corresponding with the 3rd logic of class address
After into the internal memory and when the main frame is not detected by input operation, the controller 10 is additionally operable to:
The mapping table data message corresponding with the 3rd logic of class address is obtained from the internal memory;
By the mapping table data information memory corresponding with the 3rd logic of class address into the hard disk main body.
In the embodiment of the present application, it is in "on" position in the hard disc apparatus and receives the reading sent by the main frame and refers to
When making, the controller 10 is specifically used for:
The 4th mapping table for judging to store in the nonvolatile storage whether with stored in the internal memory the 5th mapping
Table is identical, obtains the first judged result;
If first judged result is no, the 4th mapping table is read from the nonvolatile storage;
Based on the 4th mapping table, it is determined that with the reading instruction and the corresponding things of logical address of the second data will be read
Manage address;
Based on the physical address, read from the hard disk main body in the second memory cell corresponding with the physical address
Take second data.
Embodiment two
The embodiment of the present application also provides a kind of information processing method, refer to Fig. 2, including:
S101:The controller of hard disc apparatus receives reads or writes instruction by what the main frame being connected with the hard disc apparatus was sent;
S102:Based on it is described read or write instruction, the hard disc apparatus nonvolatile storage in the first mapping table and institute
The second mapping table in the internal memory of hard disc apparatus is stated, is write to the first memory cell of the hard disk main body of the hard disc apparatus
First data read the second data from the second memory cell of the hard disk main body, wherein, first mapping table and institute
The second mapping table is stated to be used to characterize the mapping between the logical address of the main frame transmission and the physical address of the hard disk main body
Relation.
In the embodiment of the present application, a kind of information processing method can apply to a hard disc apparatus, wherein, hard disc apparatus bag
Include:Controller;Nonvolatile storage, it is connected with the controller;Hard disk main body, it is connected with the controller;And internal memory, with institute
State controller connection.
In specific implementation process, nonvolatile storage can be phase transition storage, magnetoresistive memory, variable resistance type storage
Device, Ferroelectric Random Access Memory etc., or other nonvolatile storages etc., are not especially limited in the embodiment of the present application.
The random read-write speed of nonvolatile storage, the read or write speed compared to hard disk main body want fast an order of magnitude
More than, specific is 30-50 times of hard disk main body read or write speed, and already close to the read-write express delivery of internal memory, therefore, this is in certain journey
The random read-write speed of hard disc apparatus can be improved on degree, so as to reduce between hard disc apparatus and internal memory random read-write data speed it
Between gap.
In addition, the cellar area of embedded NOR memory is 0.05 μm under same process2, and non-volatile phase change memory
The cellar area of device is 0.017 μm2, in chip of the same area, the capacity of non-volatile phase transition storage is about that embedded NOR is deposited
Store up capacity 3 times.
For embedded NOR memory, it is required for carrying out erasing operation, and nonvolatile storage before data are write
Can be directly and without carrying out erasing operation when writing data.
Hard disk main body can be specifically NAND-type flash memory chip or NOR-type flash chip etc. in the embodiment of the present application;
Internal memory is specially dynamic RAM, synchronous DRAM or dual-magnification technique dynamic RAM etc., or its
Its dynamic RAM, is not especially limited in the embodiment of the present application.
During specific implementation, hard disc apparatus between HPI and main frame by being connected, in the embodiment of the present application,
HPI can be PCI, IDE or SATA interface, or other interfaces, be not especially limited in the embodiment of the present application.
Interface between controller and hard disk main body can be Toggle DDR or ONF interfaces etc., and controller sets for performing hard disk
The data such as standby upper operation sequence, algorithm, firmware.
In the embodiment of the present application, step S101 is first carried out:The controller of hard disc apparatus is received by being set with the hard disk
What the main frame of standby connection was sent reads or writes instruction.
During specific implementation, need to be written and read operation to the data in the hard disk main body of hard disc apparatus in user
When, the controller of hard disc apparatus can then receive the reading instruction sent by the main frame being connected with hard disc apparatus or write command.
After the read write command sent by main frame is received, then step S102 is performed:Instruction, described is read or write based on described
The first mapping table in the nonvolatile storage of hard disc apparatus and the second mapping table in the internal memory of the hard disc apparatus, to described
First memory cell of the hard disk main body of the hard disc apparatus writes the first data or single from the second storage of the hard disk main body
The second data are read in member, wherein, first mapping table and second mapping table are used to characterize patrolling for the main frame transmission
Collect the mapping relations between address and the physical address of the hard disk main body.
During specific implementation, receive by main frame send read write command and read-write data logical address it
Afterwards, in the first mapping table and internal memory that are stored in logical address and nonvolatile storage of the controller according to read write command and data
Logical address is converted into physical address by the second mapping table of storage, then according to physical address, is directly read from hard disk main body
Write data.
In the embodiment of the present application, in execution of step:The first storage to the hard disk main body of the hard disc apparatus
After unit, Fig. 3 is refer to, methods described also includes:
S201:The first logical address corresponding with first memory cell is marked in first mapping table and is used for
Characterize first data whether be effective read-write data significance bit information, obtain the 3rd mapping table;
S202:Mark the data message of the 3rd mapping table different from the data message of second mapping table.
During specific implementation, after receiving the write command sent by main frame and writing the logical address of data, control
Device processed is according to write command and writes the logical addresses of data, such as 1,2 or 3, according to the first mapping stored in nonvolatile storage
Table, a new physical address, such as 1000 are found in the first mapping table, then according to physical address 1000, the first data A is write
Enter into the first memory cell 1000.
, it is necessary to which first mapping table that upgrades in time, i.e., reflect first after writing first data into the first memory cell
Add whether the data of physical address 1000 and first corresponding with logical address 1 can effectively be read and write in firing table, such as effectively
Position is desirable " 0 " or " 1 ", represents that data can be read and write when significance bit is " 1 ", when significance bit is " 0 ", represents that data cannot
Read-write, specifically exists, after data A is stored in the first memory cell to hard disk main body, the reading of these data in hard disk main body
It is " 1 " to write significance bit, so, after updating the first mapping table, then obtain new mapping table i.e. the second mapping table.
The first mapping table being stored in due to the mapping table of renewal in nonvolatile storage, is reflected for the 3rd in internal memory
Firing table is updated, therefore the data message and the 3rd mapping table of the second mapping table are identified in nonvolatile storage
Data message simultaneously differs.
In the embodiment of the present application, mapping table is stored in nonvolatile storage, can avoided because mapping table is frequent
Update and cause memory cell in hard disk main body by excessively erasable, so as to improve the life-span of flash chip.It can also add simultaneously
The reconstruction speed of fast mapping table, this is due to, it is necessary to from hard disk master when restarting after traditional hard disc apparatus electrifying startup or power down
Mapping table data message is extracted in each memory cell of body into internal memory with reconstructed mapped table, and is mapped in the embodiment of the present application
Table is stored in nonvolatile storage, much faster compared to mapping table data message is read from hard disk main body, saves power consumption.
In the embodiment of the present application, main frame is performing operating system or when application program, general step be by
Operating system or application program are loaded into internal memory from hard disk main body, then are performed by controller.And loaded from hard disk main body
Speed into content is slow, and some parts of operating system or application program may be often performed, and be performed every time
Operating system or application program will be partially loaded into these in internal memory, therefore cause opening for operating system or application program
Dynamic speed is unhappy, and bad experience is brought to user, therefore in order to improve Consumer's Experience, in the embodiment of the present application will frequent quilt
The part or all of storage of the operating system or application program of execution to non-volatile memory wherein.
In addition, during specific implementation, in order to shield the physical characteristic of hard disk main body to upper strata, hard disk main body is abstracted
Into look-alike disk block device, it is necessary to specific hard disk main body storage management block.A kind of important and widely used method is exactly
Flash translation layer (FTL) carrys out storage management flash memory device.The major function of flash translation layer (FTL) is logical block maps, garbage reclamation and loss
Equilibrium etc..Flash translation layer (FTL) is realized by controller on hardware, and logical block maps are that the logical address for providing main frame turns
The physical address of hard disk principal space is changed to, i.e., logical address is provided by the file system in main frame, is converted into according to mapping table
The physical address of hard disk main body, operation is written and read to hard disk main body so as to realize.
Therefore, in the embodiment of the present application, nonvolatile storage can be used for firmware program and the calculation of storage hard disk equipment
Method data, such as:Mapping address algorithm, garbage collection algorithms, loss equalizing algorithm etc., memory map assignments are may also be used for, also may be used
To store firmware program and algorithm and mapping table etc. simultaneously, above-mentioned several ways, those of ordinary skill in the art can root
It is selected according to being actually needed, it is not especially limited in the embodiment of the present application.
In the embodiment of the present application, in execution of step S201:Mark in first mapping table and deposited with described first
First logical address corresponding to storage unit and for characterize first data whether be effective read-write data significance bit letter
Breath, after obtaining the 3rd mapping table, methods described also includes:
The 3rd mapping table is obtained from the nonvolatile storage;
3rd mapping table is written in the internal memory, and mark the data message of second mapping table with it is described
The data message of 3rd mapping table is identical.
After writing data in hard disk main body during specific implementation, the first mapping table in nonvolatile storage is able to
Renewal, obtains the second new mapping table, because in actual use, the random read-write speed of internal memory is higher than non-volatile deposit
The random read-write speed of reservoir, while in order to avoid when the second mapping table in nonvolatile storage is written in internal memory,
The performance of the read-write operation of main frame is influenced whether, then in the case where the system of main frame is in idle condition, is just write the second mapping table
Into internal memory.
After the second mapping table is written into internal memory, the mapping table data message that is stored in internal memory then with nonvolatile storage
The mapping table data message of middle storage is identical.
In the embodiment of the present application, in execution of step S201:Mark in first mapping table and deposited with described first
First logical address corresponding to storage unit and for characterize first data whether be effective read-write data significance bit letter
Breath, after obtaining the 3rd mapping table, Fig. 4 is refer to, methods described also includes:
S301:Obtain the number that each logical address is accessed in the 3rd mapping table within a period;
S302:Based on the number, determine logical address of the number more than the first preset value for the first kind logically
Location;The logical address that the number is less than the second preset value is the second logic of class address;It is default that the number is more than described second
The logical address for being worth and being less than first preset value is the 3rd logic of class address;
S303:Will mapping table data information memory corresponding with the first kind logical address to the nonvolatile storage
In;Will mapping table data message corresponding with second logic of class address and mapping corresponding with the 3rd logic of class address
Table data information memory is into the internal memory.
In the embodiment of the present application, after in the first memory cell for write first data into hard disk main body, due to non-
The memory space of volatile memory is certain, so cold and hot sequence is carried out to the mapping table data in the second mapping table,
During specific implementation, by the inspection software installed in main frame, obtain each logical address in the second mapping table and be accessed
Number, such as:It can be 2 hours, 5 hours or 12 hours etc. within a period, and can be other periods, this
Field those of ordinary skill can be set according to being actually needed, and be not especially limited in the embodiment of the present application.
In the embodiment of the present application, for a period of time exemplified by 2 hours, it is assumed that logical address 1 is accessed number as 20 times, patrols
To collect address 2 and be accessed number as 25 times, logical address 3 is accessed number as 30 times, and logical address 4 is accessed number as 10 times,
Logical address 5 is accessed number as 15 times, and logical address 6 is accessed number 17, therefore is each patrolled in the second mapping table is counted
After collecting the accessed number in address, then statistics number is wanted to be more than the first kind logical address of the first preset value, in the embodiment of the present application
In, the first preset value can be 20,25 or 30 etc., and those of ordinary skill in the art can be set according to being actually needed,
It is not especially limited in the embodiment of the present application.Then statistics number is also wanted to be less than the second logic of class address of the second preset value,
In the embodiment of the present application, the second preset value can be 5,10 or 15 etc., and those of ordinary skill in the art can be according to being actually needed
Set, be not especially limited in the embodiment of the present application.
In the embodiment of the present application, the first preset value is exemplified by 20, and the second preset value is exemplified by 15, then number is more than 20
Logical address has 1,2,3 three logical address, is first kind logical address, in the embodiment of the present application also referred to as hot number
According to;Logical address of the times of acquisition less than 15 has 4 and 5 two logical addresses, i.e. the second logic of class address, in the embodiment of the present application
In also referred to as cold data;So logical address of the times of acquisition more than 15 and less than 20 is 6, i.e. the 3rd logic of class address,
Warm data are also referred to as in the embodiment of the present application.
After the data in the second mapping table carry out cold and hot sequence, then dsc data is stored in nonvolatile storage,
By cold data and warm data storage in internal memory.
In the embodiment of the present application, except the firmware program of mapping table or hard disc apparatus and algorithm are stored in into non-volatile deposit
, can also be by the data storage of the most frequent random read-write of user in nonvolatile storage in reservoir.Because user is one
Section the time in random read-write data be probably hard disk main bodys different in storage hard disk equipment different masses not on same page not
In certain continuous byte, when the data of most frequent random read-write are put into nonvolatile storage, data can be put into
In same one page of same on nonvolatile storage or the successive byte of continuous page.In addition, in the hard of access hard disk equipment
During disc main body, the reading interface of data is usually serial read-write mode, and the interface between nonvolatile storage and controller can
To form parallel interface, therefore, read-write data can be hard so as to be carried while hard disc apparatus service life is improved with concurrent reading and concurrent writing
The random read-write speed of disc apparatus.
In the embodiment of the present application, when the main frame is not detected by input operation, will be patrolled described with the 3rd class
After volume mapping table data information memory is into the internal memory corresponding to address, methods described also includes:
The mapping table data message corresponding with the 3rd logic of class address is obtained from the internal memory;
By the mapping table data information memory corresponding with the 3rd logic of class address into the hard disk main body.
In the embodiment of the present application, in order to ensure that mapping table is consistent with the data really stored in hard disk main body,
In order to avoid mapping table to be written to the performance for the read-write operation that main frame can be influenceed in hard disk main body, then it is in host computer system
Idle condition, or when main frame will power off, mapping table data message corresponding with the 3rd logic of class address is written to hard disk master
In body, in the embodiment of the present application, because cold data is the data that have not changed as, so, and cold data need not be write
Into hard disk main body, and dsc data is the data being often modified, then in order to avoid the excessive wiping to hard disk main body memory cell
Write, by dsc data storage into nonvolatile storage, therefore it may only be necessary to which warm data are write into hard disk main body, avoid frequency
Map information is write in numerous main body toward hard disk, so as to improve the service life of hard disc apparatus.
In the embodiment of the present application, it is described to read the second data from the hard disk main body, specifically include:
Judge whether first mapping table is identical with second mapping table, obtain the first judged result;
If first judged result is no, first mapping table is read from the nonvolatile storage;
Based on first mapping table, it is determined that physical address corresponding with the second logical address of second data;
Based on the physical address, read from the hard disk main body in the second memory cell corresponding with the physical address
Take second data.
During specific implementation, when receiving the reading instruction sent by main frame, first determine whether in nonvolatile storage
Whether the first mapping table and the mapping table of internal memory second of storage are identical, need exist for judging whether the first mapping table maps with second
Table is identical, is primarily due to after having write operation, is that the mapping table in nonvolatile storage is updated first, and not
Have and the mapping table in nonvolatile storage is written in internal memory in time, so as to cause the second mapping table in content to be reflected with first
Firing table differs.
After being judged, if the first mapping table is identical with the second mapping table, the second mapping table is read from internal memory, will
Reading instruction and the logical address for reading data is converted into physical address, it is single from the storage corresponding with physical address of hard disk main body
Data are read in member, here when the first mapping table is identical with the second mapping table, read from internal memory the second mapping table be because
The random read-write speed of internal memory is higher than the random read-write speed of nonvolatile storage.
During specific implementation, if the first mapping table differs with the second mapping table, read from nonvolatile storage
Take the first mapping table by reading instruction and by read data logical address be converted into physical address, from hard disk main body with physically
Data are read in memory cell corresponding to location.
Pass through one or more of the embodiment of the present application technical scheme, it is possible to achieve following one or more technology effects
Fruit:
First, due to the technical scheme in the embodiment of the present application be hard disc apparatus controller receive by with the hard disc apparatus
What the main frame of connection was sent reads or writes instruction;Based on it is described read or write instruction, the hard disc apparatus nonvolatile storage in
The second mapping table in the internal memory of first mapping table and the hard disc apparatus, to the of the hard disk main body of the hard disc apparatus
One memory cell writes the first data or reads the second data from the second memory cell of the hard disk main body, wherein, it is described
First mapping table and second mapping table are used for the physics for characterizing logical address and the hard disk main body that the main frame is sent
Mapping relations between address.I.e. will not be and frequent due to mapping table as in existing, mapping table is stored in hard disk main body
The characteristic that renewal and hard disk main body can not update on the spot, therefore, the hard disk main body memory cell where mapping table can continually more
Other memory cell are newly arrived, cause unnecessary erasable, reduce the service life of hard disc apparatus, and use this programme, will be reflected
Firing table is stored in nonvolatile storage, can be avoided to the erasable of hard disk main body memory cell, so, efficiently solve existing
There is the low technical problem of service life in the hard disc apparatus in technology, reached the technology effect for the service life for improving hard disc apparatus
Fruit.
2nd, due to the technical scheme in the embodiment of the present application be obtain within a period it is each in the 3rd mapping table
The accessed number of logical address;Based on the number, determine that the logical address that the number is more than the first preset value is first
Logic of class address;The logical address that the number is less than the second preset value is the second logic of class address;The number is more than described
Second preset value and be the 3rd logic of class address less than the logical address of first preset value;Will be with the first kind logically
Mapping table data information memory is into the nonvolatile storage corresponding to location;Corresponding with second logic of class address it will reflect
Firing table data message and mapping table data information memory corresponding with the 3rd logic of class address are into the internal memory, i.e., to
Data in three mapping tables are classified, the mapping table data Cun Chudao internal memories that will be changed once in a while or change frequency is relatively low
In, then the frequency for mapping table data being written to hard disk main body is greatly reduced, has reached reduction power consumption and has further reached
Improve the technique effect of the service life of hard disc apparatus.
3rd, because the technical scheme in the embodiment of the present application is that described and the 3rd logic of class is obtained from the internal memory
Mapping table data message corresponding to address;By the mapping table data information memory corresponding with the 3rd logic of class address extremely
In the hard disk main body.I.e. will not be as in the prior art, when there is write operation generation, it is necessary to frequently toward writing in hard disk main body
Map information, and when writing mapping table into hard disk main body, often runs into read-write operation, but due to by mapping table from
The speed that internal memory is written in hard disk main body is slow, therefore, it is desirable to after writing map operation and completing, could respond read-write
Operation, so as to influence readwrite performance, and in the embodiment of the present application, is in the host computer system free time, is just written to mapping table
In hard disk main body, and then improve the technique effect of readwrite performance.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or computer program
Product.Therefore, the present invention can use the reality in terms of complete hardware embodiment, complete software embodiment or combination software and hardware
Apply the form of example.Moreover, the present invention can use the computer for wherein including computer usable program code in one or more
The computer program production that usable storage medium is implemented on (including but is not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention is the flow with reference to method according to embodiments of the present invention, equipment (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be by every first-class in computer program instructions implementation process figure and/or block diagram
Journey and/or the flow in square frame and flow chart and/or block diagram and/or the combination of square frame.These computer programs can be provided
The processors of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing devices is instructed to produce
A raw machine so that produced by the instruction of computer or the computing device of other programmable data processing devices for real
The device for the function of being specified in present one flow of flow chart or one square frame of multiple flows and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that the instruction being stored in the computer-readable memory, which produces, to be included referring to
Make the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one square frame of block diagram or
The function of being specified in multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices so that counted
Series of operation steps is performed on calculation machine or other programmable devices to produce computer implemented processing, so as in computer or
The instruction performed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in individual square frame or multiple square frames.
Specifically, computer program instructions can be stored in corresponding to the information processing method in the embodiment of the present application
In the storage mediums such as CD, hard disk, USB flash disk, when computer program instructions quilt corresponding with information processing method in storage medium
When one electronic equipment reads or is performed, comprise the following steps:
The controller of hard disc apparatus receives reads or writes instruction by what the main frame being connected with the hard disc apparatus was sent;
Based on it is described read or write instruction, the hard disc apparatus nonvolatile storage in the first mapping table and the hard disk
The second mapping table in the internal memory of equipment, to the number of the first memory cell write-in first of the hard disk main body of the hard disc apparatus
According to or from reading the second data in the second memory cell of the hard disk main body, wherein, first mapping table and described second
Mapping table is used to characterize the mapping relations between the logical address of the main frame transmission and the physical address of the hard disk main body.
Optionally, other computer program instructions are also stored in the storage medium, the other computer journey
Sequence instruction with step:Calculating corresponding to the first data is write in the first memory cell of the hard disk main body to the hard disc apparatus
Machine programmed instruction is performed after being performed, and is comprised the following steps in implementation procedure:
The first logical address corresponding with first memory cell is marked in first mapping table and for characterizing
First data whether be effective read-write data significance bit information, obtain the 3rd mapping table;
Mark the data message of the 3rd mapping table different from the data message of second mapping table.
Optionally, other computer program instructions are also stored with the storage medium, the other computer
Programmed instruction with step:When the main frame is not detected by input operation, the mark and described the in first mapping table
First logical address corresponding to one memory cell and for characterizing whether first data are the effective of effective read-write data
Position information, computer program instructions corresponding to the 3rd mapping table of acquisition are performed after being performed, and implementation procedure includes as follows
Step:
The 3rd mapping table is obtained from the nonvolatile storage;
3rd mapping table is written in the internal memory, and mark the data message of second mapping table with it is described
The data message of 3rd mapping table is identical.
Optionally, other computer program instructions are also stored with the storage medium, the other computer
Programmed instruction with step:Marked in first mapping table corresponding with first memory cell the first logical address and
For characterize first data whether be effective read-write data significance bit information, obtain and calculated corresponding to the 3rd mapping table
Machine programmed instruction is performed after being performed, and is comprised the following steps in implementation procedure:
Obtain the number that each logical address is accessed in the 3rd mapping table within a period;
Based on the number, determine that the logical address that the number is more than the first preset value is first kind logical address;Institute
The logical address that number is stated less than the second preset value is the second logic of class address;The number is more than second preset value and small
In the logical address of first preset value be the 3rd logic of class address;
Will mapping table data information memory corresponding with the first kind logical address into the nonvolatile storage;Will
Mapping table data message corresponding with second logic of class address and mapping table number corresponding with the 3rd logic of class address
It is believed that breath is stored into the internal memory.
Optionally, other computer program instructions are also stored with the storage medium, the other computer
Programmed instruction with step:When the main frame is not detected by input operation, it is described will be with the 3rd logic of class address pair
The mapping table data information memory answered corresponding computer program instructions into the internal memory are performed after being performed, and are performed
Comprise the following steps in journey:
The mapping table data message corresponding with the 3rd logic of class address is obtained from the internal memory;
By the mapping table data information memory corresponding with the 3rd logic of class address into the hard disk main body.
Optionally, what is stored in the storage medium is corresponding with reading the second data from the hard disk main body described in step
Computer program instructions during being performed, specifically comprise the following steps:
Judge whether first mapping table is identical with second mapping table, obtain the first judged result;
If first judged result is no, first mapping table is read from the nonvolatile storage;
Based on first mapping table, it is determined that physical address corresponding with the second logical address of second data;
Based on the physical address, read from the hard disk main body in the second memory cell corresponding with the physical address
Take second data.
Although preferred embodiments of the present invention have been described, but those skilled in the art once know basic creation
Property concept, then can make other change and modification to these embodiments.So appended claims be intended to be construed to include it is excellent
Select embodiment and fall into having altered and changing for the scope of the invention.
Obviously, those skilled in the art can carry out the essence of various changes and modification without departing from the present invention to the present invention
God and scope.So, if these modifications and variations of the present invention belong to the scope of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to comprising including these changes and modification.