Control equipment based on BLE CS

By optimizing the BLE CS ranging algorithm and combining it with the SE power switch circuit and NFC antenna control equipment, the problems of high cost, high energy consumption and low accuracy of BLE ranging were solved, realizing low-energy, high-precision distance measurement and secure communication, and extending the battery life of the device.

CN121056842APending Publication Date: 2025-12-02BEIJING HUAHONG INTEGRATED CIRCUIT DESIGN +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410646912.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2025-12-02

AI Technical Summary

Technical Problem

Existing BLE ranging technology is costly, energy-intensive, and has low accuracy, which cannot meet the needs of energy-sensitive applications such as vehicles, industrial control, and object finding.

Method used

The control device based on BLE CS is adopted. The BLE module is woken up by the motion sensor to connect and measure distance. The BLE CS ranging algorithm is optimized and combined with the SE power switch circuit and NFC antenna to achieve low power consumption and high accuracy distance measurement.

Benefits of technology

It reduces the power consumption of the BLE module, improves ranging accuracy, ensures communication security, supports secure communication in low-power conditions, and extends the battery life of the device.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121056842A_ABST
    Figure CN121056842A_ABST
Patent Text Reader

Abstract

The invention relates to a control device based on BLE CS, and belongs to the technical field of communication, the control device comprises a motion sensor, a BLE module and a control module, the control module monitors a motion signal generated by the motion sensor to activate the BLE module and controls the motion sensor to stop working, and the BLE module is connected with the motion sensor. When the BLE module is not connected with any anchor point within the preset time, the BLE module is controlled to sleep again, and the motion sensor is started; measuring the distance between the equipment and the anchor point based on an optimized BLE CS ranging algorithm; when the distance is smaller than or equal to a preset threshold value, the BLE module is controlled to start an SE power switch circuit so as to start an SE chip, and communication data and a control command are encrypted on the premise of ensuring connection reliability so as to ensure safety; and the NFC antenna is included, so that safe communication with the anchor point in a low-electric-quantity or power-off state is ensured. The problems that in the prior art, cost is high, energy consumption is high, and existing BLE distance measurement precision is low are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and in particular to a control device based on BLE CS. Background Technology

[0002] Bluetooth Low Energy (BLE) technology is widely used for distance measurement and positioning. Its principle is to estimate distance using Bluetooth signal strength (RSSI). Bluetooth Angle of Arrival (AOA) technology is a positioning algorithm based on the angle of arrival of a signal, primarily used for precise positioning in indoor environments. It relies on multiple base stations or antenna arrays, calculating the location of the mobile device by measuring the signal's incident angle, offering high accuracy and strong anti-interference capabilities. However, in practical applications, Bluetooth RSSI is susceptible to significant fluctuations due to environmental factors. Bluetooth AOA technology requires the deployment of matrix antennas and has a relatively small coverage area, making it unsuitable for one-to-one remote ranging, positioning, and control scenarios such as vehicles, industrial control, and object finding. Therefore, the industry common practice is to combine UWB ranging with Bluetooth, leveraging UWB's high-precision ranging capabilities and Bluetooth's low-power and easy connectivity features to ensure high-precision positioning while improving portability and reducing energy consumption. However, UWB is costly and energy-intensive, limiting its application in energy-sensitive fields such as vehicles and object finding. Summary of the Invention

[0003] Based on the above analysis, the present invention aims to provide a control device based on BLE CS to solve the problems of high cost, high energy consumption, and low ranging accuracy of existing BLE systems.

[0004] On one hand, embodiments of the present invention provide a control device based on BLE CS, the device including a motion sensor, a BLE module, and a control module, wherein,

[0005] The motion sensor is used to detect the motion state of the device;

[0006] When the BLE module is not connected to the anchor point, the control module controls the motion sensor to turn on, and wakes up the BLE module when it detects that the device is in motion.

[0007] The BLE module establishes a connection with the anchor point and measures the distance between the device and the anchor point through the established connection channel;

[0008] Once the BLE module establishes a connection with the anchor point, the controller module shuts down the motion sensor.

[0009] Based on further improvements to the aforementioned equipment, the BLE module establishes a connection with the anchor point, including:

[0010] The BLE module continuously sends broadcast packets outwards within a preset time and determines whether an anchor point has been found.

[0011] If so, then establish a connection with the anchor point;

[0012] Otherwise, when the preset time ends, the BLE module enters a sleep state.

[0013] Based on further improvements to the above-mentioned device, the device also includes an SE power switch circuit and an SE chip; when the distance between the BLE module and the anchor point reaches a predetermined threshold, the control module controls the BLE module to send a switch control signal to the SE power switch circuit, and the SE power switch circuit starts to supply power to the SE chip; the SE chip encrypts all control commands sent by the BLE module to the anchor point.

[0014] Based on further improvements to the aforementioned device, the device also includes an NFC antenna connected to the SE chip; the NFC antenna is used to transmit encrypted data read from the anchor point by the device.

[0015] Based on further improvements to the aforementioned equipment, the BLE module measures the distance between the equipment and the anchor point through the established connection channel, including:

[0016] S1. Obtain the initial channel interval based on the preset maximum communication distance of the BLE module;

[0017] S2. Use the initial channel spacing as the current channel spacing; use the preset maximum communication distance as the previous ranging result;

[0018] S3: The BLE module reads the phase angles of two channels that satisfy the current channel interval and obtains the phase difference. Based on the phase difference and the previous ranging result, it calculates the first distance.

[0019] Read the phase angles of the two channels corresponding to the maximum channel spacing and calculate the maximum phase difference;

[0020] Determine whether the first distance is less than the first maximum ranging distance, where the first maximum ranging distance is the ranging distance when using the maximum channel spacing;

[0021] If so, the ranging result is obtained based on the maximum phase difference and the first maximum ranging distance, the maximum channel interval is used as the current channel interval, and the process returns to step S3 for the next ranging.

[0022] Otherwise, the first distance is optimized based on the maximum phase difference and the first maximum ranging distance to obtain the optimized distance, and the optimized distance is used as the ranging result for this time; the channel interval is calculated based on the optimized distance as the current channel interval, and the process returns to S3.

[0023] Specifically, in this embodiment of the invention, the BLE terminal and the anchor point are two terminals for distance measurement. They need to establish and maintain a Bluetooth communication connection, and the BLE terminal reads the communication connection channel to measure the distance.

[0024] BLE CS distance measurement involves reading the BLE channel phase angle and calculating the phase difference using a complex algorithm, then calculating the distance based on the relationship between the channel phase difference and the channel frequency. Because the BLE CS phase difference calculation algorithm is complex, the algorithm in this embodiment is an optimization of the BLE CS ranging algorithm. To simplify the calculation, the channel phase difference is equated to the corresponding channel frequency difference, i.e., the channel interval, and the corresponding channel frequency difference is equated to the wavelength difference. Therefore, ranging between the two ends of a BLE connection can be understood as measuring the number of channel wavelengths included in the distance between the two ends of the BLE connection. The ranging algorithm is optimized based on this idea.

[0025] Based on the BLE communication principle, there are a total of 79 channels in the BLE connection. Among them, 75 channels, numbered from 2 to 76, can be used for BLE CS ranging. Table 1 shows the correspondence and values ​​of BLE channels, frequencies, wavelengths, and wavelength differences that can be used for CS ranging.

[0026] Table 1: BLE Channel Numbers and Corresponding Frequency, Wavelength, and Wavelength Difference Values ​​for CS Ranging

[0027]

[0028]

[0029] As shown in Table 1, the wavelength difference between BLE connection channels is proportional to the channel spacing. Therefore, the wavelength difference between any two channels can be estimated as the product of the channel spacing and the wavelength difference between adjacent channels. From this, the relationship between the distance of a BLE connection and the channels and the channel spacing can be derived as follows:

[0030] D=λ i ×λ i / (Δλ×ΔCH), where ΔCH is the channel spacing, Δλ is the wavelength difference between adjacent channels, and λ is the wavelength difference between adjacent channels. i Let λ be the wavelength of the shorter channel among any two channels, and D be the distance.

[0031] In Table 1, the wavelength differences between adjacent BLE channels are all within a very small range, around 0.005 com. The maximum wavelength difference between channels used for BLE CS ranging is only 0.37 com. Considering the propagation distance of BLE electromagnetic waves and practical applications, the error of the wavelength difference between adjacent BLE channels is almost negligible compared to the ranging error. Therefore, the wavelength difference between adjacent channels is simplified to 0.005 com, where λ is the wavelength of the shorter channel among any two channels. i The central channel wavelength, denoted as λ, is uniformly used for ranging.

[0032] Based on the above optimization scheme, the optimized distance formula is obtained as follows: ΔCH=(λ×(λ / Δλ))÷D, where ΔCH is the channel spacing, λ is the wavelength of the center channel, Δλ is the average wavelength difference between adjacent channels, and D is the distance.

[0033] In theory, the larger the BLE CS channel spacing, the shorter the ranging distance and the higher the ranging accuracy; conversely, the smaller the channel spacing, the longer the ranging distance and the lower the ranging accuracy. To achieve higher ranging accuracy, when the distance between the BLE terminal and the anchor point reaches a certain level, the maximum channel spacing can be used for ranging. This distance is the first maximum ranging distance, which is the maximum ranging distance under the maximum channel spacing. Conversely, the maximum ranging distance under the minimum channel spacing is the second maximum ranging distance.

[0034] Furthermore, the first maximum ranging distance is calculated using the following method:

[0035] The second maximum ranging distance is obtained based on the center channel wavelength, the minimum channel spacing, and the average wavelength difference between adjacent channels.

[0036] The first maximum ranging distance is obtained by dividing the second maximum ranging distance by the maximum channel spacing.

[0037] Specifically, based on the optimized distance formula, the theoretical distance of the maximum ranging distance between adjacent channels can be calculated, which is the second maximum ranging distance. Based on different BLE PHY rates, the second maximum ranging distance corresponding to BLE 1M PHY is approximately 150 meters. Then, according to the conversion relationship between the maximum channel spacing and distance in BLE CS and the second maximum ranging distance, the first maximum ranging distance can be calculated, which is approximately 2 meters at the maximum channel spacing.

[0038] Before ranging begins, due to the differences in wireless performance among different BLE terminals, the specific value of the channel interval connecting the BLE terminal and the anchor point cannot be determined; both distance and channel interval are unknown. Therefore, in step S2, this embodiment of the invention calculates the initial channel interval based on the preset maximum communication distance of the BLE terminal, i.e., the theoretical maximum transmission distance corresponding to the BLE terminal, by substituting it into the optimized distance formula. The preset maximum communication distance is generally a verified and reliable theoretical value. The advantage of this is that, before ranging, the initial channel interval is calculated based on the preset maximum communication distance and the optimized distance formula.

[0039] Use the initial channel spacing as the current channel spacing; use the preset maximum communication distance as the result of the last ranging measurement.

[0040] The BLE terminal reads the phase angles of two channels that satisfy the current channel interval and obtains the phase difference. Based on the phase difference and the previous ranging result, it calculates the first distance.

[0041] Read the phase angles of the two channels corresponding to the maximum channel spacing and calculate the maximum phase difference;

[0042] Next, a ranging operation can be performed based on the initial channel interval.

[0043] Specifically, the BLE terminal selects the channel for ranging based on the initial channel interval, reads the phase angle of the corresponding channel, and then calculates the phase difference.

[0044] Furthermore, the BLE terminal reads the phase angles of two channels that satisfy the current channel interval and obtains the phase difference, including:

[0045] Determine whether the channel interval is set to a fixed channel interval;

[0046] If so, the BLE terminal reads the phase angle of the lowest numbered channel and the channel numbered with an interval of the channel interval between the lowest numbered channel and the channel numbered with the channel interval between the two channels, and calculates the difference between the phase angles of the two channels to obtain the phase difference;

[0047] Otherwise, the BLE terminal reads all channel phase angles, randomly selects two channel phase angles with an interval equal to the channel interval, and calculates the difference between the two channel phase angles as the phase difference.

[0048] Existing BLE CS algorithms require complex comparison operations when selecting the BLE channel for ranging, resulting in a high computational cost for each ranging measurement. Therefore, this invention optimizes the BLE CS channel selection algorithm based on the initial channel interval, using the initial channel interval as a coefficient to provide the following two channel selection methods, specifically including:

[0049] If the initial channel interval is set to a fixed channel interval, the BLE terminal will only read the phase angle of the lowest numbered channel and the channel whose interval with the lowest numbered channel is the channel interval.

[0050] If no fixed channel interval is set, the BLE terminal randomly reads two predetermined phase angles of the channel interval as the initial channel interval.

[0051] Through the above processing, without complex calculations, the channel interval obtained from the previous ranging can be used as a coefficient to simplify the channel selection process for the current ranging. Setting a fixed channel interval is even simpler, as it eliminates the need to read the phase angle of channels other than the lowest-numbered channel and the channel with an interval equal to the channel interval, further reducing the power consumption of the BLE terminal.

[0052] Furthermore, based on the phase difference and the previous ranging result, the first distance is calculated using the following formula:

[0053] d=(Δθ / 2π)×D p In the formula, d is the distance measured, and D p Δθ represents the distance corresponding to the previous ranging result, and Δθ represents the phase difference.

[0054] When the phase difference is 2π, the distance between the BLE terminal and the anchor point is the first maximum ranging distance. However, the phase difference between the two channels obtained by the BLE terminal is always a value less than 2π, which cannot reflect the number of cycles of the actual interval between the BLE terminal and the anchor point. This is determined by the characteristics of BLE CS technology, but it also shows that the distance between the BLE terminal and the anchor point may include 0-n first maximum ranging distances.

[0055] Furthermore, it is determined whether the first distance is less than the first maximum ranging distance, where the first maximum ranging distance is the ranging distance when the maximum channel spacing is used;

[0056] If so, the ranging result is obtained based on the maximum phase difference and the first maximum ranging distance, the maximum channel interval is used as the current channel interval, and the process returns to step S4 for the next ranging.

[0057] Specifically, when the first distance is less than the first maximum ranging distance, the actual phase difference of the first distance is less than 360 degrees and is proportional to the phase difference. Therefore, substituting the maximum channel spacing phase difference Δθ and the first maximum ranging distance Dp into d=(Δθ / 2π)×D p Then, the distance d measured in this step can be obtained. Since this ranging is based on the maximum channel spacing, the ranging accuracy is very high. After this ranging is completed, return to step S4 to perform the next ranging.

[0058] Otherwise, the first distance is optimized based on the maximum phase difference and the first maximum ranging distance to obtain the optimized distance, and the optimized distance is used as the ranging result for this time;

[0059] Furthermore, the optimized distance is obtained by optimizing the first distance based on the maximum phase difference and the first maximum ranging distance, specifically as follows:

[0060] In the formula, d is the first distance, and D c D is the optimized distance. 1max It is the first maximum ranging distance. To round down, Δd is the relative distance, where Δd = (Δθ) max / 2π)×D 1max , Δθ max The maximum channel spacing phase difference is denoted as .

[0061] When the first distance is greater than the first maximum ranging distance, the result of dividing the first distance by the first maximum ranging distance is rounded down, and then the phase difference and the first maximum ranging distance are substituted into d=(Δθ / 2π)×D p The relative distance is calculated, and the sum of the two is the optimized distance.

[0062] The channel interval is calculated based on the optimized distance and used as the current channel interval. Then, return to S4 for the next ranging measurement.

[0063] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0064] 1. The control module controls the motion sensor to generate a motion signal to wake up the BLE module. If the BLE module does not connect to the anchor point within a preset time, it will go into sleep mode again. After the BLE module connects to the anchor point, the motion sensor is turned off, thus achieving better energy saving.

[0065] 2. An optimized ranging algorithm, obtained by reducing the complexity and computational load of the BLE CS ranging algorithm, has lower energy consumption requirements and faster ranging speed;

[0066] 3. When the distance between the BLE module and the anchor point reaches a predetermined threshold, the control module controls the BLE module to send a switching signal to the SE power switch circuit to ensure connection reliability and start communication encryption to ensure communication security.

[0067] 4. The NFC antenna supports replacing the BLE connection for secure communication between the device and the anchor point in a low-power or passive state.

[0068] In this invention, the above-described technical solutions can be combined with each other to achieve more preferred combinations. Other features and advantages of this invention will be set forth in the following description, and some advantages may become apparent from the description or be learned by practicing the invention. The objects and other advantages of this invention can be realized and obtained from what is particularly pointed out in the description and drawings. Attached Figure Description

[0069] The accompanying drawings are for illustrative purposes only and are not intended to limit the invention. Throughout the drawings, the same reference numerals denote the same parts.

[0070] Figure 1 This is a schematic diagram illustrating a specific example of a Bluetooth car key according to an embodiment of the present invention.

[0071] Figure 2 This is a schematic diagram illustrating a specific application scenario of the Bluetooth car key according to an embodiment of the present invention. Detailed Implementation

[0072] Preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not intended to limit the scope of the present invention.

[0073] One specific embodiment of the present invention discloses a control device based on BLE CS.

[0074] The device includes a motion sensor, a BLE module, and a control module, wherein...

[0075] The motion sensor is used to detect the motion state of the device;

[0076] When the BLE module is not connected to the anchor point, the control module controls the motion sensor to turn on, and wakes up the BLE module when it detects that the device is in motion.

[0077] The BLE module establishes a connection with the anchor point and measures the distance between the device and the anchor point through the established connection channel;

[0078] Once the BLE module establishes a connection with the anchor point, the controller module shuts down the motion sensor.

[0079] Specifically, an embodiment of the present invention discloses a control device based on BLE CS, comprising a BLE module, a motion sensor, and a control module. The control module monitors the states of the BLE module and the motion sensor, and controls the BLE module and the motion sensor based on their respective states. Specifically, the BLE module has communication capabilities, used to send BLE broadcast packets to detect anchor points and establish BLE communication connections with the detected anchor points. The motion sensor monitors the motion state of the device and generates motion signals based on the motion state.

[0080] Furthermore, the BLE module establishes a connection with the anchor point, including:

[0081] The BLE module continuously sends broadcast packets outwards within a preset time and determines whether an anchor point has been found.

[0082] If so, then establish a connection with the anchor point;

[0083] Otherwise, when the preset time ends, the BLE module enters a sleep state.

[0084] Generally, when the device is stationary and the BLE module is not connected to the anchor point, the BLE module is in a sleep state and the motion sensor is in a stopped state to save energy.

[0085] When the device is in motion, the motion sensor detects the motion and begins generating a motion signal. The control module detects this motion signal and immediately wakes up the BLE module. Once awakened, the BLE module broadcasts a signal to detect anchor points within a preset time. This preset time is also a timeout period set for energy saving. If the BLE module detects an anchor point and establishes a connection within the preset time, the control module controls the motion sensor to stop working. If the preset time ends and the BLE module has not detected an anchor point, the BLE module enters sleep mode again. This embodiment of the invention, through the above method, on the one hand, uses the motion signal generated by the motion sensor as a condition for waking up the BLE, which not only allows for real-time detection of the device's motion state but also minimizes energy consumption when the device is stationary and without connection. On the other hand, by setting a preset time, it prevents the BLE module from endlessly detecting anchor points after being awakened, thus reducing continuous energy consumption. Furthermore, by waking up the BLE module and connecting it to the anchor point, the motion sensor stops working. Compared to existing technologies, this embodiment of the invention significantly reduces energy consumption requirements.

[0086] Furthermore, the BLE module measures the distance between the device and the anchor point through the established connection channel, including:

[0087] S1. Obtain the initial channel interval based on the preset maximum communication distance of the BLE module;

[0088] S2. Use the initial channel spacing as the current channel spacing; use the preset maximum communication distance as the previous ranging result;

[0089] S3: The BLE module reads the phase angles of two channels that satisfy the current channel interval and obtains the phase difference. Based on the phase difference and the previous ranging result, it calculates the first distance.

[0090] Read the phase angles of the two channels corresponding to the maximum channel spacing and calculate the maximum phase difference;

[0091] Determine whether the first distance is less than the first maximum ranging distance, where the first maximum ranging distance is the ranging distance when using the maximum channel spacing;

[0092] If so, the ranging result is obtained based on the maximum phase difference and the first maximum ranging distance, the maximum channel interval is used as the current channel interval, and the process returns to step S3 for the next ranging.

[0093] Otherwise, the first distance is optimized based on the maximum phase difference and the first maximum ranging distance to obtain the optimized distance, and the optimized distance is used as the ranging result for this time; the channel interval is calculated based on the optimized distance as the current channel interval, and the process returns to S3.

[0094] Specifically, in this embodiment of the invention, the BLE module and the anchor point serve as two terminals for distance measurement. They need to establish and maintain a Bluetooth communication connection. The BLE module reads the communication connection channel to measure the distance. The technical process for measuring the distance specifically includes:

[0095] Step 1: Obtain the initial channel spacing based on the preset maximum communication distance.

[0096] BLE CS distance measurement involves reading the BLE channel phase angle and calculating the phase difference using a complex algorithm, then calculating the distance based on the relationship between the channel phase difference and the channel frequency. The algorithm in this embodiment of the invention is an optimization of the BLE CS ranging algorithm. Because the BLE CS algorithm for calculating the phase difference is very complex, to simplify the calculation, the channel phase difference is equated to the frequency difference of the corresponding channel, i.e., the channel interval. Furthermore, the frequency difference of the corresponding channel is equated to the wavelength difference. Therefore, ranging between the two ends of a BLE connection can be understood as measuring the number of channel wavelengths included in the distance between the two ends of the BLE connection. The ranging algorithm is optimized based on this idea.

[0097] Furthermore, the following relationship is used when obtaining the initial channel interval based on the preset maximum communication distance and when calculating the channel interval based on the optimized distance:

[0098] ΔCH=(λ×(λ / αλ))÷D, where ΔCH is the channel spacing, λ is the wavelength of the center channel, Δλ is the average wavelength difference between adjacent channels, and D is the distance. When solving for the initial channel spacing, D is taken as the preset maximum communication distance. When solving for the channel spacing calculated based on the optimized distance, D is taken as the optimized distance.

[0099] Specifically, the number of electromagnetic waves required to measure the maximum distance between two adjacent channels in a BLE connection can be calculated by dividing the wavelength of the adjacent channel by the wavelength difference between the two adjacent channels.

[0100] Based on the BLE communication principle, there are a total of 79 channels in the BLE connection. Among them, 75 channels, numbered from 2 to 76, can be used for BLE CS ranging. Table 1 shows the correspondence and values ​​of BLE channels, frequencies, wavelengths, and wavelength differences that can be used for CS ranging.

[0101] Table 1: BLE Channel Numbers and Corresponding Frequency, Wavelength, and Wavelength Difference Values ​​for CS Ranging

[0102]

[0103] As shown in Table 1, the wavelength difference between BLE connection channels is proportional to the channel spacing. Therefore, the wavelength difference between any two channels can be estimated as the product of the channel spacing and the wavelength difference between adjacent channels. From this, the relationship between the distance of a BLE connection and the channels and the channel spacing can be derived as follows:

[0104] D=λ i ×λ i / (Δλ×ΔCH), where ΔCH is the channel spacing, Δλ is the wavelength difference between adjacent channels, and λ is the wavelength difference between adjacent channels. i Let λ be the wavelength of the shorter channel among any two channels, and D be the distance.

[0105] In Table 1, the wavelength differences between adjacent BLE channels are all within a very small range, around 0.005 com. The maximum wavelength difference between channels used for BLE CS ranging is only 0.37 com. Considering the propagation distance of BLE electromagnetic waves and practical applications, the error of the wavelength difference between adjacent BLE channels is almost negligible compared to the ranging error. Therefore, the wavelength difference between adjacent channels is simplified to 0.005 com, where λ is the wavelength of the shorter channel among any two channels. i The central channel wavelength, denoted as λ, is uniformly used for ranging.

[0106] Step 2: Use the initial channel spacing as the current channel spacing; use the preset maximum communication distance as the result of the last ranging measurement.

[0107] Before the initial ranging measurement between the BLE module and the anchor point, based on the distance formula, both the distance and the channel interval are unknowns. Using the preset maximum communication distance as an initial value, the initial channel interval is calculated by substituting it into the distance formula. This is equivalent to completing one ranging process based on the initial channel interval to obtain the preset maximum communication distance. The algorithm design based on this embodiment of the invention provides an initial value for subsequent repeated ranging processes.

[0108] Step 3: The BLE module reads the phase angles of the two channels that satisfy the current channel interval and obtains the phase difference. Based on the phase difference and the previous ranging result, the first distance is calculated.

[0109] Next, a ranging operation can be performed based on the initial channel interval.

[0110] Specifically, the BLE module periodically reads the channel phase angle, selects the channel for ranging and obtains the corresponding channel's phase angle, calculates the phase angle difference, and obtains the ranging distance based on the BLE CS's formula for calculating distance based on the phase difference.

[0111] Furthermore, the BLE module reads the phase angles of two channels that satisfy the current channel interval and obtains the phase difference, including:

[0112] Determine whether the channel interval is set to a fixed channel interval;

[0113] If so, the BLE module reads the phase angle of the lowest-numbered channel and the channel whose number is the channel interval between the lowest-numbered channel and the channel, and calculates the difference between the phase angles of the two channels to obtain the phase difference;

[0114] Otherwise, the BLE module reads all channel phase angles, randomly selects two channel phase angles with an interval equal to the channel interval, and calculates the difference between the two channel phase angles as the phase difference.

[0115] Existing BLE CS algorithms require complex comparison operations when selecting the BLE channel for ranging, resulting in a high computational cost for each ranging measurement. Therefore, this invention optimizes the BLE CS channel selection algorithm based on the initial channel interval, using the initial channel interval as a coefficient to provide the following two channel selection methods, specifically including:

[0116] If the initial channel interval is set to a fixed channel interval, the BLE module will only read the phase angle of the lowest numbered channel and the channel whose interval with the lowest numbered channel is the channel interval.

[0117] If no fixed channel interval is set, the BLE module randomly reads two predetermined phase angles of the channel interval as the initial channel interval.

[0118] Through the above processing, without complex calculations, the channel interval obtained from the previous ranging can be used as a coefficient to simplify the channel selection process for the current ranging. Setting a fixed channel interval is even simpler, as it eliminates the need to read the phase angle of channels other than the lowest-numbered channel and the channel with an interval equal to the channel interval, further reducing the power consumption of the BLE module.

[0119] After obtaining the phase difference through the above process, the first distance can be calculated based on the previous ranging result.

[0120] Furthermore, the calculation of the first distance based on the phase difference and the previous ranging result, and the calculation of the current ranging result based on the maximum phase difference and the first maximum ranging distance, are both obtained through the following formulas to obtain the corresponding ranging distances:

[0121] d=(Δθ / 2π)×D p In the formula, d is the distance measured, and D p The distance corresponding to the previous ranging result or the first maximum ranging distance is Δθ, and the phase difference or the maximum phase difference is Δθ.

[0122] Specifically, based on the BLE CS characteristics, substituting the relationship between the previous ranging channel interval and the corresponding phase difference into the relationship between channel interval, wavelength, and distance ΔCH=(λ×(λ / Δλ))÷D, we can derive the relationship between the distance and phase difference between two adjacent ranging measurements as: d=(Δθ / 2π)×D p The distance d calculated based on this relationship is the first distance.

[0123] Based on the characteristics of BLE communication, the greater the distance between the BLE module and the anchor point, the worse the ranging accuracy and the larger the ranging error; conversely, the closer the distance, the better the ranging accuracy and the smaller the ranging error. This is an inevitable result of the increased phase delay caused by the extended propagation distance of electromagnetic waves. Therefore, when the first distance reaches the maximum ranging distance corresponding to the maximum channel spacing, i.e., the first maximum ranging distance, the ranging error for distances smaller than the first maximum ranging distance can be basically ignored. Substituting the first maximum ranging distance into the relationship between ranging distance and phase difference, d=(Δθ / 2π)×D p Then, by obtaining the maximum channel spacing phase difference, the actual ranging distance can be obtained.

[0124] Step 4: Read the phase angles of the two channels corresponding to the maximum channel spacing and calculate the maximum phase difference.

[0125] Furthermore, the first maximum ranging distance is calculated using the following method:

[0126] The second maximum ranging distance is obtained based on the center channel wavelength, the minimum channel spacing, and the average wavelength difference between adjacent channels.

[0127] The first maximum ranging distance is obtained by dividing the second maximum ranging distance by the maximum channel spacing.

[0128] Based on the BLE CS communication principle, a larger channel spacing results in a shorter ranging distance and higher ranging accuracy, while a smaller channel spacing results in a longer ranging distance and lower ranging accuracy. The theoretical maximum ranging distance between adjacent channel spacings can be calculated using the distance formula; this is the second maximum ranging distance. Based on different BLE PHY rates, the second maximum ranging distance corresponding to a BLE 1M PHY is approximately 150 meters. Then, according to the conversion relationship between the maximum BLE CS channel spacing and distance, and the second maximum ranging distance, the first maximum ranging distance can be calculated, which is approximately 2 meters at the maximum channel spacing.

[0129] Furthermore, the optimized distance is obtained by optimizing the first distance based on the maximum phase difference and the first maximum ranging distance, specifically as follows:

[0130] In the formula, d is the first distance, and D c D is the optimized distance. 1max It is the first maximum ranging distance. To round down, Δd is the relative distance, where Δd = (Δθ) max / 2π)×D 1max , Δθ max The maximum channel spacing phase difference is denoted as .

[0131] For the first distance obtained in step 3, if the first distance exceeds the first maximum ranging distance, the first maximum ranging distance needs to be applied to correct the error of the first distance. First, calculate the relative distance based on the maximum channel spacing phase difference and the first maximum ranging distance. Then, round down the ratio of the first distance to the first maximum ranging distance to obtain the integer ratio between the first distance and the first maximum ranging distance. Multiply this integer ratio by the first maximum ranging distance and add the relative distance to obtain the optimized distance.

[0132] Furthermore, when calculating the first distance and the current ranging result, the phase difference and the maximum phase difference are first corrected based on the error phase difference, and the first distance and the current ranging result are calculated using the corrected phase difference and the maximum phase difference.

[0133] Furthermore, the error phase difference is the maximum phase difference when the BLE module and the anchor point are attached.

[0134] To further eliminate phase testing errors caused by BLE terminal circuit delay, the phase error due to circuit delay needs to be removed from the phase difference when calculating the ranging distance based on the phase difference and the previous ranging distance. This phase error is the maximum phase difference calculated when the BLE terminal is in contact with the anchor point, i.e., the phase angles of the two channels with the smallest and largest BLE CS numbers are read by the BLE terminal and the corresponding phase difference is calculated. The above process is an error removal process before ranging, which only needs to be performed once to affect all subsequent ranging results.

[0135] Furthermore, the device also includes an SE power switch circuit and an SE chip; when the distance between the BLE module and the anchor point reaches a predetermined threshold, the control module controls the BLE module to send a switch control signal to the SE power switch circuit, and the SE power switch circuit starts to supply power to the SE chip; the SE chip encrypts all control commands sent by the BLE module to the anchor point.

[0136] Generally, a control device maintains a connection with a controlled device and sends control commands and communications to the controlled device based on this connection. For security reasons, the process of sending control commands and communications needs to be encrypted. In this embodiment of the invention, the device is equivalent to the control device, and the anchor point is equivalent to the controlled device. The device includes an SE power switch circuit and an SE chip. The SE chip is used to encrypt the communication data between the device and the anchor point, as well as the control commands sent by the device to the anchor point. Specifically, the BLE module included in the device sends control commands and communication data to the anchor point. Based on the characteristics of BLE communication, which uses electromagnetic waves propagating through the air, the closer the distance, the stronger the signal and the higher the communication reliability. Therefore, this embodiment of the invention sets a distance range as a predetermined threshold. Preferably, a first maximum ranging distance is selected as the predetermined threshold. When the distance between the anchor point and the control device is less than or equal to the first maximum ranging distance, it is considered that the communication connection performance is reliable. At this time, the control module controls the BLE module to send a switch control signal to the SE power switch circuit. The SE power switch circuit is turned on and supplies power to the SE chip. All data and control commands of the connection between the BLE module and the anchor point are then encrypted by the SE chip. When the distance between the anchor point and the control device is greater than the first maximum ranging distance, the connection between the anchor point and the control device is only used for ranging and maintaining the connection, and no communication data or control commands are transmitted. Through the above methods, this embodiment of the invention not only ensures the security of communication data and control commands between the control device and the anchor point, but also, by setting a predetermined threshold as the start-up condition for the SE power switch circuit and the SE chip, achieves the purpose of further ensuring communication reliability and energy saving.

[0137] Furthermore, the device also includes an NFC antenna connected to the SE chip; the NFC antenna is used to transmit encrypted data read from the anchor point by the device.

[0138] Specifically, the device in this embodiment of the invention further includes an NFC antenna, which serves as an alternative communication connection method besides BLE communication. Based on the characteristics of NFC communication, the distance between the device and the anchor point is sufficiently close to transmit communication data and control commands. Therefore, the NFC antenna is connected to an SE chip, which is used to encrypt communication data and control commands. In this embodiment of the invention, the NFC antenna supports passive NFC communication. When the device is in a low-battery or depleted state and cannot use BLE communication, data in the device can be read by the anchor point based on the NFC antenna included in the device, thereby achieving communication in a passive state.

[0139] The control device of this invention includes a motion sensor, a BLE module, and a control module. The control module monitors the motion signal generated by the motion sensor, activates the BLE module, and controls the motion sensor to stop working. If the BLE module does not connect to any anchor point within a preset time, the control module controls the BLE module to go into sleep mode again and activates the motion sensor. It measures the distance between the device and the anchor point based on an optimized BLE CS ranging algorithm. When the distance is less than or equal to a predetermined threshold, the control module activates the SE power switch circuit to start the SE chip. Communication data and control commands are encrypted to ensure security while ensuring connection reliability. It also includes an NFC antenna to ensure secure communication with the anchor point in low power or power outage conditions. Compared to existing technologies, the control device of this invention further reduces energy consumption, solves the problem of low ranging accuracy in existing BLE systems through an optimized BLE CS ranging algorithm, avoids using more expensive technical solutions, is compatible with existing BLE hardware, and can greatly improve the battery life of the control device.

[0140] For example, Figure 1 This illustration shows a specific example of the present invention applied to a Bluetooth car key. The Bluetooth car key includes a motion sensor, a BLE chip, a BLE antenna, an external watchdog timer, a button, an SE power switch circuit, an SE chip, a power management circuit, and a battery. The external watchdog timer is used to reset the BLE chip. The BLE chip uses a hardware configuration essentially consistent with existing Bluetooth car key technologies, and achieves higher ranging accuracy and longer battery life without the need for a UWB chip.

[0141] Figure 2 This diagram illustrates an application scenario of a Bluetooth car key according to an embodiment of the present invention. The area between the outer and inner circles is the vehicle welcome area, and the area within the inner circle is the vehicle unlocking area. The outer circle is the connection establishment area between the Bluetooth car key and the vehicle anchor point, and the distance between the Bluetooth car key and the vehicle anchor point in the inner circle is the first maximum ranging distance. Different applications can be configured based on the areas where the Bluetooth car key and the vehicle anchor point are located.

[0142] Those skilled in the art will understand that all or part of the processes of the methods described in the above embodiments can be implemented by a computer program instructing related hardware, and the program can be stored in a computer-readable storage medium. The computer-readable storage medium may be a disk, optical disk, read-only memory, or random access memory, etc.

[0143] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A control device based on BLE CS, characterized in that, The device includes a motion sensor, a BLE module, and a control module, wherein... The motion sensor is used to detect the motion state of the device; When the BLE module is not connected to the anchor point, the control module controls the motion sensor to turn on, and wakes up the BLE module when it detects that the device is in motion. The BLE module establishes a connection with the anchor point and measures the distance between the device and the anchor point through the established connection channel; Once the BLE module establishes a connection with the anchor point, the controller module shuts down the motion sensor.

2. The BLE CS-based device according to claim 1, characterized in that, The BLE module establishes a connection between itself and the anchor point, including: The BLE module continuously sends broadcast packets outwards within a preset time and determines whether an anchor point has been found. If so, then establish a connection with the anchor point; Otherwise, when the preset time ends, the BLE module enters a sleep state.

3. A control device based on BLE CS according to claim 2, characterized in that, The device also includes an SE power switch circuit and an SE chip; when the distance between the BLE module and the anchor point reaches a predetermined threshold, the control module controls the BLE module to send a switch control signal to the SE power switch circuit, and the SE power switch circuit starts to supply power to the SE chip; the SE chip encrypts all control commands sent by the BLE module to the anchor point.

4. A control device based on BLE CS according to claim 3, characterized in that, The device also includes an NFC antenna connected to the SE chip; the NFC antenna is used to transmit encrypted data read from the anchor point by the device.

5. A control device based on BLE CS according to claim 4, characterized in that, The BLE module measures the distance between the device and the anchor point through the established connection channel, including: S1. Obtain the initial channel interval based on the preset maximum communication distance of the BLE module; S2. Use the initial channel spacing as the current channel spacing; use the preset maximum communication distance as the previous ranging result; S3: The BLE module reads the phase angles of two channels that satisfy the current channel interval and obtains the phase difference. Based on the phase difference and the previous ranging result, it calculates the first distance. Read the phase angles of the two channels corresponding to the maximum channel spacing and calculate the maximum phase difference; Determine whether the first distance is less than the first maximum ranging distance, where the first maximum ranging distance is the ranging distance when using the maximum channel spacing; If so, the ranging result is obtained based on the maximum phase difference and the first maximum ranging distance, the maximum channel interval is used as the current channel interval, and the process returns to step S3 for the next ranging. Otherwise, the first distance is optimized based on the maximum phase difference and the first maximum ranging distance to obtain the optimized distance, and the optimized distance is used as the ranging result for this time; the channel interval is calculated based on the optimized distance as the current channel interval, and the process returns to S3.

6. A control device based on BLE CS according to claim 5, characterized in that, The following relationship is used when obtaining the initial channel interval based on the preset maximum communication distance and when calculating the channel interval based on the optimized distance: ΔCH=(λ×(λ / Δλ))÷D, where ΔCH is the channel spacing, λ is the wavelength of the center channel, Δλ is the average wavelength difference between adjacent channels, and D is the distance. When solving for the initial channel spacing, D is taken as the preset maximum communication distance. When solving for the channel spacing calculated based on the optimized distance, D is taken as the optimized distance.

7. A control device based on BLE CS according to claim 6, characterized in that, The BLE module reads the phase angles of two channels that satisfy the current channel interval and obtains the phase difference, including: Determine whether the channel interval is set to a fixed channel interval; If so, the BLE module reads the phase angle of the lowest-numbered channel and the channel whose number is the channel interval between the lowest-numbered channel and the channel, and calculates the difference between the phase angles of the two channels to obtain the phase difference; Otherwise, the BLE module reads all channel phase angles, randomly selects two channel phase angles with an interval equal to the channel interval, and calculates the difference between the two channel phase angles as the phase difference.

8. A control device based on BLE CS according to claim 7, characterized in that, The first distance is calculated based on the phase difference and the previous ranging result, and the current ranging result is obtained based on the maximum phase difference and the first maximum ranging distance. The corresponding ranging distances are obtained using the following formulas: d=(Δθ / 2π)×D p In the formula, d is the distance measured, and D p The distance corresponding to the previous ranging result or the first maximum ranging distance is Δθ, and the phase difference or the maximum phase difference is Δθ.

9. A control device based on BLE CS according to claim 8, characterized in that, The relation d = (Δθ / 2π) × D p In this context, Δθ is the difference between the corresponding channel phase difference and the error phase difference, where the error phase difference is the maximum phase difference when the BLE module and the anchor point are attached.

10. A control device based on BLE CS according to claim 9, characterized in that, The optimized distance is obtained by optimizing the first distance based on the maximum phase difference and the first maximum ranging distance, specifically as follows: In the formula, D c D is the optimized distance. 1max It is the first maximum ranging distance. To round down, Δd is the relative distance, where Δd = (Δθ) max / 2π)×D 1max , Δθ max The maximum phase difference is denoted as .