Distance measuring method, distance measuring device, electronic device, and storage medium

文档序号:66846 发布日期:2021-10-01 浏览:28次 中文

阅读说明:本技术 距离测量方法、装置、电子设备及存储介质 (Distance measuring method, distance measuring device, electronic device, and storage medium ) 是由 吕生义 杨强 于 2021-07-16 设计创作,主要内容包括:本申请涉及一种距离测量方法、装置、终端及存储介质,属于通信技术领域。该方法包括:接收目标电子设备的第一蓝牙信号,确定所述第一蓝牙信号的第一信号强度;获取参考信号强度,基于所述参考信号强度对所述第一信号强度进行修正,得到目标信号强度,所述参考信号强度用于指示环境对所述第一蓝牙信号的干扰,且所述参考信号强度为基于本端电子设备发射和接收的蓝牙信号所确定的;基于所述目标信号强度,确定所述目标电子设备与本端电子设备之间的距离。上述方案中确定出的目标信号强度的精确度较高,从而根据该目标信号强度确定出的两个设备之间的距离更加准确,进而提高了距离测量的精确度。(The application relates to a distance measuring method, a distance measuring device, a terminal and a storage medium, and belongs to the technical field of communication. The method comprises the following steps: receiving a first Bluetooth signal of a target electronic device, and determining first signal strength of the first Bluetooth signal; acquiring reference signal strength, and correcting the first signal strength based on the reference signal strength to obtain target signal strength, wherein the reference signal strength is used for indicating the interference of the environment on the first Bluetooth signal, and the reference signal strength is determined based on Bluetooth signals transmitted and received by the local electronic equipment; and determining the distance between the target electronic equipment and the local-end electronic equipment based on the target signal strength. The accuracy of the target signal intensity determined in the scheme is higher, so that the distance between the two devices determined according to the target signal intensity is more accurate, and the accuracy of distance measurement is improved.)

1. A distance measuring method, characterized in that the method comprises:

receiving a first Bluetooth signal of a target electronic device, and determining first signal strength of the first Bluetooth signal;

acquiring reference signal strength, and correcting the first signal strength based on the reference signal strength to obtain target signal strength, wherein the reference signal strength is used for indicating the interference of the environment on the first Bluetooth signal, and the reference signal strength is determined based on Bluetooth signals transmitted and received by the local electronic equipment;

and determining the distance between the target electronic equipment and the local electronic equipment based on the target signal strength.

2. The method of claim 1, wherein the obtaining the reference signal strength comprises:

receiving a second Bluetooth signal of the local-end electronic equipment, and determining second signal strength of the second Bluetooth signal;

and determining the reference signal strength based on the second signal strength and the reference signal strength of the local electronic equipment.

3. The method of claim 2, wherein determining the reference signal strength based on the second signal strength and a reference signal strength of the home electronic device comprises:

taking a difference between the second signal strength and the reference signal strength as the reference signal strength.

4. The method of claim 2, further comprising:

and under the condition that the local-end electronic equipment is in a test environment, determining the reference signal strength of the reference Bluetooth signal through a reference Bluetooth signal transmitted by the local-end electronic equipment, wherein the interference of the test environment on the reference Bluetooth signal is less than an interference threshold value.

5. The method of claim 1, wherein the modifying the first signal strength based on the reference signal strength to obtain a target signal strength comprises:

taking a difference between the first signal strength and the reference signal strength as the target signal strength.

6. The method of claim 1, wherein the local electronic device comprises at least one pair of a transmitting antenna and a receiving antenna; the method further comprises the following steps:

and transmitting Bluetooth signals through the transmitting antenna, and receiving the Bluetooth signals through the receiving antenna.

7. A distance measuring device, characterized in that the device comprises:

the first determining module is used for receiving a first Bluetooth signal of target electronic equipment and determining first signal strength of the first Bluetooth signal;

the correction module is used for acquiring reference signal strength, correcting the first signal strength based on the reference signal strength to obtain target signal strength, wherein the reference signal strength is used for indicating the interference of the environment on the first Bluetooth signal, and the reference signal strength is determined based on the Bluetooth signals transmitted and received by the local electronic equipment;

and the second determining module is used for determining the distance between the target electronic equipment and the local-end electronic equipment based on the target signal strength.

8. The apparatus of claim 7, wherein the modification module comprises:

the first determining unit is used for receiving a second Bluetooth signal of the local-end electronic equipment and determining second signal intensity of the second Bluetooth signal;

and the second determining unit is used for determining the reference signal strength based on the second signal strength and the reference signal strength of the local electronic equipment.

9. A terminal, characterized in that the terminal comprises a processor and a memory; the memory stores at least one program code for execution by the processor to implement the distance measurement method of any of claims 1 to 6.

10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores at least one program code for execution by a processor to implement the distance measurement method according to any one of claims 1 to 6.

Technical Field

The embodiment of the application relates to the technical field of communication, in particular to a distance measuring method and device, electronic equipment and a storage medium.

Background

At present, people use electronic equipment more and more frequently in daily life. For example, when a user wants to find an electronic device, the distance between the two electronic devices can be determined through the bluetooth connection between the other electronic devices and the electronic device, and then the position of the electronic device can be determined according to the distance. In the related art, taking electronic devices a and B as an example, electronic device a receives a bluetooth signal transmitted by electronic device B, and determines the distance between electronic devices a and B based on the signal strength of the bluetooth signal. Among them, because bluetooth signal itself is easily disturbed by environmental factors, the accuracy of distance measurement is low.

Disclosure of Invention

The embodiment of the application provides a distance measuring method and device, electronic equipment and a storage medium, and the accuracy of distance measurement can be improved. The technical scheme is as follows:

in one aspect, a distance measurement method is provided, the method including:

receiving a first Bluetooth signal of a target electronic device, and determining first signal strength of the first Bluetooth signal;

acquiring reference signal strength, and correcting the first signal strength based on the reference signal strength to obtain target signal strength, wherein the reference signal strength is used for indicating the interference of the environment on the first Bluetooth signal, and the reference signal strength is determined based on Bluetooth signals transmitted and received by the local electronic equipment;

and determining the distance between the target electronic equipment and the local electronic equipment based on the target signal strength.

In another aspect, there is provided a distance measuring apparatus, the apparatus including:

the first determining module is used for receiving a first Bluetooth signal of target electronic equipment and determining first signal strength of the first Bluetooth signal;

the correction module is used for acquiring reference signal strength, correcting the first signal strength based on the reference signal strength to obtain target signal strength, wherein the reference signal strength is used for indicating the interference of the environment on the first Bluetooth signal, and the reference signal strength is determined based on the Bluetooth signals transmitted and received by the local electronic equipment;

and the second determining module is used for determining the distance between the target electronic equipment and the local-end electronic equipment based on the target signal strength.

In another aspect, an electronic device is provided, the electronic device comprising a processor and a memory; the memory stores at least one program code for execution by the processor to implement the distance measurement method as described in the above aspect.

In another aspect, a computer-readable storage medium is provided, having stored thereon at least one program code for execution by a processor to implement the distance measurement method according to the above aspect.

In another aspect, a computer program product is provided, in which program code is enabled, when executed by a processor of an electronic device, to perform a distance measurement method as described in the above aspect.

In the embodiment of the application, because the reference signal strength is used for indicating the interference of the environment on the bluetooth signal, when the first bluetooth signal of the target electronic device is received, the signal strength of the first bluetooth signal is corrected according to the reference signal strength to obtain the target signal strength considering the environmental interference, so that the determined target signal strength is higher in accuracy, the distance between two devices determined according to the target signal strength is more accurate, and the accuracy of distance measurement is further improved.

Drawings

FIG. 1 illustrates a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application;

fig. 2 shows a block diagram of a terminal provided in an exemplary embodiment of the present application;

FIG. 3 illustrates a flow chart of a distance measurement method shown in an exemplary embodiment of the present application;

FIG. 4 illustrates a flow chart of a distance measurement method shown in an exemplary embodiment of the present application;

FIG. 5 illustrates a schematic diagram of a distance measurement method shown in an exemplary embodiment of the present application;

fig. 6 shows a block diagram of a distance measuring device according to an exemplary embodiment of the present application.

Detailed Description

To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.

Reference herein to "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.

It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data referred to in the present application are information and data authorized by the user or sufficiently authorized by each party.

The distance measuring method provided by the embodiment of the application is applied to electronic equipment. In one possible implementation, the electronic device may be a terminal, such as a mobile phone, a tablet computer, a computer, or an Internet Of Things (IOT) device. In another possible implementation manner, the electronic device may be a server, and the server is a server, or a server cluster composed of several servers, or a cloud computing service center.

Referring to FIG. 1, a schematic diagram of an implementation environment provided by an exemplary embodiment of the present application is shown. The implementation environment includes a first electronic device 10 and a second electronic device 20. The first electronic device 10 and the second electronic device 20 are connected through a wireless or wired network.

In some embodiments, the first electronic device 10 is configured to transmit bluetooth signals; the second electronic device 20 is configured to receive the bluetooth signal, and determine a distance between the first electronic device 10 and the second electronic device 20 based on the signal strength of the bluetooth signal. Alternatively, in other embodiments, the second electronic device 20 is configured to transmit Bluetooth signals; the first electronic device 10 is configured to receive the bluetooth signal, and determine a distance between the first electronic device 10 and the second electronic device 20 based on a signal strength of the bluetooth signal.

The distance measuring method provided by the application can be applied to a positioning scene:

for example, the first electronic device 10 is an earphone, and the second electronic device 20 is a mobile phone. The earphone transmits a Bluetooth signal, the mobile phone receives the Bluetooth signal, and the distance between the earphone and the mobile phone is determined based on the Bluetooth signal, so that the mobile phone can determine the position of the earphone according to the distance to position the earphone.

It should be noted that the above application scenarios are only exemplary, and do not limit the distance measurement scenario, and the present application can be applied to any other distance measurement scenario besides the above positioning scenario.

In an embodiment of the present application, there is provided an electronic device comprising a processor and a memory; the memory stores at least one program code for execution by the processor to implement performing the distance measuring method provided by the embodiments of the present application.

In one possible implementation, the electronic device may be provided as a terminal, please refer to fig. 2, which shows a block diagram of a structure of the terminal 100 provided in an exemplary embodiment of the present application. The terminal 100 may be a mobile phone, a tablet computer, a computer, an IOT device, or other terminal having distance measurement and data processing functions. The terminal 100 in the present application may include one or more of the following components: processor 110, memory 120, display 130.

Processor 110 may include one or more processing cores. The processor 110 connects various parts within the overall terminal 100 using various interfaces and lines, and performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 120 and calling data stored in the memory 120. Alternatively, the processor 110 may be implemented in hardware using at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 110 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Neural-Network Processing Unit (NPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is responsible for rendering and drawing the content to be displayed on the display screen 130; the NPU is used for realizing an Artificial Intelligence (AI) function; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 110, but may be implemented by a single chip.

The Memory 120 may include a Random Access Memory (RAM) or a Read-Only Memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like; the storage data area may store data (such as audio data, a phonebook) created according to the use of the terminal 100, and the like.

The display screen 130 is a display component for displaying a user interface. Optionally, the display screen 130 is a display screen with a touch function, and through the touch function, a user may use any suitable object such as a finger, a touch pen, and the like to perform a touch operation on the display screen 130.

The display 130 is generally provided at a front panel of the terminal 100. The display screen 130 may be designed as a full-face screen, a curved screen, a contoured screen, a double-face screen, or a folding screen. The display 130 may also be designed as a combination of a full-screen and a curved-screen, a combination of a special-shaped screen and a curved-screen, etc., which is not limited in this embodiment.

In addition, those skilled in the art will appreciate that the configuration of terminal 100 illustrated in the above-described figures is not intended to be limiting of terminal 100, and that terminal 100 may include more or less components than those shown, or some components may be combined, or a different arrangement of components. For example, the terminal 100 further includes a microphone, a speaker, a radio frequency circuit, an input unit, a sensor, an audio circuit, a Wireless Fidelity (Wi-Fi) module, a power supply, a bluetooth module, and other components, which are not described herein again.

In an embodiment of the present application, an electronic device includes at least a pair of transmit and receive antennas. Accordingly, the electronic device transmits the bluetooth signal through the transmitting antenna and receives the bluetooth signal through the receiving antenna. Wherein, the transmitting antenna and the receiving antenna are set in advance. For example, the electronic device includes an antenna 1 and an antenna 2, where the antenna 1 is set as a transmitting antenna and the antenna 2 is set as a receiving antenna, and then the electronic device may transmit a bluetooth signal through the antenna 1 and receive a bluetooth signal through the antenna 2.

In some embodiments, the bluetooth signal transmitted by the electronic device may be received by a receiving antenna on the electronic device, thereby implementing the local terminal of the electronic device to transmit and receive the bluetooth signal.

In the embodiment of the application, the electronic device comprises the transmitting antenna and the receiving antenna, so that the Bluetooth signal can be transmitted and received simultaneously, and the transmission efficiency of the Bluetooth signal is improved.

Wherein, the bluetooth signal carries the identification information of the electronic equipment. For example, the identification information may be address information or other information capable of uniquely identifying the electronic device. In some embodiments, if the bluetooth signal is received through the receiving antenna, the electronic device may determine whether the bluetooth signal is a bluetooth signal transmitted by the local electronic device based on the identification information carried in the bluetooth signal. Correspondingly, if the identification information carried by the Bluetooth signal is matched with the identification information of the local electronic equipment, the electronic equipment determines that the Bluetooth signal is the Bluetooth signal transmitted by the local electronic equipment; and if the identification information carried by the Bluetooth signal is not matched with the identification information of the local-end electronic equipment, the electronic equipment determines that the Bluetooth signal is not the Bluetooth signal transmitted by the local-end electronic equipment.

The electronic device may transmit a Bluetooth signal in the form of transmitting a Bluetooth Low Energy (BLE) broadcast packet.

It should be noted that the bluetooth signal transmitted by the electronic device may also be received by other electronic devices, and the electronic device may also receive bluetooth signals of other electronic devices, so as to implement signal transmission between two electronic devices.

Referring to fig. 3, a flow chart of a distance measuring method according to an exemplary embodiment of the present application is shown. In the embodiment of the present application, a first electronic device is taken as a target electronic device, and a second electronic device is taken as a home terminal electronic device as an example for description. The method comprises the following steps:

step 301: the second electronic device receives a first Bluetooth signal of the first electronic device and determines a first signal strength of the first Bluetooth signal.

The embodiment of the present application takes an execution subject as an example of the second electronic device. The first bluetooth signal carries identification information of the first electronic device, and correspondingly, if the first bluetooth signal is received, the second electronic device determines that the first bluetooth signal is transmitted by the first electronic device based on the identification information.

The first Signal Strength may be a Received Signal Strength Indication (RSSI) value.

Step 302: the second electronic device obtains a reference signal strength, corrects the first signal strength based on the reference signal strength to obtain a target signal strength, wherein the reference signal strength is used for indicating the interference of the environment on the first Bluetooth signal, and the reference signal strength is determined based on the Bluetooth signals transmitted and received by the second electronic device.

Step 303: the second electronic device determines a distance between the first electronic device and the second electronic device based on the target signal strength.

In the embodiment of the application, because the reference signal strength is used for indicating the interference of the environment on the bluetooth signal, when the first bluetooth signal of the target electronic device is received, the signal strength of the first bluetooth signal is corrected according to the reference signal strength to obtain the target signal strength considering the environmental interference, so that the determined target signal strength is higher in accuracy, the distance between two devices determined according to the target signal strength is more accurate, and the accuracy of distance measurement is further improved.

Referring to fig. 4, a flow chart of a distance measuring method according to an exemplary embodiment of the present application is shown. In the embodiment of the present application, a home electronic device is taken as an electronic device a, a target electronic device is taken as an electronic device B, the electronic device B transmits a bluetooth signal, and the electronic device a receives the bluetooth signal.

The method comprises the following steps:

step 401: the electronic device a transmits a second bluetooth signal.

The electronic device a includes at least a pair of transmitting antenna and receiving antenna. The electronic device a transmits a second bluetooth signal through the transmitting antenna.

Step 402: the electronic device A receives a second Bluetooth signal of the electronic device A and determines a second signal strength of the second Bluetooth signal.

The electronic device a receives the second bluetooth signal through the receiving antenna. The second bluetooth signal carries identification information, and if the identification information is matched with the identification information of the electronic device A, the electronic device A determines that the second bluetooth signal is a bluetooth signal transmitted by the local terminal of the electronic device A.

For example, taking the electronic device a as a mobile phone as an example, the second signal strength of the second bluetooth signal may be RSSI_phone_1The identification information carried by the second bluetooth signal may be a, and the identification information of the electronic device a is a, so that the electronic device a may determine that the second bluetooth signal is a bluetooth signal transmitted by the local terminal.

Step 403: the electronic device a determines a reference signal strength based on the second signal strength and a reference signal strength of the electronic device a, the reference signal strength being indicative of interference of the environment with the second bluetooth signal and the reference signal strength being determined based on the bluetooth signals transmitted and received by the electronic device a.

The reference signal strength is a signal strength determined in advance, and the reference signal strength is determined by the electronic device a in a test environment. Correspondingly, the distance measuring method provided by the application further comprises the following steps: under the condition that the electronic device A is in a test environment, the electronic device A determines the reference signal strength of a reference Bluetooth signal through the reference Bluetooth signal emitted by the electronic device A, and the interference of the test environment on the reference Bluetooth signal is smaller than an interference threshold.

The interference threshold may be set as needed, which is not specifically limited in this application. For example, the test environment may be an area for shielding radio signals, and then the interference of the environment on bluetooth signals is infinitely close to 0, and then the interference threshold may be 0.1, 0.2, or 0.3, etc.

In some embodiments, the reference signal strength is transmitted by electronic device a through a transmit antenna and received by electronic device a through a receive antenna. For example, the reference signal strength may be RSSI_ref

In the embodiment of the present application, since the reference signal strength is determined when the interference of the electronic device in the environment is smaller than the interference threshold, the reference signal strength is closer to the true signal strength of the reference bluetooth signal, so as to provide data support for subsequently determining the reference signal strength capable of indicating the interference of different environments on the electronic device a receiving the bluetooth signal.

In some embodiments, the implementation of step 403 may be: the electronic apparatus a takes the difference between the second signal strength and the reference signal strength as the reference signal strength.

For example, the second signal strength is RSSI_phone_1The reference signal strength is RSSI_refIf the reference signal strength is RSSI_diff=RSSI_phone_1-RSSI_ref

In this embodiment of the application, the reference signal strength may be regarded as the true signal strength of the second bluetooth signal, and the second signal strength is the signal strength of the second bluetooth signal under the condition of being interfered by the environment, and the difference between the two is also the error of the signal strength caused by the interference of the environment, so that the accuracy of taking the difference as the reference signal strength is higher.

In some embodiments, electronic device a stores the determined reference signal strength. Optionally, the electronic device a uses the reference signal strength as a reference signal strength in a preset time period, that is, in the preset time period, under the condition that the environment where the electronic device a is located is not changed, the electronic device a uses the prestored reference signal strength to correct the subsequently received first bluetooth signal of the electronic device B.

The environment where the electronic device a is located may not change, and the location of the electronic device a may not change, or the location of the electronic device a is within a preset area. The preset area and the preset time period can be set according to needs, and this is not specifically limited in this application.

In the embodiment of the application, the determined reference signal strength is stored, so that the reference signal strength can be directly adopted in the electronic device a subsequently, and the number of times of reference signal strength is reduced.

Step 404: the electronic device A receives a first Bluetooth signal of the electronic device B and determines a first signal strength of the first Bluetooth signal.

The electronic equipment B transmits a first Bluetooth signal through an antenna of the electronic equipment B, and the first Bluetooth signal carries identification information of the electronic equipment B; when receiving the first bluetooth signal, the electronic device a may determine whether the first bluetooth signal is transmitted by the electronic device B based on the identification information, and an implementation manner of this step is similar to an implementation manner of the electronic device a determining whether the second bluetooth signal is a bluetooth signal transmitted by the local-end electronic device, and is not described herein again.

It should be noted that the environment in which the electronic device a is located when receiving the first bluetooth signal is the same as the environment in which the electronic device a is located when receiving the second bluetooth signal.

Step 405: the electronic device A acquires the reference signal intensity, and corrects the first signal intensity based on the reference signal intensity to obtain the target signal intensity.

In some embodiments, electronic device a acquires a predetermined reference signal strength. Optionally, the predetermined reference signal strength may be time-efficient; i.e. the reference signal strength, after acquisition, a corresponding time stamp may be added, the time stamp being used to indicate the moment of acquiring the reference signal strength. If the time difference between the current time and the timestamp does not exceed the preset time length, the electronic device a may directly obtain the predetermined reference signal strength. If the time difference between the current time and the timestamp exceeds the preset time length, the electronic device a may reacquire the reference signal strength.

Optionally, the predetermined reference signal strength may also be associated with a location of the electronic device a, that is, the electronic device a may establish an association between the reference signal strength and a location where the electronic device a is located when determining the reference signal strength. Before obtaining the reference signal strength, the electronic device a may compare the current location of the electronic device a with a location associated with a predetermined reference signal strength. If the distance between the current position of the electronic device a and the position associated with the reference signal strength is smaller than a first preset distance, the electronic device a may obtain the predetermined reference signal strength; if the distance between the current position of the electronic device a and the position associated with the reference signal strength is not less than the first preset distance, the electronic device a may reacquire the reference signal strength.

The preset time length and the first preset distance may be set as needed, which is not specifically limited in the present application. The implementation manner of the electronic device a to reacquire the reference signal strength is shown in steps 401 to 403, and is not described herein again.

In the embodiment of the application, on one hand, whether the predetermined reference signal strength is adopted can be determined by combining the current time or the current position of the electronic device a, so that the reference signal strength can be directly obtained under the condition that the current time or the current position meets the condition, the time for distance measurement is saved, and the efficiency of distance measurement is improved. On the other hand, the accuracy of the reference signal strength is also ensured due to the fact that the position and time limitation is also used.

In other embodiments, the electronic device a may also obtain the reference signal strength in real time when the distance measurement is needed, so as to ensure that the reference signal strength is accurate enough.

In some embodiments, the implementation of step 405 may be: the electronic device a takes the difference between the first signal strength and the reference signal strength as the target signal strength.

Since the reference signal strength is determined based on the bluetooth signal transmitted and received by the local terminal of the electronic device a, and the reference signal strength is an error of the signal strength of the second bluetooth signal caused by interference of the environment, for the electronic device a in the same environment, the error of the signal strength of the first bluetooth signal may also be the reference signal strength.

In the embodiment of the present application, the difference between the reference signal strength and the first signal strength is used as the target signal strength, that is, the signal strength of the real first bluetooth signal, so that the accuracy of the signal strength is higher.

Step 406: the electronic device A determines the distance between the electronic device B and the electronic device A based on the target signal strength.

In some embodiments, electronic device a determines the distance between electronic device B and electronic device a based on the target signal strength by equation one below.

The formula I is as follows:

where d is the distance between the electronic device B and the electronic device a, a is the reference distance, B is the path loss factor, and RSSI is the target signal strength. The reference distance is an RSSI value of a bluetooth signal of the electronic device B received by the electronic device a when the distance between the electronic device a and the electronic device B is 1 meter. The path loss factor is related to the environment such as temperature and humidity, and the path loss factor can be set according to the requirement, which is not specifically limited in this application.

For example, referring to fig. 5, the electronic device a first obtains the reference signal strength RSSI of the local terminal_ref(ii) a When the electronic device a and the electronic device B are in a better Radio Frequency (RF) environment, the electronic device a obtains a second signal strength as RSSI_phone_1Determining the reference signal strength as RSSI_diff=RSSI_phone_1-RSSI_refWhen receiving the broadcast data packet 1 transmitted by the electronic device B, that is, when receiving the first bluetooth signal (signal 1) of the electronic device B, determining the first signal strength RSSI1And thus RSSI according to the reference signal strength_diffCorrecting the signal 1 to determine the distance between the electronic equipment A and the electronic equipment B

For another example, with continued reference to fig. 5, when electronic device a and electronic device B are in a poor Radio Frequency (RF) environment, electronic device a obtains a second signal strength as RSSI_phone_2Determining the reference signal strength as RSSI_diff′=RSSI_phone_2-RSSI_refWhen receiving the broadcast data packet 2 transmitted by the electronic device B, that is, when receiving the first bluetooth signal (signal 2) of the electronic device B, determining the first signal strength RSSI2And thus RSSI according to the reference signal strength_diff' the signal 2 is corrected to determine the distance between the electronic device A and the electronic device B

In some embodiments, the electronic device a may determine the distance between the electronic device a and the electronic device B through the step 401 and the step 405 when the electronic device B is located, so as to locate the electronic device B according to the distance. The implementation manner of the electronic device a positioning the electronic device B according to the distance may be: the electronic device A determines a positioning area by taking the position of the electronic device A as a center and the distance as a radius, and the positioning area is taken as the position of the electronic device B.

In other embodiments, the electronic device a uses the electronic device B, whose distance from the electronic device a does not exceed the second preset distance, as the electronic device associated with the electronic device a, and accordingly, the electronic device a may determine the distance between the electronic device a and the electronic device B through the above-mentioned step 401 and step 406 when it is required to determine whether the currently scanned electronic device B is the electronic device associated with the electronic device a. And if the electronic device A receives the first Bluetooth signal of the electronic device B, the electronic device B is determined to be scanned. The second preset distance may be set as needed, and this application is not limited in this respect.

For example, the electronic device a is a mobile phone, the electronic device B is an earphone, the mobile phone first obtains the reference signal strength, when the earphone is scanned, that is, when the first bluetooth signal of the earphone is received, the first signal strength of the first bluetooth signal is corrected according to the reference signal strength to obtain the target signal strength, and the distance between the mobile phone and the earphone is determined based on the target signal strength.

It should be noted that, the electronic device a may determine the distance between the electronic device a and the electronic device B through the steps 401 and 406 in other scenarios than those provided in the two embodiments, which is not specifically limited in this application.

In the embodiment of the application, because the reference signal strength is used for indicating the interference of the environment on the bluetooth signal, when the first bluetooth signal of the target electronic device is received, the signal strength of the first bluetooth signal is corrected according to the reference signal strength to obtain the target signal strength considering the environmental interference, so that the determined target signal strength is higher in accuracy, the distance between two devices determined according to the target signal strength is more accurate, and the accuracy of distance measurement is further improved.

Referring to fig. 6, a block diagram of a distance measuring device according to an exemplary embodiment of the present application is shown. The distance measuring device may be implemented as all or part of a processor of the electronic device by software, hardware, or a combination of both. The apparatus 600 comprises:

the first determining module 601 is configured to receive a first bluetooth signal of a target electronic device, and determine a first signal strength of the first bluetooth signal;

a correcting module 602, configured to obtain a reference signal strength, correct the first signal strength based on the reference signal strength, and obtain a target signal strength, where the reference signal strength is used to indicate interference of an environment on the first bluetooth signal, and the reference signal strength is determined based on bluetooth signals transmitted and received by a local electronic device;

a second determining module 603, configured to determine, based on the target signal strength, a distance between the target electronic device and the local electronic device.

In some embodiments, the modification module 602 includes:

the first determining unit is used for receiving a second Bluetooth signal of the local-end electronic equipment and determining the second signal intensity of the second Bluetooth signal;

and the second determining unit is used for determining the reference signal strength based on the second signal strength and the reference signal strength of the local electronic equipment.

In some embodiments, the second determination unit is configured to use a difference between the second signal strength and the reference signal strength as the reference signal strength.

In some embodiments, the apparatus further comprises:

the third determining module is configured to determine the reference signal strength of the reference bluetooth signal through a reference bluetooth signal transmitted by the local electronic device when the local electronic device is in a test environment, where interference of the test environment on the reference bluetooth signal is smaller than an interference threshold.

In some embodiments, the modification module 602 is configured to use a difference between the first signal strength and the reference signal strength as the target signal strength.

In some embodiments, the local electronic device includes at least a pair of transmit and receive antennas; the device also includes:

the transmitting module is used for transmitting the Bluetooth signal through the transmitting antenna;

and the receiving module is used for receiving the Bluetooth signal through the receiving antenna.

In the embodiment of the application, because the reference signal strength is used for indicating the interference of the environment on the bluetooth signal, when the first bluetooth signal of the target electronic device is received, the signal strength of the first bluetooth signal is corrected according to the reference signal strength to obtain the target signal strength considering the environmental interference, so that the determined target signal strength is higher in accuracy, the distance between two devices determined according to the target signal strength is more accurate, and the accuracy of distance measurement is further improved.

The present embodiments also provide a computer-readable storage medium storing at least one program code for execution by a processor to implement the distance measurement method as shown in the above embodiments.

Embodiments of the present application further provide a computer program product, when the program code in the computer program product is executed by an electronic device of the electronic device, the electronic device is enabled to execute the distance measurement method as shown in the above embodiments.

In some embodiments, the computer program according to the embodiments of the present application may be deployed to be executed on one electronic device, or on a plurality of electronic devices located at one site, or on a plurality of electronic devices distributed at a plurality of sites and interconnected by a communication network, and the plurality of electronic devices distributed at the plurality of sites and interconnected by the communication network may constitute a block chain system.

Those skilled in the art will recognize that, in one or more of the examples described above, the functions described in the embodiments of the present application may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more program codes or code on a computer-readable medium. Computer-readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.

The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种具有显式频率函数的OFDM-NLFM信号设计方法

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!