CN106201652A - A kind of data processing method and virtual machine - Google Patents

A kind of data processing method and virtual machine Download PDF

Info

Publication number
CN106201652A
CN106201652A CN201610507768.7A CN201610507768A CN106201652A CN 106201652 A CN106201652 A CN 106201652A CN 201610507768 A CN201610507768 A CN 201610507768A CN 106201652 A CN106201652 A CN 106201652A
Authority
CN
China
Prior art keywords
address
virtual address
physical block
physical
read
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
CN201610507768.7A
Other languages
Chinese (zh)
Other versions
CN106201652B (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201610507768.7A priority Critical patent/CN106201652B/en
Publication of CN106201652A publication Critical patent/CN106201652A/en
Application granted granted Critical
Publication of CN106201652B publication Critical patent/CN106201652B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/4557Distribution of virtual machine instances; Migration and load balancing

Abstract

This application discloses data processing method and virtual machine, the method includes: receive instruction data storage;Respond described instruction data storage, from Virtual Block Device VBD, select the virtual address corresponding with described instruction data storage;From multiple physical block equipment that VBD set in advance and described is corresponding, select the physical address corresponding with described virtual address;Record the corresponding relation of described virtual address and described physical address;Store described data to be stored to described physical address.In the method, setting multiple physical block equipment for VBD in advance, when performing instruction data storage, can choose physical address and carry out data storage from multiple physical block equipment, the read-write operation for virtual machine provides more choices.Meanwhile, by the way of the corresponding relation between the virtual address write by record and physical address, it is established that the mapping between virtual address and physical address, it is ensured that stored data can be found accurately, improve the performance of virtual machine.

Description

A kind of data processing method and virtual machine
Technical field
The present invention relates to technical field of electronic equipment, a kind of data processing method and virtual machine.
Background technology
VM (Virtual Machine, virtual machine) refers to have complete hardware system function, operation by what software was simulated Complete computer in a completely isolated environment.
At present when using VM, the operating system (being called for short VM OS) of VM needs to create a virtual hard disk (Virtual Hard Disk, is called for short VHD).It is that VM OS can use a virtual physical block that VM OS creates the essential condition of a VHD Equipment (Virtual Block Device is called for short VBD).The physical block device that VBD and usual computer system can use (Block Device) equally, is to carry out random-access storage device.The VBD of VM OS is usually from main frame (Host) Block Device map.Such as: the VBD of VM is probably a complete Block Device of Host, it is also possible to It it is a part of Host Block Device.After VBD is mapped to Block Device, to VBD read-write operation actually To the Block Device read-write operation setting up mapping relations with it.
Summary of the invention
In view of this, the present invention provides a kind of data processing method and virtual machine, to solve virtual machine in prior art The problem that energy is poor.
For achieving the above object, the present invention provides following technical scheme:
A kind of data processing method, including:
Receive instruction data storage, described instruction data storage includes data to be stored;
Respond described instruction data storage, from Virtual Block Device VBD, select the void corresponding with described instruction data storage Intend address;
From multiple physical block equipment that VBD set in advance and described is corresponding, select corresponding with described virtual address Physical address;
Record the corresponding relation of described virtual address and described physical address;
Store described data to be stored to described physical address.
Preferably, described multiple physical block equipment corresponding from described VBD, the thing corresponding with described virtual address is selected Reason address includes:
Obtain the device type of each physical block equipment of described VBD record;
According to described device type, determine the physical block equipment that in the plurality of physical block equipment, access speed is the fastest;
The physical address corresponding with described virtual address is selected from the physical block equipment that described access speed is the fastest.
Preferably, also include after selecting the virtual address corresponding with described instruction data storage from VBD:
According to pre-recorded virtual address by read-write number of times, determine the type of described virtual address.
Preferably, described according to pre-recorded virtual address by read-write number of times, determine the type of described virtual address Including:
Determine that the pre-recorded virtual address being written into number of times no more than first threshold is hot write address;
Determine that the pre-recorded number of times that is read is not more than the virtual address of Second Threshold and reads address for heat;
Determine that the pre-recorded number of times that is written into is hot write address less than or equal to the virtual address of first threshold;
Determine that the pre-recorded number of times that is read reads address less than or equal to the virtual address of Second Threshold for heat.
Preferably, described multiple physical block equipment corresponding from described VBD, the thing corresponding with described virtual address is selected Reason address includes:
According to the type of described virtual address, selection target physical block device from the plurality of physical block equipment, and from Described target physical block device selects the physical address corresponding with described virtual address.
Preferably, according to the type of described virtual address, from the plurality of physical block equipment, select target physical block device Including:
It is that heat is read in the case of address in described virtual address, selects access speed from the plurality of physical block equipment Fast physical block equipment is as target physical block device;
In the case of described virtual address is hot write address, from the plurality of physical block equipment, select equipment loss Low physical block equipment is as target physical block device;
In the case of described virtual address is cold read/write address, select capacity maximum from the plurality of physical block equipment Physical block equipment as target physical block device.
Preferably, also include:
Receive data read command, determine virtual address to be read;
According to the corresponding relation of virtual address and physical address, determine corresponding with described virtual address to be read to be read Physical address;
Read the data of storage in described physical address to be read.
Preferably, the corresponding relation recording described virtual address and described physical address includes:
Record the corresponding relation of described virtual address and described physical address in a tabular form.
The application also discloses a kind of virtual machine, including: processor, the memorizer coupled with described processor, wherein:
Described processor is used for, and receives instruction data storage, includes data to be stored in described instruction data storage, rings Answer described instruction data storage, from Virtual Block Device VBD, select the virtual address corresponding with described instruction data storage, from advance In multiple physical block equipment corresponding with described VBD first set, select the physical address corresponding with described virtual address, record Described virtual address and the corresponding relation of described physical address, store described data to be stored to described physical address.
Preferably, performing from multiple physical block equipment that described VBD is corresponding, selecting corresponding with described virtual address During the step of physical address, described processor is used for:
Obtain the device type of each physical block equipment of described VBD record;
According to described device type, determine the physical block equipment that in the plurality of physical block equipment, access speed is the fastest;
The physical address corresponding with described virtual address is selected from the physical block equipment that described access speed is the fastest.
Preferably, described processor is additionally operable to:
According to pre-recorded virtual address by read-write number of times, determine the type of described virtual address.
Preferably, perform according to pre-recorded virtual address by read-write number of times, determine the class of described virtual address During the step of type, described processor is used for:
Determine that the pre-recorded virtual address being written into number of times no more than first threshold is hot write address;
Determine that the pre-recorded number of times that is read is not more than the virtual address of Second Threshold and reads address for heat;
Determine that the pre-recorded number of times that is written into is hot write address less than or equal to the virtual address of first threshold;
Determine that the pre-recorded number of times that is read reads address less than or equal to the virtual address of Second Threshold for heat.
Preferably, described from multiple physical block equipment that described VBD is corresponding in execution, select and described virtual address pair During the step of the physical address answered, described processor is used for:
According to the type of described virtual address, selection target physical block device from the plurality of physical block equipment, and from Described target physical block device selects the physical address corresponding with described virtual address.
Preferably, according to the type of described virtual address, from the plurality of physical block equipment, select target physical block device Including:
It is that heat is read in the case of address in described virtual address, selects access speed from the plurality of physical block equipment Fast physical block equipment is as target physical block device;
In the case of described virtual address is hot write address, from the plurality of physical block equipment, select equipment loss Low physical block equipment is as target physical block device;
In the case of described virtual address is cold read/write address, select capacity maximum from the plurality of physical block equipment Physical block equipment as target physical block device.
Preferably, described processor is additionally operable to:
Receive data read command, determine virtual address to be read;
According to the corresponding relation of virtual address and physical address, determine corresponding with described virtual address to be read to be read Physical address;
Read the data of storage in described physical address to be read.
Understand via above-mentioned technical scheme, compared with prior art, present disclosure provides a kind of data process side Method, in the method, sets multiple physical block equipment for VBD in advance, when performing instruction data storage, and can be from multiple things Choosing physical address in reason block device and carry out data storage, the read-write operation for virtual machine provides more choices.Meanwhile, logical The mode of the corresponding relation between the virtual address of overwriting write and physical address, it is established that between virtual address and physical address Map, it is ensured that stored data can be found accurately, improve the performance of virtual machine.
Further, both reflect can be revised by the way of corresponding relation between amendment virtual address and physical address Penetrate relation, and then for dynamically selecting physics block device and physical address to provide the foundation.
Accompanying drawing explanation
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing In having technology to describe, the required accompanying drawing used is briefly described, it should be apparent that, the accompanying drawing in describing below is only this Inventive embodiment, for those of ordinary skill in the art, on the premise of not paying creative work, it is also possible to according to The accompanying drawing provided obtains other accompanying drawing.
Fig. 1 is the mapping relations schematic diagram of virtual address and physical address disclosed in the embodiment of the present application;
Fig. 2 is the flow chart of data processing method disclosed in the embodiment of the present application;
Fig. 3 is the flow chart of another data processing method disclosed in the embodiment of the present application;
Fig. 4 is the flow chart of another data processing method disclosed in the embodiment of the present application;
Fig. 5 is the flow chart of another data processing method disclosed in the embodiment of the present application;
Fig. 6 is the structural representation that the embodiment of the present application discloses a kind of virtual machine.
Detailed description of the invention
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Describe, it is clear that described embodiment is only a part of embodiment of the present invention rather than whole embodiments wholely.Based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under not making creative work premise Embodiment, broadly falls into the scope of protection of the invention.
The embodiment of the invention discloses a kind of data processing method, the method is applied to virtual machine.In virtual machine, to void Intend reading and the write operation of hard disc data, surface is virtual address is written and read operation, and it practice, read and write Be all physical address corresponding to virtual address.In this programme, allocate multiple physical block equipment in advance for virtual machine, virtual The physical address that machine is used, can be this whole physical block equipment, it is also possible to being a part for this physical block equipment, it reflects Penetrate relation as shown in Figure 1.Multiple physical block equipment in virtual block address respective hosts Host in VM.Physical block device A, B Can be by virtual machine call with C.Owing to physical block device type can be different, such as, SSD (Solid State Drive, solid state hard disc), NVME SSD, HHD (Hybrid hard drive, hybrid hard disk) for theaflash protocol, HDD (Hard Disk Drive conventional hard) etc., it is the most also had nothing in common with each other.Therefore, it is possible to realize virtual machine according to storage Instructing with reading, choose physical address and carry out data storage from multiple physical block equipment, the read-write operation for virtual machine provides More selection.
As shown in fig. 1, in Virtual Block Device, continuous print address Addr00、Addr01….Addr09, the thing of its correspondence Reason address as indicated with an arrow, can not be in same physical block equipment, it is also possible to is not order.In figure, Addr00Right Answer the Addr1 in physical block device A3, Addr01Addr2 in corresponding physics block device B5, Addr03Corresponding physics block device A In Addr15.Further, this corresponding relation is dynamically to set up, say, that virtual address which physical address corresponding Do not pre-build, and dynamically configure, storing data in virtual address when, can be this virtual address simultaneously Configuration physical address.
Data processing method disclosed in the embodiment of the present application, as in figure 2 it is shown, include:
Step S201: receive instruction data storage, include data to be stored in instruction data storage.
Virtual machine receives the instruction data storage of user's input, gives, can comprise and need to be deposited in this instruction data storage The virtual address that storage data are to be write, it is also possible to do not comprise the virtual address that data to be stored are to be write.
Step S202: response data storage instruction, selects the void corresponding with instruction data storage from physical block equipment VBD Intend address.
If instruction data storage has virtual address to be write, then directly using this address as corresponding virtual of data Address, such as, the virtual address comprised in instruction data storage is Addr0, then can directly determine that Addr0 is storage instruction correspondence Virtual address.
When realizing said process with program, use and write function ssize_twrite
ssize_twrite(int handle,void*buf,int nbyte);
Wherein, handle is filec descriptor;
Buf is the relief area specified, i.e. pointer, points to one section of internal storage location;
Nbyte is intended to write the byte number that file is specified;Return value: the byte number (successfully) of write document;-1 (makeing mistakes)
Its function realized is, the document of nbyte write filec descriptor handle indication in buf, returns during success The byte number write, returns-1 during mistake.
In this way of example, Addr0 can the memory area of document of corresponding handle indication.
Without comprising virtual address, then virtual machine can be with analytical data storage instruction, from the class of instruction data storage Type, or, the application program corresponding to this instruction data storage determines corresponding default Virtual address, or, connecing When receiving instruction data storage, directly distribute a virtual address for it.
Such as, if write is the configuration parameter of A application program, then address necessarily A application program of its write is joined Put the address that file is stored.
If the interpolation of new application program, and the most also there is no the memory space of correspondence, then can be directly its point Join address, store.
Step S203: from the multiple physical block equipment corresponding with VBD set in advance, select corresponding with virtual address Physical address.
After determining the virtual address that instruction data storage is corresponding, from corresponding multiple physical block equipment, select and it Corresponding physical address.This process, is i.e. the process for the dynamic allocated physical address of virtual address.During distribution, can To select according to predetermined physical block equipment choice rule, for example, it is desired to store fast physical equipment, then select SSD or The block device of NVME SSD type, if needing service life long, the holding time is long, then can select HDD.
Step S204: record virtual address and the corresponding relation of physical address.
After distributing physical address for virtual address, need to record both corresponding relations, could be according to virtually Physical address is found in location, continues to read data.It can thus be seen that in this method, the purpose of record corresponding relation is to realize two Will be placed in concrete accessing operation for the process of virtual address configuration physical address between person, and then achieve dynamically configuration Physical address, improves the motility of this data processing method.
In the present embodiment, the corresponding relation of virtual address and physical address can be recorded in a tabular form.Defined For dynamic virtual ATT (Dynamic Addr Table, DAT).Owing to this corresponding relation not just sets when initializing Reserve, but the follow-up dynamic configuration carried out, the most just think this, when upper once write operation, can be that virtual address is different Physical address, only need to carry out record storage, it is possible to ensure in this data handling procedure by both corresponding relations, both One_to_one corresponding.
Owing to the recording mode of form is very flexible, therefore need not require that the storage order of physical address is protected with virtual address Hold consistent.
Step S205: store data to be stored to physical address.
Data to be stored are stored in physical address.
The order of step S204 and step S205 might not as shown in Figure 2, in other examples, equally Select, first store data, re-record the relation of virtual address and physical address.Or, two steps are carried out simultaneously.
Data processing method disclosed in the present embodiment, sets multiple physical block equipment for VBD in advance, deposits performing data During storage instruction, can choose physical address and carry out data storage from multiple physical block equipment, the read-write operation for virtual machine carries Supply more selection.Meanwhile, by the way of the corresponding relation between the virtual address write by record and physical address, it is established that Mapping between virtual address and physical address, it is ensured that stored data can be found accurately.The method changes existing skill Art is only the limitation of VBD one physical block equipment of distribution, for realizing more flexibly and effectively data being stored and reading Take, it is provided that basis, improve the performance of virtual machine.
Further, change Virtual Block Device and physical block equipment relation one to one in prior art, use one-to-many Corresponding relation, also advantageously improves the stable row of system.Assume that one of them physical block equipment breaks down unavailable, it is also possible to Select other physical block equipment, or, in the case of a physical block equipment storage speed is relatively low wherein, it is also possible to select Other physical equipment stores.Further, it is also possible to add new physical block equipment in real time.
In data processing method disclosed in the present application, how from multiple physical block equipment that VBD is corresponding, select with empty Intending physical address corresponding to address is more crucial step, and its concrete operating process is as shown in example below.
A kind of multiple physical block equipment corresponding from VBD disclosed in the present application, select the physics corresponding with virtual address The method flow of address is as it is shown on figure 3, the method is applied to, and predetermined physical block equipment choice rule is: select storage speed The fastest physical block equipment.This process includes:
Step S301: obtain the device type of each physical block equipment of VBD record.
When setting corresponding physical block equipment for VBD in advance, except recording the identification marking of physical block equipment, in addition it is also necessary to Record the type of this physical block equipment, such as SSD, NVME SSD, HHD, HDD, the accessibility of the physical block equipment of each type Can be different, this access performance can be by the sector number of access per second, and the number of times of access per second determines.
Further, it is also possible to record the big of the physical storage areas that each physical block equipment uses for virtual machine Little, such as, 1G or 1T etc., at the same time it can also be record each equipment equipment loss when performing read-write operation.
Step S302: according to device type, determine the physical block equipment that in multiple physical block equipment, access speed is the fastest.
According to physical block equipment choice rule, the physical block equipment that storage speed to be selected is the fastest, NVME SSD.
Step S303: select the physical address corresponding with virtual address from the physical block equipment that access speed is the fastest.
It is similar with said process, if pre-set physical block equipment choice rule is the thing selecting memory capacity maximum Reason block device, or the physical block equipment that equipment loss is minimum, then can hold according to the storage of each physical block equipment of record Amount, selects.
In the above-described embodiments, due to select which physical block equipment be instruction data storage perform before the most Setting, therefore, its storage efficiency and storage effect are very limited.For some data, due to and be of little use, it is not necessary to storage In the physical block equipment that storage speed is the fastest, but if stored according to default rule, then can be to a certain extent The resource of waste physical block equipment, due to resource-constrained, can cause not having memory space to store some and must be stored in storage speed Spend the data in the fastest physical equipment.
In order to solve this problem, in the embodiment depicted in figure 2, it is also possible to set special enumerator, record each void Intend address to be written into and be read now, thus determine that after virtual address, in addition it is also necessary to record this virtual address and write again The event entered, adds 1 in enumerator.Based on these records, after selecting the virtual address corresponding for instruction data storage, can To read the number of times that this virtual address is read and write, it is generally the case that if a virtual address is often read and write, it is written into Exceed preset value with the number of times read, then it can be assumed that this address is hot write address, or, heat reads address.Such as, write is super secondary Number be hot write address more than 100 times, and reading times be hot reading address more than 500 times, if be both not reaching to, then and can be by This virtual address is defined as cold read/write address.And then, can according to pre-recorded virtual address by read-write number of times, determine this The type of virtual address, including:
Determine that the pre-recorded virtual address being written into number of times no more than first threshold is hot write address;
Determine that the pre-recorded number of times that is read is not more than the virtual address of Second Threshold and reads address for heat;
Determine that the pre-recorded number of times that is written into is hot write address less than or equal to the virtual address of first threshold;
Determine that the pre-recorded number of times that is read reads address less than or equal to the virtual address of Second Threshold for heat.
On the basis of above-mentioned classification, if virtual address corresponding in a certain data read command is Addr1, the most permissible First according to Addr1 by read-write number of times, it is judged which virtual address type it belongs to, then, according to this virtual address type, Target physical block device is selected, it is assumed that the number of times that is read of Addr1 is 600 times, then it substantially belongs to from multiple physical block equipment Read address in heat, show that it is read the number of times of data the most, and probability is very big, from the angle that system work is effective Consider, now need to select the fastest physical block equipment of access speed as object block equipment, then, then from object block equipment In, select physical address, carry out data storage.If the number of times that is written into of Addr1 is 600 times, then show that it is written into data Number of times the most, then need to select the minimum physical block equipment of equipment loss, to ensure that data write repeatedly will not be to thing The performance of reason block device impacts.And if Addr1 to be read number of times the least, only 10 times, then it is meant that these numbers According to once being stored, then it is rarely used, or, will not be used, deleted or updated for a long time.So, it is necessary to choosing Select the physical block equipment that Capacity Ratio is bigger, after such guarantee data to be stored store this physical block equipment, to this physics Block device resource take the operation not interfering with other.Therefore, when the capacity of physical block equipment is respectively 1G and 1T, preferentially The physical block equipment selecting 1T stores.
Said process, the description of summary can represent by flow process shown in Fig. 4, including:
Step S401: in the case of virtual address is heat reading address, select access speed from multiple physical block equipment The fastest physical block equipment is as target physical block device.
Step S402: in the case of virtual address is hot write address, selects equipment loss from multiple physical block equipment Minimum physical block equipment is as target physical block device.
Step S403: in the case of virtual address is cold read/write address, selects capacity from multiple physical block equipment Big physical block equipment is as target physical block device.
In the above-described embodiments, do not limit and select the type of a certain virtual address corresponding only in above-mentioned mode Physical block equipment.In some cases, in order to improve the writing speed of data, when virtual address is hot write address, it is same The physical block equipment that reading speed is the highest can be selected.
The explanation that scheme is mainly carried out by above-described embodiment from the angle of storage data, after storage data, another Key operation is read exactly.After carrying out data storage based on above-described embodiment, read the process of data as it is shown in figure 5, include:
Step S501: receive data read command, determine virtual address to be read.
Data read command carries the virtual address needing to read.
Step S502: according to the corresponding relation of virtual address with physical address, determine corresponding with virtual address to be read Physical address to be read.
The physical address corresponding with virtual address can be inquired according to DAT.
Step S503: read the data of storage in physical address to be read.
The application also discloses a kind of virtual machine, its structure as shown in Figure 6, including processor 601, with processor coupling The memorizer 602 closed, wherein:
Processor is used for, and receives instruction data storage, includes data to be stored in instruction data storage, and response data is deposited Storage instruction, selects the virtual address corresponding with instruction data storage from Virtual Block Device VBD, from set in advance and VBD pair In the multiple physical block equipment answered, selecting the physical address corresponding with virtual address, record virtual address is right with physical address Should be related to, store data to be stored to physical address.
Virtual machine disclosed in the present embodiment, sets multiple physical block equipment for VBD in advance, is performing instruction data storage Time, physical address can be chosen from multiple physical block equipment and carry out data storage, the read-write operation for virtual machine provides more Many selections.Meanwhile, by the way of the corresponding relation between the virtual address write by record and physical address, it is established that virtually Mapping between location and physical address, it is ensured that stored data can be found accurately, be greatly improved the performance of virtual machine.
Preferably, performing from multiple physical block equipment that VBD is corresponding, selecting the physical address corresponding with virtual address Step time, processor is used for:
Obtain the device type of each physical block equipment of VBD record;
According to device type, determine the physical block equipment that in multiple physical block equipment, access speed is the fastest;
The physical address corresponding with virtual address is selected from the physical block equipment that access speed is the fastest.
Preferably, processor is additionally operable to:
According to pre-recorded virtual address by read-write number of times, determine the type of virtual address.
Preferably, perform according to pre-recorded virtual address by read-write number of times, determine the type of virtual address During step, processor is used for:
Determine that the pre-recorded virtual address being written into number of times no more than first threshold is hot write address;
Determine that the pre-recorded number of times that is read is not more than the virtual address of Second Threshold and reads address for heat;
Determine that the pre-recorded number of times that is written into is hot write address less than or equal to the virtual address of first threshold;
Determine that the pre-recorded number of times that is read reads address less than or equal to the virtual address of Second Threshold for heat.
Preferably, performing from multiple physical block equipment that VBD is corresponding, selecting the physical address corresponding with virtual address Step time, processor is used for:
According to the type of virtual address, from multiple physical block equipment, select target physical block device, and from target physical Block device selects the physical address corresponding with virtual address.
Preferably, according to the type of virtual address, target physical block device is selected to include from multiple physical block equipment:
It is in the case of heat reads address in virtual address, from multiple physical block equipment, selects the physics that access speed is the fastest Block device is as target physical block device;
In the case of virtual address is hot write address, from multiple physical block equipment, select the physics that equipment loss is minimum Block device is as target physical block device;
In the case of virtual address is cold read/write address, from multiple physical block equipment, select the physical block that capacity is maximum Equipment is as target physical block device.
Preferably, processor is additionally operable to:
Receive data read command, determine virtual address to be read;
According to the corresponding relation of virtual address with physical address, determine the to be read physics corresponding with virtual address to be read Address;
Read the data of storage in physical address to be read.
Those of ordinary skill in the art are it is to be appreciated that combine the list of each example that the embodiments described herein describes Unit and algorithm steps, it is possible to being implemented in combination in of electronic hardware or computer software and electronic hardware.These functions are actually Perform with hardware or software mode, depend on application-specific and the design constraint of technical scheme.Professional and technical personnel Each specifically should being used for can be used different methods to realize described function, but this realization is it is not considered that exceed The scope of the present invention.
Those skilled in the art is it can be understood that arrive, for convenience and simplicity of description, and the electronics of foregoing description The specific works process of equipment, is referred to the corresponding process in preceding method embodiment, does not repeats them here.
If described function is using the form realization of SFU software functional unit and as independent production marketing or use, permissible It is stored in a computer read/write memory medium.Based on such understanding, technical scheme is the most in other words The part contributing prior art or the part of this technical scheme can embody with the form of software product, this meter Calculation machine software product is stored in a storage medium, including some instructions with so that a computer equipment (can be individual People's computer, server, or the network equipment etc.) perform all or part of step of method described in each embodiment of the present invention. And aforesaid storage medium includes: USB flash disk, portable hard drive, read only memory (ROM, Read-Only Memory), random access memory are deposited The various media that can store program code such as reservoir (RAM, Random Access Memory), magnetic disc or CD.
Described above to the disclosed embodiments, makes professional and technical personnel in the field be capable of or uses the present invention. Multiple amendment to these embodiments will be apparent from for those skilled in the art, as defined herein General Principle can realize without departing from the spirit or scope of the present invention in other embodiments.Therefore, the present invention It is not intended to be limited to the embodiments shown herein, and is to fit to and principles disclosed herein and features of novelty phase one The widest scope caused.

Claims (15)

1. a data processing method, it is characterised in that including:
Receive instruction data storage, described instruction data storage includes data to be stored;
Responding described instruction data storage, from Virtual Block Device VBD, selection is corresponding with described instruction data storage virtually Location;
From multiple physical block equipment that VBD set in advance and described is corresponding, select the physics corresponding with described virtual address Address;
Record the corresponding relation of described virtual address and described physical address;
Store described data to be stored to described physical address.
Method the most according to claim 1, it is characterised in that described multiple physical block equipment corresponding from described VBD, The physical address corresponding with described virtual address is selected to include:
Obtain the device type of each physical block equipment of described VBD record;
According to described device type, determine the physical block equipment that in the plurality of physical block equipment, access speed is the fastest;
The physical address corresponding with described virtual address is selected from the physical block equipment that described access speed is the fastest.
Method the most according to claim 1, it is characterised in that select corresponding with described instruction data storage from VBD Also include after virtual address:
According to pre-recorded virtual address by read-write number of times, determine the type of described virtual address.
Method the most according to claim 3, it is characterised in that described secondary according to being read and write of pre-recorded virtual address Number, determines that the type of described virtual address includes:
Determine that the pre-recorded virtual address being written into number of times no more than first threshold is hot write address;
Determine that the pre-recorded number of times that is read is not more than the virtual address of Second Threshold and reads address for heat;
Determine that the pre-recorded number of times that is written into is hot write address less than or equal to the virtual address of first threshold;
Determine that the pre-recorded number of times that is read reads address less than or equal to the virtual address of Second Threshold for heat.
Method the most according to claim 4, it is characterised in that described multiple physical block equipment corresponding from described VBD, The physical address corresponding with described virtual address is selected to include:
According to the type of described virtual address, from the plurality of physical block equipment, select target physical block device, and from described Target physical block device selects the physical address corresponding with described virtual address.
Method the most according to claim 5, it is characterised in that according to the type of described virtual address, from the plurality of physics Block device selects target physical block device include:
It is in the case of heat reads address in described virtual address, selects access speed the fastest from the plurality of physical block equipment Physical block equipment is as target physical block device;
In the case of described virtual address is hot write address, select equipment loss minimum from the plurality of physical block equipment Physical block equipment is as target physical block device;
In the case of described virtual address is cold read/write address, from the plurality of physical block equipment, select the thing that capacity is maximum Reason block device is as target physical block device.
7. according to the method described in any one in claim 1-6, it is characterised in that also include:
Receive data read command, determine virtual address to be read;
According to the corresponding relation of virtual address with physical address, determine the to be read physics corresponding with described virtual address to be read Address;
Read the data of storage in described physical address to be read.
8. according to the method described in any one in claim 1-6, it is characterised in that record described virtual address and described thing The corresponding relation of reason address includes:
Record the corresponding relation of described virtual address and described physical address in a tabular form.
9. a virtual machine, it is characterised in that including: processor, the memorizer coupled with described processor, wherein:
Described processor is used for, and receives instruction data storage, includes data to be stored in described instruction data storage, responds institute State instruction data storage, from Virtual Block Device VBD, select the virtual address corresponding with described instruction data storage, set from advance In fixed multiple physical block equipment corresponding with described VBD, selecting the physical address corresponding with described virtual address, record is described Virtual address and the corresponding relation of described physical address, store described data to be stored to described physical address.
Virtual machine the most according to claim 9, it is characterised in that set from multiple physical blocks that described VBD is corresponding in execution In Bei, when selecting the step of the physical address corresponding with described virtual address, described processor is used for:
Obtain the device type of each physical block equipment of described VBD record;
According to described device type, determine the physical block equipment that in the plurality of physical block equipment, access speed is the fastest;
The physical address corresponding with described virtual address is selected from the physical block equipment that described access speed is the fastest.
11. virtual machines according to claim 9, it is characterised in that described processor is additionally operable to:
According to pre-recorded virtual address by read-write number of times, determine the type of described virtual address.
12. virtual machines according to claim 11, it is characterised in that performing the quilt according to pre-recorded virtual address Read-write number of times, when determining the step of type of described virtual address, described processor is used for:
Determine that the pre-recorded virtual address being written into number of times no more than first threshold is hot write address;
Determine that the pre-recorded number of times that is read is not more than the virtual address of Second Threshold and reads address for heat;
Determine that the pre-recorded number of times that is written into is hot write address less than or equal to the virtual address of first threshold;
Determine that the pre-recorded number of times that is read reads address less than or equal to the virtual address of Second Threshold for heat.
13. virtual machines according to claim 12, it is characterised in that described from multiple things corresponding for described VBD in execution In reason block device, when selecting the step of the physical address corresponding with described virtual address, described processor is used for:
According to the type of described virtual address, from the plurality of physical block equipment, select target physical block device, and from described Target physical block device selects the physical address corresponding with described virtual address.
14. virtual machines according to claim 13, it is characterised in that according to the type of described virtual address, from the plurality of Physical block equipment selects target physical block device include:
It is in the case of heat reads address in described virtual address, selects access speed the fastest from the plurality of physical block equipment Physical block equipment is as target physical block device;
In the case of described virtual address is hot write address, select equipment loss minimum from the plurality of physical block equipment Physical block equipment is as target physical block device;
In the case of described virtual address is cold read/write address, from the plurality of physical block equipment, select the thing that capacity is maximum Reason block device is as target physical block device.
15. according to the virtual machine described in any one in claim 9-14, it is characterised in that described processor is additionally operable to:
Receive data read command, determine virtual address to be read;
According to the corresponding relation of virtual address with physical address, determine the to be read physics corresponding with described virtual address to be read Address;
Read the data of storage in described physical address to be read.
CN201610507768.7A 2016-06-29 2016-06-29 Data processing method and virtual machine Active CN106201652B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610507768.7A CN106201652B (en) 2016-06-29 2016-06-29 Data processing method and virtual machine

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610507768.7A CN106201652B (en) 2016-06-29 2016-06-29 Data processing method and virtual machine

Publications (2)

Publication Number Publication Date
CN106201652A true CN106201652A (en) 2016-12-07
CN106201652B CN106201652B (en) 2020-05-26

Family

ID=57464186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610507768.7A Active CN106201652B (en) 2016-06-29 2016-06-29 Data processing method and virtual machine

Country Status (1)

Country Link
CN (1) CN106201652B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329790A (en) * 2017-06-30 2017-11-07 联想(北京)有限公司 A kind of data processing method and electronic equipment
CN108304215A (en) * 2017-12-15 2018-07-20 山东超越数控电子股份有限公司 A kind of video memory optimization implementation method based on Domestic Platform
CN109597677A (en) * 2018-12-07 2019-04-09 北京百度网讯科技有限公司 Method and apparatus for handling information
CN109960569A (en) * 2019-03-26 2019-07-02 联想(北京)有限公司 A kind of virtualization processing method and device
CN110716886A (en) * 2019-09-29 2020-01-21 Tcl移动通信科技(宁波)有限公司 Data processing method, device, storage medium and terminal
CN110737608A (en) * 2018-07-03 2020-01-31 阿里巴巴集团控股有限公司 data operation method, device and system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102662869A (en) * 2012-04-01 2012-09-12 龙芯中科技术有限公司 Method and device for access to memory of virtual machine and finders
US20130198738A1 (en) * 2012-01-30 2013-08-01 Timothy Reddin Input/output operations at a virtual block device of a storage server
US20130262411A1 (en) * 2012-03-28 2013-10-03 Andrew Kadatch File map compression
CN103593147A (en) * 2013-11-07 2014-02-19 华为技术有限公司 Data reading method and device
CN103995732A (en) * 2014-05-26 2014-08-20 华为技术有限公司 Virtual trusted platform module function implementation method and management equipment
CN104598170A (en) * 2015-01-30 2015-05-06 华为技术有限公司 Method and device for confirming read-write path

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130198738A1 (en) * 2012-01-30 2013-08-01 Timothy Reddin Input/output operations at a virtual block device of a storage server
US20130262411A1 (en) * 2012-03-28 2013-10-03 Andrew Kadatch File map compression
CN102662869A (en) * 2012-04-01 2012-09-12 龙芯中科技术有限公司 Method and device for access to memory of virtual machine and finders
CN103593147A (en) * 2013-11-07 2014-02-19 华为技术有限公司 Data reading method and device
CN103995732A (en) * 2014-05-26 2014-08-20 华为技术有限公司 Virtual trusted platform module function implementation method and management equipment
CN104598170A (en) * 2015-01-30 2015-05-06 华为技术有限公司 Method and device for confirming read-write path

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王鹤群: ""虚拟存储技术及其应用"", 《记录媒体技术》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107329790A (en) * 2017-06-30 2017-11-07 联想(北京)有限公司 A kind of data processing method and electronic equipment
CN107329790B (en) * 2017-06-30 2021-01-15 联想(北京)有限公司 Data processing method and electronic equipment
CN108304215A (en) * 2017-12-15 2018-07-20 山东超越数控电子股份有限公司 A kind of video memory optimization implementation method based on Domestic Platform
CN110737608A (en) * 2018-07-03 2020-01-31 阿里巴巴集团控股有限公司 data operation method, device and system
CN110737608B (en) * 2018-07-03 2024-03-15 阿里巴巴集团控股有限公司 Data operation method, device and system
CN109597677A (en) * 2018-12-07 2019-04-09 北京百度网讯科技有限公司 Method and apparatus for handling information
CN109960569A (en) * 2019-03-26 2019-07-02 联想(北京)有限公司 A kind of virtualization processing method and device
CN109960569B (en) * 2019-03-26 2021-04-13 联想(北京)有限公司 Virtualization processing method and device
CN110716886A (en) * 2019-09-29 2020-01-21 Tcl移动通信科技(宁波)有限公司 Data processing method, device, storage medium and terminal
CN110716886B (en) * 2019-09-29 2022-12-13 惠州市仲恺Tcl智融科技小额贷款股份有限公司 Data processing method, device, storage medium and terminal

Also Published As

Publication number Publication date
CN106201652B (en) 2020-05-26

Similar Documents

Publication Publication Date Title
CN106201652A (en) A kind of data processing method and virtual machine
EP3617867B1 (en) Fragment management method and fragment management apparatus
CN106708424B (en) Apparatus and method for performing selective underlying exposure mapping on user data
US7895394B2 (en) Storage system
JP4185058B2 (en) Flash memory remapping method
US5491810A (en) Method and system for automated data storage system space allocation utilizing prioritized data set parameters
KR102541492B1 (en) Storage device including multi-partitions for multimode operations, and operation method thereof
KR102586805B1 (en) Management system for operating storage media in multi-mode, storage system including the same, and method of managing storage media using the same
US11354236B2 (en) Garbage collection method for data storage device
CN104866428B (en) Data access method and data access device
CN108021510A (en) The method for operating the storage device being managed to multiple name space
CN103761053B (en) A kind of data processing method and device
CN108733322A (en) Method for multithread garbage collection
CN104850358A (en) Magnetic-optical-electric hybrid storage system and data acquisition and storage method thereof
CN110688256B (en) Metadata power-on recovery method and device, electronic equipment and storage medium
CN105593828A (en) Method for managing files, distributed storage system and management node
CN103514249A (en) Method and system for automatic data reduction and storage device
EP3346387B1 (en) Storage system and system garbage collection method
CN104272242B (en) Create encryption memory bank
CN106527992A (en) Method and device for destroying data in storage equipment
WO2006014748A1 (en) Method and device to improve usb flash write performance
CN109558457A (en) A kind of method for writing data, device, equipment and storage medium
CN103324533A (en) distributed data processing method, device and system
CN107092443B (en) Data migration method and device
CN108196954A (en) A kind of file read/write method, system, equipment and computer storage media

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant