Wireless Mesh ad hoc network method and device, electronic equipment and storage medium

文档序号:1942014 发布日期:2021-12-07 浏览:19次 中文

阅读说明:本技术 无线Mesh自组网方法、装置、电子设备及存储介质 (Wireless Mesh ad hoc network method and device, electronic equipment and storage medium ) 是由 陈锦辉 宋德超 唐杰 李喜林 于 2021-08-23 设计创作,主要内容包括:本发明实施例涉及一种无线Mesh自组网方法、装置、电子设备及存储介质,方法包括:在第一蓝牙设备上电后,启动蓝牙扫描;当扫描到任一第二蓝牙设备发送的蓝牙信号时,确定蓝牙信号的RSSI值;基于RSSI值,确定第一蓝牙设备与任一所述第二蓝牙设备之间的距离值;将距离值发送给无线Mesh自组网设备,以使无线Mesh自组网设备基于距离值确定与第一蓝牙设备之间满足设定条件的第二蓝牙设备,以及将第一蓝牙设备、与第一蓝牙设备之间满足设定条件的第二蓝牙设备进行无线Mesh自组网。由此,可以实现自动发现满足设定条件的第一蓝牙设备与第二蓝牙设备,进而智能地对满足设定条件的第一蓝牙设备与第二蓝牙设备进行无线Mesh组网,而无需用户手动地进行配网,提升用户体验。(The embodiment of the invention relates to a wireless Mesh ad hoc network method, a device, electronic equipment and a storage medium, wherein the method comprises the following steps: starting Bluetooth scanning after the first Bluetooth device is powered on; when the Bluetooth signal sent by any second Bluetooth device is scanned, the RSSI value of the Bluetooth signal is determined; determining a distance value between the first Bluetooth device and any one of the second Bluetooth devices based on the RSSI value; and sending the distance value to the wireless Mesh ad hoc network device, so that the wireless Mesh ad hoc network device determines a second Bluetooth device meeting the set conditions with the first Bluetooth device based on the distance value, and performs wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting the set conditions with the first Bluetooth device. From this, can realize automatic discovery and satisfy first bluetooth equipment and the second bluetooth equipment of setting for the condition, and then carry out wireless Mesh network deployment to satisfying the first bluetooth equipment and the second bluetooth equipment of setting for the condition intelligently, and need not the user and join in marriage the net manually, promote user experience.)

1. A wireless Mesh ad hoc network method is applied to a first Bluetooth device, and the method comprises the following steps:

starting Bluetooth scanning after the first Bluetooth equipment is powered on;

when a Bluetooth signal sent by any second Bluetooth device is scanned, determining the RSSI value of the Bluetooth signal;

determining a distance value between the first Bluetooth device and any one of the second Bluetooth devices based on the RSSI value;

and sending the distance value to wireless Mesh ad hoc network equipment, so that the wireless Mesh ad hoc network equipment determines second Bluetooth equipment meeting set conditions with the first Bluetooth equipment based on the distance value, and performs wireless Mesh ad hoc network on the first Bluetooth equipment and the second Bluetooth equipment meeting the set conditions with the first Bluetooth equipment.

2. The method of claim 1, wherein when there are a plurality of scanned Bluetooth signals transmitted by the second Bluetooth device, the determining a distance between the first Bluetooth device and any one of the second Bluetooth devices based on the RSSI value comprises:

grouping the RSSI values of all the scanned Bluetooth signals, wherein the RSSI values in the same group correspond to the same second Bluetooth equipment, and the RSSI values in different groups correspond to different second Bluetooth equipment;

for each of the packets, determining a target RSSI value from a plurality of the RSSI values that the packet comprises; determining a distance value between the first Bluetooth device and the second Bluetooth device corresponding to the packet based on the target RSSI value.

3. The method of claim 2, wherein said determining a target RSSI value from a plurality of said RSSI values included in said packet comprises:

filtering a plurality of the RSSI values comprised by the packet;

determining an average of a plurality of the RSSI values in the packet after filtering;

determining the average value as a target RSSI value.

4. The method of claim 3, wherein the filtering the plurality of RSSI values included in the packet comprises:

determining a mean u and a variance σ of a plurality of the RSSI values included in the packet;

and filtering RSSI values which do not belong to a set range in the packet, wherein the set range is (u-k sigma, u + k sigma), and k is a preset value.

5. A wireless Mesh ad hoc network method is applied to a wireless Mesh ad hoc network device, and the method comprises the following steps:

receiving a distance value sent by a first Bluetooth device, wherein the distance value is used for representing the distance between the first Bluetooth device and a second Bluetooth device;

determining a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value;

and performing wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting set conditions with the first Bluetooth device.

6. The method of claim 5, wherein determining a second Bluetooth device satisfying a predetermined condition with the first Bluetooth device based on the distance value comprises:

determining first position information of the first Bluetooth device based on distance values between the first Bluetooth device and at least three second Bluetooth devices and known second position information of the at least three second Bluetooth devices by using a least square method;

and determining a second Bluetooth device in the same set space with the first Bluetooth device as a second Bluetooth device meeting set conditions with the first Bluetooth device based on the first position information and the second position information.

7. A wireless Mesh ad hoc network device applied to a first Bluetooth device, the device comprising:

the scanning module is used for starting Bluetooth scanning after the first Bluetooth equipment is powered on;

the RSSI determining module is used for determining the RSSI value of the Bluetooth signal when the Bluetooth signal sent by any second Bluetooth device is scanned;

a distance determining module, configured to determine a distance value between the first bluetooth device and any one of the second bluetooth devices based on the RSSI value;

and the sending module is used for sending the distance value to the wireless Mesh ad hoc network device so as to enable the wireless Mesh ad hoc network device to determine a second Bluetooth device meeting the set conditions between the wireless Mesh ad hoc network device and the first Bluetooth device based on the distance value, and to carry out wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting the set conditions between the first Bluetooth device and the first Bluetooth device.

8. A wireless Mesh ad hoc network device is applied to wireless Mesh ad hoc network equipment, and the device comprises:

the receiving module is used for receiving a distance value sent by a first Bluetooth device, wherein the distance value is used for representing the distance between the first Bluetooth device and a second Bluetooth device;

the device determining module is used for determining a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value;

and the networking module is used for performing wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting set conditions with the first Bluetooth device.

9. An electronic device, comprising: the processor is used for executing a wireless Mesh ad hoc network program stored in the memory so as to realize the wireless Mesh ad hoc network method of any one of claims 1-4 or 5-6.

10. A storage medium storing one or more programs, the one or more programs being executable by one or more processors to implement the wireless Mesh ad hoc network method of any one of claims 1 to 4 or 5 to 6.

Technical Field

The embodiment of the invention relates to the technical field of Bluetooth, in particular to a wireless Mesh ad hoc network method, a wireless Mesh ad hoc network device, electronic equipment and a storage medium.

Background

The wireless Mesh ad hoc network is a novel wireless network technology completely different from the traditional wireless network, and is widely applied by virtue of the advantages of strong reliability, easiness in expansion and the like.

In an exemplary application scenario, the wireless Mesh ad hoc network is applied to a smart home system. However, in the prior art, when multiple smart home devices are subjected to wireless Mesh ad hoc network, a user needs to manually distribute a network based on the position of the smart home device, which causes low efficiency of the distribution network and is easy to make mistakes, thereby affecting user experience.

In view of the above technical problems, no effective solution has been proposed at present.

Disclosure of Invention

In view of this, embodiments of the present invention provide a wireless Mesh ad hoc network method, an apparatus, an electronic device, and a storage medium, so as to automatically discover a first bluetooth device and a second bluetooth device that meet a set condition, and further intelligently perform wireless Mesh networking on the first bluetooth device and the second bluetooth device that meet the set condition, thereby improving network distribution efficiency and improving user experience.

In a first aspect, an embodiment of the present invention provides a wireless Mesh ad hoc network method, where the method includes:

starting Bluetooth scanning after the first Bluetooth equipment is powered on;

when a Bluetooth signal sent by any second Bluetooth device is scanned, determining the RSSI value of the Bluetooth signal;

determining a distance value between the first Bluetooth device and any one of the second Bluetooth devices based on the RSSI value;

and sending the distance value to wireless Mesh ad hoc network equipment, so that the wireless Mesh ad hoc network equipment determines second Bluetooth equipment meeting set conditions with the first Bluetooth equipment based on the distance value, and performs wireless Mesh ad hoc network on the first Bluetooth equipment and the second Bluetooth equipment meeting the set conditions with the first Bluetooth equipment.

In a possible embodiment, when there are a plurality of scanned bluetooth signals transmitted by the second bluetooth devices, the determining a distance between the first bluetooth device and any one of the second bluetooth devices based on the RSSI value includes:

grouping the RSSI values of all the scanned Bluetooth signals, wherein the RSSI values in the same group correspond to the same second Bluetooth equipment, and the RSSI values in different groups correspond to different second Bluetooth equipment;

for each of the packets, determining a target RSSI value from a plurality of the RSSI values that the packet comprises; determining a distance value between the first Bluetooth device and the second Bluetooth device corresponding to the packet based on the target RSSI value.

In a possible embodiment, the determining a target RSSI value from a plurality of RSSI values included in the packet comprises:

filtering a plurality of the RSSI values comprised by the packet;

determining an average of a plurality of the RSSI values in the packet after filtering;

determining the average value as a target RSSI value.

In a possible embodiment, the filtering the plurality of RSSI values included in the packet includes:

determining a mean u and a variance σ of a plurality of the RSSI values included in the packet;

and filtering RSSI values which do not belong to a set range in the packet, wherein the set range is (u-k sigma, u + k sigma), and k is a preset value.

In a second aspect, an embodiment of the present invention provides a wireless Mesh ad hoc network method, where the method includes:

receiving a distance value sent by a first Bluetooth device, wherein the distance value is used for representing the distance between the first Bluetooth device and a second Bluetooth device;

determining a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value;

and performing wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting set conditions with the first Bluetooth device.

In a possible embodiment, determining a second bluetooth device satisfying a set condition with the first bluetooth device based on the distance value includes:

determining first position information of the first Bluetooth device based on distance values between the first Bluetooth device and at least three second Bluetooth devices and known second position information of the at least three second Bluetooth devices by using a least square method;

and determining a second Bluetooth device in the same set space with the first Bluetooth device as a second Bluetooth device meeting set conditions with the first Bluetooth device based on the first position information and the second position information.

In a third aspect, an embodiment of the present invention provides a wireless Mesh ad hoc network device, where the device includes:

the scanning module is used for starting Bluetooth scanning after the first Bluetooth equipment is powered on;

the RSSI determining module is used for determining the RSSI value of the Bluetooth signal when the Bluetooth signal sent by any second Bluetooth device is scanned;

a distance determining module, configured to determine a distance value between the first bluetooth device and any one of the second bluetooth devices based on the RSSI value;

and the sending module is used for sending the distance value to the wireless Mesh ad hoc network device so as to enable the wireless Mesh ad hoc network device to determine a second Bluetooth device meeting the set conditions between the wireless Mesh ad hoc network device and the first Bluetooth device based on the distance value, and to carry out wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting the set conditions between the first Bluetooth device and the first Bluetooth device.

In a fourth aspect, an embodiment of the present invention provides a wireless Mesh ad hoc network device, where the device includes:

the receiving module is used for receiving a distance value sent by a first Bluetooth device, wherein the distance value is used for representing the distance between the first Bluetooth device and a second Bluetooth device;

the device determining module is used for determining a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value;

and the networking module is used for performing wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting set conditions with the first Bluetooth device.

In a fifth aspect, an embodiment of the present invention provides an electronic device, including: the processor is configured to execute a wireless Mesh ad hoc network program stored in the memory to implement the wireless Mesh ad hoc network method according to any one of the first aspect and the second aspect.

In a sixth aspect, an embodiment of the present invention provides a storage medium, where the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the wireless Mesh ad hoc network method according to any one of the first aspect or the second aspect.

The technical scheme provided by the embodiment of the invention is that after a first Bluetooth device is powered on, Bluetooth scanning is started, when a Bluetooth signal sent by any second Bluetooth device is scanned, an RSSI value of the Bluetooth signal is determined, a distance value between the first Bluetooth device and any second Bluetooth device is determined based on the RSSI value, the distance value is sent to a wireless Mesh ad hoc network device, so that the wireless Mesh ad hoc network device determines a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value, and the first Bluetooth device and the second Bluetooth device meeting the set condition with the first Bluetooth device are subjected to wireless Mesh ad hoc network, the first Bluetooth device and the second Bluetooth device meeting the set condition can be automatically discovered, and the first Bluetooth device and the second Bluetooth device meeting the set condition can be intelligently subjected to wireless Mesh networking without manually distributing a network by a user, the distribution network efficiency is improved, and the user experience is improved.

Drawings

Fig. 1 is a schematic diagram of an application scenario according to an embodiment of the present invention;

fig. 2 is a flowchart of an embodiment of a wireless Mesh ad hoc network method according to an exemplary embodiment of the present invention;

fig. 3 is a schematic diagram illustrating that the RSSI value probability distribution of the bluetooth signal received by the receiving end satisfies the normal distribution when the distance is constant;

fig. 4 is a flowchart of another embodiment of a wireless Mesh ad hoc network method according to an exemplary embodiment of the present invention;

fig. 5 is a schematic diagram of a networking architecture obtained by applying the wireless Mesh ad hoc network method according to the embodiment of the present invention;

fig. 6 is a block diagram of an embodiment of a wireless Mesh ad hoc network device according to an exemplary embodiment of the present invention;

fig. 7 is a block diagram of another embodiment of a wireless Mesh ad hoc network device according to an exemplary embodiment of the present invention;

fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.

Detailed Description

In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

For the convenience of understanding of the embodiments of the present invention, the system architecture and application scenario related to the embodiments of the present invention are first explained with reference to the drawings.

Fig. 1 is a schematic view of an application scenario according to an embodiment of the present invention. The application scenario shown in fig. 1 includes: bluetooth devices 11-16, and wireless Mesh ad hoc network devices 17.

As an exemplary application scenario, the Bluetooth devices 11-16 may be smart home devices, such as a smart air conditioner, a smart range hood, a smart water purifier, a smart electric cooker, a smart television, a smart sweeper, and the like. Further, as shown in FIG. 1, it is assumed that the Bluetooth devices 11-14 are located in the same space, such as a kitchen, and the Bluetooth devices 15-16 and the Bluetooth devices 1-14 are located in different spaces, such as a living room.

In the application scenario, by applying the technical scheme provided by the embodiment of the invention, the bluetooth devices in the same space, such as the bluetooth devices 11 to 14, can be found, and then the bluetooth devices in the same space are subjected to wireless Mesh ad hoc network.

The method according to the present invention is further explained with reference to the following embodiments, which are not to be construed as limiting the embodiments of the present invention.

Referring to fig. 2, a flowchart of an embodiment of a wireless Mesh ad hoc network method according to an exemplary embodiment of the present invention is provided. As an embodiment, the process shown in fig. 2 may be applied to a bluetooth device (hereinafter referred to as a first bluetooth device for convenience of description) with unknown location information, such as the bluetooth device 11. As shown in fig. 2, the process may include the following steps:

step 201, after the first bluetooth device is powered on, bluetooth scanning is started.

In one embodiment, the first bluetooth device may automatically turn on the bluetooth scanning function after first powering on.

In another embodiment, after the first bluetooth device is powered on, the bluetooth scan function may be started by the first bluetooth device by triggering the bluetooth start button on the first bluetooth device.

The first bluetooth device may scan at least one bluetooth broadcast channel (e.g., three channels 37, 38, and 39) for bluetooth signals after initiating a bluetooth scan.

Furthermore, it should be noted that the first bluetooth device will continue to scan for a period of time, such as 1 minute, after the bluetooth scan is initiated, that is, the first bluetooth device will continue to scan for at least one bluetooth broadcast channel for a period of time.

Step 202, when the bluetooth signal sent by any second bluetooth device is scanned, the RSSI value of the bluetooth signal is determined.

First, the second bluetooth device refers to a bluetooth device other than the first bluetooth device in the whole application scenario, such as the bluetooth devices 12 to 16.

The second bluetooth device may start the bluetooth broadcast under the power-on condition, for example, the second bluetooth device may automatically start the bluetooth broadcast function after being powered on, or the second bluetooth device starts the bluetooth broadcast function by triggering the broadcast button on the second bluetooth device after being powered on. The second bluetooth device may transmit a bluetooth signal through at least one bluetooth broadcast channel (e.g., three channels 37, 38, and 39) after the bluetooth broadcast function is activated.

The second bluetooth device may continuously transmit bluetooth signals over the at least one bluetooth broadcast channel for a period of time, similar to the first bluetooth device continuously scanning the at least one bluetooth broadcast channel for a period of time as described above.

Based on this, after starting bluetooth scanning, the first bluetooth device can scan the bluetooth signal that the second bluetooth device sent, and for a certain second bluetooth device, the first bluetooth device can scan a plurality of bluetooth signals of this second bluetooth device. The plurality of bluetooth signals here includes the same bluetooth signal transmitted by the second bluetooth device at the same time through the plurality of bluetooth broadcast channels, and a plurality of bluetooth signals transmitted by the second bluetooth device at different times.

In the embodiment of the invention, when the first Bluetooth device scans the Bluetooth signal sent by the second Bluetooth device, the RSSI value of the Bluetooth signal is determined.

And step 203, determining a distance value between the first Bluetooth device and any second Bluetooth device based on the RSSI value.

As shown in step 202, for a second bluetooth device, the first bluetooth device may scan multiple bluetooth signals of the second bluetooth device during the scanning process, and then determine RSSI values of the multiple bluetooth signals.

Based on this, in this step 203, the first bluetooth device first groups the RSSI values of all the scanned bluetooth signals, so as to assign the RSSI values corresponding to the same second bluetooth device to the same group, and assign the RSSI values corresponding to different second bluetooth devices to different groups, that is, the RSSI values in the same group correspond to the same second bluetooth device, and the RSSI values in different groups correspond to different second bluetooth devices; the first bluetooth device then determines, for each packet, a target RSSI value from a plurality of RSSI values included in the packet, and finally determines, based on the target RSSI value, a distance value between the first bluetooth device and a second bluetooth device corresponding to the packet. This means that, in the embodiment of the present invention, the first bluetooth device determines, for each second bluetooth device, the distance value between the first bluetooth device and the second bluetooth device based on the RSSI values of the plurality of bluetooth signals transmitted by the second bluetooth device collectively. Through this kind of processing, can effectively avoid because of the RSSI value of bluetooth signal can receive the interference of environmental factor, lead to RSSI value inaccurate enough to the distance that determines based on single RSSI value is great with the condition of actual distance error.

In one embodiment, the RSSI values included in the packets may be filtered to filter out outliers (e.g., values that are too large or too small), and then an average of the RSSI values in the filtered packets is determined and determined as the target RSSI value.

Furthermore, it is found through statistics that, within a certain period of time, when the distance is fixed (that is, the distance between the receiving end and the transmitting end of the bluetooth signal is fixed), the RSSI value probability distribution of the bluetooth signal received by the receiving end satisfies the normal distribution, see fig. 3, which is a schematic diagram that the RSSI value probability distribution of the bluetooth signal received by the receiving end satisfies the normal distribution when the distance is fixed.

Based on this, in an embodiment, the plurality of RSSI values included in the packet may be filtered by: first, an average value u and a variance σ of a plurality of RSSI values included in a packet are determined based on the following formula (one) and formula (two), respectively, and then RSSI values that do not fall within a set range of (u-k σ, u + k σ) where k is a preset value, for example, 0.8, are filtered out from the packet.

In this step 203, determining a distance value between the first bluetooth device and the second bluetooth device corresponding to the packet based on the target RSSI value may be implemented based on the following formula (three):

in the formula (iii), d represents a distance value, RSSI represents a target RSSI value, a represents an RSSI value when the transmitting end and the receiving end are spaced apart by 1 meter, and m represents an environmental attenuation factor. In an open space, m is generally 1.6-1.8, and in a complex space with barriers, m is generally 4-6.

And 204, sending the distance value to the wireless Mesh ad hoc network device, so that the wireless Mesh ad hoc network device determines a second Bluetooth device meeting the set conditions with the first Bluetooth device based on the distance value, and performs wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting the set conditions with the first Bluetooth device.

In one embodiment, the setting condition may refer to being in the same space, such as a kitchen.

In an embodiment, the setting condition may refer to a close distance, wherein the close distance may be characterized by a distance value being smaller than a set distance threshold.

As to how the wireless Mesh ad hoc network device determines the second bluetooth device satisfying the setting condition with the first bluetooth device based on the distance value, the following is explained by the flow shown in fig. 4, and detailed description is omitted here.

The technical scheme provided by the embodiment of the invention is that after a first Bluetooth device is powered on, Bluetooth scanning is started, when a Bluetooth signal sent by any second Bluetooth device is scanned, an RSSI value of the Bluetooth signal is determined, a distance value between the first Bluetooth device and any second Bluetooth device is determined based on the RSSI value, the distance value is sent to a wireless Mesh ad hoc network device, so that the wireless Mesh ad hoc network device determines a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value, and the first Bluetooth device and the second Bluetooth device meeting the set condition with the first Bluetooth device are subjected to wireless Mesh ad hoc network, the first Bluetooth device and the second Bluetooth device meeting the set condition can be automatically discovered, and the first Bluetooth device and the second Bluetooth device meeting the set condition can be intelligently subjected to wireless Mesh networking without manually distributing a network by a user, the distribution network efficiency is improved, and the user experience is improved.

Referring to fig. 4, a flowchart of another embodiment of a wireless Mesh ad hoc network method according to an exemplary embodiment of the present invention is provided. As an embodiment, the flow shown in fig. 4 may be applied to a wireless Mesh ad hoc network device. As shown in fig. 4, the process may include the following steps:

step 401, receiving a distance value sent by a first bluetooth device, where the distance value is used to represent a distance between the first bluetooth device and a second bluetooth device.

As to how the first bluetooth device obtains the distance value between the first bluetooth device and the second bluetooth device, refer to the description in the flow illustrated in fig. 2, which is not described herein again.

And 402, determining a second Bluetooth device meeting the set conditions with the first Bluetooth device based on the distance value.

In one embodiment, the setting condition may refer to being in the same space, such as a kitchen.

In an embodiment, the setting condition may refer to a close distance, wherein the close distance may be characterized by a distance value being smaller than a set distance threshold.

It should be noted that, when the setting condition indicates that the devices are in the same space, it is not accurate to determine whether the devices are in the same space only according to the distance value, for example, in a home scene, if a living room and a kitchen are adjacent, it is likely that the smart home devices in the living room are closer to the smart home devices in the kitchen, but the smart home devices are not in the same space. Since it is more accurate to determine whether the bluetooth devices are located in the same space according to the location information, in this step 402, the location information of the first bluetooth device (hereinafter referred to as first location information for convenience of description) is determined, and then the second bluetooth device located in the same space as the first bluetooth device is determined based on the first location information of the first bluetooth device and the location information of the second bluetooth device (hereinafter referred to as second location information for convenience of description).

How to determine the first location information of the first bluetooth device is described below:

based on the least square method positioning principle, when the position information (represented by two-dimensional coordinate values) of three nodes and the distance value between each of the three nodes and the unknown position node are known, the position information of the unknown position node can be solved based on the least square method.

Specifically, it is assumed that the position information of three known nodes is (x1, x2), (x2, y2), and (x3, y3), and the distance value between each of the three nodes and the unknown position node (the position information to be solved is (x, y)) is d1、d2、d3The following set of equations may be listed:

then, by solving the above equation set, the following formula (four) is obtained, i.e., (x, y) is solved:

it can be seen that, in this step 402, determining, based on the distance value, a second bluetooth device that satisfies the setting condition with the first bluetooth device includes: and determining first position information of the first Bluetooth device based on the distance values between the first Bluetooth device and at least three second Bluetooth devices and known second position information of the at least three second Bluetooth devices by using a least square method, and then determining the second Bluetooth device which is in the same set space with the first Bluetooth device as the second Bluetooth device meeting the set conditions with the first Bluetooth device based on the first position information and the second position information.

And step 403, performing wireless Mesh ad hoc network on the first bluetooth device and a second bluetooth device meeting set conditions with the first bluetooth device.

Fig. 5 is a schematic diagram of a networking architecture obtained by applying the wireless Mesh ad hoc network method provided by the embodiment of the present invention. In FIG. 5, nodes A-J, L-N are in the same space and are added to the same networking architecture, while K, O two nodes are removed from the networking architecture because they are in other spaces.

The technical scheme provided by the embodiment of the invention is that after a first Bluetooth device is powered on, Bluetooth scanning is started, when a Bluetooth signal sent by any second Bluetooth device is scanned, an RSSI value of the Bluetooth signal is determined, a distance value between the first Bluetooth device and any second Bluetooth device is determined based on the RSSI value, the distance value is sent to a wireless Mesh ad hoc network device, so that the wireless Mesh ad hoc network device determines a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value, and the first Bluetooth device and the second Bluetooth device meeting the set condition with the first Bluetooth device are subjected to wireless Mesh ad hoc network, the first Bluetooth device and the second Bluetooth device meeting the set condition can be automatically discovered, and the first Bluetooth device and the second Bluetooth device meeting the set condition can be intelligently subjected to wireless Mesh networking without manually distributing a network by a user, the distribution network efficiency is improved, and the user experience is improved.

Corresponding to the embodiment of the wireless Mesh ad hoc network method, the invention also provides an embodiment of the wireless Mesh ad hoc network device.

Referring to fig. 6, a block diagram of an embodiment of a wireless Mesh ad hoc network device according to an exemplary embodiment of the present invention is provided. As an embodiment, the apparatus may be applied to a first bluetooth device, and as shown in fig. 6, the apparatus includes:

the scanning module 61 is configured to start bluetooth scanning after the first bluetooth device is powered on;

an RSSI determining module 62, configured to determine an RSSI value of a bluetooth signal sent by any one of the second bluetooth devices when the bluetooth signal is scanned;

a distance determining module 63, configured to determine a distance value between the first bluetooth device and any one of the second bluetooth devices based on the RSSI value;

a sending module 64, configured to send the distance value to a wireless Mesh ad hoc network device, so that the wireless Mesh ad hoc network device determines, based on the distance value, a second bluetooth device that meets a set condition with the first bluetooth device, and performs wireless Mesh ad hoc network on the first bluetooth device and the second bluetooth device that meets the set condition with the first bluetooth device.

In a possible implementation, the distance determining module 63 is specifically configured to:

when a plurality of scanned Bluetooth signals sent by the second Bluetooth equipment are sent, grouping the RSSI values of all the scanned Bluetooth signals, wherein the RSSI value in the same group corresponds to the same second Bluetooth equipment, and the RSSI values in different groups correspond to different second Bluetooth equipment;

for each of the packets, determining a target RSSI value from a plurality of the RSSI values that the packet comprises; determining a distance value between the first Bluetooth device and the second Bluetooth device corresponding to the packet based on the target RSSI value.

In a possible implementation, the distance determining module 63 determines a target RSSI value from a plurality of RSSI values included in the packet, including:

filtering a plurality of the RSSI values comprised by the packet;

determining an average of a plurality of the RSSI values in the packet after filtering;

determining the average value as a target RSSI value.

In a possible implementation, the distance determining module 63 filters the plurality of RSSI values included in the packet, including:

determining a mean u and a variance σ of a plurality of the RSSI values included in the packet;

and filtering RSSI values which do not belong to a set range in the packet, wherein the set range is (u-k sigma, u + k sigma), and k is a preset value.

Referring to fig. 7, a block diagram of another embodiment of a wireless Mesh ad hoc network device is provided for an exemplary embodiment of the present invention. As an embodiment, the apparatus may be applied to a wireless Mesh ad hoc network device, as shown in fig. 7, and includes:

a receiving module 71, configured to receive a distance value sent by a first bluetooth device, where the distance value is used to represent a distance between the first bluetooth device and a second bluetooth device;

a device determining module 72, configured to determine, based on the distance value, a second bluetooth device that meets a set condition with the first bluetooth device;

a networking module 73, configured to perform wireless Mesh ad hoc networking on the first bluetooth device and the second bluetooth device that meets the set condition with the first bluetooth device.

In a possible implementation, the device-based determination module 72 is specifically configured to:

determining first position information of the first Bluetooth device based on distance values between the first Bluetooth device and at least three second Bluetooth devices and known second position information of the at least three second Bluetooth devices by using a least square method;

and determining a second Bluetooth device in the same set space with the first Bluetooth device as a second Bluetooth device meeting set conditions with the first Bluetooth device based on the first position information and the second position information.

Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 800 shown in fig. 8 includes: at least one processor 801, memory 802, at least one network interface 804, and other user interfaces 803. The various components in the electronic device 800 are coupled together by a bus system 805. It is understood that the bus system 805 is used to enable communications among the components connected. The bus system 805 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 805 in fig. 8.

The user interface 803 may include a touch panel, a touch screen, or the like.

It will be appreciated that the memory 802 in embodiments of the invention may be either volatile memory or nonvolatile memory, or may include both volatile and nonvolatile memory. The non-volatile memory may be a Read-only memory (ROM), a programmable Read-only memory (PROM), an erasable programmable Read-only memory (erasabprom, EPROM), an electrically erasable programmable Read-only memory (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM) which functions as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (staticiram, SRAM), dynamic random access memory (dynamic RAM, DRAM), synchronous dynamic random access memory (syncronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM ), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and direct memory bus RAM (DRRAM). The memory 802 described herein is intended to comprise, without being limited to, these and any other suitable types of memory.

In embodiments of the present invention, processor 801 is configured to perform the method steps provided by the various method embodiments by invoking programs or instructions stored in memory 802, including, for example:

starting Bluetooth scanning after the first Bluetooth device is powered on;

when a Bluetooth signal sent by any second Bluetooth device is scanned, determining the RSSI value of the Bluetooth signal;

determining a distance value between the first Bluetooth device and any one of the second Bluetooth devices based on the RSSI value;

and sending the distance value to wireless Mesh ad hoc network equipment, so that the wireless Mesh ad hoc network equipment determines second Bluetooth equipment meeting set conditions with the first Bluetooth equipment based on the distance value, and performs wireless Mesh ad hoc network on the first Bluetooth equipment and the second Bluetooth equipment meeting the set conditions with the first Bluetooth equipment.

Or receiving a distance value sent by a first Bluetooth device, wherein the distance value is used for representing the distance between the first Bluetooth device and a second Bluetooth device;

determining a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value;

and performing wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting set conditions with the first Bluetooth device.

The methods disclosed in the embodiments of the present invention described above may be implemented in the processor 801 or implemented by the processor 801. The processor 801 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 801. The processor 801 may be a general-purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present invention 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 the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software elements in the decoding processor. The software elements may be located in ram, flash, rom, prom, or eprom, registers, among other storage media that are well known in the art. The storage medium is located in the memory 802, and the processor 801 reads the information in the memory 802, and combines the hardware to complete the steps of the method.

It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or any combination thereof. For a hardware implementation, the processing units may be implemented within one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, micro-controllers, microprocessors, other electronic units configured to perform the functions described herein, or a combination thereof.

For a software implementation, the techniques described herein may be implemented by means of units performing the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.

The electronic device provided in this embodiment may be the electronic device shown in fig. 8, and may execute all the steps of the wireless Mesh ad hoc network method shown in fig. 2 and 4, so as to achieve the technical effect of the wireless Mesh ad hoc network method shown in fig. 2 and 4, and please refer to the description related to fig. 2 and 4 for brevity, which is not described herein again.

The embodiment of the invention also provides a storage medium (computer readable storage medium). The storage medium herein stores one or more programs. Among others, the storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, a hard disk, or a solid state disk; the memory may also comprise a combination of memories of the kind described above.

When one or more programs in the storage medium are executable by one or more processors, the above-described wireless Mesh ad hoc network method performed on the electronic side is implemented.

The processor is used for executing the wireless Mesh ad hoc network program stored in the memory so as to realize the following steps of the wireless Mesh ad hoc network method executed on the electronic equipment side:

starting Bluetooth scanning after the first Bluetooth device is powered on;

when a Bluetooth signal sent by any second Bluetooth device is scanned, determining the RSSI value of the Bluetooth signal;

determining a distance value between the first Bluetooth device and any one of the second Bluetooth devices based on the RSSI value;

and sending the distance value to wireless Mesh ad hoc network equipment, so that the wireless Mesh ad hoc network equipment determines second Bluetooth equipment meeting set conditions with the first Bluetooth equipment based on the distance value, and performs wireless Mesh ad hoc network on the first Bluetooth equipment and the second Bluetooth equipment meeting the set conditions with the first Bluetooth equipment.

Or receiving a distance value sent by a first Bluetooth device, wherein the distance value is used for representing the distance between the first Bluetooth device and a second Bluetooth device;

determining a second Bluetooth device meeting a set condition with the first Bluetooth device based on the distance value;

and performing wireless Mesh ad hoc network on the first Bluetooth device and the second Bluetooth device meeting set conditions with the first Bluetooth device.

Those of skill would further appreciate that the various illustrative components and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative components and steps have been described above generally in terms of their functionality in order to clearly illustrate this interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. 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 invention.

The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied in hardware, a software module executed by a processor, or a combination of the two. A software module may reside in Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are merely exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种蓝牙通信系统和方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类