Detailed Description
In order to make the technical solutions and advantages of the embodiments of the present application more apparent, the following further detailed description of the exemplary embodiments of the present application with reference to the accompanying drawings makes it clear that the described embodiments are only a part of the embodiments of the present application, and are not exhaustive of all embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
Fig. 1 is a flowchart of a wireless connection method between a PC and a terminal according to a first embodiment of the present application.
According to an embodiment of the present application, a method for connecting a PC to a terminal, which is applied to a PC client, includes the following steps:
s102, confirming that the associated terminal client exists in the local area network according to the detection data packet;
s104, acquiring terminal information of a related terminal client;
and S106, triggering the PC to be wirelessly connected to the terminal according to the terminal information.
Those skilled in the art will appreciate that a PC client is a client installed on a PC; the terminal client is the client installed on the terminal. The terminal client can be installed on a mobile terminal such as a mobile phone and a tablet computer which can be accessed to a wireless local area network; the terminal information is information for identifying the mobile terminal.
The local area network of the PC client is the local area network which is currently accessed by the PC; the existence of the associated terminal client in the local area network means that the terminal where the associated terminal client is located is accessed to the local area network. During specific implementation, the PC can be accessed to the local area network in a wireless mode or in a wired mode; the terminal typically accesses the local area network in a wireless manner. Those skilled in the art will appreciate that, in order to realize wireless connection between the PC and the terminal, the PC and the terminal are both provided with a wireless communication module such as a wireless network card.
In specific implementation, the association relationship between the terminal client and the PC client can be established in a manner that the terminal where the terminal client is located and the PC where the PC client is located are successfully connected in a wired or wireless manner within a predetermined time, the terminal client and the PC client are logged in by the same account, or the terminal client and the PC client are logged in by different accounts belonging to the same user; those skilled in the art will understand that the terminal client and the PC client can be associated with each other, and the association relationship between the terminal client and the PC client can be established. More specifically, those skilled in the art may establish the association relationship between the terminal client and the PC client by recording the unique identifier of the latest successfully connected terminal/PC on the PC client/terminal client. To avoid confusion, typically within a lan, one PC client is associated with only one end client. Preferably, the Wireless connection mode between the PC and the terminal is WIFI (Wireless-Fidelity) connection.
The speed of WIFI is different according to different standards of the wireless network card. Wherein the highest IEEE802.11b is 11Mbps, the highest IEEE802.11a is 54Mbps, the highest IEEE802.11g is also 54Mbps, and the Netgear SUPER g technology can improve the speed to 108 Mbps.
In specific implementation, the PC and the terminal may be connected by a Wireless method such as a Wireless LAN authentication and Privacy Infrastructure (WAPI).
Therefore, the user can realize the connection between the PC and the terminal in a wireless mode such as WIFI or WAPI, and the user can conveniently and quickly experience the high data transmission rate between the PC and the terminal without depending on a USB line.
By adopting the method for connecting the PC and the terminal in the embodiment of the application, after confirming that the related PC and the terminal are in the same local area network according to the detection data packet and the PC acquires the information of the terminal, triggering the PC to be wirelessly connected to the terminal; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
In the method for connecting the PC and the terminal in the prior art, a user needs to start a PC client at first, then click on a main interface of the PC client to enter a mobile phone connection interface, and after entering the mobile phone connection interface, the PC client triggers the PC to scan whether a mobile phone provided with a mobile phone assistant terminal client exists in a local area network of the PC or not; if so, listing, confirming the mobile phone associated with the PC client from the listed mobile phone list by the user, and then executing subsequent operations by the PC client to enable the PC to be wirelessly connected to the mobile phone.
By adopting the scheme in the prior art, a user selects a mobile phone associated with a PC client, and if a plurality of mobile phones provided with mobile phone assistant terminal clients exist in a local area network, the user needs to spend several seconds to find the mobile phone which the user wants to connect, so that the user experience is reduced.
Optionally, confirming that the associated terminal client exists in the local area network according to the probe packet specifically includes: the PC client sends a first detection data packet in a local area network; when first response data aiming at the first detection data packet from the associated terminal client in the local area network is received, confirming that the associated terminal client exists in the local area network, wherein the first response data carries terminal information; the acquiring of the terminal information of the terminal client specifically includes: the terminal information is extracted from the first response data.
If the terminal client associated with the PC client does not exist in the lan, the PC client may retransmit the probe data packet after a predetermined time interval, or may not retransmit the probe data packet, which is not limited in this application.
In a specific implementation, the first probe packet and the first response data may be UDP (User datagram protocol) packets; the PC client may send the first probe packet in the local area network in a multicast form, or in a broadcast form. It should be understood that the above examples are for the purpose of facilitating the implementation of the present application by those skilled in the art, and are not intended to limit the present application.
Those skilled in the art should understand that, in order to enable the PC or the terminal that receives the first probe packet to identify and return response data, the first probe packet sent by the PC client carries a Unique Identifier of the PC client in the local area network, where the Unique Identifier may be an IP address of the PC, or may be a Unique Identifier that is allocated by the server for the PC client, such as a randomly generated 32-bit GUID (global Unique Identifier): 2cf2ecc8-166d-43ce-8759-38735f842211 and the like.
In specific implementation, the terminal client determines whether the PC client is associated with the PC client according to the first probe packet by using the following method: and when the terminal client receives the first detection data packet, extracting the identification of the PC from the detection data packet, comparing the identification with the identification of the associated PC stored in the terminal client, if the identification is consistent with the identification of the associated PC stored in the terminal client, judging that the PC client sending the first detection data packet is the associated PC client, and if the identification is not consistent with the identification of the associated PC client, judging that the PC client sending the first detection data packet is not the associated PC client. It should be understood that the above examples are for the purpose of facilitating the implementation of the present application by those skilled in the art, and are not intended to limit the present application.
By adopting the method in the embodiment of the application, the PC client can automatically confirm the terminal client related to the PC client in the form of sending the network detection packet and replying the response data by the related terminal client in the local area network, and the process does not need the participation of a user, so that the operation of the user is reduced, and the user experience is improved.
Preferably, the PC client start triggers the PC client to send the first probe packet within the lan. In the specific implementation of the present application, the PC client may also send the information after detecting that the PC is connected to the lan after being started, or may send the information at any other preset time.
By adopting the scheme in the embodiment of the application, the PC client side immediately triggers the first detection data packet to be sent in the local area network after being started, the process of connecting to the terminal can be immediately initiated after the user starts the PC client side, the user does not need to perform more operations, and the user experience is improved.
Optionally, confirming that the associated terminal client exists in the local area network according to the probe packet specifically includes: receiving a second detection data packet, wherein the second detection data packet is sent by the terminal client in the local area network; judging whether the terminal client is associated with the terminal client according to the second detection data packet, and if so, confirming that the associated terminal client exists in the local area network; the acquiring of the terminal information of the terminal client specifically includes: sending second response data for the second probe data packet to the associated terminal client; and receiving terminal information sent by the terminal client.
In a specific implementation, the second probe packet and the second response data may be UDP (User datagram protocol) packets; the second probe packet may be transmitted in a multicast format within the local area network, or may be transmitted in a broadcast format. It should be understood that the above examples are for the purpose of facilitating the implementation of the present application by those skilled in the art, and are not intended to limit the present application.
Those skilled in the art should understand that, in order to enable the PC or the terminal that receives the second probe packet to identify and return response data, the second probe packet sent by the terminal client carries a unique identifier of the terminal client in the local area network, where the unique identifier may be an IP address of the terminal, or may be a unique identifier that is allocated by the server to the terminal client, such as a terminal client connection code: GK5R9K, and the like.
In specific implementation, the PC client determines whether the terminal client is associated with the terminal client according to the second probe packet by using the following method: and when the PC client receives the second detection data packet, extracting the identifier of the sending terminal from the detection data packet, comparing the identifier with the identifier of the associated terminal stored by the PC client, if the identifier is consistent with the identifier of the associated terminal, judging that the terminal client sending the second detection data packet is the associated terminal client, and if the identifier is not consistent with the associated terminal client, judging that the terminal client sending the second detection data packet is not the associated terminal client. It should be understood that the above examples are for the purpose of facilitating the implementation of the present application by those skilled in the art, and are not intended to limit the present application.
By adopting the method in the embodiment of the application, when the PC client receives the second detection data packet, the existence of the associated terminal client is judged according to the content carried in the data packet, so that the PC client can automatically confirm the terminal client associated with the PC client, the participation of a user is not needed in the process, the operation of the user is reduced, and the user experience is improved.
In the prior art, when a user PC or a terminal does not have a WIFI environment, the connection between the terminal and the PC cannot be realized, so that the user is inconvenient.
Optionally, before determining that the associated terminal client exists in the local area network according to the probe packet, the method further includes: the PC client triggers the PC to establish a WIFI hotspot, and the terminal is connected to the local area network through the hotspot.
The PC can establish a WIFI hotspot (soft AP) through the wireless network card, so that the terminal and the PC can access the same local area network, the connection between the terminal and the PC is realized, and the user experience is improved.
Optionally, before determining that the associated terminal client exists in the local area network according to the probe packet, the method further includes: the terminal client triggers the terminal to establish a WIFI hotspot, and the PC is connected to the local area network through the hotspot.
The terminal can establish a WIFI hotspot through the wireless network card, so that the terminal and the PC can access the same local area network, the connection between the terminal and the PC is realized, and the user experience is improved.
Preferably, before confirming that the associated terminal client exists in the local area network according to the probe packet, the method further includes: prompting whether to connect the PC and the terminal on a PC screen or a terminal screen; the triggering of the wireless connection of the PC to the terminal according to the terminal information specifically comprises: and when the user confirms the connection, triggering the PC to be wirelessly connected to the terminal according to the terminal information.
In specific implementation, whether the terminal is connected or not is prompted on a PC screen or a terminal screen in various ways, for example, a prompt box pops up at the lower right corner of the PC screen; popping up a prompt box in the middle of a PC screen; flashing at the lower right corner of the PC, and popping up a prompt box after a user clicks; popping up a prompt box in the middle of a terminal screen, and the like; it should be understood by those skilled in the art that the above-mentioned modes are only examples and are not intended to limit the present application as long as the prompt is provided for the user.
If the user selects not to connect, closing the prompt box; or if the user does not click the select button, the prompt box is automatically closed after a predetermined time, for example, 10 s.
Taking a WIFI connection process of a PC and a mobile phone which are accessed to the same wireless local area network as an example, after the PC is started to access the wireless local area network and automatically logs in a PC client, the PC client finds that the mobile phone of a user is also accessed to the same wireless local area network; the PC acquires the related information of the mobile phone; the PC client then pops up a prompt asking the user "do you need to connect to your phone? If the user clicks the 'yes' button, the PC client triggers the PC to start the wireless communication module and is connected to the mobile phone through WIFI; if the user clicks 'no', the PC client closes the prompt box; or if the user does not click the prompt button, the prompt box is automatically closed after 10 s.
By adopting the scheme in the embodiment of the application, when the PC client finds the associated terminal clients accessed to the same local area network, the terminal client or the PC client is triggered to inquire whether to connect or not to the user, and wireless connection/disconnection is carried out according to the selection of the user; the option of whether the PC is connected with the terminal is given to the user, so that unnecessary resource consumption caused by connection of the PC and the terminal under the condition that the user does not need the option is avoided, resources are saved, and user experience is improved.
In the prior art method for connecting the PC and the terminal, after a user confirms a mobile phone associated with a PC client from a listed mobile phone list, the PC acquires mobile phone information of the mobile phone and then wirelessly connects to the mobile phone.
By adopting the scheme in the prior art, after the user confirms the connection, the PC can acquire the terminal information again, even if the acquisition is successful, a certain delay can exist, and if the acquisition is failed, the connection is still unsuccessful and is inconsistent with the user expectation, the user experience is reduced.
Preferably, the terminal information includes a terminal IP address and a port number. In specific implementation of the present application, the terminal information may further include other information of the terminal, such as a terminal name, a user mobile phone number, and the like.
By adopting the scheme in the embodiment of the application, before inquiring whether the terminal is connected to the user, the IP address and the port number of the terminal information are acquired, preparation is made for subsequent wireless connection, once the user confirms the connection, the terminal can be quickly connected to the user, the time delay caused by acquiring the terminal information after the user confirms the connection is avoided, the connection power after the user confirms the connection can be improved, and the user experience is improved.
Fig. 2 is a flowchart of a method for connecting a PC and a terminal according to a second embodiment of the present application.
As shown in fig. 2, the method for connecting a PC and a terminal applied to a terminal client according to the second embodiment of the present application includes the following steps:
s202, confirming that the associated PC client exists in the local area network according to the detection data packet;
s204, sending terminal information to the associated PC client;
s206, the terminal is triggered to receive a wireless connection establishment request sent by the PC according to the terminal information so as to establish wireless connection with the PC.
As will be understood by those skilled in the art, a terminal client is a client installed on a terminal; the PC client is a client installed on the PC. The terminal client can be installed on a mobile terminal such as a mobile phone and a tablet computer which can be accessed to a wireless local area network; the terminal information is information for identifying the mobile terminal.
The local area network of the PC client is the local area network which is currently accessed by the PC; the existence of the associated terminal client in the local area network means that the terminal where the associated terminal client is located is accessed to the local area network. During specific implementation, the PC can be accessed to the local area network in a wireless mode or in a wired mode; the terminal typically accesses the local area network in a wireless manner. Those skilled in the art will appreciate that, in order to realize wireless connection between the PC and the terminal, the PC and the terminal are both provided with a wireless communication module such as a wireless network card.
In specific implementation, the association relationship between the terminal client and the PC client can be established in a manner that the terminal where the terminal client is located and the PC where the PC client is located are successfully connected in a wired or wireless manner within a predetermined time, the terminal client and the PC client log in the same account, or different accounts belonging to the same user, and the like; those skilled in the art will understand that the terminal client and the PC client can be associated with each other, and the association relationship between the terminal client and the PC client can be established. More specifically, those skilled in the art may establish the association relationship between the terminal client and the PC client by recording the unique identifier of the latest successfully connected terminal/PC on the PC client/terminal client. To avoid confusion, typically within a lan, one PC client is associated with only one end client.
Preferably, the wireless connection establishment request accepted by the terminal is a WIFI connection establishment request.
In specific implementation, the PC and the terminal can be connected in a wireless manner such as a WAPI.
Therefore, the user can conveniently and quickly experience the high data transmission rate between the PC and the terminal without depending on the USB cable by connecting the PC and the terminal through the WIFI.
Taking a WIFI connection process of a PC and a mobile phone which are accessed to the same wireless local area network as an example, after the mobile phone is started to access the wireless local area network and automatically logs in a terminal client, the terminal client finds that the PC of a user is also accessed to the same wireless local area network; after the terminal client sends the mobile phone related information to the PC client; waiting for the PC end to send a wireless connection establishment request; if the request is received, accepting; if no request is received, no processing is performed.
By adopting the method for connecting the PC and the terminal in the embodiment of the application, when the related PC and the terminal are confirmed to be in the same local area network according to the detection data packet, the terminal sends terminal information to the PC, and then receives a wireless connection establishment request sent by the PC to establish wireless connection between the terminal and the PC; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
In the method for connecting the PC and the terminal in the prior art, if a user wants to trigger the establishment of wireless connection between the PC and the terminal from the terminal side, the user needs to open a main interface of a PC client, then enters a two-dimension code connection interface to generate a two-dimension code, simultaneously opens a two-dimension code scanning tool of the terminal, scans the two-dimension code, and after the scanning is completed, the terminal requests the PC to establish wireless connection to complete the wireless connection between the PC and the terminal.
By adopting the scheme in the prior art, a user needs to open the PC client and the terminal client simultaneously, and after clicking operation for many times, the user needs to scan the two-dimensional code for connection, so that the operation is complex, and the user who is unfamiliar with the intelligent terminal is difficult to smoothly complete.
By adopting the technical scheme of the embodiment of the application, the terminal client sends the terminal information to the PC client when confirming that the associated PC client exists in the local area network, and triggers the PC side to initiate the wireless connection request.
Optionally, confirming that the associated PC client exists in the local area network according to the probe packet specifically includes: receiving a first detection data packet, wherein the first detection data packet is sent by a PC client in a local area network; judging whether the PC client is associated with the PC client or not according to the first detection data packet; if yes, confirming that the associated PC client exists in the local area network; sending terminal information to the associated PC client, specifically comprising: and sending first response data to the associated PC client, wherein the first response data carries terminal information.
In an implementation, the first probe packet and the first response packet may be UDP packets; the first probe packet may be transmitted in a multicast form within the local area network or in a broadcast form. It should be understood that the above examples are for the purpose of facilitating the implementation of the present application by those skilled in the art, and are not intended to limit the present application.
Those skilled in the art should understand that, in order to enable the PC or the terminal that receives the first probe packet to identify and return response data, the first probe packet sent by the PC client carries a unique identifier of the PC client in the local area network, where the unique identifier may be an IP address of the PC, or a unique identifier that is allocated by the server for the PC client, such as a randomly generated 32-bit GUID: 2cf2ecc8-166d-43ce-8759-38735f842211 and the like.
In specific implementation, the terminal client determines whether the PC client is associated with the PC client according to the first probe packet by using the following method: when the terminal client receives the first detection data packet, the identification of the sending PC is extracted from the detection data packet, the identification is compared with the identification of the associated PC stored in the terminal client, if the identification is consistent with the identification of the associated PC stored in the terminal client, the PC client sending the first detection data packet is judged to be the associated PC client, and if the identification is not consistent with the identification of the associated PC stored in the terminal client, the PC client sending the first detection data packet is judged not to be the associated PC client. It should be understood that the above examples are for the purpose of facilitating the implementation of the present application by those skilled in the art, and are not intended to limit the present application.
By adopting the method in the embodiment of the application, when the terminal client receives the first detection data packet, the terminal client judges that the associated PC client exists according to the content carried in the data packet, and sends terminal information to the associated PC client so as to trigger the PC client to initiate a wireless connection request; the terminal client can automatically confirm the PC client related to the terminal client and trigger the PC client to initiate the wireless connection request, and the process does not need participation of a user, so that the operation of the user is reduced, and the user experience is improved.
Optionally, confirming that the associated PC client exists in the local area network according to the probe packet specifically includes: sending a second detection data packet in the local area network; and when second response data aiming at the second detection data packet from the associated PC client is received, confirming that the associated PC client exists in the local area network.
If the PC client associated with the terminal client does not exist in the local area network, the terminal client may send the probe packet again after a predetermined time interval, or may not send the probe packet, which is not limited in this application.
In an implementation, the second probe packet and the second response packet may be UDP packets; the terminal client may send the second probe packet in the local area network in a multicast manner, or may send the second probe packet in a broadcast manner. It should be understood that the above examples are for the purpose of facilitating the implementation of the present application by those skilled in the art, and are not intended to limit the present application.
Those skilled in the art should understand that, in order to enable the PC or the terminal that receives the second probe packet to identify and return response data, the second probe packet sent by the terminal client carries a unique identifier of the terminal client in the local area network, where the unique identifier may be an IP address of the terminal, or may be a unique identifier that is allocated by the server to the terminal client, such as a terminal client connection code: GK5R9K, and the like.
In specific implementation, the PC client determines whether the terminal client is associated with the terminal client according to the second probe packet by using the following method: and when the PC client receives the second detection data packet, extracting the identifier of the terminal from the detection data packet, comparing the identifier with the associated terminal identifier stored in the PC client, if the identifier is consistent with the associated terminal identifier stored in the PC client, judging that the terminal client sending the second detection data packet is the associated terminal client, and if the identifier is not consistent with the associated terminal identifier stored in the PC client, judging that the terminal client sending the second detection data packet is not the associated terminal client. It should be understood that the above examples are for the purpose of facilitating the implementation of the present application by those skilled in the art, and are not intended to limit the present application.
By adopting the method in the embodiment of the application, the terminal client sends the second detection data packet in the local area network; when second response data aiming at the second detection data packet from the associated PC client is received, the existence of the associated PC client in the local area network is confirmed; then sending terminal information to the associated PC client to trigger the PC client to inquire whether to connect to the user; the terminal client can automatically confirm the PC client related to the terminal client and trigger the PC client to inquire whether the PC client is connected or not to the user, and the process does not need the participation of the user, so that the operation of the user is reduced, and the user experience is improved.
Preferably, the terminal connecting to the lan triggers the terminal client to send the second probe packet within the lan. In the specific implementation of the present application, the terminal client may immediately send the second probe packet in the local area network after being started, may also immediately send the second probe packet when the terminal starts the WIFI connection, and may also send the second probe packet at any other preset time.
By adopting the scheme in the embodiment of the application, the terminal client immediately triggers the sending of the second detection data packet in the local area network after being connected to the local area network, and can immediately initiate the process of being connected to the terminal after the user is connected to the local area network, so that the user does not need to perform more operations, and the user experience is improved.
Optionally, confirming that the associated PC client exists in the local area network according to the probe packet specifically includes: acquiring the IP address of the PC which is successfully connected in a preset time from the server; sending a third detection data packet to the IP address; when third response data aiming at the third detection data packet is received, confirming that a related PC client exists in the local area network; sending terminal information to the associated PC client, specifically comprising: and sending the terminal information to the PC client corresponding to the IP address sending the third response data.
And if the third response data is not received, judging that the PC client connected within the preset time does not exist locally.
In specific implementation, the terminal client may send the third probe packet in a wireless manner such as WIFI or WAPI.
The IP address obtained by the terminal client from the server may be one, multiple, or none. If the number of the IP addresses is multiple, the terminal client can sequentially send detection data packets to the IP addresses, and for the IP addresses which are not in the local area network, the detection data packets cannot be received, so that the terminal client cannot receive response data packets from the IP addresses; if the response data packet is received, the PC is confirmed to be in the local area network.
The terminal client can immediately acquire preset time from the server after being started, such as an IP address list of a PC successfully connected within 24 hours, or immediately acquire the time from the server when WIFI is started, or acquire the time from the server at any other preset time, and the application is not limited to this.
By adopting the method in the embodiment of the application, the terminal client sends a third detection data packet to the IP address after acquiring the IP address of the PC which is successfully connected in the preset time from the server; when third response data aiming at the third detection data packet is received, confirming that a related PC client exists in the local area network; then sending terminal information to a PC client corresponding to the IP address sending the third response data, and triggering the PC client to initiate a connection request; the process does not need the participation of the user, reduces the operation of the user and improves the user experience.
In the prior art, when a user PC or a terminal does not have a WIFI environment, the connection between the terminal and the PC cannot be realized, so that the user is inconvenient.
Optionally, before determining that the associated terminal client exists in the local area network according to the probe packet, the method further includes: the PC client triggers the PC to establish a WIFI hotspot, and the terminal is connected to the local area network through the hotspot.
The PC can establish a WIFI hotspot through the wireless network card, so that the terminal and the PC can access the same local area network, the connection between the terminal and the PC is realized, and the user experience is improved.
Optionally, before determining that the associated terminal client exists in the local area network according to the probe packet, the method further includes: the terminal client triggers the terminal to establish a WIFI hotspot, and the PC is connected to the local area network through the hotspot.
The terminal can establish a WIFI hotspot through the wireless network card, so that the terminal and the PC can access the same local area network, the connection between the terminal and the PC is realized, and the user experience is improved.
Preferably, before confirming that the associated terminal client exists in the local area network according to the probe packet, the method further includes: prompting whether to connect the PC and the terminal on a PC screen or a terminal screen; the triggering of the wireless connection of the PC to the terminal according to the terminal information specifically comprises: and when the user confirms the connection, triggering the PC to be wirelessly connected to the terminal according to the terminal information.
In specific implementation, whether the terminal is connected or not is prompted on a PC screen or a terminal screen in various ways, for example, a prompt box pops up at the lower right corner of the PC screen; popping up a prompt box in the middle of a PC screen; flashing at the lower right corner of the PC, and popping up a prompt box after a user clicks; popping up a prompt box in the middle of a terminal screen, and the like; it should be understood by those skilled in the art that the above-mentioned modes are only examples and are not intended to limit the present application as long as the prompt is provided for the user.
If the user selects not to connect, closing the prompt box; or if the user does not click the select button, the prompt box is automatically closed after a predetermined time, for example, 10 s.
By adopting the scheme in the embodiment of the application, when the terminal client finds the PC client accessed to the same local area network, the PC client or the terminal client is triggered to inquire whether to be connected or not to the user, and wireless connection/disconnection is carried out according to the selection of the user; the option of whether the PC is connected with the terminal is given to the user, so that unnecessary resource consumption caused by connection of the PC and the terminal under the condition that the user does not need the option is avoided, resources are saved, and user experience is improved.
In the prior art method for connecting the PC and the terminal, after a user scans the two-dimensional code, the terminal sends information to the PC, and requests the PC to establish wireless connection, so that the wireless connection between the PC and the terminal is completed.
By adopting the scheme in the prior art, after the user scans the two-dimensional code to confirm connection, the terminal sends information to the PC, certain time delay can be caused, and the user experience is reduced.
Preferably, the terminal information includes a terminal IP address and a port number. In specific implementation of the present application, the terminal information may further include other information of the terminal, such as a terminal name, a user mobile phone number, and the like.
By adopting the scheme in the embodiment of the application, before the PC client inquires whether to connect to the terminal or not, the terminal sends the IP address and the port number to the PC client so that the PC can prepare for subsequent wireless connection, once the user confirms the connection, the terminal can be quickly connected to the terminal, the time delay caused by obtaining the terminal information after the user confirms the connection is avoided, and the user experience is improved.
Based on the same inventive concept, the embodiment of the present application further provides a device for connecting a PC and a terminal applied to a PC client, and as the principle of solving the problem of the device is similar to the method for connecting the PC and the terminal applied to the PC client, the implementation of the device can refer to the implementation of the method, and repeated details are not repeated.
Fig. 3 is a schematic structural diagram of a connection device between a PC and a terminal according to a third embodiment of the present application.
As shown in fig. 3, a PC-to-terminal connection apparatus 300 applied to a PC client 30 according to a third embodiment of the present application includes: a first confirmation module 302, configured to confirm that a relevant terminal client exists in the local area network according to the probe packet; an obtaining module 304, configured to obtain terminal information associated with a terminal client; and a first triggering module 306, configured to trigger the PC to wirelessly connect to the terminal according to the terminal information when the user confirms the connection.
By adopting the connecting device of the PC and the terminal in the embodiment of the application, when the related PC and the terminal are confirmed to be in the same local area network according to the detection data packet and the PC can acquire the information of the terminal, the PC is triggered to be wirelessly connected to the terminal; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
Optionally, the first confirming module 302 specifically includes: the first sending submodule is used for sending a first detection data packet in the local area network; the first confirmation submodule is used for confirming that the associated terminal client exists in the local area network when receiving first response data of the associated terminal client in the local area network aiming at the first detection data packet, wherein the first response data carries the terminal information; the obtaining module 304 is further configured to extract the terminal information from the first response data.
Optionally, the first confirming module 302 specifically includes: the first receiving submodule is used for receiving a second detection data packet, wherein the second detection data packet is sent by the terminal client in the local area network; the second confirmation submodule is used for judging whether the terminal client is associated with the terminal client according to the second detection data packet, and if so, confirming that the associated terminal client exists in the local area network; the obtaining module 304 specifically includes: the second sending submodule is used for sending second response data aiming at the second detection data packet to the associated terminal client; and the second receiving submodule is used for receiving the terminal information sent by the terminal client.
By adopting the scheme in the embodiment of the application, the PC client can automatically confirm the terminal client associated with the PC client and carry out wireless connection, the process does not need participation of a user, the operation of the user is reduced, and the user experience is improved.
In the prior art, when a user PC or a terminal does not have a WIFI environment, the connection between the terminal and the PC cannot be realized, so that the user is inconvenient.
Preferably, the connection device applied to the PC client in the embodiment of the present application further includes: the first WIFI hotspot establishing module is used for establishing a WIFI hotspot, and the terminal client is connected to the local area network through the hotspot.
The PC can establish a WIFI hotspot through the wireless network card, so that the terminal and the PC can access the same local area network, the connection between the terminal and the PC is realized, and the user experience is improved.
Preferably, the connection device applied to the PC client in the embodiment of the present application further includes: the first prompting module is used for prompting whether the PC and the terminal are connected or not on a PC screen or a terminal screen; the first triggering module is specifically used for triggering the PC to be wirelessly connected to the terminal according to the terminal information when the user confirms connection.
By adopting the scheme in the embodiment of the application, when the PC client finds the associated terminal clients accessed to the same local area network, the PC client or the terminal client is triggered to inquire whether to connect or not to the user, and wireless connection/disconnection is carried out according to the selection of the user; the option of whether the PC is connected with the terminal is given to the user, so that unnecessary resource consumption caused by connection of the PC and the terminal under the condition that the user does not need the option is avoided, resources are saved, and user experience is improved.
Preferably, the terminal information includes a terminal IP address and a port number.
By adopting the scheme in the embodiment of the application, before inquiring whether the terminal is connected to the user, the IP address and the port number of the terminal information are acquired, preparation is made for subsequent wireless connection, once the user confirms the connection, the terminal can be quickly connected to the user, the time delay caused by acquiring the terminal information after the user confirms the connection is avoided, the connection power after the user confirms the connection can be improved, and the user experience is improved.
Based on the same inventive concept, the embodiment of the present application further provides a device for connecting a PC and a terminal applied to a terminal client, and because the principle of solving the problem of the device is similar to the method for connecting the PC and the terminal applied to the terminal client, the implementation of the device can refer to the implementation of the method, and repeated details are not repeated.
Fig. 4 is a schematic structural diagram of a PC-to-terminal connection apparatus according to a fourth embodiment of the present application.
As shown in fig. 4, the PC-to-terminal connection apparatus 400 applied to the terminal client 40 according to the fourth embodiment of the present application includes: a second confirmation module 402, configured to confirm that a relevant PC client exists in the local area network according to the probe packet; a sending module 404, configured to send terminal information to the associated PC client; and a second triggering block 406, configured to trigger the terminal to accept a connection establishment request sent by the PC according to the terminal information, so as to establish a wireless connection with the PC.
By adopting the connecting device of the PC and the terminal in the embodiment of the application, when the related PC and the terminal are confirmed to be in the same local area network, the terminal sends terminal information to the PC so as to trigger the PC to initiate a wireless connection request to the terminal and the terminal receives the wireless connection request; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
By adopting the technical scheme of the embodiment of the application, the terminal information is sent to the PC client when the terminal client confirms that the associated PC client exists in the local area network, the PC is triggered to initiate the wireless connection request to the terminal, and the terminal receives the wireless connection request.
Optionally, the second confirming module 402 specifically includes: the third receiving submodule is used for receiving a first detection data packet, wherein the first detection data packet is sent by the PC client in the local area network; the second confirmation submodule is used for judging whether the PC client is associated with the PC client or not according to the first detection data packet; the sending module 404 is further configured to send first response data to the associated PC client, where the first response data carries terminal information.
Optionally, the second confirming module 402 specifically includes: the third sending submodule is used for sending a second detection data packet in the local area network; and the third confirmation submodule is used for confirming that the associated PC client exists in the local area network when receiving second response data aiming at the second detection data packet from the associated PC client.
Optionally, the second confirming module 402 specifically includes: the acquisition submodule is used for acquiring an IP address list of the PC which is successfully connected in preset time from the server; the fourth confirming submodule is used for wirelessly connecting the IP addresses in the IP address list, judging whether the associated PC client exists according to the connection result, and if the connection is successful, confirming that the associated PC client exists in the local area network; the sending module 404 is further configured to send the terminal information to the PC client corresponding to the successfully connected IP address.
By adopting the scheme in the embodiment of the application, the terminal client can automatically confirm the PC client associated with the terminal client and complete wireless connection, and the process does not need participation of a user, so that the operation of the user is reduced, and the user experience is improved.
In the prior art, when a user PC or a terminal does not have a WIFI environment, the connection between the terminal and the PC cannot be realized, so that the user is inconvenient.
Preferably, the connection device applied to the terminal client in the embodiment of the present application further includes: and the second WIFI hotspot establishing module is used for establishing a WIFI hotspot, and the PC client is connected to the local area network through the hotspot.
The terminal can establish the WIFI hotspot through the wireless network card, so that the PC and the terminal can access the same local area network, the connection between the terminal and the PC is realized, and the user experience is improved.
The connection device applied to the terminal client in the embodiment of the application further includes: the second prompting module is used for prompting whether the PC and the terminal are connected or not on a PC screen or a terminal screen; the second triggering module is specifically used for triggering the terminal to receive a wireless connection establishment request sent by the PC according to the terminal information when the user confirms the connection.
By adopting the scheme in the embodiment of the application, when the terminal client finds the PC client accessed to the same local area network, the PC client or the terminal client is triggered to inquire whether to be connected or not to the user, and wireless connection/disconnection is carried out according to the selection of the user; the option of whether the PC is connected with the terminal is given to the user, so that unnecessary resource consumption caused by connection of the PC and the terminal under the condition that the user does not need the option is avoided, resources are saved, and user experience is improved.
Preferably, the terminal information includes a terminal IP address and a port number.
By adopting the scheme in the embodiment of the application, before the PC client inquires whether to connect to the terminal or not, the terminal sends the IP address and the port number to the PC client so that the PC can prepare for subsequent wireless connection, once the user confirms the connection, the terminal can be quickly connected to the terminal, the time delay caused by obtaining the terminal information after the user confirms the connection is avoided, and the user experience is improved.
Based on the same inventive concept, the embodiment of the application also provides a system for connecting the PC and the terminal, and as the principle of solving the problems of the system is similar to the method for connecting the PC and the terminal, the implementation of the system can refer to the implementation of the method, and repeated parts are not described again.
Fig. 5 is a system block diagram of a PC and terminal connection system according to a fifth embodiment of the present application.
As shown in fig. 5, a PC-to-terminal connection system 50 according to the fifth embodiment of the present application includes: a PC client 30 including a wireless connection device 300; an end client 40 comprising a wireless connection means 400.
Preferably, the connection system further comprises: and the server is used for storing the IP address of the PC which is successfully connected by the terminal client within the preset time.
By adopting the connection system of the PC and the terminal in the embodiment of the application, when the related PC and the terminal are in the same local area network, the terminal sends terminal information to the PC so as to trigger the PC to initiate a wireless connection request to the terminal, so that the PC is wirelessly connected with the terminal; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
By adopting the technical scheme of the embodiment of the application, in the process of establishing wireless connection between the PC and the terminal, the association relation between the PC and the terminal is automatically confirmed, and the wireless connection is carried out, so that the user does not need to participate in the whole process, convenience and rapidness are realized, and the user experience is improved.
Fig. 6 is a flowchart of a method for connecting a PC to a terminal according to a sixth embodiment of the present application.
In the sixth embodiment of the present application, a cloud mobile phone assistant client is taken as an example, and a method for connecting a PC and a terminal according to the sixth embodiment of the present application is introduced.
As shown in fig. 6, the process of the method for connecting the PC and the terminal actively triggered by the mobile phone side includes the following steps:
s602, connecting the mobile phone into a WIFI network;
s604, the cloud mobile phone assistant mobile phone client acquires the IP of the PC terminal which is connected recently from the server;
s606, the mobile phone client terminal tries to connect the IPs, and if the connection is successful, S614 is executed; if the connection fails, S608 is performed;
s608, the mobile phone client sends out a network multicast detection data packet and waits for receiving a response data packet from the PC client;
s610, after receiving the detection data packet, the PC client judges whether the detection data packet is the detection data packet sent by the relevant cloud mobile phone assistant client, and if the detection data packet is the detection data packet sent by the relevant cloud mobile phone assistant client, the step S611 is executed; if not, ending the flow;
s611, sending a response data packet;
s612, if the mobile phone client receives the response data packet aiming at the detection data packet within the specified time, executing S614; if the message is not received within the specified time, ending the process;
s614, the mobile phone client sends the mobile phone related information to the cloud mobile phone assistant PC client, and waits for a wireless connection request of the PC;
s616, popping up a prompt window by the PC client;
s618, the user clicks the button of "connect immediately";
and S620, the PC client initiates TCP connection and is connected to the mobile phone client.
By adopting the method for connecting the PC and the terminal in the embodiment of the application, when the related PC and the terminal are in the same local area network, the terminal sends terminal information to the PC so as to trigger the PC client to prompt a user whether to connect a mobile phone, and then when the user confirms the connection, the PC and the terminal are wirelessly connected; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
By adopting the scheme in the embodiment of the application, the option of whether the PC is connected with the terminal or not is given to the user, so that unnecessary resource consumption caused by connection of the PC and the terminal under the condition that the user does not need the PC is avoided, resources are saved, and the user experience is improved.
By adopting the method in the embodiment of the application, the terminal client can automatically confirm the PC client related to the terminal client and trigger the PC client to inquire whether the connection is made to the user, the process does not need the participation of the user, the operation of the user is reduced, and the user experience is improved.
Fig. 7 is a flowchart of a connection method between a PC and a terminal according to a seventh embodiment of the present application.
In the seventh embodiment of the present application, a cloud mobile phone assistant client is taken as an example to introduce a connection method between a PC and a terminal according to the seventh embodiment of the present application.
As shown in fig. 7, the process of the method for connecting the PC and the terminal actively triggered by the PC includes the following steps:
s702, starting a service process of a cloud mobile phone assistant PC client, and sending out a network multicast detection data packet;
s704, after receiving the detection data packet, the mobile phone client judges whether the detection data packet is the detection data packet sent by the related PC client, if so, S705 is executed, and if not, the process is ended;
s705, sending a response data packet;
s706, if the PC client does not receive the corresponding response data packet, ending the process; if the PC client receives the corresponding response data packet, executing S708;
s708, popping up a prompt window by the PC client;
s710, clicking an 'immediate connection' button by a user;
s712, the PC client initiates TCP connection to the mobile phone client.
By adopting the method for connecting the PC and the terminal in the embodiment of the application, when the related PC and the terminal are in the same local area network, the PC client prompts a user whether to connect a mobile phone, and then when the user confirms the connection, the PC and the terminal are wirelessly connected; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
By adopting the scheme in the embodiment of the application, the option of whether the PC is connected with the terminal or not is given to the user, so that unnecessary resource consumption caused by connection of the PC and the terminal under the condition that the user does not need the PC is avoided, resources are saved, and the user experience is improved.
By adopting the method in the embodiment of the application, the PC client can automatically confirm the terminal client associated with the PC client, and the process does not need the participation of a user, so that the operation of the user is reduced, and the user experience is improved.
Fig. 8 is a flowchart of a method for connecting a PC to a terminal according to an eighth embodiment of the present application.
In an eighth embodiment of the present application, a cloud mobile phone assistant client is taken as an example, and a method for connecting a PC and a terminal according to the eighth embodiment of the present application is introduced.
As shown in fig. 8, the process of the method for establishing the WIFI hotspot by the mobile phone and actively triggering the connection between the PC and the terminal by the PC includes the following steps:
s802, a user clicks to establish a WIFI hotspot on an interface of a cloud mobile phone assistant mobile phone client;
s804, the mobile phone client generates a WIFI hotspot, the name of the hotspot is alizhushou, and the password is a 6-bit connection code of the mobile phone client;
s806, the user starts the cloud mobile phone assistant PC client, opens the connection interface of the PC client and selects the associated mobile phone name;
s808, detecting the WIFI hotspot with the current hotspot name of alizhushou by the PC through the wireless gateway, trying to connect the hotspot by using a connection code of the associated mobile phone as a password, executing S810 if the connection is successful, and prompting connection failure and ending the process if the connection is not successful;
s810, the PC client sends a network detection data packet to the connected mobile phone;
s812, after receiving the detection data packet, the mobile phone client judges that the detection data packet comes from the associated PC client, and sends a response data packet to the PC client, wherein the response data packet carries the IP address and the port number of the mobile phone;
s814, after receiving the response data packet, the PC client extracts the IP address and the port number of the mobile phone from the response data packet and initiates TCP connection to the mobile phone;
and S816, after receiving the connection request, the mobile phone client performs connection verification, and after the verification is passed, the mobile phone client establishes connection with the PC.
By adopting the method for connecting the PC and the terminal in the embodiment of the application, the terminal establishes the WIFI hotspot through the wireless network card, so that the PC and the terminal can access the same local area network, a wireless environment is provided for the connection between the subsequent terminal and the PC, and the user experience is improved.
By adopting the method for connecting the PC and the terminal in the embodiment of the application, when the related PC and the terminal are in the same local area network, the PC client is automatically connected with the mobile phone through WIFI; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
By adopting the method in the embodiment of the application, the PC client can automatically confirm the terminal client associated with the PC client, and the process does not need the participation of a user, so that the operation of the user is reduced, and the user experience is improved.
Fig. 9 is a flowchart of a method for connecting a PC to a terminal according to a ninth embodiment of the present application.
Ninth in the embodiment of the present application, a cloud mobile phone assistant client is taken as an example, and a method for connecting a PC and a terminal according to the ninth in the embodiment of the present application is introduced.
As shown in fig. 9, the process of the method for establishing the WIFI hotspot by the PC and connecting the PC and the terminal actively triggered by the mobile phone includes the following steps:
s902, a user opens a PC-side cloud mobile phone assistant connection interface, selects a mobile phone name to be connected in a mobile phone list, and selects intelligent WIFI connection;
s904, the PC client triggers the PC to generate a WIFI hotspot through the wireless network card, wherein the hotspot name is alizhushou; the password is a 6-bit connection code of the selected mobile phone;
s906, the user starts a mobile phone client of the cloud mobile phone assistant and selects WIFI intelligent connection;
s908, the mobile phone client triggers the mobile phone to detect a WIFI hotspot named alizhushou through the wireless network card, and the WIFI hotspot is connected by taking the connection code of the current mobile phone as a password; if the connection is successful, executing S910, if not, prompting failure and ending the process;
s910, the mobile phone client sends a detection data packet;
s912, the PC client receives the detection data packet sent by the mobile phone and judges whether the detection data packet comes from the associated mobile phone; if so, perform S914; if not, ignoring the data packet;
s914, the PC client side initiates a TCP connection request to the mobile phone;
s916, the mobile phone receives the connection request, and the PC establishes connection with the mobile phone.
By adopting the method for connecting the PC and the terminal in the embodiment of the application, the PC establishes the WIFI hotspot through the wireless network card, so that the PC and the terminal can access the same local area network, a wireless environment is provided for the connection between the subsequent terminal and the PC, and the user experience is improved.
By adopting the method for connecting the PC and the terminal in the embodiment of the application, when the related PC and the terminal are in the same local area network, the PC client is automatically connected with the mobile phone through WIFI; the dependence on the USB cable when the PC is connected with the terminal in the prior art is avoided, so that the connection between the PC and the terminal is more convenient and faster, and the user experience is improved.
By adopting the method in the embodiment of the application, the PC client can automatically confirm the terminal client associated with the PC client, and the process does not need the participation of a user, so that the operation of the user is reduced, and the user experience is improved.
For convenience of description, each part of the above-described apparatus is separately described as functionally divided into various parts or units. Of course, the functionality of the various components or units may be implemented in the same or in multiple software or hardware implementations as the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.