Method, device and computer readable storage medium for wirelessly measuring Bluetooth frequency offset

文档序号:1326453 发布日期:2020-07-14 浏览:33次 中文

阅读说明:本技术 无线测量蓝牙频偏的方法、装置和计算机可读存储介质 (Method, device and computer readable storage medium for wirelessly measuring Bluetooth frequency offset ) 是由 刘境发 于 2020-03-25 设计创作,主要内容包括:本发明提供了一种无线测量主从设备蓝牙频偏的方法、装置和计算机可读存储介质,该方法通过两次测量数据包的同步时刻来计算频偏,能够便捷地得到蓝牙设备的蓝牙频偏,且成本低廉、抗干扰性强。(The invention provides a method, a device and a computer readable storage medium for wirelessly measuring the Bluetooth frequency offset of master and slave equipment.)

1. A method of wirelessly measuring bluetooth frequency offset, the method comprising the steps of:

s101, establishing Bluetooth connection between the testing device and the device to be tested;

s102, acquiring clock skew of the testing device and the tested device at a first moment, wherein the clock skew is a first clock skew;

s103, at the second moment, acquiring the clock offset of the testing device and the tested device again, wherein the clock offset is the second clock offset;

s104, calculating a change value of the first clock offset and the second clock offset according to the first clock offset and the second clock offset, wherein the change value is a clock offset difference;

and S105, taking a local clock of the testing device as a reference clock, and calculating a frequency offset value of the tested device according to the clock offset difference, the first time and the second time.

2. The method according to claim 1, wherein the local clock of steps S102, 103 is a local clock C L KN defined by bluetooth protocol, and is generated by a local crystal oscillator of the testing device and the device under test.

3. The method according to claim 1, wherein the local clock of the test apparatus, specifically the local clock generated by the calibrated local crystal oscillator of the test apparatus, is used as the reference clock in step S105.

4. The method of claim 1, wherein the step S102, 103 of obtaining the clock offset between the testing device and the device under test comprises:

when the test device is used as Bluetooth slave equipment, the test device acquires clock offset at synchronous time when receiving a data packet;

when the test device is used as a Bluetooth master device, the device under test acquires clock offset at synchronous time through the device under test when receiving a data packet, and transmits the clock offset to the test device.

5. The method of claim 4, wherein the synchronization time is an access code completion time of a classic Bluetooth packet.

6. The method of claim 4, wherein the synchronization time is a preamble and access address receiving completion time of a B L E data packet.

7. The method according to any of claims 1-6, wherein the first time of step S102 is separated from the second time of step S103 by a predetermined time interval.

8. The method of claim 7, wherein the predetermined time interval is 0.25-2 s.

9. An apparatus applying the method of any one of claims 1 to 8, comprising the testing apparatus and the device under test, wherein the testing apparatus and the device under test are connected wirelessly through classic bluetooth, and the frequency offset value of the device under test is obtained by obtaining clock offsets of the testing apparatus and the device under test at different times.

10. The apparatus according to claim 9, wherein the obtaining of the clock offsets of the testing apparatus and the device under test at different times is to obtain the local clock offsets at the synchronous times by the testing apparatus/the device under test when the testing apparatus/the device under test receives the data packets.

11. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1-8.

Technical Field

The invention relates to the technical field of Bluetooth testing, in particular to a method and a device for wirelessly measuring Bluetooth frequency offset of master and slave equipment and a computer readable storage medium.

Background

Currently, a crystal oscillator is used as a clock source in a bluetooth scheme to provide a clock reference for 2.4G RF signals. Due to the manufacturing process level, the crystal oscillators produced by different manufacturers usually have a certain frequency deviation. These fine frequency differences are multiplied by the phase-locked loop and amplified, resulting in a large bluetooth frequency offset.

The bluetooth frequency offset is a difference value between an actual communication carrier frequency and a theoretical communication carrier frequency, when the difference value exceeds a certain range, errors are introduced during signal demodulation, and the communication is unstable or even cannot be communicated due to an overlarge error rate. Therefore, in order to make bluetooth devices manufactured by different manufacturers compatible and stably connected with each other, the bluetooth specification requires that the frequency offset should be controlled within a certain range. In actual production, frequency deviation is difficult to be consistent due to crystal oscillator difference and parasitic capacitance influence. Measuring the bluetooth frequency offset is important in the bluetooth scheme production process.

In the existing scheme for measuring frequency offset, two ways are included:

firstly, the crystal oscillator frequency (or after frequency division of 2.4G signals) is output to a chip pin, and the frequency deviation of low-frequency signals is measured by a frequency meter, the method is simple and direct, but in actual batch production, flying wires need to be welded to an instrument, and then the flying wires are removed after measurement, so that the workload is huge; or the thimble contacts the PCB test point to measure, the test mould needs to be customized, and the process is various.

Secondly, 2.4G signals are directly measured to obtain Bluetooth frequency deviation, the method is complex to measure, high-temperature test equipment such as a frequency spectrograph or a Bluetooth comprehensive tester is needed, the test cost is high, the frequency spectrograph is easily interfered by 2.4G signals (such as an induction cooker, wifi and other Bluetooth) in the surrounding environment in the test process, and the Bluetooth comprehensive tester can resist 2.4G interference, but the equipment cost is high, the operation interface is complex, and the method is not suitable for production operation of workers.

Disclosure of Invention

In view of the above problems, the present invention provides a method, an apparatus, and a computer readable storage medium for wirelessly measuring bluetooth frequency offset of a master device and a slave device, which can conveniently obtain bluetooth frequency offset of a bluetooth device, and have low cost and strong anti-interference performance.

In a first aspect, the present invention provides a method for wirelessly measuring a bluetooth frequency offset, the method comprising the following steps:

s101, establishing Bluetooth connection between the testing device and the device to be tested;

s102, acquiring clock skew of the testing device and the tested device at a first moment, wherein the clock skew is a first clock skew;

s103, at the second moment, acquiring the clock offset of the testing device and the tested device again, wherein the clock offset is the second clock offset;

s104, calculating a change value of the first clock offset and the second clock offset according to the first clock offset and the second clock offset, wherein the change value is a clock offset difference;

and S105, taking a local clock of the testing device as a reference clock, and calculating a frequency offset value of the tested device according to the clock offset difference, the first time and the second time.

Specifically, the local clock C L KN specified by the bluetooth protocol in steps S102 and S103 is generated by the local crystal oscillators of the test apparatus and the device under test.

Specifically, in step S105, the local clock of the test apparatus is used as the reference clock, specifically, the local clock generated by the calibrated local crystal oscillator of the test apparatus is used as the reference clock.

Specifically, the acquiring the clock offset between the testing device and the device under test in steps S102 and S103 includes:

when the test device is used as Bluetooth slave equipment, the test device acquires clock offset at synchronous time when receiving a data packet;

when the test device is used as a Bluetooth master device, the device under test acquires clock offset at synchronous time through the device under test when receiving a data packet, and transmits the clock offset to the test device.

Specifically, the synchronization time is the time when the access code of the classic bluetooth packet is received.

Specifically, the synchronization time is the time when the preamble and the access address of the B L E packet are received.

Specifically, the first time in step S102 is separated from the second time in step S103 by a predetermined time interval.

Specifically, the preset time interval is 0.25-2 s.

In a second aspect, the invention provides a device using the method, which includes the testing device and the device under test, wherein the testing device and the device under test are wirelessly connected through classic bluetooth, and the frequency offset value of the device under test is obtained by obtaining the clock offsets of the testing device and the device under test at different times.

Specifically, the obtaining of the clock skew of the testing device and the device under test at different times includes obtaining, by the testing device/the device under test, the local clock skew at a synchronous time when the testing device/the device under test receives the data packet.

In a third aspect, the invention provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the above method.

Compared with the fly-line measurement in the prior art, the method provided by the invention is simpler and more convenient to operate and has higher efficiency through a wireless connection mode.

The 68bits access code of the classic Bluetooth, the 8bits lead code of the B L E and the 32bits access address of the B L E are unique in Bluetooth communication and can be effectively distinguished from other 2.4G signals.

The frequency offset is calculated by measuring the synchronous time of the data packet twice, compared with a Bluetooth comprehensive tester, the frequency offset measuring method is simpler to realize, the measuring device is low in cost and simple and convenient to operate, and the frequency offset measuring method is suitable for being used in a mass production environment.

Drawings

Fig. 1 is a schematic diagram of steps of a method for wirelessly measuring a bluetooth frequency offset according to an embodiment of the present invention.

Fig. 2 is a timing diagram of clock offset when a device under test has positive frequency offset, where the device under test is used as a slave device according to an embodiment of the present invention.

Fig. 3 is a timing diagram of clock offset when the test apparatus provided in the first embodiment of the present invention is used as a slave device and a negative frequency offset exists in the device under test.

Fig. 4 is a clock offset timing diagram of a device under test with positive frequency offset when the device under test serves as a master device according to an embodiment of the present invention.

Fig. 5 is a clock offset timing diagram of a device under test with negative frequency offset, where the device under test is used as a master device according to an embodiment of the present invention.

Fig. 6A is a timing diagram of clock skew for classical bluetooth packet reception by a master device and a slave device according to an embodiment of the present invention.

Fig. 6B is a timing diagram illustrating clock skew for packet reception by a master device B L E according to an embodiment of the present invention.

Fig. 7 is a flowchart of the apparatus according to the second embodiment of the present invention.

Detailed Description

The technical solution of the present invention will be described clearly and completely with reference to the accompanying drawings in the following embodiments of the present invention, and it is obvious that the described embodiments are only a part of the present invention, and not all of it. Thus, the following detailed description of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step, are within the scope of the present invention.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种多天线接收赋形前后SNR测量方法及装置

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!