CN109426545B - Data communication method and device - Google Patents
Data communication method and device Download PDFInfo
- Publication number
- CN109426545B CN109426545B CN201710770800.5A CN201710770800A CN109426545B CN 109426545 B CN109426545 B CN 109426545B CN 201710770800 A CN201710770800 A CN 201710770800A CN 109426545 B CN109426545 B CN 109426545B
- Authority
- CN
- China
- Prior art keywords
- computer system
- equipment
- communication channel
- data communication
- computer
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
- G06F2009/45579—I/O management, e.g. providing access to device drivers or storage
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer And Data Communications (AREA)
Abstract
The application provides a data communication method and a data communication device, which are applied to communication among computer systems sharing hardware; the data communication method comprises the following steps: when the first computer system is determined to communicate with the second computer system, a communication channel is established through input/output (IO) equipment in shared hardware; based on the established communication channel, the first computer system communicates with the second computer system. At least one embodiment of the present application may enable data communication around a network.
Description
Technical Field
The present invention relates to the field of computers, and in particular, to a data communication method and apparatus.
Background
Data communication between an existing host and a virtual machine (the virtual machine is a client relative to the host) running on the host is basically based on network communication, but in some application scenarios, a user often manually closes a virtual machine network in advance to achieve network security isolation of the virtual machine, and real-time communication between processes running on the host and the client cannot be achieved in the scenario because a network channel is already closed, if a process in the client has a requirement for data interaction with the process in the host, the data communication cannot be achieved.
At present, a Vmware tool (tool) of virtual machine software has one function as follows: the function does not depend on whether the network is opened or not, but can only be installed in a Vmware product, cannot be applied to a virtualization scheme of a Linux open source community, and only realizes the copy and paste function of files, and cannot realize the real-time direct data communication function between the running processes of the host machine and the client machine under the condition that the network of the virtual machine is closed.
Disclosure of Invention
The application provides a data communication method and device, which can bypass a network to realize data communication.
The technical scheme is as follows.
A data communication method is applied to communication between computer systems sharing hardware, and comprises the following steps:
when the first computer system is determined to communicate with the second computer system, a communication channel is established through input/output (IO) equipment in shared hardware;
based on the established communication channel, the first computer system communicates with the second computer system.
The IO device may be a miscellaneous device or a character device.
Wherein the second computer system may be a virtual machine and the first computer system may be a host of the virtual machine;
alternatively, the first computer system may be a virtual machine and the second computer system may be a host of the virtual machine;
alternatively, the first computer system and the second computer system may be two virtual machines on the same host machine.
Wherein, the establishing a communication channel through an input/output IO device in the shared hardware may include:
and establishing a data communication channel between the IO device in the first computer system and the IO device in the second computer system through the device driver in the first computer system and the device driver in the second computer system.
Wherein the first computer system communicating with the second computer system may include one or more of:
the first computer system or the second computer system writes data to be sent to the opposite computer system into IO equipment in the computer system according to the file handle of the IO equipment of the computer system;
the first computer system or the second computer system reads data sent by the opposite-end computer system from the IO equipment in the computer system according to the file handle of the IO equipment of the computer system;
the peer computer system refers to other computer systems which have established a communication channel with the local computer system through IO devices in shared hardware.
A data communication device applied to communication between computer systems sharing hardware comprises: a processor and a memory;
the memory is used for storing programs for data communication; the program for communicating data, when read and executed by the processor, performs the following operations:
when the first computer system is confirmed to be communicated with the second computer system, a communication channel is established through input/output (IO) equipment in shared hardware;
based on the established communication channel, the first computer system communicates with the second computer system.
The IO device may be a miscellaneous device or a character device.
Wherein, the establishing a communication channel through an input/output IO device in the shared hardware may include:
and establishing a data communication channel between the IO device in the first computer system and the IO device in the second computer system through the device driver in the first computer system and the device driver in the second computer system.
A data communication device is applied to communication between computer systems sharing hardware, and comprises:
the establishing module is used for establishing a communication channel through input/output (IO) equipment in shared hardware when the first computer system is determined to be communicated with the second computer system;
and the communication module is used for carrying out communication between the first computer system and the second computer system based on the established communication channel.
The IO device may be a miscellaneous device or a character device.
The establishing module may establish the communication channel through an input/output IO device in the shared hardware, including:
the establishing module establishes a data communication channel between the IO device in the first computer system and the IO device in the second computer system through the device driver in the first computer system and the device driver in the second computer system.
In at least one embodiment of the present application, network communication can be performed by bypassing a network channel; data communication between two computer systems sharing hardware usage can be realized even if the network of the computer systems is shut down.
Of course, it is not necessary for any product to achieve all of the above-described advantages at the same time for the practice of the present application.
Drawings
Fig. 1 is a flowchart of a data communication method according to a first embodiment;
FIG. 2 is a schematic diagram of an implementation of an example of the first embodiment;
fig. 3 is a schematic diagram of a data communication apparatus according to a third embodiment.
Detailed Description
The technical solution of the present application will be described in more detail with reference to the accompanying drawings and embodiments.
It should be noted that, if not conflicting, the embodiments and the features in the embodiments may be combined with each other and are within the scope of protection of the present application. Additionally, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
In one configuration, the means for data communication may include one or more processors (CPUs), input/output interfaces, network interfaces, and memory (memories).
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. The memory may include one or more modules.
Computer-readable media include permanent and non-permanent, removable and non-removable storage media that can implement the storage of information by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
Herein, a device in a computer system generally refers to a file corresponding to real hardware; for example, in Unix, linux, etc., a device is a device file (or device node) under the/dev directory; in some cases, a device in a computer system may also correspond to a fake device (i.e., no real hardware exists).
The devices in the computer system may be accessed in the form of access files, for example, system calls such as open (open), read (read), write (write), close (close), and the like may be made. A device in a computer system may be viewed as a file.
An embodiment of a data communication method, applied to communication between computer systems sharing hardware, as shown in fig. 1, includes steps S110 to S120:
s110, when the first computer system is determined to be communicated with a second computer system, a communication channel is established through input/output (IO) equipment in shared hardware;
s120, based on the established communication channel, the first computer system communicates with the second computer system.
In this embodiment, network communication can be performed by bypassing the network channel; this enables data communication between two computer systems sharing the use of hardware even if the network of the computer systems is shut down.
In this embodiment, the network of the first computer system and the second computer system, or any one of the computer systems, may be closed. In the case where the network of the first computer system and the network of the second computer system are both open, the two computer systems can communicate through the network, but it is not excluded that the communication is still performed using the method of the present embodiment.
In this embodiment, the first computer system and the second computer system sharing hardware may mean that both are running on the same real machine, for example, the first computer system and the second computer system may be a virtual machine and its host, or two virtual machines on the same host, respectively. The virtual machine can refer to a complete computer system which has complete hardware system functions and is simulated by software and runs in a completely isolated environment; a host may refer to a computer system that installs virtual machine software, and a virtual machine may be viewed as a guest on the host.
In this embodiment, the steps S110 to S120 may be implemented by adding codes to the first computer system and the second computer system.
In one implementation, the first computer system and the second computer system are in data communication, which may refer, but is not limited to, a first process in the first computer system and a second process in the second computer system.
In this implementation manner, when the first process needs to communicate with the second process, the IO device in the first computer system may be opened, for example, the IO device in the first computer system is opened only when there is data to be sent to the second process; or opening the IO device in the first computer system in any time period before sending data to the second process, for example, when the first process necessarily needs to communicate with the second process, the IO device in the first computer system may be opened as soon as the first process is started.
Similarly, the second process may open the IO device in the second computer system upon startup or during execution.
In other implementations, the first computer system and the second computer system perform data communication, and may also refer to a thread, a process, an operating system, or the like in the first computer system performing data communication with a thread, a process, an operating system, or the like in the second computer system.
In this embodiment, the IO devices in the first computer system and the second computer system may be synchronized through bottom layer driver interaction, hardware connection (for example, chip pin connection), and the like.
In one implementation, the IO device may be, but is not limited to being, a stream-oriented IO device.
In this implementation, the stream-oriented IO device may refer to that the IO device supports character-by-character or byte-by-byte reading and writing.
In other implementations, other types of IO devices may also be employed.
In one implementation, the IO Device may be a miscellaneous Device (Misc Device) or a character Device (Char Device).
The character device may be a device that transmits in units of characters in an IO transmission process; the real IO device corresponding to the character device may include a keyboard, a printer, and the like.
The miscellaneous device can be regarded as a special character device corresponding to a real IO device which is not easily classified and does not belong to a predetermined character device category.
In this implementation, it is not necessary or necessary for the first and second computer systems to know whether the data in the miscellaneous device or character device is from real hardware or from another computer system.
In other implementations, the IO device may also be other kinds of IO devices.
In one implementation, the second computer system may be a virtual machine, and the first computer system may be a host of the virtual machine;
alternatively, the first computer system may be a virtual machine and the second computer system may be a host of the virtual machine;
alternatively, the first computer system and the second computer system may be two virtual machines on the same host machine.
In the implementation mode, the process in the virtual machine can open the IO device of the virtual machine when the process is started; the process in the host machine can open the IO equipment of the host machine when the data to be sent is sent to the process in the virtual machine, and close the IO equipment of the host machine after the data communication is completed. For example, a process in a host may be designed to: when the process to be communicated is judged to be the process in the virtual machine, opening IO equipment of the host machine; and after the process communication with the virtual machine is finished, closing the IO equipment of the host machine.
In this implementation manner, under the condition of network security isolation of the virtual machine, a data communication channel between the host and the virtual machine can be implemented, that is: data communication is achieved bypassing the network.
In one implementation, establishing a communication channel through an input/output IO device in shared hardware may further include:
and establishing a data communication channel between the IO device in the first computer system and the IO device in the second computer system through the device driver in the first computer system and the device driver in the second computer system.
In this implementation manner, if a first process in a first computer system opens an IO device in the first computer system, and a second process in a second computer system opens an IO device in the second computer system, establishing a communication channel is equivalent to binding the processes that open the IO device in the first and second computer systems, so that the two processes can interact with each other through the IO device and the device driver in the respective computer systems.
In this implementation manner, the data communication channel may further include an interface between an IO device and a device driver of each of the first and second computer systems.
In this implementation manner, when the first computer system or the second computer system is a host, the host opens the IO device, and may trigger the device driver of the host and the device driver of the virtual machine to establish the data communication channel, so as to synchronize the IO device in the first computer system and the IO device in the second computer system.
In this implementation manner, IO devices in the first computer system and IO devices in the second computer system may be synchronized between device drivers of the first computer system and the second computer system, so that data changes of the IO devices in the first computer system and the second computer system may be respectively embodied in the IO devices in the first computer system and the second computer system.
When the implementation mode is applied to the Linux environment, the device driver can be a Virtio device driver; where Virtio is an abstraction of a set of generic simulated devices in a virtualized hypervisor. Data communication is carried out between a first computer system and a second computer system, which can be regarded as that a first process in the first computer system carries out data communication with a second process in the second computer system; the first process and the second process can be user mode processes, and the device driver can work in a kernel mode; wherein the kernel mode and the user mode are two running levels of the operating system.
When the implementation mode is applied to a Linux environment and the first computer system or the second computer system is a host machine, the process in the host machine can interact with the Qemu process so as to interact with the device driver in the host machine; qemu is an analog processor.
When the implementation mode is applied to a Linux environment and the first computer system and/or the second computer system are/is a virtual machine, a process in the virtual machine can interact with the IO device of the virtual machine through a virtual file system API provided by the IO device of the virtual machine; the IO device may interact with the device driver through the interface.
In one implementation, the first computer system communicating with the second computer system may include one or more of:
the first computer system or the second computer system writes data to be sent to the opposite computer system into the IO equipment in the computer system according to the file handle of the IO equipment of the computer system;
the first computer system or the second computer system reads data sent by the opposite computer system from the IO equipment in the computer system according to the file handle of the IO equipment of the computer system;
the peer computer system refers to other computer systems which establish a communication channel with the computer system through IO devices in shared hardware.
For example, for a first computer system, the peer computer system is a second computer system; for the second computer system, the peer computer system is the first computer system.
In this implementation manner, when the process in the computer system opens the IO device in the computer system, the file handle of the IO device in the computer system may be obtained.
The file handle (file handle) is a unique identification basis for an opened file (i.e. an IO device in the implementation manner); when a process needs to access an IO device, an access request is sent to an operating system together with a file handle of the IO device, and the operating system performs access to the IO device, such as reading or writing.
The present embodiment is described below by way of an example. In this example, the first computer system is a host, and the second computer system is a virtual machine on the host; the IO devices are miscellaneous devices.
The implementation principle of this example is shown in fig. 2, and the virtual machine in this example is a Guest (Guest) based on Linux operating system. The embodiment provides a method for realizing a real-time data communication channel between a host machine and a client machine through a miscellaneous device driver in a network isolated Linux virtual machine environment, and further realizing data communication by bypassing a network.
In this example, assume that a user-mode process in the virtual machine has opened a miscellaneous device/dev/name, where the device name is any character name that conforms to the naming convention.
From the perspective of the user mode process of the client, the interface of the real-time data communication channel is the miscellaneous equipment, and the data communication function can be realized by opening the miscellaneous equipment for reading and writing, namely the real-time data communication function is realized by reading and writing the miscellaneous equipment. The miscellaneous item equipment can be regarded as a transmission channel and a transmission interface which comprise a kernel mode, and the transmission channel interacts with Virtio-based miscellaneous item equipment drivers on the virtual machine through the transmission interface. The transport channel may include a Virtual File System (Virtual File System) Application Programming Interface (API) and a transport channel protocol Interface.
The Virtio-based miscellaneous device driver provides a device file operation API for a user mode process according to a Linux virtual file system API, namely, a common file related operation: open (open), close (close), read (read), write (write).
The virtual file system API sends data written by the user mode process on the virtual machine into the miscellaneous equipment to the Virtio-based miscellaneous equipment driver through the transmission channel protocol interface and the transmission interface (the data is sent to the user mode process on the host machine through the Virtio equipment driver on the host machine), and obtains the data read by the user mode process on the virtual machine from the miscellaneous equipment driver based on the Virtio.
On a host machine end, a user mode process interacts with a Qemu process of a user mode in an inter-process communication mode, data written into miscellaneous equipment is placed into virtual-queue (virtual queue) of the Qemu process, and data read from the miscellaneous equipment is obtained from the Qemu process; the Qemu process acts as a data transfer station. The Virtio device driver in the kernel state on the host machine can transmit data in virtual-queue of the Qemu process to the Virtio-based miscellaneous device driver in the kernel state of the client machine, and receives data from the Virtio-based miscellaneous device driver in the kernel state of the client machine and transmits the data to the Qemu process, so that a data communication channel is formed.
At a host end or a client end, when a user state process has a requirement for data interaction with a user state process of an opposite end (the client end or the host end), opening miscellaneous equipment to pair a trigger equipment drive with miscellaneous equipment of the opposite end so as to form a data interaction channel.
The data transmitted via the data channel may be defined into a certain format, i.e. transmitted according to a certain Protocol (Protocol), which may be designed by itself or may use an existing Protocol.
In this example, when the first computer system is a Host (Host) and the second computer system is a virtual machine, the one-time communication process includes the following steps 201 to 207:
201. after the virtual machine is started, a user mode process A in the virtual machine opens the miscellaneous equipment a in the virtual machine to obtain a file handle ah of the miscellaneous equipment b.
202. When a user mode process B in a host machine needs to communicate with a user mode process A in a virtual machine, opening miscellaneous equipment B in the host machine, and obtaining a file handle bh of the miscellaneous equipment B; the opening of the miscellaneous equipment b triggers Virtio equipment drive to establish a communication channel with the miscellaneous equipment a;
203. a user mode process B in a host machine carries out write operation on the miscellaneous equipment B according to a file handle bh, and data to be sent to the user mode process A is written into the miscellaneous equipment B; the write operation is synchronized into miscellaneous device a of the virtual machine by the Virtio device driver.
204. The user mode process A in the virtual machine monitors the data increase of the miscellaneous equipment a, reads the miscellaneous equipment a according to the file handle ah, and reads the increased data, namely the data sent by the user mode process B in the host machine.
205. The user mode process A in the virtual machine operates according to the read data to obtain an operation result; writing operation is carried out on the miscellaneous equipment a according to the file handle ah, and the operation result is written into the miscellaneous equipment a; the write operation is driven by the Virtio device to be synchronized into the miscellaneous device b of the host.
206. And the user mode process B in the host machine monitors the data increase of the miscellaneous equipment B, and reads the operation result by reading the miscellaneous equipment B according to the file handle bh.
207. After the communication is completed, the user mode process B in the host machine may close the miscellaneous device B.
In this example, the miscellaneous device drivers may be programmed in, but are not limited to, the C language.
In this example, the miscellaneous device may be replaced by a character device, or other IO device.
The second embodiment provides a data communication device, which is applied to communication between virtual machines of a computer system sharing hardware, and comprises: a processor and a memory;
the memory is used for storing programs for data communication; the program for communicating data, when read and executed by the processor, performs the operations of:
when the first computer system is determined to communicate with the second computer system, a communication channel is established through input/output (IO) equipment in shared hardware;
based on the established communication channel, the first computer system communicates with the second computer system.
In this embodiment, the program for performing data communication may be a component of a program that runs in the first and second computer systems; for example, when data communication is performed between the first computer system and the second computer system, it means that the first process in the first computer system and the second process in the second computer system perform data communication, the program for performing data communication may be a component of the first program/the second program that generates the first process/the second process, respectively, such as but not limited to a subprogram or a function included in the first program/the second program.
In this embodiment, the processor and the memory may include real hardware, or may include a virtual processor and a virtual memory in a virtual machine.
In one implementation, the IO device may be a miscellaneous device or a character device.
In one implementation, the second computer system may be a virtual machine, and the first computer system may be a host of the virtual machine;
alternatively, the first computer system may be a virtual machine and the second computer system may be a host of the virtual machine;
alternatively, the first computer system and the second computer system may be two virtual machines on the same host machine.
In one implementation, establishing a communication channel through an input/output IO device in shared hardware may include:
and establishing a data communication channel between the IO device in the first computer system and the IO device in the second computer system through the device driver in the first computer system and the device driver in the second computer system.
In one implementation, the first computer system communicating with the second computer system may include one or more of:
writing data to be sent to an opposite computer system by a first computer system or a second computer system into IO (input/output) equipment in a computer system according to a file handle of the IO equipment of the computer system (namely, the first computer system or the second computer system);
reading data sent by an opposite-end computer system from IO equipment in the computer system according to the file handle of the IO equipment of the first computer system or the second computer system;
the peer computer system refers to other computer systems which establish a communication channel with the computer system through IO devices in shared hardware.
In this embodiment, when the program for performing data communication is read and executed by the processor, the operations performed may correspond to steps S110 to S120 of the first embodiment, where implementation details can be referred to in the first embodiment.
A third embodiment of a data communication apparatus, applied to communication between computer systems sharing hardware, as shown in fig. 3, includes:
the establishing module 31 is configured to establish a communication channel through an input/output IO device in shared hardware when it is determined that the first computer system communicates with the second computer system;
a communication module 32, configured to perform communication between the first computer system and the second computer system based on the established communication channel.
In this embodiment, the data communication device may be distributed in the first and second computer systems.
In one implementation, the IO device may be a miscellaneous device or a character device.
In one implementation, the second computer system may be a virtual machine, and the first computer system may be a host of the virtual machine;
alternatively, the first computer system may be a virtual machine and the second computer system may be a host of the virtual machine;
alternatively, the first computer system and the second computer system may be two virtual machines on the same host machine.
In one implementation, the establishing module establishing a communication channel through an input/output IO device in shared hardware may include:
the establishing module establishes a data communication channel between the IO device in the first computer system and the IO device in the second computer system through the device driver in the first computer system and the device driver in the second computer system.
In one implementation, the communication module to communicate between the first computer system and the second computer system may include one or more of:
writing data to be sent to an opposite-end computer system by a first computer system or a second computer system into IO (input/output) equipment in the computer system according to a file handle of the IO equipment of the computer system;
reading data sent by an opposite-end computer system from IO equipment in the computer system according to a file handle of the IO equipment of the first computer system or the second computer system;
the peer computer system refers to other computer systems which establish a communication channel with the computer system through IO devices in shared hardware.
In this embodiment, operations performed by the establishing module and the communication module may correspond to steps S110 to S120 in the first embodiment, and other implementation details may be referred to in the first embodiment.
It will be understood by those skilled in the art that all or part of the steps of the above methods may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, such as a read-only memory, a magnetic or optical disk, and the like. Alternatively, all or part of the steps of the above embodiments may be implemented using one or more integrated circuits. Accordingly, each module/unit in the above embodiments may be implemented in the form of hardware, and may also be implemented in the form of a software functional module. The present application is not limited to any specific form of hardware or software combination.
The present application is capable of other embodiments, and various changes and modifications can be made by one skilled in the art without departing from the spirit and scope of the application, which should be limited only by the claims appended hereto.
Claims (8)
1. A data communication method is applied to communication between computer systems sharing hardware, and is characterized by comprising the following steps:
when determining that the first computer system communicates with the second computer system, establishing a communication channel through an input/output (IO) device in shared hardware comprises: establishing a communication channel between the IO device in the first computer system and the IO device in the second computer system through a device driver in the first computer system and a device driver in the second computer system; the IO device is a stream-oriented IO device which supports character-by-character or byte-by-byte reading and writing; the establishing of the communication channel between the IO device in the first computer system and the IO device in the second computer system refers to: binding a first process for opening IO equipment in the first computer system with a second process for opening IO equipment in the second computer system, so that the first process and the second process can interact through the IO equipment and equipment drivers in the respective computer systems; the device drivers in the first computer system and the second computer system are used for synchronizing IO devices in the first computer system and the second computer system;
based on the established communication channel, the first process in the first computer system communicates with the second process in the second computer system.
2. The data communication method of claim 1, wherein:
the stream-oriented IO device is a miscellaneous device or a character device.
3. The data communication method of claim 1, wherein:
the second computer system is a virtual machine and the first computer system is a host of the virtual machine;
or, the first computer system is a virtual machine, and the second computer system is a host of the virtual machine;
or the first computer system and the second computer system are two virtual machines on the same host machine.
4. The data communication method according to claim 1,
the first computer system communicating with the second computer system includes one or more of:
the first computer system or the second computer system writes data to be sent to the opposite computer system into IO equipment in the computer system according to the file handle of the IO equipment of the computer system;
the first computer system or the second computer system reads data sent by the opposite-end computer system from the IO equipment in the computer system according to the file handle of the IO equipment of the computer system;
the peer computer system refers to other computer systems which have established a communication channel with the local computer system through IO devices in shared hardware.
5. A data communication device is applied to communication between computer systems sharing hardware, and comprises: a processor and a memory;
the method is characterized in that:
the memory is used for storing programs for data communication; the program for communicating data, when read and executed by the processor, performs the operations of:
when determining that the first computer system communicates with the second computer system, establishing a communication channel through an input/output (IO) device in shared hardware comprises: establishing a communication channel between IO equipment in the first computer system and IO equipment in the second computer system through an equipment driver in the first computer system and an equipment driver in the second computer system; the IO device is a stream-oriented IO device which supports character-by-character or byte-by-byte reading and writing; the establishing of the communication channel between the IO device in the first computer system and the IO device in the second computer system refers to: binding a first process for opening IO equipment in the first computer system with a second process for opening IO equipment in the second computer system, so that the first process and the second process can interact through the IO equipment and a device driver in the respective computer systems; the device drivers in the first computer system and the second computer system are used for synchronizing IO devices in the first computer system and the second computer system;
based on the established communication channel, the first process in the first computer system communicates with the second process in the second computer system.
6. The data communication apparatus of claim 5, wherein:
the stream-oriented IO device is a miscellaneous device or a character device.
7. A data communication device applied to communication between computer systems sharing hardware, the data communication device is characterized by comprising:
the establishing module is used for establishing a communication channel through input/output (IO) equipment in shared hardware when the first computer system is determined to communicate with the second computer system, and comprises the following steps: establishing a communication channel between the IO device in the first computer system and the IO device in the second computer system through a device driver in the first computer system and a device driver in the second computer system; the IO device is a stream-oriented IO device which supports character-by-character or byte-by-byte reading and writing; the establishing of the communication channel between the IO device in the first computer system and the IO device in the second computer system refers to: binding a first process for opening IO equipment in the first computer system with a second process for opening IO equipment in the second computer system, so that the first process and the second process can interact through the IO equipment and equipment drivers in the respective computer systems; the device drivers in the first computer system and the second computer system are used for synchronizing IO devices in the first computer system and the second computer system;
a communication module, configured to perform communication between the first process in the first computer system and the second process in the second computer system based on the established communication channel.
8. The data communication apparatus of claim 7, wherein:
the stream-oriented IO device is a miscellaneous device or a character device.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710770800.5A CN109426545B (en) | 2017-08-31 | 2017-08-31 | Data communication method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710770800.5A CN109426545B (en) | 2017-08-31 | 2017-08-31 | Data communication method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109426545A CN109426545A (en) | 2019-03-05 |
CN109426545B true CN109426545B (en) | 2023-02-03 |
Family
ID=65505233
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710770800.5A Active CN109426545B (en) | 2017-08-31 | 2017-08-31 | Data communication method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109426545B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117407092B (en) * | 2023-12-13 | 2024-03-12 | 苏州元脑智能科技有限公司 | Device configuration changing method and device, electronic device and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9672052B1 (en) * | 2012-02-16 | 2017-06-06 | Google Inc. | Secure inter-process communication |
WO2017119918A1 (en) * | 2016-01-05 | 2017-07-13 | Hewlett Packard Enterprise Development Lp | Virtual machine messaging |
Family Cites Families (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CA2299550A1 (en) * | 1999-03-31 | 2000-09-30 | International Business Machines Corporation | Dynamic i/o allocation in a partitioned computer system |
US8001543B2 (en) * | 2005-10-08 | 2011-08-16 | International Business Machines Corporation | Direct-memory access between input/output device and physical memory within virtual machine environment |
US7984449B2 (en) * | 2007-08-15 | 2011-07-19 | International Business Machines Corporation | In-band communication with virtual machines via a hypervisor message bus |
CN101819564B (en) * | 2009-02-26 | 2013-04-17 | 国际商业机器公司 | Method and device for assisting communication between virtual machines |
CN101639814B (en) * | 2009-08-31 | 2011-11-16 | 中国科学院计算技术研究所 | Input-output system facing to multi-core platform and networking operation system and method thereof |
CN101976200B (en) * | 2010-10-15 | 2013-05-08 | 浙江大学 | Virtual machine system for input/output equipment virtualization outside virtual machine monitor |
CN102591702B (en) * | 2011-12-31 | 2015-04-15 | 华为技术有限公司 | Virtualization processing method, related device and computer system |
KR101617210B1 (en) * | 2012-03-29 | 2016-05-18 | 인텔 코포레이션 | Techniques for using an assigned switch identification at an input/output device |
CN102662777A (en) * | 2012-04-28 | 2012-09-12 | 浪潮电子信息产业股份有限公司 | High speed communication method between clients based on kernel-based virtual machine (KVM) |
-
2017
- 2017-08-31 CN CN201710770800.5A patent/CN109426545B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9672052B1 (en) * | 2012-02-16 | 2017-06-06 | Google Inc. | Secure inter-process communication |
WO2017119918A1 (en) * | 2016-01-05 | 2017-07-13 | Hewlett Packard Enterprise Development Lp | Virtual machine messaging |
Also Published As
Publication number | Publication date |
---|---|
CN109426545A (en) | 2019-03-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109154888B (en) | Super fusion system equipped with coordinator | |
US9934064B2 (en) | Storing and resuming application runtime state | |
US8549532B2 (en) | Parallel checkpointing for migration of workload partitions | |
US9910765B2 (en) | Providing testing environments for software applications using virtualization and a native hardware layer | |
US9658941B2 (en) | Methods and systems of function-specific tracing | |
JP4942966B2 (en) | Partition bus | |
US9086901B2 (en) | Migration of applications from physical machines to virtual machines | |
US11403086B2 (en) | System and method for upgrading operating system of a container using an auxiliary host | |
WO2018119951A1 (en) | Gpu virtualization method, device, system, and electronic apparatus, and computer program product | |
US10152342B2 (en) | Method and system for providing virtual desktop and virtual application interactivity | |
US7055026B2 (en) | Method and system for a portable adaptable operating environment identity | |
CA2780567C (en) | Methods and systems for executing software applications using hardware abstraction | |
WO2021227971A1 (en) | Sandbox implementation method, device, apparatus, and storage medium | |
US8631423B1 (en) | Translating input/output calls in a mixed virtualization environment | |
CN114327777B (en) | Method and device for determining global page directory, electronic equipment and storage medium | |
CN117369993A (en) | Method for compatibly running different service systems in Linux environment and credit creation server | |
WO2016176005A1 (en) | Translating operating system processes | |
CN109426545B (en) | Data communication method and device | |
US11074114B1 (en) | System and method for executing applications in a non-native environment | |
CN107844304A (en) | The hot upgrade method of virtual machine and device | |
CN112948062B (en) | Transparent transmission method and device for device file and computer storage medium | |
CN116360925A (en) | Paravirtualization implementation method, device, equipment and medium | |
US12061931B2 (en) | Optimizing performance of a computing device in a mixed workload environment | |
CN111090535B (en) | Communication method, device, electronic equipment and storage medium | |
US11055115B1 (en) | Virtual machine conversion in distributed system of remote desktops |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |