Altitude determination method, device, wearable device, and storage medium
By combining baseline altitude and barometric pressure sensor data in wearable devices and fusing altitude and barometric pressure information using a Kalman filter, the problem of inaccurate altitude measurement in wearable devices is solved, and the accuracy of altitude measurement is improved.
Patent Information
- Application Number
- CN202411553201.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2044-11-01
AI Technical Summary
The accuracy of altitude determination using wearable devices in existing technologies is not high, especially when GPS signals are weak or when environmental factors affect the altitude measurement, the error is relatively large.
By obtaining the baseline altitude and altitude increment of the reference location, and combining it with the current air pressure collected by the barometer, the Kalman filter is used to fuse the first altitude and the second altitude to determine the altitude of the current location.
It improves the accuracy of altitude measurement by wearable devices in different environments, reduces noise interference and errors, and enhances the precision of altitude measurement.
Smart Images

Figure CN119437162B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of altitude measurement technology, specifically to an altitude determination method, apparatus, wearable device, and storage medium. Background Technology
[0002] With the rapid development of smart wearable devices, more and more users are wearing them to improve the convenience of their lives. Taking smartwatches as an example, during outdoor mountaineering, users can use their smartwatches to measure their altitude for recording their activity, or they can use the altitude data to make subsequent decisions, such as determining whether to continue climbing. This is because the higher the altitude, the thinner the oxygen, making mountaineering less suitable. However, currently, there is a lack of a method for accurately determining altitude using wearable devices. Summary of the Invention
[0003] In view of the above problems, this application provides an altitude determination method, apparatus, wearable device and storage medium to solve the problem of low accuracy of altitude determined by wearable devices in the prior art.
[0004] According to one aspect of the embodiments of this application, an altitude determination method is provided, applied to a wearable device. The method includes: obtaining a reference altitude of a reference location; determining the altitude increment between the current location of the wearable device and the reference location at the current moment; determining the sum of the reference altitude and the altitude increment as a first altitude of the current location; obtaining the atmospheric pressure at sea level at the current moment; determining the current air pressure at the current location at the current moment; determining a second altitude of the current location based on the atmospheric pressure at sea level and the current air pressure; and determining the altitude of the current location at the current moment based on the first altitude and the second altitude.
[0005] In one alternative approach, determining the altitude increment between the current location of the wearable device and the reference location at the current moment includes:
[0006] The method involves: acquiring multiple first air pressures stored in the first buffer of the wearable device for multiple historical moments closest to the current moment, wherein the first buffer stores the first air pressures of different historical moments and their corresponding locations; determining a fitting slope K for fitting the multiple first air pressures according to the time sequence of the multiple historical moments; determining the difference diff between the current air pressure and the first air pressure of the previous moment among the multiple first air pressures; if K > SLOP and diff > PREDIFF, or K < -SLOP and diff < - PREDIFF, then determining the altitude increment based on the current air pressure and the multiple first air pressures; if K ≤ SLOP or diff ≤ PREDIFF or K ≥ -SLOP or diff ≥ - PREDIFF, then determining the altitude increment of the previous moment as the altitude increment of the current moment, wherein SLOP is a preset slope threshold and PREDIFF is a preset air pressure difference threshold.
[0007] In one alternative approach, determining the altitude increment based on the current air pressure and the plurality of first air pressures includes: using a formula Determine the altitude increment, where altd is the altitude increment, P0 is the current air pressure, and P1 is the first air pressure at the previous moment among the plurality of first air pressures.
[0008] In one optional approach, determining the current air pressure at the current location at the current moment includes: acquiring multiple second air pressures stored in a second buffer of the wearable device, wherein the second buffer stores second air pressures collected by the wearable device at different historical moments; determining a first average value of the multiple second air pressures; if the first average value satisfies a first preset condition, determining the first average value as the current air pressure; if the first average value does not satisfy the first preset condition, determining whether multiple third air pressures satisfy a second preset condition, wherein the multiple third air pressures include the first average value and the air pressures at the wearable device's location at multiple historical moments stored in the first buffer of the wearable device; if the multiple third air pressures do not satisfy the second preset condition, determining the first average value as the current air pressure; if the multiple third air pressures satisfy the second preset condition, determining the standard deviation S of the multiple second air pressures; if S < C, determining the first average value as the current air pressure, wherein C is a preset standard deviation threshold; if S ≥ C, determining the effective air pressure at the wearable device's location at the previous moment stored in the first buffer as the current air pressure.
[0009] In an alternative manner, the first preset condition includes abs(Pressure - mm_pre_press) < MB, where Pressure is the first average value, mm_pre_press is the effective air pressure at the position where the wearable device was located at the previous moment stored in the first buffer, and MB is a preset air pressure difference threshold; among the multiple third air pressures, there are n air pressures that do not satisfy the first preset condition, and the second preset condition includes a < n ≤ b, where a, n, and b are all positive integers, and b > a.
[0010] In an alternative manner, the reference altitude is determined through the following steps: in response to an operation of calibrating the reference altitude, obtain multiple third altitudes collected by GPS when the wearable device is located at the reference position; determine the standard deviation S of the multiple third altitudes ’ ; determine the product c of S ’ and a preset value; remove the third altitudes greater than S ’ +c from the multiple third altitudes; remove the third altitudes less than S ’ -c from the multiple third altitudes; determine the second average value of the remaining third altitudes; determine the second average value as the reference altitude.
[0011] In an alternative manner, determining the altitude of the current position at the current moment according to the first altitude and the second altitude includes: fusing the first altitude and the second altitude through a Kalman filter to obtain the altitude of the current position at the current moment.
[0012] According to another aspect of the embodiments of the present application, there is provided an altitude determination device applied to a wearable device, including: a first acquisition module for acquiring the reference altitude of a reference position; a first determination module for determining the altitude increment between the current position where the wearable device is located at the current moment and the reference position; a second determination module for determining the sum value of the reference altitude and the altitude increment as the first altitude of the current position; a second acquisition module for acquiring the sea - level atmospheric pressure at the current moment; a third determination module for determining the current air pressure at the current position; a fourth determination module for determining the second altitude of the current position according to the sea - level atmospheric pressure and the current air pressure; a fifth determination module for determining the altitude of the current position at the current moment according to the first altitude and the second altitude.
[0013] According to another aspect of the embodiments of the present application, there is provided a wearable device, including: a memory, a processor, and a computer program stored on the memory, and the processor executes the computer program to implement the altitude determination method as described above.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the altitude determination method as described above.
[0015] In this embodiment, the first altitude of the current location is determined by a reference altitude and the second altitude of the current location is determined by air pressure. The altitude of the current location is obtained by fusing the first altitude and the second altitude. Compared with the method of directly determining the first altitude or the second altitude as the altitude of the current location, the accuracy of the final determined altitude of the current location can be improved.
[0016] The above description is merely an overview of the technical solutions of the embodiments of this application. In order to better understand the technical means of the embodiments of this application and to implement them in accordance with the contents of the specification, and to make the above and other objects, features and advantages of the embodiments of this application more obvious and understandable, specific implementation methods of this application are described below. Attached Figure Description
[0017] The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of this application. Furthermore, the same reference numerals denote the same parts throughout the drawings. In the drawings:
[0018] Figure 1 A schematic diagram of the structure of the wearable device provided in an embodiment of this application is shown;
[0019] Figure 2 A flowchart illustrating the altitude determination method provided in an embodiment of this application is shown;
[0020] Figure 3 It shows Figure 2 A flowchart illustrating the sub-steps of step 150 in the middle section;
[0021] Figure 4 A flowchart illustrating an altitude determination method according to another embodiment of this application is shown;
[0022] Figure 5 A flowchart illustrating the benchmark altitude determination method provided in an embodiment of this application is shown.
[0023] Figure 6 A schematic diagram of the altitude determination device provided in an embodiment of this application is shown. Detailed Implementation
[0024] Exemplary embodiments of the present application will now be described in more detail with reference to the accompanying drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application may be implemented in various forms and should not be limited to the embodiments set forth herein.
[0025] Altitude refers to the vertical difference between a local location and a reference sea level. Since altitude is related to air pressure, wearable devices can incorporate barometric pressure sensors to collect the air pressure at their location. The altitude can then be calculated based on the relationship between air pressure and altitude. However, air pressure is affected not only by altitude but also by other environmental factors such as temperature. Therefore, the air pressure at the same location can vary at different times, leading to significant discrepancies in the altitude calculated directly from air pressure. In short, altitude calculated directly from air pressure contains a certain degree of error.
[0026] The method of determining altitude by directly using the Global Positioning System (GPS) requires a high signal strength. In densely forested areas and other places where GPS signals are weak, GPS drift will occur during positioning due to the poor signal, resulting in lower accuracy of the obtained altitude.
[0027] Therefore, to improve the accuracy of altitude determination using wearable devices, this application proposes an altitude determination method applied to wearable devices. This method involves determining the altitude increment between the current location of the wearable device and a reference location, summing the reference altitude of the reference location and the altitude increment to determine the first altitude of the current location, and then determining the second altitude of the current location using the air pressure at that location. Finally, the altitude of the current location is determined based on both the first and second altitudes. Since the first and second altitudes are determined using two different methods, determining the current location's altitude based on either the first or second altitude improves the accuracy of the final altitude determination compared to directly using either the first or second altitude.
[0028] Figure 1 The diagram shows a structural schematic of a wearable device provided in an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the wearable device.
[0029] like Figure 1 As shown, the wearable device 10 may include: a barometric pressure sensor 11, a Global Positioning System (GPS) 12, a first buffer 13, a second buffer 14, a processor 15, and a memory 16.
[0030] The barometric pressure sensor 11 is used to collect the air pressure at the location of the wearable device 10 and store the collected air pressure data in the second buffer 14. GPS is used to measure the altitude at the location of the wearable device 10.
[0031] Memory 16 is used to store computer program 17. Memory 16 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device. The computer program 17 may include computer-executable instructions.
[0032] The processor 15 is used to execute the computer program 17 to implement the altitude determination method embodiment provided in this application, and to store the effective air pressure at different times and locations determined by executing the computer program 17 into the first buffer 13.
[0033] Processor 15 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application. The wearable device 10 may include one or more processors of the same type, such as one or more CPUs; or it may include processors of different types, such as one or more CPUs and one or more ASICs.
[0034] Figure 2 The diagram illustrates a flowchart of an altitude determination method provided in an embodiment of this application. This method is executed by a wearable device 10, which may be a wearable device including one or more processors 15, such as a smartwatch, smart bracelet, or smart helmet. Figure 2 As shown, the method includes the following steps:
[0035] Step 110: Obtain the reference elevation of the reference location.
[0036] Since the accuracy of altitude measurements obtained via GPS is higher in areas with strong GPS signals, the reference altitude in this embodiment can be the altitude measured in advance at a reference location using the GPS 12 of the wearable device 10, where the reference location is a location with a strong GPS signal. Alternatively, after accurately determining the altitude of a location through other means, that location and its altitude can be respectively designated as the reference location and the reference altitude.
[0037] Step 120: Determine the altitude increment between the current location of the wearable device and the reference location at the current moment.
[0038] The elevation increment can be understood as the elevation difference between the current location and the reference location. If the current location is higher than the reference location, the elevation increment is greater than zero. If the current location is lower than the reference location, the elevation increment is less than zero. If the current location and the reference location are the same location, the elevation increment is zero. It should be noted that in this application, "current time" and "current location" refer to the same time and the same location.
[0039] Step 130: Determine the sum of the baseline elevation and the elevation increment as the first elevation of the current location.
[0040] Since the elevation increment is the elevation difference between the current location and the reference location, and the reference elevation is the elevation between the reference location and the reference sea level, the first elevation of the current location is the sum of the reference elevation and the elevation increment.
[0041] Step 140: Obtain the atmospheric pressure at sea level at the current moment.
[0042] Since other environmental factors such as temperature and humidity can affect atmospheric pressure at sea level, this step obtains the atmospheric pressure at sea level at the current moment to determine the altitude of the current location.
[0043] Step 150: Determine the current air pressure at the current location at the current moment.
[0044] The current air pressure can be obtained by collecting the air pressure at the current location at the current moment through the air pressure sensor 11 of the wearable device 10.
[0045] Step 160: Determine the second elevation of the current location based on the atmospheric pressure at sea level and the current air pressure.
[0046] In this step, the formula can be used. Calculate the second altitude h2, where P2 is the current air pressure collected by the barometer and P3 is the atmospheric pressure at sea level.
[0047] It is worth noting that in this embodiment of the application, the wearable device can be controlled to execute steps 110 and 140 simultaneously, or the wearable device can be controlled to execute steps 110 and 140 sequentially. The execution order of steps 110 and 140 can be determined as needed and is not limited here.
[0048] Step 170: Determine the altitude of the current location at the current moment based on the first altitude and the second altitude.
[0049] Because the data collected by the hardware in the wearable device 10 contains hardware-introduced noise and interference, both the first and second altitudes determined from the collected data have certain errors. Therefore, the optimal estimation of the first and second altitudes can also be regarded as a filtering process. Thus, in this embodiment, preferably, the first and second altitudes are fused using a Kalman filter to obtain the altitude of the current location. Kalman filtering is an algorithm that uses the state equations of a linear system, combined with the system's input-output information and observation data, to make an optimal estimate of the system's state.
[0050] Specifically, the Kalman filter equations are as follows:
[0051] X(t|t-1)=AX(t-1|t-1)+BU(t) (1)
[0052] P(t|t-1)=AP(t-1|t-1)A ′ +Q (2)
[0053] X(t|t)=X(t|t-1)+K(t)(Z(t)-HX(t|t-1)) (3)
[0054] K(t)=P(t|t-1)H ′ / (HP(t|t-1)H ′ +R) (4)
[0055] P(t)=(IK(t)H)P(t|t-1) (5)
[0056] In this system, the first elevation is represented as X(t|t-1), and the second elevation as Z(t), which are substituted into the Kalman filter equations described above. H represents the parameters of the measurement system. ′ Let H be the transpose of H, X(t-1|t-1) be the optimal result of the previous state, and U(t) be the control variable of the current state, which is 0 in this embodiment. P(t|t-1) is the covariance of X(t|t-1), P(t-1|t-1) is the covariance of X(t-1|t-1), and A is the covariance of X(t-1|t-1). ′ Let A be the transpose matrix, which is 1 in this embodiment; B be the gain of the control input, which is 1 in this embodiment; R be the covariance of the noise of the barometric pressure sensor 11; Q be the covariance of the system process; K(t) be the Kalman gain at time t; and I be the identity matrix, which is 1 for a single model and single measurement. When the system enters state t+1, P(t) is the covariance of X(t|t) at time t. X(t|t) is the optimal estimate of the filter at time t, which is also the altitude of the current position at the current time.
[0057] In this embodiment, the first altitude of the current location is determined by a reference altitude, and the second altitude is determined by air pressure. Since both the first and second altitudes have varying degrees of error, fusing the first and second altitudes to obtain the current location's altitude improves the accuracy of the final determined altitude compared to directly determining either the first or second altitude. Specifically, by using a Kalman filter to fuse the first and second altitudes, errors can be reduced or eliminated, improving the accuracy of the final fused altitude.
[0058] In some embodiments, the average of the first altitude and the second altitude can be used as the altitude of the current location, thereby improving the accuracy of the determined altitude.
[0059] Figure 3 It shows Figure 2 A flowchart illustrating the sub-steps of step 150. (See attached flowchart.) Figure 3 As shown, step 150 includes:
[0060] Step 151: Obtain multiple second air pressures stored in the second buffer of the wearable device, wherein the second buffer stores the second air pressures of the wearable device at different historical times.
[0061] The second air pressure is collected by the air pressure sensor 11 in the wearable device 10. Specifically, the air pressure sensor 11 can be controlled to collect the air pressure every fixed preset time interval (e.g., 1 second) and store it in the second buffer 14. In this embodiment, in order to improve the utilization rate of the storage space of the second buffer 14, the second buffer 14 only stores the air pressure collected in the most recent few times (e.g., the most recent 5 times). It should be noted that the multiple second air pressures obtained in this step are the air pressures collected at the multiple historical times closest to the current time.
[0062] After acquiring multiple second air pressures, smoothing filters can be used to smooth out data with large fluctuations, reducing abnormal data fluctuations. An outlier tracking filter algorithm is used to filter the multiple second air pressures and remove abnormal second air pressures. The air pressure data packets collected from the air pressure sensor 11 contain noise, and even air pressure data collected when the wearable device 10 is in motion may have abrupt changes. Therefore, smoothing filters can make the air pressure data smoother. While smoothing filters reduce noise, when a user wears the wearable device 10 and engages in vigorous exercise, such as when running while wearing a smartwatch, the smartwatch swings with the user's arm movements. This causes significant abrupt changes in the air pressure data collected by the smartwatch's air pressure sensor. Smoothing filters have little impact on these abrupt changes; therefore, an outlier filtering algorithm is needed to filter them out.
[0063] Step 152: Determine the first average value of multiple second air pressures.
[0064] In this step, by determining the first average value of multiple second air pressures, the current air pressure can be determined based on the first average value in the subsequent process, rather than directly determining the current air pressure based on a single air pressure collected by the air pressure sensor 11 at the current moment. This can avoid the situation where the accuracy of the current air pressure determined subsequently is reduced due to an abnormal air pressure collected at a certain moment caused by an abnormality in the air pressure sensor 11.
[0065] Step 153: Determine whether the first average value meets the first preset condition. If yes, go to step 154; if not, go to step 155.
[0066] The first preset condition can be set as needed. In some embodiments, the first preset condition includes abs(Pressure - mm_pre_press) < MB, where Pressure is the first average value, mm_pre_press is the effective air pressure at the position where the wearable device was located at the previous moment stored in the first buffer 13, and MB is the preset air pressure difference threshold, which can be set as needed, such as set to 0.1, 0.2, or 0.3, etc. The first buffer 13 stores the effective air pressures at each moment and the corresponding moments determined through steps 151 to 158 at historical moments.
[0067] It can be understood that under normal circumstances, within a short period of time, the change range of the air pressures at two adjacent moments is within a certain range, that is, the air pressures at two adjacent moments will not change significantly. Taking the wearable device as a smart watch as an example, when the user is doing strenuous exercise (such as running on flat ground), if the user's arm swings, it may cause a huge mutation in the air pressure collected by the air pressure sensor, that is, the difference between the first average value and the air pressure at the previous moment stored in the first buffer 13 is large, but this is not the air pressure change caused by the altitude change. Then, for the above situation, if the first average value is directly used as the current air pressure and stored in the first buffer 13, the accuracy of the determined current air pressure will be low. Therefore, in the embodiment of the present application, by determining whether the absolute value of the difference between the first average value Pressure and the air pressure mm_pre_press at the previous moment's position is less than the preset air pressure difference threshold, it is determined whether the change range between the first average value and the air pressure at the previous moment belongs to the normal range.
[0068] Step 154: Determine the first average value as the current air pressure.
[0069] If the absolute value of the difference between the first average pressure and the air pressure mm_pre_press at the previous moment is less than the preset air pressure difference threshold, it means that the change in the first average pressure and the air pressure at the previous moment is within the normal range, and thus the first average pressure is determined as the current air pressure in this step.
[0070] Step 155: Determine whether the multiple third air pressures meet the second preset condition, wherein the multiple third air pressures include the first average value and the air pressure at the location of the wearable device at multiple historical moments stored in the first buffer of the wearable device. If yes, proceed to step 156; if no, proceed to step 154.
[0071] The plurality of third air pressures includes a first average value and air pressures stored in the first buffer 13 that are closest to the current time from multiple historical times. A second preset condition can be set as needed. In some embodiments, the plurality of third air pressures includes n air pressures that do not satisfy the first preset condition, and the second preset condition includes a < n ≤ b, where a, n, and b are all positive integers, and b > a. a and b can be set as needed; for example, a can be set to 2, 3, or 4, and b can be set to 19, 20, or 21.
[0072] Wearable devices are typically set to collect air pressure every 1 second. In some embodiments, by setting 'a' to 3, it is possible to prevent the wearable device from abruptly changing for only 1-2 seconds and filtering out the collected air pressure as an outlier during such a change.
[0073] Step 156: Determine the standard deviation S of multiple second pressures.
[0074] Step 157: Determine if S < C. If yes, proceed to step 154; otherwise, proceed to step 158.
[0075] Step 158: Determine the effective air pressure of the wearable device's location at the previous moment, stored in the first buffer, as the current air pressure.
[0076] If S < C, it indicates that the multiple third pressures are relatively concentrated and there are no significant fluctuations. Therefore, in the embodiment of this application, if the standard deviation S of the multiple second pressures satisfies S < C, it indicates that the current state is normal and the first average value is valid, thus the first average value is determined as the current pressure.
[0077] If S≥C, it indicates that the multiple third air pressures are relatively dispersed, meaning that the multiple third air pressures fluctuate significantly, which is not in line with reality. This may be due to other factors causing anomalies in the second air pressure collected by the air pressure sensor, leading to an abnormal first average value. Under the premise of conforming to reality, the current position will not change significantly from the previous position, and the corresponding air pressure will not change significantly either. Therefore, the standard deviation S of the multiple second air pressures satisfies S<C. Thus, if S≥C, it indicates that the current position has not changed significantly from the previous position, and the significant fluctuations in the multiple third air pressures are due to a large change in air pressure. Therefore, in this embodiment, the air pressure at the previous position of the wearable device stored in the first buffer 13 is determined as the current air pressure.
[0078] In this embodiment of the application, multiple second air pressures collected by the air pressure sensor within a certain period of time are obtained, and a first average value of the multiple second air pressures is determined. Then, based on the first average value, it is determined whether the change range of the effective air pressure at the previous moment is within the normal range. If it is within the normal range, it means that the first average value is an effective value. Therefore, the first average value is determined as the current air pressure.
[0079] In this embodiment, multiple second air pressures collected by a barometric pressure sensor over a certain period of time are acquired, and a first average value of the multiple second air pressures is determined. Then, it is determined whether the first average value meets a first preset condition. If it meets the first preset condition, the first average value is considered valid, and thus the first average value is determined as the current air pressure, thereby improving the accuracy of the determined current air pressure. If the first average value does not meet the first preset condition, it is further determined whether multiple third air pressures meet a second preset condition. If the second preset condition is met and S < C, it indicates that the current state of the wearable device is consistent with the actual situation, i.e., the first average value is valid, and thus the first average value is determined as the current air pressure, thereby improving the accuracy of the determined current air pressure. If the second preset condition is met but S < C is not met, it indicates that the current state of the wearable device is inconsistent with the actual situation. In this case, the air pressure at the previous location is determined as the current air pressure, instead of the first average value, thereby improving the accuracy of the determined current air pressure.
[0080] Figure 4 A flowchart illustrating an altitude determination method according to another embodiment of this application is shown. Figure 4 As shown, the method includes the following steps:
[0081] Step 201: Obtain the reference elevation of the reference location.
[0082] This step is the same as step 110. Therefore, the principle and specific implementation method of this step can be referred to step 110, and will not be repeated here.
[0083] Step 202: Obtain multiple first air pressures from multiple historical moments closest to the current moment stored in the first buffer of the wearable device, wherein the first buffer stores the first air pressures of different historical moments and their corresponding locations.
[0084] In this embodiment of the application, preferably, the first air pressure stored in the first buffer 13 is the effective air pressure determined by steps 151 to 158 above, and the air pressure after noise reduction and smoothing filtering. The length of the filter used for smoothing filtering is LM.
[0085] Step 203: Determine the fitting slope K for fitting multiple first air pressures based on the time sequence of multiple historical moments.
[0086] In this embodiment of the application, the fitting slope K is preferably determined by the least squares method. The least squares formula is:
[0087]
[0088] Where LM is the number of first air pressure data obtained in step 202, x i Let y be the i-th value in an arithmetic sequence from 1 to LM with a common difference of 1. i The first air pressure is the i-th one obtained in step 202 based on the time sequence of multiple historical moments.
[0089] Step 204: Determine the difference, diff, between the current air pressure and the first air pressure at the previous moment among a plurality of first air pressures.
[0090] Wherein, diff is the difference between the current air pressure and the first air pressure stored in the first buffer that is closest to the current time in the previous time.
[0091] Step 205: Determine whether K > SLOP and diff > PREDIFF, or K <- SLOP and diff <- PREDIFF. If yes, proceed to step 206; otherwise, proceed to step 207.
[0092] PREDIFF is a preset pressure difference threshold, which can be set as needed, for example, to 0.006, 0.007, or 0.008. SLOP is a preset slope threshold, which can be set as needed, for example, to 0.4, 0.5, or 0.6.
[0093] The change in air pressure is mainly caused by two reasons: one is the change in air pressure due to the change in altitude, and the other is the change in air pressure due to the change in atmospheric environment without a change in altitude. Therefore, in this embodiment of the application, in order to improve the accuracy of the altitude increment determined by the first air pressure obtained in step 202, it is first determined whether the change in air pressure due to the change in altitude is satisfied based on the first air pressure at multiple historical moments.
[0094] If diff satisfies diff > PREDIFF, or diff < - PREDIFF, then the pressure change between two adjacent moments is within the normal range. In this embodiment, by determining whether K and diff simultaneously satisfy K > SLOP and diff > PREDIFF, or simultaneously satisfy K < - SLOP and diff < - PREDIFF, it is possible to accurately determine whether the pressure change is caused by altitude change or atmospheric environment change.
[0095] Step 206: Determine the altitude increment based on the current air pressure and multiple first air pressures.
[0096] Within a certain altitude range (typically several thousand meters), air pressure changes with altitude. Assuming constant temperature and humidity, air pressure decreases with increasing altitude and increases with decreasing altitude. Air pressure also changes with environmental variations; at the same location, air pressure will differ at different times. Therefore, if K > SLOP and diff > PREDIFF, or K <- SLOP and diff <- PREDIFF, it indicates that the current change in air pressure is caused by a change in altitude.
[0097] In some embodiments, by formula Determine the altitude increment, where altd is the altitude increment, P0 is the current air pressure, and P1 is the first air pressure of the previous moment among multiple first air pressures, which is the first air pressure of the historical moment closest to the current moment.
[0098] Step 207: Determine the altitude increment of the previous moment as the altitude increment of the current moment.
[0099] If K > SLOP and diff > PREDIFF or K < -SLOP and diff < -PREDIFF is not satisfied, it indicates that the current pressure change is caused by changes in the atmospheric environment.
[0100] Step 208: Determine the sum of the baseline elevation and the elevation increment as the first elevation of the current location.
[0101] Step 209: Obtain the atmospheric pressure at sea level at the current moment.
[0102] Step 210: Determine the current air pressure at the current location at the current moment.
[0103] Step 211: Determine the second altitude of the current location based on the atmospheric pressure at sea level and the current air pressure.
[0104] Step 212: Determine the altitude of the current location at the current moment based on the first altitude and the second altitude.
[0105] Steps 208 to 212 are the same as steps 130 to 170. Therefore, the principle and implementation method of steps 208 to 212 can be referred to steps 130 to 170, and will not be repeated here.
[0106] It is worth noting that in this embodiment of the application, the wearable device can be controlled to execute steps 201 and 209 simultaneously, or the wearable device can be controlled to execute steps 201 and 209 sequentially. The execution order of steps 201 and 209 can be determined as needed and is not limited here.
[0107] Since any change in altitude or atmospheric environment can cause a change in altitude, if the cause of the change in air pressure is not known, and the altitude increment is determined directly based on the current air pressure and the first air pressure, the determined altitude increment may not be caused by the change in location. This would reduce the accuracy of the first altitude determined based on the altitude increment, and thus reduce the accuracy of the current altitude determined based on the first altitude.
[0108] In this embodiment, the fitting slope K and the difference diff are determined based on the current air pressure and multiple first air pressures at multiple historical times. If K > SLOP and diff > PREDIFF or K < -SLOP and diff < -PRREDIFF, it indicates that the air pressure change is caused by an altitude change, and the altitude increment is calculated based on the current air pressure and the first air pressures. If K > SLOP and diff > PREDIFF or K < -SLOP and diff < -PRREDIFF, it indicates that the air pressure change is caused by an atmospheric environmental change, and the current position is unchanged from the previous position, meaning the altitude of the current position is unchanged from the previous position. Therefore, the altitude increment of the previous position is determined as the altitude increment of the current position. Through the above method, this embodiment improves the accuracy of the determined altitude increment, thereby further improving the accuracy of the final determined altitude of the current position.
[0109] Figure 5 A flowchart illustrating the benchmark altitude determination method provided in an embodiment of this application is shown. Figure 5 As shown, the method for determining the benchmark altitude includes:
[0110] Step 310: In response to the calibration of the reference altitude, acquire multiple third altitudes via GPS when the wearable device is located at the reference position.
[0111] Among these features, when the user is in an area with a strong GPS signal, the wearable device can be calibrated to a reference altitude.
[0112] Step 320: Determine the standard deviation S of multiple third altitudes ’ .
[0113] Step 330: Determine S ’ The product c of the preset value.
[0114] The preset value can be determined as needed, for example, 5%, 10%, or 15%.
[0115] Step 340: Remove multiple values greater than S from the third altitude. ’ +c is the third altitude.
[0116] Step 350: Remove multiple third altitudes less than S ’ -c is the third altitude.
[0117] It is understandable that the third altitude data collected via GPS may contain some errors. Therefore, in steps 340-350, by removing the third altitudes that deviate from the standard deviation within the first degree, abnormal third altitudes can be removed, thus retaining the normal third altitudes.
[0118] Step 360: Determine the second average value of the remaining third altitude.
[0119] Step 370: Determine the second average value as the baseline altitude.
[0120] In this embodiment, by removing abnormal data from multiple third altitudes and then determining the second average value of the remaining normal third altitudes as the reference altitude, the accuracy of the determined reference altitude can be improved compared to directly determining the third altitude collected at a certain moment as the reference altitude.
[0121] During mountain climbing, users wearing wearable devices collect atmospheric pressure data via a barometric pressure sensor. Research shows a negative correlation between air pressure and altitude; that is, air pressure decreases as altitude increases. Since atmospheric pressure varies from several hundred to tens of hundred Pascals throughout the day, and air pressure is higher in winter than in summer at the same location, directly calculating altitude from air pressure would introduce significant errors. Because air pressure changes relatively slowly throughout the day, a threshold is set to determine whether the pressure change is caused by atmospheric environmental variations or altitude changes. If the change is due to altitude, the altitude increment is calculated using the pressure difference, and the initial altitude is then calculated based on the baseline altitude and the altitude increment. However, even when determining the reference altitude using GPS at a reference location with good GPS signal, there will still be some error. Furthermore, the second altitude calculated by comparing the obtained sea level atmospheric pressure with the atmospheric pressure collected by the barometric pressure sensor will also have some error. In particular, when the natural environment of the sea level corresponding to the sea level atmospheric pressure differs significantly from the natural environment of the current location, the error of the second altitude will be larger. Therefore, in this embodiment of the application, the first altitude and the second altitude are fused using a Kalman filter, thereby obtaining a more accurate altitude of the current location.
[0122] Figure 6 A schematic diagram of the altitude determination device provided in an embodiment of this application is shown. Figure 6 As shown, the device 400 is applied to a wearable device and includes: a first acquisition module 401, a first determination module 402, a second determination module 403, a second acquisition module 404, a third determination module 405, a fourth determination module 406, and a fifth determination module 407. Specifically, the first acquisition module 401 acquires the reference altitude of a reference location. The first determination module 402 determines the altitude increment between the current location of the wearable device and the reference location. The second determination module 403 determines the first altitude of the current location by summing the reference altitude and the altitude increment. The second acquisition module 404 acquires the atmospheric pressure at sea level at the current time. The third determination module 405 determines the current air pressure at the current location. The fourth determination module 406 determines the second altitude of the current location based on the atmospheric pressure at sea level and the current air pressure. The fifth determination module 407 determines the altitude of the current location based on the first and second altitudes.
[0123] The altitude determination device provided in this embodiment is used to execute the altitude determination method in the aforementioned method embodiment. Its implementation principle and technical effect are similar, and will not be described again here.
[0124] It is worth noting that the altitude determination device provided in this embodiment also includes other modules for performing the steps of the above-described altitude determination method embodiment, which will not be described in detail here.
[0125] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described altitude determination method embodiment.
[0126] This application provides a computer program that can be executed by a processor to implement the above-described altitude determination method embodiment.
[0127] This application provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described altitude determination method embodiment.
[0128] In the several embodiments provided in this application, any function, if implemented as a software functional module / unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of this application 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 other electronic device) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing computer program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0129] The algorithms or displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of this application are not directed to any particular programming language. It should be understood that the content of this application described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of this application.
[0130] It should be noted that the above embodiments are illustrative of this application and not restrictive, and those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. This application can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In claims enumerating several means, several units or modules of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be construed as limiting the order of execution.
[0131] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method for determining an altitude, applied to a wearable device, comprising: The method comprises: obtaining a reference altitude of a reference position; determining an altitude increment between a current position of the wearable device at a current time and the reference position; determining a first altitude of the current position as a sum of the reference altitude and the altitude increment; obtaining a sea level atmospheric pressure at the current time; determining a current atmospheric pressure of the current position at the current time; determining a second altitude of the current position according to the sea level atmospheric pressure and the current atmospheric pressure; determining an altitude of the current position at the current time according to the first altitude and the second altitude; wherein, the determination of the altitude increment between the current position of the wearable device at the current time and the reference position comprises: obtaining a plurality of first atmospheric pressures at a plurality of historical times closest to the current time stored in a first cache area of the wearable device, wherein the first cache area stores first atmospheric pressures at different historical times and positions thereof; determining a fitting slope K fitting the plurality of first atmospheric pressures according to a time sequence of the plurality of historical times; determining a difference diff between the current atmospheric pressure and a first atmospheric pressure at a previous time in the plurality of first atmospheric pressures; if K > SLOP and diff > PREDIFF, or K < -SLOP and diff < -PREDIFF, determining the altitude increment according to the current atmospheric pressure and the plurality of first atmospheric pressures, wherein SLOP is a preset slope threshold, and PREDIFF is a preset atmospheric pressure difference threshold. if K ≤ SLOP or diff ≤ PREDIFF or K ≥ -SLOP or diff ≥ -PREDIFF, determining an altitude increment at a previous time as the altitude increment at the current time.
2. The method of claim 1, wherein, the determination of the altitude increment according to the current atmospheric pressure and the plurality of first atmospheric pressures comprises: determining the altitude increment by formula determining the altitude increment, wherein, is the altitude increment, P0 is the current air pressure, and P1 is a first air pressure at a previous time among the plurality of first air pressures.
3. The method of claim 1, wherein, the determination of the current atmospheric pressure of the current position at the current time comprises: obtaining a plurality of second atmospheric pressures stored in a second cache area of the wearable device, wherein the second cache area stores second atmospheric pressures of positions of the wearable device collected at different historical times; determining a first average of the plurality of second atmospheric pressures; if the first average satisfies a first preset condition, determining the first average as the current atmospheric pressure; if the first average does not satisfy the first preset condition, determining whether a plurality of third atmospheric pressures satisfy a second preset condition, wherein the plurality of third atmospheric pressures comprise the first average and atmospheric pressures of positions of the wearable device at a plurality of historical times stored in a first cache area of the wearable device; if the plurality of third atmospheric pressures do not satisfy the second preset condition, determining the first average as the current atmospheric pressure; if the plurality of third atmospheric pressures satisfy the second preset condition, determining a standard deviation S of the plurality of second atmospheric pressures; if S < C, determining the first average as the current atmospheric pressure, wherein C is a preset standard deviation threshold; if S ≥ C, determining a valid atmospheric pressure of a position of the wearable device at a previous time stored in the first cache area as the current atmospheric pressure.
4. The method of claim 3, wherein, The first preset condition comprises wherein, Pressure is the first average value, mm_pre_press is the effective air pressure of the wearable device at the position stored in the first cache area at the previous time, is a preset air pressure difference threshold value. The third pressures include n pressures that do not satisfy the first preset condition, and the second preset condition includes a 5. The method of claim 1, wherein, The reference altitude is determined by the following steps: In response to the operation of calibrating the reference altitude, a plurality of third altitudes collected by GPS when the wearable device is located at the reference position are acquired; determining a standard deviation of the plurality of third elevations ; determining a product c of the determined value and a preset value; removing third elevations greater than from the plurality of third elevations; removing third elevations in the plurality of third elevations that are less than third elevations. A second average value of the remaining third altitudes is determined; The second average value is determined as the reference altitude.
6. The method of claim 1, wherein, The determining of the altitude of the current position at the current time according to the first altitude and the second altitude includes: The first altitude and the second altitude are fused by a Kalman filter to obtain the altitude of the current position at the current time.
7. An altitude determining apparatus applied to a wearable device, characterized in that, The device includes: A first acquisition module configured to acquire a reference altitude of a reference position; A first determination module configured to determine an altitude increment between a current position of the wearable device at a current time and the reference position; A second determination module configured to determine a sum of the reference altitude and the altitude increment as a first altitude of the current position; A second acquisition module configured to acquire a sea level atmospheric pressure at the current time; A third determination module configured to determine a current pressure of the current position at the current time; A fourth determination module configured to determine a second altitude of the current position according to the sea level atmospheric pressure and the current pressure; A fifth determination module configured to determine an altitude of the current position at the current time according to the first altitude and the second altitude; The determination of the altitude increment between the current position of the wearable device at the current time and the reference position includes: Acquiring a plurality of first pressures of a plurality of historical times closest to the current time stored in a first cache area of the wearable device, wherein the first cache area stores first pressures of different historical times and positions thereof; Determining a fitting slope K fitting the plurality of first pressures according to a time sequence of the plurality of historical times; Determining a difference diff between the current pressure and a first pressure of a previous time in the plurality of first pressures; If K > SLOP and diff > PREDIFF, or K < -SLOP and diff < -PREDIFF, then determining the altitude increment according to the current pressure and the plurality of first pressures; If K ≤ SLOP or diff ≤ PREDIFF or K ≥ -SLOP or diff ≥ -PREDIFF, then determining a previous time altitude increment as the altitude increment at the current time, wherein SLOP is a preset slope threshold, and PREDIFF is a preset pressure difference threshold.
8. A wearable device comprising a memory, a processor, and a computer program stored on the memory, wherein, The processor executes the computer program to implement the altitude determination method of any one of claims 1-6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the altitude determination method of any one of claims 1-6.
Citation Information
Patent Citations
Method and apparatus for measuring absolute altitude
CN106403891A
Method, system and equipment for collecting and processing bird flight height data
CN117146773A