A screen projection method, device, equipment and readable storage medium

By allocating ION display memory and establishing a mapping relationship in the Android system, screen data can be sent directly using the PCIe bus, solving the problems of high memory usage and latency in Android device screen projection and improving the user experience of head-mounted display devices.

CN115494946BActive Publication Date: 2026-08-04GEER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
GEER TECH CO LTD
Filing Date
2022-09-28
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Screen mirroring solutions for Android devices suffer from issues such as excessive memory consumption and high latency in head-mounted displays, resulting in a poor user experience.

Method used

By acquiring window layer data and allocating ION display memory in the Android system, a mapping relationship between ION display memory and the DMA of the PCIe EP display device is established. After hardware synthesis, the screen data is sent directly to the PCIe EP display device via the PCIe bus, avoiding memory copying.

Benefits of technology

It reduces memory usage, shortens the latency of projected images, and improves the user experience of head-mounted display devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115494946B_ABST
    Figure CN115494946B_ABST
Patent Text Reader

Abstract

The application discloses a screen projection method, device and equipment and a readable storage medium. The method comprises the following steps: obtaining window layer data and allocating ION display memory; establishing a mapping relationship between the ION display memory and a DMA inter-display device which is arranged inside a head-mounted display device or arranged outside the head-mounted display device; storing screen data obtained after hardware synthesis of the window layer data into the ION display memory; and sending the screen data to the PCIe EP display device through a PCIe bus by using the mapping relationship. Compared with a scheme in which a consumer and a producer each occupy a memory space and data transmission is performed by copying in two different memory spaces, the application only needs to occupy one ION display memory to provide the producer and the consumer with the screen projection, thereby reducing the memory occupation, saving the memory copying time, shortening the time delay of the screen projection picture and effectively improving the user experience of the head-mounted display device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer application technology, and in particular to a screen projection method, apparatus, device, and readable storage medium. Background Technology

[0002] Screen mirroring is the process of displaying the screen of device A onto the screen of another device B. In the Android operating system, the display adapter architecture is used to collect and discover physical display device services, thereby enabling screen mirroring.

[0003] Currently, Android systems typically use wireless connections and virtual display adapters for screen extension, i.e., screen mirroring. However, both virtual screens and wireless connections result in additional memory consumption and high latency in the mirrored image. When Android systems mirror their images to head-mounted displays, the resulting additional memory consumption and high latency ultimately lead to a poor user experience for the head-mounted display device.

[0004] In conclusion, how to effectively solve the problem of screen mirroring from Android devices to improve the user experience of head-mounted display devices is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] The purpose of this application is to provide a screen projection method, apparatus, device, and readable storage medium to reduce memory usage, shorten the latency of the projected image, and effectively improve the user experience of head-mounted display devices.

[0006] To solve the above-mentioned technical problems, this application provides the following technical solution:

[0007] A screen mirroring method, applied to the Android system, includes:

[0008] Get the window layer data and allocate memory for ION display;

[0009] A mapping relationship is established between the ION display memory and the DMA of the PCIe EP display device; wherein, the PCIe EP display device is located inside the head-mounted display device or outside the head-mounted display device;

[0010] After hardware synthesis of the window layer data, the resulting screen data is stored in the ION display memory;

[0011] Using the mapping relationship, the screen data is sent to the PCIe EP terminal display device via the PCIe bus.

[0012] Preferably, using the mapping relationship, the screen data is sent to the PCIe EP terminal display device via the PCIe bus, including:

[0013] Using the mapping relationship, the screen data is read from the ION display memory;

[0014] The screen data is sent to the PCIe EP display device via the PCIe bus.

[0015] Preferably, the step of acquiring window layer data includes:

[0016] The layers of each window are drawn using an Android application to obtain the window layer data.

[0017] Preferably, the allocation of ION display memory includes:

[0018] The window layer data is passed to the display management process;

[0019] Using the display management process, allocate the ION display memory to the window layer data.

[0020] Preferably, hardware synthesis of the window layer data includes:

[0021] The screen data is obtained by compositing the window layer data using a hardware compositor.

[0022] Once the synthesis is complete, a screen refresh notification is sent to the kernel.

[0023] Preferably, using the mapping relationship, the screen data is sent to the PCIe EP terminal display device via the PCIe bus, including:

[0024] After the kernel receives the screen refresh notification, it uses the DMA to send the screen data to the PCIe EP display device via the PCIe bus.

[0025] Preferably, establishing a mapping relationship between the ION display memory and the DMA of the PCIe EP display device includes:

[0026] The file descriptor corresponding to the memory displayed by the ION is passed to the kernel;

[0027] The kernel uses the file descriptor to establish the mapping relationship.

[0028] A screen mirroring device, used in the Android system, includes:

[0029] The memory allocation module is used to obtain window layer data and allocate memory for ION display.

[0030] A mapping establishment module is used to establish a mapping relationship between the ION display memory and the DMA of the PCIe EP terminal display device; wherein the PCIe EP terminal display device is disposed inside the head-mounted display device or outside the head-mounted display device;

[0031] The hardware compositing module is used to perform hardware compositing on the window layer data and then store the resulting screen data into the ION display memory.

[0032] The data transmission module is used to transmit the screen data to the PCIe EP terminal display device via the PCIe bus using the mapping relationship.

[0033] An electronic device, comprising:

[0034] Memory, used to store computer programs;

[0035] A processor is used to implement the steps of the above-described screen projection method when executing the computer program.

[0036] A readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described screen projection method.

[0037] The method provided in this application embodiment, applied in the Android system, includes: acquiring window layer data and allocating ION display memory; establishing a mapping relationship between the ION display memory and the DMA of the PCIe EP terminal display device; wherein the PCIe EP terminal display device is located inside or outside the head-mounted display device; after hardware synthesis of the window layer data, the resulting screen data is stored in the ION display memory; and the screen data is sent to the PCIe EP terminal display device via the PCIe bus using the mapping relationship.

[0038] In this application, during memory allocation, ION display memory is allocated. After allocating the ION display memory, a mapping relationship is established between the ION display memory and the DMA of the PCIe EP display device. Since ION can be shared between user-space processes or kernel-space modules, and this sharing can be zero-copy, after hardware synthesis is completed, the mapping relationship can be directly used to send the screen data to the PCIe EP display device located inside or outside the head-mounted display device via the PCIe bus. Therefore, compared to schemes where the consumer and producer each occupy a separate memory space and need to copy data between two different memory spaces, the screen projection scheme provided in this application only requires one ION display memory to provide for both the producer and consumer, thereby reducing memory usage, eliminating memory copy time, shortening the latency of the projected image, and effectively improving the user experience of the head-mounted display device.

[0039] Accordingly, embodiments of this application also provide a screen projection device, equipment, and readable storage medium corresponding to the above-described screen projection method, which have the aforementioned technical effects, and will not be elaborated further here. Attached Figure Description

[0040] To more clearly illustrate the technical solutions in the embodiments or related technologies of this application, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0041] Figure 1 This is a flowchart illustrating the implementation of a screen projection method in an embodiment of this application.

[0042] Figure 2 This is a schematic diagram of the structure of a screen projection device according to an embodiment of this application;

[0043] Figure 3 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application;

[0044] Figure 4 This is a schematic diagram of the specific structure of an electronic device in an embodiment of this application. Detailed Implementation

[0045] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0046] Please refer to Figure 1 , Figure 1 This is a flowchart of a screen mirroring method according to an embodiment of this application. The method can be applied to the Android system and includes the following steps:

[0047] S101. Obtain window layer data and allocate ION display memory.

[0048] Here, window layer data refers to the data corresponding to the layers of each window. Specifically, window layer data can be obtained by drawing the window or by directly reading pre-drawn window layer data. In this embodiment, the specific content corresponding to the window layer data is not limited.

[0049] In one specific embodiment of this application, obtaining window layer data specifically includes: using an Android application to draw the layers of each window to obtain window layer data. The Android application can specifically be an application with window layer drawing capabilities. That is, the Android application draws the layers of each window to obtain the window layer data. In this embodiment, the Android application itself is not limited, and the number of Android applications can be one or more.

[0050] ION is a memory allocation and management mechanism in Android that enables zero-copy shared memory between devices by allocating and sharing memory between hardware devices and user space. That is, ION can be used for memory sharing between user-space processes or between kernel-space modules, and this sharing can be zero-copy.

[0051] After obtaining the window layer data, ION can be used to allocate the corresponding memory. To distinguish it from the memory allocated by other memory allocators, in this application, the memory allocated for the window layer data using ION will be referred to as ION display memory.

[0052] In one specific embodiment of this application, allocating ION display memory includes:

[0053] Step 1: Pass the window layer data to the display management process;

[0054] Step 2: Using the display management process, allocate ION display memory to the window layer data.

[0055] For ease of description, the two steps above will be explained together below.

[0056] After an Android application has drawn the window layer data, it can pass the window layer data to the display management process (such as the SurfaceFlinger process, where SurfaceFlinger is a specific service within ION). The display management process can then allocate ION display memory for the window layer data. For details on how the display management process allocates ION display memory for window layer data, please refer to the specific definitions and implementations of ION memory management and memory sharing; these will not be elaborated upon here.

[0057] S102. Establish a mapping relationship between the ION display memory and the DMA of the PCIe EP display device.

[0058] In some embodiments, the PCIe EP end display device is disposed inside the head-mounted display device. For example, the head-mounted display device is specifically a VR device, and the PCIe EP end display device is the display screen located in front of the user's eyes when worn.

[0059] In some embodiments, the PCIe EP terminal display device can be set independently of the head-mounted display device, for example, it can be set outside the head-mounted display device, or the PCIe EP terminal display device can be externally attached to the head-mounted display device, for example, it can be fixedly connected or detachably connected to the front or side of the head-mounted display device.

[0060] In PCIe, EP (EndPoint) represents the endpoint of a transmission. In this embodiment, the PCIe EP end display device is the corresponding EP device during PCIe transmission; the EP device represents a serial or I / O device. In EP mode, the type value in the PCIe configuration header is 0; in EP mode, the PCIe controller receives read and write operations for the local memory space.

[0061] DMA (Direct Memory Access) is a high-speed data transfer operation that allows direct reading and writing of data between external devices and memory, without the CPU's involvement or intervention. The entire data transfer operation is controlled by a DMA controller. The CPU performs some processing at the beginning and end of the data transfer, and can perform other tasks during the transfer process.

[0062] In this application, the PCIe EP display device and the device equipped with the Android system are connected via the PCIe bus. PCIe, or PCI-Express, corresponds to a high-speed serial computer expansion bus standard, which belongs to high-speed serial point-to-point dual-channel high-bandwidth transmission.

[0063] In this embodiment, to reduce memory usage and avoid data copying operations within the allocated ION display memory, the ION display memory is shared, allowing it to be shared by both screen data producers and consumers. Therefore, in this embodiment, a mapping relationship needs to be established between the ION display memory and the DMA of the PCIe EP display device. This allows the DMA to access the ION display memory based on this mapping relationship.

[0064] In other words, to reduce memory usage, a mapping relationship is established between the ION display memory and the DMA of the PCIe EP display device. This allows the PCIe EP display device's DMA to use the ION display memory. Specifically, the ION display memory is used not only by the screen casting producer (Android system, specifically the Android application generating screen data and the hardware synthesizer) but also shared by the screen casting consumer (external PCIe EP display device, specifically the DMA sending screen data to the PCIe EP display device). Thus, screen data producers and consumers can share the same ION display memory, reducing memory usage and eliminating the need for additional data copying in memory.

[0065] For example, in related solutions, memory space A is allocated to screen data producers, and memory space B is allocated to ohm data consumers. Memory space A and memory space B are different. When screen data is generated, it is first stored in memory space A. When transmission is needed, the screen data is first read from memory space A and then copied to memory space B. It is evident that this type of solution occupies two memory locations and involves a memory copying process. However, in the solution provided in this application embodiment, screen data producers and consumers share the ION display memory, thus not occupying an additional memory space, and data copying is unnecessary within the same memory space.

[0066] In one specific embodiment of this application, step S102 establishes a mapping relationship between the ION display memory and the DMA of the PCIe EP display device, including:

[0067] Step 1: Pass the file descriptor corresponding to the memory displayed by ION to the kernel;

[0068] Step 2: The kernel uses file descriptors to establish a mapping relationship.

[0069] For ease of description, the two steps above will be explained together below.

[0070] The kernel uses file descriptors to access files. File descriptors are non-negative integers. When opening an existing file or creating a new file, the kernel returns a file descriptor. Reading and writing files also require using a file descriptor to specify the file to be read or written.

[0071] The ION displays the file descriptor corresponding to the memory location and passes it to the kernel. Once the kernel receives the file descriptor, it can establish the DMA mapping based on it.

[0072] S103. After hardware synthesis of the window layer data, the resulting screen data is stored in the ION display memory.

[0073] Hardware synthesis refers to the process of using hardware to combine image data from window layer data to obtain screen data that can be displayed. After obtaining the screen data, it is stored in the ION display memory.

[0074] In one specific embodiment of this application, hardware synthesis of window layer data includes:

[0075] Step 1: Use a hardware compositor to composite the window layer data to obtain screen data;

[0076] Step 2: After the synthesis is complete, send a screen refresh notification to the kernel.

[0077] For ease of description, the two steps above will be explained together below.

[0078] This means that a hardware compositor can be used to composite the window layer data to obtain the screen data. After the composite is complete, a screen refresh notification is sent to the kernel so that the kernel can refresh the screen.

[0079] Specifically, in practical applications, this hardware compositor can use HWC (Hardware Composer) to composite window layer data to obtain screen data.

[0080] S104. Using the mapping relationship, the screen data is sent to the PCIe EP terminal display device through the PCIe bus.

[0081] This mapping relationship corresponds to the mapping between the ION display memory and the DMA of the PCIe EP display device. Therefore, using this mapping relationship, screen data can be sent to the PCIe EP display device via the PCIe bus.

[0082] In one specific embodiment of this application, step S104 utilizes a mapping relationship to send screen data to the PCIe EP terminal display device via the PCIe bus, including:

[0083] Step 1: Use the mapping relationship to read screen data from the ION display memory;

[0084] Step 2: Send screen data to the PCIe EP display device via the PCIe bus.

[0085] For ease of description, the two steps above will be explained together below.

[0086] When updating the screen on a PCIe EP display device, the screen data is directly read from the ION display memory using the mapping relationship. Then, the screen data is sent to the PCIe EP display device via the PCIe bus. As can be seen, this process does not involve data copying; it directly reads the screen data from the ION display memory. Eliminating the screen data copying step allows the projected image from the PCIe EP display device to arrive faster, reducing latency.

[0087] In one specific embodiment of this application, step S104 utilizes a mapping relationship to send screen data to the PCIe EP display device via the PCIe bus, including: after the kernel receives a screen refresh notification, using DMA to send the screen data to the PCIe EP display device via the PCIe bus. That is, sending screen data to the PCIe EP display device is based on the kernel receiving the screen refresh notification. Furthermore, the data transmission can be specifically controlled and processed by DMA. For details on how DMA specifically controls and processes screen data, please refer to the definition of DMA and its transmission control implementation.

[0088] After receiving the screen data, the PCIe EP display device can display it on its screen based on the screen data, thus completing the screen projection from the Android system to the PCIe EP display device.

[0089] Applying the method provided in the embodiments of this application,

[0090] The system acquires window layer data and allocates ION display memory; it establishes a mapping relationship between the ION display memory and the DMA of the PCIe EP terminal display device; wherein the PCIe EP terminal display device is located inside or outside the head-mounted display device; after hardware synthesis of the window layer data, the resulting screen data is stored in the ION display memory; using the mapping relationship, the screen data is sent to the PCIe EP terminal display device via the PCIe bus.

[0091] In this application, during memory allocation, ION display memory is allocated. After allocating the ION display memory, a mapping relationship is established between the ION display memory and the DMA of the PCIe EP display device. Since ION can be shared between user-space processes or kernel-space modules, and this sharing can be zero-copy, after hardware synthesis is completed, the mapping relationship can be directly used to send the screen data to the PCIe EP display device located inside or outside the head-mounted display device via the PCIe bus. Therefore, compared to schemes where the consumer and producer each occupy a separate memory space and need to copy data between two different memory spaces, the screen projection scheme provided in this application only requires one ION display memory to provide for both the producer and consumer, thereby reducing memory usage, eliminating memory copy time, shortening the latency of the projected image, and effectively improving the user experience of the head-mounted display device.

[0092] To help those skilled in the art better understand the screen projection method provided in the embodiments of this application, the screen projection method will be described in detail below with specific application scenarios as examples.

[0093] Taking the use of screen projection in a VR scene as an example, the specific process of implementing screen projection includes the following steps:

[0094] Step (1): The Android application draws the layers of each window.

[0095] Step (2): The drawn window layer data is handed over to the SurfaceFlinger process display management process, and ION display memory is allocated. Specifically, this includes:

[0096] Step a: SurfaceFlinger passes the file descriptor corresponding to the allocated ION display memory to the kernel;

[0097] Step b: After receiving the ION file descriptor, the kernel maps it to the DMA region of the PCIe EP display device.

[0098] Step (3): SurfaceFlinger hands over all layers to HWC for hardware compositing.

[0099] Step (4): After HWC completes the hardware synthesis, it notifies the kernel to refresh the display data.

[0100] Step (5): After receiving the screen refresh notification, the kernel sends the screen refresh data (the same as the screen data mentioned above) in the ION display memory to the PCIe EP display device via DMA.

[0101] PCIe EP display devices, such as VR devices, display data after receiving refresh data sent via the PCIe cable.

[0102] Therefore, the screen mirroring method provided in this application can solve the problems of high system overhead and long latency when using an extended screen in the Android system. By connecting the extended screen via a PCIe cable, data transmission and sharing on the extended screen can be completed efficiently and quickly while the main display is working normally.

[0103] Corresponding to the above method embodiments, this application also provides a screen projection device. The screen projection device described below can be referred to in correspondence with the screen projection method described above.

[0104] See Figure 2 As shown, this device uses the Android system and specifically includes the following modules:

[0105] The memory allocation module 101 is used to obtain window layer data and allocate memory for ION display.

[0106] The mapping establishment module 102 is used to establish a mapping relationship between the ION display memory and the DMA of the PCIe EP display device; wherein, the PCIe EP display device is located inside the head-mounted display device or externally attached to the outside of the head-mounted display device;

[0107] The hardware compositing module 103 is used to perform hardware compositing on the window layer data and then store the resulting screen data into the ION display memory.

[0108] The data transmission module 104 is used to transmit screen data to the PCIe EP terminal display device via the PCIe bus using the mapping relationship.

[0109] The apparatus provided in the embodiments of this application, when used in an Android system, includes:

[0110] The system acquires window layer data and allocates ION display memory; it establishes a mapping relationship between the ION display memory and the DMA of the PCIe EP terminal display device; wherein the PCIe EP terminal display device is located inside or outside the head-mounted display device; after hardware synthesis of the window layer data, the resulting screen data is stored in the ION display memory; using the mapping relationship, the screen data is sent to the PCIe EP terminal display device via the PCIe bus.

[0111] In this application, during memory allocation, ION display memory is allocated. After allocating the ION display memory, a mapping relationship is established between the ION display memory and the DMA of the PCIe EP display device. Since ION can be shared between user-space processes or kernel-space modules, and this sharing can be zero-copy, after hardware synthesis is completed, the mapping relationship can be directly used to send the screen data to the PCIe EP display device located inside or outside the head-mounted display device via the PCIe bus. Therefore, compared to schemes where the consumer and producer each occupy a separate memory space and need to copy data between two different memory spaces, the screen projection scheme provided in this application only requires one ION display memory to provide for both the producer and consumer, thereby reducing memory usage, eliminating memory copy time, shortening the latency of the projected image, and effectively improving the user experience of the head-mounted display device.

[0112] In one specific embodiment of this application, the data sending module 104 is specifically used to read screen data from the ION display memory using a mapping relationship;

[0113] Screen data is sent to the PCIe EP display device via the PCIe bus.

[0114] In one specific embodiment of this application, the memory allocation module 101 is specifically used to draw the layers of each window using an Android application to obtain window layer data.

[0115] In one specific embodiment of this application, the memory allocation module 101 is specifically used to pass window layer data to the display management process;

[0116] The display management process allocates ION display memory to window layer data.

[0117] In one specific embodiment of this application, the hardware synthesis module 103 is specifically used to synthesize window layer data using a hardware synthesizer to obtain screen data;

[0118] Once the synthesis is complete, a screen refresh notification is sent to the kernel.

[0119] In one specific embodiment of this application, the data sending module 104 is specifically used to send screen data to the PCIe EP terminal display device via the PCIe bus using DMA after the kernel receives a screen refresh notification.

[0120] In one specific embodiment of this application, the mapping establishment module 102 is specifically used to pass the file descriptor corresponding to the ION display memory to the kernel;

[0121] The kernel uses file descriptors to establish mapping relationships.

[0122] Corresponding to the above method embodiments, this application also provides an electronic device. The electronic device described below and the screen projection method described above can be referred to in correspondence.

[0123] See Figure 3 As shown, the electronic device includes:

[0124] Memory 332 is used to store computer programs;

[0125] The processor 322 is used to implement the screen projection method steps of the above method embodiments when executing a computer program.

[0126] For details, please refer to Figure 4 , Figure 4 This is a schematic diagram of a specific structure of an electronic device provided in this embodiment. The electronic device can vary significantly due to differences in configuration or performance. It may include one or more central processing units (CPUs) 322 (e.g., one or more processors) and a memory 332. The memory 332 stores one or more computer application programs 342 or data 344. The memory 332 can be temporary or persistent storage. The program stored in the memory 332 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the data processing device. Furthermore, the central processing unit 322 may be configured to communicate with the memory 332 and execute the series of instruction operations stored in the memory 332 on the electronic device 301.

[0127] Electronic device 301 may also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341.

[0128] The steps in the screen mirroring method described above can be implemented by the structure of an electronic device.

[0129] Corresponding to the above method embodiments, this application also provides a readable storage medium. The readable storage medium described below can be referred to in conjunction with the screen projection method described above.

[0130] A readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the screen projection method described in the above method embodiments.

[0131] Specifically, the readable storage medium can be a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, or any other readable storage medium capable of storing program code.

[0132] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0133] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0134] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0135] Finally, it should be noted that in this document, terms such as include, encompass, or any other variation are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that includes a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0136] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A screen projection method, characterized in that, Applied to the Android system, including: Get the window layer data and allocate ION display memory; where ION display memory is the memory allocated using ION for the window layer data; A mapping relationship is established between the ION display memory and the DMA of the PCIe EP display device, so that the DMA of the PCIe EP display device uses the ION display memory; wherein, the PCIe EP display device is disposed inside the head-mounted display device or outside the head-mounted display device; After hardware synthesis of the window layer data, the resulting screen data is stored in the ION display memory; Using the mapping relationship, the screen data is sent to the PCIe EP terminal display device via the PCIe bus.

2. The screen projection method according to claim 1, characterized in that, The process of obtaining window layer data includes: The layers of each window are drawn using an Android application to obtain the window layer data.

3. The screen projection method according to claim 1, characterized in that, The allocation of ION display memory includes: The window layer data is passed to the display management process; Using the display management process, allocate the ION display memory to the window layer data.

4. The screen projection method according to claim 1, characterized in that, Hardware synthesis of the window layer data includes: The screen data is obtained by compositing the window layer data using a hardware compositor. Once the synthesis is complete, a screen refresh notification is sent to the kernel.

5. The screen projection method according to claim 4, characterized in that, Using the mapping relationship, the screen data is sent to the PCIe EP display device via the PCIe bus, including: After the kernel receives the screen refresh notification, it uses the DMA to send the screen data to the PCIe EP display device via the PCIe bus.

6. The screen projection method according to any one of claims 1 to 5, characterized in that, Establishing a mapping relationship between the ION display memory and the DMA of the PCIeEP display device includes: The file descriptor corresponding to the memory displayed by the ION is passed to the kernel; The kernel uses the file descriptor to establish the mapping relationship.

7. A screen projection device, characterized in that, Applied to the Android system, including: The memory allocation module is used to obtain window layer data and allocate ION display memory; where ION display memory is the memory allocated using ION for window layer data; A mapping establishment module is used to establish a mapping relationship between the ION display memory and the DMA of the PCIe EP terminal display device, so that the DMA of the PCIe EP terminal display device uses the ION display memory; wherein, the PCIe EP terminal display device is disposed inside the head-mounted display device or outside the head-mounted display device; The hardware compositing module is used to perform hardware compositing on the window layer data and then store the resulting screen data into the ION display memory. The data transmission module is used to transmit the screen data to the PCIe EP terminal display device via the PCIe bus using the mapping relationship.

8. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the screen projection method as described in any one of claims 1 to 6 when executing the computer program.

9. A readable storage medium, characterized in that, The readable storage medium stores a computer program that, when executed by a processor, implements the steps of the screen projection method as described in any one of claims 1 to 6.