Floor calculation method and equipment

By obtaining air pressure data in real time and calculating multiples between floors using the prime factor decomposition algorithm, combining the floor height empirical value of building type, dynamically fitting the floor formula, solving the problem of inaccurate floor calculation caused by building structure differences, and achieving more accurate floor calculation.

CN120467341APending Publication Date: 2025-08-12SHANGHAI SEARCH INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510601880.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-12
Publication Date
2025-08-12

AI Technical Summary

Technical Problem

The existing floor calculation method has inconsistent floor height due to differences in building structures, resulting in inaccurate floor calculations.

Method used

By obtaining the air pressure data of the user environment in real time, extracting the height air pressure data exceeding the preset frequency threshold, performing the difference ratio processing, using the prime factor decomposition algorithm to calculate the multiple of the floors between floors, and dynamically fit the floor formula for calculation based on the empirical value of the floor height of the building type.

Benefits of technology

More accurate floor calculations are achieved, the accuracy and efficiency of floor calculations are improved, and accurate floor calculations can be completed only once when riding an elevator or stairs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120467341A_ABST
    Figure CN120467341A_ABST
Patent Text Reader

Abstract

The invention discloses a floor calculation method and equipment in the technical field of intelligent equipment. The floor calculation method comprises the steps of obtaining air pressure data of an environment where a user is located in real time based on the intelligent equipment; and extracting height air pressure data exceeding a preset frequency threshold in the air pressure data, wherein the height air pressure data is used for identifying that the user stays at different heights. The air pressure data is acquired in real time, the inter-floor multiple is calculated through the prime factor decomposition algorithm, the floor number is dynamically calculated after the floor height empirical value is acquired, accurate calculation of the floor number is achieved, and through the prime factor decomposition mode, it can be guaranteed that the floor number is accurately calculated when people go upstairs and downstairs by taking elevators or stairs. As long as the staying time of the user within a certain air pressure value reaches the preset frequency threshold value, the air pressure data is recorded, on this basis, the user only needs to determine the floor height once again, a more accurate floor number calculation result can be completed, multiple pieces of air pressure data need to be collected in the mode, but the calculation result is more accurate, and the use effect is good.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent devices, and in particular to a floor calculation method and device. Background Art

[0002] Smart devices have a wide range of applications, touching nearly every aspect of our lives. For example, smartphones, smart TVs at home, and smart watches are becoming increasingly popular and powerful with the continuous advancement of artificial intelligence technology. Smartwatches, in particular, are wearable devices that combine the functions of smartphones and watches, offering core features like location tracking and anti-loss, audio and video calls, as well as electronic payment, health monitoring, social chat, photography, and intelligent object recognition. Children and adults alike can easily get lost in shopping malls during daily travel. The lack of floor signs and identification heightens the risk of getting lost, including, but not limited to, not knowing which floor or location you are on.

[0003] The current method for determining the number of floors is usually to detect the current air pressure under the default conditions (floor height 2.8 meters), and divide the height calculated by the barometer by 2.8 to obtain the current floor. This method has certain limitations, is not very accurate, and there is room for improvement.

[0004] In the existing floor calculation process, since the floor heights of residential buildings, commercial buildings, etc. may be inconsistent due to different building structures, the method of obtaining the current floor by fixing the floor height is not accurate enough and the use effect is poor. Summary of the Invention

[0005] The purpose of the present invention is to provide a floor calculation method to solve the above-mentioned problem that the floor heights of residential buildings, commercial buildings, etc. may be inconsistent due to different building structures, and the method of obtaining the current floor by fixing the floor height is not accurate enough.

[0006] To achieve the above object, the present invention provides the following technical solutions:

[0007] In a first aspect, the present invention provides a floor calculation method, comprising:

[0008] Obtain the air pressure data of the user's environment in real time based on smart devices;

[0009] Extracting the air pressure data exceeding a preset frequency threshold to obtain altitude air pressure data, wherein the altitude air pressure data is used to identify the user staying at different altitudes;

[0010] Performing difference ratio processing on the altitude pressure data to obtain the simplest integer ratio;

[0011] The height pressure data and the simplest integer ratio are used to obtain the floor number multiples between floors based on the prime factor decomposition algorithm;

[0012] Matching the building type based on the map positioning module of the smart device to obtain the corresponding floor height experience value;

[0013] The floor formula is obtained by fitting the multiple of the number of floors between the floors and the empirical value of the floor height. The current floor number of the user is dynamically calculated multiple times according to the floor formula, and the current floor number of the user is output.

[0014] As a further solution of the present invention: the method of obtaining the air pressure value of the environment in real time based on the smart device and forming air pressure data includes:

[0015] The smart device obtains in real time the air pressure value of the user's environment during the vertical displacement process, and the air pressure value forms air pressure data.

[0016] As a further solution of the present invention, extracting the pressure data exceeding a preset frequency threshold to obtain altitude pressure data, wherein the altitude pressure data is used to identify the user staying at different altitudes, includes:

[0017] Extracting air pressure values exceeding a preset frequency threshold from the air pressure data within a preset time window;

[0018] The standard deviation, linearity and correlation of the extracted multiple air pressure values are calculated, and the standard deviation, linearity and correlation are used to determine whether the user stays at a certain floor height, wherein the altitude air pressure data includes the ground air pressure value of the user's environment, and the ground air pressure value is obtained based on the air pressure information published by the local meteorological bureau. The altitude air pressure data also includes air pressure values corresponding to at least two different floors, and the air pressure values corresponding to the two different floors are a first air pressure value and a second air pressure value, and the first air pressure value is greater than the second air pressure value.

[0019] As a further solution of the present invention, performing difference ratio processing on the altitude pressure data to obtain the simplest integer ratio includes:

[0020] The ground pressure value in the altitude pressure data is recorded as P0, the first pressure value is recorded as P1, and the second pressure value is recorded as P2;

[0021] The ground pressure value is recorded as P0, the first pressure value is recorded as P1, and the second pressure value is recorded as P2, and a difference ratio is processed to calculate the pressure difference ratio;

[0022]

[0023] The pressure difference ratio is simplified to the simplest integer ratio a:b.

[0024] As a further solution of the present invention: if the pressure difference ratio cannot be directly obtained as the simplest integer ratio, disturbance data D is added, and |D|<0.1(P1-P2) to simplify the pressure difference ratio to the simplest integer ratio.

[0025] As a further solution of the present invention, the method of obtaining the floor multiples between floors by using the altitude pressure data and the simplest integer ratio based on a prime factor decomposition algorithm includes:

[0026] Calculate the total height C of the current floor (in m);

[0027]

[0028] The coefficient 12 (in meters) corresponds to a height difference where the air pressure decreases by 133 (in Pa), and 0.133 is the conversion factor for the air pressure change unit.

[0029] Add a and b in the simplest integer ratio, i.e. a+b;

[0030] Based on the prime factor decomposition algorithm, the total floor height C of the current floor is decomposed into the product of several prime numbers, wherein the product of the several prime numbers contains a+b multiples of the number of floors, and the multiple of the number of floors is n (n=1, 2, 3, ...).

[0031] As a further solution of the present invention: the map positioning module based on the smart device matches the building type to obtain the corresponding floor height experience value, including:

[0032] The building types include residential areas and commercial areas, and the residential areas and commercial areas both have a floor height experience value N, wherein the floor height experience value of the residential area is defined as a first floor height experience value, and the floor height experience value of the commercial area is defined as a second floor height experience value;

[0033] N=C / ((a+b)*n), (n=1, 2, 3,...);

[0034] Positioning the user's environment based on the map positioning module of the smart device, and determining a currently matched residential area or commercial area based on the user's environment positioning;

[0035] If the residential area is matched, the floor height experience value N is the first floor height experience value;

[0036] Otherwise, the floor height experience value N is the second floor height experience value.

[0037] As a further solution of the present invention: fitting the multiple of the number of floors between the floors with the empirical value of the floor height to obtain a floor formula, dynamically calculating the current floor number of the user based on the floor formula multiple times, and outputting the current floor number of the user, includes:

[0038] The floor formula:

[0039] Z = n × (a + b);

[0040] The actual floor formula can be obtained as:

[0041]

[0042] Among them, Z is the number of the floor the user is currently on; N is the floor height experience value;

[0043] Based on the enumeration method, multiple floor height experience values N are substituted into the floor formula to obtain the user's current floor number Z, and the user's current floor number Z is output.

[0044] As a further solution of the present invention: it also includes, when the results of calculating the number of the floor where the user is currently located in a preset number of times converge to the same value, terminating the calculation and outputting the number Z of the floor where the user is currently located, so as to improve calculation efficiency.

[0045] In a second aspect, the present invention provides an electronic device comprising a processor and a memory, wherein the memory stores a computer program, and when the program is executed by the processor, the floor calculation method is implemented.

[0046] Compared with the prior art, the present invention has the following beneficial effects:

[0047] 1. In the present invention, by acquiring air pressure data in real time and calculating the multiples between floors through a prime factor decomposition algorithm, the number of floors is dynamically calculated after obtaining the empirical value of the floor height, thereby achieving accurate calculation of the number of floors. By using the prime factor decomposition method, it can be ensured that when taking an elevator or going up or down stairs, as long as the user stays within a certain air pressure value for a preset frequency threshold, the air pressure data is recorded. On this basis, the user only needs to determine the floor height again to complete a more accurate calculation result of the number of floors. This method requires collecting multiple air pressure data, but the calculation result is more accurate and the use effect is good.

[0048] 2. In the present invention, the standard deviation, linearity and correlation calculations are performed on the multiple extracted air pressure values. By combining these three indicators, the system can more reliably determine whether the user is staying at a certain floor height, and the user's current position height is accurately located. When the simplest integer ratio is obtained, the difference ratio processing is performed on at least three air pressure value data. By minimizing the air pressure difference ratio, it can prevent the user from directly outputting the current floor number through the height of a known floor when the air pressure difference changes by multiples. At the same time, it is beneficial to further improve the accuracy of floor calculation and has a good use effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1Schematic diagram of the method of the present invention. DETAILED DESCRIPTION

[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0051] Example:

[0052] See also Figure 1 In an embodiment of the present invention, a floor calculation method includes:

[0053] Obtain the air pressure data of the user's environment in real time based on smart devices;

[0054] Extract the pressure data that exceeds the preset frequency threshold to obtain altitude pressure data, which is used to identify users staying at different altitudes;

[0055] Perform difference ratio processing on the altitude pressure data to obtain the simplest integer ratio;

[0056] The height pressure data and the simplest integer ratio are used to obtain the floor multiples between floors based on the prime factor decomposition algorithm;

[0057] The map positioning module based on smart devices matches the building type to obtain the corresponding floor height experience value;

[0058] The floor formula is obtained by fitting the floor multiples between floors and the empirical value of floor height. The user's current floor number is dynamically calculated multiple times based on the floor formula and the user's current floor number is output.

[0059] Furthermore, the altitude pressure data is obtained by extracting the parts of the pressure data that exceed the preset frequency threshold, and the pressure data is subjected to frequency statistics. The parts with frequencies lower than the preset frequency threshold are removed, and the parts with frequencies higher than or equal to the preset frequency threshold are retained to form the altitude pressure data. The altitude pressure data can accurately reflect the user's stay at different altitudes.

[0060] The present invention obtains air pressure data in real time through an intelligent device and extracts the number of times the air pressure data exceeds a preset frequency threshold to obtain altitude air pressure data. The altitude air pressure data is used to identify the different altitudes at which the user is staying, thereby ensuring the accuracy of identifying the user's altitude. The altitude air pressure data is processed by difference ratio to obtain the simplest integer ratio, thereby simplifying the relationship between the altitude air pressure data and facilitating subsequent calculations. At the same time, by minimizing the air pressure difference ratio, it is possible to prevent the user from directly outputting the current floor number based on the floor height of a known floor when the air pressure difference changes by multiples, thereby further improving the accuracy of floor calculation.

[0061] The altitude pressure data and the simplest integer ratio are compared based on the prime factor decomposition algorithm to obtain the floor multiples between floors. The prime factor decomposition algorithm can more accurately determine the multiple relationship between floors, improving the accuracy of floor calculation. The corresponding floor height experience value is obtained based on the smart device. Combined with the map positioning module and building type information, a reliable floor height experience value is provided for floor calculation, further improving the accuracy of the calculation. The floor multiples between floors and the floor height experience value are fitted to obtain the floor formula. The floor formula is used to dynamically calculate the user's current floor number multiple times and output the user's current floor number. Through dynamic calculation, the user's current floor number can be output in real time and accurately.

[0062] In summary, the floor calculation method provided by the present invention obtains air pressure data in real time and calculates the multiples between floors through a prime factor decomposition algorithm. After obtaining the empirical value of the floor height, the number of floors is dynamically calculated, thereby achieving accurate calculation of the number of floors. Through the prime factor decomposition method, it can be ensured that when taking an elevator or stairs to go up and down, as long as the user stays within a certain air pressure value for a preset frequency threshold, the air pressure data is recorded. On this basis, the user only needs to determine the floor height again to complete a more accurate floor number calculation result. This method requires collecting multiple air pressure data, but the calculation result is more accurate and the use effect is good.

[0063] Furthermore, the map positioning module of the smart device includes one or more of a GPS positioning module, a Beidou positioning module or a GLONASS positioning module, which can obtain the latitude and longitude information of the user's location in real time, providing an accurate location reference for floor calculation. At the same time, the map positioning module can also obtain building information around the user's location, such as building type, floor height, etc. This information provides an important basis for determining the floor height experience value, further improving the accuracy and reliability of floor calculation.

[0064] Optionally, the smart device can be used to obtain the ambient air pressure in real time and generate air pressure data, including:

[0065] The smart device obtains the air pressure value of the user's environment during the vertical displacement process in real time, and the air pressure value forms air pressure data.

[0066] Specifically, smart devices achieve precise data collection through built-in air pressure sensors. These highly sensitive, low-power sensors can monitor and record minute changes in air pressure in real time, accurately capturing pressure trends even when pressure differences between floors are minimal. This ensures that users can accurately identify and record air pressure changes when taking an elevator or going up or down stairs, which then become air pressure data.

[0067] Optionally, extracting the pressure data that exceeds a preset frequency threshold to obtain altitude pressure data, and the altitude pressure data is used to identify when the user stays at different altitudes, including:

[0068] Extracting air pressure values exceeding a preset frequency threshold from the air pressure data within a preset time window;

[0069] The standard deviation, linearity and correlation of the extracted multiple air pressure values are calculated. The standard deviation, linearity and correlation are used to determine whether the user is staying at a certain floor height. The altitude air pressure data includes the ground air pressure value of the user's environment, and the ground air pressure value is obtained based on the air pressure information published by the local meteorological bureau. The altitude air pressure data also includes air pressure values corresponding to at least two different floors. The air pressure values corresponding to the two different floors are a first air pressure value and a second air pressure value, and the first air pressure value is greater than the second air pressure value.

[0070] Among them, the preset time window is in the range of 1 minute to 30 minutes, and the options are 5 minutes, 10 minutes and 15 minutes. Within this time window, the system can automatically analyze the stability of the air pressure data and effectively eliminate misjudgments caused by short-term air pressure fluctuations. When the air pressure data remains stable within the preset time window and exceeds the preset frequency threshold, it is considered that the user has stayed at the altitude corresponding to the air pressure value. By adjusting the size of the time window, it can flexibly adapt to the floor identification needs in different scenarios and improve the accuracy and practicality of floor calculations. The selection of these three time windows of 5 minutes, 10 minutes and 15 minutes is the optimal solution based on a large amount of experimental data and user behavior analysis. It can reduce unnecessary computing overhead while ensuring accuracy and improve the operating efficiency of the overall system.

[0071] Specifically, the standard deviation, linearity and correlation of the extracted multiple pressure values are calculated, where the standard deviation reflects the degree of fluctuation of the pressure data. When the user stays on a certain floor, the standard deviation of the pressure data will be relatively small due to the relatively stable pressure between floors. The linearity measures the linear trend of the pressure data over time. If the user is in a stable state, the linearity of the pressure data will be higher, indicating that the pressure value has a relatively stable trend over time. At the same time, by calculating the correlation between the pressure data, it can be further confirmed whether the pressure data is interfered with by external factors, thereby improving the accuracy of floor recognition. Combining these three indicators, the system can more reliably determine whether the user is staying at a certain floor height and accurately locate the user's current position height. When the simplest integer ratio is obtained, the difference ratio processing is performed on at least three pressure value data. By minimizing the pressure difference ratio, it can prevent the user from directly outputting the current floor number through the height of a known floor when the pressure difference changes by multiples. At the same time, it is beneficial to further improve the accuracy of floor calculation and have a good use effect.

[0072] Optionally, the altitude pressure data is processed by difference ratio to obtain the simplest integer ratio, including:

[0073] The ground pressure value in the altitude pressure data is recorded as P0, the first pressure value is recorded as P1, and the second pressure value is recorded as P2;

[0074] The ground pressure value is recorded as P0, the first pressure value is recorded as P1, and the second pressure value is recorded as P2, and the difference ratio is processed to calculate the pressure difference ratio;

[0075]

[0076] Simplify the pressure difference ratio to the simplest integer ratio a:b.

[0077] Optionally, if the pressure difference ratio cannot be directly converted to a simplest integer ratio, disturbance data D is added, and |D|<0.1(P1-P2), so that the pressure difference ratio can be simplified to a simplest integer ratio.

[0078] Specifically, when calculating the simplest integer ratio of height differences, due to factors such as uneven floor thickness and collection errors, it is often not divisible evenly. Therefore, it is necessary to add a disturbance data D. When used, the disturbance data D can be added or subtracted from the data (P0-P1) or the data (P1-P2) to ensure that the final pressure difference ratio can be simplified to the simplest integer ratio. The selection of this disturbance data D requires caution. It must ensure that the pressure difference ratio can be simplified to an integer ratio and be as small as possible. Preferably, D<0.1(P1-P2) is used to avoid excessive impact on the floor calculation results. By testing multiple possible pressure difference ratios and combining them with actual floor height data, a suitable disturbance data D can be found to make the floor calculation results more accurate and reliable. In addition, while adding the disturbance data D, the pressure data needs to be further corrected and processed to eliminate other possible error factors and improve the accuracy and stability of the floor calculation.

[0079] Optionally, the altitude pressure data and the simplest integer ratio are used to obtain the floor multiples between floors based on a prime factorization algorithm, including:

[0080] Calculate the total height C of the current floor (in m);

[0081]

[0082] The coefficient 12 (in meters) corresponds to a height difference where the air pressure decreases by 133 (in Pa), and 0.133 is the conversion factor for the air pressure change unit.

[0083] Add a and b in the simplest integer ratio, i.e. a+b;

[0084] Based on the prime factor decomposition algorithm, the current total floor height C is decomposed into the product of several prime numbers, wherein the product of the several prime numbers contains a+b multiples of the number of floors, and the number of floors is n (n=1, 2, 3, ...).

[0085] Specifically, within an altitude of 3,000 meters above the ground, the air pressure decreases by 133 Pa for every 12-meter increase in altitude. This pressure change pattern serves as the basic data for floor calculation. Using this pattern, combined with the pressure difference between different floors measured by the pressure sensor, the height difference between floors can be calculated.

[0086] When calculating the total floor height, since the total floor height is the sum of two or more items in the air pressure ratio, and knowing common experience, we can calculate the total floor height C of the current floor and decompose the total floor height C into the product of several prime numbers. The product of several prime numbers contains a+b multiples of the number of floors n, which is convenient for subsequent calculation of the current floor.

[0087] Optionally, the map positioning module based on the smart device matches the building type to obtain the corresponding floor height experience value, including:

[0088] Building types include residential areas and commercial areas. Both residential areas and commercial areas have a floor height experience value N. The floor height experience value of the residential area is defined as the first floor height experience value, and the floor height experience value of the commercial area is defined as the second floor height experience value.

[0089] N=C / ((a+b)*n), (n=1, 2, 3,...);

[0090] The map positioning module of the smart device is used to locate the user's environment and determine whether the current matching residential area or commercial area is based on the user's environment positioning;

[0091] If the residential area is matched, the floor height experience value N is the first floor height experience value;

[0092] Otherwise, the floor height experience value N is the second floor height experience value.

[0093] Specifically, the smart device will automatically select the corresponding floor height experience value N for floor calculation based on the positioning results. In residential areas, the first floor height experience value is used for calculation to ensure the accuracy of the calculation results. In commercial areas, the second floor height experience value is used for calculation to better adapt to the height changes of different floors. The smart device can quickly and accurately calculate the user's current floor, improving the efficiency and accuracy of floor calculation.

[0094] Furthermore, the first floor height experience value can be optionally set to 2.8m or 3.0m, and the second floor height experience value can be optionally set to 4.5m or 5.5m. This data is the floor height experience value, which is based on statistical analysis of the actual floor height data of a large number of residential and commercial buildings. The floor heights in residential areas are usually relatively uniform, so the first floor height experience value is set to 2.8m or 3.0m to better cover most situations. When the user wears a smart device to stay on different floors, the total floor height C of the current floor is calculated. When the floor height C of the floor is an integer multiple of 2.8m or close to an integer multiple of 2.8m, for example, the floor height C is an integer multiple of 2.81m, 2.82m, 2.83m, etc., then the first floor height experience value is 2.8m, otherwise the first floor height experience value is 3.0m. However, due to the diverse functions of commercial areas, the floors in commercial areas are higher than those in residential areas. Therefore, the second floor height empirical value is set to 4.5m or 5.5m, etc. When users wear smart devices and stop at different floors, the total floor height C of the current floor is calculated. When the floor height C is an integer multiple of 4.5m or an integer multiple close to 4.5m, such as the floor height C of 4.51m, 4.48m, 4.60m, etc., the second floor height empirical value is set to 4.5m. Otherwise, the second floor height empirical value is set to 5.5m to better adapt to the height changes of different floors in the commercial area. This setting takes into account the actual situation and ensures the accuracy and efficiency of floor calculation.

[0095] Optionally, a floor formula is obtained by fitting the floor multiples between floors and the empirical value of the floor height. The user's current floor is dynamically calculated multiple times based on the floor formula, and the user's current floor is output, including:

[0096] Floor formula:

[0097] Z = n × (a + b);

[0098] The actual floor formula can be obtained as:

[0099]

[0100] Among them, Z is the number of the floor the user is currently on; N is the floor height experience value;

[0101] Based on the enumeration method, multiple floor height experience values N are substituted into the floor formula to obtain the user's current floor number Z, and the user's current floor number Z is output.

[0102] Specifically, the smart device first performs a preliminary calculation based on a preset empirical value N for floor height, such as 2.8m, 3.0m, 4.5m, or 5.5m, combined with the multiples of the number of floors between floors, using the floor formula Z = n × (a + b). Subsequently, the more refined floor formula Z = ((a + b) × N1 / 2 × (P0-P1+P1-P2)^0.133) × (a + b), where P0, P1, P2, etc. represent the different air pressure values between floors, is used to further dynamically adjust the calculation result. The smart device selects the empirical value N for the floor height corresponding to the user's location and substitutes it into the formula for multiple dynamic calculations until the most accurate number Z of the user's current floor is obtained. After obtaining the user's current floor number Z, the smart device will output the calculated result to prompt the user of their current floor.

[0103] Optionally, the method further includes terminating the calculation and outputting the user's current floor number Z when the results of calculating the user's current floor number converge to the same value within a preset number of times, so as to improve calculation efficiency.

[0104] Specifically, the method also includes real-time monitoring of the user's movement during the floor calculation process. If the user is detected to be stationary, the smart device pauses floor calculation to reduce unnecessary computing power. When the user resumes moving, the smart device immediately resumes calculation, ensuring real-time updates of floor information. This design not only improves computing efficiency but also fully considers the balance between user experience and device energy consumption.

[0105] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the program is executed by the processor, the above-mentioned floor calculation method is implemented.

[0106] Optionally, the electronic device is a smart watch, which integrates an air pressure sensor, a GPS module and a motion status detection unit for collecting air pressure data in real time and judging the user's movement status.

[0107] A computer-readable storage medium, characterized by storing computer instructions, which, when executed by a terminal device, implement the above-mentioned floor calculation method. A computer-readable storage medium in an embodiment of the present application is used. Since it is substantially similar to the method embodiment, the description is relatively simple. For relevant details, please refer to the partial description of the method embodiment.

[0108] The above description is only an optional specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any technician familiar with the technical field, within the technical scope disclosed by the present invention, who makes equivalent replacements or changes based on the technical solutions and inventive concepts of the present invention, should be covered by the scope of protection of the present invention.

Claims

1. A floor calculation method, characterized in that: include: Obtain the air pressure data of the user's environment in real time based on smart devices; Extracting the air pressure data exceeding a preset frequency threshold to obtain altitude air pressure data, wherein the altitude air pressure data is used to identify the user staying at different altitudes; Performing difference ratio processing on the altitude pressure data to obtain the simplest integer ratio; The height pressure data and the simplest integer ratio are used to obtain the floor number multiples between floors based on the prime factor decomposition algorithm; Matching the building type based on the map positioning module of the smart device to obtain the corresponding floor height experience value; The floor formula is obtained by fitting the multiple of the number of floors between the floors and the empirical value of the floor height. The current floor number of the user is dynamically calculated multiple times according to the floor formula, and the current floor number of the user is output.

2. A floor calculation method according to claim 1, characterized in that: The method of obtaining the air pressure value of the environment in real time based on the smart device and forming air pressure data includes: The smart device obtains in real time the air pressure value of the user's environment during the vertical displacement process, and the air pressure value forms air pressure data.

3. A floor calculation method according to claim 2, characterized in that: The step of extracting the pressure data exceeding a preset frequency threshold to obtain altitude pressure data, wherein the altitude pressure data is used to identify the user staying at different altitudes, includes: Extracting air pressure values exceeding a preset frequency threshold from the air pressure data within a preset time window; The standard deviation, linearity and correlation of the extracted multiple air pressure values are calculated, and the standard deviation, linearity and correlation are used to determine whether the user stays at a certain floor height, wherein the altitude air pressure data includes the ground air pressure value of the user's environment, and the ground air pressure value is obtained based on the air pressure information published by the local meteorological bureau. The altitude air pressure data also includes air pressure values corresponding to at least two different floors, and the air pressure values corresponding to the two different floors are a first air pressure value and a second air pressure value, and the first air pressure value is greater than the second air pressure value.

4. A floor calculation method according to claim 3, characterized in that: The step of performing difference ratio processing on the altitude pressure data to obtain the simplest integer ratio includes: The ground pressure value in the altitude pressure data is recorded as P0, the first pressure value is recorded as P1, and the second pressure value is recorded as P2; The ground pressure value is recorded as P0, the first pressure value is recorded as P1, and the second pressure value is recorded as P2, and a difference ratio is processed to calculate the pressure difference ratio; The pressure difference ratio is simplified to the simplest integer ratio a:b.

5. A floor calculation method according to claim 4, characterized in that: If the pressure difference ratio cannot be directly converted to a simplest integer ratio, disturbance data D is added, and |D|<0.1(P1-P2), so that the pressure difference ratio is simplified to a simplest integer ratio.

6. A floor calculation method according to claim 5, characterized in that: The step of obtaining the floor multiples between floors by using the altitude pressure data and the simplest integer ratio based on a prime factor decomposition algorithm includes: Calculate the total height C of the current floor (in m); The coefficient 12 (in meters) corresponds to a height difference where the air pressure decreases by 133 (in Pa), and 0.133 is the conversion factor for the air pressure change unit. Add a and b in the simplest integer ratio, i.e. a+b; Based on the prime factor decomposition algorithm, the total floor height C of the current floor is decomposed into the product of several prime numbers, wherein the product of the several prime numbers contains a+b multiples of the number of floors, and the multiple of the number of floors is n (n=1, 2, 3, ...).

7. A floor calculation method according to claim 6, characterized in that: The map positioning module based on the smart device matches the building type to obtain the corresponding floor height experience value, including: The building types include residential areas and commercial areas, and the residential areas and commercial areas both have a floor height experience value N, wherein the floor height experience value of the residential area is defined as a first floor height experience value, and the floor height experience value of the commercial area is defined as a second floor height experience value; N=C / ((a+b)*n), (n=1, 2, 3,...); Positioning the user's environment based on the map positioning module of the smart device, and determining a currently matched residential area or commercial area based on the user's environment positioning; If the residential area is matched, the floor height experience value N is the first floor height experience value; Otherwise, the floor height experience value N is the second floor height experience value.

8. A floor calculation method according to claim 7, characterized in that: The method of fitting the multiple of the number of floors between the floors with the empirical value of the floor height to obtain a floor formula, dynamically calculating the current floor number of the user according to the floor formula multiple times, and outputting the current floor number of the user includes: The floor formula: Z = n × (a + b); The actual floor formula can be obtained as: Among them, Z is the number of the floor the user is currently on; N is the floor height experience value; Based on the enumeration method, multiple floor height experience values N are substituted into the floor formula to obtain the user's current floor number Z, and the user's current floor number Z is output.

9. A floor calculation method according to claim 8, characterized in that: It also includes, when the results of calculating the number of the floor where the user is currently located in a preset number of times converge to the same value, terminating the calculation and outputting the number Z of the floor where the user is currently located, so as to improve calculation efficiency.

10. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the program is executed by the processor, the floor calculation method according to any one of claims 1 to 9 is implemented.