CN115604520A - Screen projection connection method and device and computer readable storage medium - Google Patents

Screen projection connection method and device and computer readable storage medium Download PDF

Info

Publication number
CN115604520A
CN115604520A CN202211189540.XA CN202211189540A CN115604520A CN 115604520 A CN115604520 A CN 115604520A CN 202211189540 A CN202211189540 A CN 202211189540A CN 115604520 A CN115604520 A CN 115604520A
Authority
CN
China
Prior art keywords
screen
screen projection
port
application
projection
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.)
Pending
Application number
CN202211189540.XA
Other languages
Chinese (zh)
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.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology 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 Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN202211189540.XA priority Critical patent/CN115604520A/en
Publication of CN115604520A publication Critical patent/CN115604520A/en
Pending legal-status Critical Current

Links

Images

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/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/4363Adapting the video or multiplex stream to a specific local network, e.g. a IEEE 1394 or Bluetooth® network
    • H04N21/43637Adapting the video or multiplex stream to a specific local network, e.g. a IEEE 1394 or Bluetooth® network involving a wireless protocol, e.g. Bluetooth, RF or wireless LAN [IEEE 802.11]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention discloses a screen projection connection method, screen projection connection equipment and a computer readable storage medium, wherein the method comprises the following steps: after receiving a handshake message which is sent by the screen projection end and is successfully connected, detecting an idle port of the projected end, and switching the preset monitoring port to the idle port according to a detection result; starting a preset screen projection application through the system service, and transmitting the idle port to an application service of the screen projection application so that the screen projection application monitors the idle port after the screen projection application is started; and the system service sends the idle port to the screen projection end so that the screen projection end and the screen projection application establish a screen projection link through the idle port. The humanized screen projection connection scheme is realized, the power consumption before the screen projection connection is established is reduced, the execution efficiency, the stability and the success rate of the screen projection connection during the establishment are improved, and the use experience of a user on the screen projection function is enhanced.

Description

Screen projection connection method and device and computer readable storage medium
Technical Field
The present invention relates to the field of mobile communications, and in particular, to a screen-projection connection method, device, and computer-readable storage medium.
Background
In the prior art, with the continuous development of intelligent terminal equipment, screen projection applications based on a mobile terminal and a large screen terminal are increasingly popular with users. In the existing screen projection scheme, a function of finding screen projection equipment needs to be performed, namely, the two-dimensional code scanning scheme (which is relatively complicated, and has relatively slow operation steps and response) of the existing screen projection is changed. At present, some screen projection devices are discovered, and in such schemes, when a computer or a mobile phone is opened, the device can be discovered, and then the screen projection device is clicked directly. The essence of the above implementation scheme is that the detection of each IP network address and network port is linked in the local area network, but the above scheme faces two serious problems of user experience, firstly, the screen-throwing client always operates in the background, which greatly increases the power consumption, so that the electricity consumption is faster caused by the throwing end (movable small-sized device, battery power supply), secondly, when the screen-throwing end (large-screen device, computer, etc.) operates, the distributed port may be occupied by other programs, thereby the screen-throwing cannot be used, that is, the fixed port connection cannot effectively guarantee the success rate and stability when the screen-throwing link is established.
Therefore, how to improve the creation efficiency, stability and success rate of the screen-throwing link becomes a technical problem to be solved urgently at present.
Disclosure of Invention
In order to solve the technical defects in the prior art, the invention provides a screen projection connection method, which comprises the following steps:
creating a link of a preset monitoring port in system service of a thrown end so that the thrown screen end scans a network address connected with the preset monitoring port in a local area network;
after receiving a handshake message which is sent by the screen projection end and is successfully connected, detecting an idle port of the projected end, and switching the preset monitoring port into the idle port according to a detection result;
starting a preset screen projection application through the system service, and transmitting the idle port to an application service of the screen projection application so that the screen projection application monitors the idle port after the screen projection application is started;
and the system service sends the idle port to the screen projection end so that the screen projection end and the screen projection application establish a screen projection link through the idle port.
Optionally, the creating a link of a preset monitor port in the system service of the dropped terminal to enable the dropped terminal to scan a network address connected to the preset monitor port in the local area network includes:
obtaining historical screen projection information of the projected terminal, and selecting a monitoring port as the preset monitoring port according to the historical screen projection information;
after the screen projection end is started, connection with the preset monitoring port is tried in sequence according to the preset range of the network address through the screen projection service of the screen projection end.
Optionally, after receiving a handshake message sent by the screen projection end and successfully connected, the method detects an idle port of the projected end, and switches the preset monitoring port to the idle port according to a detection result, including:
when the screen projection end determines that a network address can be connected with the projected end, establishing network connection between the screen projection end and the projected end through the network address and the preset monitoring port;
and the screen projection end sends the handshake message of successful connection to the projected end through the network connection.
Optionally, after receiving a handshake message sent by the screen projection end and successfully connected, the method detects an idle port of the projected end, and switches the preset monitoring port to the idle port according to a detection result, further including:
after the system service receives the handshake message, the thrown terminal sends a handshake response message corresponding to the handshake message to the screen throwing terminal through the network connection;
and the screen projection end determines that the network equipment corresponding to the handshake response message belongs to the projected end, and displays the projected end and related operation options in an interface of the screen projection end.
Optionally, the starting a preset screen-casting application through the system service, and transmitting the idle port to an application service of the screen-casting application, so that the screen-casting application monitors the idle port after the starting is completed, including:
starting a preset screen projection application by the system service, and determining the idle port corresponding to the screen projection application;
communicating, by the system service, the idle port to the application service of the screen casting application.
Optionally, the starting a preset screen-projecting application through the system service, and transmitting the idle port to an application service of the screen-projecting application, so that the screen-projecting application monitors the idle port after the starting is completed, further including:
the system service carries the idle port in the handshake response message sent to the screen projection end;
and when the cast terminal receives the idle port, replacing the preset monitoring port by the idle port.
Optionally, the sending, by the system service, the idle port to the screen projection end, so that the screen projection end and the screen projection application establish a screen projection link through the idle port, includes:
recording the idle port by the screen projection end;
and determining the idle port as a screen projection link port of the screen projection end and the projected end currently.
Optionally, the sending, by the system service, the idle port to the screen projection end to enable the screen projection end and the screen projection application to establish a screen projection link through the idle port further includes:
receiving a screen projection starting instruction input to the screen projection application by a user at the projected end;
and starting to create the screen projection link of the projected end and the screen projection end according to the screen projection starting instruction and the screen projection link.
The invention also provides a screen projection connection device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the computer program realizes the steps of the screen projection connection method according to any one of the above items when being executed by the processor.
The invention further provides a computer readable storage medium, on which a screen projection connection program is stored, and when the screen projection connection program is executed by a processor, the steps of the screen projection connection method are implemented.
By implementing the screen projection connection method, the screen projection connection equipment and the computer readable storage medium, a link of a preset monitoring port is established in the system service of a projected end, so that the screen projection end scans a network address connected with the preset monitoring port in a local area network; after receiving a handshake message which is sent by the screen projection end and is successfully connected, detecting an idle port of the projected end, and switching the preset monitoring port to the idle port according to a detection result; starting a preset screen projection application through the system service, and transmitting the idle port to an application service of the screen projection application so as to monitor the idle port after the screen projection application is started; and the system service sends the idle port to the screen projection end so that the screen projection end and the screen projection application establish a screen projection link through the idle port. The humanized screen projection connection scheme is realized, the power consumption before the screen projection connection is established is reduced, the execution efficiency, the stability and the success rate of the screen projection connection during the establishment are improved, and the use experience of a user on the screen projection function is enhanced.
Drawings
The invention will be further described with reference to the following drawings and examples, in which:
fig. 1 is a schematic diagram of a hardware structure of a mobile terminal according to the present invention;
FIG. 2 is a flowchart of a first embodiment of a screen-projection connection method according to the present invention;
FIG. 3 is a flowchart of a second embodiment of a screen projection connection method according to the present invention;
FIG. 4 is a flowchart of a third embodiment of a screen-projection connection method of the present invention;
FIG. 5 is a flowchart of a fourth embodiment of a screen projection connection method according to the present invention;
FIG. 6 is a flow chart of a fifth embodiment of the screen projection connection method of the present invention;
FIG. 7 is a flowchart of a sixth embodiment of a screen projection connection method according to the present invention;
FIG. 8 is a flowchart of a seventh embodiment of a screen projection connection method according to the present invention;
fig. 9 is a flowchart of a screen projection connection method according to an eighth embodiment of the present invention.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and do not limit the invention.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, the mobile terminal 100 may include: an RF (Radio Frequency) unit 101, a WiFi module 102, an audio output unit 103, an a/V (audio/video) input unit 104, a sensor 105, a display unit 106, a user input unit 107, an interface unit 108, a memory 109, a processor 110, and a power supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000 ), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to a short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send emails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the mobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The mobile terminal 100 also includes at least one sensor 105, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of the display panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off the display panel 1061 and/or a backlight when the mobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, can collect touch operations of a user (e.g., operations of a user on the touch panel 1071 or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory) thereon or nearby and drive the corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. In particular, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, without limitation.
Further, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation on or near the touch panel, the touch panel is transmitted to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal 100 and external devices.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, etc. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the mobile terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The mobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, the power supply 111 may be logically connected to the processor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, the mobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
Based on the hardware structure of the mobile terminal, the invention provides various embodiments of the method.
Example one
Fig. 2 is a flowchart of a first embodiment of the screen projection connection method of the present invention. A method of screen-casting connectivity, the method comprising:
s1, creating a link of a preset monitoring port in system service of a thrown end so that the thrown end scans a network address connected with the preset monitoring port in a local area network;
s2, after receiving a handshake message which is sent by the screen projection end and is successfully connected, detecting an idle port of the projected end, and switching the preset monitoring port into the idle port according to a detection result;
s3, starting a preset screen projection application through the system service, and transmitting the idle port to an application service of the screen projection application so that the screen projection application monitors the idle port after the screen projection application is started;
and S4, the system service sends the idle port to the screen projection end so that the screen projection end and the screen projection application establish a screen projection link through the idle port.
In the embodiment, in view of saving power consumption, the background is not allowed to always perform screen projection, but screen projection needs to be detected, which is contradictory. Based on the above problem, the present embodiment considers that the system of the dropped terminal itself has many program processes running frequently, and can borrow them to help the listening port. Based on the above thought, the following is realized: firstly, in a system service system server process of a system to be launched, a socket binding fixed port is pulled up, the assumption is 12345, at this time, the system server only has a 12345 port, the system server process is always in operation, the increase of power consumption for the system is almost ignored, and compared with the method that the screen launching operation is always carried out, the cost is much lower; then, after the computer end is opened, scanning each IP network address of the local area network in the local area network, and seeing whether a 12345 port of the network address can be linked or not, if so, linking is performed, and a handshake message is sent, if the system server receives the link and receives the handshake message, a handshake response is given, and at the moment, the computer end can know that the equipment of the network address belongs to the equipment capable of screen projection, and then the equipment is displayed in a list of the computer end; finally, after the detection is successful, the screen-casting application needs to be formally connected for screen-casting operation, specifically, the systemserver sends a handshake success message and also sends a real port number of a next screen-casting application, wherein the port number may be non-fixed, so that the situation that the screen cannot be cast after a fixed port number is occupied and malicious links of other illegal programs are prevented is avoided, the systemserver sets one port number according to the current system port number use condition, simultaneously pulls up the screen-casting application, transfers the generated port number, the screen-casting application can run, and binds a new port number. Therefore, after the computer serving as the client receives the real screen projection port number, recording is carried out, and the user clicks a screen projection equipment button to start real connection and execute the created screen projection task.
In another example, first, system server detects a busy port in the system after receiving a connection and a handshake message, and uses the busy port if a fixed port, such as "23456", is not busy, otherwise, changes to another unoccupied port, such as "23457"; then, the system mserver starts the screen application again, pulls up the screen application corresponding to the service and transfers the unoccupied port number such as "23456", monitors the unoccupied port after the screen application is started, and responds to handshake of the computer terminal by the system mserver simultaneously, and simultaneously carries the port number "23456"; and finally, after the screen projection application is started, the computer end also responds manually, and at the moment, the computer end can be directly connected with the screen projection application in a screen projection manner.
The method has the advantages that the link of the preset monitoring port is established in the system service of the thrown end, so that the throwing end scans the network address connected with the preset monitoring port in the local area network; after receiving a handshake message which is sent by the screen projection end and is successfully connected, detecting an idle port of the projected end, and switching the preset monitoring port into the idle port according to a detection result; starting a preset screen projection application through the system service, and transmitting the idle port to an application service of the screen projection application so that the screen projection application monitors the idle port after the screen projection application is started; and sending the idle port to the screen projection end by the system service so that the screen projection end and the screen projection application establish a screen projection link through the idle port. The method and the device have the advantages that a humanized screen projection connection scheme is realized, power consumption before the screen projection connection is established is reduced, execution efficiency, stability and success rate during the screen projection connection establishment are improved, and use experience of a user on screen projection functions is enhanced.
Example two
Fig. 3 is a flowchart of a second embodiment of the screen projection connection method according to the present invention, where based on the above embodiments, the creating a link of a preset monitor port in a system service of a projected terminal to enable the screen projection terminal to scan a network address connected to the preset monitor port in a local area network includes:
s11, obtaining historical screen projection information of the projected end, and selecting a monitoring port as the preset monitoring port according to the historical screen projection information;
and S12, after the screen projection end is started, sequentially trying to connect with the preset monitoring port according to the preset range of the network address through the screen projection service of the screen projection end.
Optionally, in this embodiment, the historical screen projection information includes device information of a historical screen projection end and an applicable port number range associated with the device information.
Optionally, in this embodiment, one listening port is selected from the port number range as the preset listening port.
The method has the advantages that historical screen projection information of the projected end is obtained, and one monitoring port is selected as the preset monitoring port according to the historical screen projection information; after the screen projection end is started, connection with the preset monitoring port is tried in sequence according to the preset range of the network address through the screen projection service of the screen projection end. The method and the device have the advantages that a humanized screen projection connection scheme is realized, power consumption before the screen projection connection is established is reduced, execution efficiency, stability and success rate during the screen projection connection establishment are improved, and use experience of a user on screen projection functions is enhanced.
EXAMPLE III
Fig. 4 is a flowchart of a third embodiment of the screen-casting connection method, where based on the above embodiments, after receiving a handshake message that is sent by the screen-casting end and is successfully connected, the detecting is performed on an idle port of the cast end, and the preset listening port is switched to the idle port according to a detection result, including:
s21, when the screen projection end determines that a network address can be connected with the projected end, establishing network connection between the screen projection end and the projected end through the network address and the preset monitoring port;
and S22, the screen projection end sends the handshake message of successful connection to the projected end through the network connection.
Optionally, in this embodiment, the detection range and the detection period of the network address are determined according to the operating state and the network state of the screen projection terminal.
Optionally, in this embodiment, a network address connectable to the dropped terminal is determined according to the detection range and the detection period.
The method has the advantages that when the screen projection end determines that a network address can be connected with the projected end, the network connection between the screen projection end and the projected end is established through the network address and the preset monitoring port; and the screen projection end sends the handshake message of successful connection to the projected end through the network connection. The method and the device have the advantages that a humanized screen projection connection scheme is realized, power consumption before the screen projection connection is established is reduced, execution efficiency, stability and success rate during the screen projection connection establishment are improved, and use experience of a user on screen projection functions is enhanced.
Example four
Fig. 5 is a flowchart of a fourth embodiment of the screen-casting connection method, where based on the foregoing embodiments, after receiving a handshake message that is sent by the screen-casting end and is successfully connected, the method detects an idle port of the cast end, and switches the preset monitor port to the idle port according to a detection result, and further includes:
s23, after the system service receives the handshake message, the thrown terminal sends a handshake response message corresponding to the handshake message to the screen throwing terminal through the network connection;
and S24, the screen projection end determines that the network equipment corresponding to the handshake response message belongs to the projected end, and displays the projected end and related operation options in an interface of the screen projection end.
Optionally, in this embodiment, after the screen projection end determines that the network device corresponding to the handshake response message belongs to the projected end, screen projection data recorded by the screen projection end is obtained.
Optionally, in this embodiment, whether historical port data exists is queried according to the screen projection data, and a current attempted port is determined according to a high-frequency port in the port data or a previous screen projection port.
The method has the advantages that after the system service receives the handshake message, the thrown terminal sends a handshake response message corresponding to the handshake message to the screen throwing terminal through the network connection; and determining that the network equipment corresponding to the handshake response message belongs to the screen-projected end by the screen-projected end, and displaying the screen-projected end and related operation options in an interface of the screen-projected end. The humanized screen projection connection scheme is realized, the power consumption before the screen projection connection is established is reduced, the execution efficiency, the stability and the success rate of the screen projection connection during the establishment are improved, and the use experience of a user on the screen projection function is enhanced.
EXAMPLE five
Fig. 6 is a flowchart of a fifth embodiment of the screen-casting connection method, where based on the above embodiments, the starting a preset screen-casting application by the system service and transmitting the idle port to an application service of the screen-casting application, so that the screen-casting application monitors the idle port after the starting is completed, where the method includes:
s31, starting a preset screen projection application by the system service, and determining the idle port corresponding to the screen projection application;
s32, transmitting the idle port to the application service of the screen projection application through the system service.
Optionally, in this embodiment, a high-frequency port or a previous screen projection port is selected from the local historical screen projection information of the projected terminal, and whether the selected port is a current idle port is determined.
Optionally, in this embodiment, if the selected port is an idle port, the idle port is transferred to the application service of the screen projection application through the system service.
The method has the advantages that the preset screen projection application is started through the system service, and the idle port corresponding to the screen projection application is determined; communicating, by the system service, the idle port to the application service of the screen casting application. The humanized screen projection connection scheme is realized, the power consumption before the screen projection connection is established is reduced, the execution efficiency, the stability and the success rate of the screen projection connection during the establishment are improved, and the use experience of a user on the screen projection function is enhanced.
EXAMPLE six
Fig. 7 is a flowchart of a sixth embodiment of the screen projection connection method, where based on the above embodiments, the starting a preset screen projection application by the system service and transmitting the idle port to an application service of the screen projection application so that the screen projection application monitors the idle port after the starting is completed, and the method further includes:
s33, the system service carries the idle port in the handshake response message sent to the screen projection end;
and S34, when the cast terminal receives the idle port, replacing the preset monitoring port by the idle port.
Optionally, in this embodiment, when the dropped terminal receives the idle port, it is detected whether the idle port is consistent with its own trial port, and if so, the preset listening port is replaced by the idle port.
Optionally, in this embodiment, the system service carries a plurality of idle ports in the handshake response message sent to the screen projection end, and when the screen projection end receives the plurality of idle ports, detects whether a port that is consistent with the plurality of trial ports of the system service exists in the plurality of idle ports, and if so, selects a consistent port as the idle port, and replaces the preset monitoring port with the idle port.
The method has the advantages that the system service carries the idle port in the handshake response message sent to the screen projection end; and when the cast terminal receives the idle port, replacing the preset monitoring port by the idle port. The humanized screen projection connection scheme is realized, the power consumption before the screen projection connection is established is reduced, the execution efficiency, the stability and the success rate of the screen projection connection during the establishment are improved, and the use experience of a user on the screen projection function is enhanced.
EXAMPLE seven
Fig. 8 is a flowchart of a seventh embodiment of the connection method for screen projection according to the present invention, where based on the above embodiments, the sending, by the system service, the idle port to the screen projection end to enable the screen projection end and the screen projection application to establish a screen projection link through the idle port includes:
s41, recording the idle port by the screen projection end;
and S42, determining the idle port as a current screen projection link port of the screen projection end and the screen projection end.
Optionally, in this embodiment, the screen projection end records the idle port, and detects whether the current running program occupies the idle port.
Optionally, in this embodiment, if the idle port is not occupied, it is determined that the idle port is a current screen-casting link port of the screen-casting end and the cast end, otherwise, a message of reselecting the idle port is returned to the cast end.
The method has the advantages that the idle port is recorded by the screen projection end; and determining the idle port as a screen projection link port of the screen projection end and the projected end currently. The humanized screen projection connection scheme is realized, the power consumption before the screen projection connection is established is reduced, the execution efficiency, the stability and the success rate of the screen projection connection during the establishment are improved, and the use experience of a user on the screen projection function is enhanced.
Example eight
Fig. 9 is a flowchart of an eighth embodiment of the screen-casting connection method, where based on the above embodiments, the system service sends the idle port to the screen-casting end, so that the screen-casting end and the screen-casting application establish a screen-casting link through the idle port, and the method further includes:
s43, receiving a screen projection starting instruction input to the screen projection application by a user at the projected end;
and S44, the screen projecting link of the projected end and the screen projecting end is established according to the screen projecting starting instruction and the screen projecting link.
Optionally, in this embodiment, after the screen-casting link between the cast terminal and the screen-casting terminal is successfully created according to the screen-casting starting instruction and the screen-casting link, information of the screen-casting link is recorded to local historical screen-casting information at the cast terminal.
Optionally, in this embodiment, after the screen projecting link between the projected end and the screen projecting end is successfully created according to the screen projecting start instruction and the screen projecting link, information of the screen projecting link is recorded in local historical port data at the screen projecting end.
The method has the advantages that the screen projection starting instruction input to the screen projection application by the user is received at the projected end; and starting to create the screen projecting link of the projected end and the screen projecting end according to the screen projecting starting instruction and the screen projecting link. The humanized screen projection connection scheme is realized, the power consumption before the screen projection connection is established is reduced, the execution efficiency, the stability and the success rate of the screen projection connection during the establishment are improved, and the use experience of a user on the screen projection function is enhanced.
Example nine
Based on the foregoing embodiments, the present invention further provides a screen projection connection device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the computer program is executed by the processor, the steps of the screen projection connection method as described in any one of the above are implemented.
It should be noted that the device embodiment and the method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment, and technical features in the method embodiment are correspondingly applicable in the device embodiment, which is not described herein again.
Example ten
Based on the foregoing embodiment, the present invention further provides a computer-readable storage medium, where a screen-projection connection program is stored, and when executed by a processor, the screen-projection connection program implements the steps of the screen-projection connection method as described in any one of the foregoing embodiments.
It should be noted that the media embodiment and the method embodiment belong to the same concept, and specific implementation processes thereof are detailed in the method embodiment, and technical features in the method embodiment are applicable to the media embodiment, which is not described herein again.
It should be noted that, in this document, 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 of 8230, and" comprising 8230does not exclude the presence of additional like elements in a process, method, article, or apparatus comprising the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the particular illustrative embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, but is intended to cover various modifications, equivalent arrangements, and equivalents thereof, which may be made by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A screen-projection connection method, the method comprising:
creating a link of a preset monitoring port in system service of a thrown end so that the thrown end scans a network address connected with the preset monitoring port in a local area network;
after receiving a handshake message which is sent by the screen projection end and is successfully connected, detecting an idle port of the projected end, and switching the preset monitoring port into the idle port according to a detection result;
starting a preset screen projection application through the system service, and transmitting the idle port to an application service of the screen projection application so as to monitor the idle port after the screen projection application is started;
and sending the idle port to the screen projection end by the system service so that the screen projection end and the screen projection application establish a screen projection link through the idle port.
2. The screen-casting connection method of claim 1, wherein the creating a link of a preset listening port in a system service of the cast terminal so that the screen-casting terminal scans a network address connected to the preset listening port in a local area network comprises:
obtaining historical screen projection information of the projected terminal, and selecting a monitoring port as the preset monitoring port according to the historical screen projection information;
after the screen projection end is started, sequentially trying to be connected with the preset monitoring port according to the preset range of the network address through the screen projection service of the screen projection end.
3. The screen-casting connection method of claim 2, wherein the detecting an idle port of the cast terminal after receiving a handshake message of successful connection sent by the screen-casting terminal, and switching the preset listening port to the idle port according to a detection result comprises:
when the screen projection end determines that a network address can be connected with the projected end, establishing network connection between the screen projection end and the projected end through the network address and the preset monitoring port;
and the screen projection end sends the handshake message of successful connection to the projected end through the network connection.
4. The screen-casting connection method of claim 3, wherein after receiving a handshake message that a connection is successful and sent by the screen-casting terminal, the method detects an idle port of the cast terminal, and switches the preset listening port to the idle port according to a detection result, further comprising:
after the system service receives the handshake message, the thrown terminal sends a handshake response message corresponding to the handshake message to the screen throwing terminal through the network connection;
and the screen projection end determines that the network equipment corresponding to the handshake response message belongs to the projected end, and displays the projected end and related operation options in an interface of the screen projection end.
5. The screen-casting connection method of claim 4, wherein the starting of a preset screen-casting application through the system service and the delivery of the idle port to an application service of the screen-casting application are performed so that the screen-casting application monitors the idle port after the starting is completed, and the method comprises:
starting a preset screen projection application by the system service, and determining the idle port corresponding to the screen projection application;
communicating, by the system service, the idle port to the application service of the screen casting application.
6. The screen-casting connection method of claim 5, wherein the starting of a preset screen-casting application through the system service and the delivery of the idle port to an application service of the screen-casting application are performed so that the screen-casting application monitors the idle port after the completion of the starting, and further comprising:
the system service carries the idle port in the handshake response message sent to the screen projection end;
and when the cast terminal receives the idle port, replacing the preset monitoring port by the idle port.
7. The screen-projection connection method of claim 6, wherein the sending, by the system service, the idle port to the screen-projection end to enable the screen-projection end and the screen-projection application to establish a screen-projection link through the idle port comprises:
recording the idle port by the screen projection end;
and determining the idle port as a screen projection link port of the screen projection end and the screen projection end at present.
8. The screen-projection connection method of claim 7, wherein the system service sends the idle port to the screen-projection end so that the screen-projection end and the screen-projection application establish a screen-projection link through the idle port, and further comprising:
receiving a screen projection starting instruction input to the screen projection application by a user at the projected end;
and starting to create the screen projection link of the projected end and the screen projection end according to the screen projection starting instruction and the screen projection link.
9. A screen-casting connection apparatus, characterized in that the apparatus comprises a memory, a processor and a computer program stored on the memory and executable on the processor, which computer program, when executed by the processor, carries out the steps of the screen-casting connection method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that a screen-casting connection program is stored thereon, which when executed by a processor implements the steps of the screen-casting connection method according to any one of claims 1 to 8.
CN202211189540.XA 2022-09-28 2022-09-28 Screen projection connection method and device and computer readable storage medium Pending CN115604520A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211189540.XA CN115604520A (en) 2022-09-28 2022-09-28 Screen projection connection method and device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211189540.XA CN115604520A (en) 2022-09-28 2022-09-28 Screen projection connection method and device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115604520A true CN115604520A (en) 2023-01-13

Family

ID=84844838

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211189540.XA Pending CN115604520A (en) 2022-09-28 2022-09-28 Screen projection connection method and device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115604520A (en)

Similar Documents

Publication Publication Date Title
CN110972334A (en) Bluetooth pairing connection method and device and readable storage medium
CN109889757B (en) Video call method and terminal equipment
CN110865745A (en) Screen capturing method and terminal equipment
CN110851220A (en) Information output method and electronic equipment
US20220394786A1 (en) Session Information Processing Method, and Electronic Device
CN107864086B (en) Information rapid sharing method, mobile terminal and computer readable storage medium
CN111158815B (en) Dynamic wallpaper blurring method, terminal and computer readable storage medium
CN109788114B (en) Call processing method and terminal
CN111061404A (en) Control method and first electronic device
CN111447598B (en) Interaction method and display device
CN111314903B (en) Information sharing method and electronic equipment
CN111209072B (en) Application sharing method, first electronic device and readable storage medium
CN109309741B (en) Terminal and control method thereof
CN109947617B (en) Method, terminal and readable storage medium for monitoring display content of application interface
CN109067976B (en) Desktop automatic switching method, mobile terminal and computer readable storage medium
CN111142998A (en) Sharing method of background application and electronic equipment
CN109521916B (en) File processing method based on flexible screen, mobile terminal and storage medium
CN108811177B (en) Communication method and terminal
CN111367448B (en) Application function execution method and device, electronic equipment and storage medium
CN111522674B (en) Cross-application processing method of multimedia content and electronic equipment
CN111752449B (en) Screen control method and device
CN114064179A (en) Display mode adaptation method, terminal and storage medium
CN115604520A (en) Screen projection connection method and device and computer readable storage medium
CN108683793B (en) Display method of application icon and mobile terminal
CN112463234A (en) Shutdown management method and device, intelligent terminal and readable storage medium

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