[go: up one dir, main page]

CN107277751B - Method, apparatus and storage medium for establishing short-range wireless communication connection - Google Patents

Method, apparatus and storage medium for establishing short-range wireless communication connection Download PDF

Info

Publication number
CN107277751B
CN107277751B CN201710515928.7A CN201710515928A CN107277751B CN 107277751 B CN107277751 B CN 107277751B CN 201710515928 A CN201710515928 A CN 201710515928A CN 107277751 B CN107277751 B CN 107277751B
Authority
CN
China
Prior art keywords
mac address
command
intelligent device
random number
wireless communication
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
CN201710515928.7A
Other languages
Chinese (zh)
Other versions
CN107277751A (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
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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201710515928.7A priority Critical patent/CN107277751B/en
Publication of CN107277751A publication Critical patent/CN107277751A/en
Application granted granted Critical
Publication of CN107277751B publication Critical patent/CN107277751B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The disclosure relates to a method, a device and a computer readable storage medium for establishing short-distance wireless communication connection, which relate to the technical field of communication, and the method comprises the following steps: sending a first command to second intelligent equipment through a CEC channel, wherein the first command carries a first MAC address, the first MAC address is a short-distance wireless communication protocol MAC address of the first intelligent equipment, and the CEC channel is formed after the first intelligent equipment and the second intelligent equipment are connected through HDMI; receiving a second command sent by a second intelligent device through a CEC channel; and when the second command carries a second MAC address, establishing short-distance wireless communication connection with the second intelligent equipment based on the second MAC address, wherein the second MAC address is a short-distance wireless communication protocol MAC address of the second intelligent equipment. Therefore, the first intelligent device can quickly and conveniently establish short-distance wireless communication connection with the second intelligent device without searching for the first intelligent device.

Description

Method, apparatus and storage medium for establishing short-range wireless communication connection
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method, an apparatus, and a storage medium for establishing a short-range wireless communication connection.
Background
Currently, smart display devices such as smart televisions, monitor display devices, computers, and the like are equipped with an HDMI (high definition Multimedia Interface), and other smart devices that are physically connected to the smart display device via the HDMI may also be connected to the smart display device via short-range wireless communication, such as bluetooth. For convenience of the following description, the smart display device is referred to as a first smart device, and the smart device that establishes a physical connection with the smart display device through the HDMI is referred to as a second smart device. Of course, the smart display device may also be referred to as a second smart device, and the smart device that establishes a physical connection with the smart display device through the HDMI may also be referred to as a first smart device.
In the related art, when a first smart device needs to establish a short-range wireless communication connection with a second smart device, the first smart device may send a broadcast message to the outside in a wireless manner to search for the second smart device located within a preset range, and when the first smart device searches for the second smart device, the first smart device may send a connection request to the second smart device, so as to establish a short-range wireless communication connection with the second smart device.
Disclosure of Invention
In order to overcome the problem of slow speed when the first intelligent device and the second intelligent device establish the short-distance wireless communication connection in the related art, the present disclosure provides a method, an apparatus and a computer-readable storage medium for establishing the short-distance wireless communication connection.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for establishing a short-range wireless communication connection, applying a first smart device, the method including:
sending a first command to a second intelligent device through a CEC (consumer electronics control) channel, wherein the first command carries a first Media Access Control (MAC) address, the first MAC address is an MAC address of a short-distance wireless communication protocol of the first intelligent device, and the CEC channel is formed after the first intelligent device and the second intelligent device are connected through a high-definition multimedia interface (HDMI);
receiving a second command sent by the second intelligent device through the CEC channel, wherein the second command is sent by the second intelligent device after receiving the first command;
and when the second command carries a second MAC address, establishing short-distance wireless communication connection with the second intelligent equipment based on the second MAC address, wherein the second MAC address is the MAC address of the short-distance wireless communication protocol of the second intelligent equipment.
Optionally, the first command further carries a first acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address;
the establishing a short-range wireless communication connection with the second smart device based on the second MAC address comprises:
and when the second command further carries a second acknowledgement, establishing the short-range wireless communication connection with the second intelligent device based on the second MAC address, wherein the second acknowledgement is used for indicating that the second intelligent device has received the first MAC address.
Optionally, the first command further carries a first random number, and the first random number is generated by the first smart device;
the establishing the short-range wireless communication connection with the second smart device based on the second MAC address comprises:
and when the second command also carries a second random number and the first random number and the second random number meet preset conditions, establishing the short-distance wireless communication connection with the second intelligent device based on the second MAC address.
Optionally, before establishing the short-range wireless communication connection with the second smart device based on the second MAC address, the method further includes:
determining a third random number based on the second random number;
sending a third command to the second intelligent device through the CEC channel, where the third command carries a third acknowledgement and the third random number, and the third acknowledgement is used to indicate that the first intelligent device has received the second MAC address.
Optionally, the method further comprises:
detecting the sending state of the MAC address;
when the MAC address transmission status is not transmitted, executing the step of transmitting the first command to the second smart device through the CEC channel;
and when the MAC address transmission status is that the MAC address is transmitted and a fourth acknowledgement is received, the step of transmitting the first command to the second smart device through the CEC channel is performed, where the fourth acknowledgement is used to indicate that the second smart device does not receive the first MAC address.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for establishing a short-range wireless communication connection, applying a second smart device, the method comprising:
receiving a first command sent by a first intelligent device through a Consumer Electronics Control (CEC) channel, wherein the CEC channel is formed after the second intelligent device and the first intelligent device are connected through a High Definition Multimedia Interface (HDMI), and the first command is a command sent when the first intelligent device and the second intelligent device establish short-distance wireless communication connection;
sending a second command to the first intelligent device through the CEC channel, where the second command carries a second MAC address of a second intelligent device, and the second MAC address is an MAC address of a short-range wireless communication protocol of the second intelligent device;
and when the first command carries a first MAC address, establishing short-distance wireless communication connection with the first intelligent equipment based on the first MAC address, wherein the first MAC address is the MAC address of the short-distance wireless communication protocol of the first intelligent equipment.
Optionally, when the first command further carries a first acknowledgement, and when the first command carries the first MAC address, the second command further carries a second acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address, and the second acknowledgement is used to indicate that the second smart device has received the first MAC address.
Optionally, after receiving the first command sent by the first smart device through the CEC channel of the consumer electronics control, the method further includes:
when the first command also carries a first random number, determining a second random number based on the first random number, wherein the first random number is generated by the first intelligent device;
correspondingly, the second command also carries the second random number.
Optionally, the establishing a short-range wireless communication connection with the first smart device based on the first MAC address includes:
when a third command sent by the first intelligent device through the CEC channel is received and the third command carries a third identifier and a third random number, judging whether a preset condition is met between the second random number and the third random number;
wherein the third acknowledgement is used to indicate that the second MAC address has been received by the first smart device, and the third random number is determined by the first smart device based on the second random number;
and when the preset condition is met between the second random number and the third random number, establishing the short-distance wireless communication connection with the first intelligent equipment based on the first MAC address.
Optionally, the method further comprises:
when the first command does not carry the first MAC address, sending a fourth acknowledgement to the first intelligent device through the CEC channel, and re-receiving the first command sent by the first intelligent device through the CEC channel, where the fourth acknowledgement is used to indicate that the second intelligent device does not receive the first MAC address.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for establishing a short-range wireless communication connection, the apparatus being included in a first smart device, the apparatus comprising:
the first sending module is configured to send a first command to a second intelligent device through a Consumer Electronics Control (CEC) channel, where the first command carries a first Media Access Control (MAC) address, the first MAC address is an MAC address of a short-range wireless communication protocol of the first intelligent device, and the CEC channel is a channel formed after the first intelligent device and the second intelligent device are connected through a high-definition multimedia interface (HDMI);
a first receiving module, configured to receive a second command sent by the second intelligent device through the CEC channel, where the second command is sent by the second intelligent device after receiving the first command;
and the first connection module is configured to establish short-range wireless communication connection with the second intelligent device based on a second MAC address when the second command carries the second MAC address, where the second MAC address is a MAC address of the short-range wireless communication protocol of the second intelligent device.
Optionally, the first command further carries a first acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address;
the first connection module is configured to:
and when the second command further carries a second acknowledgement, establishing the short-range wireless communication connection with the second intelligent device based on the second MAC address, wherein the second acknowledgement is used for indicating that the second intelligent device has received the first MAC address.
Optionally, the first command further carries a first random number, and the first random number is generated by the first smart device;
the first connection module is further configured to:
and when the second command also carries a second random number and the first random number and the second random number meet preset conditions, establishing the short-distance wireless communication connection with the second intelligent device based on the second MAC address.
Optionally, the apparatus further comprises:
a first determining module for determining a third random number based on the second random number;
a second sending module, configured to send a third command to the second intelligent device through the CEC channel, where the third command carries a third acknowledgement and the third random number, and the third acknowledgement is used to indicate that the first intelligent device has received the second MAC address.
Optionally, the apparatus further comprises:
the detection module is used for detecting the sending state of the MAC address;
the triggering module is used for triggering the first sending module to send a first command to the second intelligent device through a CEC channel when the MAC address sending state is not sent;
the triggering module is further configured to trigger the first sending module to send a first command to the second intelligent device through a CEC channel when the MAC address sending status is sent and a fourth acknowledgement is received, where the fourth acknowledgement is used to indicate that the second intelligent device does not receive the first MAC address.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an apparatus for establishing a short-range wireless communication connection, the apparatus being included in a second smart device, the apparatus comprising:
the second receiving module is used for receiving a first command sent by a first intelligent device through a Consumer Electronics Control (CEC) channel, wherein the CEC channel is formed after the second intelligent device and the first intelligent device are connected through a high-definition multimedia interface (HDMI), and the first command is a command sent when the first intelligent device and the second intelligent device establish short-distance wireless communication connection;
a third sending module, configured to send a second command to the first intelligent device through the CEC channel, where the second command carries a second MAC address of a second intelligent device, and the second MAC address is a MAC address of a short-range wireless communication protocol of the second intelligent device;
and the second connection module is used for establishing short-distance wireless communication connection with the first intelligent equipment based on the first MAC address when the first command carries the first MAC address, and the first MAC address is the MAC address of the short-distance wireless communication protocol of the first intelligent equipment.
Optionally, when the first command further carries a first acknowledgement, and when the first command carries the first MAC address, the second command further carries a second acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address, and the second acknowledgement is used to indicate that the second smart device has received the first MAC address.
Optionally, the apparatus further comprises:
a second determining module, configured to determine, when the first command further carries a first random number, a second random number based on the first random number, where the first random number is generated by the first smart device;
correspondingly, the second command also carries the second random number.
Optionally, the second connection module comprises:
the judging submodule is used for judging whether a preset condition is met between the second random number and the third random number when a third command sent by the first intelligent device through the CEC channel is received and the third command carries a third identifier and the third random number;
wherein the third acknowledgement is used to indicate that the second MAC address has been received by the first smart device, and the third random number is determined by the first smart device based on the second random number;
and the connection sub-module is used for establishing the short-distance wireless communication connection with the first intelligent device based on the first MAC address when the preset condition is met between the second random number and the third random number.
Optionally, the apparatus further comprises:
a fourth sending module, configured to send a fourth acknowledgement to the first intelligent device through the CEC channel when the first command does not carry the first MAC address;
the second receiving module is further configured to re-receive the first command sent by the first smart device through the CEC channel, and the fourth acknowledgement is used to indicate that the second smart device does not receive the first MAC address.
According to a fifth aspect of the embodiments of the present disclosure, there is provided an apparatus for establishing a short-range wireless communication connection, the apparatus being included in a first smart device, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of any one of the methods of the first aspect.
According to a sixth aspect of the embodiments of the present disclosure, there is provided an apparatus for establishing a short-range wireless communication connection, the apparatus being included in a second smart device, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the steps of any one of the methods of the second aspect.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon instructions which, when executed by a processor, implement the steps of any one of the methods of the first aspect described above.
According to an eighth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon instructions which, when executed by a processor, implement the steps of any one of the methods of the second aspect described above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: in the embodiment of the present disclosure, the first smart device and the second smart device may be directly physically connected through HDMI, and transmit the short-distance wireless communication protocol MAC address to each other through a CEC channel formed by the physical connection, so that the first smart device and the second smart device may directly acquire the short-distance wireless communication protocol MAC address of the other party, and establish the short-distance wireless communication connection according to the acquired short-distance wireless communication protocol MAC address, and do not need to perform device search in a wireless manner, so that the process of establishing the short-distance wireless communication connection becomes fast and convenient.
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 flow chart illustrating a method of establishing a short-range wireless communication connection according to an example embodiment.
Fig. 2 is a flow chart illustrating a method of establishing a short-range wireless communication connection according to an example embodiment.
Fig. 3 is a flow chart illustrating a method of establishing a short-range wireless communication connection according to an example embodiment.
Fig. 4A is a block diagram illustrating an apparatus 400 for establishing a short-range wireless communication connection according to an example embodiment.
Fig. 4B is a block diagram illustrating an apparatus 400 for establishing a short-range wireless communication connection according to an example embodiment.
Fig. 4C is a block diagram illustrating an apparatus 400 for establishing a short-range wireless communication connection according to an example embodiment.
Fig. 5A is a block diagram illustrating an apparatus 500 for establishing a short-range wireless communication connection according to an example embodiment.
Fig. 5B is a block diagram illustrating an apparatus 500 for establishing a short-range wireless communication connection according to an example embodiment.
Fig. 5C is a block diagram illustrating a second connection module 503 according to an example embodiment.
Fig. 5D is a block diagram illustrating an apparatus 500 for establishing a short-range wireless communication connection according to an example embodiment.
Fig. 6 is a block diagram illustrating an apparatus 600 for establishing a short-range wireless communication connection according to an example embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the present disclosure more apparent, embodiments of the present disclosure will be described in detail with reference to the accompanying drawings.
Before explaining the embodiments of the present disclosure in detail, an application scenario of the embodiments of the present disclosure will be described. At present, most of intelligent display devices are provided with HDMI, and through the HDMI, the intelligent display devices can establish physical connection with other intelligent devices by utilizing HDMI lines. The intelligent display device can be an intelligent television, a computer, a monitoring display device and the like, and other intelligent devices which are physically connected with the intelligent display device through an HDMI (high-definition multimedia interface) can be a television box, a high-definition player, a television game machine, a television host and the like. The other intelligent devices that are physically connected to the intelligent display device through the HDMI cable generally have a function of establishing short-distance WIreless communication connection, that is, the other intelligent devices that are physically connected to the intelligent display device through the HDMI cable may also establish short-distance WIreless communication connection such as bluetooth and WIFI (WIreless Fidelity) with the intelligent display device. For example, can be connected through the HDMI line between smart TV and the TV box, meanwhile, smart TV and TV box all have short distance wireless communication connection functions such as bluetooth, WIFI. The method for establishing short-distance wireless communication connection provided by the embodiment of the disclosure can be used in the above-mentioned scenario, and when the intelligent display device and other intelligent devices establish physical connection through the HDMI cable, the intelligent display device and other intelligent devices can establish short-distance wireless communication connection through the method provided by the embodiment of the disclosure.
In addition, in the embodiment of the present disclosure, for convenience of description, the first smart device and the second smart device will be used later to distinguish the smart display device from other smart devices connected thereto through the HDMI line. When the first intelligent device is the intelligent display device, the second intelligent device is the other intelligent devices connected with the intelligent display device through the HDMI line. When the first intelligent device is other intelligent devices connected with the intelligent display device through the HDMI line, the second intelligent device is the intelligent display device.
In the related art, in the process of establishing short-distance wireless communication connection, the first intelligent device and the second intelligent device need to search and then can acquire respective MAC addresses, and then establish connection, which is tedious in operation and slow in speed.
In order to solve the above technical problem, embodiments of the present disclosure provide a method for establishing a short-range wireless communication connection, and a specific implementation manner of establishing a short-range wireless communication connection will be explained through the following embodiments while referring to the drawings.
Fig. 1 is a flowchart illustrating a method of establishing a short-range wireless communication connection according to an exemplary embodiment, which is used in a first smart device, as shown in fig. 1, and includes the steps of:
in step 101, a first command is sent to a second smart device through a CEC channel, where the first command carries a first MAC address, the first MAC address is a short-range wireless communication protocol MAC address of the first smart device, and the CEC channel is a channel formed after the first smart device and the second smart device are connected through HDMI.
In step 102, a second command sent by the second smart device through the CEC channel is received, where the second command is sent after the second smart device receives the first command.
In step 103, when the second command carries a second MAC address, a short-range wireless communication connection is established with the second smart device based on the second MAC address, where the second MAC address is a short-range wireless communication protocol MAC address of the second smart device.
In the embodiment of the present disclosure, a first smart device may directly perform physical connection with a second smart device through an HDMI, and send a first command carrying a first MAC address to the second smart device through a CEC channel formed by the physical connection, and receive a second command sent by the second smart device, when the second command carries a second MAC address, the first smart device may directly establish short-distance wireless communication connection with the second smart device according to the first MAC address, that is, the first smart device and the second smart device mutually transmit MAC addresses through the CEC channel, so that the first smart device may directly establish short-distance wireless communication connection with the second smart device without performing device search, and the process of establishing short-distance wireless communication connection becomes fast and convenient.
Optionally, the first command further carries a first acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address;
establishing a short-range wireless communication connection with a second smart device based on a second MAC address, comprising:
and when the second command also carries a second acknowledgement, establishing short-distance wireless communication connection with the second intelligent device based on the second MAC address, wherein the second acknowledgement is used for indicating that the second intelligent device has received the first MAC address.
Optionally, the first command further carries a first random number, and the first random number is generated by the first smart device;
establishing a short-range wireless communication connection with a second smart device based on a second MAC address, comprising:
and when the second command also carries a second random number and the first random number and the second random number meet the preset condition, establishing short-distance wireless communication connection with the second intelligent equipment based on the second MAC address.
Optionally, before establishing the short-range wireless communication connection with the second smart device based on the second MAC address, the method further includes:
determining a third random number based on the second random number;
and sending a third command to the second intelligent device through the CEC channel, wherein the third command carries a third acknowledgement and a third random number, and the third acknowledgement is used for indicating that the first intelligent device has received the second MAC address.
Optionally, the method further comprises:
detecting the sending state of the MAC address;
executing a step of transmitting a first command to the second smart device through the CEC channel when the MAC address transmission status is not transmitted;
and when the MAC address sending status is sent and a fourth acknowledgement is received, the step of sending the first command to the second intelligent device through the CEC channel is performed, wherein the fourth acknowledgement is used for indicating that the second intelligent device does not receive the first MAC address.
All the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, and the embodiments of the present disclosure are not described in detail again.
Fig. 2 is a flowchart illustrating a method of establishing a short-range wireless communication connection, as shown in fig. 2, for use in a second smart device, according to an example embodiment, including the steps of:
in step 201, a first command sent by a first smart device through a CEC channel is received, where the CEC channel is a channel formed after a second smart device and the first smart device are connected through HDMI, and the first command is a command sent when the first smart device establishes a short-range wireless communication connection with the second smart device.
In step 202, a second command is sent to the first smart device through the CEC channel, where the second command carries a second MAC address of the second smart device, and the second MAC address is a short-range wireless communication protocol MAC address of the second smart device.
In step 203, when the first command carries a first MAC address, a short-range wireless communication connection is established with the first intelligent device based on the first MAC address, where the first MAC address is a short-range wireless communication protocol MAC address of the first intelligent device.
In the disclosed embodiment, the second smart device may be physically connected to the first smart device directly via HDMI, and receives a first command of the first smart device and transmits a second command carrying a second MAC address through the CEC channel formed by the physical connection, when the first command carries the first MAC address, the second intelligent device can establish the short-range wireless communication connection with the first intelligent device directly according to the first MAC address, that is, the second intelligent device and the first intelligent device mutually transmit the short-range wireless communication protocol MAC address through the CEC channel, in this way, the second intelligent device does not need to establish the short-distance wireless communication connection with the first intelligent device by responding to the broadcast message of the first intelligent device, that is, the first intelligent device does not need to perform device search any more, so that the process of establishing the short-distance wireless communication connection becomes quick and convenient.
Optionally, when the first command further carries a first acknowledgement, and the first command carries a first MAC address, the second command further carries a second acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address, and the second acknowledgement is used to indicate that the second smart device has received the first MAC address.
Optionally, after receiving the first command sent by the first smart device through the CEC channel of the consumer electronics control, the method further includes:
when the first command also carries a first random number, determining a second random number based on the first random number, wherein the first random number is generated by the first intelligent equipment;
accordingly, the second command also carries a second random number.
Optionally, establishing a short-range wireless communication connection with the first smart device based on the first MAC address includes:
when a third command sent by the first intelligent device through the CEC channel is received, and the third command carries a third identifier and a third random number, judging whether a preset condition is met between the second random number and the third random number;
the third acknowledgement is used for indicating that the first intelligent device has received the second MAC address, and the third random number is determined by the first intelligent device based on the second random number;
and when the second random number and the third random number meet preset conditions, establishing short-distance wireless communication connection with the first intelligent equipment based on the first MAC address.
Optionally, the method further comprises:
when the first command does not carry the first MAC address, a fourth acknowledgement is sent to the first smart device through the CEC channel, and the first command sent by the first smart device through the CEC channel is received again, where the fourth acknowledgement is used to indicate that the second smart device does not receive the first MAC address.
All the above optional technical solutions can be combined arbitrarily to form optional embodiments of the present disclosure, and the embodiments of the present disclosure are not described in detail again.
Fig. 3 is a flowchart illustrating a method of establishing a short-range wireless communication connection according to an example embodiment, as shown in fig. 3, the method including the steps of:
in step 301, a first smart device sends a first command to a second smart device via a CEC channel.
As described in the aforementioned application scenarios, currently, there is HDMI on some smart display devices, which supports the transmission of uncompressed all-digital high-definition video, multi-channel audio, smart formats, and control commands over a single cable. The HDMI lines connecting the two smart devices include four differential cables, and cables such as DDC (Display Data Channel) and CEC (Consumer Electronics Control). The CEC channel will be formed when the first smart device and the second smart device are connected through the HDMI line.
In the disclosed embodiments, the first smart device may act as an initiating device that wants to establish a short-range wireless communication connection. When the first smart device is the initiating device, the first smart device may send the first command to the second smart device through the CEC channel after the system initialization is completed and the insertion prompt message is received. The insertion prompting message is used for indicating that the first intelligent device is connected with the second intelligent device through the HDMI line. The first command carries a first MAC address, the first MAC address is a short-distance wireless communication protocol MAC address of the first intelligent device, and the CEC channel is a channel formed after the first intelligent device and the second intelligent device are connected through HDMI.
It should be noted that, when the first intelligent device is used as an initiating device to send the first command, because the first intelligent device does not currently acquire the short-range wireless communication protocol MAC address of the second intelligent device, that is, the second MAC address, the first intelligent device may also carry a first acknowledgement in the first command in addition to the first MAC address carried in the first command, where the first acknowledgement is used to indicate that the first intelligent device has not currently received the second MAC address sent by the second intelligent device.
In addition, in order to ensure the real-time property of the first command sent by the first smart device, that is, in order to enable the second smart device to distinguish that the first command is the command sent by the first smart device for the second time, the first smart device may further carry a first random number in the sent first command, where the first random number is generated by the first smart device. For example, the first random number may be an integer randomly selected by the first smart device from 1-100.
It should be further noted that the first command may carry the first MAC address, the first MAC address and the first acknowledgement, or the first command may carry the first MAC address and the first random number, and of course, the first command may also simultaneously carry the first MAC address, the first acknowledgement, and the first random number.
Optionally, the first smart device may further store a MAC address sending status, where the MAC address sending status may be used to record whether the first smart device has sent the first MAC address to the second smart device. For example, if the first smart device never sends the first MAC address to the second smart device, then the MAC address send status will be unsent. When the first smart device is the initiator device, the MAC address transmission status may be updated to the transmitted MAC address after the first command is transmitted to the second smart device for the first time. Of course, the MAC address transmission state may include not only the non-transmission state and the transmission state, but also the transmission state and the ready-to-transmit state.
In step 302, the second smart device receives the first command through the CEC channel and sends the second command to the first smart device.
After the first smart device transmits the first command through the CEC channel, the second smart device may receive the first command through the CEC channel. Since the information carried in the first command may be lost during the transmission process, when the second smart device receives the first command, it may be determined whether the first command includes the first MAC address. Meanwhile, the second intelligent device can also send a second command to the first intelligent device so as to send the own short-range wireless communication protocol MAC address to the first intelligent device.
It should be noted that the second command carries the second MAC address, and in order to make the first intelligent device know that the second intelligent device has received the first MAC address, when the second intelligent device determines that the first command carries the first MAC address, the second intelligent device may also carry a second acknowledgement symbol in the second command, so as to notify the first intelligent device that the first MAC address has been received. Wherein the second acknowledgement is used to indicate that the second smart device has received the first MAC address.
Of course, if the second smart device determines that the first command does not carry the first MAC address, the second command sent to the first MAC address may carry a fourth acknowledgement symbol, so that the first smart device can know that the second smart device does not receive the first MAC address, and then send the first MAC address to the second smart device again, thereby improving the success rate of connection. Wherein the fourth acknowledgement is used to indicate that the second smart device did not receive the first MAC address.
Optionally, the second intelligent device may further determine whether the received first command carries a first random number, and when the received first command also carries the first random number, the second intelligent device may further generate a second random number according to the first random number, and carry the second random number in the second command. The second smart device may add 1 to the first random number to generate a second random number, or may process the first random number according to other preset rules to generate the second random number.
Optionally, the second smart device may also store a MAC address sending status, which is used to indicate whether the second smart device has sent the second MAC address to the first smart device. After the second intelligent device sends the second command carrying the second MAC address to the first intelligent device for the first time, the second intelligent device may update the MAC address status to sent.
After the second smart device sends the second command, if the first command carries the first MAC address, the second smart device may establish a short-range wireless communication connection with the first smart device through step 304.
In step 303, the first smart device receives a second command through the CEC channel.
After the second smart device transmits the second command to the first smart device through the CEC channel, the first smart device may receive the second command through the CEC channel. Then, the first intelligent device may determine whether the second command carries a second MAC address, and if the second command carries the second MAC address, the first intelligent device may establish a short-range wireless communication connection with the second intelligent device through step 304.
Optionally, when the first command sent by the first intelligent device further carries a first acknowledgement character, the first intelligent device may further determine whether the second command further carries a second acknowledgement character, and if the second command carries the second acknowledgement character, it indicates that the second intelligent device has received the first MAC address sent by the first intelligent device, at this time, the first intelligent device establishes a short-distance wireless communication connection with the second intelligent device through step 304, and the success rate of the connection is increased.
Of course, if the first intelligent device determines that the second command does not carry the second acknowledgement symbol but carries the fourth acknowledgement symbol, it indicates that the second intelligent device does not receive the first MAC address sent by the first intelligent device, and at this time, the first intelligent device needs to send the first MAC address to the second intelligent device again, that is, the first intelligent device may return to step 301 to continue sending the first command to the second intelligent device through the CEC channel.
Optionally, if the first command sent by the first smart device further carries a first random number, then, when the first smart device receives the second command, it may further determine whether the second command further carries a second random number, and if the second command carries the second random number and a preset condition is met between the second random number and the first random number, the first smart device may execute step 304.
Optionally, if the first command sent by the first intelligent device simultaneously carries the first random number and the first acknowledgement, then when receiving the second command, the first intelligent device may further determine whether the second command further carries the second random number and the second acknowledgement, and if the second command carries the second acknowledgement and the second random number and the preset condition is satisfied between the second random number and the first random number, then the first intelligent device may establish the short-range wireless communication connection with the second intelligent device through step 304.
It should be further noted that, after the first intelligent device determines that the received second command carries the second MAC address, if the second command also carries the second random number and the second acknowledgement, the first intelligent device may further send a third command to the second intelligent device to notify that the second intelligent device has received the second MAC address. The third command may carry a third random number and a third acknowledgement, where the third random number is obtained by the first intelligent device processing the second random number according to a preset rule, and the preset rule adopted when the first intelligent device obtains the third random number may be the same as the preset rule adopted when the second intelligent device obtains the second random number. For example, the first smart device may add 1 to the second random number to generate a third random number. Additionally, the third acknowledgement is used to indicate that the first smart device has received the second MAC address.
In step 304: and when the second command carries the second MAC address, the first intelligent device establishes short-distance wireless communication connection with the second intelligent device based on the second MAC address.
When the first intelligent device determines that the second command carries the second MAC address, since the first intelligent device has sent the first MAC address to the second intelligent device, the first intelligent device can directly establish short-range wireless communication connection with the second intelligent device according to the second MAC address at this time.
Optionally, in order to improve a success rate of connection between the first intelligent device and the second intelligent device, the first intelligent device may establish a short-range wireless communication connection with the second intelligent device based on the second MAC address when it is determined that the second command further carries the second acknowledgement. Or, the first intelligent device may establish the short-range wireless communication connection with the second intelligent device based on the second MAC address when it is determined that the second command further carries the second random number and the preset condition is satisfied between the second random number and the first random number. Or, the first intelligent device may further establish short-range wireless communication connection with the second intelligent device based on the second MAC address when it is determined that the second command further carries a second acknowledgement symbol and a second random number, and the preset condition is satisfied between the second random number and the first random number.
It should be noted that, when the first intelligent device establishes the short-range wireless communication connection with the second intelligent device based on the second MAC address, the second intelligent device may send a connection request to the second intelligent device, and when the second intelligent device receives the connection request, if the first command received by the second intelligent device carries the first MAC address, the second intelligent device may directly establish the short-range wireless communication connection with the first intelligent device according to the first MAC address.
Of course, if the first command does not carry the first MAC address, then the second smart device may not establish short-distance wireless communication connection with the first smart device because the second smart device has not acquired the first MAC address of the first smart device, and at this time, the second smart device may return to step 302 to continue to receive the first command sent by the first smart device through the CEC channel.
Optionally, based on the descriptions in step 301 and step 302, when the second command further carries the second acknowledgement and the second random number, the second smart device may further receive, through the CEC channel, the third command sent by the first smart device after sending the second command to the first smart device. If the second intelligent device receives the third command, the second intelligent device may determine whether the third command carries a third acknowledgement symbol and a third random number, and if the third command carries the third acknowledgement symbol and the third random number and a preset condition is satisfied between the third random number and the second random number, the second intelligent device may establish a short-distance wireless communication connection with the first intelligent device according to the first MAC address.
The third acknowledgement is used to indicate that the first smart device has received the second MAC address, the third random number is generated by the first smart device according to the second random number, and a preset rule for the first smart device to generate the third random number based on the second random number and a preset rule for the second smart device to generate the second random number based on the first random number may be the same. Since the third random number is generated by the second smart device according to the second random number by the preset rule, the second smart device may determine whether the second random number satisfies the preset condition before the third random number is set by the second smart device after receiving the third command, so as to distinguish the authenticity of the third random number. In addition, if the third command carries the third acknowledgement character, the second intelligent device can determine that the first intelligent device has received the second MAC address, and at this time, the second intelligent device establishes short-distance wireless communication connection with the first intelligent device according to the first MAC address, thereby improving the connection success rate.
Optionally, if the third command received by the second intelligent device does not carry the third acknowledgement character, but carries the third random number and the first acknowledgement character, and the preset condition is satisfied between the third random number and the second random number, at this time, the second intelligent device may determine, according to the first acknowledgement character, that the first intelligent device does not receive the second MAC address, and therefore, the second intelligent device may return to the step of sending the second command to the first intelligent device, and continue to send its own MAC address to the first intelligent device until the third acknowledgement character sent by the first intelligent device is received.
In the embodiment of the present disclosure, the first smart device and the second smart device may be directly physically connected through HDMI, and transmit the short-range wireless communication protocol MAC address to each other through a CEC channel formed by the physical connection, so that the first smart device and the second smart device may directly acquire the short-range wireless communication protocol MAC address of the other party, and establish the short-range wireless communication connection according to the acquired short-range wireless communication protocol MAC address, and do not need to perform device search, so that the process of establishing the short-range wireless communication connection becomes fast and convenient. In addition, the first intelligent device and the second intelligent device can carry corresponding confirmers and random numbers in commands sent to the opposite side so as to inform the opposite side whether the MAC address of the opposite side is received or not, and when the MAC address is not received, the opposite side can send the MAC address to the opposite side again, so that the two sides can be ensured to acquire the MAC address of the opposite side, and the connection success rate is improved.
It should be noted that, in the foregoing embodiment, a method for establishing a short-range wireless communication connection between a first smart device and a second smart device when the first smart device is used as an initiating device is mainly described. In practical application, the second intelligent device may also serve as the initiating device, and when the second intelligent device serves as the initiating device, the second intelligent device is also equivalent to the first intelligent device in the above embodiment, and a specific implementation process may refer to the above embodiment, and an independent description is not provided in the embodiments of the present disclosure.
In addition, based on the above description, it is known that, because both the first smart device and the second smart device may serve as initiating devices, in practical applications, when the system initialization of the first smart device and the second smart device is completed and the insertion prompt information is received, the first smart device and the second smart device may send commands to each other at the same time, that is, the first smart device and the second smart device may send commands to each other at the same time as the initiating devices, at this time, the commands sent by the first smart device and the second smart device, except for carrying their own MAC addresses, will both carry a confirmation symbol indicating that the MAC addresses of the other devices are not received, and after the first smart device receives the second command sent by the second smart device, if the second command carries the second MAC address, the first MAC address may be sent to the second smart device again, and transmits a third acknowledgement, after which the first smart device may establish a short-range wireless communication connection with the second smart device based on the received second MAC address. Correspondingly, after receiving the first command, if the first command carries the first MAC address, the second smart device may send the second MAC address to the first smart device again, and send the second acknowledgement. Of course, if the second smart device receives the first MAC address and the third acknowledgement sent again by the first smart device before sending again the second MAC address and the second acknowledgement, the second smart device may directly send the second acknowledgement to the first smart device, and thereafter, the second smart device may establish a short-range wireless communication connection with the first smart device based on the first MAC address.
After the specific implementation process of the method for establishing a short-range wireless communication connection is described in the above embodiments, the intelligent device for establishing a short-range wireless communication connection will be described in the following two embodiments.
Fig. 4A is a block diagram illustrating an apparatus 400 for establishing a short-range wireless communication connection according to an exemplary embodiment, where the apparatus 400 is included in a first smart device, and referring to fig. 4A, the apparatus 400 includes a first transmitting module 401, a first receiving module 402, and a first connecting module 403.
A first sending module 401, configured to send a first command to a second intelligent device through a consumer electronics control CEC channel, where the first command carries a first media access control MAC address, the first MAC address is an MAC address of a short-range wireless communication protocol of the first intelligent device, and the CEC channel is a channel formed after the first intelligent device and the second intelligent device are connected through a high-definition multimedia interface HDMI;
a first receiving module 402, configured to receive a second command sent by a second intelligent device through a CEC channel, where the second command is sent by the second intelligent device after receiving the first command;
the first connection module 403 is configured to, when the second command carries a second MAC address, establish short-range wireless communication connection with the second intelligent device based on the second MAC address, where the second MAC address is a MAC address of a short-range wireless communication protocol of the second intelligent device.
Optionally, the first command further carries a first acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address;
the first connection module 403 is configured to:
and when the second command also carries a second acknowledgement, establishing short-distance wireless communication connection with the second intelligent device based on the second MAC address, wherein the second acknowledgement is used for indicating that the second intelligent device has received the first MAC address.
Optionally, the first command further carries a first random number, and the first random number is generated by the first smart device;
the first connection module 403 is further configured to:
and when the second command also carries a second random number and the first random number and the second random number meet the preset condition, establishing short-distance wireless communication connection with the second intelligent equipment based on the second MAC address.
Optionally, referring to fig. 4B, the apparatus 400 further comprises:
a first determining module 404 for determining a third random number based on the second random number;
a second sending module 405, configured to send a third command to the second intelligent device through the CEC channel, where the third command carries a third acknowledgement and a third random number, and the third acknowledgement is used to indicate that the first intelligent device has received the second MAC address.
Optionally, referring to fig. 4C, the apparatus 400 further comprises:
a detection module 406, configured to detect a MAC address sending status;
a triggering module 407, configured to trigger the first sending module to send a first command to the second intelligent device through the CEC channel when the MAC address sending status is not sent;
the triggering module 407 is further configured to trigger the first sending module to send the first command to the second smart device through the CEC channel when the MAC address sending status is sent and a fourth acknowledgement is received, where the fourth acknowledgement is used to indicate that the second smart device does not receive the first MAC address.
In the embodiment of the present disclosure, a first smart device may directly perform physical connection with a second smart device through an HDMI, and send a first command carrying a first MAC address to the second smart device through a CEC channel formed by the physical connection, and receive a second command sent by the second smart device, when the second command carries a second MAC address, the first smart device may directly establish short-distance wireless communication connection with the second smart device according to the first MAC address, that is, the first smart device and the second smart device mutually transmit MAC addresses through the CEC channel, so that the first smart device may directly establish short-distance wireless communication connection with the second smart device without performing device search, and the process of establishing short-distance wireless communication connection becomes fast and convenient.
Fig. 5A is a block diagram illustrating an apparatus 500 for establishing a short-range wireless communication connection according to an exemplary embodiment, where the apparatus 500 is included in a second smart device, and referring to fig. 5A, the apparatus 500 includes a second receiving module 501, a third transmitting module 502, and a second connecting module 503.
A second receiving module 501, configured to receive a first command sent by a first intelligent device through a consumer electronics control CEC channel, where the CEC channel is a channel formed after the second intelligent device and the first intelligent device are connected through a high-definition multimedia interface HDMI, and the first command is a command sent when the first intelligent device and the second intelligent device establish short-distance wireless communication connection;
a third sending module 502, configured to send a second command to the first intelligent device through the CEC channel, where the second command carries a second MAC address of the second intelligent device, and the second MAC address is a MAC address of a short-distance wireless communication protocol of the second intelligent device;
the second connection module 503 is configured to, when the first command carries a first MAC address, establish short-range wireless communication connection with the first intelligent device based on the first MAC address, where the first MAC address is a MAC address of a short-range wireless communication protocol of the first intelligent device.
Optionally, when the first command further carries a first acknowledgement, and the first command carries a first MAC address, the second command further carries a second acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address, and the second acknowledgement is used to indicate that the second smart device has received the first MAC address.
Optionally, referring to fig. 5B, the apparatus 500 further comprises:
a second determining module 504, configured to determine, when the first command further carries a first random number, a second random number based on the first random number, where the first random number is generated by the first smart device;
accordingly, the second command also carries a second random number.
Alternatively, referring to fig. 5C, the second connection module 503 includes:
the determining sub-module 5031, configured to determine whether the second random number and the third random number meet a preset condition when a third command sent by the first intelligent device through the CEC channel is received, where the third command carries a third identifier and the third random number;
the third acknowledgement is used for indicating that the first intelligent device has received the second MAC address, and the third random number is determined by the first intelligent device based on the second random number;
the connection sub-module 5032 is configured to establish a short-range wireless communication connection with the first smart device based on the first MAC address when a preset condition is satisfied between the second random number and the third random number.
Optionally, referring to fig. 5D, the apparatus 500 further comprises:
a fourth sending module 505, configured to send a fourth acknowledgement to the first intelligent device through the CEC channel when the first command does not carry the first MAC address;
the second receiving module 501 is further configured to re-receive the first command sent by the first smart device through the CEC channel, and the fourth acknowledgement is used to indicate that the second smart device does not receive the first MAC address.
In the disclosed embodiment, the second smart device may be physically connected to the first smart device directly via HDMI, and receives a first command of the first smart device and transmits a second command carrying a second MAC address through the CEC channel formed by the physical connection, when the first command carries the first MAC address, the second intelligent device can establish the short-range wireless communication connection with the first intelligent device directly according to the first MAC address, that is, the second intelligent device and the first intelligent device mutually transmit the short-range wireless communication protocol MAC address through the CEC channel, in this way, the second intelligent device does not need to establish the short-distance wireless communication connection with the first intelligent device by responding to the broadcast message of the first intelligent device, that is, the first intelligent device does not need to perform device search any more, so that the process of establishing the short-distance wireless communication connection becomes quick and convenient.
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.
Fig. 6 is a block diagram illustrating an apparatus 600 for establishing a short-range wireless communication connection according to an example embodiment. The device can be an intelligent television, a television box, a high-definition player, a monitoring display device, a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant and the like.
Referring to fig. 6, the apparatus 600 may include one or more of the following components: processing component 602, memory 604, power component 606, multimedia component 608, audio component 610, input/output (I/O) interface 612, sensor component 614, and communication component 616.
The processing component 602 generally controls the overall operation of the device 600, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 602 can include one or more modules that facilitate interaction between the processing component 602 and other components. For example, the processing component 602 can include a multimedia module to facilitate interaction between the multimedia component 608 and the processing component 602.
The memory 604 is configured to store various types of data to support the operation of the apparatus 600. Examples of such data include instructions for any application or method operating on the device 600, contact data, phonebook data, messages, pictures, videos, and the like. The memory 604 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.
A power supply component 606 provides power to the various components of the device 600. The power components 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 600.
The multimedia component 608 includes a screen that provides an output interface between the device 600 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 608 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 600 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 610 is configured to output and/or input audio signals. For example, audio component 610 includes a Microphone (MIC) configured to receive external audio signals when apparatus 600 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 604 or transmitted via the communication component 616. In some embodiments, audio component 610 further includes a speaker for outputting audio signals.
The I/O interface 612 provides an interface between the processing component 602 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 614 includes one or more sensors for providing status assessment of various aspects of the apparatus 600. For example, the sensor assembly 614 may detect the open/closed status of the device 600, the relative positioning of the components, such as the display and keypad of the device 600, the sensor assembly 614 may also detect a change in the position of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration/deceleration of the device 600, and a change in the temperature of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 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 614 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 616 is configured to facilitate communications between the apparatus 600 and other devices in a wired or wireless manner. The apparatus 600 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 616 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 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 600 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 methods provided by the embodiments illustrated in fig. 1-3 and described above.
In an exemplary embodiment, a non-transitory computer readable storage medium comprising instructions, such as the memory 604 comprising instructions, executable by the processor 620 of the apparatus 600 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 whose instructions, when executed by a processor of a first smart device, enable the first smart device to perform a method of establishing a short-range wireless communication connection, the method comprising:
the method comprises the steps of sending a first command to a second intelligent device through a CEC channel, wherein the first command carries a first MAC address, the first MAC address is a short-distance wireless communication protocol MAC address of the first intelligent device, and the CEC channel is formed after the first intelligent device and the second intelligent device are connected through HDMI.
And receiving a second command sent by the second intelligent device through the CEC channel, wherein the second command is sent after the second intelligent device receives the first command.
And when the second command carries a second MAC address, establishing short-distance wireless communication connection with the second intelligent equipment based on the second MAC address, wherein the second MAC address is a short-distance wireless communication protocol MAC address of the second intelligent equipment.
Optionally, the first command further carries a first acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address;
establishing a short-range wireless communication connection with a second smart device based on a second MAC address, comprising:
and when the second command also carries a second acknowledgement, establishing short-distance wireless communication connection with the second intelligent device based on the second MAC address, wherein the second acknowledgement is used for indicating that the second intelligent device has received the first MAC address.
Optionally, the first command further carries a first random number, and the first random number is generated by the first smart device;
establishing a short-range wireless communication connection with a second smart device based on a second MAC address, comprising:
and when the second command also carries a second random number and the first random number and the second random number meet the preset condition, establishing short-distance wireless communication connection with the second intelligent equipment based on the second MAC address.
Optionally, before establishing the short-range wireless communication connection with the second smart device based on the second MAC address, the method further includes:
determining a third random number based on the second random number;
and sending a third command to the second intelligent device through the CEC channel, wherein the third command carries a third acknowledgement and a third random number, and the third acknowledgement is used for indicating that the first intelligent device has received the second MAC address.
Optionally, the method further comprises:
detecting the sending state of the MAC address;
executing a step of transmitting a first command to the second smart device through the CEC channel when the MAC address transmission status is not transmitted;
and when the MAC address sending status is sent and a fourth acknowledgement is received, the step of sending the first command to the second intelligent device through the CEC channel is performed, wherein the fourth acknowledgement is used for indicating that the second intelligent device does not receive the first MAC address.
A non-transitory computer readable storage medium whose instructions, when executed by a processor of a second smart device, enable the second smart device to perform a method of establishing a short-range wireless communication connection, the method comprising:
the method comprises the steps of receiving a first command sent by a first intelligent device through a CEC channel, wherein the CEC channel is formed after a second intelligent device and the first intelligent device are connected through an HDMI, and the first command is sent when the first intelligent device and the second intelligent device establish short-distance wireless communication connection.
And sending a second command to the first intelligent device through the CEC channel, wherein the second command carries a second MAC address of the second intelligent device, and the second MAC address is a short-distance wireless communication protocol MAC address of the second intelligent device.
And when the first command carries a first MAC address, establishing short-range wireless communication connection with the first intelligent equipment based on the first MAC address, wherein the first MAC address is a short-range wireless communication protocol MAC address of the first intelligent equipment.
Optionally, when the first command further carries a first acknowledgement, and the first command carries a first MAC address, the second command further carries a second acknowledgement, where the first acknowledgement is used to indicate that the first smart device does not receive the second MAC address, and the second acknowledgement is used to indicate that the second smart device has received the first MAC address.
Optionally, after receiving the first command sent by the first smart device through the CEC channel of the consumer electronics control, the method further includes:
when the first command also carries a first random number, determining a second random number based on the first random number, wherein the first random number is generated by the first intelligent equipment;
accordingly, the second command also carries a second random number.
Optionally, establishing a short-range wireless communication connection with the first smart device based on the first MAC address includes:
when a third command sent by the first intelligent device through the CEC channel is received, and the third command carries a third identifier and a third random number, judging whether a preset condition is met between the second random number and the third random number;
the third acknowledgement is used for indicating that the first intelligent device has received the second MAC address, and the third random number is determined by the first intelligent device based on the second random number;
and when the second random number and the third random number meet preset conditions, establishing short-distance wireless communication connection with the first intelligent equipment based on the first MAC address.
Optionally, the method further comprises:
when the first command does not carry the first MAC address, a fourth acknowledgement is sent to the first smart device through the CEC channel, and the first command sent by the first smart device through the CEC channel is received again, where the fourth acknowledgement is used to indicate that the second smart device does not receive the first MAC address.
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 (16)

1. A method for establishing a short-range wireless communication connection, applied to a first smart device, the method comprising:
detecting a Media Access Control (MAC) address sending state stored in the first intelligent device, wherein the MAC address sending state is used for recording whether the first intelligent device sends a first MAC address to a second intelligent device, and the first MAC address is a short-range wireless communication protocol (MAC) address of the first intelligent device;
when the MAC address sending state is not sending, or when the MAC address sending state is sending, and a fourth acknowledgement is received, sending a first command to the second intelligent device through a consumer electronics control CEC channel, where the fourth acknowledgement is used to indicate that the second intelligent device does not receive the first MAC address, the first command carries the first MAC address and the first acknowledgement, the CEC channel is a channel formed after the first intelligent device and the second intelligent device are connected through a high definition multimedia interface HDMI, the first acknowledgement is used to indicate that the first intelligent device does not receive a second MAC address, and the second MAC address is the short-range wireless communication protocol MAC address of the second intelligent device;
receiving a second command sent by the second intelligent device through the CEC channel, wherein the second command is sent by the second intelligent device after receiving the first command;
and when the second command carries the second MAC address and a second acknowledgement, establishing short-range wireless communication connection with the second intelligent device based on the second MAC address, where the second acknowledgement is used to indicate that the second intelligent device has received the first MAC address.
2. The method of claim 1, wherein the first command further carries a first random number, the first random number generated by the first smart device;
the establishing the short-range wireless communication connection with the second smart device based on the second MAC address comprises:
and when the second command also carries a second random number and the first random number and the second random number meet preset conditions, establishing the short-distance wireless communication connection with the second intelligent device based on the second MAC address.
3. The method of claim 2, wherein prior to establishing the short-range wireless communication connection with the second smart device based on the second MAC address, further comprising:
determining a third random number based on the second random number;
sending a third command to the second intelligent device through the CEC channel, where the third command carries a third acknowledgement and the third random number, and the third acknowledgement is used to indicate that the first intelligent device has received the second MAC address.
4. A method for establishing a short-range wireless communication connection, applied to a second smart device, the method comprising:
receiving a first command sent by a first intelligent device through a Consumer Electronics Control (CEC) channel, wherein the CEC channel is formed after the second intelligent device and the first intelligent device are connected through a High Definition Multimedia Interface (HDMI), and the first command is a command sent when the first intelligent device and the second intelligent device establish short-distance wireless communication connection;
sending a second command to the first intelligent device through the CEC channel, where the second command carries a second MAC address and a second acknowledgement, the second MAC address is a short-range wireless communication protocol MAC address of the second intelligent device, the second acknowledgement is used to indicate that the second intelligent device has received a first MAC address, and the first MAC address is the short-range wireless communication protocol MAC address of the first intelligent device;
when the first command carries the first MAC address and a first acknowledgement, establishing short-range wireless communication connection with the first intelligent device based on the first MAC address, wherein the first acknowledgement is used for indicating that the first intelligent device does not receive the second MAC address;
when the first command does not carry the first MAC address, sending a fourth acknowledgement to the first intelligent device through the CEC channel, and re-receiving the first command sent by the first intelligent device through the CEC channel, where the fourth acknowledgement is used to indicate that the second intelligent device does not receive the first MAC address.
5. The method of claim 4, wherein after receiving the first command sent by the first smart device via the CEC channel, the method further comprises:
when the first command also carries a first random number, determining a second random number based on the first random number, wherein the first random number is generated by the first intelligent device;
correspondingly, the second command also carries the second random number.
6. The method of claim 5, wherein establishing a short-range wireless communication connection with the first smart device based on the first MAC address comprises:
when a third command sent by the first intelligent device through the CEC channel is received and the third command carries a third identifier and a third random number, judging whether a preset condition is met between the second random number and the third random number;
wherein the third acknowledgement is used to indicate that the second MAC address has been received by the first smart device, and the third random number is determined by the first smart device based on the second random number;
and when the preset condition is met between the second random number and the third random number, establishing the short-distance wireless communication connection with the first intelligent equipment based on the first MAC address.
7. An apparatus for establishing a short-range wireless communication connection, the apparatus being embodied in a first smart device, the apparatus comprising:
a first sending module, configured to send a first command to a second smart device through a Consumer Electronics Control (CEC) channel, where the first command carries a first Media Access Control (MAC) address and a first acknowledgement, the first MAC address is an MAC address of a short-range wireless communication protocol of the first smart device, the CEC channel is a channel formed after the first smart device and the second smart device are connected through a high-definition multimedia interface (HDMI), the first acknowledgement is used to indicate that the first smart device does not receive a second MAC address, and the second MAC address is the MAC address of the short-range wireless communication protocol of the second smart device;
a first receiving module, configured to receive a second command sent by the second intelligent device through the CEC channel, where the second command is sent by the second intelligent device after receiving the first command;
a first connection module, configured to establish a short-range wireless communication connection with the second smart device based on the second MAC address when the second MAC address and a second acknowledgement are carried in the second command, where the second acknowledgement is used to indicate that the second smart device has received the first MAC address;
the first connection module is further configured to:
when a second acknowledgement is also carried in the second command, establishing the short-range wireless communication connection with the second intelligent device based on the second MAC address, where the second acknowledgement is used to indicate that the second intelligent device has received the first MAC address;
the device further comprises:
a detection module, configured to detect a MAC address sending status stored in the first intelligent device, where the MAC address sending status is used to record whether the first intelligent device has sent the first MAC address to the second intelligent device;
the triggering module is used for triggering the first sending module to send the first command to the second intelligent device through the CEC channel when the MAC address sending state is not sent;
the triggering module is further configured to trigger the first sending module to send the first command to the second intelligent device through the CEC channel when the MAC address sending status is sent and a fourth acknowledgement is received, where the fourth acknowledgement is used to indicate that the second intelligent device does not receive the first MAC address.
8. The apparatus of claim 7, wherein the first command further carries a first random number, the first random number generated by the first smart device;
the first connection module is further configured to:
and when the second command also carries a second random number and the first random number and the second random number meet preset conditions, establishing the short-distance wireless communication connection with the second intelligent device based on the second MAC address.
9. The apparatus of claim 8, further comprising:
a first determining module for determining a third random number based on the second random number;
a second sending module, configured to send a third command to the second intelligent device through the CEC channel, where the third command carries a third acknowledgement and the third random number, and the third acknowledgement is used to indicate that the first intelligent device has received the second MAC address.
10. An apparatus for establishing a short-range wireless communication connection, the apparatus being included in a second smart device, the apparatus comprising:
the second receiving module is used for receiving a first command sent by a first intelligent device through a Consumer Electronics Control (CEC) channel, wherein the CEC channel is formed after the second intelligent device and the first intelligent device are connected through a high-definition multimedia interface (HDMI), and the first command is a command sent when the first intelligent device and the second intelligent device establish short-distance wireless communication connection;
a third sending module, configured to send a second command to the first intelligent device through the CEC channel, where the second command carries a second MAC address and a second acknowledgement, the second MAC address is a short-range wireless communication protocol MAC address of the second intelligent device, and the second acknowledgement is used to indicate that the second intelligent device has received a first MAC address, where the first MAC address is the short-range wireless communication protocol MAC address of the first intelligent device;
a second connection module, configured to establish a short-range wireless communication connection with the first intelligent device based on the first MAC address when the first command carries the first MAC address and a first acknowledgement, where the first acknowledgement is used to indicate that the first intelligent device does not receive the second MAC address;
the device further comprises:
a fourth sending module, configured to send a fourth acknowledgement to the first intelligent device through the CEC channel when the first command does not carry the first MAC address;
the second receiving module is further configured to re-receive the first command sent by the first smart device through the CEC channel, and the fourth acknowledgement is used to indicate that the second smart device does not receive the first MAC address.
11. The apparatus of claim 10, further comprising:
a second determining module, configured to determine, when the first command further carries a first random number, a second random number based on the first random number, where the first random number is generated by the first smart device;
correspondingly, the second command also carries the second random number.
12. The apparatus of claim 11, wherein the second connection module comprises:
the judging submodule is used for judging whether a preset condition is met between the second random number and the third random number when a third command sent by the first intelligent device through the CEC channel is received and the third command carries a third identifier and the third random number;
wherein the third acknowledgement is used to indicate that the second MAC address has been received by the first smart device, and the third random number is determined by the first smart device based on the second random number;
and the connection sub-module is used for establishing the short-distance wireless communication connection with the first intelligent device based on the first MAC address when the preset condition is met between the second random number and the third random number.
13. An apparatus for establishing a short-range wireless communication connection, the apparatus being embodied in a first smart device, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to the steps of any of the methods of claims 1-3.
14. An apparatus for establishing a short-range wireless communication connection, the apparatus being included in a second smart device, the apparatus comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to the steps of any of the methods of claims 4-6.
15. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement the steps of any of the methods of claims 1-3.
16. A computer-readable storage medium having instructions stored thereon, wherein the instructions, when executed by a processor, implement the steps of any of the methods of claims 4-6.
CN201710515928.7A 2017-06-29 2017-06-29 Method, apparatus and storage medium for establishing short-range wireless communication connection Active CN107277751B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710515928.7A CN107277751B (en) 2017-06-29 2017-06-29 Method, apparatus and storage medium for establishing short-range wireless communication connection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710515928.7A CN107277751B (en) 2017-06-29 2017-06-29 Method, apparatus and storage medium for establishing short-range wireless communication connection

Publications (2)

Publication Number Publication Date
CN107277751A CN107277751A (en) 2017-10-20
CN107277751B true CN107277751B (en) 2020-09-01

Family

ID=60070582

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710515928.7A Active CN107277751B (en) 2017-06-29 2017-06-29 Method, apparatus and storage medium for establishing short-range wireless communication connection

Country Status (1)

Country Link
CN (1) CN107277751B (en)

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2009016936A1 (en) * 2007-08-01 2009-02-05 Sharp Kabushiki Kaisha Network av device and av network system
US8045552B2 (en) * 2008-01-03 2011-10-25 Sony Corporation Wired exchange of control information in wireless system
WO2009096191A1 (en) * 2008-01-30 2009-08-06 Panasonic Corporation Radio control system
CN101640581B (en) * 2008-07-31 2012-11-21 鸿富锦精密工业(深圳)有限公司 Wireless device, matching method thereof and method for removing matching
CN105979311A (en) * 2016-06-16 2016-09-28 乐视控股(北京)有限公司 Method and device for adjusting brightness of television, and terminal

Also Published As

Publication number Publication date
CN107277751A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
CN105516183B (en) Equipment connection method and device
US9264528B2 (en) Mobile terminal, image display device mounted on vehicle and data processing method using the same
EP3038397A1 (en) Method and device for connection
US11895630B2 (en) Method and device for identifying downlink transmissions
RU2637470C2 (en) Method and device for detecting intelligent device
CN109451877B (en) Unmanned aerial vehicle control method and device, unmanned aerial vehicle and remote control equipment
CN109156026B (en) Method, device, equipment and storage medium for sending uplink scheduling request
CN111654354B (en) Method and device for detecting maximum transmission unit MTU and storage medium
EP3226432A1 (en) Method and device for sharing media data between terminals
CN111654450A (en) Data transmission method and device and storage medium
JP2017513416A (en) Data transmission method, apparatus, facility, program, and recording medium
CN104796460B (en) Document transmission method and device
CN112116803B (en) Information processing method and device, electronic device and storage medium
CN104967966B (en) A kind of method and device of binding bluetooth equipment
CN111800836B (en) Communication method, device, electronic equipment and storage medium
CN110224991B (en) Video network terminal communication method and device
CN107277751B (en) Method, apparatus and storage medium for establishing short-range wireless communication connection
CN113726905B (en) Data acquisition method, device and equipment based on home terminal equipment
CN107039054B (en) The way of recording and device
CN105227891A (en) A kind of video call method and device
CN115086295A (en) File transmission method, file transmission device, server and storage medium
CN110213531B (en) Monitoring video processing method and device
CN107181669A (en) The display methods and equipment of the transmission time of chat messages
CN113660513A (en) Method, device and storage medium for synchronizing playing time
CN105407518B (en) Equipment networking method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant