CN117939577A - Wireless connection method, master device, slave device and wireless transmission system - Google Patents

Wireless connection method, master device, slave device and wireless transmission system Download PDF

Info

Publication number
CN117939577A
CN117939577A CN202410101038.1A CN202410101038A CN117939577A CN 117939577 A CN117939577 A CN 117939577A CN 202410101038 A CN202410101038 A CN 202410101038A CN 117939577 A CN117939577 A CN 117939577A
Authority
CN
China
Prior art keywords
handshake
master device
slave device
time slot
controlling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410101038.1A
Other languages
Chinese (zh)
Inventor
刘境发
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Zhongke Lanxun Technology Co ltd
Original Assignee
Shenzhen Zhongke Lanxun Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Zhongke Lanxun Technology Co ltd filed Critical Shenzhen Zhongke Lanxun Technology Co ltd
Priority to CN202410101038.1A priority Critical patent/CN117939577A/en
Publication of CN117939577A publication Critical patent/CN117939577A/en
Pending legal-status Critical Current

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the application relates to the technical field of wireless communication, and discloses a wireless connection method, master equipment, slave equipment and a wireless transmission system. The method comprises the following steps: the method comprises the steps of controlling a main device to enter a broadcasting state, controlling the main device to broadcast an identification frame in the broadcasting state, enabling a target slave device to return a connection request after scanning the identification frame, enabling the target slave device to be a slave device in at least one slave device, controlling the main device to enter a handshake state in response to the connection request, and controlling the main device and the target slave device to execute handshake connection operation in the handshake state. According to the method, the broadcasting party is the master equipment, the scanning party and the connection initiator are the slave equipment, and the master equipment can establish wireless connection with a plurality of slave equipment only by broadcasting a short identification frame with a small idle time slot, so that the reliability, the stability and the low-latency of establishing the wireless connection are improved. When the wireless connection is not established, the embodiment transmits the power-consuming broadcasting task to the master device for broadcasting the identification frame, so that the power consumption of the slave device is saved.

Description

Wireless connection method, master device, slave device and wireless transmission system
Technical Field
The embodiment of the application relates to the technical field of wireless communication, in particular to a wireless connection method, master equipment, slave equipment and a wireless transmission system.
Background
The Bluetooth low energy (Low Energy Bluetooth, BLE) has the characteristics of frequency hopping, low power consumption, multiple connections and the like. A bluetooth low energy based master device typically communicates by establishing bluetooth connections with a plurality of slaves in the form of a piconetwork. Before the Bluetooth connection is established, the slave device needs to broadcast information according to the low-power Bluetooth protocol, the master device scans the broadcast information according to a certain time slot window and then initiates a connection request to the slave device, so that in the low-power Bluetooth protocol, the broadcaster is the slave device, and both the scanner and the initiator are the master devices.
As described above, since the master device supports the one-to-many wireless connection manner and the master device is a scanner, when the master device establishes bluetooth connections with more and more slave devices, the plurality of slave devices having established bluetooth connections occupy corresponding slots on a fixed communication period, which results in smaller and smaller spare slots of the master device. When the reserved idle time slot is smaller, the master device lacks enough scanning time, so that broadcasting information of a new slave device is easily not scanned, and further, the subsequent slave devices are more and more difficult to connect with the master device.
Disclosure of Invention
An object of an embodiment of the present application is to provide a wireless connection method, a master device, a slave device, and a wireless transmission system, so as to solve a technical problem of poor reliability of connection of a plurality of slave devices in the related art.
In a first aspect, an embodiment of the present application provides a wireless connection method, applied to a master device, where the master device may be wirelessly connected to at least one slave device, the method including:
Controlling the main equipment to enter a broadcasting state;
Controlling the master device to broadcast an identification frame in the broadcast state so that a target slave device returns a connection request after scanning the identification frame, wherein the target slave device is a slave device in the at least one slave device;
responding to the connection request, and controlling the main equipment to enter a handshake state;
And controlling the master device and the target slave device to execute handshake connection operation in the handshake state.
Optionally, the master device is configured with a communication period, the communication period including at least one time slot, and the controlling the master device to enter the broadcast state includes:
Judging whether a time slot in a to-be-connected state exists in the communication period or not;
And if the communication period has a time slot in a to-be-connected state, controlling the main equipment to enter a broadcasting state.
Optionally, the master device is configured with a communication period, the communication period includes at least one time slot, and controlling the master device to broadcast an identification frame in the broadcast state, so that the target slave device returns a connection request in response to the identification frame includes:
And controlling the master device to broadcast an identification frame in a target time slot in the broadcast state so that the target slave device returns a connection request after scanning the identification frame, wherein the target time slot is a time slot in a to-be-connected state.
Optionally, the time slot includes a transmission interval and a reception interval, and the master device transmits data in the transmission interval and receives data in the reception interval.
Optionally, the controlling the master device to broadcast an identification frame in the target time slot in the broadcast state, so that the target slave device returns a connection request in response to the identification frame includes:
Controlling the master device to broadcast an identification frame in the transmission interval in the broadcast state so as to enable the target slave device to respond to the identification frame and return a connection request;
and controlling the master device to receive a connection request in the receiving section in the broadcasting state.
Optionally, the master device is configured with a communication cycle, the communication cycle including at least one time slot, and controlling the master device to perform a handshake connection operation with the target slave device in the handshake state includes:
determining a handshake time slot corresponding to the target slave device in the handshake state, wherein the handshake time slot is a time slot when the master device performs handshake with the target slave device;
And controlling the master device to execute handshake connection operation with the target slave device in the handshake time slot.
Optionally, the time difference between the handshake time slot and the broadcast time slot is equal to the communication period, and the broadcast time slot is a time slot in which the connection request is received after the master device broadcasts the identification frame.
Optionally, the time slot includes a transmission interval and a reception interval, and the controlling the master device to perform a handshake connection operation with the target slave device in the handshake time slot includes:
Controlling the master device to transmit a first handshake packet in a transmission interval of the handshake time slot so as to enable the target slave device to return to a second handshake packet;
And if the master device is detected to receive the second handshake packet in the receiving interval of the handshake time slot, entering a wireless connection state.
Optionally, the master device is configured with a communication period, where the communication period includes at least one time slot, and one time slot corresponds to one slave device.
Optionally, the wireless connection is a bluetooth connection.
In a second aspect, an embodiment of the present application provides a wireless connection method, applied to a slave device, including:
controlling the slave device to enter a scanning state;
Controlling whether the slave device scans the identification frame broadcast by the master device in the scanning state;
and if the identification frame is scanned, controlling the slave equipment to send a connection request to the master equipment so that the master equipment executes handshake connection operation according to the connection request.
Optionally, if the identification frame is received, controlling the slave device to send a connection request to the master device, so that the master device performs a handshake connection operation according to the connection request includes:
if the identification frame is received, determining a handshake time point;
controlling the slave device to send a connection request to the master device;
And controlling the slave device to execute handshake connection operation with the master device at the handshake time point.
Optionally, the master device is configured with a communication period, and the determining a handshake time point includes:
Determining a starting receiving time, wherein the starting receiving time is the time when the broadcasting starting time of the identification frame broadcast by the master device is mapped to the time axis of the slave device;
And adding the initial receiving time and the communication period to obtain a handshake time point.
Optionally, the determining the starting receiving time includes:
acquiring a receiving end time and a receiving duration, wherein the receiving end time is the time when the slave device receives the identification frame, and the receiving duration is the duration spent by the slave device for receiving the identification frame;
and subtracting the receiving time length from the receiving end time to obtain the initial receiving time.
Optionally, the controlling the slave device to perform a handshake connection operation with the master device at the handshake time point includes:
controlling the slave device to detect whether a first handshake packet is detected at the handshake time point, wherein the first handshake packet is a handshake packet returned by the master device according to the connection request;
And if the first handshake packet is detected, controlling the slave equipment to send a second handshake packet to the master equipment.
Optionally, the master device is configured with a communication period, the communication period includes at least one time slot, the identification frame includes a transmission interval and a reception interval of the time slot, and the controlling whether the slave device detects the first handshake packet at the handshake time point includes:
and controlling the slave device to set a receiving interval from the handshake time point to detect whether the first handshake packet is received.
Optionally, if the first handshake packet is detected, controlling the slave device to send a second handshake packet to the master device includes:
if the first handshake packet is detected, controlling the slave device to set a transmitting interval after the receiving interval;
and controlling the slave device to send a second handshake packet to the master device in the transmission interval.
Optionally, the wireless connection is a bluetooth connection.
In a third aspect, an embodiment of the present application provides a master device, including:
A first wireless communication module;
a first memory; and
The first processor is respectively in communication connection with the first memory and the first wireless communication module, and is used for executing one or more computer programs stored in the first memory, and the first processor enables the main equipment to realize the method when executing the one or more computer programs.
In a fourth aspect, an embodiment of the present application provides a slave device, including:
A second wireless communication module;
A second memory; and
And the second processor is respectively in communication connection with the second memory and the second wireless communication module, and is used for executing one or more computer programs stored in the second memory, and the second processor enables the slave equipment to realize the method when executing the one or more computer programs.
In a fifth aspect, an embodiment of the present application provides a wireless transmission system, including:
the master device described above;
at least one slave device is connected with the master device in a wireless mode.
In a sixth aspect, an embodiment of the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the above-described method or the above-described method.
The embodiment of the application can realize the following technical effects: in the wireless connection method provided by the embodiment of the application, the master device is controlled to enter a broadcasting state, the master device is controlled to broadcast the identification frame in the broadcasting state, so that the target slave device returns a connection request after scanning the identification frame, the target slave device is at least one slave device, the master device is controlled to enter a handshake state in response to the connection request, and the master device and the target slave device are controlled to execute handshake connection operation in the handshake state. According to the method, the broadcasting party is the master equipment, the scanning party and the connection initiator are the slave equipment, and the master equipment can establish wireless connection with a plurality of slave equipment only by broadcasting a short identification frame with a small idle time slot, so that the reliability, the stability and the low-latency of establishing the wireless connection are improved. When the wireless connection is not established, the embodiment transmits the power-consuming broadcasting task to the master device for broadcasting the identification frame, thereby saving the power consumption of the slave device.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments of the present application will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a piconetwork structure formed by a master device and a plurality of slave devices based on a bluetooth low energy protocol according to the related art;
fig. 2 is a schematic diagram of a scattering network structure formed by a slave device and a plurality of master devices based on a bluetooth low energy protocol according to the related art;
fig. 3 is a schematic structural diagram of a wireless transmission system according to an embodiment of the present application;
fig. 4 is a schematic flow chart of a wireless connection method according to an embodiment of the present application, where an execution body is a master device;
FIG. 5 is a schematic diagram of a master device dividing a communication cycle into a plurality of time sequences according to an embodiment of the present application;
Fig. 6 is a timing chart of transmitting data and receiving data by a master device based on a time slot divided by a communication period according to an embodiment of the present application;
fig. 7 is a schematic diagram of a master device and a slave device 1 according to an embodiment of the present application to establish bluetooth connection;
fig. 8 is a schematic flow chart of a wireless connection method according to an embodiment of the present application, where an execution body is a slave device;
fig. 9 is a communication timing diagram of a master device and a slave device 1 according to an embodiment of the present application;
Fig. 10 is a schematic diagram of data transmission between a master device and a slave device 1, where the master device and the slave device 2 establish a bluetooth connection;
fig. 11 is a schematic structural diagram of a wireless connection device according to an embodiment of the present application, where an execution body is a master device;
Fig. 12 is a schematic structural diagram of a wireless connection device according to an embodiment of the present application, where an execution master is a slave device;
Fig. 13 is a schematic structural diagram of a master device according to an embodiment of the present application;
fig. 14 is a schematic structural diagram of a slave device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
It should be noted that, if not in conflict, the features of the embodiments of the present application may be combined with each other, which is within the protection scope of the present application. In addition, while functional block division is performed in a device diagram and logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the block division in the device, or in the flowchart. Furthermore, the words "first," "second," "third," and the like as used herein do not limit the order of data and execution, but merely distinguish between identical or similar items that have substantially the same function and effect.
As described above, the related art provides a master device that establishes bluetooth connections with a plurality of slave devices in the form of a piconetwork based on a bluetooth low energy protocol. Referring to fig. 1, a master device 10 establishes bluetooth connections with slave devices 11, 12 and 13, respectively, based on a bluetooth low energy protocol.
Some application scenarios have high requirements on time delay performance, and the slave device needs to divide the data packet into a plurality of sub-packets and transmit the sub-packets to the master device. The master device 10 communicates with the slave devices 11, 12 and 13 at corresponding time slots of the communication cycle, respectively, to receive the sub-packets transmitted from the slave devices 11, 12 and 13, respectively.
When the slave device 14 needs to establish a bluetooth connection with the master device 10, since the master device 10 has established a bluetooth connection with the slave device 11, the slave device 12 and the slave device 13, respectively, the time slots reserved for the slave device 14 in the communication period are smaller and smaller, the master device 10 is difficult to scan for the communication information broadcast by the slave device 14 in the smaller time slots, which results in that the master device 10 is difficult to establish a bluetooth connection with the slave device 14.
In the process of implementing the embodiment of the application, the inventor also finds another related technology, and the slave device provided by the related technology establishes Bluetooth connection with a plurality of master devices in a scattering network mode based on a low-power consumption Bluetooth protocol, namely, one slave device drags the plurality of master devices. Referring to fig. 2, the slave device 21 establishes bluetooth connections with the master device 22 and the master device 23, respectively, and the slave device 24 establishes bluetooth connections with the master device 23, the master device 25, and the master device 26, respectively.
When a slave device drags a plurality of master devices, based on the above mentioned factors, a phenomenon that the slave device easily overlaps time in a certain time slot after a period of time of communication with the plurality of master devices, for example, the slave device 21 communicates with the master device 22 and the master device 23 based on a bluetooth connection, and then, after a period of time of communication with the master device 22 and the master device 23, it is found that a communication time which needs to communicate with the master device 22 and the master device 23 simultaneously occurs in the same time slot, which results in that the slave device 21 can only select one communication time for transmitting data in the communication time of the master device 22 and the communication time of the master device 23, for example, select the communication time of the master device 22 for transmitting data, which results in that the slave device 21 cannot communicate with the master device 23, thereby generating a packet loss event.
In the related art shown in fig. 1 or 2, the broadcaster is a slave device, and both the scanner and the initiating connector are master devices.
The inventor has found that in implementing the embodiments of the present application, another related technology supports classical bluetooth (Classic Bluetooth, BT) in which a connection is established using paging (page) and page scan (page scan) methods, where page scan is different from BLE, and page scan needs to return a page response after scanning a page request, so page scan is a passive scan method. In BT, the initiating connection is the master, and the connected is the slave, i.e.: the method comprises the steps that a main device initiates a paging request which lasts for a long time, and response information is returned to the main device when a slave device scans the request; after the master device confirms the information, the FHS packet containing the clock information is sent to the slave device, and the slave device establishes Bluetooth connection with the master device according to the FHS packet.
As described above, the connection between the master and slave devices of the classical bluetooth needs to be confirmed by information through multiple steps, so that the bluetooth connection process established based on the classical bluetooth in the related art is complicated, the delay is large, and the success rate is low.
The main device provided by the embodiment of the application is a broadcasting party, the scanning party and the initiating connecting party are both slave devices, and the main device can establish wireless connection with a plurality of slave devices only by broadcasting a short identification frame with a small idle time slot, so that the reliability, the stability and the low delay of establishing the wireless connection are improved.
According to the embodiment of the application, a scattering network structure of a plurality of main devices is not required to be dragged by one auxiliary device, and the problem of unreliable connection caused by the frequency offset problem of the main devices can be avoided.
When the wireless connection is not established, the embodiment of the application transmits the power-consuming broadcasting task to the master device to broadcast the identification frame, thereby saving the power consumption of the slave device. In many application scenarios, the master device is directly connected with a power supply, the slave device is powered by a battery, and the embodiment transmits the power-consuming broadcasting task to the master device to broadcast the identification frame, so that the power consumption of the slave device can be reduced and the endurance of the slave device can be improved on the premise of ensuring that the power supply is enough to broadcast.
According to the embodiment of the application, the master device is controlled to divide the communication period into the corresponding number of time slots according to the number of the slave devices, and the divided time slots are the minimum time slots meeting the requirements of the master device, so that the delay is reduced, and the low-delay capability is improved.
As an aspect of the embodiment of the present application, the embodiment of the present application provides a wireless transmission system. Referring to fig. 3, a wireless transmission system 300 includes a master device 31 and at least one slave device, the at least one slave device being communicatively coupled to the master device 31. As shown in fig. 3, at least one slave device is a slave device 32, a slave device 33, and a slave device 34, respectively. The master device 31 establishes wireless connection with the slave device 32, the slave device 33, and the slave device 34, respectively, using the wireless connection method described in the following embodiments.
It is understood that the master device may be an adapter, a wireless microphone, a wireless speaker, a mobile phone, a computer or a smart television, and the slave device may be a wireless microphone, a wireless speaker, a mobile phone, a computer or a smart television.
As another aspect of the embodiments of the present application, the embodiments of the present application provide a wireless connection method, which is applied to a master device, where the master device may be wirelessly connected with at least one slave device, where the wireless connection includes a bluetooth connection, a WIFI connection, a Zigbee connection, or an NFC connection, etc., and it is understood that the present embodiment does not make any undue restrictions on a wireless protocol of the wireless connection. Referring to fig. 4, the wireless connection method includes the following steps:
S41: and controlling the main equipment to enter a broadcasting state.
In this step, the broadcast status is the status of the master device broadcasting information to the outside.
In some embodiments, controlling the master device to enter a broadcast state includes the steps of: and when the starting command is detected, controlling the main equipment to enter a broadcasting state.
In some embodiments, controlling the master device to enter the broadcast state includes the steps of: and responding to the broadcast command sent by the external equipment, and controlling the main equipment to enter a broadcast state.
In some embodiments, the master device is configured with a communication period including at least one time slot, and controlling the master device to enter the broadcast state includes: judging whether the communication period has a time slot in a to-be-connected state, if the communication period has the time slot in the to-be-connected state, controlling the main equipment to enter a broadcasting state, and if the communication period does not have the time slot in the to-be-connected state, controlling the main equipment to end the operation of judging whether the communication period has the time slot in the to-be-connected state.
The step of judging whether the communication period has a time slot in a to-be-connected state comprises the following steps: and determining the connection state of each time slot of the communication period, and judging whether the connection state of each time slot is a state to be connected.
Determining the connection status of each slot of the communication cycle comprises the steps of: a status identifier of each time slot in the communication period is obtained, wherein the status identifier is used for representing a connection status.
The state identifier comprises a to-be-connected state identifier and a connected state identifier, the connected state comprises a to-be-connected state and a connected state, the to-be-connected state identifier is used for indicating the to-be-connected state, and the to-be-connected state is a state that the slave device is not connected with the master device yet. The connected state identifier is used to indicate a connected state, which is a state in which the slave device has connected to the master device.
The step of judging whether the connection state of each time slot is the state to be connected comprises the following steps: and judging whether the state identifier of each time slot is the to-be-connected state identifier.
Referring to fig. 5, a master device is configured with communication periods, each of which includes an equal number of time slots, and communicates with different slaves in different time slots. As shown in fig. 5, the first communication period T1, the second communication period T2, and the third communication period T3 all include n time slots, the master device determines whether the connection state of the time slot 1 is a to-be-connected state, if the connection state of the time slot 1 is the connection state, the master device considers that the time slot 1 is connected to the slave device 1, and continues to determine whether the connection state of the time slot 2 is the to-be-connected state, if the connection state of the time slot 2 is still the connection state, the master device considers that the time slot 2 is connected to the slave device 2, and continues to determine whether the connection state of the time slot 3 is the to-be-connected state, and if the connection state of the time slot 3 is the to-be-connected state, the master device considers that the time slot 3 is not connected to the slave device, so the master device can choose to enter a broadcast state in the time slot 3, and wait for the connection of the slave device 3.
In some embodiments, one time slot corresponds to one slave device, in other words, the master device divides the communication period into time slots with the same number of time slots as the number of slave devices according to the number of slave devices, for example, please refer to fig. 5, and the designer designs that the master device can be connected with n slave devices at most according to the product requirement, so that the number of slave devices is n, the number of time slots is n, and the master device divides the communication period into n time slots. If the master device establishes wireless connection with n slave devices, the master device communicates with the slave device 1 in the time slot 1, communicates with the slave device 2 in the time slot 2, and communicates with the slave device n in the time slot n, so that the description is omitted here.
According to the embodiment of the application, the master device is controlled to divide the communication period into the corresponding number of time slots according to the number of the slave devices, and the divided time slots are the minimum time slots meeting the requirements of the master device, so that the delay is reduced, and the low-delay capability is improved.
S42: and controlling the master device to broadcast the identification frame in a broadcast state so that the target slave device returns a connection request after scanning the identification frame, wherein the target slave device is one of the at least one slave device.
In this step, the identification frame is a data frame for helping the slave device to establish wireless connection with the master device, and the identification frame can be obtained by encapsulating the identification information by a designer according to the identification information matched with the product requirement by adopting any data structure.
In some embodiments, the identification frame is composed of four major parts, which are the synchronization header, the device address, the clock information, and the additional information, respectively. The synchronization header is used to identify the identification frame. The device address is the device address of the master device, and the subsequent slave device analyzes the device address of the master device, so that a connection request can be initiated. The clock information is used to represent the local clock of the time slot generated by the master device, which may then be used for frequency hopping. The accessory information comprises characteristic information for establishing wireless connection, such as connection period, frequency hopping sequence, CRC initial value, transmitting interval TX information and receiving interval RX information, and the characteristic information is analyzed from the device, so that a link capable of establishing wireless connection can be filtered out rapidly.
The connection request is a request for the target slave device to establish a wireless connection with the master device.
Controlling the master device to broadcast the identification frame in a broadcast state so that the target slave device returns a connection request in response to the identification frame comprises the following steps: and in the broadcasting state, controlling the master device to broadcast the identification frame in the target time slot, so that the target slave device returns a connection request after scanning the identification frame, wherein the target time slot is the time slot in the to-be-connected state.
For example, when the connection state of the slot 3 is the to-be-connected state, the master device broadcasts an identification frame in the slot 3 in the broadcast state, and when the slave device 3 scans to the identification frame, the slave device 3 sends a connection request to the master device, requesting to establish a wireless connection with the master device.
As described above, the master device serves as a broadcasting party, and a short identification frame can be broadcast only by a small idle time slot, and the target slave device serves as a scanning party, and when the target slave device scans the identification frame, the target slave device transmits a connection request to the master device. Therefore, in the process, the target slave device can use a longer time slot window to scan the identification frame, so that the success rate of scanning is improved. Meanwhile, the time slot allocation of the master device is simplified, the influence on the existing connection when a new device is scanned after a plurality of slave devices are connected is avoided, and the stability of the connection is improved.
In some embodiments, the time slot includes a transmit interval in which the master device transmits data and a receive interval in which the master device receives data. Referring to fig. 6, the master device just starts up and does not establish a wireless connection with any slave device, so the connection status of each time slot in the communication cycle is a to-be-connected status. As shown in fig. 6, the master transmits data in the transmission interval TX of the slot 1 and receives data in the reception interval RX of the slot 1. The embodiment can complete the transmitting operation and the receiving operation in one time slot so as to quickly transmit and receive data, thereby being beneficial to reducing communication delay.
In some embodiments, controlling the master device to broadcast the identification frame in the target time slot in the broadcast state such that the target slave device returns a connection request in response to the identification frame comprises the steps of: and in the broadcasting state, the master device is controlled to broadcast the identification frame in the transmitting interval so that the target slave device returns the connection request in response to the identification frame, and in the broadcasting state, the master device is controlled to receive the connection request in the receiving interval.
As shown in fig. 6, the master device broadcasts an identification frame in a transmission section TX of the slot 1, and receives a connection request transmitted from the slave device in a reception section RX of the slot 1. The embodiment can complete the transmitting operation and the receiving operation in one time slot so as to quickly establish the wireless connection, which is beneficial to reducing the power consumption.
S43: and responding to the connection request, and controlling the main device to enter a handshake state.
In this step, the handshake state is a state in which the master device exchanges data with the target slave device to establish a wireless connection.
S44: and in the handshake state, controlling the master device to perform handshake connection operation with the target slave device.
In this step, in some embodiments, the master device may perform a handshake connection operation with the target slave device in one direction in the handshake state, for example, the master device sends a handshake packet to the target slave device in the handshake state, so as to establish a wireless connection with the target slave device. In some embodiments, the master device performs bidirectional communication with the target slave device in the handshake state to perform a handshake connection operation, for example, the master device sends a first handshake packet to the target slave device in the handshake state, the target slave device sends a second handshake packet to the master device after receiving the first handshake packet, and the master device can establish a wireless connection with the target slave device after receiving the second handshake packet.
In general, the broadcaster is a master device, the scanner and the connection initiator are slave devices, and the master device can establish wireless connection with a plurality of slave devices only by broadcasting a short identification frame in a small idle time slot, so that the reliability, stability and low-latency of establishing the wireless connection are improved. When the wireless connection is not established, the embodiment transmits the power-consuming broadcasting task to the master device for broadcasting the identification frame, thereby saving the power consumption of the slave device.
In some embodiments, the master device is configured with a communication cycle including at least one time slot, and controlling the master device to perform a handshake connection operation with the target slave device in the handshake state includes the steps of: and determining a handshake time slot corresponding to the target slave device in a handshake state, wherein the handshake time slot is a time slot when the master device performs handshake with the target slave device, and controlling the master device to perform handshake connection operation with the target slave device in the handshake time slot.
The time difference between the handshake time slot and the broadcast time slot is equal to the communication period, and the broadcast time slot is the time slot in which the connection request is received after the main device broadcasts the identification frame.
Referring to fig. 7, the master device detects that the connection state of the first time slot 1 is the to-be-connected state in the first communication period T1, and then the master device broadcasts an identification frame in the transmission interval TX of the first time slot 1, but no slave device scans the identification frame at this time, so the master device does not receive the connection request in the reception interval RX of the first time slot 1.
Next, the slave device 1 is configured whether or not the identification frame is scanned within the preset scanning window length CX. In addition, the master device detects that the connection state of the time slot 1 is a to-be-connected state in the second communication period T2, and then the master device broadcasts an identification frame in the transmission interval TX of the second time slot 1, and because the transmission interval TX of the second time slot 1 appears in the preset scanning window length CX, the slave device 1 scans the identification frame in the preset scanning window length CX, the slave device 1 analyzes the identification frame to obtain the characteristic information such as the device address and the transmission interval TX of the master device, the slave device 1 generates a connection request according to the device address of the master device, and sends the connection request to the master device in the transmission interval TX, and the master device receives the connection request in the reception interval RX. The master takes the second time slot 1 of the second communication period T2 as a broadcast time slot and the third time slot 1 of the third communication period T3 as a handshake time slot. The time difference between the third time slot 1 and the second time slot 1 is equal to the communication period.
In some embodiments, determining a handshake slot corresponding to the target slave device in the handshake state comprises: the method comprises the steps of determining a broadcasting time slot of a current communication period in a handshake state, wherein the current communication period is a communication period in which a main device broadcasts an identification frame, the broadcasting time slot is a time slot in which a connection request is received after the main device broadcasts the identification frame, determining a target sequence number of the broadcasting time slot, determining a time slot in which the sequence number is consistent with the target sequence number in a next communication period in the handshake state as a handshake time slot corresponding to a target slave device, and the next communication period is a communication period connected after the current communication period.
In some embodiments, determining a handshake slot corresponding to the target slave device in the handshake state comprises: and determining time information of the broadcasting time slot in a handshake state, and calculating the handshake time slot corresponding to the target slave device according to the time information of the broadcasting time slot and a preset communication period.
In some embodiments, the time information of the broadcast time slot is a time slot starting point, the handshake time slot includes a handshake starting point and a handshake ending point, a difference between the handshake ending point and the handshake starting point is equal to the time slot, and calculating the handshake time slot corresponding to the target slave device according to the time information of the broadcast time slot and a preset communication period includes: and adding the time slot starting point of the broadcast time slot and the communication period to obtain a handshake starting point.
The time slot comprises a transmitting interval and a receiving interval, and the control master device and the target slave device execute handshake connection operation in the handshake time slot comprises the following steps: and controlling the main equipment to transmit a first handshake packet in a transmitting interval of the handshake time slot so as to enable the target slave equipment to return to a second handshake packet, entering a wireless connection state if the main equipment is detected to receive the second handshake packet in a receiving interval of the handshake time slot, and controlling the main equipment to execute preset operation if the main equipment is not detected to receive the second handshake packet in the receiving interval of the handshake time slot.
In some embodiments, controlling the master device to perform the preset operation includes: the master device is directly controlled to reenter the broadcast state.
In some embodiments, controlling the master device to perform the preset operation includes: determining handshake duration, judging whether the handshake duration is greater than a preset handshake threshold, if yes, stopping handshake connection operation, controlling the main equipment to reenter a broadcasting state, and if not, determining a new handshake time slot, and controlling the main equipment to execute handshake connection operation with the target auxiliary equipment in the new handshake time slot.
Referring to fig. 7, the master device transmits the first handshake packet w1 in the transmission interval TX of the third time slot 1 (i.e., handshake time slot) of the third communication period T3, the slave device 1 does not receive the first handshake packet w1 in the local reception interval RX, or the slave device 1 receives the first handshake packet w1 in the local reception interval RX, but cannot transmit the second handshake packet w2, or the slave device 1 receives the first handshake packet w1 in the local reception interval RX, but cannot transmit the first handshake packet w1, but the transmitted second handshake packet w2 is not received by the master device in the reception interval RX, that is, the master device does not receive the second handshake packet w2 transmitted by the slave device in the reception interval RX, and the master device considers that the handshake fails and performs the handshake again.
In the process of re-handshake, the master device transmits a first handshake packet w1 in a transmission interval TX of a fourth time slot 1 (i.e., a handshake time slot) of a fourth communication period T4, the slave device 1 receives the first handshake packet w1 in a local receiving interval RX and transmits a second handshake packet w2 in the local transmission interval TX, the master device receives the second handshake packet w2 transmitted by the slave device in the receiving interval RX, and the master device considers that handshake is successful and generates handshake success information, and the master device and the slave device enter a data transmission state.
In the data transmission state, the master device transmits and receives data packets in the transmission interval TX and the reception interval RX of the fifth time slot 1 of the fifth communication period T5, and correspondingly, the slave device 1 transmits and receives data packets in the local reception interval RX and the transmission interval TX.
In the embodiment of the application, a two-way handshake mode is adopted in the handshake connection process, so that the wireless connection between the master device and the slave device can be reliably and stably controlled. Meanwhile, as described above, when the master device and the slave device handshake succeed, the master device enters a wireless connection state. When the master device and the slave device handshake fail, the master device re-handshake or reenters the broadcast state, which is beneficial to quickening the reaction when detecting abnormal connection and improving the robustness of the connection process.
As still another aspect of the embodiments of the present application, the embodiments of the present application provide a wireless connection method applied to a slave device, where the wireless connection includes a bluetooth connection, a WIFI connection, a Zigbee connection, an NFC connection, or the like. Referring to fig. 8, the wireless connection method includes the following steps:
s81: the slave device is controlled to enter a scanning state.
In this step, the scanning state is a state of whether the slave device scans the identification frame broadcast by the master device.
S82: in the scanning state, whether the slave device scans to the identification frame broadcast by the master device is controlled.
In this step, the embodiment configures a preset scanning window length for the slave device, and controls whether the slave device scans the identification frame broadcasted by the master device within the preset scanning window length.
S83: and if the identification frame is scanned, controlling the slave device to send a connection request to the master device so that the master device performs handshake connection operation according to the connection request.
S84: and if the identification frame is not scanned, controlling the slave equipment to reenter the scanning state.
As described above, the broadcaster is a master device, and the scanner and the connection initiator are slave devices, and the master device only needs a small idle time slot to broadcast a short identification frame, so that wireless connection can be established with a plurality of slave devices, thereby improving reliability, stability and low latency of establishing wireless connection. When the wireless connection is not established, the embodiment transmits the power-consuming broadcasting task to the master device for broadcasting the identification frame, thereby saving the power consumption of the slave device.
In some embodiments, step S83 includes the steps of: if the identification frame is received, determining a handshake time point, controlling the slave device to send a connection request to the master device, and controlling the slave device to execute handshake connection operation with the master device at the handshake time point.
The master device is configured with a communication period, and determining a handshake time point includes the steps of: and determining the initial receiving time, wherein the initial receiving time is the time when the broadcasting initial time of the broadcasting identification frame of the master device is mapped to the time axis of the slave device, and adding the initial receiving time and the communication period to obtain the handshake time point.
Determining the starting reception time comprises the following steps: and acquiring a receiving end time and a receiving duration, wherein the receiving end time is the time when the slave equipment receives the identification frame, the receiving duration is the time spent by the slave equipment for receiving the identification frame, and the receiving duration is subtracted from the receiving end time to obtain the initial receiving time.
Referring to fig. 9, the slave device 1 enters a scanning state between a first time slot 1 of a first communication period T1 and a second time slot 1 of a second communication period T2, and scans whether an identification frame broadcasted by the master device is received within a preset scanning window length in the scanning state. The slave device 1 receives the identification frame at the CLK (x) time on the local clock, where the CLK (x) time is the reception end time. The time period taken for the slave device 1 to receive the identification frame is Duration, which is the reception time period. The present embodiment can calculate the initial reception time ts=clk (x) -Duration. The slave device 1 counts in beats per clock cycle CLK and also can accurately calculate the time offset from each clock cycle, in many cases, the CLK (x) time is not an integer multiple of the clock cycle CLK, the CLK (x) time is expressed on the local clock as: CLK (x) =clks (x) +offsets (x), CLKs (x) is the time corresponding to the xth clock cycle, offset (x) is the offset time from CLKs (x), and thus, the start reception time ts=clks (x) +offsets (x) -Duration.
Since the start reception time is a time when the broadcast start time of the master broadcast identification frame is mapped to the time axis of the slave, that is, please refer to fig. 9, the master starts broadcasting the identification frame at the broadcast start time CLKm (n) of the local clock, and the time aligned with the broadcast start time CLKm (n) at the local clock of the slave 1 is the start reception time ts, in other words, the master starts broadcasting the identification frame while the slave 1 is still in the scanning state at the start reception time ts.
The slave needs to send and receive data synchronously with the master, and therefore, the clock of the slave needs to be kept synchronous with the clock of the master. After the initial receiving time ts is determined in the present embodiment, the present embodiment adds the initial receiving time ts to the communication period to obtain the handshake time tw.
If the slave device receives the identification frame, the slave device enters a handshake state, and sends a connection request to the master device in the handshake state, wherein the control of the slave device to send the connection request to the master device comprises the following steps: and the slave equipment is controlled to analyze the identification frame to obtain transmission interval information, and after the receiving end time, the transmission interval is set according to the transmission interval information so as to control the slave equipment to send a connection request to the master equipment in the transmission interval.
Controlling the slave device to perform a handshake connection operation with the master device at a handshake time point comprises the steps of: and controlling the slave device to detect whether a first handshake packet is detected at the handshake time point, wherein the first handshake packet is returned by the master device according to the connection request, if the first handshake packet is detected, controlling the slave device to send a second handshake packet to the master device, and if the first handshake packet is not detected, controlling the slave device to reenter the handshake state.
The master device is configured with a communication period, the communication period comprises at least one time slot, the identification frame comprises a transmitting section and a receiving section of the time slot, and the controlling whether the slave device detects the first handshake packet at the handshake time point comprises: and controlling the slave device to set a receiving interval from the handshake time point to detect whether the first handshake packet is received.
If the first handshake packet is detected, controlling the slave device to send a second handshake packet to the master device comprises the following steps: and if the first handshake packet is detected, controlling the slave device to set a transmitting interval after the receiving interval, and controlling the slave device to send a second handshake packet to the master device in the transmitting interval.
Referring to fig. 10, the master device has established a wireless connection with the slave device 1, and the master device may transmit data packets to and receive data packets from the slave device 1 in the first time slot 1 of the first communication period T1, the second time slot 1 of the second communication period T2, the third time slot 1 of the third communication period T3, and the fourth time slot 1 of the fourth communication period T4.
The master device determines that the connection state of the second time slot 2 in the first communication period T1 is a to-be-connected state, and broadcasts an identification frame in the transmission interval TX of the second time slot 2 in the first communication period T1, but no slave device scans the identification frame at this time, so the master device does not receive a connection request in the reception interval RX of the second time slot 2.
Next, the master device broadcasts an identification frame in the transmission interval TX of the second time slot 2 of the second communication period T2, which identification frame is still not scanned by any slave device.
Then, the master device broadcasts an identification frame in a transmission interval TX of a third time slot 2 in a third communication period T3, the slave device 2 scans the identification frame in a preset scanning window length, analyzes transmission interval information from the identification frame, sends a connection request to the master device in the transmission interval TX corresponding to the transmission interval information, and enters a handshake state. The master device enters a handshake state according to the connection request.
When the slave device 2 enters the handshake state, the slave device calculates a handshake time point tw. Meanwhile, when the master device enters a handshake state, the master device determines a fourth time slot 2 of a fourth communication period T4 as a handshake time slot, and transmits a first handshake packet in a transmission interval TX of the fourth time slot 2. The slave device 2 sets a local reception interval RX from the handshake time tw, and when the first handshake packet is received in the local reception interval RX, transmits a second handshake packet to the master device in a local transmission interval TX. And when the master device receives the second handshake packet in the receiving interval RX of the fourth time slot 2, the master device completes the handshake connection operation.
It should be noted that, in the foregoing embodiments, there is not necessarily a certain sequence between the steps, and those skilled in the art will understand that, according to the description of the embodiments of the present application, the steps may be performed in different orders in different embodiments, that is, may be performed in parallel, may be performed interchangeably, or the like.
As another aspect of the embodiments of the present application, the embodiments of the present application provide a wireless connection apparatus, which is applied to a master device, where the master device may be wirelessly connected to at least one slave device. The wireless connection device may be a software module, where the software module includes several instructions, and the instructions are stored in a memory, and the processor may access the memory and call the instructions to execute to complete the wireless connection method set forth in the foregoing embodiments.
Referring to fig. 11, the wireless connection device 110 includes a broadcast control module 111, a data broadcast module 112, a handshake control module 113, and a handshake connection module 114.
The broadcast control module 111 is configured to control the master device to enter a broadcast state, the data broadcast module 112 is configured to control the master device to broadcast an identification frame in the broadcast state, so that a connection request is returned after the target slave device scans the identification frame, the target slave device is a slave device in at least one slave device, the handshake control module 113 is configured to control the master device to enter a handshake state in response to the connection request, and the handshake connection module 114 is configured to control the master device to perform a handshake connection operation with the target slave device in the handshake state.
In this embodiment, the broadcaster is a master device, and the scanner and the connection initiator are slave devices, and the master device only needs a small idle time slot to broadcast a short identification frame, so that wireless connection can be established with a plurality of slave devices, thereby improving reliability, stability and low latency of establishing wireless connection. When the wireless connection is not established, the embodiment transmits the power-consuming broadcasting task to the master device for broadcasting the identification frame, thereby saving the power consumption of the slave device.
In some embodiments, the master device is configured with a communication period comprising at least one time slot, and the broadcast control module 111 is specifically configured to: judging whether the communication period has a time slot in a to-be-connected state, and if the communication period has the time slot in the to-be-connected state, controlling the main equipment to enter a broadcasting state.
In some embodiments, the master device is configured with a communication period comprising at least one time slot, and the data broadcast module 112 is specifically configured to: and in the broadcasting state, controlling the master device to broadcast the identification frame in the target time slot, so that the target slave device returns a connection request after scanning the identification frame, wherein the target time slot is the time slot in the to-be-connected state.
In some embodiments, the time slot includes a transmission interval in which the data is transmitted by the master device and a reception interval in which the data is received.
In some embodiments, the data broadcast module 112 is specifically configured to: and in the broadcasting state, the master device is controlled to broadcast the identification frame in the transmitting interval so that the target slave device returns the connection request in response to the identification frame, and in the broadcasting state, the master device is controlled to receive the connection request in the receiving interval.
In some embodiments, the master device is configured with a communication cycle comprising at least one time slot, and handshake connection module 114 is specifically configured to: and determining a handshake time slot corresponding to the target slave device in a handshake state, wherein the handshake time slot is a time slot when the master device performs handshake with the target slave device, and controlling the master device to perform handshake connection operation with the target slave device in the handshake time slot.
In some embodiments, the time difference between the handshake time slot and the broadcast time slot is equal to the communication period, and the broadcast time slot is a time slot in which the connection request is received after the master broadcasts the identification frame.
In some embodiments, the time slot includes a transmission interval and a reception interval, and the handshake connection module 114 is specifically configured to: and controlling the master device to transmit the first handshake packet in the transmitting interval of the handshake time slot so as to enable the target slave device to return to the second handshake packet, and entering a wireless connection state if the master device is detected to receive the second handshake packet in the receiving interval of the handshake time slot.
In some embodiments, the master device is configured with a communication period comprising at least one time slot, one time slot corresponding to each slave device.
In some embodiments, the wireless connection is a bluetooth connection.
It should be noted that, the wireless connection device may execute the wireless connection method provided by the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in the wireless connection device embodiment may be referred to the wireless connection method provided in the embodiment of the present application.
As still another aspect of the embodiments of the present application, the embodiments of the present application provide a wireless connection apparatus applied to a slave device, where the wireless connection apparatus may be a software module, and the software module includes several instructions, which are stored in a memory, and a processor may access the memory and call the instructions to execute the instructions to complete the wireless connection method set forth in the foregoing embodiments.
Referring to fig. 12, the wireless connection device 120 includes a scan control module 121, a data scan module 122, and a connection request module 123. The scan control module 121 is configured to control the slave device to enter a scan state, the data scan module 122 is configured to control whether the slave device scans an identification frame broadcasted by the master device in the scan state, and the connection request module 123 is configured to control the slave device to send a connection request to the master device if the identification frame is scanned, so that the master device performs a handshake connection operation according to the connection request. The broadcasting party is the master equipment, the scanning party and the connection initiator are the slave equipment, and the master equipment can establish wireless connection with a plurality of slave equipment only by broadcasting a short identification frame in a small idle time slot, so that the reliability, the stability and the low-delay property of establishing the wireless connection are improved. When the wireless connection is not established, the embodiment transmits the power-consuming broadcasting task to the master device for broadcasting the identification frame, thereby saving the power consumption of the slave device.
In some embodiments, the connection request module 123 is specifically configured to: if the identification frame is received, determining a handshake time point, controlling the slave device to send a connection request to the master device, and controlling the slave device to execute handshake connection operation with the master device at the handshake time point.
In some embodiments, the master device is configured with a communication cycle, and the connection request module 123 is specifically configured to: and determining the initial receiving time, wherein the initial receiving time is the time when the broadcasting initial time of the identification frame broadcast by the master device is mapped to the time axis of the slave device, and adding the initial receiving time and the communication period to obtain a handshake time point.
In some embodiments, the connection request module 123 is specifically configured to: and acquiring a receiving end time and a receiving duration, wherein the receiving end time is the time when the slave equipment receives the identification frame, the receiving duration is the time spent by the slave equipment for receiving the identification frame, and the receiving duration is subtracted from the receiving end time to obtain the initial receiving time.
In some embodiments, the connection request module 123 is specifically configured to: and controlling whether the slave device detects a first handshake packet at the handshake time point, wherein the first handshake packet is returned by the master device according to the connection request, and if the first handshake packet is detected, controlling the slave device to send a second handshake packet to the master device.
In some embodiments, the master device is configured with a communication period, the communication period includes at least one time slot, the identification frame includes a transmission interval and a reception interval of the time slot, and the connection request module 123 is specifically configured to: control sets a reception interval from the device starting from the handshake time point to detect whether the first handshake packet is received.
In some embodiments, the connection request module 123 is specifically configured to: and if the first handshake packet is detected, controlling the slave device to set a transmitting interval after the receiving interval, and controlling the slave device to send a second handshake packet to the master device in the transmitting interval.
In some embodiments, the wireless connection is a bluetooth connection.
It should be noted that, the wireless connection device may execute the wireless connection method provided by the embodiment of the present application, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in the wireless connection device embodiment may be referred to the wireless connection method provided in the embodiment of the present application.
Referring to fig. 13, fig. 13 is a schematic structural diagram of a master device according to an embodiment of the present application. The host device 130 includes a first wireless communication module 131, a first memory 132, and one or more first processors 133. The one or more first processors 133 are each communicatively coupled to the first memory 132 and the first wireless communication module 131, respectively. The first wireless communication module 131 may be a bluetooth module, a wifi module, a Zigbee module, or the like.
Referring to fig. 14, fig. 14 is a schematic structural diagram of a slave device according to an embodiment of the present application. The slave device 140 includes a second wireless communication module 141, a second memory 142, and one or more second processors 143. The one or more second processors 143 are each communicatively coupled to the second memory 142 and the second wireless communication module 141, respectively. The second wireless communication module 141 may be a bluetooth module, a wifi module, a Zigbee module, or the like.
The first processor 133 or the second processor 143 is configured to support the computer device to perform the respective functions in the methods in the above-described method embodiments, and the first processor 133 or the second processor 143 may be a central processor (central processing unit, CPU), a network processor (network processor, NP), a hardware chip, or any combination thereof. The hardware chip may be an Application SPECIFIC INTEGRATED Circuit (ASIC), a programmable logic device (programmable logic device, PLD), or a combination thereof. The PLD may be a complex programmable logic device (complex programmable logic device, CPLD), a field-programmable gate array (FPGA) GATE ARRAY, generic array logic (GENERIC ARRAY logic, GAL), or any combination thereof.
The first memory 132 or the second memory 142 is used for storing program codes and the like. The first memory 132 or the second memory 142 may include a Volatile Memory (VM), such as a random access memory (random access memory, RAM); the memory may also include a non-volatile memory (NVM), such as read-only memory (ROM), flash memory (flash memory), hard disk (HARD DISK DRIVE, HDD) or solid state disk (solid-state drive (STATE DRIVE, SSD); the memory may also comprise a combination of the above types of memories.
The first memory 132 or the second memory 142 may be used to store a nonvolatile software program, a nonvolatile computer executable program, and a module, such as program instructions/modules corresponding to the wireless connection method in the embodiment of the present application. The first processor 133 performs various functional applications and data processing of the wireless connection method and the wireless connection apparatus by running the nonvolatile software programs, instructions, and modules stored in the first memory 132, or the second processor 143 performs the functions of the various modules or units of the wireless connection method and the wireless connection apparatus provided by the above-described method embodiments by running the nonvolatile software programs, instructions, and modules stored in the second memory 142.
The first memory 132 or the second memory 142 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function. The storage data area may store data created according to the use of the wireless connection device, etc. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the wireless connection through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The one or more modules are stored in the first memory or the second memory, and when executed by the one or more first processors or the second processors, perform the wireless connection method in any of the method embodiments described above, for example, perform the method steps described in the method embodiments described above, and implement the functions of the modules described in the apparatus embodiments described above.
Embodiments of the present application also provide a computer-readable storage medium storing a computer program comprising program instructions that, when executed by a computer, cause the computer to perform the method of the previous embodiments.
Those skilled in the art will appreciate that implementing all or part of the above-described methods in the embodiments may be accomplished by computer programs stored in a computer-readable storage medium, which when executed, may include the steps of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only memory (ROM), a random-access memory (Random Access memory, RAM), or the like.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (22)

1. A wireless connection method applied to a master device, the master device being wirelessly connectable to at least one slave device, the method comprising:
Controlling the main equipment to enter a broadcasting state;
Controlling the master device to broadcast an identification frame in the broadcast state so that a target slave device returns a connection request after scanning the identification frame, wherein the target slave device is a slave device in the at least one slave device;
responding to the connection request, and controlling the main equipment to enter a handshake state;
And controlling the master device and the target slave device to execute handshake connection operation in the handshake state.
2. The method of claim 1, wherein the master device is configured with a communication period, the communication period comprising at least one time slot, the controlling the master device to enter a broadcast state comprising:
Judging whether a time slot in a to-be-connected state exists in the communication period or not;
And if the communication period has a time slot in a to-be-connected state, controlling the main equipment to enter a broadcasting state.
3. The method of claim 2, wherein the master device is configured with a communication period, the communication period including at least one time slot, wherein controlling the master device to broadcast an identification frame in the broadcast state to cause a target slave device to return a connection request in response to the identification frame comprises:
And controlling the master device to broadcast an identification frame in a target time slot in the broadcast state so that the target slave device returns a connection request after scanning the identification frame, wherein the target time slot is a time slot in a to-be-connected state.
4. A method according to claim 3, wherein the time slot comprises a transmission interval in which the master transmits data and a reception interval in which the master receives data.
5. The method of claim 4, wherein said controlling the master device to broadcast an identification frame in the target time slot in the broadcast state to cause the target slave device to return a connection request in response to the identification frame comprises:
Controlling the master device to broadcast an identification frame in the transmission interval in the broadcast state so as to enable the target slave device to respond to the identification frame and return a connection request;
and controlling the master device to receive a connection request in the receiving section in the broadcasting state.
6. The method according to any one of claims 1 to 5, wherein the master device is configured with a communication period, the communication period comprising at least one time slot, the controlling the master device to perform a handshake connection operation with the target slave device in the handshake state comprising:
determining a handshake time slot corresponding to the target slave device in the handshake state, wherein the handshake time slot is a time slot when the master device performs handshake with the target slave device;
And controlling the master device to execute handshake connection operation with the target slave device in the handshake time slot.
7. The method of claim 6, wherein a time difference between the handshake time slot and a broadcast time slot is equal to the communication period, the broadcast time slot being a time slot in which the connection request is received after the master device broadcasts the identification frame.
8. The method of claim 6, wherein the time slot comprises a transmit interval and a receive interval, and wherein the controlling the master device to perform a handshake connection operation with the target slave device during the handshake time slot comprises:
Controlling the master device to transmit a first handshake packet in a transmission interval of the handshake time slot so as to enable the target slave device to return to a second handshake packet;
And if the master device is detected to receive the second handshake packet in the receiving interval of the handshake time slot, entering a wireless connection state.
9. The method according to any of claims 1 to 8, wherein the master device is configured with a communication period comprising at least one time slot, one time slot corresponding to one of the slave devices.
10. The method according to any of claims 1 to 8, wherein the wireless connection is a bluetooth connection.
11. A wireless connection method applied to a slave device, comprising:
controlling the slave device to enter a scanning state;
Controlling whether the slave device scans the identification frame broadcast by the master device in the scanning state;
and if the identification frame is scanned, controlling the slave equipment to send a connection request to the master equipment so that the master equipment executes handshake connection operation according to the connection request.
12. The method of claim 11, wherein the controlling the slave device to send a connection request to the master device if the identification frame is received, such that the master device performs a handshake connection operation according to the connection request comprises:
if the identification frame is received, determining a handshake time point;
controlling the slave device to send a connection request to the master device;
And controlling the slave device to execute handshake connection operation with the master device at the handshake time point.
13. The method of claim 12, wherein the master device is configured with a communication period, and wherein determining a handshake time point comprises:
Determining a starting receiving time, wherein the starting receiving time is the time when the broadcasting starting time of the identification frame broadcast by the master device is mapped to the time axis of the slave device;
And adding the initial receiving time and the communication period to obtain a handshake time point.
14. The method of claim 13, wherein the determining the starting reception time comprises:
acquiring a receiving end time and a receiving duration, wherein the receiving end time is the time when the slave device receives the identification frame, and the receiving duration is the duration spent by the slave device for receiving the identification frame;
and subtracting the receiving time length from the receiving end time to obtain the initial receiving time.
15. The method according to any one of claims 12 to 14, wherein the controlling the slave device to perform a handshake connection operation with the master device at the handshake time point comprises:
controlling the slave device to detect whether a first handshake packet is detected at the handshake time point, wherein the first handshake packet is a handshake packet returned by the master device according to the connection request;
And if the first handshake packet is detected, controlling the slave equipment to send a second handshake packet to the master equipment.
16. The method of claim 15, wherein the master device is configured with a communication period, the communication period including at least one time slot, the identification frame including a transmission interval and a reception interval of the time slot, the controlling whether the slave device detects a first handshake packet at the handshake time point includes:
and controlling the slave device to set a receiving interval from the handshake time point to detect whether the first handshake packet is received.
17. The method of claim 16, wherein if the first handshake packet is detected, controlling the slave device to send a second handshake packet to the master device comprises:
if the first handshake packet is detected, controlling the slave device to set a transmitting interval after the receiving interval;
and controlling the slave device to send a second handshake packet to the master device in the transmission interval.
18. The method according to any of claims 11 to 14, wherein the wireless connection is a bluetooth connection.
19. A master device, comprising:
A first wireless communication module;
a first memory; and
A first processor in communication with the first memory and the first wireless communication module, respectively, the first processor for executing one or more computer programs stored in the first memory, the first processor, when executing the one or more computer programs, causing the host device to implement the method of any of claims 1-10.
20. A slave device, comprising:
A second wireless communication module;
A second memory; and
A second processor in communication with the second memory and the second wireless communication module, respectively, the second processor for executing one or more computer programs stored in the second memory, the second processor, when executing the one or more computer programs, causing the slave device to implement the method of any of claims 11-18.
21. A wireless transmission system, comprising:
the master device of claim 19;
the at least one slave device of claim 20, at least one of the slave devices being wirelessly connected with the master device.
22. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1-10 or the method of any one of claims 11-18.
CN202410101038.1A 2024-01-24 2024-01-24 Wireless connection method, master device, slave device and wireless transmission system Pending CN117939577A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410101038.1A CN117939577A (en) 2024-01-24 2024-01-24 Wireless connection method, master device, slave device and wireless transmission system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410101038.1A CN117939577A (en) 2024-01-24 2024-01-24 Wireless connection method, master device, slave device and wireless transmission system

Publications (1)

Publication Number Publication Date
CN117939577A true CN117939577A (en) 2024-04-26

Family

ID=90750624

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410101038.1A Pending CN117939577A (en) 2024-01-24 2024-01-24 Wireless connection method, master device, slave device and wireless transmission system

Country Status (1)

Country Link
CN (1) CN117939577A (en)

Similar Documents

Publication Publication Date Title
US9756582B2 (en) Broadcasting, and scanning for wireless communication
CN113395687B (en) Reconnection method, reconnection device, electronic equipment and storage medium
US10789180B2 (en) SPI-based data transmission method and device
US8958744B2 (en) Wireless communication apparatus operable in different connection attempt states based on detection of interference
CN111464993A (en) Double-ear Bluetooth headset pairing method and wireless headset for double-ear Bluetooth headset
CN113490218A (en) Pairing method, pairing device, Bluetooth remote controller, intelligent device and storage medium
CN114208234A (en) Method for supporting multilink in bluetooth network environment and electronic device thereof
US11950233B2 (en) Efficient techniques for resource selection assistance reporting for NR Rel-17 sidelink
CN104936211A (en) Wireless resource distribution method
CN112055315B (en) Bluetooth broadcast communication method, system and master device and slave device thereof
WO2022089313A1 (en) Communication processing method and apparatus, storage medium, chip and related device
CN110059514B (en) Data writing method, NFC tag, NFC device and storage medium
EP2014021B1 (en) Communication apparatus and control method, program, and storage medium thereof
CN114830699A (en) Method for establishing ISO link and BLE equipment
CN117939577A (en) Wireless connection method, master device, slave device and wireless transmission system
JP2022533632A (en) Device and its wireless communication method
KR20210116119A (en) Apparatus and method for performing communication
CN111405534A (en) Information transmission method, first terminal and computer storage medium
CN111465112A (en) Method and device for sending and processing access control signaling
CN113784430A (en) Self-organizing network mixed timing synchronization method and related equipment thereof
KR20220047162A (en) Apparatus and method for multi-link operation by access point with simultaneous transmit-receive constraints
CN112312329A (en) Communication method and system based on Bluetooth broadcast, and master device and slave device thereof
CN115085800B (en) Ground satellite equipment, satellite transit monitoring method and storage medium
CN111052846A (en) Electronic device performing listen-before-talk operation as part of radio communication and method thereof
US20230345524A1 (en) Prach for coverage enhancements

Legal Events

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