Data processing method, device and equipment and readable storage medium

By creating shared physical memory in the host and executing business application instruction sets in the virtual machine in the hypervisor, the problem of low running efficiency of Android emulators on Windows on ARM devices is solved, and more efficient data processing and resource utilization is achieved.

CN120104252APending Publication Date: 2025-06-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510161847.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-13
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing Android emulator cannot run Android applications normally when running on Windows on ARM devices, and the binary translation efficiency is low, the bit error rate is high, the calculation amount is huge, the system resources are too much, and the data interaction between the virtual machine and the host is low.

Method used

By creating shared physical memory in the host that can be read and written by the virtual machine and the hypervisor, the business application instruction set obtained by running business applications in the virtual machine is stored in the shared physical memory, and these instruction sets are obtained and executed through the hypervisor, the binary translation layer of the virtual machine is avoided.

Benefits of technology

It improves the execution efficiency and accuracy of the business application instruction set, reduces computing costs, avoids memory copying, and improves data transmission efficiency, thereby improving the performance of virtual machines running business applications in the host.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120104252A_ABST
    Figure CN120104252A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method, device and equipment and a readable storage medium, and the method comprises the steps: running a business application in a virtual machine, and obtaining a business application instruction set; the instruction type of the business application instruction set is an instruction type supported by a processor of the host machine; writing a service application instruction set in a virtual memory of the virtual machine into a shared physical memory in a virtual interaction device corresponding to the virtual machine, and generating writing notification information used for representing a writing completion state of the service application instruction set; the shared physical memory is a physical memory used for being jointly read and written by the virtual machine and the management program in the host machine; and in the management program, obtaining write-in notification information, obtaining the business application instruction set in the shared physical memory through the write-in notification information, and executing the business application instruction set through a processor of the host machine to obtain instruction execution data corresponding to the business application instruction set. By adopting the method and the device, the performance of running the business application by the virtual machine in the host machine can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and readable storage medium. Background Art

[0002] Because Android applications and computer devices have different operating systems, running Android applications on computer devices requires simulating the operation through a virtual machine (VM), namely an Android emulator. Existing Android emulators are all developed based on the Windows operating system (Windows) on the x86 architecture (CISC (Complex Instruction Set Computing), a complex instruction set architecture) using Virtual Box (a virtualization engine) as a virtualization solution, namely Windows on x86.

[0003] When the existing Android emulator is run on a Windows device with an x86 architecture, the Android emulator will first perform binary translation of the ARM instruction set generated by the Android application into an x86 instruction set to support the x86 instruction set platform, and then transmit the translated x86 instruction set to the Windows device through the Vsock (a virtual socket) protocol.

[0004] When the existing Android emulator runs on the ARM architecture (Advanced RISC (Reduced Instruction Set Computing) Machine, a reduced instruction set architecture), the ARM instruction set will still be binary translated into the x86 instruction set, but the ARM architecture processor cannot execute the x86 instruction set, which makes the existing Android emulator unable to run Android applications on Windows on ARM devices, and the binary translation efficiency is low, the bit error rate is high, and the calculation amount is huge. The existing Android emulator needs to occupy a large amount of system resources when running. At the same time, the data interaction between the virtual machine and the host machine is carried out through the Vsock protocol, which has low transmission speed and high latency. Summary of the invention

[0005] The embodiments of the present application provide a data processing method, apparatus, device and readable storage medium, which can improve the performance of a virtual machine in a host machine running a business application.

[0006] On one hand, an embodiment of the present application provides a data processing method, which is executed by a host machine, the host machine includes a virtual machine and a hypervisor, the operating system of the host machine and the operating system of the virtual machine are different from each other, and the hypervisor is run based on the operating system of the host machine; the data processing method includes:

[0007] Running the business application in the virtual machine to obtain a business application instruction set; the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine;

[0008] Writing the business application instruction set in the virtual memory of the virtual machine to the shared physical memory in the virtual interactive device corresponding to the virtual machine, and generating write notification information for representing the write completion status of the business application instruction set; the shared physical memory is the physical memory in the host machine used for being read and written by the virtual machine and the hypervisor;

[0009] In the management program, write notification information is obtained, and a business application instruction set is obtained in the shared physical memory through the write notification information. The business application instruction set is executed by the processor of the host machine to obtain instruction execution data corresponding to the business application instruction set.

[0010] Among them, it also includes:

[0011] Perform kernel compilation on the kernel code of the operating system of the host machine and the kernel code of the processor to obtain kernel compiled code;

[0012] Based on the kernel compilation code, a virtualization engine is generated for compatibility with the instruction types of the operating system of the host machine and the instruction types supported by the processor;

[0013] Based on the virtualization engine, a virtual machine and a hypervisor are created in the host machine, configuration information corresponding to the virtual machine is obtained, and based on the configuration information, the hardware device of the host machine is virtualized to obtain a virtual interactive device for data interaction with the host machine.

[0014] Among them, it also includes:

[0015] Obtaining a memory offset corresponding to a base address register in a virtual interactive device through a hypervisor; the memory offset is an offset between a virtual memory of a virtual machine and a virtual memory of a host machine;

[0016] Acquire a first memory page table for representing a memory mapping relationship between a virtual memory of a virtual machine and a physical memory of the virtual machine, and acquire a second memory page table for representing a memory mapping relationship between a virtual memory of a host machine and a physical memory of the host machine;

[0017] Generate a third memory page table for representing a memory mapping relationship between a virtual memory of the virtual machine and a virtual memory of the host machine based on the memory offset, the first memory page table, and the second memory page table;

[0018] The virtual machine determines a memory area in the physical memory of the virtual interactive device, and determines the third memory page table and the memory area as a shared physical memory for reading and writing by the virtual machine and the hypervisor.

[0019] Among them, it also includes:

[0020] In the virtual machine, a memory sharing request is generated, the memory sharing request is written into a memory mapping register corresponding to the virtual interactive device, and a virtual machine exit event is generated according to the memory sharing request in the memory mapping register; the virtual machine exit event is used to transfer the access control authority of the virtual machine for the virtual interactive device to the hypervisor;

[0021] Obtain the memory offset corresponding to the base address register in the virtual interactive device through the hypervisor, including:

[0022] In the hypervisor, a memory sharing request is obtained through a memory mapping register, a shared memory function is called through the memory sharing request, and a virtual machine exit event is processed through the shared memory function to obtain access control permissions for a virtual interactive device, and a memory offset is obtained in a base address register of the virtual interactive device based on the access control permissions.

[0023] Among them, it also includes:

[0024] In the virtual machine, writing the write notification information to the memory mapping register corresponding to the virtual interactive device, generating a virtual machine exit event according to the write notification information in the memory mapping register; the virtual machine exit event is used to transfer the virtual machine's access control authority for the virtual interactive device to the hypervisor;

[0025] In the hypervisor, write notification information is obtained, and a business application instruction set is obtained in the shared physical memory through the write notification information, including:

[0026] In the hypervisor, write notification information is obtained through memory mapping registers, shared memory functions are called through the write notification information, and virtual machine exit events are processed through the shared memory functions to obtain access control permissions for virtual interactive devices. Based on the access control permissions and the write notification information, a business application instruction set is obtained in the shared physical memory of the virtual interactive device.

[0027] The write notification information includes register parameters of the business application instruction set in the shared physical memory; based on the access control authority and the write notification information, the business application instruction set is obtained in the shared physical memory of the virtual interactive device, including:

[0028] Obtaining register parameters in the write notification information, and determining a first virtual address of the service application instruction set in the virtual memory of the virtual machine based on the register parameters;

[0029] Mapping and converting the first virtual address based on the third memory page table to obtain a second virtual address corresponding to the service application instruction set in the virtual memory of the host machine;

[0030] The second virtual address is mapped and converted based on the second memory page table to obtain a first physical address of the business application instruction set in the shared physical memory, and the business application instruction set is obtained in the host machine based on the first physical address.

[0031] The shared physical memory is a ring buffer, and the ring buffer includes a head pointer and a tail pointer; after writing the business application instruction set in the virtual memory of the virtual machine to the shared physical memory corresponding to the virtual interactive device, the method further includes:

[0032] In the virtual machine, based on the physical address of the business application instruction set in the ring buffer and the tail parameter value corresponding to the tail pointer, an updated parameter value of the tail pointer is generated;

[0033] Obtain the business application instruction set in the shared physical memory by writing notification information, including:

[0034] In the management program, by writing notification information, the update parameter value and the header parameter value corresponding to the head pointer are obtained in the ring buffer, based on the update parameter value and the header parameter value, the buffer area is determined in the ring buffer, and the business application instruction set is obtained in the buffer area.

[0035] Wherein, after writing the service application instruction set in the virtual memory of the virtual machine into the shared physical memory of the virtual interactive device corresponding to the virtual machine, it includes:

[0036] Writing the service application instruction set into the virtual memory of the virtual machine to obtain a third virtual address of the service application instruction set in the virtual memory of the virtual machine;

[0037] Mapping and converting the third virtual address based on the first memory page table to obtain a second physical address of the business application instruction set in the shared physical memory, and writing the business application instruction set into the shared physical memory in the virtual interactive device based on the second physical address;

[0038] When the business application instruction set is completely written into the shared physical memory, write notification information is generated to indicate the write completion status of the business application instruction set.

[0039] Among them, it also includes:

[0040] Writing instruction execution data in the virtual memory of the host machine to the shared physical memory corresponding to the virtual interactive device, generating an interrupt request for the virtual interactive device, and sending the interrupt request to the virtual machine through the virtual interactive device;

[0041] In the virtual machine, a dormant thread corresponding to the virtual machine is executed based on an interrupt request, instruction execution data is obtained in a shared physical memory through the dormant thread, and an execution result of a business application instruction set of the business application is determined based on the instruction execution data.

[0042] The business application is run in the virtual machine to obtain a business application instruction set, including:

[0043] Running the business application through the virtual interactive device corresponding to the virtual machine, obtaining a graphics rendering request initiated by the business application calling the graphics rendering interface, encoding the graphics rendering request by byte stream, and obtaining a business application instruction set; the graphics rendering request includes graphics data;

[0044] The processor of the host machine executes the business application instruction set to obtain instruction execution data corresponding to the business application instruction set, including:

[0045] The business application instruction set is decoded by byte stream to obtain a graphics rendering request, and the graphics data in the graphics rendering request is rendered by a processor to obtain rendered data, and the rendered data is determined as instruction execution data corresponding to the business application instruction set.

[0046] Among them, it also includes:

[0047] If the data volume of the business application instruction set is greater than or equal to the data transmission threshold, executing the step of writing the business application instruction set in the virtual memory of the virtual machine into the shared physical memory of the virtual interactive device corresponding to the virtual machine;

[0048] If the data volume of the business application instruction set is less than the data transmission threshold and the read and write load status of the virtual interactive device meets the parallel transmission conditions, a communication connection relationship with the host machine is established based on the socket protocol, and the business application instruction set is sent to the host machine through the communication connection relationship.

[0049] The virtual interactive device includes a virtual audio and video processing component and a virtual sensor component; the hardware device of the host machine is virtualized to obtain the virtual interactive device corresponding to the virtual machine, including:

[0050] The audio and video processing component of the host machine is virtualized to obtain a virtual audio and video processing component, and the sensor component of the host machine is virtualized to obtain a virtual sensor component.

[0051] The processor of the host machine executes the business application instruction set to obtain instruction execution data corresponding to the business application instruction set, including:

[0052] If the business application instruction set is used to perform playback processing for audio and video data, then based on the processor of the host machine, the audio and video processing component corresponding to the virtual audio and video processing component is called, the audio and video data is played based on the audio and video processing component, and the feedback information of the played audio and video data is determined as the instruction execution data corresponding to the business application instruction set;

[0053] If the business application instruction set is used to obtain sensor information, based on the processor of the host machine, the sensor component corresponding to the virtual sensor component is called, and the sensor information in the sensor component is determined as instruction execution data corresponding to the business application instruction set.

[0054] In one aspect, an embodiment of the present application provides a data processing device, which is applied to a host machine, wherein the host machine includes a virtual machine and a hypervisor, wherein an operating system of the host machine and an operating system of the virtual machine are different from each other, and the hypervisor is run based on the operating system of the host machine; the data processing device includes:

[0055] An instruction set generation module is used to run the business application in the virtual machine to obtain the business application instruction set; the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine;

[0056] An instruction set sharing module is used to write the business application instruction set in the virtual memory of the virtual machine to the shared physical memory in the virtual interactive device corresponding to the virtual machine, and generate write notification information for representing the write completion status of the business application instruction set; the shared physical memory is the physical memory in the host machine that is used to be read and written by the virtual machine and the hypervisor;

[0057] The instruction set processing module obtains write notification information in the management program, obtains the business application instruction set in the shared physical memory through the write notification information, executes the business application instruction set through the processor of the host machine, and obtains the instruction execution data corresponding to the business application instruction set.

[0058] In a possible implementation, the instruction set generation module is further configured to perform the following operations:

[0059] Perform kernel compilation on the kernel code of the operating system of the host machine and the kernel code of the processor to obtain kernel compiled code;

[0060] Based on the kernel compilation code, a virtualization engine is generated for compatibility with the instruction types of the operating system of the host machine and the instruction types supported by the processor;

[0061] Based on the virtualization engine, a virtual machine and a hypervisor are created in the host machine, configuration information corresponding to the virtual machine is obtained, and based on the configuration information, the hardware device of the host machine is virtualized to obtain a virtual interactive device for data interaction with the host machine.

[0062] In a possible implementation, the instruction set generation module is further configured to perform the following operations:

[0063] Obtaining a memory offset corresponding to a base address register in a virtual interactive device through a hypervisor; the memory offset is an offset between a virtual memory of a virtual machine and a virtual memory of a host machine;

[0064] Acquire a first memory page table for representing a memory mapping relationship between a virtual memory of a virtual machine and a physical memory of the virtual machine, and acquire a second memory page table for representing a memory mapping relationship between a virtual memory of a host machine and a physical memory of the host machine;

[0065] Generate a third memory page table for representing a memory mapping relationship between a virtual memory of the virtual machine and a virtual memory of the host machine based on the memory offset, the first memory page table, and the second memory page table;

[0066] The virtual machine determines a memory area in the physical memory of the virtual interactive device, and determines the third memory page table and the memory area as a shared physical memory for reading and writing by the virtual machine and the hypervisor.

[0067] In a possible implementation, the instruction set generation module is further configured to perform the following operations:

[0068] In the virtual machine, a memory sharing request is generated, the memory sharing request is written into a memory mapping register corresponding to the virtual interactive device, and a virtual machine exit event is generated according to the memory sharing request in the memory mapping register; the virtual machine exit event is used to transfer the access control authority of the virtual machine for the virtual interactive device to the hypervisor;

[0069] When the instruction set generation module is used to obtain the memory offset corresponding to the base address register in the virtual interactive device through the management program, it is specifically used to perform the following operations:

[0070] In the hypervisor, a memory sharing request is obtained through a memory mapping register, a shared memory function is called through the memory sharing request, and a virtual machine exit event is processed through the shared memory function to obtain access control permissions for a virtual interactive device, and a memory offset is obtained in a base address register of the virtual interactive device based on the access control permissions.

[0071] In a possible implementation, the instruction set sharing module is further used to perform the following operations:

[0072] In the virtual machine, writing the write notification information to the memory mapping register corresponding to the virtual interactive device, generating a virtual machine exit event according to the write notification information in the memory mapping register; the virtual machine exit event is used to transfer the virtual machine's access control authority for the virtual interactive device to the hypervisor;

[0073] The instruction set sharing module is used to obtain write notification information in the hypervisor. When obtaining the business application instruction set in the shared physical memory through the write notification information, it is specifically used to perform the following operations:

[0074] In the hypervisor, write notification information is obtained through memory mapping registers, shared memory functions are called through the write notification information, and virtual machine exit events are processed through the shared memory functions to obtain access control permissions for virtual interactive devices. Based on the access control permissions and the write notification information, a business application instruction set is obtained in the shared physical memory of the virtual interactive device.

[0075] In a possible implementation, the instruction set sharing module is used to write notification information including register parameters of the business application instruction set in the shared physical memory; based on the access control authority and the write notification information, when obtaining the business application instruction set in the shared physical memory of the virtual interactive device, it is specifically used to perform the following operations:

[0076] Obtaining register parameters in the write notification information, and determining a first virtual address of the service application instruction set in the virtual memory of the virtual machine based on the register parameters;

[0077] Mapping and converting the first virtual address based on the third memory page table to obtain a second virtual address corresponding to the service application instruction set in the virtual memory of the host machine;

[0078] The second virtual address is mapped and converted based on the second memory page table to obtain a first physical address of the business application instruction set in the host machine, and the business application instruction set is obtained in the shared physical memory based on the first physical address.

[0079] In a possible implementation, the shared physical memory is a ring buffer, and the ring buffer includes a head pointer and a tail pointer; the instruction set sharing module is further used to perform the following operations:

[0080] In the virtual machine, based on the physical address of the business application instruction set in the ring buffer and the tail parameter value corresponding to the tail pointer, an updated parameter value of the tail pointer is generated;

[0081] The instruction set sharing module is used to obtain the business application instruction set in the shared physical memory by writing notification information, and is specifically used to perform the following operations:

[0082] In the management program, by writing notification information, the update parameter value and the header parameter value corresponding to the head pointer are obtained in the ring buffer, based on the update parameter value and the header parameter value, the buffer area is determined in the ring buffer, and the business application instruction set is obtained in the buffer area.

[0083] In a possible implementation, the instruction set sharing module is used to write the business application instruction set in the virtual memory of the virtual machine to the shared physical memory in the virtual interactive device corresponding to the virtual machine, and when generating write notification information for representing the write completion status of the business application instruction set, specifically to perform the following operations:

[0084] Writing the service application instruction set into the virtual memory of the virtual machine to obtain a third virtual address of the service application instruction set in the virtual memory of the virtual machine;

[0085] Mapping and converting the third virtual address based on the first memory page table to obtain a second physical address of the business application instruction set in the shared physical memory, and writing the business application instruction set into the shared physical memory in the virtual interactive device based on the second physical address;

[0086] When the business application instruction set is completely written into the shared physical memory, write notification information is generated to indicate the write completion status of the business application instruction set.

[0087] In a possible implementation, the instruction set processing module is further configured to perform the following operations:

[0088] Writing instruction execution data in the virtual memory of the host machine to the shared physical memory corresponding to the virtual interactive device, generating an interrupt request for the virtual interactive device, and sending the interrupt request to the virtual machine through the virtual interactive device;

[0089] In the virtual machine, a dormant thread corresponding to the virtual machine is executed based on an interrupt request, instruction execution data is obtained in a shared physical memory through the dormant thread, and an execution result of a business application instruction set of the business application is determined based on the instruction execution data.

[0090] In a possible implementation, the instruction set generation module is used to run the business application in the virtual machine, and when the business application instruction set is obtained, it is specifically used to perform the following operations:

[0091] Running the business application through the virtual interactive device corresponding to the virtual machine, obtaining a graphics rendering request initiated by the business application calling the graphics rendering interface, encoding the graphics rendering request by byte stream, and obtaining a business application instruction set; the graphics rendering request includes graphics data;

[0092] The instruction set execution module is used to execute the business application instruction set through the processor of the host machine, and when the instruction execution data corresponding to the business application instruction set is obtained, it is specifically used to perform the following operations:

[0093] The business application instruction set is decoded by byte stream to obtain a graphics rendering request, and the graphics data in the graphics rendering request is rendered by a processor to obtain rendered data, and the rendered data is determined as instruction execution data corresponding to the business application instruction set.

[0094] In a possible implementation, the instruction set sharing module is further used to perform the following operations:

[0095] If the data volume of the business application instruction set is greater than or equal to the data transmission threshold, executing the step of writing the business application instruction set in the virtual memory of the virtual machine into the shared physical memory of the virtual interactive device corresponding to the virtual machine;

[0096] If the data volume of the business application instruction set is less than the data transmission threshold and the read and write load status of the virtual interactive device meets the parallel transmission conditions, a communication connection relationship with the host machine is established based on the socket protocol, and the business application instruction set is sent to the host machine through the communication connection relationship.

[0097] In a possible implementation, the virtual interactive device includes a virtual audio and video processing component and a virtual sensor component; the instruction set generation module is used to virtualize the hardware device of the host machine, and when obtaining the virtual interactive device corresponding to the virtual machine, it is specifically used to perform the following operations:

[0098] Virtualizing the audio and video processing component of the host machine to obtain a virtual audio and video processing component, and virtualizing the sensor component of the host machine to obtain a virtual sensor component;

[0099] The instruction set execution module is used to execute the business application instruction set through the processor of the host machine, and when the instruction execution data corresponding to the business application instruction set is obtained, it is specifically used to perform the following operations:

[0100] If the business application instruction set is used to perform playback processing for audio and video data, then based on the processor of the host machine, the audio and video processing component corresponding to the virtual audio and video processing component is called, the audio and video data is played based on the audio and video processing component, and the feedback information of the played audio and video data is determined as the instruction execution data corresponding to the business application instruction set;

[0101] If the business application instruction set is used to obtain sensor information, based on the processor of the host machine, the sensor component corresponding to the virtual sensor component is called, and the sensor information in the sensor component is determined as instruction execution data corresponding to the business application instruction set.

[0102] On the one hand, an embodiment of the present application provides a computer device, including: a processor, a memory, and a network interface;

[0103] The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, and the memory is used to store a computer program. When the computer program is executed by the processor, the computer device executes the method provided in the embodiment of the present application.

[0104] On the one hand, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program is suitable for being loaded and executed by a processor so that a computer device having the processor executes the method provided by the embodiment of the present application.

[0105] In one aspect, an embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the method provided in the embodiment of the present application.

[0106] The embodiment of the present application can store the business application instruction set obtained by running the business application in the virtual machine into the shared physical memory by creating a physical memory (i.e., shared physical memory) in the host machine that can be read and written by the virtual machine and the hypervisor. After the business application instruction set is completely written into the shared physical memory, the virtual machine can generate a write notification message. In the hypervisor, the business application instruction set can be obtained in the shared physical memory by writing the notification message. Since the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine, the hypervisor can execute the business application instruction set through the processor of the host machine to obtain the instruction execution data corresponding to the business application instruction set. It can be seen that the embodiment of the present application can pass the native business application instruction set to the hypervisor by creating a physical memory that can be read and written by both the virtual machine and the hypervisor when the instruction type of the business application instruction set is consistent with the instruction type supported by the processor of the host machine, and the native business application instruction set can be executed by the processor of the host machine, thereby improving the execution efficiency and accuracy of the business application instruction set. There is no need for the binary translation layer of the virtual machine to perform binary translation on the instruction set, which avoids the compatibility problems caused by binary translation and reduces the computing cost. At the same time, by sharing physical memory to exchange data for business application instruction sets, virtual machines and hypervisors access the same physical memory, avoiding memory copying, improving data transmission efficiency, and thus improving the performance of business applications running in virtual machines in the host machine. BRIEF DESCRIPTION OF THE DRAWINGS

[0107] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0108] Figure 1 This is a schematic diagram of a network architecture provided by an embodiment of the present application;

[0109] Figure 2 This is a data processing scenario provided by the embodiment of the present application. Figure 1 ;

[0110] Figure 3 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 1 ;

[0111] Figure 4 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 2 ;

[0112] Figure 5 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 3 ;

[0113] Figure 6 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 4 ;

[0114] Figure 7 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 5 ;

[0115] Figure 8 This is a data processing scenario provided by the embodiment of the present application. Figure 2 ;

[0116] Fig. 9 This is a data processing scenario provided by the embodiment of the present application. Figure 3 ;

[0117] Fig.10 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 6 ;

[0118] Fig.11 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0119] Fig.12 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0120] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0121] See also Figure 1 , Figure 1 Schematic diagram of a network architecture provided by an embodiment of the present application. Figure 1As shown, the network architecture may include a host machine 100 and a business server 200, wherein the host machine 100 includes a virtual machine 101 and a management program 102 for controlling the virtual machine 101, and there is a communication connection between the host machine 100 and the business server 200, and the communication connection does not limit the connection method, and can be directly or indirectly connected through a wired communication method, or directly or indirectly connected through a wireless communication method, or through other methods, which are not limited in this application.

[0122] The host machine 100 may include: smart phones, tablet computers, laptop computers, desktop computers, intelligent voice interaction devices, smart home appliances (e.g., smart TVs), wearable devices, vehicle terminals, aircraft, and other smart terminals with data processing functions. The vehicle terminals may be terminal devices in smart traffic scenarios and assisted driving scenarios. It should be understood that when the virtual machine 101 runs on the host machine 100, it can communicate with the above-mentioned virtual machines through the hypervisor 102. Figure 1 The business servers 200 shown perform data interaction.

[0123] like Figure 1 As shown, the host machine 100 can create a virtual machine 101 and a hypervisor 102 through a virtualization engine, and the hypervisor is run based on the operating system of the host machine. The host machine 100 can virtualize the hardware devices of the host machine 100 through configuration information to create virtual hardware devices corresponding to the virtual machine 101. Among them, the virtualization engine is used to simulate multiple independent virtual operating environments on the host machine 100, and the virtual operating environment is the above-mentioned virtual machine. The virtual hardware device is a virtual resource obtained by the virtualization engine by virtualizing the hardware devices of the host machine 100. The host machine 100 can determine a virtual interactive device for data interaction with the host machine in the virtual hardware device, and the virtual interactive device can also be called a virtual PCI (Peripheral Component Interconnect, Peripheral Component Interconnect Standard) device. Among them, the hypervisor is a program running on the host machine operating system for managing and coordinating the operation of virtual machines, such as for implementing functions such as management of virtual machine interfaces, device communications, and data rendering.

[0124] It is understood that the physical memory of the virtual hardware device may be a portion of the physical memory in the host machine 100, and the physical memory of the virtual hardware device is the physical memory of the virtual machine. The virtual interaction device may include a portion of the physical memory in the virtual hardware device and a processing unit or register for implementing data interaction. The virtual memory mapped by the physical memory of the virtual hardware device in the virtual machine is the virtual memory of the virtual machine.

[0125] The virtual machine 101 can run an operating system different from the host machine 100. For example, the operating system of the host machine can be a Windows system, a macOS system (a dedicated command line system), etc., and the operating system of the virtual machine can be a Linux system (an open source command line system), an Android system (Android system), a Chrome system (a browser system), etc. For ease of understanding, the operating system of the virtual machine is an Android system as an example for explanation. The host machine 100 can run business applications supported by the Android system, that is, Android applications, in the virtual machine 101. When the business application runs in the virtual machine 101, the business application instruction set corresponding to the business application can be obtained, and the virtual machine 101 can pass the business application instruction set to the hypervisor 102 through the virtual interactive device.

[0126] The hypervisor 102 can execute the acquired business application instruction set through the processor of the host machine 100. For example, the business application instruction set may include a network access request. The processor of the host machine 100 can execute the network access request to communicate with the business server 200 over the network, and obtain response data from the business server 200 to the network access request. The host machine 100 can pass the response data to the virtual machine 101 through the virtual interaction device, so that in the virtual machine 101, the request result of the business application is determined through the response data.

[0127] The embodiment of the present application can expand the application mode of the host machine by creating a virtual machine different from the host machine operating system in the host machine. At the same time, the virtual machine can use the more powerful hardware resources of the host machine, so as to better support the operation of business applications. The virtual machine can simulate different hardware performances and test the performance of business applications under different hardware conditions. In addition, the host machine can create several virtual machines to run business applications in parallel, and assign different tasks to the business applications run by each virtual machine, thereby improving resource utilization and business flexibility and reducing the time cost of business application execution tasks.

[0128] See also Figure 2 , Figure 2 This is a data processing scenario provided by an embodiment of the present application. Figure 1 .like Figure 2 As shown, the host machine can be the above Figure 1 The host machine 100 of the corresponding embodiment, wherein the operating system of the host machine may be a Windows system, and the architecture of the processor of the host machine may be an ARM architecture, an x86 architecture, a VLIW (Very Long Instruction Word) architecture, etc., which is not limited in the embodiments of the present application.

[0129] For ease of understanding, the host machine's processor architecture is ARM architecture as an example. The host machine can create virtual machines and hypervisors through a virtualization engine, where the hypervisor is a program running on the host machine's operating system for managing and coordinating the operation of virtual machines, such as for implementing management of virtual machine interfaces, device communications, data rendering and other functions. The host machine can virtualize the host machine's hardware devices through configuration information, for example, it can virtualize cameras, sensors and hardware video decoders to obtain virtual hardware devices corresponding to the virtual machines. Among them, virtualization refers to simulating the functions of physical hardware devices through software technology, or by directly accessing and calling physical hardware devices to realize the functions of the physical hardware devices.

[0130] The host machine can determine the virtual interaction device for data interaction with the host machine in the virtual hardware device. Among them, the virtualization engine can be an HCS (Host Compute System) engine, an engine that supports the creation of an Android operating environment of Hyper-V (a virtualization technology) under the ARM architecture. The operating system of the virtual machine can be an Android system. The configuration information can include the size of the physical memory corresponding to the virtual machine, the number of virtual processors, and the path of the virtual disk.

[0131] The host machine can start the virtual machine through the management program. The virtual machine can include several applications, such as photo albums, weather, business applications, etc. The applications in the virtual machine can all be Android applications. For ease of understanding, the business application can be a game application as an example. The host machine can start the business application through the virtual machine. When the business application runs in the virtual machine, the business application instruction set corresponding to the business application can be obtained. The virtual machine can pass the business application instruction set to the management program through the virtual interactive device. Among them, the business application instruction set can be an ARM instruction set, which can include the logical instructions necessary for the operation of the business application (such as basic arithmetic, conditional judgment, etc.), and the request of the virtual interactive device called by the business application, such as graphics rendering request, voice recording request, etc.

[0132] The hypervisor can obtain the business application instruction set and execute the business application instruction set through the processor of the host machine. For example, when the business application instruction set is a graphics rendering request, the processor of the host machine can call the graphics processor of the host machine through the graphics rendering request, and the graphics processor performs graphics rendering on the graphics data in the graphics rendering request to obtain rendered data. The host machine can pass the rendered data to the virtual machine through the virtual interactive device, and the rendered data can be displayed through the business application in the virtual machine to obtain the game display screen of the business application.

[0133] The embodiment of the present application can run a variety of Android applications and games in the host machine, which can meet the diverse needs of users. Through virtualization technology, it supports functions such as cameras, sensors, and hardware video decoders, ensuring the same experience as mobile devices, avoiding the problem of incomplete or incompatible functions. At the same time, the present application can forward the graphics rendering request of the virtual machine to the hypervisor, and call the host machine's processor through the hypervisor to perform more efficient graphics rendering, thereby improving the efficiency and performance of graphics rendering.

[0134] It can be understood that the virtual machine proposed in the embodiment of the present application can be an Android emulator that supports the ARM architecture, and the user can operate the Android application through the mouse and keyboard. By implementing a virtual interactive device based on the PCI protocol, the present application allows the virtual machine and the hypervisor to access the same physical memory, avoiding memory copying, improving data transmission efficiency, and thus enabling more intelligent resource management, reducing system resource usage, and extending battery life. Users can adjust the system mode, set the resolution and performance model of the virtual machine, etc. through the hypervisor to meet the diverse needs of users.

[0135] See also Figure 3 , Figure 3 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 1 The data processing method can be executed by a host machine, which can be Figure 1 The host machine 100 shown in FIG. 100 is shown in FIG. 101 . The data processing method is executed by the host machine as an example for description. The data processing method may include at least the following steps S101 to S103:

[0136] Step S101, running a business application in a virtual machine to obtain a business application instruction set; the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine;

[0137] Specifically, the host machine may include the created virtual machine and a hypervisor for controlling the virtual machine. The hypervisor is a program running on the host machine operating system for managing and coordinating the operation of the virtual machine, such as for implementing functions such as managing the virtual machine interface, device communication, and data rendering.

[0138] For ease of understanding, the host machine's operating system is Windows system, and the host machine's processor architecture is ARM architecture. The virtual machine's operating system is Android system for example. The host machine can virtualize the host machine's hardware devices through configuration information to obtain virtual hardware devices corresponding to the virtual machine. Among them, the configuration information may include the size of the physical memory corresponding to the virtual machine, the number of virtual processors, and the path of the virtual disk. Virtual hardware devices refer to virtual resources simulated by virtualization technology, which are used to simulate the functions of physical hardware devices, or to implement the functions of the physical hardware devices by directly accessing and calling physical hardware devices.

[0139] The host machine can determine a virtual interactive device in the virtual hardware device for data interaction with the host machine. The virtual interactive device can include a portion of the physical memory in the virtual hardware device and a processing unit or register for data interaction. The virtual interactive device can implement data exchange and communication between the virtual machine and the host machine based on the PCI protocol.

[0140] It is understood that the physical memory of the virtual hardware device can be a part of the physical memory of the host machine, and the physical memory of the virtual hardware device is the physical memory of the virtual machine. The virtual interactive device can include a part of the physical memory of the virtual hardware device and a processing unit or register for realizing data interaction. The virtual memory mapped by the physical memory of the virtual hardware device in the virtual machine is the virtual memory of the virtual machine.

[0141] The host machine can run the business application (e.g., the business application can be an Android application of ARM architecture) through the virtual hardware device corresponding to the virtual machine to obtain the business application instruction set. The instruction type of the business application instruction set is the instruction type supported by the processor of the host machine, for example, the business application instruction set can be an ARM instruction set.

[0142] Step S102, writing the business application instruction set in the virtual memory of the virtual machine into the shared physical memory in the virtual interactive device corresponding to the virtual machine, and generating write notification information for representing the write completion status of the business application instruction set; the shared physical memory is the physical memory in the host machine used for being read and written by the virtual machine and the hypervisor;

[0143] Specifically, the virtual machine can determine a portion of the memory area in the physical memory of the virtual interactive device, and map a portion of the virtual memory of the host machine and a portion of the virtual memory of the virtual machine to the memory area, thereby obtaining a physical memory that can be read and written by the virtual machine and the hypervisor. The memory area can also be referred to as a shared physical memory, and the data structure of the shared physical memory can be an array, such as a lock-free ring buffer (Ring Buffer), or a queue (Queue), which is not limited in the embodiments of the present application.

[0144] In a virtual machine, the virtual machine can write a business application instruction set into the virtual memory of the virtual machine, and write the business application instruction set in the virtual memory of the virtual machine into the shared physical memory corresponding to the virtual interactive device. When the business application instruction set is completely written into the shared physical memory, the virtual machine can generate a write notification message. The write notification message is used to characterize the write completion status of the business application instruction set. For example, the virtual machine can pass the write notification message to the host machine by reading and writing a memory-mapped input output (MMIO). The memory-mapped register can be a register in the virtual interactive device used for data exchange between the host machine and the virtual machine.

[0145] Step S103, in the management program, obtain write notification information, obtain the business application instruction set in the shared physical memory through the write notification information, execute the business application instruction set through the processor of the host machine, and obtain instruction execution data corresponding to the business application instruction set.

[0146] Specifically, in the hypervisor, the hypervisor may obtain write notification information through a memory mapping register, the write notification information may include register parameters for indicating a physical address, and the hypervisor may obtain a business application instruction set in a shared physical memory through the register parameters in the write notification information.

[0147] Optionally, when the shared physical memory is a ring buffer, the ring buffer may maintain a head pointer (head) and a tail pointer (tail). The parameter value of the head pointer is used to indicate the read position of the ring buffer, and the parameter value of the tail pointer is used to indicate the write position of the ring buffer. When the virtual machine writes the business application instruction set to the shared physical memory, the virtual machine may write the business application instruction set to the position indicated by the tail parameter value corresponding to the tail pointer, and the virtual machine may move the tail pointer based on the data volume of the business application instruction set, that is, the virtual machine may generate an update parameter value of the tail pointer based on the data volume of the business application instruction set and the current tail parameter value. In the hypervisor, the hypervisor may obtain write notification information through a memory mapping register, and the write notification information may be used to indicate that the business application instruction set has been completely written into the ring buffer, and then the hypervisor may obtain the update parameter value and the head parameter value corresponding to the head pointer in the ring buffer, determine the buffer area in the ring buffer based on the update parameter value and the head parameter value, and obtain the business application instruction set in the buffer area. The address range of the buffer area is determined based on the update parameter value and the head parameter value.

[0148] After the hypervisor obtains the service application instruction set, the hypervisor may execute the service application instruction set through the processor of the host machine to obtain instruction execution data corresponding to the service application instruction set.

[0149] The embodiment of the present application can store the business application instruction set obtained by running the business application in the virtual machine into the shared physical memory by creating a physical memory (i.e., shared physical memory) in the host machine that can be read and written by the virtual machine and the hypervisor. After the business application instruction set is completely written into the shared physical memory, the virtual machine can generate a write notification message. In the hypervisor, the business application instruction set can be obtained in the shared physical memory by writing the notification message. Since the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine, the hypervisor can execute the business application instruction set through the processor of the host machine to obtain the instruction execution data corresponding to the business application instruction set. It can be seen that the embodiment of the present application can pass the native business application instruction set to the hypervisor by creating a physical memory that can be read and written by both the virtual machine and the hypervisor when the instruction type of the business application instruction set is consistent with the instruction type supported by the processor of the host machine, and the native business application instruction set can be executed by the processor of the host machine, thereby improving the execution efficiency and accuracy of the business application instruction set. There is no need for the binary translation layer of the virtual machine to perform binary translation on the instruction set, which avoids the compatibility problems caused by binary translation and reduces the computing cost. At the same time, by sharing physical memory to exchange data for business application instruction sets, virtual machines and hypervisors access the same physical memory, avoiding memory copying, improving data transmission efficiency, and thus improving the performance of business applications running in virtual machines in the host machine.

[0150] The host can create virtual machines and the virtual interactive devices corresponding to the virtual machines. For the process, see Figure 4 , Figure 4 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 2 The data processing method can be executed by a host machine, which can be Figure 1 The host machine 100 shown in FIG. 1 is a host machine 100. The following will take the data processing method executed by the host machine as an example for description. The data processing method may at least include the following steps S201 to S207:

[0151] Step S201, creating a virtual machine based on a virtual machine engine;

[0152] Specifically, the operating system of the host machine can be a Windows system, and the architecture of the processor of the host machine can be an ARM architecture. The host machine can perform kernel compilation on the kernel code of the operating system of the host machine and the kernel code of the processor to obtain the kernel compiled code, and adjust and optimize the Hyper-V virtualization technology through the kernel compiled code to generate a virtualization engine for being compatible with the instruction type of the operating system of the host machine and the instruction type supported by the processor. For example, the kernel code of the Hyper-V virtualization technology can be recompiled to enable it to support the ARM instruction set. Or a driver adapted to the ARM instruction set can be compiled, and the embodiments of the present application are not limited here.

[0153] For ease of understanding, the virtualization engine is taken as an example of the HCS engine. The HCS engine is an engine that supports the creation of the Hyper-V Android operating environment under the ARM architecture. The host can start the HCS engine to create a virtual machine and a hypervisor in the host. Among them, the HCS engine runs on the operating system of the host.

[0154] Step S202, obtaining configuration information;

[0155] Step S203, setting up a communication system based on the configuration information;

[0156] Specifically, the HCS engine may obtain configuration information, which may include the size of the physical memory corresponding to the virtual machine, the number of virtual processors, and the path of the virtual disk, etc. The HCS engine may set the communication system of the virtual machine based on the configuration information, for example, it may include setting a virtual switch, or establishing a communication connection relationship of the Vsock protocol (socket protocol) with the host machine, which is not limited in the embodiments of the present application.

[0157] Step S204, creating a virtual interactive device based on the configuration information;

[0158] Specifically, the HCS engine can virtualize the hardware devices of the host machine based on the configuration information to obtain virtual hardware devices corresponding to the virtual machine. Among them, virtualization refers to simulating the functions of physical hardware devices through software technology, or directly accessing and calling physical hardware devices to realize the functions of the physical hardware devices. Virtual hardware devices are virtual resources obtained by the HCS engine through virtualizing the hardware devices of the host machine, which are used to simulate the functions of physical hardware devices, or directly access and call physical hardware devices to realize the functions of physical hardware devices.

[0159] The host machine can determine a virtual interactive device in the virtual hardware device for data interaction with the host machine. The virtual interactive device can also be called a virtual PCI device. The virtual interactive device can include a portion of the physical memory in the virtual hardware device and a processing unit or register for data interaction. The virtual interactive device can realize data exchange and communication between the virtual machine and the host machine based on the PCI protocol.

[0160] It is understood that the physical memory of the virtual hardware device can be a part of the physical memory of the host machine, and the physical memory of the virtual hardware device is the physical memory of the virtual machine. The virtual interactive device can include a part of the physical memory of the virtual hardware device and a processing unit or register for realizing data interaction. The virtual memory mapped by the physical memory of the virtual hardware device in the virtual machine is the virtual memory of the virtual machine.

[0161] Step S205, starting the virtual machine;

[0162] Step S206, exception handling and retry;

[0163] Step S207: error diagnosis and repair.

[0164] Specifically, the HCS engine can start the virtual machine. If the virtual machine starts successfully, it means that the virtual machine and the virtual interactive device corresponding to the virtual machine are successfully created. If the virtual machine fails to start, the HCS engine can perform exception processing to check whether the configuration information in the virtual machine log data is wrong or whether the image file is damaged. The HCS engine can repair the configuration information or the image file, and after the repair is completed, recreate the virtual machine and perform the same steps as the above steps S201 to S207 until the virtual machine starts successfully.

[0165] The embodiment of the present application creates a virtual machine by supporting a virtualization engine of Windows on ARM architecture, and the virtual machine supports ARM processors, providing a new application and game operating environment for Windows on ARM device users. It not only broadens the application scope of Windows on ARM devices, but also significantly improves the user experience. The HCS engine is used to create an Android operating environment under the Hyper-V environment, providing the virtualization capabilities of the processor and memory. And a data transmission device of the PCI protocol, i.e., a virtual interactive device, is implemented. The virtual machine can drive the device through the device driver of the virtual interactive device to realize data exchange and communication with the host machine.

[0166] After the virtual machine and the virtual interactive device corresponding to the virtual machine are successfully created, the virtual machine can request to establish shared physical memory with the host machine. For the process, see Figure 5 , Figure 5 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 3 The data processing method can be jointly executed by a virtual machine and a hypervisor in a host machine, and the host machine can be as follows Figure 1 The host machine 100 shown in FIG. 1 and the virtual machine 100 may be as follows: Figure 1 The virtual machine 101 shown, the hypervisor can be such as Figure 1 The hypervisor 102 shown. The following will take the data processing method being executed by the virtual machine and the hypervisor in the host machine as an example for explanation. The data processing method may at least include the following steps S301-S305:

[0167] Step S301, the virtual machine initiates a memory sharing request;

[0168] Specifically, in a virtual machine, the virtual machine can generate a memory sharing request, which is used to realize memory sharing with a host machine through a virtual interactive device. The virtual machine can read and write a memory mapping register (MMIO) in the virtual interactive device to interact with a device driver (Driver) of the virtual interactive device. For example, the virtual machine can write a memory sharing request to a memory mapping register corresponding to the virtual interactive device, wherein the memory mapping register can be a register used for data interaction between the host machine and the virtual machine.

[0169] The virtual machine can generate a virtual machine exit event (VM_EXIT) through a memory sharing request in a memory mapping register, wherein the virtual machine exit event is used to transfer the access control authority of the virtual machine to the virtual interactive device to the hypervisor in the host machine.

[0170] Step S302, reading and writing the corresponding memory mapping register;

[0171] Step S303, processing a virtual machine exit event;

[0172] Step S304, obtaining the memory offset in the base address register;

[0173] Specifically, in the hypervisor, the hypervisor can obtain a memory sharing request through a memory mapping register, call a shared memory function through the memory sharing request, and process a virtual machine exit event through the shared memory function, thereby obtaining the access control permission for the virtual interactive device, and obtaining a memory offset in a base address register (BAR) of the virtual interactive device based on the access control permission. The memory offset is the offset between the virtual memory of the virtual machine and the virtual memory of the host machine.

[0174] Step S305, establishing a memory mapping relationship.

[0175] Specifically, in the hypervisor, the hypervisor can obtain a first memory page table for representing the memory mapping relationship between the virtual memory of the virtual machine and the physical memory of the virtual machine, and obtain a second memory page table for representing the memory mapping relationship between the virtual memory of the host machine and the physical memory of the host machine. Among them, the memory page table (Memory PageTable) is used to coordinate with the memory management unit (MMU) to convert one address mapping to another address. For example, the virtual address of the virtual machine can be mapped and converted to obtain the address corresponding to the virtual address of the virtual machine in the physical memory of the virtual machine.

[0176] The hypervisor can generate a third memory page table for characterizing the memory mapping relationship between the virtual memory of the virtual machine and the virtual memory of the host machine based on the memory offset, the first memory page table and the second memory page table, determine the memory area in the physical memory of the virtual interactive device, and determine the third memory page table and the memory area as a shared physical memory for being read and written by the virtual machine and the hypervisor. That is, the memory area specified by the base address register is mapped to the virtual address (Host Virtual Address, HVA) of the host machine, thereby establishing a memory mapping between the physical address (Guest Physical Address, GPA) of the virtual machine and the virtual address of the host machine. The memory mapping between the physical address of the virtual machine and the virtual address of the host machine can be established by using stage 2 address conversion technology, which is not limited in the embodiment of the present application. Through the memory mapping relationship contained in the first memory page table, the second memory page table and the third memory page table, when the virtual machine writes data in the shared physical memory, the host machine can map and convert the register parameters used to indicate the physical address contained in the write notification information based on the first memory page table, the second memory page table and the third memory page table, so as to know the address of the write data in the shared physical memory.

[0177] The embodiment of the present application maps the virtual machine memory of the virtual machine and the virtual memory of the host machine to the same physical memory through a page table, that is, the shared physical memory virtual machine can generate write notification information to notify the hypervisor of the write status of the business application instruction set by operating the memory mapping register. In the hypervisor, the hypervisor can obtain the business application instruction set in the shared physical memory through the write notification information, and memory sharing is achieved through shared physical memory, which avoids memory copying and improves data transmission efficiency.

[0178] After the shared physical memory between the virtual machine and the host is successfully established, the virtual machine can pass the business application instruction set obtained by running the business application to the host. For the process, see Figure 6 , Figure 6This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 4 The data processing method can be jointly executed by a virtual machine and a hypervisor in a host machine, and the host machine can be as follows Figure 1 The host machine 100 shown in FIG. 1 and the virtual machine 100 may be as follows: Figure 1 The virtual machine 101 shown, the hypervisor can be such as Figure 1 The hypervisor 102 shown. The following will take the data processing method being executed by the virtual machine and the hypervisor in the host machine as an example for explanation. The data processing method may at least include the following steps S401-S405:

[0179] Step S401, writing a business application instruction set into a shared physical memory;

[0180] Specifically, the virtual machine can write the business application instruction set into the virtual memory of the virtual machine, obtain the third virtual address of the business application instruction set in the virtual memory of the virtual machine, and the virtual machine can obtain the third memory page table. Among them, the first memory page table includes the memory mapping relationship between the virtual memory of the virtual machine and the shared physical memory. The virtual machine can map and convert the third virtual address based on the third memory page table, obtain the second physical address of the business application instruction set in the shared physical memory, and write the business application instruction set into the shared physical memory in the virtual interactive device based on the second physical address.

[0181] When the business application instruction set is completely written to the shared physical memory, the virtual machine can generate write notification information for representing the write completion status of the business application instruction set. The virtual machine can read and write the memory mapped register (MMIO) in the virtual interactive device to interact with the device driver of the virtual interactive device. For example, the virtual machine can write the write notification information to the memory mapped register corresponding to the virtual interactive device, where the memory mapped register can be a register used for data interaction between the host machine and the virtual machine.

[0182] The virtual machine can generate a virtual machine exit event (VM_EXIT) through the write notification information in the memory mapping register. The virtual machine exit event is used to transfer the access control authority of the virtual machine to the virtual interactive device to the hypervisor in the host machine.

[0183] Step S402, reading and writing corresponding memory mapping registers;

[0184] Step S403, processing a virtual machine exit event;

[0185] Step S404, obtaining write notification information;

[0186] Specifically, in the hypervisor, the hypervisor can obtain write notification information through memory mapping registers, call shared memory functions through the write notification information, and process virtual machine exit events through the shared memory functions, thereby obtaining the above-mentioned access control permissions for the virtual interactive device.

[0187] Step S405: Obtain a business application instruction set.

[0188] Specifically, in the hypervisor, the write notification information may include a register parameter for indicating the physical address of the business application instruction set in the shared physical memory. The hypervisor may obtain the business application instruction set in the shared physical memory by using the register parameter in the write notification information. For example, the hypervisor may determine the first virtual address of the business application instruction set in the virtual memory of the virtual machine based on the register parameter, and obtain the third memory page table and the second memory page table corresponding to the shared physical memory. The contents of the third memory page table and the second memory page table may refer to the above Figure 4 The specific description of the corresponding embodiments will not be repeated here.

[0189] The hypervisor can map and convert the first virtual address based on the third memory page table to obtain the second virtual address corresponding to the business application instruction set in the virtual memory of the host machine, map and convert the second virtual address based on the second memory page table to obtain the first physical address of the business application instruction set in the shared physical memory, and obtain the business application instruction set in the shared physical memory based on the first physical address.

[0190] Optionally, the shared physical memory can be a ring buffer, and the process of the management level obtaining the business application instruction set in the ring buffer can be: in the virtual machine, based on the physical address of the business application instruction set in the ring buffer and the tail parameter value corresponding to the tail pointer, generate an updated parameter value of the tail pointer; in the management program, by writing notification information, obtain the update parameter value and the head parameter value corresponding to the head pointer in the ring buffer, based on the update parameter value and the head parameter value, determine the buffer area in the ring buffer, and obtain the business application instruction set in the buffer area.

[0191] Specifically, when the shared physical memory is a ring buffer, the ring buffer may maintain a head pointer and a tail pointer, wherein the parameter value of the head pointer is used to indicate the read position of the ring buffer, and the parameter value of the tail pointer is used to indicate the write position of the ring buffer.

[0192] When the virtual machine writes the business application instruction set into the shared physical memory, the virtual machine can write the business application instruction set to the location indicated by the tail parameter value corresponding to the tail pointer, and the virtual machine can move the tail pointer based on the data volume of the business application instruction set, that is, the virtual machine can generate an updated parameter value of the tail pointer based on the data volume of the business application instruction set and the current tail parameter value. In the hypervisor, the hypervisor can obtain write notification information through the memory mapping register, and the write notification information can be used to indicate that the business application instruction set has been completely written into the ring buffer. The hypervisor can obtain the update parameter value and the head parameter value corresponding to the head pointer in the ring buffer, determine the buffer area in the ring buffer based on the update parameter value and the head parameter value, and obtain the business application instruction set in the buffer area.

[0193] The embodiment of the present application passes the business application instruction set to the hypervisor through a virtual machine exit event and shared physical memory, wherein the virtual machine runs in non-root mode (VMX non-root operation) and the host machine's hypervisor runs in root mode (VMX root operation). When the virtual machine executes instructions such as accessing hardware resources and modifying processor status, a virtual machine exit event is triggered, and access control rights are transferred to the host machine's hypervisor. The hypervisor can efficiently handle access control permissions, allowing the virtual machine to use the host machine's hardware resources as needed. This avoids direct virtual machine access to hardware resources and unnecessary context switching, thereby improving the security and stability of the system.

[0194] On the other hand, shared physical memory can be a ring buffer, which connects the head and tail of the buffer to form a logical ring structure. When the buffer is full and new data is written, the oldest data can be overwritten. In this way, when the data flow is continuous, there is no need to frequently allocate and release large blocks of memory space, and the limited memory space can be fully utilized, avoiding the memory waste caused by data movement or reallocation in conventional memory. The ring buffer has only two pointers, namely the head pointer and the tail pointer. The head pointer and the tail pointer can be used to determine the write position and read position of the data, avoiding the complex address conversion and index calculation between the virtual machine and the host machine, and improving the read and write efficiency.

[0195] After the virtual machine passes the business application instruction set to the host machine, the hypervisor can execute the business application instruction set through the host machine's processor to obtain the instruction execution data corresponding to the business application instruction set. The hypervisor can return the instruction execution data to the virtual machine. For details, see Figure 7 , Figure 7 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 5The data processing method can be jointly executed by a virtual machine and a hypervisor in a host machine, and the host machine can be as follows Figure 1 The host machine 100 shown in FIG. 1 and the virtual machine 100 may be as follows: Figure 1 The virtual machine 101 shown, the hypervisor can be such as Figure 1 The hypervisor 102 shown. The following will take the data processing method being executed by the virtual machine and the hypervisor in the host machine as an example for explanation. The data processing method may at least include the following steps S501-S505:

[0196] Step S501, writing instruction execution data into the shared physical memory;

[0197] Step S502, initiating an interrupt request;

[0198] Specifically, the hypervisor may write the instruction execution data to the virtual memory of the host machine, obtain the fourth virtual address of the instruction execution data in the virtual memory of the host machine, and the hypervisor may obtain the second memory page table. The second memory page table may include a memory mapping relationship between the virtual memory of the host machine and the shared physical memory. The hypervisor may map and convert the fourth virtual address based on the second memory page table, obtain the third physical address of the instruction execution data in the shared physical memory, and write the business application instruction set to the shared physical memory in the virtual interactive device based on the third physical address.

[0199] When the instruction execution data is completely written to the shared physical memory, the hypervisor can generate an interrupt request for characterizing the write completion status of the instruction execution data. The hypervisor can read and write the memory mapped register (MMIO) in the virtual interactive device to interact with the device driver of the virtual interactive device, initiate an interrupt request to the virtual machine, and send the interrupt request to the virtual machine through the virtual interactive device. For example, the hypervisor can write the interrupt request to the memory mapped register corresponding to the virtual interactive device, wherein the memory mapped register can be a register used for data interaction between the host machine and the virtual machine.

[0200] Step S503, processing the interrupt request;

[0201] Step S504, determining whether there is data to be read;

[0202] Step S505, executing the dormant thread and reading instruction execution data.

[0203] Specifically, in a virtual machine, the virtual machine can obtain an interrupt request in a memory mapping register, and execute a dormant thread corresponding to the virtual machine based on the interrupt request. The interrupt request can include a register parameter for indicating a physical address of a business application instruction set in a shared physical memory. The virtual machine can determine whether there is readable data in the shared physical memory of the virtual interactive device through the dormant thread. If there is readable data in the shared physical memory, the virtual machine can obtain instruction execution data in the shared physical memory based on the register parameter in the interrupt request. For example, the virtual machine can determine the fifth virtual address in the virtual memory of the host machine based on the register parameter, and obtain the first memory page table and the third memory page table corresponding to the shared physical memory. The contents of the first memory page table and the third memory page table can refer to the above Figure 4 The specific description of the corresponding embodiment is not repeated here. The virtual machine can map and convert the fifth virtual address based on the third memory page table to obtain the sixth virtual address corresponding to the instruction execution data in the virtual memory of the virtual machine, map and convert the sixth virtual address based on the third memory page table to obtain the fourth physical address of the instruction execution data in the shared physical memory, and obtain the instruction execution data in the shared physical memory based on the fourth physical address.

[0204] In the virtual machine, the virtual machine can determine the execution result of the business application instruction set of the business application based on the instruction execution data. For example, if the business application instruction set is a graphics rendering request for graphics data, then the instruction execution data can be rendered data, and the rendered data can be displayed by the business application in the virtual machine to obtain a display screen of the business application.

[0205] Optionally, the shared physical memory may be a ring buffer. After the instruction execution data is completely written into the ring buffer, the hypervisor may update the parameter value of the head pointer based on the data volume of the instruction execution data to obtain the target parameter value. In the virtual machine, the virtual machine may obtain the instruction execution data in the ring buffer based on the target parameter value and the parameter value of the tail pointer. The process may refer to the above. Figure 6 The specific description of step S404 of the corresponding embodiment will not be repeated here in this embodiment of the present application.

[0206] The embodiment of the present application returns instruction execution data through interrupt requests implemented with the assistance of virtual interactive devices, and interrupts virtualization technology by passing interrupt requests to virtual machines, which eliminates the need to frequently trigger virtual machine exit events, reduces the number of context switches, and significantly reduces the performance overhead caused by virtualization. At the same time, when the virtual machine is in a dormant thread, the host machine can more efficiently schedule other active threads, avoid unnecessary context switches, and improve the response speed of the system.

[0207] The embodiment of the present application can store the business application instruction set obtained by running the business application in the shared physical memory by creating a physical memory that can be read and written by the virtual machine and the hypervisor in the virtual machine. After the business application instruction set is completely written to the shared physical memory, the virtual machine can generate a write notification message. In the hypervisor, the business application instruction set can be obtained in the shared physical memory by writing the notification message. Since the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine, the hypervisor can execute the business application instruction set through the processor of the host machine to obtain the instruction execution data corresponding to the business application instruction set. It can be seen that the embodiment of the present application can pass the native business application instruction set to the hypervisor by creating a physical memory that can be read and written by both the virtual machine and the hypervisor when the instruction type of the business application instruction set is consistent with the instruction type supported by the processor of the host machine, and the native business application instruction set can be executed by the processor of the host machine, thereby improving the execution efficiency and accuracy of the business application instruction set. There is no need for the binary translation layer of the virtual machine to perform binary translation on the instruction set, which avoids the compatibility problems caused by binary translation and reduces the computing cost. At the same time, by sharing physical memory to exchange data for business application instruction sets, the virtual machine and the hypervisor access the same physical memory, avoiding memory copying, improving data transmission efficiency, and thus improving the performance of the host machine running business applications in the virtual machine.

[0208] On the other hand, shared physical memory can be a ring buffer, which connects the head and tail of the buffer to form a logical ring structure. When the buffer is full and new data is written, the oldest data can be overwritten. In this way, when the data flow is continuous, there is no need to frequently allocate and release large blocks of memory space, and the limited memory space can be fully utilized, avoiding the memory waste caused by data movement or reallocation in conventional memory. The ring buffer has only two pointers, namely the head pointer and the tail pointer. The head pointer and the tail pointer can be used to determine the write position and read position of the data, avoiding the complex address conversion and index calculation between the virtual machine and the host machine, and improving the read and write efficiency.

[0209] See also Figure 8 , Figure 8 This is a data processing scenario provided by an embodiment of the present application. Figure 2 .like Figure 8 As shown, the host machine can be the above Figure 1 For the host machine 100 of the corresponding embodiment, the virtual machine may be the above Figure 1 The virtual machine 101 of the corresponding embodiment.

[0210] The host machine can create virtual machines and hypervisors through the virtualization engine. The hypervisor runs based on the host machine's operating system. The host machine can virtualize the host machine's hardware devices through configuration information and create virtual hardware devices corresponding to the virtual machines. Among them, the physical memory of the virtual hardware device can be part of the host machine's physical memory, and the physical memory of the virtual hardware device is the physical memory of the virtual machine.

[0211] The host machine can determine a virtual interactive device (also referred to as a PCI device or a wormhole device) in the virtual hardware device for data interaction with the host machine. The virtual interactive device can include a portion of the physical memory of the virtual hardware device and a processing unit or register for data interaction. The physical memory of the virtual interactive device can also be referred to as the wormhole device memory. The virtual memory mapped by the wormhole device memory in the virtual machine is the virtual memory of the virtual machine.

[0212] The virtual machine can determine a memory area in the wormhole device memory as a shared physical memory for establishing memory sharing with the host machine. The data structure of the shared physical memory can be an array, such as a lock-free ring buffer, or a queue, which is not limited in the embodiments of the present application. The implementation of shared physical memory can map a portion of the host machine's virtual memory and a portion of the virtual memory of the virtual machine to the same physical memory. The portion of the host machine's virtual memory can also be called wormhole virtual memory. For the content of creating shared physical memory, please refer to the above Figure 5 The specific description of steps S301 to S305 of the corresponding embodiment will not be repeated here in the embodiment of the present application.

[0213] The host machine can run business applications through virtual machines, and can control the virtual machines through the hypervisor. For ease of understanding, the business application is taken as an example of a game application. When a business application runs in a virtual machine, the business application can include a hardware abstraction layer (HAL) and a wormhole application layer. The business application can call virtual hardware devices through the hardware abstraction layer and pass the business application instruction set to the wormhole application layer. The wormhole application layer can pass the business application instruction set to the shared physical memory of the virtual interactive device. Among them, the content of writing the business application instruction set to the shared physical memory of the virtual interactive device can be referred to above. Figure 6 The specific description of step S401 of the corresponding embodiment will not be repeated here in the embodiment of the present application.

[0214] When the business application instruction set is completely written to the shared physical memory, the wormhole application layer can generate write notification information for characterizing the write completion status of the business application instruction set. The write notification information is passed to the wormhole kernel driver of the virtual interactive device (i.e., the device driver of the virtual interactive device), and the write notification information for characterizing the write completion status of the business application instruction set is generated by the wormhole kernel driver. The wormhole kernel driver can write the write notification information to the memory mapping register corresponding to the virtual interactive device, wherein the memory mapping register can be a register used for data interaction between the host machine and the virtual machine.

[0215] The virtual machine can generate a virtual machine exit event (VM_EXIT) through the write notification information in the memory mapping register. The virtual machine exit event is used to transfer the access control authority of the virtual machine to the virtual interactive device to the hypervisor in the host machine.

[0216] In the hypervisor, the hypervisor can obtain write notification information through the memory mapped register and call the shared memory function (such as Figure 8 The virtual machine exit event processing routine shown in FIG. 1 is used to process the virtual machine exit event through the shared memory function, thereby obtaining the access control permission for the virtual interactive device. In the hypervisor, the hypervisor can obtain the business application instruction set in the shared physical memory based on the write notification information and the access control permission. The content of obtaining the business application instruction set in the shared physical memory can be referred to in the above Figure 6 The specific description of step S405 of the corresponding embodiment will not be repeated here in this embodiment of the present application.

[0217] The shared physical memory may be a ring buffer, which is a memory structure of producers and consumers. In the process of producing a business application instruction set, the producer may be a writer or generator of the business application instruction set, and the consumer may be a reader or processor of the business application instruction set.

[0218] After the hypervisor obtains the business application instruction set, the virtual machine exit event processing routine can call the notification processing routine in the wormhole device component. The notification processing routine can notify the consumer through the consumer interface that the virtual machine has completely written the business application instruction set into the shared physical memory. The consumer can include a graphics processing component (Open Graphics Library, a graphics programming interface), a video processing component (Video, a component responsible for video processing such as decoding and playback), and a graphics buffer component (Grolloc, a component responsible for graphics buffer allocation and management of the hardware abstraction layer). The embodiments of the present application are not limited here.

[0219] The consumer executes the business application instruction set through the processor of the host machine. For example, when the business application instruction set is a graphics rendering request, the processor of the host machine can call the graphics processor of the host machine through the graphics rendering request, and the graphics processor performs graphics rendering on the graphics data in the graphics rendering request to obtain rendered data. The host machine can pass the rendered data to the virtual machine through the virtual interactive device, and the rendered data can be displayed through the business application in the virtual machine to obtain the game display screen of the business application.

[0220] The embodiment of the present application can store the business application instruction set obtained by running the business application in the shared physical memory by creating a physical memory that can be read and written by the virtual machine and the hypervisor in the virtual machine. After the business application instruction set is completely written to the shared physical memory, the virtual machine can generate a write notification message. In the hypervisor, the business application instruction set can be obtained in the shared physical memory by writing the notification message. Since the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine, the hypervisor can execute the business application instruction set through the processor of the host machine to obtain the instruction execution data corresponding to the business application instruction set. It can be seen that the embodiment of the present application can pass the native business application instruction set to the hypervisor by creating a physical memory that can be read and written by both the virtual machine and the hypervisor when the instruction type of the business application instruction set is consistent with the instruction type supported by the processor of the host machine, and the native business application instruction set can be executed by the processor of the host machine, thereby improving the execution efficiency and accuracy of the business application instruction set. There is no need for the binary translation layer of the virtual machine to perform binary translation on the instruction set, which avoids the compatibility problems caused by binary translation and reduces the computing cost. At the same time, by sharing physical memory to exchange data for business application instruction sets, the virtual machine and the hypervisor access the same physical memory, avoiding memory copying, improving data transmission efficiency, and thus improving the performance of the host machine running business applications in the virtual machine.

[0221] See also Fig. 9 , Fig. 9 This is a data processing scenario provided by an embodiment of the present application. Figure 3 .like Fig. 9 As shown, the host machine can be the above Figure 1 For the host machine 100 of the corresponding embodiment, the virtual machine may be the above Figure 1 The virtual machine 101 of the corresponding embodiment.

[0222] The host machine can create a virtual machine and a hypervisor through a virtualization engine, and the hypervisor is run based on the operating system of the host machine. The virtualization engine may include virtualization components, such as components that implement Hyper-V virtualization technology, and virtual machine communication components for establishing a virtual machine communication system, such as vmbus, which are not limited in the embodiments of the present application. The virtualization engine can virtualize the hardware devices of the host machine through configuration information to obtain virtual hardware devices corresponding to the virtual machine. Among them, the physical memory of the virtual hardware device can be a part of the physical memory of the host machine, and the physical memory of the virtual hardware device is the physical memory of the virtual machine. The hardware devices of the host machine may include a processor, physical memory, disk, and external devices.

[0223] The host machine can determine a virtual interactive device in the virtual hardware device for data interaction with the host machine. The virtual interactive device can include a portion of the physical memory in the virtual hardware device and a processing unit or register for realizing data interaction. The virtual interactive device can realize data exchange and communication between the virtual machine and the host machine based on the PCI protocol. The virtual interactive device can also include a virtual audio and video processing component and a virtual sensor component. For example, the virtualization engine can virtualize the audio and video processing component of the host machine to obtain a virtual audio and video processing component, and virtualize the sensor component of the host machine to obtain a virtual sensor component.

[0224] The host machine can determine a virtual interactive device (also called a PCI device or a wormhole device) in the virtual hardware device for data interaction with the host machine. The virtual interactive device can include a portion of the physical memory of the virtual hardware device and a processing unit or register for data interaction. The virtual machine can determine a memory area in the physical memory of the virtual interactive device as a shared physical memory for establishing memory sharing with the host machine.

[0225] The operating system framework of the business application, such as the Android framework, and the detection component can be deployed in the virtual machine. The detection component can detect the running data of the business application to ensure the security of the running data. For example, when the business application is a game application, the anti-cheating function can be implemented to ensure the security of the game application.

[0226] When a business application runs in a virtual machine, the business application may include a hardware abstraction layer, through which the business application may call a virtual hardware device, and through the device driver of the virtual interactive device, the business application instruction set is passed to the virtual interactive device, for example, the business application instruction set may include a graphics rendering data stream, a touch data stream, a control data stream, an audio and video data stream, etc. Then, the business application instruction set is passed to the hypervisor through the shared physical memory corresponding to the virtual interactive device.

[0227] The management program can obtain the business application instruction set and provide application management services, window management services, detection services, input control services, rendering services, audio services, video services, etc. Among them, the application management service can be to install and uninstall business applications, etc., the window management service can be to adjust the size and position of the display screen of the business application, etc., and the detection service can be to detect the running data of the business application through the detection component. The input control service can be used to execute the business application instruction set such as touch data flow and control data flow to input or control the business application. The audio service and the video service can be based on the host machine's processor, calling the audio and video processing component corresponding to the virtual audio and video processing component, and playing and processing the audio and video data based on the audio and video processing component.

[0228] Optionally, the virtualization engine can also virtualize the host machine's sensors, such as location detection sensors, to obtain virtual sensor components. If the business application instruction set is used to obtain sensor information, the hypervisor calls the sensor component corresponding to the virtual sensor component based on the host machine's processor, and determines the sensor information in the sensor component as instruction execution data corresponding to the business application instruction set.

[0229] The embodiment of the present application can store the business application instruction set obtained by running the business application in the shared physical memory by creating a physical memory that can be read and written by the virtual machine and the hypervisor in the virtual machine. After the business application instruction set is completely written to the shared physical memory, the virtual machine can generate a write notification message. In the hypervisor, the business application instruction set can be obtained in the shared physical memory by writing the notification message. Since the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine, the hypervisor can execute the business application instruction set through the processor of the host machine to obtain the instruction execution data corresponding to the business application instruction set. It can be seen that the embodiment of the present application can pass the native business application instruction set to the hypervisor by creating a physical memory that can be read and written by both the virtual machine and the hypervisor when the instruction type of the business application instruction set is consistent with the instruction type supported by the processor of the host machine, and the native business application instruction set can be executed by the processor of the host machine, thereby improving the execution efficiency and accuracy of the business application instruction set. There is no need for the binary translation layer of the virtual machine to perform binary translation on the instruction set, which avoids the compatibility problems caused by binary translation and reduces the computing cost. At the same time, by sharing physical memory to exchange data for business application instruction sets, the virtual machine and the hypervisor access the same physical memory, avoiding memory copying, improving data transmission efficiency, and thus improving the performance of the host machine running business applications in the virtual machine.

[0230] It can be understood that the virtual machine can also establish a communication connection relationship with the host machine through the Vsock protocol. If the data volume of the business application instruction set is greater than or equal to the data transmission threshold, the virtual machine can use the virtual interaction device to write the business application instruction set to the shared physical memory to interact with the host machine; if the data volume of the business application instruction set is less than the data transmission threshold, and the read and write load state of the virtual interaction device meets the parallel transmission conditions, the virtual machine can interact with the host machine through the Vsock protocol. Therefore, when the shared physical memory is processing a high load state (such as high read and write, insufficient capacity), data with a smaller data volume, such as touch data flow, control data flow, etc., can be interacted with the host machine through the Vsock protocol. Improve the efficiency of data interaction.

[0231] The rendering service may refer to rendering graphics for a graphics rendering request when the business application instruction set is a graphics rendering request. For the process, please refer to Fig.10 , Fig.10 This is a flow diagram of a data processing method provided in an embodiment of the present application. Figure 6 The data processing method can be jointly executed by a virtual machine and a hypervisor in a host machine, and the host machine can be as follows Figure 1 The host machine 100 shown in FIG. 1 and the virtual machine 100 may be as follows: Figure 1 The virtual machine 101 shown, the hypervisor can be such as Figure 1 The hypervisor 102 shown. The following will take the data processing method being executed by the virtual machine and the hypervisor in the host machine as an example for explanation. The data processing method may at least include the following steps S601 to S606:

[0232] Step S601, the business application calls the graphics rendering interface;

[0233] Step S602, performing byte stream encoding on the graphics rendering request to obtain a business application instruction set;

[0234] Specifically, when a business application is running on a virtual machine, the business application can call the OpenGL ES (Open Graphics Library for Embedded Systems, graphics optimized for embedded devices) interface through the graphics interface simulation layer to initiate a graphics rendering request, wherein the graphics interface simulation layer may include EGL (Embedded Graphics Library, embedded system graphics library) simulation (Emulation), GL ES simulation or Vulkan (a graphics rendering and computing component) simulation, etc., which is not limited in the embodiments of the present application. Among them, EGL simulation is used to implement the interface of the embedded system graphics library on the operating system architecture of the business application, GL ES simulation is used to implement the interface of the embedded device optimized graphics on the operating system architecture of the business application, and Vulkan simulation is used to implement the interface of Vulkan on the operating system architecture of the business application.

[0235] For example, the graphics rendering request may be an OpenGL ES command, and the virtual machine may call an OpenGL ES function to perform byte stream encoding on the graphics rendering request to obtain a business application instruction set, such as a rendering data stream.

[0236] Step S603, writing the business application instruction set into the shared physical memory;

[0237] Step S604, obtaining a business application instruction set;

[0238] Specifically, the virtual machine may write the service application instruction set into the shared physical memory through the virtual interactive device. The content of writing the service application instruction set into the shared physical memory of the virtual interactive device may refer to the above Figure 6 The specific description of step S401 of the corresponding embodiment will not be repeated here in the embodiment of the present application.

[0239] In the hypervisor, the hypervisor can obtain the service application instruction set in the shared physical memory through the virtual interactive device. The content of obtaining the service application instruction set in the shared physical memory can be referred to in the above Figure 6 The specific description of step S405 of the corresponding embodiment will not be repeated here in this embodiment of the present application.

[0240] Step S605, decoding the byte stream of the service application instruction set to obtain a graphics rendering request;

[0241] Step S606, calling a graphics rendering component to perform graphics rendering.

[0242] Specifically, the hypervisor can decode the byte stream of the business application instruction set to obtain an OpenGL ES command, and the hypervisor can translate the decoded OpenGL ES command into an OpenGL or Vulkan API supported by the Windows system. The processor performs graphics rendering on the graphics data in the OpenGL ES command to obtain rendered data, and the rendered data is determined as instruction execution data corresponding to the business application instruction set.

[0243] The embodiment of the present application realizes graphics acceleration of business applications by using OpenGL on the host machine. Through virtualization technology, the OpenGL ES graphics rendering request of the business application is forwarded to the processor of the host machine for execution. After receiving the rendering instruction stream, the management program can convert the OpenGL ES command into the OpenGL or Vulkan command corresponding to the operating system of the host machine to render the image, and optimize the graphics stack protocol of the business application. Through the virtual interactive device, the graphics rendering request of the business application can be efficiently forwarded and executed on the host machine of the Windows architecture in the virtualized environment, thereby utilizing the graphics processing capability of the host machine to improve the rendering performance.

[0244] See also Fig.11 , Fig.11 Schematic diagram of a data processing device provided in an embodiment of the present application. Fig.11 As shown, the data processing device 1 is applied to a host machine, which includes a virtual machine and a hypervisor. The operating system of the host machine is different from the operating system of the virtual machine, and the hypervisor is run based on the operating system of the host machine; the data processing device 1 includes an instruction set generation module 701, an instruction set sharing module 702 and an instruction set processing module 703.

[0245] The instruction set generation module 701 is used to run the business application in the virtual machine to obtain the business application instruction set; the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine;

[0246] The instruction set sharing module 702 is used to write the business application instruction set in the virtual memory of the virtual machine to the shared physical memory in the virtual interactive device corresponding to the virtual machine, and generate write notification information for representing the write completion status of the business application instruction set; the shared physical memory is the physical memory in the host machine used for being read and written by the virtual machine and the hypervisor;

[0247] The instruction set processing module 703 obtains write notification information in the management program, obtains the business application instruction set in the shared physical memory through the write notification information, executes the business application instruction set through the processor of the host machine, and obtains instruction execution data corresponding to the business application instruction set.

[0248] In a possible implementation, the instruction set generation module 701 is further configured to perform the following operations:

[0249] Perform kernel compilation on the kernel code of the operating system of the host machine and the kernel code of the processor to obtain kernel compiled code;

[0250] Based on the kernel compilation code, a virtualization engine is generated for compatibility with the instruction types of the operating system of the host machine and the instruction types supported by the processor;

[0251] Based on the virtualization engine, a virtual machine and a hypervisor are created in the host machine, configuration information corresponding to the virtual machine is obtained, and based on the configuration information, the hardware device of the host machine is virtualized to obtain a virtual interactive device for data interaction with the host machine.

[0252] In a possible implementation, the instruction set generation module 701 is further configured to perform the following operations:

[0253] Obtaining a memory offset corresponding to a base address register in a virtual interactive device through a hypervisor; the memory offset is an offset between a virtual memory of a virtual machine and a virtual memory of a host machine;

[0254] Acquire a first memory page table for representing a memory mapping relationship between a virtual memory of a virtual machine and a physical memory of the virtual machine, and acquire a second memory page table for representing a memory mapping relationship between a virtual memory of a host machine and a physical memory of the host machine;

[0255] Generate a third memory page table for representing a memory mapping relationship between a virtual memory of the virtual machine and a virtual memory of the host machine based on the memory offset, the first memory page table, and the second memory page table;

[0256] The virtual machine determines a memory area in the physical memory of the virtual interactive device, and determines the third memory page table and the memory area as a shared physical memory for reading and writing by the virtual machine and the hypervisor.

[0257] In a possible implementation, the instruction set generation module 701 is further configured to perform the following operations:

[0258] In the virtual machine, a memory sharing request is generated, the memory sharing request is written into a memory mapping register corresponding to the virtual interactive device, and a virtual machine exit event is generated according to the memory sharing request in the memory mapping register; the virtual machine exit event is used to transfer the access control authority of the virtual machine for the virtual interactive device to the hypervisor;

[0259] When the instruction set generation module 701 is used to obtain the memory offset corresponding to the base address register in the virtual interactive device through the management program, it is specifically used to perform the following operations:

[0260] In the hypervisor, a memory sharing request is obtained through a memory mapping register, a shared memory function is called through the memory sharing request, and a virtual machine exit event is processed through the shared memory function to obtain access control permissions for a virtual interactive device, and a memory offset is obtained in a base address register of the virtual interactive device based on the access control permissions.

[0261] In a possible implementation, the instruction set sharing module 702 is further configured to perform the following operations:

[0262] In the virtual machine, writing the write notification information to the memory mapping register corresponding to the virtual interactive device, generating a virtual machine exit event according to the write notification information in the memory mapping register; the virtual machine exit event is used to transfer the virtual machine's access control authority for the virtual interactive device to the hypervisor;

[0263] The instruction set sharing module 702 is used to obtain write notification information in the management program, and when obtaining the service application instruction set in the shared physical memory through the write notification information, it is specifically used to perform the following operations:

[0264] In the hypervisor, write notification information is obtained through memory mapping registers, shared memory functions are called through the write notification information, and virtual machine exit events are processed through the shared memory functions to obtain access control permissions for virtual interactive devices. Based on the access control permissions and the write notification information, a business application instruction set is obtained in the shared physical memory of the virtual interactive device.

[0265] In a possible implementation, the instruction set sharing module 702 is used to write notification information including register parameters of the business application instruction set in the shared physical memory; based on the access control authority and the write notification information, when obtaining the business application instruction set in the shared physical memory of the virtual interactive device, specifically for performing the following operations:

[0266] Obtaining register parameters in the write notification information, and determining a first virtual address of the service application instruction set in the virtual memory of the virtual machine based on the register parameters;

[0267] Mapping and converting the first virtual address based on the third memory page table to obtain a second virtual address corresponding to the service application instruction set in the virtual memory of the host machine;

[0268] The second virtual address is mapped and converted based on the second memory page table to obtain a first physical address of the business application instruction set in the host machine, and the business application instruction set is obtained in the shared physical memory based on the first physical address.

[0269] In a possible implementation, the shared physical memory is a ring buffer, and the ring buffer includes a head pointer and a tail pointer; the instruction set sharing module 702 is further used to perform the following operations:

[0270] In the virtual machine, based on the physical address of the business application instruction set in the ring buffer and the tail parameter value corresponding to the tail pointer, an updated parameter value of the tail pointer is generated;

[0271] The instruction set sharing module 702 is used to obtain the service application instruction set in the shared physical memory by writing notification information, and is specifically used to perform the following operations:

[0272] In the management program, by writing notification information, the update parameter value and the header parameter value corresponding to the head pointer are obtained in the ring buffer, based on the update parameter value and the header parameter value, the buffer area is determined in the ring buffer, and the business application instruction set is obtained in the buffer area.

[0273] In a possible implementation, the instruction set sharing module 702 is used to write the business application instruction set in the virtual memory of the virtual machine to the shared physical memory of the virtual interactive device corresponding to the virtual machine, and when generating write notification information for representing the write completion status of the business application instruction set, specifically to perform the following operations:

[0274] Writing the service application instruction set into the virtual memory of the virtual machine to obtain a third virtual address of the service application instruction set in the virtual memory of the virtual machine;

[0275] Mapping and converting the third virtual address based on the first memory page table to obtain a second physical address of the business application instruction set in the shared physical memory, and writing the business application instruction set into the shared physical memory in the virtual interactive device based on the second physical address;

[0276] When the business application instruction set is completely written into the shared physical memory, write notification information is generated to indicate the write completion status of the business application instruction set.

[0277] In a possible implementation, the instruction set processing module 703 is further configured to perform the following operations:

[0278] Writing instruction execution data in the virtual memory of the host machine to the shared physical memory corresponding to the virtual interactive device, generating an interrupt request for the virtual interactive device, and sending the interrupt request to the virtual machine through the virtual interactive device;

[0279] In the virtual machine, a dormant thread corresponding to the virtual machine is executed based on an interrupt request, instruction execution data is obtained in a shared physical memory through the dormant thread, and an execution result of a business application instruction set of the business application is determined based on the instruction execution data.

[0280] In a possible implementation, the instruction set generation module 701 is used to run the business application in the virtual machine, and when the business application instruction set is obtained, it is specifically used to perform the following operations:

[0281] Running the business application through the virtual interactive device corresponding to the virtual machine, obtaining a graphics rendering request initiated by the business application calling the graphics rendering interface, encoding the graphics rendering request by byte stream, and obtaining a business application instruction set; the graphics rendering request includes graphics data;

[0282] The instruction set execution module is used to execute the business application instruction set through the processor of the host machine, and when the instruction execution data corresponding to the business application instruction set is obtained, it is specifically used to perform the following operations:

[0283] The business application instruction set is decoded by byte stream to obtain a graphics rendering request, and the graphics data in the graphics rendering request is rendered by a processor to obtain rendered data, and the rendered data is determined as instruction execution data corresponding to the business application instruction set.

[0284] In a possible implementation, the instruction set sharing module 702 is further configured to perform the following operations:

[0285] If the data volume of the business application instruction set is greater than or equal to the data transmission threshold, executing the step of writing the business application instruction set in the virtual memory of the virtual machine into the shared physical memory of the virtual interactive device corresponding to the virtual machine;

[0286] If the data volume of the business application instruction set is less than the data transmission threshold and the read and write load status of the virtual interactive device meets the parallel transmission conditions, a communication connection relationship with the host machine is established based on the socket protocol, and the business application instruction set is sent to the host machine through the communication connection relationship.

[0287] In a possible implementation, the virtual interactive device includes a virtual audio and video processing component and a virtual sensor component; the instruction set generation module 701 is used to virtualize the hardware device of the host machine, and when obtaining the virtual interactive device corresponding to the virtual machine, it is specifically used to perform the following operations:

[0288] Virtualizing the audio and video processing component of the host machine to obtain a virtual audio and video processing component, and virtualizing the sensor component of the host machine to obtain a virtual sensor component;

[0289] The instruction set execution module is used to execute the business application instruction set through the processor of the host machine, and when the instruction execution data corresponding to the business application instruction set is obtained, it is specifically used to perform the following operations:

[0290] If the business application instruction set is used to perform playback processing for audio and video data, then based on the processor of the host machine, the audio and video processing component corresponding to the virtual audio and video processing component is called, the audio and video data is played based on the audio and video processing component, and the feedback information of the played audio and video data is determined as the instruction execution data corresponding to the business application instruction set;

[0291] If the business application instruction set is used to obtain sensor information, based on the processor of the host machine, the sensor component corresponding to the virtual sensor component is called, and the sensor information in the sensor component is determined as instruction execution data corresponding to the business application instruction set.

[0292] The embodiment of the present application can store the business application instruction set obtained by running the business application in the virtual machine into the shared physical memory by creating a physical memory (i.e., shared physical memory) in the host machine that can be read and written by the virtual machine and the hypervisor. After the business application instruction set is completely written into the shared physical memory, the virtual machine can generate a write notification message. In the hypervisor, the business application instruction set can be obtained in the shared physical memory by writing the notification message. Since the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine, the hypervisor can execute the business application instruction set through the processor of the host machine to obtain the instruction execution data corresponding to the business application instruction set. It can be seen that the embodiment of the present application can pass the native business application instruction set to the hypervisor by creating a physical memory that can be read and written by both the virtual machine and the hypervisor when the instruction type of the business application instruction set is consistent with the instruction type supported by the processor of the host machine, and the native business application instruction set can be executed by the processor of the host machine, thereby improving the execution efficiency and accuracy of the business application instruction set. There is no need for the binary translation layer of the virtual machine to perform binary translation on the instruction set, which avoids the compatibility problems caused by binary translation and reduces the computing cost. At the same time, by sharing physical memory to exchange data for business application instruction sets, virtual machines and hypervisors access the same physical memory, avoiding memory copying, improving data transmission efficiency, and thus improving the performance of business applications running in virtual machines in the host machine.

[0293] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.

[0294] See also Fig.12 , Fig.12Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig.12 As shown, the computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the user interface 1003 may optionally include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Fig.12 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.

[0295] In such Fig.12 In the computer device 1000 shown, the network interface 1004 can provide a network communication network element; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0296] Running the business application in the virtual machine to obtain a business application instruction set; the instruction type of the business application instruction set is the instruction type supported by the processor of the host machine;

[0297] Writing the business application instruction set in the virtual memory of the virtual machine to the shared physical memory in the virtual interactive device corresponding to the virtual machine, and generating write notification information for representing the write completion status of the business application instruction set; the shared physical memory is the physical memory in the host machine used for being read and written by the virtual machine and the hypervisor;

[0298] In the management program, write notification information is obtained, and a business application instruction set is obtained in the shared physical memory through the write notification information. The business application instruction set is executed by the processor of the host machine to obtain instruction execution data corresponding to the business application instruction set.

[0299] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figures 3 to 10The description of the data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.

[0300] In addition, it should be pointed out here that: the embodiment of the present application also provides a computer-readable storage medium, and the computer-readable storage medium stores a computer program, and when the processor executes the computer program, it can execute the above Figures 3 to 10 The description of the above data processing method in any corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated. For technical details not disclosed in the computer-readable storage medium embodiment involved in this application, please refer to the description of the method embodiment of this application.

[0301] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart memory card (smart media card, SMC), a secure digital (secure digital, SD) card, a flash card (flash card), etc. equipped on the computer device. Further, the computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been displayed or is to be displayed.

[0302] In addition, it should be noted that: the embodiment of the present application also provides a computer program product, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the above Figures 3 to 10 Any method provided by the corresponding embodiment.

[0303] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the term "comprising" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, device, product, or equipment that includes a series of steps or units is not limited to the listed steps or modules, but optionally includes steps or modules that are not listed, or optionally includes other step units inherent to these processes, methods, devices, products, or equipment.

[0304] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of network elements in the above description. Whether these network elements are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described network elements for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0305] The method and related apparatus provided by the embodiment of the present application are described with reference to the method flow chart and / or structural diagram provided by the embodiment of the present application. Specifically, each process and / or box in the method flow chart and / or structural diagram, as well as the combination of the processes and / or boxes in the flow chart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable device to generate a machine, so that the instructions executed by the processor of the computer or other programmable device generate instructions for implementing the process in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable device to work in a specific way, so that the instructions stored in the computer-readable memory produce a product including an instruction device, which implements the functions specified in the process. Figure 1 A process or multiple processes and / or structures Figure 1 These computer program instructions can also be loaded onto a computer or other programmable device so that a series of operation steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide the functions for implementing the process. Figure 1 A flow or multiple flows and / or structures illustrate the steps of the functions specified in one block or multiple blocks.

[0306] The steps in the method of the embodiment of the present application can be adjusted in order, combined and deleted according to actual needs.

[0307] The modules in the device of the embodiment of the present application can be merged, divided and deleted according to actual needs.

[0308] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data processing method, characterized in that: The method is performed by a host machine, the host machine includes a virtual machine and a hypervisor, the operating system of the host machine is different from the operating system of the virtual machine, and the hypervisor is run based on the operating system of the host machine; the method includes: Running a business application in the virtual machine to obtain a business application instruction set; the instruction type of the business application instruction set is an instruction type supported by the processor of the host machine; Writing the business application instruction set in the virtual memory of the virtual machine into the shared physical memory in the virtual interactive device corresponding to the virtual machine, and generating write notification information for representing the write completion status of the business application instruction set; the shared physical memory is the physical memory in the host machine used for being read and written by the virtual machine and the hypervisor; In the management program, the write notification information is obtained, the business application instruction set is obtained in the shared physical memory through the write notification information, and the business application instruction set is executed by the processor of the host machine to obtain instruction execution data corresponding to the business application instruction set.

2. The method according to claim 1, characterized in that: Also includes: Performing kernel compilation on the kernel code of the operating system of the host machine and the kernel code of the processor to obtain a kernel compiled code; Based on the kernel compiled code, a virtualization engine is generated for being compatible with instruction types of the operating system of the host machine and instruction types supported by the processor; Based on the virtualization engine, the virtual machine and the hypervisor are created in the host machine, configuration information corresponding to the virtual machine is obtained, and based on the configuration information, the hardware device of the host machine is virtualized to obtain a virtual interaction device for data interaction with the host machine.

3. The method according to claim 1, characterized in that Also includes: Acquire, through the management program, a memory offset corresponding to a base address register in the virtual interactive device; The memory offset is the offset between the virtual memory of the virtual machine and the virtual memory of the host machine; Acquire a first memory page table for representing a memory mapping relationship between a virtual memory of the virtual machine and a physical memory of the virtual machine, and acquire a second memory page table for representing a memory mapping relationship between a virtual memory of the host machine and a physical memory of the host machine; Generate a third memory page table for representing a memory mapping relationship between the virtual memory of the virtual machine and the virtual memory of the host machine based on the memory offset, the first memory page table and the second memory page table; The virtual machine determines a memory area in the physical memory of the virtual interactive device, and determines the third memory page table and the memory area as a shared physical memory for reading and writing by the virtual machine and the hypervisor.

4. The method according to claim 3, characterized in that Also includes: In the virtual machine, a memory sharing request is generated, the memory sharing request is written into a memory mapping register corresponding to the virtual interactive device, and a virtual machine exit event is generated according to the memory sharing request in the memory mapping register; The virtual machine exit event is used to transfer the access control authority of the virtual machine for the virtual interactive device to the hypervisor; The obtaining, through the management program, a memory offset corresponding to a base address register in the virtual interactive device includes: In the hypervisor, the memory sharing request is obtained through the memory mapping register, a shared memory function is called through the memory sharing request, and the virtual machine exit event is processed through the shared memory function to obtain access control permissions for the virtual interactive device, and a memory offset is obtained in the base address register of the virtual interactive device based on the access control permissions.

5. The method according to claim 3, characterized in that: Also includes: In the virtual machine, writing the write notification information into a memory mapping register corresponding to the virtual interactive device, and generating a virtual machine exit event according to the write notification information in the memory mapping register; The virtual machine exit event is used to transfer the access control authority of the virtual machine for the virtual interactive device to the hypervisor; The step of obtaining the write notification information in the management program and obtaining the service application instruction set in the shared physical memory through the write notification information includes: In the hypervisor, the write notification information is obtained through the memory mapping register, a shared memory function is called through the write notification information, and the virtual machine exit event is processed through the shared memory function to obtain access control permissions for the virtual interactive device, and based on the access control permissions and the write notification information, the business application instruction set is obtained in the shared physical memory of the virtual interactive device.

6. The method according to claim 5, characterized in that The write notification information includes register parameters of the business application instruction set in the shared physical memory; and obtaining the business application instruction set in the shared physical memory of the virtual interactive device based on the access control authority and the write notification information includes: Acquire the register parameter in the write notification information, and determine a first virtual address of the service application instruction set in the virtual memory of the virtual machine based on the register parameter; Mapping and converting the first virtual address based on the third memory page table to obtain a second virtual address corresponding to the service application instruction set in the virtual memory of the host machine; The second virtual address is mapped and converted based on the second memory page table to obtain a first physical address of the business application instruction set in the shared physical memory, and the business application instruction set is obtained in the host machine based on the first physical address.

7. The method according to claim 1, characterized in that The shared physical memory is a ring buffer, and the ring buffer includes a head pointer and a tail pointer; after writing the business application instruction set located in the virtual memory of the virtual machine to the shared physical memory in the virtual interactive device corresponding to the virtual machine, the method further includes: In the virtual machine, based on the physical address of the business application instruction set in the ring buffer and the tail parameter value corresponding to the tail pointer, an update parameter value of the tail pointer is generated; The acquiring the service application instruction set in the shared physical memory by writing the notification information includes: In the management program, the update parameter value and the header parameter value corresponding to the head pointer are obtained in the ring buffer by writing the notification information, and a buffer area is determined in the ring buffer based on the update parameter value and the header parameter value, and the business application instruction set is obtained in the buffer area.

8. The method according to claim 3, characterized in that The step of writing the business application instruction set in the virtual memory of the virtual machine into the shared physical memory of the virtual interactive device corresponding to the virtual machine, and generating write notification information for representing the write completion status of the business application instruction set, includes: Writing the service application instruction set into the virtual memory of the virtual machine to obtain a third virtual address of the service application instruction set in the virtual memory of the virtual machine; Mapping and converting the third virtual address based on the first memory page table to obtain a second physical address of the business application instruction set in the shared physical memory, and writing the business application instruction set into the shared physical memory in the virtual interactive device based on the second physical address; When the service application instruction set is completely written into the shared physical memory, write notification information is generated to indicate a write completion status of the service application instruction set.

9. The method according to claim 1, characterized in that: Also includes: Writing the instruction execution data in the virtual memory of the host machine into the shared physical memory corresponding to the virtual interactive device, generating an interrupt request for the virtual interactive device, and sending the interrupt request to the virtual machine through the virtual interactive device; In the virtual machine, a dormant thread corresponding to the virtual machine is executed based on the interrupt request, the instruction execution data is obtained in the shared physical memory through the dormant thread, and an execution result of the business application instruction set of the business application is determined based on the instruction execution data.

10. The method according to claim 1, characterized in that The step of running the business application in the virtual machine to obtain a business application instruction set includes: Running a business application through a virtual interactive device corresponding to the virtual machine, obtaining a graphics rendering request initiated by the business application calling a graphics rendering interface, performing byte stream encoding on the graphics rendering request, and obtaining a business application instruction set; the graphics rendering request includes graphics data; The executing the service application instruction set by the processor of the host machine to obtain instruction execution data corresponding to the service application instruction set includes: The business application instruction set is byte stream decoded to obtain the graphics rendering request, the graphics data in the graphics rendering request is graphics rendered by the processor to obtain rendered data, and the rendered data is determined as instruction execution data corresponding to the business application instruction set.

11. The method according to claim 1, characterized in that: Also includes: If the data volume of the business application instruction set is greater than or equal to the data transmission threshold, executing the step of writing the business application instruction set in the virtual memory of the virtual machine into the shared physical memory of the virtual interaction device corresponding to the virtual machine; If the data volume of the business application instruction set is less than the data transmission threshold, and the read and write load status of the virtual interactive device meets the parallel transmission condition, a communication connection relationship with the host machine is established based on the socket protocol, and the business application instruction set is sent to the host machine through the communication connection relationship.

12. The method according to claim 2, characterized in that: The virtual interactive device includes a virtual audio and video processing component and a virtual sensor component; the virtualization of the hardware device of the host machine to obtain the virtual interactive device corresponding to the virtual machine includes: Virtualizing the audio and video processing component of the host machine to obtain a virtual audio and video processing component, and virtualizing the sensor component of the host machine to obtain a virtual sensor component; The executing the service application instruction set by the processor of the host machine to obtain instruction execution data corresponding to the service application instruction set includes: If the service application instruction set is used to perform playback processing for audio and video data, then based on the processor of the host machine, the audio and video processing component corresponding to the virtual audio and video processing component is called, the audio and video data is played based on the audio and video processing component, and feedback information of playing the audio and video data is determined as instruction execution data corresponding to the service application instruction set; If the business application instruction set is used to obtain sensor information, based on the processor of the host machine, the sensor component corresponding to the virtual sensor component is called, and the sensor information in the sensor component is determined as the instruction execution data corresponding to the business application instruction set.

13. A data processing device, characterized in that: include: An instruction set generation module, used to run a business application in a virtual machine to obtain a business application instruction set; the instruction type of the business application instruction set is an instruction type supported by a processor of a host machine; the host machine includes a virtual machine and a hypervisor, the operating system of the host machine is different from the operating system of the virtual machine, and the hypervisor is run based on the operating system of the host machine; An instruction set sharing module, used to write the business application instruction set in the virtual memory of the virtual machine into the shared physical memory in the virtual interactive device corresponding to the virtual machine, and generate write notification information for representing the write completion status of the business application instruction set; the shared physical memory is the physical memory in the host machine used for being read and written by the virtual machine and the hypervisor; An instruction set processing module obtains the write notification information in the management program, obtains the business application instruction set in the shared physical memory through the write notification information, executes the business application instruction set through the processor of the host machine, and obtains instruction execution data corresponding to the business application instruction set.

14. A computer device, characterized in that: include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method described in any one of claims 1-12.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 12.

16. A computer program product, characterized in that The computer program product comprises a computer program, which is stored in a computer-readable storage medium and is suitable for being read and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 12.

Citation Information

Cited By

  • GPU (Graphics Processing Unit) virtualized video memory management method and device, storage medium and program product

    CN120429067A

  • GPU virtualized video memory management method, device, storage medium, and program product

    CN120429067B

  • Communication method and device between virtual machines, equipment and storage medium

    CN120723383A

  • Communication method and device of virtual machine, storage medium and electronic device

    CN121433814A