Altitude height determination method, electronic equipment and storage medium

By using air pressure sensors and GNSS data combined with Kalman filtering technology in satellite communication, the problem of large altitude error in satellite communication is solved, and the altitude is accurately obtained during the movement process and the user experience is improved.

CN120333391AActive Publication Date: 2025-07-18HONOR DEVICE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410042874.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-01-10
Publication Date
2025-07-18
Estimated Expiration
2044-01-10

AI Technical Summary

Technical Problem

In areas where base stations cannot be deployed, there are large errors and fluctuations in the altitude obtained by the prior art through satellite communications, and users need to remain stationary to obtain accurate heights, which affects the user experience.

Method used

Using air pressure sensors and GNSS data, combined with Kalman filtering technology, the altitude reference value and air pressure reference value are obtained through satellite communication, reducing errors and allowing users to move during the detection process, improving the accuracy of altitude.

Benefits of technology

Under satellite communication, real-time altitude is quickly determined, reducing errors and improving user experience, and users can move during the detection process without affecting accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120333391A_ABST
    Figure CN120333391A_ABST
Patent Text Reader

Abstract

The invention discloses an altitude determination method, electronic equipment and a storage medium, and relates to the technical field of terminals. The method comprises the steps of determining a real-time altitude according to a sea level air pressure value and a detection result of a current air pressure sensor when the sea level air pressure value is obtained within a first preset time before satellite communication is established; when the electronic equipment does not acquire a sea level air pressure value within a first preset time before establishing satellite communication, determining an altitude reference value and an air pressure reference value according to altitude information in GNSS data acquired within a second preset time and a detection result of an air pressure sensor within the second preset time; the air pressure reference value is the air pressure of the electronic equipment at the end moment of the second preset time; taking the altitude reference value as the altitude of the electronic equipment at the end moment of the second preset time; and determining the real-time altitude according to the current detection result of the air pressure sensor, the altitude reference value and the air pressure reference value. According to the scheme, the accuracy of the determined altitude is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of terminals, and in particular, to a method for determining altitude, an electronic device, and a storage medium. Background Art

[0002] Currently, when users are engaged in outdoor work or outdoor sports, there may be a need to obtain the current altitude through an electronic device. For example, users need to send their current altitude to the outside through the electronic device, or users need to record the altitude of the target location, or users need to generate a 3D motion trajectory.

[0003] When the user is in a place where a base station cannot be deployed, such as the ocean, desert, or air, the traditional ground network cannot provide signal coverage. At this time, the electronic device cannot obtain the barometric pressure information of the local sea level through the network to determine the altitude, but can only obtain the global navigation satellite system (GNSS) position information through satellite communication, and use the altitude carried in the GNSS position information as the altitude of the current position.

[0004] However, the altitude obtained from the GNSS position information currently has large errors and fluctuations. The altitude differences obtained by measuring the same position multiple times may be more than ten meters or even larger. When the user moves during the altitude measurement process, the error of the altitude detection result may be even greater. Summary of the Invention

[0005] To solve the above problems, this application provides a method for determining altitude, an electronic device, and a storage medium, which improves the accuracy of the determined altitude.

[0006] In a first aspect, this application provides a method for determining altitude, which is applied to an electronic device. The electronic device supports satellite communication functions and includes a barometric pressure sensor. The method includes: the electronic device establishes satellite communication; when the sea level barometric pressure value is obtained within a first preset time before the electronic device establishes satellite communication, the real-time altitude is determined according to the sea level barometric pressure value and the detection result of the current barometric pressure sensor; when the sea level barometric pressure value is not obtained within the first preset time before the electronic device establishes satellite communication, the altitude reference value and the barometric pressure reference value are determined according to the altitude information in the GNSS data continuously obtained within a second preset time and the detection result of the barometric pressure sensor within the second preset time. The barometric pressure reference value is the barometric pressure of the electronic device at the end of the second preset time; the altitude reference value is used as the altitude of the electronic device at the end of the second preset time; the real-time altitude is determined according to the detection result of the current barometric pressure sensor, the altitude reference value, and the barometric pressure reference value.

[0007] When the solution provided by this application can obtain an effective sea - level air pressure value, that is, when establishing satellite communication due to no mobile network connection for a short period of time, it can quickly determine the real - time altitude according to the sea - level air pressure value obtained within the first preset time before establishing satellite communication and the detection result of the current air pressure sensor, shortening the waiting time of the user.

[0008] When the electronic device fails to obtain the sea - level air pressure value within the first preset time before establishing satellite communication, it can combine the altitude information in the GNSS data and the detection result of the air pressure sensor to determine the accurate altitude reference value and air pressure reference value.

[0009] Among them, the altitude reference value is the altitude of the electronic device at the end of the second preset time, which can be used as the reference altitude for subsequent calculation of the real - time altitude.

[0010] The air pressure reference value is the air pressure value of the electronic device at the end of the second preset time, and its function is similar to the sea - level air pressure value, which can be used as the reference air pressure for subsequent calculation of the real - time altitude.

[0011] The solution of this application uses multiple groups of GNSS data to reduce accidental errors, and uses the detection results of multiple groups of air pressure sensors to reflect the movement of the current user in the vertical direction within the second preset time. The altitude reference value jointly determined according to the altitude information and the detection result of the air pressure sensor within the second preset time is more accurate. Even if the user moves in the vertical direction during the detection process of the altitude reference value, since the movement in the vertical direction will cause changes in the detection result of the air pressure sensor, and the detection result of the air pressure sensor has been taken into account, a relatively accurate altitude reference value can still be obtained. Therefore, in the solution of this application, the user can move within the second preset time, and the obtained altitude reference value represents the altitude of the user's location at the end of the second preset time. Since this solution does not require the user to stay stationary, it has high practicability and improves the user experience.

[0012] In a possible implementation manner, determining the altitude reference value and the air pressure reference value according to the altitude information in the global navigation satellite system (GNSS) data obtained within the second preset time and the detection result of the air pressure sensor within the second preset time includes:

[0013] Obtain the first number of groups of original data within the second preset time, and each group of original data includes altitude information and the detection result of the air pressure sensor when obtaining the altitude information;

[0014] Filter the altitude information in each group of original data, and retain the altitude information with an error less than the preset threshold to obtain the second number of groups of detection data;

[0015] Perform a first-order Kalman filter on the second set of detection data to determine the altitude reference value and the air pressure reference value.

[0016] Using the Kalman filter to obtain the altitude reference value improves the accuracy of the altitude reference value.

[0017] In a possible implementation, performing a first-order Kalman filter on the second set of detection data to determine the altitude reference value and the air pressure reference value specifically includes:

[0018] Perform a first-order Kalman filter on the second set of detection data in sequence to obtain the second quantity of altitude calculation values in sequence. The second quantity is n, and n is a positive integer;

[0019] According to the detection result of the pressure sensor corresponding to the i-th altitude calculation value and the detection result of the pressure sensor corresponding to the n-th altitude calculation value, determine the height difference between the n-th altitude calculation value and the i-th altitude calculation value, where i = 1, 2,..., n - 1;

[0020] Sum the i-th altitude calculation value and the height difference corresponding to the i-th altitude calculation value to obtain the i-th altitude equivalent value; when the standard deviation between the n - 1 altitude equivalent values obtained and the n-th altitude calculation value is less than the preset standard deviation threshold, determine the last altitude calculation value obtained within the second preset time as the altitude reference value, and determine the detection result of the last pressure sensor obtained within the second preset time as the air pressure reference value.

[0021] In a possible implementation, according to the detection result of the current pressure sensor, the altitude reference value, and the air pressure reference value, determine the real-time altitude, specifically including: determining the real-time altitude change amount according to the detection result of the pressure sensor and the air pressure reference value; taking the sum of the real-time altitude change and the altitude reference value as the real-time altitude.

[0022] In a possible implementation, after determining the real-time altitude, the method further includes:

[0023] Display the real-time altitude on the user interface of the electronic device.

[0024] In a possible implementation, the method further includes:

[0025] In response to a selection operation, start a text message application program, and the text message application program is used to send text messages through satellite communication;

[0026] In response to a location information addition operation, add the real-time altitude to the text message.

[0027] In a possible implementation, when the standard deviation between the n - 1 altitude equivalent values obtained and the nth altitude calculated value is greater than or equal to a preset standard deviation, the method further includes:

[0028] Determining the altitude at the end moment of the second preset time as the last altitude calculated value obtained within the second preset time;

[0029] When the user requests to obtain the altitude again, determining the altitude reference value and the air pressure reference value according to the altitude information obtained within the second preset time and the detection result of the barometric pressure sensor within the second preset time.

[0030] In a possible implementation, the method further includes:

[0031] When the electronic device is connected to the mobile network, updating the sea - level air pressure value.

[0032] In a second aspect, the present application further provides an electronic device, which includes a barometric pressure sensor, a memory, and a processor. The barometric pressure sensor is used to measure the air pressure at the current location. The memory is used to store programs, and when the processor runs the programs, it implements the method for determining the altitude provided in the above - mentioned first aspect and any implementation manner of the first aspect. The electronic device in this implementation supports satellite communication functions.

[0033] In a third aspect, the present application further provides a storage medium, on which a computer program is stored. When the computer program is executed by the processor of the electronic device, it implements the method for determining the altitude provided in the above - mentioned first aspect and any implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic diagram of a non - terrestrial networks (NTN) communication system provided by the present application;

[0035] Figure 2 It is a flowchart of a method for determining altitude provided by an embodiment of the present application;

[0036] Figure 3 It is a schematic diagram of the user interface of the electronic device provided by an embodiment of the present application Figure 1 ;

[0037] Figure 4 It is a schematic diagram of the user interface of the electronic device provided by an embodiment of the present application Figure 2 ;

[0038] Figure 5 It is a flowchart of another method for determining altitude provided by an embodiment of the present application;

[0039] Figure 6Schematic diagram of the user interface of the electronic device provided by the embodiment of the present application Figure 3 ;

[0040] Figure 7 Schematic diagram of an electronic device provided by the embodiment of the present application. Detailed implementation manners

[0041] The terms "first", "second", "third", etc. in the description, claims and drawings of the present application are used to distinguish different objects, rather than to limit a specific order.

[0042] In the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Rather, the use of words such as "exemplary" or "for example" is intended to present relevant concepts in a specific manner.

[0043] In order to enable those skilled in the art to understand the solution of the present application more clearly, the application scenario of the technical solution of the present application will be described first below.

[0044] See Figure 1 , which is a schematic diagram of a non-terrestrial networks (NTN) communication system provided by the present application.

[0045] The method provided by the present application can be applied to an NTN communication system. As Figure 1 shown, the NTN communication system includes a satellite (which can also be referred to as a satellite base station) 100, a ground station (which can also be referred to as a gateway) 300, and a terminal device 400. The base station 200 in the figure can communicate with the ground station 300.

[0046] In the embodiments provided in this application, the terminal device 400 can be in various forms. For example, it can be a mobile phone, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a vehicle-mounted terminal device, a wireless terminal in unmanned driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a wearable terminal device, and so on. A terminal can sometimes also be referred to as a terminal device, a user equipment (UE), an access terminal device, a vehicle-mounted terminal, an industrial control terminal, a UE unit, a UE station, a mobile station, a mobile unit, a remote station, a remote terminal device, a mobile device, a UE terminal device, a terminal device, a wireless communication device, a UE agent, or a UE device, etc. The terminal can also be a fixed terminal or a mobile terminal.

[0047] In the embodiments of this application, the terminal devices can also communicate with each other through device-to-device (D2D), machine-to-machine (M2M), etc.

[0048] The satellite 100 in the embodiments of this application can provide wireless access services for the terminal device 400, schedule wireless resources for the accessed terminal device 400, and provide reliable wireless transmission protocols and data encryption protocols, etc. The satellite 100 can use artificial earth satellites and high-altitude aircraft, etc. as wireless communication base stations, such as evolutional NodeB (eNB) and next generation node B (gNB), etc. Alternatively, the satellite can also act as a relay for the base station to transparently transmit the wireless signals of these base stations to the terminal device. In this case, the ground station can be regarded as a wireless communication base station.

[0049] Therefore, in the embodiments of this application, in some embodiments, such as in the regenerative scenario of the satellite, the network device can be Figure 1 the satellite base station shown, that is, including the satellite 100; in other embodiments, such as in the transparent scenario of the satellite, the network device can be Figure 1 the ground station 300 shown.

[0050] For example, when the satellite 100 operates in the transparent transmission mode, the satellite 100 has the function of relay forwarding. The ground station 300 has the function of a base station or part of the functions of a base station. At this time, the ground station 300 can be regarded as a base station. Alternatively, the base station 200 can be deployed separately from the ground station 300. For ease of description, the transparent transmission mode shown below takes the case where the ground station 300 and the base station 200 are together or in close proximity as an example. Figure 1 This is shown by taking the case where the ground station 300 and the base station 200 are deployed separately, and it should not be construed as a limitation on the embodiments of the present application. When the satellite 100 operates in the regeneration mode, the satellite 100 has data processing capabilities, has the function of a base station or part of the functions of a base station. At this time, the satellite 100 can be regarded as a base station.

[0051] Optionally, the satellite 100 can be a geostationary earth orbit (GEO) satellite, or a non-geostationary earth orbit (NGEO) medium earth orbit (MEO) satellite or low earth orbit (LEO) satellite, or a high altitude platform station (HAPS), etc. The present application does not limit the specific type of the satellite.

[0052] Satellite communication, as a supplement to the current terrestrial cellular communication system, has at least the following advantages.

[0053] Extended coverage: For areas that cannot be covered by the current cellular communication system or where the coverage cost is high, such as the ocean, desert, remote mountainous areas, etc., satellite communication can be used to solve the communication problem.

[0054] Emergency communication: In extreme situations such as earthquakes where the infrastructure of cellular communication becomes unavailable, satellite communication can be used to quickly establish a communication connection.

[0055] Providing relevant industry applications: For example, for latency-sensitive services with long-distance transmission, the latency of service transmission can be reduced through satellite communication.

[0056] Currently, in areas where cellular communication systems cannot provide coverage, electronic devices can directly obtain altitude information through satellite communication capabilities. Specifically, the electronic device obtains GNSS location information through satellite communication capabilities. This location information may carry the longitude and latitude coordinates, altitude, and time information of the electronic device. However, there are significant errors and fluctuations in the altitude obtained from GNSS location information. The altitude differences obtained from multiple measurements at the same location may be more than ten meters or even greater. Moreover, obtaining GNSS location information through satellite communication capabilities takes a certain amount of time, such as generating dozens of seconds in more than a dozen seconds. If the user has a displacement in the vertical direction during this period, the error will further increase. Therefore, the current solution not only fails to meet the user's demand for obtaining high-precision altitude information but also requires the user to remain as stationary as possible when obtaining altitude information, which restricts the user's movement and thus reduces the user experience.

[0057] To solve the above technical problems, this application provides a method for determining altitude, an electronic device, and a storage medium. When the electronic device is connected to a mobile network, it obtains the sea-level air pressure value through the mobile network as the standard for air pressure calculation. When the electronic device obtains the sea-level air pressure value through the mobile network within the first preset time before establishing satellite communication, it determines the current altitude based on the obtained sea-level air pressure and the detection result of the air pressure sensor. When the electronic device fails to obtain the sea-level air pressure value within the first preset time before establishing satellite communication, it determines the altitude reference value and the air pressure reference value based on the altitude information in the GNSS data obtained within the second preset time and the detection result of the air pressure sensor within the second preset time, and determines the real-time altitude based on the current detection result of the air pressure sensor, the altitude reference value, and the air pressure reference value. The solution of this application can quickly determine the real-time altitude based on the sea-level air pressure value and the current detection result of the air pressure sensor when the sea-level air pressure value can be obtained through the network. When the sea-level air pressure value cannot be obtained, it jointly determines the real-time altitude by combining the altitude information in the GNSS data and the detection result of the air pressure sensor, improving the accuracy of the altitude detection result. And even if the user moves in the vertical direction during the altitude detection process, since the movement in the vertical direction will cause changes in the detection result of the pressure sensor, the solution of this application can still obtain a relatively accurate altitude detection result.

[0058] The following specifically describes the implementation manner of the solution of this application with reference to the accompanying drawings.

[0059] See Figure 2 , which is a flowchart of a method for determining altitude provided by an embodiment of this application.

[0060] S11: The electronic device establishes satellite communication.

[0061] See alsoFigure 3 and Figure 4 . Among them, Figure 3 is a schematic diagram of the user interface of the electronic device provided by the embodiment of the present application Figure 1 ; Figure 4 is a schematic diagram of the user interface of the electronic device provided by the embodiment of the present application Figure 2 .

[0062] The electronic device in the embodiment of the present application supports the satellite communication function. When the electronic device is currently in an area without mobile network coverage, the user can enable the satellite communication function of the electronic device. At this time, the electronic device first connects to the satellite to establish satellite communication. During this process, the user interface of the electronic device can be referred to Figure 3 .

[0063] After the satellite communication is established, the user interface of the electronic device switches to Figure 4 , Figure 4 in which the current signal status can be displayed. For example, it is displayed that the current signal status is good. The current longitude and latitude coordinates, real-time altitude, and data refresh time can also be displayed

[0064] Among them, the longitude and latitude coordinates are used to indicate the longitude and latitude of the current position of the electronic device. The real-time altitude is the real-time altitude determined by the following steps of the present application, and is not the altitude information directly carried in the GNSS data

[0065] S12: Determine whether a sea-level air pressure value is obtained within the first preset time before the satellite communication is established

[0066] If so, execute S13, otherwise execute S14

[0067] The sea-level air pressure value is the weight of the air column from the sea level to the upper boundary of the atmosphere per unit area. The sea-level air pressure value can be used for altitude calculation. For example, when the local sea-level air pressure value and the detection result of the current air pressure sensor are determined, the altitude of the current position, that is, the real-time altitude, can be determined

[0068] However, the sea-level air pressure value has timeliness. The sea-level air pressure value is affected by conditions such as atmospheric temperature and atmospheric density. If the sea-level air pressure value that remains unchanged is directly used for altitude calculation, the calculation result may have a certain deviation. Therefore, the sea-level air pressure value needs to be updated periodically or the latest sea-level air pressure value needs to be obtained when in use

[0069] When the electronic device is connected to the mobile network, the electronic device can obtain the local sea-level air pressure value in real time through the network or update the local sea-level air pressure value according to a certain update period. For example, the update period can be set to 1 hour. After the electronic device is connected to the mobile network, it determines whether the time since the last request to obtain the local sea-level air pressure value exceeds 1 hour. If it exceeds, it requests to obtain the local sea-level air pressure value again, saves the obtained sea-level air pressure value, and records the request time. The sea-level air pressure value obtained this time is used as the reference air pressure value for calculating the altitude.

[0070] It can be understood that the local sea-level air pressure value obtained through the network can be determined by the local meteorological agency, and this sea-level air pressure value can also be referred to as the average sea-level air pressure value.

[0071] When the electronic device disconnects from the mobile network and establishes satellite communication, the electronic device can no longer obtain or update the local sea-level air pressure value through the network. The solution of this application sets the first preset time as the aging judgment standard for the local sea-level air pressure value, and determines whether the time length between the request time of the last request to obtain the local sea-level air pressure value and the establishment of satellite communication by the electronic device is greater than the first preset time. If it is greater, it indicates that the sea-level air pressure value has not been obtained within the first preset time before the electronic device establishes satellite communication. If it is less, it indicates that the sea-level air pressure value has been obtained within the first preset time before the electronic device establishes satellite communication.

[0072] When the electronic device obtains the local sea-level air pressure value within the first preset time before establishing satellite communication, the solution of this application believes that this sea-level air pressure value still has timeliness and can be directly applied to calculate the real-time altitude. Otherwise, it is considered that no available local sea-level air pressure value has been obtained, or it is considered that the obtained local sea-level air pressure value no longer has timeliness.

[0073] The embodiment of this application does not specifically limit the first preset time. It can be understood that since the first preset time is used as the aging judgment standard for the local sea-level air pressure value, the first preset time should not be set too long. In some possible implementation manners, the first preset time can be set to 30 minutes, 1 hour, or 2 hours, so that the local sea-level air pressure value has high timeliness and reduces the calculation error of the real-time altitude.

[0074] The first preset time in the embodiments of the present application can be fixed or adjustable. For example, when the first preset time is adjustable, the user can configure the length of the first preset time in the setting option. For example, when located in an area with rapid or frequent weather changes, such as mountains or the ocean, the first preset time can be set shorter, for example, set to 30 minutes; when located in an area with relatively stable weather conditions, the first preset time can be set longer, for example, set to 2 hours.

[0075] S13: Determine the real-time altitude according to the sea-level air pressure value and the detection result of the current air pressure sensor.

[0076] At this time, there is a local sea-level air pressure value that can be directly applied, which is represented by P0. The electronic device can detect the air pressure at the current location through the air pressure sensor, and the detection result is represented by P. Then the real-time altitude h can be determined by the following formula:

[0077]

[0078] The units of P0 and P in formula (1) are kilopascals (kPa), and T is the current measured temperature, with the unit of degrees Celsius. In the above formula, T + 273.15 is to convert degrees Celsius to Kelvin temperature.

[0079] In practical applications, since the obtained is the local sea-level air pressure value, if the influence of temperature is not considered, taking the temperature as 15°C as an example, then the above formula (1) can also be converted into the following formula (2):

[0080]

[0081] Formula (2) does not require obtaining the current measured temperature compared with formula (1), so the real-time altitude can be obtained without a temperature sensor.

[0082] At this time, in the case of short-term lack of mobile network, the real-time altitude can be quickly determined using the sea-level air pressure value, shortening the waiting time of the user.

[0083] S14: Determine the altitude reference value and the air pressure reference value according to the altitude information in the GNSS data continuously obtained within the second preset time and the detection result of the air pressure sensor within the second preset time.

[0084] At this time, there is no local sea-level air pressure value that can be directly applied. Therefore, in the solution of the present application, the altitude reference value and the air pressure reference value are determined through the altitude information obtained within the second preset time and the detection result of the air pressure sensor.

[0085] The altitude reference value is the altitude of the electronic device at the end moment of the second preset time, which can be used as the reference altitude for subsequent calculation of the real-time altitude.

[0086] The barometric reference value is the barometric value of the electronic device at the end of the second preset time, and its function is similar to the sea-level barometric value, which can be used as the reference barometric pressure for subsequent calculation of the real-time altitude.

[0087] At this time, when the electronic device is performing satellite communication, it requests continuous positioning within the first preset time and obtains multiple GNSS data, and each GNSS data contains an altitude information.

[0088] In the related solutions, the altitude indicated by the altitude information obtained in real time is directly determined as the altitude of the electronic device. However, in the solution of the present application, not only multiple altitude information is continuously obtained within the first time period, but also the detection results of multiple barometric sensors are continuously obtained within the first time period.

[0089] Among them, the altitude information can indicate the altitude of the current location.

[0090] The detection result of the barometric sensor is used to characterize the barometric pressure of the current location of the electronic device. The barometric pressure will change with the change of altitude. For example, when the longitude and latitude coordinates remain unchanged, when the altitude increases, the barometric pressure decreases; when the altitude decreases, the barometric pressure increases. Therefore, by using the detection results of the barometric sensor at different times, the altitude difference can be determined. The specific calculation method can refer to the above formula (2), and the following is an example.

[0091] At time T1, the altitude of the user is h1, the detection result of the corresponding barometric sensor at time T1 is P1, at time T2, the altitude of the user changes to h2, and the detection result of the corresponding barometric sensor at time T2 is P2. Then the altitude difference Δh can be determined by the following formula (3):

[0092]

[0093] Furthermore, the altitude h2 of the user at time T2 can be determined by the following formula (4):

[0094] h2 = Δh + h1 (4)

[0095] Combining formula (3) and formula (4), it can be found that if you want to improve the calculation accuracy of altitude h2, you need to improve the accuracy of altitude h1. That is, when the detection ability of the barometric sensor is fixed, it is necessary to obtain as accurate altitude h1 as possible, and then use h1 as the altitude reference value for subsequent calculation, so as to facilitate subsequent real-time altitude calculation. In summary, it is necessary to determine a relatively accurate altitude reference value.

[0096] Assume that the time period for the electronic device to initiate altitude detection covers time t1 - time t2.

[0097] In related solutions, the moment when a GNSS request is initiated is taken as the moment when the electronic device initiates altitude detection. That is, the electronic device initiates a GNSS request at time t1. Assuming that the user does not move during the period from time t1 to time t2, the altitude information carried in the GNSS data is finally used as the altitude at time t1. Since only a set of data at time t1 is obtained, the altitude error is relatively large. And assuming that the user moves during the period from time t1 to time t2, since the displacement situation during the altitude detection time is not considered in the related solutions, it will also make the altitude determined with time t1 as the request time no longer applicable at time t2 itself.

[0098] To overcome the above problems, the solution of this application no longer directly determines the altitude based on the GNSS data at one moment, but continuously obtains multiple sets of GNSS data and the detection results of sensors within a second preset time to determine an altitude reference value, which is P1 in formula (3). The altitude reference value is used as the reference altitude for subsequent real-time altitude calculation, that is, this altitude reference value is used as the altitude at the end moment of the second preset time. The end moment of the second preset time can be considered as the T1 moment in the corresponding description of formula (3) above.

[0099] The solution of this application uses multiple sets of GNSS data to reduce accidental errors, and uses the detection results of multiple barometric pressure sensors to reflect the movement of the current user in the vertical direction within the second preset time. The altitude reference value determined jointly according to the altitude information and the detection results of the barometric pressure sensors within the second preset time is more accurate. Even if the user moves in the vertical direction during the detection process of the altitude reference value, since the movement in the vertical direction will cause changes in the detection results of the barometric pressure sensors, and the detection results of the barometric pressure sensors have been taken into account, a relatively accurate altitude reference value can still be obtained. Therefore, in the solution of this application, the user can move within the second preset time, and the obtained altitude reference value represents the altitude of the user's location at the end moment of the second preset time.

[0100] In the embodiment of this application, the length of the second preset time is also the determination time of the altitude reference value. To improve the accuracy of the altitude reference value, multiple sets of altitude information and the detection results of barometric pressure sensors need to be obtained. Therefore, the length of the second preset time cannot be set too short. However, considering the user experience, in order to shorten the user's waiting time, the length of the second preset time cannot be set too long. In some possible implementation manners, the second preset time can be set to 15 seconds.

[0101] S15: Determine the real-time altitude according to the detection result of the current barometric pressure sensor, the altitude reference value, and the pressure reference value.

[0102] As described in S14, the determined altitude reference value serves as the reference altitude for subsequent real-time altitude calculation. Thereafter, when the electronic device needs to perform real-time altitude calculation, the barometric pressure reference value and the detection result of the current barometric pressure sensor are substituted into Equation (3) to determine the altitude difference, and then the altitude reference value and the altitude difference are substituted into Equation (4) to determine the real-time altitude.

[0103] The following is an example for illustration.

[0104] At time T0, the altitude where the user is located is h0, and the user starts to determine the altitude reference value. The time taken to detect the altitude reference value covers the period from time T0 to time T1. The altitude reference value obtained at time T1 is the altitude at time T1, which is also h1, and the detection result of the barometric pressure sensor corresponding to time T1 is P1.

[0105] At time T2, the altitude where the user is located changes to h2, and the detection result of the barometric pressure sensor corresponding to time T2 is P2. Then h2 can be determined by the above Equations (3) and (4).

[0106] This altitude reference value can be saved locally on the mobile phone for use when determining the altitude again later.

[0107] For example, the detection result of the barometric pressure sensor corresponding to time T3 is P3. Then the altitude difference Δh3 between time T3 and time T1 satisfies the following Equation (5):

[0108]

[0109] Furthermore, the altitude h3 where the user is located at time T3 is determined by the following Equation (6):

[0110] H3 = Δh3 + h1 (6)

[0111] In a possible implementation, an effective time length can be set for the determined altitude reference value. This effective time length can be a first preset time or set to other time lengths. After the effective time length ends, the altitude reference value and the barometric pressure reference value are determined again according to the altitude information obtained within a second preset time and the detection result of the barometric pressure sensor within the second preset time.

[0112] After determining the real-time altitude, the real-time altitude can be displayed on the user interface of the electronic device, and the longitude and latitude coordinates of the current location can also be displayed simultaneously. For the specific user interface, please refer to Figure 4 as shown.

[0113] The following specifically describes the implementation manner of determining the altitude reference value.

[0114] Refer to Figure 5, This figure is a flowchart of another method for determining altitude provided by an embodiment of this application.

[0115] This method includes the following steps:

[0116] S21: The electronic device establishes satellite communication.

[0117] When the electronic device is currently in an area without mobile network coverage, the user can enable the satellite communication function of the electronic device. The electronic device first connects to the satellite to establish satellite communication. During this process, the user interface of the electronic device can refer to Figure 3 .

[0118] After the satellite communication is established, the user interface of the electronic device switches to Figure 4 .

[0119] S22: Determine that the sea-level air pressure value has not been obtained within the first preset time before the satellite communication is established.

[0120] The first preset time is used as the aging judgment standard for the local sea-level air pressure value.

[0121] S23: Obtain the first set of original data within the second preset time.

[0122] The length of the second preset time is also the time used to determine the altitude reference value, and this altitude reference value can also be used as the altitude of the location where the electronic device is located at the end of the second preset time.

[0123] Each set of original data includes altitude information and the detection result of the pressure sensor when the altitude information is obtained.

[0124] After establishing satellite communication, continuously request positioning within the second preset time, and then continuously obtain multiple GNSS data, and obtain multiple altitude information from the multiple GNSS data.

[0125] In order to improve the correspondence between the altitude information and the detection result of the pressure sensor, the time to obtain the detection result of the pressure sensor in each set of original data is the time when the GNSS data is received. For the convenience of explanation, the following takes the second preset time as 15 seconds as an example for explanation.

[0126] After the electronic device establishes satellite communication, it requests continuous positioning within 15 seconds. Assuming that 15 GNSS data are obtained, that is, 15 altitude information are obtained. At this time, the first quantity is 15. The times to obtain the 15 GNSS data are t1, t2,..., t15 in sequence. Then the electronic device obtains the detection results of the pressure sensor at these 15 moments of t1, t2,..., t15.

[0127] The altitude information obtained at time t1 and the detection results of the barometric pressure sensor form the first set of original data. The altitude information obtained at time t2 and the detection results of the barometric pressure sensor form the second set of original data. And so on, 15 sets of original data are formed.

[0128] S24: Filter the altitude information in each set of original data, and retain the altitude information with an error less than a preset threshold to obtain a second set of detection data.

[0129] In practical applications, the altitude information obtained through satellite communication may itself have a large error. Therefore, it is necessary to filter the altitude information in each set of original data obtained to remove the altitude information with a large error and improve the accuracy of the determined altitude reference value.

[0130] In a possible implementation, the electronic device calculates the average value of the obtained first quantity of altitude information, and then takes the absolute value of the difference between each altitude information and the average value as the error, and removes the altitude information with an error greater than or equal to the preset threshold, only retaining the altitude information with an error less than the preset threshold as available data. Considering that the displacement distance of the user within the second preset time is not too long, if the error corresponding to the altitude information is large, it indicates that there may be an obvious deviation in this item of data.

[0131] Based on the above example, by filtering the altitude information, assuming that the altitude information of 14 sets of the obtained 15 sets of original data is retained, the final second quantity is 14.

[0132] The second quantity can be less than or equal to the first quantity. If the errors of all altitude information are less than the preset threshold, then the second quantity is equal to the first quantity at this time, that is, all the altitude information of the first quantity is retained.

[0133] S25: Perform first-order Kalman filtering on the second set of detection data to obtain a second quantity of altitude calculation values.

[0134] In the solution of this application, the Kalman filter is used to obtain the altitude reference value. This is because the Kalman filter is a recursive estimation, that is, as long as the estimated value of the previous state and the observed value of the current state are known, the estimated value of the current state can be calculated. Therefore, it is not necessary to record the historical information of the observation or estimation, that is, it is not necessary to obtain valid altitude information.

[0135] For the state estimation algorithm, generally three values of the state quantity can be obtained: the state prediction value The optimal estimated value And the true value (x k),The Kalman filter uses the Kalman gain to correct the state prediction value to approximate the true value.

[0136] Among them, the state prediction value , which is also the altitude estimated this time, can be determined by the state prediction equation (7):

[0137]

[0138] Among them is the altitude estimated this time, that is, the state vector at time t; u k-1 is the altitude difference determined by using the barometric pressure detection results of the previous group of data and the barometric pressure detection results of the current group of data. A is the state transition matrix, or the state transition equation, used to convert the state at time t - 1 to the state at time t. B is the control input matrix, or the control input equation, used to map the effect of the altitude difference to the state vector.

[0139] is the altitude fused by the previous Kalman filter.

[0140] Among them, time t is the acquisition time of the i-th group of data in the second quantity group of detection data, and time t - 1 is the acquisition time of the (i - 1)-th group of data. Taking the second quantity as 15 as an example, then i = 2, 3,..., 15.

[0141] The optimal state estimate value can be determined by the state update equation (8):

[0142]

[0143] K in formula (8) k is the Kalman gain, which characterizes the ratio of the model prediction error to the measurement error in the optimal state estimation process. z k is the altitude indicated by the altitude information carried in the GNSS data, that is, the measured value. H is the state observation matrix, used to map the state quantity to the measured value, indicating the relationship connecting the state and the observation.

[0144] K k is in the interval of [0, 1]. When K k is 0, the prediction error is 0, and the state value of the system depends entirely on the predicted value. When K k is 1, the state value of the system depends entirely on the measured value.

[0145] The estimation principle of the Kalman filter is to make the covariance P of the state estimation kis minimized so that it increasingly approaches the true value. The Kalman gain matrix K under the optimal estimation condition k satisfies the following formula (10):

[0146]

[0147] R is the covariance of the measurement noise.

[0148] The state estimation covariance P k satisfies the following formula:

[0149]

[0150] The state estimation covariance P in formula (10) k is the covariance between the true value and the optimal estimated value, representing the covariance between the true value and the predicted value. can be determined by the following formula:

[0151]

[0152] Q is the covariance of the process noise.

[0153] The above formulas (7) and (11) are the formulas for updating the altitude in the time series. Formulas (8), (9), and (10) are the updates of the Kalman filter on the actual measurement series.

[0154] By substituting the detection data of the second quantity group into the above formulas in sequence for Kalman filtering, an altitude calculation value can be obtained for each fusion, that is, the second quantity of altitude calculation values can be obtained.

[0155] The second quantity is n, and n is a positive integer. Here, taking n as 15 as an example to illustrate the fusion result of a group of second preset times. The specific data can be seen in Table 1 below.

[0156] Table 1: Data table within the second preset time

[0157]

[0158] In the data of Table 1, the second preset time is 15 seconds. After the 15 groups of original data obtained meet the error requirements, they are used as test data. From the true value of the altitude, it can be determined that within the 15 - second altitude reference value detection time, the user is not stationary but has movement in the vertical direction, and the altitude where the user is located shows a gradually rising trend. By comparing the true value of the altitude with the indicated altitude of the altitude information, it can be found that there is an average error of more than 2 meters between the two.

[0159] By comparing the true altitude value with the fused altitude obtained by Kalman filtering, it can be found that as the number of iterations of Kalman filtering increases, the error between the true altitude value and the Kalman filtering fused altitude gradually decreases, and the error between the true altitude value and the Kalman filtering fused altitude is less than the error between the true altitude value and the altitude indicated by the altitude information. Therefore, in the solution of this application, the accuracy of the obtained altitude reference value can be improved through Kalman filtering. It can be understood that the Kalman filtering fused altitude determined according to the 15th group of data is used as the altitude at the end moment of the second preset time, that is, the altitude reference value.

[0160] S26: Determine the altitude reference value and the barometric pressure reference value.

[0161] The Kalman filtering fused altitude in Table 1 is also the altitude calculation value. There are 15 altitude calculation values in Table 1, that is, n is equal to 15.

[0162] After obtaining the second quantity of altitude calculation values, error verification is also required to determine whether the accuracy of each altitude calculation value meets the requirements.

[0163] Since the solution of this application allows the user to move the electronic device within the second preset time, that is, the determined second quantity of altitude calculation values can be different itself, directly performing error verification on the second quantity of altitude calculation values cannot reflect the true error situation. The solution of this application uses the detection result of the barometric pressure sensor to obtain the height difference between the last altitude calculation value and the i-th altitude calculation value, where i = 1, 2,..., n - 1.

[0164] Sum the i-th altitude calculation value and the height difference corresponding to the i-th altitude calculation value to obtain the i-th altitude equivalent value.

[0165] At this time, a total of n - 1 altitude equivalent values can be obtained. The n - 1 altitude equivalent values and the last altitude calculation value together form n altitude data. When the standard deviation of the n altitude data formed by the n - 1 altitude equivalent values and the n-th altitude calculation value is less than the preset standard deviation threshold, it is considered that the accuracy of each altitude calculation value obtained by Kalman filtering meets the requirements. The following is an explanation in combination with the data in Table 1.

[0166] When n is 15, the detection result of the barometric pressure sensor corresponding to the first altitude calculation value is P1 = 942.115 kPa, and the detection result of the barometric pressure sensor corresponding to the 15th altitude calculation value is P1 = 941.44995 kPa. The height difference determined according to Equation (5) is 5.9566151 m. Add the first altitude calculation value 706.1067663 to this height difference according to Equation (6) to obtain the first altitude equivalent value of 712.0633814 m.

[0167] And so on. The calculation data can be seen in Table 2 below.

[0168] Table 2: Error verification data table of altitude calculation values

[0169] Serial number Height difference from the nth altitude calculation value (unit: meter) Equivalent altitude value (unit: meter) 1 5.9566151 712.0633814 2 5.6204266 711.612589 3 4.7810046 710.5369849 4 4.3780467 710.4282764 5 4.8033904 711.5661409 6 4.4004339 711.805304 7 3.4380808 711.5142453 8 2.9231781 711.2368624 9 2.7104530 711.0483679 10 2.1954078 710.6723262 11 1.1987116 710.3012866 12 0.9188303 710.2025676 13 0.9098710 710.7675838 14 0.5488037 711.0603777 15 0 710.8243036

[0170] After obtaining 14 altitude equivalent values, the 14 altitude equivalent values respectively represent the equivalent altitude values at the end of the second preset time after the corresponding altitude calculation values are converted according to the air pressure values. At this time, the 14 altitude equivalent values and the last altitude calculation value form 15 altitude data, and the mean square error σ of the 15 altitude data in Table 2 is calculated:

[0171]

[0172] The height h in formula (12) 平均 is the average value of the 15 data in the third column of Table 2, specifically 711.0427065. The calculated result of σ after substituting the final data is 0.575193193.

[0173] In the embodiments of the present application, the preset standard deviation threshold is not specifically limited. In practical applications, in order to improve the accuracy of the determined altitude reference value, the preset standard deviation threshold should be set to a smaller number, such as 3, 2, or 1, etc. Taking the preset standard deviation threshold as 3 as an example, at this time, the calculated result of σ is less than 3, indicating that the accuracy of the determined altitude calculation values meets the requirements.

[0174] At this time, the last altitude calculation value obtained after fusion is used as the altitude reference value. That is, the nth altitude calculation value is used as the altitude reference value, and the altitude reference value can also be used as the altitude of the electronic device at the end of the second preset time.

[0175] The electronic device determines the detection result of the last barometric pressure sensor within the second preset time as the barometric pressure reference value, that is, as the barometric pressure reference value at the end of the second preset time.

[0176] It can be understood that in S26, taking the equivalent conversion of each altitude calculation value to the nth altitude calculation value as an example for illustration. In practical applications, each altitude calculation value can also be equivalently converted to the first altitude calculation value or the intermediate altitude calculation value. The specific principle is similar, and the embodiments of the present application will not elaborate here.

[0177] S27: Determine the real-time altitude change amount according to the detection result of the barometric pressure sensor and the barometric pressure reference value.

[0178] Assume that the altitude of the user at time T1 is h1, the detection result of the barometric pressure sensor corresponding to time T1 is P1, the altitude of the user changes to h2 at time T2, and the detection result of the barometric pressure sensor corresponding to time T2 is P2. Then, the real-time altitude change amount Δh can be determined by the above formula (3). Among them, the altitude of the user at time T1 can be the altitude reference value, and the detection result of the barometric pressure sensor corresponding to time T1 can be the barometric pressure reference value.

[0179] S28: Use the sum of the real-time altitude change and the altitude reference value as the real-time altitude.

[0180] That is, the altitude h2 of the user at time T2 = Δh + h1.

[0181] S29: Display the real-time altitude on the user interface of the electronic device.

[0182] For the display interface of the real-time altitude, please refer to Figure 4 As shown, the real-time altitude can be displayed together with the longitude and latitude coordinates of the current position of the electronic device.

[0183] S30: In response to a selection operation, start the SMS application.

[0184] Some applications on the electronic device can cooperate with satellite communication to implement their functions. For example Figure 4 As shown, the call application 42 can make satellite calls, and the SMS application 41 can send satellite SMS.

[0185] Taking the use of the SMS application to send satellite SMS as an example for illustration.

[0186] Refer to Figure 6 , this figure is a schematic diagram of the user interface of the electronic device provided by the embodiment of the present application Figure 3 .

[0187] After the user clicks and selects to start the SMS application 41 on the Figure 4 interface shown, the user interface of the electronic device switches to the interface shown in 6-(a). The user can enter the message content in the "Satellite Message" option bar of this interface.

[0188] S31: In response to a location information addition operation, add the real-time altitude to the SMS.

[0189] The user can select "Carry Location and Altitude" in the satellite message on the interface shown in 6-(a). At this time, the user interface can be referred to as shown in 6-(b), realizing the addition of the real-time altitude to the SMS.

[0190] The above steps of the embodiments of the present application are only for convenience of description and do not constitute a limitation to the technical solution of the present application. In practical applications, after the second number of altitude calculation values are obtained in S25, when the standard deviation between the n-1 altitude equivalent values obtained and the nth altitude calculation value is greater than or equal to the preset standard deviation, the last altitude calculation value obtained within the second preset time is determined as the altitude at the end moment of the second preset time, and this altitude can be displayed on the user interface of the electronic device. However, this altitude cannot be used as the altitude reference value for subsequent real-time altitude calculation because the error of this altitude reference value calculation is relatively large. If this altitude reference value is applied to subsequent real-time altitude calculation, it may cause relatively large errors in the subsequent real-time altitude calculation results.

[0191] When a subsequent request for obtaining the altitude is made again, it is necessary to determine the altitude reference value and the air pressure reference value again according to the altitude information obtained within the second preset time and the detection results of the air pressure sensor within the second preset time, that is, to execute S23-S26 again.

[0192] In another possible implementation, when the electronic device ends the satellite call and resumes connecting to the mobile network, the electronic device can initiate an update of the sea level air pressure value.

[0193] In summary, by using the solution provided by the embodiments of the present application, the accuracy of the determined altitude is improved, and even if the user moves vertically during the detection process of the altitude reference value, a relatively accurate altitude reference value can still be obtained without requiring the user to stay stationary. Therefore, it has high practicability and improves the user experience.

[0194] Based on the altitude determination method provided by the above embodiments, the embodiments of the present application further provide an electronic device, which will be specifically described below with reference to the drawings.

[0195] See Figure 7 , this figure is a schematic diagram of an electronic device provided by an embodiment of the present application.

[0196] This electronic device supports satellite communication functions. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0197] The sensor module 180 may include a barometric pressure sensor 180A, and the barometric pressure sensor 180A is used to measure barometric pressure. The electronic device 100 implements the altitude method in the above embodiments of the present application through the barometric pressure value measured by the barometric pressure sensor 180A.

[0198] It can be understood that the structure schematically shown in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or have different component arrangements. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0199] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. A memory may also be provided in the processor 110 for storing instructions and data.

[0200] The wireless communication function of the electronic device 100 may be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc. The mobile communication module 150 may provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc. applied to the electronic device 100.

[0201] The wireless communication module 160 may provide solutions for wireless communications applied to the electronic device 100, including wireless local area networks (WLANs) (such as Wi-Fi networks), Bluetooth (BT), global navigation satellite systems (GNSSs), frequency modulation (FM), near field communication (NFC), infrared technology (IR), and the like.

[0202] The internal memory 121 may be used to store computer-executable program code, and the executable program code includes instructions. When the processor runs the program code stored in the internal memory 121, the method for determining the altitude described in the above embodiments is implemented.

[0203] In summary, by using the electronic device provided in the embodiments of the present application, when an effective sea-level air pressure value can be obtained, that is, when satellite communication is established without a mobile network connection for a short time, the real-time altitude can be quickly determined according to the sea-level air pressure value obtained within the first preset time before the establishment of satellite communication and the detection result of the current air pressure sensor. When the electronic device fails to obtain the sea-level air pressure value within the first preset time before the establishment of satellite communication, the altitude information in the GNSS data obtained within the second preset time and the detection result of the air pressure sensor within the second preset time can be subjected to Kalman filtering, thereby determining accurate altitude reference values and air pressure reference values, improving the accuracy of the determined altitude, and even if the user moves in the vertical direction during the detection of the altitude reference value, a relatively accurate altitude reference value can still be obtained without requiring the user to remain stationary. Therefore, it has high practicability and improves the user experience.

[0204] Based on the method for determining the altitude provided in the above embodiments, the embodiments of the present application further provide a storage medium, on which a program is stored, and when the program is executed by an electronic device, the method for determining the altitude provided in the above embodiments is implemented.

[0205] A storage medium includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically-erasable programmable read-only memory (EEPROM), flash memory, or other memory technologies.

[0206] It should be understood that in this application, "at least one (item)" means one or more, and "a plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: only A exists, only B exists, and both A and B exist at the same time. Among them, A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one (item) of the following" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0207] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for determining altitude, characterized in that The electronic device supports satellite communication functions. The electronic device includes a barometric pressure sensor. The method includes: The electronic device establishes satellite communication. When the sea-level barometric pressure value is obtained within a first preset time before the electronic device establishes satellite communication, determine the real-time altitude according to the sea-level barometric pressure value and the detection result of the barometric pressure sensor at present. When the sea-level barometric pressure value is not obtained within a first preset time before the electronic device establishes satellite communication, determine the altitude reference value and the barometric pressure reference value according to the altitude information in the Global Navigation Satellite System (GNSS) data continuously obtained within a second preset time and the detection result of the barometric pressure sensor within the second preset time. The barometric pressure reference value is the barometric pressure of the electronic device at the end of the second preset time; the altitude reference value is used as the altitude of the electronic device at the end of the second preset time. Determine the real-time altitude according to the detection result of the barometric pressure sensor at present, the altitude reference value, and the barometric pressure reference value.

2. The method according to claim 1, characterized in that The determining the altitude reference value and the barometric pressure reference value according to the altitude information in the Global Navigation Satellite System (GNSS) data obtained within a second preset time and the detection result of the barometric pressure sensor within the second preset time includes: Obtain a first number of groups of original data within the second preset time. Each group of the original data includes the altitude information and the detection result of the barometric pressure sensor when the altitude information is obtained. Filter the altitude information in each group of the original data, and retain the altitude information with an error less than a preset threshold to obtain a second number of groups of detection data. Perform first-order Kalman filtering on the second number of groups of detection data to determine the altitude reference value and the barometric pressure reference value.

3. The method according to claim 2, wherein The performing first-order Kalman filtering on the second number of groups of detection data to determine the altitude reference value and the barometric pressure reference value specifically includes: Perform first-order Kalman filtering on the second number of groups of detection data in sequence, and obtain a second number of altitude calculation values in sequence. The second number is n, and n is a positive integer. Determine the height difference between the nth altitude calculation value and the ith altitude calculation value according to the detection result of the barometric pressure sensor corresponding to the ith altitude calculation value and the detection result of the barometric pressure sensor corresponding to the nth altitude calculation value, where i = 1, 2, …, n - 1. Sum the ith altitude calculation value and the height difference corresponding to the ith altitude calculation value to obtain the ith altitude equivalent value; when the standard deviation between the n - 1 altitude equivalent values obtained and the nth altitude calculation value is less than a preset standard deviation threshold, determine the last altitude calculation value obtained within the second preset time as the altitude reference value, and determine the last detection result of the barometric pressure sensor obtained within the second preset time as the barometric pressure reference value.

4. The method according to any one of claims 1 to 3, characterized in that The determining the real-time altitude according to the detection result of the barometric pressure sensor at present, the altitude reference value, and the barometric pressure reference value specifically includes: Determine the real-time altitude change amount according to the detection result of the barometric pressure sensor and the barometric pressure reference value; Use the sum of the real-time altitude change and the altitude reference value as the real-time altitude.

5. The method according to claim 4, wherein After determining the real-time altitude, the method further includes: Display the real-time altitude on the user interface of the electronic device.

6. The method according to claim 5, wherein The method further includes: In response to a selection operation, start a text message application program, which is used to send text messages through satellite communication; In response to a location information addition operation, add the real-time altitude to the text message.

7. The method according to claim 3, characterized in that, When the standard deviation between the n-1 altitude equivalent values obtained and the nth altitude calculation value is greater than or equal to a preset standard deviation, the method further includes: Determine the altitude at the end moment of the second preset time as the last altitude calculation value obtained within the second preset time; When the user requests to obtain the altitude again, determine the altitude reference value and the barometric pressure reference value according to the altitude information obtained within the second preset time and the detection result of the barometric pressure sensor within the second preset time.

8. The method according to claim 1, wherein The method further includes: When the electronic device is connected to a mobile network, update the sea-level barometric pressure value.

9. An electronic device, characterized in that, The electronic device includes a barometric pressure sensor, a memory, and a processor. The memory is used to store programs. When the processor runs the programs, it implements the method for determining the altitude according to any one of claims 1-8. The barometric pressure sensor is used to measure the barometric pressure at the current location.

10. A storage medium, characterized in that, A program is stored on the storage medium. When the program is executed by an electronic device, it implements the method for determining the altitude according to any one of claims 1-8.

Citation Information

Patent Citations

  • Barometric altimetry assisted floor positioning method and device and storage medium

    CN113624204A

  • Method for calculating altitude according to combination of GPS height and air pressure

    CN114322930A

  • Apparatus and methods for height determination

    US20120290253A1

  • Method and apparatus for measuring altitude in portable terminal

    US20130325385A1

  • Opportunistic calibration of a barometer in a mobile device

    US20160245716A1