Screen projection processing method and device, electronic equipment and storage medium
By establishing a long connection between the mobile phone and the TV device, the problem of screen projection when the device is not on the same LAN is solved, and content sharing and playback status synchronization between devices is realized, improving the convenience and fluency of the screen projection experience.
Patent Information
- Application Number
- CN202411079756.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-03
AI Technical Summary
When the mobile phone and TV devices are not on the same LAN, the traditional screen projection method based on protocols such as DLNA cannot work properly, making wireless sharing of content impossible.
By establishing a long connection between the first device and the second device, the transmission of screen projection requests and control instructions is realized, ensuring the stability and synchronization of data transmission and control operations between devices.
It realizes the synchronization of content sharing and playback status between devices. Users can directly control the playback status of another device on one device, ensuring the consistency of playback progress, and improving the convenience and fluency of the screen projection experience.
Smart Images

Figure CN119071547A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of system security technology, and in particular to a screen projection processing method, device, electronic device and storage medium. Background Art
[0002] The technology for wireless screen projection between mobile phones and television (TV) devices usually relies on standard protocols such as the Digital Living Network Alliance (DLNA). It is mainly designed to operate in a Local Area Network (LAN) environment, ensuring that mobile devices and TV devices are in the same network architecture, allowing users to enjoy the convenience of screen projection.
[0003] However, in certain situations, for example, the user may be using a mobile network outdoors or at home. At this time, the mobile phone is not connected to the traditional home LAN, and the TV device may also be connected to a different network or in standby mode. In this case, due to the isolation of the network environment, the traditional screen projection method based on protocols such as DLNA will not work properly. The lack of an effective network connection between the mobile phone and the TV device makes wireless sharing of content impossible.
[0004] Therefore, there is an urgent need to develop a screen projection processing method, device, electronic device and storage medium to solve one or more of the above-mentioned problems. Summary of the invention
[0005] In view of this, in order to solve the above-mentioned technical problems or part of the technical problems, the embodiments of the present invention provide a screen projection processing method, device, electronic device and storage medium.
[0006] In a first aspect, the present application provides a screen projection processing method, the method comprising:
[0007] Receive a screen projection request, where the screen projection request is a screen projection request initiated by the first device to the second device through the first screen projection channel or the second screen projection channel, and the screen projection request carries device information and screen projection data of the second device;
[0008] Sending the screen projection request to the second device through a persistent connection based on the device information, so that the second device responds to the screen projection request and displays the screen projection data;
[0009] During the process of the second device displaying the projection data, the control instruction sent by the first device is received through the first projection channel or the second projection channel, and the control instruction is sent to the second device through a long connection, so that the second device executes the operation corresponding to the control instruction.
[0010] In a possible implementation, receiving a screen projection request includes:
[0011] A screen projection request sent by the first device is received through the first screen projection channel. The first screen projection channel is a data transmission channel between the first device and the second device established based on the first server. The first device establishes a long connection with the first server.
[0012] In a possible implementation, the method further includes:
[0013] Parsing the screen projection request to obtain device information of the second device;
[0014] Establishing a persistent connection between the second device and the first server according to the device information;
[0015] The first device and the second device are recorded in an online device list.
[0016] In a possible implementation, receiving a screen projection request includes:
[0017] A screen projection request sent by the second server is received through a second screen projection channel, wherein the screen projection request is generated by the first device and sent to the second server, and the second screen projection channel is a data transmission channel between the first device and the second device established based on the first server and the second server, and a Hypertext Transfer Protocol HTTP connection is established between the first device and the second server, and an HTTP connection is established between the second server and the first server.
[0018] In a possible implementation, the method further includes:
[0019] receiving a detection result of the second device status by the second server;
[0020] When the detection result is that the device is online, execute the step of sending the screen projection request to the second device through a long connection based on the device information.
[0021] In a possible implementation, the method further includes:
[0022] When it is detected that the state of the first device or the second device is offline, the online device list is updated to delete the offline device.
[0023] In a possible implementation manner, the first device is connected to a first network, and the second device is connected to a second network;
[0024] The first network and the second network may be of the same or different network types.
[0025] In a second aspect, the present application provides a screen projection processing device, the device comprising:
[0026] A first receiving module is used to receive a screen projection request, where the screen projection request is a screen projection request initiated by the first device to the second device through the first screen projection channel or the second screen projection channel, and the screen projection request carries device information and screen projection data of the second device;
[0027] A sending module, configured to send the screen projection request to the second device through a persistent connection based on the device information, so that the second device responds to the screen projection request and displays the screen projection data;
[0028] The second receiving module is used to receive the control instructions sent by the first device through the first projection channel or the second projection channel during the process of the second device displaying the projection data, and send the control instructions to the second device through a long connection, so that the second device executes the operation corresponding to the control instructions.
[0029] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the steps of the screen projection processing method described in any one of the embodiments of the first aspect are implemented.
[0030] In a fourth aspect, the present application also provides a computer storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the screen projection processing method described in any embodiment of the first aspect are implemented.
[0031] The above-mentioned technical scheme provided by the embodiment of the present application has the following advantages over the prior art: the screen projection processing method provided by the embodiment of the present application, after determining the screen projection receiving end, establishes a screen projection data transmission connection between the first device and the second device, which can not only realize the control operations of playing and pausing the second device, allowing the user to directly control the playback status of the second device on the first device, but also realize the synchronous update of the playback progress, ensuring that the user can maintain the consistency of the playback position when watching videos on the first device and the second device, thereby realizing content sharing between devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0034] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.
[0035] Figure 1 A flowchart of a screen projection processing method provided in an embodiment of the present application;
[0036] Figure 2 A connection diagram of the first screen projection channel provided in an embodiment of the present application;
[0037] Figure 3 A schematic diagram of device connection for the first screen projection channel provided in an embodiment of the present application;
[0038] Figure 4 A connection diagram of the second screen projection channel provided in an embodiment of the present application;
[0039] Figure 5 A schematic diagram of device connection for the second screen projection channel provided in an embodiment of the present application;
[0040] Figure 6 A schematic diagram of the structure of a screen projection processing device provided in an embodiment of the present application;
[0041] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0043] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.
[0044] In order to solve the technical problem in the prior art that the mobile phone may use the mobile network and the TV is not in the same local area network, resulting in the screen projection function being unusable, the present application provides a screen projection processing method, device, electronic device and storage medium, which can establish a screen projection channel that can complete the transmission of screen projection instructions, as a bridge for data interaction between the mobile phone and the TV. Through this screen projection channel, users can not only enjoy the convenience of remote control, but also play and pause the TV directly on the mobile phone, so as to control the viewing experience more freely. Furthermore, it also realizes the instant synchronization of the playback progress, ensuring that the user's viewing position can remain consistent whether watching the video on the mobile phone or the TV, realizing content sharing across devices and optimizing the screen projection experience.
[0045] Figure 1 A flowchart of a screen projection processing method provided in an embodiment of the present application is shown as follows: Figure 1 As shown, the method is applied to the first server, and the method specifically includes:
[0046] S101. Receive a screen projection request, where the screen projection request is a screen projection request initiated by the first device to the second device through the first screen projection channel or the second screen projection channel, and the screen projection request carries device information and screen projection data of the second device;
[0047] When a persistent connection is used, when an operation is completed, the TCP connection used to transmit data between the client and the server will not be closed. When the client accesses the server again, it will continue to use the established connection. This embodiment calls this server a persistent connection server. The persistent connection server does not maintain a connection permanently. It has a retention time, which can be set in different server software (such as Apache) so that the access during this period remains connected, thereby realizing a persistent connection between the client and the server.
[0048] In this embodiment, the first server may be a persistent connection server, the first device and the second device may be a client (such as a smart phone) and a receiving end (such as a TV), and the persistent connection server receives a screen projection request initiated from the client to the TV end;
[0049] Specifically, when a client initiates a screen projection request to a certain receiving end, the screen projection request carries the device identification information of the receiving end and all the screen projection data of this projection. The screen projection request will be sent to the persistent connection server. The persistent connection server acts as a transmission relay and forwards the screen projection request accurately to the target receiving end, thereby ensuring efficient and stable screen projection between the client and the receiving end.
[0050] It should be noted that when using a persistent connection, both the client and the server need to support persistent connection. In this embodiment, both the client (such as a smart phone) and the receiving end (such as a TV) support persistent connection operations.
[0051] S102, sending the screen projection request to the second device through a persistent connection based on the device information, so that the second device responds to the screen projection request and displays the screen projection data;
[0052] In this embodiment, after the screen projection is started, a persistent and stable long connection transmission channel is established between the second device and the first device. The first device accurately sends the screen projection request to the second device through the "long connection" communication method. After receiving the screen projection request, the second device quickly responds by displaying the screen projection data carried in the screen projection request on its display interface, thereby realizing the transmission and display of the screen projection information.
[0053] S103. During the process of the second device displaying the projection data, a control instruction sent by the first device is received through the first projection channel or the second projection channel, and the control instruction is sent to the second device through a long connection, so that the second device executes the operation corresponding to the control instruction.
[0054] In this embodiment, when the first device projects screen data such as videos, pictures or documents to the second device through a long connection, this is not just a simple transmission of data streams, but also an intelligent interaction between the two devices. In this process, the first device plays the role of a "commander", which can not only transmit data in real time, but also issue a series of operation instructions to the second device through a specific communication protocol; these operation instructions are received by the second device through the "long connection" communication method.
[0055] In this embodiment, the operation instructions sent by the first device to the second device may be operation instructions such as adjusting the brightness, contrast, volume of the projected image, or even switching different playback sources.
[0056] For example, in the field of education, teachers can remotely control the projection equipment in the classroom through mobile phones or tablets, easily switch teaching materials, and improve teaching efficiency; in business meetings, speakers can adjust the display effect of the projection screen through mobile phones anytime and anywhere to ensure that participants can clearly see the presentation content; in the field of smart homes, users can remotely control the smart TV or projector at home through mobile phones to enjoy a more convenient and comfortable viewing experience. Users can control and adjust the projection content anytime and anywhere without having to go to the second device in person to operate. Through an intuitive operating interface and simple command design, the remote control function can significantly reduce operation time and labor costs and improve work efficiency.
[0057] It should be noted that a two-way connection is established between the device and the server. Not only does the first device actively initiate a screen projection request to the second device, but the second device will also display the projection data according to the control instructions sent by the first device and will feed back the execution results of the projection control to the first device in real time, ensuring a high degree of synchronization and consistency in the playback content between the first device and the second device, thereby providing users with a smoother and seamless screen projection experience.
[0058] The screen projection processing method provided in this embodiment receives a screen projection request initiated by the first device to the second device through the first screen projection channel or the second screen projection channel, and then transmits the screen projection request to the second device through a stable and reliable long connection technology based on the device information of the second device, ensuring that the second device can accurately display all the screen projection data carried in the screen projection request, thereby presenting a complete and coherent visual presentation to the user. When the second device starts to display the screen projection data, it closely monitors any control instructions from the first device. Once an operation instruction is received, the control instruction is quickly and accurately transmitted to the second device through the established long connection channel to ensure that it can perform the corresponding operation immediately. Not only can the control operations of play and pause be realized, allowing users to directly control the playback status of the TV end on the mobile phone, but also the synchronous update of the playback progress can be realized, ensuring that the user can maintain consistency in the playback position when watching videos on the mobile phone and the TV end, thereby realizing content sharing between devices.
[0059] In an optional solution of the embodiment of the present invention, the receiving the screen projection request includes:
[0060] A screen projection request sent by the first device is received through the first screen projection channel. The first screen projection channel is a data transmission channel between the first device and the second device established based on the first server. The first device establishes a long connection with the first server.
[0061] In this embodiment, a first screen projection channel is established between the first device and the second device. The first screen projection channel is established based on the first server. A long connection relationship is established between the first server and the first device. Long connection is a commonly used technology in network communication. By maintaining the connection status between the client and the server, the overhead caused by frequent connection establishment is reduced, thereby improving the efficiency and real-time performance of data transmission. When the first device needs to project its screen content to the remote screen, it sends a screen projection request to the first server. This request contains all the screen projection data required for screen projection, such as screen resolution, frame rate, color depth, etc. This embodiment provides a smooth, convenient and reliable screen projection method by constructing a stable and efficient long connection relationship and combining the screen projection request processing flow.
[0062] Specifically, this embodiment provides a screen projection channel of a first device-first server-second device for communication without going through the business background. Generally speaking, data synchronization operations such as progress synchronization give priority to this screen projection method.
[0063] In an optional solution of the embodiment of the present invention, the method further includes:
[0064] Parsing the screen projection request to obtain device information of the second device;
[0065] In this implementation case, the screen request initiated by the first device carries the device identification information of the target screen projection object, that is, the device identification information of the second device, which ensures the accuracy of the screen projection object and facilitates the precise pairing and connection between devices in subsequent operations.
[0066] Establishing a persistent connection between the second device and the first server according to the device information;
[0067] In this embodiment, after determining the projection target corresponding to the first device, that is, the second device, a long connection relationship is established between the second device and the first server, so that a long connection projection channel exists between the first device and the second device, laying the foundation for the subsequent projection operation on the second device and ensuring the smoothness and efficiency of data transmission. By establishing such a connection relationship, the projection process can be managed more flexibly, achieving a richer and smoother visual presentation effect.
[0068] The first device and the second device are recorded in an online device list.
[0069] In this embodiment, a long connection mechanism is constructed, which enables the newly established long connection to be instantly recognized by the long connection server and registered in the online device database it maintains, ensuring real-time tracking and recording of the device status. Furthermore, if the long connection between the client and the server is interrupted, the long connection server will respond quickly and accurately remove the information of the device from the online device library to maintain the timeliness and accuracy of the database, optimize the management and allocation of resources, and significantly enhance the flexibility and reliability of video projection, thereby providing users with a smoother and more stable projection experience.
[0070] like Figures 2 to 3As shown, taking the first device as the client and the first server as the persistent connection server as an example, the client, including mobile phones and TV devices, will establish a persistent connection with the persistent connection server after startup, and maintain the persistent connection through a heartbeat mechanism. If a new persistent connection is established, the persistent connection server will record the device in the online device library; if the direct persistent connection between the client and the server is disconnected, the persistent connection server will delete the device from the online device library, and the persistent connection server will record the relationship between the device information and the persistent connection. When sending a message, the persistent connection can be found according to the device information, thereby sending the message through the persistent connection.
[0071] In an optional solution of the embodiment of the present invention, the receiving the screen projection request includes:
[0072] A screen projection request sent by the second server is received through a second screen projection channel, wherein the screen projection request is generated by the first device and sent to the second server, and the second screen projection channel is a data transmission channel between the first device and the second device established based on the first server and the second server, and a Hypertext Transfer Protocol HTTP connection is established between the first device and the second server, and an HTTP connection is established between the second server and the first server.
[0073] In this embodiment, a second screen projection channel is established between the first device and the second device. The second screen projection channel is jointly established based on the first server and the second server. The first device is connected to the first server through the second server. The second server may be a business server.
[0074] The first device initiates an HTTP request to the business server, informing the business server of what operation to perform on the second device. After receiving the request, the business server sends the request to the persistent connection server via an HTTP request, and the persistent connection server sends the request to the second device via a persistent connection.
[0075] Specifically, a data connection relationship based on the Hypertext Transfer Protocol (HTTP) is established between the first device and the second device. In order to ensure smooth data transmission and processing continuity, the second server and the first server are connected, and the HTTP protocol is also used to ensure the security and integrity of the projection data during transmission. Through the HTTP connection, the devices can exchange information efficiently, laying a solid foundation for the realization of the screen projection function and bringing users a more convenient and smooth screen projection experience.
[0076] like Figures 4 to 5As shown, taking the second server as a business server as an example, before screen projection, it is necessary to establish a binding relationship between the mobile phone and the TV, that is, a binding relationship between the first device and the second device. The device information of the mobile phone and the TV to be bound can be reported to the business background through various methods such as scanning the QR code of the TV. The business background records the device information binding relationship in the binding device library; if the client initiates a request to understand the binding, it will be deleted from the binding device library.
[0077] The binding relationship between the first device and the second device is many-to-many. For example, the binding relationship between a mobile phone and a TV is many-to-many. One mobile phone can be bound to multiple TVs; one TV can also be bound to multiple mobile phones.
[0078] The mobile phone initiates screen projection to the TV. After receiving the projection request, the TV plays the corresponding video according to the information in the projection request. After the projection is successful, the mobile phone can be used as a remote control to control the playback of the video on the TV, including pausing, dragging the progress bar, etc. In addition, the mobile phone and TV can synchronize information with each other, including playback progress.
[0079] In an optional solution of the embodiment of the present invention, the method further includes:
[0080] receiving a detection result of the second device status by the second server;
[0081] When the detection result is that the device is online, execute the step of sending the screen projection request to the second device through a long connection based on the device information.
[0082] In this embodiment, the second server can be a business server, and the business server can make decisions on the screen projection request, including authentication, flow control, distribution, etc.; receive the detection result of the network status of the second device from the second server, and reflect the current network status of the second device through the detection result; when the detection result indicates that the device is online, quickly execute the step of sending the screen projection request to the second device through a long connection based on the device information, and send the screen projection request to the second device accurately.
[0083] For example, when a mobile phone is projecting the screen to a TV, the mobile phone will first check the list of bound TVs and select the TV to be projected from it; at the same time, it will query the persistent connection server for the online status of the TV. If it is not online, the screen cannot be projected, but if it is online, the screen can be projected.
[0084] It should be noted that the network status involved in this embodiment is not limited to a simple connection or disconnection state, but can also be a network delay state. The network connection state, as a decisive factor in data transmission efficiency and quality, is directly related to and affects the smoothness of the screen projection operation. Specifically, when the network connection is in good condition, data transmission will be faster and more stable, thereby ensuring smooth screen projection operation; on the contrary, if the network delay is serious or the connection is unstable, it may cause data transmission to be blocked, thereby affecting the real-time performance and user experience of the screen projection.
[0085] For example, suppose you use a smart TV at home for a remote meeting, and use a mobile device as the screen projection source to project the conference screen onto the TV in real time. At this time, the system continuously monitors the network status of the smart TV through a built-in detection mechanism. Once it finds that the smart TV is online and the network condition is good, the system immediately starts the screen projection process and uses the established long connection channel to transmit the conference screen to the TV with nearly lossless quality, ensuring the smooth progress of the meeting without being disturbed by network fluctuations.
[0086] Specifically, this embodiment provides a screen projection channel for communication between a first device, a second server, a first server and a second device. The first device initiates an HTTP request to the business background to inform the second server of which device to perform what operation on. After receiving the request, the second server sends the request to the first server via an HTTP request, and the first server sends the request to another client via a long connection. Generally speaking, control requests such as screen projection, screen projection, and broadcast control give priority to the screen projection channel.
[0087] In an optional solution of the embodiment of the present invention, the method further includes:
[0088] When it is detected that the state of the first device or the second device is offline, the online device list is updated to delete the offline device.
[0089] In this embodiment, when the system detects that the status of the first device or the second device is offline, it executes the operation of updating the current online device list to ensure the real-time and accuracy of the list, and removes the devices that have been disconnected from the network from the list, so that the user can clearly understand the connectable devices that are currently online, thereby optimizing the efficiency of screen projection task allocation; not only does it maintain the neatness and orderliness of the device list, but it also ensures that subsequent operations and instructions can be accurately conveyed to all online devices, thereby improving the efficiency and stability of the entire screen projection operation.
[0090] In an optional solution of the embodiment of the present invention, the first device is connected to a first network, and the second device is connected to a second network;
[0091] The first network and the second network may be of the same or different network types.
[0092] In this embodiment, since the first device and the second device are connected through the first server / first server-second server, the network types of the first device and the second device may be different;
[0093] For example, the first device may be under the coverage of a mobile network, while the second device may be connected to a wireless network environment. At this time, the first device establishes a connection with the server through the mobile network channel, while the second device realizes data interconnection with the server through the wireless network. The difference in connection methods does not affect the data transmission between the device and the server, and data projection can still be realized between the first device and the second device.
[0094] It should be noted that even if the first device and the second device both choose wireless network as the network connection method, they may not be in the same local area network, which greatly broadens the connection possibilities between devices and brings a more flexible and convenient user experience to users.
[0095] This embodiment provides two screen projection channels: first device-first server-second device, and first device-second server-first server-second device. These two screen projection channels have their own advantages and disadvantages. The request time of channel two is higher than that of channel one, and there is an additional business background, which requires more resources. However, the request of channel two can be decided by the business background, including authentication, flow control, distribution, etc.; generally speaking, control requests such as screen projection and broadcast control can give priority to channel two, while data synchronization operations such as progress synchronization can give priority to channel one.
[0096] Figure 6 A schematic diagram of the structure of another screen projection processing device provided in an embodiment of the present application, such as Figure 6 As shown, the device specifically includes:
[0097] The first receiving module 601 is used to receive a screen projection request, where the screen projection request is a screen projection request initiated by the first device to the second device through the first screen projection channel or the second screen projection channel, and the screen projection request carries device information and screen projection data of the second device;
[0098] A sending module 602 is used to send the screen projection request to the second device through a persistent connection based on the device information, so that the second device responds to the screen projection request and displays the screen projection data;
[0099] The second receiving module 603 is used to receive the control instruction sent by the first device through the first projection channel or the second projection channel during the process of the second device displaying the projection data, and send the control instruction to the second device through a long connection, so that the second device executes the operation corresponding to the control instruction.
[0100] In a possible implementation, the first receiving module 601 is further used to receive a screen projection request sent by a first device, and the first device establishes a long connection with the first server.
[0101] In one possible implementation, the device also includes a first establishment module 604, which is used to parse the screen projection request to obtain device information of the second device; establish a long connection between the second device and the first server based on the device information; and record the first device and the second device in an online device list.
[0102] In one possible implementation, the first receiving module 601 is also used to receive a screen projection request sent by the second server, where the screen projection request is generated by the first device and sent to the second server, and a Hypertext Transfer Protocol HTTP connection is established between the first device and the second server, and an HTTP connection is established between the second server and the first server.
[0103] In one possible implementation, the device also includes a detection module 605, which receives a detection result of the second server on the status of the second device; when the detection result is that the device is online, executes the step of sending the screen projection request to the second device through a long connection based on the device information.
[0104] In a possible implementation manner, the apparatus further includes a deleting module 606, which updates the online device list to delete the offline device when it is detected that the status of the first device or the second device is offline.
[0105] The intelligent recommendation system provided in this embodiment can be as follows Figure 6 The screen projection processing device shown in can execute the following steps: Figure 1-5 All the steps of the projection screen processing are realized Figure 1-5 For details, please refer to the technical effect of screen projection processing shown in the figure. Figure 1-5 For the sake of brevity, the relevant description is not repeated here.
[0106] The system embodiment described above is merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0107] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Figure 7As shown, an embodiment of the present application provides an electronic device, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704; the memory 703 is used to store computer programs; the processor 701 is used to execute the program stored in the memory 703, and implement the steps of the screen projection processing method provided by any of the aforementioned method embodiments:
[0108] Receive a screen projection request, where the screen projection request is initiated by the first device to the second device through the first screen projection channel or the second screen projection channel, and the screen projection request carries the device information of the second device and the screen projection data; based on the device information, send the screen projection request to the second device through a long connection, so that the second device responds to the screen projection request and displays the screen projection data; while the second device is displaying the screen projection data, receive a control instruction sent by the first device through the first screen projection channel or the second screen projection channel, and send the control instruction to the second device through a long connection, so that the second device executes the operation corresponding to the control instruction.
[0109] In a possible implementation, a screen projection request sent by a first device is received, and the first device establishes a long connection with the first server.
[0110] In one possible implementation, the screen projection request is parsed to obtain device information of the second device; a long connection is established between the second device and the first server based on the device information; and the first device and the second device are recorded in an online device list.
[0111] In one possible implementation, a screen projection request sent by a second server is received, where the screen projection request is generated by a first device and sent to a second server, a Hypertext Transfer Protocol (HTTP) connection is established between the first device and the second server, and an HTTP connection is established between the second server and the first server.
[0112] In one possible implementation, a detection result of the second device status by the second server is received; when the detection result is that the device is online, the step of sending the screen projection request to the second device through a long connection based on the device information is executed.
[0113] In a possible implementation, when it is detected that the status of the first device or the second device is offline, the online device list is updated to delete the offline device.
[0114] In a possible implementation manner, the first device is connected to a first network, and the second device is connected to a second network; the first network and the second network are of the same or different network types.
[0115] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0116] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments, and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described herein are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.
[0117] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A screen projection processing method, applied to a first server, characterized in that: include: Receive a screen projection request, where the screen projection request is a screen projection request initiated by the first device to the second device through the first screen projection channel or the second screen projection channel, and the screen projection request carries device information and screen projection data of the second device; Sending the screen projection request to the second device through a persistent connection based on the device information, so that the second device responds to the screen projection request and displays the screen projection data; During the process of the second device displaying the projection data, the control instruction sent by the first device is received through the first projection channel or the second projection channel, and the control instruction is sent to the second device through a long connection, so that the second device executes the operation corresponding to the control instruction.
2. The method according to claim 1, characterized in that The receiving of the screen projection request comprises: A screen projection request sent by the first device is received through the first screen projection channel. The first screen projection channel is a data transmission channel between the first device and the second device established based on the first server. The first device establishes a long connection with the first server.
3. The method according to claim 2, characterized in that The method further comprises: Parsing the screen projection request to obtain device information of the second device; Establishing a persistent connection between the second device and the first server according to the device information; The first device and the second device are recorded in an online device list.
4. The method according to claim 1, characterized in that: The receiving of the screen projection request comprises: A screen projection request sent by the second server is received through a second screen projection channel, wherein the screen projection request is generated by the first device and sent to the second server, and the second screen projection channel is a data transmission channel between the first device and the second device established based on the first server and the second server, and a Hypertext Transfer Protocol HTTP connection is established between the first device and the second server, and an HTTP connection is established between the second server and the first server.
5. The method according to claim 4, characterized in that The method further comprises: receiving a detection result of the second device status by the second server; When the detection result is that the device is online, execute the step of sending the screen projection request to the second device through a long connection based on the device information.
6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: When it is detected that the state of the first device or the second device is offline, the online device list is updated to delete the offline device.
7. The method according to claim 6, characterized in that The first device is connected to a first network, and the second device is connected to a second network; The first network and the second network may be of the same or different network types.
8. A screen projection processing device, characterized in that: include: A first receiving module is used to receive a screen projection request, where the screen projection request is a screen projection request initiated by the first device to the second device through the first screen projection channel or the second screen projection channel, and the screen projection request carries device information and screen projection data of the second device; A sending module, configured to send the screen projection request to the second device through a persistent connection based on the device information, so that the second device responds to the screen projection request and displays the screen projection data; The second receiving module is used to receive the control instructions sent by the first device through the first projection channel or the second projection channel during the process of the second device displaying the projection data, and send the control instructions to the second device through a long connection, so that the second device executes the operation corresponding to the control instructions.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the screen projection processing method described in any one of claims 1 to 7 are implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the screen projection processing method described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Equipment binding method and system, storage medium and electronic device
CN121284083A
