Disclosure of Invention
The embodiment of the invention provides a combination pairing method, a combination system and equipment, which can enable first equipment and second equipment to automatically complete combination pairing and are convenient for a user to use.
In order to achieve the purpose of the invention, the technical scheme of the embodiment of the invention is realized as follows:
the embodiment of the invention provides a method for combination pairing, which comprises the following steps:
when a second device is connected to a first device, the first device reads all channels and/or communication addresses;
the first device sets a first configuration according to all the read channels and/or communication addresses, wherein the first configuration comprises at least one of the following: a channel between the first device and the second device, a communication address of the first device, a communication address of the second device;
The first device sends the first configuration to the second device.
In an embodiment, the method further comprises:
and the first equipment informs the second equipment of modifying the channel and the communication address according to the first configuration, and the first equipment modifies the channel and the communication address according to the first configuration.
In an embodiment, the method further comprises:
the first device detects the interference strength of a frequency channel between the first device and the second device;
if the interference strength of the frequency channel between the first device and the second device is greater than or equal to a preset interference strength threshold, the first device selects the frequency channel with the interference strength less than the preset interference strength threshold as the frequency channel in the first configuration.
In an embodiment, the method further comprises:
the first device detecting whether a third device is connected to the first device;
when the third device is connected to the first device, the first device further sets a second configuration according to all the read channels and/or communication addresses, wherein the second configuration comprises at least one of the following:
a frequency channel between the first device and the third device, a frequency channel between the second device and the third device, a communication address of the first device, a communication address of the second device, a communication address of the third device;
The first device sends the second configuration to the third device.
In an embodiment, the method further comprises:
and the first equipment informs the second equipment and the third equipment of modifying the channel and the communication address according to the second configuration, and the first equipment modifies the channel and the communication address according to the second configuration.
In an embodiment, the method further comprises:
the first device also detects the interference strength of a frequency channel between the first device and the third device and/or between the second device and the third device;
if the interference strength of the frequency channel between the first device and the third device and/or between the second device and the third device is greater than or equal to a preset interference strength threshold, the first device selects the frequency channel with the interference strength less than the preset interference strength threshold as the frequency channel in the second configuration.
An embodiment of the present invention further provides a device, which is applied to a first device, and includes a processor and a memory, where: the processor is configured to execute a program of combined pairing stored in the memory to implement the steps of the method of combined pairing as described in any one of the above.
The embodiment of the invention also provides a method for combining and pairing, which comprises the following steps:
when a second device is connected to a first device, the second device receives a first configuration sent by the first device and replies a response to the first device, wherein the first configuration comprises at least one of the following: a channel between the first device and the second device, a communication address of the first device, a communication address of the second device;
and the second equipment receives the modification notice sent by the first equipment and modifies according to the first configuration.
In an embodiment, the method further comprises:
when a third device is connected to the first device, the third device receives a second configuration sent by the first device and replies a response to the first device, wherein the second configuration comprises at least one of the following: a frequency channel between the first device and the third device, a frequency channel between the second device and the third device, a communication address of the first device, a communication address of the second device, a communication address of the third device;
and the third equipment receives the modification notice sent by the first equipment and modifies according to the second configuration.
An embodiment of the present invention further provides a device, which is applied to a second device, and includes a processor and a memory, where: the processor is configured to execute the program for combinatorial pairing stored in the memory to implement the method of:
when a second device is connected to a first device, the second device receives a first configuration sent by the first device and replies a response to the first device, wherein the first configuration comprises at least one of the following: a channel between the first device and the second device, a communication address of the first device, a communication address of the second device;
and the second equipment receives the modification notice sent by the first equipment and modifies according to the first configuration.
An embodiment of the present invention further provides a device, which is applied to a third device, and includes a processor and a memory, where: the processor is configured to execute the program for combinatorial pairing stored in the memory to implement the method of:
when a third device is connected to the first device, the third device receives a second configuration sent by the first device and replies a response to the first device, wherein the second configuration comprises at least one of the following: a frequency channel between the first device and the third device, a frequency channel between the second device and the third device, a communication address of the first device, a communication address of the second device, a communication address of the third device;
And the third equipment receives the modification notice sent by the first equipment and modifies according to the second configuration.
The embodiment of the invention also provides equipment which is applied to the first equipment and comprises a reading module, a first setting module and a communication module, wherein:
the reading module is used for reading all channels and/or communication addresses when the second equipment is connected to the first equipment;
the first setting module is configured to set a first configuration according to all the read channels and/or communication addresses, where the first configuration includes at least one of: a channel between the first device and the second device, a communication address of the first device, a communication address of the second device;
the communication module is configured to send the first configuration to the second device.
In an embodiment, the first device further comprises a second setting module, wherein:
the second setting module is configured to set a second configuration according to all the read channels and/or communication addresses when a third device is connected to the first device, where the second configuration includes at least one of: a frequency channel between the first device and the third device, a frequency channel between the second device and the third device, a communication address of the first device, a communication address of the second device, a communication address of the third device;
The communication module is further configured to send the second configuration to the second device and/or the third device.
In an embodiment, the first device further comprises a modification module, wherein:
the communication module is further configured to notify the second device to modify a channel and a communication address according to a first configuration;
and the modifying module is used for modifying own channel and communication address according to the first configuration.
In an embodiment, the first device further comprises a modification module, wherein:
the communication module is further configured to notify the second device and/or the third device to modify a channel and a communication address according to a second configuration;
and the modifying module is used for modifying the own channel and communication address according to the second configuration.
An embodiment of the present invention further provides a combined system, including the first device as described in any one of the above, and further including a second device, where:
the second device is configured to receive the first configuration sent by the first device, and reply a received response to the first device; and receiving a modification notice sent by the first equipment, and modifying according to the first configuration.
In an embodiment, the combined system further comprises a third device, wherein:
The third device is configured to receive the second configuration sent by the first device, and reply a received response to the first device; and receiving a modification notice sent by the first equipment, and modifying according to the second configuration.
In an embodiment, the first device is a positioning base station, the second device is a helmet locator, and the third device is a left handle and/or a right handle;
the first device is further configured to determine that the third device is a left handle or a right handle according to the connection position of the third device.
The technical scheme of the embodiment of the invention has the following beneficial effects:
according to the combined pairing method, the combined system and the combined equipment provided by the embodiment of the invention, when the second equipment is connected to the first equipment, the first equipment automatically sets the channel and/or the communication address between the first equipment and the second equipment, so that the first equipment and the second equipment automatically complete combined pairing, and the use experience of a user is improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
Embodiments of a method for pairing a group, a first device and a storage medium
As shown in fig. 1, an embodiment of the present invention provides a method for pairing, including the following steps:
step 101: when a second device is connected to a first device, the first device reads all channels and/or communication addresses;
In an embodiment of the present invention, before thestep 101, the method further includes: the first device detecting whether the second device is connected to the first device;
in an embodiment of the present invention, a first interface is provided on the first device, a second interface is provided on the second device, and when the second interface is plugged into the first interface, the first device detects that the second device is connected to the first device through signal detection on the first interface.
In an example of this embodiment, the first interface and the second interface may perform communication, and the communication mode may be Serial communication, for example, may be a Universal Serial Bus (USB) Type-C interface. The USB Type-C interface is a firm and easy-to-use interface, supports positive and negative insertion, and is convenient and fast. The power amplifier supports ultrahigh-speed communication function and power output, the size is 8.3 millimeters by 2.5 millimeters, the maximum transmission rate is 10 gigabits per second (Gbits/s), the maximum output power is 100 watts (W), and the maximum current is 5 amperes (A). It may also be IIC (Inter-Integrated Circuit) communication, Serial Peripheral Interface (SPI) communication, etc., which are not required herein.
In an embodiment of the present invention, the first device is a positioning base station, and the second device is a helmet locator.
In an embodiment of the present invention, all the channels and/or communication addresses are stored on the second device or devices other than the second device, and include the communication address of the first device, the communication address of the second device, and the channel between the first device and the second device. In one example of this embodiment, the channels include a communication channel between the first device and the second device and a synchronization channel between the first device and the second device.
It should be noted that all the channels may be frequency bands which are opened and allowed to be used internationally, such as 2.4GHz ISM (Industrial Scientific Medical) and 5GHz ISM frequency bands; the communication Address may be an Internet Protocol (IP) Address.
The ISM band is mainly open to three major organizations of industry, science and medicine, and is defined by the Federal Communications Commission (FCC) in the united states, and belongs to Free License (Free License) without a limitation of so-called usage authorization. The ISM band is not uniform across countries, e.g. three bands 902-928MHz,2400-2483.5MHz and 5725-5850MHz in the United states, whereas the 900MHz band in Europe is partly used for GSM communication. 2.4GHz and 5GHz are common ISM frequency bands of various countries. Therefore, wireless networks such as wireless local area networks (WiFi), Bluetooth (Bluetooth) and ZigBee (ZigBee) can work in the frequency bands of 2.4GHz and 5 GHz.
In an embodiment of the present invention, each of the first interface of the first device and the second interface of the second device is provided with a sending pin, a receiving pin, and a busy pin, when the second interface is inserted into the first interface, the sending pin of the first interface is connected to the receiving pin of the second interface, the receiving pin of the first interface is connected to the sending pin of the second interface, and the busy pin of the first interface is connected to the busy pin of the second interface.
The busy pin of the first interface and the busy pin of the second interface are both set to be high level by default, when first equipment or second equipment needs to send data through the first interface or the second interface, whether the busy pin of the first interface or the second interface is high level is detected firstly, if the busy pin of the first interface or the second interface is low level, it indicates that other equipment is in communication at the moment, the equipment delays waiting; if the busy pin of the first interface or the second interface is in high level, the device sets the busy pin to be in low level, sends a message to other devices and sets the busy pin to be in high level after the message is sent.
Step 102: the first device sets a first configuration according to all the read channels and/or communication addresses, wherein the first configuration comprises at least one of the following: a frequency channel between the first device and the second device, a communication address of the first device, a communication address of the second device.
It should be noted that, when the first device reads only all channels, the first device sets a channel between the first device and the second device according to all the read channels, and the first device and the second device communicate using the set channel and a communication address of a default configuration or a communication address corresponding to the set channel;
when the first device only reads all communication addresses, the first device sets the communication address of the first device and the communication address of the second device according to all the read communication addresses, and the first device and the second device communicate by using the set communication addresses and a default configured frequency channel or a frequency channel corresponding to the set communication addresses;
when the first device reads all channels and communication addresses, the first device sets the channels between the first device and the second device, the communication addresses of the first device and the communication addresses of the second device according to all the read channels and communication addresses, and the first device and the second device communicate by using the set channels and communication addresses.
In an embodiment of the present invention, instep 102, the method further includes:
the first device detects the interference strength of a frequency channel between the first device and the second device;
if the interference strength of the frequency channel between the first device and the second device is greater than or equal to a preset interference strength threshold value, the first device selects the frequency channel with the interference strength less than the preset interference strength threshold value as the frequency channel in the first configuration.
Step 103: the first device sends the first configuration to the second device.
When the first device sends the first configuration to the second device, waiting for the second device to receive a response; if the response received by the second device is not received in the preset waiting time interval, the first device may send the first configuration to the second device M times, where M is a natural number.
And if the first equipment sends the first configuration to the second equipment M times again and the response received by the second equipment is not received in the waiting time interval after each sending, the frequency channels and the communication addresses of the first equipment and the second equipment continue to adopt the original frequency channels and communication addresses without any change according to the first configuration.
In an embodiment of the present invention, afterstep 103, the method further includes:
step 104: the first device notifies the second device to modify the channel and communication address.
In an embodiment of the present invention, when the first device sends the first configuration to the second device, after the first device receives a response from the second device, the first device notifies the second device of modifying a channel and a communication address, and waits for a feedback of successful modification of the second device; if the modification success feedback of the second device is not received in the preset waiting time interval, the first device may send the notification to the second device N times again, where N is a natural number. And if the first equipment sends the notice to the second equipment for N times again and the modification success feedback of the second equipment is not received in the waiting time interval after each sending, the frequency channels and the communication addresses of the first equipment and the second equipment continue to adopt the original frequency channels and communication addresses without any change according to the first configuration.
In an embodiment of the present invention, after the first device receives the feedback of successful modification of the second device, the first device modifies its own channel and communication address according to the first configuration.
In another embodiment of the present invention, when the first device sends the first configuration to the second device, after the first device receives a response from the second device, the first device notifies the second device to modify a channel and a communication address, and the first device also modifies the channel and the communication address according to the first configuration.
In another embodiment of the present invention, the all channels and/or communication addresses include a communication address of the first device, a communication address of the second device, a communication address of the third device, a channel between the first device and the second device, and a channel between the first device and the third device.
In an embodiment of the invention, the third device is a left handle and/or a right handle.
The second interface is also arranged on the third equipment, the second interface of the third equipment is the same as the second interface of the second equipment, and a sending pin, a receiving pin and a busy pin are still arranged on the third equipment.
The busy pin of the first interface and the busy pin of the second interface are both set to be high level by default, when any device needs to send data through the first interface or the second interface, whether the busy pin of the first interface or the second interface is high level is detected firstly, if the busy pin of the first interface or the second interface is low level, it indicates that other devices are in communication at the moment, and the device delays waiting; if the busy pin of the first interface or the second interface is in high level, the device sets the busy pin to be in low level, sends a message to other devices and sets the busy pin to be in high level after the message is sent.
In another embodiment of the present invention, the all channels and/or communication addresses further comprise: a channel between the second device and the third device.
It should be noted that, when playing VR game or watching VR video, each device (positioning base station, left handle, right handle) may only need to communicate with the helmet locator, and in this case, a channel between the second device (helmet locator) and the third device (left/right handle) may not be set.
In an embodiment of the invention, the method further comprises:
The first device detecting whether a third device is connected to the first device;
when a third device is connected to the first device, the first device further sets a second configuration according to all the read channels and/or communication addresses, wherein the second configuration comprises at least one of the following:
a frequency channel between the first device and the third device, a frequency channel between the second device and the third device, a communication address of the first device, a communication address of the second device, a communication address of the third device;
the first device sends the second configuration to the second device and/or the third device.
It should be noted that, when the second configuration includes only a frequency channel between the first device and the third device, the first device and the third device communicate using the set frequency channel and a communication address of a respective default configuration or a communication address corresponding to the set frequency channel;
when the second configuration only includes the communication address of the first device and the communication address of the third device, the first device and the third device communicate by using the set communication address and a frequency channel of a respective default configuration or a frequency channel corresponding to the set communication address;
When the second configuration comprises a frequency channel between the first device and the third device, a communication address of the first device and a communication address of the third device, the first device and the third device communicate by using the set frequency channel and communication address;
other cases are similar to this principle and will not be described here.
In an example of this embodiment, the method further comprises:
the first device also detects the interference strength of a frequency channel between the first device and the third device and/or between the second device and the third device;
and if the interference strength of the frequency channel between the first device and the third device and/or between the second device and the third device is greater than or equal to a preset interference strength threshold value, the first device selects the frequency channel with the interference strength less than the preset interference strength threshold value as the frequency channel in the second configuration.
When the first device sends the second configuration to the second device and/or the third device, waiting for a response received by the second device and/or the third device; if the received response of the second device and/or the third device is not received in a preset waiting time interval, the first device may send the second configuration to the second device and/or the third device M times, where M is a natural number.
And if the first equipment sends the second configuration to the second equipment and/or the third equipment for M times and the received response of the second equipment and/or the third equipment is not received in the waiting time interval after each sending, the frequency channels and the communication addresses of the first equipment, the second equipment and the third equipment continue to adopt the original frequency channels and communication addresses without any change according to the second configuration.
In an embodiment of the present invention, after the first device receives a response from the second device and/or the third device, the first device notifies the second device and/or the third device to modify a channel and a communication address according to the second configuration.
In an embodiment of the present invention, the first device sends the second configuration to the second device and/or the third device, and when the first device receives a response from the second device and/or the third device, the first device notifies the second device and/or the third device to modify a channel and a communication address according to the second configuration, and waits for a feedback that the modification of the second device and/or the third device is successful; if the modification success feedback of the second device and/or the third device is not received in a preset waiting time interval, the first device may send N times of modification notifications to the second device and/or the third device, where N is a natural number. And if the first equipment sends the modification notice to the second equipment and/or the third equipment for N times again and the modification success feedback of the second equipment and/or the third equipment is not received in the waiting time interval after each sending, the frequency channels and the communication addresses of the first equipment, the second equipment and the third equipment continue to adopt the original frequency channels and communication addresses without any change according to the second configuration.
In an embodiment of the present invention, after the first device receives the feedback of the successful modification of the second device and the third device, the first device modifies its own channel and communication address according to the first configuration and the second configuration.
In another embodiment of the present invention, when the first device sends the second configuration to the second device and/or the third device, after the first device receives a response from the second device and/or the third device, the first device notifies the second device and/or the third device to modify a channel and a communication address according to the second configuration, and the first device itself also directly modifies its channel and communication address according to the second configuration.
In an example of this embodiment, the method further comprises:
the first device sets a new communication address of the second device and/or the third device according to a pre-established corresponding relation between the channel and the communication address and the selected new channel between the first device and the third device and/or between the second device and the third device; and sending an instruction to modify a communication address of the second device and/or the third device to the second device and/or the third device.
The embodiment of the invention can reduce the interference between the frequency channels by establishing the corresponding relation between the frequency channels and the communication addresses, and can simultaneously reduce the possibility of the conflict between the communication addresses.
An embodiment of the present invention further provides a device, which is applied to a first device, and includes a processor and a memory, where: the processor is configured to execute a program of combined pairing stored in the memory to implement the steps of the method of combined pairing as described in any one of the above.
Embodiments of the present invention also provide a storage medium storing one or more programs, which are executable by one or more processors to implement the steps of the method for combined pairing as described in any one of the above.
Example two first apparatus
As shown in fig. 2, an embodiment of the present invention further provides a device, which is applied to a first device, and includes areading module 201, afirst setting module 202, and acommunication module 203, where:
thereading module 201 is configured to read all channels and/or communication addresses when a second device is connected to the first device;
thefirst setting module 202 is configured to set a first configuration according to all the read channels and/or communication addresses, where the first configuration includes at least one of: a channel between the first device and the second device, a communication address of the first device, a communication address of the second device;
Thecommunication module 203 is configured to send the first configuration to the second device.
In an embodiment of the present invention, a first interface is disposed on the first device, a second interface is disposed on the second device, and when the second interface is plugged into the first interface, thereading module 201 detects that the second device is connected to the first device through signal detection on the first interface.
In an example of this embodiment, the first interface and the second interface may perform communication, and the communication mode may be serial port communication, for example, a USB Type-C interface, and may also be IIC communication, SPI communication, and the like, which is not required here.
In an embodiment of the present invention, the first device is a positioning base station, and the second device is a helmet locator.
In an embodiment of the present invention, all the channels and/or communication addresses are stored on the second device or devices other than the second device, and include the communication address of the first device, the communication address of the second device, and the channel between the first device and the second device. In one example of this embodiment, the channels include a communication channel between the first device and the second device and a synchronization channel between the first device and the second device.
It should be noted that, all the channels may be in 2.4GHz and 5GHz ISM bands; the communication address may be an IP address.
In an embodiment of the present invention, each of the first interface of the first device and the second interface of the second device is provided with a sending pin, a receiving pin, and a busy pin, when the second interface is inserted into the first interface, the sending pin of the first interface is connected to the receiving pin of the second interface, the receiving pin of the first interface is connected to the sending pin of the second interface, and the busy pin of the first interface is connected to the busy pin of the second interface.
The busy pin of the first interface and the busy pin of the second interface are both set to be high level by default, when first equipment or second equipment needs to send data through the first interface or the second interface, whether the busy pin of the first interface or the second interface is high level is detected firstly, if the busy pin of the first interface or the second interface is low level, it indicates that other equipment is in communication at the moment, the equipment delays waiting; if the busy pin of the first interface or the second interface is in high level, the device sets the busy pin to be in low level, sends a message to other devices and sets the busy pin to be in high level after the message is sent.
It should be noted that, when thereading module 201 reads only all channels, thefirst setting module 202 sets a channel between the first device and the second device according to all the read channels, and the first device and the second device communicate using the set channel and a communication address configured by default or a communication address corresponding to the set channel;
when thereading module 201 reads only all communication addresses, thefirst setting module 202 sets a communication address of the first device and a communication address of the second device according to all the read communication addresses, and the first device and the second device communicate using the set communication addresses and a default configured frequency channel or a frequency channel corresponding to the set communication addresses;
when thereading module 201 reads all channels and communication addresses, thefirst setting module 202 sets a channel between the first device and the second device, a communication address of the first device, and a communication address of the second device according to all the read channels and communication addresses, and the first device and the second device communicate using the set channels and communication addresses.
After receiving the first configuration sent by thecommunication module 203, the second device replies with a received response to the first device.
When thecommunication module 203 sends the first configuration to the second device, it waits for a response received by the second device; if the received response of the second device is not received in a preset waiting time interval, thecommunication module 203 may send the first configuration to the second device M times, where M is a natural number.
If thecommunication module 203 sends the first configuration to the second device M times again and no response is received from the second device in the waiting time interval after each sending, the channel and communication address of the first device and the second device continue to use the original channel and communication address without any change according to the first configuration.
In an embodiment of the present invention, as shown in fig. 3, the first device further includes aninterference detection module 204, where:
theinterference detection module 204 is configured to detect an interference strength of a frequency channel between the first device and the second device; and if the interference strength of the frequency channel between the first device and the second device is greater than or equal to a preset interference strength threshold value, selecting the frequency channel with the interference strength less than the preset interference strength threshold value as the frequency channel in the first configuration.
In an embodiment of the present invention, after receiving the received response of the second device, thecommunication module 203 is further configured to: notifying the second device to modify the channel and the communication address.
It should be noted that, if thecommunication module 203 does not receive the feedback of successful modification of the second device in a preset waiting time interval after sending the modification notification to the second device, thecommunication module 203 may send a notification of modifying the channel and the communication address to the second device N times again, where N is a natural number.
If thecommunication module 203 does not receive the successful modification feedback of the second device in the waiting time interval after each transmission after transmitting the modification notification N times to the second device again, the channels and the communication addresses of the first device and the second device continue to use the original channels and communication addresses without any change according to the first configuration.
In another embodiment of the present invention, the first device further includes amodification module 206, when thecommunication module 203 sends the first configuration to the second device, and after thecommunication module 203 receives a response received from the second device, thecommunication module 203 notifies the second device to modify the channel and the communication address, and themodification module 206 of the first device modifies the channel and the communication address directly according to the first configuration.
In an example of this embodiment, thefirst setting module 202 is further configured to set a new communication address of the first device and/or the second device according to a pre-established correspondence between the frequency channel and the communication address and the selected new frequency channel between the first device and the second device; and sending an instruction to the second device to modify a communication address of the first device and/or the second device.
The embodiment of the invention can reduce the interference between the frequency channels by establishing the corresponding relation between the frequency channels and the communication addresses, and can simultaneously reduce the possibility of the conflict between the communication addresses.
In another embodiment of the present invention, the all channels and/or communication addresses include a communication address of the first device, a communication address of the second device, a communication address of the third device, a channel between the first device and the second device, and a channel between the first device and the third device.
In an embodiment of the invention, the third device is a left handle and/or a right handle.
The third device is also provided with the second interface, the second interface of the third device is the same as the second interface of the second device, and is still provided with a sending pin, a receiving pin and a busy pin, when the second interface of the third device is inserted into the first interface of the first device, the sending pin of the first interface is connected with the receiving pin of the second interface, the receiving pin of the first interface is connected with the sending pin of the second interface, and the busy pin of the first interface is connected with the busy pin of the second interface.
The busy pin of the first interface and the busy pin of the second interface are both set to be high level by default, when any device needs to send data through the first interface or the second interface, whether the busy pin of the first interface or the second interface is high level is detected firstly, if the busy pin of the first interface or the second interface is low level, it indicates that other devices are in communication at the moment, and the device delays waiting; if the busy pin of the first interface or the second interface is in high level, the device sets the busy pin to be in low level, sends a message to other devices and sets the busy pin to be in high level after the message is sent.
In another embodiment of the present invention, the all channels and/or communication addresses further comprise: a channel between the second device and the third device.
It should be noted that, when playing VR game or watching VR video, each device (positioning base station, left handle, and right handle) may only need to communicate with the helmet locator, and in this case, a channel between the second device (helmet locator) and the third device (left and right handles) may not be set.
In an embodiment of the present invention, as shown in fig. 3, the first device further includes asecond setting module 205, where:
Thesecond setting module 205 is configured to set a second configuration according to all the read channels and/or communication addresses when a third device is connected to the first device, where the second configuration includes at least one of: a frequency channel between the first device and the third device, a frequency channel between the second device and the third device, a communication address of the first device, a communication address of the second device, a communication address of the third device;
thecommunication module 203 is further configured to send the second configuration to the second device and/or the third device.
It should be noted that, when the second configuration includes only a frequency channel between the first device and the third device, the first device and the third device communicate using the set frequency channel and a communication address of a default configuration or a communication address corresponding to the set frequency channel;
when the second configuration only comprises the communication address of the first device and the communication address of the third device, the first device and the third device communicate by using the set communication addresses and the frequency channels of the respective default configurations or the frequency channels corresponding to the set communication addresses;
When the second configuration includes a frequency channel between the first device and the third device, a communication address of the first device, and a communication address of the third device, the first device and the third device communicate using the set frequency channel and communication address;
other cases are similar to this principle and will not be described here.
In an embodiment of the present invention, theinterference detecting module 204 is further configured to detect an interference strength of a frequency channel between the first device and the third device and/or between the second device and the third device;
and if the interference strength of the frequency channel between the first device and the third device and/or the second device and the third device is greater than or equal to a preset interference strength threshold value, selecting the frequency channel with the interference strength less than the preset interference strength threshold value as the frequency channel in the second configuration.
It should be noted that, if thecommunication module 203 sends the second configuration to the second device and/or the third device and does not receive a response received by the second device and/or the third device within a preset waiting time interval, thecommunication module 203 may send the second configuration to the second device and/or the third device M times, where M is a natural number.
If thecommunication module 203 sends the second configuration to the second device and/or the third device M times again, and no response received by the second device and/or the third device is received in the waiting time interval after each sending, the channel and the communication address of the first device and the second device, and/or the channel and the communication address of the first device and the third device continue to use the original channel and communication address without any change according to the second configuration.
If thecommunication module 203 receives a response from the second device and/or the third device in a preset waiting time interval, thecommunication module 203 notifies the second device and/or the third device to modify the channel and the communication address, and waits for a successful modification feedback of the second device and/or the third device.
If the modification success feedback of the second device and/or the third device is not received in a preset waiting time interval, thecommunication module 203 may send N times of modification notifications to the second device and/or the third device, where N is a natural number. If thecommunication module 203 sends N times of modification notifications to the second device and/or the third device, and no modification success feedback of the second device and/or the third device is received in the waiting time interval after each sending, the frequency channels and the communication addresses of the first device, the second device, and the third device continue to use the original frequency channels and communication addresses without any change according to the second configuration.
In an embodiment of the present invention, as shown in fig. 3, the first device further includes a modifyingmodule 206, and after thecommunication module 203 receives the feedback of successful modification of the second device and the third device, the modifyingmodule 206 modifies its own channel and communication address according to the first configuration and the second configuration.
In another embodiment of the present invention, when thecommunication module 203 sends the second configuration to the second device and/or the third device, after thecommunication module 203 receives a response from the second device and/or the third device, thecommunication module 203 notifies the second device and/or the third device to modify a channel and a communication address according to the second configuration, and themodification module 206 directly modifies its channel and communication address according to the second configuration.
In an embodiment of the present invention, thesecond setting module 205 is further configured to set a new communication address of the second device and/or the third device according to a pre-established correspondence between the frequency channel and the communication address and the selected new frequency channel between the first device and the third device and/or between the second device and the third device.
The embodiment of the invention can reduce the interference between the frequency channels by establishing the corresponding relation between the frequency channels and the communication addresses, and can simultaneously reduce the possibility of the conflict between the communication addresses.
Embodiment three method for combined pairing, second device and third device
The embodiment of the invention also provides a method for combining and pairing, which comprises the following steps:
when a second device is connected to a first device, the second device receives a first configuration sent by the first device and replies a response to the first device, wherein the first configuration comprises at least one of the following: a channel between the first device and the second device, a communication address of the first device, a communication address of the second device;
and the second equipment receives the modification notice sent by the first equipment and modifies according to the first configuration.
An embodiment of the present invention further provides a device, which is applied to a second device, and includes a processor and a memory, where: the processor is configured to execute a program of combined pairing stored in the memory to implement the steps of the method of combined pairing as described in any one of the above.
Embodiments of the present invention also provide a storage medium storing one or more programs, which are executable by one or more processors to implement the steps of the method for combined pairing as described in any one of the above.
The embodiment of the invention also provides a method for combining and pairing, which comprises the following steps:
when a third device is connected to the first device, the third device receives a second configuration sent by the first device and replies a response to the first device, wherein the second configuration comprises at least one of the following: a frequency channel between the first device and the third device, a frequency channel between the second device and the third device, a communication address of the first device, a communication address of the second device, a communication address of the third device;
and the third equipment receives the modification notice sent by the first equipment and modifies according to the second configuration.
An embodiment of the present invention further provides a device, which is applied to a third device, and includes a processor and a memory, where: the processor is configured to execute a program of combined pairing stored in the memory to implement the steps of the method of combined pairing as described in any one of the above.
Embodiments of the present invention also provide a storage medium storing one or more programs, which are executable by one or more processors to implement the steps of the method for combined pairing as described in any one of the above.
Example four-combination System
As shown in fig. 4, an embodiment of the present invention further provides a combinedsystem 40, which includes afirst device 401, where the structure of thefirst device 401 is as described in any one of the second embodiments, and the combinedsystem 40 further includes asecond device 402, where:
thesecond device 402 is configured to receive the first configuration sent by thefirst device 401, and reply to thefirst device 401 with a received response; and receiving a modification notification sent by thefirst device 401, and modifying according to the first configuration.
In an embodiment of the present invention, thesecond device 402 is further configured to receive the second configuration sent by thefirst device 401, and reply to thefirst device 401 with a received response; and receiving a modification notification sent by thefirst device 401, and modifying according to the second configuration.
In an embodiment of the present invention, thesecond device 402 is further configured to send a modification success feedback to thefirst device 401 after the modification is successful.
Thesecond device 402 may reply with a response to thefirst device 401 after receiving the first configuration and/or the second configuration sent by thefirst device 401; thefirst device 401 sends a modification notification to thesecond device 402, thesecond device 402 modifies the corresponding configuration according to the first configuration and/or the second configuration, and replies a modification success feedback to thefirst device 401, after receiving the modification success feedback, thefirst device 401 modifies the corresponding configuration according to the first configuration and/or the second configuration, and thefirst device 401 and thesecond device 402, and/or thesecond device 402 and the third device complete the combined pairing.
In an embodiment of the present invention, as shown in fig. 5, the combinedsystem 40 further comprises athird device 403, wherein:
thethird device 403 is configured to receive the second configuration sent by thefirst device 401, and reply with a received response to thefirst device 401; and receiving a modification notice sent by the first equipment, and modifying according to the second configuration.
In an embodiment of the present invention, thethird device 403 is further configured to send a modification success feedback to thefirst device 401 after the modification is successful.
Thethird device 403 may reply with a response to thefirst device 401 after receiving the second configuration sent by thefirst device 401; thefirst device 401 sends a modification notification to thethird device 403, thethird device 403 modifies the corresponding configuration according to the second configuration and replies a modification success feedback to thefirst device 401, after receiving the modification success feedback, thefirst device 401 modifies the corresponding configuration according to the second configuration, and thefirst device 401 and thethird device 402 complete the combined pairing.
In an embodiment of the present invention, as shown in fig. 6, thefirst device 401 is a positioning base station, thesecond device 402 is a helmet locator, and thethird device 403 is a left handle and/or a right handle;
Thefirst device 401 is further configured to determine that thethird device 403 is a left handle or a right handle according to the connection position of thethird device 403.
In an embodiment of the present invention, a first interface is disposed on thefirst device 401, a second interface is disposed on thesecond device 402 and thethird device 403, and the first interface and the second interface are each provided with a sending pin, a receiving pin, and a busy pin, as shown in fig. 7, when the second device and/or the third device is inserted into the first device, the sending pin of the first interface is connected to one or more receiving pins of the second interface, the receiving pin of the first interface is connected to one or more sending pins of the second interface, and the busy pin of the first interface is connected to one or more busy pins of the second interface.
The busy pin of the first interface and the busy pin of the second interface are both set to be high level by default, when any device needs to send data through the first interface or the second interface, whether the busy pin of the first interface or the second interface is high level is detected firstly, if the busy pin of the first interface or the second interface is low level, it indicates that other devices are in communication at the moment, and the device delays waiting; if the busy pin of the first interface or the second interface is in high level, the device sets the busy pin to be in low level, sends a message to other devices and sets the busy pin to be in high level after the message is sent.
It will be understood by those skilled in the art that all or part of the steps of the above methods may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, such as a read-only memory, a magnetic or optical disk, and the like. Alternatively, all or part of the steps of the foregoing embodiments may also be implemented by using one or more integrated circuits, and accordingly, each module/unit in the foregoing embodiments may be implemented in the form of hardware, and may also be implemented in the form of a software functional module. The present invention is not limited to any specific form of combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.