The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome the problems referred to above or at least in part solve on
State the method and corresponding device of the structure virtual disk of problem, and the data processing method method and phase based on virtual disk
The device answered.
According to an aspect of of the present present invention, there is provided a kind of method of structure virtual disk, including:
A memory block in storage device is mapped as into virtual disk partition;
For virtual disk partition definition include the file memory format of file header, multiple data partitions and data block with
And the data processing type that data block is processed, wherein, the file header records the information of each data partition, described each
The information of individual data partitioned record data block, the data block is used for the content of data storage file;
Process is formatted to the virtual disk partition using the file memory format, to build virtual disk.
Alternatively, it is described that a memory block in storage device is mapped as into virtual disk partition, including:
Volume file is created on a storage device, is virtual disk partition by the volume File Mapping for creating.
Alternatively, it is virtual disk partition by the volume File Mapping for creating, including:
The disk unit object of establishment virtual disk partition, and the extension object of the disk unit object is set up, wherein,
The extension object is used to preserve volume file corresponding with the virtual disk partition;
The volume file for creating is preserved to the extension object.
Alternatively, the volume file is single file.
Alternatively, the file header also records the data processed described each data partition recorded data block
Process type.
Alternatively, described each data partition also records the data processing class processed itself recorded data block
Type.
Alternatively, one or more in described each data partition are also recorded to other data partition recorded data
The data processing type that block is processed.
Alternatively, the data processing type includes encryption.
Alternatively, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
Alternatively, when the data processing type includes multiple, methods described also includes:
Each data processing type is together in series according to processing sequence to form pipeline, and is recorded in the file header or institute
State data partition.
Alternatively, the information of the data partition includes data partition in the position of the volume file, the data block
Information includes data block in the position of the volume file.
Alternatively, the storage device is non-volatile memory device.
According to another aspect of the present invention, a kind of data processing method based on virtual disk is additionally provided, including:
Acquisition will write the data file of non-volatile memory device, by the data file segmentation into multiple source datas
Block;
Multiple data partitions that the plurality of source block is distributed to the virtual disk for building, wherein, each data
Partitioned record distributes to one or more source blocks of itself;
For described each data partition, obtain at the data processed the source block that the data partition is recorded
Reason type, and the source block that the data partition is recorded is processed using the data processing type for obtaining, processed
Target data block afterwards;
Target data block after the process is stored into the virtual disk data partition recorded data block.
Alternatively, the acquisition will write the data file of non-volatile memory device, including:
Monitor the instruction that data file is write non-volatile memory device;
When the instruction is monitored, the instruction is intercepted and parsed, obtain the data file.
Alternatively, the acquisition will write the data file of non-volatile memory device, including:
Receive the instruction that data file is write non-volatile memory device;
The instruction is parsed, the data file is obtained.
Alternatively, the data processing type processed the source block that the data partition is recorded is obtained, including:
The number processed the source block that the data partition is recorded is obtained from the file header of the virtual disk
According to process type;Or
Obtain from the data partition or other data partitions and the source block that the data partition is recorded is processed
Data processing type.
Alternatively, the data processing type includes encryption.
Alternatively, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
Alternatively, when the data processing type includes multiple, each data processing type is connected according to processing sequence
Get up to form pipeline, and record file header or data partition in the virtual disk, then obtain and the data partition is recorded
The data processing type that processed of source block, including:
The pipeline is obtained from the file header of the virtual disk;Or
The pipeline is obtained from the data partition or other data partitions.
Alternatively, the data file is from local volatile storage devices or outside.
Alternatively, the target data block after by the process stores to the virtual disk data partition and is recorded
Data block after, methods described also includes:
When the read requests for reading the data file are received, examined and seized from the virtual magnetic according to the read requests
Take corresponding multiple target data blocks;
Multiple data partitions according to belonging to the plurality of target data block, it is determined that carrying out to the plurality of target data block
The target data of process processes type;
Type is processed according to the target data to process the plurality of target data block, obtain the plurality of target
The corresponding source block of data block, and return to reading side.
Alternatively, the multiple data partitions according to belonging to the plurality of target data block, it is determined that to the plurality of number of targets
The target data processed according to block processes type, including:
Multiple data partitions according to belonging to the plurality of target data block, obtain the source recorded to each data partition
The data processing type that data block is processed;
According to the data processing type for obtaining, it is determined that the target data processed the plurality of target data block
Process type.
Alternatively, when the data processing type is encryption, it is decryption processing that the target data processes type.
Alternatively, process type according to the target data to process the plurality of target data block, including:
Key is obtained from the read requests;
Process is decrypted to the plurality of target data block using the key.
Alternatively, the data processing type processed the source block that each data partition is recorded is obtained, including:
Obtain what the source block that each data partition is recorded was processed from the file header of the virtual disk
Data processing type;Or
Obtain at the source block recorded to each data partition from the data partition or other data partitions
The data processing type of reason.
Alternatively, before the plurality of source block to be distributed the multiple data partitions to the virtual disk for building,
It is described also to include:
Identity to operating the operator of the virtual disk is verified;
After being verified, the virtual disk is loaded.
Alternatively, methods described is applied to the driver of the virtual disk.
According to another aspect of the present invention, a kind of device of structure virtual disk is additionally provided, including:
Mapping block, is suitable to for the memory block in storage device to be mapped as virtual disk partition;
Definition module, being suitable for the virtual disk partition definition includes file header, multiple data partitions and data block
File memory format and the data processing type that data block is processed, wherein, the file header records each data point
The information in area, the information of each data partition record data block, the data block is used for the content of data storage file;
Module is built, is suitable to be formatted process to the virtual disk partition using the file memory format, with
Build virtual disk.
Alternatively, the mapping block is further adapted for:
Volume file is created on a storage device, is virtual disk partition by the volume File Mapping for creating.
Alternatively, the mapping block is further adapted for:
The disk unit object of establishment virtual disk partition, and the extension object of the disk unit object is set up, wherein,
The extension object is used to preserve volume file corresponding with the virtual disk partition;
The volume file for creating is preserved to the extension object.
Alternatively, the volume file is single file.
Alternatively, the file header also records the data processed described each data partition recorded data block
Process type.
Alternatively, described each data partition also records the data processing class processed itself recorded data block
Type.
Alternatively, one or more in described each data partition are also recorded to other data partition recorded data
The data processing type that block is processed.
Alternatively, the data processing type includes encryption.
Alternatively, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
Alternatively, the definition module is further adapted for:
When the data processing type includes multiple, each data processing type is together in series shape according to processing sequence
Into pipeline, and record in the file header or the data partition.
Alternatively, the information of the data partition includes data partition in the position of the volume file, the data block
Information includes data block in the position of the volume file.
Alternatively, the storage device is non-volatile memory device.
According to another aspect of the present invention, a kind of data processing equipment based on virtual disk is additionally provided, including:
First acquisition module, is suitable to obtain the data file that will write non-volatile memory device;
Segmentation module, is suitable to the data file segmentation into multiple source datas block;
Distribute module, is suitable to the multiple data partitions for distributing the plurality of source block to the virtual disk for building,
Wherein, each data partition record distribution is to one or more source blocks of itself;
First processing module, is suitable to, for described each data partition, obtain the source data for recording the data partition
The data processing type that block is processed, and the data partition is recorded source block using the data processing type for obtaining
Processed, the target data block after being processed;
Memory module, is suitable to for the target data block after the process to store to the virtual disk data partition institute
The data block of record.
Alternatively, first acquisition module is further adapted for:
Monitor the instruction that data file is write non-volatile memory device;
When the instruction is monitored, the instruction is intercepted and parsed, obtain the data file.
Alternatively, first acquisition module is further adapted for:
Receive the instruction that data file is write non-volatile memory device;
The instruction is parsed, the data file is obtained.
Alternatively, the first processing module is further adapted for:
The number processed the source block that the data partition is recorded is obtained from the file header of the virtual disk
According to process type;Or
Obtain from the data partition or other data partitions and the source block that the data partition is recorded is processed
Data processing type.
Alternatively, the data processing type includes encryption.
Alternatively, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
Alternatively, the first processing module is further adapted for:
When the data processing type includes multiple, each data processing type is together in series to be formed according to processing sequence
Pipeline, and record file header or data partition in the virtual disk, then institute is obtained from the file header of the virtual disk
State pipeline;Or
The pipeline is obtained from the data partition or other data partitions.
Alternatively, the data file is from local volatile storage devices or outside.
Alternatively, described device also includes:
Second acquisition module, is suitable to the target data block after the process be stored to described virtual in the memory module
On disk after the data partition recorded data block, when the read requests for reading the data file are received, according to
The read requests obtain corresponding multiple target data blocks from the virtual disk;
Determining module, the multiple data partitions being suitable to according to belonging to the plurality of target data block, it is determined that to the plurality of
The target data that target data block is processed processes type;
Second processing module, be suitable to according to the target data process type to the plurality of target data block at
Reason, obtains the corresponding source block of the plurality of target data block, and returns to reading side.
Alternatively, the determining module is further adapted for:
Multiple data partitions according to belonging to the plurality of target data block, obtain the source recorded to each data partition
The data processing type that data block is processed;
According to the data processing type for obtaining, it is determined that the target data processed the plurality of target data block
Process type.
Alternatively, when the data processing type is encryption, it is decryption processing that the target data processes type.
Alternatively, the Second processing module is further adapted for:
Key is obtained from the read requests;
Process is decrypted to the plurality of target data block using the key.
Alternatively, the determining module is further adapted for:
Obtain what the source block that each data partition is recorded was processed from the file header of the virtual disk
Data processing type;Or
Obtain at the source block recorded to each data partition from the data partition or other data partitions
The data processing type of reason.
Alternatively, described device also includes:
Load-on module, is suitable to distribute the plurality of source block to the virtual disk for building in the distribute module
Before multiple data partitions,
Identity to operating the operator of the virtual disk is verified;
After being verified, the virtual disk is loaded.
Alternatively, described device is applied to the driver of the virtual disk.
The embodiment of the present invention is written and read process to data file by building virtual disk, does not interfere with original operation
Process logic between the file system and disk driver of system, more flexibly.Implement, set locally stored
Standby one piece of upper memory block is mapped as virtual disk partition, and virtual disk partition is carried out using self-defining file memory format
Formatting processes to build virtual disk.Further, in user-defined file storage format, definition has file header, many numbers
According to subregion and data block, wherein file header records the information of each data partition, the information of each data partition record data block
It is convenient and data block is used for the content of data storage file, realizes the memory module of the data block under multiple data partitions
Tissue data, and being capable of on-demand loading and random read-write.Also, the embodiment of the present invention also defines what data block was processed
Data processing type, when exist data file need write local memory device when, then dividing processing is carried out to data file and is obtained
To multiple source datas block, multiple source datas block can be processed according to the data processing type of definition, after process
Target data block is stored by the data block on virtual disk;When reading side needs to read data file from virtual disk
When, then process type according to the corresponding target of data processing type and target data block is processed, by the source number after process
Reading side is submitted to according to block.Further, since the data block on virtual disk is organized according to data partition, thus for each
Data partition, can define the data processing type that the data block for recording or organizing to the data partition is processed, so as to
One data file can be processed using various data processing types, flexible, autgmentability be processed by force, especially in encryption
In process, one data file is encrypted using various cipher modes can further improve security.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention,
And can be practiced according to the content of specification, and in order to allow the above and other objects of the present invention, feature and advantage can
Become apparent, below especially exemplified by the specific embodiment of the present invention.
According to the detailed description below in conjunction with accompanying drawing to the specific embodiment of the invention, those skilled in the art will be brighter
Above-mentioned and other purposes, the advantages and features of the present invention.
Specific embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although showing the disclosure in accompanying drawing
Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure and should not be by embodiments set forth here
Limited.On the contrary, there is provided these embodiments are able to be best understood from the disclosure, and can be by the scope of the present disclosure
Complete conveys to those skilled in the art.
To solve above-mentioned technical problem, a kind of method of structure virtual disk is embodiments provided, can be applied
On the terminal devices such as computer, smart mobile phone, panel computer.Fig. 1 shows according to an embodiment of the invention structure virtually
The flow chart of the method for disk.As shown in figure 1, the method at least comprises the following steps S102 to step S106.
Step S102, by the memory block in storage device virtual disk partition is mapped as.
Step S104, is that virtual disk partition definition includes that the file of file header, multiple data partitions and data block is stored
Form and the data processing type that data block is processed, wherein, file header records the information of each data partition, each
The information of data partition record data block, data block is used for the content of data storage file.
Step S106, using file memory format process is formatted to virtual disk partition, to build virtual disk.
The embodiment of the present invention is written and read process to data file by building virtual disk, does not interfere with original operation
Process logic between the file system and disk driver of system, more flexibly.Implement, set locally stored
Standby one piece of upper memory block is mapped as virtual disk partition, and virtual disk partition is carried out using self-defining file memory format
Formatting processes to build virtual disk.Further, in user-defined file storage format, definition has file header, many numbers
According to subregion and data block, wherein file header records the information of each data partition, the information of each data partition record data block
It is convenient and data block is used for the content of data storage file, realizes the memory module of the data block under multiple data partitions
Tissue data, and being capable of on-demand loading and random read-write.Also, the embodiment of the present invention also defines what data block was processed
Data processing type, when exist data file need write local memory device when, then dividing processing is carried out to data file and is obtained
To multiple source datas block, multiple source datas block can be processed according to the data processing type of definition, after process
Target data block is stored by the data block on virtual disk;When reading side needs to read data file from virtual disk
When, then process type according to the corresponding target of data processing type and target data block is processed, by the source number after process
Reading side is submitted to according to block.Further, since the data block on virtual disk is organized according to data partition, thus for each
Data partition, can define the data processing type that the data block for recording or organizing to the data partition is processed, so as to
One data file can be processed using various data processing types, flexible, autgmentability be processed by force, especially in encryption
In process, one data file is encrypted using various cipher modes can further improve security.
In the alternative embodiment of the present invention, the memory block in storage device is mapped as virtually in above step S102
Disk partition may be embodied as creating volume file on a storage device, be virtual disk partition by the volume File Mapping for creating, this
Sample can perform file operation by virtual disk partition to rolling up file.Here storage device can be that non-volatile memories set
It is standby, that is, refer to that the data of the inside will not lose when the equipment of closing a terminal or emergentness, accidentality close a terminal equipment
Lose, such as hard disk, SD (Secure Digital, secure digital) cards etc..
When the volume File Mapping that will be created is virtual disk partition, a kind of optional side is embodiments provided
Case, in this scenario, can create the disk unit object of virtual disk partition, and it is right to set up the extension of disk unit object
As, extension object here is used to preserving volume file corresponding with virtual disk partition, so by the volume file of establishment preserve to
Extension object.Safeguard for convenience, volume file can be single file, so all information are stored in single file, nothing
Use by needing extraneous information.
Above step S104 defines the file including file header, multiple data partitions and data block for virtual disk partition
Storage format, wherein file header record each data partition information (quantity, mark, record data such as data partition it is big
Position etc. little, in volume file), the information of each data partition record data block (mark, size such as data block, in volume
Position of file etc.), data block is used for the content of data storage file, i.e. data file segmentation is obtained for storage
Multiple source datas block carries out the content of the target data block after the process of data processing type.
The principle schematic of the file memory format of definition is illustrated in figure 2, in fig. 2, Section#1 and Section#
2 is schematic two data partitions, and Block#1, Block#2, Block#3, Block#4, Block#5 are schematic five
Data block, file header records the information of each data partition, data partition Section#1 record data block Block#1 and
The information of Block#2, the information of data partition Section#2 record data block Block#3, Block#4 and Block#5, each
Data block Block#1, Block#2, Block#3, Block#4 and Block#5 are used for the content of data storage file.Need
Bright, the quantity of data partition and data block shown in Fig. 2 is only illustrative, and does not limit the invention, in reality
In the application of border, can according to demand or the situation of memory block determines multiple data partitions and data block.
In the alternative embodiment of the present invention, in each data partition, the side of key-value (key-value) can be adopted
Formula carrys out the information of record data block, can facilitate storage configuration information.It is possible to further to each data partition flag type
Mark, such as meta-data region, file data area, signed data area, realize separating storage, facilitate application call side to organize data.
Except defining file memory format in above step S104, also define at the data processed data block
Reason type.Specifically, data processing type can include being encrypted using AES, and AES here can be with
It is RC4 or SM4 etc..Additionally, data processing type can also include caching process, compression process, mirror image processing etc., the present invention is not
It is limited to this.Here, the concrete Processing Algorithm of each data processing type can be chosen according to the actual requirements, and the present invention is implemented
Example is not restricted to this.
In the alternative embodiment of the present invention, the data processing type of definition can be recorded in volume file, it is also possible to
Other single file records.When data processing type record is when rolling up in file, can record to each data in file header
The data processing type that subregion recorded data block is processed, it is so, each except parsing in resolution file head
The quantity of the information of individual data partition, such as data partition, mark, the size of record data, can also parse to each
The data processing type that data partition recorded data block is processed.Here, to each data partition recorded data
The data processing type that block is processed, i.e. dividing processing is carried out to data file and obtains multiple source datas block, by multiple source numbers
Distribute at most individual data partition, one or more source blocks of a data partitioned record distribution, to each data point according to block
The data processing type that the source block that area is recorded is processed.The source block that each data partition is recorded according to
After corresponding data processing type is processed, the target data block after process can be stored into each data block.
In the alternative embodiment of the present invention, when data processing type record is when rolling up in file, can be with each number
According to the data processing type that partitioned record is processed itself recorded data block, or can be with each data partition
In one or more in record the data processing type processed other data partition recorded data blocks.
By taking the storage format shown in Fig. 2 as an example, can record in file header to data partition Section#1 and
The data processing type that Section#2 recorded data blocks are processed;Can also record to its own in Section#1
The data processing type that recorded data block Block#1 and Block#2 are processed, records to it certainly in Section#2
The data processing type that body recorded data block Block#3, Block#4 and Block#5 are processed;Or, can be with
Record in Section#1 to Section#2 recorded data block Block#3, Block#4 and Block#5 process
Data processing type.Here, the data processing class for Section#1 and Section#2 recorded data blocks being processed
Type, the source block in referring to Section#1 recorded data blocks (that is, the data block in physical significance) will be stored
The data processing type for being processed, that is to say, that for any source block obtained by data file segmentation, the source data
Block is allocated to Section#1 or Section#2, is stored by Section#1 or Section#2 recorded data blocks,
The source block is processed according to the data processing type on Section#1 or Section#2 before storing, is being obtained
After target data block after process, target data block is stored into the data block to corresponding physical significance.
In the alternative embodiment of the present invention, when data processing type includes multiple, can be by each data processing class
Type is together in series to form filter (filtration) pipeline according to processing sequence, and records in file header or data partition.For example, data
It is to be processed using RC4 encryptions and compression to process type, then be together in series to form pipeline, so as to realize at function superposition
Reason.Again for example, data processing type be caching process, compression process, using RC4 encryptions, then be together in series to be formed
Pipeline, so as to realize function overlap-add procedure.
Process is formatted to virtual disk partition using file memory format in above step S106, is to virtual
Disk partition carries out a kind of initialized operation.Generally, low-level formatting and high-level formatting are divided into the form of disk, it is low
It is the operation that division cylinder, magnetic track, sector are carried out to disk that level is formatted.Also known as logical formatting, it is referred to high-level formatting
The file system (such as common FAT12, FAT16, FAT32, NTFS, EXT2, EXT3) selected according to user, in the spy of disk
Region write particular data is determined, to reach initialization disk or disk partition, remove All Files in former disk or disk partition
One operation.High-level formatting is included to the rewriting of partition table respective regions, the text selected according to user in MBR
Part system, mark in subregion it is a piece of for depositing file allocation table, catalogue listing etc. for the disk space of file management, so as to
User uses the partition management file.Being formatted to virtual disk partition for referring in the embodiment of the present invention is primarily referred to as height
Level format, i.e., using self-defining file memory format virtual disk partition specific region write particular data, and
Mark in virtual disk partition it is a piece of for depositing file allocation table, catalogue listing etc. for the disk space of file management, so as to
User uses the partition management file.
After virtual disk described above is constructed, the virtual disk that the embodiment of the present invention is also based on building is carried out
Data processing.Fig. 3 shows the flow chart of the data processing method based on virtual disk according to an embodiment of the invention.As schemed
Shown in 3, the method at least comprises the following steps S302 to step S308.
Step S302, acquisition will write the data file of non-volatile memory device, by data file segmentation into multiple
Source block.
Step S304, multiple data partitions that multiple source datas block is distributed to the virtual disk for building, wherein, each
Data partition record distribution is to one or more source blocks of itself.
Step S306, for each data partition, what acquisition was processed the source block that the data partition is recorded
Data processing type, and the source block that the data partition is recorded is processed using the data processing type for obtaining, obtain
Target data block to after process.
Step S308, by the target data block after process the data partition recorded data is stored to virtual disk
Block.
In embodiments of the present invention, when exist data file need write local memory device when, then data file is entered
Row dividing processing obtains multiple source datas block, can according to self-defining data processing type to multiple source datas block at
Reason, the target data block after process is stored by the data block on virtual disk.Also, due on virtual disk
Data block is organized according to data partition, mutually isolated between them, thus for each data partition, can be defined to this
The data processing type that the data block that data partition recorded or organized is processed, such that it is able to using various data processing classes
Type is processed a data file, flexible, autgmentability is processed by force, especially in encryption, using various encryption sides
Formula is encrypted to a data file and can further improve security.
The data file that will write non-volatile memory device is obtained in above step S302, the embodiment of the present invention is provided
A kind of optional scheme, in this scenario, can monitor the instruction that data file is write non-volatile memory device, work as prison
When measuring instruction, intercept and analysis instruction, obtain data file.The alternative embodiment can be applied in data file from volatibility
The scene of storage device (such as internal memory, caching) write non-volatile memory device, it is also possible to apply in data file from outside
(that is, the outside of terminal device, such as server) writes the scene of non-volatile memory device.Such as certain application (is such as absorbed in
Enterprise Mobile work exchanges the blue letter of collaboration with inside and outside), there is the interaction message between contact person in running, need
Interaction message is written to into disk from internal memory, then can be monitored by the embodiment of the present invention and data file is write into non-volatile depositing
The instruction of storage equipment, when monitor by interaction message write disk instruction when, the instruction is intercepted, parse the instruction from
It is middle to obtain interaction message to be written.
The data file that will write non-volatile memory device is obtained in above step S302, the embodiment of the present invention is also carried
A kind of optional scheme is supplied, in this scenario, the finger that data file is write non-volatile memory device can have been directly received
Order, parses the instruction, obtains data file.Compared to the scheme for intercepting instruction mentioned above, difference is this programme,
This programme increased in above-mentioned application (such as blue letter) and process accordingly logic, i.e., when meeting pre-conditioned, by the line applied
Data file is write the instruction of non-volatile memory device by Cheng Shengcheng, and is submitted to the executive agent of this programme.Can
In the embodiment of choosing, the executive agent of this programme can be the driver of virtual disk.
Further, in step S302 by data file segmentation into multiple source datas block when, fixed length segmentation can be carried out, i.e.,
Original data file is cut into into fixed length block, facilitates operation independent, concrete fixed length length to enter according to the actual requirements
Row is arranged.
Step S302 by data file segmentation into after multiple source datas block, step S304 by multiple source datas block distribute
Multiple data partitions to the virtual disk for building, can be randomly assigned, it is also possible to be allocated according to specified order, or
Can also be allocated according to the idle condition of each data partition recorded data block, etc., the present invention is not limited this
System.For example, original data file is divided into multiple source datas block block1, block2 and block3, with depositing shown in Fig. 2
As a example by storage form, block1 can be distributed to data partition Section#1, block2 and block3 are distributed to data partition
Section#2;Or, it is also possible to block1, block2, block3 are all distributed to data partition Section#2.
As introduced above, when the data processing type record of definition is when rolling up in file, can record in file header, also may be used
To record in data partition, thus in above step S306, for each data partition, what acquisition was recorded to the data partition
The data processing type that source block is processed, the embodiment of the present invention can be obtained to the number from the file header of virtual disk
The data processing type that the source block recorded according to subregion is processed;Or from the data partition or other data partitions
The data processing type that acquisition is processed the source block that the data partition is recorded.Here data processing type can be with
Including being encrypted using AES, AES here can be RC4 or SM4 etc..Additionally, data processing type
Caching process, compression process, mirror image processing etc. can also be included, the invention is not restricted to this.Here, each data processing type
Concrete Processing Algorithm can be chosen according to the actual requirements, and the embodiment of the present invention is not restricted to this.
When data processing type includes multiple, each data processing type is together in series to form pipeline according to processing sequence
Record the file header or data partition in virtual disk.For example, data processing type is using at RC4 encryptions and compression
Reason, then be together in series to form pipeline, so as to realize function overlap-add procedure.Again for example, data processing type be caching process,
Compression process, using RC4 encryptions, then be together in series to form pipeline, so as to realize function overlap-add procedure.So, walk
Rapid S306, can be from virtual magnetic when the data processing type processed the source block that the data partition is recorded is obtained
The pipeline is obtained at the file header of disk, it is also possible to obtain the pipeline from the data partition or other data partitions.
By taking the storage format shown in Fig. 2 as an example, original data file be divided into multiple source datas block block1,
Block2 and block3, and block1 is distributed to data partition Section#1, block2 and block3 are distributed to data point
The corresponding data processing type of area Section#2, data partition Section#1 is using RC4 encryptions, data partition
The corresponding data processing types of Section#2 are first to cache, then using SM4 encryptions.So, RC4 is carried out to block1
Encryption, first caches to block2 and block3, then using SM4 encryptions.Finally, the target data for process being obtained
Block stores to virtual disk the data partition recorded data block, for example, can be by the block11 after processing block1
Store to Block#1, the block22 after processing block2 is stored to Block#3, after processing block3
Block33 is stored to Block#4.In actual applications, the specific algorithm of encryption can extend, you can neatly to adjust each
The specific algorithm encrypted on data partition.
The target data block after process is stored into virtual disk what the data partition was recorded in above step S308
After data block, the embodiment of the present invention can also be read to data.That is, when the reading for receiving reading data file
During request, corresponding multiple target data blocks are obtained from virtual disk according to read requests;Subsequently, according to multiple target data blocks
Affiliated multiple data partitions, it is determined that the target data processed multiple target data blocks processes type;Afterwards, according to mesh
Mark data processing type is processed multiple target data blocks, obtains the corresponding source block of multiple target data blocks, and is returned
Back to reading side.
In the alternative embodiment of the present invention, in the multiple data partitions according to belonging to multiple target data blocks, it is right to determine
Can be multiple according to belonging to multiple target data blocks when the target data that multiple target data blocks are processed processes type
Data partition, obtains the data processing type processed the source block that each data partition is recorded;And then basis is obtained
The data processing type for taking, it is determined that the target data processed multiple target data blocks processes type.
In an alternate embodiment of the invention, when data processing type be encryption when, target data process type for decryption at
Reason;When data processing type is processed for compression, it is decompression processing that target data processes type.That is, data processing class
It is relative that type and target data process type, and a side can be the inverse operation of the opposing party, and for example, data processing type is slow
Deposit, compress, encryption, then target data process type can for decryption, decompression, caching process.Further, in decryption processing
When, decruption key can be provided by reading side, i.e., multiple target data blocks are being processed according to target data process type
When, key can be obtained from read requests, and then process is decrypted to multiple target data blocks using key.
In an alternate embodiment of the invention, obtaining at the data processed the source block that each data partition is recorded
During reason type, can obtain what the source block that each data partition is recorded was processed from the file header of virtual disk
Data processing type;Or the source data that acquisition is recorded to each data partition from the data partition or other data partitions
The data processing type that block is processed.
In the alternative embodiment of the present invention, multiple source datas block is distributed to the virtual disk for building in step S304
Multiple data partitions before, the identity that will operate the operator of virtual disk can be verified, after being verified,
Loading virtual disk;When checking does not pass through, then the loading of virtual disk is not carried out.As such, it is possible to further improve virtual magnetic
The security of data in disk.
Data processing method based on virtual disk provided in an embodiment of the present invention can apply to the driving of virtual disk
Program.That is, between the file system and disk driver of original operating system, the driving journey of one layer of virtual disk is added
One piece of memory block on local memory device is mapped as virtual disk partition by sequence, the dish driving program of virtual magnetic, and user needs
The data file that encryption (or caching, compression, mirror image etc.) is stored all is stored by virtual disk partition, in virtual disk
Driver in dynamically to storage be encrypted to the file on disk.When user reads data text from virtual disk partition
During part, data are decrypted operation in the driver through virtual disk, and file is submitted to into user with plaintext version;When
The driver of virtual disk passes to device driver after being encrypted to sector data during user's write file, final number
According to this ciphertext form is stored on physical disk.The storage mode of this virtual disk partition is caused for the caller of upper strata
Enciphering/deciphering process in driver is transparent, simplifies the operation of user.What is deposited all the time on physical disk is sensitive
The ciphertext of information, the plaintext of sensitive information is at any time not in the form of plaintext in physical disk.Using layer-management
Program is responsible for the opening and closing of virtual disk partition, and only validated user could open virtual disk partition, and it is legal to carry out
File read-write.Also, the data block on virtual disk is organized according to data partition, mutually isolated between them, thus pin
To each data partition, the data processing class that the data block for recording or organizing to the data partition is processed can be defined
Type, such that it is able to process a data file using various data processing types, processes flexible, autgmentability by force, especially
It is that in encryption, one data file is encrypted using various cipher modes can further improve safety
Property.
The structure virtual disk of the embodiment of the present invention is discussed in detail below by a specific application scenarios and is based on
The virtual disk of structure carries out the method for data processing and realizes process.The embodiment is with the application (such as Lan Xin) on smart mobile phone
Store and read as a example by document data.
First, virtual disk is built.
Single volume file is created in the storage device (such as outside SD card or built in memory device) of smart mobile phone, and will wound
The single volume File Mapping built is virtual disk partition.
Blue courier preserves document data with two Section, wherein:
Section#1 is meta-data region, the main configuration information for preserving filter pipelines, to reduce pipeline;
Section#2 is document data area, the main particular content for preserving original text file data, and filter is configured to add
Close, specific AES can be RC4 or SM4 etc., embodiment of the present invention not limited to this.
Data partition Section#1 and Section#2 each record the information of one or more data blocks, each data block
The particular content of store document data.
Process is formatted to virtual disk partition using self-defining above-mentioned file memory format, to build virtual magnetic
Disk.
Secondly, the virtual disk based on above-mentioned structure carries out the storage process of document data.
Blue believer in a certain religion's service end downloads document data, and document data is write into the virtual disk of above-mentioned structure, bright so as to accomplish
Text does not land.Specifically, document data is write the instruction of non-volatile memory device for monitoring, when instruction is monitored, is intercepted
And analysis instruction, obtain document data.Subsequently, document data is divided into into multiple source datas block, by the distribution of multiple source datas block
Data partition Section#2 to virtual disk, the configuration information of filter pipelines, construction are read from Section#1
Filter pipelines (encryption).Further, multiple source datas block is processed using the filter pipelines of construction, is processed
Target data block afterwards, the target data block after process is stored in each data block to Section#2, and finally closing should
Virtual disk.
Again, document data is read.
Loading virtual disk, can verify here to the identity of operator, and virtual disk is loaded after being verified,
The security of data in virtual disk can be improved.
The configuration information of filter pipelines is read from data partition Section#1, then opens Section#2, and constructed
Filter pipelines, carry out read-write and prepare.Indigo plant letter can adjust document reader, generation that the data of needs are read from virtual disk
Read request, the file system driver of original operating system receives User space, and (document reader is in User space, original
The file system driver of operating system be in kernel mode) read request, read request is issued to into the driving journey of virtual disk
Sequence, and then these read requests are mapped in corresponding data block, and it is decrypted, so as to realize random read take.Finally,
After data are read, by data content exposure to user.
The method of the structure virtual disk provided based on each embodiment above, based on same inventive concept, the present invention is real
Apply example and additionally provide a kind of device of structure virtual disk.
Fig. 4 shows the structural representation of the device of structure virtual disk according to an embodiment of the invention.Such as Fig. 4 institutes
Show, the device can at least include mapping block 410, definition module 420 and build module 430.
Now introduce each composition or the function and each several part of device of the device of the structure virtual disk of the embodiment of the present invention
Between annexation:
Mapping block 410, is suitable to for the memory block in storage device to be mapped as virtual disk partition;
Definition module 420, is coupled with mapping block 410, be suitable for virtual disk partition definition include file header,
The file memory format of multiple data partitions and data block and the data processing type that data block is processed, wherein, institute
The information that file header records each data partition is stated, the information of each data partition record data block, the data block is used
In the content of data storage file;
Module 430 is built, is coupled with definition module 420, be suitable to using the file memory format to the virtual magnetic
Disk subregion is formatted process, to build virtual disk.
In an embodiment of the present invention, above-mentioned mapping block 410 is further adapted for:
Volume file is created on a storage device, is virtual disk partition by the volume File Mapping for creating.
In an embodiment of the present invention, above-mentioned mapping block 410 is further adapted for:
The disk unit object of establishment virtual disk partition, and the extension object of the disk unit object is set up, wherein,
The extension object is used to preserve volume file corresponding with the virtual disk partition;
The volume file for creating is preserved to the extension object.
In an embodiment of the present invention, the volume file is single file.
In an embodiment of the present invention, the file header also records and described each data partition recorded data block is entered
The data processing type that row is processed.
In an embodiment of the present invention, described each data partition also records and itself recorded data block is processed
Data processing type.
In an embodiment of the present invention, one or more in described each data partition are also recorded to other data partitions
The data processing type that recorded data block is processed.
In an embodiment of the present invention, the data processing type includes encryption.
In an embodiment of the present invention, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
In an embodiment of the present invention, the definition module is further adapted for:
When the data processing type includes multiple, each data processing type is together in series shape according to processing sequence
Into pipeline, and record in the file header or the data partition.
In an embodiment of the present invention, the information of the data partition includes data partition in the position of the volume file,
The information of the data block includes data block in the position of the volume file.
In an embodiment of the present invention, the storage device is non-volatile memory device.
Accordingly, the embodiment of the present invention additionally provides a kind of data processing equipment based on virtual disk.Fig. 5 shows root
According to the structural representation of the data processing equipment based on virtual disk of one embodiment of the invention.As shown in figure 5, the device is extremely
The first acquisition module 510, segmentation module 520, distribute module 530, first processing module 540 and memory module can be included less
550。
Now introduce each composition of the data processing equipment based on virtual disk of the embodiment of the present invention or the function of device with
And the annexation between each several part:
First acquisition module 510, is suitable to obtain the data file that will write non-volatile memory device;
Segmentation module 520, is coupled with the first acquisition module 510, is suitable to the data file segmentation into multiple source numbers
According to block;
Distribute module 530, is coupled with segmentation module 520, is suitable to distribute the plurality of source block to the void for building
Intend the multiple data partitions on disk, wherein, each data partition record distribution is to one or more source blocks of itself;
First processing module 540, is coupled with distribute module 530, is suitable to, for described each data partition, obtain to this
The data processing type that the source block that data partition is recorded is processed, and using the data processing type for obtaining to the number
The source block recorded according to subregion is processed, the target data block after being processed;
Memory module 550, is coupled with first processing module 540, is suitable to store the target data block after the process
The data partition recorded data block to the virtual disk.
In an embodiment of the present invention, above-mentioned first acquisition module 510 is further adapted for:
Monitor the instruction that data file is write non-volatile memory device;
When the instruction is monitored, the instruction is intercepted and parsed, obtain the data file.
In an embodiment of the present invention, above-mentioned first acquisition module 510 is further adapted for:
Receive the instruction that data file is write non-volatile memory device;
The instruction is parsed, the data file is obtained.
In an embodiment of the present invention, above-mentioned first acquisition module 510 is further adapted for:
The number processed the source block that the data partition is recorded is obtained from the file header of the virtual disk
According to process type;Or
Obtain from the data partition or other data partitions and the source block that the data partition is recorded is processed
Data processing type.
In an embodiment of the present invention, the data processing type includes encryption.
In an embodiment of the present invention, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
In an embodiment of the present invention, above-mentioned first processing module 540 is further adapted for:
When the data processing type includes multiple, each data processing type is together in series to be formed according to processing sequence
Pipeline, and record file header or data partition in the virtual disk, then institute is obtained from the file header of the virtual disk
State pipeline;Or
The pipeline is obtained from the data partition or other data partitions.
In an embodiment of the present invention, the data file is from local volatile storage devices or outside.
In an embodiment of the present invention, as shown in fig. 6, the device that figure 5 above shows can also include:
Second acquisition module 610, is coupled with memory module 550, is suitable to the mesh after the process in memory module 550
Mark data block is stored to the virtual disk after the data partition recorded data block, and when receiving the data are read
During the read requests of file, corresponding multiple target data blocks are obtained from the virtual disk according to the read requests;
Determining module 620, is coupled with the second acquisition module 610, is suitable to according to belonging to the plurality of target data block
Multiple data partitions, it is determined that the target data processed the plurality of target data block processes type;
Second processing module 630, is coupled with determining module 620, is suitable to process type to institute according to the target data
State multiple target data blocks to be processed, obtain the corresponding source block of the plurality of target data block, and return to reading side.
In an embodiment of the present invention, above-mentioned determining module 620 is further adapted for:
Multiple data partitions according to belonging to the plurality of target data block, obtain the source recorded to each data partition
The data processing type that data block is processed;
According to the data processing type for obtaining, it is determined that the target data processed the plurality of target data block
Process type.
In an embodiment of the present invention, when the data processing type is encryption, the target data processes class
Type is decryption processing.
In an embodiment of the present invention, above-mentioned Second processing module 630 is further adapted for:
Key is obtained from the read requests;
Process is decrypted to the plurality of target data block using the key.
In an embodiment of the present invention, above-mentioned determining module 620 is further adapted for:
Obtain what the source block that each data partition is recorded was processed from the file header of the virtual disk
Data processing type;Or
Obtain at the source block recorded to each data partition from the data partition or other data partitions
The data processing type of reason.
In an embodiment of the present invention, as shown in fig. 6, the device that figure 5 above shows can also include:
Load-on module 640, is coupled with distribute module 530, is suitable to divide the plurality of source block in distribute module 530
Before being assigned to the multiple data partitions on the virtual disk of structure,
Identity to operating the operator of the virtual disk is verified;
After being verified, the virtual disk is loaded.
In an embodiment of the present invention, described device is applied to the driver of the virtual disk.
According to the combination of above-mentioned any one preferred embodiment or multiple preferred embodiments, the embodiment of the present invention can reach
Following beneficial effect:
The embodiment of the present invention is written and read process to data file by building virtual disk, does not interfere with original operation
Process logic between the file system and disk driver of system, more flexibly.Implement, set locally stored
Standby one piece of upper memory block is mapped as virtual disk partition, and virtual disk partition is carried out using self-defining file memory format
Formatting processes to build virtual disk.Further, in user-defined file storage format, definition has file header, many numbers
According to subregion and data block, wherein file header records the information of each data partition, the information of each data partition record data block
It is convenient and data block is used for the content of data storage file, realizes the memory module of the data block under multiple data partitions
Tissue data, and being capable of on-demand loading and random read-write.Also, the embodiment of the present invention also defines what data block was processed
Data processing type, when exist data file need write local memory device when, then dividing processing is carried out to data file and is obtained
To multiple source datas block, multiple source datas block can be processed according to the data processing type of definition, after process
Target data block is stored by the data block on virtual disk;When reading side needs to read data file from virtual disk
When, then process type according to the corresponding target of data processing type and target data block is processed, by the source number after process
Reading side is submitted to according to block.Further, since the data block on virtual disk is organized according to data partition, thus for each
Data partition, can define the data processing type that the data block for recording or organizing to the data partition is processed, so as to
One data file can be processed using various data processing types, flexible, autgmentability be processed by force, especially in encryption
In process, one data file is encrypted using various cipher modes can further improve security.
In specification mentioned herein, a large amount of details are illustrated.It is to be appreciated, however, that the enforcement of the present invention
Example can be put into practice in the case of without these details.In some instances, known method, structure is not been shown in detail
And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help understand one or more in each inventive aspect, exist
Above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together into single enforcement sometimes
In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor
The more features of feature that the application claims ratio of shield is expressly recited in each claim.More precisely, such as following
Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore,
Thus the claims for following specific embodiment are expressly incorporated in the specific embodiment, wherein each claim itself
All as the separate embodiments of the present invention.
Those skilled in the art are appreciated that can be carried out adaptively to the module in the equipment in embodiment
Change and they are arranged in one or more equipment different from the embodiment.Can be the module or list in embodiment
Unit or component are combined into a module or unit or component, and can be divided in addition multiple submodule or subelement or
Sub-component.In addition at least some in such feature and/or process or unit is excluded each other, can adopt any
Combine to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed
Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification is (including adjoint power
Profit is required, summary and accompanying drawing) disclosed in each feature can it is identical by offers, be equal to or the alternative features of similar purpose carry out generation
Replace.
Although additionally, it will be appreciated by those of skill in the art that some embodiments described herein include other embodiments
In included some features rather than further feature, but the combination of the feature of different embodiments means in of the invention
Within the scope of and form different embodiments.For example, in detail in the claims, embodiment required for protection one of arbitrarily
Can in any combination mode using.
The present invention all parts embodiment can be realized with hardware, or with one or more processor operation
Software module realize, or with combinations thereof realization.It will be understood by those of skill in the art that can use in practice
Microprocessor or digital signal processor (DSP) are realizing structure virtual disk device according to embodiments of the present invention and base
The some or all functions of some or all parts in the data processing equipment of virtual disk.It is of the invention acceptable real
It is now some or all equipment or program of device (for example, computer journey for performing method as described herein
Sequence and computer program).Such program for realizing the present invention can be stored on a computer-readable medium, or can be with
Form with one or more signal.Such signal can be downloaded from internet website and obtained, or in carrier letter
There is provided on number, or provide in any other form.
It should be noted that above-described embodiment the present invention will be described rather than limits the invention, and ability
Field technique personnel can design without departing from the scope of the appended claims alternative embodiment.In the claims,
Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" is not excluded the presence of not
Element listed in the claims or step.Word "a" or "an" before element does not exclude the presence of multiple such
Element.The present invention can come real by means of the hardware for including some different elements and by means of properly programmed computer
It is existing.If in the unit claim for listing equipment for drying, several in these devices can be by same hardware branch
To embody.The use of word first, second, and third does not indicate that any order.These words can be explained and be run after fame
Claim.
So far, although those skilled in the art will appreciate that detailed herein illustrate and describe multiple showing for the present invention
Example property embodiment, but, without departing from the spirit and scope of the present invention, still can be direct according to present disclosure
It is determined that or deriving many other variations or modifications for meeting the principle of the invention.Therefore, the scope of the present invention is understood that and recognizes
It is set to and covers all these other variations or modifications.
The one side of the embodiment of the present invention, there is provided A1, a kind of method of structure virtual disk, including:
A memory block in storage device is mapped as into virtual disk partition;
For virtual disk partition definition include the file memory format of file header, multiple data partitions and data block with
And the data processing type that data block is processed, wherein, the file header records the information of each data partition, described each
The information of individual data partitioned record data block, the data block is used for the content of data storage file;
Process is formatted to the virtual disk partition using the file memory format, to build virtual disk.
A2, the method according to A1, wherein, it is described that a memory block in storage device is mapped as into virtual disk partition,
Including:
Volume file is created on a storage device, is virtual disk partition by the volume File Mapping for creating.
A3, the method according to A2, wherein, it is virtual disk partition by the volume File Mapping for creating, including:
The disk unit object of establishment virtual disk partition, and the extension object of the disk unit object is set up, wherein,
The extension object is used to preserve volume file corresponding with the virtual disk partition;
The volume file for creating is preserved to the extension object.
A4, the method according to A2 or A3, wherein, the volume file is single file.
A5, the method according to any one of A1-A4, wherein, the file header is also recorded to described each data point
The data processing type that area's recorded data block is processed.
A6, the method according to any one of A1-A4, wherein, described each data partition is also recorded to be remembered to itself
The data processing type that the data block of record is processed.
A7, the method according to any one of A1-A4, wherein, one or more in described each data partition are also
The data processing type that record is processed other data partition recorded data blocks.
A8, the method according to any one of A1-A7, wherein, the data processing type includes encryption.
A9, the method according to A8, wherein, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
A10, the method according to A9, wherein, when the data processing type includes multiple, methods described is also wrapped
Include:
Each data processing type is together in series according to processing sequence to form pipeline, and is recorded in the file header or institute
State data partition.
A11, the method according to any one of A1-A10, wherein, the information of the data partition includes data partition
In the position of the volume file, the information of the data block includes data block in the position of the volume file.
A12, the method according to any one of A1-A11, wherein, the storage device is non-volatile memory device.
The another aspect of the embodiment of the present invention, additionally provides B13, a kind of data processing method based on virtual disk, bag
Include:
Acquisition will write the data file of non-volatile memory device, by the data file segmentation into multiple source datas
Block;
Multiple data partitions that the plurality of source block is distributed to the virtual disk for building, wherein, each data
Partitioned record distributes to one or more source blocks of itself;
For described each data partition, obtain at the data processed the source block that the data partition is recorded
Reason type, and the source block that the data partition is recorded is processed using the data processing type for obtaining, processed
Target data block afterwards;
Target data block after the process is stored into the virtual disk data partition recorded data block.
B14, the method according to B13, wherein, the acquisition will write the data text of non-volatile memory device
Part, including:
Monitor the instruction that data file is write non-volatile memory device;
When the instruction is monitored, the instruction is intercepted and parsed, obtain the data file.
B15, the method according to B13, wherein, the acquisition will write the data text of non-volatile memory device
Part, including:
Receive the instruction that data file is write non-volatile memory device;
The instruction is parsed, the data file is obtained.
B16, the method according to any one of B13-B15, wherein, obtain the source data recorded to the data partition
The data processing type that block is processed, including:
The number processed the source block that the data partition is recorded is obtained from the file header of the virtual disk
According to process type;Or
Obtain from the data partition or other data partitions and the source block that the data partition is recorded is processed
Data processing type.
B17, the method according to any one of B13-B16, wherein, the data processing type includes encryption.
B18, the method according to B17, wherein, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
B19, the method according to B18, wherein, when the data processing type includes multiple, each data processing
Type is together in series to form pipeline according to processing sequence, and records file header or data partition in the virtual disk, then obtain
The data processing type that the source block recorded to the data partition is processed is taken, including:
The pipeline is obtained from the file header of the virtual disk;Or
The pipeline is obtained from the data partition or other data partitions.
B20, the method according to any one of B13-B19, wherein, the data file is deposited from local volatibility
Storage equipment or outside.
B21, the method according to any one of B13-B20, wherein, the target data block storage after by the process
To the virtual disk after the data partition recorded data block, methods described also includes:
When the read requests for reading the data file are received, examined and seized from the virtual magnetic according to the read requests
Take corresponding multiple target data blocks;
Multiple data partitions according to belonging to the plurality of target data block, it is determined that carrying out to the plurality of target data block
The target data of process processes type;
Type is processed according to the target data to process the plurality of target data block, obtain the plurality of target
The corresponding source block of data block, and return to reading side.
B22, the method according to B21, wherein, the multiple data partitions according to belonging to the plurality of target data block,
It is determined that the target data processed the plurality of target data block processes type, including:
Multiple data partitions according to belonging to the plurality of target data block, obtain the source recorded to each data partition
The data processing type that data block is processed;
According to the data processing type for obtaining, it is determined that the target data processed the plurality of target data block
Process type.
B23, the method according to B22, wherein, when the data processing type is encryption, the number of targets
It is decryption processing according to type is processed.
B24, the method according to B23, wherein, type is processed to the plurality of target data according to the target data
Block is processed, including:
Key is obtained from the read requests;
Process is decrypted to the plurality of target data block using the key.
B25, the method according to any one of B22-B24, wherein, obtain the source number recorded to each data partition
The data processing type processed according to block, including:
Obtain what the source block that each data partition is recorded was processed from the file header of the virtual disk
Data processing type;Or
Obtain at the source block recorded to each data partition from the data partition or other data partitions
The data processing type of reason.
B26, the method according to any one of B13-B25, wherein, the plurality of source block is being distributed to structure
Virtual disk on multiple data partitions before, it is described also to include:
Identity to operating the operator of the virtual disk is verified;
After being verified, the virtual disk is loaded.
B27, the method according to any one of B13-B26, wherein, methods described is applied to the drive of the virtual disk
Dynamic program.
The another aspect of the embodiment of the present invention, additionally provides C28, a kind of device of structure virtual disk, including:
Mapping block, is suitable to for the memory block in storage device to be mapped as virtual disk partition;
Definition module, being suitable for the virtual disk partition definition includes file header, multiple data partitions and data block
File memory format and the data processing type that data block is processed, wherein, the file header records each data point
The information in area, the information of each data partition record data block, the data block is used for the content of data storage file;
Module is built, is suitable to be formatted process to the virtual disk partition using the file memory format, with
Build virtual disk.
C29, the device according to C28, wherein, the mapping block is further adapted for:
Volume file is created on a storage device, is virtual disk partition by the volume File Mapping for creating.
C30, the device according to C29, wherein, the mapping block is further adapted for:
The disk unit object of establishment virtual disk partition, and the extension object of the disk unit object is set up, wherein,
The extension object is used to preserve volume file corresponding with the virtual disk partition;
The volume file for creating is preserved to the extension object.
C31, the device according to C29 or C30, wherein, the volume file is single file.
C32, the device according to any one of C28-C31, wherein, the file header is also recorded to described each data
The data processing type that subregion recorded data block is processed.
C33, the device according to any one of C28-C31, wherein, described each data partition is also recorded to itself institute
The data processing type that the data block of record is processed.
C34, the device according to any one of C28-C31, wherein, one or more in described each data partition
Also record the data processing type processed other data partition recorded data blocks.
C35, the device according to any one of C28-C34, wherein, the data processing type includes encryption.
C36, the device according to C35, wherein, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
C37, the device according to C36, wherein, the definition module is further adapted for:
When the data processing type includes multiple, each data processing type is together in series shape according to processing sequence
Into pipeline, and record in the file header or the data partition.
C38, the device according to any one of C28-C37, wherein, the information of the data partition includes data partition
In the position of the volume file, the information of the data block includes data block in the position of the volume file.
C39, the device according to any one of C28-C38, wherein, the storage device sets for non-volatile memories
It is standby.
The another aspect of the embodiment of the present invention, additionally provides D40, a kind of data processing equipment based on virtual disk, bag
Include:
First acquisition module, is suitable to obtain the data file that will write non-volatile memory device;
Segmentation module, is suitable to the data file segmentation into multiple source datas block;
Distribute module, is suitable to the multiple data partitions for distributing the plurality of source block to the virtual disk for building,
Wherein, each data partition record distribution is to one or more source blocks of itself;
First processing module, is suitable to, for described each data partition, obtain the source data for recording the data partition
The data processing type that block is processed, and the data partition is recorded source block using the data processing type for obtaining
Processed, the target data block after being processed;
Memory module, is suitable to for the target data block after the process to store to the virtual disk data partition institute
The data block of record.
D41, the device according to D40, wherein, first acquisition module is further adapted for:
Monitor the instruction that data file is write non-volatile memory device;
When the instruction is monitored, the instruction is intercepted and parsed, obtain the data file.
D42, the device according to D40, wherein, first acquisition module is further adapted for:
Receive the instruction that data file is write non-volatile memory device;
The instruction is parsed, the data file is obtained.
D43, the device according to any one of D40-D42, wherein, the first processing module is further adapted for:
The number processed the source block that the data partition is recorded is obtained from the file header of the virtual disk
According to process type;Or
Obtain from the data partition or other data partitions and the source block that the data partition is recorded is processed
Data processing type.
D44, the device according to any one of D40-D43, wherein, the data processing type includes encryption.
D45, the device according to D44, wherein, the data processing type also includes at least one following:
Caching process, compression process, mirror image processing.
D46, the device according to D45, wherein, the first processing module is further adapted for:
When the data processing type includes multiple, each data processing type is together in series to be formed according to processing sequence
Pipeline, and record file header or data partition in the virtual disk, then institute is obtained from the file header of the virtual disk
State pipeline;Or
The pipeline is obtained from the data partition or other data partitions.
D47, the device according to any one of D40-D46, wherein, the data file is deposited from local volatibility
Storage equipment or outside.
D48, the device according to any one of D40-D47, wherein, also include:
Second acquisition module, is suitable to the target data block after the process be stored to described virtual in the memory module
On disk after the data partition recorded data block, when the read requests for reading the data file are received, according to
The read requests obtain corresponding multiple target data blocks from the virtual disk;
Determining module, the multiple data partitions being suitable to according to belonging to the plurality of target data block, it is determined that to the plurality of
The target data that target data block is processed processes type;
Second processing module, be suitable to according to the target data process type to the plurality of target data block at
Reason, obtains the corresponding source block of the plurality of target data block, and returns to reading side.
D49, the device according to D48, wherein, the determining module is further adapted for:
Multiple data partitions according to belonging to the plurality of target data block, obtain the source recorded to each data partition
The data processing type that data block is processed;
According to the data processing type for obtaining, it is determined that the target data processed the plurality of target data block
Process type.
D50, the device according to D49, wherein, when the data processing type is encryption, the number of targets
It is decryption processing according to type is processed.
D51, the device according to D50, wherein, the Second processing module is further adapted for:
Key is obtained from the read requests;
Process is decrypted to the plurality of target data block using the key.
D52, the device according to any one of D49-D51, wherein, the determining module is further adapted for:
Obtain what the source block that each data partition is recorded was processed from the file header of the virtual disk
Data processing type;Or
Obtain at the source block recorded to each data partition from the data partition or other data partitions
The data processing type of reason.
D53, the device according to any one of D40-D52, wherein, also include:
Load-on module, is suitable to distribute the plurality of source block to the virtual disk for building in the distribute module
Before multiple data partitions,
Identity to operating the operator of the virtual disk is verified;
After being verified, the virtual disk is loaded.
D54, the device according to any one of D40-D53, wherein, described device is applied to the drive of the virtual disk
Dynamic program.