CN102866964A - Method and device for protecting data on storage equipment - Google Patents

Method and device for protecting data on storage equipment Download PDF

Info

Publication number
CN102866964A
CN102866964A CN2012103483669A CN201210348366A CN102866964A CN 102866964 A CN102866964 A CN 102866964A CN 2012103483669 A CN2012103483669 A CN 2012103483669A CN 201210348366 A CN201210348366 A CN 201210348366A CN 102866964 A CN102866964 A CN 102866964A
Authority
CN
China
Prior art keywords
disk partition
node
eject
target storage
disk
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
CN2012103483669A
Other languages
Chinese (zh)
Other versions
CN102866964B (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
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 CN201210348366.9A priority Critical patent/CN102866964B/en
Priority to CN201510146242.6A priority patent/CN104700048B/en
Publication of CN102866964A publication Critical patent/CN102866964A/en
Application granted granted Critical
Publication of CN102866964B publication Critical patent/CN102866964B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a method and a device for protecting data on storage equipment, relating to the technical field of computers, and solving the problem of the data damage or loss of the storage equipment due to that which partition or file of the storage equipment does not finish reading and writing cannot be accurately judged, and then a user cannot remove the storage equipment after guaranteeing that the data reading and writing of the storage equipment are finished. The method comprises the following steps of: detecting the command of ejecting the storage equipment in real time according to a preset storage equipment monitoring instruction; determining the to-be-ejected disk partition in case that the command of ejecting the storage equipment is detected; and determining all disk partitions on target storage equipment linked to be ejected with the to-be-ejected disk partition, suspending an ejection operation for the to-be-ejected disk partition and the target storage equipment in case that at least one disk partition is detected to be in an active state, and prompting the information of the disk partition in the active state so as to protect data on the target storage equipment.

Description

A kind of method and device of protecting data on the memory device
Technical field
The present invention relates to field of computer technology, relate in particular to a kind of method and device of protecting data on the memory device.
Background technology
Along with the widespread use of computing machine, it is especially important that memory device becomes.People utilize memory device the transmission of data between computer equipment and computer equipment, and for example people deposit the data on the computer equipment in USB storage with USB storage, deposit the data on the USB storage in another computer equipment again.But at data writing on memory device or from the memory device during sense data, if misoperation, such as, when memory device not being read and write end, memory device is removed from computer equipment, will cause data storage errors, may cause the corrupted data on the memory device when serious or lose.
In the prior art, after operating system detects the request that removes memory device, determining when the read-write of memory device do not finished, can can't remove by prompting user equipment, but which subregion or which file that can't provide memory device do not have read-write to finish, the user removes memory device after can not find exact cause, may cause the corrupted data on the memory device or lose.How to protect the data on the memory device, make the user guarantee to memory device read end after remove again memory device, the safety with the data of protection on the memory device becomes a problem to be solved.
Summary of the invention
Fundamental purpose of the present invention is to provide a kind of method and device of protecting data on the memory device; which subregion that can't accurately judge memory device or the file that exist with the solution prior art do not have read-write to finish; and then can not make the user after the reading and writing data of guaranteeing memory device is finished, remove memory device; cause the corrupted data of memory device or the problem of losing, wherein:
A kind of method of protecting data on the memory device comprises:
Detect in real time the order of ejecting memory device according to the memory device watchdog routine that presets;
When detecting the order of described ejection memory device, determine the disk partition that this order will be ejected;
All disk partition on the target storage device that the disk partition interlock of determining and will ejecting is ejected; when detecting that wherein at least one disk partition is in active state; suspend the ejection operation of the described disk partition that will eject and target storage device; point out the information of the disk partition that is in active state to protect the data on this target storage device
Wherein, described target storage device has at least two disk partition.
A kind of device of protecting data on the memory device comprises:
Monitoring module is used for detecting in real time the order of ejecting memory device according to the memory device watchdog routine that presets;
The target storage device determination module is used for determining the disk partition that this order will be ejected when detecting the order of described ejection memory device;
Data protection module; every other disk partition on the target storage device that is used for determining to eject with the disk partition interlock that will eject; when detecting that wherein at least one disk partition is in active state; suspend the ejection operation of the described disk partition that will eject and target storage device; point out the information of the disk partition that is in active state to protect the data on this target storage device
Wherein, described target storage device has at least two disk partition.
Method and apparatus of the present invention according to the memory device watchdog routine that presets, detects the order of ejecting memory device in real time, when detecting the order of described ejection memory device, determines the disk partition that this order will be ejected; Then, all disk partition on the target storage device that the disk partition interlock of determining and will ejecting is ejected, when detecting that wherein at least one disk partition is in active state, suspend the ejection operation of the described disk partition that will eject and target storage device, prompting is in the information of the disk partition of active state.Avoid when some disk partition of memory device is in active state, ejecting the corrupted data on the memory device that this memory device causes or lost, effectively protected the data on the memory device.
Description of drawings
In order to be illustrated more clearly in the technical scheme of the embodiment of the invention, the accompanying drawing of required use was done to introduce simply during the below will describe embodiment, apparently, accompanying drawing in the following describes only is some embodiments of the present invention, for those of ordinary skills, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the schematic flow sheet according to the method for data on the protection memory device of the present invention;
Fig. 2 is the tree structure synoptic diagram of operating system management equipment;
Fig. 3 is the structural representation according to the device of data on the protection memory device of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
In detail technical scheme of the present invention is set forth below in conjunction with accompanying drawing 1.
Step 100 detects the order of ejecting memory device in real time according to the memory device watchdog routine that presets.
Memory device watchdog routine of the present invention realizes that by the execution of client software wherein, the program that client software is carried out comprises: memory device watchdog routine, target storage device determine procedures, data protection program etc.; Client is computing machine, palm PC etc.After the client software on the client starts, can the Real Time Monitoring memory device, client software detects the order of ejecting memory device in real time by carrying out the memory device watchdog routine, when detecting the user by client software operation ejection memory device, the memory device monitored instruction detects the order of ejecting memory device.
Step 101 when detecting the order of described ejection memory device, is determined the disk partition that this order will be ejected.
Memory device of the present invention comprises: portable hard drive, USB storage etc. has memory function and can carry out to storage space the equipment of partition management.Present embodiment is specifically described as an example of USB storage example, also can be based on the memory device of other interfaces.This memory device has two disk partition at least on main frame, in the present embodiment, suppose that USB storage equipment has two disk partition at main frame, represents with drive D and drive E respectively, supposes that the D dish is disk partition to be ejected.
Behind the os starting, usually can collect all device datas, and device data is written in the registration table, be convenient to equipment control.Wherein also comprise data in magnetic disk, can the real-time update data in magnetic disk after operating system has detected the memory device access or removed.In device data, the corresponding unique sequence number of each memory device, and each disk partition has a unique device number, each memory device can related a plurality of disk partition, be the different corresponding equipment Serial Numbers of disk partition possibility of a plurality of device numbers, when one of them disk partition is ejected, the memory device related with this disk partition ejection that will link.
At first, generate device name according to disk partition to be ejected.Can adopt with minor function:
StringCchPrintf (szDeviceName, ARRAYSIZE (szDeviceName), L ". %c: ", byVolLetter), wherein, byVolLetter is drive, the device name of szDeviceName for generating.
Then, call the file operation function and open equipment corresponding to this device name, and the equipment handle.During implementation, can call function CreateFile () equipment handle, as: hDevice=CreateFile (szDeviceName, 0, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, NULL), wherein, hDevice is the handle of equipment.The handle of magnetic machine can be used as the unique identification of disk partition, has obtained the handle of equipment, just can carry out associative operation to disk partition.
If also have the removable equipment of other types in the computer equipment, can pass through call function DeviceIoControl (hDevice, IOCTL_STORAGE_QUERY_PROPERTY , ﹠amp; Spq, sizeof (spq) , ﹠amp; Buffer, sizeof (buffer) , ﹠amp; CbBytesReturned, (LPOVERLAPPED) NULL) come the attribute of equipment, be stored among the spq, and the interface type of the determined property equipment by equipment USB device whether, the application only processes USB device.Wherein, hDevice is the equipment handle.
Convenient for subsequent operation, can also send to this equipment handle the instruction of the device number that obtains memory device, obtain the device number that this will the eject disk subregion, use device number as the unique identification of disk partition.Can realize equipment number by calling DeviceIoControl () function:
DeviceIoControl (hDevice, IOCTL_STORAGE_GET_DEVICE_NUMBER, NULL, 0, (LPVOID) ﹠amp; Sdn, sizeof (sdn) , ﹠amp; CbBytesReturned, (LPOVERLAPPED) NULL), wherein, hDevice is the equipment handle.The device number of the D dish that obtains is stored among the data structure sdn.
Step 102; all disk partition on the target storage device that the disk partition interlock of determining and will ejecting is ejected; when detecting that wherein at least one disk partition is in active state; suspend disk partition described to be ejected and the ejection operation of target storage device, point out the information of the disk partition that is in active state to protect the data on this target storage device.
The device data that operating system is set up can be the form of tabulation, also can be tree-shaped structure, and present embodiment adopts tree structure to come the management equipment data instance with operating system.Fig. 2 is a tree structure synoptic diagram of operating system management equipment, and in this tree structure, USB device is by three disk partition, the 202nd, and a disk partition of USB device, the leaf node of corresponding tree structure; The 201st, USB memory device, the father node of corresponding tree structure.
It below is the example that the tree structure of a management equipment of setting up in advance by the search operation system is determined the every other disk partition on this target storage device.
The first step is enumerated all disk partition on the client, the set of setting up device node corresponding to all disk partition.Call SetupDiGetClassDevs (pGuidInferface, NULL, NULL, DIGCF_PRESENT|DIGCF_DEVICEINTERFACE) function, enumerate all disk partition information of client, if first parameter of SetupDiGetClassDevs () function is (GUID*) ﹠amp; GUID_DEVINTERFACE_DISK then can obtain the disk partition information on all USB storage on the client.Obtaining disk partition information is stored among the pGuidInferface.
Second step, obtain successively the device number of the disk partition that each device node is corresponding in the described set, determine node corresponding to disk partition of the node identical with the device number of the disk partition that will eject for ejecting, and with the father node of this node as destination node, the node corresponding to target storage device that namely will link and eject.During implementation, call SetupDiEnumDeviceInterfeces (hIntDevInfo, NULL, pGuidInferface, dwIndex , ﹠amp; InterfaceData) function reads the information of all nodes in the set, and the nodal information of acquisition is stored among the interfaceData, further calls SetupDiGetDeviceInterfaceDetail (hIntDevInfo , ﹠amp; InterfaceData, pInterFaceDetailData, cbBytesReturned , ﹠amp; CbBytesReturned , ﹠amp; DeviceInfoData) function obtains the details of each device node, and wherein pInterFaceDetailData stores the routing information of each node; Call respectively CreateFile () function, open node corresponding to each equipment of enumerating by device path (pInterFaceDetailData-〉DevicePath), obtain the equipment handle of disk partition corresponding to this node; Then, call DeviceIoControl () function, control code is made as IOCTL_STORAGE_GET_DEVICE_NUMBER, obtains device number corresponding to each node.Device number corresponding to each device node that herein obtains is exactly the device number of corresponding disk partition.Find with step 101 in obtain will the eject disk subregion identical that node of device number, the node that the disk partition that will eject exactly is corresponding.In tree structure, upwards search, call the father node that CM_Get_Parent () function obtains this node, determine node corresponding to target storage device of this father node for linking and ejecting, as destination node.Further call the sign (ID) that CM_Get_Device_ID () can obtain this destination node.
In the 3rd step, obtain respectively the father node of device node corresponding to each disk partition on the client, and disk partition corresponding to the node that father node is identical with destination node is as the disk partition on this target storage device.Call the drive information that GetLogicalDriveStrings () function obtains all disk partition on the computing machine, call all drive information that StringCchLength () function will obtain and write buffer memory, wait for traveling through.From buffer memory, take out respectively each drive information, call the format of StringCchPrintf () function after, generate device name; To each device name, call respectively the equipment handle that CreateFile () function obtains all disk partition, and then call DeviceIoControl (hDevice, IOCTL_STORAGE_QUERY_PROPERTY , ﹠amp; Spq, sizeof (spq) , ﹠amp; Buffer, sizeof (buffer) , ﹠amp; CbBytesReturned, (LPOVERLAPPED) NULL) come the attribute of equipment, filter out the memory device that is not USB interface, the step of going forward side by side obtains device number corresponding to each disk partition with DeviceIoControl () function.Repeat the function call in the first step and the second step, call flow is: call SetupDiGetClassDevs () and enumerate all disk partition on the client, the set of setting up device node corresponding to all disk partition; Sequence call SetupDiEnumDeviceInterfaces (), SetupDiGetDeviceInterfaceDetail () function obtain the details of each device node; Call CreateFile () function, open node corresponding to each equipment of enumerating by device path (pInterFaceDetailData-〉DevicePath), obtain the equipment handle of disk partition corresponding to this node; Then, call DeviceIoControl () function and obtain device number corresponding to each node; Call the father node that CM_Get_Parent () function obtains respectively the node in tree structure corresponding to each disk partition; The step of going forward side by side according to the father node that obtains, obtains the sign of this father node with CM_Get_Device_ID ().
At last, the father node of the node that all disk partition that relatively obtain are corresponding and the destination node of acquisition determine that father node disk partition corresponding to node identical with destination node (node that the target storage device of the ejection that namely will link is corresponding) is the disk partition on this target storage device.The father node of the node (leaf node) that disk partition is corresponding so father node is identical, just illustrates that disk partition is on same physical storage device (such as the USB hard disk) to physical storage device that should the disk partition place.Judge whether father node is identical, can be by the relatively sign realization of father node.
Device node corresponding to target storage device of the present invention to obtaining first will link and eject, the father node that still obtains first device node corresponding to all disk partition is not done restriction, as long as the two obtained before relatively.Function call among the application only is a function call among the embodiment, in different situations, can be suitable delete and increase function call that so the function call of enumerating in the present embodiment should not be considered as limitation of the invention.
Can also according to the sequence number of physical disk (being memory device), determine other disk partition on this physical disk.
Look for other subregions according to Disk Serial Number.Concrete steps are: at first to the equipment handle of the disk partition that will eject, i.e. the handle of step 101 kind of acquisition sends and obtains the instruction of USB device sequence number, obtains the sequence number of the target storage device that ejects with the disk partition interlock that will eject; Then, obtain all disk partition on the client, and obtain respectively that type is the equipment handle of the disk partition to be filtered of USB memory device in all disk partition, by the instruction of obtaining the USB device sequence number to the equipment handle transmission of disk partition to be filtered respectively, obtain the sequence number of the USB device at all disk partition to be filtered places.By calling DeviceIoControl () function, control code is made as the sequence number that IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER can obtain the USB hard disk at the disk partition place that will eject.Can be by calling all disk partition in GetLogicalDrives () the function acquisition system, the rreturn value of this function is the number of a double byte, the binary lowest order of this rreturn value is that 1 sign A takes inventory, and inferior low level is that 1 expression B takes inventory, and the rest may be inferred.Then, obtain the type of all disk partition, according to the type of disk partition, further filter out non-hand disk subregion (such as floppy drive, CD-ROM drive), remaining disk partition to be filtered is the disk partition of hard disk or movable storage device.Call GetDriveType () function, can determine the type of disk partition, such as floppy drive, CD-ROM drive, hard disk, USB memory device etc.At last, in filtering disk partition to be filtered, do not belong to the subregion of specifying physical disk, to link disk partition on the physical disk that ejects that remaining is exactly.Filter and do not belong to the subregion of specifying physical disk in the disk partition to be filtered, can be to the StringCchPrintf () in the disk partition difference to be filtered successively invocation step 101, CreateFile () obtains the handle of disk partition to be filtered, then call DeviceIoControl () function, control code is made as the sequence number that IOCTL_STORAGE_GET_MEDIA_SERIAL_NUMBER obtains the USB hard disk at all disk partition to be filtered places, the sequence number of the target storage device that the sequence number and the disk partition interlock that will eject that obtain the USB hard disk at each disk partition place to be filtered are ejected.Sequence number is identical, and explanation is same USB hard disk.Therefore, will coil with D disk partition that (namely will eject disk subregion) have identical Disk Serial Number as the disk partition on the same memory device, also be the disk partition that interlock is ejected.
After all disk partition on definite target storage device that ejects that will link, judge the file that whether also has in each disk partition just in use, the file of perhaps not yet closing, if the file that is using or do not closing in addition on certain subregion, illustrate that this subregion still is in active state, ejection should be suspended, otherwise loss of data or file corruption may be caused.When detecting that wherein at least one disk partition is in active state, suspend disk partition described to be ejected and the ejection operation of target storage device, prompting is in the information of disk partition of active state to protect the data on this target storage device.Specifically can pass through to eject prompting frame, and show the drive of accurately disk partition, the realization of file path in use.Also can be in prompting, on computers backup be in the disk partition of active state at the file data that uses or do not close, in order to recovering.
The technical problem to be solved in the present invention is: how to protect the data on the memory device, guarantee to memory device read end after, when namely memory device is not in active state, remove again memory device, with the safety of the data of protection on the memory device.The technical solution used in the present invention is: detect in real time the order of ejecting memory device according to the memory device watchdog routine that presets; When detecting the order of described ejection memory device, determine the disk partition that this order will be ejected; All disk partition on the target storage device that the disk partition interlock of determining and will ejecting is ejected; when detecting that wherein at least one disk partition is in active state; suspend the ejection operation of the described disk partition that will eject and target storage device, point out the information of the disk partition that is in active state to protect the data on this target storage device.
What enumerate in the present embodiment only is some functions that can realize this programme, those skilled in the art can also realize obtaining disk partition by calling other function, obtains the type of disk partition, determine the device number of disk partition etc. that the present invention is not construed as limiting this.All the disk partition methods on this target storage device determined also have a variety of, and the present invention has only enumerated two preferred embodiments, should not be understood as limitation of the invention.
Corresponding to method of the present invention, the present invention also provides a kind of device of protecting data on the memory device, as shown in Figure 3, comprising:
Monitoring module 300 is used for detecting in real time the order of ejecting memory device according to the memory device watchdog routine that presets;
Target storage device determination module 301 is used for determining the disk partition that this order will be ejected when detecting the order of described ejection memory device;
Data protection module 302; every other disk partition on the target storage device that is used for determining to eject with the disk partition interlock that will eject; when detecting that wherein at least one disk partition is in active state; suspend the ejection operation of the described disk partition that will eject and target storage device, point out the information of the disk partition that is in active state to protect the data on this target storage device.
Wherein, the described disk partition of determining that this order will be ejected is specially: the device name of the disk partition that will eject according to the drive Information generation in the described order; Call the file operation function and open equipment corresponding to this device name, the equipment handle of the disk partition that acquisition will be ejected.
The described disk partition of determining that this order will be ejected can also comprise: the equipment handle to the disk partition that will eject sends the instruction of obtaining device number, obtain the device number of the disk partition that this order will eject, with the unique identification of this device number as disk partition, be used for subsequent operation.
Preferably, all disk partition on the target storage device that the described disk partition interlock of determining and will ejecting is ejected further comprise: enumerate all disk partition on the client, the set of setting up device node corresponding to all disk partition; Obtain successively the device number of the disk partition that each device node is corresponding in the described set, determine node corresponding to disk partition of the node identical with the device number of the disk partition that will eject for ejecting, and with the father node (node corresponding to target storage device of the ejection that namely will link) of this node as destination node; Obtain respectively the father node of device node corresponding to each disk partition on the client, and disk partition corresponding to the node that father node is identical with destination node is as the disk partition on this target storage device.
Perhaps, directly pass through the sequence number of the physical disk at acquisition disk partition place, determine all disk partition on this target storage device, be specially: send to the equipment handle of the disk partition that will eject and obtain the instruction of USB device sequence number, obtain the sequence number of the target storage device that ejects with the disk partition interlock that will eject; Obtain all disk partition on the client, and the type that obtains respectively in all disk partition is the equipment handle of the disk partition to be filtered of USB memory device, by the instruction of obtaining the USB device sequence number to the equipment handle transmission of disk partition to be filtered respectively, obtain the sequence number of the USB device at all disk partition to be filtered places; Determine to be all disk partition on this target storage device with the disk partition that will the eject disk subregion has same sequence number.
When detecting that wherein at least one disk partition is in active state, suspend disk partition described to be ejected and the ejection operation of target storage device, prompting is in the information of disk partition of active state to protect the data on this target storage device.Specifically can pass through to eject prompting frame, and show the drive of accurately disk partition, the realization of file path in use.Also can be in prompting, on computers backup be in the disk partition of active state at the file data that uses or do not close, in order to recovering.The application is not construed as limiting this.
Described target storage device among the application is the movable storage device that is connected in the USB interface of computer equipment, such as USB storage.Described target storage device has at least two disk partition.
The device of data can be used for client device on the protection memory device among the application, and described client device comprises: portable terminal one classes such as cloud memory device, PC, mobile phone, but the kind that is not limited to enumerate in the application documents.
Each embodiment in this instructions is general, and the mode of going forward one by one that adopts is described, 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.
The application can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module or unit.Usually, program module or unit can comprise the routine carrying out particular task or realize particular abstract data type, program, object, assembly, data structure etc.In general, program module or unit can be realized by software, hardware or both combinations.Also can in distributed computing environment, put into practice the application, in these distributed computing environment, be executed the task by the teleprocessing equipment that is connected by communication network.In distributed computing environment, program module or unit can be arranged in the local and remote computer-readable storage medium that comprises memory device.
At last, also need to prove, in this article, relational terms such as the first and second grades only is used for an entity or operation are made a distinction with another entity or operation, and not necessarily requires or hint and have the relation of any this reality or sequentially between these entities or the operation.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby not only comprise those key elements so that comprise process, method, commodity or the equipment of a series of key elements, but also comprise other key elements of clearly not listing, or also be included as the intrinsic key element of this process, method, commodity or equipment.Do not having in the situation of more restrictions, the key element that is limited by statement " comprising ... ", and be not precluded within process, method, commodity or the equipment that comprises described key element and also have other identical element.
Used specific case herein the application's principle and embodiment are set forth, the explanation of above embodiment just is used for helping to understand the application's method and main thought thereof; Simultaneously, for one of ordinary skill in the art, the thought according to the application all will change in specific embodiments and applications, and in sum, this description should not be construed as the restriction to the application.

Claims (9)

1. a method of protecting data on the memory device is characterized in that, comprising:
Detect in real time the order of ejecting memory device according to the memory device watchdog routine that presets;
When detecting the order of described ejection memory device, determine the disk partition that this order will be ejected;
All disk partition on the target storage device that the disk partition interlock of determining and will ejecting is ejected; when detecting that wherein at least one disk partition is in active state; suspend the ejection operation of the described disk partition that will eject and target storage device; point out the information of the disk partition that is in active state to protect the data on this target storage device
Wherein, described target storage device has at least two disk partition.
2. method according to claim 1 is characterized in that, the described disk partition of determining that this order will be ejected is specially:
The device name of the disk partition that will eject according to the drive Information generation in the described order;
Call the file operation function and open equipment corresponding to this device name, the equipment handle of the disk partition that acquisition will be ejected.
3. method according to claim 1 and 2 is characterized in that,
The described disk partition of determining that this order will be ejected also comprises: send the instruction of the device number that obtains memory device to the equipment handle of the disk partition that will eject, obtain the device number of the disk partition that this order will eject;
All disk partition on the target storage device that the described disk partition interlock of determining and will ejecting is ejected further comprise:
Enumerate all disk partition on the client, the set of setting up device node corresponding to all disk partition;
Obtain successively the device number of the disk partition that each device node is corresponding in the described set, determine that the node identical with the device number of the disk partition that will eject is the node corresponding to disk partition that will eject, and with the father node of this node as destination node;
Obtain respectively the father node of device node corresponding to each disk partition on the client, and disk partition corresponding to the node that father node is identical with destination node is as the disk partition on this target storage device.
4. each described method is characterized in that according to claim 1-3, and all disk partition on the target storage device that the described disk partition interlock of determining and will ejecting is ejected further comprise:
Send to the equipment handle of the disk partition that will eject and to obtain the instruction of USB device sequence number, obtain the sequence number of the target storage device that ejects with the disk partition interlock that will eject;
Obtain all disk partition on the client, and obtain respectively that type is the equipment handle of the disk partition to be filtered of USB memory device in all disk partition, by the instruction of obtaining the USB device sequence number to the equipment handle transmission of disk partition to be filtered respectively, obtain the sequence number of the USB device at all disk partition to be filtered places;
Determine to be all disk partition on this target storage device with the disk partition that will the eject disk subregion has same sequence number.
5. a device of protecting data on the memory device is characterized in that, comprising:
Monitoring module is used for detecting in real time the order of ejecting memory device according to the memory device watchdog routine that presets;
The target storage device determination module is used for determining the disk partition that this order will be ejected when detecting the order of described ejection memory device;
Data protection module; every other disk partition on the target storage device that is used for determining to eject with the disk partition interlock that will eject; when detecting that wherein at least one disk partition is in active state; suspend the ejection operation of the described disk partition that will eject and target storage device; point out the information of the disk partition that is in active state to protect the data on this target storage device
Wherein, described target storage device has at least two disk partition.
6. device according to claim 5 is characterized in that, the described disk partition of determining that this order will be ejected is specially:
The device name of the disk partition that will eject according to the drive Information generation in the described order;
Call the file operation function and open equipment corresponding to this device name, the equipment handle of the disk partition that acquisition will be ejected.
7. according to claim 5 or 6 described devices, it is characterized in that,
The described disk partition of determining that this order will be ejected also comprises: the equipment handle to the disk partition that will eject sends the instruction of obtaining device number, obtains the device number of the disk partition that this order will eject;
All disk partition on the target storage device that the described disk partition interlock of determining and will ejecting is ejected further comprise:
Enumerate all disk partition on the client, the set of setting up device node corresponding to all disk partition;
Obtain successively the device number of the disk partition that each device node is corresponding in the described set, determine that the node identical with the device number of the disk partition that will eject is the node corresponding to disk partition that will eject, and with the father node of this node as destination node;
Obtain respectively the father node of device node corresponding to each disk partition on the client, and disk partition corresponding to the node that father node is identical with destination node is as the disk partition on this target storage device.
8. each described device is characterized in that according to claim 5-7, and all disk partition on the target storage device that the described disk partition interlock of determining and will ejecting is ejected further comprise:
Send to the equipment handle of the disk partition that will eject and to obtain the instruction of USB device sequence number, obtain the sequence number of the target storage device that ejects with the disk partition interlock that will eject;
Obtain all disk partition on the client, and the type that obtains respectively in all disk partition is the equipment handle of the disk partition to be filtered of USB memory device, by the instruction of obtaining the USB device sequence number to the equipment handle transmission of disk partition to be filtered respectively, obtain the sequence number of the USB device at all disk partition to be filtered places;
Determine to be all disk partition on this target storage device with the disk partition that will the eject disk subregion has same sequence number.
9. a client device is characterized in that, comprising: such as each described device among the claim 5-8.
CN201210348366.9A 2012-09-18 2012-09-18 Method and device for protecting data on storage equipment Active CN102866964B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201210348366.9A CN102866964B (en) 2012-09-18 2012-09-18 Method and device for protecting data on storage equipment
CN201510146242.6A CN104700048B (en) 2012-09-18 2012-09-18 The method and device of data in a kind of protection storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210348366.9A CN102866964B (en) 2012-09-18 2012-09-18 Method and device for protecting data on storage equipment

Related Child Applications (1)

Application Number Title Priority Date Filing Date
CN201510146242.6A Division CN104700048B (en) 2012-09-18 2012-09-18 The method and device of data in a kind of protection storage device

Publications (2)

Publication Number Publication Date
CN102866964A true CN102866964A (en) 2013-01-09
CN102866964B CN102866964B (en) 2015-06-03

Family

ID=47445842

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210348366.9A Active CN102866964B (en) 2012-09-18 2012-09-18 Method and device for protecting data on storage equipment

Country Status (1)

Country Link
CN (1) CN102866964B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461489A (en) * 2013-09-22 2015-03-25 安一恒通(北京)科技有限公司 Method and device for quickly popping up removable device and user device
CN104731633A (en) * 2015-04-15 2015-06-24 上海斐讯数据通信技术有限公司 Method and system for rolling back in Linux system after failure of uninstalling of multi-partition storage equipment
CN109074301A (en) * 2017-03-13 2018-12-21 华为技术有限公司 A kind of data processing method and device
CN113342846A (en) * 2021-06-29 2021-09-03 福州外语外贸学院 Big data-based early warning and control reminding method and device and computer equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050144405A1 (en) * 2003-12-24 2005-06-30 Mark Doran Method to qualify access to a block storage device via augmentation of the device's controller and firmware flow
CN1877550A (en) * 2006-01-13 2006-12-13 深圳创维-Rgb电子有限公司 Method for implementing real-time hot-plug of USB memory under TV embedded Linux system
CN101957725A (en) * 2009-07-13 2011-01-26 联想(北京)有限公司 Method for managing external equipment of computer
CN102567233A (en) * 2011-12-23 2012-07-11 福建升腾资讯有限公司 Data protection method of USB storage device based on magnetic disc virtual technology
CN102662882A (en) * 2012-03-30 2012-09-12 奇智软件(北京)有限公司 Method and device for unloading mobile storage equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050144405A1 (en) * 2003-12-24 2005-06-30 Mark Doran Method to qualify access to a block storage device via augmentation of the device's controller and firmware flow
CN1877550A (en) * 2006-01-13 2006-12-13 深圳创维-Rgb电子有限公司 Method for implementing real-time hot-plug of USB memory under TV embedded Linux system
CN101957725A (en) * 2009-07-13 2011-01-26 联想(北京)有限公司 Method for managing external equipment of computer
CN102567233A (en) * 2011-12-23 2012-07-11 福建升腾资讯有限公司 Data protection method of USB storage device based on magnetic disc virtual technology
CN102662882A (en) * 2012-03-30 2012-09-12 奇智软件(北京)有限公司 Method and device for unloading mobile storage equipment

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104461489A (en) * 2013-09-22 2015-03-25 安一恒通(北京)科技有限公司 Method and device for quickly popping up removable device and user device
CN104731633A (en) * 2015-04-15 2015-06-24 上海斐讯数据通信技术有限公司 Method and system for rolling back in Linux system after failure of uninstalling of multi-partition storage equipment
CN104731633B (en) * 2015-04-15 2018-02-13 上海斐讯数据通信技术有限公司 Rollback method and system after multi partition storage device dismount failure under a kind of linux system
CN109074301A (en) * 2017-03-13 2018-12-21 华为技术有限公司 A kind of data processing method and device
CN109074301B (en) * 2017-03-13 2021-10-08 荣耀终端有限公司 Data processing method and device
CN113342846A (en) * 2021-06-29 2021-09-03 福州外语外贸学院 Big data-based early warning and control reminding method and device and computer equipment
CN113342846B (en) * 2021-06-29 2024-03-19 福州外语外贸学院 Early warning handle control reminding method and device based on big data and computer equipment

Also Published As

Publication number Publication date
CN102866964B (en) 2015-06-03

Similar Documents

Publication Publication Date Title
US9183268B2 (en) Partition level backup and restore of a massively parallel processing database
CN103902623B (en) Method and system for the accessing file in storage system
CN101937372B (en) Exception processing method and device
CN104156380B (en) A kind of distributed memory hash indexing method and system
CN101651576B (en) Alarm information processing method and system
CN103294675A (en) Method and device for updating data in distributed storage system
WO2014060881A1 (en) Consistency group management
CN106844089B (en) Method and equipment for recovering tree data storage
CN103198122B (en) Restart the method and apparatus of memory database
JP6996812B2 (en) How to process data blocks in a distributed database, programs, and devices
CN103544077A (en) Data processing method and device and shared memory device
CN103379129A (en) Data synchronization method, servers and distributed system
CN103559301A (en) Method of data update, database trigger and SE (search engine)
CN102866964B (en) Method and device for protecting data on storage equipment
EP3438845A1 (en) Data updating method and device for a distributed database system
CN108089926A (en) A kind of method, apparatus, equipment and readable storage medium storing program for executing for obtaining distributed lock
CN102497286A (en) Method and device for matching management information base (MIB)
CN103729166A (en) Method, device and system for determining thread relation of program
CN106815318B (en) Clustering method and system for time sequence database
CN109101595B (en) Information query method, device, equipment and computer readable storage medium
CN106970851A (en) Method and apparatus for disk detection process in distributed file system
CN109325005A (en) A kind of data processing method and electronic equipment
CN102004761B (en) Data storage method and system
CN104700048A (en) Method and device for protecting data on storage equipment
CN109933460A (en) Data snapshot method and device

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220712

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co., Ltd