CN105472771B - Wireless connection method and device - Google Patents

Wireless connection method and device Download PDF

Info

Publication number
CN105472771B
CN105472771B CN201410466306.6A CN201410466306A CN105472771B CN 105472771 B CN105472771 B CN 105472771B CN 201410466306 A CN201410466306 A CN 201410466306A CN 105472771 B CN105472771 B CN 105472771B
Authority
CN
China
Prior art keywords
check code
terminal device
terminal
terminal equipment
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410466306.6A
Other languages
Chinese (zh)
Other versions
CN105472771A (en
Inventor
王爱军
刘华东
宋志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Xiaomi Inc
Beijing Xiaomi Mobile Software 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 Xiaomi Inc, Beijing Xiaomi Mobile Software Co Ltd filed Critical Xiaomi Inc
Priority to CN201410466306.6A priority Critical patent/CN105472771B/en
Publication of CN105472771A publication Critical patent/CN105472771A/en
Application granted granted Critical
Publication of CN105472771B publication Critical patent/CN105472771B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The disclosure relates to a wireless connection method and a wireless connection device, and belongs to the technical field of wireless communication. The method comprises the following steps: acquiring and analyzing a bar code provided by first terminal equipment to obtain bar code information; sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; receiving response information returned by the first terminal equipment; and judging whether to establish wireless connection with the first terminal equipment or not according to the response information. According to the method and the device, the second terminal equipment initiates the wireless connection request to the first terminal equipment by acquiring the MAC address of the first terminal equipment of the bar code information, so that the condition of mismatching or misconnection caused by the same name of the target equipment is avoided, the connection request information contains the second check code, whether the second terminal equipment is the connectable terminal equipment or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.

Description

Wireless connection method and device
Technical Field
The present disclosure relates to the field of wireless communication technologies, and in particular, to a wireless connection method and apparatus.
Background
With the development of wireless communication technology, wireless connection applications such as wifi and bluetooth are increasingly widespread and popular. In general, when a wireless communication device performs wireless connection, connectable devices are searched, a target device is selected from the connectable devices, and a connection request is transmitted to the device.
BRIEF SUMMARY OF THE PRESENT DISCLOSURE
In order to overcome the problem that the traditional wireless connection is easy to generate mismatching or misconnection, the disclosure provides a wireless connection method and a wireless connection device.
According to a first aspect of embodiments of the present disclosure, there is provided a wireless connection method, the method including:
acquiring and analyzing a bar code provided by a first terminal device to obtain bar code information, wherein the bar code information comprises: the MAC address and the first check code of the first terminal equipment;
sending connection request information to the first terminal device according to the MAC address of the first terminal device, wherein the connection request information comprises: the MAC address, a second check code and a connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code;
receiving response information returned by the first terminal device, wherein the response information is generated after the first terminal device verifies the second terminal device by adopting the second verification code;
and judging whether to establish wireless connection with the first terminal equipment or not according to the response information.
According to an implementation manner of the first aspect of the embodiments of the present disclosure, the barcode information further includes real-time information of the first terminal device, and the real-time information of the first terminal device includes: whether the first terminal device has established a wireless connection with another terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
According to another implementation of the first aspect of the embodiments of the present disclosure, the method further includes:
and judging whether to request the first terminal equipment to disconnect from other terminal equipment which establishes wireless connection or not according to the real-time information of the first terminal equipment.
According to another implementation manner of the first aspect of the embodiment of the present disclosure, the connection request information further includes disconnection indication information, where the disconnection indication information is used to indicate that the first terminal device is disconnected from other terminal devices that have established wireless connection.
According to a second aspect of the embodiments of the present disclosure, there is provided a wireless connection method, the method including: acquiring connection request information sent by second terminal equipment, wherein the connection request information comprises: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code, and the first check code is obtained by the second terminal equipment through analyzing the bar code provided by the first terminal equipment;
verifying the second terminal equipment by adopting the second verification code to obtain a verification result;
and sending response information to the second terminal equipment according to the verification result.
According to an implementation of the second aspect of the embodiments of the present disclosure, the method further comprises:
generating a bar code, wherein the bar code comprises bar code information comprising: the MAC address of the first terminal device and the first check code.
According to another implementation manner of the second aspect of the embodiment of the present disclosure, the barcode information further includes real-time information of the first terminal device, and the real-time information of the first terminal device includes: whether the first terminal device has established a wireless connection with another terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
According to another implementation manner of the second aspect of the embodiment of the present disclosure, the connection request information further includes disconnection indication information, where the disconnection indication information is used to indicate that the first terminal device is disconnected from other terminal devices that have established wireless connection.
According to another implementation manner of the second aspect of the embodiment of the present disclosure, the connection request information further includes device information of the second terminal device, where the device information includes: and one or more of the device name and the device type of the second terminal device.
According to another implementation of the second aspect of the embodiments of the present disclosure, the method further comprises:
determining the priority of the second terminal equipment according to one or more of the equipment name, the equipment type and the MAC address of the second terminal equipment;
and establishing wireless connection with the second terminal equipment according to the priority of the second terminal equipment.
According to a third aspect of embodiments of the present disclosure, there is provided a wireless connection apparatus, the apparatus comprising: the acquisition module is used for acquiring and analyzing a bar code provided by a first terminal device to obtain bar code information, wherein the bar code information comprises: the MAC address and the first check code of the first terminal equipment;
a sending module, configured to send connection request information to the first terminal device according to the MAC address of the first terminal device, where the connection request information includes: the MAC address, a second check code and a connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code;
a receiving module, configured to receive response information returned by the first terminal device, where the response information is generated after the first terminal device verifies the second terminal device by using the second verification code;
and the first judging module is used for judging whether to establish wireless connection with the first terminal equipment according to the response information.
According to an implementation manner of the third aspect of the embodiment of the present disclosure, the barcode information further includes real-time information of the first terminal device, and the real-time information of the first terminal device includes: whether the first terminal device has established a wireless connection with another terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
According to another implementation of the third aspect of the embodiments of the present disclosure, the apparatus further includes:
and the second judgment module is used for judging whether to request the first terminal equipment to be disconnected with other terminal equipment which establishes wireless connection according to the real-time information of the first terminal equipment.
According to another implementation manner of the third aspect of the embodiment of the present disclosure, the connection request information further includes disconnection indication information, where the disconnection indication information is used to indicate that the first terminal device is disconnected from other terminal devices that have established wireless connection.
According to a fourth aspect of embodiments of the present disclosure, there is provided a wireless connection apparatus, the apparatus comprising: an obtaining module, configured to obtain connection request information sent by a second terminal device, where the connection request information includes: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code, and the first check code is obtained by the second terminal equipment through analyzing the bar code provided by the first terminal equipment;
the verification module is used for verifying the second terminal equipment by adopting the second check code to obtain a verification result;
and the sending module is used for sending response information to the second terminal equipment according to the verification result.
According to an implementation manner of the fourth aspect of the embodiments of the present disclosure, the apparatus further includes:
the generating module is used for generating a bar code, and the bar code information contained in the bar code comprises: the MAC address of the first terminal device and the first check code.
According to another implementation manner of the fourth aspect of the embodiment of the present disclosure, the barcode information further includes real-time information of the first terminal device, and the real-time information of the first terminal device includes: whether the first terminal device has established a wireless connection with another terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
According to another implementation manner of the fourth aspect of the embodiment of the present disclosure, the connection request information further includes disconnection indication information, where the disconnection indication information is used to indicate that the first terminal device is disconnected from other terminal devices that have established wireless connection.
According to another implementation manner of the fourth aspect of the embodiment of the present disclosure, the connection request information further includes device information of the second terminal device, where the device information includes: and one or more of the device name and the device type of the second terminal device.
According to another implementation of the fourth aspect of the embodiments of the present disclosure, the apparatus further includes:
a determining module, configured to determine a priority of the second terminal device according to one or more of a device name, a device type, and an MAC address of the second terminal device;
and the processing module is used for establishing wireless connection with the second terminal equipment according to the priority of the second terminal equipment.
According to a fifth aspect of embodiments of the present disclosure, there is provided a wireless connection apparatus, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring and analyzing a bar code provided by a first terminal device to obtain bar code information, wherein the bar code information comprises: the MAC address and the first check code of the first terminal equipment;
sending connection request information to the first terminal device according to the MAC address of the first terminal device, wherein the connection request information comprises: the MAC address, a second check code and a connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code;
receiving response information returned by the first terminal device, wherein the response information is generated after the first terminal device verifies the second terminal device by adopting the second verification code;
and judging whether to establish wireless connection with the first terminal equipment or not according to the response information.
According to a sixth aspect of embodiments of the present disclosure, there is provided a wireless connection apparatus, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring connection request information sent by second terminal equipment, wherein the connection request information comprises: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code, and the first check code is obtained by the second terminal equipment through analyzing the bar code provided by the first terminal equipment;
verifying the second terminal equipment by adopting the second verification code to obtain a verification result;
and sending response information to the second terminal equipment according to the verification result.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
obtaining and analyzing a bar code provided by the first terminal equipment to obtain bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic diagram illustrating an application scenario of a wireless connection method according to an exemplary embodiment.
Fig. 2 is a flow chart illustrating a method of wireless connectivity according to an example embodiment.
Fig. 3 is a flow chart illustrating a method of wireless connectivity according to an example embodiment.
Fig. 4 is an information interaction diagram illustrating a wireless connection method according to an example embodiment.
Fig. 5 is an information interaction diagram illustrating a wireless connection method according to an example embodiment.
Fig. 6 is a block diagram illustrating a wireless connection apparatus according to an example embodiment.
Fig. 7 is a block diagram illustrating a wireless connection apparatus according to an example embodiment.
Fig. 8 is a block diagram illustrating a wireless connection apparatus according to an example embodiment.
Fig. 9 is a block diagram illustrating a wireless connection apparatus according to an example embodiment.
Fig. 10 is a block diagram illustrating a wireless connection apparatus according to an example embodiment.
Fig. 11 is a block diagram illustrating a wireless connection apparatus in accordance with an example embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The following briefly introduces an application scenario of the embodiment in the present disclosure. Referring to fig. 1, in the application scenario, the method includes: the mobile terminal comprises a first terminal device 11 and a second terminal device 12, wherein the first terminal device 11 is a mobile terminal (for example, a smart phone, a tablet computer, a bluetooth headset, a bluetooth sound box, etc.) having a wireless connection function of bluetooth, wifi, etc., and the second terminal device 12 is a mobile terminal (for example, a smart phone, a tablet computer, etc.) having a wireless connection function of bluetooth, wifi, etc., and a function of scanning a barcode, wherein the barcode may be a two-dimensional code or a one-dimensional code, etc.
It should be noted that the above contents are only examples, and the disclosure is not limited thereto.
Example one
Fig. 2 is a flow chart illustrating a method of wireless connection, as shown in fig. 2, for a second terminal device, according to an example embodiment, including the following steps.
In step S11, the barcode provided by the first terminal device is acquired and analyzed to obtain barcode information, where the barcode information includes: a Media Access Control (MAC) address of the first terminal device and a first check code.
The second terminal device may scan the barcode through a camera of the second terminal device or a camera switched out through an interface (such as a USB). The bar code may be a two-dimensional code or a one-dimensional code.
In step S12, connection request information is sent to the first terminal device according to the MAC address of the first terminal device, the connection request information including: the MAC address of the second terminal device, a second check code and a connection request identifier, wherein the second check code is generated according to the first check code.
The connection request identifier is used for the first terminal equipment to identify a wireless connection request initiated by the second terminal equipment. The second check code can be obtained by calculation according to a preset check code calculation rule and the first check code, the check code calculation rule is stored in the terminal device needing to establish the wireless connection, and the second check code is used for the first terminal device to judge whether the second terminal device is the terminal device capable of establishing the wireless connection. In addition, the first check code can also be directly adopted as the second check code.
And the MAC address of the second terminal equipment is used for the first terminal equipment to determine the identity information of the second terminal equipment for identifying the second terminal equipment.
In step S13, response information returned by the first terminal device is received, where the response information is generated after the first terminal device verifies the second terminal device by using the second check code.
Wherein the response information may be used to indicate whether the second terminal device is authenticated or not, or the response information may be used to inform the second terminal device whether the first terminal device agrees to establish a wireless connection therewith.
In step S14, it is determined whether to establish a wireless connection with the first terminal device based on the response information.
If the response information indicates that the second terminal equipment passes the verification or indicates that the first terminal equipment agrees to establish the wireless connection with the second terminal equipment, the second terminal equipment establishes the wireless connection with the first terminal equipment, otherwise, if the response information indicates that the second terminal equipment does not pass the verification or indicates that the first terminal equipment does not agree to establish the wireless connection with the first terminal equipment, the second terminal equipment does not establish the wireless connection with the first terminal equipment.
The embodiment of the disclosure obtains and analyzes the bar code provided by the first terminal device to obtain the bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
Example two
Fig. 3 is a flow chart illustrating a method of wireless connectivity, as shown in fig. 3, for a first terminal device, according to an example embodiment, including the following steps.
In step S21, connection request information sent by the second terminal device is acquired, where the connection request information includes: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code, and the first check code is obtained by the second terminal equipment through analyzing the bar code provided by the first terminal equipment.
The connection request identifier is used for the first terminal equipment to identify a connection request sent by the second terminal.
In step S22, the second terminal device is verified by using the second check code, and a verification result is obtained.
In this embodiment, when the second check code is determined, the third check code obtained by calculating the first check code may be matched with the second check code according to a preset check code calculation rule, and if the matching is successful, the second terminal device passes the verification; otherwise, if the matching result is not obtained, the second terminal device is not verified. In addition, the first check code can be used as the second check code, so that whether the first check code is the same as the second check code or not can be judged, and if the first check code is the same as the second check code, the second terminal equipment passes the verification.
In step S23, response information is sent to the second terminal device according to the verification result.
Wherein the response information may be used to indicate whether the second terminal device is authenticated or not, or the response information may be used to inform the second terminal device whether the first terminal device agrees to establish a wireless connection therewith.
In this embodiment, the second terminal device determines whether to establish a wireless connection with the first terminal device according to the response information. If the response information indicates that the second terminal equipment passes the verification or indicates that the first terminal equipment agrees to establish the wireless connection with the second terminal equipment, the second terminal equipment establishes the wireless connection with the first terminal equipment, otherwise, if the response information indicates that the second terminal equipment does not pass the verification or indicates that the first terminal equipment does not agree to establish the wireless connection with the first terminal equipment, the second terminal equipment does not establish the wireless connection with the first terminal equipment.
The embodiment of the disclosure obtains and analyzes the bar code provided by the first terminal device to obtain the bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
EXAMPLE III
In this embodiment, a bluetooth connection is established between a first terminal device and a second terminal device, and the first terminal device is a bluetooth headset and the second terminal device is a mobile terminal supporting a bluetooth function. The Bluetooth headset is provided with a bar code. It is easy to know that, besides the bluetooth headset, the present embodiment is also applicable to bluetooth devices without a display screen, such as a bluetooth speaker, a bluetooth mouse, etc.
Fig. 4 is an information interaction diagram illustrating a wireless connection method according to an exemplary embodiment, where the method is used for establishing a wireless connection between a first terminal device and a second terminal device, as shown in fig. 4, and includes the following steps.
In step S31, the second terminal device obtains and parses the barcode provided by the first terminal device, so as to obtain barcode information, where the barcode information includes: the MAC address of the first terminal device and the first check code.
In this embodiment, the first terminal device does not have a display screen, that is, the barcode generated in real time cannot be provided for scanning by other terminal devices, and for this reason, a barcode including the MAC address and the first check code information of the first terminal device may be attached to the first terminal device at the time of factory shipment or later, for example, the barcode may be attached to the first terminal device.
The second terminal device may scan the barcode through a camera of the second terminal device or a camera switched out through an interface (such as a USB). The bar code may be a two-dimensional code or a one-dimensional code.
In step S32, the second terminal device sends connection request information to the first terminal device according to the MAC address of the first terminal device, the connection request information including: the MAC address of the second terminal device, a second check code, a connection request identifier and disconnection indication information, wherein the second check code is generated according to the first check code, and the disconnection indication information is used for indicating that the first terminal device is disconnected with other terminal devices which have established wireless connection.
After the second terminal device passes the verification of the first terminal device, the first terminal device disconnects with other terminal devices which have established wireless connection according to the disconnection indication information sent by the first terminal device.
In this embodiment, the connection request identifier is used for the first terminal device to identify the wireless connection request initiated by the second terminal device. The second check code can be obtained by calculation according to a preset check code calculation rule and the first check code, the check code calculation rule is stored in the terminal device needing to establish the wireless connection, the second check code is used for the first terminal device to judge whether the second terminal device is the terminal device capable of establishing the wireless connection, and in addition, the first check code can also be directly adopted as the second check code.
In practical applications, a field may be set in the connection request message sent to the first terminal device, where the field is used to carry disconnection indication information, and the first terminal device determines whether the second terminal device requires the second terminal device to disconnect the established wireless connection by recognizing a value of the field.
It should be noted that the connection request information may not include the disconnection indication information, that is, the first terminal device may establish a wireless connection with the second terminal device when there is a wireless connection with another terminal device.
In step S33, the first terminal device obtains connection request information sent by the second terminal device, where the connection request information includes: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code, and the first check code is obtained by the second terminal equipment through analyzing the bar code provided by the first terminal equipment.
In this embodiment, the connection request information may further include device information of the second terminal device, where the device information of the second terminal device includes: and one or more of the device name and the device type of the second terminal device.
In step S34, the first terminal device verifies the second terminal device by using the second check code, and obtains a verification result.
In this embodiment, if the second check code is correct, the second terminal device passes the verification; otherwise, the second terminal device fails to pass the verification.
When the second check code is judged, the third check code obtained by calculating the first check code can be matched with the second check code according to a preset check code calculation rule, and if the matching is successful, the second terminal equipment passes the verification; otherwise, if the matching result is not obtained, the second terminal device is not verified. In addition, when the first terminal device and the second terminal device agree in advance that the first check code is adopted as the second check code, only the judgment of whether the first check code is the same as the second check code is needed, and if the first check code is the same as the second check code, the second terminal device passes the verification.
In step S35, the first terminal device transmits response information to the second terminal device according to the verification result.
Wherein the response information may be used to indicate whether the second terminal device is authenticated or not, or the response information may be used to inform the second terminal device whether the first terminal device agrees to establish a wireless connection therewith.
In step S36, the second terminal device determines whether to establish a wireless connection with the first terminal device based on the response information.
In this embodiment, the second terminal device determines whether to establish a wireless connection with the first terminal device according to the response information. If the response information indicates that the second terminal equipment passes the verification or indicates that the first terminal equipment agrees to establish the wireless connection with the second terminal equipment, the second terminal equipment establishes the wireless connection with the first terminal equipment, otherwise, if the response information indicates that the second terminal equipment does not pass the verification or indicates that the first terminal equipment does not agree to establish the wireless connection with the first terminal equipment, the second terminal equipment does not establish the wireless connection with the first terminal equipment.
In step S37, the first terminal device determines the priority of the second terminal device according to one or more of the device name, the device type, and the MAC address of the second terminal device.
In step S38, the first terminal device establishes a wireless connection with the second terminal device according to the priority of the second terminal device.
In practical applications, since it is possible that a plurality of terminal devices pass the verification of the first terminal device at the same time, the first terminal device may select which terminal device to establish a wireless connection preferentially according to a preset priority rule. The priority rule may be a level rule established according to one or more of a device name, a device type, and a MAC address of the terminal device, for example: the device name or the MAC address may be stored in the first terminal device, and the first terminal device determines the priority of the terminal device that has passed the authentication according to the device name or the MAC address; the device type can also be stored in the first terminal device, and the first terminal device judges which type of terminal device preferentially establishes the wireless connection according to the device type; reference may also be made to a plurality of the above items simultaneously. The foregoing is by way of example only and is not intended as a limitation upon the present disclosure.
It should be noted that this embodiment is not only suitable for establishing a bluetooth connection, but also can establish other wireless connections, for example, a WIFI connection.
The embodiment of the disclosure obtains and analyzes the bar code provided by the first terminal device to obtain the bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
Example four
In this embodiment, a bluetooth connection is established between a first terminal device and a second terminal device, and the first terminal device is a mobile terminal supporting a bluetooth function, and the second terminal device is a mobile terminal supporting a bluetooth function. The first terminal device may generate the barcode in real time. It is easy to know that the first terminal device may be a smart phone, a tablet computer, or the like.
Fig. 5 is an information interaction diagram illustrating a wireless connection method according to an exemplary embodiment, where the method is used for establishing a wireless connection between a first terminal device and a second terminal device, as shown in fig. 5, and includes the following steps.
In step S41, the first terminal device generates a barcode including barcode information including: the MAC address of the first terminal device and the first check code.
In this embodiment, the barcode information further includes real-time information of the first terminal device, where the real-time information of the first terminal device includes: whether the first terminal device has established a wireless connection with the other terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
When a user needs to establish wireless connection between the first terminal device and the second terminal device, a bar code can be generated in real time and output on a display screen of the bar code to be provided for the second terminal device.
In step S42, the second terminal device obtains and parses the barcode provided by the first terminal device, so as to obtain barcode information.
The second terminal device may scan the barcode through a camera of the second terminal device or a camera switched out through an interface (such as a USB). The bar code may be a two-dimensional code or a one-dimensional code.
In step S43, the second terminal device sends connection request information to the first terminal device according to the MAC address of the first terminal device, the connection request information including: the MAC address of the second terminal device, a second check code and a connection request identifier, wherein the second check code is generated according to the first check code.
In this embodiment, the connection request identifier is used for the first terminal device to identify the wireless connection request initiated by the second terminal device. The second check code can be obtained by calculation according to a preset check code calculation rule and the first check code, the check code calculation rule is stored in the terminal device needing to establish the wireless connection, the second check code is used for the first terminal device to judge whether the second terminal device is the terminal device capable of establishing the wireless connection, and in addition, the first check code can also be directly adopted as the second check code.
In practical applications, a field may be set in the connection request message sent to the first terminal device, where the field is used to carry disconnection indication information, and the first terminal device determines whether the second terminal device requires the second terminal device to disconnect the established wireless connection by recognizing a value of the field.
In step S44, the second terminal device determines whether to request the first terminal device to disconnect from another terminal device that has established a wireless connection, based on the real-time information of the first terminal device.
In this embodiment, if the second terminal device determines that it is necessary to request the first terminal device to disconnect from the other terminal devices that have already established wireless connection, the second terminal device sends disconnection indication information to the first terminal device, where the disconnection indication information is used to indicate that the first terminal device disconnects from the other terminal devices that have already established wireless connection.
The second terminal device determines whether to request the first terminal device to disconnect from other terminal devices that have established wireless connection according to the real-time information of the first terminal device, and may adopt the following method: it is determined whether the number of terminal apparatuses that have established wireless connection with the first terminal apparatus exceeds a threshold (e.g., 5), and when the number exceeds the threshold, a disconnection request is sent to the first terminal apparatus. And the first terminal equipment disconnects with other terminal equipment which establishes wireless connection according to the disconnection request sent by the first terminal equipment after the second terminal equipment passes the verification.
In this embodiment, step S43 is not preceded by step S44.
In one implementation manner of this embodiment, the disconnection indication information may be included in the connection request information and transmitted. For example, a field may be set in the connection request information, the field being used to carry disconnection indication information, and the first terminal device reads the disconnection indication information by recognizing the field.
In step S45, the first terminal device obtains connection request information sent by the second terminal device, where the connection request information includes: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code, and the first check code is obtained by the second terminal equipment through analyzing the bar code provided by the first terminal equipment.
In this embodiment, the connection request information further includes device information of the second terminal device, where the device information includes: and one or more of the device name and the device type of the second terminal device.
In step S46, the first terminal device verifies the second terminal device by using the second check code, and obtains a verification result.
In this embodiment, if the second check code is correct, the second terminal device passes the verification; otherwise, the second terminal device fails to pass the verification.
When the second check code is judged, the third check code obtained by calculating the first check code can be matched with the second check code according to a preset check code calculation rule, and if the matching is successful, the second terminal equipment passes the verification; otherwise, if the matching result is not obtained, the second terminal device is not verified. In addition, when the first terminal device and the second terminal device agree in advance that the first check code is adopted as the second check code, only the judgment of whether the first check code is the same as the second check code is needed, and if the first check code is the same as the second check code, the second terminal device passes the verification.
In step S47, the first terminal device transmits response information to the second terminal device according to the verification result.
Wherein the response information may be used to indicate whether the second terminal device is authenticated or not, or the response information may be used to inform the second terminal device whether the first terminal device agrees to establish a wireless connection therewith.
In step S48, the second terminal device determines whether to establish a wireless connection with the first terminal device based on the response information.
In this embodiment, the second terminal device determines whether to establish a wireless connection with the first terminal device according to the response information. If the response information indicates that the second terminal equipment passes the verification or indicates that the first terminal equipment agrees to establish the wireless connection with the second terminal equipment, the second terminal equipment establishes the wireless connection with the first terminal equipment, otherwise, if the response information indicates that the second terminal equipment does not pass the verification or indicates that the first terminal equipment does not agree to establish the wireless connection with the first terminal equipment, the second terminal equipment does not establish the wireless connection with the first terminal equipment.
In step S49, the first terminal device determines the priority of the second terminal device according to one or more of the device name, the device type, and the MAC address of the second terminal device.
In step S50, the first terminal device establishes a wireless connection with the second terminal device according to the priority of the second terminal device.
In practical applications, since it is possible that a plurality of terminal devices pass the verification of the first terminal device at the same time, the first terminal device may select which terminal device to establish a wireless connection preferentially according to a preset priority rule. The priority rule may be a level rule established according to one or more of a device name, a device type, and a MAC address of the terminal device, for example: the device name or the MAC address may be stored in the first terminal device, and the first terminal device determines the priority of the terminal device that has passed the authentication according to the device name or the MAC address; the device type can also be stored in the first terminal device, and the first terminal device judges which type of terminal device preferentially establishes the wireless connection according to the device type; reference may also be made to a plurality of the above items simultaneously. The foregoing is by way of example only and is not intended as a limitation upon the present disclosure.
It should be noted that this embodiment is not only suitable for establishing a bluetooth connection, but also can establish other wireless connections, for example, a WIFI connection.
The embodiment of the disclosure obtains and analyzes the bar code provided by the first terminal device to obtain the bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
EXAMPLE five
Fig. 6 is a block diagram illustrating a wireless connection apparatus according to an example embodiment. Referring to fig. 6, the wireless connection device may be a mobile terminal having a wireless connection function of bluetooth, wifi, etc. and a function of scanning a barcode, and includes an acquiring module 101, a sending module 102, a receiving module 103, and a first determining module 104.
The first obtaining module 101 is configured to obtain and parse a barcode provided by a first terminal device, to obtain barcode information, where the barcode information includes: the MAC address of the first terminal device and the first check code.
The sending module 102 is configured to send connection request information to the first terminal device according to the MAC address of the first terminal device, where the connection request information includes: the MAC address of the second terminal device, a second check code and a connection request identifier, wherein the second check code is generated according to the first check code.
The connection request identifier is used for the first terminal equipment to identify a wireless connection request initiated by the second terminal equipment. The second check code can be obtained by calculation according to a preset check code calculation rule and the first check code, the check code calculation rule is stored in the terminal device needing to establish the wireless connection, and the second check code is used for the first terminal device to judge whether the second terminal device is the terminal device capable of establishing the wireless connection. In addition, the first check code can be directly adopted as the second check code.
And the MAC address of the second terminal equipment is used for the first terminal equipment to determine the identity information of the second terminal equipment for identifying the second terminal equipment.
The receiving module 103 is configured to receive response information returned by the first terminal device, where the response information is generated after the first terminal device verifies the second terminal device by using the second check code.
Wherein the response information may be used to indicate whether the second terminal device is authenticated or not, or the response information may be used to inform the second terminal device whether the first terminal device agrees to establish a wireless connection therewith.
The first determining module 104 is configured to determine whether to establish a wireless connection with the first terminal device according to the response information.
If the response information indicates that the second terminal equipment passes the verification or indicates that the first terminal equipment agrees to establish the wireless connection with the second terminal equipment, the second terminal equipment establishes the wireless connection with the first terminal equipment, otherwise, if the response information indicates that the second terminal equipment does not pass the verification or indicates that the first terminal equipment does not agree to establish the wireless connection with the first terminal equipment, the second terminal equipment does not establish the wireless connection with the first terminal equipment.
The embodiment of the disclosure obtains and analyzes the bar code provided by the first terminal device to obtain the bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
EXAMPLE six
Fig. 7 is a block diagram illustrating a wireless connection apparatus according to an example embodiment. Referring to fig. 7, the wireless connection device may be a mobile terminal having a wireless connection function of bluetooth, wifi, etc. and a function of scanning a barcode, and includes an acquiring module 201, a sending module 202, a receiving module 203, and a first determining module 204.
The acquiring module 201 is configured to acquire and parse a barcode provided by a first terminal device, to obtain barcode information, where the barcode information includes: the MAC address of the first terminal device and the first check code.
The sending module 202 is configured to send connection request information to the first terminal device according to the MAC address of the first terminal device, where the connection request information includes: the MAC address of the second terminal device, a second check code and a connection request identifier, wherein the second check code is generated according to the first check code.
The connection request identifier is used for the first terminal equipment to identify a wireless connection request initiated by the second terminal equipment. The second check code can be obtained by calculation according to a preset check code calculation rule and the first check code, the check code calculation rule is stored in the terminal device needing to establish the wireless connection, and the second check code is used for the first terminal device to judge whether the second terminal device is the terminal device capable of establishing the wireless connection. In addition, the first check code can be directly adopted as the second check code.
And the MAC address of the second terminal equipment is used for the first terminal equipment to determine the identity information of the second terminal equipment for identifying the second terminal equipment.
The receiving module 203 is configured to receive response information returned by the first terminal device, where the response information is generated after the first terminal device verifies the second terminal device by using the second check code.
Wherein the response information may be used to indicate whether the second terminal device is authenticated or not, or the response information may be used to inform the second terminal device whether the first terminal device agrees to establish a wireless connection therewith.
The first determining module 204 is configured to determine whether to establish a wireless connection with the first terminal device according to the response information.
If the response information indicates that the second terminal equipment passes the verification or indicates that the first terminal equipment agrees to establish the wireless connection with the second terminal equipment, the second terminal equipment establishes the wireless connection with the first terminal equipment, otherwise, if the response information indicates that the second terminal equipment does not pass the verification or indicates that the first terminal equipment does not agree to establish the wireless connection with the first terminal equipment, the second terminal equipment does not establish the wireless connection with the first terminal equipment.
In addition, the barcode information further includes real-time information of the first terminal device, and the real-time information of the first terminal device includes: whether the first terminal device has established a wireless connection with the other terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device. The device also includes: a second decision module 205. The second determining module 205 is configured to determine whether to request the first terminal device to disconnect from other terminal devices that have established wireless connection according to the real-time information of the first terminal device.
In addition, the connection request information further includes disconnection indication information for indicating that the first terminal device is disconnected from the other terminal devices that have established the wireless connection.
The embodiment of the disclosure obtains and analyzes the bar code provided by the first terminal device to obtain the bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
EXAMPLE seven
Fig. 8 is a block diagram illustrating a wireless connection apparatus according to an example embodiment. Referring to fig. 8, the wireless connection device may be a mobile terminal having a wireless connection function of bluetooth, wifi, etc., and includes an obtaining module 301, a verifying module 302, and a sending module 303.
The obtaining module 301 is configured to obtain connection request information sent by the second terminal device, where the connection request information includes: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code, and the first check code is obtained by the second terminal equipment through analyzing the bar code provided by the first terminal equipment.
The connection request identifier is used for the first terminal equipment to identify a connection request sent by the second terminal.
The verification module 302 is configured to verify the second terminal device with the second check code, resulting in a verification result.
In this embodiment, when the second check code is determined, the third check code obtained by calculating the first check code may be matched with the second check code according to a preset check code calculation rule, and if the matching is successful, the second terminal device passes the verification; otherwise, if the matching result is not obtained, the second terminal device is not verified. In addition, the first check code can be used as the second check code, so that whether the first check code is the same as the second check code or not can be judged, and if the first check code is the same as the second check code, the second terminal equipment passes the verification.
The sending module 303 is configured to send response information to the second terminal device according to the verification result.
In this embodiment, the second terminal device determines whether to establish a wireless connection with the first terminal device according to the response information. If the response information indicates that the second terminal equipment passes the verification or indicates that the first terminal equipment agrees to establish the wireless connection with the second terminal equipment, the second terminal equipment establishes the wireless connection with the first terminal equipment, otherwise, if the response information indicates that the second terminal equipment does not pass the verification or indicates that the first terminal equipment does not agree to establish the wireless connection with the first terminal equipment, the second terminal equipment does not establish the wireless connection with the first terminal equipment.
The embodiment of the disclosure obtains and analyzes the bar code provided by the first terminal device to obtain the bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
Example eight
FIG. 9 is a block diagram illustrating a wire connection apparatus in accordance with an exemplary embodiment. Referring to fig. 9, the wireless connection apparatus may be a mobile terminal having a wireless connection function of bluetooth, wifi, etc., and includes an acquisition module 401, a verification module 402, and a transmission module 403.
The obtaining module 401 is configured to obtain connection request information sent by the second terminal device, where the connection request information includes: the MAC address, the second check code and the connection request identification of the second terminal device, wherein the second check code is generated according to the first check code, and the first check code is obtained by analyzing the bar code provided by the first terminal device.
The connection request identifier is used for the first terminal equipment to identify a connection request sent by the second terminal. The barcode may be a two-dimensional code or a one-dimensional code, etc.
The verification module 402 is configured to verify the second terminal device with the second check code, resulting in a verification result.
When the second check code is judged, the third check code obtained by calculating the first check code can be matched with the second check code according to a preset check code calculation rule, and if the matching is successful, the second terminal equipment passes the verification; otherwise, if the matching result is not obtained, the second terminal device is not verified. In addition, the first check code can be used as the second check code, so that whether the first check code is the same as the second check code or not can be judged, and if the first check code is the same as the second check code, the second terminal equipment passes the verification.
The sending module 403 is configured to send response information to the second terminal device according to the verification result.
In this embodiment, the second terminal device determines whether to establish a wireless connection with the first terminal device according to the response information. If the response information indicates that the second terminal equipment passes the verification or indicates that the first terminal equipment agrees to establish the wireless connection with the second terminal equipment, the second terminal equipment establishes the wireless connection with the first terminal equipment, otherwise, if the response information indicates that the second terminal equipment does not pass the verification or indicates that the first terminal equipment does not agree to establish the wireless connection with the first terminal equipment, the second terminal equipment does not establish the wireless connection with the first terminal equipment.
In addition, the apparatus further comprises: a generation module 404. Wherein the generating module 404 is configured to generate a barcode, the barcode including barcode information comprising: the MAC address of the first terminal device and the first check code.
Further, the barcode information further includes real-time information of the first terminal device, and the real-time information of the first terminal device includes: whether the first terminal device has established a wireless connection with the other terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
In addition, the connection request information further includes device information of the second terminal device, the device information including: and one or more of the device name and the device type of the second terminal device.
Further, the apparatus also comprises a determination module 405 and a processing module 406. Wherein the determining module 405 is configured to determine the priority of the second terminal device according to one or more of the device name, the device type and the MAC address of the second terminal device; the processing module 406 is configured to establish a wireless connection with the second terminal device according to the priority of the second terminal device.
In practical applications, since it is possible that a plurality of terminal devices pass the verification of the first terminal device at the same time, the first terminal device may select which terminal device to establish a wireless connection preferentially according to a preset priority rule. The priority rule may be a level rule established according to one or more of a device name, a device type, and a MAC address of the terminal device, for example: the device name or the MAC address may be stored in the first terminal device, and the first terminal device determines the priority of the terminal device that has passed the authentication according to the device name or the MAC address; the device type can also be stored in the first terminal device, and the first terminal device judges which type of terminal device preferentially establishes the wireless connection according to the device type; reference may also be made to a plurality of the above items simultaneously. The foregoing is by way of example only and is not intended as a limitation upon the present disclosure.
The embodiment of the disclosure obtains and analyzes the bar code provided by the first terminal device to obtain the bar code information; then sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment; and finally, receiving response information returned by the first terminal equipment, and judging whether to establish wireless connection with the first terminal equipment according to the response information. The second terminal device initiates a wireless connection request to the first terminal device by acquiring the MAC address of the first terminal device of the barcode information, so that the situation of mismatching or misconnection caused by the same name of the target device is avoided, the connection request information contains a second check code, whether the second terminal device is a connectable terminal device or not is judged by verifying the second check code, and the accuracy of wireless connection is guaranteed.
Example nine
Fig. 10 is a block diagram illustrating a wireless connection apparatus 800 according to an example embodiment. For example, the apparatus 800 may be a mobile terminal.
Referring to fig. 10, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing elements 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operation at the device 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 806 provides power to the various components of device 800. The power components 806 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed state of the device 800, the relative positioning of the components, such as the display and keypad of the apparatus 800, the sensor assembly 814 may also detect a change in the position of the apparatus 800 or a component of the apparatus 800, the presence or absence of user contact with the apparatus 800, the orientation or acceleration/deceleration of the apparatus 800, and a change in the temperature of the apparatus 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium comprising instructions, such as the memory 804 comprising instructions, executable by the processor 820 of the device 800 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a wireless connection method, the method comprising:
acquiring and analyzing a bar code provided by a first terminal device to obtain bar code information, wherein the bar code information comprises: the MAC address and the first check code of the first terminal equipment;
sending connection request information to the first terminal equipment according to the MAC address of the first terminal equipment, wherein the connection request information comprises: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code;
receiving response information returned by the first terminal equipment, wherein the response information is generated after the first terminal equipment adopts a second check code to verify the second terminal equipment;
and judging whether to establish wireless connection with the first terminal equipment or not according to the response information.
Example ten
Fig. 11 is a block diagram illustrating a wireless connection apparatus 900 according to an example embodiment. For example, the apparatus 900 may be a mobile terminal.
Referring to fig. 11, the apparatus 900 may include one or more of the following components: processing component 902, memory 904, power component 906, multimedia component 908, audio component 910, input/output (I/O) interface 912, sensor component 914, and communication component 916.
The processing component 902 generally controls overall operation of the device 900, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Processing element 902 may include one or more processors 920 to execute instructions to perform all or a portion of the steps of the methods described above. Further, processing component 902 can include one or more modules that facilitate interaction between processing component 902 and other components. For example, the processing component 902 can include a multimedia module to facilitate interaction between the multimedia component 908 and the processing component 902.
The memory 904 is configured to store various types of data to support operation at the device 900. Examples of such data include instructions for any application or method operating on device 900, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 904 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power component 906 provides power to the various components of device 900. The power components 906 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the device 900.
The multimedia component 908 includes a screen that provides an output interface between the device 900 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 908 includes a front facing camera and/or a rear facing camera. The front-facing camera and/or the rear-facing camera may receive external multimedia data when the device 900 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 910 is configured to output and/or input audio signals. For example, audio component 910 includes a Microphone (MIC) configured to receive external audio signals when apparatus 900 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 904 or transmitted via the communication component 916. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
I/O interface 912 provides an interface between processing component 902 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor component 914 includes one or more sensors for providing status assessment of various aspects of the apparatus 900. For example, the sensor assembly 914 may detect an open/closed state of the device 900, the relative positioning of the components, such as a display and keypad of the apparatus 900, the sensor assembly 914 may also detect a change in the position of the apparatus 900 or a component of the apparatus 900, the presence or absence of user contact with the apparatus 900, orientation or acceleration/deceleration of the apparatus 900, and a change in the temperature of the apparatus 900. The sensor assembly 914 may include a proximity sensor configured to detect the presence of a nearby object in the absence of any physical contact. The sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 914 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 916 is configured to facilitate communications between the apparatus 900 and other devices in a wired or wireless manner. The apparatus 900 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 916 receives a broadcast signal or broadcast associated information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communications component 916 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 900 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 904 comprising instructions, executable by the processor 920 of the apparatus 900 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein which, when executed by a processor of a mobile terminal, enable the mobile terminal to perform a wireless connection method, the method comprising:
acquiring connection request information sent by second terminal equipment, wherein the connection request information comprises: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated according to the first check code, and the first check code is obtained by the second terminal equipment through analyzing the bar code provided by the first terminal equipment;
verifying the second terminal equipment by adopting a second check code to obtain a verification result;
and sending response information to the second terminal equipment according to the verification result.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (22)

1. A method of wireless connectivity, the method comprising:
acquiring and analyzing a bar code provided by a first terminal device to obtain bar code information, wherein the bar code information comprises: the MAC address and the first check code of the first terminal equipment;
sending connection request information to the first terminal device according to the MAC address of the first terminal device, wherein the connection request information comprises: the MAC address, a second check code and a connection request identifier of the second terminal device, wherein the second check code is generated by a preset check code calculation rule according to the first check code;
receiving response information returned by the first terminal device, where the response information is generated after the first terminal device verifies the second terminal device by using the second check code, and the verifying the second terminal device by using the second check code by the first terminal device includes: the first terminal equipment adopts a third check code to match with the second check code, and verifies the second terminal equipment according to the matching result of the third check code and the second check code, wherein the third check code is generated by calculating the first check code according to a preset check code calculation rule when the first terminal judges the second check code;
and judging whether to establish wireless connection with the first terminal equipment or not according to the response information.
2. The method of claim 1, wherein the barcode information further comprises real-time information of the first terminal device, and wherein the real-time information of the first terminal device comprises: whether the first terminal device has established a wireless connection with another terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
3. The method of claim 2, further comprising:
and judging whether to request the first terminal equipment to disconnect from other terminal equipment which establishes wireless connection or not according to the real-time information of the first terminal equipment.
4. The method according to any one of claims 1 to 3, wherein the connection request information further includes disconnection indication information for indicating that the first terminal device is disconnected from other terminal devices that have established wireless connection.
5. A method of wireless connectivity, the method comprising:
acquiring connection request information sent by second terminal equipment, wherein the connection request information comprises: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated by a preset check code calculation rule according to a first check code, and the first check code is obtained by the second terminal equipment through analyzing a bar code provided by the first terminal equipment;
adopting the second check code to verify the second terminal device to obtain a verification result, the adopting the second check code to verify the second terminal device comprises: adopting a third check code to be matched with the second check code, and verifying the second terminal device according to the matching result of the third check code and the second check code, wherein the third check code is generated by calculating the first check code according to a preset check code calculation rule when the first terminal judges the second check code;
and sending response information to the second terminal equipment according to the verification result.
6. The method of claim 5, further comprising:
generating a bar code, wherein the bar code comprises bar code information comprising: the MAC address of the first terminal device and the first check code.
7. The method of claim 6, wherein the barcode information further comprises real-time information of the first terminal device, and wherein the real-time information of the first terminal device comprises: whether the first terminal device has established a wireless connection with another terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
8. The method according to any one of claims 5 to 7, wherein the connection request information further includes disconnection indication information for indicating that the first terminal device is disconnected from other terminal devices that have established wireless connection.
9. The method of claim 5, wherein the connection request information further comprises device information of the second terminal device, and wherein the device information comprises: and one or more of the device name and the device type of the second terminal device.
10. The method of claim 9, further comprising:
determining the priority of the second terminal equipment according to one or more of the equipment name, the equipment type and the MAC address of the second terminal equipment;
and establishing wireless connection with the second terminal equipment according to the priority of the second terminal equipment.
11. A wireless connection apparatus, the apparatus comprising:
the acquisition module is used for acquiring and analyzing a bar code provided by a first terminal device to obtain bar code information, wherein the bar code information comprises: the MAC address and the first check code of the first terminal equipment;
a sending module, configured to send connection request information to the first terminal device according to the MAC address of the first terminal device, where the connection request information includes: the MAC address, a second check code and a connection request identifier of the second terminal device, wherein the second check code is generated by a preset check code calculation rule according to the first check code;
a receiving module, configured to receive response information returned by the first terminal device, where the response information is generated after the first terminal device verifies the second terminal device by using the second check code, and the verifying the second terminal device by using the second check code by using the first terminal device includes: the first terminal equipment adopts a third check code to match with the second check code, and verifies the second terminal equipment according to the matching result of the third check code and the second check code, wherein the third check code is generated by calculating the first check code according to a preset check code calculation rule when the first terminal judges the second check code;
and the first judging module is used for judging whether to establish wireless connection with the first terminal equipment according to the response information.
12. The apparatus of claim 11, wherein the barcode information further comprises real-time information of the first terminal device, and wherein the real-time information of the first terminal device comprises: whether the first terminal device has established a wireless connection with another terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
13. The apparatus of claim 12, further comprising:
and the second judgment module is used for judging whether to request the first terminal equipment to be disconnected with other terminal equipment which establishes wireless connection according to the real-time information of the first terminal equipment.
14. The apparatus according to any of claims 11-13, wherein the connection request information further includes disconnection indication information, and the disconnection indication information is used to indicate that the first terminal device is disconnected from other terminal devices that have established wireless connection.
15. A wireless connection apparatus, the apparatus comprising:
an obtaining module, configured to obtain connection request information sent by a second terminal device, where the connection request information includes: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated by a preset check code calculation rule according to a first check code, and the first check code is obtained by the second terminal equipment through analyzing a bar code provided by the first terminal equipment;
the verification module is configured to verify the second terminal device with the second check code to obtain a verification result, where the verifying the second terminal device with the second check code includes: adopting a third check code to be matched with the second check code, and verifying the second terminal device according to the matching result of the third check code and the second check code, wherein the third check code is generated by calculating the first check code according to a preset check code calculation rule when the first terminal judges the second check code;
and the sending module is used for sending response information to the second terminal equipment according to the verification result.
16. The apparatus of claim 15, further comprising:
the generating module is used for generating a bar code, and the bar code information contained in the bar code comprises: the MAC address of the first terminal device and the first check code.
17. The apparatus of claim 16, wherein the barcode information further comprises real-time information of the first terminal device, and wherein the real-time information of the first terminal device comprises: whether the first terminal device has established a wireless connection with another terminal device, and the number of other terminal devices that have established a wireless connection with the first terminal device.
18. The apparatus according to any of claims 15-17, wherein the connection request information further includes disconnection indication information, and the disconnection indication information is used to indicate that the first terminal device is disconnected from other terminal devices that have established wireless connection.
19. The apparatus of claim 15, wherein the connection request information further comprises device information of the second terminal device, and wherein the device information comprises: and one or more of the device name and the device type of the second terminal device.
20. The apparatus of claim 19, further comprising:
a determining module, configured to determine a priority of the second terminal device according to one or more of a device name, a device type, and an MAC address of the second terminal device;
and the processing module is used for establishing wireless connection with the second terminal equipment according to the priority of the second terminal equipment.
21. A wireless connection apparatus, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring and analyzing a bar code provided by a first terminal device to obtain bar code information, wherein the bar code information comprises: the MAC address and the first check code of the first terminal equipment;
sending connection request information to the first terminal device according to the MAC address of the first terminal device, wherein the connection request information comprises: the MAC address, a second check code and a connection request identifier of the second terminal device, wherein the second check code is generated by a preset check code calculation rule according to the first check code;
receiving response information returned by the first terminal device, where the response information is generated after the first terminal device verifies the second terminal device by using the second check code, and the verifying the second terminal device by using the second check code by the first terminal device includes: the first terminal equipment adopts a third check code to match with the second check code, and verifies the second terminal equipment according to the matching result of the third check code and the second check code, wherein the third check code is generated by calculating the first check code according to a preset check code calculation rule when the first terminal judges the second check code;
and judging whether to establish wireless connection with the first terminal equipment or not according to the response information.
22. A wireless connection apparatus, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
acquiring connection request information sent by second terminal equipment, wherein the connection request information comprises: the MAC address, the second check code and the connection request identification of the second terminal equipment, wherein the second check code is generated by a preset check code calculation rule according to a first check code, and the first check code is obtained by the second terminal equipment through analyzing a bar code provided by the first terminal equipment;
adopting the second check code to verify the second terminal device to obtain a verification result, the adopting the second check code to verify the second terminal device comprises: adopting a third check code to be matched with the second check code, and verifying the second terminal device according to the matching result of the third check code and the second check code, wherein the third check code is generated by calculating the first check code according to a preset check code calculation rule when the first terminal judges the second check code;
and sending response information to the second terminal equipment according to the verification result.
CN201410466306.6A 2014-09-12 2014-09-12 Wireless connection method and device Active CN105472771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410466306.6A CN105472771B (en) 2014-09-12 2014-09-12 Wireless connection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410466306.6A CN105472771B (en) 2014-09-12 2014-09-12 Wireless connection method and device

Publications (2)

Publication Number Publication Date
CN105472771A CN105472771A (en) 2016-04-06
CN105472771B true CN105472771B (en) 2020-06-19

Family

ID=55609910

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410466306.6A Active CN105472771B (en) 2014-09-12 2014-09-12 Wireless connection method and device

Country Status (1)

Country Link
CN (1) CN105472771B (en)

Families Citing this family (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105933657A (en) * 2016-05-17 2016-09-07 北京睿智荟聚科技发展有限公司 Method and system for network real-time live broadcasting of instant frame, and camera
CN106793018A (en) * 2017-02-22 2017-05-31 周莹 A kind of method of internet of things equipment access network
CN108696843A (en) 2017-03-07 2018-10-23 中移(杭州)信息技术有限公司 Bluetooth group control method, device and system between a kind of physical equipment
CN107483715B (en) * 2017-07-04 2021-03-02 上海小蚁科技有限公司 Method and system for communication between terminal and equipment, terminal and storage medium
CN107371156A (en) * 2017-08-10 2017-11-21 腾讯科技(深圳)有限公司 Mobile terminal matching method and mobile terminal
CN108174458B (en) * 2017-12-29 2020-11-17 歌尔科技有限公司 Method and device for wireless connection between mobile terminal and wearable device, mobile terminal and wearable device
CN109996347B (en) * 2017-12-29 2023-05-23 珠海金山办公软件有限公司 Method and device for establishing connection between terminal devices
CN109274563B (en) * 2018-10-10 2021-12-31 耘申信息科技(上海)有限公司 Equipment connection method and device
CN110209070A (en) * 2019-04-10 2019-09-06 浙江捷昌线性驱动科技股份有限公司 The means of communication, device and same table based on two dimensional code
CN111355558A (en) * 2019-06-27 2020-06-30 鸿合科技股份有限公司 Method for improving connection code connection accuracy and related equipment
CN112055082B (en) * 2020-09-08 2023-07-25 北京自如信息科技有限公司 Checking method and device of access equipment and computer equipment
CN113115475A (en) * 2021-03-24 2021-07-13 福建新大陆自动识别技术有限公司 Wireless connection method and system
CN113556715B (en) * 2021-07-02 2023-10-03 Oppo广东移动通信有限公司 Device connection method and apparatus, computer readable medium and electronic device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932037A (en) * 2012-10-15 2013-02-13 天地融科技股份有限公司 Method and system for establishing connection between Bluetooth key and terminal
CN202856994U (en) * 2012-10-15 2013-04-03 天地融科技股份有限公司 System for establishing connection between bluetooth key and terminal
CN103974375A (en) * 2014-01-17 2014-08-06 北京奇虎科技有限公司 Wireless network access method, device and system
CN104038263A (en) * 2014-06-18 2014-09-10 小米科技有限责任公司 Method and device for establishing Bluetooth connection

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102932037A (en) * 2012-10-15 2013-02-13 天地融科技股份有限公司 Method and system for establishing connection between Bluetooth key and terminal
CN202856994U (en) * 2012-10-15 2013-04-03 天地融科技股份有限公司 System for establishing connection between bluetooth key and terminal
CN103974375A (en) * 2014-01-17 2014-08-06 北京奇虎科技有限公司 Wireless network access method, device and system
CN104038263A (en) * 2014-06-18 2014-09-10 小米科技有限责任公司 Method and device for establishing Bluetooth connection

Also Published As

Publication number Publication date
CN105472771A (en) 2016-04-06

Similar Documents

Publication Publication Date Title
CN105472771B (en) Wireless connection method and device
KR101755589B1 (en) Method and apparatus, program and recording medium for network access
EP3151507B1 (en) Methods and apparatuses for controlling device
CN104318741B (en) Bluetooth equipment control method and device
EP3177077A1 (en) Method and device for network access
US10764934B2 (en) Method, apparatus for terminal device to access wireless network
CN109451817B (en) Unmanned aerial vehicle access method and device
JP6250867B2 (en) Network connection method, apparatus, program, and recording medium
EP3179397A1 (en) Methods and devices for managing automatic parallel login and logout in several applications
CN105138942A (en) Two-dimensional code display method and device
KR101642019B1 (en) Method, apparatus, program, and recording medium of verifying terminal
CN106375096B (en) short message verification method and device
CN104468971A (en) Method and device for connecting playing source
CN104994541A (en) Network flow correction method and device
CN107562500B (en) Debugging device, method and equipment
CN105049219A (en) Network traffic ordering method and system, mobile terminal and server
CN105282162A (en) Processing method and device for account management business
CN105337937A (en) Network verification method and device
CN104618987A (en) Method and device for accessing network
CN111541922A (en) Method, device and storage medium for displaying interface input information
CN104994211A (en) Incoming call prompting method, device and system
CN105512542A (en) Information inputting method and system
CN105530594A (en) Communication method and device based remote control
US10019604B2 (en) Method and apparatus of verifying terminal and medium
CN105657322A (en) Image providing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200422

Address after: No.018, floor 8, building 6, yard 33, middle Xierqi Road, Haidian District, Beijing 100085

Applicant after: BEIJING XIAOMI MOBILE SOFTWARE Co.,Ltd.

Applicant after: Xiaomi Technology Co.,Ltd.

Address before: 100085, Haidian District, Beijing Qinghe Street No. 68, Huarun colorful city shopping center two, 13 layers

Applicant before: Xiaomi Technology Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant