Hard disk data protection method and computer memory system
Technical field
The present invention relates to the hard disk data protection methods and meter under a kind of computer realm more particularly to a kind of instant power-down
Calculation machine storage system.
Background technology
The mass-memory unit that active computer uses is generally mechanical hard disk or solid state disk.Mechanical hard disk uses machine
Tool flabellum stores data, uses mechanical head read or write-in data;Solid state disk uses flash memory as storage medium, uses electronics
Addressing system reads and writees data.During computer use, it is likely that encounter the unexpected power down of power supply or crash and close by force
The situation of machine so that the unexpected power down of hard disk.Mechanical hard disk has many protections to arrange the mechanical device of hard disc data and hard disk itself
Apply, but in unexpected power down present hard discs all only have magnetic head reset mechanical protection measures, for data itself have no ability into
Row protection.Solid state disk itself also has certain protection mechanism, such as carries out bad block analysis to hard disk, the means such as Backup Data, but
In system power failure, data manipulation may be read and write and proceed to half, or imperfect, the Wu Fabao to the read-write operation of system file
Card system executes the order of hard disk operation, can not ensure the integrality and reliability of data.
In view of this, on it is necessary to provide a kind of improved hard disk data protection methods and computer memory system to solve
State problem.
Invention content
Avoid that hard disc data is imperfect in the case of instant power-down or system cannot be just the purpose of the present invention is to provide one kind
The method and computer memory system often to work.
For achieving the above object, the present invention provides a kind of hard disk data protection method, include the following steps:
M1, when monitor working power power-off when, preset data buffer judge the hard disk last time operation
Whether be registration table data;
If so, executing M2;
If it is not, executing M3;
M2, judged by the data buffer hard disk last time operation whether be to registration table the last one
The operation of data;
If so, operating entire registry data to the hard disk;
If it is not, entire registry data of the pre- backup in the data buffer is directed into the hard disk, and by institute
The data manipulation of registration table is stated to the hard disk;
M3, judge whether the last item order of the data buffer caching is complete;
If so, the data manipulation in the data buffer will be buffered in the hard disk;
If it is not, abandoning the operational order, the operation is not executed.
To achieve the above object, the present invention provides a kind of computer memory system, including CPU module and the CPU module
The hard disk of electric connection, and be the working power of hard disk power supply, further include:On off operating mode for monitoring power supply
Monitor, for the hard disk power supply emergency service power supply and data buffer, when the monitor monitors the work
When making power cut-off, the monitor sends status command to the data buffer, and triggers inside the data buffer
Control module, the control module controls the data buffer and judges the number currently operated to the last time of the hard disk
According to type and the integrality of order, and select corresponding operation to the hard disk.
As a further improvement on the present invention, the data buffer at least cache a complete CPU operation data and
Order, and back up entire registry data after system is switched on every time.
As a further improvement on the present invention, the working power is powered by the first power supply circuit for the hard disk, institute
It states emergency service power supply to power for the hard disk by the second power supply circuit, first power supply circuit and the second power supply circuit phase
Mutually in parallel and respectively described power supply circuit two branches, be additionally provided in the conjunction branch of the power supply circuit with the working power and
The circuit switch that emergency service power supply is electrically connected.
As a further improvement on the present invention, pass through the first control electricity between the working power and the circuit switch
Road concatenates, and the working power between the data buffer by second control circuit by being concatenated, the first control electricity
Road and second control circuit is parallel with one another and two branches of respectively control circuit, be additionally provided in the conjunction branch of the control circuit with
The monitor that the data buffer and circuit switch are electrically connected.
As a further improvement on the present invention, when the monitor monitor working power power-off when, the monitor to
The circuit switch sends the order for switching the power supply circuit.
As a further improvement on the present invention, the emergency service power supply is the hard disk local power.
As a further improvement on the present invention, the working power can give the emergency service by emergency supply circuit
Power supply energy storage.
As a further improvement on the present invention, the CPU module includes CPU, south bridge module and north bridge module, the south bridge
It is electrically connected by hdd data bus between module and the data buffer.
The beneficial effects of the invention are as follows:The present invention discloses one kind under power-down conditions, protects data in the hard disk complete
Property and provide system stability method and computer memory system, by judge the currently performed operation data type of hard disk with
And the integrality of order, and control data buffer and corresponding operation is executed to the hard disk, hard disc data can be protected complete
Also the safety of system is improved while property.
In addition, the present invention also provides a kind of computer memory system, by the way that data buffer is arranged, for caching at least one
The complete operational order of item and data, and the data of entire registration table are backed up in each system boot, for working as the work
When making power supply and powering off suddenly, caching need to execute the stability that system has been effectively ensured to the registry data of the hard disk.
Furthermore the present invention also provides a kind of emergency service power supplys of only hard disk local power, can overcome common answer
Anxious power supply for whole system due to powering, and the disadvantage for causing electric quantity consumption too fast.
Description of the drawings
Fig. 1 is the structure composition figure of computer memory system of the present invention.
Fig. 2 is hard disk data protection method flow chart of the present invention.
Specific implementation mode
Hereinafter, the present invention will be described in detail with reference to various embodiments shown in the accompanying drawings, below preferably for the present invention one
Embodiment.
Shown in Figure 1, the present invention relates to a kind of computer memory systems 100, including CPU module 10 and the CPU
The hard disk of the electric connection of module 10, the working power for hard disk power supply, the off-position for monitoring the working power
Monitor, for the hard disk power supply emergency service power supply, circuit switch and data buffer.
The CPU module 10 includes CPU, south bridge module and north bridge module, the south bridge module and the data buffer
Between be electrically connected by hdd data bus 11.
The working power is powered by the first power supply circuit 12 for the hard disk, and the emergency service power supply passes through second
Power supply circuit 13 is hard disk power supply, and first power supply circuit, 12 and second power supply circuit 13 is parallel with one another and respectively institute
State two branches of power supply circuit, the circuit switch be set to the hard disk power supply circuit conjunction branch it is upper and respectively with the work
Power supply and emergency service power supply are electrically connected, for when the monitoring module monitors are powered off to the working power, switching
It powers to the emergency service power supply for the hard disk.The emergency service power supply is only the hard disk local power, Neng Gouke
Common emergency service power supply is taken due to powering for whole system, and the disadvantage for causing electric quantity consumption too fast.The working power
The emergency service power supply energy storage can be given by emergency supply circuit 16.
It is concatenated by first control circuit 14 between the working power and the circuit switch, the working power is logical
It crosses between the data buffer and is concatenated by second control circuit 15, the first control circuit 14 and second control circuit 15
Parallel with one another and respectively control circuit two branches, the monitor be arranged the control circuit conjunction branch on, and with institute
It states data buffer and circuit switch is electrically connected, for being powered off to the working power when the monitoring module monitors
When, the power-down state instruction of the working power is respectively sent to the circuit switch and data buffer.
The data buffer is used at least cache a complete CPU operation data and order, and each in system
Entire registry data is backed up after booting, when the monitor monitors working power power-off, the monitor is to the number
Power-down state instruction is sent according to buffer, and triggers the control module inside the data buffer, the control module passes through
The integrality for judging the data type and institute's cache command to the operation of the last time of the hard disk at this time, it is slow to control the data
Storage executes corresponding operation to the hard disk.In the present embodiment, the data buffer executes corresponding operation to write
Operation.
At this point, the monitor also sends the order switched to the power supply circuit to the circuit switch so that institute
Emergency service power supply is stated to be powered the hard disk.
Shown in Figure 2, the present invention also provides a kind of hard disk data protection methods, include the following steps:
M1, power down shape is sent when the monitor monitors that the working power powers off, and to the data buffer
State instructs, the control module inside the data buffer judge at this time to the last time operation data of the hard disk whether be
The data of registration table;
If so, executing M2;
If it is not, executing M3;
M2, by the data buffer judge to the operation of the last time of the hard disk whether be to registration table last
The operation of a data.Since registration table is made of multiple complete operation datas, if only one of operation data is carried out
Operation can cause whole system that cannot normally start to the hard disk when being switched on next time;
If so, operating entire registry data to the hard disk;
If it is not, entire registry data of the backup in the data buffer is directed into the hard disk, and will be described
The data manipulation of registration table is to the hard disk;
M3, judge whether the last item operational order of the data buffer caching is complete;
If so, the data manipulation in the data buffer will be buffered in the hard disk;
If it is not, abandoning the operational order, the operation is not executed, to achieve the purpose that the protection hard disc data integrality.
In conclusion the present invention discloses one kind under power-down conditions, protects data integrity in the hard disk and system is provided
The method and computer memory system for stability of uniting, by first judging the currently performed operation data type of hard disk and order
Integrality, and control data buffer and corresponding operation is executed to the hard disk, while hard disc data integrality can be protected
Also the safety of system is improved.
In addition, the present invention also provides a kind of computer memory system, by the way that data buffer is arranged, for caching at least one
The complete operational order of item and data, and the data of entire registration table are backed up in each system boot, for working as the work
When making power supply and powering off suddenly, caching need to execute the stability that system has been effectively ensured to the registry data of the hard disk.
Furthermore the present invention also provides a kind of emergency service power supplys of only hard disk local power, can overcome common answer
Anxious power supply for whole system due to powering, and the disadvantage for causing electric quantity consumption too fast.
It should be appreciated that although this specification is described in terms of embodiments, but not each embodiment only includes one
A independent technical solution, this description of the specification is merely for the sake of clarity, and those skilled in the art should will say
As a whole, the technical solution in each embodiment may also be suitably combined to form those skilled in the art can for bright book
With the other embodiment of understanding.
The series of detailed descriptions listed above only for the present invention feasible embodiment specifically
Bright, they are all without departing from equivalent implementations made by technical spirit of the present invention not to limit the scope of the invention
Or change should all be included in the protection scope of the present invention.