CN102956270A - Mobile storage equipment detecting method and device - Google Patents

Mobile storage equipment detecting method and device Download PDF

Info

Publication number
CN102956270A
CN102956270A CN2012104133696A CN201210413369A CN102956270A CN 102956270 A CN102956270 A CN 102956270A CN 2012104133696 A CN2012104133696 A CN 2012104133696A CN 201210413369 A CN201210413369 A CN 201210413369A CN 102956270 A CN102956270 A CN 102956270A
Authority
CN
China
Prior art keywords
sectors
sets
storage device
movable storage
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012104133696A
Other languages
Chinese (zh)
Other versions
CN102956270B (en
Inventor
施生移
宁敢
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201210413369.6A priority Critical patent/CN102956270B/en
Publication of CN102956270A publication Critical patent/CN102956270A/en
Application granted granted Critical
Publication of CN102956270B publication Critical patent/CN102956270B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a mobile storage equipment detecting method and device. The device comprises a right control sub module, a judgment sub module, an initialization sub module, a normal sector set judging module, a ratio calculation module and a normal mobile storage equipment judging module. On the basis of ensuring that user data is safe, the detecting efficiency of mobile storage equipment can be improved; the service life of the mobile storage equipment can be prolonged; and the user experience can be improved.

Description

Movable storage device detection method and device
Technical field
The present invention relates to the Technology On Data Encryption field, be specifically related to a kind of movable storage device detection method, and, a kind of movable storage device pick-up unit.
Background technology
The development of information age impels people increasing to the demand of electronic information, in daily study and work life, can relate to unavoidably moving and carrying of electronic information, and therefore the effect of movable storage device has obtained appreciation.But, some illegal manufacturer is in order to reap staggering profits now, use a kind of software of volume production instrument, change the master information on the movable storage device, the movable storage device capacity is marked much larger than its actual capacity, when the actual capacity of movable storage device be less than or equal to its nominal 90% the time, namely be identified as the shrink dish that has quality problems.
At present, identify a movable storage device whether a method of shrink dish be, deposit the content of mark amount of capacity in to this movable storage device, for example the mark capacity of movable storage device is the content that 2G just writes 2G, again the content of this 2G is read out, check then whether the data that write and read change, particularly, method step process flow diagram with reference to tradition shrink dish shown in Figure 1 is identified comprises the steps:
Step 1: file A is written on the movable storage device of 2G;
Step 2: with file A RNTO file B on the movable storage device of 2G;
Step 3: file B is read on the hard disk from the movable storage device of 2G;
Step 4: whether comparison document A equate with file B, if then movable storage device is normal movable storage device, if not, then movable storage device is the shrink dish.
Yet, the method that above-mentioned shrink dish is identified is because needing the user to carry out the read-write of Large Volume Data at movable storage device, expended a large amount of time of user, and, often for a long time movable storage device is carried out the serviceable life that reading and writing data is easy to reduce movable storage device.
Therefore, need at present the urgent technical matters that solves of those skilled in the art to be: to propose a kind of movable storage device testing mechanism, improve the efficient that movable storage device detects, the capacity that guarantees the memory device that the user uses can not exist and actual inconsistent situation, ensure secure user data, prolong the life-span of movable storage device.
Summary of the invention
In view of the above problems, the present invention has been proposed in order to a kind of a kind of movable storage device detection method that overcomes the problems referred to above or address the above problem at least in part, corresponding a kind of movable storage device pick-up unit are provided.
According to one aspect of the present invention, provide a kind of movable storage device detection method to comprise:
Set the control authority of movable storage device;
Judge whether described movable storage device is read-write;
If obtain each sets of sectors in the movable storage device, and be each sets of sectors memory allocated space in the described movable storage device;
Whether each sets of sectors of judging the storage space of described movable storage device is normal sets of sectors;
Calculate the ratio of normal sets of sectors in the storage space of described movable storage device;
If the ratio of described normal sets of sectors in the storage space of movable storage device surpasses preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is unusual movable storage device.
Alternatively, described method also comprises:
Show described testing result to movable storage device.
Alternatively, whether the sets of sectors in the described storage space of judging each movable storage device is that the step of normal sets of sectors comprises:
Read the first data in the sets of sectors;
Write test data in described sets of sectors, described test data covers described the first data;
In other sectors beyond the described sets of sectors, write random data;
Judge whether described random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is normal sets of sectors.
Alternatively, describedly judge whether random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is that the step of normal sets of sectors comprises:
Read the second data in the described sets of sectors;
Described the second data and described test data are compared, if described the second data are consistent with described test data, then described random data does not cause interference to described test data, and described sets of sectors is normal sets of sectors; If described the second data and described test data are inconsistent, then described random data causes interference to described test data, and described sets of sectors is unusual sets of sectors.
Alternatively, the step of the ratio in the storage space of the normal sets of sectors of described calculating in movable storage device comprises:
Obtain the quantity of all sets of sectors in the storage space of movable storage device;
Add up the quantity of normal sets of sectors;
Calculate the ratio of the quantity of all sets of sectors in the quantity of described normal sets of sectors and the described movable storage device.
Alternatively, described method also comprises:
Described testing result is synchronized in other the data handling system in the network.
Alternatively, described method also comprises:
Recover the primary data of movable storage device.
According to another aspect of the present invention, a kind of movable storage device pick-up unit of based on data disposal system is provided, comprising:
The control of authority module is suitable for setting the control authority of movable storage device;
Judge module is suitable for judging whether described movable storage device is read-write, if then call the initialization submodule;
Initialization module is suitable for obtaining each sets of sectors in the movable storage device, and is each sets of sectors memory allocated space in the described movable storage device;
Normal sets of sectors judge module is suitable for judging whether the sets of sectors of the storage space of described each movable storage device is normal sets of sectors;
The ratio computing module is suitable for calculating the ratio of normal sets of sectors in the storage space of described movable storage device;
Normal movable storage device judge module, be suitable for when the ratio in the storage space of described normal sets of sectors at movable storage device surpasses preset ratio, judge that described movable storage device is normal movable storage device, otherwise, judge that described movable storage device is unusual movable storage device.
Alternatively, described device also comprises:
Display module is suitable for showing described testing result to movable storage device.
Alternatively, described normal sets of sectors judge module comprises:
The first data reading submodule is suitable for reading the first data in the sets of sectors;
Test data writes submodule, is suitable for writing test data in described sets of sectors, and described test data covers described the first data;
Random data writes submodule, is suitable for writing random data in other sectors beyond the described sets of sectors;
Disturb and judge submodule, be suitable for judging whether described random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is normal sets of sectors.
Alternatively, described interference judges that submodule comprises:
The second data-reading unit is suitable for reading the second data in the described sets of sectors;
Disturb judging unit, be suitable for described the second data and described test data are compared, if described the second data are consistent with described test data, then described random data does not cause interference to described test data, and described sets of sectors is normal sets of sectors; If described the second data and described test data are inconsistent, then described random data causes interference to described test data, and described sets of sectors is unusual sets of sectors.
Alternatively, described ratio computing module comprises:
Sets of sectors is obtained submodule, is suitable for obtaining the quantity of all sets of sectors in the storage space of movable storage device;
Normal sets of sectors is added up submodule, is suitable for adding up the quantity of normal sets of sectors;
The ratio calculating sub module is suitable for calculating the ratio of the quantity of all sets of sectors in the storage space of the quantity of described normal sets of sectors and described movable storage device.
Alternatively, described device also comprises:
Synchronization module is suitable for described testing result is synchronized in other the data handling system in the network.
Alternatively, described device also comprises:
Recover module, be suitable for recovering the primary data of movable storage device.
User's log into thr computer, after detecting movable storage device insertion computing machine, then can start the automatic detecting machine system of this programme, the present invention is by randomly drawing several movable storage device sectors as the sets of sectors of movable storage device, by the read-write operation to several sets of sectors in the movable storage device, rather than the read-write operation of all sectors of movable storage device is detected a movable storage device is normal movable storage device or unusual movable storage device, solved thus the user and identified that the problem whether movable storage device expends all sector datas in the plenty of time read-write movable storage device in the normal process has obtained on the basis that is ensureing secure user data, improve the efficient that movable storage device is identified, prolong the life-span of movable storage device, improve the effect that the user experiences.
Above-mentioned explanation only is the general introduction of technical solution of the present invention, for can clearer understanding technological means of the present invention, and can be implemented according to the content of instructions, and for above and other objects of the present invention, feature and advantage can be become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of drawings
By reading hereinafter detailed description of the preferred embodiment, various other advantage and benefits will become cheer and bright for those of ordinary skills.Accompanying drawing only is used for the purpose of preferred implementation is shown, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts with identical reference symbol.In the accompanying drawings:
Fig. 1 shows the method step process flow diagram that traditional according to an embodiment of the invention shrink dish is identified;
Fig. 2 shows the flow chart of steps of a kind of according to an embodiment of the invention movable storage device detection method embodiment 1;
Fig. 3 shows the flow chart of steps of a kind of according to an embodiment of the invention movable storage device detection method embodiment 2;
Fig. 4 shows and fails according to an embodiment of the invention to detect the user interface that USB flash disk is connected to application program operation on the computing machine;
Fig. 5 shows can detect the user interface that USB flash disk is connected to application program operation on the computing machine according to an embodiment of the invention;
Fig. 6 shows according to an embodiment of the invention application program run user interface;
Fig. 7 shows the user interface that according to an embodiment of the invention detection progress shows;
Fig. 8 shows the according to an embodiment of the invention user interface of testing result demonstration;
Fig. 9 shows the flow chart of steps of a kind of according to an embodiment of the invention movable storage device pick-up unit embodiment.
Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in the accompanying drawing, yet should be appreciated that and to realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order to understand the disclosure more thoroughly that these embodiment are provided, and can with the scope of the present disclosure complete convey to those skilled in the art.
One of core idea of the embodiment of the invention, by randomly drawing several sectors of movable storage device as the movable storage device sets of sectors, whether several movable storage device sets of sectors to detect each movable storage device sets of sectors be normal movable storage device sets of sectors if being carried out read-write operation, and then by judging that the ratio of normal movable storage device sets of sectors in all sets of sectors judge whether a movable storage device is normal movable storage device or shrink dish.
With reference to Fig. 2, the flow chart of steps that it shows a kind of movable storage device detection method embodiment 1 of the present invention specifically can comprise the steps:
Step 201: set the control authority of movable storage device, and obtain each sets of sectors of the storage space of movable storage device;
Particularly, movable storage device can comprise the computing machine External memory equipment of arbitrary medium, such as the wireless Internet card of mobile phone, extra storage function, USB flash disk etc.
The sector is the physical memory cell of disk minimum, and the size of a general sector is 512 bytes.For example, the movable storage device of a 2G, refer to that the storage space that all sectors in the movable storage device form has 2G, in fact, file is stored on the USB flash disk, is actually file allocation is stored to the storage space that comprises a plurality of sectors, such as, the film of a 300MB is placed on the USB flash disk, and in fact being has a lot of sectors being responsible for the storage data.
For the movable storage device of a nG, can use following equation expression, wherein n is positive number:
The size of each sector of number * of sector=nG=n*1024*1024*1024 byte
Therefore, check whether shrink dish of a movable storage device, the most essential principle, confirm exactly sector number in the described movable storage device equation above whether satisfying, the in fact shrink of shrink dish, disappearance be the number of sector, for a shrink dish, illustrate that the number of sectors in its physical memory space is inadequate, even for example be known as the capacity of movable storage device 2G is arranged, but the capacity of the data of its actual storage is certainly less than 2G.
In a preferred embodiment of the present invention, described step 201 can comprise following substep:
Substep S11: the control authority of setting movable storage device;
A kind of preferred exemplary as the present embodiment, for example can use the API(of operating system standard, call the DeviceIoControl function) set the control authority of movable storage device, described control authority to mobile movable storage device is exclusive control authority, described control authority can comprise movable storage device is locked, the access limit of control movable storage device, namely only allow default specific program that it is read and write after the movable storage device locking, other programs just can't be read and write movable storage device.
Substep S12: judge whether described movable storage device is read-write;
Particularly, judge movable storage device whether read-write be to judge that described movable storage device is for default specific program read-write data whether, a kind of preferred exemplary as the present embodiment, whether API that can Application standard detects in the movable storage device certain sector read-write, described standard A PI can be ReadFile function and WriteFile function, if the read-write data in described sector illustrate the read-write data of described movable storage device.
Substep S13: if obtain each sets of sectors in the movable storage device, and be each sets of sectors memory allocated space in the described movable storage device.
Particularly, a movable storage device can have a lot of sectors according to its capacity, can from the larger sector of these quantity, randomly draw several sectors and form a sets of sectors, in whole movable storage device, several sets of sectors can be arranged, the distribution on a rough average of these several sets of sectors, can cover between the sector null of whole movable storage device, but discontinuous between these sets of sectors, namely do not occur simultaneously, for example, whole movable storage device has 10000 sectors, certain sets of sectors may comprise 100 sectors, and the distribution of these 100 sectors in 10000 sectors of whole movable storage device can be respectively 1-20,1000-1040, the the 2000th to 2020, the 8000th to 8020.
In specific implementation, for the process in each sets of sectors memory allocated space in the movable storage device is the process of initialization movable storage device, can comprise the select target sector, give the target sector memory allocated space of selecting, form the process of sets of sectors.
Step 202: whether each sets of sectors of judging the storage space of described movable storage device is normal sets of sectors;
Wherein, for several sets of sectors of the storage space of movable storage device, judge whether each sets of sectors is normal sets of sectors.
In a preferred embodiment of the present invention, described step 202 can comprise following substep:
Substep S21: read the first data in the sets of sectors;
Substep S22: write test data in described sets of sectors, described test data covers described the first data;
In specific implementation, described test data can be random code, the first data in the set of the test data that writes meeting coverage sector.
Substep S23: in other sectors beyond the described sets of sectors, write random data;
In specific implementation, random data can be random code, and do not occur simultaneously in other sectors beyond the described sets of sectors and the position of the sector in the described sets of sectors, and other sectors beyond the described sets of sectors are several sectors of randomly drawing.
Substep S24: judge whether described random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is normal sets of sectors.
In a preferred embodiment of the present invention, described substep S24 can comprise following substep:
Substep S241: read the second data in the described sets of sectors;
Substep S242: described the second data and described test data are compared, if described the second data are consistent with described test data, then described random data does not cause interference to described test data, and described sets of sectors is normal sets of sectors; If described the second data and described test data are inconsistent, then described random data causes interference to described test data, and described sets of sectors is unusual sets of sectors.
Particularly, because the position that writes other sectors and the sector in the described sets of sectors beyond the sets of sectors of random data is common factor not, therefore in normal situation, the random data that writes and test data are not occured simultaneously, but, in the situation that movable storage device is the shrink dish, the capacity of the random data that writes is greater than the capacity of the sector that is used for the storage random data, therefore random data will take the position of other sectors, for example take the position of described sets of sectors, random data will the partial coverage test data like this, cause interference to test data, cause the second data and the test data that read inconsistent, also therefore proved that described sets of sectors is unusual sets of sectors.
Step 203: calculate the ratio of normal sets of sectors in the storage space of described movable storage device;
In a preferred embodiment of the present invention, described step 203 can comprise following substep:
Substep S31: the quantity of obtaining all sets of sectors in the storage space of movable storage device;
Substep S32: the quantity of adding up normal sets of sectors;
Substep S33: the ratio of calculating the quantity of all sets of sectors in the storage space of the quantity of described normal sets of sectors and described movable storage device.
Step 204: if the ratio of described normal sets of sectors in the storage space of movable storage device surpasses preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is unusual movable storage device.
For example: preset ratio is 90%, when the ratio of normal sets of sectors in all sets of sectors is 50%, show if the amount of capacity that marks on the movable storage device is 4G, in fact the amount of capacity of movable storage device is 2G, less than default 3.6G, can illustrate that namely described movable storage device is unusual movable storage device, i.e. the shrink dish.
The shrink dish also claims " dilatation dish ", " upgrading dish ", refer to that illegal manufacturer uses a kind of software of volume production instrument, the movable storage device capacity is marked much larger than its actual capacity, means with the swindle consumer are reaped staggering profits, when the actual capacity of movable storage device be less than or equal to its nominal 90% the time, namely be identified as the shrink dish that has quality problems.
Shrink dish actual capacity is much smaller than the mark capacity, in use, shrink coils that not only read or write speed is super slow, and insufficient memory can appear very soon, in addition, be written to the file in the shrink dish, surpass the part of actual capacity, can't normally be read and be used, can be brought the troubles such as a series of obliterated datas, work delay to the user like this.So a kind of good movable storage device detection method is most important for the user.
In specific implementation, owing to judging that movable storage device is to need to write and reading out data in normal movable storage device or the process of shrink dish, therefore before execution in step 201, can capsule information be backed up first reminding user.(after namely beginning execution in step 201) after the detection that begins to carry out movable storage device, the progress that can use method reminding user movable storage devices such as detecting progress bar to detect, and reminding user avoids extracting movable storage device, prevents losing of data.
With reference to Fig. 3, the flow chart of steps that it shows a kind of movable storage device detection method embodiment 2 of the present invention specifically can comprise the steps:
Step 301: set the control authority of movable storage device, and obtain each sets of sectors of the storage space of movable storage device;
In a preferred embodiment of the present invention, described step 301 can comprise following substep:
Substep S41: the control authority of setting movable storage device;
Substep S42: judge whether described movable storage device is read-write;
Substep S43: if obtain each sets of sectors in the movable storage device, and be each sets of sectors memory allocated space in the described movable storage device.
Particularly, a movable storage device can have a lot of sectors according to its capacity, can from the larger sector of these quantity, randomly draw several sectors and form a sets of sectors, in whole movable storage device, several sets of sectors can be arranged, the distribution on a rough average of these several sets of sectors, can cover between the sector null of whole movable storage device, but discontinuous between these sets of sectors, namely do not occur simultaneously, for example, whole movable storage device has 10000 sectors, certain sets of sectors may comprise 100 sectors, and the distribution of these 100 sectors in 10000 sectors of whole movable storage device can be respectively 1-20,1000-1040, the the 2000th to 2020, the 8000th to 8020.
Step 302: judge whether each sets of sectors in the storage space of described movable storage device is normal sets of sectors;
Wherein, for several sets of sectors in the storage space of movable storage device, judge whether each sets of sectors is normal sets of sectors.
In a preferred embodiment of the present invention, described step 302 can comprise following substep:
Substep S51: read the first data in the sets of sectors;
Substep S52: write test data in described sets of sectors, described test data covers described the first data;
In specific implementation, described test data can be random code, the first data in the set of the test data that writes meeting coverage sector.
Substep S53: in other sectors beyond the described sets of sectors, write random data;
In specific implementation, random data can be random code, and do not occur simultaneously in other sectors beyond the described sets of sectors and the position of the sector in the described sets of sectors, and other sectors beyond the described sets of sectors are several sectors of randomly drawing.
Substep S54: judge whether described random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is normal sets of sectors.
In a preferred embodiment of the present invention, described substep S54 can comprise following substep:
Substep S541: read the second data in the described sets of sectors;
Substep S542: described the second data and described test data are compared, if described the second data are consistent with described test data, then described random data does not cause interference to described test data, and described sets of sectors is normal sets of sectors; If described the second data and described test data are inconsistent, then described random data causes interference to described test data, and described sets of sectors is unusual sets of sectors.
Step 303: calculate the ratio of normal sets of sectors in the storage space of described movable storage device;
In a preferred embodiment of the present invention, described step 303 can comprise following substep:
Substep S61: the quantity of obtaining all sets of sectors in the storage space of movable storage device;
Substep S62: the quantity of adding up normal sets of sectors;
Substep S63: the ratio of calculating the quantity of all sets of sectors in the storage space of the quantity of described normal sets of sectors and described movable storage device.
Step 304: if the ratio of described normal sets of sectors in the storage space of movable storage device surpasses preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is unusual movable storage device.
For example: preset ratio is 90%, when the ratio of normal sets of sectors in all sets of sectors is 50%, show if the amount of capacity that marks on the movable storage device is 4G, in fact the amount of capacity of movable storage device is 2G, less than default 3.6G, can illustrate that namely described movable storage device is unusual movable storage device, i.e. the shrink dish.
The shrink dish also claims " dilatation dish ", " upgrading dish ", refer to that illegal manufacturer uses a kind of software of volume production instrument, the movable storage device capacity is marked much larger than its actual capacity, means with the swindle consumer are reaped staggering profits, when the actual capacity of movable storage device be less than or equal to its nominal 90% the time, namely be identified as the shrink dish that has quality problems.
Shrink dish actual capacity is much smaller than the mark capacity, in use, shrink coils that not only read or write speed is super slow, and insufficient memory can appear very soon, in addition, be written to the file in the shrink dish, surpass the part of actual capacity, can't normally be read and be used, can be brought the troubles such as a series of obliterated datas, work delay to the user like this.
Step 305: show described testing result to movable storage device.
A kind of preferred exemplary as the present embodiment, described testing result can comprise that actual capacity, the mark capacity of movable storage device, the system banner capacity of movable storage device, the movable storage device of described movable storage device are normal movable storage device or the testing result of unusual movable storage device (shrink dish) etc., wherein, the system banner capacity of described movable storage device is that system is according to the ratio of described normal sets of sectors in the storage space of movable storage device and the product gained of movable storage device mark capacity.
Step 306: described testing result is synchronized in other the data handling system in the network.
Such as: described testing result can be synchronized in other data handling systems in the network by sharing the modes such as blog, microblogging.
Step 307: the primary data of recovering movable storage device.
Particularly, because in the testing process of movable storage device, can carry out reading and writing data, the data that write or read can cause the test data and the primary data that write in the storage space of described movable storage device different, therefore the user test data should be reverted to the primary data of movable storage device, so that can normally use movable storage device.
For making those skilled in the art understand better the present invention, below by a concrete example of using the testing process of movable storage device of the present invention is described, below be the qualification process for USB flash disk:
(1) starts computing machine, USB flash disk is connected on the computing machine;
(2) determine that USB flash disk is connected on the computing machine, also be not connected on the computing machine if detect USB flash disk, eject as shown in Figure 4 fail detect USB flash disk and be connected to user interface on the computing machine, reminding user inserts USB flash disk; If detecting USB flash disk has been connected on the computing machine, the USB flash disk that can detect that ejects as shown in Figure 5 is connected to user interface on the computing machine, the information of showing USB flash disk, and reminding user begins to detect, and ejection backup reminding user interface as shown in Figure 6, reminding user backup capsule information;
(3) detect beginning after, eject detection progress reminding user interface as shown in Figure 7, show the progress that detects, and reminding user is not extracted USB flash disk or is shut down computer; Wherein, the progress of described detection is embodied in system bottom and is:
A. lock USB flash disk, and obtain each sets of sectors of the storage space of USB flash disk;
Whether each sets of sectors of b. judging the storage space of described USB flash disk is normal sets of sectors;
C. calculate the ratio of normal sets of sectors in the storage space of described USB flash disk;
If d. the ratio of described normal sets of sectors in the storage space of movable storage device surpasses preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is the shrink dish.
(4) after detection finishes, show testing result, testing result is as shown in Figure 8 showed user interface, described testing result comprises that actual capacity, the mark capacity of USB flash disk, the system banner capacity of USB flash disk, the USB flash disk of USB flash disk are normal USB flash disk or the testing result of shrink dish etc., and reminding user can be shared (synchronously) in other data handling systems with testing result.
For the embodiment of the method for Fig. 3 because itself and Fig. 2 embodiment of the method basic simlarity, so describe fairly simple, relevant part gets final product referring to the part explanation of embodiment of the method
Need to prove, for embodiment of the method, for simple description, therefore it all is expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not subjected to the restriction of described sequence of movement, because according to the present invention, some step can adopt other orders or carry out simultaneously.Secondly, those skilled in the art also should know, the embodiment described in the instructions all belongs to preferred embodiment, and related action and module might not be that the present invention is necessary.
With reference to Fig. 9, show the structured flowchart of a kind of according to an embodiment of the invention movable storage device pick-up unit embodiment, specifically can comprise with lower module:
Sets of sectors acquisition module 901 is suitable for setting the control authority of movable storage device, and obtains each sets of sectors of the storage space of movable storage device;
In a preferred embodiment of the present invention, described sets of sectors acquisition module 901 can comprise following submodule:
The control of authority submodule is suitable for setting the control authority of movable storage device;
Judge submodule, be suitable for judging whether described movable storage device is read-write, if then call the initialization submodule;
The initialization submodule is suitable for obtaining each sets of sectors in the movable storage device, and is each sets of sectors memory allocated space in the described movable storage device.
Normal sets of sectors judge module 902 is suitable for judging whether each sets of sectors in the storage space of described movable storage device is normal sets of sectors;
In a preferred embodiment of the present invention, described normal sets of sectors judge module 902 can comprise following submodule:
The first data reading submodule is suitable for reading the first data in the sets of sectors;
Test data writes submodule, is suitable for writing test data in described sets of sectors, and described test data covers described the first data;
Random data writes submodule, is suitable for writing random data in other sectors beyond the described sets of sectors;
Disturb and judge submodule, be suitable for judging whether described random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is normal sets of sectors.
In a preferred embodiment of the present invention, described interference judges that submodule further can comprise such as lower unit:
The second data-reading unit is suitable for reading the second data in the described sets of sectors;
Disturb judging unit, be suitable for described the second data and described test data are compared, if described the second data are consistent with described test data, then described random data does not cause interference to described test data, and described sets of sectors is normal sets of sectors; If described the second data and described test data are inconsistent, then described random data causes interference to described test data, and described sets of sectors is unusual sets of sectors.
Ratio computing module 903 is suitable for calculating the ratio of normal sets of sectors in the storage space of described movable storage device;
In a preferred embodiment of the present invention, described ratio computing module 903 can comprise following submodule:
Sets of sectors is obtained submodule, is suitable for obtaining the quantity of all sets of sectors in the storage space of movable storage device;
Normal sets of sectors is added up submodule, is suitable for adding up the quantity of normal sets of sectors;
The ratio calculating sub module is suitable for calculating the ratio of the quantity of all sets of sectors in the storage space of the quantity of described normal sets of sectors and described movable storage device.
Normal movable storage device judge module 904, be suitable for when the ratio in the storage space of described normal sets of sectors at movable storage device surpasses preset ratio, judge that described movable storage device is normal movable storage device, otherwise, judge that described movable storage device is unusual movable storage device.
For example: preset ratio is 90%, when the ratio of normal sets of sectors in all sets of sectors is 50%, can illustrate that namely described movable storage device is unusual movable storage device, i.e. the shrink dish.
The shrink dish also claims " dilatation dish ", " upgrading dish ", refer to that illegal manufacturer uses a kind of software of volume production instrument, the movable storage device capacity is marked much larger than its actual capacity, means with the swindle consumer are reaped staggering profits, when the actual capacity of movable storage device be less than or equal to its nominal 90% the time, namely be identified as the shrink dish that has quality problems.
Shrink dish actual capacity is much smaller than the mark capacity, in use, shrink coils that not only read or write speed is super slow, and insufficient memory can appear very soon, in addition, be written to the file in the shrink dish, surpass the part of actual capacity, can't normally be read and be used, can be brought the troubles such as a series of obliterated datas, work delay to the user like this.
Display module 905: be suitable for showing described testing result to movable storage device.
Synchronization module 906 is suitable for described testing result is synchronized in other the data handling system in the network.
Recover module 907, be suitable for recovering the primary data of movable storage device.
For the device embodiment of Fig. 9 because itself and embodiment of the method basic simlarity, so describe fairly simple, relevant part gets final product referring to the part explanation of embodiment of the method.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and what each embodiment stressed is and the difference of other embodiment that identical similar part is mutually referring to getting final product between each embodiment.
Intrinsic not relevant with any certain computer, virtual system or miscellaneous equipment with demonstration at this algorithm that provides.Various general-purpose systems also can be with using based on the teaching at this.According to top description, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.Should be understood that and to utilize various programming languages to realize content of the present invention described here, and the top description that language-specific is done is in order to disclose preferred forms of the present invention.
In the instructions that provides herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can be in the situation that there be these details to put into practice.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the description to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes in the above.Yet the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires the more feature of feature clearly put down in writing than institute in each claim.Or rather, as following claims reflected, inventive aspect was to be less than all features of the disclosed single embodiment in front.Therefore, follow claims of embodiment and incorporate clearly thus this embodiment into, wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can adaptively change and they are arranged in one or more equipment different from this embodiment the module in the equipment among the embodiment.Can be combined into a module or unit or assembly to the module among the embodiment or unit or assembly, and can be divided into a plurality of submodules or subelement or sub-component to them in addition.In such feature and/or process or unit at least some are mutually repelling, and can adopt any combination to disclosed all features in this instructions (comprising claim, summary and the accompanying drawing followed) and so all processes or the unit of disclosed any method or equipment make up.Unless in addition clearly statement, disclosed each feature can be by providing identical, being equal to or the alternative features of similar purpose replaces in this instructions (comprising claim, summary and the accompanying drawing followed).
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included among other embodiment, the combination of the feature of different embodiment means and is within the scope of the present invention and forms different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with array mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, perhaps realizes with the software module of moving at one or more processor, and perhaps the combination with them realizes.It will be understood by those of skill in the art that and to use in practice microprocessor or digital signal processor (DSP) to realize according to some or all some or repertoire of parts in the movable storage device checkout equipment of the based on data disposal system of the embodiment of the invention.The present invention can also be embodied as be used to part or all equipment or the device program (for example, computer program and computer program) of carrying out method as described herein.Such realization program of the present invention can be stored on the computer-readable medium, perhaps can have the form of one or more signal.Such signal can be downloaded from internet website and obtain, and perhaps provides at carrier signal, perhaps provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation of the scope that does not break away from claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed in element or step in the claim.Being positioned at word " " before the element or " one " does not get rid of and has a plurality of such elements.The present invention can realize by means of the hardware that includes some different elements and by means of the computing machine of suitably programming.In having enumerated the unit claim of some devices, several in these devices can be to come imbody by same hardware branch.The use of word first, second and C grade does not represent any order.Can be title with these word explanations.

Claims (14)

1. movable storage device detection method comprises:
Set the control authority of movable storage device;
Judge whether described movable storage device is read-write;
If obtain each sets of sectors in the movable storage device, and be each sets of sectors memory allocated space in the described movable storage device;
Whether each sets of sectors of judging the storage space of described movable storage device is normal sets of sectors;
Calculate the ratio of normal sets of sectors in the storage space of described movable storage device;
If the ratio of described normal sets of sectors in the storage space of movable storage device surpasses preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is unusual movable storage device.
2. the method for claim 1 also comprises:
Show described testing result to movable storage device.
3. whether the method for claim 1, the sets of sectors in the described storage space of judging each movable storage device are that the step of normal sets of sectors comprises:
Read the first data in the sets of sectors;
Write test data in described sets of sectors, described test data covers described the first data;
In other sectors beyond the described sets of sectors, write random data;
Judge whether described random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is normal sets of sectors.
4. method as claimed in claim 3 describedly judges whether random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is that the step of normal sets of sectors comprises:
Read the second data in the described sets of sectors;
Described the second data and described test data are compared, if described the second data are consistent with described test data, then described random data does not cause interference to described test data, and described sets of sectors is normal sets of sectors; If described the second data and described test data are inconsistent, then described random data causes interference to described test data, and described sets of sectors is unusual sets of sectors.
5. the method for claim 1, the step of the ratio in the storage space of the normal sets of sectors of described calculating in movable storage device comprises:
Obtain the quantity of all sets of sectors in the storage space of movable storage device;
Add up the quantity of normal sets of sectors;
Calculate the ratio of the quantity of all sets of sectors in the quantity of described normal sets of sectors and the described movable storage device.
6. method as claimed in claim 2 also comprises:
Described testing result is synchronized in other the data handling system in the network.
7. such as each described method in the claim 1 to 6, also comprise:
Recover the primary data of movable storage device.
8. movable storage device pick-up unit comprises:
The control of authority module is suitable for setting the control authority of movable storage device;
Judge module is suitable for judging whether described movable storage device is read-write, if then call initialization module;
Initialization module is suitable for obtaining each sets of sectors in the movable storage device, and is each sets of sectors memory allocated space in the described movable storage device;
Normal sets of sectors judge module is suitable for judging whether the sets of sectors of the storage space of described each movable storage device is normal sets of sectors;
The ratio computing module is suitable for calculating the ratio of normal sets of sectors in the storage space of described movable storage device;
Normal movable storage device judge module, be suitable for when the ratio in the storage space of described normal sets of sectors at movable storage device surpasses preset ratio, judge that described movable storage device is normal movable storage device, otherwise, judge that described movable storage device is unusual movable storage device.
9. device as claimed in claim 8 also comprises:
Display module is suitable for showing described testing result to movable storage device.
10. device as claimed in claim 8, described normal sets of sectors judge module comprises:
The first data reading submodule is suitable for reading the first data in the sets of sectors;
Test data writes submodule, is suitable for writing test data in described sets of sectors, and described test data covers described the first data;
Random data writes submodule, is suitable for writing random data in other sectors beyond the described sets of sectors;
Disturb and judge submodule, be suitable for judging whether described random data causes interference to described test data, if then described sets of sectors is unusual sets of sectors; If not, then described sets of sectors is normal sets of sectors.
11. device as claimed in claim 10, described interference judge that submodule comprises:
The second data-reading unit is suitable for reading the second data in the described sets of sectors;
Disturb judging unit, be suitable for described the second data and described test data are compared, if described the second data are consistent with described test data, then described random data does not cause interference to described test data, and described sets of sectors is normal sets of sectors; If described the second data and described test data are inconsistent, then described random data causes interference to described test data, and described sets of sectors is unusual sets of sectors.
12. device as claimed in claim 8, described ratio computing module comprises:
Sets of sectors is obtained submodule, is suitable for obtaining the quantity of all sets of sectors in the storage space of movable storage device;
Normal sets of sectors is added up submodule, is suitable for adding up the quantity of normal sets of sectors;
The ratio calculating sub module is suitable for calculating the ratio of the quantity of all sets of sectors in the storage space of the quantity of described normal sets of sectors and described movable storage device.
13. device as claimed in claim 9 also comprises:
Synchronization module is suitable for described testing result is synchronized in other the data handling system in the network.
14. such as each described device of claim 8 to 13, also comprise:
Recover module, be suitable for recovering the primary data of movable storage device.
CN201210413369.6A 2012-10-25 2012-10-25 Movable storage device detection method and device Expired - Fee Related CN102956270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210413369.6A CN102956270B (en) 2012-10-25 2012-10-25 Movable storage device detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210413369.6A CN102956270B (en) 2012-10-25 2012-10-25 Movable storage device detection method and device

Publications (2)

Publication Number Publication Date
CN102956270A true CN102956270A (en) 2013-03-06
CN102956270B CN102956270B (en) 2015-11-25

Family

ID=47764978

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210413369.6A Expired - Fee Related CN102956270B (en) 2012-10-25 2012-10-25 Movable storage device detection method and device

Country Status (1)

Country Link
CN (1) CN102956270B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646669A (en) * 2013-11-29 2014-03-19 北京奇虎科技有限公司 Method and device for detecting reliability of removable storage device
CN103677668A (en) * 2013-11-29 2014-03-26 北京奇虎科技有限公司 Method and device for detecting mobile storage equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5640286A (en) * 1995-05-08 1997-06-17 Western Digital Corporation Disk drive with error code embedded sector identification
CN1527312A (en) * 2003-09-24 2004-09-08 威盛电子股份有限公司 CD data error diagnosing method
CN101068420A (en) * 2006-05-03 2007-11-07 Lg电子株式会社 Mobile communication terminal and method for controlling the same
CN101477837A (en) * 2009-01-21 2009-07-08 炬力集成电路设计有限公司 Detection method and apparatus for memory capacity
CN101527172A (en) * 2008-03-07 2009-09-09 佛山市顺德区顺达电脑厂有限公司 Detection system and method for dynamic random access memory capacity
CN102306503A (en) * 2010-07-30 2012-01-04 深圳市江波龙电子有限公司 Method and system for detecting false capacity memory

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5640286A (en) * 1995-05-08 1997-06-17 Western Digital Corporation Disk drive with error code embedded sector identification
CN1527312A (en) * 2003-09-24 2004-09-08 威盛电子股份有限公司 CD data error diagnosing method
CN101068420A (en) * 2006-05-03 2007-11-07 Lg电子株式会社 Mobile communication terminal and method for controlling the same
CN101527172A (en) * 2008-03-07 2009-09-09 佛山市顺德区顺达电脑厂有限公司 Detection system and method for dynamic random access memory capacity
CN101477837A (en) * 2009-01-21 2009-07-08 炬力集成电路设计有限公司 Detection method and apparatus for memory capacity
CN102306503A (en) * 2010-07-30 2012-01-04 深圳市江波龙电子有限公司 Method and system for detecting false capacity memory

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646669A (en) * 2013-11-29 2014-03-19 北京奇虎科技有限公司 Method and device for detecting reliability of removable storage device
CN103677668A (en) * 2013-11-29 2014-03-26 北京奇虎科技有限公司 Method and device for detecting mobile storage equipment
CN103646669B (en) * 2013-11-29 2016-08-24 北京奇虎科技有限公司 The reliability checking method of a kind of movable storage device and device
CN103677668B (en) * 2013-11-29 2017-04-05 北京奇虎科技有限公司 A kind of method and device of movable storage device detection

Also Published As

Publication number Publication date
CN102956270B (en) 2015-11-25

Similar Documents

Publication Publication Date Title
CN101427323B (en) System and method for reading non-volatile computer memory
CN102043686B (en) Disaster tolerance method, backup server and system of memory database
US8239329B2 (en) Data storage medium, software installation method and copyright protection module
KR101651204B1 (en) Apparatus and Method for synchronization of snapshot image
US20110119662A1 (en) Method for updating firmware of embedded system
US20090037646A1 (en) Method of using a flash memory for a circular buffer
CN103902702A (en) Data storage system and data storage method
CN103838521B (en) Data processing method and data processing device
CN101937721A (en) Method for testing memory device
CN102136296B (en) Method for identifying metadata format of NANDFlash memory chip
CN102955861A (en) Method and device for generating index files based on backup files
CN104484131A (en) Device and corresponding method for processing data of multi-disk servers
CN103646669A (en) Method and device for detecting reliability of removable storage device
US20100030992A1 (en) Initializing of a memory area
CN106155580B (en) A kind of storage method and system based on embedded multi-media card eMMC
CN100550206C (en) A kind of method and device of surveying physical parameters of flash memory
CN102969026B (en) Based on movable storage device detection method and the device of data handling system
CN102956270B (en) Movable storage device detection method and device
CN105260130B (en) A kind of reading/writing method of Seagate hard-disk system file
CN107957921B (en) Wear-balanced intelligent card power-down data protection method
CN103677668A (en) Method and device for detecting mobile storage equipment
CN103187070A (en) Audio file processing method and system based on mobile terminal
CN110045927A (en) A method of there is the EEPROM of atomic operation characteristic using flash memory simulation
CN105830067A (en) Document information processing method, apparatus, and document processing apparatus and system
CN101295312A (en) Method for presenting data by table

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20151125

CF01 Termination of patent right due to non-payment of annual fee