Screen projection control method and device, equipment and storage medium
By identifying and binding the multiple network connection statuses of the screen-casting terminal and publishing screen-casting protocol services, the problem of low success rate of screen-casting devices under multiple network connection statuses is solved, achieving a higher screen-casting success rate and a lower operating threshold.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN FALCON NETWORK MEDIA CO LTD
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-01
AI Technical Summary
Existing screen mirroring devices have a low success rate when multiple network connections are involved, requiring a single network connection for successful screen mirroring, which makes operation difficult.
By obtaining the network connection status of the target screen-casting terminal, identifying multiple network connection statuses, and binding the screen-casting socket to the network interface of each terminal, screen-casting protocol services are published to ensure that the associated screen-casting terminals can discover and establish screen-casting connections.
It improves the success rate of screen mirroring devices under multiple network connection conditions, lowers the threshold for screen mirroring operations, and increases the success rate of screen mirroring.
Smart Images

Figure CN121967512A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of screen projection technology, specifically to a screen projection control method, device, equipment, and storage medium. Background Technology
[0002] Currently, with the rapid development of network connectivity and screen mirroring technologies, more and more screen mirroring devices support simultaneous connection and use of multiple network interfaces. For example, screen mirroring devices can connect to multiple communication networks simultaneously, such as wired networks and wireless networks (e.g., WiFi). However, during screen mirroring, only a single network is often supported. That is, the screen mirroring terminals usually need to be on the same network for successful screen mirroring, resulting in a low success rate. Summary of the Invention
[0003] This application provides a screen projection control method, apparatus, device, and storage medium, aiming to solve the technical problem of low screen projection success rate of multi-network screen projection devices in the prior art.
[0004] On the one hand, embodiments of this application provide a screen casting control method, which includes the following steps: In response to a screen mirroring control request for the target screen mirroring terminal, obtain the network connection status of the target screen mirroring terminal; If the network connection status is a multi-network connection status, then determine each terminal connection network to which the target projection terminal is connected and the terminal network interface corresponding to the terminal connection network. Based on the screen casting control request, the screen casting socket publishes the screen casting protocol service to the terminal network interface corresponding to each terminal connection network, and obtains the screen casting control result.
[0005] In one possible implementation of this application, the step of publishing a screen casting protocol service to the terminal network interface corresponding to each terminal connection network based on the screen casting control request socket, and obtaining the screen casting control result, includes: Generate the screen casting socket corresponding to the screen casting control request, and bind the screen casting socket to the terminal network interface to obtain the target socket; Based on the target socket and the corresponding terminal network interface, the screen projection protocol service is published to the network connected to each terminal.
[0006] In one possible implementation of this application, the target socket includes a first target socket and a second target socket; The step of binding the projection socket and the terminal network interface to obtain the target socket includes: Obtain the screen projection transmission method corresponding to the screen projection control request; If the screen projection transmission method is unicast transmission or broadcast transmission, the screen projection socket and the terminal network interface are bound by the first binding method and the interface address information corresponding to the terminal network interface to obtain the first target socket; If the screen projection transmission method is multicast transmission, then the screen projection socket is bound to the terminal network interface corresponding to the preset multicast group to obtain the second target socket.
[0007] In one possible implementation of this application, the target socket includes a third target socket; The step of binding the projection socket and the terminal network interface to obtain the target socket includes: The additional information attributes corresponding to the screen projection socket are created according to the second binding method; The target socket and the terminal network interface are bound together by the additional information attribute to obtain a third target socket. When sending data, the third target socket carries a network interface information tag corresponding to the terminal network interface through the additional information attribute.
[0008] In one possible implementation of this application, the step of publishing the screen projection protocol service to each of the terminal connection networks based on the target socket of the screen projection control request and the terminal network interface includes: Obtain the screen casting data packet corresponding to the screen casting protocol service; The target data packet is obtained by configuring the screen projection data packet according to the target socket and the terminal network interface; The target data packet is transmitted according to the target socket and the terminal network interface corresponding to each terminal connection network, so that the target projection terminal and the associated projection terminal establish a projection connection.
[0009] In one possible implementation of this application, transmitting the target data packet according to the target socket and the terminal network interface corresponding to each of the terminal connection networks includes: Parse the target data packet to determine the network interface information tag in the additional information attributes corresponding to the target data packet; If the network port information label and the network label information corresponding to the terminal network interface are the same, then the target data packet is transmitted using the terminal network interface; If the network port information label and the network label information corresponding to the terminal network interface are different, then the target data packet is filtered.
[0010] In one possible implementation of this application, configuring the screen-casting data packet according to the target socket and the terminal network interface to obtain the target data packet includes: Generate the network port information tag corresponding to the terminal network interface; The additional information attributes of the projection data packet are configured according to the target socket and the network port information tag to obtain the target data packet.
[0011] On the other hand, this application provides a screen projection control device, the screen projection control device comprising: The network identification module is configured to respond to a screen projection control request for the target screen projection terminal and obtain the network connection status of the target screen projection terminal; The interface identification module is configured to determine each terminal connection network to which the target projection terminal is connected and the terminal network interface corresponding to the terminal connection network if the network connection status is a multi-network connection status. The multi-network screen mirroring module is configured to publish screen mirroring protocol services to the terminal network interfaces corresponding to the network connected to each terminal according to the target socket of the screen mirroring control request, and obtain the screen mirroring control result.
[0012] On the other hand, this application also provides a screen projection control device, the screen projection control device comprising: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the screen casting control method.
[0013] On the other hand, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the steps in the screen projection control method.
[0014] This application obtains the network connection status of the target screen-casting terminal by responding to a screen-casting control request for the target screen-casting terminal. If the network connection status is a multi-network connection status, it determines each terminal connection network connected to the target screen-casting terminal and the corresponding terminal network interface of each terminal connection network. Based on the screen-casting socket of the screen-casting control request, it publishes screen-casting protocol services to the terminal network interfaces corresponding to each of the terminal connection networks to obtain the screen-casting control result. This allows the target screen-casting terminal, acting as the screen-casting receiver, to identify its network connection status before establishing a screen-casting connection, thereby determining whether the target screen-casting terminal is in a multi-network connection status. If the network connection status is determined to be multi-network connection status, it identifies each terminal connection network connected to the target screen-casting terminal and its corresponding terminal network interface, and publishes screen-casting protocol services through the screen-casting socket corresponding to the screen-casting control request and the terminal network interface corresponding to each terminal connection network. This enables any terminal connecting to any terminal connection network to discover the target screen-casting terminal and establish a screen-casting connection, effectively lowering the barrier to entry for screen-casting and improving the success rate. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a schematic diagram of a scenario for the screen projection control method according to an embodiment of this application; Figure 2 This is a flowchart illustrating one embodiment of the screen projection control method in this application. Figure 3 A flowchart illustrating an embodiment of the screen projection control method provided in this application for determining a target socket; Figure 4 A flowchart illustrating an embodiment of the screen casting control method for publishing a screen casting protocol service provided in this application; Figure 5 A schematic diagram of the structure of one embodiment of the screen projection control device provided in this application; Figure 6 This is a schematic diagram of the structure of one embodiment of the screen projection control device provided in this application. Detailed Implementation
[0017] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of the stated features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0019] In this application, the term "exemplary" is used to mean "serving as an example, illustration, or description." Any embodiment described as "exemplary" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0020] Currently, with the rapid development of network connectivity and screen mirroring technologies, more and more screen mirroring devices support simultaneous connection and use of multiple network interfaces. For example, screen mirroring devices can connect to multiple communication networks simultaneously, such as wired networks and wireless networks (e.g., WiFi). However, during screen mirroring, only a single network is often supported. That is, the screen mirroring terminals usually need to be on the same network for successful screen mirroring, resulting in a low success rate.
[0021] Based on this, this application proposes a screen projection control method, device, equipment, and computer-readable storage medium to solve the technical problem of low screen projection success rate of multi-network screen projection devices in the prior art.
[0022] The screen projection control method in this embodiment of the invention is applied to a screen projection control device, which is set in a screen projection control equipment. The screen projection control equipment is provided with one or more processors, a memory, and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the screen projection control method. The screen projection control equipment can be a smart display terminal, such as a mobile phone, tablet computer, smart TV, smart wearable device (such as VR, AR and MR head-mounted displays or other devices), and smart computer, etc. Optionally, the screen projection control equipment can also be a server or a service cluster composed of multiple servers.
[0023] like Figure 1 As shown, Figure 1 This is a schematic diagram illustrating a scenario of the screen projection control method according to an embodiment of this application. In this embodiment, the screen projection control scenario includes a screen projection control device 100 (which integrates a screen projection control unit) and an associated screen projection terminal 200. The screen projection control device 100 has a computer-readable storage medium corresponding to the screen projection control method running to execute the steps of the screen projection control method. The associated screen projection terminal 200 is a screen projection terminal that establishes a screen projection connection with the screen projection control device 100 and performs screen projection interaction.
[0024] Understandable Figure 1 The screen projection control device in the scenario of the screen projection control method shown, or the device included in the screen projection control device, does not constitute a limitation on the embodiments of the present invention. That is, the number or type of screen projection control device included in the scenario of the screen projection control method, or the number or type of device included in each device, does not affect the overall implementation of the technical solution in the embodiments of the present invention, and can all be considered as equivalent substitutions or derivatives of the technical solutions claimed in the embodiments of the present invention.
[0025] In this embodiment of the invention, the screen projection control device 100 is mainly used to: respond to a screen projection control request for a target screen projection terminal and obtain the network connection status of the target screen projection terminal; If the network connection status is a multi-network connection status, then determine each terminal connection network to which the target projection terminal is connected and the terminal network interface corresponding to the terminal connection network. Based on the screen casting control request, the screen casting socket publishes the screen casting protocol service to the terminal network interface corresponding to each terminal connection network, and obtains the screen casting control result.
[0026] The screen projection control device 100 in this embodiment of the invention can be an independent screen projection control device, such as a mobile phone, tablet computer, network device, server and smart computer, or a screen projection control network or screen projection control cluster composed of multiple screen projection control devices.
[0027] This application provides a screen projection control method, apparatus, device, and computer-readable storage medium, which will be described in detail below.
[0028] It will be understood by those skilled in the art that Figure 1 The application environment shown is only one application scenario related to the solution of this application and does not constitute a limitation on the application scenario of this application. Other application environments may include more than one application scenario. Figure 1 The number of more or fewer screen mirroring control devices shown, or the screen mirroring control network connections, for example... Figure 1 Only one screen projection control device is shown in the figure. It can be understood that the scenario of this screen projection control method may also include one or more screen projection control devices, which are not limited here. The screen projection control device 100 may also include a memory for storing network connection status and other data.
[0029] It should be noted that, Figure 1 The schematic diagram of the screen casting control method shown is merely an example. The scenarios of the screen casting control method described in this embodiment are intended to more clearly illustrate the technical solutions of this embodiment and do not constitute a limitation on the technical solutions provided by this embodiment.
[0030] Based on the scenarios described above for screen projection control methods, various embodiments of the screen projection control method disclosed in this invention are proposed.
[0031] like Figure 2 As shown, Figure 2 This is a flowchart illustrating one embodiment of the screen projection control method in this application. The screen projection control method includes the following steps 201 to 203: 201. Respond to the screen casting control request for the target screen casting terminal and obtain the network connection status of the target screen casting terminal; The screen casting control method in this embodiment is applied to a screen casting control device. The type and number of screen casting control devices are not specifically limited; that is, the screen casting control device can be one or more intelligent display terminals capable of simultaneously connecting to multiple networks and having screen casting functionality. In one specific embodiment, the screen casting control device is a screen casting terminal that serves as a screen casting receiver and / or a screen casting sender. For example, in one specific embodiment, the screen casting control device can be a target screen casting terminal that serves as a screen casting receiver.
[0032] Optionally, the target projection terminal is a projection terminal that simultaneously supports multiple network connections and is capable of establishing projection connections with associated projection terminals for projection interaction. Optionally, the target projection terminal can be any one of a projection receiver and / or a projection sender. For example, in one specific embodiment, the target projection terminal is a projection receiver used to display projection content during the projection interaction process. The associated projection terminal is a projection sender used to transmit projection content during the projection interaction process. The projection content refers to multimedia data to be wirelessly projected to the target projection terminal for display during the projection interaction process.
[0033] Optionally, the screen mirroring control device can connect to multiple communication networks simultaneously during operation. For example, it can connect to any number of communication networks, such as Ethernet and wireless networks (e.g., WiFi). However, in existing screen mirroring processes, the target screen mirroring terminal and the associated screen mirroring terminal need to be connected to the same communication network (e.g., both connected to the same network simultaneously) to establish a screen mirroring connection. Therefore, in a multi-network connected state, the screen mirroring control device may not be able to effectively receive the screen mirroring protocol service sent by the device due to not being on the same network. This can lead to the associated screen mirroring terminal being unable to detect the screen mirroring control device as the target screen mirroring terminal during the screen mirroring interaction, resulting in a low screen mirroring success rate and a high barrier to entry for screen mirroring operations. Therefore, when acting as the target screen mirroring terminal, the screen mirroring control device also responds to screen mirroring control requests and monitors the network connection status of the target screen mirroring terminal through these requests.
[0034] Optionally, the screen mirroring control request is an operation request that drives the screen mirroring control device and / or the target screen mirroring terminal to perform different screen mirroring processing operations under different network conditions, so that the target screen mirroring terminal can be effectively discovered and a screen mirroring connection can be established during the screen mirroring interaction. Optionally, this screen mirroring control request can be triggered by the user when enabling the multi-network screen mirroring option in the screen mirroring settings interface. In addition, this screen mirroring control request can also be automatically triggered by the screen mirroring control device, for example, during the screen mirroring process, the screen mirroring control device automatically triggers a screen mirroring control request for the target screen mirroring terminal.
[0035] Optionally, the network connection status refers to the network status information representing the communication networks that the target projection terminal has connected to. Optionally, this network connection status includes single network connection status and multiple network connection status. The single network connection status represents the network status information representing the target projection terminal establishing a network connection with only one communication network. The multiple network connection status represents the network status information representing the target projection terminal establishing network connections with multiple communication networks simultaneously.
[0036] Optionally, after receiving a screen mirroring control request, the screen mirroring control device can continuously monitor the network connection status of the target screen mirroring terminal in the background to detect whether the network connection status of the target screen mirroring terminal has changed. If the network connection status has not changed, the device outputs the network connection status of the target screen mirroring terminal. If the network connection status of the target screen mirroring terminal has changed, the device obtains the current changed network connection status of the target screen mirroring terminal.
[0037] Optionally, if the screen mirroring control device detects that the target screen mirroring terminal is only connected to one communication network, it outputs the network connection status as a single network connection status and uses the terminal connection network corresponding to the target screen mirroring terminal to send a screen mirroring protocol service, so that the associated screen mirroring terminal can discover the target screen mirroring terminal and establish a screen mirroring connection based on the screen mirroring protocol service.
[0038] Optionally, if the screen projection control device detects that the target screen projection terminal is connected to multiple communication networks at the same time, the output network connection status is "multi-network connection status".
[0039] 202. If the network connection status is a multi-network connection status, then determine each terminal connection network to which the target projection terminal is connected and the terminal network interface corresponding to the terminal connection network; Optionally, after obtaining the network connection status of the target screen projection terminal, the screen projection control device, after determining that the network connection status of the target screen projection terminal is a multi-network connection status, also identifies each terminal connection network connected to the target screen projection terminal and the terminal network interface corresponding to the terminal connection network.
[0040] Optionally, the terminal connection network is the communication network currently connected to by the target projection terminal. Optionally, the terminal connection network can be any one or more of Ethernet, WiFi, cellular networks, and other communication networks.
[0041] Optionally, the terminal network interface is the network port of the target projection terminal's terminal connection network. Optionally, this terminal network interface can connect to one or more terminal connection networks.
[0042] 203. Based on the screen casting control request, the screen casting socket publishes the screen casting protocol service to the terminal network interface corresponding to each terminal connection network to obtain the screen casting control result.
[0043] Optionally, after obtaining the terminal connection network and terminal network interface of the target screen projection terminal, the screen projection control device binds to the terminal network interface corresponding to each terminal connection network through the corresponding screen projection socket. In this way, during the screen projection interaction, the screen projection protocol service is sent to each bound terminal network interface through the screen projection socket, so that each terminal connection network can publish the screen projection protocol service. This allows the associated screen projection device to discover the target screen projection terminal and establish a screen projection connection regardless of which terminal connection network it connects to.
[0044] Optionally, the screen mirroring socket is a socket used to transmit data packets corresponding to the screen mirroring protocol service during the screen mirroring interaction. Optionally, in a specific embodiment, the screen mirroring socket is a UDP (User Datagram Protocol) socket.
[0045] Optionally, the screen mirroring protocol service is a screen mirroring transmission protocol used for screen mirroring transmission during the screen mirroring process. Optionally, in a specific embodiment, the screen mirroring protocol service includes wireless screen mirroring protocols such as DLNA, AirPlay, and Google Cast.
[0046] Optionally, in order to transmit the data packets corresponding to the screen projection protocol service through the multi-terminal network interface via the screen projection socket, the screen projection control device generates the screen projection socket corresponding to the screen projection control request during the screen projection interaction process, binds the screen projection socket to the terminal network interface, and obtains the target socket.
[0047] Optionally, the screen projection control device may publish screen projection protocol services to each terminal's connected network based on the target socket and the corresponding terminal network interface.
[0048] Optionally, the screen mirroring control device can also bind the screen mirroring socket and the terminal network interface according to different screen mirroring implementation methods and screen mirroring transmission methods to obtain the target socket. In the process of screen mirroring interaction, the screen mirroring data packet or target data packet corresponding to the screen mirroring protocol service is transmitted through the target socket, so that each terminal connected to the network can publish the screen mirroring protocol service, and the associated screen mirroring device can discover the target screen mirroring terminal and establish a screen mirroring connection no matter which terminal it is connected to.
[0049] Optionally, the screen mirroring implementation method is the code implementation method corresponding to the screen mirroring data packet during the screen mirroring interaction. Optionally, in a specific embodiment, the screen mirroring implementation method includes a first implementation method and a second implementation method. The first screen mirroring implementation method is the screen mirroring implementation method corresponding to Android Java. The second screen mirroring implementation method is the screen mirroring implementation method corresponding to C / C++.
[0050] Optionally, the screen projection transmission method refers to the transmission method that specifies the transmission and reception of screen projection data packets during the screen projection interaction process. In a specific embodiment, the screen projection transmission method includes any one or more of unicast transmission, broadcast transmission, and multicast transmission.
[0051] Optionally, the target socket is a projection socket bound to the corresponding terminal network interface. Optionally, in one specific embodiment, the target socket includes a first target socket and a second target socket. The first target socket is the projection socket bound to the terminal network interface for unicast or broadcast transmission in the first projection implementation method. The second target socket is the projection socket bound to the terminal network interface for multicast transmission in the first projection implementation method.
[0052] Optionally, after determining that the screen projection implementation method is the first screen projection implementation method, the screen projection control device obtains the screen projection transmission method corresponding to the screen projection control request.
[0053] Optionally, if the screen projection control device determines that the screen projection transmission method is unicast or broadcast, it binds the screen projection socket to the terminal network interface using the first binding method and the interface address information corresponding to the terminal network interface to obtain the first target socket. Optionally, in a specific embodiment, the first binding method is the bindSocket method of the Network object.
[0054] Optionally, if the screen mirroring control device determines that the screen mirroring transmission method is multicast transmission, it binds the screen mirroring socket to the terminal network interface corresponding to the preset multicast group to obtain a second target socket. That is, when adding the screen mirroring socket to the preset multicast group, the screen mirroring control device binds the corresponding terminal network interface to the screen mirroring socket to obtain the second target socket. The screen mirroring control device sends and receives data packets through both the first and second target sockets, and both transmissions must be through the terminal communication network corresponding to the bound terminal network interface. This ensures that each terminal's connected network can publish screen mirroring protocol services, allowing the associated screen mirroring device to discover the target screen mirroring terminal and establish a screen mirroring connection regardless of which terminal's connected network it connects to.
[0055] Optionally, in other embodiments, the screen projection control device can also bind the screen projection socket corresponding to the second screen projection implementation method to a specified terminal network interface to generate a third target socket.
[0056] Optionally, after binding the projection socket and the terminal network interface, the projection control device, upon obtaining the target projection socket, also transmits the projection data packet corresponding to the projection protocol service through the target socket and the corresponding terminal network interface. This enables the target projection terminal to establish a projection connection with the associated projection terminal based on the projection protocol service. In other words, this allows the associated projection terminal to discover the target projection terminal and establish a projection connection regardless of which terminal it connects to.
[0057] In this embodiment, the screen casting control device obtains the network connection status of the target screen casting terminal by responding to a screen casting control request for the target screen casting terminal. If the network connection status is a multi-network connection status, it determines each terminal connection network connected to the target screen casting terminal and the corresponding terminal network interface of each terminal connection network. Based on the screen casting socket of the screen casting control request, it publishes screen casting protocol services to the terminal network interfaces corresponding to each of the terminal connection networks to obtain the screen casting control result. This achieves the following: before the target screen casting terminal, acting as the screen casting receiver, establishes a screen casting connection, it identifies the network connection status of the target screen casting terminal, thereby determining whether the target screen casting terminal is in a multi-network connection status connected to multiple communication networks. If the network connection status is determined to be a multi-network connection status, it identifies each terminal connection network connected to the target screen casting terminal and the corresponding terminal network interface, and publishes screen casting protocol services through the screen casting socket corresponding to the screen casting control request and the terminal network interface corresponding to each terminal connection network. This allows the receiving terminal to discover the target screen casting terminal and establish a screen casting connection with it by connecting to any terminal connection network, thereby effectively reducing the barrier to screen casting and improving the success rate of screen casting.
[0058] like Figure 3 As shown, Figure 3 A flowchart illustrating one embodiment of the screen casting control method provided in this application for determining the target socket is shown below. Figure 3 In the illustrated embodiment, the screen projection control method further includes steps 301 to 302: 301. Create additional information attributes corresponding to the screen projection socket according to the second binding method; 302. Bind the target socket and the terminal network interface through the additional information attributes to obtain a third target socket.
[0059] Based on the above embodiments, the screen projection control device can also bind the screen projection socket corresponding to the second screen projection implementation method to the specified terminal network interface to generate a third target socket.
[0060] Optionally, the screen projection control device creates additional information attributes corresponding to the screen projection socket using the second binding method, enabling the screen projection socket to carry additional network information when transmitting data packets. Optionally, in one specific embodiment, the second binding method is the socket binding method corresponding to the second screen projection implementation. In one specific embodiment, the second binding method is the setsockopt(socketFd, IPPROTO_IP, IP_PKTINFO,&on, sizeof(on)) method. That is, the screen projection control device specifies additional information attributes in the screen projection socket using the second binding method, and binds the target socket and the terminal network interface through these additional information attributes to generate a third target socket. The third target socket carries a network port information tag corresponding to the terminal network interface through the additional information attributes when sending data.
[0061] Optionally, the additional information attribute is an attribute used to characterize the network information specified by the third target socket when sending and receiving data. This additional attribute information is the IP_PKTINFO attribute. When transmitting data, the third target socket can use the additional attribute information to tag the data packet with the network port information tag corresponding to the bound terminal network interface, so that the screen projection control device can transmit the data packet transmitted by the third target socket through the specified terminal network interface via the network port information tag.
[0062] In this embodiment, the screen projection control device creates additional information attributes corresponding to the screen projection socket according to the second binding method; the target socket and the terminal network interface are bound through the additional information attributes to obtain a third target socket. When sending data, the third target socket carries a network port information tag corresponding to the terminal network interface through the additional information attributes. This achieves the binding of the screen projection socket and the terminal network interface, enabling the screen projection socket to send and receive data through the specified terminal network interface, thereby improving the screen projection success rate.
[0063] like Figure 4 As shown, Figure 4 A flowchart illustrating an embodiment of the screen casting control method provided in this application for publishing a screen casting protocol service is shown below. Figure 4 In the illustrated embodiment, the screen projection control method further includes steps 401 to 403: 401. Obtain the screen casting data packet corresponding to the screen casting protocol service; 402. Configure the screen projection data packet according to the target socket and the terminal network interface to obtain the target data packet; 403. Transmit the target data packet according to the projection socket and the terminal network interface corresponding to each terminal connection network.
[0064] Based on the above embodiments, in this embodiment, after binding the screen casting socket and the terminal network interface, the screen casting control device obtains the target screen casting socket. Then, it transmits the screen casting data packet corresponding to the screen casting protocol service through the target socket and the corresponding terminal network interface, enabling the target screen casting terminal to establish a screen casting connection with the associated screen casting terminal based on the screen casting protocol service. That is, regardless of which terminal network the associated screen casting terminal connects to, it can discover the target screen casting terminal and establish a screen casting connection.
[0065] Optionally, the screen mirroring data packet is a data packet generated by the screen mirroring protocol service to establish a screen mirroring connection. The target data packet is a screen mirroring data packet containing a network interface information tag associated with the specified terminal's network interface, and transmitted through that specified terminal's network interface.
[0066] Optionally, after obtaining the screen projection data packet corresponding to the screen projection protocol service, the screen projection control device configures the screen projection data packet according to the target socket and the terminal's network interface to obtain the target data packet. That is, the screen projection control device generates a network port information tag corresponding to the terminal's network interface, and configures the additional information attributes of the screen projection data packet according to the target socket and the network port information tag to obtain the target data packet.
[0067] That is, the screen projection control device adds a network port information tag corresponding to the terminal network interface bound to the target socket to the screen projection data packet, thereby generating a target data packet corresponding to the screen projection data packet. The network port information tag is a tag representing the network port corresponding to the terminal network interface from which the target data packet is to be sent. Optionally, in a specific embodiment, the network port information tag is a pktinfo tag. An example of a network port information tag in a specific embodiment is shown below: struct in pktinfo { int ipi ifindex; struct in_addr ipi_spec_dst; struct in_addr ipi_addr; }; Optionally, after acquiring the target data packet, the screen mirroring control device transmits the target data packet according to the target socket and the terminal network interface corresponding to the network to which each terminal is connected, so that the target screen mirroring terminal establishes a screen mirroring connection with the associated screen mirroring terminal based on the screen mirroring protocol service. That is, the screen mirroring control device selects the terminal network interface used to transmit the target data packet and filters other terminal network interfaces through the network port information tag in the target data packet.
[0068] Optionally, during the transmission of the target data packet between the target socket and the terminal network interface corresponding to the network connected to each terminal, the screen projection control device parses the target data packet and determines the network port information tag in the additional information attribute corresponding to the target data packet.
[0069] Optionally, after obtaining the network port information tag corresponding to the target data packet, the screen projection control device will also compare the network port information tag with the network tag information corresponding to each terminal network interface, since all terminal network interfaces can receive the same target data packet when listening to the target socket, thereby selecting the terminal network interface used to transmit the target data packet.
[0070] Optionally, if the screen projection control device determines that the network port information label and the network label information corresponding to the terminal's network interface are the same, then the target data packet is transmitted using the terminal's network interface. The network label information is the label information that distinguishes each terminal's network interface. Optionally, in a specific embodiment, the network label information is ipi_ifindex.
[0071] Optionally, if the network port information label and the network label information corresponding to the terminal network interface are different, then the target data packet is filtered in the terminal network interface.
[0072] In this embodiment, the screen casting control device obtains the screen casting data packet corresponding to the screen casting protocol service; configures the screen casting data packet according to the target socket and the terminal network interface to obtain the target data packet; and transmits the target data packet according to the target socket and the terminal network interface corresponding to each terminal connection network, so as to enable the target screen casting terminal to publish the screen casting protocol service through the target socket and the bound terminal network interface, thereby enabling the target screen casting terminal to establish a screen casting connection with the associated screen casting terminal based on the screen casting protocol service.
[0073] To better implement the screen projection control method in the embodiments of this application, a screen projection control device is also provided in the embodiments of this application, such as... Figure 5 As shown, Figure 5 This is a schematic diagram of one embodiment of the screen projection control device provided in this application. Specifically, the screen projection control device 500 includes: The network identification module 501 is configured to respond to a screen projection control request for the target screen projection terminal and obtain the network connection status of the target screen projection terminal. The interface identification module 502 is configured to determine each terminal connection network connected to the target projection terminal and the terminal network interface corresponding to the terminal connection network if the network connection status is a multi-network connection status. The multi-network screen mirroring module 503 is configured to publish screen mirroring protocol services to the terminal network interface corresponding to each terminal connection network according to the screen mirroring control request, and obtain the screen mirroring control result.
[0074] In one possible implementation of this embodiment, the target socket in the screen projection control device includes a first target socket and a second target socket; The screen projection control device binds the screen projection socket and the terminal network interface to obtain the target socket, including: Obtain the screen projection transmission method corresponding to the screen projection control request; If the screen projection transmission method is unicast transmission or broadcast transmission, the screen projection socket and the terminal network interface are bound by the first binding method and the interface address information corresponding to the terminal network interface to obtain the first target socket; If the screen projection transmission method is multicast transmission, then the screen projection socket is bound to the terminal network interface corresponding to the preset multicast group to obtain the second target socket.
[0075] In one possible implementation of this embodiment, the target socket in the screen projection control device includes a third target socket; The screen projection control device binds the screen projection socket and the terminal network interface to obtain the target socket, including: The additional information attributes corresponding to the screen projection socket are created according to the second binding method; The target socket and the terminal network interface are bound together by the additional information attribute to obtain a third target socket. When sending data, the third target socket carries a network interface information tag corresponding to the terminal network interface through the additional information attribute.
[0076] In one possible implementation of this embodiment, the screen casting control device publishes a screen casting protocol service to each of the terminal connection networks based on the screen casting socket of the screen casting control request and the terminal network interface, including: Obtain the screen casting data packet corresponding to the screen casting protocol service; The target data packet is obtained by configuring the screen projection data packet according to the target socket and the terminal network interface; The target data packet is transmitted according to the screen casting socket and the terminal network interface corresponding to each terminal connection network, so that the target screen casting terminal establishes a screen casting connection with the associated screen casting terminal based on the screen casting protocol service.
[0077] In one possible implementation of this embodiment, the screen projection control device transmits the target data packet according to the screen projection socket and the terminal network interface corresponding to each terminal connection network, including: Parse the target data packet to determine the network interface information tag in the additional information attributes corresponding to the target data packet; If the network port information label and the network label information corresponding to the terminal network interface are the same, then the target data packet is transmitted using the terminal network interface; If the network port information label and the network label information corresponding to the terminal network interface are different, then the target data packet is filtered.
[0078] In one possible implementation of this embodiment, the screen projection control device configures the screen projection data packet according to the screen projection socket and the terminal network interface to obtain the target data packet, including: Generate the network port information tag corresponding to the terminal network interface; The additional information attributes of the screen projection data packet are configured according to the screen projection socket and the network port information tag to obtain the target data packet.
[0079] In this embodiment, the screen casting control device obtains the network connection status of the target screen casting terminal by responding to a screen casting control request for the target screen casting terminal. If the network connection status is a multi-network connection status, it determines each terminal connection network connected to the target screen casting terminal and the corresponding terminal network interface of each terminal connection network. Based on the screen casting socket of the screen casting control request, it publishes screen casting protocol services to the terminal network interfaces corresponding to each of the terminal connection networks to obtain the screen casting control result. This enables the identification of the network connection status of the target screen casting terminal before establishing a screen casting connection, thereby determining whether the target screen casting terminal is in a multi-network connection status connected to multiple communication networks. When the multi-network connection status is determined, it identifies each terminal connection network connected to the target screen casting terminal and its corresponding terminal network interface, and publishes screen casting protocol services through the screen casting socket corresponding to the screen casting control request and the terminal network interface corresponding to each terminal connection network. This allows any terminal connecting to any terminal connection network to discover the target screen casting terminal and establish a screen casting connection, effectively lowering the barrier to entry for screen casting and improving the success rate of screen casting.
[0080] This invention also provides a screen projection control device, such as... Figure 6 As shown, Figure 6 This is a schematic diagram of one embodiment of the screen projection control device provided in this application.
[0081] The screen projection control device integrates any one of the screen projection control devices provided in the embodiments of the present invention, and the screen projection control device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured by the processor to perform the steps of the screen casting control method described in any of the embodiments of the above-described screen casting control method.
[0082] Specifically, the screen projection control device may include components such as a processor 601 with one or more processing cores, a memory 602 with one or more computer-readable storage media, a power supply 603, and an input unit 604. Those skilled in the art will understand that... Figure 6 The screen projection control device structure shown does not constitute a limitation on the screen projection control device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements. Wherein: The processor 601 is the control center of the screen projection control device. It connects various parts of the device via interfaces and lines, and executes software programs and / or modules stored in the memory 602, as well as calling data stored in the memory 602, to perform various functions and process data, thereby providing overall monitoring of the screen projection control device. Optionally, the processor 601 may include one or more processing cores; preferably, the processor 601 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, while the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 601.
[0083] The memory 602 can be used to store software programs and modules. The processor 601 executes various functional applications and screen projection control by running the software programs and modules stored in the memory 602. The memory 602 may mainly 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 function, image playback function, etc.), etc.; the data storage area may store data created based on the use of the screen projection control device, etc. In addition, the memory 602 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, or other volatile solid-state storage device. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0084] The projection control device also includes a power supply 603 that supplies power to the various components. Preferably, the power supply 603 can be logically connected to the processor 601 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system. The power supply 603 may also include one or more DC or AC power supplies, recharging systems, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components.
[0085] The screen projection control device may also include an input unit 604, which can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function control.
[0086] Although not shown, the screen projection control device may also include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 601 in the screen projection control device loads the executable files corresponding to the processes of one or more applications into the memory 602 according to the following instructions, and the processor 601 runs the applications stored in the memory 602 to realize various functions, as follows: In response to a screen mirroring control request for the target screen mirroring terminal, obtain the network connection status of the target screen mirroring terminal; If the network connection status is a multi-network connection status, then determine each terminal connection network to which the target projection terminal is connected and the terminal network interface corresponding to the terminal connection network. Based on the screen casting control request, the screen casting socket publishes the screen casting protocol service to the terminal network interface corresponding to each terminal connection network, and obtains the screen casting control result.
[0087] Therefore, embodiments of the present invention provide a computer-readable storage medium, which may include: read-only memory (ROM), random access memory (RAM), a disk, or an optical disk, etc. A computer program is stored thereon, which is loaded by a processor to execute the steps in any of the screen projection control methods provided in the embodiments of the present invention. For example, the computer program loaded by the processor can execute the following steps: In response to a screen mirroring control request for the target screen mirroring terminal, obtain the network connection status of the target screen mirroring terminal; If the network connection status is a multi-network connection status, then determine each terminal connection network to which the target projection terminal is connected and the terminal network interface corresponding to the terminal connection network. Based on the screen casting control request, the screen casting socket publishes the screen casting protocol service to the terminal network interface corresponding to each terminal connection network, and obtains the screen casting control result.
[0088] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the detailed descriptions of other embodiments above, which will not be repeated here.
[0089] In practice, each of the above units or structures can be implemented as an independent entity or can be arbitrarily combined to be implemented as the same or several entities. For the specific implementation of each of the above units or structures, please refer to the previous method embodiments, which will not be repeated here.
[0090] For details on the implementation of each of the above operations, please refer to the previous examples, which will not be repeated here.
[0091] The above provides a detailed description of a screen projection control method provided by the embodiments of this application. Specific embodiments have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A screen projection control method, characterized in that, The screen projection control method includes: In response to a screen mirroring control request for the target screen mirroring terminal, obtain the network connection status of the target screen mirroring terminal; If the network connection status is a multi-network connection status, then determine each terminal connection network to which the target projection terminal is connected and the terminal network interface corresponding to the terminal connection network. Based on the screen casting control request, the screen casting socket publishes the screen casting protocol service to the terminal network interface corresponding to each terminal connection network, and obtains the screen casting control result.
2. The screen projection control method according to claim 1, characterized in that, The step of publishing a screen casting protocol service to the terminal network interface corresponding to the network connected to each terminal according to the screen casting control request, and obtaining the screen casting control result, includes: Generate the screen casting socket corresponding to the screen casting control request, and bind the screen casting socket to the terminal network interface to obtain the target socket; Based on the target socket and the corresponding terminal network interface, the screen projection protocol service is published to the network connected to each terminal.
3. The screen projection control method according to claim 2, characterized in that, The target socket includes a first target socket and a second target socket; The step of binding the projection socket and the terminal network interface to obtain the target socket includes: Obtain the screen projection transmission method corresponding to the screen projection control request; If the screen projection transmission method is unicast transmission or broadcast transmission, the screen projection socket and the terminal network interface are bound by the first binding method and the interface address information corresponding to the terminal network interface to obtain the first target socket; If the screen projection transmission method is multicast transmission, then the screen projection socket is bound to the terminal network interface corresponding to the preset multicast group to obtain the second target socket.
4. The screen projection control method according to claim 2, characterized in that, The target socket includes a third target socket; The step of binding the projection socket and the terminal network interface to obtain the target socket includes: The additional information attributes corresponding to the screen projection socket are created according to the second binding method; The target socket and the terminal network interface are bound together by the additional information attribute to obtain a third target socket. When sending data, the third target socket carries a network interface information tag corresponding to the terminal network interface through the additional information attribute.
5. The screen projection control method according to claim 2, characterized in that, The step of publishing the screen projection protocol service to each terminal connection network according to the target socket and the corresponding terminal network interface includes: Obtain the screen casting data packet corresponding to the screen casting protocol service; The target data packet is obtained by configuring the screen projection data packet according to the target socket and the terminal network interface; The target data packet is transmitted according to the target socket and the terminal network interface corresponding to each terminal connection network, so that the target screen projection terminal establishes a screen projection connection with the associated screen projection terminal based on the screen projection protocol service.
6. The screen projection control method according to claim 5, characterized in that, The step of transmitting the target data packet according to the projection socket and the terminal network interface corresponding to each terminal connection network includes: Parse the target data packet to determine the network interface information tag in the additional information attributes corresponding to the target data packet; If the network port information label and the network label information corresponding to the terminal network interface are the same, then the target data packet is transmitted using the terminal network interface; If the network port information label and the network label information corresponding to the terminal network interface are different, then the target data packet is filtered.
7. The screen projection control method according to claim 5, characterized in that, The step of configuring the screen projection data packet according to the target socket and the terminal network interface to obtain the target data packet includes: Generate the network interface information tag corresponding to the terminal network interface bound to the target socket; The additional information attributes of the projection data packet are configured according to the target socket and the network port information tag to obtain the target data packet.
8. A screen projection control device, characterized in that, The projection control device includes: The network identification module is configured to respond to a screen projection control request for the target screen projection terminal and obtain the network connection status of the target screen projection terminal; The interface identification module is configured to determine each terminal connection network to which the target projection terminal is connected and the terminal network interface corresponding to the terminal connection network if the network connection status is a multi-network connection status. The multi-network screen mirroring module is configured to publish screen mirroring protocol services to the terminal network interfaces corresponding to the network connected to each terminal according to the screen mirroring control request, and obtain the screen mirroring control result.
9. A screen projection control device, characterized in that, The screen projection control device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the steps of the screen casting control method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the steps of the screen projection control method according to any one of claims 1 to 7.