Background technology
Along with economic prosperity and scientific-technical progress, the use of various computing machines and server is day by day general, yet in exist and occupy epochmaking status in computing machine and the server, the influence of systemic-function is just being played the part of than more crucial in the past role, as long as the above mistake of 1bit takes place in the internal memory, just can make data produce wrong or loss, cause the very big puzzlement of consumer.
Existing two-sided stitch definition memory modules (Dual In-line Memory Modules; DIMM) the data storing technology uses mode standard (Standard), omission pattern (Spare) and three kinds of patterns of mirror image pattern (Mirror) to carry out the action of data backup, what this must illustrate be, above-mentioned three kinds of technology are technology that electronics industry is used always, so repeat no more, yet,, need to take one group of identical internal memory of size and be used for backing up though these three kinds of patterns have higher fiduciary level, therefore can only use the memory size of half in the design, cause the waste of money and internal memory.
Therefore, how to avoid the data occupancy memory headroom of archive memory, cause the use capacity of internal memory to reduce, cause internal memory to waste, real problem for demanding urgently at present handling.
Summary of the invention
Shortcoming in view of above-mentioned prior art; fundamental purpose of the present invention is to provide a kind of data guard method of storage device; detect by the bit data of desiring to be stored in this storage device; to detect the bad block of this storage device, in data backup, also can avoid taking the standby memory capacity and the fiduciary level that promotes computer installation of this storage device thus.
For reaching above-mentioned and other purpose, the invention provides a kind of data guard method of storage device, it is applied to have in the computer installation of this storage device, this storage device is made up of a plurality of block, this data guard method may further comprise the steps:, with the storage unit of (bit) stored bit data is detected with data storing during in this storage device at this computer installation; And if detect and have wrong bit data, the block that then will be used to store these error bit data backups to predetermined block.
In another embodiment of the data guard method of storage device of the present invention, the data guard method of this storage device comprises that also whether this computer installation add up this number of blocks with error bit data greater than setting value, if greater than then exporting alarm signal.
Whether the detection that this computer installation carried out is handled and is referred to the stored bit data of this storage device, carries out odd-parity detection or even parity and detects, wrong to judge the bit data in the block.
Therefore; the data guard method of storage device of the present invention; can effectively avoid prior art to need to keep in advance the backup block because of this storage device; so that the memory size of reducing storage device; and but the real-time informing user changes the storage device that is about to damage; improve the use capacity of storage device thus, and promote the fiduciary level of computer installation.
Embodiment
Below by specific instantiation explanation embodiments of the present invention, those skilled in the art can understand other advantage of the present invention and effect easily by the content that this instructions disclosed.
See also Fig. 1; it is the basic framework block schematic diagram of the data guard method of running storage device of the present invention; as shown in the figure, the computer installation 1 that operates the data guard method of storage device of the present invention is made up of storage device 11, basic input/output system (BIOS) 12, operating system 13 and driver 14.What this must illustrate be; the computer installation 1 of using the data guard method of storage device of the present invention has other various functional unit in addition; be simplicity of illustration and explanation; framework herein only shows the member relevant with the present invention; the hardware structure of south bridge and north bridge etc. for example, be not shown in this graphic in.Wherein, this computer installation 1 for example is personal computer or server.
This basic input/output system 12 can carry out the initialization operation to this storage device 11 when start, also promptly this storage device 11 is carried out function and parameter testing, particularly, the selftest (POST) of starting shooting exactly work, 11 storage volumes that can provide of this storage device and affiliated type of memory thereof for example are provided, and this type of memory for example is types such as DRAM or SRAM, and after definite this storage device 11 can operate as normal, make this computer installation 1 enter into operating system 13, and with the capability notification operating system 13 of storage device 11, wherein, this storage device 11 is two-sided stitch definition memory modules (Dual In-line MemoryModule; DIMM).
Then; this operating system 13 is carried out driver 14 to order about this control output/Input Control Element; control the running of this storage device 11 or expansion board devices such as (not giving icon) at this as south bridge and north bridge chips (not giving icon) at this; for example the memory size that this storage device 11 is provided is carried out data storing work; and in the data storing process; carry out the data guard method of storage device of the present invention; with when detecting this storage device and have the storage block of damage; promptly the data that early desire stored change and are stored in available storage block, improve the use capacity and the fiduciary level that promotes data storing of this storage device thus.Wherein, this operating system 13 is Windows or Unix.
As shown in Figure 2, schematic flow sheet for first embodiment of the data guard method of storage device of the present invention, generally speaking, this computer installation 1 is started shooting and is carried out in start selftests (POST) work by basic input/output system 12, to carry out the initialization operation so that 11 storage volumes that can provide of this storage device and affiliated type of memory thereof to be provided to this storage device 11, afterwards, promptly enter operating system 13, wherein, when operating system 13 begins that this storage device 11 carried out data, enter to step S1 immediately, each bit data that 1 pair of this computer installation desires to be stored in this storage device 11 detects processing, also be, storage unit with one (bit) detects stored bit data, the following mode that comprises is handled in the detection of present embodiment: the one digit number desiring to deposit in according to after being stored in this storage device 11, being read this again and is stored in bit data in this storage device 11, and then whether the bit data that read of contrast is consistent with the bit data of desiring to deposit in; Or, carry out that odd-parity detects or even parity detects to the stored bit data of this storage device 11, and whether wrong to judge the bit data in the block, then proceed to step S2.
In this step S2, whether this computer installation 1 has wrong bit data to judge this storage device 11, if then proceed to step S3 according to the resulting result who detects after handling; Otherwise, then return this step S1.Particularly, whether judge foundation that this storage device 11 has a wrong bit data consistent as a reference with this step S1 contrast bit data that is read and the bit data of desiring to deposit in, if consistent this storage device 11 of then representing of contrast does not have wrong bit data, if inconsistent this storage device 11 of then representing of contrast has wrong bit data.
In this step S3, this computer installation 1 backups to the predetermined block in this storage device 11 with the block that this storage device 11 has the error bit data, then proceeds to step S4.
In this step S4, the quantity of the block of this computer installation 1 this wrong bit data of statistics to obtain statistical value, then proceeds to step S5.
In this step S5, this computer installation 1 relatively this statistical value whether greater than setting value, if then proceed to step S6; Otherwise, then return this step S1.In this step S6, the quantity of the block of this computer installation 1 through relatively learning these storage device 11 wrong bit data greater than the setting value that sets (also is, critical value for the damage number of blocks that can accept this storage device), therefore, must export alarm signal and change this storage device 11, then return this step S1 to notify the user.Particularly, this setting value can be pre-stored in the driver 14 in this computer installation 1, after entering operating system 13 and to carry out driver 14 at this computer installation 1, this driver 14 is carrying out in the process of data storing this storage device 11, except that the detection of the bit data of carrying out aforementioned this step S2 is handled, also can carry out whether abovementioned steps S5 surpasses safety value about the number of blocks of the bit data that makes a mistake comparison.
Among first embodiment of the data guard method of storage device of the present invention; the capacity of this storage device 11 is made up of by a plurality of blocks of 1k position (bits) amount of capacity; yet; backup to predetermined block in this storage device 11 as for the stored data of the block that will have the error bit data and refer to the data that detect at least one position (1bit) in the block of desiring to deposit in the bit data material wrongly and carry out this back-up processing, then be identified as with this block and damage with error bit data.So by the bad block of this storage device of detection, and can remove the backup block that keeps this storage device from, improve the use capacity of storage device thus.
Moreover, this setting value is the critical value of storage device 11 damages, in other words, be storage device 11 acceptable safety values, just set according to this computer installation 1 required data storing fiduciary level, the high more then data storing of this setting value fiduciary level is low more, otherwise the low more then fiduciary level of this setting value is high more.
Moreover, among second embodiment of the data guard method of storage device of the present invention, carry out and also comprise behind this step S3 the block with error bit data is denoted as the block of having damaged, so that the user discerns the available block and the damage block of this storage device.
In sum; the data guard method of storage device of the present invention; can effectively solve prior art and need to keep in advance the backup block because of storage device; so that the memory size of reducing storage device; therefore; data guard method by storage device of the present invention; by whether data storing is damaged to detect the storage block that storage device was provided in the bit data of this storage device; to guarantee that the bit data in this storage device can be stored in the block that can be read; and but the real-time informing user changes the storage device that is about to damage; improve the use capacity of storage device thus, and promote the fiduciary level of computer installation.
The foregoing description is illustrative principle of the present invention and effect thereof only, but not is used to limit the present invention.Any those skilled in the art all can be under spirit of the present invention and category, and the foregoing description is modified and changed.Therefore, the scope of the present invention, the claim scope is listed as described later.