CN116132963A - Neighbor discovery method and electronic device - Google Patents
Neighbor discovery method and electronic device Download PDFInfo
- Publication number
- CN116132963A CN116132963A CN202111343116.1A CN202111343116A CN116132963A CN 116132963 A CN116132963 A CN 116132963A CN 202111343116 A CN202111343116 A CN 202111343116A CN 116132963 A CN116132963 A CN 116132963A
- Authority
- CN
- China
- Prior art keywords
- electronic device
- broadcast
- electronic
- group
- time
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W8/00—Network data management
- H04W8/005—Discovery of network devices, e.g. terminals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W8/00—Network data management
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Multimedia (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
A neighbor discovery method and an electronic device are provided, the method comprising: the first electronic device scans a first broadcast channel for a scan period, the first broadcast channel being any one of a predefined plurality of broadcast channels, at least two broadcast channels having broadcast messages transmitted thereon in each broadcast period; establishing a connection with a second electronic device based on a first broadcast message received from the second electronic device over a first broadcast channel; a first neighbor description table is obtained from the second electronic device, the first neighbor description table including device information for each electronic device in the first device group. Therefore, the first electronic device scans any one of the broadcast channels, and can find one of the electronic devices in the device group, so that all the electronic devices in the device group can be found, the probability that the electronic devices to be added successfully scan surrounding electronic devices is improved, the probabilistic delay of finding the surrounding electronic devices is shortened, and the user experience is improved.
Description
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a neighbor discovery method and an electronic device.
Background
With the rapid development of the internet, applications of wireless communication based on proximity are attracting attention. For electronic devices supporting wireless communication, neighbor discovery based on a neighbor discovery protocol (neighbor discovery protocol, NDP) is required to establish a connection further. For example, the bluetooth-based device scanning process is a neighbor discovery process.
Currently, neighbor discovery may be achieved by point-to-point scanning. The point-to-point scanning process is specifically as follows: the electronic device (denoted as electronic device # 1 for convenience of distinction and explanation) may transmit broadcast messages through different broadcast channels in different broadcast periods, and the other electronic device (denoted as electronic device #2 for convenience of distinction and explanation) randomly selects one broadcast channel for scanning in a scanning period, then scans another broadcast channel in a next scanning period, and only if the electronic device # 1 transmits a broadcast message on a certain broadcast channel, the electronic device #2 scans the broadcast channel, and the electronic device # 1 can be discovered. Thus, there is a probabilistic delay.
However, in some cases, there may be a need for one electronic device to scan for multiple electronic devices. For example, if a user's mobile phone needs to establish a connection with a plurality of other electronic devices in the home, the mobile phone needs to scan the plurality of electronic devices one by using a point-to-point scanning manner, so as to establish a connection with the plurality of electronic devices. There is a probabilistic delay due to the discovery of each electronic device. When the number of scanned electronic devices increases, the probabilistic delay also increases exponentially, resulting in longer time consumption and higher time delay in the whole discovery process, which further affects the user experience.
Disclosure of Invention
The application provides a neighbor discovery method and electronic equipment, so that probabilistic delay of the electronic equipment for discovering surrounding electronic equipment can be reduced, the duration of the whole discovery process is shortened, and user experience is further improved.
In a first aspect, the present application provides a neighbor discovery method, where the method may be performed by a first electronic device, or may also be performed by a component (such as a chip, a chip system, etc.) configured in the first electronic device, or may also be implemented by a logic module or software that can implement all or part of the functions of the first electronic device, where the application is not limited to this.
Illustratively, the method includes: the first electronic device scanning a first broadcast channel within a scan period, the first broadcast channel being any one of a predefined plurality of broadcast channels, in each of at least one broadcast period, at least two broadcast channels having broadcast messages transmitted thereon, the broadcast messages from electronic devices in the first device group; the first electronic device establishes connection with a second electronic device based on a first broadcast message sent by the second electronic device and received on a first broadcast channel, wherein the second electronic device is an electronic device in a first device group; the first electronic device obtains a first neighbor description table from the second electronic device, the first neighbor description table including device information for each electronic device in the first device group.
It is understood that the first electronic device receives the first broadcast message sent by the second electronic device, which indicates that at least one broadcast period overlaps the scanning period of the first electronic device in the time domain. In other words, in case that at least one broadcast period overlaps in time domain with a scanning period of the first electronic device, the first electronic device may scan for the first broadcast message transmitted by the second electronic device during the scanning period.
Based on the technical scheme, the electronic devices in the same device group can send broadcast messages through different broadcast channels in the same broadcast period, so that the electronic device to be added can scan any one of the broadcast channels and can find one of the electronic devices in the device group. And the neighbor description table comprising the device information of all the electronic devices in the device group is shared to all the electronic devices in the device group, so that the electronic devices to be added can find all the electronic devices in the device group after any one of the electronic devices in the device group is found. Therefore, the probability of successful scanning of the surrounding electronic devices by the electronic devices to be added is improved, the probabilistic delay of finding the surrounding electronic devices is shortened, and the duration of the neighbor finding process of the electronic devices to be added is reduced. Moreover, the greater the number of electronic devices in the device group, the more remarkable the effect of this solution. Because the more electronic devices, the lower the probability of successful point-to-point single device scanning, the greater the probabilistic delay that may be incurred. However, if the scheme is used, any node in the equipment group can be discovered quickly, the neighbor discovery time delay is obviously reduced, and the user experience is improved.
With reference to the first aspect, in a possible implementation manner of the first aspect, a number of electronic devices that transmit broadcast messages on a plurality of broadcast channels in each broadcast period is not greater than a number of the plurality of broadcast channels.
The plurality of electronic devices in the first device group send broadcast messages in a staggered manner, and the number of the electronic devices sending the broadcast messages on the plurality of broadcast channels in each broadcast period is not greater than the number of the plurality of broadcast channels, in other words, the plurality of electronic devices send the broadcast messages on different broadcast channels at the same time, so that the plurality of electronic devices are prevented from sending the broadcast messages on the same channel and generating resource collision.
With reference to the first aspect, in a possible implementation manner of the first aspect, the method further includes: the first electronic device updates a first neighbor description table based on local device information to obtain a second neighbor description table; the second neighbor description table includes device information for each electronic device in a second device group that includes the first electronic device and the electronic devices in the first device group.
After the first electronic device receives the first neighbor description table, the device information of the first electronic device is added into the first neighbor description table to form a second neighbor description table, in other words, the device information of the first electronic device is included in the second neighbor description table besides the device information of the electronic device in the first device group, so that the device information of the first electronic device can be obtained by other electronic devices in the device group, and information sharing is achieved. From the perspective of the equipment group, the first electronic equipment joins the first equipment group to form a second equipment group, and the second equipment group comprises all the electronic equipment of the first equipment group and the first electronic equipment, so that the electronic equipment in the second equipment group can be connected with any one of the electronic equipment in the second equipment group based on the second neighbor description table, the connection speed is increased, and the user experience is improved.
With reference to the first aspect, in a possible implementation manner of the first aspect, the device information includes: an Identification (ID) of the device, a broadcast channel of the device, and a broadcast time of the device, wherein the broadcast time of the device is used to indicate a time when the electronic device last transmitted the broadcast message.
The device information may include device information required for establishing connection between the electronic devices, for example, an ID of the device, a broadcast channel of the device, and a broadcast time of the device, so that the electronic devices in the device group do not need to perform a neighbor discovery process again, and quick connection may be implemented based on the device information, thereby improving user experience.
Optionally, the device information further includes one or more of: an ID of the device group, a number of electronic devices in the device group, a link quality parameter, a time stamp, and an aging time, wherein the link quality parameter is used to indicate a link quality.
The device information may further include related information for maintaining a neighbor description table, for example, a time stamp for indicating an update time of the device information of the electronic device; the aging time is used to determine whether the electronic device leaves the device group, and may be an absolute time, such as 9:15, or an interval time, such as 3 minutes, which is not limited in this application. By maintaining the neighbor description table, the electronic devices in the device group can be guaranteed to be all connectable electronic devices, and the situation that a certain electronic device leaves the device group is avoided, but because another electronic device can inquire the device information of the electronic device based on the neighbor description table, the electronic device is connected with the electronic device, but the connection cannot be successful is avoided.
With reference to the first aspect, in a possible implementation manner of the first aspect, the method further includes: the first electronic device establishes connection with a third electronic device based on device information of the third electronic device, wherein the third electronic device is an electronic device which the first electronic device in the first device group wants to establish connection with, and the third electronic device is any electronic device in the first device group.
After the first electronic device joins the first device group, connection can be established with any one electronic device in the device group, if the first electronic device wishes to establish connection with the third electronic device, the first electronic device can query device information of the third electronic device based on the first neighbor description table, establish connection with the third electronic device based on the device information, and no need to perform a process of discovering the third electronic device again, thereby shortening time for establishing connection and improving user experience.
In a second aspect, the present application provides an electronic device, where the method in the first aspect and any possible implementation manner of the first aspect may be implemented. The electronic device comprises corresponding units for performing the above-described methods. The units comprised by the device may be implemented in software and/or hardware.
In a third aspect, the present application provides an electronic device comprising a processor. The processor is coupled to the memory and operable to execute a computer program in the memory to implement the method of neighbor discovery of the first aspect and any one of the possible implementations of the first aspect.
Optionally, the electronic device further comprises a memory.
Optionally, the electronic device further comprises a communication interface, and the processor is coupled to the communication interface.
In a fourth aspect, the present application provides a computer readable storage medium having stored therein a computer program or instructions which, when executed, implement the neighbor discovery method of the first aspect and any one of the possible implementations of the first aspect.
In a fifth aspect, the present application provides a computer program product comprising instructions which, when executed, implement the neighbor discovery method of the first aspect and any one of the possible implementations of the first aspect.
In a sixth aspect, the present application provides a chip system, where the chip system includes a processor and may further include a memory, where the processor is configured to implement the neighbor discovery method in the first aspect and any one of possible implementations of the first aspect. The chip system may be formed of a chip or may include a chip and other discrete devices.
It should be understood that, the second aspect to the sixth aspect of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects obtained by each aspect and the corresponding possible embodiments are similar, and are not repeated.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a network architecture suitable for use in a communication system of an embodiment of the present application;
fig. 3 is a schematic diagram of a scanning process of finding an intelligent sound box by mobile phone scanning according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of a neighbor discovery method provided by an embodiment of the application;
FIG. 5 is a schematic diagram of device information provided by an embodiment of the present application;
FIG. 6 is yet another schematic flow chart diagram of a neighbor discovery method provided by an embodiment of the application;
fig. 7 is a schematic diagram of a first electronic device scanning discovery of a first device group according to an embodiment of the present application.
Detailed Description
The technical solutions in the present application will be described below with reference to the accompanying drawings.
In order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second", and the like are used to distinguish the same item or similar items having substantially the same function and effect. For example, the first electronic device and the second electronic device are for distinguishing different electronic devices, and the sequence of the first electronic device and the second electronic device is not limited. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In the present embodiment, "plurality" means two or more. "one or more of the following" or similar expressions thereof, refers to any combination of these items, including any combination of single or plural items. For example, one or more of a, b, or c may represent: a, b, c; a and b; a and c; b and c; or a and b and c.
It should be understood that the electronic device described in the present application refers to an electronic device having a bluetooth function. For example, the electronic device with bluetooth function in the present application may be: cell phone, tablet computer, intelligent audio amplifier, bluetooth headset, wearable equipment etc..
The wearable device can also be called as a wearable intelligent device, and is a generic name for intelligently designing daily wearing and developing wearable devices by applying a wearable technology, such as a smart watch, a bracelet and the like. The wearable device is a portable device that is worn directly on the body or integrated into the clothing or accessories of the user. The wearable device is not only a hardware device, but also can realize a powerful function through software support, data interaction and cloud interaction. The generalized wearable intelligent device includes full functionality, large size, and may not rely on the smart phone to implement complete or partial functionality, such as: smart watches or smart glasses, etc., and focus on only certain types of application functions, and need to be used in combination with other devices, such as smart phones, for example, various smart bracelets, smart jewelry, etc. for physical sign monitoring.
Illustratively, fig. 1 shows a schematic structural diagram of an electronic device 100. As shown in fig. 1, the electronic device 100 may include a processor 110, a radio frequency unit 120, a power supply 130, a memory 140, an input unit 150, a display unit 160, a sensor 170, an audio circuit 180, a wireless fidelity (wireless fidelity, wi-Fi) module 190, and a bluetooth module 1100.
The processor 110 is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, and performs various functions of the electronic device and processes data by running or executing software programs and/or modules stored in the memory 140, and calling data stored in the memory 140, thereby performing overall monitoring of the electronic device. The processor 110 may include one or more processing units. Preferably, the processor 110 may integrate an application processor and a modem processor. Optionally, the application processor primarily handles operating systems, user interfaces, applications, etc., and the modem processor primarily handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The radio frequency unit 120 may be used for receiving and transmitting signals during the information receiving or communication process, specifically, receiving downlink information of the base station, and then processing the downlink information for the processor 110; and, the uplink data is transmitted to the base station. Typically, the radio frequency unit 120 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 120 may also communicate with networks and other devices via wireless communications. The wireless communications may use any communication standard or protocol including, but not limited to, global System for Mobile communications (global system of mobile communication, GSM), general packet radio service (general packet radio service, GPRS), code division multiple Access 2000 (code division multiple access, CDMA2000), wideband code division multiple Access (wideband code division multiple access, WCDMA), time division synchronous code division multiple Access (time division-synchronous code division multiple access, TD-SCDMA), frequency division Duplex Long term evolution (frequency division duplexing-long term evolution, FDD-LTE), time division Duplex Long term evolution (time division duplexing-long term evolution, TDD-LTE), and the like.
The power supply 130 (e.g., a battery) is used to power the various components, and preferably the power supply 130 may be logically connected to the processor 110 through a power management system, so as to perform functions of managing charging, discharging, and power consumption management through the power management system.
The memory 140 may be used to store software programs and modules that the processor 110 performs various functional applications and data processing of the electronic device by running the software programs and modules stored in the memory 140. The memory 140 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, a boot loader (boot loader), etc.; the storage data area may store data created according to the use of the electronic device (such as audio data, phonebooks, etc.), and the like. In addition, memory 140 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The input unit 150 may be used to receive input numeric or character information and to generate key signal inputs related to user settings and function controls of the electronic device. In particular, the input unit 150 may include a touch panel 1501 and other input devices 1502. The touch panel 1501, also referred to as a touch screen, may collect touch operations thereon or thereabout by a user (e.g., operations of the user on the touch panel 1501 or thereabout using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a predetermined program. Alternatively, touch panel 1501 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch azimuth of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into touch point coordinates, and sends the touch point coordinates to the processor 110, and can receive and execute commands sent from the processor 110. In addition, the touch panel may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. The input unit 150 may include other input devices 1502 in addition to the touch panel 1501. In particular, other input devices 1502 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, mouse, joystick, etc.
The display unit 160 may be used to display information input by a user or information provided to the user and various menus of the electronic device. The display unit 160 may include a display panel 1601, and alternatively, the display panel 1601 may be configured in the form of a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), or the like. Further, the touch panel 1501 may cover the display panel 1601, and when the touch panel 1501 detects a touch operation thereon or thereabout, the touch operation is transferred to the processor 110 to determine the type of touch event, and then the processor 110 provides a corresponding visual output on the display panel 1601 according to the type of touch event. Although in fig. 1, the touch panel 1501 and the display panel 1601 are two separate components to implement the input and input functions of the electronic device, in some embodiments, the touch panel 1501 may be integrated with the display panel 1601 to implement the input and output functions of the electronic device.
The electronic device 100 may also include at least one sensor 170, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 1601 according to the brightness of ambient light, and a proximity sensor that may turn off the display panel 1601 or the backlight when the electronic device is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the acceleration in all directions (typically three axes), and can detect the gravity and direction when stationary, and can be used for recognizing the gesture of the electronic equipment (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and knocking), and the like; other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc. that may also be configured with the electronic device are not described in detail herein.
The audio circuit 180 may transmit the received electrical signal converted from audio data to the speaker 1801, and convert the electrical signal into a sound signal by the speaker 1801 to output; on the other hand, the microphone 1802 converts the collected sound signals into electrical signals, which are received by the audio circuit 180 and converted into audio data, which are processed by the audio data output processor 110 for transmission to, for example, another electronic device via the radio frequency unit 120, or which are output to the memory 140 for further processing.
Wi-Fi belongs to a short-range wireless transmission technology, and the electronic device can help a user to send and receive e-mails, browse web pages, access streaming media and the like through the Wi-Fi module 190, so that wireless broadband internet access is provided for the user. Although fig. 1 shows Wi-Fi module 190, it is to be understood that it does not belong to the necessary constitution of the electronic device, and can be omitted entirely as required within the scope not changing the essence of the invention.
The bluetooth technology also belongs to a short-distance wireless transmission technology, and the electronic device can establish bluetooth connection with other electronic devices with bluetooth modules through the bluetooth module 1100, so that data transmission is performed based on a bluetooth communication link. The bluetooth module 1100 may be a bluetooth low energy (bluetooth low energy, BLE) module according to actual needs. It may be appreciated that in the embodiment of the present application, the electronic device includes a bluetooth module.
In the embodiment of the application, the electronic equipment discovers the other party through Bluetooth scanning, and then establishes connection with the other party to carry out service transmission. Therefore, the electronic device related to the embodiment of the application has a bluetooth function, in other words, the electronic device related to the embodiment of the application includes a bluetooth module.
It is to be understood that the structure illustrated herein does not constitute a specific limitation on the electronic device 100. In other embodiments, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
Fig. 2 is a network architecture diagram of a communication system 200 suitable for use in embodiments of the present application. As shown in fig. 2, the communication system 200 includes: an electronic device 210 and a device group 220, the device group 220 including electronic devices 2201 to 2203. The electronic devices 2201 to 2203 may be different types of electronic devices, including, but not limited to, a smart speaker, a tablet computer, a smart watch, and other electronic devices not shown in the drawings, such as a notebook computer, a smart television, and the like. The electronic device 210 may find any one electronic device in the device group 220 based on NDP scanning, and further establish a connection with the electronic device to perform service transmission. The electronic devices outside the device group 220, such as the electronic device 210 shown in the figure, may discover all the electronic devices in the device group 220 by scanning to discover any one of the electronic devices in the device group.
At present, the neighbor discovery may be implemented through point-to-point scanning, for example, in a home scenario, the electronic device 210 (such as a mobile phone) may discover other electronic devices in the home, such as a smart speaker, a television, and a tablet computer through bluetooth scanning, but the mobile phone needs to scan for the electronic devices one by one, display the electronic devices one by one on a mobile phone interface, and then select the electronic devices that are desired to be connected to connect.
Taking the case that the smart speaker is found by BLE scanning by the mobile phone as an example, the scanning process is described in detail with reference to fig. 3. It should be appreciated that a cell phone and a smart speaker are two possible examples of an electronic device.
As shown in fig. 3, the smart speakers sequentially transmit broadcast messages on different broadcast channels, e.g., channel 37, channel 38, and channel 39, during different broadcast periods, such as broadcast period # 1, broadcast period #2, and broadcast period #3, as shown. The plurality of broadcast channels are predefined broadcast channels used for transmitting broadcast messages in the neighbor discovery process, for example, may be a plurality of broadcast channels predefined by a protocol. The handset scans over one of its broadcast channels, such as channel 37, during its scan period; another broadcast channel, such as channel 38, is scanned during the next scan period. As can be seen from the figure, when the mobile phone starts scanning and scans on the channel 37, the smart speaker does not send a broadcast message on the channel, so the mobile phone cannot scan the smart speaker, and needs to wait for the next scanning period to continue scanning. The point-to-point scanning mode is not difficult to find, when the intelligent sound box is required to send a broadcast message on a certain broadcast channel, the mobile phone just scans on the same broadcast channel to find the other side, so that the probability that the mobile phone scans the intelligent sound box in one scanning period is lower, the intelligent sound box can be successfully scanned through a plurality of scanning periods, and the scanning process is longer. It can be thought that if a plurality of electronic devices exist in a home, the mobile phone needs to perform a scanning discovery process on all the electronic devices in the home one by one and display the electronic devices on the interface of the mobile phone one by one, so that the time spent in the scanning process is multiplied, and the user needs to wait for a long time to see all the available electronic devices nearby on the interface of the mobile phone, thereby affecting the user experience.
Therefore, the application provides a neighbor discovery method, which introduces the concept of a device group. One device group may include a plurality of electronic devices, and each electronic device in the same device group shares its own device information, so as to form a neighbor description table including the device information of each electronic device in the same device group. The electronic devices in the same device group can send broadcast messages through different broadcast channels in the same broadcast period, and the electronic device to be added can find one electronic device in the device group no matter which broadcast channel is scanned. According to the process, the electronic devices in the same device group send broadcast messages on different channels at the same time, so that the probability of successful scanning of the electronic devices to be added is improved, the time delay of the electronic devices to be added in the neighbor discovery process is reduced, the time for the electronic devices to be added to scan and discover surrounding electronic devices is shortened, and the user experience is improved.
The following describes in detail a neighbor discovery method provided in the embodiments of the present application with reference to the accompanying drawings.
It should be understood that, in order to facilitate distinguishing device groups in different cases, a device group formed by two electronic devices is hereinafter referred to as device group # 1. For example, the device group # 1 includes an electronic device # 1 and an electronic device #2. For example, each time an electronic device, such as electronic device #3, is added to device group # 1, a device group #2 may be formed. For each new device to the device group, the corresponding neighbor description table is updated.
For ease of understanding, the establishment procedure of the device group # 1 is first described below, and then a neighbor discovery method based on the established device group is described in detail. It should be understood that the established device group described herein may be device group # 1, or may be a new device group that has been updated one or more times based on device group # 1. The embodiments of the present application are not limited in this regard.
Fig. 4 is a schematic flowchart of a neighbor discovery method 400 provided in an embodiment of the application. The method 400 shown in fig. 4 may include S410 to S450, and a process of establishing the device group # 1 by the electronic device # 1 and the electronic device #2 will be described in detail below with reference to fig. 4.
S410, the electronic device # 1 transmits a broadcast message through a plurality of broadcast channels in a plurality of broadcast periods.
Wherein each broadcast period may occupy one time slot, and wherein the electronic device may transmit broadcast messages on a plurality of broadcast channels during the broadcast period. The plurality of broadcast channels are predefined broadcast channels for transmitting broadcast messages in the neighbor discovery process, and may be, for example, a plurality of broadcast channels predefined by a protocol. Note that the time interval between any two of the plurality of broadcast periods may be fixed, and the time interval between the broadcast period # 1 and the broadcast period #2 shown in fig. 3 is the same as the time interval between the broadcast period #2 and the broadcast period # 3. The time length of any two of the plurality of broadcast periods may be different, for example, the time length of each broadcast period is related to the length of the data portion in the broadcast message, and a different length of the data portion of the broadcast message may cause a different length of the broadcast period. Therefore, after time synchronization between the electronic devices, the start time of the electronic device # 1 transmitting the broadcast message can be fixed, that is, the time interval between any two broadcast periods is the same. For example, the electronic device # 1 transmits the broadcast message on different broadcast channels at regular intervals, i.e., the electronic device # 1 may transmit the broadcast message on different broadcast channels at different broadcast periods, with the time interval between any two of the different broadcast periods being the same.
For example, as shown in fig. 3, an electronic device #1 (e.g., a smart speaker in fig. 3) transmits a broadcast message on channel 37 during broadcast period # 1, transmits a broadcast message on channel 38 during broadcast period #2, and transmits a broadcast message on channel 39 during broadcast period # 3.
S420, the electronic device #2 randomly selects one broadcast channel for scanning in a scanning period.
As is clear from S410, the electronic device # 1 transmits broadcast messages through a plurality of broadcast channels, and in the embodiment shown in fig. 4, the broadcast message transmitted by the electronic device # 1 is denoted as a second broadcast message. The electronic device #2 may randomly select one broadcast channel from among a plurality of broadcast channels to scan. Such as the broadcast channel shown in fig. 3, the electronic device #2 selects the channel 37 for scanning during a scanning period, it should be understood that fig. 3 only shows one scanning period, but should not constitute any limitation on this embodiment, fig. 3 may also include multiple scanning periods, and the electronic device #2 may select the channel 38 for scanning during the next scanning period.
It should be understood that the broadcast message is sent by the electronic device # 1, and the broadcast channel is scanned by the electronic device #2, which is described above, but the embodiment of the present application should not be limited in any way. For example, electronic device # 1 scans a broadcast channel and electronic device #2 transmits a broadcast message. That is, in the process of two electronic devices establishing a device group, the electronic device transmitting the broadcast message and the electronic device scanning the broadcast channel are random. In an example, the intelligent speaker # 1 sends a broadcast message, the intelligent speaker #2 scans the broadcast channel to discover the other party and establish the device group, or the intelligent speaker # 1 scans the broadcast channel, the intelligent speaker #2 sends a broadcast message, which is not limited in this embodiment of the present application.
S430, the electronic device #2 receives the broadcast message from the electronic device # 1.
The electronic device #2 randomly selects one broadcast channel to scan, and receives a broadcast message from the electronic device # 1, i.e., a second broadcast message, when the electronic device #2 scans to the broadcast message transmitted by the electronic device # 1 on a certain broadcast channel. After receiving the broadcast message, the electronic device #2 recognizes the broadcast message and determines the electronic device that transmitted the broadcast message based on the broadcast message. It will be understood that the electronic device corresponds to the address where the electronic device sends the broadcast message, where the data portion of the broadcast message carries the sending address of the electronic device, and the electronic device #2 obtains the address of the electronic device sending the broadcast message based on the broadcast message, so as to determine the electronic device sending the broadcast message.
In one example, electronic device #2 discovers electronic device # 1 based on BLE scan. Specifically, the plurality of broadcast channels are channel 37, channel 38 and channel 39, and electronic device # 1 sequentially transmits broadcast messages on channel 37, channel 38 and channel 39 in different broadcast periods, and electronic device #2 selects channel 37 for scanning in the scanning period and scans channel 38 in the next scanning period, and so on. For example, the electronic device # 1 transmits a broadcast message on the channel 37, and the electronic device #2 happens to be in the scanning period, and when the channel 37 is scanned, the electronic device # scans the broadcast message transmitted by the electronic device # 1, receives the broadcast message, and determines the electronic device # 1 transmitting the broadcast message, that is, the electronic device #2 discovers the electronic device # 1, based on the broadcast message.
S440, the electronic device # 1 and the electronic device #2 are connected.
In one possible implementation, after the electronic device #2 discovers the electronic device # 1, a message requesting connection is sent to the electronic device # 1, and accordingly, the electronic device # 1 sends a response message to the electronic device #2, and the electronic device # 1 establishes a connection with the electronic device # 2.
S450, the electronic apparatus # 1 and the electronic apparatus #2 form an apparatus group # 1.
After the electronic device # 1 and the electronic device #2 are connected, device information can be exchanged, and each electronic device can form a third neighbor description table based on the device information of the electronic device # 1 and the received device information from the opposite terminal.
The third neighbor description table includes device information of the electronic device # 1 and device information of the electronic device # 2. After the electronic device # 1 establishes a connection with the electronic device #2, device information is exchanged, that is, the electronic device # 1 sends its own device information to the electronic device #2, and after the electronic device #2 receives the connection, a third neighbor description table is formed, where the third neighbor description table includes the device information of the electronic device # 1 and the device information of the electronic device # 2. Similarly, the electronic device #2 may also receive device information of the electronic device # 1 to form a third neighbor description table. In other words, the electronic device # 1 in the device group # 1 shares the device information of each electronic device in the third neighbor description table with the electronic device # 2. Any one of the electronic devices in the device group # 1 may query the device information of each of the electronic devices in the device group # 1 through the third neighbor description table.
One possible design is that the device information exchanged by the electronic device # 1 and the electronic device #2 includes: an ID of the electronic device, a broadcast channel of the electronic device, and a broadcast time of the electronic device.
The ID of the electronic device may correspond to a device address (device address), including, but not limited to, a public device address (public device address), or a static device address (static device address), or a distinguishable device address (resolvable device address), for example. The broadcast channel of the electronic device is used to indicate the channel on which the electronic device sent the broadcast message, and the broadcast time of the electronic device is used to indicate the time at which the electronic device sent the broadcast message on the broadcast channel. For example, the electronic device # 1 needs to acquire the time and channel at which the electronic device #2 transmits the broadcast message so that the electronic device # 1 communicates with the electronic device #2 at the same time on the same channel without performing the scan discovery process again.
Another possible design is that the device information exchanged by electronic device # 1 and electronic device #2 further comprises one or more of the following: the ID of the device group, the number of electronic devices in the device group, the link quality parameter, the timestamp, and the aging time (aging time).
Wherein the link quality parameter is used to indicate the link quality, such as a received signal strength indication (received signal strength indication, RSSI); the time stamp is used for indicating the update time of the device information of the electronic device; the aging time is used to determine whether the electronic device leaves the device group, and may be an absolute time, such as 9:15, or an interval time, such as 3 minutes, which is not limited in the embodiment of the present application.
As an example, as shown in fig. 5, the device information in the neighbor description table may include: the ID of the device group # 1, the ID of the electronic device, the number of electronic devices in the device group # 1, the link quality parameter, the broadcast channel of the electronic device, the broadcast time of the electronic device, the time stamp, and the aging time. Wherein the time stamp represents the time of joining device group # 1, the time stamp and aging time may be used to maintain the neighbor description table, and the aging time may be used to determine whether the electronic device left the device group.
It should be appreciated that the bluetooth protocol stack framework includes, but is not limited to, a host (host) protocol stack, a host control interface (host controller interface, HCI), and a controller (controller). The host protocol stack defines, among other things, the generic access specification (generic access Profile, GAP) that holds the relevant information (Profile) for the device connection. In the embodiment of the application, the information in the neighbor description table, that is, the device information of each electronic device in the device group, such as the ID of the electronic device, the broadcast channel of the electronic device, the broadcast time of the electronic device, the ID of the device group, the number of electronic devices in the device group, the link quality parameter, the timestamp, and the aging time, is newly added in the Profile. The Profile exchange in the device group can be performed through private profiles, and the profiles are stored in a Host protocol stack. In other words, the above-described device information exchanged by the electronic devices in the device group can be identified by the counterpart.
After the electronic device # 1 and the electronic device #2 form the third neighbor description table, time synchronization is performed. For example, the time synchronization may be based on a precision time protocol (precision time protocol, PTP), reference being made to known techniques for specific steps, which for brevity will not be described in detail here.
It should be appreciated that after the device group # 1 is formed, any electronic device outside the device group # 1 may discover any electronic device in the device group # 1 by scanning, and thus, discover all electronic devices in the device group # 1. For example, the electronic device #3 may form the device group #2 by scanning and discovering any one of the electronic devices in the device group # 1 based on the flow shown in fig. 4, the electronic device # 1, the electronic device #2, and the electronic device #3 are included in the device group #2, and the electronic device #3 may also form the neighbor description table of the device group #2 by transmitting own device information to other electronic devices and receiving the neighbor description table from other electronic devices. For another example, the electronic device #4 may find any one of the electronic devices in the device group #2 by scanning. The following describes in detail the procedure of the electronic device #4 discovering the device group #2 and joining the device group #2 with reference to fig. 6.
Fig. 6 is a schematic flowchart of a neighbor discovery method 600 provided in an embodiment of the application. The method 600 shown in fig. 6 may include S610 to S640, and each step in fig. 6 is described in detail below.
It should be noted that, for ease of understanding, the following assumptions are made: the channels for transmitting the broadcast message include a first broadcast channel, a second broadcast channel, and a third broadcast channel. In the flow shown in fig. 6, the device group #2 is one example of the first device group, and the electronic device #4 is one example of the first electronic device. The first device group may include a greater or lesser number of electronic devices, and the number of electronic devices in the first device group is not limited in the embodiments of the present application.
S610, the electronic device #4 scans a first broadcast channel of the predefined plurality of broadcast channels within the scan period.
It should be understood that the electronic device #4 wishes to join the device group #2, and therefore, the electronic device #4 scans for broadcast messages, and the electronic devices in the device group #2 transmit broadcast messages, in other words, the electronic device that wishes to join the device group scans for broadcast messages transmitted by the electronic devices in the device group.
Wherein in each of the at least one broadcast period, broadcast messages from the electronic devices in device group #2 are transmitted on at least two of the predefined plurality of broadcast channels. The predefined broadcast channels are broadcast channels used for transmitting broadcast messages in the neighbor discovery process, and may be, for example, a plurality of broadcast channels predefined by a protocol.
In one possible design, each broadcast period occupies one time slot. At least two electronic devices in a first device group in the same time slot transmit broadcast messages on different broadcast channels.
The plurality of electronic devices of the device group #2 need to be time-synchronized before transmitting the broadcast information. It should be understood that the electronic devices in the device group #2 have the same starting time for transmitting the broadcast message, and the time intervals for transmitting the broadcast message any two times are the same, that is, the time intervals of any two broadcast periods in the plurality of broadcast periods are the same, so that resource collision between the broadcast messages is avoided.
After time synchronization, each electronic device in device group #2 sequentially transmits broadcast messages on different broadcast channels, e.g., a plurality of broadcast channels including a first broadcast channel, a second broadcast channel, and a third broadcast channel, and device group #2 includes electronic device # 1, electronic device #2, and electronic device #3. The electronic device # 1 sequentially transmits broadcast messages on the first broadcast channel, the second broadcast channel, and the third broadcast channel in different broadcast periods, the electronic device #2 sequentially transmits broadcast messages on the next channel of the broadcast channel on which the electronic device # 1 transmits broadcast messages, that is, sequentially transmits broadcast messages on the second broadcast channel, the third broadcast channel, and the first broadcast channel, and the electronic device #3 sequentially transmits broadcast messages on the next channel of the broadcast channel on which the electronic device #2 transmits broadcast messages, that is, sequentially transmits broadcast messages on the third broadcast channel, the first broadcast channel, and the second broadcast channel. As can be seen from the foregoing, when the electronic devices in the first device group have been time-synchronized, for the first broadcast period, the electronic device #4 randomly selects one broadcast channel (e.g., the first broadcast channel) to scan, and can scan the broadcast message of one of the electronic devices, if the broadcast messages sent by the electronic device # 1, the electronic device #2, and the electronic device #3 are transmitted on the three broadcast channels, respectively. For the second broadcast period, the broadcast messages sent by the electronic device #3, the electronic device # 1, and the electronic device #2 are respectively transmitted on the three broadcast channels, and then the electronic device #4 randomly selects one broadcast channel to scan, so that the broadcast message of one of the electronic devices can be scanned. For each broadcast period, the electronic device #4 can scan the broadcast message of one of the electronic devices, and for brevity, will not be described in detail herein.
It is understood that the first electronic device receives the first broadcast message sent by the second electronic device, which indicates that at least one broadcast period overlaps the scanning period of the first electronic device in the time domain. In other words, in case that at least one broadcast period overlaps in time domain with a scanning period of the first electronic device, the first electronic device may scan for the first broadcast message transmitted by the second electronic device during the scanning period.
Fig. 7 is an example of the electronic device #4 scan discovery device group #2 provided in the embodiment of the present application. As shown in fig. 7, taking BLE scenario as an example, the electronic devices in the device group #2 include the electronic device # 1, the electronic device #2, and the electronic device #3, and the plurality of broadcast channels include the channel 37, the channel 38, and the channel 39. The electronic device #3 sequentially transmits broadcast messages on the channels 37, 38 and 39, the electronic device #2 sequentially transmits broadcast messages on the channels 38, 39 and 37, and the electronic device # 1 sequentially transmits broadcast messages on the channels 39, 37 and 38, and it can be seen that any one of the broadcast channels transmits broadcast messages in each broadcast period. When the scanning period of the electronic device #4 overlaps with the second broadcasting period and the third broadcasting period in the time domain, the electronic device #4 selects the channel 37 to scan the broadcasting message sent by the electronic device # 1 when the scanning period starts scanning. It can be seen that, if the electronic device #4 selects the channel 38 to start scanning in the scanning period, the broadcast message sent by the electronic device #3 may be scanned, and if the electronic device #4 selects the channel 39 to start scanning in the scanning period, the broadcast message sent by the electronic device #2 may be scanned, in other words, no matter which broadcast channel is selected by the electronic device #4 to scan, the broadcast message may be scanned, so that the probability of success of scanning by the electronic device #4 is greatly improved, and the scanning duration is reduced.
It will be appreciated that the number of electronic devices in device group #2 above corresponds to the number of broadcast channels, but that there may be two situations as follows.
One possible scenario is that the number of electronic devices in the device group #2 is greater than the number of broadcast channels, and if the number of electronic devices in the device group #2 is N and the number of broadcast channels is M, then M electronic devices are randomly selected from the N electronic devices in the device group #2, and the M electronic devices send broadcast messages on different broadcast channels at the same time. Wherein N > M is more than or equal to 1, and M, N is an integer.
Based on the processing method, for the same electronic device, the time interval of the electronic device for transmitting the broadcast on a certain broadcast channel is longer than the time of transmitting the broadcast message, and when the time interval of the electronic device for transmitting the broadcast message on the broadcast channel twice is shorter, the electronic device needs to be frequently awakened, so that more electric quantity is consumed; if the time interval between two transmissions of the broadcast message by the electronic device on the broadcast channel is long, the broadcast channel may be in an idle state, and when another electronic device scans, the electronic device cannot scan. Therefore, when the number of electronic devices in the device group is greater than the number of broadcast channels, the electronic devices in the device group may also transmit broadcast messages as follows.
One possible implementation is for any one electronic device in the device group to increase the time interval between two transmissions of a broadcast message by that electronic device on the same channel, during which time other devices of the device group may each transmit a broadcast message on that channel.
For example, the original electronic device #3 sends a broadcast message on the channel 37 every 3 minutes, when the number of devices in the device group is greater than 3, the time interval for sending the broadcast message on the channel 37 by the electronic device #3 twice may be increased to 5 minutes, then other devices in the device group may send broadcast messages on the channel during the period, for example, in fig. 7, the time interval for sending the broadcast message by the electronic device #3 twice on the channel 37 is increased, that is, when the channels are in an idle state during the time interval for sending the broadcast messages by the electronic device #3, the electronic device # 1 and the electronic device #2, other electronic devices in the device group, for example, the electronic device #5 may send broadcast messages between the electronic device #3 and the electronic device # 1, and the electronic device #6 may send broadcast messages after the electronic device #2, thereby increasing the probability that the electronic device #4 scans to the broadcast messages.
Another possible scenario is that the number of electronic devices in the device group #2 is smaller than the number of broadcast channels, and if the number of electronic devices in the device group #2 is N and the number of broadcast channels is M, N broadcast channels are selected from the M broadcast channels, and the electronic devices in the first device group send broadcast messages on the N broadcast channels, in other words, in the same time domain, M-N broadcast channels are in an idle state in the M broadcast channels. However, in the same time domain, broadcast messages are transmitted in at least two broadcast channels, so that the probability of successful scanning of the electronic device #4 is improved and the scanning time is shortened compared with the case that only one broadcast channel has broadcast messages.
In summary, the number of electronic devices transmitting broadcast messages on the plurality of broadcast channels within each broadcast period is not greater than the number of the plurality of broadcast channels.
S620, the electronic device #4 establishes a connection with the electronic device # 1 based on the first broadcast message of the electronic device # 1 received on the first broadcast channel.
It should be appreciated that in the embodiment shown in fig. 6, electronic device # 1 is an example of a second electronic device.
The electronic device #4 randomly selects a broadcast channel for scanning during a scanning period, assuming that the electronic device #4 scans for a first broadcast message on a first broadcast channel, wherein the first broadcast channel is any one of a plurality of broadcast channels. After the electronic device #4 scans the first broadcast message, it determines, based on the first broadcast message, the electronic device that transmitted the first broadcast message, for example, as shown in fig. 7, the electronic device #4 scans the channel 37 during the scanning period, receives the broadcast message on the channel 37, and the electronic device #4 determines, based on the broadcast message, that the electronic device that transmitted the broadcast message is the electronic device # 1.
It will be understood that the electronic device corresponds to the address where the electronic device sends the broadcast message, where the data portion of the broadcast message carries the sending address of the electronic device, and the electronic device #4 obtains the address of the electronic device sending the broadcast message based on the broadcast message, so as to determine the electronic device sending the broadcast message.
Assuming that the electronic device # 1 is the electronic device discovered by the electronic device #4, after the electronic device #4 receives the first broadcast message sent by the electronic device # 1, the electronic device #4 sends a message for requesting connection to the electronic device # 1, and accordingly, the electronic device # 1 sends a response message to the electronic device #4, and the connection is established between the two messages.
S630, the electronic device #4 acquires the first neighbor description table from the electronic device # 1.
After the electronic device #4 establishes connection with the electronic device # 1, the electronic device #4 acquires the first neighbor description table from the electronic device # 1, updates the first neighbor description table based on local device information, and obtains the second neighbor description table. It will be appreciated that the electronic device #4 is newly added to the device group #2 to form a new device group, denoted as device group #3. Device group #3 is an example of a second device group. The second device group may include a greater or lesser number of electronic devices, which embodiments of the present application are not limited in this regard. The second neighbor description table includes device information of each electronic device in the device group #2 and device information of the electronic device #4, in other words, compared with the first neighbor description table, the second neighbor description table includes device information of each electronic device in the device group #3, where the device information of the electronic device #4 is added.
One possible implementation manner is that after the electronic device #4 establishes a connection with the electronic device # 1, the electronic device # 1 sends the first neighbor description table to the electronic device #4, the electronic device #4 acquires the first neighbor description table, and updates the first neighbor description table based on local device information to obtain the second neighbor description table. It can be understood that, after the electronic device #4 receives the first neighbor description table, its own device information may be newly added to the first neighbor description table to form a second neighbor description table.
Accordingly, the electronic device # 1 updates the first neighbor description table. One possible design is that the electronic device #4 may send its own device information to the electronic device # 1, and the electronic device # 1 adds the device information of the electronic device #4 to the first neighbor description table, updates the first neighbor description table, and obtains the second neighbor description table. Another possible design is that the electronic device #4 may also directly send the second neighbor description table to the electronic device 1, and the electronic device # 1 may obtain the device information of all the electronic devices in the device group #3 after receiving the second neighbor description table.
It should be understood that the electronic device #4 may notify all the remaining electronic devices in the device group #2 of the local device information, and trigger the remaining electronic devices to update the first neighbor description table to form the second neighbor description table.
It should also be appreciated that the electronic device #4 may be time synchronized based on PTP, and specific steps may be found in known techniques and will not be described in detail herein for brevity.
S640, the electronic device #4 establishes a connection with the electronic device #3 based on the device information of the electronic device # 3.
It is to be understood that electronic device #3 is an example of a third electronic device. The electronic device #4 may also select any one of the electronic devices in the device group #3 that wants to establish a connection based on the device information of each electronic device in the second neighbor description table, and establish a connection with the electronic device based on the device information of the electronic device in the second neighbor description table. Specifically, the electronic device #4 may acquire the ID of the electronic device, the broadcast channel of the electronic device, and the broadcast time of the electronic device (i.e., the time when the electronic device last transmitted the broadcast message) based on the second neighbor description table, in other words, since time synchronization has been performed, the electronic device #4 may calculate the broadcast channel, the broadcast time of the electronic device (e.g., the electronic device # 3) that wants to establish a connection based on the above information. After determining the channel and time for the electronic device #3 desiring to establish a connection to broadcast or listen next, the electronic device #4 establishes a connection with the electronic device #3 at the same time and on the same channel. Wherein, whether the electronic device #3 is broadcasting or listening is determined based on a state machine. For example, if the electronic device #3 is in a broadcast state, the electronic device #4 listens; if the electronic device #3 is in the listening state, the electronic device #4 broadcasts.
It should be understood that each electronic device in the device group #3 can share the device information in the second neighbor description table, so if any two electronic devices in the device group #3 want to establish a connection, the connection can be established by querying the device information in the second neighbor description table, without the need of scanning again, thereby accelerating the connection rate and improving the user experience.
Taking the electronic device #4 as an example, assuming that the electronic device #4 wishes to establish a connection is the electronic device #3, the electronic device #4 can learn the time and the broadcast channel of the broadcast message sent by the electronic device #3 based on local calculation, and acquire the device information of the electronic device #3 from the second neighbor description table. After the electronic device #4 is disconnected from the electronic device # 1, a connection request is sent to the electronic device #3, and a connection is established with the electronic device # 3. The electronic device #4 calculates a channel on which the electronic device #3 will broadcast and a time of broadcasting according to a broadcast channel and a broadcast time of the electronic device #3 in the neighbor description table, and the electronic device #4 can listen on the channel to establish a connection with the electronic device # 3. Alternatively, electronic device #3 is listening, and electronic device #4 may broadcast on the same channel at the same time.
Note that the broadcast time of the electronic device #3 in the neighbor description table is the time when the electronic device #3 last transmitted the broadcast message. The electronic device #4 may query the number of electronic devices in the device group #3 and the broadcast time of the electronic device #3 in the neighbor description table, calculate the time of the next broadcast transmission of the electronic device #3 according to a predefined algorithm, and use the same predefined algorithm in the device group #3.
It should be understood that it is necessary to determine whether the other party leaves the device group #3 between the electronic devices in the device group #3, thereby updating the information of the second neighbor description table. For example, if the electronic device #3 has left the device group #3, but the device information of the electronic device #3 still exists in the second neighbor description table, the electronic device #4 establishes a connection with the electronic device #3 based on the device information, which may result in a connection failure, so it is important to update the information in the second neighbor description table in time.
One possible design is to determine whether the other party leaves the device group #3 by whether a heartbeat packet is received, taking the electronic device #4 as an example, if the electronic device #4 receives the heartbeat packet sent by the electronic device # 1, the time of joining the device group of the electronic device # 1 is updated in the second neighbor description table, for example, the original time stamp is 9:00, the aging time is 3 minutes, the time of receiving the heartbeat packet is 9:02, and the time stamp is 9:02, so that the aging time does not need to be updated. For example, if the original time stamp is 9:00, the aging time is 9:03, and the time when the heartbeat packet is received is 9:02, the time stamp is updated to 9:02, and the aging time is 9:05, it is understood that since the time stamp is updated, the aging time is calculated with the updated time stamp, and therefore, when the aging time is a specific time point, the aging time needs to be updated. If the electronic device # 1 arrives at the aging time, but the electronic device #4 still does not receive the heartbeat packet, determining that the electronic device # 1 leaves the device group #3, and transmitting first information to the rest of the electronic devices in the device group #3, where the first information is used to indicate that the electronic device # 1 leaves the device group #3.
Another possible design is to notify the opposite party of leaving the device group #3 by directly transmitting information indicating the leaving. Taking the electronic device #4 as an example, if the electronic device #4 is to leave the device group #3, the second information is directly sent to the rest of the electronic devices in the device group #3, where the second information is used to instruct the electronic device #4 to leave the device group #3.
Based on the technical scheme, the electronic devices in the same device group can send broadcast messages through different broadcast channels in the same broadcast period, so that the electronic device to be added can scan any one of the broadcast channels and can find one of the electronic devices in the device group. And the neighbor description table comprising the device information of all the electronic devices in the device group is shared to all the electronic devices in the device group, so that the electronic devices to be added can find all the electronic devices in the device group after any one of the electronic devices in the device group is found. Therefore, the probability of successful scanning of the peripheral electronic devices by the electronic devices to be added is improved, the probabilistic delay of finding the peripheral electronic devices is shortened, the duration of the neighbor finding process of the electronic devices to be added is reduced, and the effect brought by the scheme is more remarkable as the number of the electronic devices in the device group is larger. Because the more electronic devices, the lower the probability of successful point-to-point single device scanning, the greater the probabilistic delay that may be incurred. However, if the scheme is used, any node in the equipment group can be discovered quickly, the neighbor discovery time delay is obviously reduced, and the user experience is improved.
It will be appreciated that the steps of the above method may be carried out by integrated logic circuitry in hardware in a processor or instructions in software. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method. To avoid repetition, a detailed description is not provided herein.
The application also provides an electronic device, which may include: memory and a processor. Wherein the memory is operable to store a computer program; the processor may be adapted to invoke a computer program in said memory to cause the electronic device to perform the method according to any of the embodiments shown in fig. 4 and 6.
The present application also provides a chip system comprising at least one processor for implementing the method described in any of the embodiments shown in fig. 4 and 6 above, for example, for receiving or processing data and/or information involved in the above method.
In one possible design, the system on a chip further includes a memory to hold program instructions and data, the memory being located either within the processor or external to the processor.
The chip system may be formed of a chip or may include a chip and other discrete devices.
The present application also provides a computer program product comprising: a computer program (which may also be referred to as code, or instructions) which, when executed, causes an electronic device to implement a method as described in any of the embodiments shown in fig. 4 or 6.
The present application also provides a computer-readable storage medium storing a computer program (which may also be referred to as code, or instructions). The computer program, when executed, causes an electronic device to implement the method described in any of the embodiments shown in fig. 4 or 6.
It should be appreciated that the processor in the embodiments of the present application may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method embodiments may be implemented by integrated logic circuits of hardware in a processor or instructions in software form. The processor may be a general purpose processor, a digital signal processor (digital signal processor, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in hardware, in a decoded processor, or in a combination of hardware and software modules in a decoded processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in a memory, and the processor reads the information in the memory and, in combination with its hardware, performs the steps of the above method.
It should also be appreciated that the memory in embodiments of the present application may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The nonvolatile memory may be a read-only memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an electrically Erasable EPROM (EEPROM), or a flash memory. The volatile memory may be random access memory (random access memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and direct memory bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
The terms "unit," "module," and the like as used in this specification may be used to refer to a computer-related entity, either hardware, firmware, a combination of hardware and software, or software in execution.
Those of ordinary skill in the art will appreciate that the various illustrative logical blocks (illustrative logical block) and steps (steps) described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application. In the several embodiments provided in this application, it should be understood that the disclosed apparatus, device, and method may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
In the above-described embodiments, the functions of the respective functional units may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions (programs). When the computer program instructions (program) are loaded and executed on a computer, the processes or functions described in accordance with the embodiments of the present application are fully or partially produced. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a digital versatile disk (digital video disc, DVD)), or a semiconductor medium (e.g., a Solid State Disk (SSD)), or the like.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a usb disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk, etc.
The foregoing is merely specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (14)
1. A neighbor discovery method, comprising:
the first electronic device scans a first broadcast channel within a scan period, the first broadcast channel being any one of a predefined plurality of broadcast channels, at least two of the plurality of broadcast channels having broadcast messages transmitted thereon during each of at least one broadcast period, the broadcast messages from electronic devices in a first device group;
the first electronic device establishes connection with a second electronic device based on receiving a first broadcast message sent by the second electronic device on the first broadcast channel, wherein the second electronic device is an electronic device in the first device group;
the first electronic device obtains a first neighbor description table from the second electronic device, wherein the first neighbor description table comprises device information of each electronic device in the first device group.
2. The method of claim 1, wherein the number of electronic devices transmitting broadcast messages on the plurality of broadcast channels within each broadcast period is no greater than the number of the plurality of broadcast channels.
3. The method of claim 1 or 2, wherein the method further comprises:
The first electronic device updates the first neighbor description table based on local device information to obtain a second neighbor description table; the second neighbor description table includes device information for each electronic device in a second device group that includes the first electronic device and the electronic devices in the first device group.
4. A method as claimed in any one of claims 1 to 3, wherein the device information comprises: the method comprises the steps of identifying an ID of a device, a broadcast channel of the device and a broadcast time of the device, wherein the broadcast time of the device is used for indicating the time of the device for transmitting a broadcast message last time.
5. The method of claim 4, wherein the device information further comprises one or more of:
an ID of a device group, a number of electronic devices in the device group, a link quality parameter, a time stamp, and an aging time, wherein the link quality parameter is used to indicate a link quality.
6. The method of any one of claims 1 to 5, wherein the method further comprises:
the first electronic device establishes connection with a third electronic device based on device information of the third electronic device, wherein the third electronic device is an electronic device which the first electronic device wants to establish connection in the first device group, and the third electronic device is any one electronic device in the first device group.
7. An electronic device comprising at least one processor configured to execute a computer program, such that the electronic device performs the following:
scanning a first broadcast channel within a scanning period, the first broadcast channel being any one of a predefined plurality of broadcast channels, at least two of the plurality of broadcast channels having broadcast messages transmitted thereon in each of at least one broadcast period, the broadcast messages from electronic devices in a first group of devices;
establishing connection with a second electronic device based on a first broadcast message sent by the second electronic device and received on the first broadcast channel, wherein the second electronic device is an electronic device in the first device group;
a first neighbor description table is obtained from the second electronic device, the first neighbor description table including device information for each electronic device in the first device group.
8. The electronic device of claim 7, wherein a number of electronic devices transmitting broadcast messages on the plurality of broadcast channels within each broadcast period is not greater than a number of the plurality of broadcast channels.
9. The electronic device of claim 7 or 8, wherein the at least one processor is configured to execute a computer program to cause the electronic device to:
updating the first neighbor description table based on local equipment information to obtain a second neighbor description table; the second neighbor description table includes device information for each electronic device in a second device group that includes the electronic device and the electronic devices in the first device group.
10. The electronic device of any of claims 7-9, wherein the device information comprises: the method comprises the steps of identifying an ID of a device, a broadcast channel of the device and a broadcast time of the device, wherein the broadcast time of the device is used for indicating the time of the device for transmitting a broadcast message last time.
11. The method of claim 10, wherein the device information further comprises one or more of:
an ID of a device group, a number of electronic devices in the device group, a link quality parameter, a time stamp, and an aging time, wherein the link quality parameter is used to indicate a link quality.
12. The electronic device of any of claims 7-11, wherein the at least one processor is configured to execute a computer program to cause the electronic device to:
And establishing connection with a third electronic device based on device information of the third electronic device, wherein the third electronic device is an electronic device which the electronic device in the first device group wants to establish connection with, and the third electronic device is any electronic device in the first device group.
13. A computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, causes an electronic device to perform the method of any one of claims 1 to 6.
14. A computer program product comprising a computer program which, when run, causes an electronic device to perform the method of any one of claims 1 to 6.
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111343116.1A CN116132963A (en) | 2021-11-12 | 2021-11-12 | Neighbor discovery method and electronic device |
PCT/CN2022/126526 WO2023082966A1 (en) | 2021-11-12 | 2022-10-20 | Neighbor discovery method and electronic device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111343116.1A CN116132963A (en) | 2021-11-12 | 2021-11-12 | Neighbor discovery method and electronic device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116132963A true CN116132963A (en) | 2023-05-16 |
Family
ID=86301442
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111343116.1A Pending CN116132963A (en) | 2021-11-12 | 2021-11-12 | Neighbor discovery method and electronic device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN116132963A (en) |
WO (1) | WO2023082966A1 (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070268856A1 (en) * | 2006-05-16 | 2007-11-22 | Nokia Corporation | Beacon broadcaster methods and systems for wireless networks |
US20150282064A1 (en) * | 2014-03-31 | 2015-10-01 | Qualcomm Incorporated | Dedicated channel for fast initial link setup in a wireless network |
CN104010289B (en) * | 2014-05-21 | 2017-12-29 | 广东工业大学 | The communication means that a kind of wireless self-networking neighbor node is mutually found |
US11057826B2 (en) * | 2018-08-24 | 2021-07-06 | Qualcomm Incorporated | Scanning enhancements for next generation Wi-Fi channels |
CN113473427A (en) * | 2021-06-11 | 2021-10-01 | 苏州集萃智造大数据科技有限公司 | Bluetooth Mesh network flooding redundancy optimization method based on neighbor information |
-
2021
- 2021-11-12 CN CN202111343116.1A patent/CN116132963A/en active Pending
-
2022
- 2022-10-20 WO PCT/CN2022/126526 patent/WO2023082966A1/en unknown
Also Published As
Publication number | Publication date |
---|---|
WO2023082966A1 (en) | 2023-05-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110622123B (en) | Display method and device | |
WO2018000134A1 (en) | Bluetooth connection method and terminal | |
JP7270753B2 (en) | Measurement processing method, parameter setting method, terminal and network equipment | |
EP3624404B1 (en) | Method and device for establishing wireless communication connection | |
JP2023507919A (en) | Path selection method, terminal and network side equipment | |
WO2018103380A1 (en) | Method for accessing wireless network, and mobile terminal | |
CN113453159A (en) | MBS service transmission method, MBS service transmission control method and related equipment | |
KR20080104125A (en) | Method and device for automatic bluetooth pairing | |
JP2021530914A (en) | Paging instruction method, equipment and system | |
JP7233527B2 (en) | Resource pool setting method, usage method, setting device, terminal | |
US12004096B2 (en) | Signal transmission method and communications device | |
JP7345062B2 (en) | Relay connection establishment method and equipment | |
KR20210057156A (en) | Resource configuration method, terminal, and network equipment | |
JP7249436B2 (en) | PC5 link establishment method, device and system | |
JP2013247616A (en) | Short-range radio communication device | |
CN110809267A (en) | Device connection method, electronic device and computer readable storage medium | |
CN113853754A (en) | In the bluetoothTMElectronic device and method for displaying external electronic device query list in network environment | |
WO2024082906A1 (en) | Information acquisition method and apparatus, bluetooth device, terminal device, and storage medium | |
CN106851784B (en) | network scanning method and terminal equipment | |
CN117768926A (en) | Multi-device networking method and device, storage medium and electronic device | |
JP7190058B2 (en) | Data processing method and user equipment | |
WO2018201391A1 (en) | Timing method for synchronization signal block, and related product | |
CN110636521B (en) | Measuring method and terminal | |
US20100167652A1 (en) | Communication device and communication method thereof | |
CN116132963A (en) | Neighbor discovery method and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |