A method for determining an altitude, an electronic device, and a storage medium

By acquiring sea level air pressure values ​​before satellite communication or combining GNSS data and air pressure sensor detection results, and optimizing altitude calculation using Kalman filtering, the problem of large altitude errors in satellite communication is solved, enabling high-precision altitude measurement during movement and improving user experience.

CN120333391BActive Publication Date: 2026-04-10HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HONOR DEVICE CO LTD
Filing Date
2024-01-10
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

In areas where base stations cannot be deployed, the altitude obtained by electronic devices through satellite communication has significant errors and fluctuations, and users need to remain stationary to obtain accurate altitude, which affects the user experience.

Method used

By obtaining sea level air pressure values ​​before satellite communication or combining GNSS data and barometric pressure sensor detection results, altitude and air pressure reference values ​​are determined. Kalman filtering is used to optimize altitude calculation, allowing users to obtain accurate altitude during movement.

Benefits of technology

It improves the accuracy of altitude measurement and user experience, reduces waiting time, and maintains the accuracy of altitude detection during movement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120333391B_ABST
    Figure CN120333391B_ABST
Patent Text Reader

Abstract

A method for determining an altitude, an electronic device and a storage medium, relate to the technical field of terminals. The method comprises: when a sea level atmospheric pressure value is acquired within a first preset time before establishing satellite communication, determining a real-time altitude according to the sea level atmospheric pressure value and a detection result of a current atmospheric pressure sensor; when the sea level atmospheric pressure value is not acquired within the first preset time before the electronic device establishes satellite communication, determining an altitude reference value and an atmospheric pressure reference value according to altitude information in GNSS data acquired within a second preset time and a detection result of the atmospheric pressure sensor within the second preset time, the atmospheric pressure reference value being an atmospheric pressure of the electronic device at an end moment of the second preset time; taking the altitude reference value as an altitude of the electronic device at the end moment of the second preset time; and determining the real-time altitude according to the detection result of the current atmospheric pressure sensor, the altitude reference value and the atmospheric pressure reference value. The scheme improves the accuracy of the determined altitude.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of terminal, and particularly relates to a method for determining an altitude, an electronic device and a storage medium. BACKGROUND

[0002] At present, when a user is performing outdoor work or outdoor sports, the user may have a demand for obtaining a current altitude through an electronic device, for example, the user needs to send the current altitude of the user to the outside through the electronic device, or the user needs to record the altitude of a target place, or the user needs to generate a 3D motion track.

[0003] When the user is in a place such as the sea, the desert or the air where a base station cannot be deployed, a traditional ground network cannot provide signal coverage, at this time, the electronic device cannot obtain atmospheric pressure information of a sea level through a network to determine an altitude, and can only obtain global navigation satellite system (GNSS) position information through satellite communication, and takes 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 a large error and fluctuation, and the altitudes obtained by multiple measurements at the same position may be more than ten meters apart or even larger, and when the user moves during the altitude measurement, the error of the detected altitude may be larger. SUMMARY

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

[0006] In a first aspect, the present application provides a method for determining an altitude, applied to an electronic device, the electronic device supporting a satellite communication function, and the electronic device comprising an atmospheric pressure sensor. The method comprises: establishing satellite communication by the electronic device; when a sea level atmospheric pressure value is obtained within a first preset time before the satellite communication is established by the electronic device, determining a real-time altitude according to the sea level atmospheric pressure value and a detection result of a current atmospheric pressure sensor; when the sea level atmospheric pressure value is not obtained within the first preset time before the satellite communication is established by the electronic device, determining a sea level altitude reference value and an atmospheric pressure reference value according to altitude information in global navigation satellite system (GNSS) data obtained continuously within a second preset time and a detection result of the atmospheric pressure sensor within the second preset time, the atmospheric pressure reference value being an atmospheric pressure of the electronic device at an end time of the second preset time, and the sea level altitude reference value being an altitude of the electronic device at the end time of the second preset time; and determining the real-time altitude according to the detection result of the current atmospheric pressure sensor, the sea level altitude reference value and the atmospheric pressure reference value.

[0007] The scheme provided in the application can quickly determine the real-time altitude according to the sea level pressure value obtained within the first preset time before the satellite communication is established and the detection result of the current pressure sensor when the effective sea level pressure value can be obtained, that is, when the satellite communication is established in a short time without mobile network connection, thereby shortening the waiting time of the user.

[0008] When the sea level pressure value is not obtained within the first preset time before the satellite communication is established, the accurate altitude reference value and the pressure reference value can be determined by combining the altitude information in the GNSS data and the detection result of the pressure sensor.

[0009] 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 height for subsequent calculation of the real-time altitude.

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

[0011] The scheme uses multiple sets of GNSS data to reduce accidental errors, and uses the detection results of multiple sets of pressure sensors to reflect the movement of the current user in the vertical direction within the second preset time. The altitude reference value determined according to the altitude information within the second preset time and the detection result of the pressure sensor is more accurate, even if the user moves in the vertical direction during the detection of the altitude reference value. Since the movement in the vertical direction will cause changes in the detection result of the pressure sensor, and the detection result of the pressure sensor has been taken into account, a more accurate altitude reference value can still be obtained. Therefore, in the scheme, the user can move within the second preset time, and the altitude reference value obtained represents the altitude of the position of the user at the end of the second preset time. Since the scheme does not require the user to remain stationary, it has high practicality and improves the user experience.

[0012] In a possible implementation, the altitude reference value and the pressure reference value are determined 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 pressure sensor within the second preset time, and the method comprises the following steps:

[0013] A first number of sets of original data are obtained within the second preset time, and each set of original data comprises altitude information and a detection result of the pressure sensor when the altitude information is obtained;

[0014] The altitude information in each set of original data is filtered, and the altitude information with an error less than a preset threshold is retained to obtain a second number of sets of detection data;

[0015] The second number of groups of detection data are subjected to first-order Kalman filtering to determine the altitude reference value and the air pressure reference value.

[0016] The altitude reference value is obtained by using Kalman filtering, which improves the accuracy of the altitude reference value.

[0017] In a possible implementation, the second number of groups of detection data are subjected to first-order Kalman filtering to determine the altitude reference value and the air pressure reference value, and specifically includes:

[0018] The second number of groups of detection data are subjected to first-order Kalman filtering in sequence to obtain the second number of altitude calculation values in sequence, and the second number is n, and n is a positive integer.

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

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

[0021] In a possible implementation, the real-time altitude is determined according to the detection result of the current air pressure sensor, the altitude reference value, and the air pressure reference value, and specifically includes: determining a real-time altitude change according to the detection result of the air pressure sensor and the air pressure reference value; and 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 the real-time altitude is determined, the method further includes:

[0023] The real-time altitude is displayed on the user interface of the electronic device.

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

[0025] In response to the selection operation, the short message application is started, and the short message application is used to send a short message through satellite communication;

[0026] In response to the position information adding operation, the real-time altitude is added to the short message.

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

[0028] determining the last altitude calculation value obtained in the second preset time as the altitude at the end time of the second preset time;

[0029] When the user requests to obtain the altitude again, the altitude reference value and the pressure reference value are determined according to the altitude information obtained in the second preset time and the detection result of the pressure sensor in the second preset time.

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

[0031] When the electronic device is connected to a mobile network, the sea level pressure value is updated.

[0032] In a second aspect, the present application also provides an electronic device, which includes a pressure sensor, a memory and a processor. The pressure sensor is used to measure the pressure of the current location. The memory is used to store a program, and the processor implements the method for determining the altitude provided in the above first aspect and any one of the implementation manners of the first aspect when running the program. The electronic device of the present implementation supports satellite communication function.

[0033] In a third aspect, the present application also provides a storage medium having a computer program stored thereon, and the computer program is executed by the processor of an electronic device to implement the method for determining the altitude provided in the above first aspect and any one of the implementation manners of the first aspect. BRIEF DESCRIPTION OF DRAWINGS

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

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

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

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

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

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

[0040] Figure 7 Schematic diagram of an electronic device provided by an embodiment of the present application DETAILED DESCRIPTION

[0041] The terms "first", "second", and "third" and the like in the description and in the claims of the present application and the drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the terms so used are interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of practical implementation irrespective of the particular sequence or chronological order of the steps involved.

[0042] In the embodiments of the present application, the word "exemplary" or "for example" is used to mean serving as an example, instance, or illustration. Any implementation or design scheme described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being preferred or advantageous over other implementations or design schemes. Rather, the word "exemplary" or "for example" is used to present concepts in a particular manner.

[0043] In order to make the person skilled in the art more clearly understand the scheme of the present application, the application scenario of the technical scheme of the present application is first described below.

[0044] Referring to Figure 1 , the figure is a schematic diagram of a non-terrestrial network (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 (also referred to as a satellite base station) 100, a ground station (also 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 embodiments provided in the present application, the terminal device 400 can be various forms, for example, a mobile phone, a tablet computer, 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 treatment, 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 the like. The terminal can 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 station, 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 apparatus, and the like. The terminal can also be a fixed terminal or a mobile terminal.

[0047] The terminal device and the terminal device shown in the embodiments of the present application can also communicate through device to device (D2D), machine to machine (M2M), and the like.

[0048] The satellite 100 in the embodiments of the present application can provide wireless access services for the terminal device 400, schedule wireless resources to the accessed terminal device 400, and provide reliable wireless transmission protocols and data encryption protocols, and the like. The satellite 100 can be a man-made satellite and a high-altitude aircraft, etc. as a base station for wireless communication, such as an evolutional NodeB (eNB) and a next generation node B (gNB), and the like. Alternatively, the satellite can also be a relay of the base station, and transparently transmit the wireless signals of the base station to the terminal device. At this time, the ground station can be regarded as a base station for wireless communication.

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

[0050] For example, when the satellite 100 works in the transmissive mode, the satellite 100 has the function of relaying and forwarding. The ground station 300 has the function of a base station or part of the function of a base station, and the ground station 300 can be regarded as a base station at this time. Alternatively, the base station 200 can be deployed separately from the ground station 300. For ease of description, the transmissive mode shown below is taken as an example in which the ground station 300 and the base station 200 are together or close to each other. Figure 1 The ground station 300 and the base station 200 are taken as an example of separate deployment, and should not be understood as a limitation of the embodiments of the present application. When the satellite 100 works in the regenerative mode, the satellite 100 has data processing capability, the function of a base station or part of the function of a base station, and the satellite 100 can be regarded as a base station at this time.

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

[0052] As a supplement to the current ground cellular communication system, the satellite communication has at least the following advantages.

[0053] Extended coverage: For areas that cannot be covered by the current cellular communication system or have high coverage costs, such as oceans, deserts, remote mountainous areas, and the like, satellite communication can be used to solve the communication problem.

[0054] Emergency communication: In the case of an extreme situation such as an earthquake that causes the infrastructure of the cellular communication to be unavailable, satellite communication can be used to quickly establish a communication connection.

[0055] Provide related industry applications: For example, for long-distance transmission of time-sensitive services, satellite communication can be used to reduce the transmission delay of the services.

[0056] Currently, in areas where cellular communication systems cannot cover, electronic devices can directly obtain the altitude through satellite communication functions. Specifically, the electronic device obtains GNSS position information through the satellite communication function, and the position information can carry the longitude and latitude coordinates, altitude and time information of the electronic device. However, the altitude obtained from the GNSS position information has a large error and fluctuation, and the altitude obtained by measuring the same position multiple times may differ by more than ten meters or even more. Moreover, obtaining GNSS position information through satellite communication function needs to consume a certain amount of time, for example, tens of seconds to generate dozens of seconds, and if the user has displacement in the vertical direction during this period of time, the error will further increase, so the current solution not only cannot meet the user's demand for obtaining high-precision altitude, but also requires the user to remain as still as possible when obtaining the altitude, which limits the user's action and thus reduces the user's experience.

[0057] To solve the above technical problems, the present application provides a method for determining altitude, an electronic device and a storage medium. When the electronic device is connected to a mobile network, the sea level atmospheric pressure value is obtained through the mobile network as the standard for atmospheric pressure calculation. When the sea level atmospheric pressure value is obtained through the mobile network within the first preset time before the satellite communication of the electronic device is established, the current altitude is determined according to the obtained sea level atmospheric pressure and the detection result of the atmospheric pressure sensor. When the sea level atmospheric pressure value is not obtained within the first preset time before the satellite communication of the electronic device is established, the altitude reference value and the atmospheric pressure reference value are determined according to the altitude information in the GNSS data obtained within the second preset time and the detection result of the atmospheric pressure sensor within the second preset time, and the real-time altitude is determined according to the detection result of the current atmospheric pressure sensor, the altitude reference value and the atmospheric pressure reference value. The present application can quickly determine the real-time altitude according to the sea level atmospheric pressure value and the detection result of the current atmospheric pressure sensor when the sea level atmospheric pressure value can be obtained through the network. When the sea level atmospheric pressure value is not obtained, the real-time altitude is determined by combining the altitude information in the GNSS data and the detection result of the atmospheric pressure sensor, which improves the accuracy of the altitude detection result, and even if the user moves in the vertical direction during the altitude detection process, the present application can still obtain a relatively accurate altitude detection result because the movement in the vertical direction will cause the change of the detection result of the pressure sensor.

[0058] The implementation mode of the present application will be specifically described below in conjunction with the drawings.

[0059] Referring to Figure 2 The figure is a flow chart of a method for determining altitude provided by an embodiment of the present application.

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

[0061] Referring toFigure 3 and Figure 4 . Wherein, Figure 3 Fig. 1 is a schematic diagram of a user interface of an electronic device provided by an embodiment of the present application Figure 1 ; Figure 4 Fig. 2 is a schematic diagram of a user interface of an electronic device provided by an embodiment of the present application Figure 2 .

[0062] The electronic device in the embodiment of the present application supports 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 refer to Figure 3 .

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

[0064] Among them, the latitude and longitude coordinates are used to indicate the longitude and latitude of the position where the electronic device is currently located. 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 the sea level air pressure value is obtained within the first preset time before the satellite communication is established.

[0066] If yes, perform S13, otherwise perform S14.

[0067] The sea level air pressure value is the weight of the air column from the sea level to the upper limit of the atmosphere per unit area. The sea level air pressure value can be used to calculate the altitude. 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, i.e. the real-time altitude, can be determined.

[0068] However, the sea level air pressure value has timeliness, and the sea level air pressure value will be affected by atmospheric temperature, atmospheric density and other conditions. If the sea level air pressure value is directly used for altitude calculation without change, the calculation result may have certain deviation, so the sea level air pressure value needs to be updated periodically or the latest sea level air pressure value is obtained when used.

[0069] When the electronic device is connected to the mobile network, the electronic device can acquire the local sea level pressure value in real time through the network or update the local sea level pressure value according to a certain update period. For example, the update period can be set to 1 hour, and after the electronic device is connected to the mobile network, it is determined whether the time from the last request for acquiring the local sea level pressure value is more than 1 hour. If it is more than 1 hour, the local sea level pressure value is requested to be acquired again, the acquired sea level pressure value is saved, and the request time is recorded. The sea level pressure value acquired this time is used as the reference pressure value for calculating the altitude.

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

[0071] When the electronic device is disconnected from the mobile network and establishes satellite communication, the electronic device can no longer acquire or update the local sea level pressure value through the network. The scheme of the present application sets a first preset time as a time limit judgment standard for the local sea level pressure value, determines whether the time length between the request time of the last request for acquiring the local sea level pressure value and the time when the electronic device establishes satellite communication is greater than the first preset time, and if it is greater than the first preset time, it indicates that the sea level pressure value is not acquired within the first preset time before the electronic device establishes satellite communication, and if it is less than the first preset time, it indicates that the sea level pressure value is acquired within the first preset time before the electronic device establishes satellite communication.

[0072] When the electronic device acquires the local sea level pressure value within the first preset time before establishing satellite communication, the scheme of the present application considers that the sea level pressure value still has timeliness and can be directly applied to calculate the real-time altitude. Otherwise, it is considered that the local sea level pressure value acquired is not available, or that the local sea level pressure value acquired has no timeliness.

[0073] The first preset time is not specifically limited in the embodiment of the present application, and it can be understood that since the first preset time is used as a time limit judgment standard for the local sea level 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 pressure value has higher 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 where the weather changes quickly or frequently, such as a mountainous area or the ocean, the first preset time can be set to be shorter, for example, 30 minutes; when located in an area where the weather is relatively stable, the first preset time can be set to be longer, for example, 2 hours.

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

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

[0077]

[0078] In formula (1), P0 and P are in kilopascal (kPa), and T is the current measured temperature in Celsius. In the above formula, T+273.15 is the conversion from Celsius to Kelvin temperature.

[0079] In actual application, since the local sea level pressure value is obtained, if the temperature is not considered, for example, the temperature is 15℃, then the above formula (1) can also be converted to the following formula (2):

[0080]

[0081] Formula (2) does not need to obtain 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-time no mobile network, the real-time altitude can be quickly determined by using the sea level pressure value, and the waiting time of the user is shortened.

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

[0084] At this time, there is no local sea level pressure value that can be directly applied, so the altitude reference value and the pressure reference value are determined by the altitude information obtained in the second preset time and the detection result of the pressure sensor.

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

[0086] The air pressure reference value is an air pressure value of the electronic device at the end of the second preset time, which has a similar effect as the sea level air pressure value and can be used as a reference air pressure for subsequent calculation of the real-time altitude.

[0087] At this time, the electronic device requests continuous positioning within the first preset time when performing satellite communication, and obtains a plurality of GNSS data, each of which has an altitude information.

[0088] In related solutions, the altitude indicated by the real-time obtained altitude information is directly determined as the altitude of the electronic device, while in the present solution, not only a plurality of altitude information is continuously obtained within the first time period, but also the detection results of the plurality of air pressure sensors are continuously obtained within the first time period.

[0089] The altitude information can indicate the altitude of the current position.

[0090] The detection result of the air pressure sensor is used to represent the air pressure of the position where the electronic device is currently located. The air pressure changes with the change of the altitude, for example, when the latitude and longitude coordinates remain unchanged, when the altitude rises, the air pressure decreases; when the altitude drops, the air pressure rises. Therefore, by using the detection results of the air pressure sensor at different times, the altitude difference can be determined, and the specific calculation method can be referred to the above formula (2), which is illustrated below.

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

[0092]

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

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

[0095] It can be found from formula (3) and formula (4) that if it is desired to improve the calculation accuracy of the altitude h2, the accuracy of the altitude h1 needs to be improved, that is, when the detection capability of the air pressure sensor is fixed, the accurate altitude h1 needs to be obtained as much as possible, and then h1 is used as the subsequent calculation of the altitude reference value, so as to facilitate the subsequent real-time altitude. In summary, a more accurate altitude reference value needs to be determined.

[0096] Suppose that the electronic device initiates the altitude detection within t1 time and t2 time.

[0097] In the related scheme, the time when the GNSS request is initiated is taken as the time when the electronic device initiates the altitude detection, that is, the electronic device initiates the GNSS request at time t1, it is assumed that the user does not move within time t1-t2, and finally the altitude at time t1 is determined according to the altitude information carried in the GNSS data. Since only one set of data at time t1 is obtained, the altitude error is large. It is assumed that the user moves within time t1-t2, and since the related scheme does not consider the displacement within the altitude detection time, the altitude determined at time t1 as the request time is no longer applicable at time t2.

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

[0099] The scheme of the present application utilizes multiple sets of GNSS data to reduce accidental errors, and utilizes multiple sets of detection results of the air pressure sensor to reflect the movement of the user in the vertical direction within the second preset time. The altitude reference value determined according to the altitude information within the second preset time and the detection results of the air pressure sensor is more accurate. Even if the user moves in the vertical direction during the detection of the altitude reference value, since the movement in the vertical direction will cause changes in the detection results of the air pressure sensor, and the detection results of the air pressure sensor have been considered, a more accurate altitude reference value can still be obtained. Therefore, in the scheme of the present application, the user can move within the second preset time, and the obtained altitude reference value represents the altitude of the position of the user at the end of the second preset time.

[0100] In the embodiment of the present application, the length of the second preset time, that is, the determination time of the altitude reference value, needs to obtain multiple sets of altitude information and detection results of the air pressure sensor in order to improve the accuracy of the altitude reference value. Therefore, the length of the second preset time cannot be set too short, but considering the user experience, in order to shorten the waiting time of the user, 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: determining the real-time altitude according to the detection result of the current air pressure sensor, the altitude reference value, and the air pressure reference value.

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

[0103] The following is an example.

[0104] At time T0, the user is at an altitude of h0, and the user starts to determine the altitude reference value. The time for detecting the altitude reference value covers time T0 to time T1, and the altitude reference value obtained at time T1 is the altitude at time T1, i.e., h1, and the detection result of the pressure sensor corresponding to time T1 is P1.

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

[0106] The altitude reference value can be saved locally on the mobile phone and applied when the altitude is determined again later.

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

[0108]

[0109] Then the altitude h3 of the user at time T3 is determined by formula (6) as follows:

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

[0111] In a possible implementation, the determined altitude reference value can be set with a valid time length, which can be a first preset time or other time length. When the valid time length ends, the altitude reference value and the pressure reference value are determined again according to the altitude information obtained within a second preset time and the detection result of the pressure sensor within the second preset time.

[0112] After the real-time altitude is determined, the real-time altitude can be displayed on the user interface of the electronic device, and the latitude and longitude coordinates of the current location can also be displayed simultaneously. For details of the specific user interface, refer to Figure 5 .

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

[0114] Refer to Figure 3FIG. 3 is a flowchart of another method for determining an altitude according to an embodiment of the present application.

[0115] The method comprises 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 a satellite to establish satellite communication, and during this process, the user interface of the electronic device can refer to FIG. 2. Figure 4 .

[0118] When the satellite communication is established, the user interface of the electronic device switches to Serial number .

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

[0120] The first preset time is a time limit for judging the local sea level pressure value.

[0121] S23: Obtain a first number of groups of original data within a second preset time.

[0122] The length of the second preset time is the time for determining the altitude reference value, which can also be used as the altitude of the location of the electronic device at the end of the second preset time.

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

[0124] After the satellite communication is established, continuous positioning is requested within the second preset time, and a plurality of GNSS data is continuously obtained, and a plurality of altitude information is obtained from the plurality of GNSS data.

[0125] In order to improve the correspondence between the altitude information and the detection result of the barometric pressure sensor, the time for obtaining the detection result of the barometric pressure sensor in each group of original data is the time when the GNSS data is received. For convenience of description, the second preset time is taken as 15 seconds as an example.

[0126] After the satellite communication is established, continuous positioning is requested within 15 seconds, and it is assumed that 15 GNSS data is obtained, i.e., 15 altitude information is obtained, and at this time, the first number is 15. The time for obtaining the 15 GNSS data is t1, t2, …, t15 in turn. Then, the electronic device obtains the detection result of the barometric pressure sensor at t1, t2, …, t15.

[0127] The altitude information obtained at the time t1 and the detection result of the air pressure sensor form a first set of original data. The altitude information obtained at the time t2 and the detection result of the air pressure sensor form a second set of original data. In this way, 15 sets of original data are formed.

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

[0129] In actual application, the altitude information obtained through satellite communication itself can have a large error, and thus the altitude information in each set of original data obtained needs to be filtered to remove the altitude information with a large error, so as to improve the accuracy of the determined altitude reference value.

[0130] In a possible implementation, the electronic device averages the first number of altitude information obtained, and then takes the absolute value of the difference between each altitude information and the average value as the error, removes the altitude information with an error greater than or equal to a preset threshold value, and only retains the altitude information with an error less than the preset threshold value as available data. It is considered that the displacement distance of the user within the second preset time is not too long, and thus if the error corresponding to the altitude information is large, it indicates that the data can have a significant deviation.

[0131] Based on the above example, by filtering the altitude information, it is assumed that the altitude information of 14 sets of original data among the 15 sets of original data obtained is retained, and thus the final second number is 14.

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

[0133] S25: First-order Kalman filtering is performed on the second number of sets of detection data to obtain a second number of altitude calculation values.

[0134] In the scheme of the present application, the Kalman filtering is used to obtain the altitude reference value, because the Kalman filtering is a recursive estimation, that is, as long as the estimated value of the state at the last time and the observation value of the current state are known, the estimated value of the current state can be calculated, and thus the history information of the observation or estimation does not need to be recorded, that is, the effective altitude information does not need to be obtained.

[0135] For a state estimation algorithm, three values of a state quantity can generally be obtained: a state prediction value an optimal estimation value and a true value (x k), Kalman filter is to use Kalman gain to correct the state prediction value, so that it approximates the true value.

[0136] wherein the state prediction value That is, the altitude of this estimation can be determined by the state prediction equation (7):

[0137]

[0138] wherein is the altitude of this estimation, that is, the state vector at time t; u k-1 is the altitude difference determined by the pressure detection result of the previous group of data and the pressure detection result of the current group of data. A is a state transition matrix, or called a state transition equation, for converting the state at time t-1 to the state at time t. B is a control input matrix, or called a control input equation, for mapping the effect of the altitude difference to the state vector.

[0139] is the altitude fused by the last Kalman filtering.

[0140] wherein the acquisition time of the i-th group of data of the second quantity of detection data at time t is the acquisition time of the i-1-th group of data at time t-1. Taking the second quantity of 15 as an example, i=2, 3, …, 15.

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

[0142]

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

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

[0145] The estimation principle of Kalman filter is to make the covariance P kThe minimum, so that it is more and more close to the true value. Kalman gain matrix K under the optimal estimation condition k Satisfies the following formula (10):

[0146]

[0147] R is the covariance of measurement noise.

[0148] State estimation covariance P k Satisfies the following formula:

[0149]

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

[0151]

[0152] Q is the covariance of process noise.

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

[0154] By substituting the second number group of detection data into the above formula in turn, one altitude calculation value can be obtained each time, that is, the second number of altitude calculation values can be obtained.

[0155] The second number is n, n is a positive integer, and the following takes n as 15 as an example to explain the fusion result of a group of second preset time. The specific data can be seen from the following table 1.

[0156] Table 1: Data table in second preset time

[0157]

[0158] The second preset time in table 1 is 15 seconds, and the 15 groups of original data obtained after meeting the error requirement are used as test data. It can be determined from the true value of altitude that the user is not stationary in the 15-second altitude reference value detection time, but moves in the vertical direction, and the altitude of the user shows a gradually rising trend. By comparing the true value of altitude with the altitude information indicating height, it can be found that there is an average error of more than 2 meters between them.

[0159] Compared with the real value of the altitude and the fused altitude obtained by the Kalman filtering, it can be found that with the increase of the iteration number of the Kalman filtering, the error between the real value of the altitude and the fused altitude obtained by the Kalman filtering is gradually reduced, and the error between the real value of the altitude and the fused altitude obtained by the Kalman filtering is smaller than the error between the real value of the altitude and the altitude information indicating height. Therefore, the accuracy of the obtained altitude reference value can be improved by the Kalman filtering in the scheme. It can be understood that the fused altitude obtained by the Kalman filtering according to the 15th group of data is the altitude at the end of the second preset time, that is, the altitude reference value.

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

[0161] The fused altitude of the Kalman filtering in Table 1 is the altitude calculation value, and the altitude calculation value in Table 1 is 15, that is, n is equal to 15.

[0162] After obtaining the second number of altitude calculation values, error checking needs to be performed to determine whether the accuracy of each altitude calculation value meets the requirements.

[0163] Since the scheme can allow the user to move the electronic device within the second preset time, that is, the second number of determined altitude calculation values can be different, directly performing error checking on the second number of altitude calculation values cannot reflect the true error situation. The scheme uses the detection result of the pressure sensor to obtain the height difference between the last altitude calculation value and the ith altitude calculation value, i = 1, 2, …, n-1.

[0164] The ith altitude calculation value and the height difference corresponding to the ith altitude calculation value are summed to obtain the ith altitude equivalent value.

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

[0166] When n is 15, the detection result of the pressure sensor corresponding to the first altitude calculation value is P1 942.115 kilopascals, the detection result of the pressure sensor corresponding to the 15th altitude calculation value is P1 941.44995 kilopascals, and the height difference determined according to formula (5) is 5.9566151 meters. According to formula (6), the first altitude equivalent value is obtained by adding the first altitude calculation value 706.1067663 and the height difference, which is 712.0633814 meters.

[0167] Similarly, the calculation data can refer to the following table 2.

[0168] Table 2: Error checking data table of altitude calculation value

[0169] Height difference from the n th elevation calculation value (unit: meter) Elevation equivalent value (unit: meter) Figure 4 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 of the corresponding altitude calculation values converted according to the air pressure value at the end of the second preset time. At this time, the 14 altitude equivalent values and the last altitude calculation value form 15 altitude data, and the mean square deviation σ of the 15 altitude data in table 2 is calculated:

[0171]

[0172] In formula (12), h is high 平均 The average value of the 15 data in the third column of table 2 is 711.0427065. The σ calculation result after the final data is brought in is 0.575193193.

[0173] The preset standard deviation threshold in the embodiment of the application is not limited specifically, and in actual application, in order to improve the accuracy of the determined altitude reference value, the preset standard deviation threshold should be set to a small number, for example, 3, 2 or 1, etc. Taking the preset standard deviation threshold of 3 as an example, at this time, the σ calculation result is less than 3, which represents that the accuracy of the determined altitude calculation value meets the requirements.

[0174] At this time, the obtained fused last altitude calculation value is taken as the altitude reference value. That is, the nth altitude calculation value is taken as the altitude reference value, and the altitude reference value can also be taken 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 air pressure sensor obtained in the second preset time as the air pressure reference value, that is, as the air pressure reference value at the end of the second preset time.

[0176] It can be understood that the nth altitude calculation value is taken as an example in S26 to explain the equivalent conversion of each altitude calculation value, and in actual application, each altitude calculation value can also be equivalent to the first altitude calculation value or the intermediate altitude calculation value. The specific principle is similar, and the embodiment of the application will not be repeated here.

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

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

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

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

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

[0182] The display interface of the real-time altitude can be seen from Figure 4 As shown, the real-time altitude can be displayed together with the latitude and longitude coordinates of the current location of the electronic device.

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

[0184] Some applications on the electronic device can realize their functions in cooperation with satellite communication. For example Figure 6 As shown, the call application 42 can make satellite calls, and the SMS application 41 can send satellite SMS.

[0185] Taking satellite SMS sending using the SMS application as an example for description.

[0186] Referring to Figure 3 , the figure is a schematic diagram of the user interface of the electronic device provided by the embodiment of the application Figure 4 .

[0187] After the user clicks to select and start the SMS application 41 on the interface shown in Figure 7 , the user interface of the electronic device switches to the interface shown in 6-(a), and the user can input message content in the "satellite message" option bar of the interface.

[0188] S31: In response to a position information adding operation, the real-time altitude is added in the SMS.

[0189] The user can select "carry position and altitude" in the satellite message on the interface shown in 6-(a), and the user interface at this time can be seen from 6-(b), realizing the addition of the real-time altitude in the SMS.

[0190] The above steps of the embodiments of the present application are only for the convenience of description and do not constitute a limitation on the technical solutions of the present application. In actual application, when the second quantity of altitude calculation values are acquired in S25, when the standard deviation of the n-1 altitude equivalent values and the n th altitude calculation value is greater than or equal to the preset standard deviation, the last altitude calculation value acquired in the second preset time is determined as the altitude at the ending moment of the second preset time, which can be displayed on the user interface of the electronic device. However, the altitude cannot be used as the altitude reference value for subsequent real-time altitude calculation, because the error of the present altitude reference value calculation is large. If the altitude reference value is applied to the subsequent real-time altitude calculation, the subsequent real-time altitude calculation results may all have large errors.

[0191] When the subsequent altitude is requested again, the altitude reference value and the pressure reference value need to be determined again according to the altitude information acquired in the second preset time and the detection results of the pressure sensor in the second preset time, that is, S23-S26 are performed again.

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

[0193] In summary, by using the scheme provided in the embodiments of the present application, the accuracy of the determined altitude is improved, and even if the user moves vertically during the detection of the altitude reference value, a more accurate altitude reference value can still be acquired, without the need for the user to remain stationary, thus having high practicability and improving the user experience.

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

[0195] Referring to ​ , the figure is a schematic diagram of an electronic device provided in the embodiments of the present application.

[0196] The electronic device supports satellite communication function. The electronic device 100 can 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 headset interface 170D, a sensor module 180, a key 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 can include an air pressure sensor 180A for measuring air pressure. The electronic device 100 implements the altitude method in the above embodiments of the present application through the air pressure value measured by the air pressure sensor 180A.

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

[0199] The processor 110 can include one or more processing units, for example: the processor 110 can 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. The processor 110 can also be provided with a memory for storing instructions and data.

[0200] The wireless communication function of the electronic device 100 can 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 can provide solutions including 2G / 3G / 4G / 5G wireless communication applied to the electronic device 100.

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

[0202] The internal memory 121 can be used to store computer executable program codes including instructions. When the processor runs the program codes stored in the internal memory 121, the method for determining the altitude height 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 pressure value can be obtained, that is, when satellite communication is established in a short time without mobile network connection, the real-time altitude height can be quickly determined according to the sea level pressure value obtained within the first preset time before the satellite communication is established and the detection result of the current pressure sensor. When the electronic device does not obtain the sea level pressure value within the first preset time before the satellite communication is established, the altitude height information in the GNSS data obtained within the second preset time and the detection result of the pressure sensor within the second preset time can be Kalman filtered, and then an accurate altitude reference value and a pressure reference value can be determined, which improves the accuracy of the determined altitude height. Even if the user moves vertically during the detection of the altitude reference value, an accurate altitude reference value can still be obtained, and the user does not need to remain in a stationary state, so the electronic device has high practicability and improves the user experience.

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

[0205] Storage media includes permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of storage media include, but are not limited to, parameter random access 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" refers to one or more, and "multiple" refers to two or more. "And / or" is used to describe the association between the associated objects, which means that there can be three kinds of relationships, for example, "A and / or B" can represent three cases: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents that the associated objects before and after are in an "or" relationship. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can represent: 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] The above-described and above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part 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 of determining an altitude, characterized by, An electronic device supports satellite communication function, the electronic device comprises a barometric pressure sensor, and the method comprises: The electronic device establishes satellite communication; When a sea level pressure value is obtained within a first preset time before the electronic device establishes satellite communication, a real-time altitude is determined according to the sea level pressure value and a detection result of the barometric pressure sensor at present; When a sea level pressure value is not obtained within the first preset time before the electronic device establishes satellite communication, an altitude reference value and a pressure reference value are determined according to altitude information in a plurality of global navigation satellite system (GNSS) data obtained within a second preset time through satellite communication and a detection result of the barometric pressure sensor within the second preset time, the pressure reference value being a pressure of the electronic device at an end time of the second preset time, and the altitude reference value being an altitude of the electronic device at the end time of the second preset time; A real-time altitude is determined according to a detection result of the barometric pressure sensor at present, the altitude reference value and the pressure reference value.

2. The method of claim 1, wherein, The altitude reference value and the pressure reference value are determined according to altitude information in global navigation satellite system (GNSS) data obtained within a second preset time through satellite communication and a detection result of the barometric pressure sensor within the second preset time, comprising: A first number of groups of original data are obtained within the second preset time, each group of the original data comprising the altitude information and a detection result of the barometric pressure sensor when the altitude information is obtained; The altitude information in each group of the original data is filtered, and the altitude information with an error less than a preset threshold value is retained to obtain a second number of groups of detection data; First-order Kalman filtering is performed on the second number of groups of detection data to determine the altitude reference value and the pressure reference value.

3. The method of claim 2, wherein, The first-order Kalman filtering is performed on the second number of groups of detection data to determine the altitude reference value and the pressure reference value, specifically comprising: First-order Kalman filtering is sequentially performed on the second number of groups of detection data to sequentially obtain a second number of altitude calculation values, the second number being n, n being a positive integer; A height difference between an n-th altitude calculation value and an i-th altitude calculation value is determined according to a detection result of a barometric pressure sensor corresponding to the i-th altitude calculation value and a detection result of a barometric pressure sensor corresponding to the n-th altitude calculation value, i=1, 2, …, n-1; The i-th altitude calculation value and a height difference corresponding to the i-th altitude calculation value are summed to obtain an i-th altitude equivalent value; when a standard deviation of n-1 altitude equivalent values and the n-th altitude calculation value is less than a preset standard deviation threshold value, a last altitude calculation value obtained within the second preset time is determined as the altitude reference value, and a last detection result of the barometric pressure sensor obtained within the second preset time is determined as the pressure reference value.

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

5. The method of claim 4, wherein, After determining the real-time altitude, the method further comprises: displaying the real-time altitude on a user interface of the electronic device.

6. The method of claim 5, wherein, The method further comprises: starting a short message application for sending a short message through satellite communication in response to a selection operation; adding the real-time altitude in the short message in response to a position information adding operation.

7. The method of claim 3, wherein, When a standard deviation of n-1 altitude equivalent values and the nth altitude calculation value is greater than or equal to a preset standard deviation, the method further comprises: determining a last altitude calculation value obtained within the second preset time as an altitude at an ending time of the second preset time; When a user requests to obtain an altitude again, determining an altitude reference value and an air pressure reference value according to the altitude information obtained within the second preset time and the detection result of the air pressure sensor within the second preset time.

8. The method of claim 1, wherein, The method further comprises: updating the sea level air pressure value when the electronic device is connected to a mobile network.

9. An electronic device, comprising: The electronic device comprises an air pressure sensor, a memory and a processor, the memory is used to store a program, the processor implements the method for determining an altitude as claimed in any one of claims 1-8 when running the program, and the air pressure sensor is used to measure an air pressure of a current position.

10. A storage medium, characterized by The storage medium has a program stored thereon, and the program implements the method for determining an altitude as claimed in any one of claims 1-8 when executed by an electronic device.

Citation Information

Patent Citations

  • Apparatus and methods for height determination

    US20120290253A1

  • Method and apparatus for measuring altitude in portable terminal

    US20130325385A1