Floor positioning method, device, electronic equipment and storage medium
By using the air pressure data of electronic devices to determine floor changes, collect wireless signal fingerprints, and establish a wireless signal fingerprint database, it solves the problems of high cost and narrow applicability in the existing technology, and achieves accurate floor positioning in private buildings and other places.
Patent Information
- Application Number
- CN202210439105.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-22
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-04-22
AI Technical Summary
The existing WIFI fingerprint identification and positioning method requires pre-collection and establishment of a WIFI fingerprint database, resulting in high labor and time costs, and limited applicability, making it unsuitable for private buildings and other places.
By obtaining the air pressure data of electronic devices, it can determine floor changes, collect wireless signal fingerprints, and establish a wireless signal fingerprint database to achieve floor positioning, avoiding the need to collect fingerprint databases in advance.
It saves a lot of labor and time costs, obtains accurate floor information, and expands the applicable places, including private buildings and other non-public places.
Smart Images

Figure CN115134754B
Abstract
Description
Technical Field
[0001] The present application relates to the field of positioning technology, and in particular to a floor positioning method, device, electronic equipment and storage medium. Background Art
[0002] As people's demand for positioning increases, when users use positioning functions through electronic devices, they not only need to know their coordinate points on the two-dimensional map plane, but also need to know the floor information of the building they are in. The positioning method of WIFI fingerprint recognition is one of the existing floor positioning technologies, but the positioning method of WIFI fingerprint recognition is often divided into offline and online stages. In the offline stage, staff are required to collect WIFI fingerprints on each floor of the building in advance and establish a WIFI fingerprint library. In the online stage, after the user arrives at the building, he can collect WIFI fingerprints through electronic devices and match the WIFI fingerprints in the pre-established WIFI fingerprint library to obtain floor information. This solution requires data collection in advance and the establishment of a WIFI fingerprint library, which has relatively high labor and time costs. In addition, some private buildings cannot be entered, and it is impossible to pre-establish a WIFI fingerprint library. Therefore, it is often only applicable to public places such as shopping malls, and its application is relatively narrow. Summary of the invention
[0003] The embodiments of the present application disclose a floor positioning method, device, electronic device and storage medium, which can obtain accurate floor information while saving a lot of manpower and time costs.
[0004] The present application embodiment discloses a floor positioning method, characterized in that the method comprises:
[0005] Acquire air pressure data collected by a barometer of the electronic device, and determine whether the floor where the electronic device is located has changed according to the air pressure change amount of the air pressure data;
[0006] When it is determined according to the air pressure change that the floor where the electronic device is located no longer changes, identifying a reference air pressure value corresponding to the reference floor from the air pressure data, and identifying an end point air pressure value corresponding to an end point of the floor change from the air pressure data;
[0007] Determining a first target floor where the electronic device is located according to the reference air pressure value and the endpoint air pressure value, and collecting a first wireless signal fingerprint corresponding to the first target floor;
[0008] Storing the correspondence between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library;
[0009] When the electronic device is turned on, if the electronic device collects a second wireless signal fingerprint, a second target floor matching the second wireless signal fingerprint is determined from the wireless signal fingerprint library.
[0010] As an optional implementation, the air pressure data includes: air pressure value sets corresponding to a plurality of sampling periods, wherein the air pressure value set corresponding to each sampling period includes a plurality of air pressure values collected in each sampling period;
[0011] And, judging whether the floor where the electronic device is located has changed according to the air pressure change amount of the air pressure data, comprises:
[0012] Determine a first air pressure change corresponding to each sampling period according to a plurality of air pressure values included in the air pressure set corresponding to each sampling period;
[0013] According to the first air pressure change amount corresponding to each sampling period, N consecutive valid sampling periods are identified from the multiple sampling periods; the first air pressure change amounts corresponding to the N consecutive valid sampling periods are all greater than the first air pressure threshold; N is a positive integer greater than or equal to 1;
[0014] It is determined whether the floor where the electronic device is located has changed according to a second air pressure change amount between a maximum air pressure value and a minimum air pressure value among a plurality of air pressure values corresponding to the N consecutive effective sampling periods.
[0015] As an optional implementation manner, judging whether the floor where the electronic device is located has changed according to a second air pressure change between a maximum air pressure value and a minimum air pressure value among a plurality of air pressure values corresponding to the N consecutive valid sampling periods, respectively, includes:
[0016] If the second air pressure change between the maximum air pressure value and the minimum air pressure value among the multiple air pressure values corresponding to the N consecutive valid sampling periods is greater than the second air pressure threshold, it is determined that the floor where the electronic device is located has changed;
[0017] If the second air pressure change is less than the second air pressure threshold, it is determined that the floor where the electronic device is located has not changed.
[0018] As an optional implementation, the air pressure data includes: first air pressure data collected when the electronic device is in an outdoor environment;
[0019] The step of identifying a reference air pressure value corresponding to a reference floor from the air pressure data comprises:
[0020] Acquire a distance change amount of the electronic device within a preset time period before a target time when the electronic device enters an indoor environment from an outdoor environment;
[0021] When the distance change is less than a first distance threshold, identifying a reference air pressure value corresponding to the reference floor from the first air pressure data; and / or,
[0022] When the distance change is greater than a second distance threshold, the air pressure value collected at the target time is determined as the reference air pressure value corresponding to the reference floor.
[0023] As an optional implementation manner, storing the correspondence between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library includes:
[0024] If it is detected that there is a third wireless signal fingerprint corresponding to the first target floor in the wireless signal fingerprint library, when it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0025] As an optional implementation manner, when it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, storing the corresponding relationship between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library includes:
[0026] Acquire wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint respectively;
[0027] When the number of identical wireless signal sources in the wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint respectively is less than a first quantity threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0028] As an optional implementation manner, the first wireless signal fingerprint and the third wireless signal fingerprint correspond to at least one same wireless signal source; when it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, storing the correspondence between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library, comprising:
[0029] When the difference in signal strength between the first wireless signal fingerprint and the third wireless signal fingerprint under each identical wireless signal source is greater than a first signal threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0030] As an optional implementation manner, after storing the correspondence between the first wireless signal fingerprint and the first target floor in the wireless signal fingerprint library, the method further includes:
[0031] When the number of movement steps detected by the electronic device on the first target floor is greater than the first step number threshold, re-collecting a fourth wireless signal fingerprint corresponding to the first target floor, and replacing the first wireless signal fingerprint with the fourth wireless signal fingerprint; and / or,
[0032] When the electronic device detects that the duration of staying on the first target floor is greater than a first duration threshold, re-collecting a fourth wireless signal fingerprint corresponding to the first target floor, and replacing the first wireless signal fingerprint with the fourth wireless signal fingerprint;
[0033] The corresponding relationship between the fourth wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0034] The present application embodiment discloses a floor positioning device, which is characterized by comprising:
[0035] A judgment module, used to obtain air pressure data collected by a barometer of the electronic device, and judge whether the floor where the electronic device is located has changed according to the air pressure change amount of the air pressure data;
[0036] an identification module, for identifying a reference air pressure value corresponding to a reference floor from the air pressure data, and identifying an end point air pressure value corresponding to an end point of a floor change from the air pressure data, when it is determined according to the air pressure change that the floor where the electronic device is located no longer changes;
[0037] a collection module, configured to determine a first target floor where the electronic device is located according to the reference air pressure value and the end point air pressure value, and collect a first wireless signal fingerprint corresponding to the first target floor;
[0038] A storage module, used for storing the corresponding relationship between the first wireless signal fingerprint and the first target floor into a wireless signal fingerprint library;
[0039] The matching module is used to determine a second target floor matching the second wireless signal fingerprint from the wireless signal fingerprint library when the electronic device is turned on and the second wireless signal fingerprint is collected by the electronic device.
[0040] An embodiment of the present application discloses an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements any one of the floor positioning methods disclosed in the embodiment of the present application.
[0041] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program enables a computer to execute any one of the floor positioning methods disclosed in the embodiment of the present application.
[0042] Compared with the related art, the embodiments of the present application have the following beneficial effects:
[0043] Whether the floor where the electronic device is located has changed is determined based on the air pressure change in the air pressure data collected by the electronic device; when it is determined based on the air pressure change that the floor where the electronic device is located no longer changes, the first target floor where the electronic device is located is determined based on the reference air pressure value corresponding to the reference floor and the end point air pressure value corresponding to the end point of the floor change identified from the air pressure data, and the first wireless signal fingerprint corresponding to the first target floor is collected; a wireless signal fingerprint library is obtained based on the correspondence between the first wireless signal fingerprint and the first target floor; when the electronic device is turned on, the second wireless signal fingerprint of the electronic device is collected, and the second target floor matching the second wireless signal fingerprint is determined from the wireless signal fingerprint library.
[0044] In the implementation of the present application, the electronic device can determine the floor that the user has arrived at based on the air pressure data, and collect the wireless signal fingerprint corresponding to the floor where the user is located, and generate a wireless signal fingerprint library based on the correspondence between the floor where the user is located and the wireless signal fingerprint; when the electronic device is turned on, the wireless signal fingerprint of the floor where the electronic device is located when it is turned on can be collected, and the accurate floor information of the electronic device can be obtained by matching in the wireless signal fingerprint library. In other words, the electronic device will collect the wireless signal fingerprint of the corresponding floor according to the needs of the user. Not every floor will collect the corresponding wireless signal fingerprint, but only the floor where the user is currently staying. Different from the scheme in the prior art that the wireless signal fingerprint of each floor is collected on a large scale by the staff in advance, the present application embodiment does not pre-establish a wireless signal fingerprint library, but establishes it during the user's use of the electronic device. Therefore, the present application embodiment does not require the staff to collect the wireless signal fingerprint in advance, and can obtain accurate floor information while saving a lot of manpower and time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 It is a flow chart of a floor positioning method disclosed in an embodiment of the present application;
[0047] Figure 2 It is a flow chart of another floor positioning method disclosed in an embodiment of the present application;
[0048] Figure 3 It is a flow chart of another floor positioning method disclosed in an embodiment of the present application;
[0049] Figure 4 It is a flow chart of another floor positioning method disclosed in an embodiment of the present application;
[0050] Figure 5 It is a structural schematic diagram of a floor positioning device disclosed in an embodiment of the present application;
[0051] Figure 6 It is a structural schematic diagram of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0054] The embodiments of the present application disclose a floor positioning method, device, electronic device and storage medium, which can obtain accurate floor information while saving a lot of manpower and time costs.
[0055] See also Figure 1 , Figure 1 : is a flow chart of a floor positioning method disclosed in an embodiment of the present application. Figure 1 The floor positioning method described is applicable to electronic devices such as smart phones and electronic devices, and is not limited in the embodiments of the present application. The electronic devices may include, but are not limited to, smart watches or smart bracelets supported by wrists, smart rings supported by fingers, smart shoes or smart socks supported by feet, smart glasses, smart helmets or smart headbands supported by heads, and various non-mainstream products such as smart clothing, school bags, crutches, accessories, etc.
[0056] like Figure 1 As shown, the floor positioning method may include the following steps:
[0057] 101. Obtain air pressure data collected by a barometer of the electronic device, and determine whether the floor where the electronic device is located has changed based on the air pressure change amount of the air pressure data.
[0058] The electronic device can collect air pressure data in real time through the built-in barometer, and can pre-process the collected air pressure data. For example, the air pressure data can be median filtered every 10 seconds to eliminate the influence of random noise, so as to accurately determine whether the floor where the electronic device is located has changed based on the air pressure change in the air pressure data.
[0059] The electronic device can determine whether the floor where the electronic device is located has changed based on the air pressure change amount of the air pressure data.
[0060] Optionally, the electronic device can determine whether the floor where the electronic device is located has changed by whether the air pressure change within a preset time period is greater than the air pressure threshold. For example, the preset time period can be 10 seconds, which is not specifically limited; the air pressure threshold can be the air pressure difference between two floors, such as 0.3 hectopascals (hPa). If the air pressure change of the electronic device within a preset time period is greater than the air pressure difference threshold, it can be considered that the floor where the electronic device is located has changed.
[0061] Optionally, the electronic device may collect air pressure data for a plurality of consecutive preset time periods, determine the maximum air pressure value and the minimum air pressure value in the air pressure data for each preset time period, and determine whether the floor where the electronic device is located has changed according to whether the difference between the maximum air pressure value and the minimum air pressure value within the plurality of consecutive preset time periods is greater than the air pressure threshold. If the difference between the maximum air pressure value and the minimum air pressure value within the plurality of consecutive preset time periods is greater than the air pressure threshold, it is determined that the floor where the electronic device is located has changed.
[0062] 102. When it is determined based on the air pressure change that the floor where the electronic device is located no longer changes, a reference air pressure value corresponding to the reference floor is identified from the air pressure data, and an end point air pressure value corresponding to the end point of the floor change is identified from the air pressure data.
[0063] The electronic device can determine that the floor where the electronic device is located no longer changes based on the air pressure change. Optionally, when the air pressure change of the electronic device within a preset time period is less than the air pressure threshold, it can be determined that the floor where the electronic device is located no longer changes; or, when the air pressure change of the electronic device within a preset time period is less than the air pressure threshold, and the time for which the air pressure data remains unchanged exceeds the time threshold, it can be determined that the floor where the electronic device is located no longer changes.
[0064] The electronic device can identify the reference air pressure value corresponding to the reference floor and the end point air pressure value corresponding to the end point of the floor change from the air pressure data.
[0065] The reference floor may be the first floor of a building, and the reference air pressure value may be the air pressure value corresponding to the first floor of a building. The reference floor may be the first floor of an indoor environment or the first floor of an outdoor environment, and the first floor of an outdoor environment may be the first floor of an elevator entering the outdoor environment.
[0066] The floor change destination may be the floor that the electronic device finally reaches after entering the indoor environment, and the destination air pressure value may be the air pressure value corresponding to the floor that the electronic device finally reaches.
[0067] Optionally, the user of the electronic device can enter the floor change destination of the indoor environment through the elevator of the outdoor environment and the outdoor corridor, wherein the first floor of the elevator of the outdoor environment is the reference floor.
[0068] Alternatively, the electronic device may enter the first floor of the indoor environment from the outdoor environment, and enter the floor change destination of the indoor environment through the elevator or stairs of the indoor environment, wherein the first floor of the indoor environment is the reference floor.
[0069] The electronic device can determine whether the electronic device has entered an indoor environment from an outdoor environment based on the GPS signal strength. For example, if the electronic device receives N GPS satellite signals, and their signal strengths are {S1, S2, S3, ..., Sn} respectively, then the current GPS signal strength When S is less than the signal threshold S0, it is considered that the electronic device has entered the indoor environment from the outdoor environment. For example, the signal threshold S0 may be 50, which is not specifically limited.
[0070] Optionally, if the electronic device enters the indoor environment from an elevator or stairs in an indoor environment and changes its floor to the destination, the moment when the GPS signal strength is less than the signal threshold can be defined as moment T1 when the electronic device enters the indoor environment from the outdoor environment, and the air pressure value corresponding to moment T1 can be used as the reference air pressure value, that is, the position where the electronic device just enters the indoor environment is used as the reference floor.
[0071] Optionally, if the electronic device enters the floor of the indoor environment from the elevator and outdoor corridor in the outdoor environment, the moment when the GPS signal strength is less than the signal threshold can be defined as the T1 moment when the electronic device enters the indoor environment from the outdoor environment, and the air pressure data within a preset time before the T1 moment can be collected, wherein the preset time can be 2 minutes. Because as the floor height increases, the air pressure value will decrease; as the floor height decreases, the air pressure value will increase. If it is determined that the floor where the electronic device is located no longer changes according to the air pressure change within the preset time, the reference air pressure value and the terminal air pressure value can be determined from the air pressure data collected within the preset time, the maximum air pressure value within the preset time can be determined as the reference air pressure value, and the minimum air pressure value within the preset time can be determined as the terminal air pressure value.
[0072] 103. Determine a first target floor where the electronic device is located according to the reference air pressure value and the end point air pressure value, and collect a first wireless signal fingerprint corresponding to the first target floor.
[0073] The electronic device can determine the first target floor where the electronic device is located according to the reference air pressure value and the end point air pressure value. The first target floor can be the floor where the electronic device is located after the indoor environment no longer changes floors, that is, the floor information corresponding to the end point of the floor change.
[0074] The height change Δh of the electronic device from the reference floor to the floor change end point can be calculated using the following formula.
[0075] Δh = 18410 * (1 + t / 273.15) * (log10(p0) – log10(p1)) (1)
[0076] Where t is the current temperature, which can be obtained from the weather forecast; p0 is the reference pressure; p1 is the end pressure. According to Δh, the number of floors to be changed, f1, can be calculated. If f1<0, the first target floor is calibrated to -f1; if f1>0, the first target floor is calibrated to f1+1.
[0077] The first wireless signal fingerprint may include a media access control (MAC) address of a wireless signal source collected on the first target floor, and a signal strength received from the wireless signal source. The electronic device may enable wireless signal fingerprint collection and collect the first wireless signal fingerprint on the first target floor. The wireless signal may be a WIFI signal, which is not specifically limited.
[0078] 104. Store the correspondence between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library.
[0079] The electronic device can store the correspondence between the first wireless signal fingerprint and the first target floor into the wireless signal fingerprint library, that is, the electronic device can use the first target floor as the label of the first wireless signal fingerprint, and store the first wireless signal fingerprint with the floor label information into the wireless signal fingerprint library. For example, when the electronic device enters the 3rd floor of the indoor environment, the electronic device can collect the wireless signal fingerprint corresponding to the 3rd floor and store it in the wireless signal fingerprint library; if the electronic device moves from the 3rd floor to the 5th floor, the electronic device can also collect the wireless signal fingerprint corresponding to the 5th floor and store it in the wireless signal fingerprint library. Therefore, the electronic device can automatically collect the wireless signal fingerprint corresponding to the floors frequently visited by the user during the user's use of the electronic device, and can efficiently generate a wireless signal fingerprint library, which is equivalent to each user being able to customize the wireless signal fingerprint library according to the floors they often visit, avoiding the storage of too much floor information and wireless fingerprint information, and effectively saving the storage space of the electronic device.
[0080] 105. When the electronic device is turned on, if the electronic device collects a second wireless signal fingerprint, a second target floor matching the second wireless signal fingerprint is determined from the wireless signal fingerprint library.
[0081] When the electronic device is not turned on on the first floor of the indoor environment, but on other floors other than the first floor, the reference air pressure value corresponding to the first floor cannot be obtained at this time, so the current floor of the electronic device cannot be directly calculated by the reference air pressure value and the end point air pressure value. However, since the user has pre-established a wireless signal fingerprint library, when the electronic device is turned on on a floor other than the first floor of the indoor environment, the electronic device can collect the second wireless signal fingerprint corresponding to the current floor, and determine the second target floor matching the second wireless signal fingerprint from the wireless signal fingerprint library, and the second target floor is the floor where the electronic device is currently located. For example, when the user of the electronic device works on the 5th floor of a building, the 5th floor is the floor that the user usually goes to, so the wireless signal fingerprint library has stored the corresponding relationship between the floor and the wireless signal fingerprint corresponding to the floor, but the electronic device suddenly runs out of power. After the electronic device is charged and restarted, the electronic device can collect the wireless signal fingerprint corresponding to the current floor, and determine the floor information matching the wireless signal fingerprint from the wireless signal fingerprint library, and finally determine that the current floor is the 5th floor.
[0082] The embodiment of the present application determines the first target floor of the electronic device according to the reference air pressure value and the end point air pressure value, and starts the wireless signal fingerprint collection to obtain the first wireless signal fingerprint corresponding to the first target floor, and stores the corresponding relationship between the first target floor and the first wireless signal fingerprint in the wireless signal fingerprint library. For the scenario where the electronic device is subsequently turned on in an indoor environment, such as the electronic device is turned on on a floor other than the first floor in the indoor environment, even if the reference air pressure value of the first floor cannot be obtained and the floor where the electronic device is currently located cannot be directly calculated through the air pressure data, the second wireless signal fingerprint of the current floor can be collected and matched in the wireless signal fingerprint library to obtain the second target floor that matches the second wireless signal fingerprint, and the second target floor is the floor where the electronic device is currently located. Therefore, the embodiment of the present application can obtain the current floor information in the scenario where the reference air pressure value of the first floor cannot be obtained, thereby providing users with accurate floor positioning information in a variety of scenarios.
[0083] In one application scenario, an embodiment of the present application can be applied to a scenario in which an electronic device interacts with other electronic devices for information. The electronic device can be pre-set with a connection or binding relationship with other electronic devices. The other electronic devices can be supervision terminals such as mobile phones, tablet computers or wearable devices connected or bound to the electronic device. Therefore, the user of the supervision terminal can timely understand the floor changes of the user of the electronic device through the supervision terminal.
[0084] The embodiment of the present application can determine the floor reached by the user based on the air pressure data, and automatically collect the wireless signal fingerprint corresponding to the floor where the user is located after the electronic device is turned on, and generate a wireless signal fingerprint library based on the correspondence between the floor where the user is located and the wireless signal fingerprint. There is no need for staff to collect wireless signal fingerprints in advance, and accurate floor information can be obtained while saving a lot of manpower and time costs.
[0085] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of another floor positioning method disclosed in an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0086] 201. Obtain air pressure data collected by a barometer of an electronic device, and determine a first air pressure change corresponding to each sampling period according to a plurality of air pressure values included in an air pressure set corresponding to each sampling period.
[0087] The air pressure data includes sets of air pressure values corresponding to a plurality of sampling periods respectively; the set of air pressure values corresponding to each sampling period includes a plurality of air pressure values collected in each sampling period.
[0088] The sampling period may be 5 seconds, which is not specifically limited. During the sampling period, the electronic device may continuously collect multiple air pressure values, and use the multiple air pressure values in each sampling period as an air pressure set. The first air pressure change value may be an air pressure change value corresponding to each sampling period calculated based on the multiple air pressure values collected in each sampling period.
[0089] 202. According to the first air pressure change amount corresponding to each sampling period, identify N consecutive valid sampling periods from multiple sampling periods.
[0090] The first air pressure changes corresponding to N consecutive valid sampling periods are all greater than the first air pressure threshold; N is a positive integer greater than or equal to 1. For example, the first air pressure threshold may be 0.05 hPa, which is not specifically limited.
[0091] It can be considered that within N consecutive valid sampling periods, the floor where the electronic device is located is more likely to change, because the first air pressure change corresponding to each valid sampling period is greater than the first air pressure threshold. Therefore, the consecutive valid sampling periods can be identified from multiple sampling periods, and then the air pressure values within the consecutive valid sampling periods are calculated to determine whether the floor where the electronic device is located has changed within the consecutive valid sampling periods. This can avoid processing the air pressure values of all sampling periods, thereby improving the computing efficiency of the electronic device.
[0092] 203. Determine whether the floor where the electronic device is located has changed according to a second air pressure change between a maximum air pressure value and a minimum air pressure value among a plurality of air pressure values corresponding to N consecutive effective sampling periods.
[0093] If the second air pressure change between the maximum air pressure value and the minimum air pressure value among the multiple air pressure values corresponding to N consecutive valid sampling periods is greater than the second air pressure threshold, it is determined that the floor where the electronic device is located has changed; if the second air pressure change is less than the second air pressure threshold, it is determined that the floor where the electronic device is located has not changed.
[0094] The second air pressure variation may be a difference between a maximum air pressure value and a minimum air pressure value among air pressure values in N consecutive valid sampling periods.
[0095] The second air pressure threshold may be the air pressure difference between two floors, such as 0.3 hPa, without specific limitation.
[0096] Exemplarily, if the sampling period is 5 seconds, N consecutive valid sampling periods are identified from multiple sampling periods, wherein the first air pressure change corresponding to each valid sampling period is greater than the first air pressure threshold, such as 0.05hPa. In the N consecutive valid sampling periods, the maximum air pressure value and the minimum air pressure value of the multiple air pressure values in each valid sampling period are recorded, and the maximum air pressure value and the minimum air pressure value of each valid sampling period are compared to obtain the maximum air pressure value and the minimum air pressure value in the N consecutive valid sampling periods. The second air pressure change is calculated based on the difference between the maximum air pressure value and the minimum air pressure value. If the second air pressure change is greater than the second air pressure threshold, such as 0.3hPa, it is considered that the floor where the electronic device is located has changed within the N consecutive valid sampling periods.
[0097] 204. When it is determined based on the air pressure change that the floor where the electronic device is located no longer changes, a reference air pressure value corresponding to the reference floor and an end point air pressure value corresponding to the end point of the floor change are identified from the air pressure data.
[0098] The electronic device can determine that the floor where the electronic device is located no longer changes based on the amount of air pressure change.
[0099] Optionally, when the electronic device identifies M consecutive invalid sampling periods from multiple sampling periods and M exceeds a first quantity threshold, it can be determined that the floor where the electronic device is located does not change any more. The first air pressure change corresponding to each invalid sampling period is less than the first air pressure threshold.
[0100] Optionally, the electronic device identifies N consecutive valid sampling periods from multiple sampling periods. When the change in the second air pressure within N consecutive valid sampling periods is less than the second air pressure threshold, and the duration of N consecutive valid sampling periods is greater than the first time threshold, it can be determined that the floor searched by the electronic device no longer changes.
[0101] 205. Determine a first target floor where the electronic device is located according to the reference air pressure value and the end point air pressure value, and collect a first wireless signal fingerprint corresponding to the first target floor.
[0102] 206. Store the correspondence between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library.
[0103] The first target floor can be used as a label of the first wireless signal fingerprint, and the first wireless signal fingerprint with the floor label is stored in the wireless signal fingerprint library.
[0104] 207. When the electronic device is turned on, if the electronic device collects a second wireless signal fingerprint, a second target floor matching the second wireless signal fingerprint is determined from the wireless signal fingerprint library.
[0105] The electronic device can be turned on in an indoor environment or in an outdoor environment.
[0106] Optionally, when the electronic device is turned on in an outdoor environment and enters a certain floor in an indoor environment from the outdoor environment, the electronic device can collect the wireless signal fingerprint of the current floor, and match the collected wireless signal fingerprint in the previously generated wireless signal fingerprint library. If the match is successful, the label floor of the matched wireless signal fingerprint is used as the current floor; if the match is unsuccessful, the air pressure of the first floor of the indoor environment can be used as the reference air pressure value, and the air pressure of the current floor can be used as the end point air pressure value. The current height and floor are calculated according to the difference between the two air pressure values, and the wireless signal fingerprint collection is turned on, and the current floor is used as the label to store the collected wireless signal fingerprint and the corresponding floor label in the wireless signal fingerprint library.
[0107] Optionally, when the electronic device is turned on in an indoor environment, the wireless signal fingerprint of the current floor of the electronic device can be collected, and the collected wireless signal fingerprint can be matched in the previously generated wireless signal fingerprint library. If the match is successful, the label floor of the matched wireless signal fingerprint is used as the current floor.
[0108] The embodiment of the present application can efficiently and accurately determine whether the floor where the electronic device is located has changed based on multiple air pressure values in each sampling period. The embodiment of the present application identifies continuous valid sampling periods from multiple sampling periods, and then calculates the air pressure values in the continuous valid sampling periods to determine whether the floor where the electronic device is located has changed in the continuous valid sampling periods. This can avoid processing the air pressure values of all sampling periods, thereby improving the computing efficiency of the electronic device.
[0109] The wireless signal fingerprint collection process of the embodiment of the present application is automatically performed by the user when using the electronic device. There is no need for the staff to collect the wireless signal fingerprint in advance, which saves a lot of manpower and time costs. In addition, through wireless signal fingerprint matching, the user can be provided with accurate current floor information in the scenario where the baseline air pressure on the first floor cannot be obtained.
[0110] See also Figure 3 , Figure 3 It is a flow chart of another floor positioning method disclosed in an embodiment of the present application.
[0111] 301. Obtain air pressure data collected by a barometer of the electronic device, and determine whether the floor where the electronic device is located has changed according to the air pressure change amount of the air pressure data.
[0112] The air pressure data may include first air pressure data collected when the electronic device is in an outdoor environment, and the air pressure data may also include second air pressure data collected when the electronic device is in an outdoor environment.
[0113] 302. When it is determined based on the air pressure change that the floor where the electronic device is located no longer changes, obtain a distance change of the electronic device within a preset time period before a target time when the electronic device enters the indoor environment from the outdoor environment.
[0114] The collection time of the distance change is consistent with the collection time of the first air pressure data. The electronic device can continuously record the GPS signal strength, GPS coordinates and air pressure value. While the electronic device is collecting the first air pressure data, it is also collecting the GPS coordinates of the electronic device in real time. The target time is the time when entering the indoor environment from the outdoor environment.
[0115] Optionally, if the electronic device enters the first target floor of the indoor environment from the elevator and outdoor corridor of the outdoor environment, the moment when the GPS signal strength is less than the signal threshold can be defined as the target moment when the electronic device enters the indoor environment from the outdoor environment, and the electronic device can collect the distance change within the preset time before the target moment, wherein the preset time can be 2 minutes. When it is determined based on the air pressure change that the floor where the electronic device is located no longer changes, the distance change of the electronic device within the preset time before the target moment when it enters the indoor environment from the outdoor environment is obtained. Among them, the distance change is calculated based on multiple GPS coordinates of the electronic device within the preset time, and can be the coordinate position change calculated based on the GPS coordinates corresponding to the starting point of the preset time and the GPS coordinates corresponding to the end point of the preset time.
[0116] 303. When the distance change is less than the first distance threshold, identify the reference air pressure value corresponding to the reference floor from the first air pressure data; and when the distance change is greater than the second distance threshold, determine the air pressure value collected at the target time as the reference air pressure value corresponding to the reference floor.
[0117] If the electronic device is in a driving uphill scenario in the outdoor environment within the preset time before the target moment when it enters the indoor environment from the outdoor environment, the slope change causes the electronic device to undergo an air pressure change in the outdoor environment. At this time, based on the air pressure change amount of the first air pressure data within the preset time, it can be judged that the floor where the electronic device is located in the outdoor environment has changed. However, if the distance change amount exceeds the first distance threshold, it does not conform to the situation where the electronic device normally goes upstairs by means of an outdoor elevator, etc., and is more in line with the situation where the user drives uphill in the outdoor environment. Therefore, driving uphill in an outdoor environment by an electronic device cannot be considered as a change in the floor where the electronic device is located. In order to exclude the situation where the electronic device drives uphill in an outdoor environment, it can be determined that the floor where the electronic device is located in the outdoor environment has changed only when the distance change amount is guaranteed to be less than the first distance threshold, thereby identifying the reference air pressure value corresponding to the reference floor from the first air pressure data.
[0118] When the distance change is less than the first distance threshold, a reference air pressure value corresponding to the reference floor is identified from the first air pressure data. The reference air pressure value may be a maximum air pressure value obtained from the first air pressure data within a preset time period;
[0119] When the distance change is greater than the second distance threshold, the air pressure value collected at the target time is determined as the reference air pressure value corresponding to the reference floor. The distance change being greater than the second distance threshold indicates that the electronic device did not change floors in the outdoor environment within the preset time before the target time when it entered the indoor environment from the outdoor environment, and the air pressure changed only because of situations such as driving uphill. Therefore, the reference air pressure value can be determined as the air pressure value collected at the target time, that is, the air pressure value when the electronic device entered the indoor environment.
[0120] The first distance threshold may be 20 meters, which is not specifically limited. Determining whether to identify the reference air pressure value from the first air pressure data based on whether the distance change is less than the first distance threshold is for a preset time period before the electronic device enters the indoor environment, and the user of the electronic device may be in an application scenario of driving uphill or downhill.
[0121] 304. Identify the terminal air pressure value corresponding to the floor change terminal point from the air pressure data.
[0122] The air pressure data may include first air pressure data collected when the electronic device is in an outdoor environment, and the air pressure data may also include second air pressure data collected when the electronic device is in an outdoor environment.
[0123] The electronic device may identify the end point air pressure value corresponding to the end point of the floor change from the first air pressure data, and may also identify the end point air pressure value corresponding to the end point of the floor change from the second air pressure data.
[0124] Optionally, when the electronic device enters the first target floor from the outdoor environment through an outdoor elevator, corridor, etc., the terminal air pressure value corresponding to the floor change terminal point can be directly identified from the first air pressure data;
[0125] Optionally, when the electronic device does not change floors in an outdoor environment and enters the first target floor from an indoor environment through an indoor elevator, stairs, etc., the end point air pressure value corresponding to the end point of the floor change can be directly identified from the second air pressure data;
[0126] Optionally, when the electronic device changes floors in an outdoor environment and also changes floors in an indoor environment before entering the first target floor, the end point air pressure value corresponding to the end point of the floor change can be identified from the second air pressure data.
[0127] 305. Determine a first target floor where the electronic device is located according to the reference air pressure value and the end point air pressure value, and collect a first wireless signal fingerprint corresponding to the first target floor.
[0128] 306. Store the correspondence between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library.
[0129] 307. When the electronic device is turned on, if the electronic device collects a second wireless signal fingerprint, a second target floor matching the second wireless signal fingerprint is determined from the wireless signal fingerprint library.
[0130] The embodiment of the present application can accurately obtain the floor information of the electronic device even if the floor of the electronic device in the outdoor environment changes. At the same time, it can accurately judge whether the floor of the electronic device in the outdoor environment changes according to the change in air pressure and the change in distance, thereby reducing the misjudgment rate and improving the accuracy of floor positioning.
[0131] See also Figure 4 , Figure 4 It is a flow chart of another floor positioning method disclosed in an embodiment of the present application.
[0132] 401. Obtain air pressure data collected by a barometer of the electronic device, and determine whether the floor where the electronic device is located has changed based on the air pressure change amount of the air pressure data.
[0133] 402. When it is determined based on the air pressure change that the floor where the electronic device is located no longer changes, a reference air pressure value corresponding to the reference floor and an end point air pressure value corresponding to an end point of the floor change are identified from the air pressure data.
[0134] 403. Determine a first target floor where the electronic device is located according to the reference air pressure value and the end point air pressure value, and collect a first wireless signal fingerprint corresponding to the first target floor.
[0135] 404. If it is detected that there is a third wireless signal fingerprint corresponding to the first target floor in the wireless signal fingerprint library, when it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0136] The third wireless signal fingerprint is a wireless signal fingerprint corresponding to the first target floor and existing in the wireless signal fingerprint library, and has the same floor label as the first wireless signal fingerprint.
[0137] The electronic device can determine whether the first wireless signal fingerprint and the third wireless signal fingerprint are similar based on the differences between the first wireless signal fingerprint and the third wireless signal fingerprint in terms of signal source, signal strength, etc.
[0138] In some optional embodiments, the wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint are obtained; when the number of identical wireless signal sources in the wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint is less than a first quantity threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0139] Among them, it can be determined whether there is an identical wireless signal source based on the MAC address included in the first wireless signal fingerprint and the third wireless signal fingerprint. The first quantity threshold can be 5, which is not specifically limited. When the number of identical wireless signal sources in the wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint is less than the first quantity threshold, it can be considered that the difference between the first wireless signal fingerprint and the third wireless signal fingerprint is large.
[0140] In other optional embodiments, the first wireless signal fingerprint and the third wireless signal fingerprint correspond to at least one identical wireless signal source; when the difference in signal strength between the first wireless signal fingerprint and the third wireless signal fingerprint under each identical wireless signal source is greater than the first signal threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0141] For example, the signal strength of the first wireless signal fingerprint under each wireless signal source is {rssi a1 ,rssi a2 ,…,rssi aT}, the signal strength of the third wireless signal fingerprint under each wireless signal source is {rssi b1 ,rssi b2 ,…,rssi bT}, where rssi a1 and rssi b1 is the signal strength detected from the first identical wireless signal source, rssi a2 and rssi b2 is the signal strength detected from the second identical wireless signal source, and so on. The difference between the signal strengths of the first wireless signal fingerprint and the third wireless signal fingerprint under each identical wireless signal source can be defined as formula (2):
[0142]
[0143] If the difference value is less than the first signal threshold, it is determined that the first wireless signal fingerprint is similar to the third wireless signal fingerprint, and the correspondence between the first wireless signal fingerprint and the first target floor is not stored in the wireless signal fingerprint library; if the difference value is greater than the first signal threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library. The first signal threshold can be 5, which is not specifically limited.
[0144] In other optional embodiments, when the number of identical wireless signal sources in the wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint respectively is greater than a first number threshold, and when the difference in signal strength between the first wireless signal fingerprint and the third wireless signal fingerprint under each identical wireless signal source is greater than a first signal threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0145] For example, for the newly collected first wireless signal fingerprint, if there is a third wireless signal fingerprint with the same floor label (first target floor) in the wireless signal fingerprint library, and the first wireless signal fingerprint and the third wireless signal fingerprint have K common wireless signal sources, K is greater than the first quantity threshold, under the K common wireless signal sources, the signal strength of the first wireless signal fingerprint under each wireless signal source is {rssi a1 ,rssi a2 ,…,rssi aT}, the signal strength of the third wireless signal fingerprint under each wireless signal source is {rssi b1 ,rssi b2 ,…,rssi bT}, according to formula (2), the difference value of the signal strength between the first wireless signal fingerprint and the third wireless signal fingerprint under each identical wireless signal source is obtained; if the difference value is greater than the first signal threshold, the corresponding relationship between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0146] 405. When the number of movement steps detected by the electronic device on the first target floor is greater than the first step number threshold, the fourth wireless signal fingerprint corresponding to the first target floor is re-collected, and the first wireless signal fingerprint is replaced by the fourth wireless signal fingerprint.
[0147] The first step number threshold may be 10. That is, the fourth wireless signal fingerprint corresponding to the first target floor is re-collected every time the number of movement steps of the electronic device increases by 10 steps.
[0148] The fourth wireless signal fingerprint is the wireless signal fingerprint corresponding to the first target floor that is re-collected when the number of motion steps detected by the electronic device on the first target floor is greater than the first step number threshold. The fourth wireless signal fingerprint replaces the first wireless signal fingerprint to obtain the correspondence between the fourth wireless signal fingerprint and the first target floor, and the correspondence between the fourth wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0149] In some embodiments, when the electronic device detects that the duration of staying on the first target floor is greater than the first duration threshold, the fourth wireless signal fingerprint corresponding to the first target floor is re-collected, and the fourth wireless signal fingerprint replaces the first wireless signal fingerprint.
[0150] The duration may be 10 minutes, without any specific limitation.
[0151] In some embodiments, when the number of movement steps detected by the electronic device on the first target floor is greater than the first number threshold, and when the electronic device detects that the duration of stay on the first target floor is greater than the first duration threshold, the fourth wireless signal fingerprint corresponding to the first target floor is re-collected, and the fourth wireless signal fingerprint replaces the first wireless signal fingerprint.
[0152] The embodiment of the present application determines whether to re-collect the fourth wireless signal fingerprint corresponding to the first target floor based on the number of movement steps detected by the electronic device on the first target floor and the duration of the stay detected on the first target floor, so as to update the wireless signal fingerprint library, thereby obtaining an accurate correspondence between the first target floor and the fourth wireless signal fingerprint, avoiding the situation where the wireless signal fingerprint is inaccurate due to factors such as maintenance of the wireless signal source on the floor and changes in the MAC address.
[0153] 406. Store the correspondence between the fourth wireless signal fingerprint and the first target floor in a wireless signal fingerprint library.
[0154] 407. When the electronic device is turned on, if the electronic device collects a second wireless signal fingerprint, a second target floor matching the second wireless signal fingerprint is determined from the wireless signal fingerprint library.
[0155] In the embodiment of the present application, when it is detected that there is a third wireless signal fingerprint corresponding to the first target floor in the wireless signal fingerprint library, it can be determined whether to store the correspondence between the first wireless signal fingerprint and the first target floor in the wireless signal fingerprint library according to the difference between the first wireless signal fingerprint and the third wireless signal fingerprint. This can avoid repeated entry of wireless signal fingerprints and save storage space of electronic devices. At the same time, the wireless signal fingerprints are regularly updated to ensure the accuracy of the wireless signal fingerprint library, thereby improving the accuracy of floor positioning.
[0156] See also Figure 5 , Figure 5 Schematic diagram of the structure of a floor positioning device disclosed in the embodiment of the present application. The device can be applied to electronic devices such as smart phones and electronic devices, without specific limitation. Figure 5 As shown, the floor positioning device 500 may include: a judgment module 510 , a recognition module 520 , a collection module 530 , a storage module 540 , and a matching module 550 .
[0157] The judging module 510 is used to obtain the air pressure data collected by the barometer of the electronic device, and judge whether the floor where the electronic device is located has changed according to the air pressure change amount of the air pressure data;
[0158] The identification module 520 is used to identify the reference air pressure value corresponding to the reference floor from the air pressure data and the terminal air pressure value corresponding to the terminal of the floor change from the air pressure data when it is determined according to the air pressure change that the floor where the electronic device is located no longer changes;
[0159] The acquisition module 530 is used to determine the first target floor where the electronic device is located according to the reference air pressure value and the end point air pressure value, and to acquire a first wireless signal fingerprint corresponding to the first target floor;
[0160] The storage module 540 is used to store the corresponding relationship between the first wireless signal fingerprint and the first target floor into the wireless signal fingerprint library;
[0161] The matching module 550 is used to determine a second target floor matching the second wireless signal fingerprint from the wireless signal fingerprint library when the electronic device is turned on and the electronic device collects the second wireless signal fingerprint.
[0162] In one embodiment, the air pressure data includes sets of air pressure values corresponding to a plurality of sampling periods, and the set of air pressure values corresponding to each sampling period includes a plurality of air pressure values collected in each sampling period;
[0163] The judgment module 510 may be used to determine the first air pressure change corresponding to each sampling period according to the multiple air pressure values included in the air pressure set corresponding to each sampling period;
[0164] According to the first air pressure change amount corresponding to each sampling period, N consecutive valid sampling periods are identified from multiple sampling periods; the first air pressure change amounts corresponding to the N consecutive valid sampling periods are all greater than the first air pressure threshold; N is a positive integer greater than or equal to 1;
[0165] It is determined whether the floor where the electronic device is located has changed according to a second air pressure change amount between a maximum air pressure value and a minimum air pressure value among a plurality of air pressure values corresponding to N consecutive effective sampling periods.
[0166] In one embodiment, the judgment module 510 is also used to determine that the floor where the electronic device is located has changed if the second air pressure change between the maximum air pressure value and the minimum air pressure value among the multiple air pressure values corresponding to N consecutive valid sampling periods is greater than the second air pressure threshold; if the second air pressure change is less than the second air pressure threshold, it is determined that the floor where the electronic device is located has not changed.
[0167] In one embodiment, the air pressure data includes first air pressure data collected when the electronic device is in an outdoor environment; the identification module 520 is also used to obtain the distance change of the electronic device within a preset time period before the target moment when the electronic device enters the indoor environment from the outdoor environment; when the distance change is less than the first distance threshold, the reference air pressure value corresponding to the reference floor is identified from the first air pressure data; and / or, when the distance change is greater than the second distance threshold, the air pressure value collected at the target moment is determined as the reference air pressure value corresponding to the reference floor.
[0168] In one embodiment, the storage module 540 is also used to store the correspondence between the first wireless signal fingerprint and the first target floor in the wireless signal fingerprint library if it is detected that there is a third wireless signal fingerprint corresponding to the first target floor in the wireless signal fingerprint library, and when it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar.
[0169] In one embodiment, the storage module 540 is also used to obtain the wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint respectively; when the number of identical wireless signal sources in the wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint respectively is less than a first quantity threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
[0170] In one embodiment, the storage module 540 is also used to determine that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar when the difference in signal strength between the first wireless signal fingerprint and the third wireless signal fingerprint under each identical wireless signal source is greater than a first signal threshold, and store the correspondence between the first wireless signal fingerprint and the first target floor in the wireless signal fingerprint library.
[0171] In one embodiment, the floor positioning device 500 is also used to re-collect the fourth wireless signal fingerprint corresponding to the first target floor and replace the first wireless signal fingerprint with the fourth wireless signal fingerprint when the number of movement steps detected by the electronic device on the first target floor is greater than the first step number threshold; and / or, when the electronic device detects that the duration of stay on the first target floor is greater than the first duration threshold, re-collect the fourth wireless signal fingerprint corresponding to the first target floor and replace the first wireless signal fingerprint with the fourth wireless signal fingerprint; and store the correspondence between the fourth wireless signal fingerprint and the first target floor in the wireless signal fingerprint library.
[0172] See also Figure 6 , Figure 6 Schematic diagram of the structure of an electronic device disclosed in the embodiment of the present application. Figure 6 As shown, the electronic device 600 may include:
[0173] A memory 610 storing executable program code;
[0174] a processor 620 coupled to the memory 610;
[0175] The processor 620 calls the executable program code stored in the memory 610 to execute any floor positioning method disclosed in the embodiments of the present application.
[0176] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by the processor, the processor implements any one of the floor positioning methods disclosed in the embodiment of the present application.
[0177] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.
[0178] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0179] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0180] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0181] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.
[0182] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0183] The above is a detailed introduction to a floor positioning method, device, electronic device and storage medium disclosed in the embodiments of the present application. The principles and implementation methods of the present application are described in detail using specific examples. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those skilled in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as limiting the present application.
Claims
1. A floor positioning method, characterized in that: The method comprises: Acquire air pressure data collected by a barometer of an electronic device, the air pressure data comprising: sets of air pressure values corresponding to a plurality of sampling periods, the set of air pressure values corresponding to each sampling period comprising a plurality of air pressure values collected in each sampling period; Determine a first air pressure change amount corresponding to each sampling period according to a plurality of air pressure values included in the air pressure set corresponding to each sampling period; According to the first air pressure change amount corresponding to each of the sampling periods, N consecutive valid sampling periods are identified from the multiple sampling periods; the first air pressure change amounts corresponding to the N consecutive valid sampling periods are all greater than the first air pressure threshold; N is a positive integer greater than or equal to 1; Determining whether the floor where the electronic device is located has changed according to a second air pressure change between a maximum air pressure value and a minimum air pressure value among a plurality of air pressure values corresponding to the N consecutive effective sampling periods; When it is determined according to the air pressure change that the floor where the electronic device is located no longer changes, identifying a reference air pressure value corresponding to the reference floor from the air pressure data, and identifying an end point air pressure value corresponding to an end point of the floor change from the air pressure data; Determining a first target floor where the electronic device is located according to the reference air pressure value and the endpoint air pressure value, and collecting a first wireless signal fingerprint corresponding to the first target floor; Storing the correspondence between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library; When the electronic device is turned on, if the electronic device collects a second wireless signal fingerprint, a second target floor matching the second wireless signal fingerprint is determined from the wireless signal fingerprint library.
2. The method according to claim 1, characterized in that The determining, based on a second air pressure change between a maximum air pressure value and a minimum air pressure value among a plurality of air pressure values corresponding to the N consecutive effective sampling periods, whether the floor where the electronic device is located has changed includes: If the second air pressure change between the maximum air pressure value and the minimum air pressure value among the multiple air pressure values corresponding to the N consecutive effective sampling periods is greater than the second air pressure threshold, it is determined that the floor where the electronic device is located has changed; If the second air pressure change is less than the second air pressure threshold, it is determined that the floor where the electronic device is located has not changed.
3. The method according to claim 1, characterized in that The air pressure data includes: first air pressure data collected when the electronic device is in an outdoor environment; The step of identifying a reference air pressure value corresponding to a reference floor from the air pressure data comprises: Acquire a distance change amount of the electronic device within a preset time period before a target time when the electronic device enters an indoor environment from an outdoor environment; When the distance change is less than a first distance threshold, identifying a reference air pressure value corresponding to the reference floor from the first air pressure data; and / or, When the distance change is greater than a second distance threshold, the air pressure value collected at the target time is determined as the reference air pressure value corresponding to the reference floor.
4. The method according to claim 1, characterized in that The storing the correspondence between the first wireless signal fingerprint and the first target floor into a wireless signal fingerprint library includes: If it is detected that there is a third wireless signal fingerprint corresponding to the first target floor in the wireless signal fingerprint library, when it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
5. The method according to claim 4, characterized in that When it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, storing the corresponding relationship between the first wireless signal fingerprint and the first target floor in the wireless signal fingerprint library includes: Obtaining wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint respectively; When the number of identical wireless signal sources in the wireless signal sources corresponding to the first wireless signal fingerprint and the third wireless signal fingerprint respectively is less than a first quantity threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
6. The method according to claim 4, characterized in that The first wireless signal fingerprint and the third wireless signal fingerprint correspond to at least one same wireless signal source; when it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, storing the correspondence between the first wireless signal fingerprint and the first target floor in the wireless signal fingerprint library, comprising: When the difference in signal strength between the first wireless signal fingerprint and the third wireless signal fingerprint under each identical wireless signal source is greater than a first signal threshold, it is determined that the first wireless signal fingerprint and the third wireless signal fingerprint are not similar, and the correspondence between the first wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
7. The method according to claim 1, characterized in that After storing the correspondence between the first wireless signal fingerprint and the first target floor in a wireless signal fingerprint library, the method further includes: When the number of movement steps detected by the electronic device on the first target floor is greater than the first step number threshold, re-collecting a fourth wireless signal fingerprint corresponding to the first target floor, and replacing the first wireless signal fingerprint with the fourth wireless signal fingerprint; and / or, When the electronic device detects that the duration of staying on the first target floor is greater than a first duration threshold, re-collecting a fourth wireless signal fingerprint corresponding to the first target floor, and replacing the first wireless signal fingerprint with the fourth wireless signal fingerprint; The corresponding relationship between the fourth wireless signal fingerprint and the first target floor is stored in the wireless signal fingerprint library.
8. A floor positioning device, characterized in that: include: A judgment module, used to obtain air pressure data collected by a barometer of an electronic device, the air pressure data including: a set of air pressure values corresponding to a plurality of sampling periods, the air pressure value set corresponding to each sampling period including a plurality of air pressure values collected in each sampling period; determining a first air pressure change corresponding to each sampling period according to the plurality of air pressure values included in the air pressure set corresponding to each sampling period; identifying N consecutive valid sampling periods from the plurality of sampling periods according to the first air pressure change corresponding to each sampling period; the first air pressure change corresponding to the N consecutive valid sampling periods is greater than a first air pressure threshold; N is a positive integer greater than or equal to 1; judging whether the floor where the electronic device is located has changed according to a second air pressure change between a maximum air pressure value and a minimum air pressure value among the plurality of air pressure values corresponding to the N consecutive valid sampling periods; an identification module, for identifying a reference air pressure value corresponding to a reference floor from the air pressure data, and identifying an end point air pressure value corresponding to an end point of a floor change from the air pressure data, when it is determined according to the air pressure change that the floor where the electronic device is located no longer changes; a collection module, configured to determine a first target floor where the electronic device is located according to the reference air pressure value and the end point air pressure value, and collect a first wireless signal fingerprint corresponding to the first target floor; A storage module, used for storing the corresponding relationship between the first wireless signal fingerprint and the first target floor into a wireless signal fingerprint library; The matching module is used to determine a second target floor matching the second wireless signal fingerprint from the wireless signal fingerprint library when the electronic device is turned on and the second wireless signal fingerprint is collected by the electronic device.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
