Screen mirroring method and related apparatus

RDMA network card technology directly transmits screen projection information in the user mode, which solves the problems of delay and lag in existing screen projection technology, achieves efficient and low-latency screen projection fluency and image quality, and improves the user experience.

WO2024222739A1PCT designated stage expired Publication Date: 2024-10-31HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/089559
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-28
Filing Date
2024-04-24
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

Existing screen projection technology suffers from large delays and freezes in wireless environments, which affects user experience especially when network conditions are poor.

Method used

Using Remote Direct Memory Access (RDMA) network card technology, data transmission is performed directly in user mode, avoiding context switching between data copying to the network software stack and kernel mode. The first electronic device can directly write screen projection information to the second electronic device. The device's memory space provides microsecond access latency and high throughput.

Benefits of technology

Significantly reduces screen projection delay, improves fluency and user experience, reduces CPU load, and avoids image quality degradation caused by codec and data compression.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024089559_31102024_PF_FP_ABST
    Figure CN2024089559_31102024_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a screen mirroring method and a related apparatus. The method comprises: a first electronic device receives a first input operation, wherein the first input operation is used for triggering the first electronic device to mirror a screen to a second electronic device; on the basis of the first input operation, an RDMA network adapter of the first electronic device sends a first request to an RDMA network adapter of the second electronic device, wherein the first request comprises first screen mirroring information and the address of a second memory space of the second electronic device, and the first request is used for instructing to write the first screen mirroring information into the second memory space; on the basis of the first request, the RDMA network adapter of the second electronic device writes the first screen mirroring information into the second memory space; the second electronic device outputs the first screen mirroring information on the basis of data stored in the second memory space. In this way, the screen mirroring time delay can be effectively reduced, the screen mirroring smoothness is improved, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Screen projection method and related device

[0001] This application claims priority to the Chinese patent application with application number 202310491797.9 filed with the State Intellectual Property Office of China on April 28, 2023, and priority to the Chinese patent application with the invention name “Screen projection method and related device”, all contents of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of electronic technology, and in particular to a screen projection method and related devices. Background Art

[0003] Screen projection technology allows you to project the display content or media files (photo gallery, music, and video) of a smart terminal onto one or more other devices. This technology covers scenarios such as mobile office, smart cars, and smart home screens. The multi-screen linkage and synergy of multiple smart terminals is a key component in building a comprehensive ecosystem.

[0004] At present, since the devices on both sides of the wireless screen projection need to perform a series of processing such as encoding and decoding the projected content, the screen projection delay is relatively large; when the network is poor or the network fluctuates greatly, the screen projection is prone to lag, and the user experience is poor.

[0005] Summary of the Invention

[0006] This application provides a screen projection method and related devices, which can effectively reduce the screen projection delay, improve the screen projection smoothness, and enhance the user experience.

[0007] In the first aspect, the present application provides a screen projection method, which is applied to a screen projection system, wherein the screen projection system includes a first electronic device and a second electronic device, and the above method includes: the first electronic device receives a first input operation, and the first input operation is used to trigger the first electronic device to project the screen to the second electronic device; based on the first input operation, the remote direct memory access (RDMA) network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, and the first request includes the first screen projection information and the address of the second memory space of the second electronic device, and the first request is used to indicate that the first screen projection information is written to the second memory space; based on the first request, the RDMA network card of the second electronic device writes the first screen projection information to the second memory space; the second electronic device outputs the first screen projection information based on the data stored in the second memory space.

[0008] By implementing the embodiments of the present application and utilizing an RDMA network card, data transmission can be performed directly in user mode; there is no need to copy the data to the network software stack, nor is there any need to perform context switching between kernel mode and user mode multiple times. The first electronic device can directly write the projection information stored in this device into the second memory space of the second electronic device; the RDMA network card can provide microsecond-level access latency and high throughput. In this way, after the first electronic device generates the projection information, the second electronic device can obtain and output the projection information in a very short time, effectively reducing the projection delay and improving the smoothness of the projection. In addition, by utilizing the RDMA network card, the second electronic device accesses the projection information of the specific memory of the first electronic device without the intervention of the central processing unit (CPU) of the first electronic device, effectively reducing the CPU load of the projection.

[0009] In one implementation, the first projection information includes image data of the first projection screen; and the second electronic device outputs the first projection information based on the data stored in the second memory space, including: the display screen of the second electronic device displays the first projection screen based on the data stored in the second memory space. When implementing this embodiment of the present application, after the first electronic device generates the projection screen, the second electronic device can obtain and display the projection screen in a very short time, effectively reducing projection latency and improving projection fluency.

[0010] In one implementation, the first screen projection information includes audio data of the first screen projection audio; and the second electronic device outputs the first screen projection information based on the data stored in the second memory space, including: the audio output device of the second electronic device outputs the first screen projection audio based on the data stored in the second memory space. When implementing the embodiment of the present application, after the first electronic device generates the screen projection audio, the second electronic device can obtain and display the screen projection audio in a very short time, effectively reducing the screen projection delay and improving the smoothness of the screen projection.

[0011] In one implementation, before the RDMA network card of the first electronic device sends the first request to the RDMA network card of the second electronic device, it also includes: after the first electronic device detects that the first electronic device synthesizes the first projection information and stores it in the first memory space, the RDMA network card of the first electronic device generates a first request based on the first projection information in the first memory space. The implementation of the embodiment of the present application is combined with the existing caching mechanism of projection information, for example, the synthesized projection screen will be cached in the display buffer; when it is detected that the projection information is cached in the display buffer, it triggers the second electronic device to write the projection information to the first electronic device in a timely manner, effectively reducing the projection delay.

[0012] In one implementation, the first projection information includes image data of the first projection screen; the clocks of the first electronic device and the second electronic device are synchronized, and the above method further includes: writing the first projection screen into the first memory space of the first electronic device in a first refresh cycle; in a refresh cycle next to the first refresh cycle, the display screen of the first electronic device displays the first projection screen based on the data stored in the first memory space; the RDMA network card of the second electronic device writes the first projection information into the second memory space, including: in the first refresh cycle, the RDMA network card of the second electronic device writes the first projection information into the second memory space; the second electronic device outputs the first projection information based on the data stored in the second memory space, including: in a refresh cycle next to the first refresh cycle, the display screen of the second electronic device displays the first projection screen based on the data stored in the second memory space. In implementing the embodiment of the present application, when the clocks of the first electronic device and the second electronic device are synchronized, after the first electronic device generates the projection information, the second electronic device can obtain the projection screen in a very short time before the next refresh cycle arrives and cache it in the display buffer; thereby ensuring that the two electronic devices can simultaneously display the projection screen based on the data in the display buffer in the next refresh cycle, effectively improving the user experience.

[0013] In one implementation, after the first electronic device receives the first input operation, before the RDMA network card of the first electronic device sends the first request to the RDMA network card of the second electronic device, the above method further includes: the second electronic device sends a first RDMA message to the first electronic device, the first RDMA message includes the address of the second memory space of the second electronic device, and the second memory space is used to store the projection information from the first electronic device. In implementing the embodiment of the present application, the second electronic device informs the first electronic device of the address of the second memory space for storing the projection information in advance, so that the first electronic device can subsequently use the RDMA network card to write the projection information to the second memory space of the second electronic device in a timely manner.

[0014] In one implementation, before the second electronic device sends the first RDMA message to the first electronic device, it also includes: the second electronic device registers the second memory space to the RDMA network card of the second electronic device, and obtains the first key corresponding to the address of the second memory space; the first RDMA message also includes the first key, and the first request also includes the first key; based on the first request, the RDMA network card of the second electronic device writes the first projection information into the second memory space, including: after the RDMA network card of the second electronic device determines that the first key included in the first request is the key corresponding to the address of the second memory space, the first projection information is written into the second memory space. In implementing the embodiment of the present application, the second electronic device registers the second memory space for storing projection information with the RDMA network card in advance to obtain the key corresponding to the second memory space; the key can ensure the security of subsequent data transmission between the first electronic device and the second electronic device.

[0015] In one implementation, before the RDMA network card of the second electronic device sends the first RDMA message to the RDMA network card of the first electronic device, the process further includes: based on the first input operation, the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, and the first RDMA message and the first request are sent through the RDMA connection.

[0016] In one implementation, before the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, it also includes: in response to the first input operation, the first electronic device sends a screen projection request to the second electronic device through the first communication module; the first electronic device receives the screen projection response sent by the second electronic device through the first communication module; the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, including: when determining to project the screen based on the screen projection response, the RDMA network card of the second electronic device and the RDMA network card of the first electronic device establish an RDMA connection.

[0017] In one implementation, after the second electronic device outputs the first screen projection information based on the data stored in the second memory space, the method includes: the second electronic device receives a second input operation; the second electronic device stores the first screen projection reverse control event corresponding to the second input operation in the third memory space; the RDMA network card of the second electronic device sends a second request to the RDMA network card of the first electronic device, the second request including the data of the first screen projection reverse control event and the address of the fourth memory space of the first electronic device, the second request being used to instruct that the data of the first screen projection reverse control event be written into the fourth memory space; based on the second request, the RDMA network card of the first electronic device writes the data of the first screen projection reverse control event into the fourth memory space; based on the first screen projection reverse control event stored in the fourth memory space, the first electronic device executes a first response event. In implementing the embodiment of the present application, using the RDMA network card, data transmission can be performed directly in user mode; without copying the data to the network software stack or performing context switching between kernel mode and user mode multiple times, the second electronic device can directly write the screen projection reverse control event stored by the second electronic device into the fourth memory space of the first electronic device. In this way, after the second electronic device generates a screen projection reverse control event, the first electronic device can obtain the screen projection reverse control event in a very short time, and then determine and execute the response event corresponding to the event in the fourth memory space according to the existing mechanism, effectively reducing the screen projection reverse control delay and improving the smoothness of the screen projection. In addition, by using the RDMA network card, the first electronic device accesses the screen projection reverse control event of the specific memory of the second electronic device, and does not require the intervention of the central processing unit (CPU) of the second electronic device, which effectively reduces the CPU load of the screen projection reverse control.

[0018] In one implementation, before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, the second electronic device also includes: after the second electronic device detects that the first screen projection reverse control event is stored in the third memory space, the RDMA network card of the second electronic device generates a second request based on the data of the first screen projection reverse control event in the third memory space. The implementation of the embodiment of the present application is combined with the existing caching mechanism of input events, for example, the screen projection reverse control event will be cached in the event buffer; when it is detected that the above event is cached in the event buffer, it triggers the first electronic device to write the screen projection reverse control event to the second electronic device in a timely manner, effectively reducing the screen projection reverse control delay.

[0019] In one implementation, before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, the method further includes: the first electronic device sends a second RDMA message to the second electronic device, the second RDMA message including the address of the fourth memory space of the first electronic device, and the fourth memory space is used to store input events of the first electronic device. In implementing the embodiment of the present application, the first electronic device notifies the second electronic device of the address of the fourth memory space for storing input events in advance, so that the second electronic device can subsequently use the RDMA network card to promptly write the screen projection reverse control event into the fourth memory space of the first electronic device.

[0020] In the second aspect, the present application provides a screen projection method, which is applied to a first electronic device, including: the first electronic device receives a first input operation, and the first input operation is used to trigger the first electronic device to project the screen to a second electronic device; based on the first input operation, the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, and the first request includes the first screen projection information and the address of the second memory space of the second electronic device, and the first request is used to indicate that the first screen projection information is written to the second memory space.

[0021] By implementing the embodiments of the present application and utilizing an RDMA network card, data transmission can be performed directly in user mode; there is no need to copy the data to the network software stack, nor is there any need to perform context switching between kernel mode and user mode multiple times. The first electronic device can directly write the projection information stored in this device into the second memory space of the second electronic device; the RDMA network card can provide microsecond-level access latency and high throughput. In this way, after the first electronic device generates the projection information, the second electronic device can obtain and output the projection information in a very short time, effectively reducing the projection delay and improving the smoothness of the projection. In addition, by utilizing the RDMA network card, the second electronic device accesses the projection information of the specific memory of the first electronic device without the intervention of the central processing unit (CPU) of the first electronic device, effectively reducing the CPU load of the projection.

[0022] In one implementation, the first projection information includes image data of the first projection screen; the first projection information stored in the second memory space is used to display the first projection screen on the display screen of the second electronic device.

[0023] In one implementation, the first screen projection information includes audio data of the first screen projection audio; the first screen projection information stored in the second memory space is used for the audio output device of the second electronic device to output the first screen projection audio.

[0024] In one implementation, before the RDMA network card of the first electronic device sends the first request to the RDMA network card of the second electronic device, it also includes: after the first electronic device detects that the first electronic device synthesizes the first projection information and stores it in the first memory space, the RDMA network card of the first electronic device generates a first request based on the first projection information in the first memory space.

[0025] In one implementation, after the first electronic device receives the first input operation, and before the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, the above method also includes: the first electronic device receives a first RDMA message sent by the second electronic device, the first RDMA message includes the address of the second memory space of the second electronic device, and the second memory space is used to store the screen projection information from the first electronic device.

[0026] In one implementation, before the RDMA network card of the second electronic device sends the first RDMA message to the RDMA network card of the first electronic device, the process further includes: based on the first input operation, the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, and the first RDMA message and the first request are sent through the RDMA connection.

[0027] In one implementation, before the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, it also includes: in response to the first input operation, the first electronic device sends a screen projection request to the second electronic device through the first communication module; the first electronic device receives the screen projection response sent by the second electronic device through the first communication module; the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, including: when determining to project the screen based on the screen projection response, the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection.

[0028] In one implementation, after the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, the method includes: the RDMA network card of the first electronic device receives a second request sent by the RDMA network card of the second electronic device, the second request includes data of the first screen projection reverse control event and the address of the fourth memory space of the first electronic device, and the second request is used to indicate that the data of the first screen projection reverse control event is written into the fourth memory space; based on the second request, the RDMA network card of the first electronic device writes the data of the first screen projection reverse control event into the fourth memory space; based on the first screen projection reverse control event stored in the fourth memory space, the first electronic device executes a first response event.

[0029] In one implementation, before the RDMA network card of the first electronic device receives the second request sent by the RDMA network card of the second electronic device, the above method also includes: the first electronic device sends a second RDMA message to the second electronic device, the second RDMA message includes the address of the fourth memory space of the first electronic device, and the fourth memory space is used to store input events.

[0030] In the third aspect, the present application provides a screen projection method, which is characterized in that it is applied to a second electronic device, including: the RDMA network card of the second electronic device receives a first request sent by the RDMA network card of the first electronic device, the first request includes first screen projection information and the address of the second memory space of the second electronic device, and the first request is used to indicate that the first screen projection information is written to the second memory space; based on the first request, the RDMA network card of the second electronic device writes the first screen projection information to the second memory space; the second electronic device outputs the first screen projection information based on the data stored in the second memory space.

[0031] By implementing the embodiments of the present application and utilizing an RDMA network card, data transmission can be performed directly in user mode; there is no need to copy the data to the network software stack, nor is there any need to perform context switching between kernel mode and user mode multiple times. The first electronic device can directly write the projection information stored in this device into the second memory space of the second electronic device; the RDMA network card can provide microsecond-level access latency and high throughput. In this way, after the first electronic device generates the projection information, the second electronic device can obtain and output the projection information in a very short time, effectively reducing the projection delay and improving the smoothness of the projection. In addition, by utilizing the RDMA network card, the second electronic device accesses the projection information of the specific memory of the first electronic device without the intervention of the central processing unit (CPU) of the first electronic device, effectively reducing the CPU load of the projection.

[0032] In one implementation, the first projection information includes image data of the first projection screen; the second electronic device outputs the first projection information based on the data stored in the second memory space, including: the display screen of the second electronic device displays the first projection screen based on the data stored in the second memory space.

[0033] In one implementation, the first screen projection information includes audio data of the first screen projection audio; the second electronic device outputs the first screen projection information based on the data stored in the second memory space, including: the audio output device of the second electronic device outputs the first screen projection audio based on the data stored in the second memory space.

[0034] In one implementation, before the RDMA network card of the second electronic device receives the first request sent by the RDMA network card of the first electronic device, the above method also includes: the second electronic device sends a first RDMA message to the first electronic device, the first RDMA message includes the address of the second memory space of the second electronic device, and the second memory space is used to store the screen projection information from the first electronic device.

[0035] In one implementation, before the second electronic device sends the first RDMA message to the first electronic device, it also includes: the second electronic device registers the second memory space to the RDMA network card of the second electronic device, and obtains the first key corresponding to the address of the second memory space; the first RDMA message also includes the first key, and the first request also includes the first key; based on the first request, the RDMA network card of the second electronic device writes the first screen projection information into the second memory space, including: after the RDMA network card of the second electronic device determines that the first key included in the first request is the key corresponding to the address of the second memory space, the first screen projection information is written into the second memory space.

[0036] In one implementation, before the RDMA network card of the second electronic device sends the first RDMA message to the RDMA network card of the first electronic device, the process further includes: the RDMA network card of the second electronic device and the RDMA network card of the first electronic device establish an RDMA connection, and the first RDMA message and the first request are sent through the RDMA connection.

[0037] In one implementation, after the second electronic device outputs the first screen projection information based on the data stored in the second memory space, the method includes: the second electronic device receives a second input operation; the second electronic device stores the first screen projection reverse control event corresponding to the second input operation in a third memory space; the RDMA network card of the second electronic device sends a second request to the RDMA network card of the first electronic device, the second request includes the data of the first screen projection reverse control event and the address of the fourth memory space of the first electronic device, the second request is used to indicate that the data of the first screen projection reverse control event is written to the fourth memory space, and the fourth memory space is used to store the input event of the first electronic device.

[0038] In one implementation, before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, it also includes: after the second electronic device detects that the first screen projection reverse control event is stored in the third memory space, the RDMA network card of the second electronic device generates a second request based on the data of the first screen projection reverse control event in the third memory space.

[0039] In one implementation, before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, the method further includes: the second electronic device receives a second RDMA message sent by the first electronic device, where the second RDMA message includes the address of the fourth memory space of the first electronic device.

[0040] In a fourth aspect, the present application provides an electronic device comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code comprising computer instructions. When the one or more processors execute the computer instructions, the communication device performs the screen projection method in any possible implementation of the second aspect.

[0041] In a fifth aspect, the present application provides another electronic device, comprising one or more processors and one or more memories. The one or more memories are coupled to the one or more processors, and the one or more memories are used to store computer program code, the computer program code including computer instructions. When the one or more processors execute the computer instructions, the communication device performs the screen projection method in any possible implementation of the third aspect.

[0042] In a sixth aspect, an embodiment of the present application provides a computer storage medium comprising computer instructions, which, when executed on an electronic device, enables a communication device to execute a screen projection method in any possible implementation of any of the above aspects.

[0043] In the seventh aspect, an embodiment of the present application provides a computer program product, which, when running on a computer, enables the computer to execute the screen projection method in any possible implementation of any of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] FIG1 is a schematic diagram of the structure of a communication system provided in an embodiment of the present application;

[0045] FIG2A is a schematic diagram of a vehicle-mounted display screen provided in an embodiment of the present application;

[0046] FIG2B is a schematic diagram of an in-vehicle device provided in an embodiment of the present application;

[0047] 2C to 2F are schematic diagrams of a screen projection scenario provided in an embodiment of the present application;

[0048] 3A to 3C are schematic diagrams of a screen projection scenario provided in an embodiment of the present application;

[0049] FIG4 is a schematic diagram of a screen projection scenario provided in an embodiment of the present application;

[0050] FIG5A is a schematic structural diagram of an electronic device provided in an embodiment of the present application;

[0051] FIG5B is a software structure block diagram of an electronic device provided in an embodiment of the present application;

[0052] FIG6A is a flow chart of a screen sharing method provided in an embodiment of the present application;

[0053] FIG6B is a flowchart of an implementation of screen sharing combined with a software structure provided in an embodiment of the present application;

[0054] FIG6C is a flowchart of a method for audio sharing provided in an embodiment of the present application;

[0055] FIG7A is a schematic diagram of a method for reverse control of screen projection provided in an embodiment of the present application;

[0056] FIG7B is a flowchart of an implementation of screen projection reverse control combined with a software structure provided in an embodiment of the present application;

[0057] FIG8 is a schematic diagram of an RDMA software stack provided in an embodiment of the present application;

[0058] FIG9A is a flow chart of a screen sharing method provided in an embodiment of the present application;

[0059] FIG9B is a flowchart of an implementation of screen sharing combined with a software structure provided in an embodiment of the present application;

[0060] FIG9C is a flowchart of an RDMA implementation provided by an embodiment of the present application;

[0061] FIG9D is a timing diagram of a refresh cycle provided in an embodiment of the present application;

[0062] FIG9E is a flowchart of an audio sharing method provided in an embodiment of the present application;

[0063] FIG9F is a flowchart illustrating an implementation of audio sharing combined with a software structure according to an embodiment of the present application;

[0064] FIG10A is a schematic flow chart of a method for reverse control of screen projection provided in an embodiment of the present application;

[0065] FIG10B is a flowchart of an implementation of screen projection reverse control combined with a software structure provided in an embodiment of the present application;

[0066] FIG10C is a flow chart of a method for audio sharing provided in an embodiment of the present application;

[0067] FIG11 is a flow chart of a screen projection method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0068] The following is a clear and detailed description of the technical solutions in the embodiments of the present application in conjunction with the accompanying drawings. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in the text is only a description of the association relationship between related objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" means two or more than two.

[0069] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to imply or suggest relative importance or implicitly indicate the number of the technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of this application, unless otherwise specified, "plurality" means two or more.

[0070] The term "user interface (UI)" in the following embodiments of this application refers to a medium interface for interaction and information exchange between an application or operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface is a source code written in a specific computer language such as Java and extensible markup language (XML). The interface source code is parsed and rendered on an electronic device and finally presented as content that the user can recognize. The commonly used form of user interface is graphical user interface (GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It can be a visual interface element such as text, icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc. displayed on the display screen of an electronic device.

[0071] The following introduces the communication system 10 involved in the embodiment of the present application.

[0072] Figure 1 exemplarily shows a schematic diagram of the structure of a communication system 10 provided in an embodiment of the present application. As shown in Figure 1 , the communication system 10 includes an electronic device 100 and one or more electronic devices connected to the electronic device 100, such as the electronic device 200.

[0073] In an embodiment of the present application, the electronic device 100 can use screen projection technology to send specific content (such as the display content of the physical screen, the user interface of a specific application, or a media file) to one or more connected electronic devices, such as the electronic device 200; the electronic device 200 can perform interface display and / or audio output based on the data sent by the electronic device 100. On the electronic device 100 side, the user can locally control the screen projection content of the electronic device 100 to the electronic device 200; on the electronic device 200 side, the user can also reversely control the electronic device 100 through the above-mentioned screen projection content. In some embodiments, the electronic device 100 is configured with a system on chip (SOC) 1, and the SOC 1 is used to support the synthesis, rendering, and display of the screen image of the electronic device 100; the electronic device 200 is configured with an SOC 2, and the SOC 2 is used to support the synthesis, rendering, and display of the screen image of the electronic device 200; using the screen projection method provided in the embodiment of the present application, the electronic device 100 and the electronic device 200 can achieve cross-chip screen viewing and device collaboration.

[0074] In some embodiments, the electronic device 100 can be directly connected to the electronic device 200 via a local wired connection. In one implementation, the electronic device 100 is configured with an RDMA network card 1, and the electronic device 200 is configured with an RDMA network card 2. The RDMA network card 1 of the electronic device 100 and the electronic device 100 and the RDMA network card 2 establish a wired connection (e.g., an Ethernet connection / IB connection) based on the RDMA network protocol. In some embodiments, the electronic device connects to the RDMA network card by using a peripheral component interconnect express (PCIE) bus. The PCIe protocol is an end-to-end interconnection protocol that provides a solution for high-speed transmission bandwidth.

[0075] In some embodiments, the electronic device 100 can be directly connected to the electronic device 200 via a short-range wireless communication connection. Exemplarily, the electronic device 100 and the electronic device 200 can have one or more short-range communication modules such as a near field communication (NFC) communication module, a wireless fidelity (WiFi) communication module, an ultra wide band (UWB) communication module, a Bluetooth (bluetooth) communication module, a ZigBee communication module, etc. Taking the electronic device 100 as an example, the electronic device 100 can transmit a signal through a short-range communication module (such as an NFC communication module) to detect and scan electronic devices near the electronic device 100, so that the electronic device 100 can discover nearby electronic devices (such as electronic device 200) through a short-range wireless communication protocol, establish a wireless communication connection with the nearby electronic devices, and transmit data to nearby electronic devices. For example, the electronic device 100 and the electronic device 200 are connected via WiFi-direct.

[0076] In some embodiments, the electronic device 100 and the electronic device 200 can be connected to a local area network (LAN) through the electronic device 300 based on a wired connection or a WiFi connection. For example, the electronic device 300 can be a third-party device such as a router, a gateway, or a smart device controller. In some embodiments, the electronic device 100 and the electronic device 200 can also be indirectly connected through at least one electronic device 400 in a wide area network. For example, the electronic device 400 can be a hardware server or a cloud server implanted in a virtualized environment. It can be understood that through the electronic device 300 and / or the electronic device 400, the electronic device 100 can indirectly perform wireless communication connection and data transmission with the electronic device 200.

[0077] It is understandable that the structure shown in this embodiment does not constitute a specific limitation on the communication system 10. In other embodiments of the present application, the communication system 10 may include more or fewer devices than shown in the figure.

[0078] The embodiments of the present application do not specifically limit the types of electronic devices 100 and 200. For example, the electronic devices 100 and 200 involved in the embodiments of the present application can be mobile phones, wearable devices (e.g., smart bracelets, smart watches), tablet computers, laptop computers, handheld computers, notebook computers, in-vehicle devices, smart TVs, ultra-mobile personal computers (UMPCs), cellular phones, personal digital assistants (PDAs), augmented reality (AR) and virtual reality (VR) devices, etc. In some embodiments, the electronic device 200 can also be a projection device such as a projector.

[0079] In an exemplary scenario, the electronic device 100 and the electronic device 200 belong to the same device system (such as an in-vehicle device). For example, the electronic device 100 and the electronic device 200 belong to the same in-vehicle device of a smart car. With the development of smart cars, there are more and more in-vehicle display screens of smart cars, including instruments, AR-HUD, central control screen, co-pilot screen, rear screens (such as left rear screen and right rear screen) and window screens. For example, Figure 2A shows multiple screens of a smart car. It is difficult for the in-vehicle device to use the GPU computing power of one SOC to meet the synthetic rendering of all screen images. Some manufacturers have introduced two or more SOCs for collaborative processing.

[0080] For example, as shown in FIG2B , taking two SOCs (i.e., SOC1 and SOC2) as an example, the vehicle-mounted device may include electronic devices 100 and 200. Electronic device 100 includes SOC1 and a vehicle-mounted display screen (e.g., a passenger screen) controlled by SOC1, and electronic device 200 includes SOC2 and a vehicle-mounted display screen (e.g., a rear screen) controlled by SOC2. Users can project the screen content of the display screen controlled by SOC1 of the vehicle-mounted device onto one or more displays controlled by SOC2.

[0081] For example, taking projecting the passenger screen controlled by SOC1 to the rear screen controlled by SOC2 as an example, Figures 2C to 2F show an interface implementation of projecting between in-vehicle display screens.

[0082] As shown in Figure 2C, the co-pilot screen plays video 1 in the user interface 11 of APP1; after detecting the user's input operation 1, the co-pilot screen displays the projection selection interface 12 shown in Figure 2D, which is used to select the projection content, target device and / or target screen. In one implementation, as shown in Figure 2C, the user interface 11 displays a projection icon 101, and the input operation 1 includes a click operation on the projection icon 101. The embodiment of the present application does not specifically limit the input operation 1. The input operation 1 can also be applied to other vehicle-mounted display screens. The input operation 1 can also include other touch operations, voice operations, or gesture operations.

[0083] As shown in FIG2D , the screen projection selection interface 12 includes a list of screens that can be projected in the vehicle. The screen list may include options for any display screen other than the passenger screen, for example, option 102 for the right rear screen. The user can select one or more displays in the screen list for projection.

[0084] As shown in FIG2D , the screen casting selection interface 12 may also include a list of devices that can be cast, and the device list includes options for other devices that can be cast, for example, a mobile phone option 103. The user can select one or more devices in the screen casting list to cast the screen.

[0085] As shown in Figure 2D, the screen projection selection interface 12 may also include a list of content that can be projected. The content list includes option 104 corresponding to the display screen (i.e., the main screen) of the main screen (i.e., the physical screen) of the co-pilot screen, and may also include options corresponding to some applications installed on the co-pilot screen (e.g., option 105 for APP2). If the user selects option 104 for the main screen, the current main screen of the co-pilot screen will be projected to the target device and / or target screen; if the user selects option 105 for APP2, SOC1 will run APP2 on the virtual display screen and project the display content of the virtual display screen to the target device and / or target screen, that is, the projected content and the main screen of the co-pilot screen can be different, and it will not affect the normal display of the co-pilot screen.

[0086] As shown in Figures 2D and 2E, the screen projection selection interface 12 may also include a confirmation control 106. After the user selects option 102 for the right rear screen and option 104 for the main screen, the electronic device 100 detects that the user has clicked on the confirmation control 106. In response to the user's click, the electronic device 100 sends the projection data to the electronic device 200. Based on the projection data, the electronic device 200 projects the projection image on the right rear screen, i.e., the main screen of the passenger screen. During projection, the right rear screen may display only the projection image, or it may display the projection image as a small window superimposed on the original display interface, without specific limitation herein.

[0087] It is understood that when the main screen of the passenger screen controlled locally by the user changes, the screen displayed on the right rear screen also changes accordingly; through the above-mentioned screen, the user can also reversely control the passenger screen on the right rear screen. For example, as shown in Figure 2F, a pause operation of the user on the screen displayed on the right rear screen is detected (for example, a click operation on the video playback area of ​​Video 1 in the user interface 11); in response to the above-mentioned pause operation, the electronic device 100 corresponding to the passenger screen controls Video 1 to pause, and both the passenger screen and the right rear screen display a pause interface 13, which indicates that Video 1 is currently paused.

[0088] In another exemplary scenario, electronic device 100 is a mobile phone, and electronic device 200 is a large-screen device (such as a car-mounted device). The mobile phone projects the user interface displayed on the screen to the large-screen device, and the user interface of the mobile phone displayed on the large-screen device can reversely control the mobile phone.

[0089] Exemplarily, as shown in FIG3A , the mobile phone detects the user's screen casting operation, which is used to trigger screen casting to the central control screen of the vehicle-mounted device; in response to the above-mentioned screen casting operation, the mobile phone sends a screen casting request to the vehicle-mounted device; the vehicle-mounted device displays a screen casting prompt box on the central control according to the screen casting request, and the screen casting prompt box is used to prompt the user to confirm whether to allow the mobile phone to cast the screen. The screen casting prompt box includes a confirmation control 201 and a cancel control 202. The confirmation control 201 is used to confirm the screen casting, and the cancel control 202 is used to refuse the screen casting. With reference to the relevant descriptions of FIG2C to FIG2E , the user can also select the target device, target screen and / or screen casting content on the mobile phone, which will not be repeated here. There is no specific limitation on the operation of the user triggering the screen casting here.

[0090] As shown in Figures 3A and 3B, after the in-vehicle device detects that the user clicks the confirmation control 201, it displays the projection screen based on the projection data sent by the mobile phone. The projection screen includes the user interface 11 currently displayed on the mobile phone. In some embodiments, no user confirmation is required, that is, no projection prompt box is displayed. The in-vehicle device can directly display the projection screen based on the projection data sent by the mobile phone.

[0091] As shown in Figures 3B and 3C , the user interface 11 includes an icon 203 for the Gallery application. After the in-vehicle device detects that the user has clicked on icon 203 in the projected image, the mobile phone displays the Gallery application's user interface 23, and the in-vehicle device also displays the Gallery application's user interface 23 in the projected image. In other words, the user controls the mobile phone on the in-vehicle device to open the Gallery application.

[0092] In another exemplary scenario, the screen projection content sent by electronic device 100 to electronic device 200 undergoes immersive processing. Immersive processing refers to performing corresponding image processing (such as cropping, selection, color change, adding filters, etc.) on the projected screen according to the projection effect selected by the user. The above-mentioned projection effect and corresponding image processing method are not specifically limited here.

[0093] For example, Figure 4 illustrates an immersive screen projection scenario. As shown in Figure 4, electronic device 100 projects its screen onto electronic devices 200 and 500. The projected images displayed by electronic devices 500 and 200 are images of the wallpaper on electronic device 100 that have been cropped, discolored, and their transparency modified. After projection, the combined effects of electronic devices 200, 100, and 500 create a unique visual effect.

[0094] The structure of the electronic device involved in the embodiments of the present application is exemplarily described below.

[0095] FIG5A shows a schematic diagram of the structure of the electronic device 100. The structure of the electronic device 200 can refer to the relevant description of the electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0096] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0097] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0098] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0099] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0100] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0101] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 180K, the charger, the flash, the camera 193, and the like via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 180K via the I2C interface, enabling communication between the processor 110 and the touch sensor 180K via the I2C bus interface, thereby implementing the touch function of the electronic device 100.

[0102] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface, enabling the function of answering calls through a Bluetooth headset.

[0103] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via a PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering calls via a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0104] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface, enabling the function of playing music through Bluetooth headphones.

[0105] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 194 and the camera 193. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to implement the camera function of the electronic device 100. The processor 110 and the display 194 communicate via the DSI interface to implement the display function of the electronic device 100.

[0106] The GPIO interface can be configured via software. The GPIO interface can be configured as either a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the camera 193, display 194, wireless communication module 160, audio module 170, sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0107] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.

[0108] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.

[0109] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.

[0110] The power management module 141 is used to connect the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

[0111] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

[0112] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0113] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0114] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

[0115] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, demodulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0116] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).

[0117] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0118] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.

[0119] The electronic device 100 can implement a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.

[0120] The ISP processes data fed back by camera 193. For example, when taking a photo, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, which is then passed to the ISP for processing and converted into a visible image. The ISP can also perform algorithmic optimization on image noise and brightness. It can also optimize parameters such as exposure and color temperature of the captured scene. In some embodiments, the ISP can be located within camera 193.

[0121] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, and then passes the electrical signal to the ISP for conversion into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device 100 may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0122] The digital signal processor is used to process digital signals. In addition to processing digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

[0123] Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. This allows electronic device 100 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0124] The NPU is a neural network (NN) computing processor. Drawing on the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it rapidly processes input information and can continuously self-learn. The NPU can enable intelligent cognitive applications in electronic device 100, such as image recognition, face recognition, speech recognition, and text comprehension.

[0125] The internal memory 121 may include one or more random access memories (RAM) and one or more non-volatile memories (NVM).

[0126] Random access memory may include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, for example, the fifth generation DDR SDRAM is generally referred to as DDR5 SDRAM), etc.; non-volatile memory may include disk storage devices and flash memory.

[0127] Flash memory can be divided into NOR FLASH, NAND FLASH, 3D NAND FLASH, etc. according to the operating principle; single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), etc. according to the storage cell potential level; universal flash storage (UFS) and embedded multi media card (eMMC) can be divided into UFS and eMMC according to the storage specification.

[0128] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of the operating system or other running programs, and can also be used to store user and application data.

[0129] The non-volatile memory may also store executable programs and user and application data, etc., and may be loaded into the random access memory in advance for direct reading and writing by the processor 110 .

[0130] The external memory interface 120 can be used to connect to an external non-volatile memory to expand the storage capacity of the electronic device 100. The external non-volatile memory communicates with the processor 110 via the external memory interface 120 to implement data storage. For example, files such as music and videos can be stored in the external non-volatile memory.

[0131] The electronic device 100 can implement audio functions such as music playback and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone jack 170D, and the application processor.

[0132] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be provided in the processor 110, or some functional modules of the audio module 170 can be provided in the processor 110.

[0133] The speaker 170A, also called a "speaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to hands-free calls through the speaker 170A.

[0134] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the electronic device 100 receives a call or a voice message, the user can place the receiver 170B close to the ear to hear the voice.

[0135] Microphone 170C, also known as a "microphone" or "speaker," is used to convert sound signals into electrical signals. When making a call or sending a voice message, a user can speak by approaching microphone 170C with their mouth to input the sound signal into microphone 170C.

[0136] The headphone jack 170D is used to connect a wired headphone.

[0137] The pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 180A can be disposed on the display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors.

[0138] The gyro sensor 180B may be used to determine the motion posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) may be determined by the gyro sensor 180B.

[0139] The air pressure sensor 180C is used to measure air pressure.

[0140] The magnetic sensor 180D includes a Hall sensor.

[0141] Accelerometer 180E can detect the magnitude of acceleration of electronic device 100 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when electronic device 100 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0142] The distance sensor 180F is used to measure distance. The electronic device 100 can measure distance by infrared or laser.

[0143] The proximity light sensor 180G may include, for example, a light emitting diode (LED) and a light detector such as a photodiode.

[0144] The ambient light sensor 180L is used to sense the brightness of the ambient light.

[0145] The fingerprint sensor 180H is used to collect fingerprints. The electronic device 100 can use the collected fingerprint characteristics to implement fingerprint unlocking.

[0146] The temperature sensor 180J is used to detect temperature.

[0147] The touch sensor 180K is also called a "touch-sensitive device." The touch sensor 180K can be disposed on the display screen 194. The touch sensor 180K and the display screen 194 form a touch screen, also called a "touch screen." The touch sensor 180K is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device 100, at a location different from that of the display screen 194.

[0148] The bone conduction sensor 180M can acquire vibration signals.

[0149] The buttons 190 include a power button, a volume button, etc. The buttons 190 can be mechanical buttons or touch buttons.

[0150] Motor 191 can generate vibration prompts.

[0151] The indicator 192 may be an indicator light, which may be used to indicate charging status, power level changes, messages, missed calls, etc.

[0152] The SIM card interface 195 is used to connect a SIM card.

[0153] The following introduces the software structures of the electronic device 100 and the electronic device 200 involved in the embodiments of the present application.

[0154] In the embodiments of the present application, the electronic device may be equipped with iOS, Android, Microsoft, or other software systems, and the software system is not specifically limited herein. The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a microservice architecture, or a cloud architecture. The following uses the electronic device 100 and the layered Android system as an example to illustrate the software structure of the electronic device. The software structure of the electronic device 200 can refer to the relevant description of the electronic device 100.

[0155] FIG5B is a block diagram of the software structure of the electronic device 100 according to an embodiment of the present invention.

[0156] The layered architecture divides software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer (Application), the application framework layer (Application Framework), the hardware abstraction layer (HAL), the native service layer (Native), and the kernel layer (Kernel). In one implementation, the layers above the kernel layer (Kernel) belong to the user state of the software system, and the kernel layer (Kernel) belongs to the kernel state of the software system.

[0157] The application layer can include a series of application packages. As shown in Figure 5B, the application package can include screen projection applications, video applications, and can also include camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, short message and other applications.

[0158] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0159] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0160] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0161] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0162] The Native layer contains local services and libraries. For performance reasons, applications (APPs) need to use C / C++ implementations in the Native layer. The Native layer then provides these solutions to the Java layer, which implements the application's basic functions, through JNI to extend computationally intensive features.

[0163] The kernel layer is the layer between hardware and software. It provides low-level drivers for various hardware components, such as Wi-Fi, Bluetooth, mobile communications, display, audio, keyboard, power, and sensor drivers (such as touch sensors). It is also responsible for file management, process management, network protocol stacks, system security, and memory management.

[0164] The HAL layer is the interface layer between the kernel and the hardware circuit. Its purpose is to abstract the hardware and provide a virtual hardware platform and services for the operating system; it converts upper-layer calls into direct access and control of the hardware. The specific activity is to establish hardware-related drivers.

[0165] In some embodiments, as shown in FIG5B , the application framework layer may include a window management service (WindowManagerService, WMS), the Native layer includes a Surfaceflinger, and the HAL layer includes a hardware compositor (hwcomposer, HWC).

[0166] Among them, WMS is used to manage window programs and manage the entire life cycle, hierarchy and properties of window displays. For example, WMS is responsible for starting, adding and deleting windows, obtaining the size of the display screen, determining whether there is a status bar, locking the screen, capturing screens, etc. Surfaceflinger is used to synthesize multiple layers (layers) rendered from WMS, and then send the synthesized image to the display device for display. After collecting all the buffers (buffers) of the visible layers, SurfaceFlinger will ask HWC how to perform the synthesis. The layer synthesis methods include GPU synthesis and HWC synthesis; GPU synthesis refers to the GPU using OpenGL to synthesize layers; HWC synthesis refers to using the display controller (Display controller) to synthesize layers. HWC can reduce the synthesis pressure of the GPU by synthesizing layers through hardware devices.

[0167] For example, when an application (such as APP1) starts an activity, it calls WMS to create and register an application window (window) corresponding to the activity. When APP1 displays the window in the foreground, WMS instructs SurfaceFlinger to create a surface (layer) for the window. Based on the graphics drawing instructions of APP1, WMS calls the CPU / GPU to draw and render each layer, and caches them in the buffer queue (BufferQueue) respectively; Surfaceflinger receives the layer data in the buffer of all visible layers (layer) and synthesizes them. For example, the layers displayed on the screen usually include the status bar (status bar) at the top of the screen, the navigation bar (system bar) below the screen and the UI part of the app (ie, the application interface, icons and / or plug-ins), and may also include background wallpaper (background).

[0168] In some embodiments, as shown in Figure 5B, the application framework layer may include mediacodec, the Native layer includes a video encoder and a video decoder, and the HAL layer includes videocodec. The video encoder in the Native layer is used to call videocodec to encode the synthesized image and obtain the encoded video stream; correspondingly, the video decoder is used to call videocodec to decode the encoded video stream. MediaCodec is a class in the application framework layer used for encoding and decoding audio and video, including encoder / decoder components. It implements encoding and decoding functions by accessing the underlying Codec.

[0169] In some embodiments, as shown in FIG5B , the application framework layer may include an audio recording module (Audio recoder), the Native layer includes Audioflinger, an audio encoder, and an audio decoder, and the HAL layer includes an audio HAL (Audio HAL). The audio recording module is used to record the audio file output by the application (e.g., APP1) and obtain the recorded audio. The Audioflinger of the Native layer is used to synthesize the audio sent down by the application layer; the audio encoder is used to call Audiocodec to encode the synthesized audio; correspondingly, the audio decoder is used to call Audiocodec to decode the encoded audio.

[0170] In some embodiments, as shown in Figure 5B, the Native layer includes an input subsystem, and the HAL layer includes an IO device node (e.g., / dev / input / eventX). Among them, there are many kinds of input devices for Android, such as screen, keyboard, mouse, game controller, joystick, etc. When the input device is available, the Linux kernel will create a corresponding IO device node in / dev / input, and different input devices correspond to different IO device nodes. When an input operation is performed through an input device (e.g., a screen), the driver corresponding to the input device (e.g., a touch sensor driver) processes the corresponding input information (e.g., a hardware interrupt) into raw input events (including touch coordinates, touch timestamps, and other information), and stores them in the IO device node corresponding to the input device. The Input subsystem can retrieve the raw input event from the IO device node; the input event is encapsulated and submitted to the target window (Window) for processing.

[0171] In some embodiments, as shown in Figure 5B, the kernel layer may also include a driver for driving the communication module 1 to operate; for example, the communication module 1 includes one or more of a short-range wireless communication module (such as a WiFi communication module, a Bluetooth communication module or a UWB communication module, etc.), a mobile communication module and a wired communication module, etc., and accordingly, the kernel layer may include one or more of a WiFi driver, a Bluetooth driver, a UWB driver, a mobile communication driver, etc.

[0172] The following is a detailed introduction to the two implementation solutions of screen projection provided by this application in combination with the aforementioned software structure.

[0173] In the embodiments of the present application, the screen projection scheme includes two parts: screen sharing and screen projection reverse control. The following describes the specific implementation of screen sharing and screen projection reverse control in the two implementation schemes. For ease of description, the subsequent embodiments may also refer to electronic device 100 as the source device of screen projection and electronic device 200 as the target device of screen projection.

[0174] Solution 1: Screen projection solution based on codec

[0175] 6A shows a method flow of screen sharing of the solution. The following describes the method flow of screen sharing in conjunction with the implementation flow of screen sharing shown in FIG6B , which includes steps S101 to S109 .

[0176] S101 . The electronic device 100 displays the user interface 1 of APP1 .

[0177] In some embodiments, before the electronic device 100 is projected onto the electronic device 200, the electronic device 100 runs and displays the user interface 1 of APP1. Step S101 includes: APP1 sends a drawing instruction to the WMS; the WMS draws and renders the display content of each layer of the user interface 1 of APP1 based on the drawing instruction. The drawing instruction may indicate the view corresponding to each layer of the user interface, as well as the properties of each view (such as size, position, and transparency); the WMS instructs surfaceflinger to synthesize each layer; surfaceflinger calls GPU synthesis and HWC synthesis to obtain the synthesized user interface 1; the HWC caches the synthesized user interface 1 in a preset buffer; the display driver sends the user interface 1 to the physical display screen of the electronic device 100 based on the data in the buffer.

[0178] In the embodiment of the present application, APP1 can be a third-party application (such as a video application) or a system application (such as a desktop application), and is not specifically limited here.

[0179] S102. After the electronic device 100 receives the screen projection operation from the user, the IO device node (ie, / dev / input / eventX) of the electronic device 100 stores the screen projection trigger event corresponding to the screen projection operation.

[0180] In some embodiments, the user triggers screen projection by performing a touch operation on the display screen. Step S102 includes: (1) after the touch sensor in the physical display screen detects the screen projection operation, the hardware perception information corresponding to the screen projection operation is sent to the touch sensor driver; (2) the touch sensor driver processes the hardware perception information into raw input events (for example, raw input events include touch coordinates, touch timestamps and other information), and stores them in the IO device node corresponding to the display screen (for example, / dev / input / eventX). For ease of description, the above raw input events can be referred to as screen projection trigger events.

[0181] For example, referring to the example described in FIG2C , the screen casting operation may include a click operation on the confirmation control 106 displayed on the display screen. The screen casting operation involved in the embodiments of the present application may also be an input operation performed through other input devices (e.g., a mouse, a remote control), or other forms of input operations such as voice operation and gesture operation, which are not specifically limited here.

[0182] S103. The screen projection trigger event in the IO device node of the electronic device 100 is distributed to the screen projection application.

[0183] In some embodiments, step S103 includes: (3) the input subsystem reads the above-mentioned original input event (i.e., the screen projection trigger event) from the IO device node. (4) the input subsystem distributes the above-mentioned screen projection trigger event to the screen projection application. In one implementation method, after the IMS monitors the screen projection trigger event output by the above-mentioned input subsystem, it calls the WMS to determine the target window corresponding to the touch event according to the layout of each window in the main screen. The target application corresponding to the above-mentioned screen projection trigger event is the screen projection application to which the target window belongs.

[0184] S104 , the screen projection application instructs drawing a composite projection screen 1 to be projected to the electronic device 200 , and the composite projection screen 1 is cached in the display buffer 1 .

[0185] In some embodiments, the above-mentioned screen projection trigger event indicates that the target device for screen projection is the electronic device 200, and the electronic device 100 creates a virtual display screen 1 corresponding to the electronic device 200, and the virtual display screen 1 is used to run the projection screen to the electronic device 200. When the user selects multiple target devices for screen projection, a virtual display screen is created for each target device. In some embodiments, the projection content is the main screen of the electronic device 100. There is no need to establish a virtual display screen, and the main screen of the electronic device 100 can also be projected to the electronic device 200, such as the mirror projection technology.

[0186] In some embodiments, step S104 includes: the screen projection application of the electronic device 100 establishes a business connection with the screen projection application of the electronic device 100; (5) the screen projection application instructs the WMS to create a virtual display screen 1 corresponding to the electronic device 200; (6) the WMS instructs the surfaceflinger to create the virtual display screen 1; (7) the surfaceflinger calls the GPU synthesis and the HWC synthesis to synthesize the projection screen 1 corresponding to the virtual display screen 1. The HWC stores the synthesized projection screen 1 in a preset buffer (i.e., display buffer 1). For ease of description, the buffer in the memory space of the electronic device 100 used to store the projection screen of the electronic device 200 (e.g., the image to be displayed on the virtual display screen 1) can be referred to as the display buffer of the electronic device 100 (e.g., display buffer 1). In some embodiments, the display screen of the electronic device 100 is the projection screen projected to the electronic device 200, and the above-mentioned display buffer 1 is used to cache the screen to be displayed on the electronic device 100; the electronic device 100 displays based on the image data in the display buffer 1 in the next refresh cycle.

[0187] In some embodiments, referring to the relevant descriptions of Figures 2C to 2E , the screen projection trigger event triggered by the user may indicate one or more of the target device for projection, the target screen, and the projection content. The electronic device 100 creates a corresponding virtual display screen based on the target device selected by the user, and determines the display content of the virtual display screen (i.e., the projection screen) based on the projection content selected by the user.

[0188] In some embodiments, when the projection content selected by the user is the main screen of the electronic device 200, and the main screen of the electronic device 200 includes the user interface 1 of APP1, the projection screen 1 includes the user interface 1; when the projection content selected by the user is not the main screen of the electronic device 200, the projection screen 1 and the main screen of the electronic device 200 may be different.

[0189] S105. The electronic device 100 encodes the projection image 1 and obtains the projection data 1.

[0190] In some embodiments, step S105 includes: (8) the video encoder obtains the image data of the projection screen 1 in the display buffer 1; (9) the video encoder calls videocode to encode the above projection screen and obtain the encoded video stream; (10) videocodec sends the encoded video stream to mediacodec; (11) mediacodec sends the encoded video stream to the projection application, and the projection application encrypts and packages the above data to obtain projection data 1.

[0191] S106 , the electronic device 200 uses the communication protocol to encapsulate the screen projection data 1 , and then sends the encapsulated screen projection message 1 through the communication module 1 .

[0192] In some embodiments, the communication module 1 may be a wireless communication module such as a short-range communication module (e.g., a WiFi communication module, a Bluetooth communication module), a mobile communication module, or the like. Taking the WiFi communication module as an example, step S105 includes: (12) the screen projection application sends screen projection data 1 to the TCP / IP protocol stack; (13) the TCP / IP protocol stack encapsulates the screen projection data 1 into a screen projection message 1 using the TCP / IP protocol, and then sends the screen projection message 1 to the WiFi driver; (14) the WiFi driver sends the screen projection message 1 to the WiFi communication module; (15) the WiFi communication module sends the screen projection message 1 to the electronic device 200. It can be understood that the screen projection message 1 includes the screen projection data 1.

[0193] Not limited to the TCP / IP protocol, the embodiments of the present application can also send screen projection messages through other communication protocols, which are not specifically limited here.

[0194] S107. After decapsulating the screen projection message 1, the screen projection application of the electronic device 200 obtains the screen projection data 1.

[0195] In some embodiments, taking the WiFi communication module as an example, step S106 includes: (16) the WiFi driver obtains the screen projection message 1 through the WiFi communication module; (17) the WiFi driver sends the screen projection message 1 to the TCP / IP protocol stack; (18) the TCP / IP protocol stack uses the TCP / IP protocol to decapsulate the screen projection data 1, and then sends the decapsulated screen projection data 1 to the screen projection application.

[0196] S108. The electronic device 200 decodes the projection data 1 and obtains the decoded projection image 1.

[0197] In some embodiments, step S108 includes: (19) the screen projection application packages and decrypts the projection data 1, and sends it to Mediacodec; (20) Mediacodec decodes the audio and video data sent by the screen projection application, and sends it to the video decoder; (21) the video decoder calls Videocodec to decode the data sent by Mediacodec to obtain the image data of the projection screen 1; (22) Videocodec sends the image data of the projection screen 1 to the screen projection application.

[0198] S109. The electronic device 200 stores the projection screen 1 in the display buffer 2, and the physical display screen displays the projection screen 1 according to the image data of the projection screen 1 cached in the display buffer 2.

[0199] In some embodiments, step S109 includes: (23) the screen projection application instructs the WMS to display the projection screen 1 in the projection window; (24) the WMS instructs the surfaceflinger to perform layer synthesis; (25) the surfaceflinger calls the GPU synthesis and the HWC synthesis; (26) the HWC stores the synthesized projection screen 1 in the display buffer 2; (27) the display driver sends the projection screen 1 to the physical display screen of the electronic device 200 based on the image data in the display buffer 2. In some embodiments, the buffer in the memory space of the electronic device 200 for storing the projection screen from the electronic device 100 can be simply referred to as the display buffer of the electronic device 200 (for example, the display buffer 2), and the physical display screen of the electronic device 200 displays the projection screen 1 based on the data in the display buffer 2. In some embodiments, the display buffer 2 is used to cache the latest synthesized image output by the SF / HWC of the electronic device 200, that is, the image to be displayed on the physical display screen of the electronic device 200 in the next refresh cycle.

[0200] In some embodiments, electronic device 200 can simultaneously display the projected screen and the interfaces of other applications installed on electronic device 200. SurfaceFlinger collects the buffers of all visible layers for image synthesis, and the buffers of the visible layers include display buffer 2 corresponding to projected screen 1. In this case, the synthesized display image includes projected screen 1 and the interfaces of other applications. The display driver sends this display image to the physical display screen of electronic device 200.

[0201] In some embodiments, the screen projection sent by electronic device 100 to electronic device 200 is playing audio or video. During the screen projection process, electronic device 100 also sends the audio corresponding to the screen projection to electronic device 200. For ease of description, this audio can be referred to as screen projection audio. Referring to Figure 6C, the screen projection solution provided in this embodiment of the application also includes audio sharing, and the audio sharing method flow includes steps S110 to S115.

[0202] S110. The screen projection application of the electronic device 100 instructs to synthesize the screen projection audio; and stores the audio data of the synthesized screen projection audio 1 in the audio buffer 1.

[0203] In some embodiments, (28) the audio recording module records the audio file sent by the upper-layer application (e.g., APP1), stores the recorded audio in a buffer, and notifies Audioflinger; (29) Audioflinger synthesizes the projection audio 1 based on the audio data in one or more buffers; the Audio HAL obtains the synthesized projection audio 1 and stores it in audio buffer 1. For ease of description, the buffer in the memory space of the electronic device 100 used to store the projection audio of the electronic device 200 (e.g., the audio to be output of the virtual display screen 1) can be referred to as the audio buffer of the electronic device 100 (e.g., audio buffer 1). In some embodiments, the output audio of the electronic device 100 is the projection audio sent to the electronic device 200, and the above-mentioned audio buffer 1 is used to cache the audio to be output of the electronic device 100.

[0204] In some embodiments, similar to the display buffer, the audio buffer of the electronic device 200 may also include multiple buffers, and audio buffer 2 is one of the above multiple buffers. For example, the latest acquired screen projection audio (for example, screen projection audio 1) can be polled and cached in one of the above multiple buffers in the order of the buffer addresses. The audio driver sends the latest cached screen projection audio to the audio output device.

[0205] S111. The electronic device 100 encodes the projection audio 1 in the audio buffer 1 to obtain the projection data 2.

[0206] In some embodiments, (30) the audio encoder obtains the projection audio 1 in the audio buffer 1; (31) calls Audiocodec to encode the projection audio 1; (32) sends the encoded projection data 2 to the projection application through Mediacodec.

[0207] S112 , the electronic device 100 uses the communication protocol to encapsulate the screen projection data 2 , and then sends the encapsulated screen projection message 2 through the communication module 1 .

[0208] S113. After the electronic device 200 decapsulates the screen projection message 2, the screen projection application of the electronic device 200 obtains the screen projection data 2.

[0209] For the specific implementation of steps S112 and S113, please refer to the relevant description of steps S106 and S107, which will not be repeated here.

[0210] S114. The electronic device 200 decodes the projection data 2 and obtains the projection audio 1.

[0211] In some embodiments, on the electronic device 200 side, (33) the screen projection application sends the projection data 2 to the audio decoder of the Native layer through Mediacodec; (34) the audio decoder calls Audiocodec to decode the data sent by Mediacodec to obtain the projection audio 1; (35) Audiocodec then returns the projection audio 1 to the screen projection application.

[0212] S115. Cache the projection audio 1 into the audio buffer 2. The audio output device of the electronic device 200 outputs the projection audio 1 according to the audio data stored in the audio buffer 2.

[0213] In some embodiments, on the electronic device 200 side, (36) the audio recording module performs audio recording based on the audio data of the projection audio 1 sent by the upper-layer application (such as the projection application), stores the recorded projection audio 1 in the buffer, and notifies the Audioflinger; (37) the Audioflinger synthesizes the projection audio 1 based on the audio data in the above buffer; (38) the Audio HAL obtains the synthesized projection audio 1 and stores it in the audio buffer 2.

[0214] For ease of description, the buffer in the memory space of electronic device 200 used to store the screen projection audio from electronic device 100 can be simply referred to as the audio buffer of electronic device 200 (e.g., audio buffer 2). The audio output device (e.g., speaker) of electronic device 200 outputs screen projection audio 1 based on the data in audio buffer 2. In some embodiments, audio buffer 2 is used to store the latest synthesized audio output by the Audio HAL, that is, the audio to be output by the audio output device of electronic device 200.

[0215] In some embodiments, (39) the audio driver of the electronic device 200 sends the audio data in the audio buffer 2 to the audio output device; (40) the audio output device outputs the projection audio 1.

[0216] In some application scenarios, even if the screen projection sent by electronic device 100 to electronic device 200 is playing audio or video, during the projection process, electronic device 100 does not need to send the audio corresponding to the projected screen to electronic device 200. For example, in one application scenario, electronic device 100 and electronic device 200 are very close to each other, and the user can hear the audio corresponding to the projected screen through electronic device 100 without the need for electronic device 200 to play the audio. For example, electronic device 100 and electronic device 200 are in-vehicle devices in the same vehicle.

[0217] As shown in FIG6A and FIG6B , in the screen sharing stage of the scheme, the electronic device 100 needs to encode the screen content (i.e., each frame of the screen and / or each frame of the screen audio), and after the encoded screen data is sent to the target device through the network, it needs to be decoded. The overall process of the scheme involves multiple user mode and kernel mode switches (e.g., steps (9), (11), (13), (17), (21), (22), and (26) shown in FIG6B ), data copying between the encoder / decoder and the CPU (e.g., steps (9), (21) shown in FIG6B ), and encoding / decoding processes (e.g., steps (9)-(11) and (19)-(22) shown in FIG6B ), and message encapsulation / decapsulation processes (e.g., steps (12), (13), (17), and (18) shown in FIG6B ); thus, the CPU / GPU load is high, the screen power consumption is high, and the screen delay is large, which may cause the screen images displayed by the source device and the target device to be out of sync, affecting the user's screen experience. In addition, the encoding / decoding process of the projected image involves data compression, and lossy compression will result in a decrease in image quality.

[0218] For example, FIG7A shows a method flow of screen projection reverse control of this solution. The following is an introduction to the method flow of screen projection reverse control in conjunction with the implementation flow of screen projection reverse control shown in FIG7B. The screen projection reverse control operation acts on the user interface of APP1 in the projection screen. Among them:

[0219] S201. After the electronic device 200 receives the user's screen projection reverse control operation, the IO device node ( / dev / input / eventX) stores the screen projection reverse control event corresponding to the screen projection reverse control operation in event buffer2.

[0220] In some embodiments, the screen projection reverse control operation includes a touch operation performed by a user on the projection screen displayed by the electronic device 200. Step S201 includes: (1) after the touch sensor in the physical display screen detects the screen projection reverse control operation, the hardware perception information corresponding to the screen projection reverse control operation is sent to the touch sensor driver; (2) the touch sensor driver processes the hardware perception information into a raw input event (for example, the raw input event includes touch coordinates, touch timestamp, and other information), and sends it to the IO device node corresponding to the display screen (for example, / dev / input / eventX), and the IO device node stores the event in event buffer2.

[0221] For ease of description, the above-mentioned original input event can be referred to as a screen projection reverse control event; the buffer in the memory space of the electronic device 200 used to store the screen projection reverse control event of the electronic device 200 can be simply referred to as the event buffer of the electronic device 200 (for example, event buffer 2).

[0222] Exemplarily, referring to the example described in FIG2F , the reverse control operation of the screen projection may include a click operation on the video playback area in the screen projection. Exemplarily, referring to the examples described in FIG3B and FIG3C , the reverse control operation of the screen projection may include a click operation on the icon 203 of the gallery application in the screen projection. Not limited to touch operations acting on the display screen, the reverse control operation of the screen projection involved in the embodiment of the present application may also be an input operation performed through other input devices (such as a mouse, a remote control), or other forms of input operations such as voice operations and gesture operations, which are not specifically limited here.

[0223] S202. The above-mentioned screen projection reverse control event in the IO device node of the electronic device 200 is distributed to the screen projection application.

[0224] In some embodiments, step S202 includes: (3) the input subsystem reads the above-mentioned original input event (i.e., the projection screen reverse control event) from the event buffer2 stored in the IO device node. (4) After the IMS monitors the original input event output by the above-mentioned input subsystem, it calls the WMS to determine the target window corresponding to the touch event according to the layout of each window in the main screen. The target application corresponding to the original input event is the application corresponding to the target window (i.e., the projection screen application). (5) The WMS distributes the above-mentioned original input event to the projection screen application.

[0225] S203 , the screen projection application of the electronic device 200 uses the communication protocol to encapsulate the screen projection reverse control event, and then sends the encapsulated screen projection message 3 to the electronic device 100 through the communication module 1 .

[0226] In some embodiments, for example, if communication module 1 is a WiFi communication module, step S105 includes: (6) the screen casting application sends an encrypted screen casting reverse control event to the TCP / IP protocol stack; (7) the TCP / IP protocol stack encapsulates the screen casting reverse control event using the TCP / IP protocol and then sends a screen casting message 2 corresponding to the screen casting reverse control event to the WiFi driver; (8) the WiFi driver triggers the WiFi communication module to send the screen casting message 1 to the electronic device 200; (9) the WiFi communication module sends the screen casting message 1 to the electronic device 200. It can be understood that the screen casting message 2 includes the aforementioned screen casting reverse control event.

[0227] S204. After the electronic device 100 decapsulates the screen projection message 3, the screen projection application obtains a screen projection reverse control event.

[0228] In some embodiments, taking the WiFi communication module as an example, step S106 includes: (10) the WiFi driver obtains the screen projection message 2 from the WiFi communication module; (11) the WiFi driver sends the screen projection message 2 to the TCP / IP protocol stack; (12) the TCP / IP protocol stack uses the TCP / IP protocol to decapsulate the screen projection message 2, and then sends the decapsulated screen projection reverse control event to the screen projection application.

[0229] S205. The screen projection application of the electronic device 100 distributes a screen projection reverse control event to APP1 through the input subsystem.

[0230] In some embodiments, step S205 includes: (13) the screen projection application decrypts the screen projection reverse control event and sends the decrypted screen projection reverse control event to the input subsystem; (14) the user's screen projection reverse control operation acts on APP1, and the input subsystem distributes the screen projection reverse control event to APP1 (for example, a video application) running in the foreground of the virtual display screen 1 corresponding to the electronic device 200. In one implementation, after the IMS detects the screen projection reverse control event (i.e., touch event) output by the above-mentioned input subsystem, it calls the WMS to determine the target window corresponding to the touch event in the virtual display screen according to the layout of each window in the virtual display screen, and the target application corresponding to the above-mentioned reverse control event is APP1 corresponding to the target window.

[0231] S206. APP1 of electronic device 100 determines the response event corresponding to the projection screen reverse control event, and the response event indicates the display content of the projection screen 2 after the response; based on the response event, the projection screen 2 after the response is drawn, and the synthesized projection screen 2 is cached to display buffer 3.

[0232] In some embodiments, step S206 includes: (15) APP1 determines a response event based on the projection screen reverse control event, and the response event indicates the projection screen 2 after the response; APP1 sends a drawing instruction to the WMS, and the drawing instruction is used to instruct the drawing of the user interface 2 after APP1 responds; (16) WMS instructs surfaceflinger to synthesize each layer; (17) surfaceflinger calls GPU synthesis and HWC synthesis to obtain the synthesized projection screen 2, and the projection screen 2 includes the user interface 2. The HWC stores the synthesized projection screen 2 in the display buffer 3.

[0233] In some embodiments, the display buffer 3 and the display buffer 1 of the electronic device 100 are the same buffer. In some embodiments, the display buffer of the electronic device 100 has multiple buffers (for example, the display buffer 1 and the display buffer 3), and the electronic device 100 polls and stores the latest synthesized projection image into one of the above multiple buffers.

[0234] In some embodiments, the main screen of the physical display screen of the electronic device 100 includes the projection screen 2; the above method further includes: sending the projection screen 2 to the physical display screen of the electronic device 100 for display. In some implementations, (18) the HWC sends the synthesized projection screen 2 to the display driver, that is, the display driver displays the image data of the projection screen 2 in buffer 3; (19) the display driver sends the projection screen 2 to the physical display screen of the electronic device 100 for display.

[0235] Exemplarily, referring to the example described in FIG2F , the projection screen 1 includes the user interface 11 of the video application shown in FIG2F , the user interface 11 includes a video playback area, the projection screen reverse control operation may include a click operation (i.e., a pause operation) acting on the video playback area in the projection screen 1, and the projection screen 2 includes a pause interface 13 determined in response to the above-mentioned pause operation. Exemplarily, referring to the example described in FIG3B and FIG3C , the projection screen 1 includes the main interface 21 of the system application shown in FIG3B , the main interface 21 includes an icon 203 of the gallery application, the projection screen reverse control operation may include a click operation acting on the icon 203 in the projection screen, and the projection screen 2 includes the user interface 23 of the gallery application determined in response to the above-mentioned click operation.

[0236] S207. The electronic device 100 encodes the projection image 2 and obtains the projection data 3.

[0237] In some embodiments, step S207 includes steps (20) to (23) in the software flow shown in Figure 7A. For details, please refer to the relevant description of step S105, which will not be repeated here.

[0238] S208. After the electronic device 100 encapsulates the screen projection data 3 using the communication protocol, it sends the encapsulated screen projection message 4 through the communication module 1.

[0239] In some embodiments, step S208 includes steps (24) to (27) in the software flow shown in Figure 7A. For details, please refer to the relevant description of step S106, which will not be repeated here.

[0240] S209. After the electronic device 200 decapsulates the screen projection message 4, the screen projection application obtains the screen projection data 3.

[0241] In some embodiments, step S209 includes steps (28) to (30) in the software flow shown in Figure 7A. For details, please refer to the relevant description of step S107, which will not be repeated here.

[0242] S210. The electronic device 200 decodes the projection data 3 and obtains the decoded projection image 2.

[0243] In some embodiments, step S210 includes steps (31) to (34) in the software flow shown in Figure 7A. For details, please refer to the relevant description of step S108, which will not be repeated here.

[0244] S211 , the electronic device 200 stores the projection screen 3 in the display buffer 4 , and the physical display screen displays the projection screen 2 according to the image data of the projection screen 2 cached in the display buffer 4 .

[0245] In some embodiments, in the electronic device 200 , the display buffer 4 storing the projection image 2 and the display buffer 2 storing the projection image 1 are the same buffer.

[0246] In some embodiments, the display buffer of the electronic device 100 has multiple buffers (for example, display buffer 2 and display buffer 4), and the electronic device 100 polls and stores the latest synthesized projection screen into one of the above multiple buffers. Exemplarily, the display buffer of the electronic device 200 includes buffer a, buffer b, and buffer c; according to the address order of the buffers, the HWC polls and caches the latest synthesized projection screen into one of the above multiple buffers; when the Vsync signal of the next refresh cycle arrives, the display driver sends the latest cached projection screen to the physical display screen. For example, the HWC synthesizes projection screens a, b, and c in sequence, and the projection screens a, b, and c are cached into buffer a, buffer b, and buffer c in sequence; when the HWC synthesizes projection screen d again, projection screen d is polled and cached into buffer a, overwriting the original projection screen a.

[0247] In some embodiments, step S211 includes steps (35) to (39) in the software flow shown in Figure 7A. For details, please refer to the relevant description of step S109, which will not be repeated here.

[0248] In some embodiments, the projection image 2 sent by the electronic device 100 to the electronic device 200 is used to play audio and video, and the electronic device 100 also sends the audio corresponding to the projection image 2 to the electronic device 200. For details, please refer to the relevant description of Figure 6C, which will not be repeated here.

[0249] Combining Figures 7A and 7B, it can be seen that in the screen projection reverse control stage of this solution, when the user's screen projection reverse control event is sent to the target application (e.g., APP1) of the source device, both devices on the screen projection side are involved in the kernel's processing of the screen projection reverse control event (e.g., steps (3) to (7) on the target device side shown in Figure 7B, and steps (11) to (13) on the source device side), as well as multiple user mode and kernel mode switches (e.g., steps (2), (7), and (11) shown in Figure 7B); this results in a long response delay for the source device to the screen projection reverse control event. Coupled with the processing delay of the screen sharing of the projection screen 2 after responding to the screen projection reverse control event, the overall screen projection reverse control delay is even greater.

[0250] Solution 2: RDMA-based screen projection solution

[0251] In Solution 2, electronic devices 100 and 200 support Remote Direct Memory Access (RDMA) technology. RDMA technology allows user-mode applications to directly access (e.g., write to or read from) remote memory, bypassing the operating system and CPU, and directly reading and writing data (e.g., data required for screen projection) from one host's memory to the memory of another host.

[0252] For example, Figure 8 shows an RDMA software stack, which includes a user-mode software stack and a kernel-mode software stack. As shown in Figure 8, the user-mode software stack includes the application layer and the RDMA user-mode lib library. The user-mode lib library includes Libimumad, Librdmacm, Libibcm, and Libibverbs. The kernel-mode software stack includes the kernel-mode lib library, the RDMA subsystem core module (Ib-core), and the RDMA network card driver. The kernel-mode lib library includes ib_umad, ib_ucm, rdma_ucm, and ib_uverbs.

[0253] The main functions of each library are to register and provide character and miscellaneous devices, perform subnet management, manage connections, and provide interfaces. The kernel-mode library interfaces with the user-mode library through the device's file operation interface (file_operations), translating the user-mode library's RDMA operations into RDMA operations (such as read, write, and release) for kernel devices (e.g., ib_device).

[0254] Calling the libibverbs library's "ibv_post_send()" interface to issue I / O commands allows direct manipulation of the RDMA network card's send and receive queues in user mode. This implementation avoids system calls (i.e., user-mode to kernel-mode switching and memory data copying), maximizing CPU resource savings and improving I / O efficiency.

[0255] RDMA technology hardware implementations include three RDMA network protocols: Infiniband (IB), RDMA over converged Ethernet (RoCE) (including RoCEv1 and RoCEv2), and the Internet Wide Area RDMA Protocol (iWARP). Infiniband is a network designed specifically for RDMA, guaranteeing reliable transmission at the hardware level. Both RoCE and iWARP are Ethernet-based RDMA technologies that support corresponding verb interfaces. RoCE also supports hardware-level reliable transmission.

[0256] An RDMA network card is a network card that supports the RDMA network protocol. In the IB / RoCE protocol specification, an RDMA network card can be called a Host Channel Adapter (HCA). In the iWARP protocol specification, an RDMA network card can be called an RNIC, which stands for a network interface card (NIC) with an RDMA engine.

[0257] The RDMA network card integrates the RDMA network protocol into the card. The network layer and transport layer are implemented in RDMA. The RDMA network card directly encapsulates and sends application data (for example, TCP / IP protocol encapsulation), parses received messages, and sends the parsed data directly to the application layer. In some embodiments, the bus interface of the RDMA network card uses a high-speed serial computer expansion bus standard (Peripheral Component Interconnect, PCIe) interface.

[0258] In some embodiments, during the screen sharing stage of Solution 2, the electronic device 200 can use the RDMA network card 2 to directly write the image data of the projection screen in the display buffer 1 of the electronic device 100 into the display buffer 2 of the electronic device 200, and the physical display screen of the electronic device 200 displays the projection screen based on the image data in the display buffer 2.

[0259] 9A shows a method flow of screen sharing of the solution. The following describes the method flow of screen sharing in conjunction with the software structure shown in FIG9B , which includes steps S301 to S310 .

[0260] FIG9B shows the software structure of another electronic device. As shown in FIG9B , the electronic device 100 and the electronic device 200 are configured with an RDMA network card; the kernel layer includes an RDMA network card driver corresponding to the RDMA network card.

[0261] S301 . The electronic device 100 displays the user interface 1 of APP1 .

[0262] S302. After the electronic device 100 receives the screen projection operation from the user, the IO device node (ie, / dev / input / eventX) of the electronic device 100 stores the screen projection trigger event corresponding to the screen projection operation.

[0263] S303. The screen projection trigger event in the IO device node of the electronic device 100 is distributed to the screen projection application.

[0264] For the specific implementation of steps S301 to S303 , reference may be made to the related description of steps S101 to S103 , which will not be repeated here.

[0265] S304 : Establish an RDMA connection between the RDMA network card of the electronic device 100 and the RDMA network card of the electronic device 200 .

[0266] In some embodiments, after the screen projection application determines that the screen is projected based on the above-mentioned screen projection trigger event, it triggers the RDMA network card of the electronic device 100 to establish an RDMA connection (i.e., a channel connection) with the electronic device 200. In some embodiments, based on the above-mentioned screen projection trigger event, the screen projection application sends a screen projection service connection request to the electronic device 200 through the communication module 1 (e.g., a WiFi communication module); the screen projection application of the electronic device 200 sends a screen projection service connection response to the electronic device 100; after the screen projection application of the electronic device 200 determines that the electronic device 200 agrees to the screen projection based on the above-mentioned screen projection service connection response, it triggers the RDMA network card of the electronic device 100 to establish an RDMA connection with the electronic device 200.

[0267] Channel connections are used for RDMA message transmission. Referring to Figure 9C , the network cards at both ends of each Channel connection maintain a pair of queues (QPs). Each QP pair consists of a send queue (SQ) and a receive queue (RQ), which manage work queue elements (WQEs) corresponding to various types of RDMA work requests (WRs). The WQE (i.e., the WR's task description) waits for the RDMA network card to schedule and resolve the data. The RDMA network card retrieves the data from the buffer pointed to by the WQE and sends it to the other end of the Channel connection.

[0268] S305 : The electronic device 200 sends an RDMA message 1 to the electronic device 100 . The RDMA message 1 carries the virtual address of the display buffer 2 .

[0269] In some embodiments, after establishing the RDMA connection, RDMA network card 2 sends the virtual address of display buffer 2 to RDMA network card 1. This means that RDMA network card 1 is informed in advance of the target storage address of the projected image in electronic device 200, so that RDMA network card 1 can directly write the image data of the projected image to the target storage address.

[0270] In some embodiments, the RDMA message 1 also includes a key 1. After establishing an RDMA connection, the electronic device 200 registers the display buffer 2 with the RDMA network card 2, obtains the key 1 (Remote key) corresponding to the display buffer 2, and the RDMA network card 2 records the correspondence between the address of the display buffer 2 and the key 1; after registration, the RDMA network card 2 sends an RDMA message 1 to the RDMA network card 1, and the RDMA message 1 includes the virtual address of the display buffer 2 and the key 1. Sending the key 1 to the RDMA network card 1 of the electronic device 100 grants the network card the authority to remotely operate the display buffer 2. In some embodiments, the RDMA message 1 may also include the memory length of the display buffer 2, and the memory length is used to indicate the maximum amount of data that can be written to the display buffer 2.

[0271] In some embodiments, referring to FIG9B , the electronic device 200 registers the display buffer 2 with the RDMA network card 2, including: (1) the upper-layer application (e.g., screen projection application) of the electronic device 200 instructs the HWC to send an instruction to the RDMA network card driver; (2) based on the instruction, the RDMA network card driver instructs the RDMA network card 2 to register the address of the display buffer 2. In one implementation, the screen projection application of the electronic device 200 instructs the HWC to send an instruction to the RDMA network card driver, including: the screen projection application of the electronic device 200 sends an instruction to the surfaceflinger through the WMS, and based on the instruction, the surfaceflinger instructs the HWC to register the address of the display buffer 2 with the RDMA network card 2; the HWC sends an instruction to the RDMA network card driver. Step S305 includes: (3) the RDMA network card 2 sends the RDMA message 1 to the RDMA network card 1.

[0272] In some embodiments, the display buffer of the electronic device 200 includes multiple buffers (e.g., buffer a, buffer b, and buffer c), and display buffer 2 is one of the multiple buffers. RDMA message 1 includes the virtual address of each of the multiple buffers. In subsequent embodiments, the RDMA network card 1 of the electronic device 100 may also write the latest synthesized projection image to one of the multiple buffers of the electronic device 200 through an RDMA write request in the order of the buffer addresses. In some embodiments, RDMA message 1 may also include the memory size of each buffer.

[0273] S306 , the screen projection application of the electronic device 100 instructs drawing a composite screen projection to the projection screen 1 of the electronic device 200 .

[0274] For the specific implementation of step S305, reference may be made to the related description of the aforementioned step S104, which will not be repeated here.

[0275] S307 , after the electronic device 100 determines that the projection screen 1 is synthesized, it submits a work request WR1 to the RDMA network card 1 . The work request WR1 is used to instruct to write the image data of the projection screen 1 into the display buffer 2 of the electronic device 200 .

[0276] In some embodiments, after the HWC determines that the projection screen 1 is synthesized (for example, it determines that the image data of the projection screen 1 is written into the display buffer 1), it submits a work request WR1 to the RDMA network card 1. For example, referring to FIG9B , step S307 includes: (4) After the HWC determines that the projection screen 1 is synthesized, it submits a work request WR1 to the RDMA network card driver, where the work request WR1 includes the virtual address of the display buffer 1 storing the projection screen 1; (5) The RDMA network card driver sends the work request WR1 to the RDMA network card 1.

[0277] In some embodiments, after establishing an RDMA connection, the upper-layer application of the electronic device 200 (e.g., a screen projection application) instructs the HWC to turn on the enable switch 1; after turning on the enable switch 1, when it is determined that a new screen projection image has been synthesized, the HWC submits a work request WR1 to the RDMA network card 1. In some embodiments, the upper-layer application of the electronic device 200 instructs the HWC to turn on the enable switch 1, including: the screen projection application of the electronic device 200 sends an instruction to the surfaceflinger through the WMS, and based on the instruction, the surfaceflinger instructs the HWC to turn on the enable switch 1.

[0278] In some embodiments, referring to the RDMA implementation process shown in FIG9C , step S306 includes: (1) when the HWC of the electronic device 100 determines that the projection screen 1 is synthesized, it submits WR1 to the RDMA network card 1. The RDMA network card 1 generates a task WQE (for example, WQE1 shown in FIG9C ) corresponding to WR based on the above-mentioned WR1 and the virtual address of the display buffer 2 carried by the RDMA message 1, and adds it to the SQ queue. WQE1 may include the RDMA operation type (i.e., write operation), the local data address (i.e., the virtual address of the display buffer 1 storing the projection screen 1), the target storage address (i.e., the virtual address of the display buffer 2 of the electronic device 200) and the key 1 corresponding to the display buffer 2.

[0279] S308. Based on WR1, the electronic device 100 sends an RDMA write request 1 to the electronic device 200. The RDMA write request 1 is used to instruct that the data of the projection screen 1 be written into the display buffer 2 of the electronic device 200. The RDMA write request 1 carries the virtual address of the display buffer 2 and the image data of the projection screen 1 in the display buffer 1.

[0280] In some embodiments, the RDMA write request 1 also carries the key 1 corresponding to the display buffer 2 , and the key 1 is used to verify that the electronic device 100 has the authority to operate the display buffer 2 .

[0281] In some embodiments, referring to FIG9B , step S308 includes: (6) based on the address of display buffer 1 indicated by WR1, RDMA network card 1 instructs the RDMA network card driver to read the data of display buffer 1; (7) RDMA network card 1 obtains the data of display buffer 1; (8) based on the data of display buffer 1, RDMA network card 1 assembles RDMA write request 1 and sends RDMA write request 1 to RDMA network card 2.

[0282] In an embodiment of the present application, the electronic device 100 can write the projection image 1 in the display buffer 1 of the electronic device 100 into the display buffer 2 of the electronic device 200 through an RDMA unilateral operation (write operation) or an RDMA bilateral operation.

[0283] In some embodiments, referring to the RDMA implementation process shown in FIG9C , step S308 includes: (2) RDMA network card 1 takes out WQE1 (i.e., the task corresponding to WR1) from SQ and parses the information WQE1; converts the virtual address of display buffer 1 in WQE1 to obtain the physical address; (3) reads the image data of the projection screen 1 from the memory of the electronic device 100 according to the physical address, and assembles the RDMA write request 1; (4) RDMA network card 1 sends the RDMA write request 1 to RDMA network card 2 via the physical link of the RDMA connection (e.g., IB link / Ethernet link).

[0284] S309 : Based on the RDMA write request 1 , the RDMA network card 2 of the electronic device 200 writes the data of the display buffer 1 into the display buffer 2 .

[0285] In some embodiments, referring to FIG9B , step S308 includes: (9) after parsing the RDMA write request 1, the RDMA network card 2 sends an instruction to the RDMA network card driver; (10) based on the instruction, the RDMA network card driver writes the data of the display buffer 1 to the display buffer 2 of the local memory.

[0286] In some embodiments, referring to the RDMA implementation process shown in FIG9C , step S309 includes: (5) RDMA network card 2 parses RDMA write request 1 and converts the target storage address in RDMA write request 1 (i.e., the virtual address of display buffer 2) into a physical address of local memory; (6) writes the target data in RDMA write request 1 (i.e., the data of display buffer 1) into the physical address.

[0287] In some embodiments, referring to the RDMA implementation process shown in FIG9C , after step S308, the following further steps are included: (9) RDMA network card 2 replies with an acknowledgment message (ACK) to RDMA network card 1. (7) RDMA network card 1 generates a completion queue element (CQE) (e.g., CQE) based on the acknowledgment message and places it in the CQ. (8) The upper-layer application determines that the task is complete based on CQE1.

[0288] S310. The electronic device 200 displays the projection screen 1 according to the image data in the display buffer 2.

[0289] The specific implementation of step S310 can refer to the relevant description of the aforementioned step S109, which will not be repeated here.

[0290] Solution 2 uses RDMA to realize the transmission of projection data, which can provide microsecond access latency and about 100Gbps of per-connection throughput. For example, referring to Figure 9D, in the refresh cycle after the arrival of vsync1, the electronic device 100 draws and renders each layer and caches it in the buffer of the buffer queue; in the refresh cycle after the arrival of the next vsync (i.e., vsync2), the electronic device 100 synthesizes the projection screen (e.g., projection screen 1) based on the drawn and rendered layers, and after the display buffer 1 stores the image data of the projection screen, the data of the display buffer 1 can be written to the display buffer 2 of the electronic device 200 in a very short time. In this way, when the clocks of the two devices are synchronized, the electronic device 100 and the electronic device 200 can display the same projection screen in the refresh cycle after another vsync (i.e., vsync3). This solution can support higher refresh rates (e.g., 60fps, 90fps, or 120fps).

[0291] In some embodiments, the screen projection sent by electronic device 100 to electronic device 200 is playing audio or video. During the screen projection process, electronic device 100 also sends the audio corresponding to the screen projection to electronic device 200. As shown in Figure 9E, the screen projection solution also includes audio sharing, and the audio sharing method flow includes steps S311 to S316. The following is a detailed introduction to steps S311 to S316 in conjunction with the software structure shown in Figure 9F.

[0292] S311 : The electronic device 200 sends an RDMA message 2 to the electronic device 100 . The RDMA message 2 carries the virtual address of the audio buffer 2 .

[0293] In some embodiments, after establishing the RDMA connection, RDMA network card 2 sends the virtual address of display audio buffer 2 to RDMA network card 1. This means that RDMA network card 1 is informed in advance of the target storage address of the screen projection audio in electronic device 200, so that RDMA network card 1 can directly write the audio data of the screen projection audio to the target storage address.

[0294] In some embodiments, RDMA message 2 also includes key 2. After establishing the RDMA connection, the electronic device 200 registers the audio buffer 2 with the RDMA network card 2, obtains the key 2 (Remote key) corresponding to the audio buffer 2, and the RDMA network card 2 records the correspondence between the address of the audio buffer 2 and the key 2; after registration, the RDMA network card 2 sends an RDMA message 2 to the RDMA network card 1. The RDMA message 2 includes the virtual address of the audio buffer 2 and the key 2. Sending the key 2 to the RDMA network card 1 of the electronic device 100 grants the network card the authority to remotely operate the audio buffer 2. In some embodiments, the RDMA message 2 may also include the memory length of the audio buffer 2, which is used to indicate the maximum amount of data that can be written to the audio buffer 2.

[0295] In some embodiments, referring to FIG9F , the electronic device 200 registers audio buffer 2 with the RDMA network card 2, including: (1) the upper layer application (e.g., screen projection application) of the electronic device 200 instructs the Audio HAL to send an instruction to the RDMA network card driver; (2) based on the instruction, the RDMA network card driver instructs the RDMA network card 2 to register the address of audio buffer 2. In one implementation, the screen projection application of the electronic device 200 instructs the Audio HAL to register audio buffer 2 with the RDMA network card 2 through the Audioflinger. Step S311 includes: (3) the RDMA network card 2 sends the RDMA message 2 to the RDMA network card 1.

[0296] In some embodiments, similar to the display buffer, the audio buffer of the electronic device 200 may also include multiple buffers, and audio buffer 2 is one of the multiple buffers. RDMA message 2 includes the virtual address of each of the multiple buffers. In subsequent embodiments, the RDMA network card 1 of the electronic device 100 may also write the latest synthesized screen projection audio to one of the multiple buffers of the electronic device 200 through RDMA write requests in the order of the buffer addresses. In some embodiments, RDMA message 2 may also include the memory size of each buffer.

[0297] In some embodiments, the RDMA message also includes a buffer type (e.g., audio buffer or display buffer). This allows the RDMA network card 1 of the electronic device 100 to identify the virtual address in RDMA message 2 as the address of the audio buffer and the virtual address in RDMA message 1 as the address of the display buffer. For example, the buffer type included in RDMA message 2 indicates an audio buffer.

[0298] S312. The screen projection application of the electronic device 100 instructs to synthesize the screen projection audio; and stores the audio data of the synthesized screen projection audio 1 in the audio buffer 1.

[0299] For the specific implementation of step S312, reference may be made to the relevant description of step S110 in FIG6C , which will not be repeated here.

[0300] S313. After the electronic device 100 determines that the screen projection audio 1 is synthesized, it submits a work request WR2 to the RDMA network card 1. The work request WR2 is used to instruct the audio data of the screen projection audio 1 to be written into the audio buffer 2 of the electronic device 200.

[0301] In some embodiments, after the Audio HAL determines that the screen projection audio 1 has been synthesized (for example, after determining that the audio data of the screen projection audio 1 has been written to the display buffer 1), it submits a work request WR2 to the RDMA network card 1. For example, referring to FIG9F , step S313 includes: (4) After the Audio HAL determines that the screen projection audio 1 has been synthesized, it submits a work request WR2 to the RDMA network card driver, where the work request WR2 includes the virtual address of the audio buffer 1 storing the screen projection audio 1; (5) the RDMA network card driver sends the work request WR2 to the RDMA network card 1.

[0302] In some embodiments, after establishing an RDMA connection, an upper-layer application (e.g., a screen projection application) of electronic device 200 instructs the Audio HAL to turn on enable switch 2. After enabling switch 2, upon detecting that screen projection audio synthesis is complete, the Audio HAL submits a work request to RDMA network card 1. In some embodiments, the upper-layer application of electronic device 200 instructs the Audio HAL to turn on enable switch 2, including: the screen projection application of electronic device 200 instructs the Audio HAL to turn on enable switch 2 through the Audioflinger.

[0303] In some embodiments, RDMA network card 1 generates WQE2 based on WR2 and adds WQE2 to the SQ queue. WQE2 may include the RDMA operation type (i.e., a write operation), the local data address (i.e., the virtual address of audio buffer 1 storing the screen projection audio 1), the target storage address (i.e., the virtual address of audio buffer 2 of electronic device 200), and the key 2 corresponding to audio buffer 2.

[0304] S314. Based on WR2, the electronic device 100 sends an RDMA write request 2 to the electronic device 200. The RDMA write request 2 is used to indicate that the data of the projection audio 1 is written into the audio buffer 2 of the electronic device 200. The RDMA write request 1 carries the virtual address of the audio buffer 2 and the audio data of the projection audio 1 in the audio buffer 1.

[0305] In some embodiments, the RDMA write request 1 also carries the key 2 corresponding to the audio buffer 2, where the key 2 is used to verify that the electronic device 100 has the authority to operate the audio buffer 2; the key 2 corresponding to the audio buffer 2.

[0306] In some embodiments, referring to FIG9F , step S314 includes: RDMA network card 1 takes out WQE2 (i.e., the task corresponding to WR2) from SQ and parses information WQE2; converts the virtual address of audio buffer 1 in WQE to obtain a physical address; (6) RDMA network card 1 instructs the RDMA network card driver to read the data of audio buffer 1 at the physical address; (7) RDMA network card 1 obtains the data of audio buffer 1; (8) based on the data of audio buffer 1, RDMA network card 1 assembles RDMA write request 2 and sends RDMA write request 1 to RDMA network card 2.

[0307] In some embodiments, the work request WR also includes a data type (such as audio or image). In this way, the RDMA network card 2 can distinguish between the work request WR2 for the screen projection audio and the work request WR1 for the screen projection image, and then generate an RDMA write request 2 for the screen projection audio or an RDMA write request 1 for the screen projection image. For example, WR2 includes an indication that the data type is audio, and the RDMA network card 2 obtains the virtual address of the audio buffer 1 of the electronic device 100 based on the data type; then assembles the RDMA write request 2 based on the address. The data type indicated by WR1 is image, and the RDMA network card 2 obtains the virtual address of the display buffer 1 of the electronic device 100 based on the data type; then assembles the RDMA write request 1 based on the address.

[0308] S315 : Based on the RDMA write request 2 , the RDMA network card 2 of the electronic device 200 writes the data of the audio buffer 1 into the audio buffer 2 .

[0309] In some embodiments, referring to FIG. 9F , step S308 includes: (9) parsing RDMA write request 2, and RDMA network card 2 sending an instruction to the RDMA network card driver; (10) based on the instruction, the RDMA network card driver writes the data of audio buffer 1 in RDMA write request 2 to audio buffer 2 in the local memory.

[0310] In some embodiments, step S309 includes: (5) RDMA network card 2 parses RDMA write request 2 and converts the target storage address in RDMA write request 2 (i.e., the virtual address of audio buffer 2) into a physical address of local memory; (6) writes the target data in RDMA write request 2 (i.e., the data of audio buffer 1) into the physical address.

[0311] S316. The audio output device of the electronic device 200 outputs the projection audio 1 according to the audio data cached in the audio buffer 2.

[0312] For the specific implementation of step S312, reference may be made to the relevant description of step S115 in FIG6C , which will not be repeated here.

[0313] In some embodiments, referring to the description of FIG9B and FIG9F , the RDMA network card 2 directly writes the projection image from the electronic device 100 into the local display buffer 2 , and directly writes the projection audio from the electronic device 100 into the local audio buffer 2 .

[0314] In some embodiments, if the electronic device 100 projects the screen to the electronic device 200 and the audio is also sent synchronously to the electronic device 200, it is necessary to ensure that the picture and audio of the projected screen and the projected audio are synchronized (for example, projected screen 1 corresponds to projected audio 1, and projected screen 2 corresponds to projected audio 2).

[0315] In some embodiments, referring to FIG9F , the kernel layer of the electronic device 200 includes a synchronization module, which is used to control the picture and sound synchronization of the projection screen and the projection screen audio. After the RDMA network card obtains the projection screen (e.g., the projection screen 1 of step S308) through RDMA write request 1, and obtains the projection screen audio (e.g., the projection screen audio of step S314) through RDMA write request 2, (11) the RDMA network card sends the above-mentioned projection screen 1 and projection screen audio 1 to the synchronization module through the RDMA network card driver; the projection screen 1 and projection screen audio 1 can be sent at the same time or separately, which is not specifically limited here. After the synchronization module synchronizes the picture and sound of the received projection screen and projection screen audio, in the same refresh cycle, (12) the projection screen 1 is written to the display buffer 2, and (13) the projection screen audio 1 is written to the audio buffer 2.

[0316] How the synchronization module synchronizes the projection image and projection audio can refer to the existing technology. In one implementation, RDMA write request 1 also carries the timestamp of projection image 1, and RDMA write request 2 also carries the timestamp of projection audio 1; the RDMA network card also sends the timestamp of projection image and the timestamp of projection audio to the synchronization module; when the synchronization module determines that the timestamps of projection image 1 and projection audio 1 received are consistent, it determines that projection image 1 and projection audio 1 are synchronized, otherwise they are out of sync. When out of sync, an error can be reported to RDMA network card 1 through RDMA network card 2.

[0317] In some embodiments, in the screen projection return control stage of scheme two, the RDMA network card 3 of the electronic device 100 directly writes the screen projection return control event in the event buffer 2 of the electronic device 200 directly into the event buffer 1 of the electronic device 100, and the upper-layer application of the electronic device 100 responds to the event based on the input event in the event buffer 1.

[0318] For example, FIG10A shows a method flow of screen projection reverse control of the solution. The following is an introduction to the method flow of screen projection reverse control in conjunction with the implementation flow of screen projection reverse control shown in FIG10B.

[0319] S401: The electronic device 100 sends an RDMA message 3 to the electronic device 200. The RDMA message 3 carries the virtual address of the event buffer 1.

[0320] For ease of description, the buffer in the memory space of electronic device 100 used to store raw input events can be referred to as the event buffer of electronic device 100 (e.g., event buffer 1). In some embodiments, raw input events of IO device nodes corresponding to different input devices (e.g., screen, mouse) are stored in different event buffers (e.g., event buffer 2 corresponding to the screen of electronic device 100). RDMA message 3 carries the virtual address of each event buffer of electronic device 100 and the identifier of the corresponding input device.

[0321] In some embodiments, after establishing the RDMA connection, RDMA network card 1 sends the virtual address of event buffer 1 to RDMA network card 2. That is, RDMA network card 2 is informed in advance of the target storage address of the original input event in electronic device 100, so that RDMA network card 2 can directly write the screen projection reverse control event to the target storage address.

[0322] In some embodiments, RDMA message 3 also includes key 3. After establishing the RDMA connection, electronic device 100 registers event buffer 1 with RDMA network card 1, obtains key 3 (Remote key) corresponding to event buffer 1, and RDMA network card 1 records the correspondence between the address of event buffer 1 and key 3; after registration, RDMA network card 1 sends RDMA message 3 to RDMA network card 2, and RDMA message 3 includes the virtual address of event buffer 1 and key 3. Sending key 3 to RDMA network card 2 of electronic device 200 grants the network card the authority to remotely operate event buffer 1. In some embodiments, RDMA message 2 may also include the memory length of event buffer 1, which is used to indicate the maximum amount of data that can be written to event buffer 1.

[0323] In some embodiments, referring to FIG10B , electronic device 100 registers event buffer 1 with RDMA network card 1, including: (1) the screen projection application of electronic device 100 instructs the IO device node (e.g., / dev / input / eventX) to send an instruction to the RDMA network card driver; (2) based on the instruction, the RDMA network card driver instructs RDMA network card 1 to register the address of event buffer 1. Step S401 includes: (3) RDMA network card 1 sends RDMA message 3 to RDMA network card 2.

[0324] S402. After the electronic device 200 receives the user's screen projection reverse control operation, the IO device node ( / dev / input / eventX) stores the screen projection reverse control event corresponding to the screen projection reverse control operation in event buffer2.

[0325] The specific implementation of step S402 can refer to the relevant description of step S201, which will not be repeated here.

[0326] S403. After the IO device node of the electronic device 200 stores the screen projection reverse control event 1 in the event buffer 2, it submits a work request WR3 to the RDMA network card 2. The work request WR3 is used to instruct to write the screen projection reverse control event 1 into the event buffer 1 of the electronic device 100.

[0327] In some embodiments, referring to FIG10B , step S403 includes: (4) after the IO device node ( / dev / input / eventX) stores the screen projection reverse control event 1 in the event buffer 2, it submits a work request WR3 to the RDMA network card driver. The work request WR3 includes the virtual address of the event buffer 2 storing the screen projection reverse control event 1; (5) the RDMA network card driver sends the work request WR3 to the RDMA network card 2.

[0328] In some embodiments, after establishing the RDMA connection, the upper-layer application of the electronic device 200 (for example, the screen projection application) instructs the IO device node to turn on the enable switch 3; after turning on the enable switch 3, when the new screen projection reverse control event is stored in the event buffer 2, the IO device node submits a work request WR3 to the RDMA network card 2.

[0329] In some embodiments, referring to the RDMA implementation process shown in FIG10C , step 403 includes: (1) After the IO device node stores the projection reverse control event 1 in the event buffer 2, it submits WR3 to the RDMA network card 2. The RDMA network card 2 generates a task WQE3 corresponding to WR3 based on the virtual address of the event buffer 1 carried by the above WR3 and the RDMA message 3, and adds it to the SQ queue. WQE3 may include the RDMA operation type (i.e., write operation), the local data address (i.e., the virtual address of the event buffer 2), the target storage address (i.e., the virtual address of the event buffer 2), and the key 3 of the event buffer 2.

[0330] In some embodiments, RDMA message 3 carries the virtual address of each event buffer of electronic device 100 and the identifier of the corresponding input device. Electronic device 200 determines that event buffer 2 of local storage for screen projection reverse control event 1 corresponds to input device 1 (e.g., screen); electronic device 200 selects the virtual address of the event buffer corresponding to input device 1 (e.g., event buffer 1 corresponding to the screen) in RDMA message 3 as the target storage location.

[0331] S404. The electronic device 200 sends an RDMA write request 3 to the electronic device 100. The RDMA write request 3 is used to instruct the screen projection reverse control event 1 to be written into the event buffer 1 of the electronic device 100. The RDMA write request 3 carries the virtual address of the event buffer 1 and the data of the screen projection reverse control event 1 in the event buffer 2.

[0332] In some embodiments, the RDMA write request 3 also carries a key 3, which is used to verify that the electronic device 200 has the authority to operate the event buffer 1.

[0333] In some embodiments, referring to FIG. 10B , step S404 includes: (6) based on the address of event buffer 2 indicated by WR3, RDMA network card 2 instructs the RDMA network card driver to read data from event buffer 2; (7) RDMA network card 2 obtains data from event buffer 2; (8) based on the data from event buffer 2, RDMA network card 2 assembles RDMA write request 3 and sends RDMA write request 3 to RDMA network card 1.

[0334] In some embodiments, referring to the RDMA implementation process shown in FIG10C , step S404 includes: (2) RDMA network card 2 takes out WQE3 (i.e., the task corresponding to WR3) from SQ and parses the information WQE3; converts the virtual address of event buffer 2 in WQE3 to obtain the physical address; (3) reads the data of screen projection reverse control event 1 from the memory of electronic device 200 according to the physical address 3, and assembles RDMA write request 3; (4) RDMA network card 2 sends RDMA write request 3 to RDMA network card 1 through the RDMA connection.

[0335] S405 : Based on the RDMA write request 3 , the RDMA network card 1 of the electronic device 100 writes the data of the event buffer 2 into the event buffer 1 .

[0336] In some embodiments, referring to FIG10B , step S405 includes: (9) after parsing the RDMA write request 3, the RDMA network card 1 sends an instruction to the RDMA network card driver; (10) based on the instruction, the RDMA network card driver writes the data of the event buffer 2 in the RDMA write request 3 into the event buffer 1 of the local memory.

[0337] In some embodiments, referring to the RDMA implementation process shown in FIG10C , step S405 includes: (5) RDMA network card 1 parses RDMA write request 3 and converts the target storage address in RDMA write request 3 (i.e., the virtual address of event buffer 1) into the physical address of local memory; (6) writes the target data in RDMA write request 3 (i.e., the data in event buffer 2) into the physical address.

[0338] In some embodiments, referring to the RDMA implementation process shown in FIG10C , after step S405, the following further steps are included: (9) RDMA network card 1 replies with an acknowledgment message (ACK) to RDMA network card 2. (7) RDMA network card 1 generates a completion queue element (CQE) (e.g., CQE3) based on the acknowledgment message and places it in the CQ. (8) The upper-layer application determines that the task is complete based on CQE3.

[0339] S406. The IO device node of the electronic device 100 distributes the screen projection reverse control event to APP1 through the input subsystem.

[0340] In some embodiments, referring to FIG10B , step S103 includes: (11) the input subsystem reads the screen projection reverse control event from the event buffer1 through the IO device node. (12) The user's screen projection reverse control operation acts on APP1, and the input subsystem distributes the above-mentioned screen projection reverse control event to APP1. In one implementation method, after the IMS detects the screen projection reverse control event (i.e., touch event) output by the above-mentioned input subsystem, it calls the WMS to determine the target window corresponding to the touch event, and the target application corresponding to the above-mentioned reverse control event is APP1 corresponding to the target window.

[0341] S407. APP1 of electronic device 100 determines the response event corresponding to the projection screen reverse control event, and the response event indicates the display content of the projection screen 2 after the response; based on the response event, the projection screen 2 after the response is drawn, and the synthesized projection screen 2 is cached to display buffer 3.

[0342] In some embodiments, the specific implementation of step S407 can refer to the relevant description of step S206, which will not be repeated here.

[0343] S408 . After the electronic device 100 determines that the projection screen 2 is synthesized, it submits a work request WR4 to the RDMA network card 1 . The work request WR4 is used to instruct the image data of the projection screen 1 to be written into the display buffer 4 of the electronic device 200 .

[0344] In some embodiments, the specific implementation of step S408 can refer to the relevant description of step S307, which will not be repeated here.

[0345] S409. Based on WR4, the electronic device 100 sends an RDMA write request 4 to the electronic device 200. The RDMA write request 4 is used to instruct that the data of the projection screen 2 be written into the display buffer 3 of the electronic device 200. The RDMA write request 4 carries the virtual address of the display buffer 4 and the image data of the projection screen 2 in the display buffer 3.

[0346] In some embodiments, the specific implementation of step S409 can refer to the relevant description of step S308 and will not be repeated here.

[0347] S410 : Based on the RDMA write request 4 , the RDMA network card 2 of the electronic device 200 writes the data of the display buffer 3 into the display buffer 4 .

[0348] In some embodiments, the specific implementation of step S410 can refer to the relevant description of step S309, which will not be repeated here.

[0349] S411. The electronic device 200 displays the projection screen 2 according to the image data stored in the display buffer 4.

[0350] The specific implementation of step S411 can refer to the relevant description of the aforementioned step S109, which will not be repeated here.

[0351] In some embodiments, when the electronic device 100 sends the projection screen 2 to the electronic device 200, it also sends the audio corresponding to the projection screen 2 to the electronic device 200. For details, please refer to the relevant description of Figure 9E, which will not be repeated here.

[0352] The embodiments provided in this application can be adaptively combined. For example, in Solution 2 and Solution 1, the same technical concepts (such as display buffer, audio buffer and event buffer) and the same implementation steps can be referenced / combined with each other.

[0353] In summary, the embodiment of the second implementation scheme combines RDMA technology to realize screen sharing, audio sharing and screen reverse control in the screen projection scenario, which has the following advantages: (1) This device (such as electronic device 100 or electronic device 200) can write the data required for screen projection (such as projection screen, projection audio or projection reverse control event) from the buffer of this device directly to the buffer of another device, without the need to copy the data to the network software stack. (2) The upper-layer application can directly perform data transmission in the user state, without the need to switch context between kernel state and user state multiple times. (3) The upper-layer application of this device accesses the memory of another device (such as display buffer1 / audio buffer1 of electronic device 100, or event buffer2 of electronic device 200) without the CPU intervention of the other device, thereby reducing the CPU load. (4) No encoding and decoding is required. (5) No data compression is involved, which can avoid the problem of image quality degradation caused by lossy compression. Based on the above advantages, the CPU load, screen projection power consumption and screen projection delay can be effectively reduced, the screen projection image quality can be guaranteed, and the user experience can be effectively improved.

[0354] Based on the above embodiments, the present application provides a screen projection method, which is applied to a screen projection system, wherein the screen projection system includes a first electronic device and a second electronic device. For example, referring to FIG11 , the method includes steps S501 to S503.

[0355] S501: A first electronic device receives a first input operation, where the first input operation is used to trigger the first electronic device to project a screen onto a second electronic device.

[0356] In the embodiment of the present application, the electronic device 100 may also be referred to as a first electronic device; the electronic device 200 may also be referred to as a second electronic device. The first input operation may include the aforementioned screen projection operation.

[0357] S502. Based on the first input operation, the remote direct memory access (RDMA) network card of the first electronic device sends a first request to the RDMA network card of the second electronic device. The first request includes the first screen projection information and the address of the second memory space of the second electronic device. The first request is used to indicate that the first screen projection information is written into the second memory space.

[0358] In some embodiments, before the RDMA network card of the first electronic device sends the first request to the RDMA network card of the second electronic device, it also includes: after the first electronic device detects that the first electronic device synthesizes the first projection information and stores it in the first memory space, the RDMA network card of the first electronic device generates a first request based on the first projection information in the first memory space.

[0359] In some embodiments, after the first electronic device receives the first input operation, before the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, the above method also includes: the second electronic device sends a first RDMA message to the first electronic device, the first RDMA message includes the address of the second memory space of the second electronic device, and the second memory space is used to store the projection information from the first electronic device.

[0360] In some embodiments, before the RDMA network card of the second electronic device sends the first RDMA message to the RDMA network card of the first electronic device, it also includes: based on the first input operation, the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, and the first RDMA message and the first request are sent through the RDMA connection.

[0361] In some embodiments, before the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, the process further includes: in response to a first input operation, the first electronic device sends a screen projection request to the second electronic device through the first communication module; the first electronic device receives a screen projection response sent by the second electronic device through the first communication module; the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, including: when determining to project the screen based on the screen projection response, the RDMA network card of the second electronic device and the RDMA network card of the first electronic device establish an RDMA connection. In the embodiment of the present application, the first communication module may include the aforementioned communication module 1.

[0362] In some embodiments, before the second electronic device sends the first RDMA message to the first electronic device, it also includes: the second electronic device registers the second memory space to the RDMA network card of the second electronic device, and obtains the first key corresponding to the address of the second memory space; the first RDMA message also includes the first key, and the first request also includes the first key; based on the first request, the RDMA network card of the second electronic device writes the first screen projection information into the second memory space, including: after the RDMA network card of the second electronic device determines that the first key included in the first request is the key corresponding to the address of the second memory space, the first screen projection information is written into the second memory space.

[0363] In some embodiments, the first projection information includes image data of the first projection screen; the second electronic device outputs the first projection information based on the data stored in the second memory space, including: the display screen of the second electronic device displays the first projection screen based on the data stored in the second memory space.

[0364] In an embodiment of the present application, when the first projection information includes image data of the first projection screen, the first request may include the aforementioned RDMA write request 2, the first projection screen may include the aforementioned projection screen 1, the first memory space includes the aforementioned display buffer 1, the second memory space may include the aforementioned display buffer 2, the first RDMA message may include the aforementioned RDMA message 1, and the first key may include the aforementioned key 1.

[0365] In some embodiments, the first screen projection information includes audio data of the first screen projection audio; the second electronic device outputs the first screen projection information based on the data stored in the second memory space, including: the audio output device of the second electronic device outputs the first screen projection audio based on the data stored in the second memory space.

[0366] In an embodiment of the present application, when the first screen projection information includes audio data of the first screen projection audio, the first request may include the aforementioned RDMA write request 2, the first screen projection audio may include the aforementioned screen projection audio 1, the first memory space may include the aforementioned audio buffer 1, the second memory space may include the aforementioned audio buffer 2, the first RDMA message may include the aforementioned RDMA message 2, and the first key may include the aforementioned key 2.

[0367] In some embodiments, the first projection information includes image data of the first projection screen; the clocks of the first electronic device and the second electronic device are synchronized, and the above method also includes: in the first refresh cycle, writing the first projection screen into the first memory space of the first electronic device; in the next refresh cycle of the first refresh cycle, the display screen of the first electronic device displays the first projection screen based on the data stored in the first memory space; the RDMA network card of the second electronic device writes the first projection information into the second memory space, including: in the first refresh cycle, the RDMA network card of the second electronic device writes the first projection information into the second memory space; the second electronic device outputs the first projection information based on the data stored in the second memory space, including: in the next refresh cycle of the first refresh cycle, the display screen of the second electronic device displays the first projection screen based on the data stored in the second memory space. In the embodiment of the present application, the first refresh cycle may include the aforementioned vsync2, and the second refresh cycle may include the aforementioned vsync3.

[0368] S503. Based on the first request, the RDMA network card of the second electronic device writes the first screen projection information into the second memory space; the second electronic device outputs the first screen projection information based on the data stored in the second memory space.

[0369] In some embodiments, after the second electronic device outputs the first screen projection information based on the data stored in the second memory space, the method includes: the second electronic device receives a second input operation; the second electronic device stores the first screen projection reverse control event corresponding to the second input operation in the third memory space; the RDMA network card of the second electronic device sends a second request to the RDMA network card of the first electronic device, the second request includes the data of the first screen projection reverse control event and the address of the fourth memory space of the first electronic device, and the second request is used to indicate that the data of the first screen projection reverse control event is written to the fourth memory space; based on the second request, the RDMA network card of the first electronic device writes the data of the first screen projection reverse control event into the fourth memory space; based on the first screen projection reverse control event stored in the fourth memory space, the first electronic device executes a first response event.

[0370] In some embodiments, before the RDMA network card of the second electronic device sends a second request to the RDMA network card of the first electronic device, it also includes: after the second electronic device detects that the first screen projection reverse control event is stored in the third memory space, the RDMA network card of the second electronic device generates a second request based on the data of the first screen projection reverse control event in the third memory space.

[0371] In some embodiments, before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, the above method also includes: the first electronic device sends a second RDMA message to the second electronic device, the second RDMA message includes the address of the fourth memory space of the first electronic device, and the fourth memory space is used to store input events of the first electronic device.

[0372] In an embodiment of the present application, the second input operation may include the aforementioned screen projection reverse control operation; the third memory space may include the aforementioned event buffer 2; the first screen projection reverse control event may include the aforementioned screen projection reverse control event 1; the fourth memory space may include the aforementioned event buffer 1; the second request may include the aforementioned RDMA write request 3; the second RDMA message may include the aforementioned RDMA message 3.

[0373] The various implementation modes of this application can be combined arbitrarily to achieve different technical effects.

[0374] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments may be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described herein are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).

[0375] Those skilled in the art will appreciate that all or part of the process steps in the above-described method embodiments can be implemented by a computer program instructing the relevant hardware. The program can be stored in a computer-readable storage medium, and when executed, the program can include the process steps in the above-described method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as ROM or random access memory (RAM), magnetic disks, or optical disks.

[0376] In short, the above description is only an embodiment of the technical solution of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made based on the disclosure of the present invention should be included in the scope of protection of the present invention.

Claims

1. A screen projection method, characterized in that: Applied to a screen projection system, the screen projection system includes a first electronic device and a second electronic device, and the method includes: The first electronic device receives a first input operation, where the first input operation is used to trigger the first electronic device to project a screen onto the second electronic device; Based on the first input operation, the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, where the first request includes first screen projection information and an address of a second memory space of the second electronic device, and the first request is used to instruct to write the first screen projection information into the second memory space; Based on the first request, the RDMA network card of the second electronic device writes the first screen projection information into the second memory space; The second electronic device outputs first screen projection information based on the data stored in the second memory space.

2. The method according to claim 1, characterized in that The first screen projection information includes image data of a first screen projection picture; and the second electronic device outputs the first screen projection information based on the data stored in the second memory space, including: The display screen of the second electronic device displays the first projection screen based on the data stored in the second memory space.

3. The method according to claim 1, characterized in that: The first screen projection information includes audio data of the first screen projection audio; The second electronic device outputting first screen projection information based on the data stored in the second memory space includes: The audio output device of the second electronic device outputs the first screen projection audio based on the data stored in the second memory space.

4. The method according to claim 1, characterized in that: Before the RDMA network card of the first electronic device sends the first request to the RDMA network card of the second electronic device, the method further includes: After the first electronic device detects that the first electronic device synthesizes the first screen projection information and stores it in the first memory space, the RDMA network card of the first electronic device generates the first request based on the first screen projection information in the first memory space.

5. The method according to claim 4, characterized in that The first screen projection information includes image data of a first screen projection picture; the first electronic device and the second electronic device are clock-synchronized, and the method further includes: In a first refresh cycle, writing the first projection image into the first memory space of the first electronic device; In a next refresh cycle of the first refresh cycle, the display screen of the first electronic device displays the first projection screen based on the data stored in the first memory space; The RDMA network card of the second electronic device writes the first screen projection information into the second memory space, including: In the first refresh cycle, the RDMA network card of the second electronic device writes the first screen projection information into the second memory space; The second electronic device outputting first screen projection information based on the data stored in the second memory space includes: In a refresh cycle next to the first refresh cycle, the display screen of the second electronic device displays the first projection screen based on the data stored in the second memory space.

6. The method according to claim 1, characterized in that After the first electronic device receives the first input operation, before the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, the method further includes: The second electronic device sends a first RDMA message to the first electronic device, where the first RDMA message includes an address of the second memory space of the second electronic device, where the second memory space is used to store screen projection information from the first electronic device.

7. The method according to claim 6, characterized in that Before the second electronic device sends the first RDMA message to the first electronic device, the method further includes: The second electronic device registers the second memory space to the RDMA network card of the second electronic device, and obtains a first key corresponding to the address of the second memory space; the first RDMA message also includes the first key, and the first request also includes the first key; The step of writing the first screen projection information into the second memory space by the RDMA network card of the second electronic device based on the first request includes: After the RDMA network card of the second electronic device determines that the first key included in the first request is the key corresponding to the address of the second memory space, the first screen projection information is written into the second memory space.

8. The method according to claim 6, characterized in that Before the RDMA network card of the second electronic device sends the first RDMA message to the RDMA network card of the first electronic device, the method further includes: Based on the first input operation, the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, and the first RDMA message and the first request are sent through the RDMA connection.

9. The method according to claim 8, characterized in that Before the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, the method further includes: In response to the first input operation, the first electronic device sends a screen projection request to the second electronic device through the first communication module; The first electronic device receives, through the first communication module, a screen projection response sent by the second electronic device; The RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, including: When the screen projection is determined based on the screen projection response, the RDMA network card of the second electronic device and the RDMA network card of the first electronic device establish an RDMA connection.

10. The method according to claim 1, characterized in that After the second electronic device outputs the first screen projection information based on the data stored in the second memory space, the method includes: The second electronic device receives a second input operation; The second electronic device stores the first screen projection reverse control event corresponding to the second input operation in a third memory space; The RDMA network card of the second electronic device sends a second request to the RDMA network card of the first electronic device, where the second request includes data of the first screen projection reverse control event and an address of a fourth memory space of the first electronic device, and the second request is used to instruct writing the data of the first screen projection reverse control event into the fourth memory space; Based on the second request, the RDMA network card of the first electronic device writes the data of the first screen projection reverse control event into the fourth memory space; Based on the first screen projection reverse control event stored in the fourth memory space, the first electronic device executes a first response event.

11. The method according to claim 10, characterized in that Before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, the method further includes: After the second electronic device detects that the first screen projection reverse control event is stored in the third memory space, the RDMA network card of the second electronic device generates the second request based on the data of the first screen projection reverse control event in the third memory space.

12. The method according to claim 10, characterized in that Before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, the method further includes: The first electronic device sends a second RDMA message to the second electronic device, where the second RDMA message includes an address of the fourth memory space of the first electronic device, where the fourth memory space is used to store input events of the first electronic device.

13. A screen projection method, characterized in that: Applicable to a first electronic device, comprising: The first electronic device receives a first input operation, where the first input operation is used to trigger the first electronic device to project a screen onto a second electronic device; Based on the first input operation, the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, the first request including first screen projection information and the address of the second memory space of the second electronic device, and the first request is used to indicate that the first screen projection information is written into the second memory space.

14. The method according to claim 13, characterized in that The first screen projection information includes image data of the first screen projection picture; the first screen projection information stored in the second memory space is used to display the first screen projection picture on the display screen of the second electronic device.

15. The method according to claim 13, characterized in that The first screen projection information includes audio data of the first screen projection audio; the first screen projection information stored in the second memory space is used for the audio output device of the second electronic device to output the first screen projection audio.

16. The method according to claim 13, characterized in that Before the RDMA network card of the first electronic device sends the first request to the RDMA network card of the second electronic device, the method further includes: After the first electronic device detects that the first electronic device synthesizes the first screen projection information and stores it in the first memory space, the RDMA network card of the first electronic device generates the first request based on the first screen projection information in the first memory space.

17. The method according to claim 13, characterized in that After the first electronic device receives the first input operation, before the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, the method further includes: The first electronic device receives a first RDMA message sent by the second electronic device, where the first RDMA message includes an address of the second memory space of the second electronic device, and the second memory space is used to store screen projection information from the first electronic device.

18. The method according to claim 17, characterized in that Before the RDMA network card of the second electronic device sends the first RDMA message to the RDMA network card of the first electronic device, the method further includes: Based on the first input operation, the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, and the first RDMA message and the first request are sent through the RDMA connection.

19. The method according to claim 18, characterized in that Before the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, the method further includes: In response to the first input operation, the first electronic device sends a screen projection request to the second electronic device through the first communication module; The first electronic device receives, through the first communication module, a screen projection response sent by the second electronic device; The RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection, including: When the screen projection is determined based on the screen projection response, the RDMA network card of the first electronic device and the RDMA network card of the second electronic device establish an RDMA connection.

20. The method according to claim 13, characterized in that After the RDMA network card of the first electronic device sends a first request to the RDMA network card of the second electronic device, the method includes: The RDMA network card of the first electronic device receives a second request sent by the RDMA network card of the second electronic device, where the second request includes data of the first screen projection reverse control event and an address of a fourth memory space of the first electronic device, and the second request is used to instruct to write the data of the first screen projection reverse control event into the fourth memory space; Based on the second request, the RDMA network card of the first electronic device writes the data of the first screen projection reverse control event into the fourth memory space; Based on the first screen projection reverse control event stored in the fourth memory space, the first electronic device executes a first response event.

21. The method according to claim 20, characterized in that Before the RDMA network card of the first electronic device receives the second request sent by the RDMA network card of the second electronic device, the method further includes: The first electronic device sends a second RDMA message to the second electronic device, where the second RDMA message includes an address of the fourth memory space of the first electronic device, where the fourth memory space is used to store input events.

22. A screen projection method, characterized in that: Applicable to a second electronic device, comprising: The RDMA network card of the second electronic device receives a first request sent by the RDMA network card of the first electronic device, where the first request includes first screen projection information and an address of a second memory space of the second electronic device, and the first request is used to instruct writing the first screen projection information into the second memory space; Based on the first request, the RDMA network card of the second electronic device writes the first screen projection information into the second memory space; The second electronic device outputs first screen projection information based on the data stored in the second memory space.

23. The method according to claim 22, characterized in that The first screen projection information includes image data of a first screen projection picture; and the second electronic device outputs the first screen projection information based on the data stored in the second memory space, including: The display screen of the second electronic device displays the first projection screen based on the data stored in the second memory space.

24. The method according to claim 22, characterized in that The first screen projection information includes audio data of the first screen projection audio; The second electronic device outputting first screen projection information based on the data stored in the second memory space includes: The audio output device of the second electronic device outputs the first screen projection audio based on the data stored in the second memory space.

25. The method according to claim 22, characterized in that Before the RDMA network card of the second electronic device receives the first request sent by the RDMA network card of the first electronic device, the method further includes: The second electronic device sends a first RDMA message to the first electronic device, where the first RDMA message includes an address of the second memory space of the second electronic device, where the second memory space is used to store screen projection information from the first electronic device.

26. The method according to claim 25, characterized in that Before the second electronic device sends the first RDMA message to the first electronic device, the method further includes: The second electronic device registers the second memory space to the RDMA network card of the second electronic device, and obtains a first key corresponding to the address of the second memory space; the first RDMA message also includes the first key, and the first request also includes the first key; The step of writing the first screen projection information into the second memory space by the RDMA network card of the second electronic device based on the first request includes: After the RDMA network card of the second electronic device determines that the first key included in the first request is the key corresponding to the address of the second memory space, the first screen projection information is written into the second memory space.

27. The method according to claim 25, characterized in that Before the RDMA network card of the second electronic device sends the first RDMA message to the RDMA network card of the first electronic device, the method further includes: The RDMA network card of the second electronic device establishes an RDMA connection with the RDMA network card of the first electronic device, and the first RDMA message and the first request are sent through the RDMA connection.

28. The method according to claim 22, characterized in that After the second electronic device outputs the first screen projection information based on the data stored in the second memory space, the method includes: The second electronic device receives a second input operation; The second electronic device stores the first screen projection reverse control event corresponding to the second input operation in a third memory space; The RDMA network card of the second electronic device sends a second request to the RDMA network card of the first electronic device, the second request including the data of the first screen projection reverse control event and the address of the fourth memory space of the first electronic device, the second request is used to indicate that the data of the first screen projection reverse control event is written into the fourth memory space, and the fourth memory space is used to store the input event of the first electronic device.

29. The method according to claim 28, characterized in that Before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, the method further includes: After the second electronic device detects that the first screen projection reverse control event is stored in the third memory space, the RDMA network card of the second electronic device generates the second request based on the data of the first screen projection reverse control event in the third memory space.

30. The method according to claim 28, characterized in that Before the RDMA network card of the second electronic device sends the second request to the RDMA network card of the first electronic device, the method further includes: The second electronic device receives a second RDMA message sent by the first electronic device, where the second RDMA message includes an address of the fourth memory space of the first electronic device.

31. An electronic device comprising a memory, one or more processors, and one or more computer programs; wherein: The one or more computer programs are stored in the memory; it is characterized in that when the one or more processors execute the one or more computer programs, the electronic device implements the method as described in any one of claims 13 to 21 or claims 22 to 30.

32. A computer storage medium, characterized in that The method comprises computer instructions, which, when executed on an electronic device, enable the electronic device to implement the method according to any one of claims 13 to 30.

Citation Information

Patent Citations

  • Screen projection method and electronic equipment

    CN114915834A

  • Screen projection method and device under virtualization management, equipment and medium

    CN115344226A

  • Screen projection method and device and electronic equipment

    CN115665468A

  • Screen projection method and electronic device

    WO2022166618A1