CN114793291B - IOS multi-device real-time screen projection method, system, computer device and storage medium - Google Patents

IOS multi-device real-time screen projection method, system, computer device and storage medium Download PDF

Info

Publication number
CN114793291B
CN114793291B CN202210088863.3A CN202210088863A CN114793291B CN 114793291 B CN114793291 B CN 114793291B CN 202210088863 A CN202210088863 A CN 202210088863A CN 114793291 B CN114793291 B CN 114793291B
Authority
CN
China
Prior art keywords
information
connection
screen
equipment
throwing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210088863.3A
Other languages
Chinese (zh)
Other versions
CN114793291A (en
Inventor
李盛
陈可立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ruan Niu Technology Group Co ltd
Original Assignee
Afirstsoft Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Afirstsoft Co Ltd filed Critical Afirstsoft Co Ltd
Priority to CN202210088863.3A priority Critical patent/CN114793291B/en
Publication of CN114793291A publication Critical patent/CN114793291A/en
Application granted granted Critical
Publication of CN114793291B publication Critical patent/CN114793291B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4122Peripherals receiving signals from specially adapted client devices additional display device, e.g. video projector
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/436Interfacing a local distribution network, e.g. communicating with another STB or one or more peripheral devices inside the home
    • H04N21/43615Interfacing a Home Network, e.g. for connecting the client to a plurality of peripherals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses an IOS multi-device real-time screen projection method, a system, a computer device and a storage medium, wherein the method comprises the following steps: broadcasting information is put into a local area network, and equipment terminals connected to the local area network are all connected with a screen throwing device in an initializing mode through corresponding broadcasting information; respectively creating corresponding screen throwing objects in the screen throwing device according to the equipment information of each equipment terminal, setting parameters, and pairing each screen throwing object with the corresponding equipment terminal; and acquiring basic information and connection information of the equipment terminal through a setup request, and performing video connection and audio connection on the equipment terminal and a screen throwing object according to the basic information and the connection information of the equipment terminal. According to the invention, the screen-throwing objects corresponding to each equipment terminal are established on the screen-throwing device, so that the plurality of equipment terminals are thrown to the same screen-throwing device through the plurality of screen-throwing objects, and the function of IOS multi-equipment screen throwing is realized.

Description

IOS multi-device real-time screen projection method, system, computer device and storage medium
Technical Field
The invention relates to the technical field of equipment screen projection, in particular to an IOS multi-equipment real-time screen projection method, an IOS multi-equipment real-time screen projection system, computer equipment and a storage medium.
Background
As IOS4.2 and OS X Mountain Lion begin to add Airplay to the IOS and MACOS systems and begin to support video mirroring at IOS 5, play can be performed using Apple TV, MAC computers, etc. on Airplay-supporting devices.
Under the same local area network, a user can click a screen mirror image to select proper screen throwing equipment by using a control center of iPhone, iPod, iPad, MAC equipment, so that the equipment can conveniently perform wireless screen throwing. The user can use the larger screen to display the content on the mobile phone, play movies, display meetings and record the screen of the mobile phone. And can support simultaneous performance, demonstration, recording and playing of a plurality of IOS or MAC devices. Because Apple does not use the disclosed document of the corresponding screen-throwing protocol, the software supporting the IOS screen throwing under the Windows platform is relatively less, and no software can support a plurality of IOS or MAC devices to simultaneously throw the screen.
In the prior art, a plurality of IOS devices are connected simultaneously, so that the phenomenon that the previous connection is interrupted or the subsequent connection is refused and cannot be connected due to the switching of the connection of the IOS devices is caused, the support of a plurality of IOS devices cannot be realized, and a user can only connect other IOS devices after disconnecting the current IOS device or prepare a plurality of devices or software supporting the Airplay for multi-device screen throwing.
Disclosure of Invention
The embodiment of the invention provides an IOS multi-device real-time screen-throwing method, an IOS multi-device real-time screen-throwing system, computer equipment and a storage medium, and aims to solve the problem that in the prior art, the IOS cannot realize multi-device screen-throwing under a Windows platform.
In a first aspect, an embodiment of the present invention provides an IOS multi-device real-time screen projection method, including:
broadcasting information is put into a local area network, and equipment terminals connected to the local area network are all connected with a screen throwing device in an initializing mode through corresponding broadcasting information;
respectively creating corresponding screen throwing objects in the screen throwing device according to the equipment information of each equipment terminal, setting parameters, and pairing each screen throwing object with the corresponding equipment terminal;
and acquiring basic information and connection information of the equipment terminal through a setup request, and performing video connection and audio connection on the equipment terminal and a screen throwing object according to the basic information and the connection information of the equipment terminal.
In a second aspect, an embodiment of the present invention provides an IOS multi-device real-time screen projection system, including:
the initialization connection unit is used for throwing the broadcast information into the local area network, so that equipment terminals connected to the local area network are all in initialization connection with the screen throwing device through the corresponding broadcast information;
the device terminal pairing unit is used for respectively creating corresponding screen-throwing objects in the screen-throwing device according to the device information of each device terminal, setting parameters, and pairing each screen-throwing object with the corresponding device terminal;
and the connection processing unit is used for acquiring the basic information and the connection information of the equipment terminal through the setup request, and carrying out video connection and audio connection on the equipment terminal and the screen throwing object according to the basic information and the connection information of the equipment terminal.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, where the processor implements the IOS multi-device real-time screen projection method described in the first aspect when executing the computer program.
In a fourth aspect, an embodiment of the present invention further provides a computer readable storage medium, where the computer readable storage medium stores a computer program, where the computer program when executed by a processor causes the processor to perform the IOS multi-device real-time screen projection method described in the first aspect above.
The embodiment of the invention provides an IOS multi-device real-time screen projection method, an IOS multi-device real-time screen projection system, a computer device and a storage medium, wherein the IOS multi-device real-time screen projection method comprises the following steps: broadcasting information is put into a local area network, and equipment terminals connected to the local area network are all connected with a screen throwing device in an initializing mode through corresponding broadcasting information; respectively creating corresponding screen throwing objects in the screen throwing device according to the equipment information of each equipment terminal, setting parameters, and pairing each screen throwing object with the corresponding equipment terminal; and acquiring basic information and connection information of the equipment terminal through a setup request, and performing video connection and audio connection on the equipment terminal and a screen throwing object according to the basic information and the connection information of the equipment terminal. According to the embodiment of the invention, the screen-throwing objects corresponding to each equipment terminal are established on the screen-throwing device, so that the plurality of equipment terminals are thrown to the same screen-throwing device through the plurality of screen-throwing objects, and the function of IOS multi-equipment screen throwing is realized.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of an IOS multi-device real-time screen projection method provided by an embodiment of the invention;
FIG. 2 is a schematic sub-flowchart of an IOS multi-device real-time screen-casting method according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of another sub-flowchart of the IOS multi-device real-time screen-projection method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of another sub-flowchart of the IOS multi-device real-time screen-projection method according to an embodiment of the present invention;
fig. 5 is a schematic block diagram of an IOS multi-device real-time screen-projection system provided by an embodiment of the invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
Referring to fig. 1, fig. 1 is a flowchart of an IOS multi-device real-time screen projection method according to an embodiment of the present invention, and the method includes steps S101 to S103.
S101, broadcasting information is put into a local area network, and equipment terminals connected to the local area network are all connected with a screen throwing device in an initializing mode through corresponding broadcasting information;
in this step, the device terminal obtains the broadcast information in the local area network so as to perform initialization connection with the corresponding screen-throwing device. Wherein each piece of broadcast information can be acquired only by one device terminal.
In one embodiment, as shown in fig. 2, before the step S101, the method includes:
s201, initializing a local network, acquiring local IP and local MAC information, formatting the information into character string data, and checking whether a local firewall is in a normal state;
s202, if the local firewall is in an abnormal state, modifying the wrong firewall rules or importing new firewall rules;
s203, if the local firewall is in a normal state, initializing and generating local pairing information, initializing a local HTTP service, setting an HTTP request method, and starting the HTTP service to create a communication port used by the HTTP service;
s204, setting a maximum connection threshold according to the user requirement or calculating the maximum connection threshold according to the hardware information, and creating a thread pool by taking the maximum connection threshold as a reference;
s205, creating and initializing a device connection service object according to the local pairing information, the HTTP service, and the maximum connection threshold.
In this embodiment, before broadcasting information is put in, the local network is initialized, whether the firewall is normal is checked, if the firewall is normal, local pairing information is continuously initialized, local HTTP service is initialized, a thread pool is created according to a maximum connection threshold, and finally, a device connection service object is created and initialized according to the local pairing information, the HTTP service and the maximum connection threshold.
Specifically, initializing the local network, acquiring local IP and MAC information, formatting the information into character string data, checking whether the local firewall is in a normal state, and if the local firewall is in an abnormal state, revising the wrong firewall rules or importing new firewall rules to prevent the firewall from interfering the screen throwing connection. Local pairing information is generated by initialization and is used for initializing a pairing session when a subsequent device terminal is paired with the local pairing, and only one local pairing information is locally created, so that the pairing session and the device terminal are connected and bound with each other. Initializing a local HTTP service, setting a connection request for processing equipment such as an HTTP request method GET/info, a POST/pair-SETUP/pair-verify/fp-SETUP/feedback and SETUP, and starting the HTTP service to create a communication port used by the HTTP service. The maximum connection threshold value is calculated according to the maximum connection threshold value set by the user requirement or according to the hardware information, and the thread pool is created and the size of the equipment MAP is limited by taking the maximum connection threshold value as a reference. And creating and initializing a device connection service object according to the information to realize connection management and limitation on the device terminal, and improving the performance when the multi-device is supported by using a thread pool and improving the retrieval efficiency of the device by using MAP. Unlike the single device approach, this stage of creating HTTP services and local pairing information will not be repeated to affect performance while also causing the last connection to be broken, and while adding a series of information specific to the multiple device management.
The device connection service object is used for realizing the management of the device terminal connection service, comprises global pairing information and a management interface of the HTTP service, can realize the closing and limiting of single devices, can directly control the device terminal connection service, and stores some information for managing the connection rules of the device terminals and the number of the device terminals.
In one embodiment, as shown in fig. 3, the step S101 includes:
s301, writing the communication port, the screen-throwing service name, the local MAC information and the local screen-throwing information into broadcast information with specified fields, opening an independent thread on line Cheng China and throwing the broadcast information into a local area network through Bonjour service;
s302, receiving a connection request sent by the equipment terminal to a corresponding screen throwing device according to the broadcast information, and judging whether the number of the equipment terminals currently connected by the screen throwing device reaches a maximum connection threshold value or not;
s303, if the number of the equipment terminals currently connected by the screen throwing device reaches a maximum connection threshold, notifying the equipment terminals to be disconnected through HTTP service;
and S304, if the number of the equipment terminals currently connected by the screen throwing device does not reach the maximum connection threshold, an HTTP connection initialization signal is sent to the equipment terminals, and a pairing session is created according to the equipment connection service object.
In this embodiment, after corresponding information is written into broadcast information, an independent thread is started and the broadcast information is put into a local area network through Bonjour service, a device terminal sends a connection request to a corresponding screen throwing device according to the broadcast information, the screen throwing device judges whether the number of the currently connected device terminals reaches a maximum connection threshold, if yes, the device terminal is notified to be disconnected through HTTP service, if not, an HTTP connection initialization signal is sent to the device terminal, and a pairing session is created according to the device connection service object.
Specifically, a communication port created when the HTTP service is started, a screen-throwing service name, a local MAC address acquired when the network configuration is initialized and local screen-throwing information are set in broadcast information of a_raop_tcp field and a_air_tcp field, an independent thread is started, broadcasting is thrown into a local area network through a Bonjour service, the life cycle of the broadcasting is the same as that of the thread creating the broadcasting, and IOS/MACOS equipment identifies the broadcast_raop_tcp and the_air_tcp information in the local area network and displays the broadcast_raop_tcp and the_air_tcp information on a mirror image screen-throwing.
And connecting the equipment terminal to the same local area network environment, after the equipment terminal identifies the released broadcast information, displaying the screen-throwing service name used by the released broadcast information by the equipment terminal, searching the corresponding local service name, starting to enter the equipment connection process, and waiting for the completion of connection. When the equipment terminal completes connection, the HTTP port is further tried to be connected, at the moment, the HTTP connection initialization signal is triggered by monitoring, when the HTTP connection initialization signal is received, the HTTP connection initialization signal is compared with the number of the equipment terminals connected by the screen throwing device according to a preset threshold value configured in the equipment connection service object, if the equipment terminal exceeds the set maximum connection threshold value, the equipment terminal is informed to disconnect through the HTTP service, a connection failure interface is popped up on a screen of the equipment terminal, and therefore continuous connection of the equipment terminal is refused.
After the equipment terminal is successfully connected, an HTTP connection initialization signal from HTTP service is received, a pairing session is created according to local pairing information stored in a device connection service object created before, the pairing session created at the moment is mutually bound with the equipment terminal connection, and the equipment connection pairing sessions of different equipment terminals are different.
In a specific embodiment, before the online Cheng China opens an independent thread and puts the broadcast information into the lan through the Bonjour service, the method includes:
judging whether the local network is provided with Bonjour service or not;
if the local network is provided with the Bonjour service, restarting the Bonjour service and delivering broadcast information;
if the local network is not provided with the Bonjour service, the Bonjour service is installed and started.
In this embodiment, whether a Bonjour service is installed in the local network is determined, and if so, the Bonjour service is stopped and then operated, so as to prevent failure of broadcast information caused by abnormal Bonjour service; if the service is not installed, the Bonjour service needs to be installed, and after the Bonjour service is successfully installed, the Bonjour service is normally started so as to provide the subsequent use of the broadcast information.
S102, respectively creating corresponding screen-throwing objects in the screen-throwing device according to the equipment information of each equipment terminal, setting parameters, and pairing each screen-throwing object with the corresponding equipment terminal;
in this step, the screen projection device creates a corresponding screen projection object according to the device information of the device terminal and performs parameter setting, and then pairs the screen projection object with the corresponding device terminal.
The specific creation process of the screen throwing object is as follows: initializing Fairplay encryption information, acquiring equipment terminal IP, formatting the equipment terminal IP into an IP character string, and creating a screen projection object by using the equipment terminal IP information, the local pairing information and the Fairplay encryption information. The parameter setting of the screen throwing object is specifically as follows: in the GET/info request, the required basic screen projection parameters are set through a binary plist (parameter table), and the binary plist data is responded to the equipment terminal through HTTP to be processed, wherein the binary plist data comprises the format of an audio/video stream, the resolution of the audio/video stream, FPS, refresh rate, minimum electric quantity of connection maintenance and other information. The parameter information is used for providing reference for the IOS system to encode the screen throwing process and the push data, and the responsive data are stored in the screen throwing object for use at any time and obtaining the screen throwing reference information. And in the POST/pair-setup request, a pairing session generated public key obtained through local pairing information initialization in the initializing connection process is used for sending the pairing session generated public key to the equipment terminal, whether pairing is normal or not and whether pairing is successful or not is verified in the pair-verify request, and Fairplay dynamic encryption information is installed in the fp-setup request and handshake is carried out, so that the verification and pairing stages of the equipment terminal are completed. Pairing information and Fairplay information of the device terminal are then included in the screen object to ensure the integrity of the screen object.
S103, acquiring basic information and connection information of the equipment terminal through a setup request, and performing video connection and audio connection on the equipment terminal and a screen throwing object according to the basic information and the connection information of the equipment terminal.
In this step, basic information and connection information of the device terminal are acquired through a setup request, and video connection and audio connection are performed according to the basic information and connection information.
In one embodiment, as shown in fig. 4, the step S103 includes:
s401, receiving a setup request triggered by the equipment terminal, acquiring a parameter table in the setup request, and judging whether an information key is contained in the request table;
s402, if the request list contains an information key, acquiring basic information and encryption information of the equipment terminal according to the information key, and judging whether the request list contains a video stream connection key or not; the basic information comprises a device name, a device ID and a device model, and the encrypted information comprises an AES key;
s403, if the request list contains a video stream connection key, processing an AES key according to the video stream connection key, notifying a screen throwing object to start video communication connection in a thread pool, generating a Socket connection port corresponding to an event, time and data, and returning corresponding connection port information to the equipment terminal through designated key position information in a parameter list; judging whether the request list contains an audio connection key or not;
s404, if the request list contains an audio connection key, acquiring the encapsulation format of the audio stream according to the audio connection key, notifying the equipment connection service object to start audio communication connection in the thread pool, generating a Socket connection port corresponding to control, time and data, and returning corresponding connection port information to the equipment terminal through the designated key position information in the parameter list.
In this embodiment, in the request of SETUP, it is identified whether the plist (parameter table) includes an acquisition part of basic information and encrypted information that the eiv key (information key) confirms whether the device belongs to, and after the device terminal completes a series of pairing processes, the device terminal will trigger the request, and in this part, information such as a device name, a device ID, and a device model number may be acquired respectively through a key name, deviceID, model, where the device ID is used as a unique identifier (hereinafter collectively referred to as a unique identifier) of the device, and meanwhile, it may be ensured that a situation such as misconnection does not occur according to the device model number and the device name, and the encrypted information includes an AES key of the device terminal, where the AES key is used for encryption and decryption of a subsequent media stream at the same time.
In the SETUP request, it is identified whether the plist contains a streamConnectionID key (video stream connection key) to confirm whether it belongs to the part of the device terminal that captures the video media stream, and when there is a screen display output on the device terminal, the device terminal will trigger the request. And processing the AES key by using a streamConnectionID key in the plist, informing the screen-casting object to start video communication connection in the thread pool, generating three Socket connection ports of event, time and data, and returning a corresponding port to the HTTP response to the equipment through eventPort, timingPort and dataPort keys of the plist. Unlike previous single device schemes, each device will generate the same number of new connections and communicate using different ports to achieve the goal of avoiding data confusion and overcompression of the decryption algorithm.
In the request of SETUP, it is identified whether the plist contains an audioFormat key (audio connection key) to confirm whether it belongs to the part of the device terminal for audio media stream acquisition, and when there is audio output on the device terminal, the device terminal will trigger the request. The audioFormat key identifies the package format of the audio stream, confirms whether the screen-throwing object supports the processing of the format, and refuses the automatic connection of the equipment if the screen-throwing object does not support the processing. And notifying the equipment connection service object to start audio communication connection in the thread pool, generating three Socket connection ports of control, time and data, and returning the corresponding ports to the equipment through controlPort, timingPort and dataPort keys in the plist. Unlike previous single device schemes, each device will generate the same number of new connections and communicate using different ports to achieve the goal of avoiding data confusion and overcompression of the decryption algorithm.
In a specific embodiment, after the acquiring the basic information and the encrypted information of the equipment terminal according to the information key, the method includes:
judging whether the equipment ID or the equipment model of the equipment terminal exists in a blacklist or not;
if the equipment ID or the equipment model of the equipment terminal exists in the blacklist, the equipment terminal is informed to disconnect through the HTTP service.
In this embodiment, it is determined whether the device ID or the device model of the device terminal exists in the blacklist, and if yes, the device terminal is notified to disconnect through the HTTP service. In the process of initializing connection, the device model and the device ID of an individual device terminal are limited, the functions of blacklist and the like of the device terminal are realized, and if the device ID or the device model on the blacklist appears, the connection can be directly refused by using the HTTP protocol.
In one embodiment, after the step S103, the method includes:
when a disconnection signal sent by the equipment terminal to the screen throwing object is detected, a corresponding screen throwing object is found out from the MAP through the equipment ID, when a heartbeat reaches a screen throwing device, a disconnection response is carried out on the equipment terminal, the screen throwing device triggers a disconnection event of the equipment terminal to recover the corresponding screen throwing object after the successful disconnection, and connection data of the screen throwing object and the equipment terminal in the MAP are cleared;
or when the complete heartbeat sent by the equipment terminal to the screen throwing object cannot be detected, the corresponding screen throwing object is found out from the MAP through the equipment ID, the connection with the equipment terminal is disconnected, and the connection data of the screen throwing object and the equipment terminal in the MAP are cleared;
or closing the HTTP connection service, disconnecting the equipment terminal from the local HTTP service, and clearing connection data between each screen throwing object and the corresponding equipment terminal in the MAP.
In this embodiment, after the device terminal is connected with the screen-throwing object, when a disconnection signal of the device terminal is detected, the corresponding screen-throwing object is found through the device ID, and when a heartbeat sent by the device terminal reaches the screen-throwing device, a disconnection response is performed to the device terminal, the corresponding screen-throwing object is recovered, and connection data established between the screen-throwing object and the device terminal is clearly obtained; when the fact that the heartbeat sent by the equipment terminal to the screen throwing device is incomplete is detected, the equipment terminal is determined to be in a weak network state, the equipment terminal and the screen throwing object are disconnected, and meanwhile connection data established between the screen throwing object and the equipment terminal are cleared; when the HTTP connection service is closed, all equipment terminals are disconnected with the screen throwing objects, and connection data of all the screen throwing objects are cleared.
Specifically, when an external signal of disconnection of the equipment terminal is received, a corresponding screen throwing object is found out from the MAP through a unique identifier (namely the equipment ID), disconnection is set in the HTTP response, when the heartbeat reaches the equipment terminal, disconnection response is carried out on the equipment terminal, the equipment terminal triggers an equipment terminal disconnection event to recover the corresponding screen throwing object after successful disconnection, and connection data of the screen throwing object and the equipment terminal in the MAP is cleared. If the heartbeat of the equipment terminal cannot be successfully received in the weak network environment, the MAP searches for the screen throwing object of the equipment terminal by using the unique identifier of the equipment terminal to carry out manual disconnection so as to realize single equipment disconnection of the equipment terminal. The connection and disconnection of the single device is mainly the control of heartbeat data to reach the purpose of notifying the device of the disconnection of the terminal. If the HTTP connection service is closed, all the equipment terminals are directly disconnected, HTTP disconnection events are returned one by one, and disconnection of the equipment terminals and resource recovery are completed one by one. And closing the HTTP connection service, directly disconnecting all the equipment terminals, and returning HTTP disconnection events one by one, thereby completing disconnection of the equipment terminals and resource recovery one by one.
Referring to fig. 5, fig. 5 is a schematic block diagram of an IOS multi-device real-time screen projection system provided in an embodiment of the present invention, where the IOS multi-device real-time screen projection system 200 includes:
an initialization connection unit 201, configured to put broadcast information into a local area network, so that equipment terminals connected to the local area network are all connected with a screen-throwing device through corresponding broadcast information in an initialization manner;
a device terminal pairing unit 202, configured to create corresponding screen-throwing objects in the screen-throwing device according to device information of each device terminal, set parameters, and pair each screen-throwing object with a corresponding device terminal;
and the connection processing unit 203 is configured to obtain the basic information and the connection information of the device terminal through a setup request, and perform video connection and audio connection on the device terminal and the screen object according to the basic information and the connection information of the device terminal.
In an embodiment, the initializing the connection unit 201 includes:
the local network initializing unit is used for initializing a local network, acquiring local IP and local MAC information, formatting the information into character string data, and checking whether a local firewall is in a normal state or not;
a firewall rule adjustment unit, configured to modify an incorrect firewall rule or import a new firewall rule if the local firewall is in an abnormal state;
the local pairing information generation unit is used for initializing local pairing information if the local firewall is in a normal state, initializing local HTTP service, setting an HTTP request method and starting the HTTP service to create a communication port used by the HTTP service;
the thread pool creation unit is used for setting a maximum connection threshold according to the requirement of a user or calculating the maximum connection threshold according to hardware information, and creating a thread pool by taking the maximum connection threshold as a reference;
and the device connection service object initializing unit is used for creating and initializing the device connection service object according to the local pairing information, the HTTP service and the maximum connection threshold value.
In an embodiment, the initializing the connection unit 201 includes:
the broadcast information delivery unit is used for writing the communication port, the screen service name, the local MAC information and the local screen information into broadcast information with specified fields, opening an independent thread on line Cheng China and delivering the broadcast information into a local area network through Bonjour service;
a connection request sending unit, configured to receive a connection request sent by the device terminal to a corresponding screen-throwing device according to the broadcast information, and determine whether the number of device terminals currently connected to the screen-throwing device reaches a maximum connection threshold;
the equipment terminal connection disconnection unit is used for notifying the equipment terminals to be disconnected through HTTP service if the number of the equipment terminals currently connected by the screen throwing device reaches a maximum connection threshold;
and the pairing session creation unit is used for sending an HTTP connection initialization signal to the equipment terminals if the number of the equipment terminals currently connected by the screen throwing device does not reach the maximum connection threshold value, and creating a pairing session according to the equipment connection service object.
In an embodiment, the broadcast information delivery unit includes:
the local network service judging unit is used for judging whether the local network is provided with Bonjour service or not;
the service restarting unit is used for restarting the Bonjour service and delivering broadcast information if the local network is provided with the Bonjour service;
and the service installation unit is used for installing and starting the Bonjour service if the Bonjour service is not installed in the local network.
In one embodiment, the IOS multi-device real-time screen projection system 200 further includes:
the disconnection signal sending unit is used for finding out a corresponding screen throwing object from the MAP through the equipment ID when a disconnection signal sent by the equipment terminal to the screen throwing object is detected, responding to the disconnection of the equipment terminal when the heartbeat reaches the screen throwing device, triggering the equipment terminal disconnection event to recover the corresponding screen throwing object after the successful disconnection of the screen throwing device, and clearing connection data of the screen throwing object and the equipment terminal in the MAP;
the heartbeat missing unit is used for finding out a corresponding screen throwing object from the MAP through the equipment ID and disconnecting the corresponding screen throwing object from the MAP when the complete heartbeat sent to the screen throwing object by the equipment terminal cannot be detected, and clearing connection data of the screen throwing object and the equipment terminal in the MAP;
and the connection service disconnection unit is used for closing the HTTP connection service, disconnecting the equipment terminal from the local HTTP service and clearing connection data between each screen throwing object in the MAP and the corresponding equipment terminal.
In an embodiment, the connection processing unit 203 includes:
the parameter table acquisition unit is used for receiving a setup request triggered by the equipment terminal, acquiring a parameter table in the setup request and judging whether the request table contains an information key or not;
the information acquisition unit is used for acquiring the basic information and the encryption information of the equipment terminal according to the information key if the request table contains the information key, and judging whether the request table contains the video stream connection key or not; the basic information comprises a device name, a device ID and a device model, and the encrypted information comprises an AES key;
the video communication connection unit is used for processing the AES key according to the video stream connection key if the request table contains the video stream connection key, notifying a screen throwing object to start video communication connection in a thread pool, generating a Socket connection port corresponding to an event, time and data, and returning corresponding connection port information to the equipment terminal through designated key position information in the parameter table; judging whether the request list contains an audio connection key or not;
and the audio communication connection unit is used for acquiring the encapsulation format of the audio stream according to the audio connection key if the request table contains the audio connection key, notifying the equipment connection service object to start audio communication connection in the thread pool, generating a Socket connection port corresponding to control, time and data, and returning corresponding connection port information to the equipment terminal through the designated key position information in the parameter table.
In an embodiment, the information acquisition unit includes:
a blacklist judging unit, configured to judge whether an equipment ID or an equipment model of the equipment terminal exists in a blacklist;
and the blacklist equipment terminal processing unit is used for notifying the equipment terminal to disconnect through the HTTP service if the equipment ID or the equipment model of the equipment terminal exists in the blacklist.
The embodiment of the invention also provides a computer device which comprises a memory, a processor and a computer program stored in the memory and capable of running on the processor, wherein the processor realizes the IOS multi-device real-time screen projection method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium is stored with a computer program, and the computer program realizes the IOS multi-device real-time screen projection method when being executed by a processor.
In the description, each embodiment is described in a progressive manner, and each embodiment is mainly described by the differences from other embodiments, so that the same similar parts among the embodiments are mutually referred. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant points refer to the description of the method section. It should be noted that it will be apparent to those skilled in the art that various modifications and adaptations of the invention can be made without departing from the principles of the invention and these modifications and adaptations are intended to be within the scope of the invention as defined in the following claims.
It should also be noted that in this specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.

Claims (9)

1. An IOS multi-device real-time screen projection method, comprising:
initializing a local network, acquiring local IP and local MAC information, formatting the local IP and the local MAC information into character string data, and checking whether a local firewall is in a normal state;
if the local firewall is in an abnormal state, modifying the wrong firewall rules or importing new firewall rules;
if the local firewall is in a normal state, initializing and generating local pairing information, initializing a local HTTP service, setting an HTTP request method, and starting the HTTP service to create a communication port used by the HTTP service;
setting a maximum connection threshold according to the user requirements or calculating the maximum connection threshold according to the hardware information, and creating a thread pool by taking the maximum connection threshold as a reference;
creating and initializing a device connection service object according to the local pairing information, the HTTP service and the maximum connection threshold;
broadcasting information is put into a local area network, and equipment terminals connected to the local area network are all connected with a screen throwing device in an initializing mode through corresponding broadcasting information;
respectively creating corresponding screen throwing objects in the screen throwing device according to the equipment information of each equipment terminal, setting parameters, and pairing each screen throwing object with the corresponding equipment terminal;
acquiring basic information and connection information of the equipment terminal through a setup request, and performing video connection and audio connection on the equipment terminal and a screen throwing object according to the basic information and the connection information of the equipment terminal;
initializing Fairplay encryption information, acquiring equipment terminal IP, formatting the equipment terminal IP into an IP character string, and creating a screen throwing object by using the equipment terminal IP information, the local pairing information and the Fairplay encryption information;
in the GET/info request, the required basic screen projection parameters are set through binary plist, and the binary plist data is responded to the equipment terminal through HTTP to be processed, wherein the binary plist data comprises the format of an audio/video stream, the resolution of the audio/video stream, FPS, the refresh rate and the information of the minimum electric quantity of the connection maintenance.
2. The IOS multi-device real-time screen projection method according to claim 1, wherein the step of projecting broadcast information into a local area network to enable a device terminal connected to the local area network to perform initialization connection with a screen projection device through the broadcast information comprises the steps of:
writing the communication port, the screen-throwing service name, the local MAC information and the local screen-throwing information into broadcast information with appointed fields, opening an independent thread on line Cheng China and throwing the broadcast information into a local area network through Bonjour service;
receiving a connection request sent by the equipment terminal to a corresponding screen throwing device according to the broadcast information, and judging whether the number of the equipment terminals currently connected by the screen throwing device reaches a maximum connection threshold value or not;
if the number of the equipment terminals currently connected by the screen throwing device reaches the maximum connection threshold, notifying the equipment terminals through HTTP service
Disconnecting the equipment terminal;
if the number of the equipment terminals currently connected by the screen throwing device does not reach the maximum connection threshold, an HTTP connection initialization signal is sent to the equipment terminals, and a pairing session is established according to the equipment connection service object.
3. The IOS multi-device real-time screening method according to claim 2, wherein before the online Cheng China opens an independent thread and puts the broadcast information into a local area network through Bonjour service, comprising:
judging whether the local network is provided with Bonjour service or not;
if the local network is provided with the Bonjour service, restarting the Bonjour service and delivering broadcast information;
if the local network is not provided with the Bonjour service, the Bonjour service is installed and started.
4. The IOS multi-device real-time screen-throwing method according to claim 1, wherein the acquiring basic information and connection information of the device terminal through a setup request, and video linking and audio connecting the device terminal and a screen-throwing object according to the basic information and connection information of the device terminal, comprises:
receiving a setup request triggered by the equipment terminal, acquiring a parameter table in the setup request, and judging whether the request table contains an information key or not;
if the request list contains an information key, acquiring basic information and encryption information of the equipment terminal according to the information key, and judging whether the request list contains a video stream connection key or not; the basic information comprises a device name, a device ID and a device model, and the encrypted information comprises an AES key;
if the request table contains a video stream connection key, processing an AES key according to the video stream connection key, notifying a screen throwing object to start video communication connection in a thread pool, generating a Socket connection port corresponding to an event, time and data, and returning corresponding connection port information to the equipment terminal through designated key position information in a parameter table; judging whether the request list contains an audio connection key or not;
if the request table contains an audio connection key, acquiring the encapsulation format of the audio stream according to the audio connection key, notifying the equipment connection service object to start audio communication connection in the thread pool, generating Socket connection ports corresponding to control, time and data, and returning corresponding connection port information to the equipment terminal through designated key position information in the parameter table.
5. The IOS multi-device real-time screen projection method according to claim 4, wherein after obtaining basic information and encrypted information of a device terminal according to the information key, the method comprises:
judging whether the equipment ID or the equipment model of the equipment terminal exists in a blacklist or not;
if the equipment ID or the equipment model of the equipment terminal exists in the blacklist, the equipment terminal is informed to disconnect through the HTTP service.
6. The IOS multi-device real-time screen-casting method according to claim 4, wherein after the acquiring the basic information and the connection information of the device terminal through the setup request and performing video linking and audio connection on the device terminal and the screen-casting object according to the basic information and the connection information of the device terminal, the method comprises:
when a disconnection signal sent by the equipment terminal to the screen throwing object is detected, a corresponding screen throwing object is found out from the MAP through the equipment ID, when a heartbeat reaches a screen throwing device, a disconnection response is carried out on the equipment terminal, the screen throwing device triggers a disconnection event of the equipment terminal to recover the corresponding screen throwing object after the successful disconnection, and connection data of the screen throwing object and the equipment terminal in the MAP are cleared;
or when the complete heartbeat sent by the equipment terminal to the screen throwing object cannot be detected, the corresponding screen throwing object is found out from the MAP through the equipment ID, the connection with the equipment terminal is disconnected, and the connection data of the screen throwing object and the equipment terminal in the MAP are cleared;
or closing the HTTP connection service, disconnecting the equipment terminal from the local HTTP service, and clearing connection data between each screen throwing object and the corresponding equipment terminal in the MAP.
7. An IOS multi-device real-time screen projection system, comprising:
the checking unit is used for initializing the local network, acquiring local IP and local MAC information, formatting the information into character string data and checking whether the local firewall is in a normal state or not;
a modification unit for modifying the wrong firewall rules or importing new firewall rules if the local firewall is in an abnormal state;
an initialization generating unit for initializing local pairing information if the local firewall is in a normal state, initializing local HTTP service, setting an HTTP request method, and starting the HTTP service to create a communication port used by the HTTP service;
the thread pool creating unit is used for setting a maximum connection threshold according to the requirement of a user or calculating the maximum connection threshold according to hardware information, and creating a thread pool by taking the maximum connection threshold as a reference;
a connection service object creating unit for creating and initializing a device connection service object according to the local pairing information, the HTTP service and the maximum connection threshold;
the initialization connection unit is used for throwing the broadcast information into the local area network, so that equipment terminals connected to the local area network are all in initialization connection with the screen throwing device through the corresponding broadcast information;
the device terminal pairing unit is used for respectively creating corresponding screen-throwing objects in the screen-throwing device according to the device information of each device terminal, setting parameters, and pairing each screen-throwing object with the corresponding device terminal;
the connection processing unit is used for acquiring basic information and connection information of the equipment terminal through a setup request, and carrying out video connection and audio connection on the equipment terminal and a screen throwing object according to the basic information and the connection information of the equipment terminal;
creating a screen-throwing object unit, initializing Fairplay encryption information, acquiring equipment terminal IP and formatting the equipment terminal IP into an IP character string, and creating the screen-throwing object by using the equipment terminal IP information, the local pairing information and the Fairplay encryption information;
and the parameter setting unit is used for setting required basic screen throwing parameters through binary plist in the GET/info request, and responding binary plist data to the equipment terminal through HTTP for processing, wherein the binary plist data comprises the format of an audio/video stream, the resolution of the audio/video stream, FPS, the refresh rate and the information of the minimum electric quantity of the connection maintenance.
8. A computer device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor, when executing the computer program, implements the IOS multi-device real-time screen projection method of any one of claims 1 to 6.
9. A computer readable storage medium storing a computer program which, when executed by a processor, causes the processor to perform the IOS multi-device real-time screen projection method of any one of claims 1 to 6.
CN202210088863.3A 2022-01-25 2022-01-25 IOS multi-device real-time screen projection method, system, computer device and storage medium Active CN114793291B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210088863.3A CN114793291B (en) 2022-01-25 2022-01-25 IOS multi-device real-time screen projection method, system, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210088863.3A CN114793291B (en) 2022-01-25 2022-01-25 IOS multi-device real-time screen projection method, system, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN114793291A CN114793291A (en) 2022-07-26
CN114793291B true CN114793291B (en) 2023-11-07

Family

ID=82460173

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210088863.3A Active CN114793291B (en) 2022-01-25 2022-01-25 IOS multi-device real-time screen projection method, system, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN114793291B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115442653A (en) * 2022-07-27 2022-12-06 苏州华启智能科技有限公司 Wireless screen projection method and device and electronic equipment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012056364A1 (en) * 2010-10-27 2012-05-03 Koninklijke Philips Electronics N.V. Low dose ct denoising
CN103051612A (en) * 2012-12-13 2013-04-17 华为技术有限公司 Firewall and method for preventing network attack
CN104038741A (en) * 2014-06-17 2014-09-10 南京物联传感技术有限公司 Projection method for video data
JP2016071638A (en) * 2014-09-30 2016-05-09 Kddi株式会社 Source terminal, display control system, display control method, and display control program
CN107277609A (en) * 2017-07-28 2017-10-20 广州爱拍网络科技有限公司 Screen mirror image projective techniques, system, device and the film recording method of iOS device
KR20190088342A (en) * 2018-01-18 2019-07-26 주식회사맥데이타 Network performance diagnosis method and apparatus, and system
CN110177399A (en) * 2019-04-30 2019-08-27 深圳市鹰硕技术有限公司 One kind is the same as screen method for connecting network, device, smart machine and storage medium
CN110519632A (en) * 2019-07-30 2019-11-29 华为技术有限公司 Throw screen method and apparatus
CN111552565A (en) * 2020-04-26 2020-08-18 深圳市鸿合创新信息技术有限责任公司 Multithreading screen projection method and device
CN112019914A (en) * 2020-08-27 2020-12-01 北京字节跳动网络技术有限公司 Screen projection method and device, electronic equipment and computer readable medium
CN112584223A (en) * 2020-12-04 2021-03-30 深圳创维-Rgb电子有限公司 Television-based self-adaptive split-screen display method and device, intelligent terminal and medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010093831A1 (en) * 2009-02-11 2010-08-19 Social Gaming Network Apparatuses, methods and systems for an interactive proximity display tether with remote co-play
US9173000B2 (en) * 2013-04-12 2015-10-27 Sony Corporation Automatic discovery and mirroring of server-client remote user interface (RUI) session on a companion device and synchronously controlling both sessions using RUI on companion device
GB201704931D0 (en) * 2017-03-28 2017-05-10 Indigovision Ltd Monitoring devices and methods for IP surveillance networks
US10779051B2 (en) * 2017-04-05 2020-09-15 Panasonic Avionics Corporation Screen mirroring from personal electronic devices to transportation vehicle display screens
US10664187B2 (en) * 2017-12-01 2020-05-26 International Business Machines Corporation Reducing a rate at which data is mirrored from a primary server to a secondary server

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012056364A1 (en) * 2010-10-27 2012-05-03 Koninklijke Philips Electronics N.V. Low dose ct denoising
CN103051612A (en) * 2012-12-13 2013-04-17 华为技术有限公司 Firewall and method for preventing network attack
CN104038741A (en) * 2014-06-17 2014-09-10 南京物联传感技术有限公司 Projection method for video data
JP2016071638A (en) * 2014-09-30 2016-05-09 Kddi株式会社 Source terminal, display control system, display control method, and display control program
CN107277609A (en) * 2017-07-28 2017-10-20 广州爱拍网络科技有限公司 Screen mirror image projective techniques, system, device and the film recording method of iOS device
KR20190088342A (en) * 2018-01-18 2019-07-26 주식회사맥데이타 Network performance diagnosis method and apparatus, and system
CN110177399A (en) * 2019-04-30 2019-08-27 深圳市鹰硕技术有限公司 One kind is the same as screen method for connecting network, device, smart machine and storage medium
CN110519632A (en) * 2019-07-30 2019-11-29 华为技术有限公司 Throw screen method and apparatus
WO2021018187A1 (en) * 2019-07-30 2021-02-04 华为技术有限公司 Screen projection method and device
CN111552565A (en) * 2020-04-26 2020-08-18 深圳市鸿合创新信息技术有限责任公司 Multithreading screen projection method and device
CN112019914A (en) * 2020-08-27 2020-12-01 北京字节跳动网络技术有限公司 Screen projection method and device, electronic equipment and computer readable medium
CN112584223A (en) * 2020-12-04 2021-03-30 深圳创维-Rgb电子有限公司 Television-based self-adaptive split-screen display method and device, intelligent terminal and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于场景融合的多路投射方法在车机***应用;姚佐平;吕俊成;俞铭;黄建鹏;卢彤;;中国新通信(第02期);全文 *

Also Published As

Publication number Publication date
CN114793291A (en) 2022-07-26

Similar Documents

Publication Publication Date Title
US10038773B2 (en) Communication systems and methods
CN107911437B (en) Screen sharing method and device, electronic equipment and storage medium
US20140115587A1 (en) Exception handling method, apparatus, and client
CN106776124B (en) Data backup method and device
WO2015027713A1 (en) Video playback method, apparatus, and terminal device based on video aggregation service
CN108769795B (en) Video signal realizing system and method
CN107612900A (en) System and method for establishing connection between the device to be communicated via network
CN105474653B (en) Unpaired equipment
CN107995247B (en) File transmission method, server and system
CN104635501A (en) Intelligent home control method and system
CN105472430A (en) Method of making mobile terminal ring through intelligent television, equipment and system thereof
WO2011150609A1 (en) System and method for re-access of wireless video conference terminal
CN105721450A (en) Method, device and system for logging in network game
CN102164312A (en) Set-top box configuration method and system for Internet protocol television
CN114793291B (en) IOS multi-device real-time screen projection method, system, computer device and storage medium
CN104038817A (en) Method of remotely monitoring intelligent television, mobile terminal, intelligent television and server
CN110290570A (en) Wireless network access method and relevant device, storage device
CN103618967A (en) Method and device for interaction of mobile terminal and television end
CN106416234A (en) Communication apparatus, communication system, communication management system, communication control method, and computer program product
CN112684995A (en) Cross-screen input method and device
CN113242462B (en) Screen projection method and device for realizing convergence terminal
WO2013155927A1 (en) Active login method and terminal
WO2024027745A1 (en) Network connection method, electronic device, readable storage medium, and chip
CN105391702A (en) Audio/video communication method, terminal, server and platform
WO2023011021A1 (en) Live picture display method and apparatus, storage medium, and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: 1301-1310, building 2, jinlitong financial center building, 1100 Xingye Road, Haiwang community, Xin'an street, Bao'an District, Shenzhen, Guangdong 518000

Patentee after: Shenzhen Ruan Niu Technology Group Co.,Ltd.

Address before: 1301-1310, building 2, jinlitong financial center building, 1100 Xingye Road, Haiwang community, Xin'an street, Bao'an District, Shenzhen, Guangdong 518000

Patentee before: AFIRSTSOFT CO.,LTD.

CP01 Change in the name or title of a patent holder