Android virtualization system supporting multiple platforms, construction method and electronic equipment

By using a multi-platform Android virtualization system, utilizing Docker containers and the gfxstream library for instruction translation, and combining GPU encoding and resource isolation, the compatibility and performance issues of Android emulators on the Linux operating system were resolved, achieving efficient cross-platform operation and a smooth gaming experience.

CN119322654APending Publication Date: 2025-01-17XIAMEN XINGJIELIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411412089.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-01-17

AI Technical Summary

Technical Problem

Existing Android emulators cannot run on Linux x86 and Linux ARM operating systems, which limits their use cases. Furthermore, existing technologies suffer from stuttering, high resource consumption, and frequent crashes when running large games.

Method used

It adopts a multi-platform Android virtualization system, uses Docker containers to build the Emulator virtualization system, combines the gfxstream library for instruction conversion, and encodes audio and video streams through GPU. It uses Linux namespaces and Cgroups mechanisms to isolate resources, achieving cross-platform compatibility and performance improvement.

Benefits of technology

It enables seamless migration and operation of Android emulators across multiple operating systems, improving compatibility and performance, reducing CPU load, and supporting smooth operation of large games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119322654A_ABST
    Figure CN119322654A_ABST
Patent Text Reader

Abstract

The invention discloses an Android virtualization system supporting multiple platforms, a construction method and electronic equipment, the system comprises a plurality of Docker containers and a plurality of Emulator virtualization systems, the Emulator virtualization systems constructed by utilizing the method comprise gfxstream libraries, the gfxstream libraries are used for converting OpenGL ES instructions into OpenGL instructions capable of being recognized by mesa, the instructions can be perfectly converted to achieve compatible operation, and the operation efficiency is improved. The system can be operated on intel, AMD, domestic Peng, Kylin and Feiteng platforms, and can be applied to a Linux X86 operating system and an ARM operating system. Wherein the domestic Peng and Feiteng are arm instruction sets, instruction accurate conversion does not need to be carried out, and instruction conversion needs to be carried out on Intel and AMD platforms, so that compatibility is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of Android virtualization technology, and in particular, relates to an Android virtualization system supporting multiple platforms, a construction method, and an electronic device. Background Art

[0002] Android emulator is the most typical Android virtual machine technology. Users can use Android applications on PC and Mac through Android emulator.

[0003] In the related technology, the Android emulator can only be supported on Windows operating system and Mac operating system, and cannot be used on other platforms, such as Linux X86 operating system and Linux ARM operating system, which greatly limits the usage scenarios of the Android emulator and has great limitations. Summary of the invention

[0004] The embodiments of the present application provide an Android virtualization system, construction method and electronic device that support multiple platforms, thereby enabling the use of Android emulators on multiple platforms at least to a certain extent, greatly expanding the usage scenarios of Android emulators.

[0005] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0006] According to a first aspect of an embodiment of the present application, there is provided a multi-platform Android virtualization system, including: a plurality of Docker containers and a plurality of Emulator virtualization systems, wherein the Docker containers correspond to the Emulator virtualization systems one to one;

[0007] The Docker container is used to build the Emulator virtualization system, and is also used to install the OpenGL ES library required for the Android HAL layer call in the Emulator virtualization system;

[0008] The Emulator virtualization system includes a driver module and a gfxstream library, wherein the driver module is used to implement instruction transmission between the Android HAL layer and the Emulator virtualization system, and the gfxstream library is used to convert OpenGL ES instructions into OpenGL instructions recognizable by mesa;

[0009] The Emulator virtualization system is also used to parse the instruction content after reading the instruction content transmitted from the Android HAL layer, and call the gfxstream library to perform instruction conversion according to the parsed result.

[0010] In some embodiments of the present application, based on the aforementioned scheme, the instruction content includes parameters and numbers of the instruction.

[0011] In some embodiments of the present application, based on the above solution, the driver module is used to implement instruction transmission between the AndroidHAL layer and the Emulator virtualization system, including:

[0012] The driver module is used to mark pending instructions between the Android HAL layer and the Emulator virtualization system by numbering;

[0013] When the Android HAL layer transmits the pending instruction, the parameters of the pending instruction are also transmitted to the pending Emulator virtualization system through the driver module, and the pending Emulator virtualization system reads the instruction number and parameters from the driver module.

[0014] In some embodiments of the present application, based on the aforementioned scheme, the Emulator virtualization system is also used to call the GPU, fetch the stream from the video memory, and transmit it to the GPU, use the GPU encoding module to encode it into an H264 audio and video stream, and transmit the audio and video stream to the web end through the network for decoding and rendering.

[0015] In some embodiments of the present application, based on the aforementioned solution, the Docker container is used to start the process, isolate the system resources of the preset memory using the Linux Namespace mechanism, and create a child process through the clone system call.

[0016] In some embodiments of the present application, based on the aforementioned scheme, the Docker container is used to limit, control and count process resources through the Linux Cgroups mechanism, and the number of CPU cores, memory size and network bandwidth are added when starting the Docker container to achieve resource limitation.

[0017] According to a second aspect of an embodiment of the present application, a method for constructing a multi-platform Android virtualization system is provided, which is applied to a system as described in any one of the above items, and the method includes:

[0018] Calling the Docker container to build an Emulator virtualization system, and installing the OpenGL ES library required for the Android HAL layer call in the Emulator virtualization system;

[0019] Instructions are marked by numbers between the Android HAL layer and the Emulator virtualization system layer, and when the Android HAL layer transmits instructions, the numbers and parameters of the instructions are transmitted to the Emulator virtualization system layer through the driver module;

[0020] The Emulator virtualization system layer Emulator reads the number and parameters of the instruction from the driver module;

[0021] The number and parameters of the read instruction are parsed, and the gfxstream library is called to perform instruction conversion according to the parsed result.

[0022] In some embodiments of the present application, based on the above solution, the method further includes:

[0023] The Emulator virtualization system layer is used to call the GPU, obtain the stream from the video memory, and transmit it to the GPU. The encoding module of the GPU is used to encode the H264 audio and video stream, and the audio and video stream is transmitted to the web end through the network for decoding and rendering.

[0024] In some embodiments of the present application, based on the above solution, the method further includes:

[0025] The Docker container uses the Linux Namespace mechanism to isolate the system resources of the preset memory and creates a process through the clone system call.

[0026] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising the multi-platform Android virtualization system as described above.

[0027] In an embodiment of the present application, the present application supports a multi-platform Android virtualization system, including: multiple Docker containers and multiple Emulator virtualization systems, and the Docker containers and the Emulator virtualization systems correspond one to one; wherein the Docker container is used to build the Emulator virtualization system, and is also used to install the OpenGL ES library required for the AndroidHAL layer call in the Emulator virtualization system; the Emulator virtualization system includes a driver module and a gfxstream library, the driver module is used to realize instruction transmission between the Android HAL layer and the Emulator virtualization system, and the gfxstream library is used to convert the OpenGL ES instructions into OpenGL instructions recognizable by mesa; the Emulator virtualization system is also used to parse the instruction content after reading the instruction content transmitted from the Android HAL layer, and call the gfxstream library for instruction conversion according to the parsed result.

[0028] Using the system of the present application, since the Emulator virtualization system of the present application is built by a Docker container, the Emulator virtualization system is pulled up using the Docker container as the entire Android system, which can isolate resources, networks, etc. and use them efficiently.

[0029] At the same time, the Emulator virtualization system constructed by this application includes the gfxstream library, which is used to convert OpenGL ES instructions into OpenGL instructions recognizable by mesa. For the X86 system, the Emulator virtualization system (the virtualized Android system) has a built-in transcoding library for converting X86 instructions into ARM instruction sets. Therefore, the solution of this application supports running on Intel and AMD platforms, and runs on the Linux X86 operating system; for ARM systems, it supports running on domestic Kunpeng, Kirin, and Feiteng platforms. Kunpeng and Feiteng themselves are ARM instruction sets, and do not require instruction conversion, and can run perfectly compatible.

[0030] At the same time, this application uses gfxstream for command transformation, and upgrades gfxstream based on the original translator to improve performance and compatibility. Moreover, by using the gfxstream library to convert OpenGL ES commands into OpenGL commands that can be recognized by mesa, the graphics card can be called, because for mobile phones with Android systems, only OpenGL ES commands can be called; and the graphics card is Open GL command. It is necessary to convert OpenGL ES to OpenGL to call the graphics card through the Android system to improve performance.

[0031] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0033] Figure 1 A block diagram of a multi-platform Android virtualization system in an embodiment of the present application is shown;

[0034] Figure 2 A flow chart showing a method for a driver module to transmit instructions in an embodiment of the present application is shown;

[0035] Figure 3 A flowchart of a method for building a multi-platform Android virtualization system in an embodiment of the present application is shown.

[0036] Figure 4 A schematic diagram showing the structure of an electronic device in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0037] 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.

[0038] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0039] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0040] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.

[0041] In the description of this application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the feature. In the description of this application, unless otherwise specified, "plurality" means two or more.

[0042] In order to enable those skilled in the art to better understand the present application, the application scenarios involved in the present application are first briefly described.

[0043] Android emulator is the most typical Android virtual machine technology. The development of the emulator is due to the popularity of mobile games. Most users are not satisfied with the existing hardware limitations of mobile phone memory, graphics card, network speed, etc., so the demand for porting mobile applications to PC has emerged.

[0044] However, in the related art, the Android virtual machine technology cannot be implemented on other platforms, such as the Linux X86 operating system and the Linux ARM operating system. The main reason is that the development of the Linux operating system originated relatively late, resulting in only supporting Windows and Mac platforms in the early stage, and the Android virtual machine technology is not compatible with the Linux operating system. Moreover, in the related art, large-scale games generally use translators for command conversion, which has poor compatibility and does not support many OpenGL commands. In particular, the current mainstream applications use newer versions of OpenGL features and add a lot of new APIs, and the current translator command conversion does not support many commands, such as UE4 features, which results in the inability of UE4 framework games to run on the Linux operating system.

[0045] Moreover, in related technologies, virtual machines running large games will experience lag, high resource consumption, frequent crashes, and sluggishness. The main reason is that most virtual machines use CPU rendering, and Windows uses non-professional GPU rendering and encoding cards. For large games, the load is high, which will cause sluggishness.

[0046] In order to solve the above problems, the present application discloses the following technical solutions.

[0047] According to the first aspect of the embodiment of the present application, referring to Figure 1 , shows a block diagram of a multi-platform Android virtualization system in an embodiment of the present application, the system includes: multiple Docker containers and multiple Emulator virtualization systems, the Docker containers and the Emulator virtualization systems correspond one to one, for example, Figure 1 The figure shows two Docker containers and two Emulator virtualization systems, which correspond to each other. In the solution of this application, a host runs multiple containers, and each container is used to run the Android system.

[0048] The Docker container is used to build the Emulator virtualization system and to install the OpenGL ES library required for the Android HAL layer to call in the Emulator virtualization system. The Emulator virtualization system includes a driver module and a gfxstream library. The driver module is used to implement instruction transmission between the Android HAL layer and the Emulator virtualization system. The gfxstream library is used to convert OpenGL ES instructions into OpenGL instructions recognizable by mesa. The Emulator virtualization system is also used to parse the instruction content after reading the instruction content transmitted from the Android HAL layer, and call the gfxstream library for instruction conversion based on the parsed results.

[0049] Among them, continue to refer to Figure 1 The upper layer of the Docker container and Emulator virtualization system of this application includes the Android Runtime layer, which is responsible for executing and managing the runtime environment of the application. Above the Android Runtime layer is the APP layer, through which Android provides developers with the ability to build extremely rich and innovative applications. The lower layer of the Docker container and Emulator virtualization system includes the Linux kernel driver and the computer hardware driver.

[0050] In the embodiments of the present application, the present application utilizes Figure 1 The corresponding multi-platform Android virtualization system can run Emulator in docker to virtualize a complete Android system, so that Android applications can be seamlessly migrated to the system for operation. The implementation solution can run in Linux x86 / arm system to achieve cross-platform support and operation.

[0051] Specifically, using the system of the present application, since the Emulator virtualization system of the present application is built by a Docker container, the Emulator virtualization system is pulled up by the Docker container as the entire Android system, which can isolate resources, networks, etc. and use them efficiently.

[0052] In some embodiments of the present application, based on the aforementioned solution, the Emulator virtualization system of the present application has a built-in transcoding library for converting X86 instructions into ARM instruction sets, which can convert X86 instructions into ARM instructions.

[0053] At the same time, the Emulator virtualization system constructed by this application includes the gfxstream library, which is used to convert OpenGL ES instructions into OpenGL instructions recognizable by mesa. For the X86 system, the Emulator virtualization system (the virtualized Android system) has a built-in transcoding library for converting X86 instructions into ARM instruction sets. Therefore, the solution of this application supports running on Intel and AMD platforms, and runs on the Linux X86 operating system; for ARM systems, it supports running on domestic Kunpeng, Kirin, and Feiteng platforms. Kunpeng and Feiteng themselves are ARM instruction sets, and do not require instruction conversion, and can run perfectly compatible.

[0054] At the same time, this application uses gfxstream for command transformation, and upgrades gfxstream based on the original translator to improve performance and compatibility. Moreover, by using the gfxstream library to convert OpenGL ES commands into OpenGL commands that can be recognized by mesa, the graphics card can be called, because for mobile phones with Android systems, only OpenGL ES commands can be called; and the graphics card is Open GL command. It is necessary to convert OpenGL ES to OpenGL to call the graphics card through the Android system to improve performance.

[0055] In some embodiments of the present application, based on the above scheme, the instruction content of the present application includes the parameters and numbers of the instructions. Therefore, when the Emulator virtualization system parses the instruction content, the parameters and numbers of the instructions can be parsed, so that it can be more matched with gfxstream to complete the instruction conversion, thereby improving the conversion efficiency.

[0056] In some embodiments of the present application, based on the aforementioned scheme, such as Figure 2 As shown, a flow chart of the method for the driver module of the present application to perform instruction transmission is shown. The method for the driver module of the present application to implement instruction transmission between the Android HAL layer and the Emulator virtualization system includes steps 210 to 220.

[0057] Step 210: The driver module is used to mark pending instructions by number between the Android HAL layer and the Emulator virtualization system;

[0058] Step 220: When the pending instruction is transmitted in the Android HAL layer, the parameters of the pending instruction are also transmitted to the pending Emulator virtualization system through the driver module, and the pending Emulator virtualization system reads the instruction number and parameters from the driver module.

[0059] The present application marks pending instructions by number, and the parameters of the pending instructions are also transmitted to the pending emulator virtualization system through the driver module, and the pending emulator virtualization system reads the instruction number and parameters from the driver module. Since the source can be determined by marking to avoid errors, the method of reading the instruction number and parameters at the same time can effectively improve efficiency.

[0060] In some embodiments of the present application, based on the aforementioned scheme, the Emulator virtualization system is also used to call the GPU, fetch the stream from the video memory, and transmit it to the GPU, use the GPU encoding module to encode it into an H264 audio and video stream, and transmit the audio and video stream to the web end through the network for decoding and rendering.

[0061] In the embodiment of the present application, the present application uses GPU for encoding, making full use of the characteristics of GPU and reducing the CPU usage; and using GPU for encoding can realize the acceleration of graphics rendering, reconstruct the Android HAL graphics rendering module, realize the output of instructions to the Emulator layer to call GPU rendering, and realize 3D graphics rendering acceleration. Moreover, using the GPU encoding characteristics to encode audio and video streams can reduce the CPU load; at the same time, efficient use of GPU for rendering can be used to run large 3D games, accelerate graphics rendering, and effectively improve the image quality.

[0062] In some embodiments of the present application, based on the aforementioned solution, the Docker container is used to start the process, isolate the system resources of the preset memory using the Linux Namespace mechanism, and create a child process through the clone system call.

[0063] This solution can be used to further isolate resources, networks, etc. to avoid mutual impact.

[0064] In some embodiments of the present application, based on the aforementioned solution, the Docker container is used to limit, control and count process resources through the Linux Cgroups mechanism, and the number of CPU cores, memory size and network bandwidth are added when starting the Docker container to implement resource limitation.

[0065] The solution of the present application can limit, control and count process resources, further improving the efficiency of the system.

[0066] The above discloses the contents of the first aspect of the present application, and the following continues to disclose the contents of the second aspect of the present application.

[0067] According to the second aspect of the embodiment of the present application, Figure 3As shown, a flowchart of a method for building a multi-platform Android virtualization system in an embodiment of the present application is shown; the present application provides a method for building a multi-platform Android virtualization system, which is applied to a system as described in any of the above items, and the method includes steps 310-340.

[0068] Step 310: Call the Docker container to build the Emulator virtualization system, and install the OpenGL ES library required for the Android HAL layer call in the Emulator virtualization system;

[0069] Step 320: Mark the instructions by number between the Android HAL layer and the Emulator virtualization system layer. When the Android HAL layer transmits the instructions, the instruction number and parameters are transmitted to the Emulator virtualization system layer through the driver module.

[0070] Step 330: The Emulator virtualization system layer reads the instruction number and parameters from the driver module;

[0071] Step 340: Parse the number and parameters of the read instruction, and call the gfxstream library to perform instruction conversion according to the parsing result.

[0072] Using the above method of the present application, since the instruction conversion is performed by calling the gfxstream library, the multi-platform Android virtualization system built by this construction method can run on platforms such as the Linux X86 operating system and Linux ARM, and supports the conversion of multiple instruction sets. Specifically, it can support running on Intel, AMD, domestic Kunpeng, Kirin, and Feiteng platforms. Domestic Kunpeng and Feiteng themselves are arm instruction sets, and no instruction conversion is required. Intel and AMD platforms need to perform instruction conversion and support multiple instruction sets; (Why our solution can be applied to multiple systems, please explain the reasons in detail, and can be combined with existing comparisons) At present, most of the existing solutions on the market are ARM solutions, and Android applications are also developed under the arm system, so most of them are running on the arm platform. For the x86 platform, the conversion of x86 instructions to arm instructions has not been realized. Our solution has a built-in x86 instruction set to arm instruction set conversion library in the Android system, which can perfectly convert instructions to compatible operation. The Emulator layer has support adaptation for multiple platforms.

[0073] Moreover, by using the method of the present application, a container is used to pull up an Emulator to virtualize the entire Android system; and Docker is used to isolate resources, networks, etc., which can improve security.

[0074] Furthermore, by using the method of this application, the original translator is upgraded to gfxstream to support more OpenGL instructions and improve compatibility and performance. At the same time, gfxstream is used to transform instructions and gfxstream is upgraded based on the original translator to improve performance and compatibility.

[0075] In some embodiments of the present application, based on the above scheme, the instruction content of the present application includes the parameters and numbers of the instructions. Therefore, when the Emulator virtualization system parses the instruction content, the parameters and numbers of the instructions can be parsed, so that it can be more matched with gfxstream to complete the instruction conversion, thereby improving the conversion efficiency.

[0076] In some embodiments of the present application, based on the above solution, the method further includes:

[0077] The Emulator virtualization system layer is used to call the GPU, fetch the stream from the video memory, and transmit it to the GPU. The GPU encoding module is used to encode it into an H264 audio and video stream, which is then transmitted to the web end through the network for decoding and rendering.

[0078] By using the method of the present application, the GPU encoding characteristics are used to encode audio and video streams, making full use of the characteristics of the GPU, reducing the CPU usage and alleviating the CPU load; at the same time, the GPU is efficiently used for rendering to run large-scale 3D games, accelerate graphics rendering, reconstruct the Android HAL graphics rendering module, implement command output to the Emulator layer to call GPU rendering, and implement 3D graphics rendering acceleration.

[0079] In some embodiments of the present application, based on the above scheme, the method of the present application further includes:

[0080] The Docker container uses the Linux Namespace mechanism to isolate system resources of the preset memory and creates a process through the clone system call.

[0081] The above discloses the contents of the second aspect of the present application, and the following continues to disclose the contents of the third aspect of the present application.

[0082] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising the above-mentioned multi-platform Android virtualization system.

[0083] The electronic device provided in the embodiment of the present application can refer to Figure 4, shows a schematic diagram of the structure of an electronic device in an embodiment of the present application, the electronic device includes one or more memories 404, one or more processors 402 and at least one computer program (computer program instruction) stored in the memory 404 and executable on the processor 402, and the processor 402 implements the method described above when executing the computer program.

[0084] Among them, Figure 4 In the embodiment of the present invention, a bus architecture (represented by bus 400) is shown, which may include any number of interconnected buses and bridges, and bus 400 links various circuits including one or more processors represented by processor 402 and memory represented by memory 404. Bus 400 may also link various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. Bus interface 405 provides an interface between bus 400 and receiver 401 and transmitter 403. Receiver 401 and transmitter 403 may be the same element, namely a transceiver, providing a unit for communicating with various other devices over a transmission medium. Processor 402 is responsible for managing bus 400 and general processing, while memory 404 may be used to store data used by processor 402 when performing operations.

[0085] The functions described herein may be implemented in hardware, software executed by a processor, firmware, or any combination thereof. If implemented in software executed by a processor, the functions may be stored as one or more instructions or codes on a computer-readable medium or transmitted via a computer-readable medium. Other examples and implementations are within the scope and spirit of the present application and the appended claims. For example, due to the nature of software, the functions described above may be implemented using software executed by a processor, hardware, firmware, hard wiring, or a combination of any of these. In addition, each functional unit may be integrated into a processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit.

[0086] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0087] The units described as separate components may or may not be physically separated, and the components of the control device may or may not be physical units, that is, they may be located in one place or distributed in multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0088] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly or all or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc., which can store computer program instructions.

[0089] The above description is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.

Claims

1. A multi-platform Android virtualization system, characterized in that: include: A plurality of Docker containers and a plurality of Emulator virtualization systems, wherein the Docker containers and the Emulator virtualization systems correspond one to one; The Docker container is used to build the Emulator virtualization system, and is also used to install the OpenGL ES library required for the Android HAL layer call in the Emulator virtualization system; The Emulator virtualization system includes a driver module and a gfxstream library, wherein the driver module is used to implement instruction transmission between the Android HAL layer and the Emulator virtualization system, and the gfxstream library is used to convert OpenGL ES instructions into OpenGL instructions recognizable by mesa; The Emulator virtualization system is also used to parse the instruction content after reading the instruction content transmitted from the Android HAL layer, and call the gfxstream library to perform instruction conversion according to the parsed result.

2. The multi-platform Android virtualization system according to claim 1, characterized in that: The instruction content includes the parameters and number of the instruction.

3. The multi-platform Android virtualization system according to claim 2, characterized in that: The driver module is used to implement instruction transmission between the Android HAL layer and the Emulator virtualization system, including: The driver module is used to mark pending instructions between the Android HAL layer and the Emulator virtualization system by numbering; When the Android HAL layer transmits the pending instruction, the parameters of the pending instruction are also transmitted to the pending Emulator virtualization system through the driver module, and the pending Emulator virtualization system reads the instruction number and parameters from the driver module.

4. The multi-platform Android virtualization system according to claim 1, characterized in that: The Emulator virtualization system is also used to call the GPU, fetch the stream from the video memory, and transmit it to the GPU, use the GPU encoding module to encode it into an H264 audio and video stream, and transmit the audio and video stream to the web end through the network for decoding and rendering.

5. The multi-platform Android virtualization system according to claim 1, characterized in that: The Docker container is used to start the process and isolate the system resources of the preset memory by using the Linux Namespace mechanism, and create a child process through the clone system call.

6. The multi-platform Android virtualization system according to claim 1, characterized in that: The Docker container is used to limit, control and count process resources through the Linux Cgroups mechanism. When starting the Docker container, the number of CPU cores, memory size and network bandwidth are added to implement resource limitations.

7. A method for constructing a multi-platform Android virtualization system, characterized in that: Applied to the system according to any one of claims 1 to 6, the method comprises: Calling the Docker container to build an Emulator virtualization system, and installing the OpenGL ES library required for the Android HAL layer call in the Emulator virtualization system; Instructions are marked by numbers between the Android HAL layer and the Emulator virtualization system layer, and when the Android HAL layer transmits instructions, the numbers and parameters of the instructions are transmitted to the Emulator virtualization system layer through the driver module; The Emulator virtualization system layer reads the number and parameters of the instruction from the driver module; The number and parameters of the read instruction are parsed, and the gfxstream library is called to perform instruction conversion according to the parsed result.

8. The construction method according to claim 7, characterized in that: The method further comprises: The Emulator virtualization system layer is used to call the GPU, obtain the stream from the video memory, and transmit it to the GPU. The encoding module of the GPU is used to encode the H264 audio and video stream, and the audio and video stream is transmitted to the web end through the network for decoding and rendering.

9. The construction method according to claim 7, characterized in that: The method further comprises: The Docker container uses the Linux Namespace mechanism to isolate the system resources of the preset memory and creates a process through the clone system call.

10. An electronic device, comprising the multi-platform Android virtualization system as claimed in any one of claims 1 to 6.