Screen mirroring methods and electronic devices

By adaptively controlling the DLNA function through access points or central devices, the DLNA function can be turned on and off according to the screen projection intention, which solves the problem of bandwidth waste in multi-device screen projection and improves user experience and resource utilization efficiency.

CN117439894BActive Publication Date: 2026-05-26HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2022-07-14
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

In multi-device screen mirroring scenarios, multicast messages consume a large amount of network bandwidth, leading to resource waste and a decline in user experience.

Method used

The DLNA function is adaptively controlled to turn on and off through access points or central devices, reducing unnecessary multicast message sending based on whether there is a screen projection intention in the environment.

Benefits of technology

It effectively reduces bandwidth waste, improves user experience, and avoids the complexity and increased power consumption of manual operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117439894B_ABST
    Figure CN117439894B_ABST
Patent Text Reader

Abstract

This application provides a screen mirroring method and an electronic device. The method involves determining whether a screen mirroring intention exists in the environment; when a screen mirroring intention exists and the Digital Living Network Alliance (DLNA) function of a second device in the environment is disabled, a first enable instruction is sent to the second device, instructing the second device to enable the DLNA function; in response to receiving a first event from a first device, a second enable instruction is sent to the second device, the first event indicating that the first device has a screen mirroring intention, and the second enable instruction instructing the second device to send multicast, which is used by the first device to discover the second device for screen mirroring. This application allows for adaptive control of the second device enabling the DLNA function and sending multicast, reducing the bandwidth occupied by multicast.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of wireless communication technology, and in particular to a screen projection method and an electronic device. Background Technology

[0002] Digital Living Network Alliance (DLNA) screen mirroring refers to a device sending the address of a multimedia resource it is playing to another device, enabling the playback of that multimedia resource on the other device.

[0003] Screen mirroring devices can multicast their own screen mirroring services. When there are many screen mirroring devices, there are many multicast messages, which consumes a lot of network bandwidth. Summary of the Invention

[0004] This application provides a screen mirroring method and an electronic device that can reduce the bandwidth occupied by multicast on the screen mirroring device.

[0005] Firstly, embodiments of this application provide a screen mirroring method. The executing entity of this screen mirroring method can be an access point, a central device, or a detection device. When the executing entity is an access point, the first device, the second device, and the detection device in the environment can all connect to the access point. When the executing entity is a central device, the first device, the second device, and the detection device in the environment can all connect to the access point, and the access point can be connected to the central device. The connection between the access point and the central device can be a wired connection or a wireless connection. When the executing entity is a detection device, the detection device can be wirelessly connected to the first device and the second device in the environment. It should be understood that the first device is the source device for screen mirroring, and the second device is the destination device for screen mirroring.

[0006] Taking the execution entity as the access point as an example, the access point can determine whether there is a screen mirroring intention in the environment. Whether there is a screen mirroring intention in the environment can be understood as whether there is a possibility of screen mirroring in the environment. When there is a screen mirroring intention in the environment, and the Digital Life Network Alliance (DLNA) function of the second device in the environment is in a disabled state, the access point can send a first enable instruction to the second device. The first enable instruction is used to instruct the second device to enable the DLNA function.

[0007] When the second device has DLNA enabled, the access point responds to receiving a first event from the first device by sending a second enable instruction to the second device. The first event indicates that the first device has a screen mirroring intention, and the second enable instruction is used to instruct the second device to send a multicast, which is used by the first device to discover the second device for screen mirroring.

[0008] The intention to cast on the first device can be understood as the possibility of casting on the first device. In one possible implementation, the first device has a casting intention when the user opens the target application on the first device, and the casting type of the first device is a casting type supported by the target application; or, the first device has a casting intention when the user opens the target application on the first device and the user inputs a casting operation to the first device.

[0009] In this application, the access point can instruct the second device to enable the DLNA function when there is a screen mirroring intention in the environment, and instruct the second device to send a Notify multicast when the device has a screen mirroring intention. The router can adaptively control the second device to enable the DLNA function and instruct the second device to send a Notify multicast, which can avoid the second device from continuously sending a Notify multicast and reduce bandwidth resource waste.

[0010] When there is no intention to cast to the screen in the environment and the DLNA function of the second device is enabled, the access point can send a shutdown instruction to the second device, which is used to instruct the second device to disable the DLNA function.

[0011] In one possible implementation, after the second device enables DLNA, it can send a first message to the access point. The first message indicates that the second device has enabled DLNA, and the access point can store the DLNA function status of the second device as enabled. In another possible implementation, after the second device disables DLNA, it can send a second message to the access point. The second message indicates that the second device has disabled DLNA, and the access point can store the DLNA function status of the second device as disabled.

[0012] In this possible implementation, after the second device turns the DLNA function on or off, it can send the status of the DLNA function to the access point, so that the access point can update the status of the second device's DLNA function. This allows the access point to precisely control the second device to turn the DLNA function on or off based on the status of the second device's DLNA function.

[0013] In this embodiment, the access point can instruct the second device to enable or disable DLNA functionality based on whether screen mirroring intent exists in the environment, and instruct the second device to send a Notify multicast when the first device intends to mirror screen. The router can adaptively control the second device to enable or disable DLNA functionality and instruct it to send a Notify multicast, which can reduce the bandwidth occupied by the Notify multicast and reduce bandwidth resource waste.

[0014] The following explains the process by which the access point determines if there is an intention to cast to the screen in the environment:

[0015] First, the environment includes an access point. The access point can query whether a first device exists among the devices already connected to it; that is, the access point detects whether the connected devices include a source device for screen mirroring. Specifically, if a first device exists among the devices already connected to the access point, the access point determines that there is an intention to mirror screens in the environment. If a first device does not exist among the devices already connected to the access point, the access point determines that there is no intention to mirror screens in the environment.

[0016] Secondly, the environment includes a detection device that can acquire data and report it to the access point. This data is user-related. The access point can receive the data reported by the detection device and, based on the data, determine whether a screen-casting intent exists in the environment.

[0017] In one possible implementation, the detection device includes at least one of the following: a camera, a smart door lock, and a smart peephole.

[0018] When the detection device includes the camera, the camera is used to capture video of the environment and determine whether a user exists in the video. When the camera detects a user in the video, it can report a second event to the access point. The second event indicates the presence of a user in the video. In this case, the user-related data acquired by the camera constitutes the second event. If the access point receives the second event from the camera, it determines that there is an intention to cast to the screen in the environment; if the access point does not receive the second event from the camera, it determines that there is no intention to cast to the screen in the environment.

[0019] In one embodiment, the camera can also determine whether a screen-casting intention exists in the environment. Specifically, when the camera detects that a user is present in the video, it determines that a screen-casting intention exists in the environment; when the camera detects that a user is not present in the video, it determines that a screen-casting intention does not exist in the environment.

[0020] The detection device includes the smart door lock and the smart peephole. The smart door lock detects the state of the door in the environment, and the smart peephole determines whether a user is at the door. When the door is closed, the smart door lock reports the door's locked status to the access point. When the smart peephole detects a user at the door, it can report a third event to the access point. The third event indicates the presence of a user at the door.

[0021] Specifically, if the access point receives a locked status from the smart door lock and no third event from the smart peephole, it determines that a screen-projection intention exists in the environment. If the access point receives a locked status from the smart door lock and a third event from the smart peephole, it determines that no screen-projection intention exists in the environment. In this case, the user-related data acquired by the smart door lock includes the locked status. The user-related data acquired by the smart peephole includes the third event.

[0022] In one embodiment, the smart door lock and smart peephole can also determine whether a screen projection intention exists in the environment. In this embodiment, when the door is closed, the smart door lock can report the door's locked status to the smart peephole, or, when the smart peephole detects a user at the door, it can send a third event to the smart door lock. Taking the smart door lock as an example, if the door is locked and no third event is received from the smart peephole, the smart door lock determines that a screen projection intention exists in the environment; if the door is locked and a third event is received from the smart peephole, the smart door lock determines that no screen projection intention exists in the environment.

[0023] Third, the environment includes an access point and a detection device. The access point can query whether a first device exists among the devices already connected to the access point, and determine whether there is a screen-casting intention in the environment based on data reported from the detection device (data related to the user). Because multiple data are combined for judgment, the accuracy of the access point in determining whether there is a screen-casting intention in the environment can be improved.

[0024] For example, taking a camera as an example, if the access point queries the devices already connected to the access point and finds a first device, but does not receive a first event from the camera, the router determines that there is no intention to project the screen. If the access point router determines that the first device is present among the devices already connected to the access point and receives a first event from the camera, the access point can determine that there is an intention to project the screen.

[0025] In one embodiment, the detection device can also determine whether there is a screen-casting intention in the environment based on whether a first device exists among the devices already connected to the access point, and based on user-related data. In this embodiment, the access point can send information about the devices already connected to the access point to the detection device.

[0026] In one possible implementation, the access point can also control the second device to enable or disable DLNA functionality based on the screen mirroring types supported by the second device. Specifically, when the second device connects to the access point, the access point can obtain the device type of the second device. For example, the second device can report its device type to the access point.

[0027] After the second device connects to the access point, the access point can receive capability information reported by the second device. The capability information reported by the second device includes support for DLNA functionality. The access point can update the capability information of the second device based on its device type. The updated capability information includes the types of screen mirroring supported by the second device. It should be understood that the device type of the second device reflects the specific types of screen mirroring it supports.

[0028] In this implementation, when there is at least one second device, the first event is further used to indicate the screen projection type of the first device. In response to the first event, the access point can, based on the updated capability information of the second device, determine a target second device among the at least one second device that supports the screen projection type of the first device, and then send the second opening instruction to the target second device.

[0029] For example, if the screen casting type of the first device is video screen casting, the access point can query the target second device that supports video screen casting based on the updated capability information of the second device, send a second open instruction to the target second device that supports video screen casting, and not send a second open instruction to the second device that does not support video screen casting.

[0030] In this implementation, the access point can precisely control the target second device to send multicast. Second devices that do not support the screen mirroring type of the first device can not multicast, which can further reduce the bandwidth consumption of multicast.

[0031] Secondly, embodiments of this application provide a screen mirroring method applied to a first device, which is the source device for screen mirroring. The device interacting with the first device can be an access point or a detection device. Taking an access point as an example, in response to the first device's intention to mirror, the first device sends a first event to the access point, indicating that the first device has a screen mirroring intention.

[0032] In one possible implementation, the first device determines that it intends to cast to the target application when the user opens the target application on the first device. Alternatively, the first device determines that it intends to cast to the target application when the user opens the target application on the first device and the user inputs a casting operation to the first device.

[0033] In one possible implementation, the first event includes the screen casting type of the first device, wherein the screen casting type of the first device is: the screen casting type supported by the target application.

[0034] Thirdly, embodiments of this application provide a screen mirroring method applied to a second device. The first device is the source device for screen mirroring, and the second device is the destination device. The device interacting with the second device can be an access point or a detection device. Taking an access point as an example, the second device receives a first enable instruction from the access point, enabling the DLNA function. The second device receives a second enable instruction from the access point and performs multicast, which is used by the first device to discover the second device for screen mirroring.

[0035] In one possible implementation, after the second device enables the DLNA function, it sends a first message to the access point, which indicates that the second device has enabled the DLNA function.

[0036] In one possible implementation, when the second device connects to the access point, it can report the device type of the second device to the access point; after the second device connects to the access point, it can report the capability information reported by the second device to the access point.

[0037] In one possible implementation, the second device receives a shutdown instruction from the access point to disable the DLNA function.

[0038] In one possible implementation, after the second device disables the DLNA function, it sends a second message to the access point, the second message indicating that the second device has disabled the DLNA function.

[0039] Fourthly, embodiments of this application provide an electronic device that may include a processor and a memory. The memory stores computer-executable program code, which includes instructions; when the processor executes the instructions, the instructions cause the electronic device to perform the methods described in the first to third aspects.

[0040] Fifthly, embodiments of this application provide a computer program product containing instructions that, when run on a computer, cause the computer to perform the methods described in the first to third aspects.

[0041] Sixthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the methods described in the first to third aspects.

[0042] The beneficial effects of the various possible implementations of the second to sixth aspects mentioned above can be found in the beneficial effects of the first aspect mentioned above, and will not be repeated here. Attached Figure Description

[0043] Figure 1 This is a schematic diagram of DLNA screen mirroring;

[0044] Figure 2A A schematic diagram of a system architecture applicable to the screen projection method provided in the embodiments of this application;

[0045] Figure 2B Another schematic diagram of the system architecture to which the screen projection method provided in the embodiments of this application is applicable;

[0046] Figure 3 A flowchart illustrating one embodiment of the screen mirroring method provided in this application;

[0047] Figure 4A A scenario diagram provided for an embodiment of this application;

[0048] Figure 4B This is another scenario illustration provided for an embodiment of this application;

[0049] Figure 4C This is another scenario illustration provided for an embodiment of this application;

[0050] Figure 4D This is another scenario illustration provided for an embodiment of this application;

[0051] Figure 4E This is another scenario illustration provided for an embodiment of this application;

[0052] Figure 4F This is another scenario illustration provided for an embodiment of this application;

[0053] Figure 5 A schematic flowchart of another embodiment of the screen projection method provided in this application;

[0054] Figure 6 A schematic flowchart of another embodiment of the screen projection method provided in this application;

[0055] Figure 7 A schematic flowchart of another embodiment of the screen projection method provided in this application;

[0056] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0057] The Digital Living Network Alliance (DLNA) screen mirroring process includes two phases: device discovery and device control. The device discovery phase involves the first device (the source device for screen mirroring, such as a mobile phone) discovering the second device (the destination device for screen mirroring, such as a television). The device control phase involves the first device sending the address of a multimedia resource to the second device, and the second device retrieving and playing the multimedia resource based on that address. The following embodiments illustrate this using the example of "the first device representing the source device for screen mirroring" and "the second device representing the destination device for screen mirroring."

[0058] Figure 1 This is a schematic diagram of DLNA screen mirroring. (See reference...) Figure 1 In the example 'a', when a user plays a video on their phone, a screen mirroring control 11 can be displayed on the video playback screen. Clicking the screen mirroring control 11 triggers the phone to discover the screen mirroring device (such as a TV). Figure 1 As shown in b, the phone can display a TV icon on the screen, such as a living room TV. After the phone detects the TV, it can send the URL of a video resource to the TV to cast the video for playback, such as... Figure 1 As shown in c in the figure.

[0059] In one embodiment, the first device may include, but is not limited to, devices with DLNA functionality such as mobile phones, portable Android devices (PADs), personal computers (PCs), personal digital assistants (PDAs), handheld devices with wireless communication capabilities, computing devices, and wearable devices.

[0060] The second device may include, but is not limited to: speakers, televisions, smart screens, in-vehicle devices, or virtual reality (VR) terminal devices, augmented reality (AR) terminal devices, wireless terminals in industrial control, smart home devices, and other devices with DLNA functionality.

[0061] It should be understood that the second device having DLNA functionality means that the second device can be scanned and discovered by the first device, and can play multimedia resources transmitted by the source device through screen mirroring.

[0062] In one embodiment, multimedia resources may include, but are not limited to, audio, video, and audio-visual materials.

[0063] During DLNA screen mirroring, the device discovery phase can include two modes: active device discovery and passive device discovery. Active device discovery refers to a first device sending a search multicast to a specified address and port. Upon receiving the search multicast, a second device responds to the first device, thus the first device discovers the second device. Passive device discovery refers to a second device sending a notification multicast. The first device listens to the notification multicast from the second device, also enabling the first device to discover the second device. The screen mirroring method in this embodiment is applicable to scenarios involving passive device discovery.

[0064] In scenarios where devices are passively discovered, after a second device connects to the network, it can send a Notify multicast every 3 seconds based on the DLNA screen mirroring protocol. Currently, there are many second devices in a home environment, including speakers, TVs, and smart screens. These devices all send a Notify multicast every 3 seconds, consuming a large amount of network bandwidth. When there is no primary device mirroring, the Notify multicast wastes bandwidth resources.

[0065] It should be understood that the screen projection method provided in this application is not only applicable to the home environment, but also to other environments, such as factories and offices. This application does not limit this, and the following embodiments use the home environment as an example for illustration.

[0066] In one embodiment, the number of Notify multicasts can be reduced by increasing the period at which the second device sends the Notify multicast, thereby reducing the bandwidth consumed by the Notify multicast. For example, the period at which the second device sends the Notify multicast can be adjusted from 3 seconds to 15 seconds, or even longer. In this embodiment, because the Notify multicast period is increased, the time it takes for the first device to discover the second device is increased, resulting in a poor user experience.

[0067] In one embodiment, a switch can be configured to enable and disable the DLNA function of the second device on the second device or on a device bound to the second device. When screen sharing is not needed, the user can turn off the switch to disable the DLNA function of the second device, preventing the Notify multicast of the second device from consuming bandwidth. When screen sharing is needed, the user can turn on the switch to enable the DLNA function of the second device.

[0068] In this embodiment, the user needs to manually enable or disable the DLNA function of the second device, which is a complex operation. Furthermore, if the user forgets to disable the DLNA function of the second device after enabling it, it can also cause the Notify multicast to consume a large amount of bandwidth.

[0069] This application provides a screen mirroring method that can adaptively enable or disable the DLNA function of a second device by combining detection devices in the environment or by detection from an access point (AP). If screen mirroring intent is detected in the environment, the DLNA function of the second device is enabled; if no screen mirroring intent is detected, the DLNA function of the second device is disabled. By adaptively enabling and disabling the DLNA function of the second device, the continuous sending of Notify multicasts by the second device can be avoided, thereby reducing the bandwidth occupied by multicasts and the waste of bandwidth resources. It can also reduce the power consumption of the second device and, moreover, eliminates the need for manual user operation, improving the user experience.

[0070] In one embodiment, the presence of screen casting intent in the environment can be understood as: a user in the environment may use DLNA screen casting.

[0071] Before introducing the screen mirroring method provided in the embodiments of this application, the system architecture to which the screen mirroring method provided in the embodiments of this application is applicable will be first introduced:

[0072] Figure 2A This is a schematic diagram of a system architecture applicable to the screen projection method provided in the embodiments of this application. (Refer to...) Figure 2A The system architecture may include: a first device, a second device, and an access point. In one embodiment, the access point may include, but is not limited to, a router, customer premises equipment (CPE), etc. Figure 2A The following embodiments use a router as an example to illustrate the concept of an access point.

[0073] A router is used to decide whether to enable or disable the DLNA function of a second device based on information about the devices connected to the router.

[0074] In one embodiment, the system architecture may also include a detection device.

[0075] The detection device is used to acquire user-related data and report the user-related data to the router.

[0076] In one embodiment, the detection device may include, but is not limited to, cameras in the home environment, smart door locks, smart peepholes, robots, etc. Robots may include, for example, cleaning robots, robotic dogs, etc. Figure 2A The following example illustrates the use of a mobile phone as the first device, a television as the second device, and a camera as the detection device. For instance, if the camera can capture video, it can determine whether a user is present in the video. The user-related data acquired by the camera includes whether the user is present in the video.

[0077] The router is also used to decide whether to enable or disable the DLNA function of the second device based on information about the devices connected to the router and / or user-related data from the detection device.

[0078] In one embodiment, the router can act as a detection device, which can determine whether there is a screen-sharing intention in the environment based on information about the devices connected to the router.

[0079] Figure 2B This is another schematic diagram of the system architecture to which the screen projection method provided in the embodiments of this application is applicable. (Refer to...) Figure 2B The system architecture may include: a first device, a second device, a detection device, a router, and a central device.

[0080] The functions of the testing equipment can be referred to Figure 2A The description in the text.

[0081] The router can report information about devices connected to the router, and / or user-related data from the detection device, to the central device.

[0082] The central device is used to decide whether to enable or disable the DLNA function of the second device based on information from the devices accessing the router and / or user-related data from the detection device.

[0083] In one embodiment, the router and the central device can be integrated into one device or separated into independent devices. The following embodiments illustrate this by using the integration of the router and the central device into one device as an example. In scenarios where the router and the central device are configured separately, the router can interact with the central device to implement the screen projection method provided in this application embodiment.

[0084] The screen projection method provided in this application will be described below with reference to specific embodiments. These embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0085] Figure 3 This is a flowchart illustrating one embodiment of the screen mirroring method provided in this application. (Refer to...) Figure 3 The screen mirroring method provided in this application embodiment may include:

[0086] S301: When the first device connects to the router, the first device sends relevant information about itself to the router.

[0087] For example, a user can enter an account and password on the first device to connect to the router, or, if the first device has previously connected to the router, the first device can directly connect to the router. This application embodiment does not limit the way the first device connects to the router.

[0088] The relevant information about the first device may include, but is not limited to, the identifier of the first device and the device type of the first device. The identifier of the first device may be the name or model of the first device, and the device type of the first device may be, for example, mobile phone, PC, PAD, etc.

[0089] In one embodiment, the router may store relevant information about the first device.

[0090] In one embodiment, the router may store device information, including the identifier and device type of devices connected to the router. When a first device connects to the router, the device information includes the identifier and device type of that first device.

[0091] In one embodiment, S301 may refer to the relevant description in the 802.11b standard protocol.

[0092] S302, when the second device connects to the router, the second device sends relevant information about the second device to the router.

[0093] S302 can be referenced from the relevant description in S301. There is no specific order between S302 and S301; they can be executed simultaneously.

[0094] The relevant information about the second device may include, but is not limited to: the identifier of the second device and the device type of the second device. The identifier of the second device may be the name or model of the second device, and the device type of the second device may be, for example, a speaker, a smart screen, a television, etc.

[0095] In one embodiment, the router may store information related to the second device. In another embodiment, when the second device is connected to the router, the device information includes the identifier and device type of the second device.

[0096] S303: After the second device connects to the router, the second device reports its capability information to the router.

[0097] After the second device connects to the router, it can register with the router to send its capability information. Capability information can be understood as the capabilities or services the second device possesses. In other words, after connecting to the router, the second device can report its capability information to the router.

[0098] For example, for a camera, the camera's capability information may include: the camera supports turning on / off, brightness adjustment, and rotation. The second device is a screen mirroring device, and its capability information includes: support for DLNA functionality. In one embodiment, the type of the second device may vary, and its capability information may include other capabilities, which will not be elaborated upon in this application.

[0099] S304, the router stores the capability information of the second device.

[0100] In one embodiment, when the second device reports its capability information to the router, it may carry the identifier of the second device, so that the router can store the identifier of the second device and the capability information of the second device in correspondence.

[0101] It should be noted that the capability information reported by the second device includes support for DLNA, but does not specify which type of screen mirroring the second device supports, such as audio or video mirroring. In one embodiment, the router can update the capability information of the second device based on its device type and the capability information reported by the second device. The updated capability information of the second device includes the specific screen mirroring types supported by the second device.

[0102] For example, if the second device is a speaker, the router can update the device's capability information from "Supports DLNA function" to "Supports DLNA function and supports audio casting". If the second device is a TV or smart screen, the router can update the device's capability information from "Supports DLNA function" to "Supports DLNA function and supports audio and video casting".

[0103] In this embodiment, the router can store updated capability information of the second device.

[0104] It should be understood that S301-S304 describe the process of device access to the router and device registration. The following describes the process of the router controlling the second device to enable or disable the DLNA function:

[0105] S305, the router determines whether the first device exists among the devices already connected to the router. If yes, proceed to S306; otherwise, proceed to S314.

[0106] In one embodiment, the router can query device information to determine whether there are any devices among the devices connected to the router that can initiate screen mirroring, such as mobile phones, PCs, tablets, etc.

[0107] S306, when the DLNA function of the second device is in the off state, the router sends a first on instruction to the second device that has been connected to the router. The first on instruction is used to instruct the second device to turn on the DLNA function.

[0108] In one embodiment, the router can query capability information to identify a second device with DLNA functionality. If a first device is already connected to the router, and this first device may be attempting DLNA screen mirroring (i.e., screen mirroring intent exists in the environment), then when the second device's DLNA function is disabled, the router can send a first enable instruction to the second device already connected to the router, instructing the second device to enable its DLNA function.

[0109] It should be understood that when the DLNA function of the second device is enabled, S306-S308 can be skipped and S310 can be executed directly.

[0110] S307, the second device enables DLNA function.

[0111] It should be noted that the second device in S307 has DLNA enabled, but does not send a Notify multicast.

[0112] S308, the second device sends the first message back to the router.

[0113] The first message indicates that the second device has enabled DLNA functionality.

[0114] S309, the router stores the DLNA function status of the second device as enabled.

[0115] S310: In response to a user opening a target application on a first device, the first device sends a target application open event to the router.

[0116] In one embodiment, the target application launch event can be referred to as the first event, which indicates that the first device has a screen mirroring intention.

[0117] The "Target Application Open" event indicates that the first device has opened the target application, meaning the first device intends to cast the video. The target application is an application with multimedia resource casting functionality. For example, the target application may include, but is not limited to, video applications that can initiate casting, audio applications that can initiate casting, and social applications that can initiate casting.

[0118] To more accurately determine a user's screen mirroring needs, in one embodiment, the first device can send a target application launch event to the router when it detects a user inputting a screen mirroring operation. For example, if the user operates the screen mirroring controls on the target application interface, it can trigger the first device to send the target application launch event to the router. Alternatively, the user can also use voice interaction to trigger the first device to send the target application launch event to the router. This embodiment does not limit the method by which the user inputs the screen mirroring operation.

[0119] S311, the router sends a second open instruction to a second device that has been connected to the router. The second open instruction is used to instruct the second device to send a Notify multicast.

[0120] When a user opens the target application on the first device, screen mirroring may occur. As shown in S307 above, the second device has already enabled DLNA but has not sent a Notify multicast. To ensure the first device can quickly discover the second device when screen mirroring occurs, in this embodiment, if the target application is open on the first device, the router can send a second enable instruction to the second device already connected to the router, instructing the second device to send a Notify multicast. The Notify multicast is used by the first device to discover the second device.

[0121] There is no specific order for S310-S311 and S307-S308; they can be executed simultaneously.

[0122] S312, the second device sends a Notify multicast.

[0123] S313: When the first device detects the Notify multicast, the first device performs DLNA screen mirroring on the second device.

[0124] The process of DLNA screen mirroring from the first device to the second device in this embodiment is not described in detail here; please refer to [reference needed]. Figure 1 Related descriptions.

[0125] S314, when the DLNA function of the second device is enabled, the router sends a shutdown instruction to the second device, which is used to instruct the second device to disable the DLNA function.

[0126] Since the first device is not among the devices connected to the router, and there is no device in the environment that can initiate screen mirroring (i.e., no intention to mirror), the router can send a disable instruction to the second device when the second device's DLNA function is enabled, instructing the second device to disable the DLNA function. It should be understood that after the second device disables the DLNA function, it will not send a Notify multicast, thus reducing bandwidth usage.

[0127] In one embodiment, when the first device is not among the devices already connected to the router, and the DLNA function of the second device is disabled, the router may not respond, such as by not sending a disable instruction to the second device. In another embodiment, when the first device is not among the devices already connected to the router, the router may continue to execute S305 while the device information is being updated.

[0128] S315, the second device disables DLNA function.

[0129] S316, the second device sends a second message to the router.

[0130] The second message indicates that the second device has disabled the DLNA function.

[0131] S317, the router stores the DLNA function status of the second device as disabled.

[0132] In summary, in one embodiment, S305 can be replaced by: the router determining whether a first device exists among the devices connected to the router, and detecting the status of the DLNA function of the second device.

[0133] Specifically, if the router determines that the first device exists among the connected devices and the DLNA function of the second device is disabled, it executes step S306. If the router determines that the first device exists among the connected devices and the DLNA function of the second device is enabled, it executes step S310. If the router determines that the first device does not exist among the connected devices and the DLNA function of the second device is enabled, it executes step S314. If the router determines that the first device does not exist among the connected devices and the DLNA function of the second device is disabled, the router does not respond.

[0134] In one embodiment, Figure 3 Some of the steps shown are optional, and the steps can be combined with each other.

[0135] Figure 4A This is a schematic diagram of a scenario provided by an embodiment of this application. In a home environment, the second device may include a speaker and a television, and the first device may be a mobile phone. Figure 4A Let's take the example where both the speakers and the TV have DLNA functionality turned off. (Refer to...) Figure 4A In point 'a', when the phone is outside the home environment, it is not connected to the router. The router determines that the first device is not among the devices already connected, and since the DLNA function of the speaker and TV is disabled, the router can choose not to respond. (See reference...) Figure 4AIn step b, when a user brings their mobile phone into the home environment, the phone can connect to the router. If the router determines that a first device is among the connected devices, it can send a first activation instruction to the speaker and television. The speaker and television respond to the first activation instruction and enable DLNA functionality.

[0136] Reference Figure 4A In step 'c', the user opens a video application on their phone, and this video application has the function of initiating screen mirroring. The phone can send a target application launch event to the router. In response to the target application launch event, the router sends a second launch instruction to the speaker and TV. In response to the second launch instruction, the speaker and TV can send a Notify multicast.

[0137] Figure 4B This is a schematic diagram of another scenario provided for an embodiment of this application. Figure 4B Taking the example where both the speaker and the TV have DLNA functionality enabled, refer to... Figure 4B When the phone is outside the home environment and not connected to the router, the router determines that the first device is not among the devices already connected. Since the speakers and TV both have DLNA enabled, the router can send a disable instruction to the speakers and TV, which will then disable their DLNA functions. Once the phone enters the home environment, you can refer to... Figure 4A b- Figure 4A The relevant description in c.

[0138] In this embodiment, the router determines whether there is a screen mirroring intention in the environment by checking if a first device is present among the devices connected to the router, and instructs the second device to enable or disable DLNA functionality. Furthermore, when the user opens a target application—that is, when the user may use the screen mirroring function of the target application—the router instructs the second device to send a Notify multicast. The router can adaptively control the second device to enable or disable DLNA functionality and instruct the second device to send Notify multicast, requiring no user intervention, making it simple and flexible. Moreover, the router only instructs the second device to start sending Notify multicast when the user actually intends to mirror, achieving targeted control of the second device's multicast. This avoids the problem of the first device being unable to detect the second device and also reduces the bandwidth occupied by Notify multicast, minimizing bandwidth resource waste.

[0139] Figure 3The illustrated embodiments demonstrate how a router can determine whether a screen-casting intention exists in the environment. In one embodiment, a detection device in the environment can also determine whether a screen-casting intention exists, allowing the router to control a second device to enable or disable DLNA functionality. In one embodiment, the detection device may include, but is not limited to, cameras, smart locks, smart doorbells, and robots.

[0140] In this embodiment, reference is made to Figure 5 S305 can be replaced by S305A-S306A:

[0141] The S305A is a detection device that acquires user-related data and sends user-related data to the router.

[0142] In one embodiment, user-related data may include: results from a detection device determining the presence of a user in the environment, and / or user behavior data.

[0143] In one embodiment, the detection device can connect to a router and interact with it. When connecting to the router, the detection device can send its own information to the router. This device information includes the device's identifier and device type.

[0144] Once the testing equipment is powered on, it can acquire data related to the user.

[0145] Firstly, taking a camera as an example of a detection device, if a camera is installed in a home environment, the camera can capture video. In one embodiment, the camera can send the captured video to a router, which analyzes the video to determine whether a user is present in the home environment. In one embodiment, the camera can capture video and analyze the video to determine whether a user is present in the home environment.

[0146] Taking the use of a camera to determine the presence of a user in a home environment as an example, in one embodiment, the camera captures video and analyzes whether the video contains a human image. The camera is installed in the home environment; when the video contains a human image, the camera can determine that a user is present in the home environment; when the video does not contain a human image, the camera can determine that no user is present in the home environment. For example, the camera can use human detection algorithms or facial recognition algorithms to determine whether the video contains a human image.

[0147] In this embodiment, when the video contains images of people, the camera can send a user event to the router, indicating the presence of a user in the environment. In one embodiment, the user event sent by the camera may be referred to as a second event. User-related data acquired by the camera includes: the second event.

[0148] In one embodiment, the camera can also analyze which user is in the video based on a facial recognition algorithm. The camera can store a user whitelist, which contains identifiers of users who have used DLNA screen mirroring. These identifiers can be user names, facial images, etc. When the camera determines that a user in the environment is on the whitelist using the facial recognition algorithm, the camera can send a user event to the router.

[0149] The user whitelist can be customized by the user on the first device, which can then send the whitelist to the camera. For example, the user can customize the whitelist in the smart home app on the first device, and when the user connects the camera to the router through the smart home app, the first device can send the whitelist to the camera.

[0150] In this embodiment, the camera does not send user events to the router whenever a user is present in the environment. Instead, it sends user events to the router only when a user who has used DLNA screen mirroring is present in the environment. This is because if a user who has used DLNA screen mirroring is present in the environment, the probability of that user using DLNA screen mirroring again is high, indicating a strong intention to use screen mirroring in the environment. When the camera reports user events to the router, it can ensure that the router can accurately control the DLNA function of the second device.

[0151] In one embodiment, the camera can remain on continuously, meaning it can continuously capture video. In another embodiment, to conserve camera power, when the door is locked (e.g., the router receives a notification from the smart lock indicating the door is locked), the router can instruct the camera to turn on and capture video. This reduces both the amount of video processing required by the camera and its power consumption.

[0152] Secondly, taking smart door locks and smart peepholes as examples of detection devices, in a home environment, smart door locks and smart peepholes are installed on the doors. Smart door locks can detect the door's status, including whether it's locked or open. For instance, a camera or human sensor can be installed in the smart peephole, allowing it to determine whether a user is outside the door.

[0153] In one embodiment, when the door is closed, the smart lock can send a message to the router indicating that the door is locked. Since the user closes the door, the smart lock acquires user-related data including the door's locked state. Locking the door can be seen as a result of user behavior; therefore, the locked state can be considered user behavior data.

[0154] A smart peephole can determine whether a user is outside the door, and when a user is present, it reports the user event to the router. In one embodiment, the smart peephole can also report collected video (or images), or human detection data, to the router, which then determines whether a user is outside the door. The method by which the smart peephole determines whether a user is outside the door can refer to the relevant descriptions of how cameras determine the presence of users in the environment. In one embodiment, the user event sent by the smart peephole can be referred to as a third event. The user-related data acquired by the smart peephole includes: the third event.

[0155] Thirdly, taking a robot (cleaning robot) as an example, the cleaning robot can move within the home environment to perform cleaning tasks. For instance, the cleaning robot is equipped with a camera or human sensor, allowing it to determine the presence of a user in the environment. When the cleaning robot determines the presence of a user, it can report the user event to the router. In one embodiment, the user event sent by the cleaning robot can be referred to as a fourth event. The user-related data acquired by the cleaning robot includes the fourth event.

[0156] S306A: The router determines whether a user exists in the environment based on user-related data from the detection device. If yes, proceed to S306; otherwise, proceed to S314.

[0157] Firstly, in one embodiment, when the router does not receive user events reported from the camera, it determines that no user exists in the environment; when the router receives user events reported from the camera, it determines that a user exists in the environment. It should be understood that when a user exists in the environment, the router determines that there is an intention to cast to the screen; when no user exists in the environment, the router determines that there is no intention to cast to the screen.

[0158] Figure 4C This is another schematic diagram illustrating an embodiment of the present application. In a home environment, the second device includes a speaker and a television, and the first device is a mobile phone. Figure 4C The testing equipment used by China and Israel includes cameras, and assuming that the DLNA function of both the speakers and the television is turned off, this is an example. (Refer to...) Figure 4C When a user is in a home environment, the camera can capture video of the home environment and determine that the user is present. The camera reports the user event to the router. The router responds by receiving the user event from the camera and can determine that the user is present in the home environment, i.e., there is an intention to cast the screen. The router can then send a first turn-on instruction to the speakers and TV. The speakers and TV respond to the first turn-on instruction and can enable the DLNA function.

[0159] After enabling DLNA on the speaker or TV, if the user opens the target application on their phone, the above actions can also be performed. Figure 4A The operations in scene c.

[0160] Secondly, in one embodiment, the router can combine the door status and whether the smart doorbell reports user events to determine whether a user exists in the environment.

[0161] For example, when the door is locked and the router receives a user event reported by the smart peephole, the router determines that the door is locked from the outside. When the door is locked but the router does not receive a user event reported by the smart peephole, the router determines that the door is locked from the inside. In this embodiment, when the door is locked from the outside, it indicates that the user has left, and the router can determine that there is no user in the environment; when the door is locked from the inside, it indicates that the user has returned home, and the router can determine that there is a user in the environment.

[0162] Third, in one embodiment, when the router does not receive user events reported by the cleaning robot, it determines that there are no users in the environment; when the router receives user events reported by the cleaning robot, it determines that there are users in the environment.

[0163] In one embodiment, the router can also combine user-related data reported by multiple detection devices to determine whether a user exists in the environment.

[0164] For example, when the door is locked from the outside, it indicates that the user has left, but other users may still be present in the environment. In this case, the router cannot accurately determine the presence of a user based solely on data reported by the smart lock and smart peephole. In this embodiment, the router can combine data reported by the camera, the smart lock and smart peephole, or the cleaning robot to determine the presence of a user. In this embodiment, when the door is locked and the router receives a user event reported by the smart peephole, the router determines that the user has left. The router can also combine this information with data from the camera not reporting user events to accurately determine that no user is present in the environment.

[0165] Figure 4D This is another schematic diagram illustrating an embodiment of the present application. In a home environment, the second device includes a speaker and a television, and the first device is a mobile phone. Figure 4D The testing equipment used by China and Israel includes cameras, smart door locks, and smart peepholes, with DLNA functionality enabled on both speakers and televisions as examples. (Refer to...) Figure 4DIn scenario 'a', if the user leaves the house, the smart door lock reports the door status as locked to the router when the door is locked. The smart peephole, recognizing the presence of a user outside, can also report a user event to the router. Conversely, if the camera captures video of the home environment but does not detect a user and does not report a user event to the router, the router, based on the locked door status, the user event from the smart peephole, and the absence of a user event from the camera, can determine that no user is present in the home environment. Therefore, there is no intention to project the screen, and the router can send a shutdown instruction to the speakers and TV. The speakers and TV, responding to the shutdown instruction, can disable the DLNA function. It should be understood that... Figure 4D The "Zhongyimen" symbol represents smart door locks and smart peepholes.

[0166] Reference Figure 4D In scenario b, if a user returns home, the smart door lock reports the door's status as locked to the router upon locking the door. The smart peephole, confirming the absence of a user outside the door, does not report any user events to the router. Conversely, the camera can capture video of the home environment and, upon confirming the presence of a user, can report user events to the router. In this scenario, based on the locked door status, the absence of user events from the smart peephole, and the receipt of user events from the camera, the router can determine the presence of a user in the home environment, indicating a potential screen mirroring intent. The router can then send a first open instruction to both the speaker and the TV. Responding to this first open instruction, the speaker and TV can activate the DLNA function.

[0167] If a user opens a video application on their phone, and that application has a screen mirroring function, the phone can send a target application launch event to the router. In response to this event, the router can send a second launch instruction to the speakers and TV. The speakers and TV, in turn, can send a Notify multicast message. (See also...) Figure 4A The relevant description of 'c' in the text.

[0168] In this embodiment, the router can combine user-related data reported by the detection device in the environment to determine whether a user exists in the environment, so as to instruct the second device to turn on or off the DLNA function. No user operation is required, which is simple and flexible. Moreover, the router only controls and instructs the second device to start sending Notify multicast when the user actually intends to cast the screen, such as when the user opens the target application. This achieves targeted multicast, which can reduce the bandwidth occupied by Notify multicast and reduce bandwidth resource waste.

[0169] If the router controls a second device to enable DLNA based on the presence of a first device (a mobile phone) among the connected devices, in one possible scenario, such as when the user hasn't returned home yet but the phone has already connected to the router, even though no one is home, this method, while enabling DLNA in advance, suffers from low control precision and wastes the second device's power. In another possible scenario, if the cameras installed in the home environment don't cover every location, the router cannot accurately determine the presence of a user based solely on data reported by the cameras; in this scenario, the router's control accuracy is also low.

[0170] In one embodiment, the router can combine user-related data acquired by the detection device with the devices already connected to the router in S305 to control the second device to turn the DLNA function on or off, thereby improving the accuracy of control over the second device.

[0171] Reference Figure 6 S305 can be replaced with S305B-S305B:

[0172] S305B: The router determines whether the first device exists among the devices already connected to the router. If yes, proceed to S306B; otherwise, proceed to S314.

[0173] S305B can be referenced from the relevant description of S305.

[0174] S306B: The router determines whether a user exists in the environment based on user-related data from the detection device. If yes, proceed with S306; otherwise, proceed with S314.

[0175] S306B can be referenced from the relevant descriptions in S305A-S306A. It should be understood that S305A can be executed before S306B.

[0176] In one embodiment, the execution order of S305B and S306B can be interchanged.

[0177] Figure 4E This is another scenario illustration provided for an embodiment of this application. In a home environment, the second device includes a speaker and a television, and the first device is a mobile phone. Figure 4E Taking a camera as the detection device, and assuming that the DLNA function of both the speaker and the TV is turned off, as an example. (Refer to...) Figure 4E In scenario 'a', when a user arrives at their doorstep with their mobile phone, the phone connects to the router. However, the camera determines that no user is present in the environment and therefore does not report a user event to the router. In this scenario, the router confirms the presence of the first device among the devices connected to the router, but has not received a user event from the camera; therefore, the router can choose not to respond. (See also...) Figure 4EIn scenario b, when a user enters a home environment with their mobile phone, the camera, upon confirming the user's presence, can report the user event to the router. In this scenario, the router determines that a first device is present among the devices connected to the router and receives the user event from the camera. The router can then determine that there is an intention to project the image, and can send a first activation instruction to the speakers and TV. The speakers and TV respond to the first activation instruction and enable the DLNA function.

[0178] After enabling DLNA on speakers and TVs, they can also respond to a second enable instruction from the router by sending a Notify multicast. See [link / reference] for details. Figure 4A The relevant description of 'c' in the text.

[0179] In this embodiment, the router can combine user-related data reported by the detection device with device information accessing the router to control the second device to turn the DLNA function on or off, thereby improving the control accuracy of the DLNA function switch.

[0180] In the above embodiments, when a screen mirroring intention is determined to exist in the environment, the router sends a first enable instruction to a second device already connected to the router, instructing the second device to enable the DLNA function. Here, the second device refers to all screen mirroring destination devices already connected to the router. Among these destination devices, different types of screen mirroring destination devices support different screen mirroring types. For example, a speaker supports audio screen mirroring, while a smart screen and a TV support both audio and video screen mirroring. When a screen mirroring intention exists in the environment, such as when a user wants to mirror video, the router controls the speaker to also send a Notify multicast, even though the speaker does not support video casting. The Notify multicast sent by the speaker still wastes bandwidth resources.

[0181] In one embodiment, to achieve precise control, when the first device executes S310, it may send a target application launch event to the router, which may include an identifier of the target application type. This target application type identifier indicates whether the target application is a video or audio application, i.e., the type of screen mirroring supported by the target application. Correspondingly, when the router executes S311, in response to the target application launch event, it may send a first launch instruction to the target second device. The router can then query the capability information of the second device based on the target application type identifier carried in the target application launch event to determine the target second device.

[0182] The target second device is a second device that supports screen mirroring of the target application. For example, such as... Figure 4FAs shown in Figure c, when a user opens a video application on their phone, the phone can send a target application launch event to the router. In response to this event, the router can send a second launch instruction to TVs that support video casting, but not to speakers that do not. This allows the TV to send a Notify multicast, while the speakers do not, reducing the bandwidth used by multicast. It should be understood that... Figure 4F ab in can be with Figure 4A The letters a and b are the same; you can refer to them. Figure 4A The relevant descriptions in ab.

[0183] In one embodiment, this application provides a screen mirroring method, referring to... Figure 7 The method may include:

[0184] S701, determine if there is a screen mirroring intention in the environment.

[0185] In one embodiment, the router or central device can determine whether a screen-sharing intention exists in the environment.

[0186] The router can query the devices connected to the router. If it determines that the first device is among the connected devices, it confirms that there is an intention to cast to the screen in the environment, as described in section S305. Alternatively, the router can also determine whether there is an intention to cast to the screen based on user-related data from the detection device, or it can determine whether there is an intention to cast to the screen based on both the devices connected to the router and user-related data from the detection device, as described in sections S306A, S305B-S306B.

[0187] The central device can receive user-related data from the detection device through the router, and the router can also send device information to the central device. The central device can determine whether there is a screen-casting intention in the environment by referring to the relevant description of the router's determination of whether there is a screen-casting intention in the environment.

[0188] In one embodiment, the detection device can determine whether a screen-casting intention exists in the environment. Specifically, when the detection device determines that a user is present in the environment, it can determine that a screen-casting intention exists. The detection device may include, but is not limited to, a camera, a smart door lock, and a smart peephole. The determination of whether a user is present in the environment can be referred to the relevant descriptions in S305A-S306A. In this embodiment, if both the first device and the second device are connected to the detection device, the detection device can interact with the first device and the second device to execute S702-S703 when it determines that a screen-casting intention exists in the environment.

[0189] It should be understood that Figure 7The following explanation uses a router as an example to illustrate the screen mirroring method.

[0190] S702, when there is a screen mirroring intention in the environment and the DLNA function of the second device in the environment is turned off, a first turn-on instruction is sent to the second device. The first turn-on instruction is used to instruct the second device to turn on the DLNA function.

[0191] S703, in response to receiving a first event from the first device, sends a second open instruction to the second device. The first event indicates that the first device has a screen mirroring intention, and the second open instruction is used to instruct the second device to send a multicast. The multicast is used by the first device to discover the second device for screen mirroring.

[0192] S702 can be referred to the relevant descriptions in S306-S313, and S703 can be referred to the relevant descriptions in S314.

[0193] In one embodiment, this application also provides an electronic device, which can be the first device, second device, router, or central device described in the above embodiments. (See also...) Figure 8 The electronic device may include a processor 801 (e.g., CPU) and a memory 802. The memory 802 may include high-speed random-access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device. The memory 802 may store various instructions for performing various processing functions and implementing the method steps of this application.

[0194] Optionally, the electronic device involved in this application may further include: a power supply 803, a communication bus 804, and a communication port 805. The communication port 805 is used to enable communication between the electronic device and other peripherals. In this embodiment, the memory 802 is used to store computer-executable program code, which includes instructions. When the processor 801 executes the instructions, the instructions cause the processor 801 of the electronic device to perform the actions described in the above method embodiment. The implementation principle and technical effects are similar and will not be repeated here.

[0195] In one embodiment, when the electronic device is a first device or a second device, the electronic device may further include a display screen 806, which is used to display an interface.

[0196] It should be noted that the modules or components described in the above embodiments 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 signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), etc. Furthermore, when a module is implemented through processing element scheduler code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors capable of calling program code, such as a controller. Additionally, these modules can be integrated together to implement a system-on-a-chip (SOC).

[0197] 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. A 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 flow or function according to the embodiments of this application is 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, 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 (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access 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., a solid-state disk (SSD)).

[0198] The term "multiple" in this document refers to two or more. The term "and / or" 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 alone, A and B simultaneously, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the preceding and following related objects; in formulas, " / " indicates a "division" relationship. Additionally, it should be understood that in the description of this application, words such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.

[0199] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of this application.

[0200] It is understood that, in the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

Claims

1. A screen projection method, characterized in that, include: Determine if there is an intention to cast to the screen in the environment; When there is a screen mirroring intention in the environment, and the Digital Life Network Alliance (DLNA) function of the second device in the environment is turned off, a first turn-on instruction is sent to the second device. The first turn-on instruction is used to instruct the second device to turn on the DLNA function. In response to receiving a first event from a first device, a second open instruction is sent to the second device. The first event indicates that the first device has a screen mirroring intention, and the second open instruction is used to instruct the second device to send a multicast, which is used by the first device to discover the second device for screen mirroring.

2. The method according to claim 1, characterized in that, The environment includes an access point, and determining whether a screen mirroring intent exists in the environment includes: Check if the first device exists among the devices already connected to the access point; If so, then it is determined that there is an intention to cast to the screen in the environment.

3. The method according to claim 1, characterized in that, The environment includes detection devices, and determining whether a screen-casting intent exists in the environment includes: Receive data reported by the detection device; Based on the data, determine whether there is an intention to cast to a screen in the environment.

4. The method according to claim 3, characterized in that, The detection equipment includes at least one of the following: a camera, a smart door lock, and a smart peephole.

5. The method according to claim 4, characterized in that, The detection device includes the camera, which is used to capture video of the environment and determine whether a user is present in the video. The step of determining whether a screen-casting intention exists in the environment based on the data includes: If a second event is received from the camera, it is determined that there is a screen mirroring intention in the environment, and the second event indicates that a user is present in the video.

6. The method according to claim 4, characterized in that, The detection device includes the smart door lock and the smart peephole. The smart door lock is used to detect the state of the door in the environment, and the smart peephole is used to determine whether there is a user at the door. The step of determining whether a screen-casting intention exists in the environment based on the data includes: If a locked status is received from the smart door lock and no third event is received from the smart doorbell, it is determined that there is an intention to project a screen in the environment. The locked status indicates that the door is locked and the third event indicates that there is a user at the door. If a locked status is received from the smart door lock, and a third event is received from the smart doorbell, it is determined that there is no intention to project the screen in the environment.

7. The method according to claim 1, characterized in that, The environment includes access points and detection devices. Determining whether a screen-casting intent exists in the environment includes: The system queries whether a first device exists among the devices already connected to the access point, and determines whether a screen mirroring intent exists in the environment based on data reported from the detection device.

8. The method according to any one of claims 1-7, characterized in that, The environment includes an access point, and before determining whether a screen-casting intention exists in the environment, the process further includes: When the second device connects to the access point, the device type of the second device is obtained; After the second device connects to the access point, it receives the capability information reported by the second device; Based on the device type of the second device, update the capability information of the second device. The updated capability information of the second device includes: the screen projection types supported by the second device.

9. The method according to claim 8, characterized in that, The second device is at least one, and the first event is further used to indicate the screen mirroring type of the first device. Sending the second open instruction to the second device includes: Based on the updated capability information of the second device, a target second device that supports the screen mirroring type of the first device is determined among the at least one second device; Send the second opening instruction to the target second device.

10. The method according to claim 9, characterized in that, When a user opens the target application on the first device, the first device has a screen mirroring intention, and the screen mirroring type of the first device is: the screen mirroring type supported by the target application; or, When a user opens the target application on the first device and the user inputs a screen mirroring operation to the first device, the first device has a screen mirroring intention.

11. The method according to any one of claims 1-7, characterized in that, After sending the first open instruction to the second device, the method further includes: Receive a first message from the second device, the first message indicating that the second device has enabled the DLNA function; The DLNA function of the second device is enabled.

12. The method according to claim 1, characterized in that, The method further includes: When there is no intention to cast to the screen in the environment and the DLNA function of the second device is turned on, a shutdown instruction is sent to the second device, which is used to instruct the second device to turn off the DLNA function.

13. An electronic device, characterized in that, include: Processor and memory; The memory stores computer instructions; The processor executes computer instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-12.

14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program or instructions that, when executed, implement the method as described in any one of claims 1-12.