WO2017008675A1 - Method and device for transmitting data in virtual environment - Google Patents
Method and device for transmitting data in virtual environment Download PDFInfo
- Publication number
- WO2017008675A1 WO2017008675A1 PCT/CN2016/089077 CN2016089077W WO2017008675A1 WO 2017008675 A1 WO2017008675 A1 WO 2017008675A1 CN 2016089077 W CN2016089077 W CN 2016089077W WO 2017008675 A1 WO2017008675 A1 WO 2017008675A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- shared memory
- transmitted
- primary
- data transmission
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
- G06F13/105—Program control for peripheral devices where the programme performs an input/output emulation function
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/10—Program control for peripheral devices
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/16—Handling requests for interconnection or transfer for access to memory bus
- G06F13/1605—Handling requests for interconnection or transfer for access to memory bus based on arbitration
- G06F13/1652—Handling requests for interconnection or transfer for access to memory bus based on arbitration in a multiprocessor architecture
- G06F13/1663—Access to shared memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
Definitions
- the present application relates to the field of computers, and in particular, to a technology for transmitting data in a virtualized environment.
- Hot swapping a disk requires creating a virtual disk in the host. First insert the virtual disk into the host, copy the data to be transferred to the virtual disk, and then unplug the virtual disk from the host. Go to the virtual machine, copy the data to be transferred from the virtual disk to the virtual machine, and then pull out the virtual disk, so that the data transmission from the host to the virtual machine can be completed. It can be seen that the method of hot swapping a disk involves hot swapping of multiple devices, and the number of times of copying data is large, and the operation steps are too cumbersome, resulting in excessive system overhead.
- the technical problem to be solved by the present application is how to transmit data in a virtualized environment, how to increase the transmission rate, and simplify the operation steps to reduce system overhead.
- the present application provides a method for transmitting data in a virtual environment on a client device side, where the method includes: creating a first data transmission module; and allocating according to the first data transmission module a shared memory, and the shared memory allows the primary device to perform a read/write operation; and the first data transmission module performs data transmission with the shared memory, wherein the performing data transmission includes at least one of the following: The first to-be-transmitted data is stored in the shared memory, and the second to-be-transmitted data stored by the primary-end device in the shared memory is obtained.
- storing the first to-be-transmitted data in the shared memory includes: reading the first to-be-transmitted data into a user space; and copying the first to-be-transmitted data from the user space to a location in a kernel space The shared memory.
- copying the first to-be-transmitted data from the user space to the sharing located in a kernel space includes: copying, according to the related capacity information of the shared memory, the first to-be-transmitted data read to the user space into the shared memory located in a kernel space; wherein, after each copy, Sending a first data transmission message to the primary device; after acquiring the first data read message returned by the primary device, performing the next copy until the transmission is completed.
- acquiring the second to-be-transmitted data stored by the primary-end device in the shared memory includes: reading a second to-be-transmitted data stored by the primary-end device in the shared memory; and reading the second Copying the data to be transmitted to the user space; storing the second data to be transmitted copied to the user space to the storage medium.
- reading the second to-be-transmitted data stored by the primary-end device in the shared memory includes: reading, according to the second data transmission message sent by the primary-end device, that the primary-end device is stored in the sharing a second data to be transmitted of the memory; after the reading is completed, returning a second data read message to the primary device.
- the method further includes: performing transmission event communication with the primary device before performing data transmission by the first data transmission module and the shared memory, and performing transmission event communication includes at least one of the following: Sending, to the primary device, first data information about the first to-be-transmitted data; and acquiring, by the primary device, second data information about the second to-be-transmitted data.
- the present application provides a method for transmitting data in a virtual environment on a primary device side, wherein the method includes: creating a second data transmission module; acquiring a shared allocated by the client device Accessing the memory, so that the shared memory allows the primary device to perform a read/write operation; and the second data transmission module performs data transmission with the shared memory, wherein the performing data transmission includes at least one of the following Obtaining, by the client device, the first to-be-transmitted data stored in the shared memory, and storing the second to-be-transmitted data in the shared memory.
- storing the second to-be-transmitted data in the shared memory includes: reading the second to-be-transmitted data into a user space; and copying the second to-be-transmitted data from the user space to a location in a kernel space The shared memory.
- copying the second to-be-transmitted data from the user space to the shared memory located in a kernel space includes: reading the read to the user space based on related capacity information of the shared memory
- the second to be transmitted data is copied to the shared memory located in the kernel space; wherein, after each copy, the second data transmission message is sent to the client device; when the second device returns the second device After the data is read, the next copy is made until the transfer is complete.
- acquiring the first data to be transmitted that is stored by the client device in the shared memory includes: reading, by the client device, first data to be transmitted stored in the shared memory; Copy the data to be transferred to User space; storing the first to-be-transmitted data copied to the user space to a storage medium.
- reading the first data to be transmitted stored by the client device in the shared memory includes: reading, according to the first data transmission message sent by the client device, the client device being stored in the sharing The first data to be transmitted of the memory; after the reading is completed, returning the first data read message to the client device.
- the method further includes: performing transmission event communication with the client device before performing data transmission by the second data transmission module and the shared memory, and performing transmission event communication includes at least one of the following: Sending, to the client device, second data information about the second to-be-transmitted data; acquiring first data information about the first to-be-transmitted data sent by the client device.
- the present application provides an apparatus for performing data transmission in a virtual environment, where the apparatus includes: a client creation apparatus for creating a first data transmission module; a client allocation apparatus, And configured to allocate a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform a read/write operation; and the client data transmission device is configured to pass the first data transmission module and the shared memory Performing data transmission, wherein the client data transmission device includes at least one of the following: a client data storage unit, configured to store the first to-be-transmitted data in the shared memory, a client data acquisition unit, And configured to acquire second to-be-transmitted data stored by the primary device in the shared memory.
- the client data storage unit includes: a subunit for reading the first data to be transmitted to the user space; and copying the first data to be transmitted from the user space to the kernel The subunit of the shared memory of space.
- the subunit for copying the first to-be-transmitted data from the user space to the shared memory located in a kernel space includes: configured to use the related capacity information based on the shared memory And reading, by the sub-unit of the shared memory located in the kernel space, the sub-units of the shared memory that are read into the user space; and sending, by each copy, the first data transmission message to the primary end device a subunit; a subunit for performing the next copy until the transmission is completed after acquiring the first data read message returned by the primary device.
- the client data obtaining unit includes: a subunit for reading the second data to be transmitted stored by the master device in the shared memory; and configured to copy the read second data to be transmitted a subunit to the user space; a second unit to be used for storing the copy to the user space to the subunit of the storage medium.
- the subunit for reading the second data to be transmitted stored by the primary device in the shared memory includes: a second data transmission message reading station according to the primary device a subunit of the second data to be transmitted stored by the master device in the shared memory; a subunit for returning a second data read message to the master device after the reading is completed.
- the device further includes: a client communication device, configured to perform transmission event communication with the primary device before performing data transmission with the shared memory by the first data transmission module, where
- the client communication device includes at least one of the following: a client information sending unit, configured to send first data information about the first data to be transmitted to the primary device, and a client information acquiring unit, configured to acquire And second data information about the second data to be transmitted sent by the primary device.
- the present application provides an apparatus for performing data transmission in a virtual environment, where the apparatus includes: a primary end creating device for creating a second data transmission module; a primary end allocation device, The access authority for obtaining the shared memory allocated by the client device, so that the shared memory allows the master device to perform read and write operations; and the primary data transmission device is configured to share with the second data transmission module
- the data transmission is performed by the memory, wherein the primary data transmission device includes at least one of the following: a primary data acquisition unit, configured to acquire first data to be transmitted stored in the shared memory by the client device, and the primary end a data storage unit, configured to store the second to-be-transmitted data in the shared memory.
- the primary data storage unit includes: a subunit for reading the second data to be transmitted to the user space; and copying the second data to be transmitted from the user space to the kernel The subunit of the shared memory of space.
- the subunit for copying the second data to be transmitted from the user space to the shared memory located in a kernel space includes: configured to use the related capacity information based on the shared memory And reading, by the sub-unit of the shared memory located in the kernel space, for each second copy, sending a second data transmission message to the client device after each copy a subunit; a subunit for performing a next copy until the transfer is completed after acquiring the second data read message returned by the guest device.
- the primary data obtaining unit includes: a subunit for reading the first data to be transmitted stored by the client device in the shared memory; and configured to copy the read first data to be transmitted a subunit to the user space; the first to be transmitted data for copying the copy to the user space to a subunit of the storage medium.
- the subunit for reading the first data to be transmitted stored by the client device in the shared memory includes: a first data transmission message reading station according to the client device a subunit of the first data to be transmitted stored in the shared memory by the client device; and a subunit for returning the first data read message to the guest device after the reading is completed.
- the device further includes: a primary communication device, configured to perform transmission event communication with the client device before performing data transmission with the shared memory by the second data transmission module, where
- the primary communication device includes at least one of: a primary information transmitting unit, configured to send, to the client device, the The second data information of the second data to be transmitted; the primary information acquiring unit is configured to acquire first data information about the first data to be transmitted sent by the client device.
- the client device creates a first data transmission module
- the primary device creates a second data transmission module, the first data transmission module and the second data transmission module.
- the client device allocates a shared memory located in the kernel space according to the first data transmission module, and allows the primary terminal
- the device reads and writes the shared memory, and the primary device acquires access rights of the shared memory; the client device and the primary device respectively pass the first data transmission module and the second
- the data transmission module performs data transmission with the shared memory.
- the client device stores the first to-be-transmitted data in the shared memory, and the primary device obtains the storage of the client device.
- the primary device stores the second to-be-transmitted data in the shared memory
- the guest device acquires the primary Data stored in the second device to be transmitted to the shared memory.
- the shared memory located in the kernel space is used as the transfer station to transmit data, which greatly improves the data transmission rate compared with the existing serial port transmission mode, and the operation is relatively simple compared with the existing hot-swappable disk method. System resources are used less.
- FIG. 1 illustrates a client device for data transmission in a virtual environment, in accordance with an embodiment of an aspect of the present application
- FIG. 2 illustrates a client data transmission device of a client device for performing data transmission in a virtual environment, in accordance with a preferred embodiment of an aspect of the present application
- FIG. 3 illustrates a client device for data transmission in a virtual environment in accordance with a preferred embodiment of an aspect of the present application
- FIG. 4 illustrates a primary device for performing data transmission in a virtual environment, in accordance with an embodiment of an aspect of the present application
- FIG. 5 illustrates a primary end data transmission device of a primary end device for performing data transmission in a virtual environment according to a preferred embodiment of an aspect of the present application
- FIG. 7 is a schematic diagram showing a cooperation between a client device and a master device for performing data transmission in a virtual environment according to an embodiment of an aspect of the present application.
- FIG. 8 illustrates a flow chart of a method for transmitting data in a virtual environment on a client device side according to an embodiment of another aspect of the present application
- FIG. 9 is a flowchart of a method for transmitting data in a virtual environment on a primary device side according to an embodiment of another aspect of the present application.
- FIG. 10 illustrates a flow chart of a method for transmitting data in a virtual environment, in accordance with an embodiment of another aspect of the present application.
- client device 1 shows a client device 1 for data transmission in a virtual environment, wherein the client device 1 includes a client creation device 11, a client distribution device 12, and a client, in accordance with an embodiment of an aspect of the present application.
- Data transmission device 13 Data transmission device 13.
- the client creating device 11 creates a first data transmission module; the client allocation device 12 allocates a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform read and write operations.
- the client data transmission device 13 performs data transmission with the shared memory through the first data transmission module.
- the client device 1 includes an electronic device capable of automatically performing numerical calculation and information processing according to an instruction set or stored in advance, the hardware of which includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), Programmable gate array (FPGA), digital processor (DSP), embedded devices, etc.
- the client device 1 can also be a collection of computer data and instructions organized in a series of sequences.
- the client device may also be a combination of a collection of computer data and instructions organized in a specific order and electronic devices capable of automatically performing numerical calculations and information processing in accordance with pre-set or stored instructions.
- a person skilled in the art should understand that the client device 1 is only an example, and other existing or future client devices 1 may be included in the application, and should be included in the scope of the present application. It is included here by reference.
- the above devices are continuously working.
- “continuous” refers to the above-mentioned respective devices respectively in real time or according to the set or real-time adjusted working mode requirements, for example, the client is created.
- the device 11 creates a first data transmission module, and the first data transmission module created by the client creation device 11 is continuously used by the client distribution device 12 and the client data transmission device 13, the client distribution device 12 continuous roots According to the first data transmission module, a shared memory is allocated, and the shared memory allows the primary device to perform read and write operations, and the client data transmission device 13 continues to perform the first data transmission module and the shared memory. Data is transmitted until the guest device 1 stops working.
- the guest device may be a guest virtual machine (guest), and the primary device may be a privileged virtual machine (host), and one or more non-privileged levels may be implemented by the privileged virtual machine. Management of customer virtual machines.
- the client creation device 11 creates a first data transmission module.
- the first data transmission module includes a guest virtual device and a client driver.
- the creating of the first data transmission module by the client creation device 11 includes: creating a guest virtual device and loading a client driver of the guest virtual device.
- the client creating device 11 adds a client virtual device by modifying a corresponding logic according to a type of a hypervisor of the host, where the guest virtual device is used between the kernel space and the user space, and the guest and the host. Communication between kernel spaces. Specifically, in the creation phase of the guest, the client creation device 11 can directly add the guest virtual device by using the created method. If the guest already exists, the client creation device 11 can use the hot plug method to increase the client. Virtual device.
- the virtual memory of the operating system of the guest device (for example, the Linux operating system) is divided into kernel space and user space, and the core software running in the kernel space has all the rights to access the hardware device, and has a higher privilege level; Ordinary applications in user space can only see some of the system resources that they are allowed to use, and cannot use certain system features or direct access to kernel space and hardware devices.
- the created first data transmission module provides a data transmission channel between the kernel space and the user space, which facilitates the smooth progress of subsequent data transmission.
- the client allocation device 12 allocates a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform read and write operations.
- a shared memory is allocated, the shared memory is located in the kernel space, and the second data transmission module of the primary device is allowed.
- the master driver in the access accesses the shared memory. Specifically, when the guest driver in the first data transmission module detects the guest virtual device, allocate a transmission page for data transmission, and allocate a control page for controlling data transmission, where the transmission page and the location are The control page is the shared memory page.
- the shared memory located in the kernel space is used as a transfer station to transmit data, which greatly improves the data transfer rate compared with the existing serial port transmission mode, and is simpler in operation than the existing hot-swappable disk. Correct System resources are used less.
- the client data transmission device 13 performs data transmission with the shared memory through the first data transmission module, and the client data transmission device 13 includes a client data storage unit 131 and client data acquisition. At least one of the units 132, wherein the client data storage unit 131 stores the first to-be-transmitted data in the shared memory, and the client data acquiring unit 132 acquires the primary device storage The second data to be transmitted in the shared memory.
- the client data storage unit 131 is configured to send the first data to be transmitted to the primary device, where the client data acquiring unit 132 is configured to receive the second data to be transmitted sent by the primary device.
- the client data transmission device 13 may only include the client data storage unit 131, that is, send the first data to be transmitted to the master device; the client data transmission device 13 may also include only the client.
- the data acquiring unit 132 receives the second data to be transmitted sent by the primary device; the client data transmitting device 13 may further include the client data storage unit 131 and the client data acquiring unit 132. That is, sending the first to-be-transmitted data to the primary end device and receiving the second to-be-transmitted data sent by the primary-end device simultaneously.
- the client data storage unit 131 may include: a subunit for reading the first data to be transmitted to the user space; and copying the first data to be transmitted from the user space to A subunit of the shared memory located in kernel space.
- the client data storage unit 131 reads the first data to be transmitted from the storage medium of the client device 1 to the user space of the client device in the memory, and the shared memory is located in the kernel space of the memory, so The first to-be-transmitted data is copied from the user space to the shared memory.
- the subunit for copying the first to-be-transmitted data from the user space to the shared memory located in a kernel space includes: for using the related capacity information of the shared memory, And reading, by the sub-unit of the shared memory located in the kernel space, the sub-units of the shared memory that are read into the user space; and sending, by each copy, the first data transmission message to the primary end device a subunit; a subunit for performing the next copy until the transmission is completed after acquiring the first data read message returned by the primary device.
- the copying is performed in units of the transmission page.
- the size of the first data to be transmitted is N
- the size of the data transmitted by the client data transmission device 13 is ALREADY
- the initial value is 0, and the number of free subpages of the transmission page SEND1 is FREE
- the number of the subpage number A is The initial value is 0, and the process of copying the first to-be-transmitted data from the client data transmission device 13 to the shared memory is as follows:
- the third step is to determine whether the size of the data to be copied INPUT is greater than or equal to the subpage size PAGESIZE, and if so, then go to the fourth step, and if not, go to the fifth step;
- the page number A is incremented by 1, it is judged whether the maximum number of sub-pages TP of the transmission page SEND1 is reached. If A reaches TP, the value A is assigned to 0, and then third step;
- the client data obtaining unit 132 includes: configured to read, that the master device is stored in the sharing a subunit of the second data to be transmitted in the memory; a subunit for copying the read second data to be transmitted to the user space; and storing the second data to be transmitted copied to the user space to the storage medium Subunit.
- the client data obtaining unit 132 copies the second data to be transmitted sent by the master device from the shared memory to the user space, and then copies the data from the user space to the storage medium.
- the storage medium refers to a non-volatile storage medium such as, but not limited to, a hard disk, an optical disk, a USB flash drive, an SD card, or the like.
- the subunit for reading the second data to be transmitted stored by the primary device in the shared memory includes: a second data transmission message reading station according to the primary device a subunit of the second data to be transmitted stored by the master device in the shared memory; a subunit for returning a second data read message to the master device after the reading is completed.
- the data size received by the client data transmission device 13 is GET, and the initial value is 0, and the second data to be transmitted is copied from the shared memory to the client.
- the flow of the data transmission device 13 is as follows:
- the second step waiting for the second data transmission message sent by the primary device, after receiving the second data transmission message sent by the primary device, according to the length LEN_SLICE of the transmission page RECEIVE1 in the control page, and transmitting
- the page RECEIVE1 subpage number and the information of the address ADDR of the transmission page RECEIVE1 in the shared memory are sequentially processed and the data in the transmission page RECEIVE1 is copied to the user space, and the client data obtaining unit 132 copies the content to the user space.
- the new value after the obtained data size is returned to the primary device to return a second data read message, and then the first step is taken.
- the client device 1 includes a client creation device 11', a client distribution device, in accordance with a preferred embodiment of an aspect of the present application, 12', the client data transmission device 13' and the client communication device 14'.
- the content of the client creation device 11', the client distribution device 12', the client data transmission device 13', and the client creation device 11, the client distribution device 12, and the client data transmission device 13 in FIG. The same or basically the same, for the sake of brevity, no longer repeat them.
- the client communication device 14' performs transmission event communication with the primary device before performing data transmission with the shared memory by the first data transmission module.
- the client communication device includes at least one of a client information transmitting unit (not shown) and a client information acquiring unit (not shown), wherein the client information is transmitted.
- the unit sends the first data information about the first data to be transmitted to the primary device, where the client information obtaining unit acquires the second data about the second data to be transmitted sent by the primary device. information.
- the first to-be-transmitted data is transmitted to the storage device in the form of a file
- the first data information includes a storage path of the file, a name of the file, and a length of the file.
- the second to-be-transmitted data is transmitted to the client device, it is stored in a storage medium in a file format, and the second data information includes a storage path of the file, a name of the file, and a length of the file.
- the client device 1 communicates with the host device for event communication: the transfer command can be placed in a xenstore (a storage device in the Xen virtual environment, and the xenstore is completed based on the event channel).
- the transfer command includes the first data information and notifies the host device that a new command exists.
- the master device obtains a transmission command from the xenstore, extracts the first data information, and first checks whether the storage path of the file in the first data information already exists, and if yes, returns an error, and notifies the client device 1 of the corresponding error. The information then ends the transmission; if not, the file is created according to the storage path of the file in the first data information, and the client device 1 is notified that the transmission command has been accepted and the processing is normal.
- FIG. 4 illustrates a primary device 2 for performing data transmission in a virtual environment, wherein the primary device 2 includes a primary device 25, a primary device 26, and a primary device, in accordance with an embodiment of an aspect of an aspect of the present application.
- Data transmission device 27 is illustrated.
- the primary end creating device 25 creates a second data transmission module; the primary end allocation device 26 acquires access rights of the shared memory allocated by the guest device, so that the shared memory allows the primary device to read and write.
- the primary data transmission device 27 performs data transmission with the shared memory through the second data transmission module.
- the master device 2 includes an automatic numerical meter capable of automatically setting or storing the instructions in advance.
- Electronic devices for computing and information processing including but not limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, and the like.
- the primary device 2 can also be a collection of computer data and instructions organized in a sequence of specific sequences.
- the master device 2 may also be a combination of a collection of computer data and instructions organized in a specific sequence and electronic devices capable of automatically performing numerical calculations and information processing in accordance with pre-set or stored instructions.
- the primary device 2 is merely an example, and other existing or future primary devices 2 may be applicable to the present application, and should also be included in the protection scope of the present application. It is included here by reference.
- the above-mentioned devices are continuously working.
- continuous refers to the above-mentioned respective devices respectively in real time or according to the set or real-time adjusted working mode requirements, for example, the primary end is created.
- the device 25 creates a second data transmission module, the second data transmission module created by the primary terminal creation device 25 is continuously used by the primary distribution device 26 and the primary data transmission device 27, the primary distribution device 26 continuously obtaining access rights of the shared memory allocated by the client device, so that the shared memory allows the master device to perform read and write operations, and the master data transmission device 27 continues to pass the second data transmission module and the The shared memory performs data transfer until the primary device 2 stops working.
- the guest device may be a guest virtual machine (guest), and the primary device may be a privileged virtual machine (host), and one or more non-privileged levels may be implemented by the privileged virtual machine. Management of customer virtual machines.
- the primary end creating device 25 creates a second data transmission module.
- the second data transmission module includes a primary virtual device and a primary drive.
- the creating, by the primary end creating device 25, the second data transmission module includes: creating a primary virtual device and loading a primary driver of the primary virtual device.
- the primary end creating device 25 increases the primary virtual device by modifying the corresponding logic according to the type of the hypervisor of the host, and the primary virtual device is used between the kernel space and the user space and the host and the guest. Communication between kernel spaces.
- the virtual memory of the operating system of the primary device (for example, the Linux operating system) is divided into kernel space and user space, and the core software running in the kernel space has all the rights to access the hardware device, and has a higher privilege level; Ordinary applications in user space can only see some of the system resources that they are allowed to use, and cannot use certain system features or direct access to kernel space and hardware devices.
- the created second data transmission module provides a data transmission channel between the kernel space and the user space, which facilitates the smooth progress of subsequent data transmission.
- the primary distribution device 26 obtains access rights of the shared memory allocated by the client device, so that the shared memory allows the primary device to perform read and write operations.
- the guest driver in the first data transmission module of the client device allocates a shared memory when detecting the guest virtual device, the shared memory is located in the kernel space, and allows the second data transmission module
- the master driver in the access accesses the shared memory.
- the guest driver in the first data transmission module detects the guest virtual device in the first data transmission module, allocate a transmission page for data transmission, and allocate a control page for controlling data transmission.
- the transfer page and the control page are both the shared memory page.
- the shared memory located in the kernel space is used as a transfer station to transmit data, which greatly improves the data transfer rate compared with the existing serial port transmission mode, and is simpler in operation than the existing hot-swappable disk. Less use of system resources.
- the primary data transmission device 27 performs data transmission with the shared memory through the second data transmission module, and the primary data transmission device 27 includes a primary data storage unit 271 and a primary data acquisition. At least one of the unit 272, wherein the primary data storage unit 271 acquires the first data to be transmitted stored by the client device in the shared memory, and the primary data acquiring unit 272 The two to-be-transmitted data is stored in the shared memory.
- the primary data storage unit 271 is configured to receive the first data to be transmitted sent by the client device, and the primary data acquiring unit 272 is configured to send the second data to be transmitted to the client device.
- the primary data transmission device 27 may include only the primary data storage unit 271, that is, receive the first to-be-transmitted number sent by the client device; the primary data transmission device 27 may also include only the The primary data acquiring unit 272 sends the second data to be transmitted to the client device.
- the primary data transmitting device 27 may further include the primary data storage unit 271 and the primary data acquiring unit 272. That is, receiving the first to-be-transmitted data sent by the client device and transmitting the second to-be-transmitted data to the client device simultaneously.
- the primary data storage unit 271 may include: a subunit for reading the second data to be transmitted to the user space; and copying the second data to be transmitted from the user space to A subunit of the shared memory located in kernel space.
- the primary data storage unit 271 reads the second data to be transmitted from the storage medium of the primary device 2 to the user space of the primary device in the memory, and the shared memory is located in the kernel space of the memory, so The second to-be-transmitted data is copied from the user space to the shared memory.
- the subunit for copying the second to-be-transmitted data from the user space to the shared memory located in a kernel space includes: for using the related capacity information of the shared memory, Read to The second to-be-transmitted data of the user space is copied to the sub-unit of the shared memory located in the kernel space; for each copy, the sub-unit of the second data transmission message is sent to the client device; After obtaining the second data read message returned by the client device, the next copy is performed until the subunit is completed.
- the copying is performed in units of the transmission page.
- the data size transmitted by the primary data transmission device 27 is ALREADY
- the initial value is 0
- the number of free subpages of the transmission page SEND2 is FREE
- the initial value of the subpage number A is The process of copying the second data to be transmitted from the primary data transmission device 27 to the shared memory:
- the third step is to determine whether the size of the data to be copied INPUT is greater than or equal to the subpage size PAGESIZE, and if so, then go to the fourth step, and if not, go to the fifth step;
- the page number A is incremented by 1, it is judged whether the maximum number of subpages TP of the transmission page SEND2 is reached. If A reaches TP, the value A is assigned to 0, and then third step;
- the primary data storage unit 271 includes: a subunit for reading the first data to be transmitted stored by the guest device in the shared memory; and the first data to be transmitted to be read Copying to a subunit of the user space; storing the first data to be transmitted copied to the user space to a subunit of the storage medium.
- the primary data storage unit 271 copies the first data to be transmitted sent by the client device from the shared memory to the user space, and then copies the data from the user space to the storage medium.
- the storage medium refers to a non-volatile storage medium such as, but not limited to, a hard disk, an optical disk, a USB flash drive, an SD card, or the like.
- the subunit for reading the first data to be transmitted stored by the client device in the shared memory includes: a first data transmission message reading station according to the client device a subunit of the first data to be transmitted stored in the shared memory by the client device; a subunit for returning the first data read message to the guest device after the reading is completed.
- the data size received by the primary data transmission device 27 is GET, and the initial value is 0, and the first data to be transmitted is copied from the shared memory to the primary end.
- the flow of the data transfer device 27 is as follows:
- the second step waiting for the first data transmission message sent by the client device, after receiving the first data transmission message sent by the client device, according to the length of the transmission page RECEIVE2 in the control page, LEN_SLICE, transmission
- the page RECEIVE2 subpage number and the information such as the address ADDR of the transmission page RECEIVE2 in the shared memory are sequentially processed and the data in the transmission page RECEIVE2 is copied to the user space, and the first data to be transmitted copied to the user space is stored to the storage.
- the master device 2 includes a master device 25', a master device, according to a preferred embodiment of an aspect of the present application. 26', the primary data transmission device 27' and the primary communication device 28'.
- the content of the primary end creating device 25', the primary distributing device 26', the primary data transmitting device 27', and the primary end creating device 25, the primary distributing device 26, and the primary data transmitting device 27 in FIG. The same or basically the same, for the sake of brevity, no longer repeat them.
- the primary communication device 28' performs transmission event communication with the guest device prior to data transmission by the second data transmission module and the shared memory.
- the primary communication device includes at least one of a primary information transmitting unit (not shown) and a primary information acquiring unit (not shown), wherein the primary information is sent.
- the unit sends the second data information about the second data to be transmitted to the client device, where the master information acquiring unit acquires the first data about the first data to be transmitted sent by the client device. information.
- the second to-be-transmitted data is transmitted to the client device, it is stored in a storage medium in a file format, and the second data information includes a storage path of the file, a name of the file, and a length of the file.
- the file is stored in a storage medium in a file format, and the first data information includes a storage path of the file, a name of the file, and a length of the file.
- the transfer command can be placed in a xenstore (a storage device in the Xen virtual environment, and the xenstore is completed based on the event channel).
- the transmission command includes the second data information and notifies the client device that there is a new command.
- the client device obtains a transmission command from the xenstore, extracts the second data information, and first checks whether the storage path of the file in the second data information already exists, and if yes, returns an error, and notifies the primary device 2 of the corresponding error. Information, then ending the transmission; if not, creating a file according to the storage path of the file in the second data information, And notify the master device 2 that the transfer command has been accepted and the processing is normal.
- FIG. 7 illustrates a schematic diagram of a client device 1 cooperating with a master device 2 for data transmission in a virtual environment, in accordance with an embodiment of an aspect of the present application.
- the client device 1 includes a client creating device 11", a client device 12" and a client data transmitting device 13", the master device 2 including a master creating device 25", a master distributing device 26" and Primary data transmission device 27".
- the client creating device 11" of the client device 1 creates a first data transmission module; the master device creating device 25" of the master device 2 creates a second data transmission module; the client device 12" of the client device 1 according to the The first data transmission module allocates a shared memory, and the shared memory allows the primary device 2 to perform read and write operations; the primary distribution device 26" of the primary device 2 acquires access rights of the shared memory allocated by the client device 1, So that the shared memory allows the primary device 2 to perform read and write operations; the client data transmission device 13" of the client device 1 performs data transmission with the shared memory through the first data transmission module, the client data
- the transmission device 13" includes at least one of a client data storage unit and a client data acquisition unit, wherein the client data storage unit stores the first to-be-transmitted data in the shared memory, The client data acquiring unit acquires the second data to be transmitted stored by the master device 2 in the shared memory; the master data transmitting device 27" of the master device 2 passes the second data transmitting module and the Shared memory for data
- the contents of the client data transmission device 13 are the same or substantially the same
- the content of the end creating device 25, the primary end distributing device 26, and the primary data transmitting device 27 are the same or substantially the same, and are not described here for brevity and are hereby incorporated by reference.
- FIG. 8 illustrates a flow chart of a method for transmitting data in a virtual environment on a client device side, according to an embodiment of another aspect of the present application.
- the method includes step S81, step S82, and step S83. Specifically, in step S81, the client device 1 creates a first data transmission module; in step S82, the client device 1 allocates a shared memory according to the first data transmission module, and the shared memory allows the primary device Performing a read/write operation; in step S83, the client device 1 performs data transmission with the shared memory through the first data transmission module.
- the client device 1 includes an automatic numerical meter capable of automatically following an instruction set or stored in advance.
- Electronic devices for computing and information processing including but not limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, and the like.
- the client device 1 can also be a collection of computer data and instructions organized in a series of sequences.
- the client device may also be a combination of a collection of computer data and instructions organized in a specific order and electronic devices capable of automatically performing numerical calculations and information processing in accordance with pre-set or stored instructions.
- a person skilled in the art should understand that the client device 1 is only an example, and other existing or future client devices 1 may be included in the application, and should be included in the scope of the present application. It is included here by reference.
- step S81 the client device 1 creates a first data transmission module, and the first data transmission module created by the client device 1 in the step S81 is continuously used by the step S82 and the step S83.
- step S82 the client device 1 continues to allocate a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform read and write operations.
- step S83 the client device 1 continues to pass the first A data transmission module performs data transmission with the shared memory until the guest device 1 stops working.
- the guest device may be a guest virtual machine (guest), and the primary device may be a privileged virtual machine (host), and one or more non-privileged levels may be implemented by the privileged virtual machine. Management of customer virtual machines.
- step S81 the client device 1 creates a first data transmission module.
- the first data transmission module includes a guest virtual device and a client driver.
- the creation of the first data transmission module by the client device 1 includes: creating a guest virtual device and loading a guest driver of the guest virtual device.
- the client device 1 adds the client virtual device by modifying the corresponding logic according to the type of the host hypervisor, and the guest virtual device is used between the kernel space and the user space and the kernel space of the guest and the host. Communication between. Specifically, in the creation phase of the guest, the client device 1 can directly add the guest virtual device by using the created method. If the guest already exists, the client device 1 can use the hot plug method to add the guest virtual device.
- the virtual memory of the operating system of the guest device (for example, the Linux operating system) is divided into kernel space and user space, and the core software running in the kernel space has all the rights to access the hardware device, and has a higher privilege level; Ordinary applications in user space can only see some of the system resources that they are allowed to use, and cannot use certain system features or direct access to kernel space and hardware devices.
- the created first data transmission module provides a data transmission channel between the kernel space and the user space, which facilitates the smooth progress of subsequent data transmission.
- step S82 the client device 1 allocates a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform read and write operations.
- a shared memory is allocated, the shared memory is located in the kernel space, and the second data transmission module of the primary device is allowed.
- the master driver in the access accesses the shared memory. Specifically, when the guest driver in the first data transmission module detects the guest virtual device, allocate a transmission page for data transmission, and allocate a control page for controlling data transmission, where the transmission page and the location are The control page is the shared memory page.
- the shared memory located in the kernel space is used as a transfer station to transmit data, which greatly improves the data transfer rate compared with the existing serial port transmission mode, and is simpler in operation than the existing hot-swappable disk. Less use of system resources.
- step S83 the client device 1 performs data transmission with the shared memory through the first data transmission module.
- the step S83 includes at least one of step S831 (not shown) and step S832 (not shown), wherein in step S831, the client device 1 stores the first data to be transmitted in In the shared memory, in step S832, the client device 1 acquires the second data to be transmitted stored by the master device in the shared memory.
- step S831 the client device 1 is configured to send the first data to be transmitted to the master device, and the client device 1 is configured to receive the second data to be transmitted sent by the master device in step S832.
- the step S83 may include only the step S831, that is, sending the first data to be transmitted to the primary device; the step S83 may also include only the step S832, that is, receiving the first message sent by the primary device.
- the step S83 may further include the step S831 and the step S832, that is, sending the first data to be transmitted to the primary device and receiving the second data to be transmitted sent by the primary device. At the same time.
- step S831 the client device 1 reads the first to-be-transmitted data into the user space, and copies the first to-be-transmitted data from the user space to the shared memory located in the kernel space.
- the client device 1 reads the first data to be transmitted from the storage medium of the client device 1 to the user space of the client device in the memory, and the shared memory is located in the kernel space of the memory, so the first device The data to be transmitted is copied from the user space to the shared memory.
- step S831 the client device 1 copies the first to-be-transmitted data read to the user space into the shared memory located in the kernel space, based on the related capacity information of the shared memory. After each copy, the first data transmission message is sent to the primary device; after the first data read message returned by the primary device is obtained, the next copy is performed until the transmission is completed.
- the related capacity information of the shared memory may include, but is not limited to, the transmission page for data transmission.
- the size of the face, the size of the transfer page SIZET the number of sub-pages TP ⁇ sub-page size PAGESIZE.
- the copying is performed in units of the transmission page.
- the size of the first data to be transmitted is N
- the size of the data transmitted by the client device 1 is ALREADY
- the initial value is 0
- the number of free subpages of the transmission page SEND1 is FREE
- the initial value of the subpage number A is 0.
- the third step is to determine whether the size of the data to be copied INPUT is greater than or equal to the subpage size PAGESIZE, and if so, then go to the fourth step, and if not, go to the fifth step;
- the page number A is incremented by 1, it is judged whether the maximum number of sub-pages TP of the transmission page SEND1 is reached. If A reaches TP, the value A is assigned to 0, and then third step;
- first to-be-transmitted data is copied from the user space to the shared memory.
- the method is only an example, and other existing or future possible methods for copying the first data to be transmitted from the user space to the shared memory, as applicable to the present application, are also included in the scope of protection of the present application. It is included here by reference.
- step S832 the client device 1 reads the second data to be transmitted stored by the master device in the shared memory, and copies the read second data to be transmitted to the user space,
- the second to-be-transmitted data copied to the user space is stored to the storage medium.
- the client device 1 copies the second data to be transmitted sent by the master device from the shared memory to the user space, and then copies the space from the user space to the storage medium.
- the storage medium refers to a non-volatile storage medium such as, but not limited to, a hard disk, an optical disk, a USB flash drive, an SD card, or the like.
- step S832 the client device 1 reads the second data to be transmitted stored by the master device in the shared memory according to the second data transmission message sent by the master device, and the reading is completed. Thereafter, a second data read message is returned to the primary device.
- the size of the second data to be transmitted is N
- the data size received by the client device 1 is GET
- the initial value is 0, and the second data to be transmitted is copied from the shared memory to the client device 1
- the second step waiting for the second data transmission message sent by the primary device, after receiving the second data transmission message sent by the primary device, according to the length LEN_SLICE of the transmission page RECEIVE1 in the control page, and transmitting
- the page RECEIVE1 subpage number and the information such as the address ADDR of the transmission page RECEIVE1 in the shared memory are sequentially processed and the data in the transmission page RECEIVE1 is copied to the user space, and the client device 1 copies the copy to the second to be transmitted in the user space.
- the new value the client device 1 returns a second data read message to the master device, and then proceeds to the first step.
- the method may further include: the client device 1 is passing the first Before the data transmission module performs data transmission with the shared memory, performing transmission event communication with the primary end device, wherein the performing transmission event communication includes at least one of the following:
- the client device 1 sends first data information about the first data to be transmitted to the primary device;
- the client device 1 acquires second data information about the second to-be-transmitted data sent by the primary device.
- the first to-be-transmitted data is transmitted to the storage device in the form of a file
- the first data information includes a storage path of the file, a name of the file, and a length of the file.
- the second to-be-transmitted data is transmitted to the client device, it is stored in a storage medium in a file format, and the second data information includes a storage path of the file, a name of the file, and a length of the file.
- the client device 1 communicates with the host device for event communication: the transfer command can be placed in a xenstore (a storage device in the Xen virtual environment, and the xenstore is completed based on the event channel).
- the transfer command includes the first data information and notifies the host device that a new command exists.
- the master device obtains a transmission command from the xenstore, extracts the first data information, and first checks whether the storage path of the file in the first data information already exists, and if yes, returns an error, and notifies the client device 1 of the corresponding error. The information then ends the transmission; if not, the file is created according to the storage path of the file in the first data information, and the client device 1 is notified that the transmission command has been accepted and the processing is normal.
- FIG. 9 illustrates a flow chart of a method for transmitting data in a virtual environment on a primary end device side, in accordance with an embodiment of another aspect of the present application.
- the method includes step S95, step S96, and step S97.
- step S95 the primary device 2 creates a second data transmission module;
- step S96 the primary device 2 acquires access rights of the shared memory allocated by the client device, so that the shared memory allows the primary terminal.
- the device performs a read/write operation;
- step S97 the primary device 2 performs data transmission with the shared memory through the second data transmission module.
- the master device 2 includes an electronic device capable of automatically performing numerical calculation and information processing according to an instruction set or stored in advance, and the hardware thereof includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), Programmable gate array (FPGA), digital processor (DSP), embedded devices, etc.
- the primary device 2 can also be a collection of computer data and instructions organized in a sequence of specific sequences.
- the master device 2 may also be a combination of a collection of computer data and instructions organized in a specific sequence and electronic devices capable of automatically performing numerical calculations and information processing in accordance with pre-set or stored instructions.
- the primary device 2 is merely an example, and other existing or future possible primary devices 2 may be applied to the present application as well. It is intended to be included within the scope of this application and is hereby incorporated by reference.
- step S95 the primary device 2 creates a second data transmission module, and the second data transmission module created by the primary device 2 in the step S95 continues to be used in the step S96 and the step S97.
- step S96 the master device 2 continuously obtains the access rights of the shared memory allocated by the client device, so that the shared memory allows the master device to perform read and write operations.
- step S97 the master device 2 continues to pass the The second data transmission module performs data transmission with the shared memory until the primary device 2 stops working.
- the guest device may be a guest virtual machine (guest), and the primary device may be a privileged virtual machine (host), and one or more non-privileged levels may be implemented by the privileged virtual machine. Management of customer virtual machines.
- step S95 the primary device 2 creates a second data transmission module.
- the second data transmission module includes a primary virtual device and a primary drive.
- the creation of the second data transmission module by the primary device 2 includes: creating a primary virtual device and loading a primary driver of the primary virtual device.
- the master device 2 increases the master virtual device by modifying the corresponding logic according to the type of the host hypervisor, and the master virtual device is used for the kernel space between the kernel space and the user space and between the host and the guest. Communication between.
- the virtual memory of the operating system of the primary device (for example, the Linux operating system) is divided into kernel space and user space, and the core software running in the kernel space has all the rights to access the hardware device, and has a higher privilege level; Ordinary applications in user space can only see some of the system resources that they are allowed to use, and cannot use certain system features or direct access to kernel space and hardware devices.
- the created second data transmission module provides a data transmission channel between the kernel space and the user space, which facilitates the smooth progress of subsequent data transmission.
- step S96 the master device 2 acquires the access rights of the shared memory allocated by the client device, so that the shared memory allows the master device to perform read and write operations.
- the guest driver in the first data transmission module of the client device allocates a shared memory when detecting the guest virtual device, the shared memory is located in the kernel space, and allows the second data transmission module
- the master driver in the access accesses the shared memory.
- the guest driver in the first data transmission module detects the guest virtual device in the first data transmission module, allocate a transmission page for data transmission, and allocate a control page for controlling data transmission.
- the transfer page and the control page are both the shared memory page.
- the shared memory located in the kernel space is used as a transfer station to transmit data, and the existing serial port transmission method In comparison, the data transmission rate is greatly improved, and the operation is simpler and less occupied by system resources than the existing hot-swappable disk.
- step S97 the primary device 2 performs data transmission with the shared memory through the second data transmission module.
- the step S97 includes at least one of step S975 (not shown) and step S976 (not shown), wherein in step S975, the master device 2 acquires that the client device is stored in The first to-be-transmitted data of the shared memory, in step S976, the primary-end device 2 stores the second to-be-transmitted data in the shared memory.
- step S975 the primary device 2 is configured to receive the first data to be transmitted sent by the client device, and the primary device 2 is configured to send the second data to be transmitted to the client device in step S976.
- the step S97 may include only the step S975, that is, receiving the first to-be-transmitted number sent by the client device; the step S97 may also include only the step S976, that is, sending the first to the client device.
- the step S97 may further include the step S975 and the step S976, that is, receiving the first data to be transmitted sent by the client device and sending the second data to be transmitted to the client device. At the same time.
- step S976 the primary device 2 reads the second to-be-transmitted data into the user space, and copies the second to-be-transmitted data from the user space to the shared memory located in the kernel space.
- the master device 2 reads the second data to be transmitted from the storage medium of the master device 2 to the user space of the master device in the memory, and the shared memory is located in the kernel space of the memory, so the second device The data to be transmitted is copied from the user space to the shared memory.
- step S976 the master device 2 copies the second to-be-transmitted data read to the user space into the shared memory located in the kernel space, based on the related capacity information of the shared memory. After each copy, the second data transmission message is sent to the client device; after the second data read message returned by the client device is obtained, the next copy is performed until the transmission is completed.
- the copying is performed in units of the transmission page.
- the size of the second data to be transmitted is N
- the size of the data transmitted by the master device 2 is ALREADY
- the initial value is 0
- the number of free subpages of the transmission page SEND2 is FREE
- the initial value of the subpage number A is 0.
- LEFT N–ALREADY, Whether the LEFT is 0 or not, if yes, the transmission of the second data to be transmitted on the primary device end has ended; if not, determining whether data can be copied to the shared memory through subsequent steps;
- the third step is to determine whether the size of the data to be copied INPUT is greater than or equal to the subpage size PAGESIZE, and if so, then go to the fourth step, and if not, go to the fifth step;
- the page number A is incremented by 1, it is judged whether the maximum number of subpages TP of the transmission page SEND2 is reached. If A reaches TP, the value A is assigned to 0, and then third step;
- step S975 the master device 2 reads the first data to be transmitted stored in the shared memory by the client device, and copies the read first data to be transmitted to the user space, and the The first to-be-transmitted data copied to the user space is stored to the storage medium.
- the master device 2 copies the first to-be-transmitted data sent by the client device from the shared memory to User space, then copy from user space to storage media.
- the storage medium refers to a non-volatile storage medium such as, but not limited to, a hard disk, an optical disk, a USB flash drive, an SD card, or the like.
- step S975 the primary device 2 reads the first data to be transmitted stored in the shared memory by the client device according to the first data transmission message sent by the client device, and the reading is completed. Thereafter, the first data read message is returned to the guest device.
- the size of the first data to be transmitted is N
- the size of the data that the primary device 2 has received is GET
- the initial value is 0, and the first data to be transmitted is copied from the shared memory to the primary device 2
- the second step waiting for the first data transmission message sent by the client device, after receiving the first data transmission message sent by the client device, according to the length of the transmission page RECEIVE2 in the control page, LEN_SLICE, transmission
- the page RECEIVE2 subpage number and the information such as the address ADDR of the transmission page RECEIVE2 in the shared memory are sequentially processed and the data in the transmission page RECEIVE2 is copied to the user space, and the primary device 2 copies the first to be transmitted to the user space.
- the master device 2 returns a first data read message to the client device, and then proceeds to the first step.
- the method may further include: the primary device 2 performs transmission event communication with the client device before performing data transmission with the shared memory by the second data transmission module,
- the transmitting event communication includes at least one of the following:
- the primary device 2 sends second data information about the second data to be transmitted to the client device;
- the master device 2 acquires first data information about the first to-be-transmitted data sent by the client device.
- the second to-be-transmitted data is transmitted to the client device, it is stored in a storage medium in a file format, and the second data information includes a storage path of the file, a name of the file, and a length of the file.
- the first to-be-transmitted data is transmitted to the primary device end, the data is stored in a storage medium, and the first data information includes The storage path of the file, the name of the file, and the length of the file.
- the transfer command can be placed in a xenstore (a storage device in the Xen virtual environment, and the xenstore is completed based on the event channel).
- the transmission command includes the second data information and notifies the client device that there is a new command.
- the client device obtains a transmission command from the xenstore, extracts the second data information, and first checks whether the storage path of the file in the second data information already exists, and if yes, returns an error, and notifies the primary device 2 of the corresponding error.
- the information then ends the transmission; if not, the file is created according to the storage path of the file in the second data information, and the host device 2 is notified that the transmission command has been accepted and the processing is normal.
- FIG. 10 illustrates a flow chart of a method for transmitting data in a virtual environment, in accordance with an embodiment of another aspect of the present application.
- the method includes steps S81' to S83' and steps S95' to S97'.
- step S81' the client device 1 creates a first data transmission module
- step S95' the master device 2 creates a second data transmission module
- step S82' the client device 1 according to the The first data transmission module allocates a shared memory, and the shared memory allows the primary device 2 to perform a read/write operation
- step S96' the primary device 2 obtains the access permission of the shared memory allocated by the client device 1 to The shared memory is allowed to perform the read and write operations of the primary device 2
- step S83' the client device 1 performs data transmission with the shared memory through the first data transmission module
- step S83' includes the following at least Any one of: storing the first data to be transmitted in the shared memory, and acquiring second data to be transmitted stored by the primary device 2 in the
- steps S81' to S83' are the same as or substantially the same as the contents of steps S81 to S83 in FIG. 8, and steps S95' to S97' are the same as or substantially the same as the contents of steps S95 to S97 in FIG. 9, for the sake of brevity. Therefore, it will not be repeated here, and is included herein by reference.
- the client device creates a first data transmission module
- the primary device creates a second data transmission module, the first data transmission module and the second data transmission module.
- the shared memory located in the kernel space is used as the transfer station to transmit data, which greatly improves the data transmission rate compared with the existing serial port transmission mode, and the operation is relatively simple compared with the existing hot-swappable disk method. System resources are used less.
- the terminal, the device of the service network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
- processors CPUs
- input/output interfaces network interfaces
- memory volatile and non-volatile memory
- the memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory.
- RAM random access memory
- ROM read only memory
- Memory is an example of a computer readable medium.
- Computer readable media includes both permanent and non-persistent, removable and non-removable media.
- Information storage can be implemented by any method or technology.
- the information can be computer readable instructions, data structures, modules of programs, 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 disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage,
- computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
- the present application can be implemented in software and/or a combination of software and hardware, for example, using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device.
- the software program of the present application can be executed by a processor to implement the steps or functions described above.
- the software programs (including related data structures) of the present application can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like.
- some of the steps or functions of the present application may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
- a portion of the present application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide a method and/or technical solution in accordance with the present application.
- the program instructions for invoking the method of the present application may be stored in a fixed or removable recording medium, and/or transmitted by a data stream in a broadcast or other signal bearing medium, and/or stored in a The working memory of the computer device in which the program instructions are run.
- an embodiment in accordance with the present application includes a device including a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, triggering
- the apparatus operates based on the aforementioned methods and/or technical solutions in accordance with various embodiments of the present application.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Near-Field Transmission Systems (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Disclosed are a method and device for transmitting data in a virtual environment. The method specifically comprises: a client device creating a first data transmission module, and a main terminal device creating a second data transmission module; the client device distributing a shared memory located in a kernel space according to the first data transmission module and allowing the main terminal device to perform a read-write operation on the shared memory; the main terminal device acquiring an access right of the shared memory; and the client device and the main terminal device performing data transmission with the shared memory via the first data transmission module and the second data transmission module respectively. By taking a shared memory located in a kernel space as a transfer station for transmitting data, a data transmission rate is high, the operation is simple and few system resources are occupied.
Description
本申请要求2015年07月16日递交的申请号为201510418471.9、发明名称为“一种用于虚拟化环境下传输数据的方法与设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。The present application claims priority to Chinese Patent Application No. 201510418471.9, entitled "A Method and Apparatus for Transmitting Data in a Virtualized Environment", filed on July 16, 2015, the entire contents of which are incorporated by reference. In this application.
本申请涉及计算机领域,尤其涉及一种用于虚拟化环境下传输数据的技术。The present application relates to the field of computers, and in particular, to a technology for transmitting data in a virtualized environment.
在虚拟化环境中,一般通过网络在宿主机和虚拟机之间进行数据传输。但在网络出现问题时,现有技术中有两种技术方案可以实现宿主机和虚拟机之间的数据传输,一是通过串口传输的方式,二是通过热插拔磁盘的方式,而这两种方案都存在一些缺陷。In a virtualized environment, data is typically transferred between the host and the virtual machine over the network. However, when there is a problem in the network, there are two technical solutions in the prior art that can realize data transmission between the host computer and the virtual machine, one is through a serial port transmission method, and the other is through hot plugging and unplugging the disk. There are some drawbacks to the scheme.
串口设备的传输速率通常较低,因而串口传输的方式无法满足快速传输数据的需求。热插拔磁盘的方式需要在宿主机中创建一块虚拟磁盘,先将该虚拟磁盘插到宿主机中,把待传输数据拷贝至该虚拟磁盘,然后把该虚拟磁盘从宿主机中拔出并插到虚拟机中,再将待传输数据从该虚拟磁盘拷贝至虚拟机中,后拔出该虚拟磁盘,如此才能完成一次从宿主机到虚拟机的数据传输。可以看到,热插拔磁盘的方式涉及多次设备的热插拔,且拷贝数据的次数较多,操作步骤过于繁琐,导致系统开销过大。The transmission rate of serial devices is usually low, so the serial transmission mode cannot meet the requirements of fast data transmission. Hot swapping a disk requires creating a virtual disk in the host. First insert the virtual disk into the host, copy the data to be transferred to the virtual disk, and then unplug the virtual disk from the host. Go to the virtual machine, copy the data to be transferred from the virtual disk to the virtual machine, and then pull out the virtual disk, so that the data transmission from the host to the virtual machine can be completed. It can be seen that the method of hot swapping a disk involves hot swapping of multiple devices, and the number of times of copying data is large, and the operation steps are too cumbersome, resulting in excessive system overhead.
发明内容Summary of the invention
本申请要解决的技术问题是,在虚拟化环境下传输数据,如何提高传输速率,同时简化操作步骤以减少系统开销。The technical problem to be solved by the present application is how to transmit data in a virtualized environment, how to increase the transmission rate, and simplify the operation steps to reduce system overhead.
为解决上述技术问题,本申请提供了一种在客端设备端的用于虚拟环境下传输数据的方法,其中,所述方法包括:创建第一数据传输模块;根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作;通过所述第一数据传输模块与所述共享内存进行数据传输,其中,所述进行数据传输包括至少以下任一项:将第一待传输数据存储于所述共享内存中,获取所述主端设备存储在所述共享内存的第二待传输数据。To solve the above technical problem, the present application provides a method for transmitting data in a virtual environment on a client device side, where the method includes: creating a first data transmission module; and allocating according to the first data transmission module a shared memory, and the shared memory allows the primary device to perform a read/write operation; and the first data transmission module performs data transmission with the shared memory, wherein the performing data transmission includes at least one of the following: The first to-be-transmitted data is stored in the shared memory, and the second to-be-transmitted data stored by the primary-end device in the shared memory is obtained.
进一步地,将第一待传输数据存储于所述共享内存中包括:将所述第一待传输数据读取至用户空间;将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存。Further, storing the first to-be-transmitted data in the shared memory includes: reading the first to-be-transmitted data into a user space; and copying the first to-be-transmitted data from the user space to a location in a kernel space The shared memory.
进一步地,将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享
内存包括:基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第一待传输数据分次拷贝至位于内核空间的所述共享内存;其中,在每次拷贝后,向所述主端设备发送第一数据传输消息;当获取所述主端设备所返回的第一数据读取消息后,进行下一次拷贝,直至传输完成。Further, copying the first to-be-transmitted data from the user space to the sharing located in a kernel space
The memory includes: copying, according to the related capacity information of the shared memory, the first to-be-transmitted data read to the user space into the shared memory located in a kernel space; wherein, after each copy, Sending a first data transmission message to the primary device; after acquiring the first data read message returned by the primary device, performing the next copy until the transmission is completed.
进一步地,获取所述主端设备存储在所述共享内存的第二待传输数据包括:读取所述主端设备存储在所述共享内存的第二待传输数据;将所读取的第二待传输数据拷贝至用户空间;将所述拷贝至用户空间的第二待传输数据存储至存储介质。Further, acquiring the second to-be-transmitted data stored by the primary-end device in the shared memory includes: reading a second to-be-transmitted data stored by the primary-end device in the shared memory; and reading the second Copying the data to be transmitted to the user space; storing the second data to be transmitted copied to the user space to the storage medium.
进一步地,读取所述主端设备存储在所述共享内存的第二待传输数据包括:根据所述主端设备所发送的第二数据传输消息读取所述主端设备存储在所述共享内存的第二待传输数据;在读取完成后,向所述主端设备返回第二数据读取消息。Further, reading the second to-be-transmitted data stored by the primary-end device in the shared memory includes: reading, according to the second data transmission message sent by the primary-end device, that the primary-end device is stored in the sharing a second data to be transmitted of the memory; after the reading is completed, returning a second data read message to the primary device.
进一步地,所述方法还包括:在通过所述第一数据传输模块与所述共享内存进行数据传输之前,与所述主端设备进行传输事件通信,进行传输事件通信包括至少以下任一项:向所述主端设备发送关于所述第一待传输数据的第一数据信息;获取所述主端设备所发送的关于所述第二待传输数据的第二数据信息。Further, the method further includes: performing transmission event communication with the primary device before performing data transmission by the first data transmission module and the shared memory, and performing transmission event communication includes at least one of the following: Sending, to the primary device, first data information about the first to-be-transmitted data; and acquiring, by the primary device, second data information about the second to-be-transmitted data.
根据本申请的一个方面,本申请提供了一种在主端设备端的用于虚拟环境下传输数据的方法,其中,所述方法包括:创建第二数据传输模块;获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作;通过所述第二数据传输模块与所述共享内存进行数据传输,其中,所述进行数据传输包括至少以下任一项:获取所述客端设备所存储在所述共享内存的第一待传输数据,将第二待传输数据存储于所述共享内存中。According to an aspect of the present application, the present application provides a method for transmitting data in a virtual environment on a primary device side, wherein the method includes: creating a second data transmission module; acquiring a shared allocated by the client device Accessing the memory, so that the shared memory allows the primary device to perform a read/write operation; and the second data transmission module performs data transmission with the shared memory, wherein the performing data transmission includes at least one of the following Obtaining, by the client device, the first to-be-transmitted data stored in the shared memory, and storing the second to-be-transmitted data in the shared memory.
进一步地,将第二待传输数据存储于所述共享内存中包括:将所述第二待传输数据读取至用户空间;将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存。Further, storing the second to-be-transmitted data in the shared memory includes: reading the second to-be-transmitted data into a user space; and copying the second to-be-transmitted data from the user space to a location in a kernel space The shared memory.
进一步地,将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存包括:基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第二待传输数据分次拷贝至位于内核空间的所述共享内存;其中,在每次拷贝后,向所述客端设备发送第二数据传输消息;当获取所述客端设备所返回的第二数据读取消息后,进行下一次拷贝,直至传输完成。Further, copying the second to-be-transmitted data from the user space to the shared memory located in a kernel space includes: reading the read to the user space based on related capacity information of the shared memory The second to be transmitted data is copied to the shared memory located in the kernel space; wherein, after each copy, the second data transmission message is sent to the client device; when the second device returns the second device After the data is read, the next copy is made until the transfer is complete.
进一步地,获取所述客端设备存储在所述共享内存的第一待传输数据包括:读取所述客端设备存储在所述共享内存的第一待传输数据;将所读取的第一待传输数据拷贝至
用户空间;将所述拷贝至用户空间的第一待传输数据存储至存储介质。Further, acquiring the first data to be transmitted that is stored by the client device in the shared memory includes: reading, by the client device, first data to be transmitted stored in the shared memory; Copy the data to be transferred to
User space; storing the first to-be-transmitted data copied to the user space to a storage medium.
进一步地,读取所述客端设备存储在所述共享内存的第一待传输数据包括:根据所述客端设备所发送的第一数据传输消息读取所述客端设备存储在所述共享内存的第一待传输数据;在读取完成后,向所述客端设备返回第一数据读取消息。Further, reading the first data to be transmitted stored by the client device in the shared memory includes: reading, according to the first data transmission message sent by the client device, the client device being stored in the sharing The first data to be transmitted of the memory; after the reading is completed, returning the first data read message to the client device.
进一步地,所述方法还包括:在通过所述第二数据传输模块与所述共享内存进行数据传输之前,与所述客端设备进行传输事件通信,进行传输事件通信包括至少以下任一项:向所述客端设备发送关于所述第二待传输数据的第二数据信息;获取所述客端设备所发送的关于所述第一待传输数据的第一数据信息。Further, the method further includes: performing transmission event communication with the client device before performing data transmission by the second data transmission module and the shared memory, and performing transmission event communication includes at least one of the following: Sending, to the client device, second data information about the second to-be-transmitted data; acquiring first data information about the first to-be-transmitted data sent by the client device.
根据本申请的另一个方面,本申请提供了一种在虚拟环境下进行数据传输的设备,其中,所述设备包括:客端创建装置,用于创建第一数据传输模块;客端分配装置,用于根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作;客端数据传输装置,用于通过所述第一数据传输模块与所述共享内存进行数据传输,其中,所述客端数据传输装置包括至少以下任一项:客端数据存储单元,用于将所述第一待传输数据存储于所述共享内存中,客端数据获取单元,用于获取所述主端设备存储在所述共享内存的第二待传输数据。According to another aspect of the present application, the present application provides an apparatus for performing data transmission in a virtual environment, where the apparatus includes: a client creation apparatus for creating a first data transmission module; a client allocation apparatus, And configured to allocate a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform a read/write operation; and the client data transmission device is configured to pass the first data transmission module and the shared memory Performing data transmission, wherein the client data transmission device includes at least one of the following: a client data storage unit, configured to store the first to-be-transmitted data in the shared memory, a client data acquisition unit, And configured to acquire second to-be-transmitted data stored by the primary device in the shared memory.
进一步地,所述客端数据存储单元包括:用于将所述第一待传输数据读取至用户空间的子单元;用于将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元。Further, the client data storage unit includes: a subunit for reading the first data to be transmitted to the user space; and copying the first data to be transmitted from the user space to the kernel The subunit of the shared memory of space.
进一步地,所述用于将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元包括:用于基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第一待传输数据分次拷贝至位于内核空间的所述共享内存的子单元;用于在每次拷贝后,向所述主端设备发送第一数据传输消息的子单元;用于当获取所述主端设备所返回的第一数据读取消息后进行下一次拷贝直至传输完成的子单元。Further, the subunit for copying the first to-be-transmitted data from the user space to the shared memory located in a kernel space includes: configured to use the related capacity information based on the shared memory And reading, by the sub-unit of the shared memory located in the kernel space, the sub-units of the shared memory that are read into the user space; and sending, by each copy, the first data transmission message to the primary end device a subunit; a subunit for performing the next copy until the transmission is completed after acquiring the first data read message returned by the primary device.
进一步地,所述客端数据获取单元包括:用于读取所述主端设备存储在所述共享内存的第二待传输数据的子单元;用于将所读取的第二待传输数据拷贝至用户空间的子单元;用于将所述拷贝至用户空间的第二待传输数据存储至存储介质的子单元。Further, the client data obtaining unit includes: a subunit for reading the second data to be transmitted stored by the master device in the shared memory; and configured to copy the read second data to be transmitted a subunit to the user space; a second unit to be used for storing the copy to the user space to the subunit of the storage medium.
进一步地,所述用于读取所述主端设备存储在所述共享内存的第二待传输数据的子单元包括:用于根据所述主端设备所发送的第二数据传输消息读取所述主端设备存储在所述共享内存的第二待传输数据的子单元;用于在读取完成后向所述主端设备返回第二数据读取消息的子单元。
Further, the subunit for reading the second data to be transmitted stored by the primary device in the shared memory includes: a second data transmission message reading station according to the primary device a subunit of the second data to be transmitted stored by the master device in the shared memory; a subunit for returning a second data read message to the master device after the reading is completed.
进一步地,所述设备还包括:客端通信装置,用于在通过所述第一数据传输模块与所述共享内存进行数据传输之前,与所述主端设备进行传输事件通信,其中,所述客端通信装置包括至少以下任一项:客端信息发送单元,用于向所述主端设备发送关于所述第一待传输数据的第一数据信息;客端信息获取单元,用于获取所述主端设备所发送的关于所述第二待传输数据的第二数据信息。Further, the device further includes: a client communication device, configured to perform transmission event communication with the primary device before performing data transmission with the shared memory by the first data transmission module, where The client communication device includes at least one of the following: a client information sending unit, configured to send first data information about the first data to be transmitted to the primary device, and a client information acquiring unit, configured to acquire And second data information about the second data to be transmitted sent by the primary device.
根据本申请的另一个方面,本申请提供了一种在虚拟环境下进行数据传输的设备,其中,所述设备包括:主端创建装置,用于创建第二数据传输模块;主端分配装置,用于获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作;主端数据传输装置,用于通过所述第二数据传输模块与所述共享内存进行数据传输,其中,所述主端数据传输装置包括至少以下任一项:主端数据获取单元,用于获取所述客端设备存储在所述共享内存的第一待传输数据,主端数据存储单元,用于将所述第二待传输数据存储于所述共享内存中。According to another aspect of the present disclosure, the present application provides an apparatus for performing data transmission in a virtual environment, where the apparatus includes: a primary end creating device for creating a second data transmission module; a primary end allocation device, The access authority for obtaining the shared memory allocated by the client device, so that the shared memory allows the master device to perform read and write operations; and the primary data transmission device is configured to share with the second data transmission module The data transmission is performed by the memory, wherein the primary data transmission device includes at least one of the following: a primary data acquisition unit, configured to acquire first data to be transmitted stored in the shared memory by the client device, and the primary end a data storage unit, configured to store the second to-be-transmitted data in the shared memory.
进一步地,所述主端数据存储单元包括:用于将所述第二待传输数据读取至用户空间的子单元;用于将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元。Further, the primary data storage unit includes: a subunit for reading the second data to be transmitted to the user space; and copying the second data to be transmitted from the user space to the kernel The subunit of the shared memory of space.
进一步地,所述用于将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元包括:用于基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第二待传输数据分次拷贝至位于内核空间的所述共享内存的子单元;用于在每次拷贝后,向所述客端设备发送第二数据传输消息的子单元;用于当获取所述客端设备所返回的第二数据读取消息后进行下一次拷贝直至传输完成的子单元。Further, the subunit for copying the second data to be transmitted from the user space to the shared memory located in a kernel space includes: configured to use the related capacity information based on the shared memory And reading, by the sub-unit of the shared memory located in the kernel space, for each second copy, sending a second data transmission message to the client device after each copy a subunit; a subunit for performing a next copy until the transfer is completed after acquiring the second data read message returned by the guest device.
进一步地,所述主端数据获取单元包括:用于读取所述客端设备存储在所述共享内存的第一待传输数据的子单元;用于将所读取的第一待传输数据拷贝至用户空间的子单元;用于将所述拷贝至用户空间的第一待传输数据存储至存储介质的子单元。Further, the primary data obtaining unit includes: a subunit for reading the first data to be transmitted stored by the client device in the shared memory; and configured to copy the read first data to be transmitted a subunit to the user space; the first to be transmitted data for copying the copy to the user space to a subunit of the storage medium.
进一步地,所述用于读取所述客端设备存储在所述共享内存的第一待传输数据的子单元包括:用于根据所述客端设备所发送的第一数据传输消息读取所述客端设备存储在所述共享内存的第一待传输数据的子单元;用于在读取完成后,向所述客端设备返回第一数据读取消息的子单元。Further, the subunit for reading the first data to be transmitted stored by the client device in the shared memory includes: a first data transmission message reading station according to the client device a subunit of the first data to be transmitted stored in the shared memory by the client device; and a subunit for returning the first data read message to the guest device after the reading is completed.
进一步地,所述设备还包括:主端通信装置,用于在通过所述第二数据传输模块与所述共享内存进行数据传输之前,与所述客端设备进行传输事件通信,其中,所述主端通信装置包括至少以下任一项:主端信息发送单元,用于向所述客端设备发送关于所述
第二待传输数据的第二数据信息;主端信息获取单元,用于获取所述客端设备所发送的关于所述第一待传输数据的第一数据信息。Further, the device further includes: a primary communication device, configured to perform transmission event communication with the client device before performing data transmission with the shared memory by the second data transmission module, where The primary communication device includes at least one of: a primary information transmitting unit, configured to send, to the client device, the
The second data information of the second data to be transmitted; the primary information acquiring unit is configured to acquire first data information about the first data to be transmitted sent by the client device.
与现有技术相比,本申请的一个实施例中,客端设备创建第一数据传输模块,主端设备创建第二数据传输模块,所述第一数据传输模块和所述第二数据传输模块提供了客端设备端的用户空间与主端设备端的用户空间之间的数据传输通道;所述客端设备根据所述第一数据传输模块分配一位于内核空间的共享内存,并允许所述主端设备对所述共享内存进行读写操作,所述主端设备获取所述共享内存的访问权限;所述客端设备和所述主端设备分别通过所述第一数据传输模块和所述第二数据传输模块与所述共享内存进行数据传输,具体地,所述客端设备将所述第一待传输数据存储于所述共享内存中,所述主端设备获取所述客端设备存储在所述共享内存的第一待传输数据,所述主端设备将所述第二待传输数据存储于所述共享内存中,所述客端设备获取所述主端设备存储在所述共享内存的第二待传输数据。Compared with the prior art, in one embodiment of the present application, the client device creates a first data transmission module, and the primary device creates a second data transmission module, the first data transmission module and the second data transmission module. Providing a data transmission channel between the user space of the client device and the user space of the host device; the client device allocates a shared memory located in the kernel space according to the first data transmission module, and allows the primary terminal The device reads and writes the shared memory, and the primary device acquires access rights of the shared memory; the client device and the primary device respectively pass the first data transmission module and the second The data transmission module performs data transmission with the shared memory. Specifically, the client device stores the first to-be-transmitted data in the shared memory, and the primary device obtains the storage of the client device. The first to-be-transmitted data of the shared memory, the primary device stores the second to-be-transmitted data in the shared memory, and the guest device acquires the primary Data stored in the second device to be transmitted to the shared memory.
如此,通过位于内核空间的共享内存作为中转站传输数据,与现有的串口传输方式相比,大大地提高数据传输速率,与现有的热插拔磁盘的方式相比,操作较为简洁,对系统资源的占用较少。In this way, the shared memory located in the kernel space is used as the transfer station to transmit data, which greatly improves the data transmission rate compared with the existing serial port transmission mode, and the operation is relatively simple compared with the existing hot-swappable disk method. System resources are used less.
通过阅读参照以下附图所作的对非限制性实施例所作的详细描述,本申请的其它特征、目的和优点将会变得更明显:Other features, objects, and advantages of the present application will become more apparent from the detailed description of the accompanying drawings.
图1示出根据本申请一个方面的一个实施例的一种在虚拟环境下进行数据传输的客端设备;1 illustrates a client device for data transmission in a virtual environment, in accordance with an embodiment of an aspect of the present application;
图2示出根据本申请一个方面的一个优选实施例的一种在虚拟环境下进行数据传输的客端设备的客端数据传输装置;2 illustrates a client data transmission device of a client device for performing data transmission in a virtual environment, in accordance with a preferred embodiment of an aspect of the present application;
图3示出根据本申请一个方面的一个优选实施例的一种在虚拟环境下进行数据传输的客端设备;3 illustrates a client device for data transmission in a virtual environment in accordance with a preferred embodiment of an aspect of the present application;
图4示出根据本申请一个方面的一个实施例的一种在虚拟环境下进行数据传输的主端设备;4 illustrates a primary device for performing data transmission in a virtual environment, in accordance with an embodiment of an aspect of the present application;
图5示出根据本申请一个方面的一个优选实施例的一种在虚拟环境下进行数据传输的主端设备的主端数据传输装置;FIG. 5 illustrates a primary end data transmission device of a primary end device for performing data transmission in a virtual environment according to a preferred embodiment of an aspect of the present application; FIG.
图6示出根据本申请一个方面的一个优选实施例的一种在虚拟环境下进行数据传输
的主端设备;6 illustrates a data transmission in a virtual environment in accordance with a preferred embodiment of an aspect of the present application.
Master device
图7示出根据本申请一个方面的一个实施例的一种在虚拟环境下进行数据传输的客端设备与主端设备配合的示意图;FIG. 7 is a schematic diagram showing a cooperation between a client device and a master device for performing data transmission in a virtual environment according to an embodiment of an aspect of the present application; FIG.
图8示出根据本申请另一个方面的一个实施例的一种在客端设备端的用于虚拟环境下传输数据的方法流程图;FIG. 8 illustrates a flow chart of a method for transmitting data in a virtual environment on a client device side according to an embodiment of another aspect of the present application; FIG.
图9示出根据本申请另一个方面的一个实施例的一种在主端设备端的用于虚拟环境下传输数据的方法流程图;FIG. 9 is a flowchart of a method for transmitting data in a virtual environment on a primary device side according to an embodiment of another aspect of the present application; FIG.
图10示出根据本申请另一个方面的一个实施例的一种用于虚拟环境下传输数据的方法流程图。FIG. 10 illustrates a flow chart of a method for transmitting data in a virtual environment, in accordance with an embodiment of another aspect of the present application.
附图中相同或相似的附图标记代表相同或相似的部件。The same or similar reference numerals in the drawings denote the same or similar components.
下面结合附图对本申请作进一步详细描述。The present application is further described in detail below with reference to the accompanying drawings.
图1示出根据本申请一个方面的一个实施例的一种在虚拟环境下进行数据传输的客端设备1,其中,客端设备1包括客端创建装置11、客端分配装置12和客端数据传输装置13。1 shows a client device 1 for data transmission in a virtual environment, wherein the client device 1 includes a client creation device 11, a client distribution device 12, and a client, in accordance with an embodiment of an aspect of the present application. Data transmission device 13.
具体地,所述客端创建装置11创建第一数据传输模块;所述客端分配装置12根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作;所述客端数据传输装置13通过所述第一数据传输模块与所述共享内存进行数据传输。Specifically, the client creating device 11 creates a first data transmission module; the client allocation device 12 allocates a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform read and write operations. The client data transmission device 13 performs data transmission with the shared memory through the first data transmission module.
在此,所述客端设备1包括一种能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备,其硬件包括但不限于微处理器、专用集成电路(ASIC)、可编程门阵列(FPGA)、数字处理器(DSP)、嵌入式设备等。所述客端设备1也可以是由一系列按照特定顺序组织的计算机数据和指令的集合。此外,所述客端设备也可以是由一系列按照特定顺序组织的计算机数据和指令的集合与能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备的结合。本领域技术人员应能理解所述客端设备1仅为举例,其他现有的或今后可能出现的客端设备1如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。Here, the client device 1 includes an electronic device capable of automatically performing numerical calculation and information processing according to an instruction set or stored in advance, the hardware of which includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), Programmable gate array (FPGA), digital processor (DSP), embedded devices, etc. The client device 1 can also be a collection of computer data and instructions organized in a series of sequences. In addition, the client device may also be a combination of a collection of computer data and instructions organized in a specific order and electronic devices capable of automatically performing numerical calculations and information processing in accordance with pre-set or stored instructions. A person skilled in the art should understand that the client device 1 is only an example, and other existing or future client devices 1 may be included in the application, and should be included in the scope of the present application. It is included here by reference.
上述各装置之间是持续不断工作的,在此,本领域技术人员应理解“持续”是指上述各装置分别实时地或者按照设定的或实时调整的工作模式要求,例如所述客端创建装置11创建第一数据传输模块,所述客端创建装置11所创建的第一数据传输模块持续供所述客端分配装置12和所述客端数据传输装置13使用,所述客端分配装置12持续根
据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作,所述客端数据传输装置13持续通过所述第一数据传输模块与所述共享内存进行数据传输,直至所述客端设备1停止工作。The above devices are continuously working. Here, those skilled in the art should understand that "continuous" refers to the above-mentioned respective devices respectively in real time or according to the set or real-time adjusted working mode requirements, for example, the client is created. The device 11 creates a first data transmission module, and the first data transmission module created by the client creation device 11 is continuously used by the client distribution device 12 and the client data transmission device 13, the client distribution device 12 continuous roots
According to the first data transmission module, a shared memory is allocated, and the shared memory allows the primary device to perform read and write operations, and the client data transmission device 13 continues to perform the first data transmission module and the shared memory. Data is transmitted until the guest device 1 stops working.
在具体的实施例中,虚拟化环境下,客端设备可以是客户虚拟机(guest),主端设备可以是特权虚拟机(host),通过特权虚拟机可以实现对一个或多个非特权级的客户虚拟机的管理。In a specific embodiment, in a virtualized environment, the guest device may be a guest virtual machine (guest), and the primary device may be a privileged virtual machine (host), and one or more non-privileged levels may be implemented by the privileged virtual machine. Management of customer virtual machines.
所述客端创建装置11创建第一数据传输模块。The client creation device 11 creates a first data transmission module.
其中,所述第一数据传输模块包括客端虚拟设备和客端驱动。所述客端创建装置11创建第一数据传输模块包括:创建客端虚拟设备以及加载所述客端虚拟设备的客端驱动。The first data transmission module includes a guest virtual device and a client driver. The creating of the first data transmission module by the client creation device 11 includes: creating a guest virtual device and loading a client driver of the guest virtual device.
进一步的,所述客端创建装置11根据host的管理程序(hypervisor)的类型,通过修改相应逻辑增加客端虚拟设备,所述客端虚拟设备用于内核空间与用户空间之间以及guest与host的内核空间之间的通信。具体地,在guest的创建阶段,所述客端创建装置11可以直接通过创建的方法增加客端虚拟设备,若guest已存在,则所述客端创建装置11可以采用热插拔方法增加客端虚拟设备。Further, the client creating device 11 adds a client virtual device by modifying a corresponding logic according to a type of a hypervisor of the host, where the guest virtual device is used between the kernel space and the user space, and the guest and the host. Communication between kernel spaces. Specifically, in the creation phase of the guest, the client creation device 11 can directly add the guest virtual device by using the created method. If the guest already exists, the client creation device 11 can use the hot plug method to increase the client. Virtual device.
在此,客端设备的操作系统(例如为Linux操作系统)的虚拟内存划分为内核空间与用户空间,运行在内核空间的核心软件拥有访问硬件设备的所有权限,具有较高的特权级别;运行在用户空间的普通应用程序只能看到允许它们使用的部分系统资源,并且不能使用某些特定的系统功能,也不能直接访问内核空间和硬件设备。Here, the virtual memory of the operating system of the guest device (for example, the Linux operating system) is divided into kernel space and user space, and the core software running in the kernel space has all the rights to access the hardware device, and has a higher privilege level; Ordinary applications in user space can only see some of the system resources that they are allowed to use, and cannot use certain system features or direct access to kernel space and hardware devices.
因此,所创建的第一数据传输模块提供了内核空间与用户空间之间的数据传输通道,有利于后续数据传输的顺利进行。Therefore, the created first data transmission module provides a data transmission channel between the kernel space and the user space, which facilitates the smooth progress of subsequent data transmission.
所述客端分配装置12根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作。The client allocation device 12 allocates a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform read and write operations.
在具体的实施例中,所述第一数据传输模块中的客端驱动检测到客端虚拟设备时分配一共享内存,所述共享内存位于内核空间,并允许主端设备的第二数据传输模块中的主端驱动访问该共享内存。具体地,所述第一数据传输模块中的客端驱动检测到所述客端虚拟设备时,分配用于数据传输的传输页面,分配用于控制数据传输的控制页面,所述传输页面与所述控制页面均为所述共享内存页面。In a specific embodiment, when the guest driver in the first data transmission module detects the guest virtual device, a shared memory is allocated, the shared memory is located in the kernel space, and the second data transmission module of the primary device is allowed. The master driver in the access accesses the shared memory. Specifically, when the guest driver in the first data transmission module detects the guest virtual device, allocate a transmission page for data transmission, and allocate a control page for controlling data transmission, where the transmission page and the location are The control page is the shared memory page.
在此,通过位于内核空间的共享内存作为中转站传输数据,与现有的串口传输方式相比,大大地提高数据传输速率,与现有的热插拔磁盘的方式相比,操作较为简洁,对
系统资源的占用较少。Here, the shared memory located in the kernel space is used as a transfer station to transmit data, which greatly improves the data transfer rate compared with the existing serial port transmission mode, and is simpler in operation than the existing hot-swappable disk. Correct
System resources are used less.
请参阅图2,所述客端数据传输装置13通过所述第一数据传输模块与所述共享内存进行数据传输,所述客端数据传输装置13包括客端数据存储单元131和客端数据获取单元132中的至少任一项,其中,所述客端数据存储单元131将所述第一待传输数据存储于所述共享内存中,所述客端数据获取单元132获取所述主端设备存储在所述共享内存的第二待传输数据。Referring to FIG. 2, the client data transmission device 13 performs data transmission with the shared memory through the first data transmission module, and the client data transmission device 13 includes a client data storage unit 131 and client data acquisition. At least one of the units 132, wherein the client data storage unit 131 stores the first to-be-transmitted data in the shared memory, and the client data acquiring unit 132 acquires the primary device storage The second data to be transmitted in the shared memory.
在此,所述客端数据存储单元131用于向所述主端设备发送第一待传输数据,所述客端数据获取单元132用于接收所述主端设备所发送的第二待传输数据。所述客端数据传输装置13可以仅包括所述客端数据存储单元131,即向所述主端设备发送第一待传输数据;所述客端数据传输装置13也可以仅包括所述客端数据获取单元132,即接收所述主端设备所发送的第二待传输数据;所述客端数据传输装置13还可以包括所述客端数据存储单元131和所述客端数据获取单元132,即向所述主端设备发送第一待传输数据与接收所述主端设备所发送的第二待传输数据同时进行。Here, the client data storage unit 131 is configured to send the first data to be transmitted to the primary device, where the client data acquiring unit 132 is configured to receive the second data to be transmitted sent by the primary device. . The client data transmission device 13 may only include the client data storage unit 131, that is, send the first data to be transmitted to the master device; the client data transmission device 13 may also include only the client. The data acquiring unit 132 receives the second data to be transmitted sent by the primary device; the client data transmitting device 13 may further include the client data storage unit 131 and the client data acquiring unit 132. That is, sending the first to-be-transmitted data to the primary end device and receiving the second to-be-transmitted data sent by the primary-end device simultaneously.
具体地,所述客端数据存储单元131可以包括:用于将所述第一待传输数据读取至用户空间的子单元;用于将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元。Specifically, the client data storage unit 131 may include: a subunit for reading the first data to be transmitted to the user space; and copying the first data to be transmitted from the user space to A subunit of the shared memory located in kernel space.
在此,所述客端数据存储单元131将所述第一待传输数据从客端设备1的存储介质读取至内存中客端设备端的用户空间,而共享内存位于内存的内核空间,故将所述第一待传输数据从所述用户空间拷贝至所述共享内存。Here, the client data storage unit 131 reads the first data to be transmitted from the storage medium of the client device 1 to the user space of the client device in the memory, and the shared memory is located in the kernel space of the memory, so The first to-be-transmitted data is copied from the user space to the shared memory.
具体地,所述用于将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元包括:用于基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第一待传输数据分次拷贝至位于内核空间的所述共享内存的子单元;用于在每次拷贝后,向所述主端设备发送第一数据传输消息的子单元;用于当获取所述主端设备所返回的第一数据读取消息后进行下一次拷贝直至传输完成的子单元。Specifically, the subunit for copying the first to-be-transmitted data from the user space to the shared memory located in a kernel space includes: for using the related capacity information of the shared memory, And reading, by the sub-unit of the shared memory located in the kernel space, the sub-units of the shared memory that are read into the user space; and sending, by each copy, the first data transmission message to the primary end device a subunit; a subunit for performing the next copy until the transmission is completed after acquiring the first data read message returned by the primary device.
在此,所述共享内存的相关容量信息可以包括但不限于所述用于数据传输的传输页面的大小,所述传输页面的大小SIZET=子页面个数TP×子页面大小PAGESIZE。优选地,在将第一待传输数据从用户空间拷贝至所述共享内存时,以所述传输页面为单位分次进行拷贝。Here, the related capacity information of the shared memory may include, but is not limited to, the size of the transmission page for data transmission, and the size of the transmission page SIZET=the number of sub-pages TP×sub-page size PAGESIZE. Preferably, when the first to-be-transmitted data is copied from the user space to the shared memory, the copying is performed in units of the transmission page.
假设第一待传输数据的大小为N,客端数据传输装置13已发送的数据大小为ALREADY,其初始值为0,传输页面SEND1的空闲子页面个数为FREE,子页面编号A的
初始值为0,将所述第一待传输数据从客端数据传输装置13拷贝至所述共享内存的流程如下:Assuming that the size of the first data to be transmitted is N, the size of the data transmitted by the client data transmission device 13 is ALREADY, the initial value is 0, and the number of free subpages of the transmission page SEND1 is FREE, and the number of the subpage number A is
The initial value is 0, and the process of copying the first to-be-transmitted data from the client data transmission device 13 to the shared memory is as follows:
第一步,根据所述第一待传输数据未传输部分的大小LEFT=N–ALREADY,判断LEFT是否为0,若是,则所述第一待传输数据在客端设备端的传输已经结束,若否,则通过后续步骤判断能否将数据拷贝至所述共享内存;The first step is to determine whether the LEFT is 0 according to the size of the first untransmitted portion of the data to be transmitted, LEFT=N−ALREADY, and if yes, the transmission of the first data to be transmitted on the client device end has ended. , determining, by subsequent steps, whether data can be copied to the shared memory;
第二步,判断所述第一待传输数据未传输部分的大小LEFT是否大于等于传输页面SEND1的大小SIZET,若是,则此次待拷贝数据的大小INPUT=SIZET,若否,则此次待拷贝数据的大小INPUT=LEFT,即每次最多拷贝SIZET大小的数据;In the second step, it is determined whether the size LEFT of the untransferred portion of the first to-be-transmitted data is greater than or equal to the size SIZET of the transmission page SEND1, and if so, the size of the data to be copied is INPUT=SIZET, and if not, the copy is to be copied. The size of the data is INPUT=LEFT, that is, the maximum size of SIZET data is copied at a time;
第三步,判断待拷贝数据大小INPUT是否大于等于子页面大小PAGESIZE,若是,则转第四步,若否,则转第五步;The third step is to determine whether the size of the data to be copied INPUT is greater than or equal to the subpage size PAGESIZE, and if so, then go to the fourth step, and if not, go to the fifth step;
第四步,将PAGESIZE大小的数据拷贝至传输页面SEND1中,将该子页面在所述共享内存中的地址ADDR=0,该子页面的长度LEN_SIZE=PAGESIZE及其子页面编号A放入控制页面中,然后执行INPUT-=PAGESIZE,A=(++A)>=TP?0:A,即待拷贝数据等于减去子页面大小后的新值,页面编号A加1后判断是否达到传输页面SEND1的最大子页面数TP,若A达到TP则给A赋值0,然后转第三步;In the fourth step, the data of the PAGESIZE size is copied to the transmission page SEND1, and the address of the subpage in the shared memory is ADDR=0, and the length of the subpage LEN_SIZE=PAGESIZE and its subpage number A are placed in the control page. Medium, then execute INPUT-=PAGESIZE, A=(++A)>=TP? 0: A, that is, the data to be copied is equal to the new value after subtracting the size of the sub-page. After the page number A is incremented by 1, it is judged whether the maximum number of sub-pages TP of the transmission page SEND1 is reached. If A reaches TP, the value A is assigned to 0, and then third step;
第五步,将INPUT大小的数据拷贝至传输页面SEND1中,将该子页面在所述共享内存中的地址ADDR=0,该子页面的长度LEN_SIZE=INPUT及其子页面编号A放入控制页面中,然后执行A=(++A)>=TP?0:A,即页面编号A加1后判断是否达到传输页面SEND1的最大子页面数TP,若A达到TP则给A赋值0,然后转第六步;In the fifth step, the data of the INPUT size is copied to the transmission page SEND1, and the address of the subpage in the shared memory is ADDR=0, and the length of the subpage LEN_SIZE=INPUT and its subpage number A are placed in the control page. Medium, then execute A=(++A)>=TP? 0: A, that is, after the page number A is incremented by 1, it is judged whether the maximum number of sub-pages TP of the transmission page SEND1 is reached, and if A reaches TP, A is assigned a value of 0, and then the sixth step is performed;
第六步,执行ALREADY+=此次拷贝至所述共享内存的数据大小,FREE-=此次使用的子页面个数,即客端数据传输装置13已发送的数据大小ALREADY等于加上此次拷贝至所述共享内存的数据大小后的新值,传输页面SEND1的空闲子页面个数FREE等于减去此次使用的子页面个数后的新值;然后向所述主端设备发送第一数据传输消息,以通知所述主端设备读取此次拷贝至所述共享内存的数据,在获取所述主端设备所返回的第一数据读取消息后,执行FREE=TP,然后转第一步。The sixth step is to execute ALREADY+=the size of the data copied to the shared memory, FREE-=the number of subpages used this time, that is, the data size ALREADY sent by the client data transmission device 13 is equal to the copy. a new value after the data size of the shared memory, the number of free subpages of the transmission page SEND1 is equal to the new value after subtracting the number of subpages used this time; and then sending the first data to the primary device Transmitting a message to notify the primary device to read the data copied to the shared memory, and after obtaining the first data read message returned by the primary device, perform FREE=TP, and then switch to the first step.
本领域技术人员应能理解上述将第一待传输数据从用户空间分次拷贝至共享内存的方法仅为举例,其他现有的或今后可能出现的将第一待传输数据从用户空间拷贝至共享内存的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。A person skilled in the art should understand that the above method for copying the first data to be transmitted from the user space to the shared memory is only an example, and other existing or future possible copies of the first to-be-transmitted data from the user space to the sharing may occur. The method of memory, as applicable to the present application, is also intended to be included within the scope of the present application and is hereby incorporated by reference.
具体地,所述客端数据获取单元132包括:用于读取所述主端设备存储在所述共享
内存的第二待传输数据的子单元;用于将所读取的第二待传输数据拷贝至用户空间的子单元;用于将所述拷贝至用户空间的第二待传输数据存储至存储介质的子单元。Specifically, the client data obtaining unit 132 includes: configured to read, that the master device is stored in the sharing
a subunit of the second data to be transmitted in the memory; a subunit for copying the read second data to be transmitted to the user space; and storing the second data to be transmitted copied to the user space to the storage medium Subunit.
在此,所述客端数据获取单元132将所述主端设备所发送的第二待传输数据从所述共享内存拷贝至用户空间,再从用户空间拷贝至存储介质。所述存储介质指的是非易失性存储介质,例如且不限于硬盘、光盘、U盘、SD卡等。Here, the client data obtaining unit 132 copies the second data to be transmitted sent by the master device from the shared memory to the user space, and then copies the data from the user space to the storage medium. The storage medium refers to a non-volatile storage medium such as, but not limited to, a hard disk, an optical disk, a USB flash drive, an SD card, or the like.
具体地,所述用于读取所述主端设备存储在所述共享内存的第二待传输数据的子单元包括:用于根据所述主端设备所发送的第二数据传输消息读取所述主端设备存储在所述共享内存的第二待传输数据的子单元;用于在读取完成后向所述主端设备返回第二数据读取消息的子单元。Specifically, the subunit for reading the second data to be transmitted stored by the primary device in the shared memory includes: a second data transmission message reading station according to the primary device a subunit of the second data to be transmitted stored by the master device in the shared memory; a subunit for returning a second data read message to the master device after the reading is completed.
例如,假设第二待传输数据的大小为N,客端数据传输装置13已接收的数据大小为GET,其初始值为0,将所述第二待传输数据从所述共享内存拷贝至客端数据传输装置13的流程如下:For example, if the size of the second data to be transmitted is N, the data size received by the client data transmission device 13 is GET, and the initial value is 0, and the second data to be transmitted is copied from the shared memory to the client. The flow of the data transmission device 13 is as follows:
第一步,判断等式GET==N是否为真,即判断客端数据传输装置13已接收的数据大小GET是否等于第二待传输数据的大小N,若是,则客端设备1已完成对所述第二待传输数据的读取,并向所述主端设备返回第二数据读取消息,若否,则转第二步;In the first step, it is determined whether the equation GET==N is true, that is, whether the data size GET received by the client data transmission device 13 is equal to the size N of the second data to be transmitted, and if so, the client device 1 has completed the pair. Reading the second data to be transmitted, and returning a second data read message to the primary device; if not, proceeding to the second step;
第二步,等待所述主端设备所发送的第二数据传输消息,当接收到所述主端设备所发送的第二数据传输消息后,根据控制页面中的关于传输页面RECEIVE1长度LEN_SLICE、传输页面RECEIVE1子页面编号及传输页面RECEIVE1在共享内存中的地址ADDR等信息,依次处理并将传输页面RECEIVE1中的数据拷贝至用户空间,所述客端数据获取单元132将所述拷贝至用户空间的第二待传输数据存储至存储介质,然后执行GET+=此次从所述共享内存中获取的数据大小,即客端数据传输装置13已接收的数据大小GET等于加上此次从所述共享内存中获取的数据大小后的新值,向所述主端设备返回第二数据读取消息,然后转第一步。In the second step, waiting for the second data transmission message sent by the primary device, after receiving the second data transmission message sent by the primary device, according to the length LEN_SLICE of the transmission page RECEIVE1 in the control page, and transmitting The page RECEIVE1 subpage number and the information of the address ADDR of the transmission page RECEIVE1 in the shared memory are sequentially processed and the data in the transmission page RECEIVE1 is copied to the user space, and the client data obtaining unit 132 copies the content to the user space. The second data to be transmitted is stored to the storage medium, and then GET+=the size of the data acquired from the shared memory, that is, the data size GET received by the client data transmission device 13 is equal to the current shared memory. The new value after the obtained data size is returned to the primary device to return a second data read message, and then the first step is taken.
本领域技术人员应能理解上述将第二待传输数据从共享内存拷贝至用户空间的方法仅为举例,其他现有的或今后可能出现的将第二待传输数据从共享内存拷贝至用户空间的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。Those skilled in the art should understand that the above method for copying the second data to be transmitted from the shared memory to the user space is only an example, and other existing or future possible copies of the second data to be transmitted are copied from the shared memory to the user space. The method is applicable to the present application and is also included in the scope of the present application, and is hereby incorporated by reference.
图3示出根据本申请一个方面的一个优选实施例的一种在虚拟环境下进行数据传输的客端设备1,其中,所述客端设备1包括客端创建装置11’、客端分配装置12’、客端数据传输装置13’和客端通信装置14’。
3 illustrates a client device 1 for data transmission in a virtual environment, wherein the client device 1 includes a client creation device 11', a client distribution device, in accordance with a preferred embodiment of an aspect of the present application, 12', the client data transmission device 13' and the client communication device 14'.
在此,所述客端创建装置11’、客端分配装置12’、客端数据传输装置13’与图1中客端创建装置11、客端分配装置12、客端数据传输装置13的内容相同或基本相同,为简明起见,不再赘述。Here, the content of the client creation device 11', the client distribution device 12', the client data transmission device 13', and the client creation device 11, the client distribution device 12, and the client data transmission device 13 in FIG. The same or basically the same, for the sake of brevity, no longer repeat them.
所述客端通信装置14’在通过所述第一数据传输模块与所述共享内存进行数据传输之前,与所述主端设备进行传输事件通信。具体地,所述客端通信装置包括客端信息发送单元(图中未示出)和客端信息获取单元(图中未示出)中的至少任一项,其中,所述客端信息发送单元向所述主端设备发送关于所述第一待传输数据的第一数据信息,所述客端信息获取单元获取所述主端设备所发送的关于所述第二待传输数据的第二数据信息。The client communication device 14' performs transmission event communication with the primary device before performing data transmission with the shared memory by the first data transmission module. Specifically, the client communication device includes at least one of a client information transmitting unit (not shown) and a client information acquiring unit (not shown), wherein the client information is transmitted. The unit sends the first data information about the first data to be transmitted to the primary device, where the client information obtaining unit acquires the second data about the second data to be transmitted sent by the primary device. information.
在此,所述第一待传输数据传输到所述主端设备端后,以文件形式存储于存储介质中,第一数据信息包括该文件的存储路径、该文件的名称及该文件的长度。所述第二待传输数据传输到所述客端设备端后,以文件形式存储于存储介质中,第二数据信息包括该文件的存储路径、该文件的名称及该文件的长度。通过所述客端通信装置在数据传输开始之前,与所述主端设备进行传输事件通信,可以避免一些类似于重复传输的低级错误,有效提高数据传输成功率。Here, the first to-be-transmitted data is transmitted to the storage device in the form of a file, and the first data information includes a storage path of the file, a name of the file, and a length of the file. After the second to-be-transmitted data is transmitted to the client device, it is stored in a storage medium in a file format, and the second data information includes a storage path of the file, a name of the file, and a length of the file. By the client communication device performing transmission event communication with the primary device before the data transmission starts, some low-level errors similar to repeated transmission can be avoided, and the data transmission success rate is effectively improved.
例如,假设在Xen虚拟化环境中,客端设备1与所述主端设备进行传输事件通信可以是:将传输命令放入xenstore(Xen虚拟环境中的一存储设备,xenstore是基于事件通道完成的)中,该传输命令包括第一数据信息,并通知所述主端设备存在新的命令。所述主端设备从xenstore中获取传输命令,提取第一数据信息,先查看所述第一数据信息中的文件的存储路径是否已经存在,若是,则返回错误,并通知客端设备1相应错误信息,然后结束传输;若否,则根据所述第一数据信息中的文件的存储路径创建文件,并通知客端设备1已经接受传输命令且处理正常。For example, assume that in the Xen virtualization environment, the client device 1 communicates with the host device for event communication: the transfer command can be placed in a xenstore (a storage device in the Xen virtual environment, and the xenstore is completed based on the event channel). The transfer command includes the first data information and notifies the host device that a new command exists. The master device obtains a transmission command from the xenstore, extracts the first data information, and first checks whether the storage path of the file in the first data information already exists, and if yes, returns an error, and notifies the client device 1 of the corresponding error. The information then ends the transmission; if not, the file is created according to the storage path of the file in the first data information, and the client device 1 is notified that the transmission command has been accepted and the processing is normal.
图4示出根据本申请一个方面的一个实施例的一种在虚拟环境下进行数据传输的主端设备2,其中,主端设备2包括主端创建装置25、主端分配装置26和主端数据传输装置27。4 illustrates a primary device 2 for performing data transmission in a virtual environment, wherein the primary device 2 includes a primary device 25, a primary device 26, and a primary device, in accordance with an embodiment of an aspect of an aspect of the present application. Data transmission device 27.
具体地,所述主端创建装置25创建第二数据传输模块;所述主端分配装置26获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作;所述主端数据传输装置27通过所述第二数据传输模块与所述共享内存进行数据传输。Specifically, the primary end creating device 25 creates a second data transmission module; the primary end allocation device 26 acquires access rights of the shared memory allocated by the guest device, so that the shared memory allows the primary device to read and write. The primary data transmission device 27 performs data transmission with the shared memory through the second data transmission module.
在此,所述主端设备2包括一种能够按照事先设定或存储的指令,自动进行数值计
算和信息处理的电子设备,其硬件包括但不限于微处理器、专用集成电路(ASIC)、可编程门阵列(FPGA)、数字处理器(DSP)、嵌入式设备等。所述主端设备2也可以是由一系列按照特定顺序组织的计算机数据和指令的集合。此外,所述主端设备2也可以是由一系列按照特定顺序组织的计算机数据和指令的集合与能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备的结合。本领域技术人员应能理解所述主端设备2仅为举例,其他现有的或今后可能出现的主端设备2如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。Here, the master device 2 includes an automatic numerical meter capable of automatically setting or storing the instructions in advance.
Electronic devices for computing and information processing, including but not limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, and the like. The primary device 2 can also be a collection of computer data and instructions organized in a sequence of specific sequences. Furthermore, the master device 2 may also be a combination of a collection of computer data and instructions organized in a specific sequence and electronic devices capable of automatically performing numerical calculations and information processing in accordance with pre-set or stored instructions. Those skilled in the art should understand that the primary device 2 is merely an example, and other existing or future primary devices 2 may be applicable to the present application, and should also be included in the protection scope of the present application. It is included here by reference.
上述各装置之间是持续不断工作的,在此,本领域技术人员应理解“持续”是指上述各装置分别实时地或者按照设定的或实时调整的工作模式要求,例如所述主端创建装置25创建第二数据传输模块,所述主端创建装置25所创建的第二数据传输模块持续供所述主端分配装置26和所述主端数据传输装置27使用,所述主端分配装置26持续获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作,所述主端数据传输装置27持续通过所述第二数据传输模块与所述共享内存进行数据传输,直至所述主端设备2停止工作。The above-mentioned devices are continuously working. Here, those skilled in the art should understand that "continuous" refers to the above-mentioned respective devices respectively in real time or according to the set or real-time adjusted working mode requirements, for example, the primary end is created. The device 25 creates a second data transmission module, the second data transmission module created by the primary terminal creation device 25 is continuously used by the primary distribution device 26 and the primary data transmission device 27, the primary distribution device 26 continuously obtaining access rights of the shared memory allocated by the client device, so that the shared memory allows the master device to perform read and write operations, and the master data transmission device 27 continues to pass the second data transmission module and the The shared memory performs data transfer until the primary device 2 stops working.
在具体的实施例中,虚拟化环境下,客端设备可以是客户虚拟机(guest),主端设备可以是特权虚拟机(host),通过特权虚拟机可以实现对一个或多个非特权级的客户虚拟机的管理。In a specific embodiment, in a virtualized environment, the guest device may be a guest virtual machine (guest), and the primary device may be a privileged virtual machine (host), and one or more non-privileged levels may be implemented by the privileged virtual machine. Management of customer virtual machines.
进一步地,所述主端创建装置25创建第二数据传输模块。Further, the primary end creating device 25 creates a second data transmission module.
其中,所述第二数据传输模块包括主端虚拟设备和主端驱动。所述主端创建装置25创建第二数据传输模块包括:创建主端虚拟设备以及加载所述主端虚拟设备的主端驱动。The second data transmission module includes a primary virtual device and a primary drive. The creating, by the primary end creating device 25, the second data transmission module includes: creating a primary virtual device and loading a primary driver of the primary virtual device.
进一步的,所述主端创建装置25根据host的管理程序(hypervisor)的类型,通过修改相应逻辑增加主端虚拟设备,所述主端虚拟设备用于内核空间与用户空间之间以及host与guest的内核空间之间的通信。Further, the primary end creating device 25 increases the primary virtual device by modifying the corresponding logic according to the type of the hypervisor of the host, and the primary virtual device is used between the kernel space and the user space and the host and the guest. Communication between kernel spaces.
在此,主端设备的操作系统(例如为Linux操作系统)的虚拟内存划分为内核空间与用户空间,运行在内核空间的核心软件拥有访问硬件设备的所有权限,具有较高的特权级别;运行在用户空间的普通应用程序只能看到允许它们使用的部分系统资源,并且不能使用某些特定的系统功能,也不能直接访问内核空间和硬件设备。Here, the virtual memory of the operating system of the primary device (for example, the Linux operating system) is divided into kernel space and user space, and the core software running in the kernel space has all the rights to access the hardware device, and has a higher privilege level; Ordinary applications in user space can only see some of the system resources that they are allowed to use, and cannot use certain system features or direct access to kernel space and hardware devices.
因此,所创建的第二数据传输模块提供了内核空间与用户空间之间的数据传输通道,有利于后续数据传输的顺利进行。
Therefore, the created second data transmission module provides a data transmission channel between the kernel space and the user space, which facilitates the smooth progress of subsequent data transmission.
所述主端分配装置26获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作。The primary distribution device 26 obtains access rights of the shared memory allocated by the client device, so that the shared memory allows the primary device to perform read and write operations.
在具体的实施例中,客端设备的第一数据传输模块中的客端驱动检测到客端虚拟设备时分配一共享内存,所述共享内存位于内核空间,并允许所述第二数据传输模块中的主端驱动访问该共享内存。具体地,所述第一数据传输模块中的客端驱动检测到所述第一数据传输模块中的客端虚拟设备时,分配用于数据传输的传输页面,分配用于控制数据传输的控制页面,所述传输页面与所述控制页面均为所述共享内存页面。In a specific embodiment, the guest driver in the first data transmission module of the client device allocates a shared memory when detecting the guest virtual device, the shared memory is located in the kernel space, and allows the second data transmission module The master driver in the access accesses the shared memory. Specifically, when the guest driver in the first data transmission module detects the guest virtual device in the first data transmission module, allocate a transmission page for data transmission, and allocate a control page for controlling data transmission. The transfer page and the control page are both the shared memory page.
在此,通过位于内核空间的共享内存作为中转站传输数据,与现有的串口传输方式相比,大大地提高数据传输速率,与现有的热插拔磁盘的方式相比,操作较为简洁,对系统资源的占用较少。Here, the shared memory located in the kernel space is used as a transfer station to transmit data, which greatly improves the data transfer rate compared with the existing serial port transmission mode, and is simpler in operation than the existing hot-swappable disk. Less use of system resources.
请参阅图5,所述主端数据传输装置27通过所述第二数据传输模块与所述共享内存进行数据传输,所述主端数据传输装置27包括主端数据存储单元271和主端数据获取单元272中的至少任一项,其中,所述主端数据存储单元271获取所述客端设备存储在所述共享内存的第一待传输数据,所述主端数据获取单元272将所述第二待传输数据存储于所述共享内存中。Referring to FIG. 5, the primary data transmission device 27 performs data transmission with the shared memory through the second data transmission module, and the primary data transmission device 27 includes a primary data storage unit 271 and a primary data acquisition. At least one of the unit 272, wherein the primary data storage unit 271 acquires the first data to be transmitted stored by the client device in the shared memory, and the primary data acquiring unit 272 The two to-be-transmitted data is stored in the shared memory.
在此,所述主端数据存储单元271用于接收所述客端设备所发送的第一待传输数据,所述主端数据获取单元272用于向所述客端设备发送第二待传输数据。所述主端数据传输装置27可以仅包括所述主端数据存储单元271,即接收所述客端设备所发送的第一待传输数;所述主端数据传输装置27也可以仅包括所述主端数据获取单元272,即向所述客端设备发送第二待传输数据;所述主端数据传输装置27还可以包括所述主端数据存储单元271和所述主端数据获取单元272,即接收所述客端设备所发送的第一待传输数据与向所述客端设备发送第二待传输数据同时进行。Here, the primary data storage unit 271 is configured to receive the first data to be transmitted sent by the client device, and the primary data acquiring unit 272 is configured to send the second data to be transmitted to the client device. . The primary data transmission device 27 may include only the primary data storage unit 271, that is, receive the first to-be-transmitted number sent by the client device; the primary data transmission device 27 may also include only the The primary data acquiring unit 272 sends the second data to be transmitted to the client device. The primary data transmitting device 27 may further include the primary data storage unit 271 and the primary data acquiring unit 272. That is, receiving the first to-be-transmitted data sent by the client device and transmitting the second to-be-transmitted data to the client device simultaneously.
具体地,所述主端数据存储单元271可以包括:用于将所述第二待传输数据读取至用户空间的子单元;用于将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元。Specifically, the primary data storage unit 271 may include: a subunit for reading the second data to be transmitted to the user space; and copying the second data to be transmitted from the user space to A subunit of the shared memory located in kernel space.
在此,所述主端数据存储单元271将所述第二待传输数据从主端设备2的存储介质读取至内存中主端设备端的用户空间,而共享内存位于内存的内核空间,故将所述第二待传输数据从所述用户空间拷贝至所述共享内存。Here, the primary data storage unit 271 reads the second data to be transmitted from the storage medium of the primary device 2 to the user space of the primary device in the memory, and the shared memory is located in the kernel space of the memory, so The second to-be-transmitted data is copied from the user space to the shared memory.
具体地,所述用于将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元包括:用于基于所述共享内存的相关容量信息,将所述读取至所述
用户空间的第二待传输数据分次拷贝至位于内核空间的所述共享内存的子单元;用于在每次拷贝后,向所述客端设备发送第二数据传输消息的子单元;用于当获取所述客端设备所返回的第二数据读取消息后进行下一次拷贝直至传输完成的子单元。Specifically, the subunit for copying the second to-be-transmitted data from the user space to the shared memory located in a kernel space includes: for using the related capacity information of the shared memory, Read to
The second to-be-transmitted data of the user space is copied to the sub-unit of the shared memory located in the kernel space; for each copy, the sub-unit of the second data transmission message is sent to the client device; After obtaining the second data read message returned by the client device, the next copy is performed until the subunit is completed.
在此,所述共享内存的相关容量信息可以包括但不限于所述用于数据传输的传输页面的大小,所述传输页面的大小SIZET=子页面个数TP×子页面大小PAGESIZE。优选地,在将第二待传输数据从用户空间拷贝至所述共享内存时,以所述传输页面为单位分次进行拷贝。Here, the related capacity information of the shared memory may include, but is not limited to, the size of the transmission page for data transmission, and the size of the transmission page SIZET=the number of sub-pages TP×sub-page size PAGESIZE. Preferably, when the second to-be-transmitted data is copied from the user space to the shared memory, the copying is performed in units of the transmission page.
假设第二待传输数据的大小为N,主端数据传输装置27已发送的数据大小为ALREADY,其初始值为0,传输页面SEND2的空闲子页面个数为FREE,子页面编号A的初始值为0,将所述第二待传输数据从主端数据传输装置27拷贝至所述共享内存的流程如下:Assuming that the size of the second data to be transmitted is N, the data size transmitted by the primary data transmission device 27 is ALREADY, the initial value is 0, the number of free subpages of the transmission page SEND2 is FREE, and the initial value of the subpage number A is The process of copying the second data to be transmitted from the primary data transmission device 27 to the shared memory is as follows:
第一步,根据所述第二待传输数据未传输部分的大小LEFT=N–ALREADY,判断LEFT是否为0,若是,则所述第二待传输数据在主端设备端的传输已经结束,若否,则通过后续步骤判断能否将数据拷贝至所述共享内存;The first step is to determine whether the LEFT is 0 according to the size of the untransmitted portion of the second data to be transmitted, LEFT=N−ALREADY, and if yes, the transmission of the second data to be transmitted on the primary device end has ended. , determining, by subsequent steps, whether data can be copied to the shared memory;
第二步,判断所述第二待传输数据未传输部分的大小LEFT是否大于等于传输页面SEND2的大小SIZET,若是,则此次待拷贝数据的大小INPUT=SIZET,若否,则此次待拷贝数据的大小INPUT=LEFT,即每次最多拷贝SIZET大小的数据;In the second step, it is determined whether the size LEFT of the untransferred portion of the second to-be-transmitted data is greater than or equal to the size SIZET of the transmission page SEND2, and if so, the size of the data to be copied is INPUT=SIZET, and if not, the copy is to be copied. The size of the data is INPUT=LEFT, that is, the maximum size of SIZET data is copied at a time;
第三步,判断待拷贝数据大小INPUT是否大于等于子页面大小PAGESIZE,若是,则转第四步,若否,则转第五步;The third step is to determine whether the size of the data to be copied INPUT is greater than or equal to the subpage size PAGESIZE, and if so, then go to the fourth step, and if not, go to the fifth step;
第四步,将PAGESIZE大小的数据拷贝至传输页面SEND2中,将该子页面在所述共享内存中的地址ADDR=0,该子页面的长度LEN_SIZE=PAGESIZE及其子页面编号A放入控制页面中,然后执行INPUT-=PAGESIZE,A=(++A)>=TP?0:A,即待拷贝数据等于减去子页面大小后的新值,页面编号A加1后判断是否达到传输页面SEND2的最大子页面数TP,若A达到TP则给A赋值0,然后转第三步;In the fourth step, the data of the PAGESIZE size is copied to the transmission page SEND2, and the address of the subpage in the shared memory is ADDR=0, and the length of the subpage LEN_SIZE=PAGESIZE and its subpage number A are placed in the control page. Medium, then execute INPUT-=PAGESIZE, A=(++A)>=TP? 0: A, that is, the data to be copied is equal to the new value after subtracting the size of the subpage. After the page number A is incremented by 1, it is judged whether the maximum number of subpages TP of the transmission page SEND2 is reached. If A reaches TP, the value A is assigned to 0, and then third step;
第五步,将INPUT大小的数据拷贝至传输页面SEND2中,将该子页面在所述共享内存中的地址ADDR=0,该子页面的长度LEN_SIZE=INPUT及其子页面编号A放入控制页面中,然后执行A=(++A)>=TP?0:A,即页面编号A加1后判断是否达到传输页面SEND2的最大子页面数TP,若A达到TP则给A赋值0,然后转第六步;In the fifth step, the data of the INPUT size is copied to the transmission page SEND2, and the address of the subpage in the shared memory is ADDR=0, and the length of the subpage LEN_SIZE=INPUT and its subpage number A are placed in the control page. Medium, then execute A=(++A)>=TP? 0: A, that is, after the page number A is incremented by 1, it is judged whether the maximum number of sub-pages TP of the transmission page SEND2 is reached, and if A reaches TP, A is assigned a value of 0, and then the sixth step is performed;
第六步,执行ALREADY+=此次拷贝至所述共享内存的数据大小,FREE-=此次使用的子页面个数,即主端数据传输装置27已发送的数据大小ALREADY等于加上此次拷
贝至所述共享内存的数据大小后的新值,传输页面SEND2的空闲子页面个数FREE等于减去此次使用的子页面个数后的新值;然后向所述客端设备发送第二数据传输消息,以通知所述客端设备读取此次拷贝至所述共享内存的数据,在获取所述客端设备所返回的第二数据读取消息后,执行FREE=TP,然后转第一步。The sixth step is to execute ALREADY+=the size of the data copied to the shared memory, FREE-=the number of subpages used this time, that is, the data size ALREADY sent by the primary data transmission device 27 is equal to the copy.
The new value after the data size of the shared memory, the number of free subpages of the transmission page SEND2 is equal to the new value after subtracting the number of subpages used this time; then sending the second to the client device Transmitting a message to notify the client device to read the data copied to the shared memory, and after obtaining the second data read message returned by the client device, performing FREE=TP, and then transferring step.
本领域技术人员应能理解上述将第二待传输数据从用户空间分次拷贝至共享内存的方法仅为举例,其他现有的或今后可能出现的将第二待传输数据从用户空间拷贝至共享内存的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。A person skilled in the art should understand that the above method for copying the second data to be transmitted from the user space to the shared memory is only an example, and other existing or future possible copies of the second data to be transmitted are copied from the user space to the shared space. The method of memory, as applicable to the present application, is also intended to be included within the scope of the present application and is hereby incorporated by reference.
具体地,所述主端数据存储单元271包括:用于读取所述客端设备存储在所述共享内存的第一待传输数据的子单元;用于将所读取的第一待传输数据拷贝至用户空间的子单元;用于将所述拷贝至用户空间的第一待传输数据存储至存储介质的子单元。Specifically, the primary data storage unit 271 includes: a subunit for reading the first data to be transmitted stored by the guest device in the shared memory; and the first data to be transmitted to be read Copying to a subunit of the user space; storing the first data to be transmitted copied to the user space to a subunit of the storage medium.
在此,所述主端数据存储单元271将所述客端设备所发送的第一待传输数据从所述共享内存拷贝至用户空间,再从用户空间拷贝至存储介质。所述存储介质指的是非易失性存储介质,例如且不限于硬盘、光盘、U盘、SD卡等。Here, the primary data storage unit 271 copies the first data to be transmitted sent by the client device from the shared memory to the user space, and then copies the data from the user space to the storage medium. The storage medium refers to a non-volatile storage medium such as, but not limited to, a hard disk, an optical disk, a USB flash drive, an SD card, or the like.
具体地,所述用于读取所述客端设备存储在所述共享内存的第一待传输数据的子单元包括:用于根据所述客端设备所发送的第一数据传输消息读取所述客端设备存储在所述共享内存的第一待传输数据的子单元;用于在读取完成后向所述客端设备返回第一数据读取消息的子单元。Specifically, the subunit for reading the first data to be transmitted stored by the client device in the shared memory includes: a first data transmission message reading station according to the client device a subunit of the first data to be transmitted stored in the shared memory by the client device; a subunit for returning the first data read message to the guest device after the reading is completed.
例如,假设第一待传输数据的大小为N,主端数据传输装置27已接收的数据大小为GET,其初始值为0,将所述第一待传输数据从所述共享内存拷贝至主端数据传输装置27的流程如下:For example, if the size of the first data to be transmitted is N, the data size received by the primary data transmission device 27 is GET, and the initial value is 0, and the first data to be transmitted is copied from the shared memory to the primary end. The flow of the data transfer device 27 is as follows:
第一步,判断等式GET==N是否为真,即判断主端数据传输装置27已接收的数据大小GET是否等于第一待传输数据的大小N,若是,则主端设备2已完成对所述第一待传输数据的读取,并向所述客端设备返回第一数据读取消息,若否,则转第二步;In the first step, it is determined whether the equation GET==N is true, that is, whether the data size GET received by the primary data transmission device 27 is equal to the size N of the first data to be transmitted, and if so, the primary device 2 has completed the pair. Reading the first data to be transmitted, and returning a first data read message to the client device, and if not, proceeding to the second step;
第二步,等待所述客端设备所发送的第一数据传输消息,当接收到所述客端设备所发送的第一数据传输消息后,根据控制页面中的关于传输页面RECEIVE2长度LEN_SLICE、传输页面RECEIVE2子页面编号及传输页面RECEIVE2在共享内存中的地址ADDR等信息,依次处理并将传输页面RECEIVE2中的数据拷贝至用户空间,将所述拷贝至用户空间的第一待传输数据存储至存储介质,然后执行GET+=此次从所述共享内存中获取的数据大小,即主端数据传输装置27已接收的数据大小GET等于加上此次从所
述共享内存中获取的数据大小后的新值,向所述客端设备返回第一数据读取消息,然后转第一步。In the second step, waiting for the first data transmission message sent by the client device, after receiving the first data transmission message sent by the client device, according to the length of the transmission page RECEIVE2 in the control page, LEN_SLICE, transmission The page RECEIVE2 subpage number and the information such as the address ADDR of the transmission page RECEIVE2 in the shared memory are sequentially processed and the data in the transmission page RECEIVE2 is copied to the user space, and the first data to be transmitted copied to the user space is stored to the storage. Media, then perform GET+= the size of the data acquired from the shared memory this time, that is, the data size GET that the primary data transmission device 27 has received is equal to the current
The new value after the size of the data acquired in the shared memory returns a first data read message to the client device, and then proceeds to the first step.
本领域技术人员应能理解上述将第一待传输数据从共享内存拷贝至用户空间的方法仅为举例,其他现有的或今后可能出现的将第一待传输数据从共享内存拷贝至用户空间的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。Those skilled in the art should understand that the above method for copying the first data to be transmitted from the shared memory to the user space is only an example, and other existing or future possible copies of the first to-be-transmitted data from the shared memory to the user space may occur. The method is applicable to the present application and is also included in the scope of the present application, and is hereby incorporated by reference.
图6示出根据本申请一个方面的一个优选实施例的一种在虚拟环境下进行数据传输的主端设备2,其中,所述主端设备2包括主端创建装置25’、主端分配装置26’、主端数据传输装置27’和主端通信装置28’。6 shows a master device 2 for performing data transmission in a virtual environment, wherein the master device 2 includes a master device 25', a master device, according to a preferred embodiment of an aspect of the present application. 26', the primary data transmission device 27' and the primary communication device 28'.
在此,所述主端创建装置25’、主端分配装置26’、主端数据传输装置27’与图4中主端创建装置25、主端分配装置26、主端数据传输装置27的内容相同或基本相同,为简明起见,不再赘述。Here, the content of the primary end creating device 25', the primary distributing device 26', the primary data transmitting device 27', and the primary end creating device 25, the primary distributing device 26, and the primary data transmitting device 27 in FIG. The same or basically the same, for the sake of brevity, no longer repeat them.
所述主端通信装置28’在通过所述第二数据传输模块与所述共享内存进行数据传输之前,与所述客端设备进行传输事件通信。具体地,所述主端通信装置包括主端信息发送单元(图中未示出)和主端信息获取单元(图中未示出)中的至少任一项,其中,所述主端信息发送单元向所述客端设备发送关于所述第二待传输数据的第二数据信息,所述主端信息获取单元获取所述客端设备所发送的关于所述第一待传输数据的第一数据信息。The primary communication device 28' performs transmission event communication with the guest device prior to data transmission by the second data transmission module and the shared memory. Specifically, the primary communication device includes at least one of a primary information transmitting unit (not shown) and a primary information acquiring unit (not shown), wherein the primary information is sent. The unit sends the second data information about the second data to be transmitted to the client device, where the master information acquiring unit acquires the first data about the first data to be transmitted sent by the client device. information.
在此,所述第二待传输数据传输到所述客端设备端后,以文件形式存储于存储介质中,第二数据信息包括该文件的存储路径、该文件的名称及该文件的长度。所述第一待传输数据传输到所述主端设备端后,以文件形式存储于存储介质中,第一数据信息包括该文件的存储路径、该文件的名称及该文件的长度。通过所述主端通信装置在数据传输开始之前,与所述客端设备进行传输事件通信,可以避免一些类似于重复传输的低级错误,有效提高数据传输成功率。Here, after the second to-be-transmitted data is transmitted to the client device, it is stored in a storage medium in a file format, and the second data information includes a storage path of the file, a name of the file, and a length of the file. After the first to-be-transmitted data is transmitted to the primary device, the file is stored in a storage medium in a file format, and the first data information includes a storage path of the file, a name of the file, and a length of the file. By the primary communication device performing transmission event communication with the client device before the data transmission starts, some low-level errors similar to repeated transmission can be avoided, and the data transmission success rate is effectively improved.
例如,假设在Xen虚拟化环境中,主端设备2与所述客端设备进行传输事件通信可以是:将传输命令放入xenstore(Xen虚拟环境中的一存储设备,xenstore是基于事件通道完成的)中,该传输命令包括第二数据信息,并通知所述客端设备存在新的命令。所述客端设备从xenstore中获取传输命令,提取第二数据信息,先查看所述第二数据信息中的文件的存储路径是否已经存在,若是,则返回错误,并通知主端设备2相应错误信息,然后结束传输;若否,则根据所述第二数据信息中的文件的存储路径创建文件,
并通知主端设备2已经接受传输命令且处理正常。For example, assume that in the Xen virtualization environment, the primary end device 2 communicates with the guest device for event communication: the transfer command can be placed in a xenstore (a storage device in the Xen virtual environment, and the xenstore is completed based on the event channel). The transmission command includes the second data information and notifies the client device that there is a new command. The client device obtains a transmission command from the xenstore, extracts the second data information, and first checks whether the storage path of the file in the second data information already exists, and if yes, returns an error, and notifies the primary device 2 of the corresponding error. Information, then ending the transmission; if not, creating a file according to the storage path of the file in the second data information,
And notify the master device 2 that the transfer command has been accepted and the processing is normal.
图7示出根据本申请一个方面的一个实施例的一种在虚拟环境下进行数据传输的客端设备1与主端设备2配合的示意图。所述客端设备1包括客端创建装置11”、客端分配装置12”和客端数据传输装置13”,所述主端设备2包括主端创建装置25”、主端分配装置26”和主端数据传输装置27”。客端设备1的客端创建装置11”创建第一数据传输模块;主端设备2的主端创建装置25”创建第二数据传输模块;客端设备1的客端分配装置12”根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备2进行读写操作;主端设备2的主端分配装置26”获取客端设备1所分配的共享内存的访问权限,以使所述共享内存允许主端设备2进行读写操作;客端设备1的客端数据传输装置13”通过所述第一数据传输模块与所述共享内存进行数据传输,所述客端数据传输装置13”包括客端数据存储单元和客端数据获取单元中的至少任一项,其中,所述客端数据存储单元将所述第一待传输数据存储于所述共享内存中,所述客端数据获取单元获取主端设备2存储在所述共享内存的第二待传输数据;主端设备2的主端数据传输装置27”通过所述第二数据传输模块与所述共享内存进行数据传输,所述主端数据传输装置27”包括主端数据存储单元和主端数据获取单元中的至少任一项,其中,所述主端数据存储单元获取客端设备1存储在所述共享内存的第一待传输数据,所述主端数据获取单元将所述第二待传输数据存储于所述共享内存中。在此,客端设备1的客端创建装置11”、客端分配装置12”、客端数据传输装置13”与图1中客端设备1的客端创建装置11、客端分配装置12、客端数据传输装置13的内容相同或基本相同,并且主端设备2的主端创建装置25”、主端分配装置26”、主端数据传输装置27”与图4中主端设备2的主端创建装置25、主端分配装置26、主端数据传输装置27的内容相同或基本相同,为简明起见,故在此不再赘述,并以引用的方式包含于此。FIG. 7 illustrates a schematic diagram of a client device 1 cooperating with a master device 2 for data transmission in a virtual environment, in accordance with an embodiment of an aspect of the present application. The client device 1 includes a client creating device 11", a client device 12" and a client data transmitting device 13", the master device 2 including a master creating device 25", a master distributing device 26" and Primary data transmission device 27". The client creating device 11" of the client device 1 creates a first data transmission module; the master device creating device 25" of the master device 2 creates a second data transmission module; the client device 12" of the client device 1 according to the The first data transmission module allocates a shared memory, and the shared memory allows the primary device 2 to perform read and write operations; the primary distribution device 26" of the primary device 2 acquires access rights of the shared memory allocated by the client device 1, So that the shared memory allows the primary device 2 to perform read and write operations; the client data transmission device 13" of the client device 1 performs data transmission with the shared memory through the first data transmission module, the client data The transmission device 13" includes at least one of a client data storage unit and a client data acquisition unit, wherein the client data storage unit stores the first to-be-transmitted data in the shared memory, The client data acquiring unit acquires the second data to be transmitted stored by the master device 2 in the shared memory; the master data transmitting device 27" of the master device 2 passes the second data transmitting module and the Shared memory for data transmission, the primary data transmission device 27" includes at least one of a primary data storage unit and a primary data acquisition unit, wherein the primary data storage unit acquires the client device 1 stored in The first to-be-transmitted data of the shared memory, the primary-end data acquiring unit stores the second to-be-transmitted data in the shared memory. Here, the client creation device 11", the client distribution device 12", the client data transmission device 13" of the client device 1 and the client creation device 11 of the client device 1 in FIG. 1, the client distribution device 12, The contents of the client data transmission device 13 are the same or substantially the same, and the master terminal creating device 25", the master terminal distributing device 26", the master terminal data transmitting device 27" of the master device 2 and the master of the master device 2 in FIG. The content of the end creating device 25, the primary end distributing device 26, and the primary data transmitting device 27 are the same or substantially the same, and are not described here for brevity and are hereby incorporated by reference.
图8示出根据本申请另一个方面的一个实施例的一种在客端设备端的用于虚拟环境下传输数据的方法流程图。FIG. 8 illustrates a flow chart of a method for transmitting data in a virtual environment on a client device side, according to an embodiment of another aspect of the present application.
该方法包括步骤S81、步骤S82和步骤S83。具体地,在步骤S81中,客端设备1创建第一数据传输模块;在步骤S82中,客端设备1根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作;在步骤S83中,客端设备1通过所述第一数据传输模块与所述共享内存进行数据传输。The method includes step S81, step S82, and step S83. Specifically, in step S81, the client device 1 creates a first data transmission module; in step S82, the client device 1 allocates a shared memory according to the first data transmission module, and the shared memory allows the primary device Performing a read/write operation; in step S83, the client device 1 performs data transmission with the shared memory through the first data transmission module.
在此,所述客端设备1包括一种能够按照事先设定或存储的指令,自动进行数值计
算和信息处理的电子设备,其硬件包括但不限于微处理器、专用集成电路(ASIC)、可编程门阵列(FPGA)、数字处理器(DSP)、嵌入式设备等。所述客端设备1也可以是由一系列按照特定顺序组织的计算机数据和指令的集合。此外,所述客端设备也可以是由一系列按照特定顺序组织的计算机数据和指令的集合与能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备的结合。本领域技术人员应能理解所述客端设备1仅为举例,其他现有的或今后可能出现的客端设备1如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。Here, the client device 1 includes an automatic numerical meter capable of automatically following an instruction set or stored in advance.
Electronic devices for computing and information processing, including but not limited to microprocessors, application specific integrated circuits (ASICs), programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, and the like. The client device 1 can also be a collection of computer data and instructions organized in a series of sequences. In addition, the client device may also be a combination of a collection of computer data and instructions organized in a specific order and electronic devices capable of automatically performing numerical calculations and information processing in accordance with pre-set or stored instructions. A person skilled in the art should understand that the client device 1 is only an example, and other existing or future client devices 1 may be included in the application, and should be included in the scope of the present application. It is included here by reference.
客端设备1的各个步骤之间是持续不断工作的。具体地,在步骤S81中,客端设备1创建第一数据传输模块,所述步骤S81中客端设备1所创建的第一数据传输模块持续供所述步骤S82和所述步骤S83使用,在步骤S82中,客端设备1持续根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作,在步骤S83中,客端设备1持续通过所述第一数据传输模块与所述共享内存进行数据传输,直至所述客端设备1停止工作。The various steps of the client device 1 are continuously working. Specifically, in step S81, the client device 1 creates a first data transmission module, and the first data transmission module created by the client device 1 in the step S81 is continuously used by the step S82 and the step S83. In step S82, the client device 1 continues to allocate a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform read and write operations. In step S83, the client device 1 continues to pass the first A data transmission module performs data transmission with the shared memory until the guest device 1 stops working.
在具体的实施例中,虚拟化环境下,客端设备可以是客户虚拟机(guest),主端设备可以是特权虚拟机(host),通过特权虚拟机可以实现对一个或多个非特权级的客户虚拟机的管理。In a specific embodiment, in a virtualized environment, the guest device may be a guest virtual machine (guest), and the primary device may be a privileged virtual machine (host), and one or more non-privileged levels may be implemented by the privileged virtual machine. Management of customer virtual machines.
在步骤S81中,客端设备1创建第一数据传输模块。In step S81, the client device 1 creates a first data transmission module.
其中,所述第一数据传输模块包括客端虚拟设备和客端驱动。客端设备1创建第一数据传输模块包括:创建客端虚拟设备以及加载所述客端虚拟设备的客端驱动。The first data transmission module includes a guest virtual device and a client driver. The creation of the first data transmission module by the client device 1 includes: creating a guest virtual device and loading a guest driver of the guest virtual device.
进一步的,客端设备1根据host的管理程序(hypervisor)的类型,通过修改相应逻辑增加客端虚拟设备,所述客端虚拟设备用于内核空间与用户空间之间以及guest与host的内核空间之间的通信。具体地,在guest的创建阶段,客端设备1可以直接通过创建的方法增加客端虚拟设备,若guest已存在,则客端设备1可以采用热插拔方法增加客端虚拟设备。Further, the client device 1 adds the client virtual device by modifying the corresponding logic according to the type of the host hypervisor, and the guest virtual device is used between the kernel space and the user space and the kernel space of the guest and the host. Communication between. Specifically, in the creation phase of the guest, the client device 1 can directly add the guest virtual device by using the created method. If the guest already exists, the client device 1 can use the hot plug method to add the guest virtual device.
在此,客端设备的操作系统(例如为Linux操作系统)的虚拟内存划分为内核空间与用户空间,运行在内核空间的核心软件拥有访问硬件设备的所有权限,具有较高的特权级别;运行在用户空间的普通应用程序只能看到允许它们使用的部分系统资源,并且不能使用某些特定的系统功能,也不能直接访问内核空间和硬件设备。Here, the virtual memory of the operating system of the guest device (for example, the Linux operating system) is divided into kernel space and user space, and the core software running in the kernel space has all the rights to access the hardware device, and has a higher privilege level; Ordinary applications in user space can only see some of the system resources that they are allowed to use, and cannot use certain system features or direct access to kernel space and hardware devices.
因此,所创建的第一数据传输模块提供了内核空间与用户空间之间的数据传输通道,有利于后续数据传输的顺利进行。
Therefore, the created first data transmission module provides a data transmission channel between the kernel space and the user space, which facilitates the smooth progress of subsequent data transmission.
在步骤S82中,客端设备1根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作。In step S82, the client device 1 allocates a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform read and write operations.
在具体的实施例中,所述第一数据传输模块中的客端驱动检测到客端虚拟设备时分配一共享内存,所述共享内存位于内核空间,并允许主端设备的第二数据传输模块中的主端驱动访问该共享内存。具体地,所述第一数据传输模块中的客端驱动检测到所述客端虚拟设备时,分配用于数据传输的传输页面,分配用于控制数据传输的控制页面,所述传输页面与所述控制页面均为所述共享内存页面。In a specific embodiment, when the guest driver in the first data transmission module detects the guest virtual device, a shared memory is allocated, the shared memory is located in the kernel space, and the second data transmission module of the primary device is allowed. The master driver in the access accesses the shared memory. Specifically, when the guest driver in the first data transmission module detects the guest virtual device, allocate a transmission page for data transmission, and allocate a control page for controlling data transmission, where the transmission page and the location are The control page is the shared memory page.
在此,通过位于内核空间的共享内存作为中转站传输数据,与现有的串口传输方式相比,大大地提高数据传输速率,与现有的热插拔磁盘的方式相比,操作较为简洁,对系统资源的占用较少。Here, the shared memory located in the kernel space is used as a transfer station to transmit data, which greatly improves the data transfer rate compared with the existing serial port transmission mode, and is simpler in operation than the existing hot-swappable disk. Less use of system resources.
在步骤S83中,客端设备1通过所述第一数据传输模块与所述共享内存进行数据传输。所述步骤S83包括步骤S831(图中未示出)和步骤S832(图中未示出)中的至少任一项,其中,在步骤S831中,客端设备1将第一待传输数据存储于所述共享内存中,在步骤S832中,客端设备1获取所述主端设备存储在所述共享内存的第二待传输数据。In step S83, the client device 1 performs data transmission with the shared memory through the first data transmission module. The step S83 includes at least one of step S831 (not shown) and step S832 (not shown), wherein in step S831, the client device 1 stores the first data to be transmitted in In the shared memory, in step S832, the client device 1 acquires the second data to be transmitted stored by the master device in the shared memory.
在此,步骤S831中客端设备1用于向所述主端设备发送第一待传输数据,步骤S832中客端设备1用于接收所述主端设备所发送的第二待传输数据。所述步骤S83可以仅包括所述步骤S831,即向所述主端设备发送第一待传输数据;所述步骤S83也可以仅包括所述步骤S832,即接收所述主端设备所发送的第二待传输数据;所述步骤S83还可以包括所述步骤S831和所述步骤S832,即向所述主端设备发送第一待传输数据与接收所述主端设备所发送的第二待传输数据同时进行。Here, in step S831, the client device 1 is configured to send the first data to be transmitted to the master device, and the client device 1 is configured to receive the second data to be transmitted sent by the master device in step S832. The step S83 may include only the step S831, that is, sending the first data to be transmitted to the primary device; the step S83 may also include only the step S832, that is, receiving the first message sent by the primary device. The step S83 may further include the step S831 and the step S832, that is, sending the first data to be transmitted to the primary device and receiving the second data to be transmitted sent by the primary device. At the same time.
具体地,在步骤S831中,客端设备1将所述第一待传输数据读取至用户空间,将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存。Specifically, in step S831, the client device 1 reads the first to-be-transmitted data into the user space, and copies the first to-be-transmitted data from the user space to the shared memory located in the kernel space.
在此,客端设备1将所述第一待传输数据从客端设备1的存储介质读取至内存中客端设备端的用户空间,而共享内存位于内存的内核空间,故将所述第一待传输数据从所述用户空间拷贝至所述共享内存。Here, the client device 1 reads the first data to be transmitted from the storage medium of the client device 1 to the user space of the client device in the memory, and the shared memory is located in the kernel space of the memory, so the first device The data to be transmitted is copied from the user space to the shared memory.
具体地,在步骤S831中,客端设备1基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第一待传输数据分次拷贝至位于内核空间的所述共享内存;在每次拷贝后,向所述主端设备发送第一数据传输消息;当获取所述主端设备所返回的第一数据读取消息后,进行下一次拷贝,直至传输完成。Specifically, in step S831, the client device 1 copies the first to-be-transmitted data read to the user space into the shared memory located in the kernel space, based on the related capacity information of the shared memory. After each copy, the first data transmission message is sent to the primary device; after the first data read message returned by the primary device is obtained, the next copy is performed until the transmission is completed.
在此,所述共享内存的相关容量信息可以包括但不限于所述用于数据传输的传输页
面的大小,所述传输页面的大小SIZET=子页面个数TP×子页面大小PAGESIZE。优选地,在将第一待传输数据从用户空间拷贝至所述共享内存时,以所述传输页面为单位分次进行拷贝。Here, the related capacity information of the shared memory may include, but is not limited to, the transmission page for data transmission.
The size of the face, the size of the transfer page SIZET = the number of sub-pages TP × sub-page size PAGESIZE. Preferably, when the first to-be-transmitted data is copied from the user space to the shared memory, the copying is performed in units of the transmission page.
假设第一待传输数据的大小为N,客端设备1已发送的数据大小为ALREADY,其初始值为0,传输页面SEND1的空闲子页面个数为FREE,子页面编号A的初始值为0,将所述第一待传输数据从客端设备1拷贝至所述共享内存的流程如下:Assume that the size of the first data to be transmitted is N, the size of the data transmitted by the client device 1 is ALREADY, the initial value is 0, the number of free subpages of the transmission page SEND1 is FREE, and the initial value of the subpage number A is 0. The process of copying the first to-be-transmitted data from the client device 1 to the shared memory is as follows:
第一步,根据所述第一待传输数据未传输部分的大小LEFT=N–ALREADY,判断LEFT是否为0,若是,则所述第一待传输数据在客端设备端的传输已经结束,若否,则通过后续步骤判断能否将数据拷贝至所述共享内存;The first step is to determine whether the LEFT is 0 according to the size of the first untransmitted portion of the data to be transmitted, LEFT=N−ALREADY, and if yes, the transmission of the first data to be transmitted on the client device end has ended. , determining, by subsequent steps, whether data can be copied to the shared memory;
第二步,判断所述第一待传输数据未传输部分的大小LEFT是否大于等于传输页面SEND1的大小SIZET,若是,则此次待拷贝数据的大小INPUT=SIZET,若否,则此次待拷贝数据的大小INPUT=LEFT,即每次最多拷贝SIZET大小的数据;In the second step, it is determined whether the size LEFT of the untransferred portion of the first to-be-transmitted data is greater than or equal to the size SIZET of the transmission page SEND1, and if so, the size of the data to be copied is INPUT=SIZET, and if not, the copy is to be copied. The size of the data is INPUT=LEFT, that is, the maximum size of SIZET data is copied at a time;
第三步,判断待拷贝数据大小INPUT是否大于等于子页面大小PAGESIZE,若是,则转第四步,若否,则转第五步;The third step is to determine whether the size of the data to be copied INPUT is greater than or equal to the subpage size PAGESIZE, and if so, then go to the fourth step, and if not, go to the fifth step;
第四步,将PAGESIZE大小的数据拷贝至传输页面SEND1中,将该子页面在所述共享内存中的地址ADDR=0,该子页面的长度LEN_SIZE=PAGESIZE及其子页面编号A放入控制页面中,然后执行INPUT-=PAGESIZE,A=(++A)>=TP?0:A,即待拷贝数据等于减去子页面大小后的新值,页面编号A加1后判断是否达到传输页面SEND1的最大子页面数TP,若A达到TP则给A赋值0,然后转第三步;In the fourth step, the data of the PAGESIZE size is copied to the transmission page SEND1, and the address of the subpage in the shared memory is ADDR=0, and the length of the subpage LEN_SIZE=PAGESIZE and its subpage number A are placed in the control page. Medium, then execute INPUT-=PAGESIZE, A=(++A)>=TP? 0: A, that is, the data to be copied is equal to the new value after subtracting the size of the sub-page. After the page number A is incremented by 1, it is judged whether the maximum number of sub-pages TP of the transmission page SEND1 is reached. If A reaches TP, the value A is assigned to 0, and then third step;
第五步,将INPUT大小的数据拷贝至传输页面SEND1中,将该子页面在所述共享内存中的地址ADDR=0,该子页面的长度LEN_SIZE=INPUT及其子页面编号A放入控制页面中,然后执行A=(++A)>=TP?0:A,即页面编号A加1后判断是否达到传输页面SEND1的最大子页面数TP,若A达到TP则给A赋值0,然后转第六步;In the fifth step, the data of the INPUT size is copied to the transmission page SEND1, and the address of the subpage in the shared memory is ADDR=0, and the length of the subpage LEN_SIZE=INPUT and its subpage number A are placed in the control page. Medium, then execute A=(++A)>=TP? 0: A, that is, after the page number A is incremented by 1, it is judged whether the maximum number of sub-pages TP of the transmission page SEND1 is reached, and if A reaches TP, A is assigned a value of 0, and then the sixth step is performed;
第六步,执行ALREADY+=此次拷贝至所述共享内存的数据大小,FREE-=此次使用的子页面个数,即客端设备1已发送的数据大小ALREADY等于加上此次拷贝至所述共享内存的数据大小后的新值,传输页面SEND1的空闲子页面个数FREE等于减去此次使用的子页面个数后的新值;然后客端设备1向所述主端设备发送第一数据传输消息,以通知所述主端设备读取此次拷贝至所述共享内存的数据,客端设备1获取所述主端设备所返回的第一数据读取消息后,执行FREE=TP,然后转第一步。The sixth step is to execute ALREADY+=the size of the data copied to the shared memory, FREE-=the number of subpages used this time, that is, the data size ALREADY sent by the client device 1 is equal to the copy to the location. The new value after the data size of the shared memory, the number of free subpages of the transmission page SEND1 is equal to the new value after subtracting the number of subpages used this time; then the client device 1 sends the number to the primary device a data transmission message, to notify the primary device to read the data copied to the shared memory, and the client device 1 obtains the first data read message returned by the primary device, and then executes FREE=TP. Then turn to the first step.
本领域技术人员应能理解上述将第一待传输数据从用户空间分次拷贝至共享内存
的方法仅为举例,其他现有的或今后可能出现的将第一待传输数据从用户空间拷贝至共享内存的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。Those skilled in the art should understand that the above-mentioned first to-be-transmitted data is copied from the user space to the shared memory.
The method is only an example, and other existing or future possible methods for copying the first data to be transmitted from the user space to the shared memory, as applicable to the present application, are also included in the scope of protection of the present application. It is included here by reference.
具体地,在步骤S832中,客端设备1读取所述主端设备存储在所述共享内存的第二待传输数据,将所读取的第二待传输数据拷贝至用户空间,将所述拷贝至用户空间的第二待传输数据存储至存储介质。Specifically, in step S832, the client device 1 reads the second data to be transmitted stored by the master device in the shared memory, and copies the read second data to be transmitted to the user space, The second to-be-transmitted data copied to the user space is stored to the storage medium.
在此,客端设备1将所述主端设备所发送的第二待传输数据从所述共享内存拷贝至用户空间,再从用户空间拷贝至存储介质。所述存储介质指的是非易失性存储介质,例如且不限于硬盘、光盘、U盘、SD卡等。Here, the client device 1 copies the second data to be transmitted sent by the master device from the shared memory to the user space, and then copies the space from the user space to the storage medium. The storage medium refers to a non-volatile storage medium such as, but not limited to, a hard disk, an optical disk, a USB flash drive, an SD card, or the like.
具体地,在步骤S832中,客端设备1根据所述主端设备所发送的第二数据传输消息读取所述主端设备存储在所述共享内存的第二待传输数据,在读取完成后,向所述主端设备返回第二数据读取消息。Specifically, in step S832, the client device 1 reads the second data to be transmitted stored by the master device in the shared memory according to the second data transmission message sent by the master device, and the reading is completed. Thereafter, a second data read message is returned to the primary device.
例如,假设第二待传输数据的大小为N,客端设备1已接收的数据大小为GET,其初始值为0,将所述第二待传输数据从所述共享内存拷贝至客端设备1的流程如下:For example, if the size of the second data to be transmitted is N, the data size received by the client device 1 is GET, and the initial value is 0, and the second data to be transmitted is copied from the shared memory to the client device 1 The process is as follows:
第一步,判断等式GET==N是否为真,即判断客端设备1已接收的数据大小GET是否等于第二待传输数据的大小N,若是,则客端设备1已完成对所述第二待传输数据的读取,并向所述主端设备返回第二数据读取消息,若否,则转第二步;The first step is to determine whether the equality GET==N is true, that is, whether the data size GET received by the client device 1 is equal to the size N of the second data to be transmitted, and if so, the client device 1 has completed the Reading the second data to be transmitted, and returning a second data read message to the primary device; if not, proceeding to the second step;
第二步,等待所述主端设备所发送的第二数据传输消息,当接收到所述主端设备所发送的第二数据传输消息后,根据控制页面中的关于传输页面RECEIVE1长度LEN_SLICE、传输页面RECEIVE1子页面编号及传输页面RECEIVE1在共享内存中的地址ADDR等信息,依次处理并将传输页面RECEIVE1中的数据拷贝至用户空间,客端设备1将所述拷贝至用户空间的第二待传输数据存储至存储介质,然后执行GET+=此次从所述共享内存中获取的数据大小,即客端设备1已接收的数据大小GET等于加上此次从所述共享内存中获取的数据大小后的新值,客端设备1向所述主端设备返回第二数据读取消息,然后转第一步。In the second step, waiting for the second data transmission message sent by the primary device, after receiving the second data transmission message sent by the primary device, according to the length LEN_SLICE of the transmission page RECEIVE1 in the control page, and transmitting The page RECEIVE1 subpage number and the information such as the address ADDR of the transmission page RECEIVE1 in the shared memory are sequentially processed and the data in the transmission page RECEIVE1 is copied to the user space, and the client device 1 copies the copy to the second to be transmitted in the user space. The data is stored to the storage medium, and then GET+=the size of the data acquired from the shared memory, that is, the data size GET received by the client device 1 is equal to the size of the data acquired from the shared memory. The new value, the client device 1 returns a second data read message to the master device, and then proceeds to the first step.
本领域技术人员应能理解上述将第二待传输数据从共享内存拷贝至用户空间的方法仅为举例,其他现有的或今后可能出现的将第二待传输数据从共享内存拷贝至用户空间的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。Those skilled in the art should understand that the above method for copying the second data to be transmitted from the shared memory to the user space is only an example, and other existing or future possible copies of the second data to be transmitted are copied from the shared memory to the user space. The method is applicable to the present application and is also included in the scope of the present application, and is hereby incorporated by reference.
根据本申请的一个优选实施例,所述方法还可以包括:客端设备1在通过所述第一
数据传输模块与所述共享内存进行数据传输之前,与所述主端设备进行传输事件通信,其中,所述进行传输事件通信包括至少以下任一项:According to a preferred embodiment of the present application, the method may further include: the client device 1 is passing the first
Before the data transmission module performs data transmission with the shared memory, performing transmission event communication with the primary end device, wherein the performing transmission event communication includes at least one of the following:
客端设备1向所述主端设备发送关于所述第一待传输数据的第一数据信息;The client device 1 sends first data information about the first data to be transmitted to the primary device;
客端设备1获取所述主端设备所发送的关于所述第二待传输数据的第二数据信息。The client device 1 acquires second data information about the second to-be-transmitted data sent by the primary device.
在此,所述第一待传输数据传输到所述主端设备端后,以文件形式存储于存储介质中,第一数据信息包括该文件的存储路径、该文件的名称及该文件的长度。所述第二待传输数据传输到所述客端设备端后,以文件形式存储于存储介质中,第二数据信息包括该文件的存储路径、该文件的名称及该文件的长度。通过客端设备1在数据传输开始之前,与所述主端设备进行传输事件通信,可以避免一些类似于重复传输的低级错误,有效提高数据传输成功率。Here, the first to-be-transmitted data is transmitted to the storage device in the form of a file, and the first data information includes a storage path of the file, a name of the file, and a length of the file. After the second to-be-transmitted data is transmitted to the client device, it is stored in a storage medium in a file format, and the second data information includes a storage path of the file, a name of the file, and a length of the file. By the client device 1 performing transmission event communication with the master device before the data transmission starts, some low-level errors similar to repeated transmission can be avoided, and the data transmission success rate is effectively improved.
例如,假设在Xen虚拟化环境中,客端设备1与所述主端设备进行传输事件通信可以是:将传输命令放入xenstore(Xen虚拟环境中的一存储设备,xenstore是基于事件通道完成的)中,该传输命令包括第一数据信息,并通知所述主端设备存在新的命令。所述主端设备从xenstore中获取传输命令,提取第一数据信息,先查看所述第一数据信息中的文件的存储路径是否已经存在,若是,则返回错误,并通知客端设备1相应错误信息,然后结束传输;若否,则根据所述第一数据信息中的文件的存储路径创建文件,并通知客端设备1已经接受传输命令且处理正常。For example, assume that in the Xen virtualization environment, the client device 1 communicates with the host device for event communication: the transfer command can be placed in a xenstore (a storage device in the Xen virtual environment, and the xenstore is completed based on the event channel). The transfer command includes the first data information and notifies the host device that a new command exists. The master device obtains a transmission command from the xenstore, extracts the first data information, and first checks whether the storage path of the file in the first data information already exists, and if yes, returns an error, and notifies the client device 1 of the corresponding error. The information then ends the transmission; if not, the file is created according to the storage path of the file in the first data information, and the client device 1 is notified that the transmission command has been accepted and the processing is normal.
图9示出根据本申请另一个方面的一个实施例的一种在主端设备端的用于虚拟环境下传输数据的方法流程图。FIG. 9 illustrates a flow chart of a method for transmitting data in a virtual environment on a primary end device side, in accordance with an embodiment of another aspect of the present application.
该方法包括步骤S95、步骤S96和步骤S97。具体地,在步骤S95中,主端设备2创建第二数据传输模块;在步骤S96中,主端设备2获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作;在步骤S97中,主端设备2通过所述第二数据传输模块与所述共享内存进行数据传输。The method includes step S95, step S96, and step S97. Specifically, in step S95, the primary device 2 creates a second data transmission module; in step S96, the primary device 2 acquires access rights of the shared memory allocated by the client device, so that the shared memory allows the primary terminal. The device performs a read/write operation; in step S97, the primary device 2 performs data transmission with the shared memory through the second data transmission module.
在此,所述主端设备2包括一种能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备,其硬件包括但不限于微处理器、专用集成电路(ASIC)、可编程门阵列(FPGA)、数字处理器(DSP)、嵌入式设备等。所述主端设备2也可以是由一系列按照特定顺序组织的计算机数据和指令的集合。此外,所述主端设备2也可以是由一系列按照特定顺序组织的计算机数据和指令的集合与能够按照事先设定或存储的指令,自动进行数值计算和信息处理的电子设备的结合。本领域技术人员应能理解所述主端设备2仅为举例,其他现有的或今后可能出现的主端设备2如可适用于本申请,也
应包含在本申请保护范围以内,并在此以引用方式包含于此。Here, the master device 2 includes an electronic device capable of automatically performing numerical calculation and information processing according to an instruction set or stored in advance, and the hardware thereof includes but is not limited to a microprocessor, an application specific integrated circuit (ASIC), Programmable gate array (FPGA), digital processor (DSP), embedded devices, etc. The primary device 2 can also be a collection of computer data and instructions organized in a sequence of specific sequences. Furthermore, the master device 2 may also be a combination of a collection of computer data and instructions organized in a specific sequence and electronic devices capable of automatically performing numerical calculations and information processing in accordance with pre-set or stored instructions. Those skilled in the art should understand that the primary device 2 is merely an example, and other existing or future possible primary devices 2 may be applied to the present application as well.
It is intended to be included within the scope of this application and is hereby incorporated by reference.
主端设备2的各个步骤之间是持续不断工作的。具体地,在步骤S95中,主端设备2创建第二数据传输模块,所述步骤S95中主端设备2所创建的第二数据传输模块持续供所述步骤S96和所述步骤S97使用,在步骤S96中,主端设备2持续获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作,在步骤S97中,主端设备2持续通过所述第二数据传输模块与所述共享内存进行数据传输,直至所述主端设备2停止工作。The various steps of the master device 2 are continuously working. Specifically, in step S95, the primary device 2 creates a second data transmission module, and the second data transmission module created by the primary device 2 in the step S95 continues to be used in the step S96 and the step S97. In step S96, the master device 2 continuously obtains the access rights of the shared memory allocated by the client device, so that the shared memory allows the master device to perform read and write operations. In step S97, the master device 2 continues to pass the The second data transmission module performs data transmission with the shared memory until the primary device 2 stops working.
在具体的实施例中,虚拟化环境下,客端设备可以是客户虚拟机(guest),主端设备可以是特权虚拟机(host),通过特权虚拟机可以实现对一个或多个非特权级的客户虚拟机的管理。In a specific embodiment, in a virtualized environment, the guest device may be a guest virtual machine (guest), and the primary device may be a privileged virtual machine (host), and one or more non-privileged levels may be implemented by the privileged virtual machine. Management of customer virtual machines.
在步骤S95中,主端设备2创建第二数据传输模块。In step S95, the primary device 2 creates a second data transmission module.
其中,所述第二数据传输模块包括主端虚拟设备和主端驱动。主端设备2创建第二数据传输模块包括:创建主端虚拟设备以及加载所述主端虚拟设备的主端驱动。The second data transmission module includes a primary virtual device and a primary drive. The creation of the second data transmission module by the primary device 2 includes: creating a primary virtual device and loading a primary driver of the primary virtual device.
进一步的,主端设备2根据host的管理程序(hypervisor)的类型,通过修改相应逻辑增加主端虚拟设备,所述主端虚拟设备用于内核空间与用户空间之间以及host与guest的内核空间之间的通信。Further, the master device 2 increases the master virtual device by modifying the corresponding logic according to the type of the host hypervisor, and the master virtual device is used for the kernel space between the kernel space and the user space and between the host and the guest. Communication between.
在此,主端设备的操作系统(例如为Linux操作系统)的虚拟内存划分为内核空间与用户空间,运行在内核空间的核心软件拥有访问硬件设备的所有权限,具有较高的特权级别;运行在用户空间的普通应用程序只能看到允许它们使用的部分系统资源,并且不能使用某些特定的系统功能,也不能直接访问内核空间和硬件设备。Here, the virtual memory of the operating system of the primary device (for example, the Linux operating system) is divided into kernel space and user space, and the core software running in the kernel space has all the rights to access the hardware device, and has a higher privilege level; Ordinary applications in user space can only see some of the system resources that they are allowed to use, and cannot use certain system features or direct access to kernel space and hardware devices.
因此,所创建的第二数据传输模块提供了内核空间与用户空间之间的数据传输通道,有利于后续数据传输的顺利进行。Therefore, the created second data transmission module provides a data transmission channel between the kernel space and the user space, which facilitates the smooth progress of subsequent data transmission.
在步骤S96中,主端设备2获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作。In step S96, the master device 2 acquires the access rights of the shared memory allocated by the client device, so that the shared memory allows the master device to perform read and write operations.
在具体的实施例中,客端设备的第一数据传输模块中的客端驱动检测到客端虚拟设备时分配一共享内存,所述共享内存位于内核空间,并允许所述第二数据传输模块中的主端驱动访问该共享内存。具体地,所述第一数据传输模块中的客端驱动检测到所述第一数据传输模块中的客端虚拟设备时,分配用于数据传输的传输页面,分配用于控制数据传输的控制页面,所述传输页面与所述控制页面均为所述共享内存页面。In a specific embodiment, the guest driver in the first data transmission module of the client device allocates a shared memory when detecting the guest virtual device, the shared memory is located in the kernel space, and allows the second data transmission module The master driver in the access accesses the shared memory. Specifically, when the guest driver in the first data transmission module detects the guest virtual device in the first data transmission module, allocate a transmission page for data transmission, and allocate a control page for controlling data transmission. The transfer page and the control page are both the shared memory page.
在此,通过位于内核空间的共享内存作为中转站传输数据,与现有的串口传输方式
相比,大大地提高数据传输速率,与现有的热插拔磁盘的方式相比,操作较为简洁,对系统资源的占用较少。Here, the shared memory located in the kernel space is used as a transfer station to transmit data, and the existing serial port transmission method
In comparison, the data transmission rate is greatly improved, and the operation is simpler and less occupied by system resources than the existing hot-swappable disk.
在步骤S97中,主端设备2通过所述第二数据传输模块与所述共享内存进行数据传输。所述步骤S97包括步骤S975(图中未示出)和步骤S976(图中未示出)中的至少任一项,其中,在步骤S975中,主端设备2获取所述客端设备存储在所述共享内存的第一待传输数据,在步骤S976中,主端设备2将所述第二待传输数据存储于所述共享内存中。In step S97, the primary device 2 performs data transmission with the shared memory through the second data transmission module. The step S97 includes at least one of step S975 (not shown) and step S976 (not shown), wherein in step S975, the master device 2 acquires that the client device is stored in The first to-be-transmitted data of the shared memory, in step S976, the primary-end device 2 stores the second to-be-transmitted data in the shared memory.
在此,步骤S975中主端设备2用于接收所述客端设备所发送的第一待传输数据,步骤S976中主端设备2用于向所述客端设备发送第二待传输数据。所述步骤S97可以仅包括所述步骤S975,即接收所述客端设备所发送的第一待传输数;所述步骤S97也可以仅包括所述步骤S976,即向所述客端设备发送第二待传输数据;所述步骤S97还可以包括所述步骤S975和所述步骤S976,即接收所述客端设备所发送的第一待传输数据与向所述客端设备发送第二待传输数据同时进行。Here, in step S975, the primary device 2 is configured to receive the first data to be transmitted sent by the client device, and the primary device 2 is configured to send the second data to be transmitted to the client device in step S976. The step S97 may include only the step S975, that is, receiving the first to-be-transmitted number sent by the client device; the step S97 may also include only the step S976, that is, sending the first to the client device. The step S97 may further include the step S975 and the step S976, that is, receiving the first data to be transmitted sent by the client device and sending the second data to be transmitted to the client device. At the same time.
具体地,在步骤S976中,主端设备2将所述第二待传输数据读取至用户空间,将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存。Specifically, in step S976, the primary device 2 reads the second to-be-transmitted data into the user space, and copies the second to-be-transmitted data from the user space to the shared memory located in the kernel space.
在此,主端设备2将所述第二待传输数据从主端设备2的存储介质读取至内存中主端设备端的用户空间,而共享内存位于内存的内核空间,故将所述第二待传输数据从所述用户空间拷贝至所述共享内存。Here, the master device 2 reads the second data to be transmitted from the storage medium of the master device 2 to the user space of the master device in the memory, and the shared memory is located in the kernel space of the memory, so the second device The data to be transmitted is copied from the user space to the shared memory.
具体地,在步骤S976中,主端设备2基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第二待传输数据分次拷贝至位于内核空间的所述共享内存;在每次拷贝后,向所述客端设备发送第二数据传输消息;当获取所述客端设备所返回的第二数据读取消息后,进行下一次拷贝,直至传输完成。Specifically, in step S976, the master device 2 copies the second to-be-transmitted data read to the user space into the shared memory located in the kernel space, based on the related capacity information of the shared memory. After each copy, the second data transmission message is sent to the client device; after the second data read message returned by the client device is obtained, the next copy is performed until the transmission is completed.
在此,所述共享内存的相关容量信息可以包括但不限于所述用于数据传输的传输页面的大小,所述传输页面的大小SIZET=子页面个数TP×子页面大小PAGESIZE。优选地,在将第二待传输数据从用户空间拷贝至所述共享内存时,以所述传输页面为单位分次进行拷贝。Here, the related capacity information of the shared memory may include, but is not limited to, the size of the transmission page for data transmission, and the size of the transmission page SIZET=the number of sub-pages TP×sub-page size PAGESIZE. Preferably, when the second to-be-transmitted data is copied from the user space to the shared memory, the copying is performed in units of the transmission page.
假设第二待传输数据的大小为N,主端设备2已发送的数据大小为ALREADY,其初始值为0,传输页面SEND2的空闲子页面个数为FREE,子页面编号A的初始值为0,将所述第二待传输数据从主端设备2拷贝至所述共享内存的流程如下:Assuming that the size of the second data to be transmitted is N, the size of the data transmitted by the master device 2 is ALREADY, the initial value is 0, the number of free subpages of the transmission page SEND2 is FREE, and the initial value of the subpage number A is 0. The process of copying the second to-be-transmitted data from the primary device 2 to the shared memory is as follows:
第一步,根据所述第二待传输数据未传输部分的大小LEFT=N–ALREADY,判
断LEFT是否为0,若是,则所述第二待传输数据在主端设备端的传输已经结束,若否,则通过后续步骤判断能否将数据拷贝至所述共享内存;In the first step, according to the size of the untransmitted portion of the second data to be transmitted, LEFT=N–ALREADY,
Whether the LEFT is 0 or not, if yes, the transmission of the second data to be transmitted on the primary device end has ended; if not, determining whether data can be copied to the shared memory through subsequent steps;
第二步,判断所述第二待传输数据未传输部分的大小LEFT是否大于等于传输页面SEND2的大小SIZET,若是,则此次待拷贝数据的大小INPUT=SIZET,若否,则此次待拷贝数据的大小INPUT=LEFT,即每次最多拷贝SIZET大小的数据;In the second step, it is determined whether the size LEFT of the untransferred portion of the second to-be-transmitted data is greater than or equal to the size SIZET of the transmission page SEND2, and if so, the size of the data to be copied is INPUT=SIZET, and if not, the copy is to be copied. The size of the data is INPUT=LEFT, that is, the maximum size of SIZET data is copied at a time;
第三步,判断待拷贝数据大小INPUT是否大于等于子页面大小PAGESIZE,若是,则转第四步,若否,则转第五步;The third step is to determine whether the size of the data to be copied INPUT is greater than or equal to the subpage size PAGESIZE, and if so, then go to the fourth step, and if not, go to the fifth step;
第四步,将PAGESIZE大小的数据拷贝至传输页面SEND2中,将该子页面在所述共享内存中的地址ADDR=0,该子页面的长度LEN_SIZE=PAGESIZE及其子页面编号A放入控制页面中,然后执行INPUT-=PAGESIZE,A=(++A)>=TP?0:A,即待拷贝数据等于减去子页面大小后的新值,页面编号A加1后判断是否达到传输页面SEND2的最大子页面数TP,若A达到TP则给A赋值0,然后转第三步;In the fourth step, the data of the PAGESIZE size is copied to the transmission page SEND2, and the address of the subpage in the shared memory is ADDR=0, and the length of the subpage LEN_SIZE=PAGESIZE and its subpage number A are placed in the control page. Medium, then execute INPUT-=PAGESIZE, A=(++A)>=TP? 0: A, that is, the data to be copied is equal to the new value after subtracting the size of the subpage. After the page number A is incremented by 1, it is judged whether the maximum number of subpages TP of the transmission page SEND2 is reached. If A reaches TP, the value A is assigned to 0, and then third step;
第五步,将INPUT大小的数据拷贝至传输页面SEND2中,将该子页面在所述共享内存中的地址ADDR=0,该子页面的长度LEN_SIZE=INPUT及其子页面编号A放入控制页面中,然后执行A=(++A)>=TP?0:A,即页面编号A加1后判断是否达到传输页面SEND2的最大子页面数TP,若A达到TP则给A赋值0,然后转第六步;In the fifth step, the data of the INPUT size is copied to the transmission page SEND2, and the address of the subpage in the shared memory is ADDR=0, and the length of the subpage LEN_SIZE=INPUT and its subpage number A are placed in the control page. Medium, then execute A=(++A)>=TP? 0: A, that is, after the page number A is incremented by 1, it is judged whether the maximum number of sub-pages TP of the transmission page SEND2 is reached, and if A reaches TP, A is assigned a value of 0, and then the sixth step is performed;
第六步,执行ALREADY+=此次拷贝至所述共享内存的数据大小,FREE-=此次使用的子页面个数,即主端设备2已发送的数据大小ALREADY等于加上此次拷贝至所述共享内存的数据大小后的新值,传输页面SEND2的空闲子页面个数FREE等于减去此次使用的子页面个数后的新值;然后主端设备2向所述客端设备发送第二数据传输消息,以通知所述客端设备读取此次拷贝至所述共享内存的数据,主端设备2获取所述客端设备所返回的第二数据读取消息后,执行FREE=TP,然后转第一步。The sixth step is to execute ALREADY+=the size of the data copied to the shared memory, FREE-=the number of subpages used this time, that is, the data size ALREADY sent by the master device 2 is equal to the copy to the location. The new value after the data size of the shared memory, the number of free subpages of the transmission page SEND2 is equal to the new value after subtracting the number of subpages used this time; then the master device 2 sends the number to the client device a data transmission message, to notify the client device to read the data copied to the shared memory, and the master device 2 obtains the second data read message returned by the client device, and then executes FREE=TP. Then turn to the first step.
本领域技术人员应能理解上述将第二待传输数据从用户空间分次拷贝至共享内存的方法仅为举例,其他现有的或今后可能出现的将第二待传输数据从用户空间拷贝至共享内存的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。A person skilled in the art should understand that the above method for copying the second data to be transmitted from the user space to the shared memory is only an example, and other existing or future possible copies of the second data to be transmitted are copied from the user space to the shared space. The method of memory, as applicable to the present application, is also intended to be included within the scope of the present application and is hereby incorporated by reference.
具体地,在步骤S975中,主端设备2读取所述客端设备存储在所述共享内存的第一待传输数据,将所读取的第一待传输数据拷贝至用户空间,将所述拷贝至用户空间的第一待传输数据存储至存储介质。Specifically, in step S975, the master device 2 reads the first data to be transmitted stored in the shared memory by the client device, and copies the read first data to be transmitted to the user space, and the The first to-be-transmitted data copied to the user space is stored to the storage medium.
在此,主端设备2将所述客端设备所发送的第一待传输数据从所述共享内存拷贝至
用户空间,再从用户空间拷贝至存储介质。所述存储介质指的是非易失性存储介质,例如且不限于硬盘、光盘、U盘、SD卡等。Here, the master device 2 copies the first to-be-transmitted data sent by the client device from the shared memory to
User space, then copy from user space to storage media. The storage medium refers to a non-volatile storage medium such as, but not limited to, a hard disk, an optical disk, a USB flash drive, an SD card, or the like.
具体地,在步骤S975中,主端设备2根据所述客端设备所发送的第一数据传输消息读取所述客端设备存储在所述共享内存的第一待传输数据,在读取完成后,向所述客端设备返回第一数据读取消息。Specifically, in step S975, the primary device 2 reads the first data to be transmitted stored in the shared memory by the client device according to the first data transmission message sent by the client device, and the reading is completed. Thereafter, the first data read message is returned to the guest device.
例如,假设第一待传输数据的大小为N,主端设备2已接收的数据大小为GET,其初始值为0,将所述第一待传输数据从所述共享内存拷贝至主端设备2的流程如下:For example, if the size of the first data to be transmitted is N, the size of the data that the primary device 2 has received is GET, and the initial value is 0, and the first data to be transmitted is copied from the shared memory to the primary device 2 The process is as follows:
第一步,判断等式GET==N是否为真,即判断主端设备2已接收的数据大小GET是否等于第一待传输数据的大小N,若是,则主端设备2已完成对所述第一待传输数据的读取,并向所述客端设备返回第一数据读取消息,若否,则转第二步;The first step is to determine whether the equality GET==N is true, that is, whether the data size GET received by the primary device 2 is equal to the size N of the first data to be transmitted, and if so, the primary device 2 has completed the Reading the first data to be transmitted, and returning the first data read message to the client device, and if not, proceeding to the second step;
第二步,等待所述客端设备所发送的第一数据传输消息,当接收到所述客端设备所发送的第一数据传输消息后,根据控制页面中的关于传输页面RECEIVE2长度LEN_SLICE、传输页面RECEIVE2子页面编号及传输页面RECEIVE2在共享内存中的地址ADDR等信息,依次处理并将传输页面RECEIVE2中的数据拷贝至用户空间,主端设备2将所述拷贝至用户空间的第一待传输数据存储至存储介质,然后执行GET+=此次从所述共享内存中获取的数据大小,即主端设备2已接收的数据大小GET等于加上此次从所述共享内存中获取的数据大小后的新值,主端设备2向所述客端设备返回第一数据读取消息,然后转第一步。In the second step, waiting for the first data transmission message sent by the client device, after receiving the first data transmission message sent by the client device, according to the length of the transmission page RECEIVE2 in the control page, LEN_SLICE, transmission The page RECEIVE2 subpage number and the information such as the address ADDR of the transmission page RECEIVE2 in the shared memory are sequentially processed and the data in the transmission page RECEIVE2 is copied to the user space, and the primary device 2 copies the first to be transmitted to the user space. The data is stored to the storage medium, and then GET+=the size of the data acquired from the shared memory, that is, the data size GET received by the primary device 2 is equal to the size of the data acquired from the shared memory. The new value, the master device 2 returns a first data read message to the client device, and then proceeds to the first step.
本领域技术人员应能理解上述将第一待传输数据从共享内存拷贝至用户空间的方法仅为举例,其他现有的或今后可能出现的将第一待传输数据从共享内存拷贝至用户空间的方法如可适用于本申请,也应包含在本申请保护范围以内,并在此以引用方式包含于此。Those skilled in the art should understand that the above method for copying the first data to be transmitted from the shared memory to the user space is only an example, and other existing or future possible copies of the first to-be-transmitted data from the shared memory to the user space may occur. The method is applicable to the present application and is also included in the scope of the present application, and is hereby incorporated by reference.
根据本申请的一个优选实施例,所述方法还可以包括:主端设备2在通过所述第二数据传输模块与所述共享内存进行数据传输之前,与所述客端设备进行传输事件通信,其中,所述进行传输事件通信包括至少以下任一项:According to a preferred embodiment of the present application, the method may further include: the primary device 2 performs transmission event communication with the client device before performing data transmission with the shared memory by the second data transmission module, The transmitting event communication includes at least one of the following:
主端设备2向所述客端设备发送关于所述第二待传输数据的第二数据信息;The primary device 2 sends second data information about the second data to be transmitted to the client device;
主端设备2获取所述客端设备所发送的关于所述第一待传输数据的第一数据信息。The master device 2 acquires first data information about the first to-be-transmitted data sent by the client device.
在此,所述第二待传输数据传输到所述客端设备端后,以文件形式存储于存储介质中,第二数据信息包括该文件的存储路径、该文件的名称及该文件的长度。所述第一待传输数据传输到所述主端设备端后,以文件形式存储于存储介质中,第一数据信息包括
该文件的存储路径、该文件的名称及该文件的长度。通过所述主端通信装置在数据传输开始之前,与所述客端设备进行传输事件通信,可以避免一些类似于重复传输的低级错误,有效提高数据传输成功率。Here, after the second to-be-transmitted data is transmitted to the client device, it is stored in a storage medium in a file format, and the second data information includes a storage path of the file, a name of the file, and a length of the file. After the first to-be-transmitted data is transmitted to the primary device end, the data is stored in a storage medium, and the first data information includes
The storage path of the file, the name of the file, and the length of the file. By the primary communication device performing transmission event communication with the client device before the data transmission starts, some low-level errors similar to repeated transmission can be avoided, and the data transmission success rate is effectively improved.
例如,假设在Xen虚拟化环境中,主端设备2与所述客端设备进行传输事件通信可以是:将传输命令放入xenstore(Xen虚拟环境中的一存储设备,xenstore是基于事件通道完成的)中,该传输命令包括第二数据信息,并通知所述客端设备存在新的命令。所述客端设备从xenstore中获取传输命令,提取第二数据信息,先查看所述第二数据信息中的文件的存储路径是否已经存在,若是,则返回错误,并通知主端设备2相应错误信息,然后结束传输;若否,则根据所述第二数据信息中的文件的存储路径创建文件,并通知主端设备2已经接受传输命令且处理正常。For example, assume that in the Xen virtualization environment, the primary end device 2 communicates with the guest device for event communication: the transfer command can be placed in a xenstore (a storage device in the Xen virtual environment, and the xenstore is completed based on the event channel). The transmission command includes the second data information and notifies the client device that there is a new command. The client device obtains a transmission command from the xenstore, extracts the second data information, and first checks whether the storage path of the file in the second data information already exists, and if yes, returns an error, and notifies the primary device 2 of the corresponding error. The information then ends the transmission; if not, the file is created according to the storage path of the file in the second data information, and the host device 2 is notified that the transmission command has been accepted and the processing is normal.
图10示出根据本申请另一个方面的一个实施例的一种用于虚拟环境下传输数据的方法流程图。所述方法包括步骤S81’~S83’和步骤S95’~S97’。具体地,在步骤S81’中,客端设备1创建第一数据传输模块;在步骤S95’中,主端设备2创建第二数据传输模块;在步骤S82’中,客端设备1根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备2进行读写操作;在步骤S96’中,主端设备2获取客端设备1所分配的共享内存的访问权限,以使所述共享内存允许主端设备2进行读写操作;在步骤S83’中,客端设备1通过所述第一数据传输模块与所述共享内存进行数据传输,所述步骤S83’包括以下至少任一项:将所述第一待传输数据存储于所述共享内存中,获取主端设备2存储在所述共享内存的第二待传输数据;在步骤S97’中,主端设备2通过所述第二数据传输模块与所述共享内存进行数据传输,所述步骤S97’包括以下至少任一项:获取客端设备1存储在所述共享内存的第一待传输数据,将所述第二待传输数据存储于所述共享内存中。在此,步骤S81’~S83’与图8中步骤S81~S83的内容相同或基本相同,并且步骤S95’~S97’与图9中步骤S95~S97的内容相同或基本相同,为简明起见,故在此不再赘述,并以引用的方式包含于此。FIG. 10 illustrates a flow chart of a method for transmitting data in a virtual environment, in accordance with an embodiment of another aspect of the present application. The method includes steps S81' to S83' and steps S95' to S97'. Specifically, in step S81', the client device 1 creates a first data transmission module; in step S95', the master device 2 creates a second data transmission module; in step S82', the client device 1 according to the The first data transmission module allocates a shared memory, and the shared memory allows the primary device 2 to perform a read/write operation; in step S96', the primary device 2 obtains the access permission of the shared memory allocated by the client device 1 to The shared memory is allowed to perform the read and write operations of the primary device 2; in step S83', the client device 1 performs data transmission with the shared memory through the first data transmission module, and the step S83' includes the following at least Any one of: storing the first data to be transmitted in the shared memory, and acquiring second data to be transmitted stored by the primary device 2 in the shared memory; in step S97, the primary device 2 passes through The second data transmission module performs data transmission with the shared memory, and the step S97' includes at least one of the following: acquiring the first data to be transmitted stored by the client device 1 in the shared memory, Two data to be transmitted is stored in the shared memory. Here, steps S81' to S83' are the same as or substantially the same as the contents of steps S81 to S83 in FIG. 8, and steps S95' to S97' are the same as or substantially the same as the contents of steps S95 to S97 in FIG. 9, for the sake of brevity. Therefore, it will not be repeated here, and is included herein by reference.
与现有技术相比,本申请的一个实施例中,客端设备创建第一数据传输模块,主端设备创建第二数据传输模块,所述第一数据传输模块和所述第二数据传输模块提供了客端设备端的用户空间与主端设备端的用户空间之间的数据传输通道;所述客端设备根据所述第一数据传输模块分配一位于内核空间的共享内存,并允许所述主端设备对所述共享内存进行读写操作,所述主端设备获取所述共享内存的访问权限;所述客端设备和所述主端设备分别通过所述第一数据传输模块和所述第二数据传输模块与所述共享内存
进行数据传输,具体地,所述客端设备将所述第一待传输数据存储于所述共享内存中,所述主端设备获取所述客端设备存储在所述共享内存的第一待传输数据,所述主端设备将所述第二待传输数据存储于所述共享内存中,所述客端设备获取所述主端设备存储在所述共享内存的第二待传输数据。Compared with the prior art, in one embodiment of the present application, the client device creates a first data transmission module, and the primary device creates a second data transmission module, the first data transmission module and the second data transmission module. Providing a data transmission channel between the user space of the client device and the user space of the host device; the client device allocates a shared memory located in the kernel space according to the first data transmission module, and allows the primary terminal The device reads and writes the shared memory, and the primary device acquires access rights of the shared memory; the client device and the primary device respectively pass the first data transmission module and the second Data transmission module and the shared memory
Performing data transmission, specifically, the client device stores the first to-be-transmitted data in the shared memory, and the primary device acquires the first to-be-transmitted storage of the client device in the shared memory. Data, the primary device stores the second data to be transmitted in the shared memory, and the client device acquires second data to be transmitted stored by the primary device in the shared memory.
如此,通过位于内核空间的共享内存作为中转站传输数据,与现有的串口传输方式相比,大大地提高数据传输速率,与现有的热插拔磁盘的方式相比,操作较为简洁,对系统资源的占用较少。In this way, the shared memory located in the kernel space is used as the transfer station to transmit data, which greatly improves the data transmission rate compared with the existing serial port transmission mode, and the operation is relatively simple compared with the existing hot-swappable disk method. System resources are used less.
此外,在本申请一个典型的配置中,终端、服务网络的设备和可信方均包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。Moreover, in a typical configuration of the present application, the terminal, the device of the service network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。The memory may include non-persistent memory, random access memory (RAM), and/or non-volatile memory in a computer readable medium, such as read only memory (ROM) or flash memory. Memory is an example of a computer readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括非暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer readable media includes both permanent and non-persistent, removable and non-removable media. Information storage can be implemented by any method or technology. The information can be computer readable instructions, data structures, modules of programs, 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 disk read only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, A magnetic tape cartridge, magnetic tape storage or other magnetic storage device or any other non-transportable medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media, such as modulated data signals and carrier waves.
显然,本领域的技术人员可以对本申请进行各种改动和变型而不脱离本申请的精神和范围。这样,倘若本申请的这些修改和变型属于本申请权利要求及其等同技术的范围之内,则本申请也意图包含这些改动和变型在内。It will be apparent to those skilled in the art that various modifications and changes can be made in the present application without departing from the spirit and scope of the application. Thus, it is intended that the present invention cover the modifications and variations of the present invention.
需要注意的是,本申请可在软件和/或软件与硬件的组合体中被实施,例如,可采用专用集成电路(ASIC)、通用目的计算机或任何其他类似硬件设备来实现。在一个实施例中,本申请的软件程序可以通过处理器执行以实现上文所述步骤或功能。同样地,本申请的软件程序(包括相关的数据结构)可以被存储到计算机可读记录介质中,例如,RAM存储器,磁或光驱动器或软磁盘及类似设备。另外,本申请的一些步骤或功能可采用硬件来实现,例如,作为与处理器配合从而执行各个步骤或功能的电路。
It should be noted that the present application can be implemented in software and/or a combination of software and hardware, for example, using an application specific integrated circuit (ASIC), a general purpose computer, or any other similar hardware device. In one embodiment, the software program of the present application can be executed by a processor to implement the steps or functions described above. Likewise, the software programs (including related data structures) of the present application can be stored in a computer readable recording medium such as a RAM memory, a magnetic or optical drive or a floppy disk and the like. In addition, some of the steps or functions of the present application may be implemented in hardware, for example, as a circuit that cooperates with a processor to perform various steps or functions.
另外,本申请的一部分可被应用为计算机程序产品,例如计算机程序指令,当其被计算机执行时,通过该计算机的操作,可以调用或提供根据本申请的方法和/或技术方案。而调用本申请的方法的程序指令,可能被存储在固定的或可移动的记录介质中,和/或通过广播或其他信号承载媒体中的数据流而被传输,和/或被存储在根据所述程序指令运行的计算机设备的工作存储器中。在此,根据本申请的一个实施例包括一个装置,该装置包括用于存储计算机程序指令的存储器和用于执行程序指令的处理器,其中,当该计算机程序指令被该处理器执行时,触发该装置运行基于前述根据本申请的多个实施例的方法和/或技术方案。In addition, a portion of the present application can be applied as a computer program product, such as computer program instructions, which, when executed by a computer, can invoke or provide a method and/or technical solution in accordance with the present application. The program instructions for invoking the method of the present application may be stored in a fixed or removable recording medium, and/or transmitted by a data stream in a broadcast or other signal bearing medium, and/or stored in a The working memory of the computer device in which the program instructions are run. Herein, an embodiment in accordance with the present application includes a device including a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, triggering The apparatus operates based on the aforementioned methods and/or technical solutions in accordance with various embodiments of the present application.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附图标记视为限制所涉及的权利要求。此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。装置权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第一,第二等词语用来表示名称,而并不表示任何特定的顺序。
It is obvious to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, and the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application. Therefore, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the invention is defined by the appended claims instead All changes in the meaning and scope of equivalent elements are included in this application. Any reference signs in the claims should not be construed as limiting the claim. In addition, it is to be understood that the word "comprising" does not exclude other elements or steps. A plurality of units or devices recited in the device claims may also be implemented by a unit or device by software or hardware. The first, second, etc. words are used to denote names and do not denote any particular order.
Claims (24)
- 一种在客端设备端的用于虚拟环境下传输数据的方法,其中,所述方法包括:A method for transmitting data in a virtual environment on a client device side, wherein the method includes:创建第一数据传输模块;Creating a first data transmission module;根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作;Allocating a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform a read and write operation;通过所述第一数据传输模块与所述共享内存进行数据传输,其中,所述进行数据传输包括至少以下任一项:Data transmission by the first data transmission module and the shared memory, wherein the performing data transmission includes at least one of the following:将第一待传输数据存储于所述共享内存中,The first to-be-transmitted data is stored in the shared memory,获取所述主端设备存储在所述共享内存的第二待传输数据。Obtaining second to-be-transmitted data stored by the primary device in the shared memory.
- 根据权利要求1所述的方法,其中,将第一待传输数据存储于所述共享内存中包括:The method of claim 1, wherein storing the first data to be transmitted in the shared memory comprises:将所述第一待传输数据读取至用户空间;Reading the first to-be-transmitted data into a user space;将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存。Copying the first to-be-transmitted data from the user space to the shared memory located in a kernel space.
- 根据权利要求2所述的方法,其中,将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存包括:The method of claim 2, wherein copying the first data to be transmitted from the user space to the shared memory located in a kernel space comprises:基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第一待传输数据分次拷贝至位于内核空间的所述共享内存;Decoding, according to the related capacity information of the shared memory, the first to-be-transmitted data read to the user space to the shared memory located in a kernel space;其中,在每次拷贝后,向所述主端设备发送第一数据传输消息;The first data transmission message is sent to the primary device after each copy;当获取所述主端设备所返回的第一数据读取消息后,进行下一次拷贝,直至传输完成。After acquiring the first data read message returned by the primary device, the next copy is performed until the transfer is completed.
- 根据权利要求1至3中任一项所述的方法,其中,获取所述主端设备存储在所述共享内存的第二待传输数据包括:The method according to any one of claims 1 to 3, wherein acquiring the second data to be transmitted stored by the primary device in the shared memory comprises:读取所述主端设备存储在所述共享内存的第二待传输数据;Reading the second to-be-transmitted data stored by the primary device in the shared memory;将所读取的第二待传输数据拷贝至用户空间;Copying the read second to-be-transmitted data to the user space;将所述拷贝至用户空间的第二待传输数据存储至存储介质。The second to-be-transmitted data copied to the user space is stored to the storage medium.
- 根据权利要求4所述的方法,其中,读取所述主端设备存储在所述共享内存的第二待传输数据包括:The method of claim 4, wherein reading the second data to be transmitted stored by the primary device in the shared memory comprises:根据所述主端设备所发送的第二数据传输消息读取所述主端设备存储在所述共享内存的第二待传输数据;Reading, according to the second data transmission message sent by the primary device, the second to-be-transmitted data stored by the primary device in the shared memory;在读取完成后,向所述主端设备返回第二数据读取消息。 After the reading is completed, a second data read message is returned to the primary device.
- 根据权利要求1至5中任一项所述的方法,其中,所述方法还包括:The method of any of claims 1 to 5, wherein the method further comprises:在通过所述第一数据传输模块与所述共享内存进行数据传输之前,与所述主端设备进行传输事件通信,进行传输事件通信包括至少以下任一项:Before performing data transmission with the shared memory by the first data transmission module, performing transmission event communication with the primary device, and performing transmission event communication includes at least one of the following:向所述主端设备发送关于所述第一待传输数据的第一数据信息;Transmitting, to the primary device, first data information about the first to-be-transmitted data;获取所述主端设备所发送的关于所述第二待传输数据的第二数据信息。Obtaining second data information about the second to-be-transmitted data sent by the primary device.
- 一种在主端设备端的用于虚拟环境下传输数据的方法,其中,所述方法包括:A method for transmitting data in a virtual environment on a host device side, wherein the method includes:创建第二数据传输模块;Creating a second data transmission module;获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作;Obtaining access rights of the shared memory allocated by the client device, so that the shared memory allows the host device to perform read and write operations;通过所述第二数据传输模块与所述共享内存进行数据传输,其中,所述进行数据传输包括至少以下任一项:Data transmission is performed by the second data transmission module and the shared memory, wherein the performing data transmission includes at least one of the following:获取所述客端设备所存储在所述共享内存的第一待传输数据,Obtaining, by the client device, the first data to be transmitted stored in the shared memory, where将第二待传输数据存储于所述共享内存中。The second to-be-transmitted data is stored in the shared memory.
- 根据权利要求7所述的方法,其中,将第二待传输数据存储于所述共享内存中包括:The method of claim 7, wherein storing the second data to be transmitted in the shared memory comprises:将所述第二待传输数据读取至用户空间;Reading the second data to be transmitted to the user space;将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存。Copying the second to-be-transmitted data from the user space to the shared memory located in a kernel space.
- 根据权利要求8所述的方法,其中,将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存包括:The method of claim 8, wherein copying the second data to be transmitted from the user space to the shared memory located in a kernel space comprises:基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第二待传输数据分次拷贝至位于内核空间的所述共享内存;And downloading, according to the related capacity information of the shared memory, the second to-be-transmitted data read to the user space to the shared memory located in a kernel space;其中,在每次拷贝后,向所述客端设备发送第二数据传输消息;The second data transmission message is sent to the client device after each copy;当获取所述客端设备所返回的第二数据读取消息后,进行下一次拷贝,直至传输完成。After acquiring the second data read message returned by the client device, the next copy is performed until the transfer is completed.
- 根据权利要求7至9中任一项所述的方法,其中,获取所述客端设备存储在所述共享内存的第一待传输数据包括:The method according to any one of claims 7 to 9, wherein acquiring the first data to be transmitted stored by the client device in the shared memory comprises:读取所述客端设备存储在所述共享内存的第一待传输数据;Reading the first data to be transmitted stored by the client device in the shared memory;将所读取的第一待传输数据拷贝至用户空间;Copying the read first to-be-transmitted data to the user space;将所述拷贝至用户空间的第一待传输数据存储至存储介质。The first to-be-transmitted data copied to the user space is stored to the storage medium.
- 根据权利要求10所述的方法,其中,读取所述客端设备存储在所述共享内存的 第一待传输数据包括:The method of claim 10, wherein reading the guest device is stored in the shared memory The first data to be transmitted includes:根据所述客端设备所发送的第一数据传输消息读取所述客端设备存储在所述共享内存的第一待传输数据;Reading, according to the first data transmission message sent by the client device, the first to-be-transmitted data stored by the client device in the shared memory;在读取完成后,向所述客端设备返回第一数据读取消息。After the reading is completed, a first data read message is returned to the guest device.
- 根据权利要求7至11中任一项所述的方法,其中,所述方法还包括:The method of any of claims 7 to 11, wherein the method further comprises:在通过所述第二数据传输模块与所述共享内存进行数据传输之前,与所述客端设备进行传输事件通信,进行传输事件通信包括至少以下任一项:Before the data transmission by the second data transmission module and the shared memory, performing transmission event communication with the client device, and performing transmission event communication includes at least one of the following:向所述客端设备发送关于所述第二待传输数据的第二数据信息;Transmitting, to the client device, second data information about the second data to be transmitted;获取所述客端设备所发送的关于所述第一待传输数据的第一数据信息。Obtaining first data information about the first to-be-transmitted data sent by the client device.
- 一种用于虚拟环境下传输数据的客端设备,其中,所述设备包括:A client device for transmitting data in a virtual environment, wherein the device includes:客端创建装置,用于创建第一数据传输模块;a client creation device, configured to create a first data transmission module;客端分配装置,用于根据所述第一数据传输模块分配一共享内存,且所述共享内存允许主端设备进行读写操作;a client allocation device, configured to allocate a shared memory according to the first data transmission module, and the shared memory allows the primary device to perform a read and write operation;客端数据传输装置,用于通过所述第一数据传输模块与所述共享内存进行数据传输,其中,所述客端数据传输装置包括至少以下任一项:a client data transmission device, configured to perform data transmission with the shared memory by using the first data transmission module, wherein the client data transmission device includes at least one of the following:客端数据存储单元,用于将所述第一待传输数据存储于所述共享内存中,a client data storage unit, configured to store the first to-be-transmitted data in the shared memory,客端数据获取单元,用于获取所述主端设备存储在所述共享内存的第二待传输数据。The client data obtaining unit is configured to acquire second data to be transmitted stored by the master device in the shared memory.
- 根据权利要求13所述的设备,其中,所述客端数据存储单元包括:The device of claim 13, wherein the client data storage unit comprises:用于将所述第一待传输数据读取至用户空间的子单元;a subunit for reading the first data to be transmitted to a user space;用于将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元。And for copying the first to-be-transmitted data from the user space to a sub-unit of the shared memory located in a kernel space.
- 根据权利要求14所述的设备,其中,所述用于将所述第一待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元包括:The device according to claim 14, wherein the subunit for copying the first data to be transmitted from the user space to the shared memory located in a kernel space comprises:用于基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第一待传输数据分次拷贝至位于内核空间的所述共享内存的子单元;And configured to, according to the related capacity information of the shared memory, copy the first to-be-transmitted data read to the user space into sub-units of the shared memory located in a kernel space;用于在每次拷贝后,向所述主端设备发送第一数据传输消息的子单元;For transmitting, after each copy, a subunit of the first data transmission message to the primary device;用于当获取所述主端设备所返回的第一数据读取消息后进行下一次拷贝直至传输完成的子单元。Sub-unit for performing the next copy until the transfer is completed after acquiring the first data read message returned by the primary device.
- 根据权利要求13至15中任一项所述的设备,其中,所述客端数据获取单元包 括:The device according to any one of claims 13 to 15, wherein the client data acquisition unit package include:用于读取所述主端设备存储在所述共享内存的第二待传输数据的子单元;a subunit for reading the second data to be transmitted stored by the primary device in the shared memory;用于将所读取的第二待传输数据拷贝至用户空间的子单元;a subunit for copying the read second data to be transmitted to the user space;用于将所述拷贝至用户空间的第二待传输数据存储至存储介质的子单元。The second to-be-transmitted data for copying the copy to the user space is stored to a sub-unit of the storage medium.
- 根据权利要求16所述的设备,其中,所述用于读取所述主端设备存储在所述共享内存的第二待传输数据的子单元包括:The device according to claim 16, wherein the subunit for reading the second data to be transmitted stored by the primary device in the shared memory comprises:用于根据所述主端设备所发送的第二数据传输消息读取所述主端设备存储在所述共享内存的第二待传输数据的子单元;And reading, by the second data transmission message sent by the primary device, a subunit of the second data to be transmitted stored by the primary device in the shared memory;用于在读取完成后向所述主端设备返回第二数据读取消息的子单元。A subunit for returning a second data read message to the primary device after the reading is completed.
- 根据权利要求13至17中任一项所述的设备,其中,所述设备还包括:The device according to any one of claims 13 to 17, wherein the device further comprises:客端通信装置,用于在通过所述第一数据传输模块与所述共享内存进行数据传输之前,与所述主端设备进行传输事件通信,其中,所述客端通信装置包括至少以下任一项:a client communication device, configured to perform transmission event communication with the primary device before performing data transmission with the shared memory by the first data transmission module, wherein the client communication device includes at least one of item:客端信息发送单元,用于向所述主端设备发送关于所述第一待传输数据的第一数据信息;a client information sending unit, configured to send, to the primary device, first data information about the first data to be transmitted;客端信息获取单元,用于获取所述主端设备所发送的关于所述第二待传输数据的第二数据信息。The client information acquiring unit is configured to acquire second data information about the second data to be transmitted sent by the primary device.
- 一种用于虚拟环境下传输数据的主端设备,其中,所述设备包括:A host device for transmitting data in a virtual environment, where the device includes:主端创建装置,用于创建第二数据传输模块;a primary end creating device, configured to create a second data transmission module;主端分配装置,用于获取客端设备所分配的共享内存的访问权限,以使所述共享内存允许主端设备进行读写操作;The primary end allocation device is configured to obtain access rights of the shared memory allocated by the client device, so that the shared memory allows the primary device to perform read and write operations;主端数据传输装置,用于通过所述第二数据传输模块与所述共享内存进行数据传输,其中,所述主端数据传输装置包括至少以下任一项:The primary data transmission device is configured to perform data transmission with the shared memory by using the second data transmission module, where the primary data transmission device includes at least one of the following:主端数据获取单元,用于获取所述客端设备存储在所述共享内存的第一待传输数据,a primary data acquiring unit, configured to acquire first data to be transmitted that is stored in the shared memory by the client device, where主端数据存储单元,用于将所述第二待传输数据存储于所述共享内存中。And a primary data storage unit, configured to store the second to-be-transmitted data in the shared memory.
- 根据权利要求19所述的设备,其中,所述主端数据存储单元包括:The device of claim 19, wherein the primary data storage unit comprises:用于将所述第二待传输数据读取至用户空间的子单元;a subunit for reading the second data to be transmitted to a user space;用于将所述第二待传输数据从所述用户空间拷贝至位于内核空间的所述共享内存的子单元。And a subunit for copying the second to-be-transmitted data from the user space to the shared memory located in a kernel space.
- 根据权利要求20所述的设备,其中,所述用于将所述第二待传输数据从所述用 户空间拷贝至位于内核空间的所述共享内存的子单元包括:The apparatus according to claim 20, wherein said means for transmitting said second data to be transmitted from said use The subspace of the shared space to the shared memory located in the kernel space includes:用于基于所述共享内存的相关容量信息,将所述读取至所述用户空间的第二待传输数据分次拷贝至位于内核空间的所述共享内存的子单元;And the second to-be-transmitted data read to the user space is separately copied to the sub-unit of the shared memory located in the kernel space according to the related capacity information of the shared memory;用于在每次拷贝后,向所述客端设备发送第二数据传输消息的子单元;For transmitting, after each copy, a subunit of the second data transmission message to the client device;用于当获取所述客端设备所返回的第二数据读取消息后进行下一次拷贝直至传输完成的子单元。Sub-unit for performing the next copy until the transfer is completed after acquiring the second data read message returned by the guest device.
- 根据权利要求19至21中任一项所述的设备,其中,所述主端数据获取单元包括:The device according to any one of claims 19 to 21, wherein the primary data acquisition unit comprises:用于读取所述客端设备存储在所述共享内存的第一待传输数据的子单元;a subunit for reading the first data to be transmitted stored by the client device in the shared memory;用于将所读取的第一待传输数据拷贝至用户空间的子单元;a subunit for copying the read first data to be transmitted to the user space;用于将所述拷贝至用户空间的第一待传输数据存储至存储介质的子单元。The first to-be-transmitted data for copying the copy to the user space is stored to a sub-unit of the storage medium.
- 根据权利要求22所述的设备,其中,所述用于读取所述客端设备存储在所述共享内存的第一待传输数据的子单元包括:The device according to claim 22, wherein the subunit for reading the first data to be transmitted stored by the client device in the shared memory comprises:用于根据所述客端设备所发送的第一数据传输消息读取所述客端设备存储在所述共享内存的第一待传输数据的子单元;And a subunit for reading, by the client device, the first data to be transmitted stored in the shared memory according to the first data transmission message sent by the client device;用于在读取完成后向所述客端设备返回第一数据读取消息的子单元。A subunit for returning a first data read message to the guest device after the reading is completed.
- 根据权利要求19至23中任一项所述的设备,其中,所述设备还包括:The device according to any one of claims 19 to 23, wherein the device further comprises:主端通信装置,用于在通过所述第二数据传输模块与所述共享内存进行数据传输之前,与所述客端设备进行传输事件通信,其中,所述主端通信装置包括至少以下任一项:a primary communication device configured to perform transmission event communication with the client device before performing data transmission with the shared memory by the second data transmission module, wherein the primary communication device includes at least one of item:主端信息发送单元,用于向所述客端设备发送关于所述第二待传输数据的第二数据信息;a primary end information sending unit, configured to send, to the client device, second data information about the second to-be-transmitted data;主端信息获取单元,用于获取所述客端设备所发送的关于所述第一待传输数据的第一数据信息。 The primary end information acquiring unit is configured to acquire first data information about the first to-be-transmitted data sent by the client device.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510418471.9A CN106354670A (en) | 2015-07-16 | 2015-07-16 | Method and apparatus for transmitting data in virtual environment |
CN201510418471.9 | 2015-07-16 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2017008675A1 true WO2017008675A1 (en) | 2017-01-19 |
Family
ID=57756871
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/089077 WO2017008675A1 (en) | 2015-07-16 | 2016-07-07 | Method and device for transmitting data in virtual environment |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106354670A (en) |
WO (1) | WO2017008675A1 (en) |
Cited By (47)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10423344B2 (en) | 2017-09-19 | 2019-09-24 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10430110B2 (en) | 2017-12-19 | 2019-10-01 | Robin Systems, Inc. | Implementing a hybrid storage node in a distributed storage system |
US10430105B2 (en) | 2017-09-13 | 2019-10-01 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10430292B2 (en) | 2017-12-19 | 2019-10-01 | Robin Systems, Inc. | Snapshot deletion in a distributed storage system |
US10452308B2 (en) | 2017-12-19 | 2019-10-22 | Robin Systems, Inc. | Encoding tags for metadata entries in a storage system |
US10452267B2 (en) | 2017-09-13 | 2019-10-22 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10534549B2 (en) | 2017-09-19 | 2020-01-14 | Robin Systems, Inc. | Maintaining consistency among copies of a logical storage volume in a distributed storage system |
US10579276B2 (en) | 2017-09-13 | 2020-03-03 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10579364B2 (en) | 2018-01-12 | 2020-03-03 | Robin Systems, Inc. | Upgrading bundled applications in a distributed computing system |
US10599622B2 (en) | 2018-07-31 | 2020-03-24 | Robin Systems, Inc. | Implementing storage volumes over multiple tiers |
US10620871B1 (en) | 2018-11-15 | 2020-04-14 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10628235B2 (en) | 2018-01-11 | 2020-04-21 | Robin Systems, Inc. | Accessing log files of a distributed computing system using a simulated file system |
US10642694B2 (en) | 2018-01-12 | 2020-05-05 | Robin Systems, Inc. | Monitoring containers in a distributed computing system |
US10642697B2 (en) | 2018-01-11 | 2020-05-05 | Robin Systems, Inc. | Implementing containers for a stateful application in a distributed computing system |
US10782887B2 (en) | 2017-11-08 | 2020-09-22 | Robin Systems, Inc. | Window-based prority tagging of IOPs in a distributed storage system |
US10817380B2 (en) | 2018-07-31 | 2020-10-27 | Robin Systems, Inc. | Implementing affinity and anti-affinity constraints in a bundled application |
US10831387B1 (en) | 2019-05-02 | 2020-11-10 | Robin Systems, Inc. | Snapshot reservations in a distributed storage system |
US10846137B2 (en) | 2018-01-12 | 2020-11-24 | Robin Systems, Inc. | Dynamic adjustment of application resources in a distributed computing system |
US10846001B2 (en) | 2017-11-08 | 2020-11-24 | Robin Systems, Inc. | Allocating storage requirements in a distributed storage system |
US10845997B2 (en) | 2018-01-12 | 2020-11-24 | Robin Systems, Inc. | Job manager for deploying a bundled application |
US10877684B2 (en) | 2019-05-15 | 2020-12-29 | Robin Systems, Inc. | Changing a distributed storage volume from non-replicated to replicated |
US10896102B2 (en) | 2018-01-11 | 2021-01-19 | Robin Systems, Inc. | Implementing secure communication in a distributed computing system |
US10908848B2 (en) | 2018-10-22 | 2021-02-02 | Robin Systems, Inc. | Automated management of bundled applications |
US10976938B2 (en) | 2018-07-30 | 2021-04-13 | Robin Systems, Inc. | Block map cache |
US11023328B2 (en) | 2018-07-30 | 2021-06-01 | Robin Systems, Inc. | Redo log for append only storage scheme |
US11036439B2 (en) | 2018-10-22 | 2021-06-15 | Robin Systems, Inc. | Automated management of bundled applications |
US11086725B2 (en) | 2019-03-25 | 2021-08-10 | Robin Systems, Inc. | Orchestration of heterogeneous multi-role applications |
US11099937B2 (en) | 2018-01-11 | 2021-08-24 | Robin Systems, Inc. | Implementing clone snapshots in a distributed storage system |
US11108638B1 (en) | 2020-06-08 | 2021-08-31 | Robin Systems, Inc. | Health monitoring of automatically deployed and managed network pipelines |
US11113158B2 (en) | 2019-10-04 | 2021-09-07 | Robin Systems, Inc. | Rolling back kubernetes applications |
US11226847B2 (en) | 2019-08-29 | 2022-01-18 | Robin Systems, Inc. | Implementing an application manifest in a node-specific manner using an intent-based orchestrator |
US11249851B2 (en) | 2019-09-05 | 2022-02-15 | Robin Systems, Inc. | Creating snapshots of a storage volume in a distributed storage system |
US11256434B2 (en) | 2019-04-17 | 2022-02-22 | Robin Systems, Inc. | Data de-duplication |
US11271895B1 (en) | 2020-10-07 | 2022-03-08 | Robin Systems, Inc. | Implementing advanced networking capabilities using helm charts |
US11347684B2 (en) | 2019-10-04 | 2022-05-31 | Robin Systems, Inc. | Rolling back KUBERNETES applications including custom resources |
US11392363B2 (en) | 2018-01-11 | 2022-07-19 | Robin Systems, Inc. | Implementing application entrypoints with containers of a bundled application |
US11403188B2 (en) | 2019-12-04 | 2022-08-02 | Robin Systems, Inc. | Operation-level consistency points and rollback |
US11456914B2 (en) | 2020-10-07 | 2022-09-27 | Robin Systems, Inc. | Implementing affinity and anti-affinity with KUBERNETES |
US11520650B2 (en) | 2019-09-05 | 2022-12-06 | Robin Systems, Inc. | Performing root cause analysis in a multi-role application |
US11528186B2 (en) | 2020-06-16 | 2022-12-13 | Robin Systems, Inc. | Automated initialization of bare metal servers |
US11556361B2 (en) | 2020-12-09 | 2023-01-17 | Robin Systems, Inc. | Monitoring and managing of complex multi-role applications |
US11582168B2 (en) | 2018-01-11 | 2023-02-14 | Robin Systems, Inc. | Fenced clone applications |
US11740980B2 (en) | 2020-09-22 | 2023-08-29 | Robin Systems, Inc. | Managing snapshot metadata following backup |
US11743188B2 (en) | 2020-10-01 | 2023-08-29 | Robin Systems, Inc. | Check-in monitoring for workflows |
US11748203B2 (en) | 2018-01-11 | 2023-09-05 | Robin Systems, Inc. | Multi-role application orchestration in a distributed storage system |
US11750451B2 (en) | 2020-11-04 | 2023-09-05 | Robin Systems, Inc. | Batch manager for complex workflows |
US11947489B2 (en) | 2017-09-05 | 2024-04-02 | Robin Systems, Inc. | Creating snapshots of a storage volume in a distributed storage system |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107346260A (en) * | 2017-06-29 | 2017-11-14 | 郑州云海信息技术有限公司 | A kind of data transmission method, apparatus and system |
CN107402802A (en) * | 2017-07-27 | 2017-11-28 | 郑州云海信息技术有限公司 | A kind of video monitoring storage system based on virtual machine |
CN108304461A (en) * | 2017-12-26 | 2018-07-20 | 山东浪潮通软信息科技有限公司 | A kind of method and device of data sharing |
CN111638968B (en) * | 2019-03-01 | 2024-03-15 | 维塔科技(北京)有限公司 | Shared memory access authority setting method and device, electronic equipment and storage medium |
CN113010407A (en) * | 2019-12-20 | 2021-06-22 | 上海汽车集团股份有限公司 | System information acquisition method, device and system |
CN112416849A (en) * | 2020-11-25 | 2021-02-26 | 杭州和利时自动化有限公司 | double-CPU data interaction method, device and system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101667144A (en) * | 2009-09-29 | 2010-03-10 | 北京航空航天大学 | Virtual machine communication method based on shared memory |
CN101819564A (en) * | 2009-02-26 | 2010-09-01 | 国际商业机器公司 | Method and device for assisting communication between virtual machines |
CN103593246A (en) * | 2012-08-15 | 2014-02-19 | 中国电信股份有限公司 | Communication method between virtual machine and host machine, host machine and virtual machine system |
CN103793330A (en) * | 2012-10-31 | 2014-05-14 | 国际商业机器公司 | Method and device for data exchange in virtual machine environment |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102244682B (en) * | 2011-07-19 | 2014-04-09 | 中国科学院软件研究所 | Covert communication method under cloud computing environment |
EP2797733B1 (en) * | 2011-12-30 | 2016-11-16 | Cytec Technology Corp. | Peel ply, method of surface preparation and bonding composite structures using the same |
-
2015
- 2015-07-16 CN CN201510418471.9A patent/CN106354670A/en active Pending
-
2016
- 2016-07-07 WO PCT/CN2016/089077 patent/WO2017008675A1/en active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101819564A (en) * | 2009-02-26 | 2010-09-01 | 国际商业机器公司 | Method and device for assisting communication between virtual machines |
CN101667144A (en) * | 2009-09-29 | 2010-03-10 | 北京航空航天大学 | Virtual machine communication method based on shared memory |
CN103593246A (en) * | 2012-08-15 | 2014-02-19 | 中国电信股份有限公司 | Communication method between virtual machine and host machine, host machine and virtual machine system |
CN103793330A (en) * | 2012-10-31 | 2014-05-14 | 国际商业机器公司 | Method and device for data exchange in virtual machine environment |
Cited By (47)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US11947489B2 (en) | 2017-09-05 | 2024-04-02 | Robin Systems, Inc. | Creating snapshots of a storage volume in a distributed storage system |
US10430105B2 (en) | 2017-09-13 | 2019-10-01 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10579276B2 (en) | 2017-09-13 | 2020-03-03 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10452267B2 (en) | 2017-09-13 | 2019-10-22 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10534549B2 (en) | 2017-09-19 | 2020-01-14 | Robin Systems, Inc. | Maintaining consistency among copies of a logical storage volume in a distributed storage system |
US10423344B2 (en) | 2017-09-19 | 2019-09-24 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US10846001B2 (en) | 2017-11-08 | 2020-11-24 | Robin Systems, Inc. | Allocating storage requirements in a distributed storage system |
US10782887B2 (en) | 2017-11-08 | 2020-09-22 | Robin Systems, Inc. | Window-based prority tagging of IOPs in a distributed storage system |
US10430110B2 (en) | 2017-12-19 | 2019-10-01 | Robin Systems, Inc. | Implementing a hybrid storage node in a distributed storage system |
US10430292B2 (en) | 2017-12-19 | 2019-10-01 | Robin Systems, Inc. | Snapshot deletion in a distributed storage system |
US10452308B2 (en) | 2017-12-19 | 2019-10-22 | Robin Systems, Inc. | Encoding tags for metadata entries in a storage system |
US11099937B2 (en) | 2018-01-11 | 2021-08-24 | Robin Systems, Inc. | Implementing clone snapshots in a distributed storage system |
US11392363B2 (en) | 2018-01-11 | 2022-07-19 | Robin Systems, Inc. | Implementing application entrypoints with containers of a bundled application |
US10628235B2 (en) | 2018-01-11 | 2020-04-21 | Robin Systems, Inc. | Accessing log files of a distributed computing system using a simulated file system |
US10896102B2 (en) | 2018-01-11 | 2021-01-19 | Robin Systems, Inc. | Implementing secure communication in a distributed computing system |
US10642697B2 (en) | 2018-01-11 | 2020-05-05 | Robin Systems, Inc. | Implementing containers for a stateful application in a distributed computing system |
US11582168B2 (en) | 2018-01-11 | 2023-02-14 | Robin Systems, Inc. | Fenced clone applications |
US11748203B2 (en) | 2018-01-11 | 2023-09-05 | Robin Systems, Inc. | Multi-role application orchestration in a distributed storage system |
US10845997B2 (en) | 2018-01-12 | 2020-11-24 | Robin Systems, Inc. | Job manager for deploying a bundled application |
US10846137B2 (en) | 2018-01-12 | 2020-11-24 | Robin Systems, Inc. | Dynamic adjustment of application resources in a distributed computing system |
US10642694B2 (en) | 2018-01-12 | 2020-05-05 | Robin Systems, Inc. | Monitoring containers in a distributed computing system |
US10579364B2 (en) | 2018-01-12 | 2020-03-03 | Robin Systems, Inc. | Upgrading bundled applications in a distributed computing system |
US10976938B2 (en) | 2018-07-30 | 2021-04-13 | Robin Systems, Inc. | Block map cache |
US11023328B2 (en) | 2018-07-30 | 2021-06-01 | Robin Systems, Inc. | Redo log for append only storage scheme |
US10817380B2 (en) | 2018-07-31 | 2020-10-27 | Robin Systems, Inc. | Implementing affinity and anti-affinity constraints in a bundled application |
US10599622B2 (en) | 2018-07-31 | 2020-03-24 | Robin Systems, Inc. | Implementing storage volumes over multiple tiers |
US10908848B2 (en) | 2018-10-22 | 2021-02-02 | Robin Systems, Inc. | Automated management of bundled applications |
US11036439B2 (en) | 2018-10-22 | 2021-06-15 | Robin Systems, Inc. | Automated management of bundled applications |
US10620871B1 (en) | 2018-11-15 | 2020-04-14 | Robin Systems, Inc. | Storage scheme for a distributed storage system |
US11086725B2 (en) | 2019-03-25 | 2021-08-10 | Robin Systems, Inc. | Orchestration of heterogeneous multi-role applications |
US11256434B2 (en) | 2019-04-17 | 2022-02-22 | Robin Systems, Inc. | Data de-duplication |
US10831387B1 (en) | 2019-05-02 | 2020-11-10 | Robin Systems, Inc. | Snapshot reservations in a distributed storage system |
US10877684B2 (en) | 2019-05-15 | 2020-12-29 | Robin Systems, Inc. | Changing a distributed storage volume from non-replicated to replicated |
US11226847B2 (en) | 2019-08-29 | 2022-01-18 | Robin Systems, Inc. | Implementing an application manifest in a node-specific manner using an intent-based orchestrator |
US11249851B2 (en) | 2019-09-05 | 2022-02-15 | Robin Systems, Inc. | Creating snapshots of a storage volume in a distributed storage system |
US11520650B2 (en) | 2019-09-05 | 2022-12-06 | Robin Systems, Inc. | Performing root cause analysis in a multi-role application |
US11347684B2 (en) | 2019-10-04 | 2022-05-31 | Robin Systems, Inc. | Rolling back KUBERNETES applications including custom resources |
US11113158B2 (en) | 2019-10-04 | 2021-09-07 | Robin Systems, Inc. | Rolling back kubernetes applications |
US11403188B2 (en) | 2019-12-04 | 2022-08-02 | Robin Systems, Inc. | Operation-level consistency points and rollback |
US11108638B1 (en) | 2020-06-08 | 2021-08-31 | Robin Systems, Inc. | Health monitoring of automatically deployed and managed network pipelines |
US11528186B2 (en) | 2020-06-16 | 2022-12-13 | Robin Systems, Inc. | Automated initialization of bare metal servers |
US11740980B2 (en) | 2020-09-22 | 2023-08-29 | Robin Systems, Inc. | Managing snapshot metadata following backup |
US11743188B2 (en) | 2020-10-01 | 2023-08-29 | Robin Systems, Inc. | Check-in monitoring for workflows |
US11456914B2 (en) | 2020-10-07 | 2022-09-27 | Robin Systems, Inc. | Implementing affinity and anti-affinity with KUBERNETES |
US11271895B1 (en) | 2020-10-07 | 2022-03-08 | Robin Systems, Inc. | Implementing advanced networking capabilities using helm charts |
US11750451B2 (en) | 2020-11-04 | 2023-09-05 | Robin Systems, Inc. | Batch manager for complex workflows |
US11556361B2 (en) | 2020-12-09 | 2023-01-17 | Robin Systems, Inc. | Monitoring and managing of complex multi-role applications |
Also Published As
Publication number | Publication date |
---|---|
CN106354670A (en) | 2017-01-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2017008675A1 (en) | Method and device for transmitting data in virtual environment | |
EP4318203A2 (en) | Managed switching between one or more hosts and solid state drives (ssds) based on the nvme protocol to provide host storage services | |
US9098302B2 (en) | System and apparatus to improve boot speed in serial peripheral interface system using a baseboard management controller | |
WO2015149673A1 (en) | Method, server, and system for sharing resource data | |
US20210318991A1 (en) | Multi-cloud bi-directional storage replication system and techniques | |
US20190243757A1 (en) | Systems and methods for input/output computing resource control | |
CN103412822B (en) | Operation Nonvolatile memory and the method and relevant apparatus of data manipulation | |
US9244877B2 (en) | Link layer virtualization in SATA controller | |
CN114281484B (en) | Data transmission method, device, equipment and storage medium | |
WO2022021896A1 (en) | Interprocess communication method and apparatus | |
US9542112B2 (en) | Secure cross-process memory sharing | |
US10089247B2 (en) | System and method for coupling a host device to secure and non-secure devices | |
CN114327777B (en) | Method and device for determining global page directory, electronic equipment and storage medium | |
US10977049B2 (en) | Installing of operating system | |
CN115840620B (en) | Data path construction method, device and medium | |
US9229891B2 (en) | Determining a direct memory access data transfer mode | |
CN112256460A (en) | Inter-process communication method and device, electronic equipment and computer readable storage medium | |
CN117349870A (en) | Transparent encryption and decryption computing system, method, equipment and medium based on heterogeneous computing | |
CN105988724B (en) | The method and storage equipment of more copy write storage devices | |
KR20180023543A (en) | Apparatus and method for providing memory via serial communication | |
US20190163657A1 (en) | Technologies for stable secure channel identifier mapping for static and dynamic devices | |
TWI611344B (en) | Systems and methods for providing file information in a memory system protocol | |
US20130247065A1 (en) | Apparatus and method for executing multi-operating systems | |
US11914879B2 (en) | Storage controller and storage system comprising the same | |
US11442668B2 (en) | Prioritizing volume accesses in multi-volume storage device based on execution path of a service |
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: 16823822 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 16823822 Country of ref document: EP Kind code of ref document: A1 |