An adaptive bluetooth signal strength switch lock method and related devices

By acquiring the Bluetooth signal strength at different distances from the second Bluetooth device and optimizing the preset signal strength threshold, the stability problem of traditional Bluetooth switch-lock algorithms at different positions or distances is solved, realizing adaptive Bluetooth switch-lock functionality and improving user experience.

CN120091290BActive Publication Date: 2026-02-17MAGICYO TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510203067.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-24
Publication Date
2026-02-17
Estimated Expiration
2045-02-24

AI Technical Summary

Technical Problem

Traditional Bluetooth automatic lock opening and closing algorithms are based on fixed strength thresholds, which makes it difficult to reliably achieve the lock opening and closing function under different Bluetooth device installation locations or distances, resulting in problems such as unlocking failure or mis-locking.

Method used

By acquiring the Bluetooth signal strength at different distances from the second Bluetooth device, optimizing the preset signal strength threshold, and adjusting the state of the electronic lock according to the real-time signal strength, an adaptive locking and unlocking function is achieved.

Benefits of technology

It can reliably and accurately perform the opening and closing lock functions at any distance, improving user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120091290B_ABST
    Figure CN120091290B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a self-adaptive Bluetooth signal strength switch lock method and related equipment, by acquiring all signal strengths of Bluetooth signals received by a second Bluetooth device when the second Bluetooth device is connected with a first Bluetooth device at different distances, the acquired signal strengths can all ensure that the first Bluetooth device can be stably connected with the second Bluetooth device at any distance; and a preset signal strength threshold is optimized according to a distribution of the all signal strengths, so as to realize optimization of the preset signal strength threshold according to a distance between the first Bluetooth device and the second Bluetooth device, ensure that the switch lock function can be stably and accurately realized at any distance, and improve user satisfaction.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This invention relates to the field of wireless control technology, and in particular to an adaptive Bluetooth signal strength switching lock method and related equipment. [Background Technology]

[0002] In recent years, the integration of intelligent connected devices with vehicles has become increasingly widespread, becoming a significant trend in industry development. Smartphones, smartwatches, and other devices, serving as key interactive terminals in vehicles, enable remote vehicle control, infotainment, navigation, and other functions. Bluetooth technology, as a short-range wireless communication technology, is widely used for data transmission and control between automobiles and smart devices.

[0003] Traditional Bluetooth automatic unlocking and locking algorithms are typically based on a fixed strength threshold. When the Bluetooth signal strength reaches the threshold, the vehicle is automatically unlocked; otherwise, it is locked. However, due to the diverse installation locations of Bluetooth devices in vehicles, such as the front wheels, rear wheels, or seats, the received Bluetooth signal strength varies significantly at different locations or distances. This leads to unstable unlocking and locking functions at certain installation locations or distances, resulting in unlocking failures, mis-locking, and other malfunctions, reducing user satisfaction. [Summary of the Invention]

[0004] In view of this, the present invention provides a method and related device for switching on and off a lock based on adaptive Bluetooth signal strength.

[0005] The specific technical solution of the first embodiment of the present invention is as follows: an adaptive Bluetooth signal strength opening and closing lock method, applied to a first Bluetooth device, wherein the first Bluetooth device is equipped with an electronic lock, the first Bluetooth device is used to receive Bluetooth signals sent by a second Bluetooth device, and to open or close the electronic lock according to the signal strength of the Bluetooth signal, the method comprising: acquiring all signal strengths of Bluetooth signals received when establishing a Bluetooth connection with the second Bluetooth device at different distances; optimizing a preset signal strength threshold according to the distribution of the total signal strength to obtain a first target signal strength threshold; adjusting the state of the electronic lock according to the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal, the state including an open state and a closed state.

[0006] Preferably, the step of optimizing the preset signal strength threshold based on the distribution of all signal strengths to obtain the first target signal strength threshold includes: obtaining the first number of signal strengths exceeding the preset signal strength threshold among all signal strengths; and optimizing the preset signal strength threshold based on a first ratio of the first number to the second number of all signal strengths to obtain the first target signal strength threshold.

[0007] Preferably, the step of optimizing the preset signal strength threshold based on the first quantity ratio of the first number to the second number of all signal strengths to obtain the first target signal strength threshold includes: if the first quantity ratio is greater than or less than the preset threshold, then setting the median of the signal strengths among all signal strengths as the first target signal strength threshold; if the first quantity ratio is equal to the preset threshold, then setting the preset signal strength threshold as the first target signal strength threshold.

[0008] Preferably, the preset signal strength threshold includes multiple signal strength thresholds; then, optimizing the preset signal strength threshold according to the distribution of all signal strengths to obtain a first target signal strength threshold includes: optimizing the multiple signal strength thresholds according to the distribution of all signal strengths to obtain an optimized signal strength threshold corresponding to each signal strength threshold; then, adjusting the state of the electronic lock according to the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal includes: selecting a first target optimized signal strength threshold from all optimized signal strength thresholds based on the user's selection; the first target optimized signal strength threshold is any one of the all optimized signal strength thresholds; adjusting the state of the electronic lock according to the first target optimized signal strength threshold and the signal strength of the received real-time Bluetooth signal.

[0009] Preferably, the step of optimizing the plurality of signal strength thresholds according to the distribution of all signal strengths to obtain an optimized signal strength threshold corresponding to each signal strength threshold includes: obtaining a first signal strength threshold; the first signal strength threshold is the signal strength threshold with the smallest value among the plurality of signal strength thresholds; obtaining a third number of signal strengths among all signal strengths that exceed the first signal strength threshold; and optimizing the plurality of signal strength thresholds according to a second ratio of the third number to the second number of all signal strengths to obtain the optimized signal strength threshold.

[0010] Preferably, the step of optimizing the plurality of signal strength thresholds based on the second quantity ratio of the third number to the second number of all signal strengths to obtain the optimized signal strength threshold includes: if the second quantity ratio is greater than a preset threshold, then setting the median of the signal strengths among all signal strengths as the second target signal strength threshold corresponding to the first signal strength threshold, and increasing the preset value of all signal strength thresholds except the first signal strength threshold to obtain a third target signal strength threshold; the second target signal strength threshold and the third target signal strength threshold constitute the optimized signal strength threshold; if the second quantity ratio is less than the preset threshold, then setting the median of the signal strengths among all signal strengths as the fourth target signal strength threshold corresponding to the first signal strength threshold, and decreasing the preset value of all signal strength thresholds except the first signal strength threshold to obtain a fifth target signal strength threshold; the fourth target signal strength threshold and the fifth target signal strength threshold constitute the optimized signal strength threshold; if the second quantity ratio is equal to the preset threshold, then setting the plurality of signal strength thresholds as the optimized signal strength threshold.

[0011] Preferably, adjusting the state of the electronic lock based on the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal includes: adjusting the electronic lock to a locked state when the signal strength of the real-time Bluetooth signal is less than or equal to the first target signal strength threshold; and adjusting the electronic lock to an unlocked state when the signal strength of the real-time Bluetooth signal is greater than the first target signal strength threshold.

[0012] The specific technical solution of the second embodiment of the present invention is as follows: an adaptive Bluetooth signal strength switching lock system, the system comprising: a signal strength acquisition module, a threshold acquisition module, and a state control module; the signal strength acquisition module is used to acquire all signal strengths of Bluetooth signals received when establishing a Bluetooth connection with the second Bluetooth device at different distances; the threshold acquisition module is used to optimize a preset signal strength threshold according to the distribution of all signal strengths to obtain a first target signal strength threshold; the state control module is used to adjust the state of the electronic lock according to the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal, the state including an open state and a closed state.

[0013] The specific technical solution of the third embodiment of the present invention is as follows: an adaptive Bluetooth signal strength switch lock device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method as described in any one of the first embodiments of this application.

[0014] The specific technical solution of the fourth embodiment of the present invention is as follows: a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor performs the steps of the method as described in any one of the first embodiments of this application.

[0015] Implementing the embodiments of the present invention will have the following beneficial effects:

[0016] This invention acquires the total signal strength of the Bluetooth signal received when connecting to the second Bluetooth device at different distances, ensuring that the acquired signal strength guarantees a stable connection between the first Bluetooth device and the second Bluetooth device at any distance. Furthermore, it optimizes a preset signal strength threshold based on the distribution of all signal strengths, thereby optimizing the preset signal strength threshold according to the distance between the first and second Bluetooth devices. This ensures stable and accurate locking / unlocking functionality at any distance, improving user satisfaction. [Attached Image Description]

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the steps of an adaptive Bluetooth signal strength switching lock method;

[0019] Figure 2 A schematic diagram of a switch and lock system that adapts to Bluetooth signal strength;

[0020] Figure 3 This is a diagram of the internal structure of a computer device.

[0021] Among them, 201 is the signal strength acquisition module; 202 is the threshold acquisition module; and 203 is the status control module.

Detailed Implementation Methods

[0022] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0023] The terms "first," "second," etc., used in the specification, claims, and drawings of this application are used to distinguish different objects, not to describe a specific order. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or modules is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other steps or modules inherent to such processes, methods, products, or apparatus.

[0024] In this document, the term "embodiment" means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0025] Please see Figure 1 This is a flowchart illustrating the steps of an adaptive Bluetooth signal strength-based lock opening and closing method according to a first embodiment of this application. The method is applied to a first Bluetooth device, which is equipped with an electronic lock. The first Bluetooth device receives Bluetooth signals sent by a second Bluetooth device and opens or closes the electronic lock based on the signal strength of the Bluetooth signal, ensuring stable and accurate lock opening and closing functionality at any distance. The method includes:

[0026] Step 101: Obtain the total signal strength of the Bluetooth signal received when establishing a Bluetooth connection with the second Bluetooth device at different distances;

[0027] Step 102: Optimize the preset signal strength threshold according to the distribution of all signal strengths to obtain the first target signal strength threshold;

[0028] Step 103: Adjust the state of the electronic lock according to the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal. The state includes an open state and a closed state.

[0029] Specifically, the first Bluetooth device can be placed anywhere in the vehicle and includes an electronic lock. The second Bluetooth device can be an electronic terminal, such as a mobile phone or tablet. When the first and second Bluetooth devices connect for the first time, the first Bluetooth device checks if it is the first connection with the second Bluetooth device. If it is, the first Bluetooth device sends a message to the second Bluetooth device, which then initiates the adaptive learning process described in this embodiment. Specifically, when the first and second Bluetooth devices are detected to be connecting for the first time, the message instructs the second Bluetooth device to change its distance from the first Bluetooth device. For example, it might start recording the Bluetooth signal strength from the point where the second Bluetooth device is closest to the first Bluetooth device until the second Bluetooth device disconnects from the first Bluetooth device. At this point, the total signal strength of the Bluetooth signal received by the first Bluetooth device at different distances is obtained. The preset signal strength threshold is optimized based on the distribution of all signal strengths, thereby achieving optimization of the preset signal strength threshold according to the distance between the first and second Bluetooth devices.

[0030] The method in this embodiment acquires all the signal strengths of the Bluetooth signals received when connecting to the second Bluetooth device at different distances, ensuring that the acquired signal strengths guarantee a stable connection between the first Bluetooth device and the second Bluetooth device at any distance. The method also optimizes a preset signal strength threshold based on the distribution of all signal strengths, thereby optimizing the preset signal strength threshold according to the distance between the first and second Bluetooth devices. This ensures stable and accurate locking / unlocking functionality at any distance, improving user satisfaction.

[0031] In a specific embodiment, optimizing the preset signal strength threshold based on the distribution of all signal strengths to obtain a first target signal strength threshold includes: obtaining the first number of signal strengths exceeding the preset signal strength threshold among all signal strengths; and optimizing the preset signal strength threshold based on a first ratio of the first number to the second number of all signal strengths to obtain the first target signal strength threshold.

[0032] Specifically, when the total number of signal strengths is A1 and the number of signal strengths exceeding the preset signal strength threshold is A2, the preset signal strength threshold is optimized based on the first quantity ratio a1 of A2 and A1. The preset signal strength threshold can also be adjusted based on the distribution of 80% of the total signal strength values. If 80% of the signal strength values ​​exceed the preset threshold, the threshold value is increased; if 80% of the signal strength values ​​are less than the threshold, the threshold value is decreased. This achieves adaptive adjustment of the preset signal strength threshold based on signal strength. The next time the first Bluetooth device connects with the second Bluetooth device, the first Bluetooth device will directly activate the adjusted first target signal strength threshold for unlocking and locking.

[0033] In a specific embodiment, optimizing the preset signal strength threshold based on the first quantity ratio of the first number to the second number of all signal strengths to obtain the first target signal strength threshold includes: if the first quantity ratio is greater than or less than the preset threshold, then setting the median of the signal strengths among all signal strengths as the first target signal strength threshold; if the first quantity ratio is equal to the preset threshold, then setting the preset signal strength threshold as the first target signal strength threshold.

[0034] Specifically, the preset threshold can be set according to the actual situation, such as 80%. If the first quantity ratio a1 is greater than or less than 80%, the median of the signal strength among all signal strengths is set as the first target signal strength threshold. For example, if all signal strengths are sorted in descending order of value as n1, n2, and n3, then the first target signal strength threshold is n2. Setting the median can better achieve adaptive optimization of the signal strength threshold and will not cause the signal strength threshold to become an extreme value, resulting in unlocking or locking failure.

[0035] In a specific embodiment, the preset signal strength threshold includes multiple signal strength thresholds; then, optimizing the preset signal strength threshold according to the distribution of all signal strengths to obtain a first target signal strength threshold includes: optimizing the multiple signal strength thresholds according to the distribution of all signal strengths to obtain an optimized signal strength threshold corresponding to each signal strength threshold; then, adjusting the state of the electronic lock according to the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal includes: selecting a first target optimized signal strength threshold from all optimized signal strength thresholds based on the user's selection; the first target optimized signal strength threshold is any one of the all optimized signal strength thresholds; adjusting the state of the electronic lock according to the first target optimized signal strength threshold and the signal strength of the received real-time Bluetooth signal.

[0036] Specifically, the first Bluetooth device sets three signal strength thresholds, such as near, medium, and far. The near, medium, and far levels are optimized based on the distribution of all signal strengths. Based on the user's selection, a first target optimized signal strength threshold is chosen from the optimized near, medium, and far levels, such as selecting the optimized near level. The electronic lock's state is adjusted based on the optimized near level and the signal strength of the received real-time Bluetooth signal.

[0037] Specifically, setting near, medium, and far gears can meet the different unlocking distance requirements of users. For example, the near gear is set to unlock when the signal strength is greater than -20 and lock when it is less than or equal to -20; the medium gear is set to unlock when the signal strength is greater than -45 and lock when it is less than or equal to -45; and the far gear is set to unlock when the signal strength is greater than -75 and lock when it is less than or equal to -75.

[0038] In a specific embodiment, optimizing the plurality of signal strength thresholds based on the distribution of all signal strengths to obtain an optimized signal strength threshold corresponding to each signal strength threshold includes: obtaining a first signal strength threshold; the first signal strength threshold being the signal strength threshold with the smallest value among the plurality of signal strength thresholds; obtaining a third number of signal strengths among all signal strengths that exceed the first signal strength threshold; and optimizing the plurality of signal strength thresholds based on a second ratio of the third number to the second number of all signal strengths to obtain the optimized signal strength threshold.

[0039] Specifically, the signal strength threshold with the smallest value among the near gear, middle gear, and far gear is the near gear. The third number A3 that exceeds the signal strength of the near gear is obtained. The near gear, middle gear, and far gear are optimized based on the second quantity ratio a2 of the third number A3 and A1, thereby achieving adaptive optimization of the signal strength threshold of different gears.

[0040] In a specific embodiment, optimizing the plurality of signal strength thresholds based on the second quantity ratio of the third number to the second number of all signal strengths to obtain the optimized signal strength threshold includes: if the second quantity ratio is greater than a preset threshold, then setting the median of the signal strengths among all signal strengths as the second target signal strength threshold corresponding to the first signal strength threshold, and increasing the preset value of all signal strength thresholds except the first signal strength threshold to obtain a third target signal strength threshold; the second target signal strength threshold and the third target signal strength threshold constitute the optimized signal strength threshold; if the second quantity ratio is less than the preset threshold, then setting the median of the signal strengths among all signal strengths as the fourth target signal strength threshold corresponding to the first signal strength threshold, and decreasing the preset value of all signal strength thresholds except the first signal strength threshold to obtain a fifth target signal strength threshold; the fourth target signal strength threshold and the fifth target signal strength threshold constitute the optimized signal strength threshold; if the second quantity ratio is equal to the preset threshold, then setting the plurality of signal strength thresholds as the optimized signal strength threshold.

[0041] Specifically, if 80% of the signal strength exceeds the near-range value, then: the near-range value is adjusted to the median of all signal strengths; the mid-range value is adjusted by subtracting the original near-range value from the adjusted near-range value and then adding the original mid-range value; the far-range value is adjusted by subtracting the original near-range value from the adjusted near-range value and then adding the original far-range value. For example, if the median of all signal strengths is -30, then: the near-range value is adjusted to -30; the mid-range value is adjusted to -20 - (-10) + (-45) = -55; and the far-range value is adjusted to -20 - (-10) + (-75) = -85.

[0042] If 80% of the signal strength is less than the nearest range value, then: the nearest range value is adjusted to the median of all signal strengths. The mid-range value is adjusted to the original mid-range value minus (the original near range value minus the adjusted near range value). The far range value is adjusted to the original far range value minus (the original near range value minus the adjusted near range value). For example, assuming the median is -10, then: the near range value is adjusted to -10. The mid-range value is adjusted to -45 - (-20 - (-10)) = -35. The far range value is adjusted to -75 - (-20 - (-10)) = -65.

[0043] In a specific embodiment, the method further includes performing Kalman filtering on all signal strengths to remove abrupt data, extracting a smooth dataset, and optimizing a preset signal strength threshold based on the distribution of signal strength in the smooth dataset to obtain a first target signal strength threshold.

[0044] Specifically, the Kalman filtering process includes: Filter initialization: Based on the statistical characteristics of the initial signal strength data, the initial state vector and covariance matrix of the Kalman filter are set. State prediction: Based on the signal strength value at the previous moment and the system dynamic model, the signal strength value and its uncertainty at the current moment are predicted. Observation update: Using the actual observed signal strength value at the current moment, combined with the prediction result, the state is updated through the Kalman gain to obtain a more accurate signal strength estimate. Repeated iteration: The recorded signal strength data sequence is processed point by point, and the filter state is iteratively updated until all data points have been processed. Removal of abrupt data: The signal strength estimate after Kalman filtering can effectively remove abrupt points and outliers from the original data. Extraction of smooth dataset: A smooth and continuous signal strength dataset is extracted from the filtered data for subsequent analysis.

[0045] Analyze the distribution of 80% of the values ​​in the dataset and adjust the preset unlocking sensitivity levels accordingly. If 80% of the values ​​in the dataset exceed the preset value for the nearest setting, set the preset value for the nearest setting to the median of the dataset and adjust the preset values ​​for the intermediate and far settings accordingly. If 80% of the values ​​in the dataset are less than the preset value for the nearest setting, set the preset value for the nearest setting to the median of the dataset and adjust the preset values ​​for the intermediate and far settings accordingly.

[0046] Introduce filtering performance evaluation metrics:

[0047] 1. Mean Squared Error (MSE): MSE is a commonly used metric for measuring filtering effectiveness. It represents the average of the squared differences between the filtered data and the actual (or expected) data. In practical applications, the signal strength data before filtering is considered the original data, and the signal strength data after filtering is considered the processed data. The MSE between the two is calculated to evaluate the filtering effect. The formula for calculating MSE is: MSE = 1 / N * Σ[(original data - filtered data)] 2 ], where N is the number of data points.

[0048] 2. Standard Deviation: Standard deviation measures the dispersion of data, i.e., the degree of data fluctuation. In evaluating the effectiveness of filtering, the improvement in data volatility caused by the filtering process can be assessed by comparing the standard deviations of signal strength data before and after filtering. The smaller the standard deviation, the smoother the data and the better the filtering effect.

[0049] Calculation metric: Calculate the mean squared error (MSE)

[0050] Prepare the data: Ensure you have two sets of data: one set of raw signal strength data and the other set of signal strength data after Kalman filtering. Both sets of data should be of the same length.

[0051] Calculate the sum of squared errors: Iterate through both sets of data. For each data point, calculate the error between the original data and the filtered data (i.e., the difference between the two). Square each error and sum all the squared errors to obtain the sum of squared errors.

[0052] Calculate the mean squared error: Divide the sum of squared errors by the length of the data (i.e. the number of data points) to obtain the mean squared error (MSE).

[0053] Calculate the average: Calculate the average of the original data and the filtered data separately. This is done by summing all the data points and then dividing by the number of data points.

[0054] Calculate the sum of squared deviations: Iterate through the data, and for each data point, calculate its deviation from the mean (i.e., the data point minus the mean). Square each deviation and sum all the squared deviations to obtain the sum of squared deviations.

[0055] Calculate the variance: Divide the sum of squared deviations by the length of the data to obtain the variance.

[0056] To calculate the standard deviation, take the square root of the variance.

[0057] Implementation steps: In C language, it is necessary to include `<math.h> The header file allows you to use the `sqrt` function to calculate the square root. You can define two functions: one to calculate the MSE and the other to calculate the standard deviation. In the main function, you can declare and initialize the original data and the filtered data arrays, and then call these two functions to calculate the MSE and standard deviation. Finally, you can use the `printf` function to output the results to the console or write them to a file.

[0058] Important Notes: Ensure that the program's data arrays are correctly initialized and of uniform length. During calculations, avoid precision loss due to integer division; floating-point numbers should generally be used. There are two ways to calculate standard deviation: sample standard deviation and population standard deviation. In most cases, the sample standard deviation is used, which requires dividing the sum of squared deviations by (data length - 1). However, in some cases, if the program's data is considered representative of the entire population, the population standard deviation may be used, which divides the sum of squared deviations by the data length. Choose the appropriate calculation method based on your specific needs.

[0059] Analyze the dataset and adjust preset values: Analyze the distribution of 80% of the values ​​in the dataset and adjust the preset unlocking sensitivity levels accordingly. If 80% of the values ​​in the dataset exceed the preset value for the nearest level, set the preset value for the nearest level to the median of the dataset and increase the preset values ​​for the middle and far levels accordingly; otherwise, decrease them accordingly.

[0060] Enable adaptive signal strength function: After completing the above steps, the smart connected device will have the function of adaptive signal strength. Regardless of the device's installation location, this function can automatically adjust the preset signal strength value according to the actual environment, realizing automatic unlocking when Bluetooth approaches and automatic locking when Bluetooth moves away.

[0061] Practical Application and Optimization: In practical applications, users only need to bring a Bluetooth-enabled mobile device near or away from the electric two-wheeler. The intelligent connected device will automatically adjust the preset signal strength value based on the adaptive signal strength function, achieving stable and reliable opening and closing functions. Based on actual application scenarios and user feedback, the control system program is continuously updated and optimized to improve user experience and device stability.

[0062] When the device is first used, a crucial adaptive learning process is initiated to ensure the accuracy of signal strength values ​​and optimize the performance of the locking and unlocking functions. Here is a specific example of this adaptive learning process: When a user uses the vehicle for the first time and initiates the adaptive learning process, the system begins recording the signal strength value from the closest point of the phone's Bluetooth connection to the two-wheeled vehicle until the phone's Bluetooth connection to the device is lost, ending the recording process. Next, the system performs a Kalman filter on the first 30 recorded signal strength data packets to remove abrupt changes and extract a smooth, continuous dataset. The specific process of Kalman filtering is as follows:

[0063] 1. Initialize the filter: Based on the statistical characteristics of the initial signal strength data, set the initial state vector and covariance matrix of the Kalman filter.

[0064] 2. State prediction: Based on the signal strength value at the previous moment and the system dynamic model, predict the signal strength value at the current moment and its uncertainty.

[0065] 3. Observation Update: Using the actual observed signal strength value at the current moment, combined with the prediction results, the state is updated through Kalman gain to obtain a more accurate signal strength estimate.

[0066] 4. Repeated Iteration: Process the recorded signal strength data sequence point by point, continuously iterating and updating the filter state until all data points have been processed.

[0067] After Kalman filtering, a smooth and continuous signal strength dataset is obtained. Next, the mean squared error (MSE) and standard deviation will be calculated based on this dataset to evaluate the filtering effect.

[0068] The steps for calculating the mean squared error (MSE) are as follows:

[0069] 1. Data Preparation: There are two sets of data: one set is the raw signal strength data, and the other set is the signal strength data after Kalman filtering. Both sets of data should be of the same length.

[0070] 2. Calculate the sum of squared errors: Iterate through the two sets of data. For each data point, calculate the error between the original data and the filtered data (i.e., the difference between the two). Then square each error and sum all the squared errors to obtain the sum of squared errors.

[0071] 3. Calculate the mean squared error: Divide the sum of squared errors by the length of the data (i.e., the number of data points) to obtain the mean squared error (MSE). The smaller the MSE value, the better the filtering effect.

[0072] The steps for calculating the standard deviation are as follows:

[0073] 1. Calculate the average: Calculate the average of the original data and the filtered data respectively.

[0074] 2. Calculate the sum of squared deviations: Iterate through the data. For each data point, calculate its deviation from the mean (i.e., the data point minus the mean). Then square each deviation and sum all the squared deviations to obtain the sum of squared deviations.

[0075] 3. Calculate the variance: Divide the sum of squared deviations by the length of the data (in the case of sample standard deviation, divide by the data length - 1; in the case of population standard deviation, divide by the data length) to obtain the variance.

[0076] 4. Calculate the standard deviation: Take the square root of the square deviation to get the standard deviation. The smaller the standard deviation, the smoother the data and the better the filtering effect.

[0077] In a specific embodiment, adjusting the state of the electronic lock based on the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal includes: adjusting the electronic lock to a locked state when the signal strength of the real-time Bluetooth signal is less than or equal to the first target signal strength threshold; and adjusting the electronic lock to an unlocked state when the signal strength of the real-time Bluetooth signal is greater than the first target signal strength threshold. Specifically, by recording users' usage habits and location information over a long period, the unlocking sensitivity level is automatically adjusted. Regardless of the location of the first Bluetooth device, it can achieve automatic unlocking when Bluetooth approaches and automatic locking when Bluetooth moves away at the same near, medium, and long distances, through applications such as a second Bluetooth device, to better meet users' personalized needs.

[0078] This embodiment may also include other technical modules and features to further optimize and expand the functionality of the invention. For example, an adaptive adjustment module based on user habits can be added. Furthermore, this embodiment can be combined with artificial intelligence technology, utilizing machine learning and deep learning algorithms to process and analyze large amounts of data, further enhancing the device's adaptive capabilities and user experience. The method for adaptive RSSI at any Bluetooth installation location provided in this embodiment achieves stable performance under different installation locations by adaptively learning and adjusting preset RSSI values. This can greatly improve the convenience and reliability of the integration of intelligent connected devices with vehicles, possessing broad application prospects and market potential.

[0079] In a specific embodiment, please refer to Figure 2 This is a schematic diagram of the structure of an adaptive Bluetooth signal strength switch lock system according to a second embodiment of this application. The system includes: a signal strength acquisition module 201, a threshold acquisition module 202, and a state control module 203. The signal strength acquisition module 201 is used to acquire the total signal strength of the Bluetooth signal received when establishing a Bluetooth connection with the second Bluetooth device at different distances. The threshold acquisition module 202 is used to optimize a preset signal strength threshold according to the distribution of the total signal strength to obtain a first target signal strength threshold. The state control module 203 is used to adjust the state of the electronic lock according to the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal. The state includes an open state and a closed state.

[0080] In this embodiment, the system acquires all the signal strengths of the Bluetooth signals received when connecting to the second Bluetooth device at different distances, ensuring that the acquired signal strengths guarantee a stable connection between the first Bluetooth device and the second Bluetooth device at any distance. The system optimizes a preset signal strength threshold based on the distribution of all signal strengths, thereby optimizing the preset signal strength threshold according to the distance between the first and second Bluetooth devices. This ensures stable and accurate locking / unlocking functionality at any distance, improving user satisfaction.

[0081] In a specific embodiment, the third embodiment of this application provides an adaptive Bluetooth signal strength switch lock device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the method as described in any one of the first embodiments of this application.

[0082] In a specific embodiment, the fourth embodiment of this application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the method as described in any one of the first embodiments of this application.

[0083] Figure 3 An internal structural diagram of a computer device in one embodiment is shown. This computer device can specifically be a terminal or a server. See also... Figure 3 The computer device includes a processor, memory, etc., connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program causes the processor to implement the method described in this embodiment. The internal memory may also store a computer program, which, when executed by the processor, causes the processor to perform the method described in this embodiment. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0084] The above embodiments merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

[0085] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments for application in other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. A method for opening and closing a lock based on adaptive Bluetooth signal strength, applied to a first Bluetooth device, wherein the first Bluetooth device is equipped with an electronic lock, the first Bluetooth device is used to receive a Bluetooth signal sent by a second Bluetooth device, and to open or close the electronic lock according to the signal strength of the Bluetooth signal, characterized in that... The method includes: Acquire the total signal strength of the Bluetooth signals received when establishing a Bluetooth connection with the second Bluetooth device at different distances; The preset signal strength threshold is optimized based on the distribution of all signal strengths to obtain the first target signal strength threshold; The state of the electronic lock is adjusted according to the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal, the state including an open state and a closed state; The preset signal strength threshold includes multiple signal strength thresholds; The step of optimizing the preset signal strength threshold based on the distribution of all signal strengths to obtain the first target signal strength threshold includes: Based on the distribution of all signal strengths, the multiple signal strength thresholds are optimized to obtain the optimized signal strength threshold corresponding to each signal strength threshold; The step of adjusting the state of the electronic lock based on the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal includes: Based on the user's selection, a first target optimized signal strength threshold is selected from all optimized signal strength thresholds; the first target optimized signal strength threshold is any one of the all optimized signal strength thresholds. The electronic lock's state is adjusted based on the first target optimized signal strength threshold and the signal strength of the received real-time Bluetooth signal; The step of optimizing the multiple signal strength thresholds based on the distribution of all signal strengths to obtain an optimized signal strength threshold for each signal strength threshold includes: Obtain a first signal strength threshold; the first signal strength threshold is the signal strength threshold with the smallest value among the plurality of signal strength thresholds; Obtain the third number of signal strengths that exceed the first signal strength threshold among all the signal strengths; The multiple signal strength thresholds are optimized based on the second quantity ratio of the third number to the second number of all signal strengths to obtain the optimized signal strength threshold; The step of optimizing the plurality of signal strength thresholds based on the second quantity ratio of the third number to the second number of all signal strengths to obtain the optimized signal strength threshold includes: If the second quantity ratio is greater than a preset threshold, then the median of the signal strengths among all signal strengths is set as the second target signal strength threshold corresponding to the first signal strength threshold, and the preset values ​​of all signal strength thresholds except the first signal strength threshold are increased to obtain a third target signal strength threshold; the second target signal strength threshold and the third target signal strength threshold constitute the optimized signal strength threshold; If the second quantity ratio is less than a preset threshold, then the median of the signal strengths among all signal strengths is set as the fourth target signal strength threshold corresponding to the first signal strength threshold, and the preset values ​​of all signal strength thresholds except the first signal strength threshold are reduced to obtain the fifth target signal strength threshold; the fourth target signal strength threshold and the fifth target signal strength threshold constitute the optimized signal strength threshold; If the second quantity ratio is equal to the preset threshold, then the plurality of signal strength thresholds are set as the optimized signal strength threshold.

2. The adaptive Bluetooth signal strength switching method for lock / unlocking as described in claim 1, characterized in that, The step of optimizing the preset signal strength threshold based on the distribution of all signal strengths to obtain the first target signal strength threshold includes: Obtain the first number of signal strengths that exceed the preset signal strength threshold among all signal strengths; The preset signal strength threshold is optimized based on the first quantity ratio of the first number to the second number of all signal strengths to obtain the first target signal strength threshold.

3. The adaptive Bluetooth signal strength switching method for locks and switches as described in claim 2, characterized in that, The step of optimizing the preset signal strength threshold based on the first quantity ratio of the first number to the second number of all signal strengths to obtain the first target signal strength threshold includes: If the first quantity ratio is greater than or less than a preset threshold, then the median of the signal strengths among all signal strengths is set as the first target signal strength threshold. If the first quantity ratio is equal to a preset threshold, then the preset signal strength threshold is set as the first target signal strength threshold.

4. The adaptive Bluetooth signal strength switching method for lock / unlocking as described in claim 1, characterized in that, Adjusting the state of the electronic lock based on the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal includes: When the signal strength of the real-time Bluetooth signal is less than or equal to the first target signal strength threshold, the electronic lock is adjusted to the locked state. When the signal strength of the real-time Bluetooth signal is greater than the first target signal strength threshold, the electronic lock is adjusted to the unlocked state.

5. An adaptive Bluetooth signal strength switching and locking system, applied to the adaptive Bluetooth signal strength switching and locking method as described in claim 1, characterized in that, The system includes: a signal strength acquisition module, a threshold acquisition module, and a state control module; The signal strength acquisition module is used to acquire the total signal strength of the Bluetooth signals received when the second Bluetooth device is connected to the Bluetooth device at different distances. The threshold acquisition module is used to optimize the preset signal strength threshold according to the distribution of all signal strengths to obtain the first target signal strength threshold. The state control module is used to adjust the state of the electronic lock according to the first target signal strength threshold and the signal strength of the received real-time Bluetooth signal. The state includes an open state and a closed state.

6. A switch / lock device that adapts to Bluetooth signal strength, comprising a memory and a processor, characterized in that, The memory stores a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 4.

7. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it causes the processor to perform the steps of the method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Vehicle unlocking method, terminal and storage medium

    CN113068160A

  • Electric vehicle non-inductive locking and unlocking method based on Bluetooth pairing, equipment and medium

    CN113611019A

  • Adjustable vehicle lock control system

    TWM584957U