Wireless screen projection method, system and server in group scene
By using FRP technology and blocking queue management, the problem of wireless screen projection being limited by the local area network was solved, enabling reliable access and multi-user management of wireless screen projection under the wide area network, thus improving the screen projection experience.
Patent Information
- Application Number
- CN202411454945.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2025-01-07
AI Technical Summary
In group scenarios, wireless screen mirroring is limited by the local area network, and files can easily be overwritten after multiple mirroring attempts, affecting the mirroring experience.
FRP technology is used for local area network penetration, and screen projection tasks are managed through blocking queues and blocking policies to ensure that screen projection operations are performed when the large screen is not occupied.
It enables wireless screen mirroring access over a wide area network, preventing file overwriting issues when multiple users mirror their screens, and improving the reliability and management efficiency of screen mirroring.
Smart Images

Figure CN119277562A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network communications, and in particular to a wireless screen projection method, system and server in a group scenario. Background Art
[0002] With the rapid development of science and technology, screen projection plays an increasingly important role in work and life. Using screen projection technology at work can effectively improve the efficiency of meetings and ensure the accuracy of information transmission during communication. Using screen projection technology in life can meet the needs of family viewing and entertainment, and obtain a better visual experience through large-screen devices.
[0003] At present, the mainstream file projection technology is divided into wired and wireless. Wired includes direct connection through hardware interfaces such as HDMI, USB, and VGA, while wireless includes third-party projection software, screen mirroring, and other methods. According to the development trend of existing mobile phones and laptops, the size of devices is getting smaller and smaller, and the number of interfaces is gradually decreasing. Wired projection often requires external converters for interface expansion, so wireless projection is more convenient, but wireless projection often requires large-screen devices to be in the same local area network as mobile phones or computer devices, and remote projection has great limitations. In addition, in group scenarios such as office meetings or families, the files projected in front will be immediately overwritten by the files projected later. Once accidentally touched, it will greatly affect the projection experience.
[0004] Therefore, there is an urgent need for a wireless screen projection method for group scenarios that can solve the above problems. Summary of the invention
[0005] In order to address the deficiencies of the prior art, the present application provides a method, system and server for wireless screen projection in a group scenario, which solves the problem that wireless screen projection in a group scenario is limited by the local area network and multiple projection files are overwritten, greatly improving the limitations of wireless screen projection.
[0006] The technical effects to be achieved by this application are achieved through the following solutions:
[0007] According to a first aspect of the present application, a wireless screen projection method in a group scenario is provided, comprising the following steps:
[0008] Step 1: When a client triggers an event of screen projection to an electronic device, the network environment of the current client is detected;
[0009] Step 2: Select a corresponding connection method according to the network environment to send a screen projection instruction, including: if the client and the electronic device are in the same local area network, directly send the screen projection instruction; if they are not in the same local area network environment, establish a connection through the frp channel and send the screen projection instruction to the electronic device;
[0010] Step 3: Add the screen projection task of the electronic device to a blocking queue according to the screen projection instruction, and execute the screen projection task according to the blocking queue and the corresponding blocking strategy, and display it on the display device.
[0011] Preferably, in step 1, detecting the network environment of the current client includes: detecting whether the current client can access the network normally, and if not, a pop-up window is displayed to inform that the screen projection fails:
[0012] If the network can be accessed normally, determine whether the client and the electronic device are currently in the same local area network, and proceed to step 2 based on the determination result.
[0013] Preferably, in step 2, it is determined whether the current client is connected to a wifi network. If so, it is connected via the LAN IP and port number. If it can be pinged, it is considered that the client and the electronic device are in the same LAN environment, otherwise they are not in the same LAN environment.
[0014] Preferably, the specific method of establishing a connection through the frp channel is:
[0015] The client sends a request to the public network server to open the frp service channel;
[0016] The public network server generates the frp access address and sends it to the client and electronic device respectively;
[0017] The electronic device opens the frpc client according to the frp address, connects to the frps server of the public network server, and feeds back the opening status of the frpc client to the public network server;
[0018] The client periodically polls the frp address and connects to the electronic device through the public network server after the frpc client is turned on.
[0019] Preferably, in step 3, the initial value of the blocking queue is set, and the size of the blocking queue can be dynamically changed according to the screen projection requirements; the data structure HashSet is selected to store all fid information for comparison and judgment, thereby ensuring that the data query complexity is minimized.
[0020] Preferably, the blocking strategy includes:
[0021] When the number of nodes in the blocking queue exceeds the threshold, the earliest projected file or the current projected file is discarded, and a prompt indicating that the projection failed;
[0022] When adding a screen projection task, determine whether there is a duplicate task in the blocking queue. If not, add a new node at the end of the blocking queue and store the screen projection file; if it already exists, discard this task;
[0023] When the projection task is placed at the top, the corresponding node is searched in the blocking queue, and then the node is set as the head node;
[0024] When deleting a screen projection task, find the corresponding node in the blocking queue, point the predecessor node of the node to be deleted to the successor node of the node to be deleted, and clear the pointer of the current node.
[0025] Preferably, when adding a screen projection task, check the screen projection flag. If the screen projection flag is false, there is no screen projection file at present, and the screen projection file is directly displayed, and the screen projection flag is set to true; if the screen projection flag is true, there is a screen projection file at present, and the screen projection task is added to the blocking queue.
[0026] Preferably, after the screen projection is successful, the exit screen projection event is monitored in real time to determine whether the blocking queue is empty. If it is empty, the screen projection flag is set to false, otherwise the screen projection tasks in the blocking queue are projected in order;
[0027] During the screen projection process, if the client is in the same LAN, the playback parameters of the display device are controlled through the UDP protocol;
[0028] If the client is not in the same LAN, the playback parameters of the display device can be remotely controlled via the HTTP protocol.
[0029] According to a second aspect of the present application, a wireless screen projection system using the wireless screen projection method in the above group scenario is provided, including a client, a network status detection module, a screen projection information processing module and a display device, wherein:
[0030] The client is used to trigger a screen projection event;
[0031] The network status detection module is installed in the client and is used to detect the network environment of the current client and select a corresponding connection method according to the network environment to send a screen projection instruction, including: if it is in the same local area network, directly send the screen projection instruction; if it is in a different local area network environment, send the screen projection instruction after establishing a connection through the frp channel;
[0032] The screen projection information processing module is installed in an electronic device connected to the display device, and is used to add the client's screen projection task to a blocking queue according to the screen projection instruction, and send the screen projection task to the display device for screen projection according to the blocking queue and the corresponding blocking strategy.
[0033] According to a third aspect of the present application, there is provided a server, comprising: a memory and at least one processor;
[0034] The memory stores a computer program, and the at least one processor executes the computer program stored in the memory to implement the wireless screen projection method in the above-mentioned group scenario.
[0035] According to an embodiment of the present application, the beneficial effect of the wireless screen projection method in the group scenario of the present application is: the FRP technology is used to penetrate the local area network to achieve wide area network access of the wireless screen projection function, which solves the problem that the screen cannot be projected in non-local area networks in traditional wireless screen projection;
[0036] A blocking strategy is adopted for screen projection. Screen projection is performed only when the current large screen is monitored to be in a non-occupied state, thereby preventing accidental touches of the screen. This effectively realizes multi-user screen projection management and solves the problem that the previously projected files will be overwritten by the later projected files in the case of multi-user screen projection. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the embodiments of the present application or the existing technical solutions, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0038] Figure 1 This is a flow chart of a wireless screen projection method in a group scenario in one embodiment of the present application;
[0039] Figure 2 This is a structural block diagram of a wireless screen projection system in a group scenario in one embodiment of the present application;
[0040] Figure 3 This is a structural block diagram of a server in an embodiment of the present application. DETAILED DESCRIPTION
[0041] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only 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 the field without creative work are within the scope of protection of the present application.
[0042] like Figure 1 As shown, the wireless screen projection method in a group scenario in an embodiment of the present application includes the following steps:
[0043] Step 1: When a client triggers a screen projection event, that is, when the client sends a screen projection command to an electronic device, the network environment of the current client is detected;
[0044] In this step, the client is a mobile device such as a mobile phone, tablet computer, laptop computer, etc. with a screen projection APP installed, which can connect to a wireless network or a wired network. The following embodiments all use a mobile phone as the client.
[0045] A display device such as a television, a projector, etc. is connected to an electronic device, such as a "China Unicom Cloud Box" which stores a number of files to be projected. The electronic device is connected to the display device via a hardware interface HDMI, so that a projection command can be issued through a mobile phone to notify the electronic device to output to the large screen for display via HDMI.
[0046] When the screen casting button is clicked on the APP, the screen casting event is triggered, and the client detects the current network environment.
[0047] Step 2: Select a corresponding connection method according to the network environment to send a screen projection instruction, including: if the client and the electronic device are in the same local area network, directly send the screen projection instruction; if they are not in the same local area network environment, establish a connection through the frp channel and send the screen projection instruction to the screen end;
[0048] In this step, the APP detects the current network environment of the mobile phone and determines whether it can access the network normally. If not, it is in a state of being unable to access the network, and a pop-up window informs the user that the screen projection has failed. If it can, it determines whether it is a local area network.
[0049] Determine whether the network used by the APP is a Wi-Fi wireless network: If so, further determine whether the APP and the electronic device are in the same local area network; if not, it can be considered that the APP is using a traffic network and is not in the same local area network;
[0050] When in a Wi-Fi wireless network, the mobile phone APP actively connects to the network through the LAN IP and port number (default 80) of the electronic device: if it can ping, it is considered that the APP and the electronic device are in the same LAN, and the APP sends the screen projection command to the electronic device through the proximal network (LAN); if it cannot connect successfully, it means that they are not in the same LAN environment;
[0051] When in a non-LAN environment or a traffic network environment, the client first establishes a remote network (non-LAN) connection channel with the device to be connected through the frp reverse proxy technology, and then the client communicates with the connected device through the frp channel: if it can be pinged, it is considered that the LAN penetration between the client and the electronic device is successful, and the client sends a screen projection command to the electronic device through the remote network; if it cannot be pinged, the user is informed that the screen projection has failed.
[0052] The specific method of establishing a connection through the frp channel is:
[0053] The client sends a request to open the frp service channel to the public network server, which has a built-in frp application and is the frps server;
[0054] The public network server generates the frp access address and sends it to the client and the electronic device respectively. The electronic device has the frp application installed, which is the frpc client.
[0055] The electronic device opens the frpc client according to the frp address, connects to the frps server of the public network server, and feeds back the opening status of the frpc client to the public network server;
[0056] The client periodically polls the frp address to maintain the availability of the channel; according to the frp address, the electronic device is connected through the public network server after the frpc client is turned on.
[0057] Step 3: Add the client's screen projection task to a blocking queue according to the screen projection instruction, and project the screen projection task according to the blocking queue and the corresponding blocking strategy.
[0058] In this step, in order to ensure the operating performance of the electronic device and the idempotence of the screen projection message, the structure and maximum length of the blocking queue are first defined;
[0059] The structure of the blocking queue is a linked list structure, which can make more flexible use of memory space and facilitate the insertion or deletion of nodes. When managing screen projection messages, the screen projection tasks can be efficiently deleted or pinned by operating the pointer to a specific node.
[0060] By default, the length of the blocking queue is set to 5. Administrators in the user group bound to the same device to be connected can dynamically change the size of the blocking queue according to screen projection requirements, with a maximum of no more than 15 and a minimum of no less than 0.
[0061] To ensure the idempotence of the task, the data structure HashSet is selected to store all fid information for comparison and judgment, thereby ensuring the lowest complexity of data query.
[0062] The fid information is the file index number, which is used to identify each file. The fid information of each file is unique and non-repetitive. The data structure HashSet is implemented using a hash table. When querying data, the location where the data is stored can be directly located based on the hash value of the data.
[0063] To ensure that the screen projection task can be properly processed at any time, a blocking strategy is defined, mainly including:
[0064] When the number of nodes in the blocking queue exceeds the threshold, the administrator can set the earliest projected file to be discarded or the currently projected file to be discarded. By default, the currently projected file is discarded and the user is prompted that the projection has failed.
[0065] When adding a screen projection task, check whether there is a duplicate task in the blocking queue. If not, add a message node to the end of the linked list queue to store the fid information of the screen projection file. If it already exists, discard this task to avoid repeatedly projecting the same file and occupying resources.
[0066] When placing the projection task on top, first find the corresponding node in the current linked list, and then set the node as the head node;
[0067] When deleting a screen projection task, first find the corresponding node in the current linked list, point the predecessor node of the node to be deleted to the successor node of the node to be deleted, and clear the pointer of the current node.
[0068] In the above blocking strategy, when a new screen projection task enters the blocking queue, the screen projection flag is checked. If the screen projection flag is false, there is no screen projection file at present, and the screen projection file can be directly displayed without joining the queue. At the same time, the screen projection flag is set to true; if the screen projection flag is true, there is a screen projection file at present, and the screen projection task is added to the blocking queue, waiting for the large screen to be released before processing the information.
[0069] After the screen is successfully projected, monitor the occurrence of the event of the large screen exiting the projection page in real time, and then determine whether the blocking queue is empty: if so, set the projection flag to false and the process ends; otherwise, consume the messages in the blocking queue in sequence, send an interrupt request signal to the CPU, and the CPU schedules the main thread to process the head node information in the blocking queue;
[0070] When the number of messages in the blocking queue (i.e. the number of screen projection tasks) is greater than 0, group users can view the list of files to be projected in the APP. The administrator can pin or cancel the screen projection task of any member, and group members can only cancel their own screen projection tasks.
[0071] During the screen projection process, if the client is in the same LAN, the playback parameters of the display device are controlled through the UDP protocol;
[0072] If the client is not in the same LAN, the playback parameters of the display device can be remotely controlled via HTTP protocol;
[0073] The playback parameters include, for example, playback pause, volume increase / decrease, fast forward / rewind, etc.
[0074] like Figure 2As shown, a wireless screen projection system using the wireless screen projection method in the above group scenario includes a client, a network status detection module, a screen projection information processing module and a display device, wherein:
[0075] The client, such as a mobile phone APP, stores the files that need to be projected and is bound to the electronic device to trigger the projection event; the client scans the QR code on the electronic device for binding to confirm the target to which the current client needs to project the screen.
[0076] The network status detection module is installed in the client and is used to detect the network environment of the current client and select a corresponding connection method according to the network environment to send a screen projection instruction, including: if it is in the same LAN, directly send the screen projection instruction; if it is in a different LAN environment, send the screen projection instruction after establishing a connection through the frp channel;
[0077] The screen projection information processing module is installed in the electronic device connected to the display device. The electronic device is connected to the TV or computer display screen output via the HDMI interface. A number of files to be projected are stored in the electronic device. The module is bound to the mobile phone APP and controlled using the mobile phone APP. After selecting the file to be projected, the screen projection task of the client is added to the blocking queue according to the screen projection instruction, and the screen projection task is sent to the display device according to the blocking queue and the corresponding blocking strategy to control the display device to display;
[0078] Display devices, such as televisions, have large screens with display functions.
[0079] like Figure 3 As shown, the server in an embodiment of the present application includes: a memory 301 and at least one processor 302;
[0080] The memory 301 stores a computer program, and the at least one processor 302 executes the computer program stored in the memory 301 to implement the wireless screen projection method in the above-mentioned group scenario.
[0081] According to an embodiment of the present application, the beneficial effect of the wireless screen projection method in the group scenario of the present application is: the FRP technology is used to penetrate the local area network to achieve wide area network access of the wireless screen projection function, which solves the problem that the screen cannot be projected in non-local area networks in traditional wireless screen projection;
[0082] A blocking strategy is adopted for screen projection. Screen projection is performed only when the current large screen is monitored to be in a non-occupied state, thereby preventing accidental touches of the screen. This effectively realizes multi-user screen projection management and solves the problem that the previously projected files will be overwritten by the later projected files in the case of multi-user screen projection.
[0083] It should be noted that the above detailed descriptions are exemplary and are intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the art to which the present application belongs.
[0084] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should also be understood that when the terms "comprise" and / or "include" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0085] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein.
[0086] In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or inherent to these processes, methods, products, or apparatuses.
[0087] For ease of description, spatially relative terms, such as "above", "above", "on the upper surface of", "above", etc., may be used herein to describe the spatial positional relationship between a device or feature and other devices or features as shown in the figure. It should be understood that spatially relative terms are intended to include different orientations of the device in use or operation in addition to the orientation described in the figure. For example, if the device in the accompanying drawings is inverted, the device described as "above other devices or structures" or "above other devices or structures" will be positioned as "below other devices or structures" or "below other devices or structures". Thus, the exemplary term "above" may include both "above" and "below". The device may also be positioned in other different ways, such as rotated 90 degrees or in other orientations, and the spatially relative descriptions used herein are interpreted accordingly.
[0088] In the above detailed description, reference is made to the accompanying drawings, which form a part of this document. In the accompanying drawings, similar symbols typically identify similar components unless the context indicates otherwise. The illustrated embodiments described in the detailed description, drawings, and claims are not meant to be limiting. Other embodiments may be used, and other changes may be made, without departing from the spirit or scope of the subject matter presented herein.
[0089] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A wireless screen projection method in a group scenario, characterized in that: The steps include: Step 1: When a client triggers an event of screen projection to an electronic device, the network environment of the current client is detected; Step 2: Select a corresponding connection method according to the network environment to send a screen projection instruction, including: directly sending a screen projection instruction if the client and the electronic device are in the same local area network; If the two devices are not in the same LAN environment, the screen projection command is sent to the electronic device after establishing a connection through the frp channel; Step 3: Add the screen projection task of the electronic device to a blocking queue according to the screen projection instruction, and execute the screen projection task according to the blocking queue and the corresponding blocking strategy, and display it on the display device.
2. The wireless screen projection method in a group scenario according to claim 1, characterized in that: In step 1, detecting the network environment of the current client includes: detecting whether the current client can access the network normally, and if not, a pop-up window will be displayed to inform that the screen projection fails: If the network can be accessed normally, determine whether the client and the electronic device are currently in the same local area network, and proceed to step 2 based on the determination result.
3. The wireless screen projection method in a group scenario according to claim 2, characterized in that: In step 2, determine whether the current client is connected to the WiFi network. If so, connect through the LAN IP and port number. If it can be pinged, it is considered that the client and the electronic device are in the same LAN environment, otherwise they are not in the same LAN environment.
4. The wireless screen projection method in a group scenario according to claim 1, characterized in that: The specific method of establishing a connection through the frp channel is: The client sends a request to the public network server to open the frp service channel; The public network server generates the frp access address and sends it to the client and electronic device respectively; The electronic device opens the frpc client according to the frp address, connects to the frps server of the public network server, and feeds back the opening status of the frpc client to the public network server; The client periodically polls the frp address after the frpc client is turned on. If connectivity is established, the client connects to the electronic device through the public network server.
5. The wireless screen projection method in a group scenario according to claim 1, characterized in that: In step 3, set the structure and initial value of the blocking queue, select a data structure linked list to store the order of projection files, and dynamically change the size of the blocking queue according to the projection requirements; select the data structure HashSet to store all fid information for comparison and judgment, so as to ensure the lowest complexity of data query.
6. The wireless screen projection method in a group scenario according to claim 5, characterized in that: The blocking strategies include: When the number of nodes in the blocking queue exceeds the threshold, the earliest projected file or the current projected file is discarded, and a prompt indicating that the projection failed; When adding a screen projection task, determine whether there is a duplicate task in the blocking queue. If not, add a new node at the end of the blocking queue and store the screen projection file; if it already exists, discard this task; When the projection task is placed at the top, the corresponding node is searched in the blocking queue, and then the node is set as the head node; When deleting a screen projection task, find the corresponding node in the blocking queue, point the predecessor node of the node to be deleted to the successor node of the node to be deleted, and clear the pointer of the current node.
7. The wireless screen projection method in a group scenario according to claim 6, characterized in that: When adding a screen projection task, check the screen projection flag. If the screen projection flag is false, there is currently no screen projection file, and the screen projection file is displayed directly, and the screen projection flag is set to true; if the screen projection flag is true, there is currently a screen projection file, and the screen projection task is added to the blocking queue.
8. The wireless screen projection method in a group scenario according to claim 7, characterized in that: After the screen is successfully projected, the exit screen projection event is monitored in real time to determine whether the blocking queue is empty. If it is empty, the screen projection flag is set to false. Otherwise, the screen projection tasks in the blocking queue are projected in order. During the screen projection process, if the client is in the same LAN, the playback parameters of the display device are controlled through the UDP protocol; If the client is not in the same LAN, the playback parameters of the display device can be remotely controlled via the HTTP protocol.
9. A wireless screen projection system using the wireless screen projection method in a group scenario according to any one of claims 1 to 8, characterized in that: It includes a client, a network status detection module, a screen projection information processing module and a display device, wherein: The client is used to trigger a screen projection event; The network status detection module is installed in the client and is used to detect the network environment of the current client and select a corresponding connection method according to the network environment to send a screen projection instruction, including: if it is in the same local area network, directly send the screen projection instruction; if it is in a different local area network environment, send the screen projection instruction after establishing a connection through the frp channel; The screen projection information processing module is installed in an electronic device connected to the display device, and is used to add the client's screen projection task to a blocking queue according to the screen projection instruction, and send the screen projection task to the display device for screen projection according to the blocking queue and the corresponding blocking strategy.
10. A server, characterized in that: include: memory and at least one processor; The memory stores a computer program, and the at least one processor executes the computer program stored in the memory to implement the wireless screen projection method in a group scenario as described in any one of claims 1 to 8.