CN113326093A - Data processing method and device, electronic equipment and computer readable medium - Google Patents

Data processing method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN113326093A
CN113326093A CN202010271152.0A CN202010271152A CN113326093A CN 113326093 A CN113326093 A CN 113326093A CN 202010271152 A CN202010271152 A CN 202010271152A CN 113326093 A CN113326093 A CN 113326093A
Authority
CN
China
Prior art keywords
virtual
virtual machine
bare metal
metal server
input terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010271152.0A
Other languages
Chinese (zh)
Inventor
田殿臣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010271152.0A priority Critical patent/CN113326093A/en
Publication of CN113326093A publication Critical patent/CN113326093A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the application provides a data processing method and device, electronic equipment and a computer readable medium, and relates to the technical field of virtualization. Wherein the method comprises the following steps: transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in a processing device to a second buffer area of the input terminal in a virtual kernel of a bare metal server, wherein the virtual machine runs in the bare metal server; sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer area based on the message signal remapping interrupt request. Through the embodiment of the application, the input terminal simulation of the virtual machine and the competition of the vcpu for the physical CPU computing resource can be effectively avoided, and the use experience of the input terminal simulated by the virtual machine is ensured.

Description

Data processing method and device, electronic equipment and computer readable medium
Technical Field
The embodiment of the application relates to the technical field of virtualization, and in particular relates to a data processing method and device, an electronic device and a computer readable medium.
Background
With the continuous evolution of cloud computing technology, cloud servers with bare metal architectures begin to appear, and the bare metal architectures bring higher computing capacity and more stable performance to the cloud servers and lower cost to cloud manufacturers through new virtualization architectures. The bare metal framework can provide a selling unit of a physical machine for a user, can run a plurality of traditional virtual machines at the same time, and still provides the virtual machines to customers in the form of cloud servers. Due to optimization of the virtualization technology under the bare metal framework, a manufacturer can sell all CPUs of the cloud server usually, services such as monitoring, operation and maintenance and the like on the cloud server do not run in the same machine environment with the Virtual machine any more before, but use other soc (System on Chip) chips for replacement and completion, so that it is ensured that a vcpu (Virtual Central Processing Unit) of a client Virtual machine occupies 100% of physical CPU computing resources, no other process can compete for the physical CPU computing resources with the vcpu process, and performance of the client Virtual machine is ensured. However, one type of computational logic is included in the code implementation of the virtual machine, and is a function of the virtual machine itself, which occupies a large amount of physical CPU computational resources, and this function is the terminal emulation of the virtual machine. However, since the physical CPU computing resources consumed by the function do not belong to the physical CPU computing resources consumed by the internal services of the client, when the function contends for the physical CPU computing resources of the vcpu, the service of the client is damaged, and if the physical CPU computing resources of the vcpu are preferentially guaranteed, the experience of the user using the analog terminal of the virtual machine is very poor, and a 'machine stuck' experience is provided for people. But because the function is part of the implementation of the virtual machine, the problem that the function contends for the physical CPU computing resources of the vcpu cannot be solved by simply deploying the function onto the soc chip like monitoring, operation and maintenance and other services.
In the prior art, in order to ensure the computing capability of the vcpu, the scheduling priority of the vcpu process is increased to preferentially acquire the physical CPU computing resource, but the disadvantage is that competition between terminal simulation of the virtual machine and the vcpu for the physical CPU computing resource is only relieved, but still exists, and the terminal simulation of the virtual machine is poor in use experience due to low execution priority. Therefore, how to effectively avoid competition between terminal simulation of the virtual machine and the vcpu for the physical CPU computing resource and ensure the use experience of the simulation terminal of the virtual machine becomes a technical problem to be solved urgently at present.
Disclosure of Invention
The application aims to provide a data processing method, a data processing device, an electronic device and a computer readable medium, which are used for solving the technical problems in the prior art that how to effectively avoid the competition between terminal simulation of a virtual machine and a vcpu for physical CPU computing resources and ensure the use experience of a simulation terminal of the virtual machine.
According to a first aspect of embodiments of the present application, a data processing method is provided. The method comprises the following steps: transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in a processing device to a second buffer area of the input terminal in a virtual kernel of a bare metal server, wherein the virtual machine runs in the bare metal server; sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer area based on the message signal remapping interrupt request.
According to a second aspect of embodiments of the present application, there is provided a data processing method. The method comprises the following steps: receiving a message signal remapping interrupt request of an input terminal simulated by the virtual machine, which is sent to the virtual machine running in the bare metal server by a processing device; reading an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request.
According to a third aspect of embodiments of the present application, there is provided a data processing method. The method comprises the following steps: sending a first data read request of a first video memory bitmap of a virtual video card of a virtual machine to a virtual machine running in a bare metal server, so as to synchronize data in the first video memory bitmap in a virtual kernel of the bare metal server to a second video memory bitmap allocated to the virtual video card by a processing device; sending a second data read request of a first video memory buffer area of the virtual video card to the virtual machine based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area in the virtual kernel to a second video memory buffer area allocated to the virtual video card by the processing device; and determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area.
According to a fourth aspect of the embodiments of the present application, there is provided a data processing apparatus. The device comprises: the virtual machine management system comprises a transmission module, a virtual machine management module and a virtual core management module, wherein the transmission module is used for transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in processing equipment to a second buffer area of the input terminal in a virtual kernel of a bare metal server, and the virtual machine runs in the bare metal server; a first sending module, configured to send a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer based on the message signal remapping interrupt request.
According to a fifth aspect of embodiments of the present application, there is provided a data processing apparatus. The device comprises: the receiving module is used for receiving a message signal remapping interrupt request of the virtual machine simulated input terminal, which is sent to a virtual machine running in a bare metal server by a processing device; a reading module, configured to read an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request.
According to a sixth aspect of embodiments of the present application, there is provided a data processing apparatus. The device comprises: a second sending module, configured to send a first data read request of a first memory bitmap of a virtual graphics card of a virtual machine to a virtual machine running in a bare metal server, so as to synchronize data in the first memory bitmap located in a virtual core of the bare metal server to a second memory bitmap allocated to the virtual graphics card by a processing device; a third sending module, configured to send, to the virtual machine, a second data read request of a first video memory buffer area of the virtual video card based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area located in the virtual core to a second video memory buffer area allocated to the virtual video card by the processing device; and the determining module is used for determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area.
According to a seventh aspect of embodiments of the present application, there is provided a data processing system. The system comprises: the chip is used for transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in the chip to a second buffer area of the input terminal in a virtual kernel of the bare metal server, and sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server; the bare metal server is configured to receive a message signal remapping interrupt request of the input terminal simulated by the virtual machine, which is sent by the chip to the virtual machine running in the bare metal server, and read an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request.
According to an eighth aspect of embodiments of the present application, there is provided a data processing system. The system comprises: the chip is used for sending a first data reading request of a first video memory bitmap of a virtual video card of a virtual machine to the virtual machine running in the bare metal server so as to synchronize data in the first video memory bitmap in a virtual kernel of the bare metal server to a second video memory bitmap distributed to the virtual video card by the chip; the chip is configured to send a second data read request of a first video memory buffer area of the virtual video card to the virtual machine based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area in the virtual core to a second video memory buffer area allocated to the virtual video card by the chip; and the chip is used for determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area.
According to a ninth aspect of embodiments of the present application, there is provided an electronic apparatus, including: one or more processors; a computer readable medium configured to store one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the data processing method as described in the first, second or third aspect of the embodiments above.
According to a tenth aspect of embodiments of the present application, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements a data processing method as described in the first, second or third aspect of the embodiments above.
According to the data processing scheme provided by the embodiment of the application, an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in a processing device is transmitted to a second buffer area of the input terminal in a virtual kernel of a bare metal server, wherein the bare metal server runs the virtual machine; sending a message signal remapping interrupt request of an input terminal to a virtual machine running in a bare metal server, so that the virtual machine reads an input terminal event from a second buffer area based on the message signal remapping interrupt request, compared with the existing other modes, by transmitting the input terminal event in a first buffer area of the input terminal simulated by a virtual machine in a processing device to the second buffer area of the input terminal in a virtual kernel of the bare metal server, and sending the message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, the simulation logic of the input terminal of the virtual machine is stripped from the bare metal server running the virtual machine, and the simulation logic of the input terminal of the virtual machine is executed by adopting a separate processing device, namely the simulation logic of the input terminal of the virtual machine in a simulator of the virtual machine in the bare metal server is sunk to the processing device for execution, the bare metal server has no overhead of computing resources of the analog logic of the input terminal of the virtual machine, the analog logic of the input terminal of the virtual machine and the vcpu are effectively prevented from competing for the computing resources of the physical CPU in the bare metal server, the computing resources of the physical CPU in the bare metal server are further released, the computing power of the vcpu is not damaged due to the simulation of the input terminal, and therefore the computing resources of the physical CPU are further used for serving the actual business inside the user. Meanwhile, because the single processing device is used for executing the simulation logic of the input terminal of the virtual machine, the simulation logic of the input terminal of the virtual machine can be completed sufficiently, the phenomenon of machine blocking can not occur, and the use experience of a user using the input terminal simulated by the virtual machine is effectively ensured.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
FIG. 1 is a flowchart illustrating steps of a data processing method according to an embodiment of the present disclosure;
FIG. 2A is a flowchart illustrating steps of a data processing method according to a second embodiment of the present application;
FIG. 2B is a diagram illustrating a data processing procedure according to the second embodiment of the present application;
FIG. 3A is a flowchart illustrating steps of a data processing method according to a third embodiment of the present application;
FIG. 3B is a diagram illustrating a data processing procedure according to the third embodiment of the present application;
FIG. 4 is a schematic structural diagram of a data processing apparatus according to a fourth embodiment of the present application;
FIG. 5 is a schematic structural diagram of a data processing apparatus according to a fifth embodiment of the present application;
FIG. 6 is a schematic structural diagram of a data processing apparatus according to a sixth embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device in a seventh embodiment of the present application;
fig. 8 is a hardware structure of an electronic device according to an eighth embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Referring to fig. 1, a flowchart illustrating steps of a data processing method according to a first embodiment of the present application is shown.
Specifically, the data processing method provided by this embodiment includes the following steps:
in step S101, an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in a processing device is transmitted to a second buffer area of the input terminal in a virtual kernel of a bare metal server.
In the embodiment of the present application, the processing device may be a soc (System on Chip) Chip. Generally, soc is called a system-on-chip, also called a system-on-chip, meaning that it is a product, an integrated circuit with a dedicated target, which contains the complete system and has the entire content of embedded software. Meanwhile, the method is a technology for realizing the whole process from the determination of system functions to the software/hardware division and completing the design. The virtual machine simulated input terminal can comprise a virtual machine simulated keyboard, a virtual machine simulated mouse and the like. The input terminal event may be understood as an operation event of the input terminal simulated by the virtual machine, such as a sliding operation and a clicking operation for a mouse, a clicking operation for a keyboard, and the like. The bare metal server may be understood as a server whose virtualized architecture is a bare metal architecture. The bare metal server runs the virtual machine. A bare metal architecture may be understood as a virtualization architecture that relies on a virtual in-layer kernel and a server console for management, with virtualization software installed directly on top of the hardware, and then operating systems and applications installed thereon. The Virtual Kernel may be a KVM (Kernel-based Virtual Machine) module. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, when an input terminal event in a first buffer of an input terminal virtually simulated in a processing device is transmitted to a second buffer of the input terminal in a virtual kernel of a bare metal server, when a set time of a timer of the input device is reached, the input terminal event in the first buffer is transmitted to the second buffer through a first hardware channel in a virtual function of a communication device of the bare metal server. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In one specific example, the input devices include a keyboard and a mouse. When an input terminal event in a first buffer area of an input terminal virtually simulated in a processing device is transmitted to a second buffer area of the input terminal in a virtual kernel of a bare metal server, when the set time of a timer of the input device is reached, a keyboard event in a third buffer area of the keyboard virtually simulated in the processing device is transmitted to a fourth buffer area of the keyboard in the virtual kernel of the bare metal server through the first hardware channel, and a mouse event in a fifth buffer area of the mouse virtually simulated in the processing device is transmitted to a sixth buffer area of the mouse in the virtual kernel of the bare metal server. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the setting time of the timer of the input device can be set by a person skilled in the art according to actual needs, for example, 5ms, 10ms, and the like. The communication device of the bare metal server may be an FPGA (Field Programmable Gate Array) chip. In practical application, an FPGA chip implements SR-IOV (Single Root I/O Virtualization) logic, and maintains a resource pool of a VF (Virtual Functions). And when the virtual machine is started, distributing the VF of the FPGA chip for the virtual machine from the FPGA chip. In particular, the SR-IOV specification defines a standardized mechanism to natively support the sharing of a physical device by multiple virtual machines. SR-IOV is widely applied to network cards. SR-IOV enables a single functional unit (e.g., an ethernet port) to look like multiple independent physical devices. One physical device with SR-IOV function can be configured as a plurality of functional units. SR-IOV uses two functions. The first function is PF (Physical Functions). This is a complete SR-IOV capable PCIe device. The PF can be discovered, managed and configured like a normal PCI device. The second function is a VF (Virtual Functions). Simple PCIe feature, which can only handle I/O. Each VF is separate from the PF. Each physical hardware has a limit on the number of VFs. A PF can be virtualized into VFs for assignment to virtual machines. The Hypervisor can assign one or more VFs to a virtual machine. At some point, a VF may only be assigned to one virtual machine. The first hardware channel in the virtual function may be a hardware queue. The keyboard event may be understood as an operational event of a user with respect to a virtual machine simulated keyboard, e.g. a click event of a user with respect to a keyboard. The mouse event may be understood as an operation event of a user with respect to a virtual machine simulated mouse, for example, a click event of the user with respect to the mouse, a slide event, and the like. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before the transmitting the incoming terminal event in the first buffer of the virtual machine emulated incoming terminal in the processing device into the second buffer of the incoming terminal in the virtual kernel of the bare metal server, the method further includes: in the processing device, creating the third buffer of the keyboard for buffering the keyboard events sent by the user, and creating the fifth buffer of the mouse for buffering the mouse events sent by the user. Wherein the third buffer and the fifth buffer may be first-in-first-out queues. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S102, a message signal remapping interrupt request of the input terminal is sent to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer area based on the message signal remapping interrupt request.
In the embodiment of the present application, the message signal remapping interrupt request may be understood as a message signal interrupt request in a remappable format, for example, an MSI-X interrupt request in a remappable format, and the like. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, when the message signal remapping interrupt request of the input terminal is sent to the virtual machine running in the bare metal server, when the set time of the timer of the input device is reached, the message signal remapping interrupt request of the input terminal is sent to the virtual machine through a second hardware channel in a virtual function of a communication device of the bare metal server, so that the virtual machine reads the input terminal event from the second buffer based on the message signal remapping interrupt request. Wherein the second hardware channel in the virtual function of the communication device may be a hardware queue. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In one specific example, the input devices include a keyboard and a mouse. When a message signal remapping interrupt request of the input terminal is sent to the virtual machine running in the bare metal server, when the set time of a timer of the input device is reached, a message signal remapping interrupt request of the keyboard is sent to the virtual machine through the second hardware channel, so that the virtual machine reads a keyboard event from a buffer area of the keyboard in a virtual kernel of the bare metal server based on the message signal remapping interrupt request of the keyboard, and sends a message signal remapping interrupt request of the mouse to the virtual machine, so that the virtual machine reads a mouse event from the buffer area of the mouse in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the mouse. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
According to the data processing method provided by the embodiment of the application, an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in processing equipment is transmitted to a second buffer area of the input terminal in a virtual kernel of a bare metal server, wherein the bare metal server runs the virtual machine; sending a message signal remapping interrupt request of an input terminal to a virtual machine running in a bare metal server, so that the virtual machine reads an input terminal event from a second buffer area based on the message signal remapping interrupt request, compared with the existing other modes, by transmitting the input terminal event in a first buffer area of the input terminal simulated by a virtual machine in a processing device to the second buffer area of the input terminal in a virtual kernel of the bare metal server, and sending the message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, the simulation logic of the input terminal of the virtual machine is stripped from the bare metal server running the virtual machine, and the simulation logic of the input terminal of the virtual machine is executed by adopting a separate processing device, namely the simulation logic of the input terminal of the virtual machine in a simulator of the virtual machine in the bare metal server is sunk to the processing device for execution, the bare metal server has no overhead of computing resources of the analog logic of the input terminal of the virtual machine, the analog logic of the input terminal of the virtual machine and the vcpu are effectively prevented from competing for the computing resources of the physical CPU in the bare metal server, the computing resources of the physical CPU in the bare metal server are further released, the computing power of the vcpu is not damaged due to the simulation of the input terminal, and therefore the computing resources of the physical CPU are further used for serving the actual business inside the user. Meanwhile, because the single processing device is used for executing the simulation logic of the input terminal of the virtual machine, the simulation logic of the input terminal of the virtual machine can be completed sufficiently, the phenomenon of machine blocking can not occur, and the use experience of a user using the input terminal simulated by the virtual machine is effectively ensured.
The data processing method of the present embodiment may be performed by any suitable device having data processing capabilities, including but not limited to: a camera, a terminal, a mobile terminal, a PC, a server, an in-vehicle device, an entertainment device, an advertising device, a Personal Digital Assistant (PDA), a tablet, a laptop, a handheld game machine, glasses, a watch, a wearable device, a virtual display device, a display enhancement device, or the like.
Referring to fig. 2A, a flowchart illustrating steps of a data processing method according to a second embodiment of the present application is shown.
Specifically, the data processing method provided by this embodiment includes the following steps:
in step S201, a message signal remapping interrupt request of an input terminal of the virtual machine simulation, which is sent to a virtual machine running in a bare metal server by a processing device, is received.
In some optional embodiments, before the receiving, by the processing device, a message signal remapping interrupt request of the virtual machine simulated input terminal sent to a virtual machine running in a bare metal server, the method further includes: receiving an input terminal event in a first buffer area of the virtual machine simulated input terminal transmitted by the processing device, and buffering the input terminal event into a second buffer area of the input terminal in the virtual kernel. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, when receiving a message signal remapping interrupt request of the virtual machine simulated input terminal sent by a processing device to a virtual machine running in a bare metal server, the processing device receives, through a hardware channel in a virtual function of a communication device of the bare metal server, a message signal remapping interrupt request of the virtual machine simulated input terminal sent by the processing device to the virtual machine running in the bare metal server. Wherein, the hardware channel in the virtual function of the communication device is a hardware queue. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, before receiving, through a hardware channel in a virtual function of the communication device of the bare metal server, a message signal remapping interrupt request of the input terminal simulated by the virtual machine, sent by the processing device to the virtual machine running in the bare metal server, the method further includes: when the virtual machine is started, distributing the virtual function of the communication equipment to the virtual machine, wherein the virtual function comprises a hardware queue for communication. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S202, based on the message signal remapping interrupt request, reading an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server.
In this embodiment, the buffer area of the input terminal may be the second buffer area in the first embodiment. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some alternative embodiments, the input device includes a keyboard and a mouse. Reading the event of the keyboard from the buffer area of the keyboard in the virtual kernel of the bare metal server based on the message signal remapping interrupt request when the event of the input terminal is read from the buffer area of the input terminal in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the keyboard; reading the mouse event from the buffer of the mouse in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the mouse. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, before the event that the keyboard is read from the buffer of the keyboard in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the keyboard, the method further includes: and applying for the buffer area of the keyboard from the virtual kernel through the simulator of the virtual machine. The simulator of the virtual machine may be QEMU (Quick simulator). QEMU is a vmm (virtual machine monitor) on a host machine, simulates CPU by dynamic binary conversion, and provides a series of hardware models, so that the operating system of the virtual machine considers that it deals with the hardware directly, which is actually a hardware deal simulated by QEMU, and QEMU translates these instructions to the real hardware for operation. By the mode, the operating system of the virtual machine can interact with a hard disk, a network card, a CPU, a CD-ROM, audio equipment and USB equipment on the host. The buffer area of the keyboard may be the fourth buffer area in the first embodiment. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, when reading an event of the keyboard from a buffer of the keyboard in a virtual kernel of the bare metal server based on a message signal remapping interrupt request of the keyboard, looking up an entry in a preconfigured interrupt remapping table based on the message signal remapping interrupt request of the keyboard to obtain an interrupt request of the bare metal server corresponding to the message signal remapping interrupt request of the keyboard; sending an interrupt injection signal to an interrupt injection unit registered in the virtual kernel based on an interrupt service routine of the interrupt request so as to inject the interrupt request into the virtual machine; executing, by a virtual processor of the virtual machine, an interrupt service routine of the interrupt request, reading an event of the keyboard from a buffer of the keyboard in a virtual kernel of the bare metal server. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the interrupt service routine, i.e. the interrupt service program, and the processor processing the "emergency" may be understood as a service, which is implemented by executing a specific program programmed in advance, and this program processing the "emergency" is called an interrupt service program. The interrupt injection unit may be an irqfd module. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when the interrupt service routine based on the interrupt request sends an interrupt injection signal to the interrupt injection unit registered in the virtual core to inject the interrupt request into the virtual machine, the interrupt request is triggered, so that the interrupt service routine of the interrupt request sends the interrupt injection signal to the interrupt injection unit registered in the virtual core; based on the interrupt injection signal, waking up a kernel thread corresponding to the interrupt injection unit in the virtual kernel, and executing a corresponding wake-up service routine to inject the interrupt request into the virtual machine. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before looking up an entry in a preconfigured interrupt remapping table based on a message signal remapping interrupt request of the keyboard, the method further comprises: after an operating system of the virtual machine allocates an interrupt number to the keyboard, an interrupt remapping table entry of the keyboard is established based on the interrupt number, and the interrupt remapping table entry of the keyboard is written into an interrupt remapping table in a virtual function of communication equipment of the bare metal server, wherein the interrupt remapping table entry records a corresponding relation between the interrupt request allocated to the keyboard and the message signal remapping interrupt request in the virtual function. Specifically, an interrupt remapping table entry of the keyboard is established through a vfio frame based on the interrupt number, and the interrupt remapping table entry of the keyboard is written into an interrupt remapping table in a virtual function of the communication device of the bare metal server. The vfio frame may be a frame that can safely expose device I/O, interrupt, DMA (Direct Memory Access), and the like to a user space (userpace), so that device driving can be completed in the user space. User space is directly accessed by the device, and the virtual machine device allocation can obtain higher IO performance. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before the interrupt service routine based on the interrupt request sends an interrupt injection signal to an interrupt injection unit registered in the virtual core to inject the interrupt request into the virtual machine, the method further includes: and creating the interrupt injection unit for the keyboard, and registering the interrupt injection unit into the virtual kernel so as to create a kernel thread which is corresponding to the interrupt injection unit and is used for executing a wake-up service routine in the virtual kernel. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, before the event of reading the mouse from the buffer of the mouse in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the mouse, the method further includes: and applying for the buffer area of the mouse to the virtual kernel through the simulator of the virtual machine. The buffer area of the mouse may be the sixth buffer area in the first embodiment. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, when the event of the mouse is read from the buffer of the mouse in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the mouse, the table entry in the preconfigured interrupt remapping table is searched based on the message signal remapping interrupt request of the mouse to obtain the interrupt request of the bare metal server corresponding to the message signal remapping interrupt request of the mouse; sending an interrupt injection signal to an interrupt injection unit registered in the virtual kernel based on an interrupt service routine of the interrupt request so as to inject the interrupt request into the virtual machine; and executing an interrupt service routine of the interrupt request through a virtual processor of the virtual machine, and reading the event of the mouse from a buffer area of the mouse in a virtual kernel of the bare metal server. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when the interrupt service routine based on the interrupt request sends an interrupt injection signal to the interrupt injection unit registered in the virtual core to inject the interrupt request into the virtual machine, the interrupt request is triggered, so that the interrupt service routine of the interrupt request sends the interrupt injection signal to the interrupt injection unit registered in the virtual core; based on the interrupt injection signal, waking up a kernel thread corresponding to the interrupt injection unit in the virtual kernel, and executing a corresponding wake-up service routine to inject the interrupt request into the virtual machine. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before looking up an entry in a preconfigured interrupt remapping table based on a message signal remapping interrupt request of the mouse, the method further comprises: after an operating system of the virtual machine allocates an interrupt number to the mouse, an interrupt remapping table entry of the mouse is established based on the interrupt number, and the interrupt remapping table entry of the mouse is written into an interrupt remapping table in a virtual function of communication equipment of the bare metal server, wherein the interrupt remapping table entry records a corresponding relation between the interrupt request allocated to the mouse and the message signal remapping interrupt request in the virtual function. Specifically, an interrupt remapping table entry of the mouse is established through a vfio frame based on the interrupt number, and the interrupt remapping table entry of the mouse is written into an interrupt remapping table in a virtual function of the communication device of the bare metal server. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before the interrupt service routine based on the interrupt request sends an interrupt injection signal to an interrupt injection unit registered in the virtual core to inject the interrupt request into the virtual machine, the method further includes: and creating the interrupt injection unit for the mouse, and registering the interrupt injection unit into the virtual kernel so as to create a kernel thread which is corresponding to the interrupt injection unit and is used for executing a wakeup service routine in the virtual kernel. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
Correspondingly, in the embodiment of the application, a data processing system is also provided. The system comprises: the chip is used for transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in the chip to a second buffer area of the input terminal in a virtual kernel of the bare metal server, and sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server; the bare metal server is configured to receive a message signal remapping interrupt request of the input terminal simulated by the virtual machine, which is sent by the chip to the virtual machine running in the bare metal server, and read an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request. Therefore, by receiving a message signal remapping interrupt request of a virtual machine simulated input terminal sent by a processing device to a virtual machine running in a bare metal server, reading an event of the input terminal from a buffer area of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request, stripping the simulation logic of the input terminal of the virtual machine from the bare metal server running the virtual machine, executing the simulation logic of the input terminal of the virtual machine by adopting a single processing device, namely sinking the simulation logic of the input terminal of the virtual machine in a simulator of the virtual machine in the bare metal server to the processing device for execution, avoiding the overhead of the calculation resources of the simulation logic of the input terminal of the virtual machine in the bare metal server, effectively avoiding the simulation logic of the input terminal of the virtual machine from competing with vcpu for the physical CPU calculation resources in the bare metal server, and further releasing physical CPU computing resources in the bare metal server, wherein the computing power of the vcpu cannot be damaged due to input terminal simulation, so that the physical CPU computing resources are further used for serving actual services in the user. Meanwhile, because the single processing device is used for executing the simulation logic of the input terminal of the virtual machine, the simulation logic of the input terminal of the virtual machine can be completed sufficiently, the phenomenon of machine blocking can not occur, and the use experience of a user using the input terminal simulated by the virtual machine is effectively ensured. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, as shown in fig. 2B, the upper bare metal server is a host of a virtual machine, and the basic components simulated by the virtual machine, such as a simulator and a virtual kernel, can be seen above. And the middle FPGA chip is responsible for data communication between the bare metal server and the soc chip. The lower soc chip, inside which a finished operating system runs. The virtual machine simulation terminal is mainly divided into two parts, one part is simulation of a keyboard and a mouse, and the other part is simulation of an input terminal. The other part is simulation of image display, and the part is simulation of output terminal. The process of sinking the simulation logic of the input terminal of the virtual machine in the simulator of the virtual machine in the bare metal server to the soc chip is as follows: 1. the FPGA chip in the bare metal server realizes SR-IOV logic and maintains a VF resource pool. And when the virtual machine is started, distributing the VF of the FPGA chip for the virtual machine. Then, after the operating system of the virtual machine allocates the interrupt numbers of the virtual machine simulated keyboard and mouse, an interrupt remapping table entry is established for each of the virtual keyboard and mouse through the vfio frame by using an Intel vt-d (Intel Virtualization Technology for Direct I/O) interrupt remapping mechanism, and the two interrupt remapping table entries are written into the interrupt remapping table of the VF of the FPGA chip. And the interrupt remapping table entry records the corresponding relation between interrupt requests respectively distributed for a keyboard and a mouse from idle interrupt resources of the bare metal server and MSI-X interrupt requests of which the VF format of the FPGA chip is a remappable format. 2. After the interrupt remapping table entry is filled through the vfio frame, an interrupt injection unit irqfd is respectively created for the keyboard and the mouse and is registered in the virtual kernel kvm, two kernel threads are created in the virtual kernel kvm to wait at the corresponding interrupt injection unit irqfd, and the awakening service routine of the kernel threads is responsible for injecting interrupt requests respectively distributed for the keyboard and the mouse into the virtual machine. 3. After the current two steps are completed, the simulator qemu applies for two caches in the virtual kernel kvm: the keyboard buffer area and the mouse buffer area are mainly used for simulating data buffer areas of actual keyboard and mouse equipment and obtaining specific keyboard events and mouse events from the data buffer areas in the interrupt process of the keyboard and the mouse corresponding to the vcpu. 4. Through the first 3 steps, after the configuration process of the keyboard and the mouse simulated for the virtual machine in the bare metal server is finished, an input terminal simulation program of the virtual machine is operated in the soc chip to complete the input terminal simulation logic in the former simulator qemu. And the input terminal simulation logic sinks from the simulator qemu to the soc chip to complete the simulation, so that the part of computing resources are saved. In the program, a first-in first-out queue is respectively created for a keyboard and a mouse simulated by a virtual machine, and is used for buffering keyboard events and mouse events sent by a user, and a keyboard and mouse timer can do two things every 10 ms: the first thing is to transmit the keyboard event and the mouse event in the queue to the keyboard buffer and the mouse buffer in the virtual kernel kvm through the hardware queue of the VF of the FPGA chip. The second thing is to initiate two self-defined MSI-X interrupt requests with a remappable format to the virtual machine through a VF hardware queue of the FPGA chip, where the interrupt requests pass through an Intel vt-d protocol, and finally trigger the interrupt request of the bare metal server allocated through the vfio frame in step 1, an interrupt service routine of the interrupt request of the bare metal server sends a signal to the interrupt injection unit irqfd, at this time, a kernel thread waiting for the irqfd in the virtual kernel kvm wakes up, a corresponding wake-up service routine is executed, and then the interrupt request of the bare metal server of the keyboard and the interrupt request of the bare metal server of the mouse are injected to the virtual machine by using a virtualization interrupt simulation principle. 5. After the interrupt request of the bare metal server of the keyboard and the interrupt request of the bare metal server of the mouse are injected into the virtual machine in the step 4, the vcpu process executes the input and output of the port in the virtual machine due to the execution of the interrupt service routine of the interrupt request of the bare metal server of the keyboard and the interrupt service routine of the interrupt request of the bare metal server of the mouse, and exits into the virtual kernel kvm, at this time, the virtual kernel kvm provides the keyboard event and the mouse event which are desired by the vcpu through the previously distributed keyboard buffer area and mouse buffer area to complete the simulation of the input and output of the port, and the vcpu process returns to the inside of the virtual machine again to run until the simulation of the once completed event of the keyboard and the mouse is completed. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
Aiming at the sinking of the simulation logic of the keyboard and the mouse, an input device following the virtio protocol can be added in the virtual machine, then the input device following the virtio protocol is connected with the vf of an fpga chip in a direct connection mode, and the keyboard event and the mouse event sent by the client are placed in the virtio ring of the input device following the virtio protocol on the soc chip according to the virtio protocol, so that the simulation of the keyboard event and the mouse event can be completed. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
By the data processing method provided by the embodiment of the application, the message signal remapping interrupt request of the virtual machine simulated input terminal sent by the processing equipment to the virtual machine operated in the bare metal server is received, the event of the input terminal is read from the buffer area of the input terminal in the virtual kernel of the bare metal server based on the message signal remapping interrupt request, compared with the existing other modes, the event of the input terminal is read from the buffer area of the input terminal in the virtual kernel of the bare metal server by receiving the message signal remapping interrupt request of the virtual machine simulated input terminal sent by the processing equipment to the virtual machine operated in the bare metal server and based on the message signal remapping interrupt request, the analog logic of the input terminal of the virtual machine is stripped from the bare metal server operating the virtual machine, and the analog logic of the input terminal of the virtual machine is executed by adopting the separate processing equipment, that is, the simulation logic of the input terminal of the virtual machine in the simulator of the virtual machine in the bare metal server is sunk to the processing device for execution, the bare metal server does not have the overhead of the computational resource of the simulation logic of the input terminal of the virtual machine, the situation that the simulation logic of the input terminal of the virtual machine and the vcpu compete for the physical CPU computational resource in the bare metal server is effectively avoided, the physical CPU computational resource in the bare metal server is further released, the computational capability of the vcpu is not damaged due to the simulation of the input terminal, and the physical CPU computational resource is further used for serving the actual service inside the user. Meanwhile, because the single processing device is used for executing the simulation logic of the input terminal of the virtual machine, the simulation logic of the input terminal of the virtual machine can be completed sufficiently, the phenomenon of machine blocking can not occur, and the use experience of a user using the input terminal simulated by the virtual machine is effectively ensured.
The data processing method of the present embodiment may be performed by any suitable device having data processing capabilities, including but not limited to: a camera, a terminal, a mobile terminal, a PC, a server, an in-vehicle device, an entertainment device, an advertising device, a Personal Digital Assistant (PDA), a tablet, a laptop, a handheld game machine, glasses, a watch, a wearable device, a virtual display device, a display enhancement device, or the like.
Referring to fig. 3A, a flowchart of steps of a data processing method according to a third embodiment of the present application is shown.
Specifically, the data processing method provided by this embodiment includes the following steps:
in step S301, a first data read request of a first memory bitmap of a virtual graphics card of a virtual machine is sent to the virtual machine running in a bare metal server, so as to synchronize data in the first memory bitmap located in a virtual core of the bare metal server to a second memory bitmap allocated to the virtual graphics card by a processing device.
In the embodiment of the present application, the processing device may be a soc (System on Chip) Chip. Generally, soc is called a system-on-chip, also called a system-on-chip, meaning that it is a product, an integrated circuit with a dedicated target, which contains the complete system and has the entire content of embedded software. Meanwhile, the method is a technology for realizing the whole process from the determination of system functions to the software/hardware division and completing the design. The bare metal server may be understood as a server whose virtualized architecture is a bare metal architecture. The bare metal server runs the virtual machine. A bare metal architecture may be understood as a virtualization architecture that relies on a virtual in-layer kernel and a server console for management, with virtualization software installed directly on top of the hardware, and then operating systems and applications installed thereon. The Virtual Kernel may be a KVM (Kernel-based Virtual Machine) module. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before sending, to a virtual machine running in a bare metal server, a first data read request of a first memory bitmap of a virtual graphics card of the virtual machine, the method further includes: and constructing the first data reading request based on the physical address of the first video memory bitmap, the physical address of the second video memory bitmap and the length of reading the data in the first video memory bitmap. The length of the data in the first video memory bitmap may be set by a person skilled in the art according to actual needs, which is not limited in this embodiment of the present application. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before the constructing the first data read request, the method further comprises: and receiving the physical address of the first video memory bitmap synchronized by the simulator of the virtual machine. The simulator of the virtual machine may be QEMU (Quick simulator). QEMU is a vmm (virtual machine monitor) on a host machine, simulates CPU by dynamic binary conversion, and provides a series of hardware models, so that the operating system of the virtual machine considers that it deals with the hardware directly, which is actually a hardware deal simulated by QEMU, and QEMU translates these instructions to the real hardware for operation. By the mode, the operating system of the virtual machine can interact with a hard disk, a network card, a CPU, a CD-ROM, audio equipment and USB equipment on the host. The buffer area of the keyboard may be the fourth buffer area in the first embodiment. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, when a first data read request of a first memory bitmap of a virtual graphics card of a virtual machine is sent to a virtual machine running in a bare metal server, when a set time of an image timer of the processing device arrives, the first data read request is sent to the virtual machine through a hardware channel in a virtual function of communication equipment of the bare metal server, so as to synchronize data in the first memory bitmap to the second memory bitmap. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the setting time of the image timer of the processing device can be set by a person skilled in the art according to actual needs, for example, 5ms, 10ms, and the like. The communication device of the bare metal server may be an FPGA (Field Programmable Gate Array) chip. In practical application, an FPGA chip implements SR-IOV (Single Root I/O Virtualization) logic, and maintains a resource pool of a VF (Virtual Functions). And when the virtual machine is started, distributing the VF of the FPGA chip for the virtual machine from the FPGA chip. The hardware channels in the virtual function may be hardware queues. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S302, based on the data in the second video memory bitmap, a second data read request of a first video memory buffer area of the virtual video card is sent to the virtual machine, so as to synchronize the video memory change data in the first video memory buffer area located in the virtual core to a second video memory buffer area allocated by the processing device for the virtual video card.
In some optional embodiments, when a second data read request of the first memory buffer area of the virtual graphics card is sent to the virtual machine based on data in the second memory bitmap, traversing bits in the second memory bitmap, and converting data of the bits in the second memory bitmap into a virtual address of the first memory buffer area inside the virtual machine; determining the physical address of the first video memory buffer area based on the mapping relation between the physical address of the first video memory buffer area and the virtual address; and constructing a second data reading request based on the physical address of the first video memory buffer area, the physical address of the second video memory buffer area and the length of the data read from the first video memory buffer area, and sending the second data reading request to the virtual machine so as to synchronize the video memory change data in the first video memory buffer area in the virtual kernel to the second video memory buffer area allocated to the virtual video card by the processing device. The length of reading the data in the first video memory buffer area may be set by a person skilled in the art according to actual needs, which is not limited in this embodiment of the present application. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before determining the physical address of the first video memory buffer based on the mapping relationship between the physical address of the first video memory buffer and the virtual address, the method further includes: and receiving the mapping relation between the physical address of the first video memory buffer area and the virtual address synchronized by the simulator of the virtual machine. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S303, a pixel with a changed pixel value in the video frame image is determined based on the video memory change data in the second video memory buffer.
In some optional embodiments, when determining a pixel with a changed pixel value in a video frame image based on the video memory change data in the second video memory buffer area, converting the video memory change data in the second video memory buffer area into pixel change data, and synchronizing the pixel change data to a first pixel buffer area allocated by the processing device for the virtual video card; and comparing the current-moment pixel in the first pixel buffer area with the last-moment pixel in a second pixel buffer area allocated to the virtual display card by the processing equipment to obtain the pixel with the changed pixel value in the video frame image. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when the video memory change data in the second video memory buffer area is converted into the pixel change data, the video memory change data in the second video memory buffer area is converted into the pixel change data through data format conversion. The video memory change data can be understood as change data of a video memory level, and the pixel change data can be understood as change data of a pixel level. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
Correspondingly, in the embodiment of the application, a data processing system is also provided. The system comprises: the chip is used for sending a first data reading request of a first video memory bitmap of a virtual video card of a virtual machine to the virtual machine running in the bare metal server so as to synchronize data in the first video memory bitmap in a virtual kernel of the bare metal server to a second video memory bitmap distributed to the virtual video card by the chip; the chip is configured to send a second data read request of a first video memory buffer area of the virtual video card to the virtual machine based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area in the virtual core to a second video memory buffer area allocated to the virtual video card by the chip; and the chip is used for determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area. Therefore, by sending a first data read request of a first video memory bitmap of a virtual video card of a virtual machine to a virtual machine running in a bare metal server, sending a second data read request of a first video memory buffer area of the virtual video card to the virtual machine based on data in a second video memory bitmap, determining pixels with changed pixel values in a video frame image based on video memory change data in the second video memory buffer area, separating analog logic of a display terminal of the virtual machine from the bare metal server running the virtual machine, executing the analog logic of the display terminal of the virtual machine by adopting a separate processing device, namely sinking analog logic of the display terminal of the virtual machine in a simulator of the virtual machine in the bare metal server to the processing device for execution, and avoiding the overhead of computing resources of the analog logic of the display terminal of the virtual machine in the bare metal server, the method effectively avoids the situation that simulation logic of the display terminal of the virtual machine and the vcpu compete for physical CPU computing resources in the bare metal server, further releases the physical CPU computing resources in the bare metal server, and the computing power of the vcpu cannot be damaged due to simulation of the display terminal, so that the physical CPU computing resources are further used for serving actual business inside a user. Meanwhile, because the single processing device is used for executing the simulation logic of the display terminal of the virtual machine, the simulation logic of the display terminal of the virtual machine can be completed sufficiently, the phenomenon of machine blocking can not occur, and the use experience of a user using the display terminal simulated by the virtual machine is effectively ensured. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, as shown in fig. 3B, the upper bare metal server is a host of a virtual machine, and the basic components simulated by the virtual machine, such as a simulator and a virtual kernel, can be seen above. And the middle FPGA chip is responsible for data communication between the bare metal server and the soc chip. The lower soc chip, inside which a finished operating system runs. The virtual machine simulation terminal is mainly divided into two parts, one part is simulation of a keyboard and a mouse, and the other part is simulation of an input terminal. The other part is simulation of image display, and the part is simulation of output terminal. The process of sinking the simulation logic of the display terminal of the virtual machine in the simulator of the virtual machine in the bare metal server to the soc chip is as follows: 1. when the virtual machine is started, after the initialization of the virtual display card is completed, the simulator qemu synchronizes the mapping relationship between the physical address hpa (host physical address) of the display buffer of the virtual display card of the virtual machine in the virtual kernel kvm and the internal address gpa (guest physical address) of the virtual machine to the display terminal simulation program of the virtual machine of the soc chip, and also allocates a display buffer and two pixel buffers to the virtual display card of the virtual machine in the display terminal simulation program of the virtual machine, wherein the former is used for caching the display data of the virtual display card of the virtual machine, and the latter is used for caching the pixel-level data of the virtual display card of the virtual machine. 2. After the mapping relation between the gpa and hpa of the video memory buffer area of the virtual video card of the virtual machine is completed synchronously, the physical address of the video memory bitmap of the virtual video card of the virtual machine is synchronized to the display terminal simulation program of the virtual machine of the soc chip, and the bits in the bitmap are automatically set by an Intel pml mechanism and the physical CPU hardware logic of the bare metal server, so as to mark which video memory data change at the front and rear moments. 3. Through the first two steps, the soc chip already takes the mapping relation between gpa and hpa of the video memory buffer of the virtual graphics card of the virtual machine and the physical address of the bitmap of the virtual graphics card of the virtual machine. The image timer can inform the FPGA chip of completing the transportation of the video memory data at a certain image refreshing frequency. The method specifically comprises the following steps: 1. and constructing a data reading request of the bare metal server, reading the length of the bitmap data in the virtual kernel by using the physical address of the bitmap in the virtual kernel and the physical address of the bitmap in the soc chip, and filling the length into the data reading request, wherein the data reading request is sent and then waits for the bitmap synchronization to be finished. 2. Traversing the bit of the bitmap in the soc chip, converting the bit into the address gpa of the video memory buffer area in the virtual kernel inside the virtual machine, and then obtaining the corresponding hpa through the mapping relation between gpa and hpa of the video memory buffer area of the virtual video card of the virtual machine. And then constructing a data reading request of the bare metal server, filling the physical address hpa, the physical address of the video memory buffer area of the virtual video card in the soc chip and the length of reading the data of the video memory buffer area in the virtual kernel into the data reading request, and synchronizing the changed video memory data in the video memory buffer area in the virtual kernel into the video memory buffer area of the virtual video card in the soc chip after the request is completed. 3. Through the traversal of the bitmap in the previous step, the latest video memory data is already in the video memory buffer area of the virtual video card in the soc chip, then the changed video memory data is converted into the changed pixel data according to the bitmap in the soc chip and is synchronized to the buffer area of the new pixel, and then the pixel in the buffer area of the new pixel is compared with the pixel in the buffer area of the old pixel at the previous moment, so that specific pixels are obtained to be changed. 4. After the previous step, specific pixels of a frame of image are obtained and changed, and finally the different pixels are sent to a user through a network card, so that completion of sinking simulation logic of the frame of image is supported. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
Aiming at the sinking of the analog logic of the display card, an input device following a virtio protocol can be added inside the virtual machine, then the VF of the virtual machine which is directly communicated with an FPGA chip is connected with the input device following the virtio protocol inside the virtual machine, the data of the virtual display card can tell the video memory address of the virtual display card to the soc chip in a front-end drive negotiation mode, the soc chip can send an internal memory read transaction to the VF of the FPGA chip at the rear end of the virtual display card, the video memory data of the virtual display card is synchronized to the soc chip, then the logic of the scheme is imitated, the cpu of the soc chip is used for completing the calculation of the difference of the video memory data of the virtual display card, hardware logic can be customized in the FPGA chip, the calculation of the difference of the video memory data of the virtual display card is completed, and finally the difference image is sent to a client. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In practical application, in the embodiment of the application, by using an msix interrupt remapping technology, the simulation logic of a keyboard and a mouse of a virtual machine in a simulator qemu is sunk onto an soc chip, in addition, the video memory data of a virtual video card of the virtual machine is copied into the soc chip, the CPU of the soc chip is used for executing calculation tasks of video memory difference comparison and pixel difference comparison to complete sinking of image display, and finally, the terminal simulation logic of the virtual machine is sunk into the soc chip from the simulator qemu to complete the sinking. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
According to the data processing method provided by the embodiment of the application, a first data reading request of a first video memory bitmap of a virtual video card of a virtual machine is sent to the virtual machine running in a bare metal server, so that data in the first video memory bitmap in a virtual core of the bare metal server is synchronized to a second video memory bitmap allocated to the virtual video card by a processing device; sending a second data reading request of a first video memory buffer area of the virtual video card to the virtual machine based on data in the second video memory bitmap so as to synchronize video memory change data in the first video memory buffer area in the virtual kernel to a second video memory buffer area distributed for the virtual video card by the processing equipment; compared with other existing modes, the method comprises the steps of sending a first data reading request of a first video memory bitmap of a virtual video card of a virtual machine to a virtual machine running in a bare metal server, sending a second data reading request of the first video memory buffer area of the virtual video card to the virtual machine based on data in a second video memory bitmap, determining a pixel with a changed pixel value in a video frame image based on video memory change data in the second video memory buffer area, stripping analog logic of a display terminal of the virtual machine from the bare metal server running the virtual machine, executing the analog logic of the display terminal of the virtual machine by adopting a separate processing device, namely sinking the analog logic of the display terminal of the virtual machine in a simulator of the virtual machine in the bare metal server to the processing device for execution, the bare metal server has no overhead of computing resources of the simulation logic of the display terminal of the virtual machine, the simulation logic of the display terminal of the virtual machine and the vcpu are effectively prevented from competing for the computing resources of the physical CPU in the bare metal server, the computing resources of the physical CPU in the bare metal server are further released, the computing power of the vcpu is not damaged due to the simulation of the display terminal, and therefore the computing resources of the physical CPU are further used for serving actual services inside users. Meanwhile, because the single processing device is used for executing the simulation logic of the display terminal of the virtual machine, the simulation logic of the display terminal of the virtual machine can be completed sufficiently, the phenomenon of machine blocking can not occur, and the use experience of a user using the display terminal simulated by the virtual machine is effectively ensured.
The data processing method of the present embodiment may be performed by any suitable device having data processing capabilities, including but not limited to: a camera, a terminal, a mobile terminal, a PC, a server, an in-vehicle device, an entertainment device, an advertising device, a Personal Digital Assistant (PDA), a tablet, a laptop, a handheld game machine, glasses, a watch, a wearable device, a virtual display device, a display enhancement device, or the like.
Referring to fig. 4, a schematic structural diagram of a data processing apparatus in the fourth embodiment of the present application is shown.
The data processing apparatus provided by the embodiment includes: a transmitting module 402, configured to transmit an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in a processing device to a second buffer area of the input terminal in a virtual kernel of a bare metal server, where the virtual machine operates in the bare metal server; a first sending module 403, configured to send a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer based on the message signal remapping interrupt request.
Optionally, the transmission module 402 is specifically configured to: and when the set time of the timer of the input equipment is up, transmitting the input terminal event in the first buffer area to the second buffer area through a first hardware channel in the virtual function of the communication equipment of the bare metal server.
Optionally, the input device includes a keyboard and a mouse, and the transmission module 402 is specifically configured to: when the set time of the timer of the input device is reached, transmitting a keyboard event in a third buffer area of the keyboard simulated by the virtual machine in the processing device to a fourth buffer area of the keyboard in a virtual kernel of the bare metal server through the first hardware channel, and transmitting a mouse event in a fifth buffer area of the mouse simulated by the virtual machine in the processing device to a sixth buffer area of the mouse in the virtual kernel of the bare metal server.
Optionally, the first sending module 403 is specifically configured to: when the set time of the timer of the input device is reached, sending a message signal remapping interrupt request of the input terminal to the virtual machine through a second hardware channel in a virtual function of the communication device of the bare metal server, so that the virtual machine reads the input terminal event from the second buffer area based on the message signal remapping interrupt request.
Optionally, the input device includes a keyboard and a mouse, and the first sending module 403 is specifically configured to: when the set time of the timer of the input device is up, sending a message signal remapping interrupt request of the keyboard to the virtual machine through the second hardware channel, so that the virtual machine reads a keyboard event from a buffer area of the keyboard in a virtual kernel of the bare metal server based on the message signal remapping interrupt request of the keyboard, and sends a message signal remapping interrupt request of the mouse to the virtual machine, so that the virtual machine reads a mouse event from the buffer area of the mouse in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the mouse.
Optionally, before the transmitting module 402, the apparatus further includes: a creating module 401, configured to create, in the processing device, the third buffer area of the keyboard for buffering the keyboard event sent by the user, and create the fifth buffer area of the mouse for buffering the mouse event sent by the user.
The data processing apparatus of this embodiment is configured to implement the corresponding data processing method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Referring to fig. 5, a schematic structural diagram of a data processing apparatus in the fifth embodiment of the present application is shown.
The data processing apparatus provided by the embodiment includes: a first receiving module 501, configured to receive a message signal remapping interrupt request of an input terminal simulated by a virtual machine, which is sent to the virtual machine running in a bare metal server by a processing device; a reading module 502, configured to read an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request.
Optionally, the first receiving module 501 is specifically configured to: receiving, through a hardware channel in a virtual function of the communication device of the bare metal server, a message signal remapping interrupt request of the input terminal simulated by the virtual machine, which is sent to the virtual machine running in the bare metal server by the processing device.
Optionally, the input device includes a keyboard and a mouse, and the reading module 502 includes: a first reading sub-module 5022, configured to read an event of the keyboard from a buffer of the keyboard in a virtual kernel of the bare metal server based on a message signal remapping interrupt request of the keyboard; the second reading sub-module 5028 is configured to read the event of the mouse from the buffer of the mouse in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the mouse.
Optionally, before the first reading sub-module 5022, the reading module 502 further includes: the application submodule 5021 is configured to apply for the buffer area of the keyboard from the virtual kernel through the simulator of the virtual machine.
Optionally, the first reading sub-module 5022 includes: a searching unit 5024, configured to search an entry in a preconfigured interrupt remapping table based on the message signal remapping interrupt request of the keyboard, so as to obtain an interrupt request of the bare metal server corresponding to the message signal remapping interrupt request of the keyboard; a transmitting unit 5026, configured to transmit an interrupt injection signal to an interrupt injection unit registered in the virtual core based on an interrupt service routine of the interrupt request, so as to inject the interrupt request into the virtual machine; a reading unit 5027, configured to execute, by a virtual processor of the virtual machine, an interrupt service routine of the interrupt request, and read an event of the keyboard from a buffer of the keyboard in a virtual kernel of the bare metal server.
Optionally, the sending unit 5026 is specifically configured to: triggering the interrupt request to enable an interrupt service routine of the interrupt request to send an interrupt injection signal to an interrupt injection unit registered in the virtual kernel; based on the interrupt injection signal, waking up a kernel thread corresponding to the interrupt injection unit in the virtual kernel, and executing a corresponding wake-up service routine to inject the interrupt request into the virtual machine.
Optionally, before the lookup unit 5024, the first reading sub-module 5022 further includes: an establishing unit 5023, configured to, after an operating system of the virtual machine allocates an interrupt number to the keyboard, establish an interrupt remapping entry of the keyboard based on the interrupt number, and write the interrupt remapping entry of the keyboard into an interrupt remapping table in a virtual function of a communication device of the bare metal server, where the interrupt remapping entry records a correspondence between the interrupt request allocated to the keyboard and the message signal remapping interrupt request in the virtual function.
Optionally, before the sending unit 5026, the first reading sub-module 5022 further includes: a creating unit 5025, configured to create the interrupt injection unit for the keyboard, and register the interrupt injection unit into the virtual core, so as to create a core thread corresponding to the interrupt injection unit in the virtual core, where the core thread is used to execute a wake-up service routine.
Optionally, the second reading submodule 5028 is specifically configured to: based on the message signal remapping interrupt request of the mouse, searching an item in a preconfigured interrupt remapping table to obtain an interrupt request of the bare metal server corresponding to the message signal remapping interrupt request of the mouse; sending an interrupt injection signal to an interrupt injection unit registered in the virtual kernel based on an interrupt service routine of the interrupt request so as to inject the interrupt request into the virtual machine; and executing an interrupt service routine of the interrupt request through a virtual processor of the virtual machine, and reading the event of the mouse from a buffer area of the mouse in a virtual kernel of the bare metal server.
The data processing apparatus of this embodiment is configured to implement the corresponding data processing method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Referring to fig. 6, a schematic structural diagram of a data processing apparatus according to a sixth embodiment of the present application is shown.
The data processing apparatus provided by the embodiment includes: a second sending module 603, configured to send a first data read request of a first video memory bitmap of a virtual video card of a virtual machine to a virtual machine running in a bare metal server, so as to synchronize data in the first video memory bitmap located in a virtual core of the bare metal server to a second video memory bitmap allocated to the virtual video card by a processing device; a third sending module 604, configured to send, to the virtual machine, a second data read request of the first video memory buffer area of the virtual video card based on the data in the second video memory bitmap, so as to synchronize the video memory change data in the first video memory buffer area in the virtual core to a second video memory buffer area allocated by the processing device for the virtual video card; a determining module 605, configured to determine, based on the video memory change data in the second video memory buffer, a pixel with a changed pixel value in the video frame image.
Optionally, before the second sending module 603, the apparatus further includes: a constructing module 602, configured to construct the first data read request based on the physical address of the first memory bitmap, the physical address of the second memory bitmap, and the length of the data read from the first memory bitmap.
Optionally, before the constructing module 602, the apparatus further includes: a second receiving module 601, configured to receive a physical address of the first video memory bitmap synchronized by the emulator of the virtual machine.
Optionally, the second sending module 603 is specifically configured to: and when the set time of the image timer of the processing equipment is up, sending the first data reading request to the virtual machine through a hardware channel in a virtual function of the communication equipment of the bare metal server so as to synchronize the data in the first video memory bitmap into the second video memory bitmap.
Optionally, the third sending module 604 includes: a traversal submodule 6041, configured to traverse bits in the second video memory bitmap, and convert data of the bits in the second video memory bitmap into a virtual address of the first video memory buffer inside the virtual machine; a determining submodule 6043, configured to determine a physical address of the first video memory buffer based on a mapping relationship between the physical address of the first video memory buffer and the virtual address; a constructing submodule 6044, configured to construct the second data read request based on the physical address of the first video memory buffer, the physical address of the second video memory buffer, and the length of the data read from the first video memory buffer, and send the second data read request to the virtual machine.
Optionally, before the determining sub-module 6043, the third sending module 604 further includes: a receiving submodule 6042, configured to receive a mapping relationship between the physical address of the first video memory buffer and the virtual address, where the mapping relationship is synchronized by the simulator of the virtual machine.
Optionally, the determining module 605 is specifically configured to: converting the video memory change data in the second video memory buffer area into pixel change data, and synchronizing the pixel change data to a first pixel buffer area which is distributed to the virtual video card by the processing equipment; and comparing the current-moment pixel in the first pixel buffer area with the last-moment pixel in a second pixel buffer area allocated to the virtual display card by the processing equipment to obtain the pixel with the changed pixel value in the video frame image.
The data processing apparatus of this embodiment is configured to implement the corresponding data processing method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Fig. 7 is a schematic structural diagram of an electronic device in a seventh embodiment of the present application; the electronic device may include:
one or more processors 701;
a computer-readable medium 702, which may be configured to store one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the data processing method according to the first embodiment, the second embodiment, or the third embodiment.
Fig. 8 is a hardware structure of an electronic device according to an eighth embodiment of the present application; as shown in fig. 8, the hardware structure of the electronic device may include: a processor 801, a communication interface 802, a computer-readable medium 803, and a communication bus 804;
wherein the processor 801, the communication interface 802, and the computer readable medium 803 communicate with each other via a communication bus 804;
alternatively, the communication interface 802 may be an interface of a communication module, such as an interface of a GSM module;
the processor 801 may be specifically configured to: transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in a processing device to a second buffer area of the input terminal in a virtual kernel of a bare metal server, wherein the virtual machine runs in the bare metal server; sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer area based on the message signal remapping interrupt request. Further, the processor 801 may be further configured to: receiving a message signal remapping interrupt request of an input terminal simulated by the virtual machine, which is sent to the virtual machine running in the bare metal server by a processing device; reading an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request. Further, the processor 801 may be further configured to: sending a first data read request of a first video memory bitmap of a virtual video card of a virtual machine to a virtual machine running in a bare metal server, so as to synchronize data in the first video memory bitmap in a virtual kernel of the bare metal server to a second video memory bitmap allocated to the virtual video card by a processing device; sending a second data read request of a first video memory buffer area of the virtual video card to the virtual machine based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area in the virtual kernel to a second video memory buffer area allocated to the virtual video card by the processing device; and determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area.
The Processor 801 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The computer-readable medium 803 may be, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code configured to perform the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section, and/or installed from a removable medium. The computer program, when executed by a Central Processing Unit (CPU), performs the above-described functions defined in the method of the present application. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access storage media (RAM), a read-only storage media (ROM), an erasable programmable read-only storage media (EPROM or flash memory), an optical fiber, a portable compact disc read-only storage media (CD-ROM), an optical storage media piece, a magnetic storage media piece, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code configured to carry out operations for the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may operate over any of a variety of networks: including a Local Area Network (LAN) or a Wide Area Network (WAN) -to the user's computer, or alternatively, to an external computer (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions configured to implement the specified logical function(s). In the above embodiments, specific precedence relationships are provided, but these precedence relationships are only exemplary, and in particular implementations, the steps may be fewer, more, or the execution order may be modified. That is, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a transmit module and a first transmit module. Where the names of these modules do not in some cases constitute a limitation of the module itself, for example, the transfer module may also be described as a module that transfers incoming terminal events in a first buffer of an incoming terminal emulated by a virtual machine in a processing device to a second buffer of said incoming terminal in a virtual kernel of a bare metal server.
As another aspect, the present application also provides a computer-readable medium on which a computer program is stored, which when executed by a processor, implements the data processing method described in the above first, second, or third embodiment.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in a processing device to a second buffer area of the input terminal in a virtual kernel of a bare metal server, wherein the virtual machine runs in the bare metal server; sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer area based on the message signal remapping interrupt request. Further, the apparatus is caused to: receiving a message signal remapping interrupt request of an input terminal simulated by the virtual machine, which is sent to the virtual machine running in the bare metal server by a processing device; reading an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request. Further, the apparatus is caused to: sending a first data read request of a first video memory bitmap of a virtual video card of a virtual machine to a virtual machine running in a bare metal server, so as to synchronize data in the first video memory bitmap in a virtual kernel of the bare metal server to a second video memory bitmap allocated to the virtual video card by a processing device; sending a second data read request of a first video memory buffer area of the virtual video card to the virtual machine based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area in the virtual kernel to a second video memory buffer area allocated to the virtual video card by the processing device; and determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area.
The expressions "first", "second", "said first" or "said second" used in various embodiments of the present disclosure may modify various components regardless of order and/or importance, but these expressions do not limit the respective components. The above description is only configured for the purpose of distinguishing elements from other elements. For example, the first user equipment and the second user equipment represent different user equipment, although both are user equipment. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the present disclosure.
When an element (e.g., a first element) is referred to as being "operably or communicatively coupled" or "connected" (operably or communicatively) to "another element (e.g., a second element) or" connected "to another element (e.g., a second element), it is understood that the element is directly connected to the other element or the element is indirectly connected to the other element via yet another element (e.g., a third element). In contrast, it is understood that when an element (e.g., a first element) is referred to as being "directly connected" or "directly coupled" to another element (a second element), no element (e.g., a third element) is interposed therebetween.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (29)

1. A method of data processing, the method comprising:
transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in a processing device to a second buffer area of the input terminal in a virtual kernel of a bare metal server, wherein the virtual machine runs in the bare metal server;
sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer area based on the message signal remapping interrupt request.
2. The method of claim 1, wherein the transmitting the incoming terminal event in a first buffer of a virtual machine emulated incoming terminal in a processing device into a second buffer of the incoming terminal in a virtual kernel of a bare metal server comprises:
and when the set time of the timer of the input equipment is up, transmitting the input terminal event in the first buffer area to the second buffer area through a first hardware channel in the virtual function of the communication equipment of the bare metal server.
3. The method of claim 2, wherein the input device comprises a keyboard and a mouse, and the transmitting an input terminal event in a first buffer of a virtual machine simulated input terminal in a processing device into a second buffer of the input terminal in a virtual kernel of a bare metal server comprises:
when the set time of the timer of the input device is reached, transmitting a keyboard event in a third buffer area of the keyboard simulated by the virtual machine in the processing device to a fourth buffer area of the keyboard in a virtual kernel of the bare metal server through the first hardware channel, and transmitting a mouse event in a fifth buffer area of the mouse simulated by the virtual machine in the processing device to a sixth buffer area of the mouse in the virtual kernel of the bare metal server.
4. The method of claim 1, wherein said sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server comprises:
when the set time of the timer of the input device is reached, sending a message signal remapping interrupt request of the input terminal to the virtual machine through a second hardware channel in a virtual function of the communication device of the bare metal server, so that the virtual machine reads the input terminal event from the second buffer area based on the message signal remapping interrupt request.
5. The method of claim 4, wherein the input device comprises a keyboard and a mouse, and the sending the message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server comprises:
when the set time of the timer of the input device is up, sending a message signal remapping interrupt request of the keyboard to the virtual machine through the second hardware channel, so that the virtual machine reads a keyboard event from a buffer area of the keyboard in a virtual kernel of the bare metal server based on the message signal remapping interrupt request of the keyboard, and sends a message signal remapping interrupt request of the mouse to the virtual machine, so that the virtual machine reads a mouse event from the buffer area of the mouse in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the mouse.
6. The method of claim 3, wherein prior to transmitting the incoming terminal event in the first buffer of the incoming terminal simulated by the virtual machine in the processing device into the second buffer of the incoming terminal in the virtual kernel of the bare metal server, the method further comprises:
in the processing device, creating the third buffer of the keyboard for buffering the keyboard events sent by the user, and creating the fifth buffer of the mouse for buffering the mouse events sent by the user.
7. A method of data processing, the method comprising:
receiving a message signal remapping interrupt request of an input terminal simulated by the virtual machine, which is sent to the virtual machine running in the bare metal server by a processing device;
reading an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request.
8. The method of claim 7, wherein receiving a message signal remapping interrupt request of the virtual machine emulated input terminal sent by a processing device to a virtual machine running in a bare metal server comprises:
receiving, through a hardware channel in a virtual function of the communication device of the bare metal server, a message signal remapping interrupt request of the input terminal simulated by the virtual machine, which is sent to the virtual machine running in the bare metal server by the processing device.
9. The method of claim 7, wherein the input device comprises a keyboard and a mouse, and the reading the event of the input terminal from the buffer of the input terminal in the virtual kernel of the bare metal server based on the message signal remapping interrupt request comprises:
reading an event of the keyboard from a buffer of the keyboard in a virtual kernel of the bare metal server based on a message signal remapping interrupt request of the keyboard;
reading the mouse event from the buffer of the mouse in the virtual kernel of the bare metal server based on the message signal remapping interrupt request of the mouse.
10. The method of claim 9, wherein prior to the event of reading the keyboard from a buffer of the keyboard in a virtual kernel of the bare metal server based on a message signal remapping interrupt request of the keyboard, the method further comprises:
and applying for the buffer area of the keyboard from the virtual kernel through the simulator of the virtual machine.
11. The method of claim 9, wherein the reading the keyboard event from the keyboard buffer in the bare metal server's virtual kernel based on the keyboard's message signal remapping interrupt request comprises:
based on the message signal remapping interrupt request of the keyboard, searching an item in a preconfigured interrupt remapping table to obtain an interrupt request of the bare metal server corresponding to the message signal remapping interrupt request of the keyboard;
sending an interrupt injection signal to an interrupt injection unit registered in the virtual kernel based on an interrupt service routine of the interrupt request so as to inject the interrupt request into the virtual machine;
executing, by a virtual processor of the virtual machine, an interrupt service routine of the interrupt request, reading an event of the keyboard from a buffer of the keyboard in a virtual kernel of the bare metal server.
12. The method of claim 11, wherein the sending an interrupt injection signal to an interrupt injection unit registered in the virtual core to inject the interrupt request into the virtual machine based on the interrupt service routine of the interrupt request comprises:
triggering the interrupt request to enable an interrupt service routine of the interrupt request to send an interrupt injection signal to an interrupt injection unit registered in the virtual kernel;
based on the interrupt injection signal, waking up a kernel thread corresponding to the interrupt injection unit in the virtual kernel, and executing a corresponding wake-up service routine to inject the interrupt request into the virtual machine.
13. The method of claim 11, wherein prior to said looking up an entry in a preconfigured interrupt remapping table based on a message signal remapping interrupt request of said keyboard, said method further comprises:
after an operating system of the virtual machine allocates an interrupt number to the keyboard, an interrupt remapping table entry of the keyboard is established based on the interrupt number, and the interrupt remapping table entry of the keyboard is written into an interrupt remapping table in a virtual function of communication equipment of the bare metal server, wherein the interrupt remapping table entry records a corresponding relation between the interrupt request allocated to the keyboard and the message signal remapping interrupt request in the virtual function.
14. The method of claim 11, wherein prior to the interrupt service routine based on the interrupt request sending an interrupt injection signal to an interrupt injection unit registered with the virtual core to inject the interrupt request into the virtual machine, the method further comprises:
and creating the interrupt injection unit for the keyboard, and registering the interrupt injection unit into the virtual kernel so as to create a kernel thread which is corresponding to the interrupt injection unit and is used for executing a wake-up service routine in the virtual kernel.
15. The method of claim 9, wherein the reading the mouse event from the mouse buffer in the bare metal server's virtual kernel based on the mouse's message signal remap interrupt request comprises:
based on the message signal remapping interrupt request of the mouse, searching an item in a preconfigured interrupt remapping table to obtain an interrupt request of the bare metal server corresponding to the message signal remapping interrupt request of the mouse;
sending an interrupt injection signal to an interrupt injection unit registered in the virtual kernel based on an interrupt service routine of the interrupt request so as to inject the interrupt request into the virtual machine;
and executing an interrupt service routine of the interrupt request through a virtual processor of the virtual machine, and reading the event of the mouse from a buffer area of the mouse in a virtual kernel of the bare metal server.
16. A method of data processing, the method comprising:
sending a first data read request of a first video memory bitmap of a virtual video card of a virtual machine to a virtual machine running in a bare metal server, so as to synchronize data in the first video memory bitmap in a virtual kernel of the bare metal server to a second video memory bitmap allocated to the virtual video card by a processing device;
sending a second data read request of a first video memory buffer area of the virtual video card to the virtual machine based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area in the virtual kernel to a second video memory buffer area allocated to the virtual video card by the processing device;
and determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area.
17. The method of claim 16, wherein before sending the first data read request of the first memory bitmap of the virtual graphics card of the virtual machine to the virtual machine running in the bare metal server, the method further comprises:
and constructing the first data reading request based on the physical address of the first video memory bitmap, the physical address of the second video memory bitmap and the length of reading the data in the first video memory bitmap.
18. The method of claim 17, wherein prior to said constructing the first data read request, the method further comprises:
and receiving the physical address of the first video memory bitmap synchronized by the simulator of the virtual machine.
19. The method of claim 16, wherein the sending a first data read request of a first memory bitmap of a virtual graphics card of a virtual machine to the virtual machine running in a bare metal server comprises:
and when the set time of the image timer of the processing equipment is up, sending the first data reading request to the virtual machine through a hardware channel in a virtual function of the communication equipment of the bare metal server so as to synchronize the data in the first video memory bitmap into the second video memory bitmap.
20. The method of claim 16, wherein the sending a second data read request of a first video memory buffer of the virtual video card to the virtual machine based on the data in the second video memory bitmap comprises:
traversing bits in the second video memory bitmap, and converting data of the bits in the second video memory bitmap into a virtual address of the first video memory buffer area in the virtual machine;
determining the physical address of the first video memory buffer area based on the mapping relation between the physical address of the first video memory buffer area and the virtual address;
and constructing a second data reading request based on the physical address of the first video memory buffer area, the physical address of the second video memory buffer area and the length of reading the data in the first video memory buffer area, and sending the second data reading request to the virtual machine.
21. The method of claim 20, wherein before determining the physical address of the first video memory buffer based on the mapping relationship between the physical address of the first video memory buffer and the virtual address, the method further comprises:
and receiving the mapping relation between the physical address of the first video memory buffer area and the virtual address synchronized by the simulator of the virtual machine.
22. The method of claim 16, wherein the determining pixels with changed pixel values in the video frame image based on the video memory change data in the second video memory buffer comprises:
converting the video memory change data in the second video memory buffer area into pixel change data, and synchronizing the pixel change data to a first pixel buffer area which is distributed to the virtual video card by the processing equipment;
and comparing the current-moment pixel in the first pixel buffer area with the last-moment pixel in a second pixel buffer area allocated to the virtual display card by the processing equipment to obtain the pixel with the changed pixel value in the video frame image.
23. A data processing apparatus, the apparatus comprising:
the virtual machine management system comprises a transmission module, a virtual machine management module and a virtual core management module, wherein the transmission module is used for transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in processing equipment to a second buffer area of the input terminal in a virtual kernel of a bare metal server, and the virtual machine runs in the bare metal server;
a first sending module, configured to send a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server, so that the virtual machine reads the input terminal event from the second buffer based on the message signal remapping interrupt request.
24. A data processing apparatus, the apparatus comprising:
the system comprises a first receiving module, a second receiving module and a processing module, wherein the first receiving module is used for receiving a message signal remapping interrupt request of an input terminal simulated by a virtual machine, which is sent to the virtual machine running in a bare metal server by processing equipment;
a reading module, configured to read an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request.
25. A data processing apparatus, the apparatus comprising:
a second sending module, configured to send a first data read request of a first memory bitmap of a virtual graphics card of a virtual machine to a virtual machine running in a bare metal server, so as to synchronize data in the first memory bitmap located in a virtual core of the bare metal server to a second memory bitmap allocated to the virtual graphics card by a processing device;
a third sending module, configured to send, to the virtual machine, a second data read request of a first video memory buffer area of the virtual video card based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area located in the virtual core to a second video memory buffer area allocated to the virtual video card by the processing device;
and the determining module is used for determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area.
26. A data processing system, the system comprising:
a chip, and a bare metal server in communication connection with the chip,
the chip is used for transmitting an input terminal event in a first buffer area of an input terminal simulated by a virtual machine in the chip to a second buffer area of the input terminal in a virtual kernel of the bare metal server, and sending a message signal remapping interrupt request of the input terminal to the virtual machine running in the bare metal server;
the bare metal server is configured to receive a message signal remapping interrupt request of the input terminal simulated by the virtual machine, which is sent by the chip to the virtual machine running in the bare metal server, and read an event of the input terminal from a buffer of the input terminal in a virtual kernel of the bare metal server based on the message signal remapping interrupt request.
27. A data processing system, the system comprising:
a chip, and a bare metal server in communication connection with the chip,
the chip is configured to send a first data read request of a first memory bitmap of a virtual graphics card of the virtual machine to a virtual machine running in the bare metal server, so as to synchronize data in the first memory bitmap located in a virtual core of the bare metal server to a second memory bitmap allocated to the virtual graphics card by the chip;
the chip is configured to send a second data read request of a first video memory buffer area of the virtual video card to the virtual machine based on data in the second video memory bitmap, so as to synchronize video memory change data in the first video memory buffer area in the virtual core to a second video memory buffer area allocated to the virtual video card by the chip;
and the chip is used for determining the pixels with changed pixel values in the video frame images based on the video memory change data in the second video memory buffer area.
28. An electronic device, the device comprising:
one or more processors;
a computer readable medium configured to store one or more programs,
when executed by the one or more processors, cause the one or more processors to implement a data processing method as claimed in any one of claims 1-6, or to implement a data processing method as claimed in any one of claims 7-15, or to implement a data processing method as claimed in any one of claims 16-22.
29. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out a data processing method according to any one of claims 1 to 6, or carries out a data processing method according to any one of claims 7 to 15, or carries out a data processing method according to any one of claims 16 to 22.
CN202010271152.0A 2020-04-08 2020-04-08 Data processing method and device, electronic equipment and computer readable medium Pending CN113326093A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010271152.0A CN113326093A (en) 2020-04-08 2020-04-08 Data processing method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010271152.0A CN113326093A (en) 2020-04-08 2020-04-08 Data processing method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN113326093A true CN113326093A (en) 2021-08-31

Family

ID=77412982

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010271152.0A Pending CN113326093A (en) 2020-04-08 2020-04-08 Data processing method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN113326093A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114116577A (en) * 2022-01-29 2022-03-01 南京沁恒微电子股份有限公司 Method and system for uploading data in real time through USB virtual serial port and USB host
CN116401017A (en) * 2023-04-13 2023-07-07 摩尔线程智能科技(北京)有限责任公司 Method, device, equipment and storage medium for realizing virtual display card

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114116577A (en) * 2022-01-29 2022-03-01 南京沁恒微电子股份有限公司 Method and system for uploading data in real time through USB virtual serial port and USB host
CN116401017A (en) * 2023-04-13 2023-07-07 摩尔线程智能科技(北京)有限责任公司 Method, device, equipment and storage medium for realizing virtual display card
CN116401017B (en) * 2023-04-13 2023-11-21 摩尔线程智能科技(北京)有限责任公司 Method, device, equipment and storage medium for realizing virtual display card

Similar Documents

Publication Publication Date Title
CN107766148B (en) Heterogeneous cluster and task processing method and device
EP3161628B1 (en) Intelligent gpu scheduling in a virtualization environment
US20130174144A1 (en) Hardware based virtualization system
US20130055254A1 (en) Methods and apparatuses for providing a virtual machine with dynamic assignment of a physical hardware resource
US11157302B2 (en) Idle processor management in virtualized systems via paravirtualization
CN112148422A (en) IO processing method and device
CN103034524A (en) Paravirtualized virtual GPU
Gu et al. GaiaGPU: Sharing GPUs in container clouds
WO2019072208A1 (en) Application running control method and device
CN113326093A (en) Data processing method and device, electronic equipment and computer readable medium
WO2023179388A1 (en) Hot migration method for virtual machine instance
US20220050795A1 (en) Data processing method, apparatus, and device
CN113419845A (en) Calculation acceleration method and device, calculation system, electronic equipment and computer readable storage medium
CN114691286A (en) Server system, virtual machine creation method and device
WO2023066079A1 (en) Virtual machine resource allocation method and apparatus, medium and device
CN111209080A (en) Transparent transmission method for graphic processor
US20180203726A1 (en) Virtual machine migration method and apparatus
CN113886019B (en) Virtual machine creation method, device, system, medium and equipment
US11392512B2 (en) USB method and apparatus in a virtualization environment with multi-VM
CN116257320B (en) DPU-based virtualization configuration management method, device, equipment and medium
US20180052700A1 (en) Facilitation of guest application display from host operating system
CN105893112B (en) Data packet processing method and device in virtualization environment
US11249804B2 (en) Affinity based optimization of virtual persistent memory volumes
EP3244311A1 (en) Multiprocessor system and method for operating a multiprocessor system
US10606681B2 (en) Incremental dump with fast reboot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40058053

Country of ref document: HK