CN106612306A - Data sharing method and device of virtual machine - Google Patents

Data sharing method and device of virtual machine Download PDF

Info

Publication number
CN106612306A
CN106612306A CN201510695398.XA CN201510695398A CN106612306A CN 106612306 A CN106612306 A CN 106612306A CN 201510695398 A CN201510695398 A CN 201510695398A CN 106612306 A CN106612306 A CN 106612306A
Authority
CN
China
Prior art keywords
shared
virtual machine
data
message
address information
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.)
Pending
Application number
CN201510695398.XA
Other languages
Chinese (zh)
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.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201510695398.XA priority Critical patent/CN106612306A/en
Priority to PCT/CN2016/101631 priority patent/WO2017067391A1/en
Publication of CN106612306A publication Critical patent/CN106612306A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a data sharing method of a virtual machine, which comprises the steps that a first virtual machine stores first data to be shared into a shared memory; the first virtual machine acquires storage address information of the first data to be shared and a destination physical address to be shared; the first virtual machine packages the storage address information and the destination physical address into a first packet to be shared; and the first virtual machine stores the first packet to be shared into a transmission queue corresponding to the first virtual machine. The invention further discloses a data sharing device of the virtual machine. The data sharing method and device disclosed by the invention improve the data sharing efficiency of the virtual machine.

Description

The data sharing method and device of virtual machine
Technical field
The present invention relates to communication technical field, more particularly to a kind of data sharing method and device of virtual machine.
Background technology
With the fast development of the communication technology, NFV (Network Function Virtualizat-ion, network Virtualization of function) technology is also increasingly mature, and network function virtualization needs the data forwarding work(for providing high speed Can, wherein, including the Microsoft Loopback Adapter between the data forwarding and virtual machine between server physical network card Data forwarding.
In the server the forwarding capability of virtual network typically passes through virtual bridge, or OVS (Open Virtual Switch, virtual switch) realizing, but either virtual bridge or OVS, all operate in Kernel state, and virtual machine is all to be located at User space, and when being communicated between virtual machine, need via void Intending bridge or OVS carries out the forwarding of data, and data are needed when forwarding between User space and kernel state Will through multiple copy, therefore, in this case data are sent to into another from virtual machine empty Plan machine, needs just carry out the forwarding of data through repeatedly copy, causes the data sharing between virtual machine Efficiency is low.
The content of the invention
Present invention is primarily targeted at proposing a kind of data sharing method and device of virtual machine, it is intended to solve The low technical problem of data sharing efficiency certainly between virtual machine.
For achieving the above object, the data sharing method of a kind of virtual machine that the present invention is provided, it is described virtual The data sharing method of machine is comprised the following steps:
First virtual machine is by the first data Cun Chudao shared drive to be shared;
First virtual machine obtains the storage address information of first data to be shared and to be shared Purpose physical address;
The storage address information and the purpose physical address are encapsulated as first by first virtual machine Message to be shared;
Described first message to be shared is stored in the corresponding transmission of first virtual machine by first virtual machine In lining up;
Wherein, first virtual machine by the described first packet storage to be shared to the purpose physical address During corresponding reception is lined up, so that corresponding second virtual machine of the purpose physical address is according to described first Storage address information in message to be shared obtains first data to be shared, first virtual machine with And second virtual machine is run in same host.
Preferably, first virtual machine obtain first data to be shared storage address information and After the step of purpose physical address to be shared, the data sharing method of the virtual machine also includes:
When the purpose physical address obtains failure, first virtual machine is by the storage address information It is encapsulated as the first message to be shared;
Described first message to be shared is stored in the corresponding transmission of first virtual machine by first virtual machine In lining up.
Preferably, the described first message to be shared is stored in first virtual machine pair by first virtual machine The transmission answered line up in step after, perform following steps:
The second message to be shared that first virtual machine is stored in real time or in timing acquisition its receiving queue;
When second message to be shared is got, it is to be shared that first virtual machine extracts described second Storage address information in message;
First virtual machine obtains storage described in the shared drive according to the storage address information Corresponding second data to be shared of location information.
Preferably, the described first data to be shared and/or second data to be shared are given birth to by multiple packets Into.
Additionally, for achieving the above object, the present invention also proposes a kind of data sharing device of virtual machine, institute Stating the data sharing device of virtual machine includes:
Memory module, for by the first data Cun Chudao shared drive to be shared;
First acquisition module, for obtaining the storage address information of the described first data to be shared and treating altogether The purpose physical address enjoyed;
First package module, for the storage address information and the purpose physical address to be encapsulated as First message to be shared;
Module is stored in, for the described first message to be shared to be stored in into the corresponding transmission of first virtual machine In lining up;
Wherein, it is described to be stored in module by the described first packet storage to be shared to the purpose physical address pair During the reception answered is lined up, so that corresponding second virtual machine of the purpose physical address is treated according to described first Storage address information in shared message obtains first data to be shared, the data sharing device with And second virtual machine is run in same host.
Preferably, the data sharing device of the virtual machine includes:
Second package module, for when the purpose physical address obtains failure, by the storage address Information encapsulation is the first message to be shared;
It is described to be stored in module, it is additionally operable to for the described first message to be shared to be stored in the first virtual machine correspondence Transmission line up.
Preferably, the data sharing device of the virtual machine also includes:
Second acquisition module, for the second report to be shared stored in real-time or timing acquisition its receiving queue Text;
Extraction module, for when second message to be shared is got, extracting described second to be shared Storage address information in message;
Second acquisition module, is additionally operable to be obtained in the shared drive according to the storage address information Corresponding second data to be shared of the storage address information.
Preferably, the described first data to be shared and/or second data to be shared are given birth to by multiple packets Into.
The data sharing method and device of virtual machine proposed by the present invention, the first virtual machine is first treated first altogether In enjoying data Cun Chudao shared drive, then obtain the storage address information of the described first data to be shared with And purpose physical address to be shared, and the storage address information and the purpose physical address are sealed Fill as the first message to be shared, finally the described first message to be shared is stored in into the first virtual machine correspondence Transmission line up, and the described first packet storage to be shared connect to the purpose physical address is corresponding During receipts are lined up, corresponding second virtual machine of the purpose physical address is realized to be shared according to described first Storage address information in message obtains first data to be shared, rather than enters line number between virtual machine According to it is shared when, via virtual bridge or virtual switch carry out data copy forwarding, in this programme In memory sharing area data storage, and the storage address information of data storage is notified to give other virtual machines, So that other virtual machines obtain the data in shared drive, so as to improve the data between virtual machine Shared efficiency.
Description of the drawings
Fig. 1 is the schematic flow sheet of the data sharing method first embodiment of virtual machine of the present invention;
Fig. 2 is the schematic diagram of shared drive between virtual machine of the present invention;
Fig. 3 is message format schematic diagram of the present invention;
Fig. 4 is the schematic flow sheet of the data sharing method second embodiment of virtual machine of the present invention;
Fig. 5 is the schematic flow sheet of the data sharing method 3rd embodiment of virtual machine of the present invention;
Fig. 6 is the high-level schematic functional block diagram of the data sharing device first embodiment of virtual machine of the present invention;
Fig. 7 is the high-level schematic functional block diagram of the data sharing device second embodiment of virtual machine of the present invention;
Fig. 8 is the high-level schematic functional block diagram of the data sharing device 3rd embodiment of virtual machine of the present invention.
The object of the invention is realized, functional characteristics and advantage will be done referring to the drawings furtherly in conjunction with the embodiments It is bright.
Specific embodiment
It should be appreciated that specific embodiment described herein is not used to limit only to explain the present invention The fixed present invention.
The present invention provides a kind of data sharing method of virtual machine.
With reference to Fig. 1, Fig. 1 is the schematic flow sheet of the data sharing method first embodiment of virtual machine of the present invention.
The present embodiment proposes a kind of data sharing method of virtual machine, the data sharing method of the virtual machine Including:
Step S10, the first virtual machine is by the first data Cun Chudao shared drive to be shared;
In the present embodiment, application scenarios are that each virtual machine in same host carries out data sharing, And each virtual machine in same host is when carrying out data sharing, in order to reduce data copy forwarding Deng operation, state of a control transmission and the network data between virtual machine is preferably realized by memory sharing technology Interaction, i.e., shared drive is set in host, and by data Cun Chudao shared drive to be shared, The shared drive is used to complete the data interaction between virtual machine and state of a control information exchange, reference picture 2, the shared drive includes a public data sharing area, and the data sharing area is used to deposit virtual Transmitting-receiving message between machine, the shared drive also includes a state of a control shared memory, control State tying memory block is mainly used in being handed between the data forwarding process I/O process in virtual machine and host Message descriptor and status information are changed, and from from the perspective of virtual machine, it is subdivided into virtual machine to host The transmission state of a control of machine data forwarding I/O (Input/Output, input and output) process describes area and from place Main frame I/O to the reception state of a control of virtual machine describes area.Further, the data forwarding process should Including one or more data I/O threads, generally, the network plane number supported by host determines, One plane one I/O thread of correspondence, for example:If all virtual machines only chain of command of a host With two network planes of data surface, it is possible to only start two I/O threads, thread process data surface Data transmit-receive a, thread is used to process the data forwarding of chain of command.
Step S20, first virtual machine obtain the storage address information of first data to be shared and Purpose physical address to be shared;
Step S30, first virtual machine seals the storage address information and the purpose physical address Fill as the first message to be shared;
In the present embodiment, first virtual machine stores the described first data to be shared in shared drive Afterwards, the storage address information and purpose physical address to be shared of the described first data to be shared are first obtained, Then, the storage address information for obtaining and the purpose physical address are encapsulated as into first to be shared Message, with reference to Fig. 3, message to be shared includes:CSD (Control-Status Discriptors, control State) descriptor, BD (buffer Discriptors, buffering area) descriptor, CSD descriptors include s Ize message sizes, header head pointers, tail tail pointers, Flags flag bits, BD includes Flags BD Label, len length, index indexes, buf_ptr message physical address etc., wherein, size is defined The BD numbers of each message, header, tail are for head and the tail rope that transceiving data is the BD for being identified with data Quotation marks, and each packet can take a BD, and BD is mainly used in describing the slow of storage transceiving data Rush the length of regional address and transceiving data.Flags defines some function marks of CSD, for depositing number According to some characteristic indications of message, index is used to identify the index of BD.Most important part is b in BD Uf_ptr and len, buf_ptr are used for the physical address of the buffering area for depositing transceiving data, and len is the buffering area Payload user data length.
Described first message to be shared is stored in first virtual machine pair by step S40, first virtual machine During the transmission answered is lined up;
Wherein, first virtual machine by the described first packet storage to be shared to the purpose physical address During corresponding reception is lined up, so that corresponding second virtual machine of the purpose physical address is according to described first Storage address information in message to be shared obtains first data to be shared, first virtual machine with And second virtual machine is run in same host.
In the present embodiment, the first virtual machine call data forwarding process, by the report to be shared Text is stored in the corresponding transmission of first virtual machine and lines up, and by the data forwarding process by institute State the first packet storage to be shared to line up to the corresponding reception of the purpose physical address, it is possible to understand that It is that the data forwarding process runs on User space, i.e., carries out void by calling the data forwarding process Data sharing between plan machine, can avoid the copy forwarding of data, so as to improve the effect of data sharing Rate, to be better understood from the present embodiment in, citing concrete application scene it is as follows:
First, in the first virtual machine, the Microsoft Loopback Adapter of the first virtual machine is driven first from shared section key Application state of a control descriptor CSD, by CSD BD descriptors are obtained, and pkt_buf ground is then applied for again Location, and pkt_buf address conversions and are prepared into be sent the into the virtual address of first virtual machine One data to be shared, that is, by the described first data copy to be shared to pkt_buf addresses, and fill in Len (the payload user data length of the buffering area), is then filled up to BD descriptions by the physical address of pkt_buf Buf_ptr fields in symbol, are encapsulated as the first message to be shared, complete the preparation for sending data.It is right In the second virtual machine, when having the first message to be shared during the reception is lined up, by calling the number According to forwarding process, to call NIC driver to process the BD of receiving queue, the buf_ptr of BD is obtained first The host-physical address of sensing, and the virtual machine address of the second virtual machine is converted into, finally, obtain described First message to be shared is completing the communication between virtual machine.
In the data forwarding process of host, data forwarding process guards the Microsoft Loopback Adapter of virtual machine Transmit queue, i.e., corresponding first message to be shared of described first virtual machine, data forwarding process is successively From the tail label start to process messages of individual queue, the buf_prt addresses in BD are obtained, and be converted into number According to the virtual address of forwarding process, and the purpose physical address of the described first message to be shared is obtained, now, The forward table for prestoring, the reception team corresponding so as to extract the second virtual machine are searched according to purpose physical address Row, and the parameter such as buf_prt, flags, len by transmit queue be copied directly to receiving queue buf_ptr, Flags, len field, is finally sent to the purpose physical address by the receiving queue that with the addition of parameter Corresponding second virtual machine.I.e. I/O processes receive the first report to be shared of transmission from the transmit queue of virtual machine Wen Hou, according to purpose physical address forward table is searched, and finds the receiving queue of the described first message to be shared, And the described first message to be shared is sent to into the receiving queue, for purpose physical address correspondence Storage address information of second virtual machine in the first message to be shared obtain the first data to be shared.
The data sharing method of the virtual machine that the present embodiment is proposed, the first virtual machine is first by the first number to be shared According to storage in shared drive, then obtain the storage address information of the described first data to be shared and treat Shared purpose physical address, and the storage address information and the purpose physical address are encapsulated as First message to be shared, is finally stored in corresponding of first virtual machine by the described first message to be shared Send in lining up, and the described first packet storage to be shared is received into row to the purpose physical address is corresponding In team, corresponding second virtual machine of the purpose physical address is realized according to the described first message to be shared In storage address information obtain first data to be shared, rather than data carried out between virtual machine be total to When enjoying, via virtual bridge or virtual switch carry out data copy forwarding, in this programme including Shared region data storage is deposited, and the storage address information of data storage is notified to give other virtual machines, for Other virtual machines obtain the data in shared drive, so as to improve the data sharing between virtual machine Efficiency.
Further, the flexibility shared in order to improve virtual-machine data, based on first embodiment this is proposed The second embodiment of the data sharing method of invention virtual machine, in the present embodiment, with reference to Fig. 4, the step After rapid S20, the data sharing method of the virtual machine also includes:
Step S50, when the purpose physical address obtains failure, first virtual machine is deposited described Storage address information is encapsulated as the first message to be shared;
Described first message to be shared is stored in first virtual machine pair by step S40, first virtual machine During the transmission answered is lined up.
In the present embodiment, first virtual machine is possible to that the first message to be shared of broadcast can be sent, or When queue cannot be found in forward table in the first message to be shared, now, to the described first report to be shared Text carries out specially treated, i.e., now need to send a first message to be shared to each virtual machine.So, The virtual machine needs the receiving queue application pkt_buf for other each virtual machines, and copy packet payload To all of pkt_buf, len and flags to BD descriptor respective fields are replicated, while by pkt_buf It is converted into host-physical address and is filled up to buf_ptr fields.That is the first virtual machine is in data storage When, the purpose physical address of virtual machine to be shared is not added in the described first message to be shared, Now, directly the storage address information is encapsulated as into the first message to be shared, and calls data forwarding to enter Journey, is stored in the described first message to be shared the corresponding transmission of first virtual machine and lines up, be i.e. institute Stating data forwarding process cannot obtain purpose physical address from the described first message to be shared, then described The storage address information extracted is sent to the corresponding host of first virtual machine by data forwarding process Other in machine each virtual machines, i.e., described data forwarding process by the described first packet storage to be shared extremely During the corresponding reception of other each virtual machines is lined up, so that other each virtual machines are treated altogether according to described first Enjoy the storage address information in message and obtain the first data to be shared, it is each with other to complete the first virtual machine The data sharing of individual virtual machine.
Further, the flexibility shared in order to improve virtual-machine data, based on first embodiment this is proposed The 3rd embodiment of the data sharing method of invention virtual machine, in the present embodiment, with reference to Fig. 5, the step After rapid S40, the data sharing method of the virtual machine includes:
Step S60, what first virtual machine was stored in real time or in timing acquisition its receiving queue second treats altogether Enjoy message;
Step S70, when second message to be shared is got, first virtual machine extracts described the Storage address information in two messages to be shared;
Step S80, first virtual machine obtains institute in the shared drive according to the storage address information State corresponding second data to be shared of storage address information.
In the present embodiment, first virtual machine is obtained and deposited in the receiving queue in first virtual machine The mode of the second message to be shared of storage includes:1) timing acquisition, i.e. user are in advance in the host In preset first virtual machine to obtain the mode of message to be shared be timing acquisition, such as every inspection in 10 minutes Whether survey during reception is lined up has message to be shared.2) obtain in real time, i.e. user is in advance in the host It is acquisition in real time that default first virtual machine obtains the mode of message to be shared, then, as long as described The reception of the first virtual machine has a message to be shared in lining up, first virtual machine can be to detecting and obtain Take.
When second message to be shared is got, it is to be shared that first virtual machine extracts described second Storage address information in message, according to the storage address information institute in the shared drive can be obtained Corresponding second data to be shared of storage address information are stated, to complete the data sharing between virtual machine.
Further, the efficiency shared in order to improve virtual-machine data, first data to be shared and/or Second data to be shared are generated by multiple packets, i.e., the first virtual machine is stored in memory sharing and treated During shared data, the data of storage are generated by multiple packets, then, data forwarding process is in inspection When measuring described first and/or the second message to be shared, you can obtain the corresponding parameters of each packet, Realize and disposably call multiple packets, reduce the average time of each data-bag interacting, so as to carry The efficiency of data sharing between high virtual machine.Further, can also be received and dispatched using larger bag length Data, such as MTU (Maximum Transmission Unit, the MTU of general network Length) it is 1500 bytes, the cost for often wrapping can be reduced using bigger MTU in actual applications, It should be noted that it requires that the two ends of packet sending and receiving to be shared must adopt identical MTU, if two The MTU at end is mismatched, and may cause message fragment so as to cannot normal communication.
Further, generated according to the source physical address of message or update forward table, that is, generate or update mesh Physical address and virtual machine receiving queue mapping table, that is to say, that I/O processes are each I/O line Journey safeguards the corresponding relation of a forward table, forward table maintenance purpose physical address and virtual machine receiving queue.
The present invention further provides a kind of data sharing device of virtual machine.
With reference to Fig. 6, Fig. 6 is the high-level schematic functional block diagram of the communication device first embodiment of virtual machine of the present invention.
It is emphasized that it will be apparent to those skilled in the art that functional block diagram is only shown in Fig. 6 The exemplary plot of one preferred embodiment, data of the those skilled in the art around the virtual machine shown in Fig. 6 The functional module of sharing means, can easily carry out the supplement of new functional module;The title of each functional module It is self-defined title, is only used for aiding in each program function block for the data sharing device for understanding the virtual machine, Restriction technical scheme is not used in, the core of technical solution of the present invention is, each self-defined title The function to be reached of functional module.
The present embodiment proposes a kind of data sharing device of virtual machine, the data sharing device of the virtual machine Including:
Memory module 10, for by the first data Cun Chudao shared drive to be shared;
In the present embodiment, application scenarios are that each virtual machine in same host carries out data sharing, And each virtual machine in same host is when carrying out data sharing, in order to reduce data copy forwarding Deng operation, state of a control transmission and the network data between virtual machine is preferably realized by memory sharing technology Interaction, i.e., shared drive is set in host, the memory module 10 is by data Cun Chudao to be shared In shared drive, the shared drive is used to complete the data interaction between virtual machine and state of a control information Interaction, with reference to Fig. 2, the shared drive includes a public data sharing area, the data sharing area For the transmitting-receiving message between depositing between virtual machine, the shared drive also includes that a state of a control is shared Memory block, state of a control shared memory is mainly used in data forwarding process I/O in virtual machine and host Message descriptor and status information are exchanged between process, and from from the perspective of virtual machine, it is subdivided into void Plan machine to the transmission state of a control of host data forwarding I/O (Input/Output, input and output) process is retouched State area and the reception state of a control from host I/O to virtual machine describes area.Further, the data turn The process of sending out should include one or more data I/O threads, generally, the network supported by host Number of planes determination, plane one I/O thread of correspondence, for example:All virtual machines of one host are such as Fruit only has two network planes of chain of command and data surface, it is possible to only start two I/O threads, a thread The data transmit-receive in processing data face a, thread is used to process the data forwarding of chain of command.
First acquisition module 20, for obtaining the storage address information of the described first data to be shared and treating Shared purpose physical address;
First package module 30, for the storage address information and the purpose physical address to be encapsulated For the first message to be shared;
In the present embodiment, the memory module 10 stores the described first data to be shared in shared drive Afterwards, first acquisition module 20 first obtains the storage address information of the described first data to be shared and treats Shared purpose physical address, then, first package module 30 believes the storage address for obtaining Breath and the purpose physical address are encapsulated as the first message to be shared, and with reference to Fig. 3, message to be shared includes: CSD (Control-Status Discriptors, state of a control) descriptor, BD (buffer Discriptor S, buffering area) descriptor, CSD descriptors include size message sizes, header head pointers, tail tails Pointer, Flags flag bits, BD includes Flags BD labels, len length, index indexes, buf_ptr Message physical address etc., wherein, size defines the BD numbers of each message, header, and tail is used to receive The head and the tail call number that data are the BD for being identified with data is sent out, and each packet can take a BD, and BD is mainly used in describing the buffer zone address of storage transceiving data and the length of transceiving data.Flags is defined Some function marks of CSD, for depositing some characteristic indications of data message, index is used to mark Know the index of BD.Most important part is buf_ptr and len, buf_ptr are used for storage transmitting-receiving number in BD According to buffering area physical address, len is the payload user data length of the buffering area.
Module 40 is stored in, for the described first message to be shared to be stored in into corresponding of first virtual machine Send in lining up;
Wherein, it is described to be stored in module by the described first packet storage to be shared to the purpose physical address pair During the reception answered is lined up, so that corresponding second virtual machine of the purpose physical address is treated according to described first Storage address information in shared message obtains first data to be shared, the data sharing device with And second virtual machine is run in same host.
In the present embodiment, the first virtual machine call data forwarding process, by the report to be shared Text is stored in the corresponding transmission of first virtual machine and lines up, and by the data forwarding process by institute State the first packet storage to be shared to line up to the corresponding reception of the purpose physical address, it is possible to understand that It is that the data forwarding process runs on User space, i.e., carries out void by calling the data forwarding process Data sharing between plan machine, can avoid the copy forwarding of data, so as to improve the effect of data sharing Rate, to be better understood from the present embodiment in, citing concrete application scene it is as follows:
First, first acquisition module 20 is from shared section key application state of a control descriptor CSD, by CSD obtains BD descriptors, and pkt_buf addresses are then applied for again, and by pkt_buf address conversions into institute The virtual address of the first virtual machine is stated, and prepares the first data to be shared to be sent, that is, will be described First data copy to be shared is in pkt_buf addresses, and (payload user data of the buffering area is long to fill in len Degree), the buf_ptr fields being then filled up to the physical address of pkt_buf in BD descriptors, the first envelope It is encapsulated as the first message to be shared for die-filling piece 30, completes the preparation for sending data.It is virtual for second Machine, when having the first message to be shared during the reception is lined up, by calling the data forwarding process, To call NIC driver to process the BD of receiving queue, the master that the buf_ptr of BD is pointed to is obtained first Machine physical address, and the virtual machine address of the second virtual machine is converted into, finally, obtain described first and treat altogether Enjoy message to complete the communication between virtual machine.
In the data forwarding process of host, data forwarding process guards the Microsoft Loopback Adapter of virtual machine Transmit queue, i.e., corresponding first message to be shared of described first virtual machine, data forwarding process is successively From the tail label start to process messages of individual queue, the buf_prt addresses in BD are obtained, and be converted into number According to the virtual address of forwarding process, and the purpose physical address of the described first message to be shared is obtained, now, The forward table for prestoring, the reception team corresponding so as to extract the second virtual machine are searched according to purpose physical address Row, and the parameter such as buf_prt, flags, len by transmit queue be copied directly to receiving queue buf_ptr, Flags, len field, is finally sent to the purpose physical address by the receiving queue that with the addition of parameter Corresponding second virtual machine.I.e. I/O processes receive the first report to be shared of transmission from the transmit queue of virtual machine Wen Hou, according to purpose physical address forward table is searched, and finds the receiving queue of the described first message to be shared, And the described first message to be shared is sent to into the receiving queue, for purpose physical address correspondence Storage address information of second virtual machine in the first message to be shared obtain the first data to be shared.
The data sharing device of the virtual machine that the present embodiment is proposed, the first virtual machine is first by the first number to be shared According to storage in shared drive, then obtain the storage address information of the described first data to be shared and treat Shared purpose physical address, and the storage address information and the purpose physical address are encapsulated as First message to be shared, is finally stored in corresponding of first virtual machine by the described first message to be shared Send in lining up, and the described first packet storage to be shared is received into row to the purpose physical address is corresponding In team, corresponding second virtual machine of the purpose physical address is realized according to the described first message to be shared In storage address information obtain first data to be shared, rather than data carried out between virtual machine be total to When enjoying, via virtual bridge or virtual switch carry out data copy forwarding, in this programme including Shared region data storage is deposited, and the storage address information of data storage is notified to give other virtual machines, for Other virtual machines obtain the data in shared drive, so as to improve the data sharing between virtual machine Efficiency.
Further, the flexibility shared in order to improve virtual-machine data, based on first embodiment this is proposed The second embodiment of the data sharing device of invention virtual machine, in the present embodiment, with reference to Fig. 7, the void The data sharing device of plan machine includes:
Second package module 50, for when the purpose physical address obtains failure, by the storage Location Information encapsulation is the first message to be shared;
It is described to be stored in module 40, it is additionally operable to for the described first message to be shared to be stored in first virtual machine pair During the transmission answered is lined up.
In the present embodiment, the data sharing device is possible to that the first message to be shared of broadcast can be sent, Or when queue cannot be found in forward table in the first message to be shared, it is now, to be shared to described first Message carries out specially treated, i.e., now need to send a first message to be shared to each virtual machine.That , second package module 50 needs the receiving queue application pkt_buf for other each virtual machines, and Copy packet payload replicates len and flags to BD descriptor respective fields, together to all of pkt_buf When pkt_buf is converted into into host-physical address and buf_ptr fields are filled up to.That is first is virtual The purpose physical address of virtual machine to be shared is not added to described first and is treated by machine in data storage In shared message, now, the storage address information is directly encapsulated as the by second package module 50 One message to be shared, the module 40 that is stored in calls data forwarding process, by the described first report to be shared Text is stored in the corresponding transmission of first virtual machine and lines up, i.e., described data forwarding process cannot be from described Purpose physical address is obtained in first message to be shared, then described in the data forwarding process will be extracted Storage address information is sent to other each virtual machines in the corresponding host of first virtual machine, i.e., The data forwarding process is by the described first packet storage to be shared to other corresponding receptions of each virtual machine In lining up, so that storage address information of other each virtual machines in the described first message to be shared is obtained The first data to be shared are taken, to complete the data sharing of the first virtual machine and other each virtual machines.
Further, the flexibility shared in order to improve virtual-machine data, based on first embodiment this is proposed The 3rd embodiment of the data sharing device of invention virtual machine, in the present embodiment, with reference to Fig. 8, the void The data sharing device of plan machine also includes:
Second acquisition module 60, second for storing in real-time or timing acquisition its receiving queue is to be shared Message;
Extraction module 70, treats altogether for when second message to be shared is got, extracting described second Enjoy the storage address information in message;
Second acquisition module 60, is additionally operable to obtain the shared drive according to the storage address information Described in corresponding second data to be shared of storage address information.
In the present embodiment, second acquisition module 60 obtains the receiving queue in first virtual machine The mode of the message to be shared of middle storage includes:, 1) timing acquisition, i.e. user are in advance in the host In preset first virtual machine to obtain the mode of message to be shared be timing acquisition, such as every inspection in 10 minutes Whether survey during reception is lined up has message to be shared.2) obtain in real time, i.e. user is in advance in the host It is acquisition in real time that default first virtual machine obtains the mode of message to be shared, then, as long as described The reception of the first virtual machine has message to be shared in lining up, first virtual machine can be to detection.
When second acquisition module 60 gets second message to be shared, the extraction module 70 The storage address information in the described second message to be shared is extracted, second acquisition module 60 is according to described It is corresponding second to be shared that storage address information can obtain storage address information described in the shared drive Data, to complete the data sharing between virtual machine.
Further, the efficiency shared in order to improve virtual-machine data, first data to be shared and/or Second data to be shared are generated by multiple packets, i.e., the first virtual machine is stored in memory sharing and treated During shared data, the data of storage are generated by multiple packets, then, data forwarding process is in inspection When measuring described first and/or the second message to be shared, you can obtain the corresponding parameters of each packet, Realize and disposably call multiple packets, reduce the average time of each data-bag interacting, so as to carry The efficiency of data sharing between high virtual machine.Further, can also be received and dispatched using larger bag length Data, such as MTU (Maximum Transmission Unit, the MTU of general network Length) it is 1500 bytes, the cost for often wrapping can be reduced using bigger MTU in actual applications, It should be noted that it requires that the two ends of packet sending and receiving to be shared must adopt identical MTU, if two The MTU at end is mismatched, and may cause message fragment so as to cannot normal communication.
Further, generated according to the source physical address of message or update forward table, that is, generate or update mesh Physical address and virtual machine receiving queue mapping table, that is to say, that I/O processes are each I/O line Journey safeguards the corresponding relation of a forward table, forward table maintenance purpose physical address and virtual machine receiving queue.
It should be noted that herein, term " including ", "comprising" or its any other variant Be intended to including for nonexcludability so that process, method, article including a series of key elements or Person's device not only includes those key elements, but also including other key elements being not expressly set out, or also Including the key element intrinsic for this process, method, article or device.In the feelings without more restrictions Under condition, the key element limited by sentence "including a ...", it is not excluded that including the key element process, Also there is other identical element in method, article or device.
The embodiments of the present invention are for illustration only, do not represent the quality of embodiment.
Through the above description of the embodiments, those skilled in the art can be understood that above-mentioned Embodiment method can add the mode of required general hardware platform to realize by software, naturally it is also possible to logical Cross hardware, but in many cases the former is more preferably embodiment.It is of the invention based on such understanding The part that technical scheme substantially contributes in other words to prior art can in the form of software product body Reveal and, the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disc, light Disk) in, including some instructions are used so that a station terminal equipment (can be mobile phone, computer is serviced Device, air-conditioner, or network equipment etc.) perform method described in each embodiment of the invention.
The preferred embodiments of the present invention are these are only, the scope of the claims of the present invention is not thereby limited, it is every The equivalent structure made using description of the invention and accompanying drawing content or equivalent flow conversion, or directly or Connect and be used in other related technical fields, be included within the scope of the present invention.

Claims (8)

1. a kind of data sharing method of virtual machine, it is characterised in that the data sharing side of the virtual machine Method is comprised the following steps:
First virtual machine is by the first data Cun Chudao shared drive to be shared;
First virtual machine obtains the storage address information of first data to be shared and to be shared Purpose physical address;
The storage address information and the purpose physical address are encapsulated as first by first virtual machine Message to be shared;
Described first message to be shared is stored in the corresponding transmission of first virtual machine by first virtual machine In lining up;
Wherein, first virtual machine by the described first packet storage to be shared to the purpose physical address During corresponding reception is lined up, so that corresponding second virtual machine of the purpose physical address is according to described first Storage address information in message to be shared obtains first data to be shared, first virtual machine with And second virtual machine is run in same host.
2. the data sharing method of virtual machine as claimed in claim 1, it is characterised in that described first Virtual machine obtains the storage address information and purpose physical address to be shared of first data to be shared The step of after, the data sharing method of the virtual machine also includes:
When the purpose physical address obtains failure, first virtual machine is by the storage address information It is encapsulated as the first message to be shared;
Described first message to be shared is stored in the corresponding transmission of first virtual machine by first virtual machine In lining up.
3. the data sharing method of virtual machine as claimed in claim 1, it is characterised in that described first Described first message to be shared is stored in virtual machine the step during the corresponding transmission of first virtual machine is lined up Afterwards, following steps are performed:
The second message to be shared that first virtual machine is stored in real time or in timing acquisition its receiving queue;
When second message to be shared is got, it is to be shared that first virtual machine extracts described second Storage address information in message;
First virtual machine obtains storage described in the shared drive according to the storage address information Corresponding second data to be shared of location information.
4. the data sharing method of the virtual machine as described in any one of claim 1-3, it is characterised in that First data to be shared and/or second data to be shared are generated by multiple packets.
5. a kind of data sharing device of virtual machine, it is characterised in that the data sharing dress of the virtual machine Put including:
Memory module, for by the first data Cun Chudao shared drive to be shared;
First acquisition module, for obtaining the storage address information of the described first data to be shared and treating altogether The purpose physical address enjoyed;
First package module, for the storage address information and the purpose physical address to be encapsulated as First message to be shared;
Module is stored in, for the described first message to be shared to be stored in into the corresponding transmission of first virtual machine In lining up;
Wherein, it is described to be stored in module by the described first packet storage to be shared to the purpose physical address pair During the reception answered is lined up, so that corresponding second virtual machine of the purpose physical address is treated according to described first Storage address information in shared message obtains first data to be shared, the data sharing device with And second virtual machine is run in same host.
6. the data sharing device of virtual machine as claimed in claim 5, it is characterised in that described virtual The data sharing device of machine includes:
Second package module, for when the purpose physical address obtains failure, by the storage address Information encapsulation is the first message to be shared;
It is described to be stored in module, it is additionally operable to for the described first message to be shared to be stored in the first virtual machine correspondence Transmission line up.
7. the data sharing device of virtual machine as claimed in claim 5, it is characterised in that described virtual The data sharing device of machine also includes:
Second acquisition module, for the second report to be shared stored in real-time or timing acquisition its receiving queue Text;
Extraction module, for when second message to be shared is got, extracting described second to be shared Storage address information in message;
Second acquisition module, is additionally operable to be obtained in the shared drive according to the storage address information Corresponding second data to be shared of the storage address information.
8. the data sharing device of the virtual machine as described in any one of claim 5-7, it is characterised in that First data to be shared and/or second data to be shared are generated by multiple packets.
CN201510695398.XA 2015-10-22 2015-10-22 Data sharing method and device of virtual machine Pending CN106612306A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510695398.XA CN106612306A (en) 2015-10-22 2015-10-22 Data sharing method and device of virtual machine
PCT/CN2016/101631 WO2017067391A1 (en) 2015-10-22 2016-10-10 Data sharing method and device for virtual machines

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510695398.XA CN106612306A (en) 2015-10-22 2015-10-22 Data sharing method and device of virtual machine

Publications (1)

Publication Number Publication Date
CN106612306A true CN106612306A (en) 2017-05-03

Family

ID=58556722

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510695398.XA Pending CN106612306A (en) 2015-10-22 2015-10-22 Data sharing method and device of virtual machine

Country Status (2)

Country Link
CN (1) CN106612306A (en)
WO (1) WO2017067391A1 (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107678835A (en) * 2017-09-30 2018-02-09 东软集团股份有限公司 A kind of data transmission method and system
CN107995129A (en) * 2017-11-30 2018-05-04 锐捷网络股份有限公司 A kind of NFV message forwarding methods and device
CN108573162A (en) * 2017-05-31 2018-09-25 北京金山云网络技术有限公司 data copy system, method and device
CN109379269A (en) * 2018-11-29 2019-02-22 南京中孚信息技术有限公司 Virtual swap device data forwarding method, device and computer equipment
CN109460373A (en) * 2017-09-06 2019-03-12 阿里巴巴集团控股有限公司 A kind of data sharing method, terminal device and storage medium
WO2019056380A1 (en) * 2017-09-25 2019-03-28 华为技术有限公司 Data access method and device
CN110109873A (en) * 2019-05-08 2019-08-09 重庆大学 A kind of file management method for message queue
CN110489150A (en) * 2019-08-26 2019-11-22 深信服科技股份有限公司 A kind of hot upgrade method of virtual machine, device and its relevant device
WO2019228228A1 (en) * 2018-05-30 2019-12-05 阿里巴巴集团控股有限公司 Data caching method, data processing method, computer device, storage medium
WO2020083060A1 (en) * 2018-10-26 2020-04-30 中兴通讯股份有限公司 Data transmission method and apparatus, storage medium, and electronic apparatus
CN111130863A (en) * 2019-12-12 2020-05-08 北京浪潮数据技术有限公司 Virtual network card management method, system, equipment and computer storage medium
CN111796902A (en) * 2019-04-08 2020-10-20 维塔科技(北京)有限公司 Method and device for switching shared memory area, storage medium and electronic equipment
CN111797497A (en) * 2020-05-21 2020-10-20 中国电力科学研究院有限公司 Communication method and system for electromagnetic transient parallel simulation
CN112241307A (en) * 2020-10-21 2021-01-19 海光信息技术股份有限公司 Virtual machine creation method and device and related equipment
CN112769716A (en) * 2021-01-12 2021-05-07 烽火通信科技股份有限公司 Data forwarding method and device of virtual switch based on hybrid virtual network bridge
CN113206807A (en) * 2020-01-31 2021-08-03 伊姆西Ip控股有限责任公司 Method for information processing, electronic device, and computer storage medium
CN114095458A (en) * 2020-08-07 2022-02-25 华为技术有限公司 Data processing method and device
CN115580644A (en) * 2022-12-07 2023-01-06 北京小米移动软件有限公司 Method, apparatus, device and storage medium for communication between client systems in host

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110912733B (en) * 2019-10-31 2022-11-04 北京浪潮数据技术有限公司 Bare computer topological relation determining method, system, equipment and computer medium
CN112905304A (en) * 2021-03-08 2021-06-04 深信服科技股份有限公司 Communication method and device between virtual machines, physical host and medium
CN115334156A (en) * 2021-04-26 2022-11-11 深信服科技股份有限公司 Message processing method, device, equipment and storage medium
CN114138371B (en) * 2021-12-02 2024-02-06 北京天融信网络安全技术有限公司 Configuration dynamic loading method and device, computer equipment and storage medium
CN114697215A (en) * 2022-03-31 2022-07-01 西安超越申泰信息科技有限公司 Method, system, equipment and medium for improving performance of virtualization network
CN115002028B (en) * 2022-04-30 2024-02-13 济南浪潮数据技术有限公司 Message processing method, device and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667144A (en) * 2009-09-29 2010-03-10 北京航空航天大学 Virtual machine communication method based on shared memory
CN101819564A (en) * 2009-02-26 2010-09-01 国际商业机器公司 Method and device for assisting communication between virtual machines
CN101847105A (en) * 2009-03-26 2010-09-29 联想(北京)有限公司 Computer and internal memory sharing method of a plurality of operation systems
US20110131571A1 (en) * 2009-11-30 2011-06-02 Itamar Heim Mechanism for Shared Memory History Optimization in a Host Selection Algorithm for Virtual Machine Placement

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103346981B (en) * 2013-06-28 2016-08-10 华为技术有限公司 Virtual switch method, relevant apparatus and computer system
CN103559075B (en) * 2013-10-30 2016-10-05 华为技术有限公司 A kind of data transmission method, device and system and memory device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101819564A (en) * 2009-02-26 2010-09-01 国际商业机器公司 Method and device for assisting communication between virtual machines
CN101847105A (en) * 2009-03-26 2010-09-29 联想(北京)有限公司 Computer and internal memory sharing method of a plurality of operation systems
CN101667144A (en) * 2009-09-29 2010-03-10 北京航空航天大学 Virtual machine communication method based on shared memory
US20110131571A1 (en) * 2009-11-30 2011-06-02 Itamar Heim Mechanism for Shared Memory History Optimization in a Host Selection Algorithm for Virtual Machine Placement

Cited By (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108573162A (en) * 2017-05-31 2018-09-25 北京金山云网络技术有限公司 data copy system, method and device
CN109460373B (en) * 2017-09-06 2022-08-26 阿里巴巴集团控股有限公司 Data sharing method, terminal equipment and storage medium
CN109460373A (en) * 2017-09-06 2019-03-12 阿里巴巴集团控股有限公司 A kind of data sharing method, terminal device and storage medium
WO2019056380A1 (en) * 2017-09-25 2019-03-28 华为技术有限公司 Data access method and device
US11249934B2 (en) 2017-09-25 2022-02-15 Huawei Technologies Co., Ltd. Data access method and apparatus
CN107678835B (en) * 2017-09-30 2020-05-08 东软集团股份有限公司 Data transmission method and system
CN107678835A (en) * 2017-09-30 2018-02-09 东软集团股份有限公司 A kind of data transmission method and system
CN107995129B (en) * 2017-11-30 2021-12-17 锐捷网络股份有限公司 NFV message forwarding method and device
CN107995129A (en) * 2017-11-30 2018-05-04 锐捷网络股份有限公司 A kind of NFV message forwarding methods and device
CN110554977A (en) * 2018-05-30 2019-12-10 阿里巴巴集团控股有限公司 Data caching method, data processing method, computer device and storage medium
WO2019228228A1 (en) * 2018-05-30 2019-12-05 阿里巴巴集团控股有限公司 Data caching method, data processing method, computer device, storage medium
WO2020083060A1 (en) * 2018-10-26 2020-04-30 中兴通讯股份有限公司 Data transmission method and apparatus, storage medium, and electronic apparatus
CN111107663A (en) * 2018-10-26 2020-05-05 中兴通讯股份有限公司 Data transmission method and device, storage medium and electronic device
CN111107663B (en) * 2018-10-26 2022-09-27 中兴通讯股份有限公司 Data transmission method and device, storage medium and electronic device
CN109379269A (en) * 2018-11-29 2019-02-22 南京中孚信息技术有限公司 Virtual swap device data forwarding method, device and computer equipment
CN111796902B (en) * 2019-04-08 2024-03-19 维塔科技(北京)有限公司 Method and device for switching shared memory area, storage medium and electronic equipment
CN111796902A (en) * 2019-04-08 2020-10-20 维塔科技(北京)有限公司 Method and device for switching shared memory area, storage medium and electronic equipment
CN110109873A (en) * 2019-05-08 2019-08-09 重庆大学 A kind of file management method for message queue
CN110109873B (en) * 2019-05-08 2023-04-07 重庆大学 File management method for message queue
CN110489150A (en) * 2019-08-26 2019-11-22 深信服科技股份有限公司 A kind of hot upgrade method of virtual machine, device and its relevant device
CN111130863A (en) * 2019-12-12 2020-05-08 北京浪潮数据技术有限公司 Virtual network card management method, system, equipment and computer storage medium
CN113206807A (en) * 2020-01-31 2021-08-03 伊姆西Ip控股有限责任公司 Method for information processing, electronic device, and computer storage medium
CN113206807B (en) * 2020-01-31 2022-12-09 伊姆西Ip控股有限责任公司 Method for information processing, electronic device, and computer storage medium
CN111797497A (en) * 2020-05-21 2020-10-20 中国电力科学研究院有限公司 Communication method and system for electromagnetic transient parallel simulation
CN111797497B (en) * 2020-05-21 2024-05-17 中国电力科学研究院有限公司 Communication method and system for electromagnetic transient parallel simulation
CN114095458A (en) * 2020-08-07 2022-02-25 华为技术有限公司 Data processing method and device
CN112241307A (en) * 2020-10-21 2021-01-19 海光信息技术股份有限公司 Virtual machine creation method and device and related equipment
CN112769716A (en) * 2021-01-12 2021-05-07 烽火通信科技股份有限公司 Data forwarding method and device of virtual switch based on hybrid virtual network bridge
CN115580644A (en) * 2022-12-07 2023-01-06 北京小米移动软件有限公司 Method, apparatus, device and storage medium for communication between client systems in host

Also Published As

Publication number Publication date
WO2017067391A1 (en) 2017-04-27

Similar Documents

Publication Publication Date Title
CN106612306A (en) Data sharing method and device of virtual machine
CN104521198B (en) For the system and method for Virtual Ethernet binding
CN106685826B (en) Switchboard stacked system, from equipment, exchange chip and processing protocol message method
CN105988948B (en) A kind of method and apparatus of data transmission
CN103795622B (en) Message forwarding method and device using same
CN105162732B (en) Create the method, apparatus of ECP Extended Capabilities Port
CN104683428B (en) Network service processing method and device
CN108200447A (en) Live data transmission method, device, electronic equipment, server and storage medium
CN108494817A (en) Data transmission method, relevant apparatus and system
CN107122252B (en) Intersystem interaction method and device
CN108228309B (en) Data packet sending and receiving method and device based on virtual machine
CN104253842B (en) Method, apparatus, terminal and the server of synchronous terminal mirror image
CN104253996B (en) The sending, receiving method and its device and Transmission system of video data
CN107872471B (en) Remote desktop image instruction processing method and system
CN104378315B (en) A kind of method and device of CAPWAP tunnel packet transmission
CN105610730B (en) Message interaction method and system between CPU and network equipment
CN106790221A (en) A kind of safe ipsec protocol encryption method of internet protocol and the network equipment
CN113867732A (en) Message information processing method, system and storage medium
CN111294235A (en) Data processing method, device, gateway and readable storage medium
CN105760134B (en) A kind of data processing method and electronic equipment
CN105933325A (en) Kernel mode RPC (Remote Procedure CALL) communication acceleration method based on NFSoRDMA (Network File System over Remote Direct Memory Access)
CN114338801B (en) Lightweight publishing and subscribing method and system suitable for intelligent measuring equipment, equipment and storage medium
CN104009982B (en) File grouping group sending device and file grouping method for group sending based on ultrashort wave radio set
CN116074253B (en) Message chained forwarding method and device
CN109218176A (en) A kind of method and device of Message processing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20170503

RJ01 Rejection of invention patent application after publication