A method, apparatus, and electronic device for measuring altitude of a wearable device.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-05
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]本发明的目的在于提供一种可穿戴设备海拔高度的测量方法、装置和电子设备,以缓解了现有技术中的可穿戴设备存在的海拔高度测量结果准确性差的技术问题
[0014]本发明提供的可穿戴设备海拔高度的测量方法,在计算海拔高度时并不是使用单个采样点的实时气压数据直接计算,而是在采集到预设时间窗口内多个实时气压数据之后,执行异常判别以及校正处理,最后利用指定单位时间段内校正后的气压数据的均值、标准气压数据和压高公式计算当前位置的海拔高度。因此,本发明方法能够将由气压传感器异常和天气异常等带来的气压变化进行校正,确保计算海拔高度时所使用的气压数据的准确性,从而缓解了现有技术中的可穿戴设备存在的海拔高度测量结果准确性差的技术问题。
Smart Images

Figure CN116817853B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of altitude measurement, and in particular to a method, apparatus, and electronic device for measuring altitude using a wearable device. Background Technology
[0002] Altitude refers to the vertical difference between a local location and a reference sea level. Generally, wearable devices can function as altimeters using their built-in barometric pressure sensors. Based on the negative correlation between air pressure and altitude, the current altitude can be calculated using the pressure-elevation formula. However, under certain circumstances (e.g., blockage of the pressure orifice, pressure changes around the orifice, water ingress, etc.), the air pressure measured by the barometric pressure sensor may become abnormal, leading to unreliable altitude calculations. Furthermore, sudden changes in weather, temperature, and humidity within a short period can cause unpredictable air pressure fluctuations, resulting in incorrect altitude readings. In summary, existing wearable devices suffer from the technical problem of poor accuracy in altitude measurement. Summary of the Invention
[0003] The purpose of this invention is to provide a method, apparatus, and electronic device for measuring the altitude of wearable devices, so as to alleviate the technical problem of poor accuracy of altitude measurement results in existing wearable devices.
[0004] In a first aspect, the present invention provides a method for measuring the altitude of a wearable device, comprising: obtaining standard barometric pressure data at the current moment from a server when it is determined that standard barometric pressure data should be updated; collecting real-time barometric pressure data of the current location within a preset time window at a preset sampling frequency to obtain multiple real-time barometric pressure data; the preset time window includes several unit time periods of specified duration; performing anomaly detection on the multiple real-time barometric pressure data, and correcting the multiple real-time barometric pressure data based on the anomaly detection results to obtain multiple corrected barometric pressure data; determining the altitude of the current location based on the pressure height formula, the standard barometric pressure data, and the average of the corrected barometric pressure data within the specified unit time periods; wherein, the specified unit time period represents the last unit time period within the preset time window.
[0005] In an optional implementation, anomaly detection is performed on the plurality of real-time air pressure data, and the plurality of real-time air pressure data are corrected based on the anomaly detection results. This includes: performing noise detection on the real-time air pressure data within each unit time period to obtain a noise detection result; correcting the real-time air pressure data within each unit time period based on the noise detection results to obtain target air pressure data within each unit time period; performing waveform abrupt change detection on the target air pressure data within the specified unit time period based on the target air pressure data within historical unit time periods to obtain abrupt change detection results; wherein, the historical unit time period represents all unit time periods before the specified unit time period within the preset time window; and correcting the target air pressure data within the specified unit time period based on the abrupt change detection results to obtain corrected air pressure data within the specified unit time period.
[0006] In an optional implementation, noise detection is performed on the real-time air pressure data within each unit time period to obtain a noise detection result. This includes: calculating the air pressure difference between adjacent real-time air pressure data within a target unit time period to obtain multiple air pressure difference values; wherein, the target unit time period represents any unit time period within the preset time window; calculating the difference between the largest and smallest air pressure difference values among the multiple air pressure difference values to obtain a reference difference value; determining whether the ratio between the sum of the multiple air pressure difference values and the reference difference value is greater than a first threshold; if yes, then the noise detection result of the real-time air pressure data within the target unit time period is determined to be abnormal; if no, then the noise detection result of the real-time air pressure data within the target unit time period is determined to be normal.
[0007] In an optional implementation, correcting the real-time air pressure data within each unit time period based on the noise detection result includes: if the noise detection result is abnormal, replacing the real-time air pressure data within the target unit time period with the real-time air pressure data within the previous adjacent unit time period to obtain the target air pressure data within the target unit time period; if the noise detection result is normal, using the real-time air pressure data within the target unit time period as the target air pressure data within the target unit time period.
[0008] In an optional implementation, waveform abrupt change detection is performed on the target pressure data within the specified unit time period based on the target pressure data within a historical unit time period. This includes: calculating the range of the average pressure difference for each unit time period based on the target pressure data within the historical unit time period, obtaining multiple reference ranges; calculating the range of the average pressure difference for the specified unit time period based on the target pressure data, obtaining the target range; determining whether the ratio of a first value to a second value is greater than a second threshold; wherein, the first value represents the difference between the target range and the average of the multiple reference ranges, and the second value represents the sum of the average of the multiple reference ranges and 1; if yes, the abrupt change detection result of the target pressure data within the specified unit time period is determined to be abnormal; if no, the abrupt change detection result of the target pressure data within the specified unit time period is determined to be normal.
[0009] In an optional implementation, correcting the target air pressure data within the specified unit time period based on the mutation detection result includes: if the mutation detection result is abnormal, removing the last target air pressure data corresponding to the target range within the specified unit time period, and replacing the last target air pressure data with the mean of the remaining target air pressure data within the specified unit time period to obtain the corrected air pressure data within the specified unit time period; if the mutation detection result is normal, using the target air pressure data within the specified unit time period as the corrected air pressure data within the specified unit time period.
[0010] In an optional implementation, after determining the altitude of the current location, the method further includes: obtaining a reference altitude of the current location; wherein the reference altitude is obtained by one of the following methods: manual input, GPS positioning; if the GPS signal of the current location meets preset conditions, using the altitude data in the GPS positioning result as the reference altitude of the current location; collecting real-time air pressure data of the next location within a preset time window at a preset sampling frequency, and calculating the altitude of the next location based on the collected real-time air pressure data; determining the altitude difference between the next location and the current location based on the altitude of the next location and the altitude of the current location; and determining the corrected altitude of the next location based on the reference altitude of the current location and the altitude difference.
[0011] Secondly, the present invention provides a wearable device for measuring altitude, comprising: a first acquisition module, configured to acquire standard pressure data at the current moment from a server when it is determined that standard pressure data should be updated; a first acquisition module, configured to acquire real-time pressure data of the current location within a preset time window according to a preset sampling frequency, thereby obtaining multiple real-time pressure data; the preset time window includes several unit time periods of specified duration; an anomaly detection module, configured to perform anomaly detection on the multiple real-time pressure data, and correct the multiple real-time pressure data based on the anomaly detection results, thereby obtaining multiple corrected pressure data; and a first determination module, configured to determine the altitude of the current location based on the pressure altitude formula, the standard pressure data, and the average of the corrected pressure data within the specified unit time period; wherein the specified unit time period represents the last unit time period within the preset time window.
[0012] Thirdly, the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program that can run on the processor, and the processor executes the computer program to implement the steps of the method for measuring the altitude of a wearable device as described in any of the foregoing embodiments.
[0013] Fourthly, the present invention provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the method for measuring the altitude of a wearable device as described in any of the foregoing embodiments.
[0014] The altitude measurement method for wearable devices provided by this invention does not directly calculate altitude using real-time air pressure data from a single sampling point. Instead, after collecting multiple real-time air pressure data points within a preset time window, it performs anomaly detection and correction processing. Finally, it calculates the altitude of the current location using the average of the corrected air pressure data within a specified time period, standard air pressure data, and the pressure height formula. Therefore, this method can correct for air pressure changes caused by air pressure sensor anomalies and weather anomalies, ensuring the accuracy of the air pressure data used in calculating altitude, thereby alleviating the technical problem of poor accuracy in altitude measurement results in existing wearable devices. Attached Figure Description
[0015] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0016] Figure 1 A flowchart illustrating a method for measuring the altitude of a wearable device according to an embodiment of the present invention;
[0017] Figure 2 This invention provides a flowchart for identifying anomalies in multiple real-time air pressure data and correcting the multiple real-time air pressure data based on the anomaly identification results.
[0018] Figure 3 A functional block diagram of a wearable device for measuring altitude provided in an embodiment of the present invention;
[0019] Figure 4 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0020] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0021] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0022] The following detailed description of some embodiments of the present invention is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0023] Example 1
[0024] Figure 1 A flowchart illustrating a method for measuring the altitude of a wearable device according to an embodiment of the present invention is shown below. Figure 1 As shown, the method specifically includes the following steps:
[0025] Step S102: If it is determined that the standard pressure data needs to be updated, the standard pressure data at the current moment is obtained from the server.
[0026] Specifically, in this embodiment of the invention, the pressure height formula P = P n (1-2.25577*10 -5 *h) 5.25588 Calculate altitude, where P represents the real-time atmospheric pressure value measured by the device. nThe value represents the local sea level air pressure, and h represents the altitude of the device's location. Therefore, to determine the altitude of the wearable device's location, it is necessary to obtain not only its measured real-time air pressure value but also the local sea level air pressure value, i.e., the standard air pressure data.
[0027] Therefore, when using a wearable device to measure altitude, users need to activate the barometric pressure sensor to obtain real-time barometric pressure data, and also need to determine the standard barometric pressure data. This embodiment of the invention can obtain standard barometric pressure data through three channels: obtaining it from the wearable device's server, using the standard barometric pressure data used in the last altitude measurement, or using the default barometric pressure data pre-stored in the device. This embodiment of the invention does not specifically limit the method of obtaining standard barometric pressure data; users can choose according to their actual situation. When the user determines that the standard barometric pressure data needs to be updated, the current standard barometric pressure data is obtained from the server; otherwise, the user can choose to use the previous standard barometric pressure data or the default standard barometric pressure data.
[0028] Step S104: Collect real-time air pressure data of the current location within a preset time window according to a preset sampling frequency to obtain multiple real-time air pressure data.
[0029] The preset time window includes several time periods of a specified duration.
[0030] Step S106: Anomaly detection is performed on multiple real-time air pressure data, and the multiple real-time air pressure data are corrected based on the anomaly detection results to obtain multiple corrected air pressure data.
[0031] If the environment in which a wearable device is used changes abruptly, the air pressure data measured by its barometric pressure sensor will become abnormal. Therefore, if only the real-time air pressure data obtained from a single measurement is substituted into the pressure height formula to solve for altitude, the accuracy of the altitude cannot be guaranteed due to the low accuracy of the air pressure data. In view of this, in this embodiment of the invention, the barometric pressure sensor in the wearable device collects real-time air pressure data of the current location within a preset time window according to a preset sampling frequency. Then, anomaly detection is performed on the multiple real-time air pressure data collected, and the air pressure data is corrected according to the anomaly detection results to obtain corrected air pressure data. The corrected air pressure data can filter out abnormal air pressure data, thereby ensuring the accuracy of the air pressure data used in subsequent calculations.
[0032] In this embodiment of the invention, the preset time window includes multiple unit time periods of specified duration. For example, assuming the preset sampling frequency is 8Hz, the preset time window is 4 seconds, and the specified duration of each unit time period is 1 second, then a 4-second time window can collect 8*4=32 real-time air pressure data points at the current location. This embodiment of the invention does not specifically limit the values of the preset frequency, specified duration, and preset time window; users can set them according to their actual needs.
[0033] Step S108: Determine the altitude of the current location based on the pressure height formula, standard air pressure data, and the average of the corrected air pressure data within a specified unit time period.
[0034] The specified time unit refers to the last time unit in the preset time window.
[0035] After correcting the real-time air pressure data for all time periods within a preset time window, this embodiment of the invention uses the average of the corrected air pressure data within the last time period (i.e., the specified time period) of the preset time window as the real-time atmospheric pressure value measured by the wearable device. That is, assuming the preset time window is 4 seconds, after correcting the air pressure data, the average of the corrected air pressure data within the 4th second of the window is calculated, and this average is used as the real-time atmospheric pressure value. Then, this average, along with the obtained standard air pressure data, is substituted into the pressure-height formula to calculate the altitude of the current location.
[0036] In other words, when a wearable device measures altitude, it needs a preset time window to obtain a measurement result. If the preset time window is 4 seconds, and the specified duration of a unit time period is 1 second, then a measurement result is only available in the 4th second. The air pressure data collected in the first 3 seconds is used to detect anomalies in the air pressure data of the 4th second. Similarly, in this embodiment, the sliding step size of the preset time window is a unit time period. Using the example above, the anomaly detection of the air pressure data in the 5th second relies on the air pressure data of the previous 3 seconds (the 2nd, 3rd, and 4th seconds).
[0037] The altitude measurement method for wearable devices provided in this invention does not directly calculate altitude using real-time air pressure data from a single sampling point. Instead, after collecting multiple real-time air pressure data points within a preset time window, it performs anomaly detection and correction processing. Finally, it calculates the altitude of the current location using the average of the corrected air pressure data within a specified time period, standard air pressure data, and the pressure height formula. Therefore, this invention can correct for air pressure changes caused by air pressure sensor anomalies and weather anomalies, ensuring the accuracy of the air pressure data used in calculating altitude, thereby alleviating the technical problem of poor accuracy in altitude measurement results in existing wearable devices.
[0038] In one alternative implementation, such as Figure 2 As shown, step S106 above involves anomaly detection of multiple real-time air pressure data points and correction of these data points based on the anomaly detection results. Specifically, it includes the following steps:
[0039] Step S1061: Perform noise detection on the real-time air pressure data within each unit time period to obtain the noise detection results.
[0040] Step S1062: Correct the real-time air pressure data within each unit time period based on the noise detection results to obtain the target air pressure data within each unit time period.
[0041] After collecting multiple real-time air pressure data points within a preset time window, this embodiment of the invention performs noise detection on the real-time air pressure data using a unit time period as the detection unit. The noise detection uses normalized difference feature logic to determine the noise detection result, which includes one of the following: normal or abnormal. Next, the real-time air pressure data within each unit time period is corrected based on the actual noise detection results to obtain the target air pressure data for each unit time period.
[0042] Step S1063: Based on the target air pressure data within a historical unit time period, perform waveform mutation detection on the target air pressure data within a specified unit time period to obtain the mutation detection result.
[0043] Among them, the historical unit time period refers to all unit time periods before the specified unit time period within the preset time window.
[0044] Step S1064: Correct the target air pressure data within a specified unit time period based on the mutation detection results to obtain the corrected air pressure data within the specified unit time period.
[0045] As described above, noise detection processes real-time air pressure data within various time units. To further enhance the ability to identify abnormal air pressure data, this embodiment of the invention also utilizes target air pressure data within historical time units within a preset time window to further perform waveform abrupt change detection on the target air pressure data within a specified time unit, obtaining abrupt change detection results (normal / abnormal). Based on the definition of historical time units above, assuming the preset time window duration is 4 seconds and the unit time unit duration is 1 second, then the historical time unit is the time period consisting of the 1st, 2nd, and 3rd seconds.
[0046] In this embodiment of the invention, waveform abrupt change detection uses average differential logic to determine the abrupt change detection result. After determining the abrupt change detection result, the target air pressure data within a specified unit time period is corrected based on the specific result, thereby obtaining the corrected air pressure data within the specified unit time period. According to the above data processing flow, this embodiment of the invention requires two detections on the air pressure data within a specified unit time period: noise detection and waveform abrupt change detection. However, air pressure data within a historical unit time period only requires one noise detection. In other words, the target air pressure data within a historical unit time period is the corrected air pressure data within that historical unit time period.
[0047] In an optional implementation, step S1061 above, which involves noise detection of the real-time air pressure data within each unit time period to obtain noise detection results, specifically includes the following steps:
[0048] Step S10611: Calculate the pressure difference between adjacent real-time air pressure data within the target unit time period to obtain multiple pressure difference values.
[0049] The target unit time period refers to any unit time period within the preset time window.
[0050] Step S10612: Calculate the difference between the largest and smallest pressure difference among multiple pressure differences to obtain a reference difference value.
[0051] Step S10613: Determine whether the ratio between the sum of multiple pressure differences and the reference difference is greater than the first threshold.
[0052] If yes, proceed to step S10614 below; if no, proceed to step S10615 below.
[0053] Step S10614: Determine that the noise detection result of the real-time air pressure data within the target unit time period is abnormal.
[0054] Step S10615: Determine that the noise detection result of the real-time air pressure data within the target unit time period is normal.
[0055] In this embodiment of the invention, noise detection is performed on the real-time air pressure data within a target unit time period. First, the air pressure difference between adjacent real-time air pressure data within that time period is calculated, thereby obtaining multiple air pressure difference values. Assuming there are N real-time air pressure data within the target unit time period, as can be seen from the method described above, N-1 air pressure difference values corresponding to the target unit time period can be obtained through the processing in step S10611.
[0056] Next, by comparing the magnitudes, the maximum and minimum air pressure differences can be determined from multiple air pressure difference values, and the difference between them is recorded as the reference difference. Additionally, the multiple air pressure differences corresponding to the target unit time period need to be accumulated to obtain a sum. Finally, it is determined whether the ratio between the accumulated sum and the reference difference is greater than a first threshold. If the ratio is greater than the first threshold, according to the meaning of the accumulated sum and the reference difference, the larger the ratio, the greater the fluctuation of the real-time air pressure data within the target unit time period, and the noise detection result is determined to be abnormal; conversely, the noise detection result is normal. This embodiment of the invention does not specifically limit the size of the first threshold; users can set it according to actual needs, for example, 0.2, 0.3.
[0057] In an optional implementation, step S1062 above, which corrects the real-time air pressure data for each unit time period based on the noise detection results, specifically includes the following:
[0058] If the noise detection result is abnormal, the real-time air pressure data for the target unit time period is replaced with the real-time air pressure data from the preceding adjacent unit time period to obtain the target air pressure data for the target unit time period. In other words, the data from the previous unit time period is reused. For example, if the noise detection result for the real-time air pressure data in the Z-th unit time period is abnormal, then the data for the Z-th unit time period is replaced with the real-time air pressure data from the (Z-1)-th unit time period.
[0059] If the noise detection result is normal, the real-time air pressure data within the target time period will be used as the target air pressure data within the target time period. That is, the original real-time air pressure data will be maintained.
[0060] In an optional implementation, step S1063 above, which involves detecting waveform abrupt changes in the target air pressure data within a specified time period based on historical target air pressure data within a unit time period, specifically includes the following steps:
[0061] Step S10631: Based on the target air pressure data for each unit time period within the historical unit time period, calculate the range of the average air pressure difference for each unit time period to obtain multiple reference ranges.
[0062] In this embodiment of the invention, when performing waveform change detection on target air pressure data within a specified unit time period, it is first necessary to calculate the range of the average air pressure difference for each unit time period within the historical unit time period. That is, if the historical unit time period includes Z unit time periods, then this step will obtain Z ranges, which are denoted as reference ranges.
[0063] The following explanation uses the calculation of the range over a unit time period as an example. If the unit time period includes N sampling points (N target air pressure data), the average difference can be calculated every 4 sampling points in chronological order. Using a sliding step of 1 sampling point, all average difference values corresponding to the N target air pressure data are calculated sequentially. Based on the above calculation method, N-3 average difference values can be calculated for a unit time period. The formula for calculating the average difference value is: Where, x i This represents the target air pressure data for the i-th target.
[0064] Next, by comparing the magnitudes, the largest average difference value K among the N-3 average differences is determined. max and the minimum draw difference K min Finally, the difference between the maximum average difference and the minimum average difference is taken as the range of the average pressure difference for that unit time period. That is, the formula for the range A is A = K. max -K min .
[0065] Step S10632: Calculate the range of the average pressure difference within the specified time period based on the target air pressure data within the specified time period, and obtain the target range.
[0066] Similarly, referring to the range calculation method introduced above, calculate the range of the average pressure difference over a specified unit time period, and denot it as the target range.
[0067] Step S10633: Determine whether the ratio of the first value to the second value is greater than the second threshold.
[0068] The first value represents the difference between the target range and the average of multiple reference ranges, and the second value represents the sum of the average of multiple reference ranges and 1.
[0069] In other words, if the historical time intervals within the preset time window include Z time intervals, then the target range is A. z+1 The average of the Z reference ranges is then expressed as Determining whether the ratio of the first value to the second value is greater than the second threshold is expressed as follows. Whether it is true or not, where y represents the second threshold. In this embodiment of the invention, the value of the second threshold is not specifically limited. Users can set it according to actual needs. For example, y = 0.5.
[0070] If yes, proceed to step S10634 below; if no, proceed to step S10635 below.
[0071] Step S10634: Determine that the mutation detection result of the target air pressure data within the specified unit time period is abnormal.
[0072] Step S10635: Determine that the change detection result of the target air pressure data within the specified unit time period is normal.
[0073] In an optional implementation, step S1064 above, which corrects the target air pressure data within a specified unit time period based on the mutation detection result, specifically includes the following:
[0074] If the mutation detection result is abnormal, the last target air pressure data corresponding to the target range within the specified unit time period is removed, and the mean of the remaining target air pressure data within the specified unit time period is used to replace the last target air pressure data to obtain the corrected air pressure data within the specified unit time period.
[0075] Specifically, when determining that the mutation detection result is abnormal, it is necessary to remove abnormal air pressure data within a specified time period. In this embodiment of the invention, the last target air pressure data corresponding to the target range is determined to be abnormal data, and the formula for the range A is known to be A = K. max -K min Furthermore, the calculation of the average difference value K requires four consecutive target air pressure data points. Therefore, in this embodiment of the invention, the last target air pressure data corresponding to the target range includes: calculating K. max The latest data collected from the four target air pressure data used, and the calculation of K. min The data collected most recently among the four target air pressure data points used. (Based on the formula...) For example, the latest data collected among the four target air pressure data is x. i+3 After removing the abnormal data, the average of the remaining target air pressure data that was not removed within a specified time period is used to replace the removed air pressure data, thereby completing the correction of waveform change detection anomalies.
[0076] If the mutation detection result is normal, the target air pressure data within a specified time period will be used as the corrected air pressure data within that specified time period. In other words, the original target air pressure data will be maintained.
[0077] If the barometric pressure sensor of a wearable device experiences problems such as a blocked pressure port, pressure changes around the port, or water ingress, the measured pressure data will be abnormal. To solve this problem, in this embodiment of the invention, after determining the altitude of the current location, the method further includes the following steps:
[0078] Step S201: Obtain the reference altitude of the current location.
[0079] The reference altitude can be obtained in one of the following ways: manual input, GPS positioning; or, if the GPS signal at the current location meets the preset conditions, the altitude data in the GPS positioning result is used as the reference altitude for the current location.
[0080] Based on the above description, the reference altitude can be obtained in two ways: manual input and GPS positioning. When the user of the wearable device is located at a location with accurate altitude information, the user can manually input the accurate altitude into the wearable device as the reference altitude; alternatively, when the user is located at a location where the GPS signal meets preset conditions, the altitude can be obtained from the latitude, longitude, and altitude data provided by the GPS positioning results and used as the reference altitude. The preset conditions include: a GPS signal-to-noise ratio greater than a third threshold and a number of detected satellites greater than a fourth threshold. This embodiment of the invention does not specifically limit the method of obtaining the reference altitude; users can set it according to their actual situation.
[0081] Step S202: Collect real-time air pressure data of the next location within a preset time window according to a preset sampling frequency, and calculate the altitude of the next location based on the collected real-time air pressure data.
[0082] The method for calculating the altitude of the current location has been disclosed above. When the user arrives at the next location with the wearable device, the altitude of the next location can also be calculated by referring to the methods in steps S102-S108 above. Please refer to the above for specific methods, which will not be repeated here.
[0083] Step S203: Determine the altitude difference between the next location and the current location based on the altitude of the next location and the current location.
[0084] Step S204: Based on the reference altitude and altitude difference of the current location, determine the corrected altitude for the next location.
[0085] Even though the accuracy of the air pressure data measured by the barometric pressure sensor cannot be guaranteed, the altitude difference corresponding to the air pressure changes at different locations is accurate. That is, the altitude difference between the current location and the next location is accurate. Since the reference altitude of the current location has already been obtained, the altitude difference can be summed with the reference altitude to obtain the corrected altitude for the next location. For example, if the altitude of the current location is calculated to be 1050m using steps S102-S108, the altitude of the next location is 1300m, and the reference altitude of the current location is 1000m, then after processing, the corrected altitude for the next location can be determined to be 1250m.
[0086] Example 2
[0087] This invention also provides a device for measuring the altitude of a wearable device. This device is mainly used to perform the method for measuring the altitude of a wearable device provided in Embodiment 1 above. The following is a detailed description of the device for measuring the altitude of a wearable device provided in this invention.
[0088] Figure 3 This is a functional block diagram of a wearable device for measuring altitude provided in an embodiment of the present invention, as shown below. Figure 3 As shown, the device mainly includes: a first acquisition module 10, a first collection module 20, an anomaly detection module 30, and a first determination module 40, wherein:
[0089] The first acquisition module 10 is used to acquire the standard pressure data at the current moment from the server when it is determined that the standard pressure data should be updated.
[0090] The first acquisition module 20 is used to acquire real-time air pressure data of the current location within a preset time window according to a preset sampling frequency, and obtain multiple real-time air pressure data; the preset time window includes several unit time periods of specified duration.
[0091] The anomaly detection module 30 is used to detect anomalies in multiple real-time air pressure data and correct the multiple real-time air pressure data based on the anomaly detection results to obtain multiple corrected air pressure data.
[0092] The first determining module 40 is used to determine the altitude of the current location based on the pressure formula, standard air pressure data, and the average of the corrected air pressure data within a specified unit time period; wherein, the specified unit time period refers to the last unit time period in the preset time window.
[0093] The wearable device for measuring altitude provided in this invention does not directly calculate altitude using real-time air pressure data from a single sampling point. Instead, after collecting multiple real-time air pressure data points within a preset time window, it performs anomaly detection and correction processing. Finally, it calculates the altitude of the current location using the average of the corrected air pressure data within a specified time period, standard air pressure data, and the pressure height formula. Therefore, this device can correct for air pressure changes caused by air pressure sensor anomalies and weather anomalies, ensuring the accuracy of the air pressure data used to calculate altitude, thereby alleviating the technical problem of poor accuracy in altitude measurement results in existing wearable devices.
[0094] Optional, the anomaly detection module 30 includes:
[0095] The noise detection unit is used to detect noise in the real-time air pressure data within each unit time period and obtain the noise detection results.
[0096] The first correction unit is used to correct the real-time air pressure data within each unit time period based on the noise detection results, so as to obtain the target air pressure data within each unit time period.
[0097] The mutation detection unit is used to perform waveform mutation detection on the target air pressure data within a specified unit time period based on the target air pressure data within a historical unit time period, and obtain the mutation detection result; wherein, the historical unit time period refers to all unit time periods before the specified unit time period within the preset time window.
[0098] The second correction unit is used to correct the target air pressure data within a specified time period based on the mutation detection results, so as to obtain the corrected air pressure data within the specified time period.
[0099] Optionally, the noise detection unit is specifically used for:
[0100] Calculate the pressure difference between adjacent real-time air pressure data within the target unit time period to obtain multiple pressure difference values; where the target unit time period refers to any unit time period within a preset time window.
[0101] Calculate the difference between the largest and smallest pressure difference among multiple pressure differences to obtain a reference difference value.
[0102] Determine whether the ratio between the sum of multiple pressure differences and the reference difference is greater than a first threshold.
[0103] If so, the noise detection result of the real-time air pressure data within the target unit time period is determined to be abnormal.
[0104] If not, then the noise detection result of the real-time air pressure data within the target unit time period is determined to be normal.
[0105] Optionally, the first correction unit is specifically used for:
[0106] If the noise detection result is abnormal, the real-time air pressure data of the target unit time period is replaced with the real-time air pressure data of the previous adjacent unit time period to obtain the target air pressure data of the target unit time period.
[0107] If the noise detection result is normal, the real-time air pressure data within the target time period is used as the target air pressure data within the target time period.
[0108] Optionally, the mutation detection unit is specifically used for:
[0109] Based on the target air pressure data for each unit time period within a historical time period, the range of the average air pressure difference for each unit time period is calculated to obtain multiple reference ranges.
[0110] The target range is obtained by calculating the range of the average pressure difference within a specified time period based on the target air pressure data within that specified time period.
[0111] Determine whether the ratio of the first value to the second value is greater than the second threshold; where the first value represents the difference between the target range and the average of multiple reference ranges, and the second value represents the sum of the average of multiple reference ranges and 1.
[0112] If so, the mutation detection result of the target air pressure data within the specified unit time period is determined to be abnormal.
[0113] If not, then the result of the sudden change detection of the target air pressure data within the specified time period is determined to be normal.
[0114] Optionally, the second correction unit is specifically used for:
[0115] If the mutation detection result is abnormal, the last target air pressure data corresponding to the target range within the specified unit time period is removed, and the mean of the remaining target air pressure data within the specified unit time period is used to replace the last target air pressure data to obtain the corrected air pressure data within the specified unit time period.
[0116] If the mutation detection result is normal, the target air pressure data within the specified unit time period will be used as the corrected air pressure data within the specified unit time period.
[0117] Optionally, the device further includes:
[0118] The second acquisition module is used to acquire the reference altitude of the current location; wherein the reference altitude is acquired by one of the following methods: manual input, GPS positioning; if the GPS signal of the current location meets the preset conditions, the altitude data in the GPS positioning result is used as the reference altitude of the current location.
[0119] The second acquisition module is used to acquire real-time air pressure data of the next location within a preset time window according to a preset sampling frequency, and to calculate the altitude of the next location based on the acquired real-time air pressure data.
[0120] The second determining module is used to determine the altitude difference between the next location and the current location based on the altitude of the next location and the altitude of the current location.
[0121] The third determining module is used to determine the corrected altitude for the next location based on the reference altitude and altitude difference of the current location.
[0122] Example 3
[0123] See Figure 4This invention provides an electronic device, which includes a processor 60, a memory 61, a bus 62, and a communication interface 63. The processor 60, the communication interface 63, and the memory 61 are connected via the bus 62. The processor 60 is used to execute executable modules, such as computer programs, stored in the memory 61.
[0124] The memory 61 may include high-speed random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 63 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc.
[0125] Bus 62 can be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.
[0126] The memory 61 is used to store programs. After receiving an execution instruction, the processor 60 executes the program. The method executed by the apparatus defined by the process disclosed in any of the foregoing embodiments of the present invention can be applied to the processor 60 or implemented by the processor 60.
[0127] Processor 60 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 60 or by instructions in software form. Processor 60 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 61. Processor 60 reads the information in memory 61 and, in conjunction with its hardware, completes the steps of the above method.
[0128] The computer program product of the method, apparatus and electronic device for measuring the altitude of a wearable device provided in the embodiments of the present invention includes a computer-readable storage medium storing non-volatile program code executable by a processor. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation, please refer to the method embodiments, which will not be repeated here.
[0129] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0130] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0131] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0132] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of this invention is in use. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention. In addition, the terms "first," "second," "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0133] Furthermore, terms such as "horizontal," "vertical," and "sag" do not imply that components must be absolutely horizontal or suspended, but rather that they can be slightly tilted. For example, "horizontal" simply means that its direction is more horizontal relative to "vertical," and does not mean that the structure must be completely horizontal, but can be slightly tilted.
[0134] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set," "install," "connect," and "link" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0135] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for measuring the altitude of a wearable device, characterized in that, include: If it is determined that the standard pressure data should be updated, the current standard pressure data is obtained from the server. Collect real-time air pressure data of the current location within a preset time window according to a preset sampling frequency to obtain multiple real-time air pressure data; The preset time window includes several unit time periods of specified duration; The multiple real-time air pressure data are anomaly identified, and the multiple real-time air pressure data are corrected based on the anomaly identification results to obtain multiple corrected air pressure data. The altitude of the current location is determined based on the pressure height formula, the standard air pressure data, and the average of the corrected air pressure data within a specified unit time period; wherein, the specified unit time period refers to the last unit time period in the preset time window; The process includes anomaly detection of the multiple real-time air pressure data, and correction of the multiple real-time air pressure data based on the anomaly detection results, including: Noise detection is performed on the real-time air pressure data within each unit time period to obtain the noise detection results; Based on the noise detection results, the real-time air pressure data within each unit time period is corrected to obtain the target air pressure data within each unit time period. Based on the target air pressure data within a historical unit time period, waveform abrupt change detection is performed on the target air pressure data within the specified unit time period to obtain abrupt change detection results; wherein, the historical unit time period refers to all unit time periods before the specified unit time period within the preset time window; Based on the mutation detection results, the target air pressure data within the specified unit time period is corrected to obtain the corrected air pressure data within the specified unit time period.
2. The method for measuring the altitude of a wearable device according to claim 1, characterized in that, Noise detection is performed on the real-time air pressure data within each of the aforementioned unit time periods to obtain noise detection results, including: Calculate the pressure difference between adjacent real-time air pressure data within a target unit time period to obtain multiple pressure difference values; wherein, the target unit time period refers to any unit time period within the preset time window; Calculate the difference between the largest and smallest pressure difference values among the multiple pressure difference values to obtain a reference difference value; Determine whether the ratio between the sum of the multiple pressure differences and the reference difference is greater than a first threshold. If so, the noise detection result of the real-time air pressure data within the target unit time period is determined to be abnormal; If not, then the noise detection result of the real-time air pressure data within the target unit time period is determined to be normal.
3. The method for measuring the altitude of a wearable device according to claim 2, characterized in that, Correcting the real-time air pressure data within each unit time period based on the noise detection results includes: If the noise detection result is abnormal, the real-time air pressure data in the target unit time period is replaced with the real-time air pressure data in the previous adjacent unit time period to obtain the target air pressure data in the target unit time period. If the noise detection result is normal, the real-time air pressure data within the target time period is used as the target air pressure data within the target time period.
4. The method for measuring the altitude of a wearable device according to claim 1, characterized in that, Based on historical target air pressure data within a given time period, waveform abrupt change detection is performed on the target air pressure data within the specified time period, including: Based on the target air pressure data for each unit time period within the historical unit time period, the range of the average air pressure difference for each unit time period is calculated to obtain multiple reference ranges. The range of the average pressure difference within the specified time period is calculated based on the target air pressure data within the specified time period to obtain the target range; Determine whether the ratio of the first value to the second value is greater than a second threshold; wherein, the first value represents the difference between the target range and the average of the plurality of reference ranges, and the second value represents the sum of the average of the plurality of reference ranges and 1; If so, the change detection result of the target air pressure data within the specified unit time period is determined to be abnormal; If not, then the change detection result of the target air pressure data within the specified unit time period is determined to be normal.
5. The method for measuring the altitude of a wearable device according to claim 4, characterized in that, Correcting the target air pressure data within the specified time period based on the mutation detection results includes: If the mutation detection result is abnormal, the last target air pressure data corresponding to the target range within the specified unit time period is removed, and the mean of the remaining target air pressure data within the specified unit time period is used to replace the last target air pressure data to obtain the corrected air pressure data within the specified unit time period. If the mutation detection result is normal, the target air pressure data within the specified time period is used as the corrected air pressure data within the specified time period.
6. The method for measuring the altitude of a wearable device according to claim 1, characterized in that, After determining the altitude of the current location, the method further includes: Obtain the reference altitude of the current location; wherein the reference altitude is obtained by one of the following methods: manual input, GPS positioning; if the GPS signal of the current location meets preset conditions, the altitude data in the GPS positioning result is used as the reference altitude of the current location. Real-time air pressure data of the next location within a preset time window is collected according to a preset sampling frequency, and the altitude of the next location is calculated based on the collected real-time air pressure data. Based on the altitude of the next location and the altitude of the current location, determine the altitude difference between the next location and the current location; Based on the reference altitude of the current location and the altitude difference, the corrected altitude of the next location is determined.
7. A wearable device for measuring altitude, characterized in that, include: The first acquisition module is used to acquire the current standard pressure data from the server when it is determined that the standard pressure data should be updated. The first acquisition module is used to acquire real-time air pressure data of the current location within a preset time window according to a preset sampling frequency, and obtain multiple real-time air pressure data. The preset time window includes several unit time periods of specified duration; An anomaly detection module is used to detect anomalies in the multiple real-time air pressure data and correct the multiple real-time air pressure data based on the anomaly detection results to obtain multiple corrected air pressure data. The first determining module is used to determine the altitude of the current location based on the pressure altitude formula, the standard air pressure data, and the average of the corrected air pressure data within a specified unit time period; wherein, the specified unit time period refers to the last unit time period in the preset time window; The anomaly detection module includes: A noise detection unit is used to perform noise detection on the real-time air pressure data within each unit time period and obtain the noise detection result. The first correction unit is used to correct the real-time air pressure data in each unit time period based on the noise detection result, so as to obtain the target air pressure data in each unit time period. The mutation detection unit is used to perform waveform mutation detection on the target air pressure data within the specified unit time period based on the target air pressure data within the historical unit time period, and obtain the mutation detection result; wherein, the historical unit time period refers to all unit time periods before the specified unit time period within the preset time window; The second correction unit is used to correct the target air pressure data within the specified unit time period based on the mutation detection result, so as to obtain the corrected air pressure data within the specified unit time period.
8. An electronic device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for measuring the altitude of the wearable device according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the method for measuring the altitude of the wearable device according to any one of claims 1 to 6.
Citation Information
Patent Citations
Altitude measuring method and system
CN103994754A
Air pressure data acquisition module as well as differential barometric leveling system and method
CN107560598A
Height measurement method and device, electronic equipment and storage medium
CN115127514A