Neighbor discovery method and electronic device
By sharing neighbor description tables and allocating different broadcast channels between electronic devices in the device group, the problem of probabilistic delay in neighbor discovery is solved, and the effect of quickly discovering surrounding devices is achieved.
Patent Information
- Application Number
- CN202111343116.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-12
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2041-11-12
AI Technical Summary
In the existing neighbor discovery method, there is a probabilistic delay when the electronic device scans multiple devices, resulting in too long discovery process and affecting the user experience.
Using the concept of equipment group, electronic devices in the same equipment group send broadcast messages through different broadcast channels in the same broadcast period and share neighbor description tables to improve the probability of scanning success and shorten the discovery time.
Through information sharing and broadcast channel allocation within the device group, neighbor discovery delay is significantly reduced, and the efficiency and user experience of electronic devices discovering surrounding devices is improved.
Smart Images

Figure CN116132963B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a neighbor discovery method and electronic device. Background Art
[0002] With the rapid development of the internet, proximity-based wireless communication applications have gained significant attention. Electronic devices supporting wireless communication require neighbor discovery based on the Neighbor Discovery Protocol (NDP) to establish connections. For example, the Bluetooth device scanning process is a neighbor discovery process.
[0003] Currently, neighbor discovery is achieved through point-to-point scanning. The point-to-point scanning process is as follows: an electronic device (for ease of distinction and explanation, denoted as electronic device #1) can send broadcast messages through different broadcast channels during different broadcast periods. Another electronic device (for ease of distinction and explanation, denoted as electronic device #2) randomly selects a broadcast channel to scan during the scanning period, and then scans another broadcast channel during the next scanning period. Electronic device #1 can only be discovered if electronic device #1 is sending a broadcast message on a certain broadcast channel while electronic device #2 is also scanning on the same broadcast channel. Therefore, there is a probabilistic delay.
[0004] However, in some cases, a single electronic device may need to scan and discover multiple electronic devices. For example, if a user's mobile phone needs to establish a connection with multiple other electronic devices in their home, the mobile phone needs to use a point-to-point scanning method to scan multiple electronic devices one by one to establish a connection with these multiple electronic devices. Because there is a probabilistic delay in the discovery of each electronic device, as the number of electronic devices being scanned increases, this probabilistic delay will also increase exponentially, resulting in a longer discovery process and higher latency, which in turn affects the user experience. Summary of the Invention
[0005] The present application provides a neighbor discovery method and electronic device, in order to reduce the probabilistic delay of an electronic device in discovering surrounding electronic devices, shorten the duration of the entire discovery process, and thereby improve the user experience.
[0006] In the first aspect, the present application provides a neighbor discovery method, which can be executed by a first electronic device, or by a component configured in the first electronic device (such as a chip, a chip system, etc.), or by a logic module or software that can realize all or part of the functions of the first electronic device. The present application does not limit this.
[0007] Exemplarily, the method includes: a first electronic device scans a first broadcast channel within a scanning period, the first broadcast channel being any one of a plurality of predefined broadcast channels, and in each broadcast period of at least one broadcast period, broadcast messages are transmitted on at least two broadcast channels, and the broadcast messages come from electronic devices in the first device group; the first electronic device establishes a connection with a second electronic device based on a first broadcast message sent by the second electronic device received on the first broadcast channel, and 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, and the first neighbor description table includes device information of each electronic device in the first device group.
[0008] It can be understood that the first electronic device's receipt of the first broadcast message sent by the second electronic device indicates that at least one broadcast period overlaps with the first electronic device's scanning period in the time domain. In other words, only when at least one broadcast period overlaps with the first electronic device's scanning period in the time domain can the first electronic device scan the first broadcast message sent by the second electronic device during the scanning period.
[0009] Based on the above technical solution, electronic devices within the same device group can send broadcast messages via different broadcast channels during the same broadcast period. This allows any electronic device that is joining the group to discover any of the electronic devices in the group by scanning any of the broadcast channels. Furthermore, a neighbor description table containing device information for all electronic devices in the group is shared with each electronic device in the group. This allows a joining electronic device to discover all electronic devices in the group after discovering any one of the electronic devices in the group. This improves the probability of a joining electronic device successfully scanning its surrounding electronic devices, shortens the probabilistic delay in discovering surrounding electronic devices, and reduces the duration of the neighbor discovery process for the joining electronic device. Furthermore, the greater the number of electronic devices in the group, the more significant the effect of this solution. This is because the greater the number of electronic devices in the group, the lower the probability of successful point-to-point scanning of individual devices, and the greater the probabilistic delay that may be incurred. However, using the above solution, any node in the group can be quickly discovered, significantly reducing neighbor discovery latency and improving the user experience.
[0010] In combination with the first aspect, in a possible implementation of the first aspect, the number of electronic devices that send broadcast messages on the multiple broadcast channels in each broadcast period is not greater than the number of the multiple broadcast channels.
[0011] Multiple electronic devices in the first device group send broadcast messages in a staggered manner, and the number of electronic devices sending broadcast messages on multiple broadcast channels within each broadcast period is not greater than the number of multiple broadcast channels. In other words, at the same time, multiple electronic devices send broadcast messages on different broadcast channels, avoiding multiple electronic devices sending broadcast messages on the same channel and causing resource collisions.
[0012] In combination with the first aspect, in a possible implementation of the first aspect, the method further includes: 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 of each electronic device in the second device group, and the second device group includes the first electronic device and the electronic devices in the first device group.
[0013] After receiving the first neighbor description table, the first electronic device adds its own device information to the first neighbor description table to form a second neighbor description table. In other words, in addition to the device information of the electronic devices in the first device group, the second neighbor description table also includes the device information of the first electronic device, so that other electronic devices in the device group can also obtain the device information of the first electronic device, realizing information sharing. From the perspective of the device group, the first electronic device joins the first device group to form a second device group. The second device group includes all electronic devices in the first device group and the first electronic device. Therefore, the electronic devices in the second device group can establish a connection with any electronic device in the second device group based on the second neighbor description table, which speeds up the connection speed and improves the user experience.
[0014] In combination with the first aspect, in a possible implementation of the first aspect, the device information includes: an identifier (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 the time when the electronic device last sent a broadcast message.
[0015] Device information may include the device information required to establish a connection between electronic devices, such as the device ID, the device's broadcast channel, and the device's broadcast time. In this way, electronic devices in the device group do not need to perform the neighbor discovery process again, and can achieve fast connection based on the above device information, thereby improving user experience.
[0016] Optionally, the device information further includes one or more of the following: an ID of a device group, the number of electronic devices in the device group, a link quality parameter, a timestamp, and an aging time, wherein the link quality parameter is used to indicate link quality.
[0017] The device information may also include relevant information for maintaining the neighbor description table, for example, a timestamp is used to indicate the update time of the device information of the electronic device; an aging time is used to determine whether the electronic device has left the device group, which can 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, it can be ensured that all electronic devices in the device group are connectable electronic devices, avoiding the situation where an electronic device has left the device group, but because another electronic device can query the device information of the electronic device based on the neighbor description table, it cannot connect to it successfully.
[0018] In combination with the first aspect, in a possible implementation of the first aspect, the method also includes: the first electronic device establishes a connection with a third electronic device based on device information of the third electronic device, the third electronic device is an electronic device in the first device group with which the first electronic device wishes to establish a connection, and the third electronic device is any electronic device in the first device group.
[0019] After the first electronic device joins the first device group, it can establish a connection with any electronic device in the device group. If the first electronic device wants to establish a connection with a third electronic device, the first electronic device can query the device information of the third electronic device based on the first neighbor description table, and establish a connection with the third electronic device based on the device information. There is no need to discover the third electronic device again, thereby shortening the time used to establish a connection and improving the user experience.
[0020] In a second aspect, the present application provides an electronic device that can implement the method described in the first aspect and any possible implementation of the first aspect. The electronic device includes corresponding units for executing the method described above. The units included in the device can be implemented in software and / or hardware.
[0021] In a third aspect, the present application provides an electronic device comprising a processor, wherein the processor is coupled to a memory and configured to execute a computer program in the memory to implement the neighbor discovery method in the first aspect and any possible implementation of the first aspect.
[0022] Optionally, the electronic device further includes a memory.
[0023] Optionally, the electronic device further includes a communication interface, and the processor is coupled to the communication interface.
[0024] In a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program or instruction. When the computer program or instruction is executed, it implements the neighbor discovery method in the first aspect and any possible implementation of the first aspect.
[0025] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed, implement the neighbor discovery method in the first aspect and any possible implementation manner of the first aspect.
[0026] In a sixth aspect, the present application provides a chip system, which includes a processor and may also include a memory, for implementing the neighbor discovery method in the first aspect and any possible implementation of the first aspect. The chip system can be composed of a chip or can include a chip and other discrete devices.
[0027] It should be understood that the second to sixth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 is a structural diagram of an electronic device provided in an embodiment of the present application;
[0029] Figure 2 is a schematic diagram of a network architecture of a communication system applicable to an embodiment of the present application;
[0030] Figure 3 This is a schematic diagram of the scanning process of a mobile phone scanning to discover a smart speaker provided in an embodiment of the present application;
[0031] Figure 4 is a schematic flow chart of a neighbor discovery method provided in an embodiment of the present application;
[0032] Figure 5 This is a schematic diagram of device information provided in an embodiment of the present application;
[0033] Figure 6 is another schematic flow chart of a neighbor discovery method provided in an embodiment of the present application;
[0034] Figure 7 This is a schematic diagram of a first electronic device scanning and discovering a first device group provided by an embodiment of the present application. DETAILED DESCRIPTION
[0035] The technical solution in this application will be described below with reference to the accompanying drawings.
[0036] To facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the first electronic device and the second electronic device are used to distinguish between different electronic devices and do not limit their order. Those skilled in the art will understand that terms such as "first" and "second" do not limit the quantity or execution order, and that terms such as "first" and "second" do not necessarily mean that they are different.
[0037] In addition, the terms "comprises" and "having" and any variations thereof are intended to cover a non-exclusive inclusion. For example, a process, method, system, product or apparatus that includes a series 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, product or apparatus.
[0038] In the embodiments of this application, "multiple" refers to two or more. "One or more of the following" or similar expressions 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 can mean: a, b, c; a and b; a and c; b and c; or a, b, and c.
[0039] It should be understood that the electronic devices described in this application refer to electronic devices with Bluetooth functionality. For example, the electronic devices with Bluetooth functionality in this application may include: mobile phones, tablet computers, smart speakers, Bluetooth headsets, wearable devices, etc.
[0040] Among them, wearable devices can also be called wearable smart devices. It is a general term for wearable devices that use wearable technology to intelligently design and develop wearable devices for daily wear, such as smart watches and bracelets. Wearable devices are portable devices that are worn directly on the body or integrated into the user's clothes or accessories. Wearable devices are not just hardware devices, but also achieve powerful functions through software support, data interaction, and cloud interaction. Broadly speaking, wearable smart devices include those that are full-featured, large in size, and can achieve full or partial functions without relying on smartphones, such as smart watches or smart glasses, as well as those that only focus on a certain type of application function and need to be used in conjunction with other devices such as smartphones, such as various smart bracelets and smart jewelry for vital sign monitoring.
[0041] For example, Figure 1 1 shows a schematic structural diagram of the electronic device 100. Figure 1As shown, 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 (Wi-Fi) module 190 , and a Bluetooth module 1100 .
[0042] The processor 110 is the control center of the electronic device. It uses various interfaces and lines to connect the various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 140 and calling data stored in the memory 140, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. 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 mainly processes the operating system, user interface, and application programs, while the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 110.
[0043] The RF unit 120 can be used to send and receive signals during information transmission or calls. Specifically, it receives downlink information from the base station and transmits it to the processor 110 for processing. It also transmits uplink data to the base station. Typically, the RF 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 more. Furthermore, the RF unit 120 can communicate with the network and other devices via wireless communication. The above-mentioned wireless communications may use any communication standard or protocol, including but not limited to global system of mobile communications (GSM), general packet radio service (GPRS), code division multiple access 2000 (CDMA2000), wideband code division multiple access (WCDMA), time division-synchronous code division multiple access (TD-SCDMA), frequency division duplexing-long term evolution (FDD-LTE) and time division duplexing-long term evolution (TDD-LTE).
[0044] The power supply 130 (such as a battery) is used to power various components. Preferably, the power supply 130 can be logically connected to the processor 110 through a power management system, so that the power management system can manage charging, discharging, power consumption and other functions.
[0045] The memory 140 can be used to store software programs and modules. The processor 110 executes 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 program storage area and a data storage area. The program storage area may store an operating system, at least one application required for a function (such as a sound playback function, an image playback function, etc.), a boot loader, etc.; the data storage area may store data created based on the use of the electronic device (such as audio data, a phone book, etc.). In addition, the memory 140 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device.
[0046] The input unit 150 can be used to receive input digital or character information, and to generate key signal input related to the user settings and function control of the electronic device. Specifically, the input unit 150 may include a touch panel 1501 and other input devices 1502. The touch panel 1501, also known as a touch screen, can collect user touch operations on or near it (such as operations performed by the user using any suitable object or accessory such as a finger, stylus, etc. on or near the touch panel 1501) and drive the corresponding connection device according to a pre-set program. Optionally, the touch panel 1501 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch direction, detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device and converts it into touch point coordinates, which are then sent to the processor 110, and can receive commands sent by the processor 110 and execute them. In addition, the touch panel can be implemented using various types such as resistive, capacitive, infrared and surface acoustic wave. In addition to the touch panel 1501, the input unit 150 may further include other input devices 1502. Specifically, the other input devices 1502 may include but are not limited to one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick.
[0047] The display unit 160 can be used to display information input by the user or information provided to the user and various menus of the electronic device. The display unit 160 may include a display panel 1601. Optionally, the display panel 1601 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch panel 1501 may cover the display panel 1601. When the touch panel 1501 detects a touch operation on or near it, it is transmitted to the processor 110 to determine the type of touch event. Subsequently, the processor 110 provides a corresponding visual output on the display panel 1601 according to the type of touch event. Although in Figure 1 In the embodiment, the touch panel 1501 and the display panel 1601 are two independent components to realize the input and output functions of the electronic device, but in some embodiments, the touch panel 1501 and the display panel 1601 can be integrated to realize the input and output functions of the electronic device.
[0048] 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 and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1601 according to the brightness of the ambient light, and the proximity sensor may turn off the display panel 1601 or the backlight when the electronic device is moved to the ear. As a type of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in all directions (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the electronic device can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be described here.
[0049] The audio circuit 180 can transmit the electrical signal converted from the received audio data to the speaker 1801, which is converted into a sound signal for output; on the other hand, the microphone 1802 converts the collected sound signal into an electrical signal, which is received by the audio circuit 180 and converted into audio data. The audio data is then output to the processor 110 for processing, and then sent to another electronic device through the radio frequency unit 120, or the audio data is output to the memory 140 for further processing.
[0050] Wi-Fi is a short-range wireless transmission technology. Electronic devices can help users send and receive emails, browse web pages, and access streaming media through the Wi-Fi module 190. It provides users with wireless broadband Internet access. Figure 1A Wi-Fi module 190 is shown, but it is understandable that it is not an essential component of the electronic device and can be omitted as needed without changing the essence of the invention.
[0051] Bluetooth technology is also a short-range wireless transmission technology. Electronic devices can establish Bluetooth connections with other electronic devices equipped with Bluetooth modules through the Bluetooth module 1100, thereby performing data transmission based on the Bluetooth communication link. The Bluetooth module 1100 can be a low-power Bluetooth (Bluetooth Low Energy, BLE) module as needed. It is understood that the electronic devices in the embodiments of the present application include a Bluetooth module.
[0052] In the embodiments of the present application, electronic devices discover each other through Bluetooth scanning, and then establish a connection with each other to transmit business. Therefore, the electronic devices involved in the embodiments of the present application have Bluetooth functionality, in other words, the electronic devices involved in the embodiments of the present application include a Bluetooth module.
[0053] It should be understood that the structure illustrated in this application does not constitute a specific limitation on the electronic device 100. In other embodiments, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0054] Figure 2 2 is a schematic diagram of a network architecture of a communication system 200 applicable to an embodiment of the present application. Figure 2 As shown, the communication system 200 includes: an electronic device 210 and a device group 220, and the device group 220 includes electronic devices 2201 to 2203. Among them, the electronic devices 2201 to 2203 can be different types of electronic devices, for example, including but not limited to smart speakers, tablets, smart watches, and other electronic devices not shown in the figure, such as laptops, smart TVs, etc. Among them, the electronic device 210 can discover any electronic device in the device group 220 based on NDP scanning, and then establish a connection with the electronic device to transmit business. Electronic devices outside the device group 220, such as the electronic device 210 shown in the figure, can discover any electronic device in the device group 220 by scanning, and then discover all electronic devices in the device group.
[0055] Currently, neighbor discovery can be achieved through point-to-point scanning. For example, in a home scenario, an electronic device 210 (such as a mobile phone) can discover other electronic devices in the home, such as smart speakers, TVs, and tablets, through Bluetooth scanning. However, the mobile phone needs to scan and discover these electronic devices one by one, and display them one by one on the mobile phone interface, and then select the electronic device you want to connect to connect.
[0056] The following example uses a mobile phone to discover a smart speaker through BLE scanning. Figure 3 The scanning process is described in detail. It should be understood that mobile phones and smart speakers are two possible examples of electronic devices.
[0057] like Figure 3 As shown, the smart speaker sends broadcast messages on different broadcast channels in different broadcast periods, such as broadcast period #1, broadcast period #2, and broadcast period #3 shown in the figure. For example, broadcast messages are sent on channel 37, channel 38, and channel 39 in sequence. The multiple broadcast channels are predefined broadcast channels used to send broadcast messages during the neighbor discovery process, for example, they can be multiple broadcast channels predefined by the protocol. During its scanning period, the mobile phone scans on one of the broadcast channels, such as channel 37; and during the next scanning period, it scans another broadcast channel, such as channel 38. As can be seen from the figure, after the mobile phone starts scanning, when scanning on channel 37, the smart speaker does not send a broadcast message on this channel. Therefore, the mobile phone cannot scan the smart speaker and needs to wait for the next scanning period to continue scanning. It's not hard to see that this point-to-point scanning method requires the smart speaker to broadcast a message on a certain broadcast channel at the same time the phone happens to be scanning on the same broadcast channel in order to discover the other party. Therefore, the probability of the phone scanning the smart speaker within a single scanning period is low, and it may take multiple scanning periods to successfully scan the smart speaker, resulting in a long scanning process. As you can imagine, if there are multiple electronic devices in a home, the phone will need to scan and discover all of them one by one and display them one by one on the phone interface. This will increase the scanning time exponentially, and the user will have to wait a long time to see all available nearby electronic devices on the phone interface, affecting the user experience.
[0058] Therefore, the present application provides a neighbor discovery method, which introduces the concept of a device group. A device group may include multiple electronic devices, and each electronic device in the same device group shares its own device information, forming a neighbor description table including the device information of each electronic device in the same device group. Electronic devices in the same device group can send broadcast messages through different broadcast channels during the same broadcast period. No matter which broadcast channel the electronic device to be joined scans, it can find an electronic device in the device group. Since each electronic device in the device group has the neighbor description table, the electronic device to be joined can find all electronic devices in the device group. The above process increases the probability of successful scanning of the electronic device to be joined by electronic devices in the same device group sending broadcast messages on different channels at the same time, thereby reducing the time delay of the electronic device to be joined in the neighbor discovery process, shortening the time for the electronic device to be joined to scan and discover surrounding electronic devices, and improving the user experience.
[0059] A neighbor discovery method provided by an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0060] It should be understood that to facilitate the distinction between device groups in different situations, the device group consisting of two electronic devices will be referred to as device group #1. For example, device group #1 includes electronic device #1 and electronic device #2. Each time a device is added to a device group, the device group number is incremented by one. For example, adding an electronic device, such as electronic device #3, to device group #1 creates device group #2. Each time a device is added to a device group, the corresponding neighbor description table is updated accordingly.
[0061] For ease of understanding, the following first describes the process of establishing device group #1, and then details the neighbor discovery method based on the established device group. It should be understood that the established device group referred to here can be device group #1, or it can be a new device group derived from device group #1 after one or more updates. This embodiment of the present application is not limited to this.
[0062] Figure 4 A schematic flowchart of a neighbor discovery method 400 provided in an embodiment of the present application. Figure 4 The method 400 shown may include S410 to S450. Figure 4 The process of establishing device group #1 between electronic device #1 and electronic device #2 is described in detail.
[0063] S410. Electronic device #1 sends a broadcast message through multiple broadcast channels within multiple broadcast time periods.
[0064] Each broadcast period may occupy a time slot, and within the broadcast period, the electronic device may send broadcast messages on multiple broadcast channels. The multiple broadcast channels are predefined broadcast channels used to send broadcast messages during the neighbor discovery process, for example, they may be multiple broadcast channels predefined by the protocol. It should be noted that the time interval between any two broadcast periods in the multiple broadcast periods may be fixed, such as Figure 3 The time interval between broadcast period #1 and broadcast period #2 shown is the same as the time interval between broadcast period #2 and broadcast period #3. The time lengths of any two broadcast periods in multiple 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. The different lengths of the data portions of different broadcast messages may cause the lengths of the broadcast periods to be different. Therefore, after the time synchronization between electronic devices, the start time of the broadcast message sent by electronic device #1 can be fixed, that is, the time interval between any two broadcast periods is the same. For example, electronic device #1 sends broadcast messages on different broadcast channels at fixed intervals, that is, electronic device #1 can send broadcast messages on different broadcast channels in different broadcast periods, and the time interval between any two broadcast periods in different broadcast periods is the same.
[0065] For example Figure 3 As shown in FIG, electronic device #1 (such as Figure 3 The smart speaker in the broadcast time period sends a broadcast message on channel 37 during broadcast time period #1, sends a broadcast message on channel 38 during broadcast time period #2, and sends a broadcast message on channel 39 during broadcast time period #3.
[0066] S420. Electronic device #2 randomly selects a broadcast channel to scan within the scanning period.
[0067] As can be seen from S410, electronic device #1 sends a broadcast message through multiple broadcast channels. Figure 4 In the embodiment shown, the broadcast message sent by electronic device #1 is recorded as the second broadcast message. Electronic device #2 can randomly select a broadcast channel from multiple broadcast channels to scan. For example Figure 3 The broadcast channel shown in FIG, electronic device #2 selects channel 37 to scan during the scanning period. It should be understood that Figure 3 Only one scanning period is shown, but this should not constitute any limitation to this embodiment. Figure 3 Multiple scanning periods may also be included, and electronic device #2 may select channel 38 for scanning in the next scanning period.
[0068] It should be understood that the above description uses the example of electronic device #1 sending a broadcast message and electronic device #2 scanning a broadcast channel, but it should not constitute any limitation to the embodiments of the present application. For example, electronic device #1 scans a broadcast channel, and electronic device #2 sends a broadcast message. That is to say, in the process of two electronic devices establishing a device group, the electronic device that sends the broadcast message and the electronic device that scans the broadcast channel are random. For example, smart speaker #1 sends a broadcast message, and smart speaker #2 scans the broadcast channel to discover each other and establish a device group, or smart speaker #1 scans the broadcast channel and smart speaker #2 sends a broadcast message. The embodiments of the present application do not limit this.
[0069] S430: Electronic device #2 receives the broadcast message from electronic device #1.
[0070] Electronic device #2 randomly selects a broadcast channel for scanning. When electronic device #2 detects a broadcast message sent by electronic device #1 on a broadcast channel, it receives the broadcast message from electronic device #1, i.e., the second broadcast message. After receiving the broadcast message, electronic device #2 identifies it and, based on the broadcast message, determines the electronic device that sent it. It will be understood that the electronic device corresponds to the address from which the electronic device sent the broadcast message, and the data portion of the broadcast message carries the sending address of the electronic device. Based on the broadcast message, electronic device #2 obtains the address of the electronic device that sent the broadcast message and can thus determine the electronic device that sent the broadcast message.
[0071] In one example, electronic device #2 discovers electronic device #1 based on BLE scanning. Specifically, the multiple broadcast channels are channel 37, channel 38, and channel 39. Electronic device #1 sends broadcast messages on channel 37, channel 38, and channel 39 in different broadcast time periods. Electronic device #2 selects channel 37 for scanning during the scanning period, and scans channel 38 during the next scanning period, and so on. For example, when electronic device #1 sends a broadcast message on channel 37, electronic device #2 happens to be in the scanning period and is scanning channel 37. Then, electronic device #2 scans the broadcast message sent by electronic device #1, receives the broadcast message, and based on the broadcast message, determines that electronic device #1 sent the broadcast message, that is, electronic device #2 discovers electronic device #1.
[0072] S440: Electronic device #1 establishes a connection with electronic device #2.
[0073] In one possible implementation, after electronic device #2 discovers electronic device #1, it sends a message requesting a connection to electronic device #1. Correspondingly, electronic device #1 sends a response message to electronic device #2, and electronic device #1 establishes a connection with electronic device #2.
[0074] S450: Electronic device #1 and electronic device #2 form device group #1.
[0075] After electronic device #1 and electronic device #2 establish a connection, they can exchange device information. Each electronic device can form a third neighbor description table based on its own device information and the device information received from the other end.
[0076] Among them, the above-mentioned third neighbor description table includes the device information of electronic device #1 and the device information of electronic device #2. After electronic device #1 establishes a connection with electronic device #2, they exchange device information, that is, electronic device #1 sends its own device information to electronic device #2, and after electronic device #2 receives it, a third neighbor description table is formed, which includes the device information of electronic device #1 and the device information of electronic device #2. Similarly, electronic device #2 can also receive the device information of electronic device #1 to form a third neighbor description table. In other words, electronic device #1 and electronic device #2 in device group #1 share the device information of each electronic device in the third neighbor description table. Any electronic device in device group #1 can query the device information of each electronic device in device group #1 through the third neighbor description table.
[0077] One possible design is that the device information exchanged between electronic device #1 and electronic device #2 includes: the ID of the electronic device, the broadcast channel of the electronic device, and the broadcast time of the electronic device.
[0078] The ID of the electronic device may correspond to a device address, such as, but not limited to, a public device address, a static device address, or a resolvable device address. The broadcast channel of the electronic device is used to indicate the channel on which the electronic device sends broadcast messages, and the broadcast time of the electronic device is used to indicate the time when the electronic device sends broadcast messages on the broadcast channel. For example, electronic device #1 needs to obtain the time and channel on which electronic device #2 sends a broadcast message so that electronic device #1 can communicate with electronic device #2 at the same time and on the same channel without having to perform the scanning and discovery process again.
[0079] Another possible design is that the device information exchanged between electronic device #1 and electronic device #2 also includes one or more of the following: device group ID, the number of electronic devices in the device group, link quality parameters, timestamp, and aging time.
[0080] Among them, the link quality parameter is used to indicate the link quality, such as the received signal strength indication (RSSI); the timestamp is used to indicate 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, which can be an absolute time, such as 9:15, or an interval time, such as 3 minutes. The embodiment of the present application is not limited to this.
[0081] An example, such as Figure 5 As shown, the device information in the neighbor description table may include: the ID of device group #1, the ID of the electronic device, the number of electronic devices in device group #1, link quality parameters, the broadcast channel of the electronic device, the broadcast time of the electronic device, a timestamp, and an aging time. The timestamp indicates the time when the device joined device group #1. The timestamp and aging time can be used to maintain the neighbor description table, and the aging time can be used to determine whether the electronic device has left the device group.
[0082] It should be understood that the Bluetooth protocol stack framework includes but is not limited to a host protocol stack, a host controller interface (HCI), and a controller. Among them, the host protocol stack defines a generic access profile (GAP), and the GAP stores relevant information (Profile) for device connection. In an embodiment of the present application, information in a neighbor description table is newly added to the Profile, 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, link quality parameters, timestamps, and aging time, etc. Among them, the Profile exchange within the device group can be done through private Profiles, and these Profiles are all present in the Host protocol stack. In other words, the above-mentioned device information exchanged by the electronic devices in the device group can be recognized by the other party.
[0083] After forming the third neighbor description table, electronic device #1 and electronic device #2 perform time synchronization, for example, based on the Precision Time Protocol (PTP). Specific steps can be found in known technologies and are not described in detail here for brevity.
[0084] It should be understood that after forming device group #1, any electronic device outside device group #1 can discover any electronic device in device group #1 by scanning, and then discover all electronic devices in device group #1. Figure 4The process shown in the figure is to form device group #2 by scanning and discovering any electronic device in device group #1. Device group #2 includes electronic device #1, electronic device #2, and electronic device #3. Electronic device #3 can also form a neighbor description table of device group #2 by sending its own device information to other electronic devices and receiving neighbor description tables from other electronic devices. For another example, electronic device #4 can scan and discover any electronic device in device group #2. Figure 6 The process of electronic device #4 discovering device group #2 and joining device group #2 is described in detail.
[0085] Figure 6 A schematic flowchart of a neighbor discovery method 600 provided in an embodiment of the present application. Figure 6 The method 600 shown may include S610 to S640. Figure 6 Detailed description of each step in.
[0086] It should be noted that, for ease of understanding, the following assumption is made: the channels used to send broadcast messages include the first broadcast channel, the second broadcast channel, and the third broadcast channel. Figure 6 In the illustrated process, device group #2 is an example of the first device group, and electronic device #4 is an example of the first electronic device. The first device group may include more or fewer electronic devices, and the embodiment of the present application does not limit the number of electronic devices in the first device group.
[0087] S610: Electronic device #4 scans a first broadcast channel among a plurality of predefined broadcast channels within a scanning period.
[0088] It should be understood that electronic device #4 wants to join device group #2, so electronic device #4 scans the broadcast message and the electronic devices in device group #2 send the broadcast message. In other words, the electronic device that wants to join the device group scans the broadcast messages sent by the electronic devices in the device group.
[0089] In each of the at least one broadcast period, at least two of the plurality of predefined broadcast channels transmit broadcast messages from electronic devices in device group #2. The plurality of predefined broadcast channels are broadcast channels used to send broadcast messages during the neighbor discovery process, and may be, for example, a plurality of broadcast channels predefined by a protocol.
[0090] In one possible design, each broadcast period occupies one time slot. In the same time slot, at least two electronic devices in the first device group send broadcast messages on different broadcast channels.
[0091] The multiple electronic devices in device group #2 must synchronize their time before sending broadcast information. It should be understood that the electronic devices in device group #2 start sending broadcast messages at the same time, and the time interval between any two broadcast messages is the same. This means that the time interval between any two broadcast periods in the multiple broadcast periods is the same, thus preventing resource collisions between broadcast messages.
[0092] After time synchronization, each electronic device in device group #2 sequentially transmits broadcast messages on different broadcast channels. For example, the multiple broadcast channels include 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. Electronic device #1 transmits broadcast messages on the first, second, and third broadcast channels in different broadcast time periods. Electronic device #2 transmits broadcast messages on the channel following the broadcast channel on which electronic device #1 transmits its broadcast message, i.e., on the second broadcast channel, the third broadcast channel, and the first broadcast channel in that order. Electronic device #3 transmits broadcast messages on the channel following the broadcast channel on which electronic device #2 transmits its broadcast message, i.e., on the third broadcast channel, the first broadcast channel, and the second broadcast channel in that order. As can be seen from the foregoing, the electronic devices in the first device group have been time synchronized. It can be seen that for the first broadcast time period, broadcast messages from electronic device #1, electronic device #2, and electronic device #3 are transmitted on the three broadcast channels, respectively. Electronic device #4 randomly selects a broadcast channel (e.g., the first broadcast channel) for scanning and can scan a broadcast message from any of the electronic devices. During the second broadcast period, three broadcast channels transmit broadcast messages from electronic device #3, electronic device #1, and electronic device #2, respectively. Electronic device #4 randomly selects a broadcast channel to scan and receives a broadcast message from one of these electronic devices. For the sake of brevity, each individual broadcast message is not detailed here.
[0093] It can be understood that the first electronic device's receipt of the first broadcast message sent by the second electronic device indicates that at least one broadcast period overlaps with the first electronic device's scanning period in the time domain. In other words, only when at least one broadcast period overlaps with the first electronic device's scanning period in the time domain can the first electronic device scan the first broadcast message sent by the second electronic device during the scanning period.
[0094] Figure 7 This is an example of electronic device #4 scanning and discovering device group #2 provided in the embodiment of the present application. Figure 7As shown, taking the BLE scenario as an example, the electronic devices in device group #2 include electronic device #1, electronic device #2, and electronic device #3, and the multiple broadcast channels include channel 37, channel 38, and channel 39. Electronic device #3 sends broadcast messages on channels 37, 38, and 39, respectively. Electronic device #2 sends broadcast messages on channels 38, 39, and 37, respectively. Electronic device #1 sends broadcast messages on channels 39, 37, and 38, respectively. It can be seen that within each broadcast period, any of the multiple broadcast channels transmits a broadcast message. The scanning period of electronic device #4 overlaps with the second and third broadcast periods in the time domain. Therefore, when electronic device #4 selects channel 37 and starts scanning during the scanning period, it can scan the broadcast message sent by electronic device #1. It can be seen that if electronic device #4 selects channel 38 to start scanning during the scanning period, it can also scan the broadcast message sent by electronic device #3. If electronic device #4 selects channel 39 to start scanning during the scanning period, it can also scan the broadcast message sent by electronic device #2. In other words, no matter which broadcast channel electronic device #4 selects to scan, it can scan the broadcast message, which greatly improves the probability of successful scanning of electronic device #4 and shortens the scanning time.
[0095] It can be understood that the number of electronic devices in device group #2 mentioned above is consistent with the number of broadcast channels, but the following two situations may also exist.
[0096] One possible scenario is that the number of electronic devices in device group #2 is greater than the number of broadcast channels. For example, if the number of electronic devices in 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 device group #2, and these M electronic devices simultaneously send broadcast messages on different broadcast channels. Where N>M≥1, and M and N are integers.
[0097] Based on the above processing method, for the same electronic device, if the interval between broadcasts on a certain broadcast channel is greater than the time it takes to send a broadcast message, and if the interval between two broadcast messages sent by the electronic device on the broadcast channel is short, the electronic device needs to be frequently woken up, resulting in high power consumption. If the interval between two broadcast messages sent by the electronic device on the broadcast channel is long, the broadcast channel may become idle, and when another electronic device scans, it will not be able to scan it. Therefore, when the number of electronic devices in a device group is greater than the number of broadcast channels, the electronic devices in the device group can also use the following method to send broadcast messages.
[0098] One possible implementation is to increase the time interval between two broadcast messages sent by any electronic device in the device group on the same channel. During this time interval, other devices in the device group can send broadcast messages on the channel respectively.
[0099] For example, electronic device #3 originally sends a broadcast message on channel 37 every 3 minutes. When the number of devices in the device group is greater than 3, the interval between two broadcast messages sent by electronic device #3 on channel 37 can be increased to 5 minutes. Then, during this time period, other devices in the device group can send broadcast messages on the channel separately. For example, Figure 7 In the example, on channel 37, the time interval between two broadcast messages sent by electronic device #3 increases. That is, the channel may be idle during the time interval between the broadcast messages sent by electronic device #3, electronic device #1, and electronic device #2. Then, other electronic devices in the device group, such as electronic device #5, can send broadcast messages between electronic device #3 and electronic device #1, and electronic device #6 can send broadcast messages after electronic device #2, thereby increasing the probability that electronic device #4 will scan the broadcast message.
[0100] Another possible scenario is that the number of electronic devices in device group #2 is smaller than the number of broadcast channels. For example, if the number of electronic devices in device group #2 is N and the number of broadcast channels is M, then N broadcast channels are selected from the M broadcast channels, and the electronic devices in the first device group transmit broadcast messages on these N broadcast channels. In other words, within the same time domain, MN of the M broadcast channels are idle. However, within the same time domain, at least two broadcast channels are transmitting broadcast messages. This increases the probability of successful scanning by electronic device #4, compared to only one broadcast channel. This also shortens the scanning time.
[0101] In summary, it can be seen that the number of electronic devices sending broadcast messages on multiple broadcast channels in each broadcast period is not greater than the number of the multiple broadcast channels.
[0102] S620: Electronic device #4 establishes a connection with electronic device #1 based on the first broadcast message received from electronic device #1 on the first broadcast channel.
[0103] It should be understood that Figure 6 In the illustrated embodiment, electronic device #1 is an example of the second electronic device.
[0104] Electronic device #4 randomly selects a broadcast channel to scan during the scanning period. Assume that electronic device #4 scans a first broadcast message on a first broadcast channel, where the first broadcast channel is any one of multiple broadcast channels. After electronic device #4 scans the first broadcast message, it determines the electronic device that sent the first broadcast message based on the first broadcast message, for example Figure 7 As shown in , electronic device #4 scans channel 37 during a scanning period and receives a broadcast message on channel 37. Based on the broadcast message, electronic device #4 determines that the electronic device that sent the broadcast message is electronic device #1.
[0105] It can be understood that the electronic device corresponds to the address of the electronic device sending the broadcast message, and the data part of the broadcast message carries the sending address of the electronic device. Electronic device #4 obtains the address of the electronic device that sends the broadcast message based on the broadcast message, and can determine the electronic device that sends the broadcast message.
[0106] Assume that electronic device #1 is the electronic device scanned and discovered by electronic device #4. After electronic device #4 receives the first broadcast message sent by electronic device #1, it sends a message requesting connection to electronic device #1. Correspondingly, electronic device #1 sends a response message to electronic device #4, and the two establish a connection.
[0107] S630: Electronic device #4 obtains a first neighbor description table from electronic device #1.
[0108] After electronic device #4 establishes a connection with electronic device #1, electronic device #4 obtains the first neighbor description table from electronic device #1, and based on the local device information, updates the first neighbor description table to obtain the second neighbor description table. It can be understood that electronic device #4 is newly added to device group #2 to form a new device group, which is recorded as device group #3. Device group #3 is an example of the second device group. The second device group may include a greater or lesser number of electronic devices, which is not limited in the embodiments of the present application. Among them, the second neighbor description table includes the device information of each electronic device in device group #2 and the device information of electronic device #4. In other words, compared with the first neighbor description table, the device information of electronic device #4 is added to the second neighbor description table, that is, the second neighbor description table includes the device information of each electronic device in device group #3.
[0109] In one possible implementation, after electronic device #4 establishes a connection with electronic device #1, electronic device #1 sends the first neighbor description table to electronic device #4. Electronic device #4 then obtains the first neighbor description table and updates it based on local device information to obtain a second neighbor description table. It is understood that after receiving the first neighbor description table, electronic device #4 can add its own device information to the first neighbor description table to form the second neighbor description table.
[0110] Accordingly, electronic device #1 updates the first neighbor description table. One possible design is that electronic device #4 can send its own device information to electronic device #1. Electronic device #1 then adds electronic device #4's device information to the first neighbor description table, updates the first neighbor description table, and obtains the second neighbor description table. Another possible design is that electronic device #4 can directly send the second neighbor description table to electronic device 1. After receiving the second neighbor description table, electronic device #1 can obtain the device information of all electronic devices in device group #3.
[0111] It should be understood that electronic device #4 can notify all remaining electronic devices in device group #2 of local device information, triggering the remaining electronic devices to update the first neighbor description table to form a second neighbor description table.
[0112] It should also be understood that electronic device #4 can perform time synchronization based on PTP. The specific steps can be referred to known technologies and will not be described in detail here for the sake of brevity.
[0113] S640: Electronic device #4 establishes a connection with electronic device #3 based on the device information of electronic device #3.
[0114] It should be understood that electronic device #3 is an example of a third electronic device. Electronic device #4 can also select any electronic device in device group #3 with which it wishes 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, electronic device #4 can obtain 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 sent a broadcast message) based on the second neighbor description table. In other words, since time synchronization has been performed, electronic device #4 can calculate the broadcast channel and broadcast time of the electronic device (e.g., electronic device #3) with which it wishes to establish a connection based on the above information. After electronic device #4 determines the channel and time on which electronic device #3 with which it wishes to establish a connection will next broadcast or listen, it establishes a connection with electronic device #3 at the same time and on the same channel. Whether electronic device #3 broadcasts or listens is determined based on a state machine. For example, if electronic device #3 is in a broadcasting state, electronic device #4 listens; if electronic device #3 is in a listening state, electronic device #4 broadcasts.
[0115] It should be understood that each electronic device in device group #3 can share the device information in the second neighbor description table. Therefore, if any two electronic devices in device group #3 want to establish a connection, they can establish a connection by querying the device information in the second neighbor description table without the need for another scanning process, which speeds up the connection rate and improves the user experience.
[0116] Taking electronic device #4 as an example, assuming that the electronic device that electronic device #4 wants to establish a connection with is electronic device #3, then electronic device #4 can know the time and broadcast channel when electronic device #3 sends the broadcast message based on local calculations, and obtain the device information of electronic device #3 from the second neighbor description table. After electronic device #4 is disconnected from electronic device #1, it sends a connection request to electronic device #3 to establish a connection with electronic device #3. Among them, electronic device #4 calculates the channel and time on which electronic device #3 will broadcast based on the broadcast channel and broadcast time of electronic device #3 in the neighbor description table. Electronic device #4 can listen on the channel and establish a connection with electronic device #3. Alternatively, if electronic device #3 is in a listening state, electronic device #4 can broadcast at the same time and on the same channel.
[0117] It should be noted that the broadcast time of electronic device #3 in the neighbor description table is the time when electronic device #3 last sent a broadcast message. Electronic device #4 can query the neighbor description table for the number of electronic devices in device group #3 and the broadcast time of electronic device #3, and calculate the next broadcast time of electronic device #3 based on a predefined algorithm. The same predefined algorithm is used for all devices in device group #3.
[0118] It should be understood that electronic devices in device group #3 need to determine whether each other has left device group #3, thereby updating the information in the second neighbor description table. For example, if electronic device #3 has left device group #3, but its device information still exists in the second neighbor description table, then electronic device #4 will attempt to establish a connection with electronic device #3 based on this device information, resulting in a connection failure. Therefore, timely updating of the information in the second neighbor description table is crucial.
[0119] One possible design is to determine whether the other party has left device group #3 by whether a heartbeat packet is received. Taking electronic device #4 as an example, if electronic device #4 receives a heartbeat packet sent by electronic device #1, the time when electronic device #1 joined the device group is updated in the second neighbor description table. For example, if the original timestamp is 9:00 and the aging time is 3 minutes, and the heartbeat packet is received at 9:02, the timestamp is updated to 9:02, and the aging time does not need to be updated. For another example, if the original timestamp is 9:00 and the aging time is 9:03, and the heartbeat packet is received at 9:02, the timestamp is updated to 9:02 and the aging time is updated to 9:05. It can be understood that because the timestamp is updated, the aging time is calculated based on the updated timestamp. Therefore, when the aging time is a specific time point, the aging time also needs to be updated. If electronic device #1 reaches the aging time, but electronic device #4 still has not received the heartbeat packet, it is determined that electronic device #1 has left device group #3, and a first message is sent to the other electronic devices in device group #3. The first message is used to indicate that electronic device #1 has left device group #3.
[0120] Another possible design is to notify the other party to leave device group #3 by directly sending a message indicating leaving. Taking electronic device #4 as an example, if electronic device #4 wants to leave device group #3, a second message is directly sent to the other electronic devices in device group #3, indicating that electronic device #4 is leaving device group #3.
[0121] Based on the above technical solution, electronic devices within the same device group can send broadcast messages via different broadcast channels during the same broadcast period. This allows any electronic device that is joining the group to discover any of the electronic devices in the group by scanning any of the broadcast channels. Furthermore, a neighbor description table containing device information for all electronic devices in the group is shared with each electronic device in the group. This allows the joining electronic device to discover all electronic devices in the group after discovering any one of the electronic devices in the group. This improves the probability of the joining electronic device successfully scanning surrounding electronic devices, shortens the probabilistic delay in discovering surrounding electronic devices, and reduces the duration of the neighbor discovery process for the joining electronic device. Furthermore, the greater the number of electronic devices in the group, the more significant the effect of this solution. This is because the more electronic devices there are, the lower the probability of successful point-to-point scanning of a single device, and the greater the probabilistic delay that may be introduced. However, using the above solution, any node in the group can be quickly discovered, significantly reducing neighbor discovery latency and improving the user experience.
[0122] It should be understood that each step of the above method can be completed by an integrated logic circuit of the hardware in the processor or by instructions in the form of software. The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or can be executed by a combination of hardware and software modules in the processor. The software module can be located in a storage medium mature in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.
[0123] The present application also provides an electronic device, which may include: a memory and a processor. The memory may be used to store a computer program; the processor may be used to call the computer program in the memory so that the electronic device executes Figure 4 and Figure 6 The method of any one of the embodiments shown.
[0124] The present application also provides a chip system, which includes at least one processor for implementing the above Figure 4 and Figure 6 The method described in any one of the embodiments shown, for example, receiving or processing the data and / or information involved in the above method.
[0125] In one possible design, the chip system further includes a memory, which is used to store program instructions and data, and the memory is located inside or outside the processor.
[0126] The chip system can be composed of chips, or can include chips and other discrete devices.
[0127] The present application also provides a computer program product, which includes: a computer program (also referred to as code, or instruction), which, when executed, enables an electronic device to implement Figure 4 or Figure 6 The method of any one of the embodiments shown.
[0128] The present application also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program (also referred to as code or instruction). When the computer program is executed, the electronic device realizes Figure 4 or Figure 6 The method of any one of the embodiments shown.
[0129] It should be understood that the processor in the embodiments of the present application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above-mentioned method embodiment can be completed by hardware integrated logic circuits in the processor or by software instructions. The above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above-mentioned method.
[0130] It should also be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used 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 link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0131] The terms "unit," "module," and the like used in this specification may be used to refer to a computer-related entity, hardware, firmware, a combination of hardware and software, software, or software in execution.
[0132] Those skilled in the art will appreciate that the various illustrative logical blocks and steps described in conjunction with the embodiments disclosed herein can be implemented using electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application. In the several embodiments provided in this application, it should be understood that the disclosed devices, equipment, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed can be through some interface, indirect coupling or communication connection of devices or units, and can be electrical, mechanical, or other forms.
[0133] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0134] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0135] In the above embodiments, the functions of each functional unit can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can 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 process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can 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 can be transmitted from one website, computer, server or data center to another website, computer, server or data center via wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state disk (SSD)).
[0136] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0137] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A neighbor discovery method, characterized in that: include: The first electronic device scans a first broadcast channel within a scanning period, where the first broadcast channel is any one of a plurality of predefined broadcast channels, and in each broadcast period of at least one broadcast period, at least two of the plurality of broadcast channels transmit broadcast messages, where the broadcast messages are from electronic devices in the first device group. The first electronic device establishes a connection with the second electronic device based on receiving a first broadcast message sent by the second electronic device on the first broadcast channel, where 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, where the first neighbor description table includes device information of each electronic device in the first device group.
2. The method according to claim 1, wherein The number of electronic devices that transmit broadcast messages on the multiple broadcast channels within each broadcast period is no greater than the number of the multiple broadcast channels.
3. The method according to 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 of each electronic device in a second device group, and the second device group includes the first electronic device and the electronic devices in the first device group.
4. The method according to claim 1, wherein 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 the time when the device last sent a broadcast message.
5. The method according to claim 4, wherein The device information may also include one or more of the following: The ID of the device group, the number of electronic devices in the device group, a link quality parameter, a timestamp, and an aging time, wherein the link quality parameter is used to indicate link quality.
6. The method according to any one of claims 1 to 2, 4 to 5, characterized in that The method further comprises: The first electronic device establishes a connection with the third electronic device based on device information of the third electronic device, where the third electronic device is an electronic device in the first device group that the first electronic device wants to establish a connection with, and the third electronic device is any electronic device in the first device group.
7. An electronic device, characterized in that: The electronic device includes at least one processor configured to execute a computer program so as to cause the electronic device to perform the following operations: Scanning a first broadcast channel within a scanning period, where the first broadcast channel is any one of a plurality of predefined broadcast channels, and in each broadcast period of at least one broadcast period, at least two of the plurality of broadcast channels transmit broadcast messages, the broadcast messages being from electronic devices in the first device group; establishing a connection with a second electronic device based on a first broadcast message sent by a second electronic device received on the first broadcast channel, where 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, where the first neighbor description table includes device information of each electronic device in the first device group.
8. The electronic device according to claim 7, wherein: The number of electronic devices that transmit broadcast messages on the multiple broadcast channels within each broadcast period is no greater than the number of the multiple broadcast channels.
9. The electronic device according to claim 7 or 8, wherein: The at least one processor is configured to execute a computer program so that the electronic device performs the following operations: Based on local device information, the first neighbor description table is updated to obtain a second neighbor description table; the second neighbor description table includes device information of each electronic device in a second device group, and the second device group includes the electronic device and the electronic devices in the first device group.
10. The electronic device according to claim 7, wherein: 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 the time when the device last sent a broadcast message.
11. The electronic device according to claim 10, wherein: The device information may also include one or more of the following: The ID of the device group, the number of electronic devices in the device group, a link quality parameter, a timestamp, and an aging time, wherein the link quality parameter is used to indicate link quality.
12. The electronic device according to any one of claims 7 to 8, 10 to 11, characterized in that: The at least one processor is configured to execute a computer program so that the electronic device performs the following operations: A connection is established with the third electronic device based on device information of the third electronic device, where the third electronic device is an electronic device in the first device group that the electronic device wishes to establish a connection with, and the third electronic device is any electronic device in the first device group.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the electronic device executes the method according to any one of claims 1 to 6.
14. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, causes an electronic device to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Access method and control method of cognitive wireless MESH network
CN101697635A
Neighbor discovery over multiple channels for wireless networks with directional antennas
US20100142460A1