CN113747405B - Method for reducing BLE device discovery delay and BLE device - Google Patents

Method for reducing BLE device discovery delay and BLE device Download PDF

Info

Publication number
CN113747405B
CN113747405B CN202110898539.3A CN202110898539A CN113747405B CN 113747405 B CN113747405 B CN 113747405B CN 202110898539 A CN202110898539 A CN 202110898539A CN 113747405 B CN113747405 B CN 113747405B
Authority
CN
China
Prior art keywords
period
advertisement
pair
scanning
duty cycle
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110898539.3A
Other languages
Chinese (zh)
Other versions
CN113747405A (en
Inventor
沈中
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xidian University
Original Assignee
Xidian University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xidian University filed Critical Xidian University
Priority to CN202110898539.3A priority Critical patent/CN113747405B/en
Publication of CN113747405A publication Critical patent/CN113747405A/en
Application granted granted Critical
Publication of CN113747405B publication Critical patent/CN113747405B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention discloses a method for reducing BLE equipment discovery delay and BLE equipment; the method comprises the following steps: calculating greatest common divisor of scanning period and advertising period according to scanning window length and tauScanning window length T using maximum convention w Updated to satisfy the equationIs a multiple of 625 mus, and selects a pair of advertising period and scanning period (T a ,T s ) The greatest common divisor of the two isAnd the error between the corresponding scanning duty cycle and advertisement duty cycle and the scanning duty cycle and advertisement duty cycle in the device is minimum; in the period-determined advertising mode, according to T w τ, δ and the selected (T a ,T s ) Performing bluetooth device discovery; in pseudo-random delayed advertising mode, T will be selected a Minus 5ms, and performs bluetooth device discovery with reference to other parameters in the period-determined ad pattern. The invention can reduce the discovery delay of the Bluetooth equipment.

Description

Method for reducing BLE device discovery delay and BLE device
Technical Field
The invention belongs to the technical field of Bluetooth communication, and particularly relates to a method for reducing BLE (Bluetooth Low Energy ) equipment discovery delay and BLE equipment.
Background
Bluetooth low energy is a widely used wireless communication technology, and most smart phones and smart wearable devices (such as smart watches, bracelets, etc.) support BLE functions at present.
The BLE specification divides BLE devices into scanners and advertisers by role. BLE devices first complete device discovery prior to communication. BLE specifies 40 channels, three of which, 37, 38 and 39, are advertising channels for device discovery. The BLE device as the scanner periodically scans 37, 38 and 39 three advertisement channels, while the BLE device as the advertiser periodically triggers advertisement events, one advertisement being sent to each of the three advertisement channels. Device discovery is completed when a scanner BLE device receives an advertisement packet sent by an advertiser BLE device over an advertisement channel. Then, both can establish a connection and transmit data. However, when the advertising periods of two advertiser BLE devices are the same and a collision of advertising packets occurs, the collision may continue to occur, causing the devices to be undetectable. To address this problem, BLE is specified in release 4.2, where the advertiser adds a pseudo-random delay of 0-10 ms before each advertising event. Such an advertisement pattern with increased pseudo-random delay is referred to as a pseudo-random delay advertisement pattern, as compared to a period-determined advertisement pattern without pseudo-random delay.
However, the increase in pseudo-random delay also brings about an increase in device discovery delay, making BLE devices difficult to discover.
Disclosure of Invention
In order to reduce discovery delay in a bluetooth device discovery process, the invention provides a method for reducing BLE device discovery delay and BLE device.
The technical problems to be solved by the invention are realized by the following technical scheme:
in a first aspect, the present invention provides a method for reducing a delay in discovery of a BLE device, applied to the BLE device, the method comprising:
according to the scanning window length T set in the current BLE equipment w And a first time period tau, a reference number is calculated by using a preset calculation rule and is used as a scanning period T to be determined s And advertising period T a The greatest common divisor of bothThe first duration is the duration of sending one advertisement by BLE equipment;
by using the greatest common divisorFor the scanning window length T w Updating is performed so that the updated scanning window length T w To satisfy equation->And satisfies T w Is a multiple of 625 mus;
by using the greatest common divisorScreening the elements in the alternative advertisement period and the alternative scanning period set to obtain an advertisement period screening set and a scanning period screening set;
selecting a pair of advertisement period and scanning period (T) from the advertisement period screening set and the scanning period screening set a ,T s ) The pair of advertisement period and scanning period (T a ,T s ) Meets the screening condition and the greatest common divisor of the two isThe screening conditions include: under a preset error evaluation criterion, according to (T a ,T s ) The calculated pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) A pair of advertisement duty ratio and scanning duty ratio +.>The error between them is minimal;
when the BLE device is operating in the period-determined advertising mode, the updated scanning window length T is used w A first time period tau, a second time period delta, and a selected pair of advertisement period and scanning period (T a ,T s ) Performing bluetooth device discovery; the second duration is the duration of interception of the channel after the BLE equipment sends an advertisement;
when the BLE device is operating in a pseudo-randomly delayed advertisement mode, the selected advertisement period T a Subtracting the time length after 5ms as fixed advertisement interval and according to the updated scanning window length T w A first time period tau, a second time period delta and a selected scanning period T are set in the current BLE device s Bluetooth device discovery is performed.
Preferably, the calculation rule includes:
judgingWhether or not it is a multiple of 3;
if yes, calculate the greatest common divisor
If not, calculating the greatest common divisor
Preferably, the greatest common divisor is utilizedScreening the elements in the alternative advertisement period and the alternative scanning period set to obtain an advertisement period screening set and a scanning period screening set, wherein the method comprises the following steps:
screening out the greatest common divisor from the alternative scanning period setForm a scanning period screening set;
screening the greatest common divisor from the alternative advertisement period setElements that are multiples of 3, and not multiples of 3, constitute an advertising period screening set.
Preferably, a pair of advertisement period and scanning period (T a ,T s ) Comprising:
screening out the greatest common divisor from the advertisement period screening set and the scanning period screening set to be equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleFirst error between->
Selecting a period pair (T a ,T s )。
Preferably, a pair of advertisement period and scanning period (T a ,T s ) Comprising:
screening out the greatest common divisor from the advertisement period screening set and the scanning period screening set to be equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleSecond error between->
Selecting a period pair (T a ,T s )。
Preferably, a pair of advertisement period and scanning period (T a ,T s ) Comprising:
screening out the greatest common divisor from the advertisement period screening set and the scanning period screening set to be equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleEuclidean distance between;
selecting a period pair (T a ,T s )。
Preferably, the method comprises, for each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) Comprising:
using the period pair (T a ,T s ) In a scanning period T s Calculating a scanning duty cycleAnd uses the period pair (T a ,T s ) Advertisement period T in a Calculate an advertisement duty cycle +.>
In a second aspect, the present invention provides a BLE device, including a processor, a bluetooth communication module, a memory, and a communication bus, where the processor, the bluetooth communication module, and the memory complete communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement any one of the method steps described above for reducing a BLE device discovery delay when executing the program stored on the memory.
The method for reducing the discovery delay of the BLE equipment provided by the invention firstly comprises the steps of according to the currently set scanning window length T in the BLE equipment w And a first time period tau to calculate a scanning period T s And advertising period T a The greatest common divisor of bothThe greatest common divisor is then used to determine the scan window length T w Updating; and screening from the candidate advertisement period and the candidate scanning period set by using the greatest common divisor, and further selecting a pair of optimal advertisement period and scanning period (T) from the advertisement period screening set and the scanning period screening set a ,T s ) The pair of optimal (T a ,T s ) Satisfy the greatest common divisor +.>And based on a pair of the scanning duty cycle and the advertising duty cycle (D a ,D s ) A pair of a scanning duty cycle and an advertisement duty cycle which are currently set in a BLE device +.>The error between them is minimal. Therefore, the invention can reduce the discovery delay when the BLE device executes the discovery of the Bluetooth device according to the working parameters by carrying out a series of screening and updating on the scanning window length, the advertising period and the scanning period of the BLE device. And, the inventionThe way to explicitly update and filter these operating parameters is applicable not only to BLE devices operating in pseudo-random delay advertising mode, but also to BLE devices operating in period-determined advertising mode.
The present invention will be described in further detail with reference to the accompanying drawings.
Drawings
Fig. 1 is a flow chart of a method for reducing a discovery delay of a BLE device according to an embodiment of the present invention;
FIGS. 2 and 3 show the results of simulation verification of an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a BLE device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to specific examples, but embodiments of the present invention are not limited thereto.
BLE device performing device discovery involves a plurality of operating parameters, including: scan period T when BLE device is the scanner s Scan window length T w And an advertising period T when BLE device is acting as advertiser a The duration τ of one advertisement being sent and the duration δ of the listening channel after sending the advertisement. Wherein, for BLE device operating in pseudo-random delay advertisement mode, there is also an operating parameter of pseudo-random delay R when serving as advertisement party, and the value of R is not more than 10ms at maximum.
The inventors have found in implementing the present invention that the discovery delay of a BLE device is very sensitive to the above-mentioned operating parameters, irrespective of whether the BLE device is operating in a pseudo-random delay advertisement mode or in a period-determined advertisement mode, and that a small change in any one of the operating parameters may result in a multiple increase in the discovery delay. For example, the advertisement period increases or decreases for a minimum duration 625 μs that the BLE specification allows for variation, and the discovery delay may also vary by a factor of several. Therefore, in order to reduce the discovery delay in the bluetooth device discovery process, the embodiment of the invention provides a method for reducing the discovery delay of a BLE device and the BLE device. The method for reducing the discovery delay of the BLE device provided by the embodiment of the present invention can be applied to the BLE device provided by the embodiment of the present invention, and of course, any other electronic device having a bluetooth communication function can use the method provided by the embodiment of the present invention.
First, a method for reducing a discovery delay of a BLE device provided by an embodiment of the present invention will be described in detail. Referring to fig. 1, the method comprises the steps of:
s10: according to the scanning window length T set in the current BLE equipment w And a first time period tau, a reference number is calculated by using a preset calculation rule and is used as a scanning period T to be determined s And advertising period T a The greatest common divisor of both
Wherein the first duration is a duration for which the BLE device sends one advertisement.
The calculation rules used in this step may include: judgingWhether or not it is a multiple of 3; if yes, calculate the greatest common divisor +.>If not, calculate the greatest common divisor +.>Wherein the symbol->Represents rounding up, symbol->Representing a rounding down. It should be noted that, unless otherwise indicated, the units of parameters in various equations and formulas given in the embodiments of the present invention are μs.
Scanning of BLE devices in a period-determined advertisement mode according to the specification of the BLE specificationBoth the description period and the advertisement period should be multiples of 625 mus; the fixed advertising interval and the scanning period of the BLE device in pseudo-random delayed advertising mode should also be multiples of 625 mus; thus the greatest common divisor calculated in step S10The 625 mus may be divided.
S20: by using greatest common divisorFor scan window length T w Updating is performed so that the updated scanning window length T w To satisfy equation->And satisfies T w Is a multiple of 625 mus.
The BLE specification also specifies a scan window length T w The requirement is a multiple of 625 mu s, and the embodiment of the invention further aims at T on the basis w The new requirement is put forward, namely T w It is also desirable to satisfy the minimum integer that is the equation above.
S30: by using greatest common divisorAnd screening the elements in the alternative advertisement period and the alternative scanning period set to obtain an advertisement period screening set and a scanning period screening set.
Specifically, the greatest common divisor is selected from the alternative scanning period setForm a scanning period screening set; and screening out the greatest common divisor from the alternative advertisement period set>Elements that are multiples of 3, and not multiples of 3, constitute an advertising period screening set。
S40: selecting a pair of advertisement period and scanning period (T) from the advertisement period screening set and the scanning period screening set a ,T s ) The pair of advertisement period and scanning period (T a ,T s ) Meets the screening condition and the greatest common divisor of the two is
The screening conditions included: under a preset error evaluation criterion, according to (T a ,T s ) The calculated pair of scan duty cycle and advertisement duty cycle (D a ,D s ) A pair of scan duty cycle and advertisement duty cycle set in the current BLE deviceThe error between them is minimal.
S50: when the BLE device is operating in the period-determined advertising mode, the updated scanning window length T is used w A first time period tau, a second time period delta, and a selected pair of advertisement period and scanning period (T a ,T s ) Bluetooth device discovery is performed.
The second duration delta is the duration of listening to the channel after the BLE device sends an advertisement.
When the BLE device operates in the period-determined advertisement mode, it specifically performs the bluetooth device discovery process as follows: when the BLE device works as an advertiser, the advertising period T is set a The work as an advertiser is performed cyclically. Wherein, in each advertising period T a In the inside, the BLE device transmits advertisement packets on three channels 37, 38, 39 and listens to the channels after transmission, the transmission duration of the advertisement packets on each channel being equal to τ, the listening duration being δ, the total duration spent transmitting advertisements being equal to (τ+δ) ×3. When the BLE device operates as a scanner, the scan period T is set to s The operation as the scanner is performed cyclically. Wherein, in each scanning period T s In, BLE device is in scanning window T w Internal scans 37, 38, 39One of the channels; stopping scanning after the time exceeds the scanning window until the current scanning period T s Ending and then entering the next scanning period T s . In addition, in a plurality of consecutive scan periods T s In this, the BLE device can scan 37, 38, 39 three channels in a polled manner.
S50': when the BLE device is operating in a pseudo-randomly delayed advertisement mode, the selected advertisement period T a Subtracting the time length after 5ms as fixed advertisement interval and according to the updated scanning window length T w Setting a first time period tau, a second time period and a selected scanning period T in the current BLE device s Bluetooth device discovery is performed.
For BLE devices operating in pseudo-random delay advertisement mode, the advertisement period is not fixed due to the pseudo-random delay, but the duration available for sending advertisements is fixed, which is referred to as the fixed advertisement interval T l The method comprises the steps of carrying out a first treatment on the surface of the In the embodiment of the present invention, the advertisement period T selected in step S40 a Minus 5ms as a fixed advertising interval T l Wherein T is a Is a multiple of 625. Mu.s, and 5ms is 8 times 625. Mu.s, thus T a T obtained by subtracting 5ms l It is still possible to ensure a multiple of 625 mus, meeting the requirements of the BLE specification. Where 5ms is taken from the mean of the pseudo-random delays.
When the BLE device operates in the pseudo-random delay advertisement mode, it specifically performs the bluetooth device discovery procedure as follows: when the BLE device works as an advertiser, a fixed advertising interval T is passed in each advertising period l After a pseudo-random delay R, advertisement packets are sent on three channels 37, 38, 39 and the channels are intercepted after the sending, and the next advertisement period is entered after the completion. In addition, the operation of the BLE device as a scanner is the same as in the period-determined advertisement mode, and a detailed description thereof will be omitted.
The method for reducing the discovery delay of the BLE equipment provided by the embodiment of the invention is firstly based on the currently set scanning window length T in the BLE equipment w And a first time period tau to calculate a scanning period T s And advertising period T a The greatest common divisor of bothThe greatest common divisor is then used to determine the scan window length T w Updating; and screening from the candidate advertisement period and the candidate scanning period set by using the greatest common divisor, and further selecting a pair of optimal advertisement period and scanning period (T) from the advertisement period screening set and the scanning period screening set a ,T s ) The pair of optimal (T a ,T s ) Satisfy the greatest common divisor +.>And based on a pair of the scanning duty cycle and the advertising duty cycle (D a ,D s ) A pair of a scanning duty cycle and an advertisement duty cycle which are currently set in a BLE device +.>The error between them is minimal. Therefore, the embodiment of the invention can reduce the discovery delay when the BLE device executes the discovery of the Bluetooth device according to the working parameters by carrying out a series of screening and updating on the scanning window length, the advertising period and the scanning period of the BLE device. Moreover, the method for updating and screening the working parameters is not only suitable for BLE equipment working in a pseudo-random delay advertising mode, but also suitable for BLE equipment working in a period determination advertising mode.
Optionally, in one implementation, a pair of advertisement period and scanning period is selected from the advertisement period screening set and the scanning period screening set in step S40 (T a ,T s ) May include:
(1) Selecting the greatest common divisor from the advertisement period screening set and the scanning period screening set to be equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
(2) For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleFirst error between->
(3) Selecting a period pair (T a ,T s )。
In another implementation, a pair of advertisement period and scanning period is selected from the advertisement period screening set and the scanning period screening set in step S40 (T a ,T s ) May include:
(1) Selecting the greatest common divisor from the advertisement period screening set and the scanning period screening set to be equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
(2) For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleSecond error between->
(3) Selecting a period pair (T a ,T s )。
In yet another implementation, a pair of advertisement period and scanning period is selected from the advertisement period screening set and the scanning period screening set in step S40 (T a ,T s ) May include:
(1) Selecting the greatest common divisor from the advertisement period screening set and the scanning period screening set to be equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
(2) For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleEuclidean distance between;
(3) Selecting a period pair (T a ,T s )。
In the three implementations described above, each cycle pair (T a ,T s ) A pair of scan duty cycle and advertisement duty cycle (D a ,D s ) Comprising:
using the period pair (T a ,T s ) In a scanning period T s Calculating a scanning duty cycleAnd uses the period pair (T a ,T s ) Advertisement period T in a Calculate an advertisement duty cycle +.>
In order to make the solution of the embodiment of the present invention more clear, a detailed description of the method provided by the embodiment of the present invention will be given below.
First, assume that the currently set scanning window length T w 10000 μs, τ=376 μs, δ=437 μs, scan duty cycleAdvertisement duty cycle->
Wherein, the liquid crystal display device comprises a liquid crystal display device,is a multiple of 3, so the scanning period T is calculated s And advertising period T a Maximum common divisor->
Then, the currently set scanning window length T w Updating to make the updated scanning window length T w Is satisfied withAnd is a multiple of 625 mus, thus T w =17×625=1062μs。
The false device selects the scanning period set as follows:
{300×625,301×625,302×625,…,339×625,340×625},
the units of the elements in the set are all μs. Due toSo, selecting elements which are multiples of 10000 from the alternative scanning sets, and the scanning period screening sets are:
{304×625,320×625,336×625}。
the fake device selects the advertisement period set as follows:
{80×625,81×625,82×625,…,159×625,160×625},
in the set ofThe units of the elements are μs. Due toSo, selecting elements which are not multiples of 3 and multiples of 10000 from the alternative advertisement period sets, and forming an advertisement period screening set which is as follows:
{80×625,112×625,128×625,160×625}。
then, selecting the advertisement period screening set and the scanning period screening set to meet the screening condition and the greatest common divisor isIs a periodic pair of (a) and (b). Advertisement period screening set and scanning period screening set can form 12 period pairs (T a ,T s ) The method comprises the steps of carrying out a first treatment on the surface of the Wherein the cycle pair (T) satisfying the greatest common divisor 10000 a ,T s ) A total of 8, including: (304× 625,80 ×625), (304× 0625,112 ×1625), (304× 2625,128 ×3625), (304× 4625,160 ×5625), (320× 625,112 ×625), (336× 625,80 ×625), (336× 625,128 ×625), and (336× 625,160 ×625); with these period pairs (T a ,T s ) Corresponding calculated duty cycle combination +.>The method comprises the following steps of: (5.59%, 4.88%), (5.59%, 3.48%), (5.59%, 3.05%), (5.59%, 2.44%), (5.31%, 3.48%), (5.06%, 4.88%), (5.06%, 3.05%), (5.06%, 2.44%).
Wherein (5.06%, 3.05%) is combined with the originally set duty cycleMost closely, the corresponding cycle pair is (336× 625,128 ×625).
To sum up, if a BLE device is operating in a period-determined advertising mode, the advertising period T in the BLE device is determined a Set as T a =128×625=8000 μs, and the scanning period T s Set as T s =336×625=210000 μs. Thus, the BLE device will follow T w =17×625=10625μs、τ=376μs、δ=437μs、T a =8000 μs and T s Operating parameters of 210000 μs to perform bluetooth device discovery. And if the BLE device is operating in pseudo-random delayed advertising mode, the fixed advertising interval T in the BLE device is set to T l =T a -5000 = 128 x 625-5000 = 3000 mus and the scanning period T s Set as T s =336×625=210000 μs. Thus, the BLE device will follow T w =17×625=10625μs、τ=376μs、δ=437μs、/>T l =3000μs、T s Bluetooth device discovery is performed with a pseudo-random delay of no more than 10ms, 210000 μs. Thus, the BLE device can effectively reduce the discovery delay.
In order to verify the beneficial effects of the embodiments of the present invention, the following simulation is performed on the effect of executing bluetooth device discovery using the method provided by the embodiments of the present invention:
emulation 1 BLE device works in period-determined advertisement mode, T s =1270000μs,T w =17×625=10625μs,T a And respectively setting the values to be different values between 0 and 600ms, and performing multiple simulation. The overall simulation results are shown in fig. 2. In FIG. 2, the horizontal axis represents T a The vertical axis represents discovery delay; the solid line is the actual discovery delay obtained by simulating all the working parameters meeting the discovery conditions; the circled dashed line is the expected discovery delay under the working parameters set by the embodiment of the invention, and the dashed line with asterisks is the theoretical discovery delay lower bound corresponding to the working parameters set by the embodiment of the invention. It can be seen from fig. 2 that if the method provided by the embodiment of the present invention is not adopted, it is found that the delay will fluctuate up and down with the variation of the advertisement period value, and the fluctuation is severe and has no obvious rule. By applying the method provided by the embodiment of the invention, the delay is found to be very small and very close to the theoretical lower bound.
Simulation 2, simulation result of BLE device operating in pseudo-random delay advertisement mode, T s =1270000μs,T w =17×625=10625μs,T l =T a -5000, wherein T a Multiple simulations were performed with different values set between 0 and 600ms, respectively. The overall simulation results are shown in fig. 3. In FIG. 3, the horizontal axis represents T a The vertical axis represents expected discovery delay; the solid line is the actual discovery delay obtained by simulating all the working parameters meeting the discovery conditions; the circled dashed line is the expected discovery delay under the operating parameters set by the application of the embodiments of the present invention. It can be seen from fig. 3 that if the method provided by the embodiment of the present invention is not adopted, it is found that the delay will fluctuate up and down with the variation of the advertisement period value, and the fluctuation is severe and has no obvious rule. The method provided by the embodiment of the invention has the advantages that the discovery delay is small and the fluctuation is also small.
The simulation results of fig. 2 and 3 demonstrate the effectiveness of the method provided by the embodiments of the present invention.
Based on the same inventive concept, the embodiment of the present invention further provides a BLE device, as shown in fig. 4, including a processor 401, a bluetooth communication module 402, a memory 403, and a communication bus 404, where the processor 401, the bluetooth communication module 402, and the memory 403 complete communication with each other through the communication bus 404,
a memory 403 for storing a computer program;
the processor 401 is configured to implement any of the method steps described above for reducing the delay of discovery of BLE devices when executing the program stored in the memory 403.
Illustratively, the BLE device described above may include: mobile terminal devices, wearable smart devices, computers, robots, tablet devices, smart terminal devices, and the like, are not limited thereto.
The communication bus mentioned above may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of representation, the figures are only represented with a thick line, but do not represent only one bus or one type of bus.
The bluetooth communication module is used for device discovery between BLE devices, and can also be used for establishing bluetooth connection. In addition, the BLE device may also include other communication modules or interfaces, depending on the actual device type. For example, the mobile terminal device may also include a mobile communication interface or the like.
The Memory may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a micro control unit (Microcontroller Unit, MCU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
It should be noted that, for the BLE device embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and the relevant points are referred to in the description of the method embodiment.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present invention. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Further, one skilled in the art can engage and combine the different embodiments or examples described in this specification.
Although the present application has been described herein in connection with various embodiments, other variations to the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from a review of the figures, the disclosure, and the appended claims.
The foregoing is a further detailed description of the invention in connection with the preferred embodiments, and it is not intended that the invention be limited to the specific embodiments described. It will be apparent to those skilled in the art that several simple deductions or substitutions may be made without departing from the spirit of the invention, and these should be considered to be within the scope of the invention.

Claims (6)

1. A method of BLE device discovery delay, applied to a BLE device, the method comprising:
according to the scanning window length T set in the current BLE equipment w And a first time period tau, a reference number is calculated by using a preset calculation rule and is used as a scanning period T to be determined s And advertising period T a The greatest common divisor of bothThe first duration is the duration of sending one advertisement by BLE equipment;
by using the greatest common divisorFor the scanning window length T w Updating is performed so that the updated scanning window length T w To satisfy equation->And satisfies T w Is a multiple of 625 mus;
from the alternativesScreening out the greatest common divisor from the scanning period setForm a scanning period screening set;
screening out the greatest common divisor from the alternative advertisement period setElements that are multiples of 3, and not multiples of 3, constitute an advertising period screening set;
selecting a pair of advertisement period and scanning period (T) from the advertisement period screening set and the scanning period screening set a ,T s ) The pair of advertisement period and scanning period (T a ,T s ) Meets the screening condition and the greatest common divisor of the two isThe screening conditions include: under a preset error evaluation criterion, according to (T a ,T s ) The calculated pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) A pair of advertisement duty ratio and scanning duty ratio +.>The error between them is minimal;
when the BLE device is operating in the period-determined advertising mode, the updated scanning window length T is used w A first time period tau, a second time period delta, and a selected pair of advertisement period and scanning period (T a ,T s ) Performing bluetooth device discovery; the second duration is the duration of interception of the channel after the BLE equipment sends an advertisement;
when the BLE device is operating in a pseudo-randomly delayed advertisement mode, the selected advertisement period T a Subtracting the time length after 5ms as fixed advertisement interval and according to the updated scanning window length T w When (when)Setting a first duration tau, a second duration delta, and a selected scan period T in a pre-BLE device s Performing bluetooth device discovery;
wherein the calculation rule includes:
judgingWhether or not it is a multiple of 3;
if yes, calculate the greatest common divisor
If not, calculating the greatest common divisor
2. The method according to claim 1, characterized in that a pair of advertisement period and scanning period (T a ,T s ) Comprising:
screening out the greatest common divisor from the advertisement period screening set and the scanning period screening set to be equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleFirst error between->
Selecting a period pair (T a ,T s )。
3. The method according to claim 1, characterized in that a pair of advertisement period and scanning period (T a ,T s ) Comprising:
screening out the greatest common divisor from the advertisement period screening set and the scanning period screening set to be equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleSecond error between->
Selecting a period pair (T a ,T s )。
4. The method according to claim 1, characterized in that a pair of advertisement period and scanning period (T a ,T s ) Comprising:
screening out from the advertisement period screening set and the scanning period screening setThe greatest common divisor is equal toAdvertisement period T of (1) a And a scanning period T s A pair of constituent periods (T a ,T s );
For each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) And calculates the (D a ,D s ) With a currently set pair of advertisement duty cycle and scan duty cycleEuclidean distance between;
selecting a period pair (T a ,T s )。
5. The method according to any one of claims 2 to 4, wherein said step of, for each cycle pair (T a ,T s ) By using the period pair (T a ,T s ) A pair of advertisement duty cycle and scanning duty cycle (D a ,D s ) Comprising:
using the period pair (T a ,T s ) In a scanning period T s Calculating a scanning duty cycleAnd uses the period pair (T a ,T s ) Advertisement period T in a Calculate an advertisement duty cycle +.>
6. The BLE equipment is characterized by comprising a processor, a Bluetooth communication module, a memory and a communication bus, wherein the processor, the Bluetooth communication module and the memory are in communication with each other through the communication bus;
the memory is used for storing a computer program;
the processor is configured to implement the method steps of any one of claims 1 to 5 when executing the program stored on the memory.
CN202110898539.3A 2021-08-05 2021-08-05 Method for reducing BLE device discovery delay and BLE device Active CN113747405B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110898539.3A CN113747405B (en) 2021-08-05 2021-08-05 Method for reducing BLE device discovery delay and BLE device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110898539.3A CN113747405B (en) 2021-08-05 2021-08-05 Method for reducing BLE device discovery delay and BLE device

Publications (2)

Publication Number Publication Date
CN113747405A CN113747405A (en) 2021-12-03
CN113747405B true CN113747405B (en) 2023-08-08

Family

ID=78730270

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110898539.3A Active CN113747405B (en) 2021-08-05 2021-08-05 Method for reducing BLE device discovery delay and BLE device

Country Status (1)

Country Link
CN (1) CN113747405B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116132964B (en) * 2022-12-16 2024-04-16 西安电子科技大学 Parameter setting method for reducing multi-node cooperative discovery delay

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519745A (en) * 2019-08-05 2019-11-29 西安电子科技大学 The neighbor discovering method of greatest common divisor based on cycle length
CN112601199A (en) * 2020-11-13 2021-04-02 西安电子科技大学 Intelligent contact sensing method, device and system based on low-power-consumption Bluetooth
CN112969168A (en) * 2021-02-08 2021-06-15 西安电子科技大学 Method for avoiding maximum value of expected discovery delay of BLE equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8737917B2 (en) * 2009-07-24 2014-05-27 Broadcom Corporation Method and system for a dual-mode bluetooth low energy device
US9699593B2 (en) * 2014-10-07 2017-07-04 Google Inc. Scanning enhancements for short-range wireless devices
EP3035742B1 (en) * 2014-12-16 2018-02-21 Nokia Technologies OY Discovery of a wireless communication device
US9967722B2 (en) * 2016-06-29 2018-05-08 Silicon Laboratories Finland Oy Packet transmission timing parameter discovery for wireless communication synchronization

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110519745A (en) * 2019-08-05 2019-11-29 西安电子科技大学 The neighbor discovering method of greatest common divisor based on cycle length
CN112601199A (en) * 2020-11-13 2021-04-02 西安电子科技大学 Intelligent contact sensing method, device and system based on low-power-consumption Bluetooth
CN112969168A (en) * 2021-02-08 2021-06-15 西安电子科技大学 Method for avoiding maximum value of expected discovery delay of BLE equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Energy-Efficient Neighbor Discovery for the Internet of Things;Zhong Shen等;《IEEE》;全文 *

Also Published As

Publication number Publication date
CN113747405A (en) 2021-12-03

Similar Documents

Publication Publication Date Title
CN110750341B (en) Task scheduling method, device, system, terminal equipment and storage medium
US20200146074A1 (en) Method for random access and terminal device
CN112969168B (en) Method for avoiding maximum value of expected discovery delay of BLE equipment
CN113747405B (en) Method for reducing BLE device discovery delay and BLE device
CN109089225A (en) A kind of system information transmission method, terminal and the network equipment
CN104618316A (en) Method, device and system of safety verification
CN105873173A (en) Graded access overload control method
CN105556905A (en) Page insertion method and device
CN104811563A (en) Method for adjusting working performance of mobile terminal
CN112511312A (en) Assembled consensus method and system
CN110418371A (en) A kind of control method, the network equipment and terminal
CN111310393B (en) Simulation clock generation method and related product
CN114286290A (en) BLE broadcast sending and receiving method, device and system
CN108965378B (en) IO mode identification method, system, equipment and computer storage medium
CN107360262B (en) Software updating method and device
CN112615942A (en) Remote configuration method and device for E1 looped network address code and storage medium
CN102752122B (en) The acquisition device of multidimensional statistics performance data and method in network management
CN111885730A (en) Network scheduling information transmission method and system of server data center
CN106412657B (en) A kind of method and system of set-top box programming sequence code
CN112954744A (en) Access control method and device for mobile terminal
CN105357243A (en) Remote interaction method and apparatus with device in the Internet of things
WO2022174722A1 (en) Wifi signal scanning method and apparatus, and terminal and storage medium
CN112751708B (en) Network management method and system based on TR069 protocol
WO2023186157A1 (en) Random access resource configuration method, apparatus, terminal and network side device
CN110933702B (en) Method and device for processing interference WIFI signal

Legal Events

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