WO2020083060A1 - 数据的传输方法及装置、存储介质、电子装置 - Google Patents

数据的传输方法及装置、存储介质、电子装置 Download PDF

Info

Publication number
WO2020083060A1
WO2020083060A1 PCT/CN2019/110996 CN2019110996W WO2020083060A1 WO 2020083060 A1 WO2020083060 A1 WO 2020083060A1 CN 2019110996 W CN2019110996 W CN 2019110996W WO 2020083060 A1 WO2020083060 A1 WO 2020083060A1
Authority
WO
WIPO (PCT)
Prior art keywords
virtual machine
connection structure
quick connection
data transmission
virtual
Prior art date
Application number
PCT/CN2019/110996
Other languages
English (en)
French (fr)
Inventor
刘熠
彭浩
余兵
Original Assignee
中兴通讯股份有限公司
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 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2020083060A1 publication Critical patent/WO2020083060A1/zh

Links

Images

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
    • 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/45504Abstract machines for programme code execution, e.g. Java virtual machine [JVM], interpreters, emulators
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/1607Details of the supervisory signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W76/00Connection management
    • H04W76/10Connection setup

Definitions

  • Embodiments of the present invention relate to the field of communications, and in particular, to a data transmission method and device, storage medium, and electronic device.
  • each virtual NIC configured for each virtual machine will be mounted on a virtual network bridge on the same host.
  • the network communication between virtual machines has a long path and is inefficient. For example, from the front end of virtual machine A's virtual network card to the back end driver of virtual machine A, and then to the back end driver of virtual machine B's virtual network card after passing through the host's network protocol stack, and then to the front end driver of virtual network card.
  • Embodiments of the present invention provide a data transmission method and device, a storage medium, and an electronic device to at least solve the problems of a long communication path between virtual machines and inefficient data transmission in the related art.
  • a data transmission method which includes: after determining that a connection is established between a first virtual machine and a second virtual machine, creating a first fast connection structure, where the first virtual machine and The second virtual machines are all connected to the same host; send the first quick connection structure to the second virtual machine to instruct the second virtual machine to establish the second quick connection structure; use the first quick connection structure and the second quick connection structure for data transmission.
  • a data transmission method including: after determining that the second virtual machine receives the first quick connection structure sent by the first virtual machine, creating a second quick connection structure, wherein Both the first virtual machine and the second virtual machine are connected to the same host; data transmission is performed using the first quick connection structure and the second quick connection structure.
  • a data transmission apparatus including: a first creation module configured to create a first fast connection structure after determining that a connection is established between a first virtual machine and a second virtual machine , Where both the first virtual machine and the second virtual machine are connected to the same host; the first sending module is configured to send the first fast connection structure to the second virtual machine to instruct the second virtual machine to establish the second fast connection structure The first transmission module is configured to use the first quick connection structure and the second quick connection structure for data transmission.
  • a data transmission apparatus including: a second creation module, configured to create after determining that the second virtual machine receives the first fast connection structure sent by the first virtual machine The second quick connection structure, wherein the first virtual machine and the second virtual machine are both connected to the same host; the second transmission module is configured to use the first quick connection structure and the second quick connection structure for data transmission.
  • a storage medium is further provided, and the storage medium stores a computer program, wherein the computer program is configured to execute any of the above method embodiments during runtime step.
  • an electronic device including a memory and a processor, the memory stores a computer program, the processor is configured to run the computer program to perform any of the above Steps in a method embodiment.
  • the first virtual machine determines to establish a connection with the second virtual machine, it creates a first quick connection structure and sends the first quick connection structure to the second virtual machine to instruct the second virtual machine to establish The second quick connection structure; utilizes the first quick connection structure and the second quick connection structure for data transmission.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal of a data transmission method according to an embodiment of the present invention
  • FIG. 2 is a flowchart (1) of a data transmission method according to an embodiment of the present invention.
  • FIG. 3 is a flowchart (2) of a data transmission method according to an embodiment of the present invention.
  • FIG. 3a is a schematic diagram of the original network communication process between virtual devices in this embodiment
  • 3b is a schematic diagram of establishing a connection between virtual machines in this embodiment
  • 3c is a schematic diagram of a handshake process between virtual machines in this embodiment
  • FIG. 3d is a schematic diagram of network communication in this embodiment.
  • FIG. 4 is a structural block diagram (1) of a data transmission device according to an embodiment of the present invention.
  • FIG. 5 is a structural block diagram (2) of a data transmission device according to an embodiment of the present invention.
  • FIG. 1 is a block diagram of a hardware structure of a mobile terminal of a data transmission method according to an embodiment of the present invention.
  • the mobile terminal 10 may include one or more (only one is shown in FIG. 1) processor 102 (the processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc. ) And a memory 104 configured to store data.
  • the mobile terminal may further include a transmission device 106 configured as a communication function and an input / output device 108.
  • FIG. 1 is merely an illustration, which does not limit the structure of the mobile terminal described above.
  • the mobile terminal 10 may also include more or fewer components than those shown in FIG. 1, or have a different configuration from that shown in FIG.
  • the memory 104 may be configured to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the data transmission method in the embodiment of the present invention, and the processor 102 runs the computer program stored in the memory 104, thereby Implementation of various functional applications and data processing, that is to achieve the above method.
  • the memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory 104 may further include memories remotely provided with respect to the processor 102, and these remote memories may be connected to the mobile terminal 10 through a network. Examples of the above network include but are not limited to the Internet, intranet, local area network, mobile communication network, and combinations thereof.
  • the transmission device 106 is configured to receive or transmit data via a network.
  • the above specific example of the network may include a wireless network provided by a communication provider of the mobile terminal 10.
  • the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC for short), which can be connected to other network devices through the base station to communicate with the Internet.
  • the transmission device 106 may be a radio frequency (Radio Frequency, RF for short) module, which is configured to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • FIG. 2 is a flowchart (1) of the data transmission method according to an embodiment of the present invention. As shown in FIG. 2, the process includes the following steps:
  • Step S202 after determining that the first virtual machine establishes a connection with the second virtual machine, a first fast connection structure is created, where both the first virtual machine and the second virtual machine are connected to the same host;
  • Step S204 Send the first fast connection structure to the second virtual machine to instruct the second virtual machine to establish the second fast connection structure
  • Step S206 the first quick connection structure and the second quick connection structure are used for data transmission.
  • the first virtual machine determines to establish a connection with the second virtual machine, it creates a first quick connection structure and sends the first quick connection structure to the second virtual machine to instruct the second virtual machine to establish the second Quick connection structure; use the first quick connection structure and the second quick connection structure for data transmission.
  • the execution body of the above steps may be a virtual machine, etc., but it is not limited thereto.
  • first virtual machine in this embodiment corresponds to the above-mentioned virtual machine A
  • second virtual machine corresponds to the above-mentioned virtual machine B.
  • This embodiment is not limited to data transmission between two virtual machines. The principle of data transmission between two virtual machines is the same as above.
  • This embodiment mainly includes the connection between the first virtual machine and the second virtual machine and the sending of data.
  • Step 1 The connection between the first virtual machine and the second virtual machine, specifically:
  • the first virtual machine sends to the second virtual machine a connection request set to request to establish a connection between the first virtual machine and the second virtual machine; the connection request initiated by the first virtual machine in time may also be initiated by the second virtual machine first connection.
  • first confirmation message returned by the second virtual machine in response to the connection request, where the first confirmation message also includes a synchronous character (SYN), which is set to synchronize data between the virtual machines;
  • SYN synchronous character
  • the confirmation message may be ACK (Acknowledgement).
  • the first quick connection structure and the second quick connection mechanism in this embodiment may be the key structure of the quick connection ksock, and send the ksock and the ACK in response to the first virtual machine to the second virtual machine.
  • the first confirmation message it is determined that the first virtual machine has established a connection with the second virtual machine.
  • the first quick connection structure is sent to the second virtual machine in the following manner: a second confirmation message carrying the first quick connection structure is sent to the second virtual machine.
  • the second virtual machine After receiving the ACK packet, the second virtual machine checks whether the ksock structure is valid, creates a ksock structure corresponding to the second virtual machine (that is, the second fast connection structure) if valid, and combines the ksock of the second virtual machine with the first
  • the ksocks of the virtual machines are related to each other (that is, the ksock of the virtual machine B can be accessed through the ksock of the virtual machine A, and vice versa).
  • the first virtual machine checks the ksock structure of the first virtual machine when the connect command is executed. If the ksock structure of its associated peer (here, the second virtual machine) is valid, the shared memory is created and set to data transmission. At this point, the quick connection is established. The shared memory is in the host.
  • Step 2 Data transmission, including:
  • the first virtual machine uses the virtual network card front-end driver to copy the data to the shared memory
  • the first virtual machine sends a notification message to the second virtual machine using the first fast connection structure to instruct the second virtual machine to transmit the notification message to the virtual network card front-end driver of the second virtual machine;
  • the front-end driver of the virtual network card of the second virtual machine obtains data from the shared memory.
  • FIG. 3 is a flowchart (2) of the data transmission method according to an embodiment of the present invention. As shown in FIG. 3, the process includes the following steps:
  • Step S302 After determining that the second virtual machine receives the first quick connection structure sent by the first virtual machine, create a second quick connection structure, where both the first virtual machine and the second virtual machine are connected to the same host;
  • Step S304 data transmission is performed using the first quick connection structure and the second quick connection structure.
  • the first virtual machine determines to establish a connection with the second virtual machine, it creates a first fast connection structure and sends the first fast connection structure to the second virtual machine, and the second virtual machine establishes the second fast connection Structure; use the first quick connection structure and the second quick connection structure for data transmission.
  • the execution body of the above steps may be a virtual machine, etc., but it is not limited thereto.
  • first virtual machine in this embodiment corresponds to the above-mentioned virtual machine A
  • second virtual machine corresponds to the above-mentioned virtual machine B.
  • This embodiment is not limited to data transmission between two virtual machines. The principle of data transmission between two virtual machines is the same as above.
  • FIG. 3a is a schematic diagram of the original network communication flow between virtual machines in this embodiment. As shown in FIG. 3a, virtual machine A and virtual machine B are both connected to the host, but there is no relevant connection between virtual machine A and virtual machine B.
  • This embodiment mainly includes the connection between the first virtual machine and the second virtual machine and the sending of data.
  • Step 1 The connection between the first virtual machine and the second virtual machine, specifically:
  • the first virtual machine sends to the second virtual machine a connection request set to request to establish a connection between the first virtual machine and the second virtual machine; the connection request initiated by the first virtual machine in time may also be initiated by the second virtual machine first connection.
  • FIG. 3b is a schematic diagram of establishing a connection between virtual machines in this embodiment. As shown in FIG. 3b, a first quick connection structure (ksock) and a second quick connection between virtual machine A and virtual machine B are established by each The structure (ksock) establishes the connection.
  • a first quick connection structure ksock
  • a second quick connection between virtual machine A and virtual machine B are established by each The structure (ksock) establishes the connection.
  • the first quick connection structure and the second quick connection mechanism in this embodiment may be the key structure of the quick connection ksock, and send the ksock and the ACK in response to the first virtual machine to the second virtual machine.
  • the first confirmation message it is determined that the first virtual machine has established a connection with the second virtual machine.
  • the first quick connection structure is sent to the second virtual machine in the following manner: a second confirmation message carrying the first quick connection structure is sent to the second virtual machine.
  • the second virtual machine After receiving the ACK packet, the second virtual machine checks whether the ksock structure is valid, creates a ksock structure corresponding to the second virtual machine (that is, the second fast connection structure) if valid, and combines the ksock of the second virtual machine with the first
  • the ksocks of the virtual machines are related to each other (that is, the ksock of the virtual machine B can be accessed through the ksock of the virtual machine A, and vice versa).
  • the first virtual machine checks the ksock structure of the first virtual machine when executing the connect command. If the ksock structure of its associated peer (here, the second virtual machine) is valid, the shared memory is created and set to data transmission. At this point, the quick connection is established. The shared memory is in the host.
  • Step 2 Data transmission, including:
  • the first virtual machine uses the virtual network card front-end driver to copy the data to the shared memory
  • FIG. 3c is a schematic diagram of a handshake process between virtual machines in this embodiment. As shown in FIG. 3c, virtual machine A and Virtual machine B reached a communication agreement by three-way handshake.
  • FIG. 3d is a schematic diagram of network communication in this embodiment.
  • the first virtual machine sends a notification message to the second virtual machine using the first fast connection structure to instruct the second virtual machine to transmit the notification message to the second
  • the front-end driver of the virtual network card of the virtual machine the front-end driver of the virtual network card of the second virtual machine obtains data from the shared memory.
  • first quick connection structure and the second quick connection structure in this embodiment are as follows:
  • gpa_t u_sock corresponds to the socket structure of the Guest application
  • the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solutions of the embodiments of the present invention may be embodied in the form of software products in essence or part of contributions to the existing technology, and the computer software products are stored in a storage medium (such as ROM / RAM, magnetic Discs, compact discs), including several instructions to enable a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the method described in each embodiment of the present invention.
  • a data transmission device is also provided.
  • the device is configured to implement the above-mentioned embodiments and preferred implementation modes, and those that have already been described will not be repeated.
  • the term "module” may implement a combination of software and / or hardware that performs predetermined functions.
  • the devices described in the following embodiments are preferably implemented in software, implementation of hardware or a combination of software and hardware is also possible and conceived.
  • FIG. 4 is a structural block diagram (1) of a data transmission device according to an embodiment of the present invention. As shown in FIG. 4, the device includes: a first creation module 42, a first sending module 44, and a first transmission module 46. Detailed description of the device:
  • the first creation module 42 is configured to create a first fast connection structure after determining that the first virtual machine establishes a connection with the second virtual machine, where both the first virtual machine and the second virtual machine are connected to the same host;
  • the first sending module 44 is connected to the first creation module 42 described above, and is configured to send the first quick connection structure to the second virtual machine to instruct the second virtual machine to establish the second quick connection structure;
  • the first transmission module 46 is connected to the first sending module 44 described above, and is configured to perform data transmission using the first quick connection structure and the second quick connection structure.
  • the first virtual machine determines to establish a connection with the second virtual machine, it creates a first quick connection structure and sends the first quick connection structure to the second virtual machine to instruct the second virtual machine to establish the second Quick connection structure; use the first quick connection structure and the second quick connection structure for data transmission.
  • the execution body of the above steps may be a virtual machine, etc., but it is not limited thereto.
  • first virtual machine in this embodiment corresponds to the above-mentioned virtual machine A
  • second virtual machine corresponds to the above-mentioned virtual machine B.
  • This embodiment is not limited to data transmission between two virtual machines. The principle of data transmission between two virtual machines is the same as above.
  • This embodiment mainly includes the connection between the first virtual machine and the second virtual machine and the sending of data.
  • Step 1 The connection between the first virtual machine and the second virtual machine, specifically:
  • the first virtual machine sends to the second virtual machine a connection request set to request to establish a connection between the first virtual machine and the second virtual machine; the connection request initiated by the first virtual machine in time may also be initiated by the second virtual machine first connection.
  • first confirmation message returned by the second virtual machine in response to the connection request, where the first confirmation message also includes a synchronous character (SYN), which is set to synchronize data between the virtual machines;
  • SYN synchronous character
  • the confirmation message may be ACK (Acknowledgement).
  • the first quick connection structure and the second quick connection mechanism in this embodiment may be the key structure of the quick connection ksock, and send the ksock and the ACK in response to the first virtual machine to the second virtual machine.
  • the first confirmation message it is determined that the first virtual machine has established a connection with the second virtual machine.
  • the first quick connection structure is sent to the second virtual machine in the following manner: a second confirmation message carrying the first quick connection structure is sent to the second virtual machine.
  • the second virtual machine After receiving the ACK packet, the second virtual machine checks whether the ksock structure is valid, creates a ksock structure corresponding to the second virtual machine (that is, the second fast connection structure) if valid, and combines the ksock of the second virtual machine with the first
  • the ksocks of the virtual machines are related to each other (that is, the ksock of the virtual machine B can be accessed through the ksock of the virtual machine A, and vice versa).
  • the first virtual machine checks the ksock structure of the first virtual machine when executing the connect command. If the ksock structure of its associated peer (here, the second virtual machine) is valid, the shared memory is created and set to data transmission. At this point, the quick connection is established. The shared memory is in the host.
  • Step 2 Data transmission, including:
  • the first virtual machine uses the virtual network card front-end driver to copy the data to the shared memory
  • the first virtual machine sends a notification message to the second virtual machine using the first fast connection structure to instruct the second virtual machine to transmit the notification message to the virtual network card front-end driver of the second virtual machine;
  • the front-end driver of the virtual network card of the second virtual machine obtains data from the shared memory.
  • FIG. 5 is a structural block diagram (2) of a data transmission device according to an embodiment of the present invention. As shown in FIG. 5, the device includes: a second creation module 52 and a second transmission module 54. The device will be described in detail below :
  • the second creation module 52 is configured to create a second quick connection structure after determining that the second virtual machine receives the first quick connection structure sent by the first virtual machine, where the first virtual machine and the second virtual machine are both the same Host connection;
  • the second transmission module 54 is connected to the second creation module 52 described above, and is configured to perform data transmission using the first quick connection structure and the second quick connection structure.
  • the first virtual machine determines to establish a connection with the second virtual machine, it creates a first quick connection structure and sends the first quick connection structure to the second virtual machine to instruct the second virtual machine to establish the second Quick connection structure; use the first quick connection structure and the second quick connection structure for data transmission.
  • the execution body of the above steps may be a virtual machine, etc., but it is not limited thereto.
  • first virtual machine in this embodiment corresponds to the above-mentioned virtual machine A
  • second virtual machine corresponds to the above-mentioned virtual machine B.
  • This embodiment is not limited to data transmission between two virtual machines. The principle of data transmission between two virtual machines is the same as above.
  • This embodiment mainly includes the connection between the first virtual machine and the second virtual machine and the sending of data.
  • Step 1 The connection between the first virtual machine and the second virtual machine, specifically:
  • the first virtual machine sends to the second virtual machine a connection request set to request to establish a connection between the first virtual machine and the second virtual machine; the connection request initiated by the first virtual machine in time may also be initiated by the second virtual machine first connection.
  • first confirmation message returned by the second virtual machine in response to the connection request, where the first confirmation message also includes a synchronous character (SYN), which is set to synchronize data between the virtual machines;
  • SYN synchronous character
  • the confirmation message may be ACK (Acknowledgement).
  • the first quick connection structure and the second quick connection mechanism in this embodiment may be the key structure of the quick connection ksock, and send the ksock and the ACK in response to the first virtual machine to the second virtual machine.
  • the first confirmation message it is determined that the first virtual machine has established a connection with the second virtual machine.
  • the first quick connection structure is sent to the second virtual machine in the following manner: a second confirmation message carrying the first quick connection structure is sent to the second virtual machine.
  • the second virtual machine After receiving the ACK packet, the second virtual machine checks whether the ksock structure is valid, creates a ksock structure corresponding to the second virtual machine (that is, the second fast connection structure) if valid, and combines the ksock of the second virtual machine with the first
  • the ksocks of the virtual machines are related to each other (that is, the ksock of the virtual machine B can be accessed through the ksock of the virtual machine A, and vice versa).
  • the first virtual machine checks the ksock structure of the first virtual machine when executing the connect command. If the ksock structure of its associated peer (here, the second virtual machine) is valid, the shared memory is created and set to data transmission. At this point, the quick connection is established. The shared memory is in the host.
  • Step 2 Data transmission, including:
  • the first virtual machine uses the virtual network card front-end driver to copy the data to the shared memory
  • the first virtual machine sends a notification message to the second virtual machine using the first fast connection structure to instruct the second virtual machine to transmit the notification message to the virtual network card front-end driver of the second virtual machine;
  • the front-end driver of the virtual network card of the second virtual machine obtains data from the shared memory.
  • the above modules can be implemented by software or hardware, and the latter can be implemented by the following methods, but not limited to this: the above modules are all located in the same processor; or, the above modules can be combined in any combination The forms are located in different processors.
  • An embodiment of the embodiments of the present invention further provides a storage medium in which a computer program is stored, wherein the computer program is configured to execute the steps in any one of the foregoing method embodiments during runtime.
  • the above storage medium may be set to store the computer program set to perform the above steps.
  • the above storage medium may include, but is not limited to: a USB flash drive, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.
  • An embodiment of the embodiment of the present invention further provides an electronic device, including a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to perform any of the steps in the above method embodiments .
  • the electronic device may further include a transmission device and an input-output device, wherein the transmission device is connected to the processor, and the input-output device is connected to the processor.
  • the above processor may be configured to execute the above steps through a computer program.
  • modules or steps in the above embodiments of the present invention can be implemented by a general-purpose computing device.
  • they can be implemented with program code executable by the computing device, so that they can be stored in the storage device and executed by the computing device, and in some cases, can be different from here
  • the steps shown or described are executed in the order of, or they are made into individual integrated circuit modules separately, or multiple modules or steps among them are made into a single integrated circuit module for implementation. In this way, the embodiments of the present invention are not limited to any specific combination of hardware and software.
  • the data transmission method and device, storage medium, and electronic device provided by the embodiments of the present invention have the following beneficial effects: the problem of long communication paths between virtual machines and inefficient data transmission is solved, and thus Improve the efficiency of data transmission.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

本发明实施例提供了一种数据的传输方法及装置、存储介质、电子装置,该方法包括:在确定第一虚拟机与第二虚拟机建立连接之后,创建第一快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;利用第一快速连接结构和第二快速连接结构进行数据传输。通过本发明实施例,解决了虚拟机之间的通信路径较长,数据传输低效的问题,进而达到了提高数据传输效率的效果。

Description

数据的传输方法及装置、存储介质、电子装置 技术领域
本发明实施例涉及通信领域,具体而言,涉及一种数据的传输方法及装置、存储介质、电子装置。
背景技术
在虚拟化环境下,同一个主机上启动多个虚拟机,每个虚拟机配置的每个虚拟网卡都会挂载到同一个主机上的一个虚拟网桥上。虚拟机之间的网络通信在现有模式下其路径较长,低效。例如:从虚机A的虚拟网卡前端到虚机A的后端驱动,再经过主机的网络协议栈后转发到虚机B的虚拟网卡后端驱动,再到虚拟网卡的前端驱动。
针对上述技术问题,相关技术中尚未提出有效的解决方案。
发明内容
本发明实施例实施例提供了一种数据的传输方法及装置、存储介质、电子装置,以至少解决相关技术中虚拟机之间的通信路径较长,数据传输低效的问题。
根据本发明实施例的一个实施例,提供了一种数据的传输方法,包括:在确定第一虚拟机与第二虚拟机建立连接之后,创建第一快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;利用第一快速连接结构和第二快速连接结构进行数据传输。
根据本发明实施例的另一个实施例,提供了一种数据传输方法,包括:在确定第二虚拟机接收到第一虚拟机发送的第一快速连接结构之后,创建第二快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;利用第一快速连接结构和第二快速连接结构进行数据传输。
根据本发明实施例的另一个实施例,提供了一种数据的传输装置,包 括:第一创建模块,设置为在确定第一虚拟机与第二虚拟机建立连接之后,创建第一快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;第一发送模块,设置为将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;第一传输模块,设置为利用第一快速连接结构和第二快速连接结构进行数据传输。
根据本发明实施例的另一个实施例,提供了一种数据传输装置,包括:第二创建模块,设置为在确定第二虚拟机接收到第一虚拟机发送的第一快速连接结构之后,创建第二快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;第二传输模块,设置为利用第一快速连接结构和第二快速连接结构进行数据传输。
根据本发明实施例的又一个实施例,还提供了一种存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
根据本发明实施例的又一个实施例,还提供了一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行上述任一项方法实施例中的步骤。
通过本发明实施例,由于第一虚拟机在确定与第二虚拟机建立连接之后,创建第一快速连接结构,并将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;利用第一快速连接结构和第二快速连接结构进行数据传输。使得第一虚拟机和第二虚拟机之间的数据传输路径简化。因此,可以解决相关技术中存在的虚拟机之间的通信路径较长,数据传输低效的问题,达到提高数据传输效率的效果。
附图说明
此处所说明的附图用来提供对本发明实施例的进一步理解,构成本申请的一部分,本发明实施例的示意性实施例及其说明设置为解释本发明实施例,并不构成对本发明实施例的不当限定。在附图中:
图1是本发明实施例的一种数据的传输方法的移动终端的硬件结构框 图;
图2是根据本发明实施例的数据的传输方法的流程图(一);
图3是根据本发明实施例的数据的传输方法的流程图(二);
图3a是本实施例中虚拟间原始网络通信流程示意图;
图3b是本实施例中虚拟机之间建立连接的示意图;
图3c是本实施例中的虚拟机之间的握手过程示意图;
图3d是本实施例中的网络通信示意图;
图4是根据本发明实施例的数据的传输装置的结构框图(一);
图5是根据本发明实施例的数据的传输装置的结构框图(二)。
具体实施方式
下文中将参考附图并结合实施例来详细说明本发明实施例。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
需要说明的是,本发明实施例的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是设置为区别类似的对象,而不必设置为描述特定的顺序或先后次序。
本申请实施例所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,图1是本发明实施例的一种数据的传输方法的移动终端的硬件结构框图。如图1所示,移动终端10可以包括一个或多个(图1中仅示出一个)处理器102(处理器102可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)和设置为存储数据的存储器104,可选地,上述移动终端还可以包括设置为通信功能的传输设备106以及输入输出设备108。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端10还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。
存储器104可设置为存储计算机程序,例如,应用软件的软件程序以及模块,如本发明实施例中的数据的传输方法对应的计算机程序,处理器102通过运行存储在存储器104内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的方法。存储器104可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器104可进一步包括相对于处理器102远程设置的存储器,这些远程存储器可以通过网络连接至移动终端10。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置106设置为经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端10的通信供应商提供的无线网络。在一个实例中,传输装置106包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置106可以为射频(Radio Frequency,简称为RF)模块,其设置为通过无线方式与互联网进行通讯。
在本实施例中提供了一种数据的传输方法,图2是根据本发明实施例的数据的传输方法的流程图(一),如图2所示,该流程包括如下步骤:
步骤S202,在确定第一虚拟机与第二虚拟机建立连接之后,创建第一快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;
步骤S204,将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;
步骤S206,利用第一快速连接结构和第二快速连接结构进行数据传输。
通过上述步骤,由于第一虚拟机在确定与第二虚拟机建立连接之后,创建第一快速连接结构,并将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;利用第一快速连接结构和第二快速连接结构进行数据传输。使得第一虚拟机和第二虚拟机之间的数据传输路 径简化。因此,可以解决相关技术中存在的虚拟机之间的通信路径较长,数据传输低效的问题,达到提高数据传输效率的效果。
可选地,上述步骤的执行主体可以为虚拟机等,但不限于此。
需要说明的是,本实施例中的第一虚拟机对应于上述中的虚拟机A,第二虚拟机对应于上述中的虚拟机B。本实施例并不限于两个虚拟机之间的数据传输,超过两个虚拟机之间的数据传输原理同上。
本实施例主要包括第一虚拟机与第二虚拟机之间的连接和数据的发送两部分。
第一步:第一虚拟机与第二虚拟机之间的连接,具体为:
第一虚拟机向第二虚拟机发送设置为请求建立第一虚拟机和第二虚拟机之间的连接的连接请求;及时第一虚拟机发起的连接请求,也可以是第二虚拟机先发起连接。
接收第二虚拟机返回的设置为响应连接请求的第一确认消息,其中,第一确认消息中还包括同步字符(synchronous Character,简称为SYN),设置为虚拟机之间的数据同步;第一确认消息可以是ACK(Acknowledgement)。
本实施例中的第一快速连接结构和第二快速连接机构可以是快速连接的关键结构ksock,将ksock及应答第一虚拟机的ACK发送到第二虚拟机。根据第一确认消息确定第一虚拟机与第二虚拟机建立了连接。
需要说明的是,通过以下方式将第一快速连接结构发送给第二虚拟机:将携带第一快速连接结构的第二确认消息发送到第二虚拟机。
第二虚拟机收到ACK包后,检查ksock结构是否有效,在有效的情况下创建对应第二虚拟机的ksock结构(即第二快速连接结构),并将第二虚拟机的ksock和第一虚拟机的ksock相互建立关联(即通过虚机A的ksock可以访问到虚机B的ksock,反之亦然)。
第一虚拟机在执行connect命令的时候检查第一虚拟机的ksock结构, 如果其关联的对端(此处即第二虚拟机)的ksock结构有效,则创建共享内存设置为数据传输。到此快速连接建立完成。共享内存是在主机中的。
第二步:数据传输,具体包括:
在建立的第一快速连接结构中的数据和第二快速连接结构中的数据之间的映射关系有效的情况下;第一虚拟机利用虚拟网卡前端驱动将数据拷贝到共享内存中;
第一虚拟机利用第一快速连接结构向第二虚拟机发送通知消息,以指示第二虚拟机将通知消息传输到第二虚拟机的虚拟网卡前端驱动;
第二虚拟机的虚拟网卡前端驱动从共享内存中获取数据。
在本实施例中提供了一种数据的传输方法,图3是根据本发明实施例的数据的传输方法的流程图(二),如图3所示,该流程包括如下步骤:
步骤S302,在确定第二虚拟机接收到第一虚拟机发送的第一快速连接结构之后,创建第二快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;
步骤S304,利用第一快速连接结构和第二快速连接结构进行数据传输。
通过上述步骤,由于第一虚拟机在确定与第二虚拟机建立连接之后,创建第一快速连接结构,并将第一快速连接结构发送给第二虚拟机,第二虚拟机建立第二快速连接结构;利用第一快速连接结构和第二快速连接结构进行数据传输。使得第一虚拟机和第二虚拟机之间的数据传输路径简化。因此,可以解决相关技术中存在的虚拟机之间的通信路径较长,数据传输低效的问题,达到提高数据传输效率的效果。
可选地,上述步骤的执行主体可以为虚拟机等,但不限于此。
需要说明的是,本实施例中的第一虚拟机对应于上述中的虚拟机A,第二虚拟机对应于上述中的虚拟机B。本实施例并不限于两个虚拟机之间的数据传输,超过两个虚拟机之间的数据传输原理同上。
图3a是本实施例中虚拟间原始网络通信流程示意图,如图3a所示,虚拟机A和虚拟机B均与主机连接,但虚拟机A和虚拟机B之间并没有相关连接。
本实施例主要包括第一虚拟机与第二虚拟机之间的连接和数据的发送两部分。
第一步:第一虚拟机与第二虚拟机之间的连接,具体为:
第一虚拟机向第二虚拟机发送设置为请求建立第一虚拟机和第二虚拟机之间的连接的连接请求;及时第一虚拟机发起的连接请求,也可以是第二虚拟机先发起连接。
接收第二虚拟机返回的设置为响应连接请求的第一确认消息,其中,第一确认消息中还包括同步字符(synchronous Character,简称为SYN),设置为虚拟机之间的数据同步;第一确认消息可以是ACK(Acknowledgement)。例如:图3b是本实施例中虚拟机之间建立连接的示意图,如图3b所示,虚拟机A和虚拟机B之间通过各自建立的第一快速连接结构(ksock)和第二快速连接结构(ksock)建立连接。
本实施例中的第一快速连接结构和第二快速连接机构可以是快速连接的关键结构ksock,将ksock及应答第一虚拟机的ACK发送到第二虚拟机。根据第一确认消息确定第一虚拟机与第二虚拟机建立了连接。
需要说明的是,通过以下方式将第一快速连接结构发送给第二虚拟机:将携带第一快速连接结构的第二确认消息发送到第二虚拟机。
第二虚拟机收到ACK包后,检查ksock结构是否有效,在有效的情况下创建对应第二虚拟机的ksock结构(即第二快速连接结构),并将第二虚拟机的ksock和第一虚拟机的ksock相互建立关联(即通过虚机A的ksock可以访问到虚机B的ksock,反之亦然)。
第一虚拟机在执行connect命令的时候检查第一虚拟机的ksock结构,如果其关联的对端(此处即第二虚拟机)的ksock结构有效,则创建共享内存设置为数据传输。到此快速连接建立完成。共享内存是在主机中的。
第二步:数据传输,具体包括:
在建立的第一快速连接结构中的数据和第二快速连接结构中的数据之间的映射关系有效的情况下;第一虚拟机利用虚拟网卡前端驱动将数据拷贝到共享内存中;
在进行通信之间,第一虚拟机和第二虚拟机之间通过握手达成通信协议,图3c是本实施例中的虚拟机之间的握手过程示意图,如图3c所示,虚拟机A和虚拟机B通过三次握手的方式达成通信协议。
图3d是本实施例中的网络通信示意图,如图3d所示,第一虚拟机利用第一快速连接结构向第二虚拟机发送通知消息,以指示第二虚拟机将通知消息传输到第二虚拟机的虚拟网卡前端驱动;第二虚拟机的虚拟网卡前端驱动从共享内存中获取数据。
可选地,本实施例中的第一快速连接结构和第二快速连接结构的具体结构和作用如下:
具体结构:
struct ksock{
...
struct ksock*remote_ksock;连接对端的ksock
struct eventfd*notify;设置为中断传输(控制流)
void*shared_memptr;共享内存指针
gpa_t u_sock对应Guest应用的socket结构
...
}
作用:
记录通信对端连接信息;
记录通信传输控制信息;
记录通信传输数据地址;
记录网络协议socket连接socket信息。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本发明实施例各个实施例所述的方法。
在本实施例中还提供了一种数据的传输装置,该装置设置为实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图4是根据本发明实施例的数据的传输装置的结构框图(一),如图4所示,该装置包括:第一创建模块42、第一发送模块44以及第一传输模块46,下面对该装置进行详细说明:
第一创建模块42,设置为在确定第一虚拟机与第二虚拟机建立连接之后,创建第一快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;
第一发送模块44,连接至上述中的第一创建模块42,设置为将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;
第一传输模块46,连接上述中的第一发送模块44,设置为利用第一快速连接结构和第二快速连接结构进行数据传输。
通过上述步骤,由于第一虚拟机在确定与第二虚拟机建立连接之后, 创建第一快速连接结构,并将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;利用第一快速连接结构和第二快速连接结构进行数据传输。使得第一虚拟机和第二虚拟机之间的数据传输路径简化。因此,可以解决相关技术中存在的虚拟机之间的通信路径较长,数据传输低效的问题,达到提高数据传输效率的效果。
可选地,上述步骤的执行主体可以为虚拟机等,但不限于此。
需要说明的是,本实施例中的第一虚拟机对应于上述中的虚拟机A,第二虚拟机对应于上述中的虚拟机B。本实施例并不限于两个虚拟机之间的数据传输,超过两个虚拟机之间的数据传输原理同上。
本实施例主要包括第一虚拟机与第二虚拟机之间的连接和数据的发送两部分。
第一步:第一虚拟机与第二虚拟机之间的连接,具体为:
第一虚拟机向第二虚拟机发送设置为请求建立第一虚拟机和第二虚拟机之间的连接的连接请求;及时第一虚拟机发起的连接请求,也可以是第二虚拟机先发起连接。
接收第二虚拟机返回的设置为响应连接请求的第一确认消息,其中,第一确认消息中还包括同步字符(synchronous Character,简称为SYN),设置为虚拟机之间的数据同步;第一确认消息可以是ACK(Acknowledgement)。
本实施例中的第一快速连接结构和第二快速连接机构可以是快速连接的关键结构ksock,将ksock及应答第一虚拟机的ACK发送到第二虚拟机。根据第一确认消息确定第一虚拟机与第二虚拟机建立了连接。
需要说明的是,通过以下方式将第一快速连接结构发送给第二虚拟机:将携带第一快速连接结构的第二确认消息发送到第二虚拟机。
第二虚拟机收到ACK包后,检查ksock结构是否有效,在有效的情况下创建对应第二虚拟机的ksock结构(即第二快速连接结构),并将第二虚拟机的ksock和第一虚拟机的ksock相互建立关联(即通过虚机A的 ksock可以访问到虚机B的ksock,反之亦然)。
第一虚拟机在执行connect命令的时候检查第一虚拟机的ksock结构,如果其关联的对端(此处即第二虚拟机)的ksock结构有效,则创建共享内存设置为数据传输。到此快速连接建立完成。共享内存是在主机中的。
第二步:数据传输,具体包括:
在建立的第一快速连接结构中的数据和第二快速连接结构中的数据之间的映射关系有效的情况下;第一虚拟机利用虚拟网卡前端驱动将数据拷贝到共享内存中;
第一虚拟机利用第一快速连接结构向第二虚拟机发送通知消息,以指示第二虚拟机将通知消息传输到第二虚拟机的虚拟网卡前端驱动;
第二虚拟机的虚拟网卡前端驱动从共享内存中获取数据。
图5是根据本发明实施例的数据的传输装置的结构框图(二),如图5所示,该装置包括:第二创建模块52和第二传输模块54,下面对该装置进行详细说明:
第二创建模块52,设置为在确定第二虚拟机接收到第一虚拟机发送的第一快速连接结构之后,创建第二快速连接结构,其中,第一虚拟机和第二虚拟机均与同一主机连接;
第二传输模块54,连接至上述中的第二创建模块52,设置为利用第一快速连接结构和第二快速连接结构进行数据传输。
通过上述步骤,由于第一虚拟机在确定与第二虚拟机建立连接之后,创建第一快速连接结构,并将第一快速连接结构发送给第二虚拟机,以指示第二虚拟机建立第二快速连接结构;利用第一快速连接结构和第二快速连接结构进行数据传输。使得第一虚拟机和第二虚拟机之间的数据传输路径简化。因此,可以解决相关技术中存在的虚拟机之间的通信路径较长,数据传输低效的问题,达到提高数据传输效率的效果。
可选地,上述步骤的执行主体可以为虚拟机等,但不限于此。
需要说明的是,本实施例中的第一虚拟机对应于上述中的虚拟机A,第二虚拟机对应于上述中的虚拟机B。本实施例并不限于两个虚拟机之间的数据传输,超过两个虚拟机之间的数据传输原理同上。
本实施例主要包括第一虚拟机与第二虚拟机之间的连接和数据的发送两部分。
第一步:第一虚拟机与第二虚拟机之间的连接,具体为:
第一虚拟机向第二虚拟机发送设置为请求建立第一虚拟机和第二虚拟机之间的连接的连接请求;及时第一虚拟机发起的连接请求,也可以是第二虚拟机先发起连接。
接收第二虚拟机返回的设置为响应连接请求的第一确认消息,其中,第一确认消息中还包括同步字符(synchronous Character,简称为SYN),设置为虚拟机之间的数据同步;第一确认消息可以是ACK(Acknowledgement)。
本实施例中的第一快速连接结构和第二快速连接机构可以是快速连接的关键结构ksock,将ksock及应答第一虚拟机的ACK发送到第二虚拟机。根据第一确认消息确定第一虚拟机与第二虚拟机建立了连接。
需要说明的是,通过以下方式将第一快速连接结构发送给第二虚拟机:将携带第一快速连接结构的第二确认消息发送到第二虚拟机。
第二虚拟机收到ACK包后,检查ksock结构是否有效,在有效的情况下创建对应第二虚拟机的ksock结构(即第二快速连接结构),并将第二虚拟机的ksock和第一虚拟机的ksock相互建立关联(即通过虚机A的ksock可以访问到虚机B的ksock,反之亦然)。
第一虚拟机在执行connect命令的时候检查第一虚拟机的ksock结构,如果其关联的对端(此处即第二虚拟机)的ksock结构有效,则创建共享内存设置为数据传输。到此快速连接建立完成。共享内存是在主机中的。
第二步:数据传输,具体包括:
在建立的第一快速连接结构中的数据和第二快速连接结构中的数据之间的映射关系有效的情况下;第一虚拟机利用虚拟网卡前端驱动将数据拷贝到共享内存中;
第一虚拟机利用第一快速连接结构向第二虚拟机发送通知消息,以指示第二虚拟机将通知消息传输到第二虚拟机的虚拟网卡前端驱动;
第二虚拟机的虚拟网卡前端驱动从共享内存中获取数据。
需要说明的是,上述各个模块是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述模块均位于同一处理器中;或者,上述各个模块以任意组合的形式分别位于不同的处理器中。
本发明实施例的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储设置为执行以上步骤的计算机程序。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本发明实施例的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以上各步骤。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式 中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本发明实施例的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明实施例不限制于任何特定的硬件和软件结合。
以上所述仅为本发明实施例的优选实施例而已,并不设置为限制本发明实施例,对于本领域的技术人员来说,本发明实施例可以有各种更改和变化。凡在本发明实施例的原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明实施例的保护范围之内。
工业实用性
如上所述,本发明实施例提供的一种数据的传输方法及装置、存储介质、电子装置具有以下有益效果:解决了虚拟机之间的通信路径较长,数据传输低效的问题,进而达到了提高数据传输效率的效果。

Claims (13)

  1. 一种数据的传输方法,包括:
    在确定第一虚拟机与第二虚拟机建立连接之后,创建第一快速连接结构,其中,所述第一虚拟机和所述第二虚拟机均与同一主机连接;
    将所述第一快速连接结构发送给所述第二虚拟机,以指示所述第二虚拟机建立第二快速连接结构;
    利用所述第一快速连接结构和所述第二快速连接结构进行数据传输。
  2. 根据权利要求1所述的方法,其中,在创建所述第一快速连接结构之前,所述方法还包括:确定所述第一虚拟机与所述第二虚拟机建立连接,其中,确定所述第一虚拟机与所述第二虚拟机建立连接包括:
    向所述第二虚拟机发送设置为请求建立所述第一虚拟机和所述第二虚拟机之间的连接的连接请求;
    接收所述第二虚拟机返回的设置为响应所述连接请求的第一确认消息;
    根据所述第一确认消息确定所述第一虚拟机与所述第二虚拟机建立了连接。
  3. 根据权利要求1所述的方法,其中,将所述第一快速连接结构发送给所述第二虚拟机包括:
    将携带所述第一快速连接结构的第二确认消息发送到所述第二虚拟机。
  4. 根据权利要求1所述的方法,其中,在利用所述第一快速连接结构和所述第二快速连接结构进行所述数据传输之前,所述方法还包括:
    在检查到所述第一快速连接结构与所述第二快速连接结构之间的映射有效的情况下,确定共享内存。
  5. 根据权利要求4所述的方法,其中,利用所述第一快速连接结构和所述第二快速连接结构进行所述数据传输包括:
    建立所述第一快速连接结构中的数据和所述第二快速连接结构中的数据之间的映射关系;
    利用所述第一虚拟机的虚拟网卡前端驱动将所述数据拷贝到所述共享内存中;
    利用所述第一快速连接结构向所述第二虚拟机发送通知消息,以指示所述第二虚拟机将所述通知消息传输到所述第二虚拟机的虚拟网卡前端驱动,使得所述第二虚拟机的虚拟网卡前端驱动从所述共享内存中获取所述数据。
  6. 一种数据传输方法,包括:
    在确定第二虚拟机接收到第一虚拟机发送的第一快速连接结构之后,创建第二快速连接结构,其中,所述第一虚拟机和所述第二虚拟机均与同一主机连接;
    利用所述第一快速连接结构和所述第二快速连接结构进行数据传输。
  7. 根据权利要求6所述的方法,其中,在确定所述第二虚拟机接收到所述第一虚拟机发送的所述第一快速连接结构之前,所述方法还包括:确定所述第一虚拟机与所述第二虚拟机建立连接,其中,确定所述第一虚拟机与所述第二虚拟机建立连接包括:
    接收所述第一虚拟机发送的设置为请求建立所述第一虚拟机和所述第二虚拟机之间的连接的连接请求;
    向所述第一虚拟机发送设置为响应所述连接请求的第一确认消息;
    根据所述第一确认消息确定所述第一虚拟机与所述第二虚拟机建立了连接。
  8. 根据权利要求6所述的方法,其中,接收所述第一虚拟机发送的所述第一快速连接结构包括:
    接收所述第一虚拟机发送的第二确认消息,其中,所述第二确认消息中携带所述第一快速连接结构。
  9. 根据权利要求6所述的方法,其中,利用所述第一快速连接结构和所述第二快速连接结构进行所述数据传输包括:
    建立所述第一快速连接结构中的数据和所述第二快速连接结构中的数据之间的映射关系;
    接收所述第一虚拟机的虚拟网卡前端驱动发送的通知消息;
    将所述通知消息发送到第二虚拟机的虚拟网卡前端驱动,使得所述第二虚拟机的虚拟网卡前端驱动从共享内存中获取所述数据;
    其中,所述共享内存是所述第一虚拟机在检查到所述第一快速连接结构与所述第二快速连接结构之间的映射有效的情况下确定的。
  10. 一种数据的传输装置,包括:
    第一创建模块,设置为在确定第一虚拟机与第二虚拟机建立连接之后,创建第一快速连接结构,其中,所述第一虚拟机和所述第二虚拟机均与同一主机连接;
    第一发送模块,设置为将所述第一快速连接结构发送给所述第二虚拟机,以指示所述第二虚拟机建立第二快速连接结构;
    第一传输模块,设置为利用所述第一快速连接结构和所述第二快速连接结构进行数据传输。
  11. 一种数据传输装置,包括:
    第二创建模块,设置为在确定第二虚拟机接收到第一虚拟机发送的第一快速连接结构之后,创建第二快速连接结构,其中,所述第一虚拟机和所述第二虚拟机均与同一主机连接;
    第二传输模块,设置为利用所述第一快速连接结构和所述第二快速连接结构进行数据传输。
  12. 一种计算机可读的存储介质,所述存储介质中存储有计算机程序,其中,所述计算机程序被设置为运行时执行所述权利要求1至5任一项中所述的方法,或者,执行所述权利要求6至9任一项中所述的方法。
  13. 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为运行所述计算机程序以执行所述权利要求1至5任一项中所述的方法,或者,执行所述权利要求6至9任一项中所述的方法。
PCT/CN2019/110996 2018-10-26 2019-10-14 数据的传输方法及装置、存储介质、电子装置 WO2020083060A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811260211.3A CN111107663B (zh) 2018-10-26 2018-10-26 数据的传输方法及装置、存储介质、电子装置
CN201811260211.3 2018-10-26

Publications (1)

Publication Number Publication Date
WO2020083060A1 true WO2020083060A1 (zh) 2020-04-30

Family

ID=70331848

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/110996 WO2020083060A1 (zh) 2018-10-26 2019-10-14 数据的传输方法及装置、存储介质、电子装置

Country Status (2)

Country Link
CN (1) CN111107663B (zh)
WO (1) WO2020083060A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120005401A1 (en) * 2010-06-30 2012-01-05 International Business Machines Corporation Page buffering in a virtualized, memory sharing configuration
CN103559075A (zh) * 2013-10-30 2014-02-05 华为技术有限公司 一种数据传输方法、装置和系统及内存装置
CN106612306A (zh) * 2015-10-22 2017-05-03 中兴通讯股份有限公司 虚拟机的数据共享方法及装置
CN107453845A (zh) * 2016-03-31 2017-12-08 阿里巴巴集团控股有限公司 应答确认方法及设备

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9563454B2 (en) * 2015-02-03 2017-02-07 International Business Machines Corporation Using a mobile device to transfer virtual machine between computers while preserving session

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120005401A1 (en) * 2010-06-30 2012-01-05 International Business Machines Corporation Page buffering in a virtualized, memory sharing configuration
CN103559075A (zh) * 2013-10-30 2014-02-05 华为技术有限公司 一种数据传输方法、装置和系统及内存装置
CN106612306A (zh) * 2015-10-22 2017-05-03 中兴通讯股份有限公司 虚拟机的数据共享方法及装置
CN107453845A (zh) * 2016-03-31 2017-12-08 阿里巴巴集团控股有限公司 应答确认方法及设备

Also Published As

Publication number Publication date
CN111107663A (zh) 2020-05-05
CN111107663B (zh) 2022-09-27

Similar Documents

Publication Publication Date Title
US10701177B2 (en) Automatic data request recovery after session failure
US10721309B2 (en) System and method for supporting data communication in a heterogeneous environment
US9912560B2 (en) Method and device for checking health of link
TWI458314B (zh) 傳送遠端封包至主機的伺服器系統及其管理方法
US11856065B2 (en) Data transmission for service integration between a virtual private cloud and an intranet
WO2022095348A1 (zh) 一种计算资源的远程映射方法、装置、设备及存储介质
CN111078607B (zh) 面向rdma与非易失性内存的网络访问编程框架部署方法及系统
WO2013071747A1 (zh) 一种获取文件的方法和装置
US11632361B2 (en) Combined authentication and connection establishment for a communication channel
US20080244085A1 (en) System and Method of Delaying Connection Acceptance to Support Connection Request Processing at Layer-7
WO2018214911A1 (zh) 一种数据传输的方法、装置及电子设备
CN112261094A (zh) 一种报文处理方法及代理服务器
US20230152978A1 (en) Data Access Method and Related Device
WO2017107886A1 (zh) 一种ip硬盘之间传输数据的方法和装置
WO2024067529A1 (zh) 基于rdma的建连方法、装置、设备及存储介质
WO2020083060A1 (zh) 数据的传输方法及装置、存储介质、电子装置
CN117135189A (zh) 服务器的访问方法及装置、存储介质、电子设备
WO2020119608A1 (zh) 基于Spark Shuffle的远程直接内存访问系统及方法
CN111416851A (zh) 在多个负载均衡器之间进行会话同步的方法和负载均衡器
US20160266887A1 (en) Method and System of Processing an Image Upgrade
CN111416852A (zh) 在多个负载均衡器之间进行会话同步的方法和负载均衡器
CN105763519A (zh) 一种一致性控制方法,装置及系统
US20220058046A1 (en) Connectivity Migration in a Virtual Execution System
WO2016197995A1 (zh) 一种无状态网络协议中实现有状态操作的方法及装置
CN112134910B (zh) 网络请求调试方法、装置、设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19875008

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 27/08/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19875008

Country of ref document: EP

Kind code of ref document: A1