CN102956270B - Movable storage device detection method and device - Google Patents

Movable storage device detection method and device Download PDF

Info

Publication number
CN102956270B
CN102956270B CN201210413369.6A CN201210413369A CN102956270B CN 102956270 B CN102956270 B CN 102956270B CN 201210413369 A CN201210413369 A CN 201210413369A CN 102956270 B CN102956270 B CN 102956270B
Authority
CN
China
Prior art keywords
storage device
sectors
movable storage
sets
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.)
Expired - Fee Related
Application number
CN201210413369.6A
Other languages
Chinese (zh)
Other versions
CN102956270A (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

Abstract

The invention discloses a kind of movable storage device detection method and device, wherein said device comprises control of authority submodule; Judge submodule; Initialization submodule; Normal sector set judge module; Ratio computing module and normal movable storage device judge module.The present invention on the basis ensureing secure user data, can improve the efficiency that movable storage device detects, and extends the life-span of movable storage device, improves Consumer's Experience.

Description

Movable storage device detection method and device
Technical field
The present invention relates to technical field of data security, 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 the demand of people to electronic information increasing, and in the life of daily study and work, can relate to moving and carrying of electronic information unavoidably, therefore the effect of movable storage device obtains 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 movable storage device, movable storage device capacity is marked much larger than its actual capacity, when the actual capacity of movable storage device is less than or equal to 90% of its nominal, be namely identified as the shrink dish that there are quality problems.
At present, identify that a method of a movable storage device whether shrink dish is, to this movable storage device stored in the content marking amount of capacity, the mark capacity of such as movable storage device is the content that 2G just writes 2G, again the content of this 2G is read out, then check whether write and the data read change, specifically, with reference to the method step process flow diagram of the tradition shrink dish qualification shown in Fig. 1, comprise the steps:
Step 1: file A is written on the movable storage device of 2G;
Step 2: by file A RNTO file B on the movable storage device of 2G;
Step 3: file B is read on hard disk from the movable storage device of 2G;
Step 4: whether comparison document A is equal with file B, if so, then movable storage device is normal movable storage device, and if not, then movable storage device is shrink dish.
But, the read-write of method because needing user to carry out Large Volume Data on movable storage device of above-mentioned shrink dish qualification, consume the time that user is a large amount of, and, often for a long time carried out to movable storage device the serviceable life that reading and writing data is easy to reduce movable storage device.
Therefore, the technical matters needing those skilled in the art urgently to solve at present is: propose a kind of movable storage device testing mechanism, improve the efficiency that movable storage device detects, ensure that the capacity of the memory device that user uses can not exist the situation inconsistent with reality, ensure secure user data, extend the life-span of movable storage device.
Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of a kind of movable storage device detection method overcoming the problems referred to above or solve the problem at least in part, corresponding a kind of movable storage device pick-up unit.
According to one aspect of the present invention, provide a kind of movable storage device detection method and comprise:
The control authority of setting movable storage device;
Judge that whether described movable storage device is read-write;
If so, obtain each sets of sectors in movable storage device, and be each sets of sectors memory allocated space in described movable storage device;
Judge that whether each sets of sectors of the storage space of described movable storage device is normal sector set;
Calculating normal sector is integrated into the ratio in the storage space of described movable storage device;
If the ratio that described normal sector is integrated in the storage space of movable storage device exceedes preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is abnormal movable storage device.
Alternatively, described method also comprises:
Show the described testing result to movable storage device.
Alternatively, whether the sets of sectors in the described storage space judging each movable storage device is that the step that normal sector is gathered comprises:
Read the first data in sets of sectors;
In described sets of sectors, write test data, described test data covers described first data;
Random data is write in other sectors beyond described sets of sectors;
Judge whether described random data causes interference to described test data, if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is normal sector set.
Alternatively, describedly judge whether random data causes interference to described test data, if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is that the step that normal sector is gathered comprises:
Read the second data in described sets of sectors;
Described second data and described test data are compared, if described 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 sector set; If described second data and described test data inconsistent, then described random data causes interference to described test data, and described sets of sectors is abnormal sets of sectors.
Alternatively, the step of the ratio during described calculating normal sector is integrated in movable storage device storage space comprises:
Obtain the quantity of all sets of sectors in the storage space of movable storage device;
The quantity of statistics normal sector set;
Calculate the ratio of the quantity of all sets of sectors in the quantity and described movable storage device gathered described normal sector.
Alternatively, described method also comprises:
Described testing result is synchronized in other the data handling system in network.
Alternatively, described method also comprises:
Recover the primary data of movable storage device.
According to another aspect of the present invention, provide a kind of movable storage device pick-up unit based on data handling system, comprising:
Control of authority module, is suitable for the control authority setting movable storage device;
Judge module, is suitable for judging that whether described movable storage device is read-write, if so, then calls initialization submodule;
Initialization module, is suitable for obtaining each sets of sectors in movable storage device, and is each sets of sectors memory allocated space in described movable storage device;
Normal sector set judge module, whether the sets of sectors being suitable for the storage space judging each movable storage device described is normal sector set;
Ratio computing module, is suitable for calculating normal sector and is integrated into ratio in the storage space of described movable storage device;
Normal movable storage device judge module, when the ratio being suitable for being integrated in the storage space of movable storage device in described normal sector exceedes preset ratio, judge that described movable storage device is normal movable storage device, otherwise, judge that described movable storage device is abnormal movable storage device.
Alternatively, described device also comprises:
Display module, is suitable for showing the described testing result to movable storage device.
Alternatively, described normal sector set judge module comprises:
First digital independent submodule, is suitable for reading the first data in sets of sectors;
Test data write submodule, be suitable for writing test data in described sets of sectors, described test data covers described first data;
Random data write submodule, is suitable for writing random data in other sectors beyond described sets of sectors;
Interference judges submodule, and be suitable for judging whether described random data causes interference to described test data, if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is normal sector set.
Alternatively, described interference judges that submodule comprises:
Second data-reading unit, is suitable for the second data read in described sets of sectors;
Interference judging unit, be suitable for described second data and described test data to compare, if described 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 sector set; If described second data and described test data inconsistent, then described random data causes interference to described test data, and described sets of sectors is abnormal sets of sectors.
Alternatively, described ratio computing module comprises:
Sets of sectors obtains submodule, is suitable for the quantity of all sets of sectors in the storage space of acquisition movable storage device;
Normal sector set statistics submodule, is suitable for the quantity of adding up normal sector set;
Ratio calculating sub module, is suitable for the ratio of the quantity calculating all sets of sectors in the quantity of described normal sector set and the storage space of described movable storage device.
Alternatively, described device also comprises:
Synchronization module, is suitable for described testing result being synchronized in other the data handling system in network.
Alternatively, described device also comprises:
Recover module, be suitable for the primary data recovering movable storage device.
User's log into thr computer, after detecting that movable storage device inserts computing machine, then can start the automatic detecting machine system of this programme, the present invention is by randomly drawing the sets of sectors of several movable storage device sectors as movable storage device, by the read-write operation to several sets of sectors in movable storage device, instead of to detect a movable storage device to the read-write operation of all sectors of movable storage device be normal movable storage device or abnormal movable storage device, solve user thus and identifying that the problem of all sector datas at substantial time read-write movable storage device in the whether normal process of movable storage device achieves on the basis ensureing secure user data, improve the efficiency of movable storage device qualification, extend the life-span of movable storage device, improve the effect of Consumer's Experience.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows the method step process flow diagram of traditional according to an embodiment of the invention shrink dish qualification;
Fig. 2 shows a kind of according to an embodiment of the invention flow chart of steps of movable storage device detection method embodiment 1;
Fig. 3 shows a kind of according to an embodiment of the invention flow chart of steps of movable storage device detection method embodiment 2;
Fig. 4 shows and fails according to an embodiment of the invention to detect that USB flash disk is connected to the user interface that on computing machine, application program is run;
Fig. 5 shows and can detect that USB flash disk is connected to the user interface that on computing machine, application program is run according to an embodiment of the invention;
Fig. 6 shows application program run user interface according to an embodiment of the invention;
Fig. 7 shows the user interface detecting progress display according to an embodiment of the invention;
Fig. 8 shows the user interface of testing result display according to an embodiment of the invention;
Fig. 9 shows a kind of according to an embodiment of the invention flow chart of steps of movable storage device pick-up unit embodiment.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
One of core idea of the embodiment of the present invention, by randomly drawing several sectors of movable storage device as movable storage device sets of sectors, whether carrying out read-write operation to several movable storage device sets of sectors, to detect each movable storage device sets of sectors be normal movable storage device sets of sectors, and then by judging that the ratio of normal movable storage device sets of sectors in all sets of sectors judges whether a movable storage device is normal movable storage device or shrink dish.
With reference to Fig. 2, it illustrates the flow chart of steps of a kind of movable storage device detection method embodiment 1 of the present invention, specifically can comprise the steps:
Step 201: the control authority of setting movable storage device, and obtain each sets of sectors of the storage space of movable storage device;
Specifically, movable storage device can comprise the computing machine External memory equipment of arbitrary medium, such as the wireless Internet card, USB flash disk etc. of mobile phone, extra storage function.
Sector is the minimum physical memory cell of disk, and the size of a general sector is 512 bytes.Such as, the movable storage device of a 2G, refer to that the storage space of all sector compositions in movable storage device has 2G, in fact, file is stored on USB flash disk, is actually and file allocation is stored to the storage space comprising multiple sector, such as, the film of a 300MB, is placed on USB flash disk, and being in fact has a lot of sectors in responsible storage data.
For the movable storage device of a nG, can use following equation expression, wherein n is positive number:
Size=nG=n*1024*1024*1024 the byte of each sector of number * of sector
Therefore, check a movable storage device whether shrink dish, the most essential principle, confirm whether sector number in described movable storage device meets equation above exactly, the shrink of shrink dish in fact, disappearance be the number of sector, for a shrink dish, illustrate that the number of sectors in its physical memory space is inadequate, even if the capacity being such as known as movable storage device has 2G, but the capacity of the data of its actual storage is less than 2G certainly.
In one preferred embodiment of the invention, described step 201 can comprise following sub-step:
Sub-step S11: the control authority of setting movable storage device;
As a kind of preferred exemplary of the present embodiment, the API(of operating system standard can be used such as, call DeviceIoControl function) set the control authority of movable storage device, the described control authority to mobile movable storage device is exclusive control authority, described control authority can comprise and locking movable storage device, control the access limit of movable storage device, namely after movable storage device locking, only allow the specific program preset to read and write it, other programs just cannot be read and write movable storage device.
Sub-step S12: judge that whether described movable storage device is read-write;
Specifically, judge movable storage device whether read-write be judge described movable storage device for preset the whether read-write data of specific program, as a kind of preferred exemplary of the present embodiment, the API of standard can be used whether read-write to detect certain sector in movable storage device, described standard A PI can be ReadFile function and WriteFile function, if the read-write data in described sector, the read-write data of described movable storage device are described.
Sub-step S13: if so, obtain each sets of sectors in movable storage device, and be each sets of sectors memory allocated space in described movable storage device.
Specifically, a movable storage device can have a lot of sectors according to its capacity, several sectors can be randomly drawed from the larger sector of these quantity and form a sets of sectors, several sets of sectors can be had in whole movable storage device, the distribution on a rough average of these several sets of sectors, between the sector null that can cover whole movable storage device, but it is discontinuous between these sets of sectors, namely do not occur simultaneously, such as, whole movable storage device has 10000 sectors, certain sets of sectors may comprise 100 sectors, this 100 sectors distribution in 10000 sectors of whole movable storage device can be 1-20 respectively, 1000-1040, 2000 to 2020, 8000 to 8020.
In specific implementation, the process for each sets of sectors memory allocated space in movable storage device is the process of initialization movable storage device, can comprise select target sector, gives the memory allocated space, target sector selected, the process of composition sets of sectors.
Step 202: judge that whether each sets of sectors of the storage space of described movable storage device is normal sector set;
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 one preferred embodiment of the invention, described step 202 can comprise following sub-step:
Sub-step S21: read the first data in sets of sectors;
Sub-step S22: write test data in described sets of sectors, described test data covers described first data;
In specific implementation, described test data can be random code, the first data in the test data meeting coverage sector set of write.
Sub-step S23: write random data in other sectors beyond described sets of sectors;
In specific implementation, random data can be random code, does not occur simultaneously in the position of other sectors beyond described sets of sectors and the sector in described sets of sectors, and other sectors beyond described sets of sectors are several sectors randomly drawed.
Sub-step S24: judge whether described random data causes interference to described test data, if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is normal sector set.
In one preferred embodiment of the invention, described sub-step S24 can comprise following sub-step:
Sub-step S241: read the second data in described sets of sectors;
Sub-step S242: described second data and described test data are compared, if described 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 sector set; If described second data and described test data inconsistent, then described random data causes interference to described test data, and described sets of sectors is abnormal sets of sectors.
Specifically, because do not occur simultaneously in the position of other sectors beyond the sets of sectors of write random data and the sector in described sets of sectors, therefore under normal conditions, random data and the test data of write are not occured simultaneously, but, when movable storage device is shrink dish, the capacity of the random data of write is greater than the capacity of the sector for storing random data, therefore random data will take the position of other sectors, such as take the position of described sets of sectors, such random data will part coverage test data, interference is caused to test data, cause the second data of reading and test data inconsistent, also therefore demonstrating described sets of sectors is abnormal sets of sectors.
Step 203: calculating normal sector is integrated into the ratio in the storage space of described movable storage device;
In one preferred embodiment of the invention, described step 203 can comprise following sub-step:
Sub-step S31: the quantity obtaining all sets of sectors in the storage space of movable storage device;
Sub-step S32: the quantity of statistics normal sector set;
Sub-step S33: the ratio calculating the quantity of all sets of sectors in the quantity of described normal sector set and the storage space of described movable storage device.
Step 204: if the ratio that described normal sector is integrated in the storage space of movable storage device exceedes preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is abnormal movable storage device.
Such as: preset ratio is 90%, when the ratio be integrated in all sets of sectors when normal sector is 50%, show if the amount of capacity that movable storage device marks is 4G, in fact the amount of capacity of movable storage device is 2G, be less than default 3.6G, namely can illustrate that described movable storage device is abnormal movable storage device, i.e. shrink dish.
Shrink dish also claims " dilatation dish ", " upgrading dish ", refer to that illegal manufacturer uses a kind of software of volume production instrument, movable storage device capacity is marked much larger than its actual capacity, reap staggering profits with the means of swindling consumer, when the actual capacity of movable storage device is less than or equal to 90% of its nominal, be namely identified as the shrink dish that there are quality problems.
Shrink dish actual capacity is much smaller than mark capacity, in use, it is super slow that not only read or write speed is coiled in shrink, and insufficient memory can be there is very soon, in addition, be written to the file in shrink dish, exceed the part of actual capacity, normally cannot be read and used, the trouble such as a series of obliterated data, work delay can be brought to user like this.So a kind of good movable storage device detection method is most important for user.
In specific implementation, due to judging that movable storage device needs write in the process of normal movable storage device or shrink dish and reads data, therefore before execution step 201, can capsule information be backed up first reminding user.After the detection starting to perform movable storage device (after namely starting to perform step 201), the progress that method reminding user movable storage devices such as detecting progress bar detects can be used, and reminding user avoids extracting movable storage device, prevents the loss of data.
With reference to Fig. 3, it illustrates the flow chart of steps of a kind of movable storage device detection method embodiment 2 of the present invention, specifically can comprise the steps:
Step 301: the control authority of setting movable storage device, and obtain each sets of sectors of the storage space of movable storage device;
In one preferred embodiment of the invention, described step 301 can comprise following sub-step:
Sub-step S41: the control authority of setting movable storage device;
Sub-step S42: judge that whether described movable storage device is read-write;
Sub-step S43: if so, obtain each sets of sectors in movable storage device, and be each sets of sectors memory allocated space in described movable storage device.
Specifically, a movable storage device can have a lot of sectors according to its capacity, several sectors can be randomly drawed from the larger sector of these quantity and form a sets of sectors, several sets of sectors can be had in whole movable storage device, the distribution on a rough average of these several sets of sectors, between the sector null that can cover whole movable storage device, but it is discontinuous between these sets of sectors, namely do not occur simultaneously, such as, whole movable storage device has 10000 sectors, certain sets of sectors may comprise 100 sectors, this 100 sectors distribution in 10000 sectors of whole movable storage device can be 1-20 respectively, 1000-1040, 2000 to 2020, 8000 to 8020.
Step 302: judge whether each sets of sectors in the storage space of described movable storage device is normal sector set;
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 one preferred embodiment of the invention, described step 302 can comprise following sub-step:
Sub-step S51: read the first data in sets of sectors;
Sub-step S52: write test data in described sets of sectors, described test data covers described first data;
In specific implementation, described test data can be random code, the first data in the test data meeting coverage sector set of write.
Sub-step S53: write random data in other sectors beyond described sets of sectors;
In specific implementation, random data can be random code, does not occur simultaneously in the position of other sectors beyond described sets of sectors and the sector in described sets of sectors, and other sectors beyond described sets of sectors are several sectors randomly drawed.
Sub-step S54: judge whether described random data causes interference to described test data, if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is normal sector set.
In one preferred embodiment of the invention, described sub-step S54 can comprise following sub-step:
Sub-step S541: read the second data in described sets of sectors;
Sub-step S542: described second data and described test data are compared, if described 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 sector set; If described second data and described test data inconsistent, then described random data causes interference to described test data, and described sets of sectors is abnormal sets of sectors.
Step 303: calculating normal sector is integrated into the ratio in the storage space of described movable storage device;
In one preferred embodiment of the invention, described step 303 can comprise following sub-step:
Sub-step S61: the quantity obtaining all sets of sectors in the storage space of movable storage device;
Sub-step S62: the quantity of statistics normal sector set;
Sub-step S63: the ratio calculating the quantity of all sets of sectors in the quantity of described normal sector set and the storage space of described movable storage device.
Step 304: if the ratio that described normal sector is integrated in the storage space of movable storage device exceedes preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is abnormal movable storage device.
Such as: preset ratio is 90%, when the ratio be integrated in all sets of sectors when normal sector is 50%, show if the amount of capacity that movable storage device marks is 4G, in fact the amount of capacity of movable storage device is 2G, be less than default 3.6G, namely can illustrate that described movable storage device is abnormal movable storage device, i.e. shrink dish.
Shrink dish also claims " dilatation dish ", " upgrading dish ", refer to that illegal manufacturer uses a kind of software of volume production instrument, movable storage device capacity is marked much larger than its actual capacity, reap staggering profits with the means of swindling consumer, when the actual capacity of movable storage device is less than or equal to 90% of its nominal, be namely identified as the shrink dish that there are quality problems.
Shrink dish actual capacity is much smaller than mark capacity, in use, it is super slow that not only read or write speed is coiled in shrink, and insufficient memory can be there is very soon, in addition, be written to the file in shrink dish, exceed the part of actual capacity, normally cannot be read and used, the trouble such as a series of obliterated data, work delay can be brought to user like this.
Step 305: show the described testing result to movable storage device.
As a kind of preferred exemplary of the present embodiment, the testing result etc. that described testing result can comprise the actual capacity of described movable storage device, the mark capacity of movable storage device, the system banner capacity of movable storage device, movable storage device are normal movable storage device or abnormal movable storage device (shrink dish), wherein, to be system be integrated into according to described normal sector the product gained that ratio in the storage space of movable storage device and movable storage device mark capacity to the system banner capacity of described movable storage device.
Step 306: described testing result is synchronized in other the data handling system in network.
Such as: can by described testing result by other data handling systems of sharing the mode such as blog, microblogging and being synchronized in network.
Step 307: the primary data recovering movable storage device.
Specifically, because can reading and writing data be carried out in the testing process of movable storage device, write or the data read can cause the test data that writes in the storage space of described movable storage device and primary data different, therefore user test data should be reverted to the primary data of movable storage device, so that normally can use movable storage device.
For making those skilled in the art understand the present invention better, the example below by way of an embody rule illustrates the testing process of movable storage device of the present invention, is below the qualification process for USB flash disk:
(1) start-up simulation machine, is connected to USB flash disk on computing machine;
(2) determine that USB flash disk is connected on computing machine, if detect that USB flash disk is not also connected on computing machine, eject as shown in Figure 4 fail detect that USB flash disk is connected to the user interface on computing machine, reminding user insert USB flash disk; If detect that USB flash disk has been connected on computing machine, eject as shown in Figure 5 can detect that USB flash disk is connected to the user interface on computing machine, show the information of USB flash disk, reminding user starts to detect, and the backup reminding user interface of ejecting as shown in Figure 6, reminding user backup capsule information;
(3) after detection starts, eject detection progress reminding user interface as shown in Figure 7, show the progress detected, and reminding user is not extracted USB flash disk or 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;
B. judge that whether each sets of sectors of the storage space of described USB flash disk is normal sector set;
C. calculating normal sector is integrated into the ratio in the storage space of described USB flash disk;
If the ratio that d. described normal sector is integrated in the storage space of movable storage device exceedes preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is shrink dish.
(4) after detection terminates, show testing result, testing result as shown in Figure 8 shows user interface, the testing result etc. that described testing result comprises the actual capacity of USB flash disk, the mark capacity of USB flash disk, the system banner capacity of USB flash disk, USB flash disk are normal USB flash disk or shrink dish, and testing result can be shared (synchronously) in other data handling systems by reminding user.
For the embodiment of the method for Fig. 3, due to itself and Fig. 2 embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part of embodiment of the method
It should be noted that, for embodiment of the method, in order to simple description, therefore it is all expressed as a series of combination of actions, but those skilled in the art should know, the present invention is not by 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 instructions all belongs to preferred embodiment, and involved action and module might not be that the present invention is necessary.
With reference to Fig. 9, show a kind of according to an embodiment of the invention structured flowchart of movable storage device pick-up unit embodiment, specifically can comprise with lower module:
Sets of sectors acquisition module 901, is suitable for the control authority setting movable storage device, and obtains each sets of sectors of the storage space of movable storage device;
In one preferred embodiment of the invention, described sets of sectors acquisition module 901 can comprise following submodule:
Control of authority submodule, is suitable for the control authority setting movable storage device;
Judge submodule, be suitable for judging that whether described movable storage device is read-write, if so, then call initialization submodule;
Initialization submodule, is suitable for obtaining each sets of sectors in movable storage device, and is each sets of sectors memory allocated space in described movable storage device.
Normal sector set judge module 902, is suitable for judging whether each sets of sectors in the storage space of described movable storage device is normal sector set;
In one preferred embodiment of the invention, described normal sector set judge module 902 can comprise following submodule:
First digital independent submodule, is suitable for reading the first data in sets of sectors;
Test data write submodule, be suitable for writing test data in described sets of sectors, described test data covers described first data;
Random data write submodule, is suitable for writing random data in other sectors beyond described sets of sectors;
Interference judges submodule, and be suitable for judging whether described random data causes interference to described test data, if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is normal sector set.
In one preferred embodiment of the invention, described interference judges that submodule can comprise further as lower unit:
Second data-reading unit, is suitable for the second data read in described sets of sectors;
Interference judging unit, be suitable for described second data and described test data to compare, if described 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 sector set; If described second data and described test data inconsistent, then described random data causes interference to described test data, and described sets of sectors is abnormal sets of sectors.
Ratio computing module 903, is suitable for calculating normal sector and is integrated into ratio in the storage space of described movable storage device;
In one preferred embodiment of the invention, described ratio computing module 903 can comprise following submodule:
Sets of sectors obtains submodule, is suitable for the quantity of all sets of sectors in the storage space of acquisition movable storage device;
Normal sector set statistics submodule, is suitable for the quantity of adding up normal sector set;
Ratio calculating sub module, is suitable for the ratio of the quantity calculating all sets of sectors in the quantity of described normal sector set and the storage space of described movable storage device.
Normal movable storage device judge module 904, when the ratio being suitable for being integrated in the storage space of movable storage device in described normal sector exceedes preset ratio, judge that described movable storage device is normal movable storage device, otherwise, judge that described movable storage device is abnormal movable storage device.
Such as: preset ratio is 90%, when the ratio be integrated in all sets of sectors when normal sector is 50%, namely can illustrate that described movable storage device is abnormal movable storage device, i.e. shrink dish.
Shrink dish also claims " dilatation dish ", " upgrading dish ", refer to that illegal manufacturer uses a kind of software of volume production instrument, movable storage device capacity is marked much larger than its actual capacity, reap staggering profits with the means of swindling consumer, when the actual capacity of movable storage device is less than or equal to 90% of its nominal, be namely identified as the shrink dish that there are quality problems.
Shrink dish actual capacity is much smaller than mark capacity, in use, it is super slow that not only read or write speed is coiled in shrink, and insufficient memory can be there is very soon, in addition, be written to the file in shrink dish, exceed the part of actual capacity, normally cannot be read and used, the trouble such as a series of obliterated data, work delay can be brought to user like this.
Display module 905: be suitable for showing the described testing result to movable storage device.
Synchronization module 906, is suitable for described testing result being synchronized in other the data handling system in network.
Recover module 907, be suitable for the primary data recovering movable storage device.
For the device embodiment of Fig. 9, due to itself and embodiment of the method basic simlarity, so description is fairly simple, relevant part illustrates see the part 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 the difference with other embodiments, between each embodiment identical similar part mutually see.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.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 in each inventive aspect one or more, in the description above 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.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions based on the some or all parts in the movable storage device checkout equipment of data handling system that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of 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 does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.

Claims (12)

1. a movable storage device detection method, comprising:
The control authority of setting movable storage device;
Judge that whether described movable storage device is read-write;
If so, obtain each sets of sectors in movable storage device, and be each sets of sectors memory allocated space in described movable storage device;
Judge that whether each sets of sectors of the storage space of described movable storage device is normal sector set;
Calculating normal sector is integrated into the ratio in the storage space of described movable storage device;
If the ratio that described normal sector is integrated in the storage space of movable storage device exceedes preset ratio, then described movable storage device is normal movable storage device, otherwise described movable storage device is abnormal movable storage device;
Each sets of sectors in described movable storage device is by randomly drawing acquisition;
Wherein, whether the sets of sectors in the described storage space judging each movable storage device is that the step that normal sector is gathered comprises:
Read the first data in sets of sectors;
In described sets of sectors, write test data, described test data covers described first data;
Random data is write in other sectors beyond described sets of sectors;
Judge whether described random data causes interference to described test data, if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is normal sector set.
2. the method for claim 1, also comprises:
Show the testing result to described movable storage device.
3. the method for claim 1, describedly judges whether random data causes interference to described test data, and if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is that the step that normal sector is gathered comprises:
Read the second data in described sets of sectors;
Described second data and described test data are compared, if described 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 sector set; If described second data and described test data inconsistent, then described random data causes interference to described test data, and described sets of sectors is abnormal sets of sectors.
4. the method for claim 1, the step of the ratio that described calculating normal sector is integrated in the storage space in movable storage device comprises:
Obtain the quantity of all sets of sectors in the storage space of movable storage device;
The quantity of statistics normal sector set;
Calculate the ratio of the quantity of all sets of sectors in the quantity and described movable storage device gathered described normal sector.
5. method as claimed in claim 2, also comprises:
Described testing result is synchronized in other the data handling system in network.
6. the method according to any one of claim 1 to 5, also comprises:
Recover the primary data of movable storage device.
7. a movable storage device pick-up unit, comprising:
Control of authority module, is suitable for the control authority setting movable storage device;
Judge module, is suitable for judging that whether described movable storage device is read-write, if so, then calls initialization module;
Initialization module, is suitable for obtaining each sets of sectors in movable storage device, and is each sets of sectors memory allocated space in described movable storage device;
Normal sector set judge module, whether each sets of sectors described being suitable for the storage space judging movable storage device is normal sector set;
Ratio computing module, is suitable for calculating normal sector and is integrated into ratio in the storage space of described movable storage device;
Normal movable storage device judge module, when the ratio being suitable for being integrated in the storage space of movable storage device in described normal sector exceedes preset ratio, judge that described movable storage device is normal movable storage device, otherwise, judge that described movable storage device is abnormal movable storage device;
Each sets of sectors in described movable storage device is by randomly drawing acquisition;
Described normal sector set judge module comprises:
First digital independent submodule, is suitable for reading the first data in sets of sectors;
Test data write submodule, be suitable for writing test data in described sets of sectors, described test data covers described first data;
Random data write submodule, is suitable for writing random data in other sectors beyond described sets of sectors;
Interference judges submodule, and be suitable for judging whether described random data causes interference to described test data, if so, then described sets of sectors is abnormal sets of sectors; If not, then described sets of sectors is normal sector set.
8. device as claimed in claim 7, also comprises:
Display module, is suitable for showing the testing result to described movable storage device.
9. device as claimed in claim 7, described interference judges that submodule comprises:
Second data-reading unit, is suitable for the second data read in described sets of sectors;
Interference judging unit, be suitable for described second data and described test data to compare, if described 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 sector set; If described second data and described test data inconsistent, then described random data causes interference to described test data, and described sets of sectors is abnormal sets of sectors.
10. device as claimed in claim 8, described ratio computing module comprises:
Sets of sectors obtains submodule, is suitable for the quantity of all sets of sectors in the storage space of acquisition movable storage device;
Normal sector set statistics submodule, is suitable for the quantity of adding up normal sector set;
Ratio calculating sub module, is suitable for the ratio of the quantity calculating all sets of sectors in the quantity of described normal sector set and the storage space of described movable storage device.
11. devices as claimed in claim 8, also comprise:
Synchronization module, is suitable for described testing result being synchronized in other the data handling system in network.
12. devices as described in any one of claim 7 to 11, also comprise:
Recover module, be suitable for the primary data recovering 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 CN102956270A (en) 2013-03-06
CN102956270B true 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)

Families Citing this family (2)

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

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

Also Published As

Publication number Publication date
CN102956270A (en) 2013-03-06

Similar Documents

Publication Publication Date Title
US7409623B2 (en) System and method of reading non-volatile computer memory
CN104461391A (en) Method and system for managing and processing metadata of storage equipment
US7725646B2 (en) Method of using a flash memory for a circular buffer
CN100440163C (en) Method and system for analysis processing of computer program
US8239329B2 (en) Data storage medium, software installation method and copyright protection module
CN102081577A (en) Data storage structure of Flash memory and data manipulation mode thereof
KR101651204B1 (en) Apparatus and Method for synchronization of snapshot image
US20110119662A1 (en) Method for updating firmware of embedded system
CN103777971A (en) Electronic device, method for updating firmware, and recording medium capable of being read by computer
US20140156913A1 (en) Data processing method, memory controller and memory storage apparatus
CN107315616A (en) A kind of loading method of firmware, device and electronic equipment
CN103914397B (en) Flash memory device and its management method
EP3336702B1 (en) Metadata recovery method and device
CN103646669A (en) Method and device for detecting reliability of removable storage device
US20100115004A1 (en) Backup system that stores boot data file of embedded system in different strorage sections and method thereof
CN102956270B (en) Movable storage device detection method and device
CN102969026B (en) Based on movable storage device detection method and the device of data handling system
CN111562882A (en) Data writing method, intelligent terminal and storage medium
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
CN102945342B (en) Progress recognizing method, device and terminal device
CN103677668A (en) Method and device for detecting mobile storage equipment
CN105830067A (en) Document information processing method, apparatus, and document processing apparatus and system
CN105893282A (en) Hard disk moving recognizing method and system
CN108038035A (en) A kind of detection method and relevant apparatus of flash reading and writing state

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20151125