Search

EP-4742027-A1 - SCREEN MIRRORING METHOD AND APPARATUS, AND ELECTRONIC DEVICE

EP4742027A1EP 4742027 A1EP4742027 A1EP 4742027A1EP-4742027-A1

Abstract

This application relates to the field of electronic device technologies, and discloses a projection method and apparatus, and an electronic device, to implement simultaneous multi-screen viewing during different-source projection. The method is applied to a projection system, and includes: A first electronic device creates a first virtual display in response to a projection operation performed by a user on an application, and generates a user interface of the application on the first virtual display; and when projecting the user interface that is of the application and that is generated on the first virtual display onto a second electronic device, the first electronic device copies the user interface generated on the first virtual display to a display of the first electronic device for displaying, to implement simultaneous multi-screen viewing on the first electronic device and the second electronic device.

Inventors

  • HU, YU
  • XU, LIANG

Assignees

  • Huawei Technologies Co., Ltd.

Dates

Publication Date
20260513
Application Date
20240620

Claims (20)

  1. A projection method, applied to a projection system, wherein the projection system comprises the first electronic device and a second electronic device, and the method comprises: creating, by the first electronic device, a first virtual display in response to a projection operation performed by a user on an application, and generating a user interface of the application on the first virtual display; sending, by the first electronic device, projection data to the second electronic device, wherein the projection data is comprised on the user interface that is of the application and that is generated on the first virtual display; and copying, by the first electronic device, the user interface generated on the first virtual display to a display of the first electronic device for displaying.
  2. The method according to claim 1, wherein creating, by the first electronic device, the first virtual display in response to the projection operation performed by the user on the application comprises: in response to the projection operation, creating, by the first electronic device, the first virtual display based on a screen parameter of the display of the first electronic device.
  3. The method according to claim 1 or 2, wherein the method further comprises: generating, by the first electronic device, identification information of the first virtual display; and establishing, by the first electronic device, a mapping relationship between the identification information of the first virtual display and the application.
  4. The method according to any one of claims 1 to 3, wherein sending, by the first electronic device, the projection data to the second electronic device comprises: generating, by the first electronic device, the projection data based on the user interface generated on the first virtual display, wherein the projection data is used by the second electronic device to display the user interface of the application in a projection window; and sending, by the first electronic device, the projection data to the second electronic device.
  5. The method according to claim 4, wherein generating, by the first electronic device, the projection data based on the user interface generated on the first virtual display comprises: obtaining, by the first electronic device, layer data of the user interface generated on the first virtual display; performing, by the first electronic device, layer synthesis on the layer data to obtain image data; and encoding, by the first electronic device, the image data to obtain the projection data.
  6. The method according to any one of claims 1 to 5, wherein copying, by the first electronic device, the user interface generated on the first virtual display to the display of the first electronic device for displaying comprises: creating, by the first electronic device, a native window, wherein the native window is used to display the user interface of the application on the display of the first electronic device; and copying, by the first electronic device, the user interface generated on the first virtual display to the native window, and displaying the user interface in the native window.
  7. The method according to claim 6, wherein after creating, by the first electronic device, the native window, the method further comprises: determining, by the first electronic device based on the mapping relationship between the identification information of the first virtual display and the application, the first virtual display on which the user interface of the application is generated.
  8. The method according to claim 7, wherein copying, by the first electronic device, the user interface generated on the first virtual display to the native window, and displaying the user interface in the native window comprises: performing, by the first electronic device, layer copying on the user interface generated on the first virtual display, to obtain the layer data of the user interface; performing, by the first electronic device, layer synthesis on the layer data to obtain the image data; and displaying, by the first electronic device, the user interface in the native window based on the image data.
  9. The method according to any one of claims 1 to 8, wherein the method further comprises: after detecting the projection operation triggered by the user for the application, determining, by the first electronic device, that the first electronic device and the second electronic device display the user interface of the application.
  10. A projection apparatus, used in a first electronic device in a projection system, wherein the apparatus comprises: a display, configured to display a user interface; a communication unit, configured to: receive and send data; and a processing unit, configured to: create a first virtual display in response to a projection operation performed by a user on an application, and generate a user interface of the application on the first virtual display; send projection data to the second electronic device, wherein the projection data is comprised on the user interface that is of the application and that is generated on the first virtual display; and copy the user interface generated on the first virtual display to the display of the first electronic device for displaying.
  11. The apparatus according to claim 10, wherein the processing unit is specifically configured to: in response to the projection operation, create the first virtual display based on a screen parameter of the display of the first electronic device.
  12. The apparatus according to claim 10 or 11, wherein the processing unit is further configured to: generate identification information of the first virtual display; and establishing a mapping relationship between the identification information of the first virtual display and the application.
  13. The apparatus according to any one of claims 10 to 12, wherein the processing unit is specifically configured to: generate the projection data based on the user interface generated on the first virtual display, wherein the projection data is used by the second electronic device to display the user interface of the application in a projection window; and send the projection data to the second electronic device.
  14. The apparatus according to claim 13, wherein the processing unit is specifically configured to: obtain layer data of the user interface generated on the first virtual display; perform layer synthesis on the layer data to obtain image data; and encode the image data to obtain the projection data.
  15. The apparatus according to any one of claims 10 to 14, wherein the processing unit is specifically configured to: create a native window, wherein the native window is used to display the user interface of the application on the display of the first electronic device; and copy the user interface generated on the first virtual display to the native window, and display the user interface in the native window.
  16. The apparatus according to claim 15, wherein after creating the native window, the processing unit is further configured to: determine, based on the mapping relationship between the identification information of the first virtual display and the application, the first virtual display on which the user interface of the application is generated.
  17. The apparatus according to claim 16, wherein the processing unit is specifically configured to: perform layer copying on the user interface generated on the first virtual display, to obtain the layer data of the user interface; perform layer synthesis on the layer data to obtain the image data; and display the user interface in the native window based on the image data.
  18. The apparatus according to any one of claims 10 to 17, wherein the processing unit is further configured to: after detecting the projection operation triggered by the user for the application, determine that the first electronic device and the second electronic device display the user interface of the application.
  19. An electronic device, comprising a display, one or more processors, and one or more memories, wherein the display is configured to display a user interface; the one or more memories are configured to store one or more computer programs and data information, and the one or more computer programs comprise instructions; and when the instructions are executed by the one or more processors, the electronic device is caused to perform the method according to any one of claims 1 to 9.
  20. A chip, wherein the chip is coupled to a memory in an electronic device, so that when the chip runs, a computer program stored in the memory is invoked to implement the method according to any one of claims 1 to 9.

Description

CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to Chinese Patent Application No. 202311215613.2, filed with the China National Intellectual Property Administration on September 19, 2023 and entitled "PROJECTION METHOD AND APPARATUS, AND ELECTRONIC DEVICE", which is incorporated herein by reference in its entirety. TECHNICAL FIELD Embodiments of this application relate to the field of electronic device technologies, and in particular, to a projection method and apparatus, and an electronic device. BACKGROUND As life and technology evolve, application of projection technologies is becoming increasingly widespread. The projection technology means that an electronic device may project a display interface of a display of the electronic device onto another electronic device for displaying. For example, a movie on a mobile phone may be projected onto a computer for playing, and a video on a central display screen of a head unit may be projected onto a tablet computer for displaying. However, when a first electronic device performs different-source projection on a second electronic device, a projection interface is displayed on only the second electronic device, but is not displayed on the first electronic device, affecting user experience. SUMMARY Embodiments of this application provide a projection method and apparatus, and an electronic device, to implement simultaneous multi-screen viewing during different-source projection and reduce power consumption. According to a first aspect, an embodiment of this application provides a projection method, and the method is applied to a projection system. The projection system includes a first electronic device and a second electronic device. The method includes: The first electronic device may create a first virtual display in response to a projection operation performed by a user on an application. After generating a user interface of the application on the created first virtual display, the first electronic device sends projection data to the second electronic device, and copies the user interface generated on the first virtual display to a display of the first electronic device for displaying. The projection data includes the user interface that is of the application and that is generated on the first virtual display. In the method, the first electronic device creates the first virtual display in response to the projection operation performed by the user on the application, and generates the user interface of the projected application on the first virtual display. The first electronic device may send, to the second electronic device, the projection data that is included on the user interface displayed on the first virtual display, and may further copy the user interface generated on the first virtual display to the display of the first electronic device for displaying, to implement simultaneous multi-screen viewing on the first electronic device and the second electronic device. In addition, in an implementation process, the first electronic device creates only the first virtual display. Compared with a similar solution of creating a plurality of virtual displays, this reduces projection power consumption. In an optional design, in response to the projection operation, the first electronic device creates the first virtual display based on a screen parameter of the display of the first electronic device. In this design, the first virtual display created by the first electronic device has exactly the same screen parameter as the display of the first electronic device. In this way, the user interface generated on the first virtual display can be directly copied to the display of the first electronic device for displaying, thereby achieving an objective of reducing power consumption. In an optional design, the first electronic device generates identification information of the first virtual display, and establishes a mapping relationship between the identification information and the application. In this design, the first electronic device establishes the mapping relationship between the identification information of the first virtual display and the application, so that a data basis can be provided for the first electronic device to determine the first virtual display on which the user interface of the application is generated. In this way, the first electronic device can quickly determine, based on the mapping relationship, the first virtual display on which the user interface is generated for layer copying, and display the user interface on the display of the first electronic device, thereby improving interface display efficiency. In an optional design, the first electronic device may further generate the projection data based on the user interface generated on the first virtual display, and send the projection data to the second electronic device. The projection data is used by the second electronic device to display the user interface of the