Screen projection method, electronic device, storage medium and program product

By using low-power BLE Bluetooth broadcast search and multiple verification methods, the problem of screen projection devices needing to be connected to the same local area network is solved, enabling flexible screen projection across different local area networks and improving security.

CN119893200BActive Publication Date: 2026-02-03HUAWEI TECH CO LTD

Patent Information

Application Number
CN202311395705.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-25
Publication Date
2026-02-03
Estimated Expiration
2043-10-25

AI Technical Summary

Technical Problem

In existing technologies, screen mirroring devices need to be connected to the same local area network to achieve screen mirroring, which limits the usage scenarios, and the SSDP device discovery method is prone to inaccurate and confusing device search.

Method used

It adopts low-power BLE Bluetooth broadcast search, and obtains device information and wireless connection information through the verification information of two data packets and key decryption, so as to realize device discovery and screen projection. It supports screen projection under different local area networks, and improves security through multiple verifications.

Benefits of technology

It enables device discovery and screen mirroring on different local area networks, reduces the error rate of device search, and improves the security and flexibility of the screen mirroring process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119893200B_ABST
    Figure CN119893200B_ABST
Patent Text Reader

Abstract

The embodiment of the application provides a screen projection method, electronic equipment, a storage medium and a program product, relates to the video projection and whole-house intelligent technical field, and can not need to connect the double-end equipment for projection to the same local area network, thereby reducing the limitation of projection, making the use scene of projection more flexible. The screen projection method comprises the following steps: in response to an operation of initiating projection, initiating low-power BLE Bluetooth broadcast search; obtaining a first data packet and a second data packet from the data of the BLE Bluetooth broadcast, the first data packet comprising first check information and encrypted information, and the second data packet comprising second check information and a key; decrypting the encrypted information according to the key; determining that the first data packet and the second data packet are associated projection information; displaying a projection device selection interface; in response to a selection operation on a projection target device option, establishing a wireless connection between the projection target device; and initiating video projection to the projection target device based on the wireless connection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of screen mirroring technology, specifically to a screen mirroring method, electronic device, storage medium, and program product. Background Technology

[0002] With the increasing interactivity between electronic devices, more and more users are using screen mirroring. For example, when using a video playback app on a mobile phone, the screen mirroring function can be used to play the video on a TV. Screen mirroring between the mobile phone and the TV can be achieved through the Digital Living Network Alliance (DLNA) protocol. During the mirroring process, the Simple Server Discovery Protocol (SSDP) is first used to discover the device. This process requires both the mobile phone and the TV to be connected to the same local area network (LAN). This limits the screen mirroring function, preventing mirroring between devices not connected to the same Wireless Fidelity (Wi-Fi) LAN. Summary of the Invention

[0003] In view of this, this application provides a screen mirroring method, electronic device, storage medium, and program product that allows two-end devices that do not require screen mirroring to connect to the same local area network, thereby reducing the limitations of screen mirroring and making screen mirroring more flexible in application scenarios.

[0004] In a first aspect, embodiments of this application provide a screen casting method applied to a screen casting source device. The method includes: in response to an operation to initiate screen casting, initiating a low-power Bluetooth broadcast search; receiving data from the searched Bluetooth broadcast, and obtaining a first data packet and a second data packet from the Bluetooth broadcast data, wherein the first data packet includes first verification information and encryption information, and the second data packet includes second verification information and a key; decrypting the encryption information according to the key, and obtaining device information and wireless connection information from the decrypted encryption information; determining that the first data packet and the second data packet are associated screen casting information according to the first verification information and the second verification information; displaying a screen casting device selection interface, wherein the screen casting device selection interface displays alternative device options corresponding to one or more screen casting information determined in the Bluetooth broadcast data, wherein the alternative device options include device information from the corresponding one or more screen casting information; in response to a selection operation of a target device option among at least one alternative device option, sending a wireless connection request to the target device based on the wireless connection information in the screen casting information corresponding to the target device option, and establishing a wireless connection with the target device; and initiating video screen casting to the target device based on the wireless connection.

[0005] By adding two associated data packets to the BLE Bluetooth broadcast data of the target device, the two associated data packets are identified during the screen mirroring process at the source device via BLE Bluetooth search and verification information. The encrypted information in the other packet is decrypted using the key of one packet to obtain device information and wireless connection information, thus discovering the target device. A wireless connection is then established based on the wireless connection information to achieve screen mirroring. Since BLE Bluetooth search is used to discover devices, both ends do not need to be connected to the same local area network, thus reducing limitations on screen mirroring and making the application scenarios more flexible. Furthermore, compared to SSDP, BLE Bluetooth search has a lower probability of failing to find a device. Additionally, because the BLE Bluetooth search range is relatively small, it is less likely to find irrelevant devices, making it easier to identify the target device and reducing the risk of screen mirroring confusion due to numerous detected devices. Moreover, by using the plaintext information of one data packet to decrypt the encrypted information in the other, rather than simply using plaintext for verification, security during screen mirroring is improved, preventing data packets from being misinterpreted by other devices.

[0006] In one possible implementation, obtaining device information and wireless connection information from the decrypted encrypted information includes: obtaining device information, wireless connection information, and third verification information from the decrypted encrypted information; the process of determining that the first data packet and the second data packet are associated screen projection information based on the first verification information and the second verification information includes: determining that the first data packet and the second data packet are associated screen projection information based on the first verification information, the second verification information, and the third verification information. In the process of determining screen projection information from BLE Bluetooth broadcast data, in addition to verification based on the plaintext first and second verification information, verification can also be performed based on the third verification information in the encrypted information. For the third verification information in the first data packet, verification can only be performed after decryption using the key in the second data packet, thereby further improving security.

[0007] In one possible implementation, the first verification information includes a Universally Unique Identifier (UUID), the second verification information includes the UUID, a Service Identifier (serviceID), and the action information for starting screen mirroring, and the third verification information includes the serviceID, which represents the screen mirroring service. Verification using UUID and serviceID improves the overall process scalability; based on different serviceID verification results, data packets can be extended for use in other scenarios.

[0008] In one possible implementation, the method further includes: in response to initiating a screen mirroring operation, sending a BLE Bluetooth broadcast including a third data packet, the third data packet including third verification information; obtaining a fourth data packet from the BLE Bluetooth broadcast data, the fourth data packet including fourth verification information, device information, and wireless connection information; and determining the fourth data packet as screen mirroring information based on the fourth verification information. The process of determining screen mirroring information based on the first and second data packets is a passive device discovery process, while the process of determining screen mirroring information based on the fourth data packet is an active device discovery process. The active and passive device discovery processes are performed simultaneously, thus improving the probability and speed of device discovery.

[0009] In one possible implementation, after determining that the first data packet and the second data packet are associated projection information based on the first verification information and the second verification information, the transmission of the third data packet is stopped. That is, if the passive device discovery process has already discovered the device, the third data packet used for active device discovery will no longer be sent, thereby achieving a logical closed loop in the overall process and improving security.

[0010] In one possible implementation, the projection source device is a file-sharing source device, the projection initiation operation is a file-sharing initiation operation, the serviceID is used to represent the file-sharing service, the projection information is file-sharing information, the projection device selection interface is a file-sharing device selection interface, the projection target device option is a file-sharing target device option, the projection target device is a file-sharing target device, initiating video projection is initiating file-sharing, and the start projection action information is the start file-sharing action information. In the file-sharing scenario, both devices can achieve device discovery based on BLE Bluetooth broadcast, that is, determine the file-sharing information based on BLE Bluetooth broadcast, then establish a wireless connection based on the device information and wireless connection information in the file-sharing information, and realize file sharing based on the wireless connection, thus expanding the application scenarios of the interaction process.

[0011] In one possible implementation, either the first data packet or the second data packet is the same broadcast structure of the protocol data unit in the Bluetooth broadcast data. In this way, no major changes to the existing Bluetooth protocol are required; simply adding screen mirroring capability information to the reserved fields in the protocol is sufficient to discover devices with screen mirroring capabilities.

[0012] In one possible implementation, the wireless connection is either a Bluetooth Low Energy (BLE) connection or a Wi-Fi peer-to-peer (P2P) connection. Device discovery can be achieved through Bluetooth searching, and wireless screen mirroring can be implemented using multiple connection methods. A BLE Bluetooth connection can be established directly based on the discovered device, and video mirroring can be initiated based on this BLE connection; alternatively, a Wi-Fi P2P connection can be established based on the discovered device, and video mirroring can be initiated based on this Wi-Fi P2P connection.

[0013] In one possible implementation, the wireless connection is a Bluetooth BLE connection; initiating video casting to the target device based on the wireless connection includes sending an online video address to the target device via the Bluetooth BLE connection, thereby enabling online video casting. That is, both device discovery and the established wireless connection are based on Bluetooth, which reduces restrictions on the devices at both ends of the casting process, and the Bluetooth BLE implementation has low power consumption.

[0014] In one possible implementation, the wireless connection is a Wi-Fi P2P connection; initiating video casting to the target device based on the wireless connection includes: sending an online video address or local video to the target device based on the Wi-Fi P2P connection. Since the bandwidth of the Wi-Fi P2P connection is large, it can realize the casting of local videos. Therefore, the Wi-Fi P2P connection can be realized based on the device discovered via Bluetooth, and the casting of local videos can be realized based on the Wi-Fi P2P connection.

[0015] Secondly, embodiments of this application provide a screen mirroring method applied to a target device. The method includes: in response to an operation to initiate Bluetooth broadcasting, initiating a low-power Bluetooth (BLE) broadcast, wherein the BLE broadcast data includes a first data packet and a second data packet, the first data packet including first verification information and encryption information, the second data packet including second verification information and a key, the key being used to decrypt the encryption information, the encryption information including device information and wireless connection information; receiving a wireless connection request sent by a source device, establishing a wireless connection with the source device based on the wireless connection request; and performing video mirroring based on the wireless connection.

[0016] In one possible implementation, the encrypted information also includes third verification information. During the process of determining the projection information from the BLE Bluetooth broadcast data, in addition to verification based on the first and second verification information in plaintext, verification can also be performed based on the third verification information in the encrypted information. For the third verification information in the first data packet, verification can only be performed after decryption using the key in the second data packet, thereby further improving security.

[0017] In one possible implementation, the first verification information includes a Universally Unique Identifier (UUID), the second verification information includes the UUID, a Service Identifier (serviceID), and the action information for starting screen mirroring, and the third verification information includes the serviceID. Verification using the UUID and serviceID improves the overall process scalability; based on different serviceID verification results, the data packet can be extended for use in other scenarios.

[0018] In one possible implementation, the method further includes: receiving a third data packet sent by the projection source device via BLE Bluetooth broadcast; obtaining third verification information from the third data packet; and, in response to obtaining the third verification information, sending a fourth data packet via BLE Bluetooth broadcast, the fourth data packet including the fourth verification information, device information, and wireless connection information. The process of determining projection information based on the first and second data packets is a passive device discovery process, while the process of determining projection information based on the fourth data packet is an active device discovery process. The active and passive device discovery processes are performed simultaneously, thus improving the probability and speed of device discovery.

[0019] In one possible implementation, in response to obtaining the third verification information, the transmission of the first and second data packets is stopped. That is, if the active device discovery process has already discovered the device, the first and second data packets used for passive device discovery will no longer be sent, thereby achieving a logical closed loop in the overall process and improving security.

[0020] In one possible implementation, the target device for screen mirroring is the file sharing target device, the serviceID is used to represent the file sharing service, the source device for screen mirroring is the file sharing source device, performing video screen mirroring is performing file sharing, and the action information for starting screen mirroring is the action information for starting file sharing, thus expanding the application scenarios of the interactive process.

[0021] In one possible implementation, either the first data packet or the second data packet is the same broadcast structure of the protocol data unit in the Bluetooth broadcast data. In this way, no major changes to the existing Bluetooth protocol are required; simply adding screen mirroring capability information to the reserved fields in the protocol is sufficient to discover devices with screen mirroring capabilities.

[0022] In one possible implementation, the wireless connection is either a low-power Bluetooth (BLE) connection or a Wi-Fi peer-to-peer (P2P) connection.

[0023] In one possible implementation, the wireless connection is a Bluetooth BLE connection; initiating video casting to the target device based on the wireless connection includes sending an online video address to the target device based on the Bluetooth BLE connection. That is, both device discovery and the established wireless connection are implemented using Bluetooth, which has fewer limitations on the devices at both ends of the casting process, and the Bluetooth BLE implementation has low power consumption.

[0024] In one possible implementation, the wireless connection is a Wi-Fi P2P connection; initiating video casting to the target device based on the wireless connection includes sending an online video address or local video to the target device based on the Wi-Fi P2P connection. Since the Wi-Fi P2P connection has a large bandwidth, it can achieve casting including local videos. Therefore, a Wi-Fi P2P connection can be established based on a device discovered via Bluetooth, and local video casting can be achieved based on the Wi-Fi P2P connection.

[0025] Thirdly, a screen mirroring method is provided, applied to a screen mirroring source device. The method includes: in response to the screen mirroring initiation operation, initiating a low-power BLE Bluetooth broadcast, wherein the data broadcast by the low-power BLE Bluetooth includes a first data packet and a second data packet, the first data packet including first verification information and encryption information, the second data packet including second verification information and a key, the key being used to decrypt the encryption information, the encryption information including device information and wireless connection information; receiving a wireless connection request sent by the target device, establishing a wireless connection with the screen mirroring source device based on the wireless connection request; and initiating video screen mirroring to the target device based on the wireless connection.

[0026] In one possible implementation, the encrypted information also includes third verification information.

[0027] In one possible implementation, the first verification information includes a universally unique identifier (UUID), the second verification information includes the UUID, the service identifier (serviceID), and the action information for starting screen mirroring, and the third verification information includes the serviceID.

[0028] In one possible implementation, the method further includes: receiving a third data packet sent by the target device for screen projection via BLE Bluetooth broadcast; obtaining third verification information from the third data packet; and, in response to obtaining the third verification information, sending a fourth data packet via BLE Bluetooth broadcast, the fourth data packet including the fourth verification information, device information, and wireless connection information.

[0029] In one possible implementation, in response to obtaining third verification information, the transmission of the first data packet and the second data packet is stopped.

[0030] In one possible implementation, the target device for screen mirroring is the file sharing target device, the serviceID is used to represent the file sharing service, the source device for screen mirroring is the file sharing source device, initiating video screen mirroring is initiating file sharing, and the action information for starting screen mirroring is the action information for starting file sharing.

[0031] In one possible implementation, either the first data packet or the second data packet is the same broadcast structure of the protocol data unit in the Bluetooth broadcast data. In this way, no major changes to the existing Bluetooth protocol are required; simply adding screen mirroring capability information to the reserved fields in the protocol is sufficient to discover devices with screen mirroring capabilities.

[0032] In one possible implementation, the wireless connection is either a Bluetooth Low Energy (BLE) connection or a Wi-Fi peer-to-peer (P2P) connection. Device discovery can be achieved through Bluetooth searching, and wireless screen mirroring can be implemented using multiple connection methods. A BLE Bluetooth connection can be established directly based on the discovered device, and video mirroring can be initiated based on this BLE connection; alternatively, a Wi-Fi P2P connection can be established based on the discovered device, and video mirroring can be initiated based on this Wi-Fi P2P connection.

[0033] In one possible implementation, the wireless connection is a Bluetooth BLE connection; initiating video casting to the target device based on the wireless connection includes sending an online video address to the target device via the Bluetooth BLE connection, thereby enabling online video casting. That is, both device discovery and the established wireless connection are based on Bluetooth, which reduces restrictions on the devices at both ends of the casting process, and the Bluetooth BLE implementation has low power consumption.

[0034] In one possible implementation, the wireless connection is a Wi-Fi P2P connection; initiating video casting to the target device based on the wireless connection includes: sending an online video address or local video to the target device based on the Wi-Fi P2P connection. Since the bandwidth of the Wi-Fi P2P connection is large, it can realize the casting of local videos. Therefore, the Wi-Fi P2P connection can be realized based on the device discovered via Bluetooth, and the casting of local videos can be realized based on the Wi-Fi P2P connection.

[0035] Fourthly, a screen casting method is provided, applied to a target device. The method includes: in response to an operation to initiate a Bluetooth search, initiating a low-power Bluetooth broadcast search; receiving data from the searched Bluetooth broadcast, obtaining a first data packet and a second data packet from the Bluetooth broadcast data, wherein the first data packet includes first verification information and encryption information, and the second data packet includes second verification information and a key; decrypting the encryption information according to the key, and obtaining device information and wireless connection information from the decrypted encryption information; determining that the first data packet and the second data packet are associated screen casting information according to the first verification information and the second verification information; displaying a screen casting device selection interface, wherein the screen casting device selection interface displays alternative device options corresponding to one or more screen casting information determined in the Bluetooth broadcast data, wherein the alternative device options include device information from the corresponding one or more screen casting information; in response to an operation to select a screen casting source device option from at least one alternative device option, sending a wireless connection request to the screen casting source device based on the wireless connection information in the screen casting information corresponding to the screen casting source device option, and establishing a wireless connection with the screen casting source device; and performing video casting based on the wireless connection.

[0036] In one possible implementation, obtaining device information and wireless connection information from the decrypted encrypted information includes: obtaining device information, wireless connection information, and third verification information from the decrypted encrypted information; the process of determining that the first data packet and the second data packet are associated projection information based on the first verification information and the second verification information includes: determining that the first data packet and the second data packet are associated projection information based on the first verification information, the second verification information, and the third verification information.

[0037] In one possible implementation, the first verification information includes a universally unique identifier (UUID), the second verification information includes the UUID, the service identifier (serviceID), and the action information for starting screen mirroring, and the third verification information includes the serviceID, which is used to represent the screen mirroring service.

[0038] In one possible implementation, the method further includes: in response to initiating a Bluetooth search operation, sending a BLE Bluetooth broadcast including a third data packet, the third data packet including third verification information; obtaining a fourth data packet from the data of the BLE Bluetooth broadcast, the fourth data packet including fourth verification information, device information and wireless connection information; and determining the fourth data packet as screen projection information based on the fourth verification information.

[0039] In one possible implementation, after determining that the first data packet and the second data packet are associated projection information based on the first verification information and the second verification information, the transmission of the third data packet is stopped.

[0040] In one possible implementation, the projection source device is a file sharing source device, the serviceID is used to represent the file sharing service, the projection information is file sharing information, the projection device selection interface is a sharing device selection interface, the projection target device option is a file sharing target device option, the projection target device is a file sharing target device, executing video projection is executing file sharing, and the start projection action information is the start file sharing action information.

[0041] In one possible implementation, either the first data packet or the second data packet is the same broadcast structure of the protocol data unit in the Bluetooth broadcast data. In this way, no major changes to the existing Bluetooth protocol are required; simply adding screen mirroring capability information to the reserved fields in the protocol is sufficient to discover devices with screen mirroring capabilities.

[0042] In one possible implementation, the wireless connection is either a low-power Bluetooth (BLE) connection or a Wi-Fi peer-to-peer (P2P) connection.

[0043] In one possible implementation, the wireless connection is a Bluetooth BLE connection; initiating video casting to the target device based on the wireless connection includes sending an online video address to the target device based on the Bluetooth BLE connection. That is, both device discovery and the established wireless connection are implemented using Bluetooth, which has fewer limitations on the devices at both ends of the casting process, and the Bluetooth BLE implementation has low power consumption.

[0044] In one possible implementation, the wireless connection is a Wi-Fi P2P connection; initiating video casting to the target device based on the wireless connection includes sending an online video address or local video to the target device based on the Wi-Fi P2P connection. Since the Wi-Fi P2P connection has a large bandwidth, it can achieve casting including local videos. Therefore, a Wi-Fi P2P connection can be established based on a device discovered via Bluetooth, and local video casting can be achieved based on the Wi-Fi P2P connection.

[0045] Fifthly, an electronic device is provided, including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device performs the screen projection method described above.

[0046] Sixthly, a computer-readable storage medium is provided, the computer-readable storage medium including a stored program, wherein, when the program is running, it controls the device where the computer-readable storage medium is located to execute the above-described screen projection method.

[0047] In a seventh aspect, a computer program product is provided, the computer program product containing executable instructions, which, when executed on a computer, cause the computer to perform the aforementioned screen projection method. Attached Figure Description

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

[0049] Figure 1 This is a schematic diagram of an architecture involving multicast in related technologies;

[0050] Figure 2 This is a schematic diagram of a device discovery process in related technologies;

[0051] Figure 3 This is a structural block diagram of an electronic device according to an embodiment of this application;

[0052] Figure 4 This is a software architecture diagram of an electronic device according to an embodiment of this application;

[0053] Figure 5 This is a schematic diagram of screen projection between a source device and a target device in an embodiment of this application.

[0054] Figure 6 This is a schematic diagram illustrating an interaction process between the projection source device and the projection target device in an embodiment of this application;

[0055] Figure 7 This is a schematic diagram illustrating a device discovery process between the projection source device and the projection target device in an embodiment of this application.

[0056] Figure 8 This is a schematic diagram of the structure of Bluetooth broadcast data in an embodiment of this application;

[0057] Figure 9 This is a schematic diagram illustrating another interaction process between the projection source device and the projection target device in the embodiments of this application;

[0058] Figure 10 This is a schematic diagram of a system involved in online video projection as described in an embodiment of this application;

[0059] Figure 11 This is a schematic diagram illustrating another interaction process between the projection source device and the projection target device in an embodiment of this application;

[0060] Figure 12This is a schematic diagram illustrating another interaction process between the projection source device and the projection target device in the embodiments of this application. Detailed Implementation

[0061] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0062] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.

[0063] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0064] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0065] Before describing the technical solutions of the embodiments of this application, the relevant technologies and their technical problems are first introduced. In the relevant technologies, the Digital Living Network Alliance (DLNA) protocol is used for screen casting. Screen casting requires the use of SSDP to discover devices, and then the video playback link, i.e., the Uniform Resource Locator (URL), is transmitted to the large screen through a Simple Object Access Protocol (SOAP) remote call. After receiving the URL, the large screen starts a local player to play the video based on the URL. SSDP provides a mechanism for discovering devices within a local area network. Control points can use SSDP to query devices providing specific services within their local area network as needed, and devices can also use SSDP to announce their existence to control points within their local area network. Taking the discovery between a mobile phone and a TV as an example, such as... Figure 1 As shown, mobile phones can use multicast address 239.255.255.250, port 1900, to discover devices. There are two methods for device discovery: active discovery and passive discovery. For example... Figure 2As shown, in the active discovery process, the mobile phone initiates a multicast search (M-Search) message. The TV listens for the M-Search message on the multicast address and port, then replies. The mobile phone reads the TV's device information through the reply, thus discovering the device. In the passive discovery process, the TV sends an online notification message to the multicast address and port, notifying mobile phones on the network that the TV is online. The mobile phone listens for messages on the multicast address and port, and upon receiving the online notification, requests a device description from the TV, thus discovering the device. However, this device discovery method requires devices to be connected to the same local area network (LAN). If devices are not connected to the same LAN, screen mirroring cannot be performed in this way, limiting the screen mirroring scenarios. Furthermore, this method is prone to failure to find devices due to router issues, network packet loss, Virtual Private Networks (VPNs), and port congestion. In scenarios such as hotels, where many users are connected to the same LAN, when a user tries to mirror to their room's TV, multiple devices are found, making it difficult for the user to distinguish between the room and the corresponding device name, leading to screen mirroring confusion.

[0066] To address the aforementioned problems, this application provides technical solutions based on its embodiments. The technical solutions of this application embodiments are described below.

[0067] First, the electronic devices involved in the embodiments of this application will be described. Figure 3 A schematic diagram of the structure of the electronic device 100 is shown.

[0068] Electronic device 100 may include processor 110, external memory interface 120, internal memory 121, wireless communication module 160, display screen 194, antenna 1, etc.

[0069] It is understood that the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100. In other embodiments of this application, the electronic device 100 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0070] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors. Processor 110 can be used for functions such as audio and video stream encoding and decoding.

[0071] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0072] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0073] The wireless communication function of electronic device 100 can be implemented through antenna 1, wireless communication module 160, modem processor and baseband processor, etc.

[0074] The wireless communication module 160 can provide solutions for wireless communication applications on the electronic device 100, including wireless local area networks (WLANs) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), and other wireless communication technologies. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 1, frequency-modulates and filters the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, frequency-modulate and amplify them, and then convert them into electromagnetic waves for radiation via antenna 1. The wireless communication module 160 may include, for example, a Bluetooth chip.

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

[0076] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel may 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 miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, electronic device 100 may include one or N displays 194, where N is a positive integer greater than 1.

[0077] In some embodiments, the electronic device 100 may have a touch sensor disposed on the display screen 194, forming a touchscreen, also known as a "touchscreen," composed of the touch sensor and the display screen 194. The touch sensor is used to detect touch operations performed on or near it. The touch sensor can transmit the detected touch operation to an application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor may also be disposed on the surface of the electronic device 100, in a different location than the display screen 194.

[0078] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of electronic device 100 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of electronic device 100 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.

[0079] The software system of electronic device 100 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to exemplify the software structure of electronic device 100.

[0080] Figure 4 This is a software structure block diagram of the electronic device 100 according to an embodiment of the present invention.

[0081] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0082] The application layer can include a series of application packages.

[0083] like Figure 4 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and SMS.

[0084] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0085] like Figure 4 As shown, the application framework layer may include a window manager, content provider, view system, resource manager, etc.

[0086] The window manager is used to manage window programs. The content provider is used to store and retrieve data, making that data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.

[0087] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views.

[0088] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

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

[0090] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0091] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0092] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0093] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0094] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0095] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0096] A 2D graphics engine is a graphics engine for 2D drawing.

[0097] The kernel layer is the layer between hardware and software. The kernel layer includes at least the display driver, Bluetooth driver, audio driver, and sensor driver.

[0098] The electronic devices involved in the embodiments of this application may be any product such as smart TVs, mobile phones, tablets, personal computers (PCs), personal digital assistants (PDAs), smartwatches, wearable electronic devices, augmented reality (AR) devices, virtual reality (VR) devices, in-vehicle devices, drone devices, smart cars, smart speakers, robots, smart glasses, etc.

[0099] like Figure 5 As shown, the system involved in this application embodiment includes two electronic devices: a projection source device 101 and a projection target device 102. Both of these electronic devices can be... Figure 3 The electronic device 100 shown is used for... Figure 4 The software architecture shown differs in that the target device 102 is typically a device with a larger screen than the source device 101. This allows users to project videos from smaller-screen electronic devices onto larger-screen devices, such as a mobile phone as the source device 101 and a television as the target device 102. The source device 101 refers to the electronic device initiating the projection, and the target device 102 refers to the electronic device receiving the projection. For example, a user watching a video on the source device 101 wants to project the video onto the television, i.e., the target device 102. Clicking the TV button 1011 within the video application will initiate a Bluetooth broadcast search for casting source device 101, i.e., scanning for Bluetooth devices. Once a target device is found, the casting source device 101 will display a casting device selection interface 201. The casting device selection interface displays alternative device options 202 corresponding to the target device 102. These alternative device options 202 include the name of the target device 102, such as "xx TV xx". After the user clicks on the alternative device option 202, video casting will begin between the casting source device 101 and the target device 102, meaning the video currently playing on the casting source device 101 can be cast to the target device 102 for playback.

[0100] The following describes the embodiments of this application based on the interaction flow between the projection source device 101 and the projection target device 102. Figure 6 and Figure 7As shown, this application embodiment provides a screen casting interaction method, including a screen casting method applied to a source device 101 and a screen casting method applied to a target device 102. The screen casting method applied to the source device 101 includes steps 301 to 308, and the screen casting method applied to the target device 102 includes steps 401 to 403. The following description uses a mobile phone as the source device 101 and a television as the target device 102 as an example.

[0101] The interaction process includes:

[0102] The user initiates a low-power Bluetooth broadcast on the target device 102, for example, by enabling Bluetooth in the settings interface of the target device 102, making the target device 102 discoverable via Bluetooth. It should be noted that initiating a BLE Bluetooth broadcast can be achieved in different ways, such as via buttons on a remote control. This embodiment does not limit this method; it is merely an example.

[0103] Upon detecting that the user initiated a BLE Bluetooth broadcast operation on the target device 102, the target device 102 executes step 401, initiating a BLE Bluetooth broadcast, in response to the BLE Bluetooth broadcast operation.

[0104] Step 401 specifically includes:

[0105] The upper-layer software of the target device 102 executes step 4011, registering a broadcast. The registered broadcast content includes a first data packet and a second data packet. The first data packet includes first verification information and encryption information, and the second data packet includes second verification information and a key. The key is used to decrypt the encryption information, which includes device information and wireless connection information. In this embodiment, the first and second data packets are added to the reserved fields of the Bluetooth general protocol of the target device 102 for identifying the corresponding device and establishing a connection during the interaction process. The first and second data packets can be two data packets in the message structure. For example, the Bluetooth broadcast data is a BLE broadcast message, and the structure of the BLE broadcast message is as follows: Figure 8As shown, octet represents an eight-bit byte, and the PDU of the BLE broadcast message includes multiple ADStructure structures. In this embodiment, one structure in the PDU can be used as a data packet. The first and second verification information may include a Universally Unique Identifier (UUID), such as "BLECast"; device information such as the device name "xxTVxx", so that the user can select the target device for screen casting based on the device name; wireless connection information such as the Media Access Control Address (MAC) "86:xx:xx:xx:17:DB" and Bluetooth BrMAC "74:xx:xx:xx:32:40". In addition, the encryption information may also include a service name and a callback function, which can facilitate the screen casting source device to call the callback function to execute some steps in the interaction process. The second verification information may also include screen casting start action information, such as "startCast", to indicate the start of screen casting. The key is, for example, "2", indicating that the encryption type solveType is 2, and the above encryption information can be decrypted using this key. Figure 8 The broadcast message structure described is merely an example, and the embodiments in this application are not limited thereto.

[0106] The Bluetooth driver of the target device 102 executes step 4012, initiating BLE Bluetooth broadcast. The data of the BLE Bluetooth broadcast includes the first data packet and the second data packet mentioned above. The first data packet and the second data packet can be adjacent data packets in the broadcast message, and they can be sent alternately.

[0107] The user initiates a screen mirroring operation on the source device 101, for example... Figure 5 As shown, the projection source device 101 is running a video application. The user clicks the "TV" button 1011 in the upper right corner of the video playback interface of the projection source device 101. Clicking this button 1011 initiates the projection operation. It should be noted that the projection operation can be initiated in different ways, such as by triggering gestures. This application embodiment does not limit this, and is only an example for illustration.

[0108] Upon detecting a user's screen mirroring operation initiated on the screen mirroring source device 101, the upper-layer software of the screen mirroring source device 101 calls the Bluetooth driver, causing the Bluetooth driver of the screen mirroring source device 101 to respond to the screen mirroring operation and execute step 301: initiating a BLE Bluetooth broadcast search. A BLE Bluetooth broadcast search can also be called a Bluetooth scan. For example, after the user clicks the "TV" button 1011, the video application of the screen mirroring source device 101 calls the Bluetooth driver to initiate a BLE Bluetooth broadcast search through the Bluetooth chip.

[0109] The Bluetooth driver of the projection source device 101 executes step 302: receiving the data from the searched BLE Bluetooth broadcast, which includes multiple data packets.

[0110] The Bluetooth driver of the projection source device 101 can execute step 303 through a callback function to send the searched full amount of BLE Bluetooth broadcast data, that is, to the upper layer software, i.e., the video application, at least one of the searched data packets.

[0111] The upper-layer software of the projection source device 101 executes step 304: traversing all the searched BLE Bluetooth broadcast data, obtaining the first data packet and the second data packet from the searched BLE Bluetooth broadcast data. The first and second verification information are in plaintext. Verification is performed based on these two verification information to determine that the two data packets are related information. The encrypted information in the first data packet can be decrypted using the key in the second data packet, and device information and wireless connection information can be obtained from the decrypted encrypted information. The encrypted information may also contain a callback function. Based on the first and second verification information, it is determined that the first data packet and the second data packet are related projection information. After determining the projection information, the subsequent projection process proceeds. That is, if the device information and wireless connection information are obtained by decrypting the first data packet using the key in the second data packet, and the verification based on the first and second verification information is successful, then the subsequent step 305 is executed.

[0112] The upper-layer software of the projection source device 101 executes step 305, which transmits the device information and wireless connection information in the projection information to the user interface (UI) thread.

[0113] The UI thread of the projection source device 101 executes step 306, displaying the projection device selection interface 201. The projection device selection interface 201 displays alternative device options 202 corresponding to one or more projection information identified in the BLE Bluetooth broadcast data. The alternative device options 202 include device information from the corresponding one or more projection information. For example, in this embodiment, only the projection information corresponding to the above-mentioned projection target device 102 was found, so only the alternative device option 202 including the device name "xx TV xx" is displayed.

[0114] When a user clicks on a candidate device option 202 on the projection source device 101, the user selects a projection target device option from at least one candidate device option 202. The candidate device option 202 clicked by the user is the projection target device option selected by the user. Upon detecting the user's selection of a projection target device option from at least one candidate device option 202 on the projection source device 101, the projection source device 101, based on the wireless connection information in the projection information corresponding to the projection target device option, executes step 307: sending a wireless connection request to the projection target device 102 and establishing a wireless connection with the projection target device.

[0115] The target device 102 executes step 402: receiving a wireless connection request sent by the source device 101, and establishing a wireless connection with the source device based on the wireless connection request.

[0116] The projection source device 101 executes step 308: Initiating video projection to the projection target device 102 based on the wireless connection.

[0117] The target device 102 executes step 403: Perform video casting based on wireless connection.

[0118] The screen mirroring method in this embodiment adds two associated data packets to the BLE Bluetooth broadcast data of the target device. During the screen mirroring process of the source device, the two associated data packets are identified through BLE Bluetooth search and verification information. The encrypted information in the other data packet is decrypted based on the key of one of the packets to obtain device information and wireless connection information, thereby discovering the target device. Then, a wireless connection is established based on the wireless connection information to achieve screen mirroring. Since the device is discovered by searching for devices using BLE Bluetooth, it is not necessary for both ends to be connected to the same local area network, thus reducing the limitations on screen mirroring and making the application scenarios more flexible. In addition, the probability of not finding a device is lower when discovering devices using BLE Bluetooth search compared to using SSDP. Furthermore, since the distance range of BLE Bluetooth search is relatively small, it is less likely to find irrelevant devices, making it easier to identify the target device and reducing the likelihood of screen mirroring confusion due to a large number of devices being searched. Moreover, by decrypting the encrypted information in the other data packet using the plaintext information of one of the two data packets, rather than just verifying it using the plaintext information, the security of the screen mirroring process can be improved, avoiding misidentification of data packets by other devices.

[0119] In some embodiments, the encrypted information further includes third verification information. The process of obtaining device information and wireless connection information from the decrypted encrypted information includes: obtaining device information, wireless connection information, and third verification information from the decrypted encrypted information; the process of determining that the first data packet and the second data packet are associated projection information based on the first verification information and the second verification information includes: determining that the first data packet and the second data packet are associated projection information based on the first verification information, the second verification information, and the third verification information. That is, in the process of determining projection information from BLE Bluetooth broadcast data, in addition to verification based on the first and second verification information in plaintext, verification can also be performed based on the third verification information in the encrypted information. For the third verification information in the first data packet, verification can only be performed after decryption using the key in the second data packet, thereby further improving security.

[0120] In some embodiments, the first verification information includes a Universally Unique Identifier (UUID), the second verification information includes a UUID and a Service Identifier (serviceID) and start casting information, and the third verification information includes a serviceID. The UUID can represent the BLE Bluetooth discovery device service, and the serviceID can represent the casting service. For example, the first verification information includes the UUID "BLECAST", the second verification information includes the UUID "BLECAST", the serviceID "HwBLeCast", and the start casting action information "startCast", and the third verification information includes the serviceID "HwBLeCast". If the casting source device determines that the UUID in the first and second verification information is the same (both are "BLECAST"), then the service corresponding to these two data packets is determined to be the BLE Bluetooth discovery device service. If the serviceID in the second and third verification information is the same (both are "HwBLeCast"), then the service corresponding to these two data packets is determined to be the casting service. Furthermore, based on the start casting action information "startCast" in the second data packet, the start casting process is determined, and the first and second data packets are determined to be associated casting information. Verification using UUID and serviceID improves the overall process scalability. Based on different serviceID verification results, data packets can be extended for other scenarios. For example, in other possible implementations, if the UUID in two data packets is determined to be the field corresponding to the BLE Bluetooth discovery service, and the serviceID is determined to be the field corresponding to the file sharing service, then these two data packets are determined not to be screen mirroring information, but rather to be file sharing information, used to implement the file sharing service.

[0121] In some embodiments, such as Figure 9 As shown, the projection method applied to the projection source device 101 further includes steps 701 to 703, and the projection method applied to the projection target device 102 further includes steps 801 to 802.

[0122] The interaction process also includes:

[0123] In response to the screen casting operation, the screen casting source device 101 performs step 701, sending a BLE Bluetooth broadcast including a third data packet. The third data packet includes third verification information, such as the UUID "BLECAST" and the search device action information, such as "searchDevice".

[0124] The target device 102 executes step 801: receiving the third data packet sent by the source device 101 via BLE Bluetooth broadcast, and obtaining the third verification information from the third data packet.

[0125] Upon receiving the third verification information, the target device 102 executes step 802, which involves broadcasting a fourth data packet via BLE Bluetooth. The fourth data packet includes the fourth verification information, device information, and wireless connection information. For example, the fourth verification information includes the UUID "BLECAST" and the serviceID "HwBLeCast". The device information is, for example, the device name "xxTVxx". The wireless connection information includes, for example, the MAC address "86:xx:xx:xx:17:DB" and the Bluetooth Br MAC address "74:xx:xx:xx:32:40".

[0126] The projection source device 101 executes step 702: Obtain the fourth data packet from the data broadcast by BLE Bluetooth.

[0127] The projection source device 101 executes step 703: Determine the fourth data packet as projection information based on the fourth verification information.

[0128] exist Figure 6 and Figure 7 In the interactive process shown, before the device is discovered, i.e., before the projection information is determined, the projection source device 101 does not need to actively send data packets. The projection target device 102 can periodically initiate BLE Bluetooth broadcasts. The projection source device 101 simply searches for projection information from the data found in the BLE Bluetooth broadcasts. After determining the projection information, it can then perform wireless connection and video projection based on the projection information. In other words, Figure 6 and Figure 7 The document describes the process of passively discovering devices and then projecting the screen based on those devices. And... Figure 9 In the interactive process shown, the projection source device 101 actively sends a third data packet via BLE Bluetooth broadcast. When the projection target device 101 receives the third data packet, it replies with a fourth data packet to the projection source device 101. The projection source device 101 determines the projection information based on the fourth data packet. Both the projection information determined by the fourth data packet and the projection information determined by the first and second data packets contain the device information and wireless connection information required for subsequent processes. Therefore, after step 703, the projection source device 101 can execute steps 306-308 to implement the subsequent projection process based on the device information and wireless connection information in the fourth data packet. Specifically, step 306 displays the device information from the fourth data packet in the device selection interface, corresponding to the alternative device options. When the user clicks this option, a wireless connection request is sent to the projection target device 102 based on the wireless connection information in the fourth data packet to establish a wireless connection. In other words, Figure 9 The document describes the process of actively discovering devices and projecting the screen based on those devices. Figure 9 and Figure 6Steps 306-308 and 402-403 are the same, only the screen projection information used is different. Figure 6 The information from the projection screen consists of the first data packet and the second data packet. Figure 9 The screen projection information is the fourth data packet. In the overall interaction process, the screen projection source device 101 responds to the screen projection initiation operation by executing steps 301 and 701, and the screen projection target device 102 responds to the Bluetooth broadcast initiation operation by executing steps 401 and 801. That is to say, both ends will simultaneously execute the active device discovery process and the passive device discovery process. When screen projection information is obtained based on either method, device discovery is achieved, and subsequent wireless connection and screen projection processes can be executed. The screen projection information obtained by the process first will be used by the subsequent wireless connection and screen projection processes. The active device discovery process and the passive device discovery process are carried out simultaneously, thus improving the probability and speed of device discovery.

[0129] In some embodiments, during the simultaneous execution of the active and passive device discovery processes, after the projection source device 101 determines that the first data packet and the second data packet are associated projection information based on the first and second verification information, it stops sending the third data packet. That is, if the passive device discovery process has already discovered the device, the third data packet used for active device discovery will no longer be sent, thus achieving a logical closed loop in the overall process and improving security.

[0130] In some embodiments, during the simultaneous execution of the active device discovery process and the passive device discovery process, the target device 102, upon receiving the third verification information, stops sending the first data packet and the second data packet. That is, if the active device discovery process has already discovered the device, the first and second data packets used for passive device discovery will no longer be sent, thus achieving a logical closed loop in the overall process and improving security.

[0131] In some embodiments, any one of the first data packet, the second data packet, the third data packet, and the fourth data packet is the same broadcast structure of the protocol data unit in the Bluetooth broadcast data. In this way, it is not necessary to make major changes to the existing Bluetooth protocol. Simply add screen casting capability information to the reserved fields in the protocol to realize the discovery of devices with screen casting capability.

[0132] In some embodiments, the wireless connection described above is a low-power BLE Bluetooth connection or a Wi-Fi peer-to-peer (P2P) connection.

[0133] In some embodiments, the aforementioned wireless connection is a BLE Bluetooth connection; step 308, initiating video casting to the target device 102 based on the wireless connection, includes: sending an online video address to the target device 102 based on the BLE Bluetooth connection. Step 403, performing video casting based on the wireless connection, includes: receiving an online resource address sent by the source device based on the wireless connection; requesting and receiving an online video based on the online resource address; and playing the online video. Figure 10 As shown, during the online video casting process, the casting source device 101 sends an online video address to the casting target device 102 in step 308. The casting target device 102 requests video from the server 103 based on the online video address. Here, the server 103 can be a cloud server, meaning that the casting target device 102 can request and obtain video resources from the cloud server via the Internet, and play the video obtained from the cloud on the casting target device 102 to realize the casting function; Alternatively, the server 103 can also be a local server, meaning that the casting target device 102 can request and obtain video resources from the local area network, and play the video obtained from the local server on the casting target device 102.

[0134] In some embodiments, the aforementioned wireless connection is a Wi-Fi P2P connection; step 308, initiating video casting to the target device 102 based on the wireless connection, includes: sending an online video address or local video to the target device based on the Wi-Fi P2P connection. Step 403, performing video casting based on the wireless connection, includes: receiving a local video sent by the source device based on the wireless connection; playing the local video. Alternatively, step 403, performing video casting based on the wireless connection, includes: receiving an online resource address sent by the source device based on the wireless connection; requesting and receiving an online video based on the online resource address; playing the online video. Wi-Fi P2P connections have greater bandwidth than BLE Bluetooth connections. Therefore, in addition to transmitting online video addresses via Wi-Fi P2P connections to achieve online video casting, the source device 101 can also directly send a video stream to the target device 102 via a Wi-Fi P2P connection, and then decode and play the video stream to achieve local video casting.

[0135] With the development of technology, BLE Bluetooth connections may also be used to directly transmit local video streams, thus enabling local video projection and playback via BLE Bluetooth connection.

[0136] In some embodiments, the online video address can be a Uniform Resource Locator (URL) or a Uniform Resource Identifier (URI). In addition to transmitting addresses and video streams, the aforementioned wireless connection can also be used to transmit broadcast control commands, enabling the source device to control video playback on the target device.

[0137] In some embodiments, the above-described interaction process can be applied not only to screen mirroring scenarios but also to other scenarios, such as file sharing scenarios. In a file sharing scenario, the screen mirroring source device is a file sharing source device, initiating screen mirroring is initiating file sharing, serviceID is used to represent the file sharing service, screen mirroring information is file sharing information, the screen mirroring device selection interface is a sharing device selection interface, the screen mirroring target device option is a file sharing target device option, the screen mirroring target device is a file sharing target device, initiating video screen mirroring is initiating file sharing, executing video screen mirroring is executing file sharing, and the start screen mirroring action information is the start file sharing action information. The specific steps, logic, and principles are the same as in the above embodiments, the difference lies only in the application scenario. In a file sharing scenario, the two devices can achieve device discovery based on BLE Bluetooth broadcast, that is, determine the file sharing information based on BLE Bluetooth broadcast, and then establish a wireless connection based on the device information and wireless connection information in the file sharing information and achieve file sharing based on the wireless connection. This expands the application scenario of the interaction process. The specific process and principle of the interaction process in the file sharing scenario and the screen mirroring scenario are similar and will not be repeated here.

[0138] The passive discovery process in the above embodiments involves the target device initiating a BLE Bluetooth broadcast, and the source device performing a BLE Bluetooth broadcast search to discover the device. In practice, the source device can also initiate a BLE Bluetooth broadcast, and the target device can perform a BLE Bluetooth broadcast search to discover the device. Examples are given below. Figure 11 As shown in the figure, this application embodiment also provides a screen casting interaction method, including a screen casting method applied to a screen casting source device and a screen casting method applied to a screen casting target device. The screen casting method applied to the screen casting source device includes steps 501 to 503, and the screen casting method applied to the screen casting target device includes steps 601 to 607.

[0139] The interaction process includes:

[0140] When a user initiates a screen mirroring operation on the source device 101, for example, if the source device 101 is running a video application, the user can click the "TV" button in the upper right corner of the video playback interface on the source device 101. Clicking this button initiates the screen mirroring operation. It should be noted that the screen mirroring operation can be initiated in different ways, such as through gesture operations. This embodiment of the application does not limit this method; it is only an example for illustration.

[0141] Upon detecting a user's screen casting initiation operation on the screen casting source device 101, the screen casting source device 101 executes step 501: initiating a BLE Bluetooth broadcast. The BLE Bluetooth broadcast data includes a first data packet and a second data packet. The first data packet includes first verification information and encryption information, and the second data packet includes second verification information and a key.

[0142] The user performs the operation of enabling Bluetooth on the target device 102 for screen mirroring.

[0143] Upon detecting that the user has enabled the Bluetooth function on the target device 102, the target device 102 executes step 601, initiating a BLE Bluetooth broadcast search, which can also be called a Bluetooth scan.

[0144] The target device 102 executes step 602, receiving the BLE Bluetooth broadcast data found in the search. The BLE Bluetooth broadcast data includes a first data packet and a second data packet.

[0145] The target device 102 executes step 604, traversing all the searched BLE Bluetooth broadcast data, and obtaining the first data packet and the second data packet from the searched BLE Bluetooth broadcast data. The first and second verification information are in plaintext. By verifying these two verification information, it can be determined that the two data packets are related information. The encrypted information in the first data packet can be decrypted according to the key in the second data packet, and the device information and wireless connection information can be obtained from the decrypted encrypted information. The encrypted information may also contain a callback function. Based on the first and second verification information, it is determined that the first data packet and the second data packet are related screen casting information. After determining the screen casting information, the subsequent screen casting process will proceed. That is, if the device information and wireless connection information are obtained by decrypting the first data packet according to the key in the second data packet, and it is determined that the second data packet contains the action information to start screen casting, then the subsequent step 605 is executed.

[0146] The target device 102 executes step 605, displaying the screen casting device selection interface. This interface shows alternative device options corresponding to one or more screen casting information identified in the BLE Bluetooth broadcast data. Each alternative device option includes device information from the corresponding one or more screen casting information entries. For example, in this embodiment, only the screen casting information corresponding to the aforementioned source device 101 was found; therefore, only alternative device options including the device name "xx mobile phone xx" are displayed.

[0147] When a user clicks on a candidate device option on the target device 102, they are selecting a projection source device option from at least one candidate device option. The candidate device option clicked by the user is the projection source device option selected by the user. Upon detecting the user's selection of a projection source device option from at least one candidate device option on the target device 102, the target device 102, based on the wireless connection information in the projection information corresponding to the projection source device option, executes step 606: sending a wireless connection request to the projection source device 101 and establishing a wireless connection with the target device.

[0148] The projection source device 101 performs step 502: receiving a wireless connection request sent by the projection target device 102, and establishing a wireless connection with the projection source device based on the wireless connection request.

[0149] The target device 102 executes step 503: Initiating video projection to the source device 101 based on the wireless connection.

[0150] The projection source device 101 executes step 607: Perform video projection based on wireless connection.

[0151] The specific methods for wireless connection and video casting can be the same as those described in the above embodiments. Figure 11 The interaction methods shown are Figure 6 The interaction methods shown are based on the same principle: adding two related data packets to the BLE Bluetooth broadcast data. During the screen mirroring process, the two related data packets are identified by searching for them through BLE Bluetooth and verifying the information. The encrypted information in the other packet is decrypted based on the key of one of the packets to obtain device information and wireless connection information, thereby discovering the target device for screen mirroring. Then, a wireless connection is established based on the wireless connection information to achieve screen mirroring. Figure 11 and Figure 6 The difference is that, Figure 6 It initiates a BLE Bluetooth broadcast on the source device side and performs a BLE Bluetooth broadcast search on the target device side; while Figure 11 It initiates a BLE Bluetooth broadcast on the target device side and searches for BLE Bluetooth broadcasts on the source device side.

[0152] Regardless of Figure 6 The interaction flow shown is still Figure 11 The interactive process shown uses BLE Bluetooth to discover devices, eliminating the need for both ends to be connected to the same local area network. This reduces limitations on screen mirroring and makes it more flexible in application scenarios. Furthermore, BLE Bluetooth discovery has a lower probability of failing to find devices compared to SSDP. Additionally, because BLE Bluetooth has a shorter search range, it is less likely to find irrelevant devices, making it easier to identify the source device and reducing the risk of screen mirroring confusion due to numerous detected devices. Moreover, by decrypting the encrypted information in one data packet using the plaintext of the other, rather than simply verifying the plaintext, security during screen mirroring is improved, preventing data packets from being misinterpreted by other devices.

[0153] In some embodiments, Figure 11 In the interactive flow shown, the encrypted information also includes third verification information. The process of obtaining device information and wireless connection information from the decrypted encrypted information includes: obtaining device information, wireless connection information, and third verification information from the decrypted encrypted information; the process of determining that the first data packet and the second data packet are associated projection information based on the first and second verification information includes: determining that the first data packet and the second data packet are associated projection information based on the first, second, and third verification information. In other words, in the process of determining projection information from BLE Bluetooth broadcast data, in addition to verification based on the plaintext first and second verification information, verification can also be performed based on the third verification information in the encrypted information. For the third verification information in the first data packet, verification can only be performed after decryption using the key in the second data packet, thereby further improving security.

[0154] In some embodiments, Figure 11In the interactive flow shown, the first verification information includes a universally unique identifier (UUID), the second verification information includes a UUID, a service identifier (serviceID), and the action information for starting screen casting, and the third verification information includes the serviceID. The UUID can be used to represent the BLE Bluetooth discovery device service, and the serviceID is used to represent the screen casting service. For example, the first verification information includes the UUID "BLECAST", the second verification information includes the UUID "BLECAST", the serviceID "HwBLeCast", and the action information for starting screen casting "startCast", and the third verification information includes the serviceID "HwBLeCast". If the target device determines that the UUID in the first and second verification information is the same (both are "BLECAST"), then the service corresponding to these two data packets is determined to be the BLE Bluetooth discovery device service. If the serviceID in the second and third verification information is the same (both are "HwBLeCast"), then the service corresponding to these two data packets is determined to be the screen casting service. Furthermore, based on the action information "startCast" in the second data packet, the screen casting process is determined, and the first and second data packets are determined to be associated screen casting information. Verification using UUID and serviceID can improve the scalability of the overall process. For example, in other possible implementations, if the UUID in the two data packets is determined to be the field corresponding to the BLE Bluetooth discovery service, and the serviceID is determined to be the field corresponding to the file sharing service, then it can be determined that the two data packets are not screen projection information that are related to each other, but rather file sharing information that is related to each other, used to implement the file sharing service.

[0155] In some embodiments, such as Figure 12 As shown, in Figure 11 Based on this, the projection method applied to the projection source device 101 further includes steps 901 to 903, and the projection method applied to the projection target device 102 further includes steps 1001 to 1002.

[0156] The interaction process also includes:

[0157] In response to the Bluetooth search initiation operation, the target device 102 performs step 901, sending a BLE Bluetooth broadcast including a third data packet. The third data packet includes third verification information, such as the UUID "BLECAST" and the search device's action information, such as "searchDevice".

[0158] The projection source device 101 performs step 1001: receiving the third data packet sent by the projection target device 102 via BLE Bluetooth broadcast, and obtaining the third verification information and the search device's action information from the third data packet.

[0159] In response to obtaining the third verification information and the action information of searching for devices, the projection source device 101 executes step 1002, which sends a fourth data packet via BLE Bluetooth broadcast. The fourth data packet includes the fourth verification information, device information, and wireless connection information. The fourth verification information includes, for example, the UUID "BLECAST" and the serviceID "HwBLeCast". The device information is, for example, the device name "xxTVxx". The wireless connection information includes, for example, the MAC address "86:xx:xx:xx:17:DB" and the Bluetooth Br MAC address "74:xx:xx:xx:32:40".

[0160] The target device 102 executes step 902: obtain the fourth data packet from the data broadcast by BLE Bluetooth.

[0161] The target device 102 executes step 903: determine the fourth data packet as the projection information based on the fourth verification information.

[0162] exist Figure 11 and Figure 12 The methods for determining information on the projection screen are different. Figure 11 The process involves passively discovering devices. Figure 12 The process involves actively discovering devices. Once a device is discovered, the screen mirroring information is determined. Subsequent wireless connection and screen mirroring processes are identical. The active and passive device discovery processes are executed synchronously. Whichever process obtains the screen mirroring information first will be used by the subsequent wireless connection and screen mirroring processes. Because the active and passive device discovery processes are performed simultaneously, the probability and speed of device discovery can be improved.

[0163] In some embodiments, based on Figure 11 and Figure 12 In the interactive process involved, during the simultaneous execution of the active and passive device discovery processes, after the target device 102 determines that the first data packet and the second data packet are associated projection information based on the first and second verification information, it stops sending the third data packet. In other words, if the passive device discovery process has already discovered the device, the third data packet used for active device discovery will no longer be sent, thus achieving a logical closed loop in the overall process and improving security.

[0164] In some embodiments, based on Figure 11 and Figure 12In the interactive process involved, during the simultaneous execution of the active and passive device discovery processes, the projection source device 101, upon receiving the third verification information, stops sending the first and second data packets. In other words, if the active device discovery process has already discovered the device, the first and second data packets used for passive device discovery will no longer be sent, thus achieving a logical closed loop in the overall process and improving security.

[0165] This application provides a screen projection device applied to a screen projection source device. The screen projection device includes: a Bluetooth module, used to initiate a low-power BLE Bluetooth broadcast search in response to a screen projection initiation operation; the Bluetooth module is further used to receive data from the searched BLE Bluetooth broadcast, and to obtain a first data packet and a second data packet from the BLE Bluetooth broadcast data, wherein the first data packet includes first verification information and encrypted information, and the second data packet includes second verification information and a key; a device discovery module, used to decrypt the encrypted information according to the key, and to obtain device information and wireless connection information from the decrypted encrypted information; and to determine that the first data packet and the second data packet are related based on the first verification information and the second verification information. The system includes: associated projection information; a display module for displaying a projection device selection interface, which shows alternative device options corresponding to one or more projection information identified in the BLE Bluetooth broadcast data, wherein the alternative device options include device information from the corresponding one or more projection information; a wireless connection module for responding to the selection operation of the projection target device option from at least one alternative device option, sending a wireless connection request to the projection target device based on the wireless connection information in the projection information corresponding to the projection target device option, and establishing a wireless connection with the projection target device; and a projection module for initiating video projection to the projection target device based on the wireless connection.

[0166] The screen projection device can apply the screen projection method in the above embodiments. The specific process and principle are the same as those in the above embodiments, and will not be repeated here.

[0167] It should be understood that the above division of the screen projection device is merely a logical functional division. In actual implementation, all or part of these modules can be integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software through processing elements; they can be implemented entirely in hardware; or some modules can be implemented in software through processing elements, while others are implemented in hardware. For example, any one of the Bluetooth module, device discovery module, display module, wireless connection module, and screen projection module can be a separate processing element, or it can be integrated into the screen projection device, for example, integrated into a chip within the device. Alternatively, it can be stored as a program in the device's memory, and its functions can be called and executed by a processing element within the device. The implementation of other modules is similar. Moreover, these modules can be integrated together or implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, the steps of the above method or the various modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.

[0168] For example, modules such as Bluetooth modules, device discovery modules, display modules, wireless connectivity modules, and projection modules can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital processors (DSPs), or one or more field-programmable gate arrays (FPGAs). Furthermore, when one of the above modules is implemented through a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor capable of calling programs. Additionally, these modules can be integrated together as a system-on-a-chip (SOC).

[0169] This application also provides a screen projection device applied to a target device. The screen projection device includes: a Bluetooth broadcast module, used to initiate a low-power Bluetooth broadcast in response to a Bluetooth broadcast operation. The BLE Bluetooth broadcast data includes a first data packet and a second data packet. The first data packet includes first verification information and encryption information, and the second data packet includes second verification information and a key. The key is used to decrypt the encryption information, and the encryption information includes device information and wireless connection information; a wireless connection module, used to receive a wireless connection request sent by the screen projection source device and establish a wireless connection with the screen projection source device based on the wireless connection request; and a screen projection module, used to perform video projection based on the wireless connection.

[0170] This application also provides a screen projection device applied to a screen projection source device. The screen projection device includes: a Bluetooth broadcast module, used to initiate a low-power BLE Bluetooth broadcast in response to a screen projection initiation operation. The low-power BLE Bluetooth broadcast data includes a first data packet and a second data packet. The first data packet includes first verification information and encryption information. The second data packet includes second verification information and a key. The key is used to decrypt the encryption information. The encryption information includes device information and wireless connection information. A wireless connection module, used to receive a wireless connection request sent by the target device and establish a wireless connection with the screen projection source device based on the wireless connection request. A screen projection module, used to initiate video projection to the target device based on the wireless connection.

[0171] This application embodiment also provides a screen projection device applied to a target device. The screen projection device includes: a Bluetooth module, used to initiate a low-power BLE Bluetooth broadcast search in response to an operation of initiating a Bluetooth search; the Bluetooth module is also used to receive data from the searched BLE Bluetooth broadcast; a discovery module, used to obtain a first data packet and a second data packet from the BLE Bluetooth broadcast data, the first data packet including first verification information and encrypted information, and the second data packet including second verification information and a key; decrypting the encrypted information according to the key, and obtaining device information and wireless connection information from the decrypted encrypted information; determining the first data packet and the second data packet according to the first verification information and the second verification information. The two data packets are associated projection information; the display module is used to display a projection device selection interface, which displays alternative device options corresponding to one or more projection information determined in the BLE Bluetooth broadcast data, wherein the alternative device options include device information in the corresponding one or more projection information; the wireless connection module is used to respond to the selection operation of the projection source device option in at least one alternative device option, and send a wireless connection request to the projection source device based on the wireless connection information in the projection information corresponding to the projection source device option, and establish a wireless connection with the projection source device; the projection module is used to perform video projection based on the wireless connection.

[0172] This application also provides a chip, including a processor. The processor is used to read and run a computer program stored in a memory to execute the screen projection method as described in any of the above embodiments.

[0173] This application also provides a computer-readable storage medium, which includes a stored program, wherein the program controls the device where the computer-readable storage medium is located to execute the screen projection method in any of the above embodiments when it is running.

[0174] This application also provides a computer program product containing executable instructions that, when executed on a computer, cause the computer to perform the screen projection method in any of the above embodiments.

[0175] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as 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 in this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive).

[0176] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0177] The above are merely preferred embodiments of this application and are not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A screen projection method, characterized in that, Applied to screen projection source devices, the method includes: In response to the screen mirroring operation, initiate a low-power BLE Bluetooth broadcast search; Receive the BLE Bluetooth broadcast data that has been searched, and obtain a first data packet and a second data packet from the BLE Bluetooth broadcast data. The first data packet includes first verification information and encryption information, and the second data packet includes second verification information and a key. Decrypt the encrypted information using the key, and obtain device information and wireless connection information from the decrypted encrypted information; Based on the first verification information and the second verification information, it is determined that the first data packet and the second data packet are associated screen projection information; The screen projection device selection interface displays alternative device options corresponding to one or more screen projection information determined in the BLE Bluetooth broadcast data, wherein the alternative device options include the device information in the corresponding one or more screen projection information; In response to the selection of a target device option among at least one of the alternative device options, a wireless connection request is sent to the target device based on the wireless connection information in the screen projection information corresponding to the target device option, and a wireless connection is established with the target device. Based on the wireless connection, a video projection is initiated to the target device.

2. The method according to claim 1, characterized in that, The step of obtaining device information and wireless connection information from the decrypted encrypted information includes: obtaining device information, wireless connection information, and third verification information from the decrypted encrypted information; The process of determining that the first data packet and the second data packet are associated projection information based on the first verification information and the second verification information includes: Based on the first verification information, the second verification information, and the third verification information, it is determined that the first data packet and the second data packet are associated screen projection information.

3. The method according to claim 2, characterized in that, The first verification information includes a universally unique identifier (UUID), the second verification information includes a UUID, a service identifier (serviceID), and information about starting screen mirroring, and the third verification information includes a serviceID, which is used to represent the screen mirroring service.

4. The method according to claim 1, characterized in that, Also includes: In response to the screen mirroring initiation operation, a BLE Bluetooth broadcast including a third data packet is sent, the third data packet including third verification information; Obtain a fourth data packet from the data broadcast by the BLE Bluetooth broadcast. The fourth data packet includes fourth verification information, device information, and wireless connection information. The fourth data packet is determined to be screen projection information based on the fourth verification information.

5. The method according to claim 4, characterized in that, After the process of determining that the first data packet and the second data packet are associated projection information based on the first verification information and the second verification information, the transmission of the third data packet is stopped.

6. The method according to claim 3, characterized in that, The screen casting source device is a file sharing source device. When the screen casting operation is to initiate a file sharing operation, the serviceID is used to represent the file sharing service. The screen casting information is file sharing information. The screen casting device selection interface is a sharing device selection interface. The screen casting target device option is a file sharing target device option. The screen casting target device is a file sharing target device. Initiating video screen casting is initiating file sharing. The screen casting start action information is the file sharing start action information.

7. The method according to claim 1, characterized in that, Either the first data packet or the second data packet is a broadcast structure of a protocol data unit in the Bluetooth broadcast data.

8. The method according to claim 1, characterized in that, The wireless connection is either a low-power BLE Bluetooth connection or a Wi-Fi peer-to-peer (P2P) connection.

9. The method according to claim 8, characterized in that, The wireless connection is a BLE Bluetooth connection; The process of initiating video projection to the target device via wireless connection includes sending an online video address to the target device via BLE Bluetooth connection.

10. The method according to claim 8, characterized in that, The wireless connection is a Wi-Fi P2P connection; The process of initiating video projection to the target device based on a wireless connection includes sending an online video address or a local video to the target device based on a Wi-Fi P2P connection.

11. A screen projection method, characterized in that, Applied to the target device for screen projection, the method includes: In response to the operation of initiating Bluetooth broadcast, a low-power Bluetooth broadcast is initiated. The data of the Bluetooth broadcast includes a first data packet and a second data packet. The first data packet includes first verification information and encryption information. The second data packet includes second verification information and a key. The key is used to decrypt the encryption information. The encryption information includes device information and wireless connection information. The first verification information and the second verification information are used to determine that the first data packet and the second data packet are associated screen projection information. Receive a wireless connection request sent by the projection source device, and establish a wireless connection with the projection source device based on the wireless connection request; Video projection is performed based on the wireless connection.

12. The method according to claim 11, characterized in that, The encrypted information also includes third verification information.

13. The method according to claim 12, characterized in that, The first verification information includes a universally unique identifier (UUID), the second verification information includes a UUID, a service identifier (serviceID), and information about starting screen mirroring, and the third verification information includes a serviceID, which is used to represent the screen mirroring service.

14. The method according to claim 11, characterized in that, Also includes: Receive the third data packet sent by the projection source device via BLE Bluetooth broadcast; Obtain third verification information from the third data packet; In response to obtaining the third verification information, a fourth data packet is sent via BLE Bluetooth broadcast. The fourth data packet includes the fourth verification information, device information, and wireless connection information.

15. The method according to claim 14, characterized in that, In response to obtaining the third verification information, the transmission of the first data packet and the second data packet is stopped.

16. The method according to claim 13, characterized in that, When the target device for screen mirroring is a file sharing target device, the serviceID is used to represent the file sharing service, the source device for screen mirroring is a file sharing source device, the execution of video screen mirroring is the execution of file sharing, and the action information for starting screen mirroring is the action information for starting file sharing.

17. The method according to claim 11, characterized in that, Either the first data packet or the second data packet is a broadcast structure of the protocol data unit in the Bluetooth broadcast data.

18. The method according to claim 11, characterized in that, The wireless connection is either a low-power BLE Bluetooth connection or a Wi-Fi peer-to-peer (P2P) connection. The video projection based on the wireless connection includes: Based on the wireless connection, the online resource address sent by the target device for screen projection is received; Request and receive online videos based on the online resource address; Play the online video.

19. The method according to claim 11, characterized in that, The wireless connection is a Wi-Fi P2P connection; The video projection based on the wireless connection includes: Receive local video sent by the target device for screen mirroring based on the wireless connection; Play the local video.

20. A screen projection method, characterized in that, Applied to screen projection source devices, the method includes: In response to the screen casting operation, a low-power BLE Bluetooth broadcast is initiated. The data broadcast by the low-power BLE Bluetooth includes a first data packet and a second data packet. The first data packet includes first verification information and encryption information. The second data packet includes second verification information and a key. The key is used to decrypt the encryption information. The encryption information includes device information and wireless connection information. The first verification information and the second verification information are used to determine that the first data packet and the second data packet are associated screen casting information. Receive a wireless connection request sent by the target device for screen projection, and establish a wireless connection with the source device for screen projection based on the wireless connection request; Based on the wireless connection, a video projection is initiated to the target device.

21. The method according to claim 20, characterized in that, The encrypted information also includes third verification information.

22. The method according to claim 21, characterized in that, The first verification information includes a universally unique identifier (UUID), the second verification information includes a UUID, a service identifier (serviceID), and information about starting screen mirroring, and the third verification information includes a serviceID, which is used to represent the screen mirroring service.

23. The method according to claim 20, characterized in that, Also includes: Receive the third data packet sent by the target device for screen mirroring via BLE Bluetooth broadcast; Obtain third verification information from the third data packet; In response to obtaining the third verification information, a fourth data packet is sent via BLE Bluetooth broadcast. The fourth data packet includes the fourth verification information, device information, and wireless connection information.

24. The method according to claim 23, characterized in that, In response to obtaining the third verification information, the transmission of the first data packet and the second data packet is stopped.

25. The method according to claim 22, characterized in that, When the target device for screen mirroring is a file sharing target device, the serviceID is used to represent the file sharing service, the screen mirroring source device is a file sharing source device, initiating video screen mirroring is initiating file sharing, and the action information for starting screen mirroring is the action information for starting file sharing.

26. The method according to claim 20, characterized in that, Either the first data packet or the second data packet is a broadcast structure of a protocol data unit in the Bluetooth broadcast data.

27. The method according to claim 20, characterized in that, The wireless connection is either a low-power BLE Bluetooth connection or a Wi-Fi peer-to-peer (P2P) connection.

28. The method according to claim 27, characterized in that, The wireless connection is a BLE Bluetooth connection; The process of initiating video projection to the target device via wireless connection includes sending an online video address to the target device via BLE Bluetooth connection.

29. The method according to claim 27, characterized in that, The wireless connection is a Wi-Fi P2P connection; The process of initiating video projection to the target device based on a wireless connection includes sending an online video address or a local video to the target device based on a Wi-Fi P2P connection.

30. A screen projection method, characterized in that, Applied to the target device for screen projection, the method includes: In response to the Bluetooth search initiation operation, initiate a low-power BLE Bluetooth broadcast search; Receive data from the BLE Bluetooth broadcast that has been detected. Obtain a first data packet and a second data packet from the data broadcast by the BLE Bluetooth. The first data packet includes first verification information and encryption information, and the second data packet includes second verification information and a key. Decrypt the encrypted information using the key, and obtain device information and wireless connection information from the decrypted encrypted information; Based on the first verification information and the second verification information, it is determined that the first data packet and the second data packet are associated screen projection information; The screen projection device selection interface displays alternative device options corresponding to one or more screen projection information determined in the BLE Bluetooth broadcast data, wherein the alternative device options include the device information in the corresponding one or more screen projection information; In response to the selection operation of at least one of the alternative device options, a wireless connection request is sent to the projection source device based on the wireless connection information in the projection information corresponding to the projection source device option, and a wireless connection is established with the projection source device. Video projection is performed based on the wireless connection.

31. The method according to claim 30, characterized in that, The step of obtaining device information and wireless connection information from the decrypted encrypted information includes: obtaining device information, wireless connection information, and third verification information from the decrypted encrypted information; The process of determining that the first data packet and the second data packet are associated projection information based on the first verification information and the second verification information includes: Based on the first verification information, the second verification information, and the third verification information, it is determined that the first data packet and the second data packet are associated screen projection information.

32. The method according to claim 31, characterized in that, The first verification information includes a universally unique identifier (UUID), the second verification information includes a UUID, a service identifier (serviceID), and information about starting screen mirroring, and the third verification information includes a serviceID, which is used to represent the screen mirroring service.

33. The method according to claim 30, characterized in that, Also includes: In response to the Bluetooth search initiation operation, a BLE Bluetooth broadcast including a third data packet is sent, the third data packet including third verification information and the search device's action information; Obtain a fourth data packet from the data broadcast by the BLE Bluetooth broadcast. The fourth data packet includes fourth verification information, device information, and wireless connection information. The fourth data packet is determined to be screen projection information based on the fourth verification information.

34. The method according to claim 33, characterized in that, After the process of determining that the first data packet and the second data packet are associated projection information based on the first verification information and the second verification information, the transmission of the third data packet is stopped.

35. The method according to claim 32, characterized in that, When the projection source device is a file sharing source device, the serviceID is used to represent the file sharing service, the projection information is file sharing information, the projection device selection interface is a sharing device selection interface, the projection target device option is a file sharing target device option, the projection target device is a file sharing target device, the execution of video projection is the execution of file sharing, and the start projection action information is the start file sharing action information.

36. The method according to claim 30, characterized in that, Either the first data packet or the second data packet is a broadcast structure of the protocol data unit in the Bluetooth broadcast data.

37. The method according to claim 30, characterized in that, The wireless connection is either a low-power BLE Bluetooth connection or a Wi-Fi peer-to-peer (P2P) connection. The video projection based on the wireless connection includes: Based on the wireless connection, the online resource address sent by the target device for screen projection is received; Request and receive online videos based on the online resource address; Play the online video.

38. The method according to claim 30, characterized in that, The wireless connection is a Wi-Fi P2P connection; The video projection based on the wireless connection includes: Receive local video sent by the target device for screen mirroring based on the wireless connection; Play the local video.

39. An electronic device, characterized in that, The device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device performs the method according to any one of claims 1 to 38.

40. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 38.

41. A computer program product, characterized in that, The computer program product includes executable instructions that, when executed on a computer, cause the computer to perform the method described in any one of claims 1 to 38.

Citation Information

Patent Citations

  • Screen transmission method and device and storage medium

    CN111459433A

  • Wirelessly streaming venue-based data to client devices

    US20170318325A1

Cited By

  • Screen mirroring method, electronic device, storage medium, and program product

    EP4746425A1

  • Screen mirroring method, electronic device, storage medium, and program product

    WO2025086716A1