Floor positioning method and device, electronic equipment and storage medium
Through a floor positioning method that combines motion sensors and air pressure sensors, and uses movement recognition models and height topology data, it solves the problem of low floor positioning accuracy in the existing technology and achieves higher floor recognition accuracy.
Patent Information
- Application Number
- CN202310247876.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-14
- Publication Date
- 2024-09-20
AI Technical Summary
Existing floor positioning technology has low accuracy among different buildings and floors, making it difficult to accurately determine the floor where electronic equipment is located.
The movement data is detected by the motion sensor and the air pressure data is detected by the air pressure sensor. Combined with the movement pattern recognition model, the state of the electronic equipment going up and down the stairs is determined. The target height value of the floor is calculated based on the air pressure data. It is combined with the height topology data of the building to accurately locate the number of floors. .
The accuracy of floor positioning is improved, the floor where the electronic equipment is located can be determined in real time and accurately, errors are reduced, and the reliability of floor identification is enhanced.
Smart Images

Figure CN118678291A
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] With the continuous development of electronic products, the importance of the positioning function of electronic products has become increasingly apparent. Users' travel and other activities are inseparable from the positioning services provided by electronic devices. Floor positioning is an important part of the positioning function of electronic devices. Due to the different floor heights of different buildings and the different floor heights of a building, the existing floor positioning technology has low accuracy when performing floor positioning. Summary of the invention
[0003] The embodiments of the present application disclose a floor positioning method, device, electronic device and storage medium, which can improve the accuracy of the determined current floor.
[0004] A first aspect of an embodiment of the present application provides a floor positioning method, which is applied to an electronic device, and the method includes:
[0005] determining a target building where the electronic device is located;
[0006] Detect motion data through a motion sensor and detect air pressure data through an air pressure sensor;
[0007] The motion data and air pressure data are input into a movement mode recognition model, and the corresponding upstairs and downstairs state of the electronic device is determined by the movement mode recognition model; the movement mode recognition model is trained based on multiple groups of target sample data, each group of target sample data includes an upstairs and downstairs state label, motion sample data corresponding to the upstairs and downstairs state label, and air pressure sample data;
[0008] If it is determined according to the up / down stairs status that the electronic device changes floors and reaches a new floor, then, according to the air pressure data collected by the air pressure sensor at the new floor, a target height value of the new floor relative to the reference plane is calculated;
[0009] The number of floors corresponding to the new floor is determined according to the target height value and the height topological data corresponding to the target building; the height topological data corresponding to the target building includes the height value of each floor in the target building relative to the reference plane.
[0010] As an optional implementation manner, in the first aspect of the embodiment of the present application, before determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building, the method further includes:
[0011] Acquire one or more height values collected by the electronic device on each floor of the target building, where the height value is a height difference between the location of the electronic device and the reference plane;
[0012] Clustering the collected one or more height values, respectively determining the distance between each of the collected height values and the cluster center of each cluster, so as to determine the cluster corresponding to each of the height values; wherein each of the clusters corresponds to the height value of a floor;
[0013] According to the height values contained in each of the clusters, the cluster centers of the clusters are re-determined, and the height values of each floor in the target building relative to the reference plane are determined according to the re-determined cluster centers.
[0014] As an optional implementation manner, in the first aspect of the embodiment of the present application, determining the target building where the electronic device is located includes:
[0015] Collecting positioning information through the positioning system, obtaining building outline information corresponding to the positioning information from the cloud, and obtaining scanned wireless fidelity WiFi fingerprint information;
[0016] Determine a plurality of first buildings according to the positioning information, wherein the first buildings are buildings whose distances from the positioning information are within a preset range;
[0017] A target building matching the WiFi fingerprint information and the building outline information is determined from the multiple first buildings.
[0018] As an optional implementation, in the first aspect of the embodiment of the present application, detecting motion data by a motion sensor and detecting air pressure data by an air pressure sensor includes:
[0019] If the positioning signal strength corresponding to the positioning system is lower than the strength threshold and the WiFi fingerprint information can be scanned, it is determined that the electronic device has entered the target building;
[0020] When the electronic device is located inside the target building, motion data is detected by a motion sensor, and air pressure data is detected by an air pressure sensor.
[0021] As an optional implementation, in the first aspect of the embodiment of the present application, before inputting the motion data and the air pressure data into a movement mode recognition model and determining the current upstairs or downstairs state of the electronic device by the movement mode recognition model, the method further includes:
[0022] Acquire motion sample data, air pressure sample data, and stair up / down state labels corresponding to the motion sample data and air pressure sample data;
[0023] Convert the motion sample data into a first sequence of data based on time, and convert the air pressure sample data into a second sequence of data based on time;
[0024] The first sequence data, the second sequence data and the corresponding going up and down stairs state labels are input into the movement mode recognition model for training, so that the movement mode recognition model learns the sequence data change characteristics corresponding to each going up and down stairs state, and obtains the trained movement mode recognition model.
[0025] As an optional implementation, in the first aspect of the embodiment of the present application, before inputting the motion data and the air pressure data into a movement mode recognition model and determining the current upstairs or downstairs state of the electronic device by the movement mode recognition model, the method further includes:
[0026] Processing the motion data using a median filtering algorithm to obtain filtered motion data;
[0027] Using a Kalman filter algorithm to process the air pressure data to obtain filtered air pressure data;
[0028] Performing feature extraction on the filtered motion data and the filtered air pressure data respectively to obtain motion feature data and air pressure feature data;
[0029] The step of inputting the motion data and the air pressure data into a movement mode recognition model and determining the current corresponding upstairs and downstairs state of the electronic device through the movement mode recognition model includes:
[0030] The motion feature data and the air pressure feature data are input into a movement mode recognition model, and the current corresponding upstairs and downstairs state of the electronic device is determined by the movement mode recognition model.
[0031] As an optional implementation manner, in the first aspect of the embodiment of the present application, before determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building, it also includes:
[0032] Acquire an initial height value of an initial floor relative to the reference plane, and determine a floor height change value according to the initial height value and the target height value; the initial floor is the floor where the electronic device is located before the floor change occurs;
[0033] The step of determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building includes:
[0034] If the floor height change value matches the up-and-down status, the number of floors corresponding to the new floor is determined according to the target height value and the height topology data corresponding to the target building.
[0035] A second aspect of an embodiment of the present application provides a floor positioning device, the device comprising:
[0036] A location determination module, used to determine the target building where the electronic device is located;
[0037] A data acquisition module, used to detect motion data through a motion sensor and detect air pressure data through an air pressure sensor;
[0038] A movement recognition module is used to input the motion data and air pressure data into a movement mode recognition model, and determine the current upstairs and downstairs state of the electronic device through the movement mode recognition model; the movement mode recognition model is trained based on multiple groups of target sample data, each group of target sample data includes a upstairs and downstairs state label, motion sample data corresponding to the upstairs and downstairs state label, and air pressure sample data;
[0039] a height calculation module, configured to calculate a target height value of the new floor relative to a reference plane according to the air pressure data collected by the air pressure sensor at the new floor, if it is determined according to the up / down stairs status that the electronic device changes floors and reaches a new floor;
[0040] The floor positioning module is used to determine the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building; the height topological data corresponding to the target building includes the height value of each floor in the target building relative to the reference plane.
[0041] A third aspect of an embodiment of the present application provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements any one of the floor positioning methods disclosed in the embodiments of the present application.
[0042] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, any one of the floor positioning methods disclosed in the embodiments of the present application is implemented.
[0043] Compared with the related art, the embodiments of the present application have the following beneficial effects:
[0044] Determine the target building where the electronic device is located, and detect the motion data through the motion sensor and the air pressure data through the air pressure sensor in real time, and then input the motion data and the air pressure data into the movement mode input model to output the current corresponding up and down state of the electronic device. Among them, the movement mode recognition model is trained according to multiple target sample data, and the target sample data includes the up and down state label, and the motion sample data and the air pressure sample data corresponding to the up and down state label. When the electronic device determines that the electronic device has changed floors according to the up and down state, and the electronic device has reached a new floor, the electronic device calculates the target height value of the new floor relative to the reference plane according to the air pressure data collected on the new floor. In the embodiment of the present application, the electronic device uses the movement mode recognition model to determine the up and down state of the electronic device, and the movement mode recognition model is more obvious for this kind of up and down recognition with more features, and has a better effect. The electronic device determines the number of floors of the new floor where the electronic device is located according to the target height value and the height topological data corresponding to the target building, that is, the height value of each floor in the target building relative to the reference plane, and can determine which floor the new floor is according to the target height value of the electronic device reaching the new floor, combined with the specific structural data of the building, thereby improving the accuracy of the number of floors of the new floor finally determined. 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 is a schematic diagram of an application scenario of a floor positioning method disclosed in an embodiment;
[0047] Figure 2 is a schematic diagram of a method flow of a floor positioning method disclosed in an embodiment;
[0048] Figure 3 is a method flow diagram of another floor positioning method disclosed in an embodiment;
[0049] Figure 4 is a structural schematic diagram of a floor positioning device disclosed in an embodiment;
[0050] Figure 5 The present invention is a schematic diagram of the structure of an electronic device disclosed in an embodiment. DETAILED DESCRIPTION
[0051] 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.
[0052] 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.
[0053] The embodiments of the present application disclose a floor positioning method, device, electronic device and storage medium, which can improve the accuracy of determining the current floor.
[0054] See also Figure 1 , Figure 1 FIG. 1 is a schematic diagram of an application scenario of a floor positioning method disclosed in an embodiment. Figure 1 As shown, it may include an electronic device 10 and several buildings 20. The electronic device 10 may be equipped with a processor, a signal detection device, a motion sensor, an air pressure sensor, etc., but is not limited thereto. Each building may be equipped with one or more wireless network devices, such as a routing device, etc. The wireless network device is used to transmit WiFi signals to provide WiFi hotspots for the electronic device 10 to access. The electronic device 10 can determine the target building according to the positioning information and / or the WiFi fingerprint information obtained by scanning. The electronic device 10 detects motion data through a motion sensor and detects air pressure data through an air pressure sensor, and inputs the detected motion data and air pressure data into a mobile mode recognition model to determine the current corresponding up-and-down state of the electronic device 10 through the mobile mode recognition model. If it is determined that the electronic device has changed floors and has reached a new floor according to the up-and-down state, the electronic device 10 calculates the target height value of the new floor relative to the reference plane according to the air pressure data collected on the new floor, and determines the target floor where the electronic device 10 is currently located according to the target height value and the height value of each floor in the target building relative to the reference plane, that is, the height topology data corresponding to the target building.
[0055] See also Figure 2 , Figure 2 FIG. 1 is a flow chart of a method for floor positioning disclosed in an embodiment, and the method can be applied to the aforementioned electronic device 10. Figure 2As shown, the method may include the following steps:
[0056] 210. Determine the target building where the electronic equipment is located.
[0057] In the embodiment of the present application, the electronic device can obtain the current positioning information of the electronic device through the built-in positioning device, such as the global positioning system GPS positioning, and determine the target building where the electronic device is located in combination with information carriers containing different building information such as high-definition maps. For example, the electronic device determines the current location, and combines the area covered by each building in the high-definition map to determine whether the current location of the electronic device falls into the area covered by any building. If so, it is determined that the target building where the electronic device is currently located is the building corresponding to the area where the current location falls.
[0058] 220. Detect motion data through a motion sensor, and detect air pressure data through an air pressure sensor.
[0059] In the embodiment of the present application, the electronic device may be provided with a motion sensor and an air pressure sensor, which may be internal or external, and is not specifically limited thereto. The electronic device detects the motion data of the user carrying the electronic device, or the motion data of the electronic device, in real time through the motion sensor; the electronic device also detects the air pressure data of the location of the electronic device in real time through the air pressure sensor.
[0060] In some embodiments, the motion sensor may be an inertial measurement unit (IMU), and the motion data detected by the IMU may be six-axis data, namely three-axis acceleration data and three-axis angular velocity data, which can effectively reflect the motion of the electronic device.
[0061] 230. Input the motion data and air pressure data into a movement mode recognition model, and determine the corresponding up-and-downstairs state of the electronic device through the movement mode recognition model; the movement mode recognition model is trained based on multiple groups of target sample data, and each group of target sample data includes an up-and-downstairs state label, motion sample data corresponding to the up-and-downstairs state label, and air pressure sample data.
[0062] In the embodiment of the present application, the movement mode recognition model is used to output the current corresponding upstairs and downstairs state of the electronic device according to the current motion data of the electronic device and the air pressure data of the current location of the electronic device. Therefore, the electronic device inputs the real-time detected motion data and air pressure data into the movement mode recognition model, and the movement mode recognition model determines the current corresponding upstairs and downstairs state of the electronic device according to the changes in the motion data and the changes in the air pressure data. Among them, the upstairs and downstairs state can include a horizontal movement state, an upward movement state, and a downward movement state.
[0063] In an embodiment of the present application, the movement mode recognition model input with motion data and air pressure data is a trained movement mode recognition model. The electronic device or other terminal device can use multiple groups of target sample data to train the movement mode recognition model to obtain a trained movement mode recognition model. Among them, each group of target sample data used for training includes a going up and down stairs state label, and the movement sample data and air pressure sample data corresponding to the going up and down stairs state label. The electronic device uses the movement mode recognition model to determine the going up and down stairs state of the electronic device. Since the movement mode recognition model used is obtained by training based on multiple groups of target sample data, and each group of target sample data includes the going up and down stairs state label, the movement sample data corresponding to the going up and down stairs state label, and the air pressure sample data, the use of this movement mode recognition model is more obvious for the going up and down stairs recognition with more features, and has a better effect.
[0064] In the embodiment of the present application, the up-and-down state may include at least a horizontal moving state, an upward moving state, and a downward moving state. Among them, the horizontal moving state indicates that the electronic device moves on the same floor, that is, the electronic device does not change floors; the upward moving state indicates that the electronic device changes floors, and moves from a relatively low floor to a relatively high floor; the downward moving state indicates that the electronic device changes floors, and moves from a relatively high floor to a relatively low floor. Here, relatively high and relatively low indicate the height of the floor before the electronic device changes floors relative to the floor after the floor changes. Therefore, if the mobile mode recognition model determines the up-and-down state of the electronic device at each moment in real time based on the motion data and air pressure data collected in real time. If the electronic device can determine the up-and-down state change of the electronic device in a time period according to the up-and-down state determined in real time, the electronic device can determine that the floor change has occurred, and the electronic device can determine that it has reached a new floor; and if the mobile mode recognition model determines the up-and-down state of the electronic device at each moment in real time based on the motion data and air pressure data collected in real time. Based on the real-time up-and-down stairs status determined by the electronic device, if it can determine within a time period that the up-and-down stairs status changes such as first moving in a horizontal moving state and then moving in an upward moving state, or first moving in a horizontal moving state and then moving in a downward moving state, the electronic device can determine that a floor change has occurred, but at the same time determine that the electronic device is still moving and has not reached a new floor.
[0065] 240. If it is determined according to the up / down stairs status that the electronic device changes floors and reaches a new floor, a target height value of the new floor relative to the reference plane is calculated according to the air pressure data collected by the air pressure sensor on the new floor.
[0066] In an embodiment of the present application, the electronic device determines the real-time corresponding up-and-down stairs state of the electronic device according to the above-mentioned movement mode recognition model. If, according to the real-time up-and-down stairs state, it is determined according to the above-mentioned judgment method that the electronic device has changed floors and reached a new floor, then the electronic device can filter out the air pressure data collected on the new floor from the air pressure data detected in real time by the air pressure sensor, and calculate the height value of the new floor reached by the electronic device relative to the reference plane based on the filtered air pressure data, that is, the target height value. Among them, the electronic device filters out the air pressure data collected on the new floor from the air pressure data detected in real time by the air pressure sensor, and specifically can determine the time point when the electronic device moves to the new floor according to the up-and-down stairs state, and determine the air pressure data collected by the air pressure sensor after this time as the air pressure data collected on the new floor.
[0067] In the embodiment of the present application, the electronic device can calculate the target height value of the new floor relative to the reference plane based on the air pressure data collected by the electronic device on the new floor and the air pressure data of the reference plane. The reference plane can be the sea level or the plane of the building where the electronic device is located, such as the ground of the first floor of the building where the electronic device is located.
[0068] In some embodiments, the electronic device calculates the target height value of the new floor where the electronic device is located after the floor change according to the acquired air pressure data. The target height value can be calculated according to the air pressure data collected by the electronic device at the new floor. The specific calculation method can be shown in formula (1):
[0069]
[0070] Among them, h_change(p,p0) represents the target height value of the electronic device when the floor changes and it reaches the new floor, p represents the air pressure data detected by the electronic device at the new floor, and p0 represents the air pressure data detected on the floor where the electronic device was before the floor change. Formula (1) can accurately calculate the target height value of the electronic device when the floor changes and it reaches the new floor. The above calculation formula can improve the accuracy of the obtained target height value.
[0071] 250. Determine the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building; the height topological data corresponding to the target building includes the height value of each floor in the target building relative to the reference plane.
[0072] In an embodiment of the present application, the electronic device can determine which floor of the target building the electronic device is located on based on the target height value and the height value of each floor of the target building relative to the reference plane, and then determine the number of the new floor.
[0073] By adopting the above embodiment, the specific floor of the new floor can be determined based on the target height value of the electronic device reaching the new floor in combination with the height topology data of the building, thereby improving the accuracy of the final determined number of new floors.
[0074] In some embodiments, before determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building, the method further includes:
[0075] Acquire one or more height values collected by the electronic device on each floor of the target building, where the height value is the height difference between the location of the electronic device and the reference plane;
[0076] Clustering the collected one or more height values, respectively determining the distance between each collected height value and the cluster center of each cluster class, so as to determine the cluster class corresponding to each height value; wherein each cluster class corresponds to the height value of a floor;
[0077] According to the height values contained in each cluster, the cluster center of each cluster is re-determined, and the height value of each floor in the target building relative to the reference plane is determined according to the re-determined cluster centers.
[0078] In an embodiment of the present application, the electronic device can determine the height topology data corresponding to each building, especially the height topology data corresponding to the target building, by clustering before determining the number of floors corresponding to a new floor based on the target height value and the height topology data corresponding to the target building, or before performing floor positioning.
[0079] Among them, for the height topological data corresponding to the target building, the specific determination method can be that the electronic device obtains one or more height values pre-collected on each floor of the target building, and the height value is the height difference of the location of the electronic device relative to the reference plane, or the height difference of the floor where the electronic device is located relative to the reference plane. Among them, the electronic device can pre-collect air pressure data on each floor of the target building through an air pressure sensor, and determine the height difference of each floor of the target building relative to the reference plane based on the air pressure data pre-collected on each floor and the air pressure data of the reference plane.
[0080] The electronic device clusters the collected one or more height values, and determines the distance between each collected height value and the cluster center of each cluster in the clustering algorithm, thereby determining the cluster to which each height value belongs. Among them, the clustering algorithm may include several clusters, and the number of clusters included corresponds to the number of floors in the target building. Each cluster corresponds to the height value of a floor, and the cluster center of each cluster can be a preset floor height value. For example, if the target building contains 20 floors, then the clustering algorithm may include 20 clusters, cluster 1 corresponds to the height value of the second floor of the target building, and the cluster center of cluster 1 is the preset height value of 2.5m on the second floor of the target building. The electronic device clusters the collected one or more height values, wherein the distance between each height value and the cluster center of cluster 1 is calculated respectively. If the distance between the height value a and the cluster center of each cluster is the closest to the cluster center of cluster 1, then it can be determined that the height value a belongs to cluster 1.
[0081] The electronic device calculates the average value of all height values in the cluster based on the height values contained in each cluster, redefines the average value as the cluster center of the cluster, and can determine the redetermined cluster centers of each cluster as the height values of each floor in the target building relative to the reference plane. For example, after clustering, the height values contained in cluster 1 are 2.5m, 3.0m, 2.9m, and 2.6m, then the average value of the height values contained in cluster 1 is calculated to be 2.75m, then the electronic device can determine 2.75m as the height value of the second floor of the target building relative to the reference plane. The reference plane here can be the ground of the first floor of the target building.
[0082] By adopting the above method, the height value of each floor in the target building relative to the reference plane, that is, the height topological data corresponding to the target building, can be determined, and the height topological data corresponding to other buildings can also be determined.
[0083] By adopting the above embodiment, the height topological data corresponding to the building is determined according to the pre-collected data by clustering, so that the accuracy of the determined floor height data of each floor in the building can be improved.
[0084] In one embodiment, see Figure 3 , Figure 3 FIG. 1 is a flow chart of another method for floor positioning disclosed in an embodiment, and the method can be applied to the aforementioned electronic device 10. Figure 3 As shown, the method may include the following steps:
[0085] 310. Collect positioning information through the positioning system, obtain building outline information corresponding to the positioning information from the cloud, and obtain the scanned wireless fidelity WiFi fingerprint information.
[0086] In an embodiment of the present application, the electronic device can communicate with a positioning system such as a global positioning system GPS to collect the positioning information of the electronic device in real time. The electronic device can obtain the building outline information corresponding to the positioning information from an external terminal device or server such as a cloud; wherein the building outline information can be a three-dimensional stereogram of the building, and the building outline information corresponding to the positioning information can be the building outline information of the building closest to the position corresponding to the positioning information, or can be the building outline information of the building within a preset distance from the position corresponding to the positioning information. The electronic device scans the WiFi fingerprint information in real time to obtain the scanned WiFi fingerprint information. wherein the WiFi fingerprint information can uniquely correspond to a building.
[0087] 320. Determine a plurality of first buildings according to the positioning information, where the first buildings are buildings whose distances from the positioning information are within a preset range.
[0088] In the embodiment of the present application, the electronic device can determine the current location of the electronic device according to the positioning information, calculate the distance between the multiple buildings near the electronic device and the location of the electronic device, and if the distance is within a preset range, then the building is considered to belong to the first building. For example, with the current location of the electronic device as the center and a circular area with a radius of 100m as the preset range, the building within the circular preset range is determined as the first building.
[0089] 330. Determine a target building that matches the WiFi fingerprint information and the building outline information from the multiple first buildings.
[0090] In an embodiment of the present application, the electronic device determines a target building that matches the scanned WiFi fingerprint information and / or building outline information from a plurality of first buildings. Specifically, at least one WiFi signal generator may be provided in each building, and each WiFi signal generator is used to transmit a specific WiFi signal. The electronic device collects WiFi signals at a preset sampling position, binds the position where the WiFi signal is collected, and the information of the collected WiFi signal, as WiFi fingerprint information, and stores them in a WiFi fingerprint information library. Then, the electronic device searches the WiFi fingerprint information library for the bound sampling position according to the scanned WiFi fingerprint information, determines in which first building the sampling position is located, and determines the first building where the sampling position is located as the target building. Alternatively, the electronic device or other terminal device may pre-construct the building outline information of each building, and upload the building outline information of each building to the cloud for storage. The electronic device determines the building outline information corresponding to the positioning information obtained from the cloud, which may be the building outline information of the building within the preset range of the corresponding position of the positioning information. According to the three-dimensional solid where the positioning information is located, the building outline information corresponding to the three-dimensional solid and the building corresponding to the building outline information are determined, thereby determining the building as the target building from the plurality of first buildings. Alternatively, the electronic device searches for the bound sampling location from the WiFi fingerprint information library based on the scanned WiFi fingerprint information, determines in which first building the sampling location is located, and also determines the building outline information corresponding to the three-dimensional solid and the building corresponding to the building outline information based on the three-dimensional solid where the location of the positioning information is located. If the first building screened out according to the WiFi fingerprint information is the same as the first building screened out according to the building outline information, then the first building can be determined as the target building; if the first building screened out according to the WiFi fingerprint information is different from the first building screened out according to the building outline information, then the building outline information can be re-acquired and the WiFi fingerprint information can be scanned to re-determine the target building.
[0091] Using the above embodiment, firstly, since the GPS signal may be interfered by different environments, there may be no GPS signal in some places, resulting in inaccurate positioning. Therefore, the WiFi fingerprint information is used to assist in determining the target building, thereby improving the accuracy of the target building determination. For larger buildings, there may be multiple entrances and exits, and each entrance and exit is far away, so there will be a scenario where the WiFi fingerprint information matching fails. Therefore, combining the building outline information can further improve the accuracy of the target building determination.
[0092] 340. If the positioning signal strength corresponding to the positioning system is lower than the strength threshold and the WiFi fingerprint information can be scanned, it is determined that the electronic device has entered the target building.
[0093] In an embodiment of the present application, after obtaining the positioning signal, the electronic device can compare the strength of the obtained positioning signal with a preset strength threshold. If the positioning signal strength is higher than or equal to the strength threshold, the electronic device can determine that it is still outside the target building; and if the positioning signal strength is lower than the strength threshold, the electronic device can check the scanned WiFi fingerprint information at this time. If the WiFi fingerprint information can still be scanned, the electronic device can determine that it is currently inside the target building. This is because the positioning information is obtained through a positioning system or the like. Generally, the strength of the positioning information received when located outside the building will be higher, and the strength of the positioning information received when located inside the building will be weaker. Since the WiFi fingerprint information is sent by a wireless signal generator or the like inside the building, the WiFi fingerprint information scanned by the electronic device when it is inside the building will not be affected.
[0094] 350. When the electronic device is located inside the target building, the motion data is detected by the motion sensor, and the air pressure data is detected by the air pressure sensor.
[0095] In an embodiment of the present application, if the electronic device determines that the electronic device is located inside the target building, the motion sensor and the air pressure sensor can be controlled to detect motion data through the motion sensor and to detect air pressure data through the air pressure sensor.
[0096] Since the electronic device needs to be located inside a building for a floor change to occur, the above embodiment can be used to start data collection when the electronic device is located inside the target building, thereby reducing unnecessary data collection and lowering the energy consumption of the electronic device.
[0097] In some embodiments, the electronic device can obtain the strength of the positioning signal in real time, as well as scan the WiFi fingerprint information, and compare the positioning signal strength at each moment with the strength threshold. If the positioning signal strength at any moment is lower than the strength threshold, and the WiFi fingerprint information can be scanned at any moment, it is determined that the electronic device enters the target building at any moment. The moment when the electronic device moves from the outside of the target building to the inside of the target building can be determined. At this moment, the electronic device is generally located on the first floor of the target building. At this moment, the electronic device can collect the motion data and air pressure data at this moment through the motion sensor and the air pressure sensor, respectively. With the first floor of the target building as the reference plane, the data to be used is collected in advance, thereby improving the intelligence of the electronic device data collection process.
[0098] 360. Input the motion data and the air pressure data into a movement mode recognition model, and determine the corresponding upstairs and downstairs state of the electronic device through the movement mode recognition model; the movement mode recognition model is trained based on multiple groups of target sample data, each group of target sample data includes an upstairs and downstairs state label, motion sample data corresponding to the upstairs and downstairs state label, and air pressure sample data;
[0099] 370. If it is determined according to the up / down state that the electronic device changes floors and reaches a new floor, a target height value of the new floor relative to the reference plane is calculated according to the air pressure data collected by the air pressure sensor on the new floor;
[0100] 380. Determine the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building; the height topological data corresponding to the target building includes the height value of each floor in the target building relative to the reference plane.
[0101] In some embodiments, before the step of inputting the motion data and the air pressure data into the movement mode recognition model and determining the current upstairs and downstairs state of the electronic device through the movement mode recognition model, the following steps may also be included:
[0102] Obtain motion sample data, air pressure sample data, and stair up / down status labels corresponding to the motion sample data and air pressure sample data;
[0103] Convert the motion sample data into a first sequence of data based on time, and convert the air pressure sample data into a second sequence of data based on time;
[0104] The first sequence data, the second sequence data and the corresponding going up and down stairs state labels are input into the movement mode recognition model for training, so that the movement mode recognition model learns the sequence data change characteristics corresponding to each going up and down stairs state, and obtains the trained movement mode recognition model.
[0105] In an embodiment of the present application, before the electronic device uses a movement mode recognition model to identify the current corresponding up-and-down stairs state of the electronic device, or before performing floor positioning, the electronic device can train the movement mode recognition model to obtain a trained movement mode recognition model to identify the corresponding up-and-down stairs state of the electronic device.
[0106] The specific process of the electronic device training the mobile mode recognition model is that the electronic device first obtains motion sample data, air pressure sample data, and the up and down stairs label status corresponding to the motion sample data and the air pressure sample data, wherein the motion sample data and the air pressure sample data are respectively used for training the mobile mode recognition model. The motion sample data can be IMU data. The electronic device can collect motion data and air pressure data in real time and automatically before and after the user enters the building, and in the process of moving floors by taking an elevator or climbing stairs. After the collection, the electronic device can set indoor and outdoor labels for the collected motion sample data and air pressure sample data according to whether the user is located outside or inside the building when collecting the motion sample data and the air pressure sample data; for example, mark "indoor" or "outdoor"; the electronic device can also set up and down stairs status labels for the collected motion sample data and air pressure sample data according to the floor where the user is before and after the floor change when collecting the motion sample data and the air pressure sample data, such as marking "moving from the first floor to the fifth floor" or "moving from the fifth floor to the second floor".
[0107] Since the calculation of frequency domain features is complex and not conducive to real-time classification, the sample data of the electronic device needs to be calculated based on the time domain features. Therefore, the electronic device can convert the obtained motion sample data into the first sequence data based on time, and convert the obtained air pressure sample data into the second sequence data based on time. Finally, the electronic device can input the first sequence data, the second sequence data and the corresponding upstairs and downstairs state labels into the movement mode recognition model for training. The movement mode recognition model is trained by learning the sequence data change characteristics corresponding to each upstairs and downstairs state, thereby obtaining a trained movement mode recognition model.
[0108] By adopting the above embodiment, the electronic device sets labels for the motion sample data and the air pressure sample data according to the specific situation in the sample data collection process, and inputs the sample data and the labels corresponding to the sample data into the movement mode recognition model to implement model training, thereby improving the effect of model training, and further improving the accuracy of the subsequent model in identifying the movement mode according to the motion data and the air pressure data. In addition, the electronic device also processes the sample data based on the time domain characteristics, so that the data input into the movement mode recognition model for training can reflect the time characteristics of the sample data, thereby improving the real-time classification effect.
[0109] In some embodiments, before the step of inputting the motion data and the air pressure data into the movement mode recognition model and determining the current upstairs and downstairs state of the electronic device through the movement mode recognition model, the following steps may also be included:
[0110] The motion data is processed by using a median filter algorithm to obtain filtered motion data;
[0111] The Kalman filter algorithm is used to process the air pressure data to obtain filtered air pressure data;
[0112] Extracting features from the filtered motion data and the filtered air pressure data respectively to obtain motion feature data and air pressure feature data;
[0113] In the step of inputting the motion data and the air pressure data into the movement mode recognition model and determining the current upstairs and downstairs state of the electronic device through the movement mode recognition model, the following steps may be performed:
[0114] The motion feature data and the air pressure feature data are input into a movement mode recognition model, and the movement mode recognition model is used to determine the current corresponding upstairs and downstairs state of the electronic device.
[0115] In an embodiment of the present application, before the electronic device identifies the current corresponding upstairs or downstairs status of the electronic device through the movement mode recognition model, and after acquiring the motion data and air pressure data, the electronic device can perform corresponding processing on the motion data and air pressure data to remove the influence of noise or data anomalies.
[0116] The specific process of the electronic device processing the motion data and air pressure data can be: in order to remove noise data, the electronic device uses a median filtering algorithm to process the motion data to obtain filtered motion data; in order to avoid the influence of abnormal air pressure fluctuations, the electronic device uses a Kalman filtering algorithm to process the air pressure data to obtain filtered air pressure data.
[0117] Optionally, the motion data is six-axis data obtained by IMU detection, which are three-axis acceleration data ax, ay, az and three-axis angular velocity data gx, gy, gz. The vector sum of the three-axis acceleration data is represented by a_all, and the vector sum of the three-axis angular velocity data is represented by g_all. The electronic device uses a median filtering algorithm to process the six-axis data, and the specific formula of the filtered six-axis data is shown in formulas (2) to (4).
[0118]
[0119]
[0120]
[0121] Among them, a_all' is the vector sum of the three-axis acceleration after filtering, g_all' is the vector sum of the three-axis acceleration after filtering, and i represents the i-th six-axis data.
[0122] In the embodiment of the present application, since the frequency domain feature calculation is complex and not conducive to real-time classification, the motion data and air pressure data of the electronic device can also be calculated based on the time domain feature. Therefore, the electronic device can convert the obtained motion data into a third sequence data based on time, and convert the obtained air pressure data into a fourth sequence data based on time. After obtaining the third sequence data and the fourth sequence data based on time, the electronic device can also extract features from the third sequence data and the fourth sequence data respectively to obtain motion feature data and air pressure feature data. Among them, the electronic device can extract 121 feature values from the third sequence data and the fourth sequence data: 115 features can be extracted from the third sequence data corresponding to the motion data, including mean, standard deviation, variance, maximum and minimum values, quartiles and square absolute deviation; the remaining features can be extracted from the fourth sequence data corresponding to the air pressure data, including slope, monotonicity, standard deviation and range. The electronic device inputs the extracted motion feature data and air pressure feature data into the trained mobile mode recognition model, and the mobile mode recognition model outputs the current corresponding up and down stairs state of the electronic device.
[0123] In some embodiments, after the motion feature data and the air pressure feature data are extracted, the motion feature data and the air pressure feature data can be processed by a recursive algorithm to obtain an optimal subset of 14-dimensional features, and the optimal subset is input into a movement mode recognition model, and the movement mode recognition model outputs the current corresponding upstairs and downstairs state of the electronic device. Feature selection is performed on the motion feature data and the air pressure feature data to reduce the feature data input into the movement mode recognition model, which can improve the efficiency of upstairs and downstairs state recognition.
[0124] By adopting the above embodiment, by filtering and extracting features of motion data and air pressure data, the computational complexity of the going up and down stairs status recognition process is reduced to improve the efficiency of the subsequent going up and down stairs status recognition process, while also reducing the impact of noise data and / or data anomalies, thereby improving the accuracy of going up and down stairs status recognition.
[0125] In some embodiments, after the electronic device converts the motion sample data into a first sequence of time-based data and converts the air pressure sample data into a second sequence of time-based data, and before inputting the first sequence of data, the second sequence of data, and the corresponding upstairs and downstairs state labels into the movement mode recognition model for training, the electronic device may further include:
[0126] The motion sample data is processed by using a median filter algorithm to obtain filtered motion sample data;
[0127] The Kalman filter algorithm is used to process the air pressure sample data to obtain filtered air pressure sample data;
[0128] Feature extraction is performed on the filtered motion sample data and the filtered air pressure sample data to obtain motion sample feature data and air pressure sample feature data, so that the motion sample feature data, air pressure sample feature data and corresponding upstairs and downstairs state labels are input into the movement mode recognition model for training, which can improve the training efficiency and training effect.
[0129] In some embodiments, before executing the step of determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building, the following steps may also be included:
[0130] Obtaining an initial height value of an initial floor relative to a reference plane, and determining a floor height change value according to the initial height value and a target height value; the initial floor is the floor where the electronic device is located before the floor change occurs;
[0131] The step of determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building may include the following steps:
[0132] If the floor height change value matches the up-and-down status, the number of floors corresponding to the new floor is determined based on the target height value and the height topology data corresponding to the target building.
[0133] In the embodiment of the present application, the electronic device can determine the height values of the floors where the electronic device is located before and after the floor change, that is, the initial height value of the initial floor where the electronic device is located before the floor change, and the target height value of the new floor where the electronic device is located after the floor change. Based on the initial height value and the target height value, the electronic device can determine the height value moved by the electronic device during the current floor change, that is, the floor height change value.
[0134] The electronic device matches the determined floor height change value with the current corresponding up-and-down stairs state of the electronic device determined by the movement mode recognition model.
[0135] For example, if the electronic device moves from the 1st floor to the 5th floor, according to the air pressure data detected on the 1st floor and the air pressure data detected after reaching the 5th floor, the calculated floor height change value is 15m. The mobile mode recognition model determines that the current corresponding up and down state of the electronic device is the upward moving state according to the motion data and air pressure data, so the electronic device believes that the target height value matches the up and down state; if the electronic device moves from the 5th floor to the 2nd floor, according to the air pressure data detected on the 5th floor and the air pressure data detected after reaching the 2nd floor, the calculated floor height change value is -9m. The mobile mode recognition model determines that the current corresponding up and down state of the electronic device is the upward moving state according to the motion data and air pressure data, so the electronic device believes that the target height value does not match the up and down state; if the electronic device moves from the 5th floor to the 2nd floor, according to the air pressure data detected on the 5th floor and the air pressure data detected after reaching the 2nd floor, the calculated floor height change value is -9m. The mobile mode recognition model determines that the current corresponding up and down state of the electronic device is the downward moving state according to the motion data and air pressure data, so the electronic device believes that the target height value matches the up and down state. Among them, the electronic device determines that the height value on the first floor is 0m based on the air pressure data detected on the first floor, determines that the height value on the second floor is 6m based on the air pressure data detected on the second floor, and determines that the height value on the fifth floor is 15m based on the air pressure data detected on the fifth floor.
[0136] In the embodiment of the present application, if the electronic device determines that the obtained floor height change value matches the current up-and-down state of the electronic device output by the movement mode recognition model, then the electronic device can determine the number of floors where the electronic device is currently located, that is, the number of floors corresponding to the new floor, based on the target height value and the height topology data corresponding to the target building. The height topology data corresponding to the target building includes the height value of each floor in the target building relative to the reference plane.
[0137] By adopting the above embodiment, the height change of the electronic equipment during the floor change process is determined according to the height values relative to the reference plane before and after the floor change. Combined with the upstairs and downstairs status, it is judged whether the floor change has actually occurred and whether the floor change is reasonable, thereby avoiding miscalculations due to data fluctuations or errors and improving the accuracy of the floor positioning process.
[0138] In some embodiments, the step of determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building may include the following steps:
[0139] If the target height value is greater than the height change value corresponding to the first floor and less than the height change value corresponding to the second floor, the new floor is determined to be the first floor; the first floor is any floor, and the second floor is the floor adjacent to the first floor and above the first floor.
[0140] In an embodiment of the present application, the height topological data corresponding to the building is the height value of each floor in the building relative to the reference plane. Therefore, the electronic device can determine the height value of the floor with the same target height value, or the number of two floors located at both ends of the target height value, based on the target height value of the new floor reached by the electronic device in the target building relative to the reference plane, and then determine the number of the floor corresponding to the new floor where the electronic device is located.
[0141] For example, the electronic device determines that the height of the new floor reached is 16m relative to the reference plane, that is, relative to the first floor of the target building. The height of the sixth floor of the target building relative to the reference plane is 18m, and the height of the fifth floor of the target building relative to the reference plane is 15m. Therefore, it can be determined that the new floor reached by the electronic device is the fifth floor of the target building.
[0142] By adopting the above embodiment, the accuracy of the corresponding floor number of the electronic equipment reached after the floor change can be improved.
[0143] See also Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a structure of a floor positioning device disclosed in an embodiment, and the floor positioning device can be applied to an electronic device 10. Figure 4 As shown, the floor positioning device 400 may include: a position determination module 410, a data acquisition module 420, a movement identification module 430, a height calculation module 440 and a floor positioning module 450.
[0144] A location determination module 410, used to determine a target building where the electronic device is located;
[0145] A data acquisition module 420, configured to detect motion data through a motion sensor and detect air pressure data through an air pressure sensor;
[0146] The movement recognition module 430 is used to input the motion data and the air pressure data into the movement mode recognition model, and determine the current upstairs and downstairs state of the electronic device through the movement mode recognition model; the movement mode recognition model is trained based on multiple groups of target sample data, each group of target sample data includes an upstairs and downstairs state label, motion sample data corresponding to the upstairs and downstairs state label, and air pressure sample data;
[0147] The height calculation module 440 is used to calculate the target height value of the new floor relative to the reference plane according to the air pressure data collected by the air pressure sensor on the new floor if it is determined according to the up / down state that the electronic device changes floors and reaches a new floor;
[0148] The floor positioning module 450 is used to determine the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building; the height topological data corresponding to the target building includes the height value of each floor in the target building relative to the reference plane.
[0149] In some embodiments, the height calculation module 440 is further configured to:
[0150] Before determining the number of floors corresponding to the new floor according to the target height value and the height topology data corresponding to the target building, obtaining one or more height values collected by the electronic device on each floor of the target building, where the height value is the height difference of the position of the electronic device relative to the reference plane;
[0151] Clustering the collected one or more height values, respectively determining the distance between each collected height value and the cluster center of each cluster class, so as to determine the cluster class corresponding to each height value; wherein each cluster class corresponds to the height value of a floor;
[0152] According to the height values contained in each cluster, the cluster center of each cluster is re-determined, and the height value of each floor in the target building relative to the reference plane is determined according to the re-determined cluster centers.
[0153] In some embodiments, the location determination module 410 is further configured to:
[0154] Collect positioning information through the positioning system, obtain the building outline information corresponding to the positioning information from the cloud, and obtain the scanned wireless fidelity WiFi fingerprint information;
[0155] Determine a plurality of first buildings according to the positioning information, where the first buildings are buildings whose distances from the positioning information are within a preset range;
[0156] A target building matching the WiFi fingerprint information and the building outline information is determined from the plurality of first buildings.
[0157] In some embodiments, the data acquisition module 420 is further configured to:
[0158] If the positioning signal strength corresponding to the positioning system is lower than the strength threshold and the WiFi fingerprint information can be scanned, it is determined that the electronic device has entered the target building;
[0159] When the electronic device is located inside the target building, motion data is detected by the motion sensor, and air pressure data is detected by the air pressure sensor.
[0160] In some embodiments, the data acquisition module 420 is further configured to:
[0161] Before inputting the motion data and the air pressure data into the movement mode recognition model and determining the current upstairs and downstairs state corresponding to the electronic device through the movement mode recognition model, obtaining the motion sample data, the air pressure sample data and the upstairs and downstairs state labels corresponding to the motion sample data and the air pressure sample data;
[0162] Convert the motion sample data into a first sequence of data based on time, and convert the air pressure sample data into a second sequence of data based on time;
[0163] The first sequence data, the second sequence data and the corresponding going up and down stairs state labels are input into the movement mode recognition model for training, so that the movement mode recognition model learns the sequence data change characteristics corresponding to each going up and down stairs state, and obtains the trained movement mode recognition model.
[0164] In some embodiments, the data acquisition module 420 is further configured to:
[0165] Before the motion data and the air pressure data are input into the movement mode recognition model and the corresponding upstairs and downstairs state of the electronic device is determined by the movement mode recognition model, the motion data is processed by a median filtering algorithm to obtain filtered motion data;
[0166] The Kalman filter algorithm is used to process the air pressure data to obtain filtered air pressure data;
[0167] Extracting features from the filtered motion data and the filtered air pressure data respectively to obtain motion feature data and air pressure feature data;
[0168] The mobile identification module 430 is further used for:
[0169] The motion feature data and the air pressure feature data are input into a movement mode recognition model, and the movement mode recognition model is used to determine the current corresponding upstairs and downstairs state of the electronic device.
[0170] In some embodiments, the height calculation module 440 is further configured to:
[0171] Before determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building, obtain the initial height value of the initial floor relative to the reference plane, and determine the floor height change value according to the initial height value and the target height value; the initial floor is the floor where the electronic device is located before the floor change occurs;
[0172] The floor positioning module 450 is also used for:
[0173] If the floor height change value matches the up-and-down status, the number of floors corresponding to the new floor is determined based on the target height value and the height topology data corresponding to the target building.
[0174] In some embodiments, the motion sensor may be an inertial measurement unit (IMU), and the motion data detected by the IMU may be six-axis data, namely three-axis acceleration data and three-axis angular velocity data, which can effectively reflect the motion of the electronic device.
[0175] See also Figure 5 , Figure 5 FIG. 1 is a schematic diagram of the structure of an electronic device disclosed in an embodiment. Figure 5 As shown, the electronic device 500 may include:
[0176] A memory 510 storing executable program codes;
[0177] a processor 520 coupled to the memory 510;
[0178] The processor 520 calls the executable program code stored in the memory 510 to execute any one of the floor positioning methods disclosed in the embodiments of the present application.
[0179] 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.
[0180] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute any one of the floor positioning methods disclosed in the embodiments of the present application.
[0181] 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.
[0182] In 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 strategy, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0183] 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.
[0184] 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.
[0185] 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.
[0186] 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.
[0187] 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, It is characterized in that Applied to electronic equipment, the method comprises: determining a target building where the electronic device is located; Detect motion data through a motion sensor and detect air pressure data through an air pressure sensor; The motion data and air pressure data are input into a movement mode recognition model, and the corresponding upstairs and downstairs state of the electronic device is determined by the movement mode recognition model; the movement mode recognition model is trained based on multiple groups of target sample data, each group of target sample data includes an upstairs and downstairs state label, motion sample data corresponding to the upstairs and downstairs state label, and air pressure sample data; If it is determined according to the up / down stairs status that the electronic device changes floors and reaches a new floor, then, according to the air pressure data collected by the air pressure sensor at the new floor, a target height value of the new floor relative to the reference plane is calculated; The number of floors corresponding to the new floor is determined according to the target height value and the height topological data corresponding to the target building; the height topological data corresponding to the target building includes the height value of each floor in the target building relative to the reference plane.
2. The method according to claim 1, It is characterized in that Before determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building, the method further includes: Acquire one or more height values collected by the electronic device on each floor of the target building, where the height value is a height difference between the location of the electronic device and the reference plane; Clustering the collected one or more height values, respectively determining the distance between each of the collected height values and the cluster center of each cluster, so as to determine the cluster corresponding to each of the height values; wherein each of the clusters corresponds to the height value of a floor; According to the height values contained in each of the clusters, the cluster centers of the clusters are re-determined, and the height values of each floor in the target building relative to the reference plane are determined according to the re-determined cluster centers.
3. The method according to claim 1, It is characterized in that The determining the target building where the electronic device is located includes: Collect positioning information through the positioning system, obtain building outline information corresponding to the positioning information from the cloud, and obtain scanned wireless fidelity WiFi fingerprint information; Determine a plurality of first buildings according to the positioning information, wherein the first buildings are buildings whose distances from the positioning information are within a preset range; A target building matching the WiFi fingerprint information and the building outline information is determined from the multiple first buildings.
4. The method according to claim 3, It is characterized in that The detecting motion data by the motion sensor and detecting air pressure data by the air pressure sensor includes: If the positioning signal strength corresponding to the positioning system is lower than the strength threshold and the WiFi fingerprint information can be scanned, it is determined that the electronic device has entered the target building; When the electronic device is located inside the target building, motion data is detected by a motion sensor, and air pressure data is detected by an air pressure sensor.
5. The method according to claim 1, It is characterized in that Before inputting the motion data and the air pressure data into a movement mode recognition model and determining the current upstairs or downstairs state of the electronic device through the movement mode recognition model, the method further includes: Acquire motion sample data, air pressure sample data, and stair up / down state labels corresponding to the motion sample data and air pressure sample data; Convert the motion sample data into a first sequence of data based on time, and convert the air pressure sample data into a second sequence of data based on time; The first sequence data, the second sequence data and the corresponding going up and down stairs state labels are input into the movement mode recognition model for training, so that the movement mode recognition model learns the sequence data change characteristics corresponding to each going up and down stairs state, and obtains the trained movement mode recognition model.
6. The method according to claim 1, It is characterized in that Before inputting the motion data and the air pressure data into a movement mode recognition model and determining the current upstairs or downstairs state of the electronic device through the movement mode recognition model, the method further includes: Processing the motion data using a median filtering algorithm to obtain filtered motion data; Using a Kalman filter algorithm to process the air pressure data to obtain filtered air pressure data; Performing feature extraction on the filtered motion data and the filtered air pressure data respectively to obtain motion feature data and air pressure feature data; The step of inputting the motion data and the air pressure data into a movement mode recognition model and determining the current corresponding upstairs and downstairs state of the electronic device through the movement mode recognition model includes: The motion feature data and the air pressure feature data are input into a movement mode recognition model, and the current corresponding upstairs and downstairs state of the electronic device is determined by the movement mode recognition model.
7. The method according to claim 1, It is characterized in that Before determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building, the method further includes: Acquire an initial height value of an initial floor relative to the reference plane, and determine a floor height change value according to the initial height value and the target height value; the initial floor is the floor where the electronic device is located before the floor change occurs; The step of determining the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building includes: If the floor height change value matches the up-and-down status, the number of floors corresponding to the new floor is determined according to the target height value and the height topology data corresponding to the target building.
8. A floor positioning device, It is characterized in that The device comprises: A location determination module, used to determine the target building where the electronic device is located; A data acquisition module, used to detect motion data through a motion sensor and detect air pressure data through an air pressure sensor; A movement recognition module is used to input the motion data and air pressure data into a movement mode recognition model, and determine the current upstairs and downstairs state of the electronic device through the movement mode recognition model; the movement mode recognition model is trained based on multiple groups of target sample data, each group of target sample data includes a upstairs and downstairs state label, motion sample data corresponding to the upstairs and downstairs state label, and air pressure sample data; a height calculation module, configured to calculate a target height value of the new floor relative to a reference plane according to the air pressure data collected by the air pressure sensor at the new floor, if it is determined according to the up / down stairs status that the electronic device changes floors and reaches a new floor; The floor positioning module is used to determine the number of floors corresponding to the new floor according to the target height value and the height topological data corresponding to the target building; the height topological data corresponding to the target building includes the height value of each floor in the target building relative to the reference plane.
9. An electronic device, It is 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, It is 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.
Citation Information
Cited By
Floor universality estimation method based on air pressure sequence analysis
CN122028169A
