Measurement distance correction method, device, medium and electronic equipment
By calculating the difference between the measured distance and the actual distance of the ultra-wideband device, the compensation function is obtained and corrected, the problem of large UWB distance measurement error is solved, the measurement accuracy is improved, and it is suitable for precision positioning and distance perception scenarios.
Patent Information
- Application Number
- CN202110137877.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-01
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-02-01
AI Technical Summary
Due to equipment errors and environmental factors, UWB distance measurement technology can reach more than 30cm in measurement errors, which is insufficient accuracy and is difficult to meet the needs of precision positioning.
By obtaining the difference between the measured distance and the actual distance of multiple ultra-wideband devices, a compensation function is calculated and used to correct the measured distance to improve the measurement accuracy.
It effectively reduces measurement errors, improves the accuracy of measurement distances, and can control the errors within 10 cm. It is suitable for indoor precision positioning and distance perception applications.
Smart Images

Figure CN112946569B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a distance measurement correction method, device, medium and electronic equipment. Background Art
[0002] Ultra Wide Band (UWB) technology is a wireless carrier communication technology that does not use a sinusoidal carrier but uses nanosecond non-sinusoidal narrow pulses to transmit data, so it occupies a wide spectrum range. UWB technology has the advantages of low system complexity, low power spectrum density of transmitted signals, insensitivity to channel fading, low interception capability, and high positioning accuracy. It is especially suitable for high-speed wireless access in dense multipath places such as indoors. However, due to the error of the UWB chip itself and the influence of environmental factors, the UWB ranging error can reach more than 30cm, about 30cm at most distances, and up to more than 100cm, and the measurement accuracy is insufficient. Summary of the invention
[0003] The embodiments of the present application provide a measurement distance correction method, device, medium and electronic device, which can improve the measurement accuracy of ultra-wideband equipment.
[0004] The present application provides a method for measuring distance correction, which includes:
[0005] obtaining a plurality of measured distances of two ultra-wideband devices;
[0006] Obtaining a plurality of differences between the measured distances and the corresponding actual distances;
[0007] Calculate a compensation function corresponding to the actual distance and the measured distance according to the plurality of difference values;
[0008] A first measurement distance is obtained by measuring with two ultra-wideband devices; and
[0009] The first measured distance is corrected according to the compensation function to obtain a first corrected distance.
[0010] The present application also provides a method for measuring distance correction, which includes:
[0011] Obtaining a compensation function, wherein the compensation function is calculated by using a plurality of measured distances of two ultra-wideband devices and corresponding actual distances;
[0012] A first measurement distance is obtained by measuring with two ultra-wideband devices; and
[0013] The first measured distance is corrected according to the compensation function to obtain a first corrected distance.
[0014] The present application also provides a measurement distance correction device, which includes:
[0015] A measurement distance acquisition module, used to acquire multiple measurement distances of two ultra-wideband devices;
[0016] A difference acquisition module, used to acquire a plurality of differences between the measured distances and the corresponding actual distances;
[0017] a compensation function acquisition module, configured to calculate a compensation function corresponding to the actual distance and the measured distance according to the plurality of difference values; and
[0018] The correction module is used to obtain a first measured distance by measuring with two ultra-wideband devices, and to correct the first measured distance according to the compensation function to obtain a first corrected distance.
[0019] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed on a computer, the computer executes the distance measurement correction method as described above.
[0020] An embodiment of the present application further provides an electronic device, which includes a processor and a memory, wherein the memory has a computer program, and the processor executes the above-mentioned measurement distance correction method by calling the computer program.
[0021] In the embodiment of the present application, multiple measured distances of two ultra-wideband devices are obtained, and then multiple differences between the multiple measured distances and the corresponding actual distances are obtained, and then a compensation function corresponding to the actual distance and the measured distance is calculated based on the multiple differences. The subsequent measured distance can be corrected based on the compensation function, thereby improving the accuracy of the measured distance. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can obtain other drawings based on these drawings without creative work.
[0023] Figure 1 A first flow chart of a distance measurement correction method provided in an embodiment of the present application.
[0024] Figure 2 A second flow chart of the distance measurement correction method provided in an embodiment of the present application.
[0025] Figure 3 for Figure 2 Schematic diagram of the positions of two ultra-wideband devices in the measurement distance correction method shown.
[0026] Figure 4 for Figure 2 Schematic diagram of the relationship between measurement distance and error in the measurement distance correction method shown.
[0027] Figure 5 for Figure 2 Schematic diagram of the relationship between the measured distance and the actual distance in the measured distance correction method shown.
[0028] Figure 6 for Figure 2 Schematic diagram of the relationship between measured distance and difference in the measured distance correction method shown.
[0029] Figure 7 A schematic diagram of the relationship between the measured distance and error before using the correction method provided in an embodiment of the present application.
[0030] Figure 8 A schematic diagram of the relationship between the measured distance and error after using the correction method provided in an embodiment of the present application.
[0031] Fig. 9 A third flow chart of the distance measurement correction method provided in an embodiment of the present application.
[0032] Fig.10 A schematic diagram of the structure of a distance measurement correction device provided in an embodiment of the present application.
[0033] Fig.11 Another structural schematic diagram of the measurement distance correction device provided in an embodiment of the present application.
[0034] Fig.12 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0035] Fig.13 Another structural diagram of an electronic device provided in an embodiment of the present application DETAILED DESCRIPTION
[0036] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0037] This application embodiment provides a method for measuring distance correction. Figure 1 , Figure 1 The first flow chart of the distance measurement correction method provided in the embodiment of the present application is as follows:
[0038] 101. Obtain multiple measurement distances of two ultra-wideband devices.
[0039] An ultra wide band (UWB) device can measure the distance between another ultra wide band device using UWB technology.
[0040] The measured distance between two ultra-wideband devices is the distance value obtained by the two ultra-wideband devices through UWB technology. Two ultra-wideband devices can measure distance or positioning in a variety of ways, such as based on signal strength indication (RSSI), based on arrival time (TOA), based on arrival time difference (TDOA) and based on arrival direction (DOA or AOA). It should be noted that each measured distance has a corresponding actual distance. For example, the actual distance between the two ultra-wideband devices is obtained by other means, such as by laser ranging, manual ranging or other ranging methods, so as to obtain an accurate actual distance.
[0041] 102. Obtain multiple differences between multiple measured distances and corresponding actual distances.
[0042] A corresponding difference is obtained according to each measured distance and the corresponding actual distance, thereby obtaining a plurality of difference values between a plurality of measured distances and the corresponding actual distances.
[0043] Among them, multiple measured distances can correspond to one actual distance or multiple actual distances. One actual distance can correspond to one or multiple measured distances. Multiple measured distances can also include multiple groups of measured distance groups, each group of measured distance groups corresponds to the same actual distance, and multiple groups of measured distance groups correspond to different actual distances.
[0044] For example, 10 measurement distances can be measured at positions where the actual distance between two ultra-wideband devices is 1 meter, 2 meters, and 3 meters, respectively, thereby obtaining 30 measurement distances. Alternatively, 30 measurement distances can be measured at a position where the actual distance between two ultra-wideband devices is 1 meter, thereby obtaining 30 measurement distances. Alternatively, one measurement distance can be obtained by starting from a position where the actual distance between two ultra-wideband devices is 1 meter, and then the actual distance is increased by 1 meter in steps of 1 meter, and the measurement distances between the two ultra-wideband devices are obtained respectively, thereby obtaining 30 measurement distances.
[0045] 103. Calculate a compensation function corresponding to the actual distance and the measured distance according to the multiple difference values.
[0046] After obtaining a plurality of differences between a plurality of measured distances and the corresponding actual distances, a compensation function corresponding to the actual distance and the measured distance can be calculated based on the plurality of differences.
[0047] 104. Obtain a first measurement distance by measuring with two ultra-wideband devices.
[0048] 105 , correct the first measured distance according to the compensation function to obtain a first corrected distance.
[0049] After the actual distance and the measured distance are known, the corresponding function (i.e., the compensation function) of the actual distance and the measured distance can be calculated. The subsequent measured distance can be corrected according to the compensation function, thereby improving the accuracy of the measured distance. Specifically, after obtaining the compensation function, the two ultra-wideband devices can measure the first measured distance through UWB technology, and then correct the first measured distance according to the compensation function to obtain a first corrected distance that is closer to the actual distance.
[0050] It should be noted that the two ultra-wideband devices for obtaining the first measurement distance in this embodiment may be two ultra-wideband devices for obtaining the compensation function, and the two ultra-wideband devices for obtaining the first measurement distance may also be devices from the same batch or using the same measurement method as the two ultra-wideband devices for obtaining the compensation function. For example, each ultra-wideband device uses the same model or type of UWB measurement module.
[0051] The present application also provides a method for measuring distance correction. Figure 2 , Figure 2 A second flow chart of the distance measurement correction method provided in the embodiment of the present application, the distance measurement correction method may specifically include:
[0052] 201 , taking the first ultra wideband device as a base point, move the second ultra wideband device so that the second ultra wideband device is located at a different position relative to the first ultra wideband device.
[0053] The first ultra wide band (UWB) device and the second ultra wide band device may measure the distance using the UWB technology.
[0054] The two ultra-wideband devices may include a first ultra-wideband device and a second ultra-wideband device. The first ultra-wideband device is used as a base point, that is, the first ultra-wideband device is stationary, and the second ultra-wideband device is moved so that the second ultra-wideband device is located at a different position relative to the first ultra-wideband device, that is, the actual distance between the two ultra-wideband devices is changed.
[0055] 202 : Acquire multiple measured distances between the first ultra wideband device and the second ultra wideband device when the second ultra wideband device is located at different positions.
[0056] The measured distance between two ultra-wideband devices is the distance value obtained by the two ultra-wideband devices through UWB technology. Two ultra-wideband devices can measure distance or positioning in a variety of ways, such as based on signal strength indication (RSSI), based on arrival time (TOA), based on arrival time difference (TDOA) and based on arrival direction (DOA or AOA). It should be noted that each measured distance has a corresponding actual distance. For example, the actual distance between the two ultra-wideband devices is obtained by other means, such as by laser ranging, manual ranging or other ranging methods, so as to obtain an accurate actual distance.
[0057] For example, see Figure 3 , Figure 3 for Figure 2 The schematic diagram of the positions of two ultra-wideband devices in the measurement distance correction method shown in the figure, the first ultra-wideband device (i.e., UWB signal transmitting end A) is fixed at the starting position A0, and the positions of the second ultra-wideband device (i.e., UWB signal receiving end B) are B1, B2, ..., Bn in steps of 50 cm, and 100 groups of measurement distances of the second ultra-wideband device at various positions are recorded respectively, where the position of Bn is defined as the distance at which the second ultra-wideband device cannot receive the UWB signal of the first ultra-wideband device, or the second ultra-wideband device cannot resolve the UWB signal of the first ultra-wideband device, and the step size of 50 cm can be appropriately adjusted to reduce or increase according to the actual effect and accuracy requirements, and the accuracy and test efficiency need to be comprehensively considered.
[0058] When obtaining multiple measurement distances of the first ultra-wideband device and the second ultra-wideband device, the heights of the first ultra-wideband device and the second ultra-wideband device are kept consistent as much as possible. If the first ultra-wideband device and the second ultra-wideband device are similar devices, the overall heights of the two are consistent. If the first ultra-wideband device and the second ultra-wideband device are different devices, the UWB module heights of the two are consistent to avoid errors caused by inconsistent heights.
[0059] When obtaining multiple measurement distances of the first ultra-wideband device and the second ultra-wideband device, the first ultra-wideband device and the second ultra-wideband device can be arranged opposite each other, that is, the UWB module of the first ultra-wideband device and the UWB module of the second ultra-wideband device are arranged opposite each other. The UWB modules of the two ultra-wideband devices are arranged opposite each other to reduce the interference of objects between the two UWB modules. It can be understood that the UWB modules of the first ultra-wideband device and the second ultra-wideband device are both arranged on corresponding circuit boards, and the circuit boards will also have an impact on the UWB signals. The UWB modules on the circuit boards of the two ultra-wideband devices can be arranged relative to each other to reduce errors. Since the error distribution of different surfaces is inconsistent, calibration can be performed for each surface separately, or only one of the surfaces can be calibrated. The calibration of one of the surfaces is taken as an example below, and the calibration process of the remaining surfaces is exactly the same.
[0060] When obtaining multiple measurement distances of the first ultra-wideband device and the second ultra-wideband device, the test environment where the first ultra-wideband device and the second ultra-wideband device are located can be carried out in an open space or a microwave darkroom, or in other environments as needed. This embodiment does not limit the test environment.
[0061] 203 , obtaining a plurality of differences between a plurality of measured distances and corresponding actual distances.
[0062] A corresponding difference is obtained according to each measured distance and the corresponding actual distance, thereby obtaining a plurality of difference values between a plurality of measured distances and the corresponding actual distances.
[0063] Among them, each actual distance can correspond to multiple measured distances, and then each measured distance is subtracted from the corresponding actual distance to obtain a difference, thereby obtaining multiple differences between the multiple measured distances and the corresponding actual distances. Exemplarily, the first ultra-wideband device and the second ultra-wideband device obtain 100 measured distances respectively at actual distances of 50 cm and 120 cm through UWB technology, and then calculate the multiple differences between the 100 measured distances corresponding to the actual distance of 50 cm and 50 cm, and calculate the multiple differences between the 100 measured distances corresponding to the actual distance of 120 cm and 120 cm. Of course, the actual distance can also include more values, and correspondingly, the measured distance can also include more values.
[0064] 204 , obtaining a fitting function corresponding to the actual distance and the measured distance by calculation according to the plurality of differences and the least squares algorithm, and using the fitting function as a compensation function.
[0065] After obtaining multiple measured distances corresponding to multiple actual distances, the measured distances of the first ultra-wideband device and the second ultra-wideband device at different positions are subtracted from the actual distances to obtain the errors (i.e., differences) of the actual distances at different positions or distances, such as Figures 4 to 6 As shown, Figure 4 The horizontal axis is the test distance, and the vertical axis is the error (Error), both in centimeters; Figure 5 The horizontal and vertical coordinates are both distances, and the units are both meters. The schematic line of the test distance is very close to the schematic line of the actual distance; Figure 6 The horizontal axis is the actual distance, and the vertical axis is the bias, both in meters.
[0066] According to the least squares algorithm, the error and the actual distance are linearly fitted by the least squares method to obtain the linear error function. The specific principle is as follows:
[0067] Taking the univariate linear model as an example, suppose the collected data set is X = {(x1, y1), (x2, y2), ..., (x m ,y m)}, where x is the test distance and y is the error, and a univariate linear model is used to fit the data set:
[0068] y = β0 + β1x;
[0069] Use the sum of squared errors as the loss function (objective function):
[0070]
[0071] It is necessary to find the β0 and β1 values that make all test data satisfy the minimum loss function J(β), and calculate the partial derivatives of β0 and β1 respectively:
[0072]
[0073]
[0074] because So the above formula can be rewritten as:
[0075]
[0076] make get:
[0077]
[0078]
[0079] Similarly:
[0080]
[0081]
[0082] In summary, the best fit of the data can be obtained, that is, the best parameters of the fitting function can be obtained. The obtained linear fitting coefficient is used as the coefficient of the linear interpolation function, that is, the coefficient of the fitting function, and the test distance obtained by the test is substituted into the linear interpolation function to obtain the error estimate at the distance, and the estimated error is subtracted from the test distance to obtain the calibrated distance. It is also possible to establish a correction coefficient table of the linear interpolation function at different distances, obtain the correction coefficient at different distances by looking up the table, perform simple linear interpolation to obtain the error estimate, and subtract the estimated error from the measured distance to obtain the corrected distance.
[0083] Calibrated distance=Test distance-Evaluated error;
[0084] Evaluated error=Test distance*β1+β0;
[0085] The data before correction is Figure 7 The corrected data is shown in Figure 8 As shown, Figure 7 and Figure 8 The horizontal axis is distance, the vertical axis is error, and the units of the horizontal and vertical axes are meters. It can be seen that many of the differences before correction exceed 0.1 meters, and even exceed 0.3 meters. After correction, the differences are basically within 0.1 meters.
[0086] It can be understood that before correcting the first measured distance according to the compensation function to obtain the first corrected distance, the following steps may also be included:
[0087] A plurality of correction coefficients are pre-calculated according to the fitting function, and different correction coefficients correspond to different measurement distances;
[0088] Selecting a corresponding correction coefficient from the plurality of correction coefficients as a target correction coefficient according to the first measurement distance;
[0089] A compensation function is obtained according to the fitting function and the target correction coefficient.
[0090] The fitting function can be calculated in advance to obtain multiple correction coefficients. For example, multiple measurement distances can be substituted into the fitting function to obtain corresponding correction coefficients, and different correction coefficients can be calculated for different measurement distances. It is also possible to associate multiple correction coefficients with corresponding measurement distances to establish a mapping table and store them. When the compensation function is needed, it is not necessary to calculate the fitting function on site, but to find the corresponding correction coefficient from the mapping table according to the first measurement distance, and use the correction coefficient to form a compensation function. It can also be understood that a correction coefficient table of a linear interpolation function (fitting function) at different measurement distances is established, and the correction coefficients at different measurement distances are obtained by looking up the table, thereby obtaining a compensation function, that is, the parameters of the fitting function are obtained by looking up the table without the need for complex calculations. After obtaining the compensation function, a simple linear interpolation is performed to obtain a compensation value, and the compensation value is subtracted from the measured distance to obtain the correction distance.
[0091] The compensation function corresponding to the actual distance and the measured distance calculated according to the multiple difference values includes:
[0092] Multiple distance intervals are obtained according to the multiple measurement distances, and different distance intervals correspond to different measurement distances;
[0093] Dividing the multiple differences into multiple difference groups according to multiple distance intervals;
[0094] A plurality of fitting functions corresponding to a plurality of distance intervals are calculated according to a plurality of difference value groups and a least squares algorithm, and the plurality of fitting functions are used as compensation functions.
[0095] It is understandable that the actual distances between the first ultra-wideband device and the second ultra-wideband device may be different, and the corresponding difference ranges may be different. For example, the difference at 50 cm may be positive, that is, the measured distance is greater than the actual distance, and the difference at 500 cm may be negative, that is, the measured distance is less than the actual distance. Therefore, different fitting functions can be formed in different distance intervals.
[0096] Exemplarily, the first fitting function is used within 500 cm, the second fitting function is used within 500 cm to 1200 cm, and the third fitting function is used above 1200 cm. The parameters of the first fitting function, the second fitting function and the third fitting function are different, and the first fitting function, the second fitting function and the third fitting function form a compensation function, which can make the measured distances of different distance intervals more reasonably corrected.
[0097] The distance interval can be divided into several distance intervals according to the principle of average segmentation. Of course, the distance interval can also be divided in an increasing or decreasing manner. For example, several distance intervals can be (0, 10], (10, 21], (21, 33], (33, 46], (46, 50], that is, the distance ranges of the distance intervals are 10 meters, 11 meters, 12 meters, 13 meters, and 14 meters respectively.
[0098] It should be noted that the division of distance intervals requires comprehensive consideration of accuracy and generalization, that is, the more distance intervals there are, the better the accuracy will be, but the corresponding generalization performance will be worse, and vice versa, the fewer distance intervals there are, the better the generalization will be, but the corresponding accuracy will be reduced. Therefore, the number of distance intervals can be reasonably set as needed, and this embodiment does not limit the number of distance interval divisions.
[0099] The compensation function corresponding to the actual distance and the measured distance calculated according to the multiple difference values may also include:
[0100] Divide the multiple differences into multiple difference groups according to their numerical values and corresponding measurement distances, and different difference groups correspond to different measurement distances;
[0101] A plurality of distance intervals are obtained according to a plurality of difference value groups;
[0102] A plurality of fitting functions corresponding to a plurality of distance intervals are calculated according to a plurality of difference value groups and a least squares algorithm, and the plurality of fitting functions are used as compensation functions.
[0103] The distance interval can also be divided in other ways. For example, it can be divided according to the difference. Specifically, the area where the difference, i.e., the error is large and the distribution is more consistent is divided into a distance interval, thereby dividing it into multiple distance intervals. Or the area where the difference, i.e., the error value is close and the distribution is more consistent is divided into a distance interval, thereby dividing it into multiple distance intervals. For example, the area where the difference value is between 0 and 2 cm and all are positive is a distance interval, and the area where the difference value is above 2 cm and all are positive is a distance interval. Similarly, the area where the difference value is between 0 and 2 cm and all are negative is a distance interval, and the area where the difference value is above 2 cm and all are negative is a distance interval. A positive value can be understood as a measured distance greater than the actual distance, and a negative value can be understood as a measured distance less than the actual distance. It is understandable that among the differences within a distance interval, there can be a few (such as one or two, etc.) differences that are far apart from the values of other differences or inconsistently distributed.
[0104] 205 , obtain a first measurement distance by measuring with two ultra-wideband devices.
[0105] After obtaining the compensation function, the two ultra-wideband devices can measure and obtain a first measurement distance using the UWB technology.
[0106] 206 : Determine a corresponding target distance interval from a plurality of distance intervals according to the first measured distance.
[0107] After the first measured distance is obtained, the first measured distance is compared with a plurality of distance intervals, and a corresponding target distance interval can be determined from the plurality of distance intervals.
[0108] 207 , determining a corresponding target fitting function from a plurality of fitting functions according to the target distance interval.
[0109] After obtaining the target distance interval, the corresponding relationship can be used to determine the corresponding target fitting function from multiple fitting functions.
[0110] 208 , calculating a compensation value according to the target fitting function and the first measured distance.
[0111] After the target fitting function is obtained, the first measured distance is substituted into the target fitting function to calculate the compensation value.
[0112] 209 , correct the first measured distance according to the compensation value to obtain a first corrected distance.
[0113] After obtaining the compensation value, the first measured distance is then corrected according to the compensation function to obtain a first corrected distance that is closer to the actual distance. The compensation value may be a positive value or a negative value. In this embodiment, the two ultra-wideband devices for obtaining the first measured distance may be two ultra-wideband devices for obtaining the compensation function, and the two ultra-wideband devices for obtaining the first measured distance may also be devices from the same batch or using the same measurement method for the two ultra-wideband devices for obtaining the compensation function. For example, each ultra-wideband device uses the same model or type of UWB measurement module.
[0114] It can be understood that the UWB indoor positioning method consists of three parts: collecting information, transmitting information, and solving information. Exemplarily, in the related art, information collection is completed by the first ultra-wideband device (such as a UWB base station) and the second ultra-wideband device (such as a tag), and the UWB base station obtains the valid information of the tag; the information transmission is that the UWB base station transmits the collected information related to positioning to the background server by wired or wireless means; the information is solved by the positioning engine of the background server. The positioning engine is used to solve the location information of the tag in real time. At present, there are many methods to obtain the location information of the tag, among which the most widely used are based on signal strength indication (RSSI), based on arrival time (TOA), based on arrival time difference (TDOA) and based on arrival direction (DOA or AOA). Among them, time-based UWB positioning methods or distance measurement methods such as TOA and TDOA require accurate measurement of signal sending and receiving time to calculate the distance of signal transmission, thereby solving the position of the tag. However, due to the environment, the error of the UWB chip itself, and the manufacturing process, there will be certain errors in actual positioning or distance measurement. Under the speed of light, 1ns will bring an error of 30 cm or even 100 cm. Therefore, the errors caused by various factors will have a great impact on the accuracy of the time-based UWB positioning algorithm or distance measurement algorithm. The relevant solutions are too complicated, difficult to implement, or complex in calculation, and require high platform computing power. It is difficult to meet the requirements of applications with high real-time requirements such as positioning.
[0115] When using UWB for positioning or distance measurement, the error in ranging will have a great impact, especially for indoor positioning with a short distance. The user's perception of the error is particularly obvious when using it. Therefore, for mobile applications with limited computing power, a simple and effective calibration solution is particularly important. The distance measurement calibration method of this embodiment can improve the accuracy and precision of the measured distance, such as controlling the error within 10 cm, and is suitable for indoor search, positioning, and close-range ranging, which are sensitive to distance perception and require high precision.
[0116] The distance measurement calibration method of this embodiment uses a large amount of test data from the actual environment and adopts the least squares principle for piecewise linear fitting. A large amount of real data is used during calibration to ensure reliability during application, and the correctness of the method of this embodiment is theoretically guaranteed. The simple linear interpolation method does not require high computing power, and can meet the real-time requirements of positioning applications or measurement applications. That is, this embodiment provides a simple and effective method that can meet the real-time requirements of applications with limited computing power such as mobile terminals. Use the real data (i.e., actual distance) of actual tests for calibration, use the least squares algorithm for linear interpolation, associate the error with the distance, and effectively reduce the distance measurement error. The linear interpolation algorithm only needs to be performed through simple table lookup and linear interpolation operations in the program, with low computational complexity and high real-time performance.
[0117] The present application also provides a method for measuring distance correction. Fig. 9 , Fig. 9 The third flow chart of the distance measurement correction method provided in the embodiment of the present application is as follows. The distance measurement correction method may specifically include:
[0118] 301 , obtaining a compensation function, where the compensation function is calculated by using a plurality of measured distances of two ultra-wideband devices and corresponding actual distances.
[0119] The compensation function is calculated by using multiple measured distances of two ultra-wideband devices and the corresponding actual distances, and the compensation function can reduce the difference between the measured distance and the actual distance. The compensation function can be specifically described in the above embodiment and will not be repeated here.
[0120] 302: Obtain a first measurement distance by measuring with two ultra-wideband devices.
[0121] 303 , correct the first measured distance according to the compensation function to obtain a first corrected distance.
[0122] The subsequent measured distance can be corrected according to the compensation function, thereby improving the accuracy of the measured distance. Specifically, after obtaining the compensation function, the two ultra-wideband devices can measure a first measured distance using UWB technology, and then correct the first measured distance according to the compensation function to obtain a first corrected distance that is closer to the actual distance.
[0123] It should be noted that the distance measurement correction method of this embodiment can also adopt the steps in the above embodiments, which will not be described in detail here.
[0124] The UWB module in the above embodiments may include one or more UWB antennas.
[0125] The present application also provides a distance measurement correction device. Fig.10 , Fig.10 A schematic diagram of the structure of a measurement distance correction device provided in an embodiment of the present application. The measurement distance correction device 400 may include: a measurement distance acquisition module 410, a difference acquisition module 420, a compensation function acquisition module 430 and a correction module 440. Among them, the measurement distance acquisition module 310 is used to obtain multiple measurement distances of two ultra-wideband devices. The difference acquisition module 320 is used to obtain multiple differences between multiple measurement distances and corresponding actual distances. The compensation function acquisition module 330 is used to calculate the compensation function corresponding to the actual distance and the measurement distance based on the multiple differences. The correction module 440 is used to correct the first measurement distance measured by the two ultra-wideband devices according to the compensation function to obtain a first corrected distance.
[0126] In some embodiments, the two ultra-wideband devices include a first ultra-wideband device and a second ultra-wideband device; the measurement distance acquisition module 410 is also used to move the second ultra-wideband device with the first ultra-wideband device as a base point so that the second ultra-wideband device is located at a different position relative to the first ultra-wideband device; and to obtain multiple measurement distances between the first ultra-wideband device and the second ultra-wideband device when the second ultra-wideband device is located at different positions.
[0127] In some implementations, the compensation function acquisition module 430 is further configured to calculate a fitting function corresponding to the actual distance and the measured distance according to a plurality of difference values and a least squares algorithm, and use the fitting function as the compensation function.
[0128] In some embodiments, the compensation function acquisition module 430 is also used to obtain multiple distance intervals according to multiple measured distances, and different distance intervals correspond to different measured distances; divide multiple differences into multiple difference groups according to the multiple distance intervals; and calculate multiple fitting functions corresponding to the multiple distance intervals according to the multiple difference groups and the least squares algorithm, and use the multiple fitting functions as compensation functions.
[0129] In some embodiments, the compensation function acquisition module 430 is also used to divide multiple differences into multiple difference groups according to the numerical values and the corresponding measurement distances, and different difference groups correspond to different measurement distances; obtain multiple distance intervals according to the multiple difference groups; and calculate multiple fitting functions corresponding to the multiple distance intervals according to the multiple difference groups and the least squares algorithm, and use the multiple fitting functions as compensation functions.
[0130] In some embodiments, the measurement distance correction device may also include a measurement module, which is used to measure a first measurement distance through two ultra-wideband devices; determine a corresponding target distance interval from multiple distance intervals based on the first measurement distance; determine a corresponding target fitting function from multiple fitting functions based on the target distance interval; calculate a compensation value based on the target fitting function and the first measurement distance; and correct the first measurement distance based on the compensation value to obtain a first corrected distance.
[0131] The present application also provides a distance measurement correction device. Fig.11 , Fig.11 Another structural schematic diagram of the measurement distance correction device provided in an embodiment of the present application. The measurement distance correction device 500 may include: a compensation function acquisition module 510, a measurement distance acquisition module 520 and a correction module 540. Among them, the compensation function acquisition module 510 is used to obtain a compensation function, and the compensation function is calculated by multiple measurement distances of two ultra-wideband devices and the corresponding actual distances. The measurement distance acquisition module 520 is used to obtain a first measurement distance measured by two ultra-wideband devices. The correction module 530 corrects the first measurement distance according to the compensation function to obtain a first corrected distance. The structure of the measurement distance correction device 500 can also adopt the structure of the measurement distance correction device in the above-mentioned embodiment, and the compensation function acquisition module 510, the measurement distance acquisition module 520 and the correction module 540 can also be used to implement the functions of the compensation function acquisition module, the measurement distance acquisition module and the correction module in the above-mentioned embodiment, which will not be repeated here.
[0132] It should be noted that the measuring distance correction device provided in the embodiment of the present application belongs to the same concept as the measuring distance correction method in the above embodiment. Any method provided in the measuring distance correction method embodiment can be run on the measuring distance correction device. The specific implementation process is detailed in the measuring distance correction method embodiment, which will not be repeated here.
[0133] The embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the computer program stored therein is executed on a computer, the computer executes the steps in the distance measurement correction method provided in the embodiment of the present application. The storage medium may be a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM), etc.
[0134] The present application also provides an electronic device. Fig.12 , Fig.12The electronic device 600 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and includes a processor 601 and a memory 602. The processor 601 is electrically connected to the memory 602.
[0135] The processor 601 is the control center of the electronic device 600. It uses various interfaces and lines to connect various parts of the entire electronic device, executes various functions of the electronic device 600 and processes data by running or loading computer programs stored in the memory 602 and calling data stored in the memory 602.
[0136] The memory 602 can be used to store software programs and modules, and the processor 601 executes various functional applications and data processing by running the computer programs and modules stored in the memory 602. The memory 602 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc.
[0137] In addition, the memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 602 may also include a memory controller to provide the processor 601 with access to the memory 602.
[0138] In the embodiment of the present application, the processor 601 in the electronic device 600 will load instructions corresponding to the processes of one or more computer programs into the memory 602 according to the following steps, and the processor 601 will run the computer program stored in the memory 602, thereby realizing various functions, as follows:
[0139] obtaining a plurality of measured distances of two ultra-wideband devices;
[0140] Obtaining multiple differences between multiple measured distances and corresponding actual distances;
[0141] A compensation function corresponding to the actual distance and the measured distance is obtained by calculating the multiple differences;
[0142] A first measurement distance is obtained by measuring with two ultra-wideband devices; and
[0143] The first measured distance is corrected according to the compensation function to obtain a first corrected distance.
[0144] See also Fig.13 , Fig.13 Another structural diagram of an electronic device provided in an embodiment of the present application, Fig.12The difference between the electronic devices shown is that the electronic device 700 may further include: a camera component 703, a display 704, an audio circuit 705, a radio frequency circuit 706 and a power supply 707. The camera component 703, the display 704, the audio circuit 705, the radio frequency circuit 706 and the power supply 707 are electrically connected to the processor 701 respectively.
[0145] The camera assembly 703 may include an image processing circuit, which may be implemented using hardware and / or software components and may include various processing units that define an image signal processing pipeline. The image processing circuit may include at least: multiple cameras, an image signal processor (ISP processor), a control logic, and an image memory, etc. Each camera may include at least one or more lenses and an image sensor. The image sensor may include a color filter array (such as a Bayer filter). The image sensor may obtain light intensity and wavelength information captured by each imaging pixel of the image sensor, and provide a set of raw image data that can be processed by an image signal processor.
[0146] The display 704 may be used to display information input by a user or information provided to a user and various graphical user interfaces. These graphical user interfaces may be composed of graphics, texts, icons, videos and any combination thereof.
[0147] The audio circuit 705 may be used to provide an audio interface between a user and the electronic device through a speaker and a microphone.
[0148] The radio frequency circuit 706 can be used to send and receive radio frequency signals to establish wireless communication with network devices or other electronic devices through wireless communication, and to send and receive signals between network devices or other electronic devices.
[0149] The power supply 707 may be used to supply power to various components of the electronic device 700. In some embodiments, the power supply 707 may be logically connected to the processor 701 through a power management system, so that the power management system can manage charging, discharging, power consumption, and other functions.
[0150] In the embodiment of the present application, the processor 701 in the electronic device 700 will load instructions corresponding to the processes of one or more computer programs into the memory 702 according to the following steps, and the processor 701 will run the computer program stored in the memory 702, thereby realizing various functions, as follows:
[0151] obtaining a plurality of measured distances of two ultra-wideband devices;
[0152] Obtaining multiple differences between multiple measured distances and corresponding actual distances;
[0153] A compensation function corresponding to the actual distance and the measured distance is obtained by calculating the multiple differences;
[0154] A first measurement distance is obtained by measuring with two ultra-wideband devices; and
[0155] The first measured distance is corrected according to the compensation function to obtain a first corrected distance
[0156] In some implementations, the two ultra-wideband devices include a first ultra-wideband device and a second ultra-wideband device; when acquiring multiple measurement distances of the two ultra-wideband devices, the processor 701 may execute:
[0157] Taking the first ultra wideband device as a base point, moving the second ultra wideband device so that the second ultra wideband device is located at a different position relative to the first ultra wideband device; and
[0158] A plurality of measured distances between the first ultra wideband device and the second ultra wideband device when the second ultra wideband device is located at different positions are obtained.
[0159] In some implementations, when a compensation function corresponding to the actual distance and the measured distance is obtained by calculating the multiple differences, the processor 701 may execute:
[0160] A fitting function corresponding to the actual distance and the measured distance is calculated according to a plurality of differences and a least squares algorithm, and the fitting function is used as a compensation function.
[0161] In some implementations, before correcting the first measured distance according to the compensation function to obtain the first corrected distance, the processor 701 may execute:
[0162] A plurality of correction coefficients are pre-calculated according to the fitting function, and different correction coefficients correspond to different measurement distances;
[0163] Selecting a corresponding correction coefficient from the plurality of correction coefficients as a target correction coefficient according to the first measurement distance;
[0164] A compensation function is obtained according to the fitting function and the target correction coefficient.
[0165] In some implementations, when a compensation function corresponding to the actual distance and the measured distance is obtained by calculating the multiple differences, the processor 701 may execute:
[0166] Multiple distance intervals are obtained according to the multiple measurement distances, and different distance intervals correspond to different measurement distances;
[0167] Dividing the plurality of difference values into a plurality of difference value groups according to a plurality of distance intervals; and
[0168] A plurality of fitting functions corresponding to a plurality of distance intervals are calculated according to a plurality of difference value groups and a least squares algorithm, and the plurality of fitting functions are used as compensation functions.
[0169] In some implementations, when a compensation function corresponding to the actual distance and the measured distance is obtained by calculating the multiple differences, the processor 701 may execute:
[0170] Divide the multiple differences into multiple difference groups according to their numerical values and corresponding measurement distances, and different difference groups correspond to different measurement distances;
[0171] Obtaining multiple distance intervals according to the multiple difference value groups; and
[0172] A plurality of fitting functions corresponding to a plurality of distance intervals are calculated according to a plurality of difference value groups and a least squares algorithm, and the plurality of fitting functions are used as compensation functions.
[0173] In some implementations, after obtaining a compensation function corresponding to the actual distance and the measured distance according to the plurality of difference values, the processor 701 may execute:
[0174] A first measurement distance is obtained by measuring with two ultra-wideband devices;
[0175] Determining a corresponding target distance interval from a plurality of distance intervals according to the first measured distance;
[0176] Determine a corresponding target fitting function from a plurality of fitting functions according to a target distance interval;
[0177] Calculating a compensation value according to the target fitting function and the first measured distance; and
[0178] The first measured distance is corrected according to the compensation value to obtain a first corrected distance.
[0179] An embodiment of the present application also provides a storage medium, which stores a computer program. When the computer program is run on a computer, the computer executes the measurement distance correction method in any of the above embodiments, such as: obtaining multiple measurement distances of two ultra-wideband devices; obtaining multiple differences between the multiple measurement distances and the corresponding actual distances; calculating a compensation function corresponding to the actual distance and the measurement distance based on the multiple differences; obtaining a first measurement distance by measuring with two ultra-wideband devices; and correcting the first measurement distance according to the compensation function to obtain a first corrected distance.
[0180] In the embodiment of the present application, the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0181] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0182] It should be noted that, for the measurement distance correction method of the embodiment of the present application, ordinary testers in the field can understand that all or part of the process of implementing the measurement distance correction method of the embodiment of the present application can be completed by controlling the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, such as stored in the memory of an electronic device, and executed by at least one processor in the electronic device, and the execution process may include the process of the embodiment of the measurement distance correction method. Among them, the storage medium can be a disk, an optical disk, a read-only memory, a random access memory, etc.
[0183] For the measurement distance correction device of the embodiment of the present application, each functional module can be integrated into a processing chip, or each module can exist physically separately, or two or more modules can be integrated into one module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium, such as a read-only memory, a disk or an optical disk.
[0184] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.
[0185] The above is a detailed introduction to the distance measurement correction method, device, medium and electronic device provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for measuring distance correction, characterized in that: include: obtaining a plurality of measured distances of two ultra-wideband devices; Obtaining a plurality of differences between the measured distances and the corresponding actual distances; A plurality of distance intervals are obtained according to the plurality of measured distances, and different distance intervals correspond to different measured distances; Dividing the plurality of difference values into a plurality of difference value groups according to the plurality of distance intervals; Calculating a plurality of fitting functions corresponding to the plurality of distance intervals according to the plurality of difference value groups and the least squares algorithm; A first measurement distance is obtained by measuring with two ultra-wideband devices; as well as A plurality of correction coefficients are pre-calculated according to the fitting function, and different correction coefficients correspond to different measurement distances; Selecting a corresponding correction coefficient from the plurality of correction coefficients as a target correction coefficient according to the first measurement distance; Obtaining a compensation function according to the fitting function and the target correction coefficient; The first measured distance is corrected according to the compensation function to obtain a first corrected distance.
2. The distance measurement correction method according to claim 1, characterized in that: The two ultra-wideband devices include a first ultra-wideband device and a second ultra-wideband device; and obtaining a plurality of measurement distances of the two ultra-wideband devices includes: Taking the first ultra wideband device as a base point, moving the second ultra wideband device so that the second ultra wideband device is located at a different position relative to the first ultra wideband device; and Acquire multiple measured distances of the first ultra wideband device and the second ultra wideband device when the second ultra wideband device is located at different positions.
3. The distance measurement correction method according to claim 1, characterized in that: After obtaining multiple fitting functions corresponding to multiple distance intervals by calculating the multiple difference value groups and the least squares algorithm, the method further includes: A first measurement distance is obtained by measuring with two ultra-wideband devices; Determine a corresponding target distance interval from the plurality of distance intervals according to the first measured distance; Determining a corresponding target fitting function from the plurality of fitting functions according to the target distance interval; Calculating a compensation value according to the target fitting function and the first measured distance; and The first measured distance is corrected according to the compensation value to obtain a first corrected distance.
4. A method for measuring distance correction, characterized in that: include: Obtaining a compensation function, wherein the compensation function is calculated by using a plurality of measured distances of two ultra-wideband devices and corresponding actual distances, including: obtaining a plurality of distance intervals according to the plurality of measured distances, wherein different distance intervals correspond to different measured distances, dividing a plurality of differences between the plurality of measured distances and the corresponding actual distances into a plurality of difference groups according to the plurality of distance intervals, and obtaining a plurality of fitting functions corresponding to the plurality of distance intervals according to the plurality of difference groups and a least squares algorithm; A first measurement distance is obtained by measuring with two ultra-wideband devices; as well as A plurality of correction coefficients are pre-calculated according to the fitting function, and different correction coefficients correspond to different measurement distances; Selecting a corresponding correction coefficient from the plurality of correction coefficients as a target correction coefficient according to the first measurement distance; Obtaining a compensation function according to the fitting function and the target correction coefficient; The first measured distance is corrected according to the compensation function to obtain a first corrected distance.
5. A measuring distance correction device, characterized in that: include: A measurement distance acquisition module, used to acquire multiple measurement distances of two ultra-wideband devices; A difference acquisition module, used to acquire a plurality of differences between the measured distances and the corresponding actual distances; A compensation function acquisition module is used to: divide the plurality of measured distances into a plurality of distance intervals, wherein different distance intervals correspond to different measured distances; divide the plurality of difference values into a plurality of difference value groups according to the plurality of distance intervals; and calculate a plurality of fitting functions corresponding to the plurality of distance intervals according to the plurality of difference value groups and a least squares algorithm; as well as The correction module is used to: obtain a first measurement distance by measuring with two ultra-wideband devices; obtain a plurality of correction coefficients in advance according to the fitting function, wherein different measurement distances correspond to different correction coefficients; select a corresponding correction coefficient from the plurality of correction coefficients according to the first measurement distance as a target correction coefficient; obtain a compensation function according to the fitting function and the target correction coefficient; and correct the first measurement distance according to the compensation function to obtain a first corrected distance.
6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed on a computer, the computer is enabled to execute the distance measurement correction method according to any one of claims 1 to 4.
7. An electronic device comprising a processor and a memory, wherein the memory has a computer program, characterized in that: The processor is used to execute the distance measurement correction method according to any one of claims 1 to 4 by calling the computer program.
