CN116761249B - Indoor positioning method, fingerprint library construction method, electronic equipment and storage medium - Google Patents

Indoor positioning method, fingerprint library construction method, electronic equipment and storage medium Download PDF

Info

Publication number
CN116761249B
CN116761249B CN202211171058.3A CN202211171058A CN116761249B CN 116761249 B CN116761249 B CN 116761249B CN 202211171058 A CN202211171058 A CN 202211171058A CN 116761249 B CN116761249 B CN 116761249B
Authority
CN
China
Prior art keywords
detection data
trajectory detection
sample trajectory
sample
fingerprint library
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211171058.3A
Other languages
Chinese (zh)
Other versions
CN116761249A (en
Inventor
陈园园
邓照飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202211171058.3A priority Critical patent/CN116761249B/en
Publication of CN116761249A publication Critical patent/CN116761249A/en
Application granted granted Critical
Publication of CN116761249B publication Critical patent/CN116761249B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/029Location-based management or tracking services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/33Services specially adapted for particular environments, situations or purposes for indoor environments, e.g. buildings

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Collating Specific Patterns (AREA)

Abstract

本申请公开了一种室内定位方法、指纹库的构建方法、电子设备及存储介质,属于终端定位技术领域。该方法包括:响应于对定位设备的定位操作,获取定位设备的轨迹检测数据;基于轨迹检测数据,通过第一分类模型确定定位设备所处的楼层;其中,第一分类模型为预先基于第一指纹库对第二分类模型进行迭代训练得到,第一指纹库是基于指纹测试集通过第二分类模型对第二指纹库进行数据扩展后得到,第二分类模型是基于第二指纹库对初始分类模型进行训练得到,第二指纹库包括多个样本轨迹检测数据,多个样本轨迹检测数据中的每个样本轨迹检测数据均带有楼层标签。本申请在进行模型训练的同时进行指纹库扩展,从而提高指纹库的可靠性和分类模型的定位准确性。

The present application discloses an indoor positioning method, a method for constructing a fingerprint library, an electronic device and a storage medium, and belongs to the field of terminal positioning technology. The method includes: in response to the positioning operation of the positioning device, obtaining the trajectory detection data of the positioning device; based on the trajectory detection data, determining the floor where the positioning device is located through a first classification model; wherein the first classification model is obtained by iteratively training the second classification model based on the first fingerprint library in advance, the first fingerprint library is obtained by expanding the data of the second fingerprint library through the second classification model based on the fingerprint test set, the second classification model is obtained by training the initial classification model based on the second fingerprint library, and the second fingerprint library includes multiple sample trajectory detection data, and each sample trajectory detection data in the multiple sample trajectory detection data has a floor label. The present application expands the fingerprint library while performing model training, thereby improving the reliability of the fingerprint library and the positioning accuracy of the classification model.

Description

室内定位方法、指纹库的构建方法、电子设备及存储介质Indoor positioning method, fingerprint library construction method, electronic device and storage medium

技术领域Technical Field

本申请涉及终端定位技术领域,特别涉及一种室内定位方法、指纹库的构建方法、电子设备及存储介质。The present application relates to the field of terminal positioning technology, and in particular to an indoor positioning method, a fingerprint library construction method, an electronic device and a storage medium.

背景技术Background Art

随着终端定位技术的发展,室内定位技术越来越受人们的青睐。室内定位技术多种多样,比如包括无线保真(Wireless Fidelity,WiFi)指纹定位技术。WiFi指纹定位技术是定位设备根据扫描到的WiFi信号确定位置信息的技术。在一种应用场景中,可以利用WiFi指纹定位技术确定定位设备所处的楼层。With the development of terminal positioning technology, indoor positioning technology is becoming more and more popular. There are many kinds of indoor positioning technologies, such as wireless fidelity (WiFi) fingerprint positioning technology. WiFi fingerprint positioning technology is a technology that allows positioning devices to determine location information based on scanned WiFi signals. In one application scenario, WiFi fingerprint positioning technology can be used to determine the floor where the positioning device is located.

WiFi指纹定位技术包括离线测试阶段和在线定位阶段,离线测试阶段的关键是建立指纹库,也即建立楼层与样本轨迹检测数据之间的对应关系,其中样本轨迹检测数据包括多个轨迹点中每个轨迹点处所检测的wifi信号强度。之后,可以利用指纹库进行模型训练以得到分类模型。如此,在在线定位阶段即可根据定位设备采集的轨迹检测数据,通过该分类模型进行定位。WiFi fingerprint positioning technology includes an offline test phase and an online positioning phase. The key to the offline test phase is to establish a fingerprint library, that is, to establish a correspondence between floors and sample trajectory detection data, where the sample trajectory detection data includes the WiFi signal strength detected at each trajectory point in multiple trajectory points. Afterwards, the fingerprint library can be used for model training to obtain a classification model. In this way, in the online positioning phase, positioning can be performed through the classification model based on the trajectory detection data collected by the positioning device.

但是,由于指纹库中的样本轨迹检测数据通常是由人工采集的,而为了训练分类模型,也为了测试训练后的分类模型的定位性能,人工采集的样本轨迹检测数据不仅需要用来构建指纹库,还需要构建指纹测试集,导致指纹库中的样本轨迹数据数量较少,因此难以构建一个可靠的指纹库,使得基于指纹库训练的分类模型的分类准确度较低,进而影响在线定位阶段定位的准确性。However, since the sample trajectory detection data in the fingerprint library is usually collected manually, in order to train the classification model and to test the positioning performance of the trained classification model, the manually collected sample trajectory detection data needs to be used not only to build the fingerprint library, but also to build a fingerprint test set, resulting in a small number of sample trajectory data in the fingerprint library. Therefore, it is difficult to build a reliable fingerprint library, which makes the classification accuracy of the classification model trained based on the fingerprint library low, which in turn affects the accuracy of positioning in the online positioning stage.

发明内容Summary of the invention

本申请提供了一种室内定位方法、指纹库的构建方法、电子设备及存储介质,可以用于改善相关技术中指纹库不可靠,导致分类模型的分了准确度低的问题。所述技术方案如下:The present application provides an indoor positioning method, a fingerprint library construction method, an electronic device and a storage medium, which can be used to improve the problem of unreliable fingerprint library in related technologies, resulting in low classification accuracy of classification models. The technical solution is as follows:

第一方面,提供了一种室内定位方法,所述方法包括:In a first aspect, an indoor positioning method is provided, the method comprising:

响应于对定位设备的定位操作,获取所述定位设备的轨迹检测数据;In response to a positioning operation on a positioning device, acquiring trajectory detection data of the positioning device;

基于所述轨迹检测数据,通过第一分类模型确定所述定位设备所处的楼层;Based on the trajectory detection data, determining the floor where the positioning device is located by using a first classification model;

其中,所述第一分类模型为预先基于第一指纹库对第二分类模型进行迭代训练得到,所述第一指纹库是基于指纹测试集通过所述第二分类模型对第二指纹库进行数据扩展后得到,所述第二分类模型是基于所述第二指纹库对初始分类模型进行训练得到,所述第二指纹库包括多个样本轨迹检测数据,所述多个样本轨迹检测数据中的每个样本轨迹检测数据均带有楼层标签。The first classification model is obtained by iteratively training the second classification model based on the first fingerprint library in advance, the first fingerprint library is obtained by expanding the data of the second fingerprint library through the second classification model based on the fingerprint test set, the second classification model is obtained by training the initial classification model based on the second fingerprint library, and the second fingerprint library includes multiple sample trajectory detection data, and each of the multiple sample trajectory detection data has a floor label.

如此,在需要进行室内定位的情况下,可以获取定位设备的轨迹检测数据,然后根据轨迹检测数据,通过第一分类模型确定定位设备所处的楼层。由于第一分类模型是根据经过数据扩展的第一指纹库训练得到,而第一指纹库是基于指纹测试集对第二指纹库进行数据扩展后得到,从而第一指纹库中的数据量较为可靠,进而第一分类模型的定位准确性也得到了提升。In this way, when indoor positioning is required, the trajectory detection data of the positioning device can be obtained, and then the floor where the positioning device is located can be determined through the first classification model based on the trajectory detection data. Since the first classification model is trained based on the first fingerprint library after data expansion, and the first fingerprint library is obtained by data expansion of the second fingerprint library based on the fingerprint test set, the data volume in the first fingerprint library is relatively reliable, and thus the positioning accuracy of the first classification model is also improved.

作为本申请的一个示例,所述第一指纹库是通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理,在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中得到。As an example of the present application, the first fingerprint library is obtained by traversing the sample trajectory detection data in the fingerprint test set through the second classification model. During the traversal process, the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold is added to the second fingerprint library.

如此,在基于指纹测试集对第二分类模型的定位性能进行测试过程中,还可以扩展第二指纹库的数据量,从而保证了第一指纹库的数据量,提高了第一指纹库的可靠性。In this way, during the process of testing the positioning performance of the second classification model based on the fingerprint test set, the data volume of the second fingerprint library can also be expanded, thereby ensuring the data volume of the first fingerprint library and improving the reliability of the first fingerprint library.

作为本申请的一个示例,所述第二指纹库为基于初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理后得到,所述初始指纹库为从获取的第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据得到。As an example of the present application, the second fingerprint library is obtained after data expansion processing is performed on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set, and the initial fingerprint library is obtained by randomly selecting a second number of flat layer sample trajectory detection data from the acquired first number of sample trajectory detection data.

如此,通过随机选择第二数量的平层样本轨迹检测数据,保证了初始指纹库中不会出现跨层样本轨迹检测数据,保证了初始指纹库的可靠性。In this way, by randomly selecting the second number of flat-layer sample trajectory detection data, it is ensured that no cross-layer sample trajectory detection data will appear in the initial fingerprint library, thereby ensuring the reliability of the initial fingerprint library.

作为本申请的一个示例,所述指纹测试集为从所述第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合。As an example of the present application, the fingerprint test set is a set consisting of remaining sample trajectory detection data after randomly selecting from the first number of sample trajectory detection data.

如此,指纹测试集与初始指纹库来源于同一批样本轨迹检测数据,从而提高了构建初始指纹库与指纹测试集的便利性。In this way, the fingerprint test set and the initial fingerprint library are derived from the same batch of sample trajectory detection data, thereby improving the convenience of constructing the initial fingerprint library and the fingerprint test set.

第二方面,提供了一种指纹库的构建方法,所述方法包括:In a second aspect, a method for constructing a fingerprint library is provided, the method comprising:

获取第二指纹库和指纹测试集,所述第二指纹库包括多个样本轨迹检测数据,所述多个样本轨迹检测数据中每个样本轨迹检测数据均带有楼层标签;Obtain a second fingerprint library and a fingerprint test set, wherein the second fingerprint library includes a plurality of sample trajectory detection data, and each of the plurality of sample trajectory detection data has a floor label;

基于所述第二指纹库对初始分类模型进行迭代训练,得到第二分类模型;Iteratively training the initial classification model based on the second fingerprint library to obtain a second classification model;

通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理;Performing traversal processing on the sample trajectory detection data in the fingerprint test set by using the second classification model;

在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中;During the traversal process, the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold is added to the second fingerprint library;

当遍历结束时,基于第一指纹库对所述第二分类模型进行迭代训练,得到第一分类模型,所述第一指纹库是在遍历过程中对所述第二指纹库进行扩展后得到,所述第一分类模型能够基于任意的定位设备的轨迹检测数据确定所述定位设备所处的楼层。When the traversal is completed, the second classification model is iteratively trained based on the first fingerprint library to obtain a first classification model. The first fingerprint library is obtained by expanding the second fingerprint library during the traversal process. The first classification model can determine the floor where the positioning device is located based on the trajectory detection data of any positioning device.

如此,由于第一分类模型是根据通过经过数据扩展的第一指纹库训练得到,而第一指纹库是基于指纹测试集对第二指纹库进行数据扩展后得到,从而第一指纹库中的数据量较为可靠,进而第一分类模型的定位准确性也得到了提升。In this way, since the first classification model is trained based on the first fingerprint library that has undergone data expansion, and the first fingerprint library is obtained by data expansion of the second fingerprint library based on the fingerprint test set, the amount of data in the first fingerprint library is more reliable, and thus the positioning accuracy of the first classification model is also improved.

作为本申请的一个示例,所述分类结果包括楼层标签和所述楼层标签对应的概率值;As an example of the present application, the classification result includes a floor label and a probability value corresponding to the floor label;

所述在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中,包括:In the traversal process, adding the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold to the second fingerprint library includes:

在遍历过程中,根据第一样本轨迹检测数据对应的分类结果中的概率值,确定所述第一样本轨迹检测数据对应的分类结果置信度,所述第一样本轨迹检测数据为当前遍历到的所述指纹测试集中的任意一个样本轨迹检测数据;During the traversal process, according to the probability value in the classification result corresponding to the first sample trajectory detection data, the confidence of the classification result corresponding to the first sample trajectory detection data is determined, and the first sample trajectory detection data is any sample trajectory detection data in the fingerprint test set currently traversed;

在所述第一样本轨迹检测数据对应的分类结果置信度大于或等于置信度阈值的情况下,将所述第一样本轨迹检测数据的楼层标签更新为所述第一样本轨迹检测数据对应的分类结果中的楼层标签;When the confidence of the classification result corresponding to the first sample trajectory detection data is greater than or equal to the confidence threshold, updating the floor label of the first sample trajectory detection data to the floor label in the classification result corresponding to the first sample trajectory detection data;

将标签更新后的所述第一样本轨迹检测数据添加至所述第二指纹库中。The first sample trajectory detection data after label update is added to the second fingerprint library.

如此,在基于指纹测试集对第二分类模型进行测试的过程中,还可以对第二指纹库进行数据扩展,从而使模型训练和指纹库构建达到相辅相成的效果。In this way, in the process of testing the second classification model based on the fingerprint test set, the data of the second fingerprint library can also be expanded, so that the model training and the fingerprint library construction can complement each other.

作为本申请的一个示例,所述获取第二指纹库和指纹测试集,包括:As an example of the present application, the obtaining of the second fingerprint library and the fingerprint test set includes:

获取第一数量的样本轨迹检测数据,所述第一数量的样本轨迹检测数据至少包括平层样本轨迹检测数据;Acquire a first number of sample trajectory detection data, where the first number of sample trajectory detection data at least includes level layer sample trajectory detection data;

从所述第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库;Randomly selecting a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library;

将所述第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合确定为所述指纹测试集;Determine a set consisting of remaining sample trajectory detection data after randomly selecting the first number of sample trajectory detection data as the fingerprint test set;

基于所述初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理,得到所述第二指纹库。Based on the initial fingerprint library and the fingerprint test set, data expansion processing is performed on the initial fingerprint library to obtain the second fingerprint library.

如此,通过指纹测试集对初始指纹库进行扩展处理,从而保证了第二指纹库中的样本轨迹检测数据的数据量,提高了第二指纹库的可靠性。In this way, the initial fingerprint library is expanded through the fingerprint test set, thereby ensuring the data volume of the sample trajectory detection data in the second fingerprint library and improving the reliability of the second fingerprint library.

作为本申请的一个示例,所述基于所述初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理,包括:As an example of the present application, the data expansion processing of the initial fingerprint library based on the initial fingerprint library and the fingerprint test set includes:

依次遍历所述指纹测试集中的各个样本轨迹检测数据;Traversing each sample trajectory detection data in the fingerprint test set in turn;

确定第二样本轨迹检测数据与所述初始指纹库中的每个样本轨迹检测数据之间的欧式距离和杰卡德距离,所述第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;Determine the Euclidean distance and the Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library, wherein the second sample trajectory detection data is the currently traversed sample trajectory detection data;

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中确定与所述第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,第三样本轨迹检测数据是指与所述第二样本轨迹检测数据之间的欧氏距离小于第一距离阈值,且与所述第二样本轨迹检测数据之间的杰卡德距离小于第二距离阈值的样本轨迹检测数据;In the case where there is at least one third sample trajectory detection data in the initial fingerprint library, determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from the at least one third sample trajectory detection data, wherein the third sample trajectory detection data refers to the sample trajectory detection data having a Euclidean distance with the second sample trajectory detection data less than a first distance threshold and a Jaccard distance with the second sample trajectory detection data less than a second distance threshold;

将所述第二样本轨迹检测数据的楼层标签更新为所确定的第三样本轨迹检测数据的楼层标签;Updating the floor label of the second sample trajectory detection data to the determined floor label of the third sample trajectory detection data;

将标签更新后的所述第二样本轨迹检测数据添加至所述初始指纹库中。The second sample trajectory detection data after the label is updated is added to the initial fingerprint library.

如此,通过从至少一个第三样本轨迹检测数据中确定与第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,从而保证了对初始指纹库进行扩展的合理性。In this way, by determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from at least one third sample trajectory detection data, the rationality of expanding the initial fingerprint library is ensured.

作为本申请的一个示例,所述在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中确定与所述第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,包括:As an example of the present application, when there is at least one third sample trajectory detection data in the initial fingerprint library, determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from the at least one third sample trajectory detection data includes:

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中获取与所述第二样本轨迹数据之间的欧氏距离最小的第三样本轨迹检测数据;或者,In the case where there is at least one third sample trajectory detection data in the initial fingerprint library, obtaining the third sample trajectory detection data having the smallest Euclidean distance with the second sample trajectory data from the at least one third sample trajectory detection data; or,

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中获取与所述第二样本轨迹数据之间的杰卡德距离最小的第三样本轨迹检测数据。In the case that at least one third sample trajectory detection data exists in the initial fingerprint library, the third sample trajectory detection data having the smallest Jaccard distance with the second sample trajectory data is obtained from the at least one third sample trajectory detection data.

如此,通过欧式距离或杰卡德距离,从至少一个第三样本轨迹检测数据中选择与第二样本轨迹检测数据之间的相似度最大的第三样本轨迹检测数据,可以使得选择出的第三样本轨迹检测数据更加准确。In this way, by using the Euclidean distance or the Jaccard distance, the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data is selected from at least one third sample trajectory detection data, so that the selected third sample trajectory detection data can be more accurate.

作为本申请的一个示例,所述基于所述初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理,包括:As an example of the present application, the data expansion processing of the initial fingerprint library based on the initial fingerprint library and the fingerprint test set includes:

依次遍历所述指纹测试集中的各个样本轨迹检测数据;Traversing each sample trajectory detection data in the fingerprint test set in turn;

确定第二样本轨迹检测数据与所述初始指纹库中的每个样本轨迹检测数据之间的相似度,得到多个相似度,所述第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;Determine the similarity between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library to obtain multiple similarities, wherein the second sample trajectory detection data is the currently traversed sample trajectory detection data;

将所述多个相似度中的最大相似度大于或等于相似度阈值的情况下,将所述第二样本轨迹检测数据的楼层标签更新为最大相似度对应的样本轨迹检测数据的楼层标签;When the maximum similarity among the multiple similarities is greater than or equal to the similarity threshold, updating the floor label of the second sample trajectory detection data to the floor label of the sample trajectory detection data corresponding to the maximum similarity;

将标签更新后的所述第二样本轨迹检测数据添加至所述初始指纹库中。The second sample trajectory detection data after the label is updated is added to the initial fingerprint library.

如此,通过不同方式对初始指纹库进行数据扩展处理,从而增加了确定数据扩展方式的丰富性。In this way, the data expansion processing is performed on the initial fingerprint library in different ways, thereby increasing the richness of the determined data expansion methods.

作为本申请的一个示例,所述从所述第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库之前,还包括:As an example of the present application, before randomly selecting a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library, the method further includes:

在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理,得到第三数量的样本轨迹检测数据,所述第三数量的样本轨迹检测数据中的各个样本轨迹检测数据的轨迹点数量小于或等于所述数量阈值;In a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than a number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold to obtain a third number of sample trajectory detection data, wherein the number of trajectory points of each sample trajectory detection data in the third number of sample trajectory detection data is less than or equal to the number threshold;

所述从所述第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库,包括:The randomly selecting a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library includes:

从所述第三数量的样本轨迹检测数据中随机选择所述第二数量的平层样本轨迹检测数据,得到所述初始指纹库。The second number of flat layer sample trajectory detection data is randomly selected from the third number of sample trajectory detection data to obtain the initial fingerprint library.

如此,通过对较长的样本轨迹检测数据进行分割,从而减少了较长的样本轨迹检测数据中包括的轨迹点数量,进而降低了后续基于样本轨迹检测数据进行计算的计算量。In this way, by segmenting the longer sample trajectory detection data, the number of trajectory points included in the longer sample trajectory detection data is reduced, thereby reducing the amount of subsequent calculations based on the sample trajectory detection data.

作为本申请的一个示例,所述在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理,包括:As an example of the present application, when the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than the number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold includes:

在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于所述数量阈值的样本轨迹检测数据的情况下,以划分数值为间隔对轨迹点数量大于所述数量阈值的样本轨迹检测数据进行分割,得到第四数量的样本轨迹检测数据,所述划分数值为小于或等于所述数量阈值的数值;In a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than the number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold at intervals of a segmentation value to obtain a fourth number of sample trajectory detection data, wherein the segmentation value is a value less than or equal to the number threshold;

在所述第四数量的样本轨迹检测数据中包括轨迹点数量小于所述划分数值的样本轨迹检测数据的情况下,将轨迹点数量小于所述划分数值的样本轨迹检测数据删除。In the case that the fourth amount of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is smaller than the division value, the sample trajectory detection data whose number of trajectory points is smaller than the division value is deleted.

如此,通过划分数值为间隔对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割,不仅能够扩展样本轨迹检测数据的数量,同时还能够降低后续进行模型训练时的计算量,并提高模型训练的准确度。In this way, by dividing the sample trajectory detection data whose number of trajectory points is greater than the quantity threshold into intervals, not only can the number of sample trajectory detection data be expanded, but also the amount of calculation in subsequent model training can be reduced and the accuracy of model training can be improved.

作为本申请的一个示例,所述通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理之后,还包括:As an example of the present application, after traversing the sample trajectory detection data in the fingerprint test set by the second classification model, the method further includes:

获取所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行分类的正确量,以及通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理后,添加至所述第二指纹库中的样本轨迹检测数据的添加量;Obtaining the correct amount of sample trajectory detection data in the fingerprint test set classified by the second classification model, and the amount of sample trajectory detection data added to the second fingerprint library after traversing the sample trajectory detection data in the fingerprint test set through the second classification model;

将所述正确量除以所述指纹测试集的样本总量,得到所述分类准确率,所述指纹测试集的样本总量为通过所述第二分类模型将所述指纹测试集中的样本轨迹检测数据添加至所述第二指纹库之前,所述指纹测试集中所包括的样本轨迹检测数据的数量;The classification accuracy is obtained by dividing the correct amount by the total number of samples in the fingerprint test set, where the total number of samples in the fingerprint test set is the number of sample trajectory detection data included in the fingerprint test set before the sample trajectory detection data in the fingerprint test set is added to the second fingerprint library through the second classification model;

将所述添加量除以所述样本总量,得到所述轨迹利用率,所述分类准确率和所述轨迹利用率用于评估所述第一分类模型的定位性能。The added amount is divided by the total number of samples to obtain the track utilization rate. The classification accuracy and the track utilization rate are used to evaluate the positioning performance of the first classification model.

如此,通过确定第二分类模型的分类准确率和该轨迹利用率,从而使得能够利用具体数据对第二分类模型的定位性能进行评估,提高了对第二分类模型的定位性能进行评估的准确性。In this way, by determining the classification accuracy of the second classification model and the trajectory utilization rate, the positioning performance of the second classification model can be evaluated using specific data, thereby improving the accuracy of evaluating the positioning performance of the second classification model.

第三方面,提供了一种室内定位装置,所述室内定位装置具有实现上述第一方面中室内定位方法行为的功能。所述室内定位装置包括至少一个模块,所述至少一个模块用于实现上述第一方面所提供的室内定位方法。该室内定位装置可以包括:In a third aspect, an indoor positioning device is provided, wherein the indoor positioning device has the function of implementing the indoor positioning method in the first aspect. The indoor positioning device includes at least one module, and the at least one module is used to implement the indoor positioning method provided in the first aspect. The indoor positioning device may include:

获取模块,用于响应于对定位设备的定位操作,获取所述定位设备的轨迹检测数据;An acquisition module, configured to acquire trajectory detection data of the positioning device in response to a positioning operation on the positioning device;

确定模块,用于基于所述轨迹检测数据,通过第一分类模型确定所述定位设备所处的楼层;A determination module, configured to determine the floor where the positioning device is located by using a first classification model based on the trajectory detection data;

其中,所述第一分类模型为预先基于第一指纹库对第二分类模型进行迭代训练得到,所述第一指纹库是基于指纹测试集通过所述第二分类模型对第二指纹库进行数据扩展后得到,所述第二分类模型是基于所述第二指纹库对初始分类模型进行训练得到,所述第二指纹库包括多个样本轨迹检测数据,所述多个样本轨迹检测数据中的每个样本轨迹检测数据均带有楼层标签。The first classification model is obtained by iteratively training the second classification model based on the first fingerprint library in advance, the first fingerprint library is obtained by expanding the data of the second fingerprint library through the second classification model based on the fingerprint test set, the second classification model is obtained by training the initial classification model based on the second fingerprint library, and the second fingerprint library includes multiple sample trajectory detection data, and each of the multiple sample trajectory detection data has a floor label.

作为本申请的一个示例,所述第一指纹库是通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理,在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中得到。As an example of the present application, the first fingerprint library is obtained by traversing the sample trajectory detection data in the fingerprint test set through the second classification model. During the traversal process, the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold is added to the second fingerprint library.

作为本申请的一个示例,所述第二指纹库为基于初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理后得到,所述初始指纹库为从获取的第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据得到。As an example of the present application, the second fingerprint library is obtained after data expansion processing is performed on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set, and the initial fingerprint library is obtained by randomly selecting a second number of flat layer sample trajectory detection data from the acquired first number of sample trajectory detection data.

作为本申请的一个示例,所述指纹测试集为从所述第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合。As an example of the present application, the fingerprint test set is a set consisting of remaining sample trajectory detection data after randomly selecting from the first number of sample trajectory detection data.

第四方面,提供了一种指纹库的构建装置,所述指纹库的构建装置具有实现上述第二方面中指纹库的构建方法行为的功能。所述指纹库的构建装置包括至少一个模块,所述至少一个模块用于实现上述第二方面所提供的指纹库的构建方法。该指纹库的构建装置可以包括:In a fourth aspect, a fingerprint library construction device is provided, wherein the fingerprint library construction device has the function of implementing the fingerprint library construction method in the second aspect. The fingerprint library construction device includes at least one module, and the at least one module is used to implement the fingerprint library construction method provided in the second aspect. The fingerprint library construction device may include:

第一获取模块,用于获取第二指纹库和指纹测试集,所述第二指纹库包括多个样本轨迹检测数据,所述多个样本轨迹检测数据中每个样本轨迹检测数据均带有楼层标签;A first acquisition module is used to acquire a second fingerprint library and a fingerprint test set, wherein the second fingerprint library includes a plurality of sample trajectory detection data, and each of the plurality of sample trajectory detection data has a floor label;

第一训练模块,用于基于所述第二指纹库对初始分类模型进行迭代训练,得到第二分类模型;A first training module, configured to iteratively train the initial classification model based on the second fingerprint library to obtain a second classification model;

遍历模块,用于通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理;A traversal module, used for traversing the sample trajectory detection data in the fingerprint test set through the second classification model;

添加模块,用于在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中;An adding module, used for adding sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold to the second fingerprint library during the traversal process;

第二训练模块,用于当遍历结束时,基于第一指纹库对所述第二分类模型进行迭代训练,得到第一分类模型,所述第一指纹库是在遍历过程中对所述第二指纹库进行扩展后得到,所述第一分类模型能够基于任意的定位设备的轨迹检测数据确定所述定位设备所处的楼层。The second training module is used to iteratively train the second classification model based on the first fingerprint library to obtain the first classification model when the traversal is completed. The first fingerprint library is obtained by expanding the second fingerprint library during the traversal process. The first classification model can determine the floor where the positioning device is located based on the trajectory detection data of any positioning device.

作为本申请的一个示例,所述分类结果包括楼层标签和所述楼层标签对应的概率值;As an example of the present application, the classification result includes a floor label and a probability value corresponding to the floor label;

所述添加模块用于:The adding module is used for:

在遍历过程中,根据第一样本轨迹检测数据对应的分类结果中的概率值,确定所述第一样本轨迹检测数据对应的分类结果置信度,所述第一样本轨迹检测数据为当前遍历到的所述指纹测试集中的任意一个样本轨迹检测数据;During the traversal process, according to the probability value in the classification result corresponding to the first sample trajectory detection data, the confidence of the classification result corresponding to the first sample trajectory detection data is determined, and the first sample trajectory detection data is any sample trajectory detection data in the fingerprint test set currently traversed;

在所述第一样本轨迹检测数据对应的分类结果置信度大于或等于置信度阈值的情况下,将所述第一样本轨迹检测数据的楼层标签更新为所述第一样本轨迹检测数据对应的分类结果中的楼层标签;When the confidence of the classification result corresponding to the first sample trajectory detection data is greater than or equal to the confidence threshold, updating the floor label of the first sample trajectory detection data to the floor label in the classification result corresponding to the first sample trajectory detection data;

将标签更新后的所述第一样本轨迹检测数据添加至所述第二指纹库中。The first sample trajectory detection data after label update is added to the second fingerprint library.

作为本申请的一个示例,所述第一获取模块用于:As an example of the present application, the first acquisition module is used for:

获取第一数量的样本轨迹检测数据,所述第一数量的样本轨迹检测数据至少包括平层样本轨迹检测数据;Acquire a first number of sample trajectory detection data, where the first number of sample trajectory detection data at least includes level layer sample trajectory detection data;

从所述第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库;Randomly selecting a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library;

将所述第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合确定为所述指纹测试集;Determine a set consisting of remaining sample trajectory detection data after randomly selecting the first number of sample trajectory detection data as the fingerprint test set;

基于所述初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理,得到所述第二指纹库。Based on the initial fingerprint library and the fingerprint test set, data expansion processing is performed on the initial fingerprint library to obtain the second fingerprint library.

作为本申请的一个示例,所述第一获取模块用于:As an example of the present application, the first acquisition module is used for:

依次遍历所述指纹测试集中的各个样本轨迹检测数据;Traversing each sample trajectory detection data in the fingerprint test set in turn;

确定第二样本轨迹检测数据与所述初始指纹库中的每个样本轨迹检测数据之间的欧式距离和杰卡德距离,所述第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;Determine the Euclidean distance and the Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library, wherein the second sample trajectory detection data is the currently traversed sample trajectory detection data;

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中确定与所述第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,第三样本轨迹检测数据是指与所述第二样本轨迹检测数据之间的欧氏距离小于第一距离阈值,且与所述第二样本轨迹检测数据之间的杰卡德距离小于第二距离阈值的样本轨迹检测数据;In the case where there is at least one third sample trajectory detection data in the initial fingerprint library, determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from the at least one third sample trajectory detection data, wherein the third sample trajectory detection data refers to the sample trajectory detection data having a Euclidean distance with the second sample trajectory detection data less than a first distance threshold and a Jaccard distance with the second sample trajectory detection data less than a second distance threshold;

将所述第二样本轨迹检测数据的楼层标签更新为所确定的第三样本轨迹检测数据的楼层标签;Updating the floor label of the second sample trajectory detection data to the determined floor label of the third sample trajectory detection data;

将标签更新后的所述第二样本轨迹检测数据添加至所述初始指纹库中。The second sample trajectory detection data after the label is updated is added to the initial fingerprint library.

作为本申请的一个示例,所述第一获取模块用于:As an example of the present application, the first acquisition module is used for:

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中获取与所述第二样本轨迹数据之间的欧氏距离最小的第三样本轨迹检测数据;或者,In the case where there is at least one third sample trajectory detection data in the initial fingerprint library, obtaining the third sample trajectory detection data having the smallest Euclidean distance with the second sample trajectory data from the at least one third sample trajectory detection data; or,

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中获取与所述第二样本轨迹数据之间的杰卡德距离最小的第三样本轨迹检测数据。In the case that at least one third sample trajectory detection data exists in the initial fingerprint library, the third sample trajectory detection data having the smallest Jaccard distance with the second sample trajectory data is obtained from the at least one third sample trajectory detection data.

作为本申请的一个示例,所述第一获取模块用于:As an example of the present application, the first acquisition module is used for:

依次遍历所述指纹测试集中的各个样本轨迹检测数据;Traversing each sample trajectory detection data in the fingerprint test set in turn;

确定第二样本轨迹检测数据与所述初始指纹库中的每个样本轨迹检测数据之间的相似度,得到多个相似度,所述第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;Determine the similarity between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library to obtain multiple similarities, wherein the second sample trajectory detection data is the currently traversed sample trajectory detection data;

将所述多个相似度中的最大相似度大于或等于相似度阈值的情况下,将所述第二样本轨迹检测数据的楼层标签更新为最大相似度对应的样本轨迹检测数据的楼层标签;When the maximum similarity among the multiple similarities is greater than or equal to the similarity threshold, updating the floor label of the second sample trajectory detection data to the floor label of the sample trajectory detection data corresponding to the maximum similarity;

将标签更新后的所述第二样本轨迹检测数据添加至所述初始指纹库中。The second sample trajectory detection data after the label is updated is added to the initial fingerprint library.

作为本申请的一个示例,所述第一获取模块还用于:As an example of the present application, the first acquisition module is further used for:

在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理,得到第三数量的样本轨迹检测数据,所述第三数量的样本轨迹检测数据中的各个样本轨迹检测数据的轨迹点数量小于或等于所述数量阈值;In a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than a number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold to obtain a third number of sample trajectory detection data, wherein the number of trajectory points of each sample trajectory detection data in the third number of sample trajectory detection data is less than or equal to the number threshold;

从所述第三数量的样本轨迹检测数据中随机选择所述第二数量的平层样本轨迹检测数据,得到所述初始指纹库。The second number of flat layer sample trajectory detection data is randomly selected from the third number of sample trajectory detection data to obtain the initial fingerprint library.

作为本申请的一个示例,所述第一获取模块用于:As an example of the present application, the first acquisition module is used for:

在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于所述数量阈值的样本轨迹检测数据的情况下,以划分数值为间隔对轨迹点数量大于所述数量阈值的样本轨迹检测数据进行分割,得到第四数量的样本轨迹检测数据,所述划分数值为小于或等于所述数量阈值的数值;In a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than the number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold at intervals of a segmentation value to obtain a fourth number of sample trajectory detection data, wherein the segmentation value is a value less than or equal to the number threshold;

在所述第四数量的样本轨迹检测数据中包括轨迹点数量小于所述划分数值的样本轨迹检测数据的情况下,将轨迹点数量小于所述划分数值的样本轨迹检测数据删除。In the case that the fourth amount of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is smaller than the division value, the sample trajectory detection data whose number of trajectory points is smaller than the division value is deleted.

作为本申请的一个示例,所述装置还包括:As an example of the present application, the device further includes:

第二获取模块,用于获取所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行分类的正确量,以及通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理后,添加至所述第二指纹库中的样本轨迹检测数据的添加量;A second acquisition module is used to obtain the correct amount of sample trajectory detection data in the fingerprint test set classified by the second classification model, and the amount of sample trajectory detection data added to the second fingerprint library after traversing the sample trajectory detection data in the fingerprint test set through the second classification model;

第一计算模块,用于将所述正确量除以所述指纹测试集的样本总量,得到所述分类准确率,所述指纹测试集的样本总量为通过所述第二分类模型将所述指纹测试集中的样本轨迹检测数据添加至所述第二指纹库之前,所述指纹测试集中所包括的样本轨迹检测数据的数量;a first calculation module, configured to obtain the classification accuracy by dividing the correct amount by the total number of samples in the fingerprint test set, where the total number of samples in the fingerprint test set is the number of sample trajectory detection data included in the fingerprint test set before the sample trajectory detection data in the fingerprint test set is added to the second fingerprint library through the second classification model;

第二计算模块,用于将所述添加量除以所述样本总量,得到所述轨迹利用率,所述分类准确率和所述轨迹利用率用于评估所述第一分类模型的定位性能。The second calculation module is used to divide the added amount by the total sample amount to obtain the trajectory utilization rate, and the classification accuracy and the trajectory utilization rate are used to evaluate the positioning performance of the first classification model.

第五方面,提供了一种电子设备,所述电子设备的结构中包括处理器和存储器,所述存储器用于存储支持电子设备执行上述第一方面所提供的室内定位方法的程序,以及存储用于实现上述第一方面所述的室内定位方法所涉及的数据。或者,所述存储器用于存储支持电子设备执行上述第二方面所提供的指纹库的构建方法的程序,以及存储用于实现上述第二方面所述的指纹库的构建方法所涉及的数据;所述处理器被配置为用于执行所述存储器中存储的程序。所述电子设备还可以包括通信总线,所述通信总线用于在所述处理器与所述存储器之间建立连接。In a fifth aspect, an electronic device is provided, wherein the structure of the electronic device includes a processor and a memory, wherein the memory is used to store a program that supports the electronic device to execute the indoor positioning method provided in the first aspect, and to store data involved in implementing the indoor positioning method described in the first aspect. Alternatively, the memory is used to store a program that supports the electronic device to execute the method for constructing a fingerprint library provided in the second aspect, and to store data involved in implementing the method for constructing a fingerprint library described in the second aspect; the processor is configured to execute the program stored in the memory. The electronic device may also include a communication bus, which is used to establish a connection between the processor and the memory.

第六方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的室内定位方法,或者,使得计算机执行上述第二方面所述的指纹库的构建方法。In a sixth aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is run on a computer, the computer executes the indoor positioning method described in the first aspect, or the fingerprint library construction method described in the second aspect.

第七方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的室内定位方法,或者,使得计算机执行上述第二方面所述的指纹库的构建方法。In a seventh aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the indoor positioning method described in the first aspect, or enables the computer to execute the fingerprint library construction method described in the second aspect.

上述第二方面、第三方面、第四方面、第五方面、第六方面和第七方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained by the above-mentioned second, third, fourth, fifth, sixth and seventh aspects are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是本申请实施例提供的一种采集样本轨迹检测数据的应用场景的示意图;FIG1 is a schematic diagram of an application scenario for collecting sample trajectory detection data provided by an embodiment of the present application;

图2是本申请实施例提供的一种室内定位的应用场景的示意图;FIG2 is a schematic diagram of an application scenario of indoor positioning provided by an embodiment of the present application;

图3是本申请实施例提供的一种电子设备的结构示意图;FIG3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

图4是本申请实施例提供的一种电子设备的软件系统的框图;FIG4 is a block diagram of a software system of an electronic device provided in an embodiment of the present application;

图5是本申请实施例提供的一种室内定位的应用场景的示意图;FIG5 is a schematic diagram of an application scenario of indoor positioning provided by an embodiment of the present application;

图6是本申请实施例提供的另一种室内定位的应用场景的示意图;FIG6 is a schematic diagram of another application scenario of indoor positioning provided by an embodiment of the present application;

图7是本申请实施例提供的另一种室内定位的应用场景的示意图;FIG7 is a schematic diagram of another application scenario of indoor positioning provided by an embodiment of the present application;

图8是本申请实施例提供的另一种室内定位的应用场景的示意图;FIG8 is a schematic diagram of another application scenario of indoor positioning provided by an embodiment of the present application;

图9是本申请实施例提供的一种室内定位的方法流程示意图;FIG9 is a schematic flow chart of an indoor positioning method provided by an embodiment of the present application;

图10是本申请实施例提供的一种指纹库的构建方法流程示意图;FIG10 is a schematic diagram of a method for constructing a fingerprint library according to an embodiment of the present application;

图11是本申请实施例提供的一种不同类型的样本轨迹检测数据的示意图;FIG11 is a schematic diagram of different types of sample trajectory detection data provided by an embodiment of the present application;

图12是本申请实施例提供的一种对初始指纹库进行数据扩展处理的方法流程示意图;FIG12 is a flow chart of a method for performing data expansion processing on an initial fingerprint library provided in an embodiment of the present application;

图13是本申请实施例提供的另一种指纹库的构建方法流程示意图;FIG13 is a schematic flow chart of another method for constructing a fingerprint library provided in an embodiment of the present application;

图14是本申请实施例提供的一种室内定位装置的结构示意图;FIG14 is a schematic diagram of the structure of an indoor positioning device provided in an embodiment of the present application;

图15是本申请实施例提供的一种指纹库的构建装置的结构示意图。FIG. 15 is a schematic diagram of the structure of a fingerprint library construction device provided in an embodiment of the present application.

具体实施方式DETAILED DESCRIPTION

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

应当理解的是,本申请提及的“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,比如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,比如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish between the same or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

在一种应用场景中,电子设备需要进行自身定位的情况下,若电子设备处于室内环境中,那么电子设备可以通过室内定位技术进行定位,比如,电子设备可以通过WiFi指纹定位技术进行定位。电子设备处于室内环境的情况下,可以预先获取人工采集的多个样本轨迹检测数据和每个样本轨迹检测数据对应的楼层标签。示例性地,参见图1,至少一个采集人员使用数据采集设备在不同楼层进行样本轨迹检测数据的采集,并将采集的样本轨迹检测数据和对应楼层发送给电子设备。为了便于说明,本申请实施例的附图中以4个楼层,且每个楼层存在一个采集人员为例进行说明。电子设备在获取到多个样本轨迹检测数据和每个样本轨迹检测数据对应的楼层标签后,可以从每一个楼层对应的样本轨迹数据中选择固定数量的样本轨迹检测数据,从而构成指纹库,并利用指纹库进行模型训练从而得到分类模型。通常情况下,电子设备还可以获取指纹测试集,基于指纹测试集可以测试分类模型的定位性能,也即是,测试分类模型是否可以用于室内定位。In an application scenario, when an electronic device needs to locate itself, if the electronic device is in an indoor environment, the electronic device can be located by indoor positioning technology, for example, the electronic device can be located by WiFi fingerprint positioning technology. When the electronic device is in an indoor environment, multiple sample trajectory detection data collected manually and the floor label corresponding to each sample trajectory detection data can be obtained in advance. Exemplarily, referring to FIG1, at least one collector uses a data acquisition device to collect sample trajectory detection data on different floors, and sends the collected sample trajectory detection data and the corresponding floor to the electronic device. For ease of explanation, the accompanying drawings of the embodiment of the present application are illustrated by taking 4 floors and one collector on each floor as an example. After obtaining multiple sample trajectory detection data and the floor label corresponding to each sample trajectory detection data, the electronic device can select a fixed number of sample trajectory detection data from the sample trajectory data corresponding to each floor, thereby forming a fingerprint library, and use the fingerprint library for model training to obtain a classification model. Generally, the electronic device can also obtain a fingerprint test set, based on which the positioning performance of the classification model can be tested, that is, whether the classification model can be used for indoor positioning.

但是,由于人工采集的样本轨迹检测数据不仅需要用来构建指纹库,还需要构建指纹测试集,导致指纹库中的样本轨迹数据数量较少,因此难以构建一个可靠的指纹库,使得基于指纹库训练的分类模型的分类准确度较低,进而影响在线定位阶段定位的准确性。示例性地,参见图2,若电子设备处于3楼,电子设备可以获取在3层的任意一个时间段的轨迹检测数据,并根据该轨迹检测数据通过该分类模型进行定位,分类模型的定位结果原本应该为3楼,但是由于分类模型是根据包括的样本轨迹数据的数量较少的指纹库训练得到,指纹库不可靠,导致分类模型的定位不准确,致使分类模型输出定位结果为4楼,且该电子设备在定位界面中显示定位结果“当前处于4楼”。However, since the manually collected sample trajectory detection data is not only needed to build a fingerprint library, but also needs to build a fingerprint test set, the number of sample trajectory data in the fingerprint library is small, so it is difficult to build a reliable fingerprint library, which makes the classification accuracy of the classification model trained based on the fingerprint library low, thereby affecting the accuracy of positioning in the online positioning stage. For example, referring to Figure 2, if the electronic device is on the 3rd floor, the electronic device can obtain trajectory detection data of any time period on the 3rd floor, and locate it through the classification model based on the trajectory detection data. The positioning result of the classification model should originally be the 3rd floor, but because the classification model is trained based on a fingerprint library with a small number of sample trajectory data, the fingerprint library is unreliable, resulting in inaccurate positioning of the classification model, causing the classification model to output a positioning result of the 4th floor, and the electronic device displays the positioning result "Currently on the 4th floor" in the positioning interface.

为了提高分类模型的定位准确性,本申请实施例提供了一种室内定位方法,该方法中电子设备在需要进行室内定位的情况下,可以获取定位设备的轨迹检测数据,然后根据轨迹检测数据,通过第一分类模型确定定位设备所处的楼层。由于第一分类模型是根据经过数据扩展的第一指纹库训练得到,而第一指纹库是基于指纹测试集对第二指纹库进行数据扩展后得到,从而第一指纹库中的数据量较为可靠,进而第一分类模型的定位准确性也得到了提升。也即是本申请实施例中电子设备扩展了指纹库中的数据量,提高了指纹库的可靠性,从而提高了分类模型的定位准确性。In order to improve the positioning accuracy of the classification model, an embodiment of the present application provides an indoor positioning method, in which the electronic device can obtain the trajectory detection data of the positioning device when indoor positioning is required, and then determine the floor where the positioning device is located through the first classification model based on the trajectory detection data. Since the first classification model is trained based on the first fingerprint library after data expansion, and the first fingerprint library is obtained by data expansion of the second fingerprint library based on the fingerprint test set, the amount of data in the first fingerprint library is more reliable, and thus the positioning accuracy of the first classification model is also improved. That is, the electronic device in the embodiment of the present application expands the amount of data in the fingerprint library, improves the reliability of the fingerprint library, and thus improves the positioning accuracy of the classification model.

在对本申请实施例提供的室内定位的方法进行详细地解释说明之前,先对本申请实施例涉及的电子设备予以说明。本申请实施例提供的方法可以由电子设备执行,电子设备可以配置有wifi信号检测功能以及定位功能。进一步地,该电子设备中可以安装有诸如导航、社交、购物等应用程序,这些应用程序均能够在使用过程中触发电子设备进行定位。作为示例而非限定,电子设备可以是但不限于手机、可穿戴智能设备、数码相机、平板电脑、桌面型、膝上型、手持计算机、笔记本电脑、车载设备、超级移动个人计算机(ultra-mobilepersonal computer,UMPC)、上网本、蜂窝电话、个人数字助理(personal digitalassistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备、手机、智能电器、服务器等,本申请实施例对此不作限定。Before explaining the indoor positioning method provided in the embodiment of the present application in detail, the electronic device involved in the embodiment of the present application is first described. The method provided in the embodiment of the present application can be performed by an electronic device, and the electronic device can be configured with a wifi signal detection function and a positioning function. Further, the electronic device can be installed with applications such as navigation, social networking, shopping, etc., and these applications can trigger the electronic device to locate during use. As an example and not a limitation, the electronic device can be but not limited to a mobile phone, a wearable smart device, a digital camera, a tablet computer, a desktop, a laptop, a handheld computer, a notebook computer, a vehicle-mounted device, an ultra-mobile personal computer (ultra-mobilepersonal computer, UMPC), a netbook, a cellular phone, a personal digital assistant (personal digitalassistant, PDA), an augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) device, a mobile phone, a smart appliance, a server, etc., and the embodiment of the present application is not limited to this.

图3是本申请实施例提供的一种电子设备的结构示意图。参见图3,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serialbus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中,传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Fig. 3 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Referring to Fig. 3, the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,比如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口,如可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.

可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。比如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。The mobile communication module 150 can provide solutions for wireless communications including 2G/3G/4G/5G, etc., applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.

无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and/or IR technology, etc. GNSS may include the global positioning system (GPS), the global navigation satellite system (GLONASS), the Beidou navigation satellite system (BDS), the quasi-zenith satellite system (QZSS) and/or the satellite based augmentation system (SBAS).

电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。比如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。The digital signal processor is used to process digital signals, and can process not only digital image signals but also other digital signals. For example, when the electronic device 100 is selecting a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy.

外部存储器接口120可以用于连接外部存储卡,比如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。比如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,计算机可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,来执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100在使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,比如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist positioning and navigation.

接下来对电子设备100的软件系统予以说明。Next, the software system of the electronic device 100 will be described.

电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的安卓(Android)系统为例,对电子设备100的软件系统进行示例性说明。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software system of the electronic device 100.

图4是本申请实施例提供的一种电子设备100的软件系统的框图。参见图4,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统层,以及内核层。FIG4 is a block diagram of a software system of an electronic device 100 provided in an embodiment of the present application. Referring to FIG4 , the layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, namely, from top to bottom, the application layer, the application framework layer, the Android runtime (Android runtime) and the system layer, and the kernel layer.

应用程序层可以包括一系列应用程序包。如图4所示,应用程序包可以包括地图,导航,相机,图库,日历,通话,WLAN,蓝牙,音乐,视频等应用程序。The application layer may include a series of application packages. As shown in FIG4 , the application package may include applications such as map, navigation, camera, gallery, calendar, call, WLAN, Bluetooth, music, video, etc.

作为一个示例,该应用程序层中还可以包括WiFi管理模块,该WiFi管理模块用于管理与WiFi相关的功能,比如,打开Wifi、断开Wifi、查看Wifi列表、动态刷新Wifi列表、动下拉刷新Wifi列表、连接指定的网络、断开网络连接等。As an example, the application layer may also include a WiFi management module, which is used to manage WiFi-related functions, such as turning on Wifi, disconnecting Wifi, viewing the Wifi list, dynamically refreshing the Wifi list, dynamically pulling down to refresh the Wifi list, connecting to a specified network, disconnecting the network, etc.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图4所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问,这些数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿、轨迹检测数据等。视图系统包括可视控件,比如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序的显示界面,显示界面可以由一个或多个视图组成,比如,包括显示短信通知图标的视图,包括显示文字的视图,以及包括显示图片的视图。电话管理器用于提供电子设备100的通信功能,比如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如,通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或滚动条文本形式出现在系统顶部状态栏的通知,比如后台运行的应用程序的通知。通知管理器还可以是以对话窗口形式出现在屏幕上的通知,比如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The application framework layer provides an application programming interface (API) and a programming framework for the application programs of the application layer. The application framework layer includes some predefined functions. As shown in FIG4 , the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make these data accessible to applications. These data may include video, images, audio, dialed and received calls, browsing history and bookmarks, phone books, track detection data, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to construct the display interface of the application, and the display interface can be composed of one or more views, for example, including a view for displaying a text message notification icon, a view for displaying text, and a view for displaying pictures. The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connecting, hanging up, etc.). The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background. The notification manager can also be a notification that appears on the screen in the form of a dialog window, such as a text message prompt in the status bar, a reminder sound, an electronic device vibrating, an indicator light flashing, etc.

作为一个示例,应用程序框架层中还可以包括算法库和数据接收模块。As an example, the application framework layer may also include an algorithm library and a data receiving module.

作为一个示例,算法模块中用于存储各类算法模型,该算法模型中包括实现室内定位的第一分类模型;在需要进行室内定位的情况下,算法模块能够调用存储的第一分类模块,并在获取到定位设备的轨迹检测数据的情况下,基于轨迹检测数据通过第一分类模块确定定位设备所处楼层。示例性地,若算法模块接收到地图或导航等应用程序触发的定位请求,则算法模块可以调用第一分类模块,在从内容提供器中获取到定位设备的轨迹检测数据的情况下,基于轨迹检测数据通过设置的定位算法确定定位设备所处楼层。As an example, the algorithm module is used to store various algorithm models, which include a first classification model for realizing indoor positioning; when indoor positioning is required, the algorithm module can call the stored first classification module, and when the trajectory detection data of the positioning device is obtained, the first classification module is used to determine the floor where the positioning device is located based on the trajectory detection data. Exemplarily, if the algorithm module receives a positioning request triggered by an application such as a map or navigation, the algorithm module can call the first classification module, and when the trajectory detection data of the positioning device is obtained from the content provider, the first classification module is used to determine the floor where the positioning device is located based on the trajectory detection data through the set positioning algorithm.

作为一个示例,算法模块还可以用于模型训练,且算法模块在进行模型训练的情况下,可以接收数据获取模块发送的一定数量的样本轨迹检测数据,然后基于获取的样本轨迹检测数据,进行模型训练。As an example, the algorithm module can also be used for model training, and when performing model training, the algorithm module can receive a certain number of sample trajectory detection data sent by the data acquisition module, and then perform model training based on the acquired sample trajectory detection data.

作为一个示例,该数据获取模块可以用于接收其他电子设备发送的样本轨迹检测数据,并将接收到的样本轨迹检测数据发送给算法模块。As an example, the data acquisition module may be used to receive sample trajectory detection data sent by other electronic devices, and send the received sample trajectory detection data to the algorithm module.

作为一个示例,该数据获取模块还可以接收硬件层中的WiFi采集器周期性采集的WiFi信号,并将每一次接收到WiFi信号的WiFi信号强度确定为一个轨迹点对应的WiFi信号强度,以得到轨迹检测数据,并将该轨迹检测数据发送给算法模块。As an example, the data acquisition module can also receive WiFi signals periodically collected by the WiFi collector in the hardware layer, and determine the WiFi signal strength of each received WiFi signal as the WiFi signal strength corresponding to a trajectory point to obtain trajectory detection data, and send the trajectory detection data to the algorithm module.

作为一个示例,数据获取模块还可以用于将获取到的轨迹检测数据存储至内容提供器中。As an example, the data acquisition module may also be used to store the acquired trajectory detection data in the content provider.

Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

系统库可以包括多个功能模块,比如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(比如:OpenGL ES),2D图形引擎(比如:SGL)等。表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,比如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。The system library can include multiple functional modules, such as: surface manager, media library, 3D graphics processing library (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.

内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动,WiFi驱动;The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, sensor driver, and WiFi driver;

作为一个示例,该WiFi驱动用于驱动硬件设备wifi采集器周期性地采集wifi信号。As an example, the WiFi driver is used to drive a hardware device WiFi collector to periodically collect WiFi signals.

下面结合捕获拍照场景,示例性说明电子设备100软件以及硬件的工作流程。The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.

当触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别原始输入事件所对应的控件。以该触摸操作是单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用程序框架层的接口,启动相机应用,再调用内核层启动摄像头驱动,通过摄像头193捕获静态图像或视频。When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation, and other information). The original input event is stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the original input event. For example, if the touch operation is a single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer, starts the camera application, and then calls the kernel layer to start the camera driver to capture static images or videos through the camera 193.

为了便于理解,在对本申请实施例提供的方法进行详细介绍之前,基于上述实施例提供的执行主体,接下来对本申请实施例涉及的应用场景进行介绍。For ease of understanding, before introducing the method provided in the embodiment of the present application in detail, based on the execution entity provided in the above embodiment, the application scenarios involved in the embodiment of the present application are introduced below.

请参考图5,图5是根据一示例性实施例示出的一种应用场景的示意图。在一种可能的场景中,用户在参观某个工厂大楼的情况下,为了避免用户闯入不允许进入的楼层,可以使用户携带定位专用的手机,在用户携带定位专用的手机的过程中,手机可以实时或每隔指定间隔对自身进行定位操作,并在定位到用户进入不允许进入的楼层的情况下,对用户进行警示。示例性地,响应于对自身的定位操作,手机可以获取用户在指定时间段内的轨迹检测数据,并基于轨迹检测数据,通过第一分类模型确定手机当前所处楼层为3层,若3层为用户不允许进入的楼层,则手机可以震动、响铃、文字提示和/或语音提示的方式提示用户离开3层。比如,手机可以在定位界面显示“请尽快离开3楼”。Please refer to Figure 5, which is a schematic diagram of an application scenario according to an exemplary embodiment. In a possible scenario, when a user visits a factory building, in order to prevent the user from entering a floor that is not allowed to enter, the user can carry a mobile phone dedicated to positioning. When the user carries the mobile phone dedicated to positioning, the mobile phone can perform positioning operations on itself in real time or at specified intervals, and warn the user when it is located that the user has entered a floor that is not allowed to enter. Exemplarily, in response to the positioning operation on itself, the mobile phone can obtain the trajectory detection data of the user within a specified time period, and based on the trajectory detection data, determine through the first classification model that the current floor of the mobile phone is the 3rd floor. If the 3rd floor is a floor that the user is not allowed to enter, the mobile phone can vibrate, ring, text prompt and/or voice prompt to prompt the user to leave the 3rd floor. For example, the mobile phone can display "Please leave the 3rd floor as soon as possible" on the positioning interface.

需要说明的是,指定时间间隔可以预先进行设置,比如,该指定时间间隔可以为3分钟、5分钟或者10分钟等等。该指定时间段可以预先根据需求进行设置,且根据定位对象的不同,该指定时间段也不同。比如,在电子设备需要进行自定位的情况下,该指定时间段为在接收定位操作时刻之前且距离接收定位操作时刻最近的一段采集轨迹检测数据的时间段,该时间段可以为5分钟、3分钟或者1分钟等。在电子设备需要对其他设备进行定位的情况下,该指定时间段为其他设备在接收到电子设备发送的轨迹获取请求的接收时刻之前,且距离接收时刻最近的一段采集轨迹检测数据的时间段,该时间段可以为5分钟、3分钟或者1分钟等。It should be noted that the specified time interval can be set in advance, for example, the specified time interval can be 3 minutes, 5 minutes or 10 minutes, etc. The specified time period can be set in advance according to the needs, and the specified time period is different depending on the positioning object. For example, in the case where the electronic device needs to perform self-positioning, the specified time period is a time period for collecting trajectory detection data before receiving the positioning operation moment and the closest to the receiving positioning operation moment, and the time period can be 5 minutes, 3 minutes or 1 minute, etc. In the case where the electronic device needs to locate other devices, the specified time period is a time period for collecting trajectory detection data before the receiving moment of the trajectory acquisition request sent by the electronic device and the closest to the receiving moment, and the time period can be 5 minutes, 3 minutes or 1 minute, etc.

作为一个示例,由于电子设备可以按照自身的信号扫描周期扫描当前所处环境的wifi信号,且在每一次扫描得到一个轨迹点及在该轨迹点处所检测到的WiFi信号的信号强度,因此,电子设备可以将任意一个时间段内的多个轨迹点及多个轨迹点中每个轨迹点处检测到的WiFi信号的信号强度确定为轨迹检测数据。As an example, since the electronic device can scan the WiFi signal of the current environment according to its own signal scanning cycle, and obtain a trajectory point and the signal strength of the WiFi signal detected at the trajectory point in each scan, the electronic device can determine the signal strength of the WiFi signal detected at multiple trajectory points in any time period and each of the multiple trajectory points as trajectory detection data.

作为本申请的一个示例,商场大楼中通常会放置有多个智能清洁设备,该多个智能清洁设备用于清洁商场大楼的环境卫生。为了便于管理和规划,管理人员为了清楚地获知每一楼层中智能清洁设备的数量,可以通过手机、笔记本电脑、台式电脑等电子设备对每个智能清洁设备进行室内定位,本申请实施例的图6中以电子设备为手机为例进行说明。参见图6中的(a)图,管理人员可以在手机显示的管理界面中触发对智能清洁设备的定位操作,比如,管理人员可以在管理界面中点击“清洁设备分布情况”选项;响应于管理人员对“清洁设备分布情况”的点击操作,手机可以向每个智能清洁设备发送轨迹获取请求;每个智能清洁设备在接收到轨迹获取请求的情况下,可以将指定时间段内采集的轨迹检测数据发送给电子设备;电子设备接收每个智能清洁设备发送的轨迹检测数据,并基于每个智能清洁设备的轨迹检测数据,通过第一分类模型确定每个智能清洁设备所处楼层;之后,参见图6中的(b)图,电子设备可以统计每个楼层放置的智能清洁设备的数量,并在管理界面中显示每个楼层所放置的智能清洁设备的数量。As an example of the present application, a plurality of intelligent cleaning devices are usually placed in a shopping mall building, and the plurality of intelligent cleaning devices are used to clean the environment and sanitation of the shopping mall building. In order to facilitate management and planning, in order to clearly know the number of intelligent cleaning devices on each floor, the manager can use electronic devices such as mobile phones, laptops, desktop computers, etc. to perform indoor positioning of each intelligent cleaning device. In FIG. 6 of the embodiment of the present application, the electronic device is taken as an example of a mobile phone for illustration. Referring to FIG. 6 (a), the manager can trigger the positioning operation of the intelligent cleaning device in the management interface displayed by the mobile phone, for example, the manager can click the "distribution of cleaning equipment" option in the management interface; in response to the manager's click operation on the "distribution of cleaning equipment", the mobile phone can send a trajectory acquisition request to each intelligent cleaning device; each intelligent cleaning device, when receiving the trajectory acquisition request, can send the trajectory detection data collected within a specified time period to the electronic device; the electronic device receives the trajectory detection data sent by each intelligent cleaning device, and based on the trajectory detection data of each intelligent cleaning device, determines the floor where each intelligent cleaning device is located through the first classification model; afterwards, referring to FIG. 6 (b), the electronic device can count the number of intelligent cleaning devices placed on each floor, and display the number of intelligent cleaning devices placed on each floor in the management interface.

作为本申请的一个示例,为了便于家长确定小孩子的位置,小孩子通常会佩戴有智能穿戴设备,在商场中家长不慎与小孩分开的情况下,家长可以通过手机对小孩子的智能穿戴设备进行定位,以确定小孩所处楼层。比如,参见图7中的(a)图,家长在打开手机中安装的智能穿戴设备对应的应用程序后,可以在该应用程序的寻找界面中点击“室内定位”选项;手机响应于对“室内定位”选项的点击操作,向智能穿戴设备发送轨迹获取请求;智能穿戴设备在接收到轨迹获取请求的情况下,可以将指定时间段内采集的轨迹检测数据发送给家长的手机;手机在接收到智能穿戴设备发送的轨迹检测数据的情况下,基于轨迹检测数据,通过第一分类模型确定智能穿戴设备所处楼层,之后,参见图7中的(b)图,手机在寻找界面中显示智能穿戴设备当前所处楼层,从而家长可以获知小孩当前所处楼层。As an example of the present application, in order to facilitate parents to determine the location of their children, children usually wear smart wearable devices. In the case where parents accidentally separate from their children in a shopping mall, parents can use their mobile phones to locate their children's smart wearable devices to determine the floor where the children are located. For example, referring to Figure 7 (a), after parents open the application corresponding to the smart wearable device installed in the mobile phone, they can click the "indoor positioning" option in the search interface of the application; the mobile phone responds to the click operation of the "indoor positioning" option and sends a track acquisition request to the smart wearable device; when the smart wearable device receives the track acquisition request, it can send the track detection data collected within the specified time period to the parent's mobile phone; when the mobile phone receives the track detection data sent by the smart wearable device, it determines the floor where the smart wearable device is located based on the track detection data through the first classification model, and then, referring to Figure 7 (b), the mobile phone displays the current floor where the smart wearable device is located in the search interface, so that parents can know the current floor where the child is located.

作为本申请的一个示例,在汽车停入地下车库的车位后,若地下车库的楼层较多,且驾驶员在泊车的过程中并未留意汽车所停楼层,那么在后续寻找汽车所在车位时,驾驶员可以通过手机对汽车进行室内定位,以确定汽车所在楼层。比如,驾驶员可以打开汽车定位应用程序,参见图8中的(a)图,驾驶员在汽车定位应用程序的定位界面触发对汽车的定位操作;响应于对汽车的定位操作,手机向汽车的车载设备发送轨迹获取请求;汽车的车载设备在接收到轨迹获取请求的情况下,可以将汽车熄火前指定时间段内的轨迹检测数据发送给手机。手机在接收到汽车的车载设备发送的轨迹检测数据的情况下,基于轨迹检测数据,通过第一分类模型确定汽车所处楼层为负2层,之后,参见图8中的(b)图,手机在汽车定位界面中显示汽车当前所处楼层。As an example of the present application, after the car is parked in the parking space of the underground garage, if there are many floors in the underground garage and the driver did not pay attention to the floor where the car is parked during the parking process, then when looking for the parking space where the car is located later, the driver can use the mobile phone to perform indoor positioning of the car to determine the floor where the car is located. For example, the driver can open the car positioning application, see Figure (a) in Figure 8, the driver triggers the positioning operation of the car in the positioning interface of the car positioning application; in response to the positioning operation of the car, the mobile phone sends a trajectory acquisition request to the on-board device of the car; when the on-board device of the car receives the trajectory acquisition request, it can send the trajectory detection data within the specified time period before the car is turned off to the mobile phone. When the mobile phone receives the trajectory detection data sent by the on-board device of the car, based on the trajectory detection data, it is determined through the first classification model that the floor where the car is located is negative 2 floors, and then, see Figure (b) in Figure 8, the mobile phone displays the current floor of the car in the car positioning interface.

需要说明的是,本申请实施例仅以上述图5-图8所示的应用场景为例进行说明,并不对本申请实施例构成限定。It should be noted that the embodiments of the present application are only described using the application scenarios shown in the above-mentioned Figures 5 to 8 as examples, and do not constitute a limitation on the embodiments of the present application.

基于上述实施例提供的执行主体和应用场景,接下来对本申请实施例提供的室内定位的方法进行介绍。请参考图9,图9是根据一示例性实施例示出的一种室内定位的方法流程示意图。作为示例而非限定,这里以该方法应用于具有定位功能的电子设备中为例进行说明,该方法可以包括如下部分或者全部内容:Based on the execution entities and application scenarios provided in the above embodiments, the method for indoor positioning provided in the embodiments of the present application is introduced below. Please refer to Figure 9, which is a schematic flow chart of a method for indoor positioning according to an exemplary embodiment. As an example and not a limitation, the method is applied to an electronic device with a positioning function as an example, and the method may include some or all of the following contents:

步骤901:响应于对定位设备的定位操作,获取定位设备的轨迹检测数据。Step 901: In response to a positioning operation on a positioning device, trajectory detection data of the positioning device is acquired.

需要说明的是,定位设备可以为进行定位的电子设备,也可以为被电子设备进行定位的其他电子设备。也即是,定位设备可以定位自身所在的位置,也可以被其他电子设备定位当前所在的位置。It should be noted that the positioning device can be an electronic device that performs positioning, or can be another electronic device that is positioned by the electronic device. That is, the positioning device can locate its own location, or can be located by other electronic devices.

在一种可能的实现方式中,在电子设备需要进行自身定位的情况下,也即是电子设备为定位设备的情况下,电子设备响应于对定位设备的定位操作,获取定位设备在指定时间段内检测到的轨迹检测数据。示例性地,该过程可以参考上述图5所示的应用场景。In a possible implementation, when the electronic device needs to locate itself, that is, when the electronic device is a positioning device, the electronic device responds to the positioning operation of the positioning device and obtains the trajectory detection data detected by the positioning device within a specified time period. Exemplarily, the process can refer to the application scenario shown in FIG5 above.

在另一种可能的方式中,在电子设备与定位设备为两个独立设备,电子设备对定位设备进行定位的情况下,响应于对定位设备的定位操作,电子设备向定位设备发送轨迹获取请求;定位设备在接收到轨迹获取请求的情况下,获取在指定时间段内检测到的轨迹检测数据,并将轨迹检测数据发送给电子设备;电子设备接收定位设备发送的轨迹检测数据。示例性地,该过程可以参考上述图6、图7或图8所示的应用场景。In another possible manner, when the electronic device and the positioning device are two independent devices and the electronic device positions the positioning device, in response to the positioning operation on the positioning device, the electronic device sends a track acquisition request to the positioning device; when the positioning device receives the track acquisition request, it acquires the track detection data detected within a specified time period and sends the track detection data to the electronic device; the electronic device receives the track detection data sent by the positioning device. Exemplarily, the process can refer to the application scenarios shown in FIG. 6, FIG. 7 or FIG. 8 above.

步骤902:基于轨迹检测数据,通过第一分类模型确定定位设备所处的楼层。Step 902: Based on the trajectory detection data, determine the floor where the positioning device is located through a first classification model.

作为一种示例,电子设备可以将轨迹检测数据输入至第一分类模型,通过第一分类模型对轨迹检测数据进行分类处理,并通过第一分类模型输出对轨迹检测数据的分类结果;将该分类结果确定为定位设备所处的楼层。As an example, the electronic device can input the trajectory detection data into the first classification model, classify the trajectory detection data through the first classification model, and output the classification result of the trajectory detection data through the first classification model; and determine the classification result as the floor where the positioning device is located.

需要说明的是,第一分类模型为预先基于第一指纹库对第二分类模型进行迭代训练得到,第一指纹库是基于指纹测试集通过第二分类模型对第二指纹库进行数据扩展后得到,第二分类模型是基于第二指纹库对初始分类模型进行训练得到,第二指纹库包括多个样本轨迹检测数据,多个样本轨迹检测数据中的每个样本轨迹检测数据均带有楼层标签。It should be noted that the first classification model is obtained by iteratively training the second classification model based on the first fingerprint library in advance, the first fingerprint library is obtained by data expansion of the second fingerprint library through the second classification model based on the fingerprint test set, and the second classification model is obtained by training the initial classification model based on the second fingerprint library. The second fingerprint library includes multiple sample trajectory detection data, and each of the multiple sample trajectory detection data has a floor label.

作为一个示例,第一指纹库是基于指纹测试集通过第二分类模型对第二指纹库进行数据扩展后得到,而基于指纹测试集通过第二分类模型对第二指纹库进行数据扩展的操作包括:通过第二分类模型对指纹测试集中的样本轨迹检测数据进行遍历处理,在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中。也即是,第一指纹库是通过第二分类模型对指纹测试集中的样本轨迹检测数据进行遍历处理,在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中得到。As an example, the first fingerprint library is obtained by performing data expansion on the second fingerprint library through the second classification model based on the fingerprint test set, and the operation of performing data expansion on the second fingerprint library through the second classification model based on the fingerprint test set includes: traversing the sample trajectory detection data in the fingerprint test set through the second classification model, and during the traversal process, adding the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold to the second fingerprint library. That is, the first fingerprint library is obtained by traversing the sample trajectory detection data in the fingerprint test set through the second classification model, and during the traversal process, adding the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold to the second fingerprint library.

值得说明的是,在基于指纹测试集对第二分类模型的定位性能进行测试过程中,还可以扩展第二指纹库的数据量,从而保证了第一指纹库的数据量,提高了第一指纹库的可靠性。It is worth noting that, in the process of testing the positioning performance of the second classification model based on the fingerprint test set, the data volume of the second fingerprint library can also be expanded, thereby ensuring the data volume of the first fingerprint library and improving the reliability of the first fingerprint library.

作为一个示例,第二指纹库为电子设备基于初始指纹库和指纹测试集,对初始指纹库进行数据扩展处理后得到,初始指纹库为电子设备从获取的第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据得到。As an example, the second fingerprint library is obtained by the electronic device after performing data expansion processing on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set, and the initial fingerprint library is obtained by the electronic device randomly selecting a second number of flat sample trajectory detection data from the acquired first number of sample trajectory detection data.

如此,通过随机选择第二数量的平层样本轨迹检测数据,保证了初始指纹库中不会出现跨层样本轨迹检测数据,保证了初始指纹库的可靠性。In this way, by randomly selecting the second number of flat-layer sample trajectory detection data, it is ensured that no cross-layer sample trajectory detection data will appear in the initial fingerprint library, thereby ensuring the reliability of the initial fingerprint library.

作为一个示例,指纹测试集为电子设备从第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合。As an example, the fingerprint test set is a set of sample trajectory detection data remaining after the electronic device randomly selects the sample trajectory detection data from the first number of sample trajectory detection data.

值得说明的是,指纹测试集与初始指纹库来源于同一批样本轨迹检测数据,从而提高了构建初始指纹库与指纹测试集的便利性。It is worth noting that the fingerprint test set and the initial fingerprint library are derived from the same batch of sample trajectory detection data, thereby improving the convenience of constructing the initial fingerprint library and the fingerprint test set.

在一些实施例中,指纹测试集也可以通过其他方式获取,比如,电子设备还可以获取第一数量的样本轨迹检测数据之外的其他样本轨迹检测数据,并将其他样本轨迹检测数据构成的集合确定为指纹测试集。其中,其他样本轨迹检测数据同样是针对同一室内楼层的样本轨迹检测数据。In some embodiments, the fingerprint test set may also be obtained in other ways, for example, the electronic device may also obtain other sample trajectory detection data in addition to the first number of sample trajectory detection data, and determine the set consisting of other sample trajectory detection data as the fingerprint test set. The other sample trajectory detection data is also sample trajectory detection data for the same indoor floor.

在一些实施例中,电子设备基于第二指纹库对初始分类模型进行训练得到第二分类模型的操作,基于指纹测试集通过第二分类模型对第二指纹库进行数据扩展,得到第一指纹库的操作,以及基于第一指纹库对第二分类模型进行迭代训练得到第一分类模型的操作均可以参考下述图10所示的对指纹库进行构建的方法。In some embodiments, the operation of the electronic device training the initial classification model based on the second fingerprint library to obtain the second classification model, the operation of performing data expansion on the second fingerprint library through the second classification model based on the fingerprint test set to obtain the first fingerprint library, and the operation of iteratively training the second classification model based on the first fingerprint library to obtain the first classification model can all refer to the method for constructing the fingerprint library shown in Figure 10 below.

在本申请实施例中,在需要进行室内定位的情况下,电子设备可以获取定位设备的轨迹检测数据,然后根据轨迹检测数据,通过第一分类模型确定定位设备所处的楼层。由于第一分类模型是根据经过数据扩展的第一指纹库训练得到,而第一指纹库是基于指纹测试集对第二指纹库进行数据扩展后得到,从而第一指纹库中的数据量较为可靠,进而第一分类模型的定位准确性也得到了提升。In the embodiment of the present application, when indoor positioning is required, the electronic device can obtain the trajectory detection data of the positioning device, and then determine the floor where the positioning device is located through the first classification model based on the trajectory detection data. Since the first classification model is trained based on the first fingerprint library after data expansion, and the first fingerprint library is obtained by data expansion of the second fingerprint library based on the fingerprint test set, the amount of data in the first fingerprint library is relatively reliable, and thus the positioning accuracy of the first classification model is also improved.

请参考图10,图10是根据一示例性实施例示出的一种指纹库的构建方法流程示意图。作为示例而非限定,这里以该方法应用于具有定位功能的电子设备中为例进行说明,该方法可以包括如下部分或者全部内容:Please refer to Figure 10, which is a schematic diagram of a method for constructing a fingerprint library according to an exemplary embodiment. As an example but not a limitation, the method is applied to an electronic device with a positioning function as an example for explanation, and the method may include some or all of the following contents:

步骤1001:获取第二指纹库和指纹测试集。Step 1001: Obtain a second fingerprint database and a fingerprint test set.

需要说明的是,第二指纹库包括多个样本轨迹检测数据,该多个样本轨迹检测数据中每个样本轨迹检测数据均带有楼层标签。It should be noted that the second fingerprint library includes a plurality of sample trajectory detection data, and each of the plurality of sample trajectory detection data has a floor label.

在一些实施例中,电子设备获取第二指纹库和指纹测试集的操作可以参考下述步骤A1-步骤A4的操作。In some embodiments, the operation of the electronic device acquiring the second fingerprint library and the fingerprint test set may refer to the operations of the following steps A1 to A4.

步骤A1:电子设备获取第一数量的样本轨迹检测数据,该第一数量的样本轨迹检测数据至少包括平层样本轨迹检测数据。Step A1: the electronic device obtains a first quantity of sample trajectory detection data, where the first quantity of sample trajectory detection data at least includes flat layer sample trajectory detection data.

在一些实施例中,在构建指纹库的过程中,通常需要人工获取样本轨迹检测数据,也即是,采集人员携带用于进行数据采集的电子设备设备在当前所处室内环境的各个楼层中采集样本轨迹检测数据,并对每个样本轨迹检测数据分配对应的楼层标签,然后将采集的携带有楼层标签的各个样本轨迹检测数据发送给电子设备,从而电子设备能够获取到第一数量的样本轨迹检测数据。In some embodiments, in the process of building a fingerprint library, it is usually necessary to manually obtain sample trajectory detection data, that is, the collector carries an electronic device for data collection to collect sample trajectory detection data on each floor of the current indoor environment, and assigns a corresponding floor label to each sample trajectory detection data, and then sends the collected sample trajectory detection data carrying the floor label to the electronic device, so that the electronic device can obtain a first number of sample trajectory detection data.

步骤A2:电子设备从该第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库。Step A2: the electronic device randomly selects a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library.

由于采集人员在进行数据采集的过程中,除了采集到平层样本轨迹检测数据外,也可能会采集到跨层样本轨迹检测数据,而平层样本轨迹检测数据是对定位具有作用的数据,因此,电子设备可以从第一数量的样本轨迹中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库。又由于在后续进行模型训练后,为了验证模型训练结果,通常情况下还会设置指纹测试集,因此,电子设备可以将第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合确定为指纹测试集。Since the data collector may collect cross-layer sample trajectory detection data in addition to flat-layer sample trajectory detection data during data collection, and the flat-layer sample trajectory detection data is data that is useful for positioning, the electronic device can randomly select a second number of flat-layer sample trajectory detection data from the first number of sample trajectories to obtain an initial fingerprint library. In addition, after subsequent model training, a fingerprint test set is usually set in order to verify the model training results. Therefore, the electronic device can determine the set consisting of the remaining sample trajectory detection data after random selection from the first number of sample trajectory detection data as the fingerprint test set.

需要说明的是,平层样本轨迹检测数据为用于数据采集的电子设备在同一楼层中采集的样本轨迹检测数据,跨层样本轨迹检测数据为用于数据采集的电子设备在不同楼层之间采集的样本轨迹检测数据。为了便于对不同类型的样本轨迹检测数据进行理解,参见图11,本申请实施例提供了一种不同类型的样本轨迹检测数据的示意图,其中,本申请实施例中仅以图11中所示的样本轨迹检测数据为例进行说明,并不对本申请实施例构成限定。It should be noted that the flat-floor sample trajectory detection data is the sample trajectory detection data collected by the electronic device for data collection on the same floor, and the cross-floor sample trajectory detection data is the sample trajectory detection data collected by the electronic device for data collection between different floors. In order to facilitate the understanding of different types of sample trajectory detection data, referring to FIG11, an embodiment of the present application provides a schematic diagram of different types of sample trajectory detection data, wherein the embodiment of the present application only uses the sample trajectory detection data shown in FIG11 as an example for illustration, and does not constitute a limitation on the embodiment of the present application.

需要说明的是,该第二数量为根据需求预先设置的数量,比如,该第二数量为100或200等。It should be noted that the second number is a number preset according to demand, for example, the second number is 100 or 200.

由于在一些情况下,有的样本轨迹检测数据中包括的轨迹点数量较多,可能会对后续进行定位的计算量带来麻烦,因此,电子设备从第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库之前,还可以对包括的轨迹点数量较多的样本轨迹检测数据进行一些处理,以减少样本轨迹检测数据中的轨迹点数量。In some cases, some sample trajectory detection data include a large number of trajectory points, which may cause trouble for the calculation amount of subsequent positioning. Therefore, the electronic device randomly selects a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data. Before obtaining the initial fingerprint library, the sample trajectory detection data including a large number of trajectory points may be processed to reduce the number of trajectory points in the sample trajectory detection data.

在一些实施例中,在第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理,得到第三数量的样本轨迹检测数据,该第三数量的样本轨迹检测数据中的各个样本轨迹检测数据的轨迹点数量小于或等于数量阈值。这样一来,电子设备可以从第三数量的样本轨迹检测数据中随机选择第二数量的样本轨迹检测数据,得到初始指纹库。In some embodiments, when the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than the number threshold, the sample trajectory detection data whose number of trajectory points is greater than the number threshold is segmented to obtain a third number of sample trajectory detection data, wherein the number of trajectory points of each sample trajectory detection data in the third number of sample trajectory detection data is less than or equal to the number threshold. In this way, the electronic device can randomly select a second number of sample trajectory detection data from the third number of sample trajectory detection data to obtain an initial fingerprint library.

由于在样本轨迹检测数据中包括的轨迹点数量大于数量阈值的情况下,说明后续基于该样本轨迹检测数据进行定位操作时,将带来计算上的麻烦,因此,电子设备可以对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理。When the number of trajectory points included in the sample trajectory detection data is greater than the quantity threshold, it means that subsequent positioning operations based on the sample trajectory detection data will cause computational troubles. Therefore, the electronic device can segment the sample trajectory detection data whose number of trajectory points is greater than the quantity threshold.

需要说明的是,数量阈值可以根据需求预先进行设置,比如,该数量阈值可以为15、20或者30等等。It should be noted that the quantity threshold can be pre-set according to requirements, for example, the quantity threshold can be 15, 20 or 30, etc.

值得说明的是,通过对较长的样本轨迹检测数据进行分割,从而减少了较长的样本轨迹检测数据中包括的轨迹点数量,进而降低了后续基于样本轨迹检测数据进行计算的计算量。It is worth noting that by segmenting the longer sample trajectory detection data, the number of trajectory points included in the longer sample trajectory detection data is reduced, thereby reducing the amount of subsequent calculations based on the sample trajectory detection data.

作为一个示例,在第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,电子设备对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理的操作包括:在第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,以划分数值为间隔对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割,得到第四数量的样本轨迹检测数据,该划分数值为小于或等于数量阈值的数值;在第四数量的样本轨迹检测数据中包括轨迹点数量小于划分数值的样本轨迹检测数据的情况下,将轨迹点数量小于划分数值的样本轨迹检测数据删除,得到第三数量的样本轨迹检测数据。As an example, in a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than a quantity threshold, the operation of the electronic device performing segmentation processing on the sample trajectory detection data whose number of trajectory points is greater than the quantity threshold includes: in a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than the quantity threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the quantity threshold with a segmentation value as an interval to obtain a fourth number of sample trajectory detection data, where the segmentation value is a value less than or equal to the quantity threshold; in a case where the fourth number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is less than the segmentation value, deleting the sample trajectory detection data whose number of trajectory points is less than the segmentation value to obtain a third number of sample trajectory detection data.

需要说明的是,划分数值同样可以根据需求预先进行设置,且划分数值可以与数量阈值相同,也可以小于数量阈值,本申请实施例对不做具体限制。It should be noted that the division value can also be pre-set according to needs, and the division value can be the same as the quantity threshold or less than the quantity threshold, and the embodiment of the present application does not impose specific restrictions on this.

由于在样本轨迹检测数据中包括的轨迹点数量太少的情况下,该样本轨迹检测数据可能会影响模型训练的准确度,因此,电子设备可以将轨迹点数量小于划分数值的样本轨迹检测数据删除。Because when the number of trajectory points included in the sample trajectory detection data is too small, the sample trajectory detection data may affect the accuracy of model training, and therefore, the electronic device may delete the sample trajectory detection data whose number of trajectory points is less than the division value.

值得说明的是,通过划分数值为间隔对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割,不仅能够扩展样本轨迹检测数据的数量,同时还能够降低后续进行模型训练时的计算量,并提高模型训练的准确度。It is worth noting that by dividing the sample trajectory detection data whose number of trajectory points is greater than the quantity threshold into intervals, not only can the number of sample trajectory detection data be expanded, but also the amount of calculation in subsequent model training can be reduced and the accuracy of model training can be improved.

由于平层样本轨迹数据为进行模型训练的样本轨迹数据,因此,电子设备在对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理的情况下,可以对轨迹点数量大于数量阈值的平层样本轨迹检测数据进行分割处理。Since the flat layer sample trajectory data is the sample trajectory data for model training, when the electronic device performs segmentation processing on the sample trajectory detection data whose number of trajectory points is greater than the number threshold, it can perform segmentation processing on the flat layer sample trajectory detection data whose number of trajectory points is greater than the number threshold.

步骤A3:电子设备将该第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合确定为指纹测试集。Step A3: The electronic device determines a set consisting of sample trajectory detection data remaining after randomly selecting the first number of sample trajectory detection data as a fingerprint test set.

在一些实施例中,电子设备不仅可以将该第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合确定为指纹测试集,还可以通过其他方式确定,比如,电子设备还可以获取第一数量的样本轨迹检测数据之外的其他样本轨迹检测数据,并将其他样本轨迹检测数据构成的集合确定为指纹测试集。其中,其他样本轨迹检测数据同样是针对同一室内楼层的样本轨迹检测数据。In some embodiments, the electronic device may not only determine the set consisting of the sample trajectory detection data remaining after random selection from the first number of sample trajectory detection data as the fingerprint test set, but may also determine it in other ways, for example, the electronic device may also obtain other sample trajectory detection data other than the first number of sample trajectory detection data, and determine the set consisting of other sample trajectory detection data as the fingerprint test set. The other sample trajectory detection data is also the sample trajectory detection data for the same indoor floor.

步骤A4:电子设备基于初始指纹库和指纹测试集,对初始指纹库进行数据扩展处理,得到第二指纹库。Step A4: The electronic device performs data expansion processing on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set to obtain a second fingerprint library.

由于在初始指纹库中的样本轨迹检测数据的数量较少的情况下,无论对于模型训练的准确性还是后续进行定位的准确性都有影响,因此,为了提高后续模型训练准确性和定位的准确性,电子设备可以基于初始指纹库和指纹测试集,对初始指纹库进行数据扩展处理。Since the number of sample trajectory detection data in the initial fingerprint library is small, it affects both the accuracy of model training and the accuracy of subsequent positioning. Therefore, in order to improve the accuracy of subsequent model training and positioning, the electronic device can perform data expansion processing on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set.

值得说明的是,通过指纹测试集对初始指纹库进行扩展处理,从而保证了第二指纹库中的样本轨迹检测数据的数据量,提高了第二指纹库的可靠性。It is worth noting that the initial fingerprint library is expanded by using the fingerprint test set, thereby ensuring the data volume of the sample trajectory detection data in the second fingerprint library and improving the reliability of the second fingerprint library.

在一种可能的实现方式中,电子设备基于初始指纹库和指纹测试集,对初始指纹库进行数据扩展处理的操作包括:依次遍历指纹测试集中的各个样本轨迹检测数据;确定第二样本轨迹检测数据与初始指纹库中的每个样本轨迹检测数据之间的欧式距离和杰卡德距离,该第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;在初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从至少一个第三样本轨迹检测数据中确定与第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,第三样本轨迹检测数据是指与第二样本轨迹检测数据之间的欧氏距离小于第一距离阈值,且与第二样本轨迹检测数据之间的杰卡德距离小于第二距离阈值的样本轨迹检测数据;将第二样本轨迹检测数据的楼层标签更新为所确定的第三样本轨迹检测数据的楼层标签;将标签更新后的第二样本轨迹检测数据添加至初始指纹库中。In a possible implementation, the electronic device performs data expansion processing on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set, including: traversing each sample trajectory detection data in the fingerprint test set in turn; determining the Euclidean distance and the Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library, the second sample trajectory detection data being the currently traversed sample trajectory detection data; in the case where there is at least one third sample trajectory detection data in the initial fingerprint library, determining the third sample trajectory detection data with the greatest similarity to the second sample trajectory detection data from the at least one third sample trajectory detection data, the third sample trajectory detection data referring to the sample trajectory detection data having a Euclidean distance with the second sample trajectory detection data less than a first distance threshold and a Jaccard distance with the second sample trajectory detection data less than a second distance threshold; updating the floor label of the second sample trajectory detection data to the determined floor label of the third sample trajectory detection data; and adding the second sample trajectory detection data with the updated label to the initial fingerprint library.

由于欧式距离和杰卡德距离(Jaccard距离)能够描述两个数据之间的相似度,且距离越小相似度越大,因此,电子设备可以确定第二样本轨迹检测数据与初始指纹库中的每个样本轨迹检测数据之间的欧式距离和杰卡德距离。Since the Euclidean distance and the Jaccard distance can describe the similarity between two data, and the smaller the distance, the greater the similarity, the electronic device can determine the Euclidean distance and the Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library.

在一些实施例中,电子设备将标签更新后的第二样本轨迹检测数据添加至初始指纹库的同时,将第二样本轨迹检测数据从指纹测试集中删除。In some embodiments, the electronic device adds the second sample trajectory detection data with the updated label to the initial fingerprint library, and deletes the second sample trajectory detection data from the fingerprint test set.

在一些实施例中,在不存在至少一个第三样本轨迹检测数据的情况下,电子设备可以结束对初始指纹库的扩展。In some embodiments, when there is no at least one third sample trajectory detection data, the electronic device may end the expansion of the initial fingerprint library.

值得说明的是,通过从至少一个第三样本轨迹检测数据中确定与第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,从而保证了对初始指纹库进行扩展的合理性。It is worth noting that by determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from at least one third sample trajectory detection data, the rationality of expanding the initial fingerprint library is ensured.

为了便于确定第二样本轨迹检测数据与初始指纹库中每个样本轨迹检测数据之间的欧式距离和杰卡德距离,对于指纹测试集中的每个样本轨迹检测数据中的每个轨迹点以及初始指纹库中每个样本轨迹检测数据中的每个轨迹点,电子设备可以通过m个wifi信号强度表示,其中,m为当前室内环境内安装的无线接入点(Access Point,AP)的个数。比如,m可以为8000、10000或者100等。In order to facilitate the determination of the Euclidean distance and Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library, for each trajectory point in each sample trajectory detection data in the fingerprint test set and each trajectory point in each sample trajectory detection data in the initial fingerprint library, the electronic device can be represented by m wifi signal strengths, where m is the number of wireless access points (AP) installed in the current indoor environment. For example, m can be 8000, 10000 or 100, etc.

示例性地,该初始指纹库F可以通过下述第一公式(1)表示,其中,在下述第一公式(1)中,初始指纹库F包括N条样本轨迹检测数据;任意一个样本轨迹检测数据Bi中包括x个轨迹点,不同的样本轨迹检测数据包括的轨迹点的数量可能不相同,因此,x的取值为可变数值;每个轨迹点Ci由m个WiFi信号强度表示,AP1表示AP1对应的wifi信号的wifi信号强度。Exemplarily, the initial fingerprint library F can be expressed by the following first formula (1), wherein, in the following first formula (1), the initial fingerprint library F includes N sample trajectory detection data; any sample trajectory detection data Bi includes x trajectory points, and the number of trajectory points included in different sample trajectory detection data may be different, so the value of x is a variable value; each trajectory point Ci is represented by m WiFi signal strengths, and AP 1 represents the WiFi signal strength of the WiFi signal corresponding to AP 1 .

示例性地,指纹测试集T可以通过下述第二公式(2)表示,其中,在下述第二公式(2)中,指纹测试集T中包括P条样本轨迹检测数据,任意一个样本轨迹检测数据Ai中包括x个轨迹点,同理,x的取值为可变数值;每个轨迹点Di由m个WiFi信号强度表示,AP1表示AP1对应的wifi信号的wifi信号强度。Exemplarily, the fingerprint test set T can be expressed by the following second formula (2), wherein in the following second formula (2), the fingerprint test set T includes P sample trajectory detection data, and any sample trajectory detection data Ai includes x trajectory points. Similarly, the value of x can be a variable value; each trajectory point Di is represented by m WiFi signal strengths, and AP 1 represents the WiFi signal strength of the WiFi signal corresponding to AP 1 .

在一些实施例中,电子设备可以通过下述第三公式(3)确定第二样本轨迹检测数据与初始指纹库中每个样本轨迹检测数据之间的欧式距离。In some embodiments, the electronic device may determine the Euclidean distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library by using the following third formula (3).

dAi_F=mini∈(1,N)|Aj-Bi| (3)d Ai_F =min i∈(1,N) |A j -B i | (3)

需要说明的是,在上述第三公式(3)中,dAj_F为第二样本轨迹检测数据与初始指纹库中任意一个样本轨迹检测数据之间的欧式距离,Aj为第二样本轨迹检测数据,Bi为初始指纹库中任意一个样本轨迹检测数据。It should be noted that in the above third formula (3), d Aj_F is the Euclidean distance between the second sample trajectory detection data and any sample trajectory detection data in the initial fingerprint library, A j is the second sample trajectory detection data, and Bi is any sample trajectory detection data in the initial fingerprint library.

在一些实施例中,电子设备可以通过下述第四公式(4)确定第二样本轨迹检测数据与初始指纹库中每个样本轨迹检测数据之间的杰卡德距离。In some embodiments, the electronic device may determine the Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library by using the following fourth formula (4).

需要说明的是,在上述第四公式(4)中,为第二样本轨迹检测数据与初始指纹库中任意一个样本轨迹检测数据之间的杰卡德距离,Aj为第二样本轨迹检测数据,Bi为初始指纹库中任意一个样本轨迹检测数据。It should be noted that in the fourth formula (4), is the Jaccard distance between the second sample trajectory detection data and any sample trajectory detection data in the initial fingerprint library, A j is the second sample trajectory detection data, and Bi is any sample trajectory detection data in the initial fingerprint library.

由于电子设备可以确定第二样本轨迹检测数据与初始指纹库中每个样本轨迹检测数据之间的欧式距离和杰卡德距离,因此,电子设备需要确定同时满足欧式距离要求和杰卡德距离要求的样本轨迹检测数据,即电子设备需要确定与第二样本轨迹检测数据之间的欧氏距离小于第一距离阈值,且与第二样本轨迹检测数据之间的杰卡德距离小于第二距离阈值的样本轨迹检测数据的至少一个第三样本轨迹检测数据。Since the electronic device can determine the Euclidean distance and the Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library, the electronic device needs to determine the sample trajectory detection data that satisfies both the Euclidean distance requirement and the Jaccard distance requirement, that is, the electronic device needs to determine at least one third sample trajectory detection data of the sample trajectory detection data whose Euclidean distance with the second sample trajectory detection data is less than the first distance threshold and whose Jaccard distance with the second sample trajectory detection data is less than the second distance threshold.

需要说明的是,第一距离阈值和第二距离阈值均可以根据需求预先进行设置。且第一距离阈值和第二距离阈值可以为固定阈值,也可以为动态阈值。It should be noted that both the first distance threshold and the second distance threshold can be pre-set according to requirements, and the first distance threshold and the second distance threshold can be fixed thresholds or dynamic thresholds.

由于在构建指纹库的过程中,电子设备从每个楼层对应的样本轨迹检测数据中选择固定数量的样本轨迹检测数据加入至指纹库中,而人工采集的样本轨迹检测数据通常具有局限性,比如,人工采集的样本轨迹检测数据呈现数据分布不均匀的现象,即有的楼层对应的样本轨迹检测数据的数量较多,而有的楼层对应的样本轨迹检测数据的数量较少,甚至有的楼层对应的样本轨迹检测数据的数量可能无法达到需要的数量。因此,第一距离阈值和第二距离阈值也可以为动态阈值,且第一距离阈值和第二距离阈值均可以根据初始指纹库中每个楼层所对应的样本轨迹检测数据的数量确定。其中,在任意一个楼层对应的样本轨迹检测数据的数量较少的情况下,为了对该楼层对应的样本轨迹检测数据进行大量的数据扩展,该楼层对应的第一距离阈值和第二距离阈值均比较大;在任意一个楼层对应的样本轨迹检测数据的数量较多的情况下,该楼层对应的第一距离阈值和第二距离阈值均比较小。Since in the process of constructing the fingerprint library, the electronic device selects a fixed number of sample trajectory detection data from the sample trajectory detection data corresponding to each floor and adds them to the fingerprint library, and the sample trajectory detection data collected manually usually has limitations, for example, the sample trajectory detection data collected manually presents the phenomenon of uneven data distribution, that is, the number of sample trajectory detection data corresponding to some floors is large, while the number of sample trajectory detection data corresponding to some floors is small, and even the number of sample trajectory detection data corresponding to some floors may not reach the required number. Therefore, the first distance threshold and the second distance threshold can also be dynamic thresholds, and the first distance threshold and the second distance threshold can both be determined according to the number of sample trajectory detection data corresponding to each floor in the initial fingerprint library. Among them, when the number of sample trajectory detection data corresponding to any floor is small, in order to perform a large amount of data expansion on the sample trajectory detection data corresponding to the floor, the first distance threshold and the second distance threshold corresponding to the floor are both relatively large; when the number of sample trajectory detection data corresponding to any floor is large, the first distance threshold and the second distance threshold corresponding to the floor are both relatively small.

示例性地,电子设备中设置有数量、第一距离阈值和第二距离阈值之间的对应关系,因此,电子设备可以根据初始指纹数据库中每个楼层对应的样本轨迹检测数据的数量从该对应关系中,确定每个样本轨迹检测数据对应的第一距离阈值和第二距离阈值。Exemplarily, a correspondence between the quantity, the first distance threshold and the second distance threshold is set in the electronic device. Therefore, the electronic device can determine the first distance threshold and the second distance threshold corresponding to each sample trajectory detection data from the correspondence according to the quantity of sample trajectory detection data corresponding to each floor in the initial fingerprint database.

由于第一距离阈值和第二距离阈值为动态阈值,因此,电子设备在确定第二样本轨迹检测数据与初始指纹库中的每个样本轨迹检测数据之间的欧式距离和杰卡德距离之后,可以根据初始指纹库中每个楼层对应的样本轨迹检测数据的数量,确定每个样本轨迹检测数据对应的第一距离阈值和第二距离阈值,然后根据每个样本轨迹检测数据对应的第一距离阈值和第二距离阈值,确定是否存在至少一个第三样本轨迹检测数据;在存在至少一个第三样本轨迹检测数据的情况下,从至少一个第三样本轨迹检测数据中确定相似度最大的第三样本轨迹检测数据,将第二样本轨迹检测数据的楼层标签更新为所确定的第三样本轨迹检测数据的楼层标签,并将标签更新后的第二样本轨迹检测数据添加至初始指纹库中,同时,将第二样本轨迹检测数据从指纹测试集中删除。在不存在至少一个第三样本轨迹检测数据的情况下,结束对初始指纹库的扩展。示例性地,该过程可以通过下述图12所示的示意图表示。Since the first distance threshold and the second distance threshold are dynamic thresholds, after determining the Euclidean distance and Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library, the electronic device can determine the first distance threshold and the second distance threshold corresponding to each sample trajectory detection data according to the number of sample trajectory detection data corresponding to each floor in the initial fingerprint library, and then determine whether there is at least one third sample trajectory detection data according to the first distance threshold and the second distance threshold corresponding to each sample trajectory detection data; in the case of at least one third sample trajectory detection data, determine the third sample trajectory detection data with the greatest similarity from the at least one third sample trajectory detection data, update the floor label of the second sample trajectory detection data to the floor label of the determined third sample trajectory detection data, and add the second sample trajectory detection data with the updated label to the initial fingerprint library, and at the same time, delete the second sample trajectory detection data from the fingerprint test set. In the case of the absence of at least one third sample trajectory detection data, the expansion of the initial fingerprint library is terminated. Exemplarily, the process can be represented by the schematic diagram shown in FIG. 12 below.

值得说明的是,通过设置第一距离阈值和第二距离阈值,从而在将标签更新后的第三样本轨迹检测数据加入至初始指纹库中后,使得第二指纹库中各个楼层对应的样本轨迹检测数据更加均衡。It is worth noting that by setting the first distance threshold and the second distance threshold, after the third sample trajectory detection data after the label update is added to the initial fingerprint library, the sample trajectory detection data corresponding to each floor in the second fingerprint library is made more balanced.

在一些实施例中,在初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,电子设备从至少一个第三样本轨迹检测数据中确定与第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据的操作包括:在初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从至少一个第三样本轨迹检测数据中获取与第二样本轨迹数据之间的欧氏距离最小的第三样本轨迹检测数据;或者,在初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从至少一个第三样本轨迹检测数据中获取与第二样本轨迹数据之间的杰卡德距离最小的第三样本轨迹检测数据。In some embodiments, when there is at least one third sample trajectory detection data in the initial fingerprint library, the operation of the electronic device determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from the at least one third sample trajectory detection data includes: when there is at least one third sample trajectory detection data in the initial fingerprint library, obtaining the third sample trajectory detection data having the smallest Euclidean distance with the second sample trajectory data from the at least one third sample trajectory detection data; or, when there is at least one third sample trajectory detection data in the initial fingerprint library, obtaining the third sample trajectory detection data having the smallest Jaccard distance with the second sample trajectory data from the at least one third sample trajectory detection data.

由于欧式距离越小,相似度越大,因此,在初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,电子设备可以从至少一个第三样本轨迹中选择与第二样本轨迹数据之间的欧式距离最小的第三样本轨迹检测数据,所选择的第三样本轨迹检测数据为与第二样本轨迹检测数据之间的相似度最大的样本轨迹检测数据。当然,由于杰卡德距离同样可以衡量两个数据之间的相似度,且该杰卡德距离越小,相似度越大,因此,在初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,电子设备也可以从至少一个第三样本轨迹中选择与第二样本轨迹数据之间的杰卡德距离最小的第三样本轨迹检测数据,所选择的第三样本轨迹检测数据为与第二样本轨迹检测数据之间的相似度最大的样本轨迹检测数据。Since the smaller the Euclidean distance, the greater the similarity, therefore, in the case where there is at least one third sample trajectory detection data in the initial fingerprint library, the electronic device can select the third sample trajectory detection data with the smallest Euclidean distance from the second sample trajectory data from at least one third sample trajectory, and the selected third sample trajectory detection data is the sample trajectory detection data with the greatest similarity to the second sample trajectory detection data. Of course, since the Jaccard distance can also measure the similarity between two data, and the smaller the Jaccard distance, the greater the similarity, therefore, in the case where there is at least one third sample trajectory detection data in the initial fingerprint library, the electronic device can also select the third sample trajectory detection data with the smallest Jaccard distance from the second sample trajectory data from at least one third sample trajectory, and the selected third sample trajectory detection data is the sample trajectory detection data with the greatest similarity to the second sample trajectory detection data.

值得说明的是,由于欧氏距离和杰卡德距离都可以描述两个数据之间的相似度,因此,通过欧式距离或杰卡德距离,从至少一个第三样本轨迹检测数据中选择与第二样本轨迹检测数据之间的相似度最大的第三样本轨迹检测数据,可以使得选择出的第三样本轨迹检测数据更加准确。It is worth noting that, since both the Euclidean distance and the Jaccard distance can describe the similarity between two data, by using the Euclidean distance or the Jaccard distance, the third sample trajectory detection data having the greatest similarity with the second sample trajectory detection data is selected from at least one third sample trajectory detection data, so that the selected third sample trajectory detection data can be more accurate.

在一些实施例中,由于欧氏距离和杰卡德距离均可以描述两个数据之间的相似度,在两个数据之间的欧式距离最小的情况下,这两个数据之间的杰卡德距离也可能是最小的,因此,电子设备不仅可以按照上述方式从至少一个第三样本轨迹检测数据中确定与第二样本轨迹检测数据的相似度最大的第三样本轨迹检数据,还可以通过其他方式确定。比如,在初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从至少一个第三样本轨迹检测数据中获取与第二样本轨迹数据之间的欧氏距离最小,且同时与第二样本轨迹数据之间的杰卡德距离最小的第三样本轨迹检测数据。In some embodiments, since both the Euclidean distance and the Jaccard distance can describe the similarity between two data, when the Euclidean distance between the two data is the smallest, the Jaccard distance between the two data may also be the smallest. Therefore, the electronic device can not only determine the third sample trajectory detection data with the greatest similarity to the second sample trajectory detection data from at least one third sample trajectory detection data in the above manner, but can also determine it in other ways. For example, when there is at least one third sample trajectory detection data in the initial fingerprint library, the third sample trajectory detection data with the smallest Euclidean distance to the second sample trajectory data and the smallest Jaccard distance to the second sample trajectory data is obtained from at least one third sample trajectory detection data.

在另一种可能的实现方式中,电子设备基于初始指纹库和指纹测试集,对初始指纹库进行数据扩展处理的操作包括:依次遍历指纹测试集中的各个样本轨迹检测数据;确定第二样本轨迹检测数据与初始指纹库中的每个样本轨迹检测数据之间的相似度,得到多个相似度,该第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;将多个相似度中的最大相似度大于或等于相似度阈值的情况下,将第二样本轨迹检测数据的楼层标签更新为最大相似度对应的样本轨迹检测数据的楼层标签;将标签更新后的第二样本轨迹检测数据添加至初始指纹库中。In another possible implementation, the electronic device performs data expansion processing on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set, including: traversing each sample trajectory detection data in the fingerprint test set in turn; determining the similarity between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library to obtain multiple similarities, and the second sample trajectory detection data is the sample trajectory detection data currently traversed; when the maximum similarity among the multiple similarities is greater than or equal to the similarity threshold, updating the floor label of the second sample trajectory detection data to the floor label of the sample trajectory detection data corresponding to the maximum similarity; and adding the second sample trajectory detection data with the updated label to the initial fingerprint library.

作为一个示例,电子设备可以通过第二样本轨迹检测数据与初始指纹库中每个样本轨迹检测数据之间的欧氏距离、杰卡德距离、余弦距离、曼哈顿距离、切比雪夫距离等中的任意一个距离来表示第二样本轨迹检测数据与初始指纹库中每个样本轨迹检测数据之间的相似度。As an example, the electronic device may represent the similarity between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library by any one of the Euclidean distance, Jaccard distance, cosine distance, Manhattan distance, Chebyshev distance, etc. between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library.

需要说明的是,相似度阈值可以根据电子设备选择的相似度算法预先进行设置。It should be noted that the similarity threshold can be set in advance according to the similarity algorithm selected by the electronic device.

值得说明的是,通过不同方式对初始指纹库进行数据扩展处理,从而增加了确定数据扩展方式的丰富性。It is worth noting that the data expansion processing is performed on the initial fingerprint library in different ways, thereby increasing the richness of the determined data expansion methods.

步骤1002:基于第二指纹库对初始分类模型进行迭代训练,得到第二分类模型。Step 1002: iteratively train the initial classification model based on the second fingerprint library to obtain a second classification model.

需要说明的是,电子设备设备基于第二指纹库对初始分类模型进行迭代训练,得到第二分类模型的操作可以包括多种不同的方式,比如,电子设备可以将第二指纹库中的每个样本轨迹检测数据输入至初始分类模型中,基于每个样本轨迹检测数据中每个轨迹点对应的WiFi信号强度对初始分类模型进行训练,之后根据对每个样本轨迹检测数据中每个轨迹点的训练结果,继续进行迭代训练,得到第二分类模型。It should be noted that the electronic device iteratively trains the initial classification model based on the second fingerprint library, and the operation of obtaining the second classification model may include a variety of different methods. For example, the electronic device can input each sample trajectory detection data in the second fingerprint library into the initial classification model, and train the initial classification model based on the WiFi signal strength corresponding to each trajectory point in each sample trajectory detection data, and then continue to iterate the training according to the training results of each trajectory point in each sample trajectory detection data to obtain the second classification model.

由于每个样本轨迹检测数据中每个轨迹点可以通过m个WiFi信号强度表示,且根据轨迹点的位置不同,对应的m个WiFi信号强度也不同,但是每个轨迹点均属于同一楼层,也即是,每个样本轨迹检测数据中每个轨迹点对应的楼层标签相同。在任意一个样本轨迹检测数据包括多个轨迹点的情况下,该样本轨迹检测数据对应有多组m个WiFi信号强度,且多组m个WiFi信号强度对应的楼层标签也相同,因此,为了使初始分类模型得到充分训练,电子设备可以基于每个样本轨迹检测数据中每个轨迹点对应的WiFi信号强度对初始分类模型进行训练。在一些实施例中,电子设备基于每个样本轨迹检测数据中每个轨迹点对应的WiFi信号强度对初始分类模型进行训练的方式也包括多种方式,本申请实施例对此不再进行一一赘述。Since each trajectory point in each sample trajectory detection data can be represented by m WiFi signal strengths, and the corresponding m WiFi signal strengths are different depending on the position of the trajectory point, but each trajectory point belongs to the same floor, that is, the floor label corresponding to each trajectory point in each sample trajectory detection data is the same. In the case where any sample trajectory detection data includes multiple trajectory points, the sample trajectory detection data corresponds to multiple groups of m WiFi signal strengths, and the floor labels corresponding to the multiple groups of m WiFi signal strengths are also the same. Therefore, in order to fully train the initial classification model, the electronic device can train the initial classification model based on the WiFi signal strength corresponding to each trajectory point in each sample trajectory detection data. In some embodiments, the electronic device also includes multiple ways to train the initial classification model based on the WiFi signal strength corresponding to each trajectory point in each sample trajectory detection data, and the embodiments of the present application will not be repeated one by one.

值得说明的是,电子设备基于每个样本轨迹检测数据中每个轨迹点对应的WiFi信号强度对初始分类模型进行训练,可以使初始分类模型能够识别每个楼层的轨迹点对应的WiFi信号强度的特征,进而后续可以识别到不属于同一楼层中的轨迹点。It is worth noting that the electronic device trains the initial classification model based on the WiFi signal strength corresponding to each trajectory point in each sample trajectory detection data, so that the initial classification model can recognize the characteristics of the WiFi signal strength corresponding to the trajectory points on each floor, and then subsequently identify trajectory points that do not belong to the same floor.

在一些实施例中,电子设备在对基于第二指纹库对初始分类模型进行迭代训练,得到第二分类模型之前,还可以对第二指纹库中的每个样本轨迹检测数据进行降维处理。In some embodiments, before the electronic device iteratively trains the initial classification model based on the second fingerprint library to obtain the second classification model, it can also perform dimensionality reduction processing on each sample trajectory detection data in the second fingerprint library.

示例性地,电子设备可以通过主成分分析(Principal Component Analysis,PCA)或奇异值分解(Singular Value Decomposition,SVD)等算法对第二指纹库中的每个样本轨迹检测数据进行降维处理,使得降维处理后的每个样本轨迹检测数据的维度为目标维度。Exemplarily, the electronic device may perform dimensionality reduction processing on each sample trajectory detection data in the second fingerprint library through algorithms such as principal component analysis (PCA) or singular value decomposition (SVD), so that the dimension of each sample trajectory detection data after dimensionality reduction processing is the target dimension.

需要说明的是,该目标维度为预先根据需求设置的维度,比如,该目标维度为64维。It should be noted that the target dimension is a dimension pre-set according to demand, for example, the target dimension is 64 dimensions.

步骤1003:通过第二分类模型对指纹测试集中的样本轨迹检测数据进行遍历处理。Step 1003: traverse and process the sample trajectory detection data in the fingerprint test set through the second classification model.

为了确定第二分类模型的定位性能,电子设备可以基于指纹测试集对第二分类模型进行测试。也即是,电子设备可以通过第二分类模型对指纹测试集中的样本轨迹检测数据进行遍历处理。In order to determine the positioning performance of the second classification model, the electronic device may test the second classification model based on the fingerprint test set. That is, the electronic device may traverse and process the sample trajectory detection data in the fingerprint test set through the second classification model.

在一些实施例中,电子设备可以将指纹测试集中的每个样本轨迹检测数据输入至第二分类模型中,并通过第二分类模型对指纹测试集中的每个样本轨迹检测数据进行分类处理,以完成对指纹测试集中的样本轨迹检测数据进行的遍历处理。In some embodiments, the electronic device may input each sample trajectory detection data in the fingerprint test set into the second classification model, and perform classification processing on each sample trajectory detection data in the fingerprint test set through the second classification model to complete the traversal processing of the sample trajectory detection data in the fingerprint test set.

在一些实施例中,电子设备在通过第二分类模型对指纹测试集中的样本轨迹检测数据进行遍历处理之前,还可以对指纹测试集中的每个样本轨迹检测数据进行降维处理。且电子设备对第二指纹库中的每个样本轨迹检测数据的降维处理可以与对指纹测试集中的每个样本轨迹检测数据的降维处理同时进行,当然也可以先对第二指纹库中的每个样本轨迹检测数据进行降维处理,或者,先对指纹测试集中的每个样本轨迹检测数据进行降维处理,本申请实施例对降维处理顺序不做具体限制。In some embodiments, before the electronic device traverses the sample trajectory detection data in the fingerprint test set through the second classification model, it can also perform dimensionality reduction processing on each sample trajectory detection data in the fingerprint test set. And the electronic device can perform dimensionality reduction processing on each sample trajectory detection data in the second fingerprint library at the same time as the dimensionality reduction processing on each sample trajectory detection data in the fingerprint test set. Of course, it is also possible to first perform dimensionality reduction processing on each sample trajectory detection data in the second fingerprint library, or first perform dimensionality reduction processing on each sample trajectory detection data in the fingerprint test set. The embodiment of the present application does not specifically limit the order of dimensionality reduction processing.

示例性地,电子设备可以通过PCA或SVD等算法对指纹测试集中的每个样本轨迹检测数据进行降维处理,使得降维处理后的每个样本轨迹检测数据的维度为目标维度。Exemplarily, the electronic device may perform dimensionality reduction processing on each sample trajectory detection data in the fingerprint test set by using algorithms such as PCA or SVD, so that the dimension of each sample trajectory detection data after the dimensionality reduction processing is the target dimension.

步骤1004:在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至第二指纹库中。Step 1004: during the traversal process, the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold is added to the second fingerprint library.

为了提升指纹库的可靠性,电子设备在基于指纹测试集测试对第二分类模型的定位性能进行测试的过程中,还可以将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至第二指纹库中。In order to improve the reliability of the fingerprint library, the electronic device can also add sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold to the second fingerprint library during the process of testing the positioning performance of the second classification model based on the fingerprint test set test.

在一些实施例中,分类结果包括楼层标签和楼层标签对应的概率值;电子设备在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至第二指纹库中的操作包括:在遍历过程中,根据第一样本轨迹检测数据对应的分类结果中的概率值,确定第一样本轨迹检测数据对应的分类结果置信度,第一样本轨迹检测数据为当前遍历到的指纹测试集中的任意一个样本轨迹检测数据;在第一样本轨迹检测数据对应的分类结果置信度大于或等于置信度阈值的情况下,将第一样本轨迹检测数据的楼层标签更新为第一样本轨迹检测数据对应的分类结果中的楼层标签;将标签更新后的第一样本轨迹检测数据添加至第二指纹库中。In some embodiments, the classification result includes a floor label and a probability value corresponding to the floor label; during the traversal process, the electronic device adds the sample trajectory detection data whose confidence in the classification result is greater than or equal to the confidence threshold to the second fingerprint library, including: during the traversal process, according to the probability value in the classification result corresponding to the first sample trajectory detection data, determining the confidence of the classification result corresponding to the first sample trajectory detection data, the first sample trajectory detection data being any sample trajectory detection data in the currently traversed fingerprint test set; when the confidence in the classification result corresponding to the first sample trajectory detection data is greater than or equal to the confidence threshold, updating the floor label of the first sample trajectory detection data to the floor label in the classification result corresponding to the first sample trajectory detection data; and adding the first sample trajectory detection data with the updated label to the second fingerprint library.

由于电子设备通过第二分类模型对第一样本轨迹检测数据进行分类处理后,分类结果可以包括多个楼层标签和多个楼层标签中每个楼层标签对应的概率值,因此,电子设备可以从多个楼层标签中每个楼层标签对应的概率值中获取最大概率值,并将最大概率值确定为分类结果置信度。Since the classification result may include multiple floor labels and probability values corresponding to each of the multiple floor labels after the electronic device classifies the first sample trajectory detection data through the second classification model, the electronic device can obtain the maximum probability value from the probability values corresponding to each of the multiple floor labels, and determine the maximum probability value as the confidence of the classification result.

在一些实施例中,电子设备还可以通过其他方式确定分类结果置信度,比如,电子设备还可以从多个楼层标签中每个楼层标签对应的概率值中获取最大概率值;将最大概率值乘以预设系数,得到乘积结果;将该乘积结果确定为分类结果置信度。或者,电子设备从多个楼层标签中每个楼层标签对应的概率值中选择大于预设概率值的至少一个概率值;确定获取的至少一个概率值的平均值;将该平均值确定为分了结果置信度。In some embodiments, the electronic device may also determine the confidence of the classification result in other ways, for example, the electronic device may also obtain the maximum probability value from the probability values corresponding to each floor label in the multiple floor labels; multiply the maximum probability value by a preset coefficient to obtain a product result; and determine the product result as the confidence of the classification result. Alternatively, the electronic device may select at least one probability value greater than the preset probability value from the probability values corresponding to each floor label in the multiple floor labels; determine the average value of the at least one probability value obtained; and determine the average value as the confidence of the classification result.

需要说明的是,置信度阈值能够根据需求事先进行设置,比如,该置信度阈值可以为0.7、0.8或者0.9等。该预设概率值可以预先进行设置,比如,该预设概率值可以为40%、35%或30%等。It should be noted that the confidence threshold can be set in advance according to the requirements, for example, the confidence threshold can be 0.7, 0.8 or 0.9, etc. The preset probability value can be set in advance, for example, the preset probability value can be 40%, 35% or 30%, etc.

在一些实施例中,电子设备将标签更新后的第一样本轨迹检测数据添加至第二指纹库中的同时,还可以将第一样本轨迹检测数据从指纹测试集中删除。In some embodiments, the electronic device may delete the first sample trajectory detection data from the fingerprint test set while adding the first sample trajectory detection data after the label is updated to the second fingerprint library.

值得说明的是,在基于指纹测试集对第二分类模型进行测试的过程中,还可以对第二指纹库进行数据扩展,从而使模型训练和指纹库构建达到相辅相成的效果。It is worth noting that, in the process of testing the second classification model based on the fingerprint test set, the data of the second fingerprint library can also be expanded, so that the model training and fingerprint library construction can complement each other.

步骤1005:当遍历结束时,基于第一指纹库对第二分类模型进行迭代训练,得到第一分类模型。Step 1005: When the traversal is completed, the second classification model is iteratively trained based on the first fingerprint library to obtain the first classification model.

需要说明的是,第一指纹库是在遍历过程中对第二指纹库进行扩展后得到,也即是,该第一指纹库是按照上述步骤1004的操作在遍历过程中将指纹测试集中分类结果置信度大于或等于置信度阈值的第一样本轨迹检测数据更新标签后添加至第二指纹库后得到。该第一分类模型能够基于任意的定位设备的轨迹检测数据确定定位设备所处的楼层。It should be noted that the first fingerprint library is obtained after the second fingerprint library is expanded during the traversal process, that is, the first fingerprint library is obtained after the first sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold in the fingerprint test set is updated with a label and added to the second fingerprint library during the traversal process according to the operation of the above step 1004. The first classification model can determine the floor where the positioning device is located based on the trajectory detection data of any positioning device.

在一些实施例中,电子设备通过第二分类模型对指纹测试集中的样本轨迹检测数据进行遍历处理之后,还可以获取第二分类模型对指纹测试集中的样本轨迹检测数据进行分类的正确量,以及通过第二分类模型对指纹测试集中的样本轨迹检测数据进行遍历处理后,添加至第二指纹库中的样本轨迹检测数据的添加量;将正确量除以指纹测试集的样本总量,得到分类准确率,指纹测试集的样本总量为通过第二分类模型将指纹测试集中的样本轨迹检测数据添加至第二指纹库之前,该指纹测试集中所包括的样本轨迹检测数据的数量;将添加量除以样本总量,得到轨迹利用率,该分类准确率和该轨迹利用率用于评估第一分类模型的定位性能。In some embodiments, after the electronic device traverses and processes the sample trajectory detection data in the fingerprint test set through the second classification model, it can also obtain the correct amount of the sample trajectory detection data in the fingerprint test set classified by the second classification model, as well as the added amount of sample trajectory detection data added to the second fingerprint library after traversing and processing the sample trajectory detection data in the fingerprint test set through the second classification model; the correct amount is divided by the total number of samples in the fingerprint test set to obtain the classification accuracy, and the total number of samples in the fingerprint test set is the number of sample trajectory detection data included in the fingerprint test set before the sample trajectory detection data in the fingerprint test set is added to the second fingerprint library through the second classification model; the added amount is divided by the total number of samples to obtain the trajectory utilization, and the classification accuracy and the trajectory utilization are used to evaluate the positioning performance of the first classification model.

值得说明的是,通过确定第二分类模型的分类准确率和该轨迹利用率,从而使得能够利用具体数据对第二分类模型的定位性能进行评估,提高了对第二分类模型的定位性能进行评估的准确性。It is worth noting that by determining the classification accuracy of the second classification model and the trajectory utilization rate, the positioning performance of the second classification model can be evaluated using specific data, thereby improving the accuracy of evaluating the positioning performance of the second classification model.

由于通过第二分类模型对指纹测试集的样本轨迹数据进行遍历处理之后,电子设备会基于第一指纹库对第二分类模型进行迭代训练,得到第一分类模型,也即是,第一分类模型是在第二分类模型的基础上迭代训练得到,第一分类模型的定位性能有很大的可能性会高于或等于第二分类模型的定位性能。因此,第二分类模型的分类准确率和轨迹利用率可以用于评估第二分类模型的定位性能,也可以用于评估第一分类模型的定位性能。After the sample trajectory data of the fingerprint test set is traversed and processed by the second classification model, the electronic device will iteratively train the second classification model based on the first fingerprint library to obtain the first classification model, that is, the first classification model is iteratively trained on the basis of the second classification model, and the positioning performance of the first classification model is very likely to be higher than or equal to the positioning performance of the second classification model. Therefore, the classification accuracy and trajectory utilization of the second classification model can be used to evaluate the positioning performance of the second classification model, and can also be used to evaluate the positioning performance of the first classification model.

需要说明的是,对第一分类模型的定位性能的评估可以是人为进行的,也可以是电子设备根据分类准确率和轨迹利用率进行的。It should be noted that the evaluation of the positioning performance of the first classification model can be performed manually or by an electronic device based on the classification accuracy and trajectory utilization.

作为一个示例,电子设备可以将分类准确率与准确率阈值进行比较,并将轨迹利用率与利用率阈值进行比较;在分类准确率大于或等于准确率阈值,且轨迹利用率大于或等于利用率阈值的情况下,确定第一分类模型的定位性能为一级性能;在分类准确率小于准确率阈值,或者,轨迹利用率小于利用率阈值的情况下,确定第一分类模型的定位性能为二级性能;在分类准确率小于准确率阈值,且轨迹利用率小于利用率阈值的情况下,确定第一分类模型的定位性能为三级性能。其中,一级性能的分类模型的定位准确性大于二级性能的分类模型的定位准确性,二级性能的分类模型的定位准确性大于三级性能的分类模型的定位准确性。As an example, the electronic device may compare the classification accuracy with the accuracy threshold, and compare the trajectory utilization with the utilization threshold; when the classification accuracy is greater than or equal to the accuracy threshold, and the trajectory utilization is greater than or equal to the utilization threshold, the positioning performance of the first classification model is determined to be the first-level performance; when the classification accuracy is less than the accuracy threshold, or the trajectory utilization is less than the utilization threshold, the positioning performance of the first classification model is determined to be the second-level performance; when the classification accuracy is less than the accuracy threshold, and the trajectory utilization is less than the utilization threshold, the positioning performance of the first classification model is determined to be the third-level performance. Among them, the positioning accuracy of the classification model with the first-level performance is greater than the positioning accuracy of the classification model with the second-level performance, and the positioning accuracy of the classification model with the second-level performance is greater than the positioning accuracy of the classification model with the third-level performance.

需要说明的是,准确率阈值和利用率阈值均可以预先进行设置,比如,该准确率阈值可以为90%或者80%等,利用率阈值可以为60%或者70%等。It should be noted that both the accuracy threshold and the utilization threshold can be preset. For example, the accuracy threshold can be 90% or 80%, and the utilization threshold can be 60% or 70%.

在一些实施例中,电子设备基于第一指纹库对第二分类模型进行迭代训练,得到第一分类模型之后,还可以继续通过第一分类模型对指纹测试集中剩余的样本轨迹数据进行遍历处理。且通过第一分类模型对指纹测试集中剩余的样本轨迹数据进行遍历处理的操作与通过第二分类模型对指纹测试集中的样本轨迹数据进行遍历处理的操作相同或相似,本申请实施例对此不再进行一一赘述。In some embodiments, the electronic device iteratively trains the second classification model based on the first fingerprint library, and after obtaining the first classification model, it can continue to traverse and process the remaining sample trajectory data in the fingerprint test set through the first classification model. The operation of traversing and processing the remaining sample trajectory data in the fingerprint test set through the first classification model is the same or similar to the operation of traversing and processing the sample trajectory data in the fingerprint test set through the second classification model, and the embodiments of the present application will not be described one by one.

在本申请实施例中,在需要对定位设备进行室内定位的情况下,可以获取定位设备的轨迹检测数据,然后根据轨迹检测数据,通过第一分类模型确定定位设备所处的楼层。由于第一分类模型是根据经过数据扩展的第一指纹库训练得到,而第一指纹库是基于指纹测试集对第二指纹库进行数据扩展后得到,从而第一指纹库中的数据量较为可靠,进而第一分类模型的定位准确性也得到了提升。也即是本申请实施例中电子设备不仅扩展了指纹库中的数据量,提高了指纹库的可靠性,同时提高了分类模型的定位准确性。In an embodiment of the present application, when it is necessary to perform indoor positioning of the positioning device, the trajectory detection data of the positioning device can be obtained, and then the floor where the positioning device is located can be determined through the first classification model based on the trajectory detection data. Since the first classification model is trained based on the first fingerprint library after data expansion, and the first fingerprint library is obtained by data expansion of the second fingerprint library based on the fingerprint test set, the amount of data in the first fingerprint library is more reliable, and the positioning accuracy of the first classification model is also improved. That is, the electronic device in the embodiment of the present application not only expands the amount of data in the fingerprint library and improves the reliability of the fingerprint library, but also improves the positioning accuracy of the classification model.

请参考图13,图13是根据另一示例性实施例示出的一种指纹库的构建方法流程示意图。作为示例而非限定,这里以该方法应用于具有定位功能的电子设备中为例进行说明,该方法可以包括如下部分或者全部内容:Please refer to FIG. 13, which is a schematic diagram of a method for constructing a fingerprint library according to another exemplary embodiment. As an example but not a limitation, the method is described here by applying it to an electronic device with a positioning function. The method may include some or all of the following contents:

步骤1301:获取人工采集的第一数量的样本轨迹检测数据。Step 1301: Obtain a first amount of manually collected sample trajectory detection data.

步骤1302:确定第一数量的样本轨迹检测数据中是否包括轨迹点数量大于数量阈值的平层样本轨迹检测数据;若存在,则执行下述步骤1303的操作;若不存在,则执行下述步骤1304的操作。Step 1302: Determine whether the first number of sample trajectory detection data includes flat layer sample trajectory detection data whose number of trajectory points is greater than the quantity threshold; if yes, perform the operation of the following step 1303; if no, perform the operation of the following step 1304.

步骤1303:在第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的评测样本轨迹检测数据的情况下,对轨迹点数量大于数量阈值的平层样本轨迹检测数据进行分割处理,得到第三数量的样本轨迹检测数据。Step 1303: When the first number of sample trajectory detection data includes evaluation sample trajectory detection data whose number of trajectory points is greater than the number threshold, segment the leveling sample trajectory detection data whose number of trajectory points is greater than the number threshold to obtain a third number of sample trajectory detection data.

步骤1304:通过m个WiFi信号强度表示每个样本轨迹检测数据中每个轨迹点。Step 1304: Represent each trajectory point in each sample trajectory detection data by m WiFi signal strengths.

步骤1305:随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库。Step 1305: randomly select a second number of flat layer sample trajectory detection data to obtain an initial fingerprint library.

需要说明的是,在第一数量的样本轨迹检测数据中不包括轨迹点数量大于数量阈值的平层样本轨迹检测数据的情况下,电子设备从第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库。在第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的平层样本轨迹检测数据的情况下,电子设备从第三数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库。It should be noted that, when the first number of sample trajectory detection data does not include flat sample trajectory detection data whose number of trajectory points is greater than the number threshold, the electronic device randomly selects a second number of flat sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library. When the first number of sample trajectory detection data includes flat sample trajectory detection data whose number of trajectory points is greater than the number threshold, the electronic device randomly selects a second number of flat sample trajectory detection data from the third number of sample trajectory detection data to obtain an initial fingerprint library.

步骤1306:将随机选择后剩余的样本轨迹检测数据构成的集合确定为指纹测试集。Step 1306: Determine the set consisting of the sample trajectory detection data remaining after the random selection as the fingerprint test set.

步骤1307:基于初始指纹库和指纹测试集,对初始指纹库进行数据扩展处理,得到第二指纹库。Step 1307: Based on the initial fingerprint library and the fingerprint test set, perform data expansion processing on the initial fingerprint library to obtain a second fingerprint library.

步骤1308:基于第二指纹库对初始分类模型进行迭代训练,得到第二分类模型。Step 1308: Iteratively train the initial classification model based on the second fingerprint library to obtain a second classification model.

步骤1309:通过第二分类模型对指纹测试集中的样本轨迹检测数据进行遍历处理。Step 1309: Perform traversal processing on the sample trajectory detection data in the fingerprint test set through the second classification model.

步骤1310:在遍历过程中,确定是否存在分类结果置信度大于或等于置信度阈值的样本轨迹检测数据,若存在,则执行下述步骤1311的操作,若不存在,则执行下述步骤1313的操作。Step 1310: During the traversal process, determine whether there is sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold. If so, perform the operation of the following step 1311; if not, perform the operation of the following step 1313.

步骤1311:将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至第二指纹库中。Step 1311: adding the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold to the second fingerprint library.

步骤1312:基于第一指纹库对第二分类模型进行迭代训练,得到第一分类模型。Step 1312: iteratively train the second classification model based on the first fingerprint library to obtain the first classification model.

需要说明的是,在得到第一分类模型的情况下,电子设备还可以继续执行下述步骤1313的操作。It should be noted that, when the first classification model is obtained, the electronic device may continue to perform the operation of step 1313 described below.

步骤1313:确定第二分类模型的分类准确率和轨迹利用率。Step 1313: Determine the classification accuracy and trajectory utilization of the second classification model.

步骤1314:结束模型训练。Step 1314: End model training.

需要说明的是,上述步骤1301-步骤1314的操作可以参考上述步骤后1001-步骤1005的操作,本申请实施例对此不再进行一一赘述。It should be noted that the operations of the above steps 1301 to 1314 can refer to the operations of the above steps 1001 to 1005, and the embodiments of the present application will not describe them one by one.

在本申请实施例中,在需要对定位设备进行室内定位的情况下,可以获取定位设备的轨迹检测数据,然后根据轨迹检测数据,通过第一分类模型确定定位设备所处的楼层。由于第一分类模型是根据经过数据扩展的第一指纹库训练得到,而第一指纹库是基于指纹测试集对第二指纹库进行数据扩展后得到,从而第一指纹库中的数据量较为可靠,进而第一分类模型的定位准确性也得到了提升。也即是本申请实施例中电子设备不仅扩展了指纹库中的数据量,提高了指纹库的可靠性,同时提高了分类模型的定位准确性。In an embodiment of the present application, when it is necessary to perform indoor positioning of the positioning device, the trajectory detection data of the positioning device can be obtained, and then the floor where the positioning device is located can be determined through the first classification model based on the trajectory detection data. Since the first classification model is trained based on the first fingerprint library after data expansion, and the first fingerprint library is obtained by data expansion of the second fingerprint library based on the fingerprint test set, the amount of data in the first fingerprint library is more reliable, and the positioning accuracy of the first classification model is also improved. That is, the electronic device in the embodiment of the present application not only expands the amount of data in the fingerprint library and improves the reliability of the fingerprint library, but also improves the positioning accuracy of the classification model.

图14是本申请实施例提供的一种室内定位装置的结构示意图,该装置可以由软件、硬件或者两者的结合实现成为计算机设备的部分或者全部,该计算机设备可以为图3所示的计算机设备。参见图14,该装置包括:获取模块1401和确定模块1402。FIG14 is a schematic diagram of the structure of an indoor positioning device provided by an embodiment of the present application, which can be implemented by software, hardware or a combination of both to form part or all of a computer device, which can be the computer device shown in FIG3. Referring to FIG14, the device includes: an acquisition module 1401 and a determination module 1402.

获取模块1401,用于响应于对定位设备的定位操作,获取所述定位设备的轨迹检测数据;An acquisition module 1401 is used for acquiring trajectory detection data of the positioning device in response to a positioning operation on the positioning device;

确定模块1402,用于基于所述轨迹检测数据,通过第一分类模型确定所述定位设备所处的楼层;A determination module 1402 is used to determine the floor where the positioning device is located through a first classification model based on the trajectory detection data;

其中,所述第一分类模型为预先基于第一指纹库对第二分类模型进行迭代训练得到,所述第一指纹库是基于指纹测试集通过所述第二分类模型对第二指纹库进行数据扩展后得到,所述第二分类模型是基于所述第二指纹库对初始分类模型进行训练得到,所述第二指纹库包括多个样本轨迹检测数据,所述多个样本轨迹检测数据中的每个样本轨迹检测数据均带有楼层标签。The first classification model is obtained by iteratively training the second classification model based on the first fingerprint library in advance, the first fingerprint library is obtained by expanding the data of the second fingerprint library through the second classification model based on the fingerprint test set, the second classification model is obtained by training the initial classification model based on the second fingerprint library, and the second fingerprint library includes multiple sample trajectory detection data, and each of the multiple sample trajectory detection data has a floor label.

作为本申请的一个示例,所述第一指纹库是通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理,在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中得到。As an example of the present application, the first fingerprint library is obtained by traversing the sample trajectory detection data in the fingerprint test set through the second classification model. During the traversal process, the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold is added to the second fingerprint library.

作为本申请的一个示例,所述第二指纹库为基于初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理后得到,所述初始指纹库为从获取的第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据得到。As an example of the present application, the second fingerprint library is obtained after data expansion processing is performed on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set, and the initial fingerprint library is obtained by randomly selecting a second number of flat layer sample trajectory detection data from the acquired first number of sample trajectory detection data.

作为本申请的一个示例,所述指纹测试集为从所述第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合。As an example of the present application, the fingerprint test set is a set consisting of remaining sample trajectory detection data after randomly selecting from the first number of sample trajectory detection data.

在本申请实施例中,在需要进行室内定位的情况下,可以获取定位设备的轨迹检测数据,然后根据轨迹检测数据,通过第一分类模型确定定位设备所处的楼层。由于第一分类模型是根据经过数据扩展的第一指纹库训练得到,而第一指纹库是基于指纹测试集对第二指纹库进行数据扩展后得到,从而第一指纹库中的数据量较为可靠,进而第一分类模型的定位准确性也得到了提升。In the embodiment of the present application, when indoor positioning is required, the trajectory detection data of the positioning device can be obtained, and then the floor where the positioning device is located can be determined by the first classification model based on the trajectory detection data. Since the first classification model is trained based on the first fingerprint library after data expansion, and the first fingerprint library is obtained by data expansion of the second fingerprint library based on the fingerprint test set, the amount of data in the first fingerprint library is relatively reliable, and thus the positioning accuracy of the first classification model is also improved.

需要说明的是:上述实施例提供的室内定位装置在进行室内定位时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。It should be noted that: the indoor positioning device provided in the above embodiment only uses the division of the above-mentioned functional modules as an example when performing indoor positioning. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

上述实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请实施例的保护范围。The functional units and modules in the above embodiments 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, and the above integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.

上述实施例提供的室内定位装置与室内定位方法实施例属于同一构思,上述实施例中单元、模块的具体工作过程及带来的技术效果,可参见方法实施例部分,此处不再赘述。The indoor positioning device and the indoor positioning method embodiments provided in the above embodiments belong to the same concept. The specific working process of the units and modules in the above embodiments and the technical effects brought about can be found in the method embodiment part and will not be repeated here.

图15是本申请实施例提供的一种指纹库的构建装置的结构示意图,该装置可以由软件、硬件或者两者的结合实现成为计算机设备的部分或者全部,该计算机设备可以为图3所示的计算机设备。参见图15,该装置包括:第一获取模块1501、第一训练模块1502、遍历模块1503、添加模块1504和第二训练模块1505。FIG15 is a schematic diagram of the structure of a fingerprint library construction device provided in an embodiment of the present application, and the device can be implemented by software, hardware or a combination of both to become part or all of a computer device, and the computer device can be the computer device shown in FIG3. Referring to FIG15, the device includes: a first acquisition module 1501, a first training module 1502, a traversal module 1503, an addition module 1504 and a second training module 1505.

第一获取模块1501,用于获取第二指纹库和指纹测试集,所述第二指纹库包括多个样本轨迹检测数据,所述多个样本轨迹检测数据中每个样本轨迹检测数据均带有楼层标签;The first acquisition module 1501 is used to acquire a second fingerprint library and a fingerprint test set, wherein the second fingerprint library includes a plurality of sample trajectory detection data, and each of the plurality of sample trajectory detection data has a floor label;

第一训练模块1502,用于基于所述第二指纹库对初始分类模型进行迭代训练,得到第二分类模型;A first training module 1502, configured to iteratively train the initial classification model based on the second fingerprint library to obtain a second classification model;

遍历模块1503,用于通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理;A traversal module 1503, configured to perform traversal processing on the sample trajectory detection data in the fingerprint test set by using the second classification model;

添加模块1504,用于在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中;An adding module 1504 is used to add the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold to the second fingerprint library during the traversal process;

第二训练模块1505,用于当遍历结束时,基于第一指纹库对所述第二分类模型进行迭代训练,得到第一分类模型,所述第一指纹库是在遍历过程中对所述第二指纹库进行扩展后得到,所述第一分类模型能够基于任意的定位设备的轨迹检测数据确定所述定位设备所处的楼层。The second training module 1505 is used to iteratively train the second classification model based on the first fingerprint library to obtain a first classification model when the traversal is completed. The first fingerprint library is obtained by expanding the second fingerprint library during the traversal process. The first classification model can determine the floor where the positioning device is located based on the trajectory detection data of any positioning device.

作为本申请的一个示例,所述分类结果包括楼层标签和所述楼层标签对应的概率值;As an example of the present application, the classification result includes a floor label and a probability value corresponding to the floor label;

所述添加模块1504用于:The adding module 1504 is used for:

在遍历过程中,根据第一样本轨迹检测数据对应的分类结果中的概率值,确定所述第一样本轨迹检测数据对应的分类结果置信度,所述第一样本轨迹检测数据为当前遍历到的所述指纹测试集中的任意一个样本轨迹检测数据;During the traversal process, according to the probability value in the classification result corresponding to the first sample trajectory detection data, the confidence of the classification result corresponding to the first sample trajectory detection data is determined, and the first sample trajectory detection data is any sample trajectory detection data in the fingerprint test set currently traversed;

在所述第一样本轨迹检测数据对应的分类结果置信度大于或等于置信度阈值的情况下,将所述第一样本轨迹检测数据的楼层标签更新为所述第一样本轨迹检测数据对应的分类结果中的楼层标签;When the confidence of the classification result corresponding to the first sample trajectory detection data is greater than or equal to the confidence threshold, updating the floor label of the first sample trajectory detection data to the floor label in the classification result corresponding to the first sample trajectory detection data;

将标签更新后的所述第一样本轨迹检测数据添加至所述第二指纹库中。The first sample trajectory detection data after label update is added to the second fingerprint library.

作为本申请的一个示例,所述第一获取模块1501用于:As an example of the present application, the first acquisition module 1501 is used to:

获取第一数量的样本轨迹检测数据,所述第一数量的样本轨迹检测数据至少包括平层样本轨迹检测数据;Acquire a first number of sample trajectory detection data, where the first number of sample trajectory detection data at least includes level layer sample trajectory detection data;

从所述第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库;Randomly selecting a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library;

将所述第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合确定为所述指纹测试集;Determine a set consisting of remaining sample trajectory detection data after randomly selecting the first number of sample trajectory detection data as the fingerprint test set;

基于所述初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理,得到所述第二指纹库。Based on the initial fingerprint library and the fingerprint test set, data expansion processing is performed on the initial fingerprint library to obtain the second fingerprint library.

作为本申请的一个示例,所述第一获取模块1501用于:As an example of the present application, the first acquisition module 1501 is used to:

依次遍历所述指纹测试集中的各个样本轨迹检测数据;Traversing each sample trajectory detection data in the fingerprint test set in turn;

确定第二样本轨迹检测数据与所述初始指纹库中的每个样本轨迹检测数据之间的欧式距离和杰卡德距离,所述第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;Determine the Euclidean distance and the Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library, wherein the second sample trajectory detection data is the currently traversed sample trajectory detection data;

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中确定与所述第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,第三样本轨迹检测数据是指与所述第二样本轨迹检测数据之间的欧氏距离小于第一距离阈值,且与所述第二样本轨迹检测数据之间的杰卡德距离小于第二距离阈值的样本轨迹检测数据;In the case where there is at least one third sample trajectory detection data in the initial fingerprint library, determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from the at least one third sample trajectory detection data, wherein the third sample trajectory detection data refers to the sample trajectory detection data having a Euclidean distance with the second sample trajectory detection data less than a first distance threshold and a Jaccard distance with the second sample trajectory detection data less than a second distance threshold;

将所述第二样本轨迹检测数据的楼层标签更新为所确定的第三样本轨迹检测数据的楼层标签;Updating the floor label of the second sample trajectory detection data to the determined floor label of the third sample trajectory detection data;

将标签更新后的所述第二样本轨迹检测数据添加至所述初始指纹库中。The second sample trajectory detection data after the label is updated is added to the initial fingerprint library.

作为本申请的一个示例,所述第一获取模块1501用于:As an example of the present application, the first acquisition module 1501 is used to:

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中获取与所述第二样本轨迹数据之间的欧氏距离最小的第三样本轨迹检测数据;或者,In the case where there is at least one third sample trajectory detection data in the initial fingerprint library, obtaining the third sample trajectory detection data having the smallest Euclidean distance with the second sample trajectory data from the at least one third sample trajectory detection data; or,

在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中获取与所述第二样本轨迹数据之间的杰卡德距离最小的第三样本轨迹检测数据。In the case that at least one third sample trajectory detection data exists in the initial fingerprint library, the third sample trajectory detection data having the smallest Jaccard distance with the second sample trajectory data is obtained from the at least one third sample trajectory detection data.

作为本申请的一个示例,所述第一获取模块1501用于:As an example of the present application, the first acquisition module 1501 is used to:

依次遍历所述指纹测试集中的各个样本轨迹检测数据;Traversing each sample trajectory detection data in the fingerprint test set in turn;

确定第二样本轨迹检测数据与所述初始指纹库中的每个样本轨迹检测数据之间的相似度,得到多个相似度,所述第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;Determine the similarity between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library to obtain multiple similarities, wherein the second sample trajectory detection data is the currently traversed sample trajectory detection data;

将所述多个相似度中的最大相似度大于或等于相似度阈值的情况下,将所述第二样本轨迹检测数据的楼层标签更新为最大相似度对应的样本轨迹检测数据的楼层标签;When the maximum similarity among the multiple similarities is greater than or equal to the similarity threshold, updating the floor label of the second sample trajectory detection data to the floor label of the sample trajectory detection data corresponding to the maximum similarity;

将标签更新后的所述第二样本轨迹检测数据添加至所述初始指纹库中。The second sample trajectory detection data after the label is updated is added to the initial fingerprint library.

作为本申请的一个示例,所述第一获取模块1501还用于:As an example of the present application, the first acquisition module 1501 is further used for:

在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理,得到第三数量的样本轨迹检测数据,所述第三数量的样本轨迹检测数据中的各个样本轨迹检测数据的轨迹点数量小于或等于所述数量阈值;In a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than a number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold to obtain a third number of sample trajectory detection data, wherein the number of trajectory points of each sample trajectory detection data in the third number of sample trajectory detection data is less than or equal to the number threshold;

从所述第三数量的样本轨迹检测数据中随机选择所述第二数量的平层样本轨迹检测数据,得到所述初始指纹库。The second number of flat layer sample trajectory detection data is randomly selected from the third number of sample trajectory detection data to obtain the initial fingerprint library.

作为本申请的一个示例,所述第一获取模块1501用于:As an example of the present application, the first acquisition module 1501 is used to:

在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于所述数量阈值的样本轨迹检测数据的情况下,以划分数值为间隔对轨迹点数量大于所述数量阈值的样本轨迹检测数据进行分割,得到第四数量的样本轨迹检测数据,所述划分数值为小于或等于所述数量阈值的数值;In a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than the number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold at intervals of a segmentation value to obtain a fourth number of sample trajectory detection data, wherein the segmentation value is a value less than or equal to the number threshold;

在所述第四数量的样本轨迹检测数据中包括轨迹点数量小于所述划分数值的样本轨迹检测数据的情况下,将轨迹点数量小于所述划分数值的样本轨迹检测数据删除。In the case that the fourth amount of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is smaller than the division value, the sample trajectory detection data whose number of trajectory points is smaller than the division value is deleted.

作为本申请的一个示例,所述装置还包括:As an example of the present application, the device further includes:

第二获取模块,用于获取所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行分类的正确量,以及通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理后,添加至所述第二指纹库中的样本轨迹检测数据的添加量;A second acquisition module is used to obtain the correct amount of sample trajectory detection data in the fingerprint test set classified by the second classification model, and the amount of sample trajectory detection data added to the second fingerprint library after traversing the sample trajectory detection data in the fingerprint test set through the second classification model;

第一计算模块,用于将所述正确量除以所述指纹测试集的样本总量,得到所述分类准确率,所述指纹测试集的样本总量为通过所述第二分类模型将所述指纹测试集中的样本轨迹检测数据添加至所述第二指纹库之前,所述指纹测试集中所包括的样本轨迹检测数据的数量;a first calculation module, configured to obtain the classification accuracy by dividing the correct amount by the total number of samples in the fingerprint test set, where the total number of samples in the fingerprint test set is the number of sample trajectory detection data included in the fingerprint test set before the sample trajectory detection data in the fingerprint test set is added to the second fingerprint library through the second classification model;

第二计算模块,用于将所述添加量除以所述样本总量,得到所述轨迹利用率,所述分类准确率和所述轨迹利用率用于评估所述第一分类模型的定位性能。The second calculation module is used to divide the added amount by the total sample amount to obtain the trajectory utilization rate, and the classification accuracy and the trajectory utilization rate are used to evaluate the positioning performance of the first classification model.

在本申请实施例中,由于第一分类模型是根据通过经过数据扩展的第一指纹库训练得到,而第一指纹库是基于指纹测试集对第二指纹库进行数据扩展后得到,从而第一指纹库中的数据量较为可靠,进而第一分类模型的定位准确性也得到了提升。In the embodiment of the present application, since the first classification model is trained based on the first fingerprint library that has undergone data expansion, and the first fingerprint library is obtained by data expansion of the second fingerprint library based on the fingerprint test set, the amount of data in the first fingerprint library is more reliable, and thus the positioning accuracy of the first classification model is also improved.

需要说明的是:上述实施例提供的指纹库的构建装置在构建指纹库时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。It should be noted that: when constructing the fingerprint library provided in the above embodiment, the division of the above functional modules is only used as an example to illustrate. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.

上述实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请实施例的保护范围。The functional units and modules in the above embodiments 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, and the above integrated units may be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present application.

上述实施例提供的指纹库的构建装置与指纹库的构建方法实施例属于同一构思,上述实施例中单元、模块的具体工作过程及带来的技术效果,可参见方法实施例部分,此处不再赘述。The fingerprint database construction device and the fingerprint database construction method provided in the above embodiments belong to the same concept. The specific working process and technical effects of the units and modules in the above embodiments can be found in the method embodiment part and will not be repeated here.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络或其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,比如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(比如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(比如:红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(比如:软盘、硬盘、磁带)、光介质(比如:数字通用光盘(Digital Versatile Disc,DVD))或半导体介质(比如:固态硬盘(Solid State Disk,SSD))等。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access, or a data storage device such as a server or data center that includes one or more available media integrations. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a digital versatile disc (DVD)), or a semiconductor medium (such as a solid state disk (SSD)).

以上所述为本申请提供的可选实施例,并不用以限制本申请,凡在本申请的揭露的技术范围之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are optional embodiments provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the technical scope disclosed in the present application shall be included in the protection scope of the present application.

Claims (15)

1.一种室内定位方法,其特征在于,所述方法包括:1. An indoor positioning method, characterized in that the method comprises: 响应于对定位设备的定位操作,获取所述定位设备的轨迹检测数据;In response to a positioning operation on a positioning device, acquiring trajectory detection data of the positioning device; 基于所述轨迹检测数据,通过第一分类模型确定所述定位设备所处的楼层;Based on the trajectory detection data, determining the floor where the positioning device is located by using a first classification model; 其中,所述第一分类模型为预先基于第一指纹库对第二分类模型进行迭代训练得到,所述第一指纹库是基于指纹测试集通过所述第二分类模型对第二指纹库进行数据扩展后得到,所述第二分类模型是基于所述第二指纹库对初始分类模型进行训练得到,所述第二指纹库包括多个样本轨迹检测数据,所述多个样本轨迹检测数据中的每个样本轨迹检测数据均带有楼层标签。The first classification model is obtained by iteratively training the second classification model based on the first fingerprint library in advance, the first fingerprint library is obtained by expanding the data of the second fingerprint library through the second classification model based on the fingerprint test set, the second classification model is obtained by training the initial classification model based on the second fingerprint library, and the second fingerprint library includes multiple sample trajectory detection data, and each of the multiple sample trajectory detection data has a floor label. 2.如权利要求1所述的方法,其特征在于,所述第一指纹库是通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理,在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中得到。2. The method as claimed in claim 1 is characterized in that the first fingerprint library is obtained by traversing the sample trajectory detection data in the fingerprint test set through the second classification model, and during the traversal process, the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold is added to the second fingerprint library. 3.如权利要求1或2所述的方法,其特征在于,所述第二指纹库为基于初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理后得到,所述初始指纹库为从获取的第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据得到。3. The method according to claim 1 or 2, characterized in that the second fingerprint library is obtained after data expansion processing is performed on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set, and the initial fingerprint library is obtained by randomly selecting a second number of flat layer sample trajectory detection data from the acquired first number of sample trajectory detection data. 4.如权利要求3所述的方法,其特征在于,所述指纹测试集为从所述第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合。4. The method according to claim 3, wherein the fingerprint test set is a set of sample trajectory detection data remaining after randomly selecting from the first number of sample trajectory detection data. 5.一种指纹库的构建方法,其特征在于,所述方法包括:5. A method for constructing a fingerprint library, characterized in that the method comprises: 获取第二指纹库和指纹测试集,所述第二指纹库包括多个样本轨迹检测数据,所述多个样本轨迹检测数据中每个样本轨迹检测数据均带有楼层标签;Obtain a second fingerprint library and a fingerprint test set, wherein the second fingerprint library includes a plurality of sample trajectory detection data, and each of the plurality of sample trajectory detection data has a floor label; 基于所述第二指纹库对初始分类模型进行迭代训练,得到第二分类模型;Iteratively training the initial classification model based on the second fingerprint library to obtain a second classification model; 通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理;Performing traversal processing on the sample trajectory detection data in the fingerprint test set by using the second classification model; 在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中;During the traversal process, the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold is added to the second fingerprint library; 当遍历结束时,基于第一指纹库对所述第二分类模型进行迭代训练,得到第一分类模型,所述第一指纹库是在遍历过程中对所述第二指纹库进行扩展后得到,所述第一分类模型能够基于任意的定位设备的轨迹检测数据确定所述定位设备所处的楼层。When the traversal is completed, the second classification model is iteratively trained based on the first fingerprint library to obtain a first classification model. The first fingerprint library is obtained by expanding the second fingerprint library during the traversal process. The first classification model can determine the floor where the positioning device is located based on the trajectory detection data of any positioning device. 6.如权利要求5所述的方法,其特征在于,所述分类结果包括楼层标签和所述楼层标签对应的概率值;6. The method according to claim 5, characterized in that the classification result includes a floor label and a probability value corresponding to the floor label; 所述在遍历过程中,将分类结果置信度大于或等于置信度阈值的样本轨迹检测数据添加至所述第二指纹库中,包括:In the traversal process, adding the sample trajectory detection data whose classification result confidence is greater than or equal to the confidence threshold to the second fingerprint library includes: 在遍历过程中,根据第一样本轨迹检测数据对应的分类结果中的概率值,确定所述第一样本轨迹检测数据对应的分类结果置信度,所述第一样本轨迹检测数据为当前遍历到的所述指纹测试集中的任意一个样本轨迹检测数据;During the traversal process, according to the probability value in the classification result corresponding to the first sample trajectory detection data, the confidence of the classification result corresponding to the first sample trajectory detection data is determined, and the first sample trajectory detection data is any sample trajectory detection data in the fingerprint test set currently traversed; 在所述第一样本轨迹检测数据对应的分类结果置信度大于或等于置信度阈值的情况下,将所述第一样本轨迹检测数据的楼层标签更新为所述第一样本轨迹检测数据对应的分类结果中的楼层标签;When the confidence of the classification result corresponding to the first sample trajectory detection data is greater than or equal to the confidence threshold, updating the floor label of the first sample trajectory detection data to the floor label in the classification result corresponding to the first sample trajectory detection data; 将标签更新后的所述第一样本轨迹检测数据添加至所述第二指纹库中。The first sample trajectory detection data after label update is added to the second fingerprint library. 7.如权利要求5所述的方法,其特征在于,所述获取第二指纹库和指纹测试集,包括:7. The method according to claim 5, wherein obtaining the second fingerprint library and the fingerprint test set comprises: 获取第一数量的样本轨迹检测数据,所述第一数量的样本轨迹检测数据至少包括平层样本轨迹检测数据;Acquire a first number of sample trajectory detection data, wherein the first number of sample trajectory detection data at least includes flat layer sample trajectory detection data; 从所述第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库;Randomly selecting a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library; 将所述第一数量的样本轨迹检测数据中随机选择后剩余的样本轨迹检测数据构成的集合确定为所述指纹测试集;Determine a set consisting of remaining sample trajectory detection data after randomly selecting the first number of sample trajectory detection data as the fingerprint test set; 基于所述初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理,得到所述第二指纹库。Based on the initial fingerprint library and the fingerprint test set, data expansion processing is performed on the initial fingerprint library to obtain the second fingerprint library. 8.如权利要求7所述的方法,其特征在于,所述基于所述初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理,包括:8. The method according to claim 7, wherein the step of performing data expansion processing on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set comprises: 依次遍历所述指纹测试集中的各个样本轨迹检测数据;Traversing each sample trajectory detection data in the fingerprint test set in turn; 确定第二样本轨迹检测数据与所述初始指纹库中的每个样本轨迹检测数据之间的欧式距离和杰卡德距离,所述第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;Determine the Euclidean distance and the Jaccard distance between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library, wherein the second sample trajectory detection data is the currently traversed sample trajectory detection data; 在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中确定与所述第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,第三样本轨迹检测数据是指与所述第二样本轨迹检测数据之间的欧氏距离小于第一距离阈值,且与所述第二样本轨迹检测数据之间的杰卡德距离小于第二距离阈值的样本轨迹检测数据;In the case where there is at least one third sample trajectory detection data in the initial fingerprint library, determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from the at least one third sample trajectory detection data, wherein the third sample trajectory detection data refers to the sample trajectory detection data having a Euclidean distance with the second sample trajectory detection data less than a first distance threshold and a Jaccard distance with the second sample trajectory detection data less than a second distance threshold; 将所述第二样本轨迹检测数据的楼层标签更新为所确定的第三样本轨迹检测数据的楼层标签;Updating the floor label of the second sample trajectory detection data to the determined floor label of the third sample trajectory detection data; 将标签更新后的所述第二样本轨迹检测数据添加至所述初始指纹库中。The second sample trajectory detection data after the label is updated is added to the initial fingerprint library. 9.如权利要求8所述的方法,其特征在于,所述在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中确定与所述第二样本轨迹检测数据的相似度最大的第三样本轨迹检测数据,包括:9. The method according to claim 8, wherein, when there is at least one third sample trajectory detection data in the initial fingerprint library, determining the third sample trajectory detection data having the greatest similarity to the second sample trajectory detection data from the at least one third sample trajectory detection data comprises: 在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中获取与所述第二样本轨迹检测数据之间的欧氏距离最小的第三样本轨迹检测数据;或者,In the case where there is at least one third sample trajectory detection data in the initial fingerprint library, obtaining the third sample trajectory detection data having the smallest Euclidean distance with the second sample trajectory detection data from the at least one third sample trajectory detection data; or, 在所述初始指纹库中存在至少一个第三样本轨迹检测数据的情况下,从所述至少一个第三样本轨迹检测数据中获取与所述第二样本轨迹检测数据之间的杰卡德距离最小的第三样本轨迹检测数据。In the case that at least one third sample trajectory detection data exists in the initial fingerprint library, the third sample trajectory detection data having the smallest Jaccard distance with the second sample trajectory detection data is obtained from the at least one third sample trajectory detection data. 10.如权利要求7所述的方法,其特征在于,所述基于所述初始指纹库和所述指纹测试集,对所述初始指纹库进行数据扩展处理,包括:10. The method according to claim 7, wherein the step of performing data expansion processing on the initial fingerprint library based on the initial fingerprint library and the fingerprint test set comprises: 依次遍历所述指纹测试集中的各个样本轨迹检测数据;Traversing each sample trajectory detection data in the fingerprint test set in turn; 确定第二样本轨迹检测数据与所述初始指纹库中的每个样本轨迹检测数据之间的相似度,得到多个相似度,所述第二样本轨迹检测数据为当前遍历到的样本轨迹检测数据;Determine the similarity between the second sample trajectory detection data and each sample trajectory detection data in the initial fingerprint library to obtain multiple similarities, wherein the second sample trajectory detection data is the currently traversed sample trajectory detection data; 将所述多个相似度中的最大相似度大于或等于相似度阈值的情况下,将所述第二样本轨迹检测数据的楼层标签更新为最大相似度对应的样本轨迹检测数据的楼层标签;When the maximum similarity among the multiple similarities is greater than or equal to the similarity threshold, updating the floor label of the second sample trajectory detection data to the floor label of the sample trajectory detection data corresponding to the maximum similarity; 将标签更新后的所述第二样本轨迹检测数据添加至所述初始指纹库中。The second sample trajectory detection data after the label is updated is added to the initial fingerprint library. 11.如权利要求7-10中任一项所述的方法,其特征在于,所述从所述第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库之前,还包括:11. The method according to any one of claims 7 to 10, characterized in that before randomly selecting a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library, the method further comprises: 在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理,得到第三数量的样本轨迹检测数据,所述第三数量的样本轨迹检测数据中的各个样本轨迹检测数据的轨迹点数量小于或等于所述数量阈值;In a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than the number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold to obtain a third number of sample trajectory detection data, wherein the number of trajectory points of each sample trajectory detection data in the third number of sample trajectory detection data is less than or equal to the number threshold; 所述从所述第一数量的样本轨迹检测数据中随机选择第二数量的平层样本轨迹检测数据,得到初始指纹库,包括:The randomly selecting a second number of flat layer sample trajectory detection data from the first number of sample trajectory detection data to obtain an initial fingerprint library includes: 从所述第三数量的样本轨迹检测数据中随机选择所述第二数量的平层样本轨迹检测数据,得到所述初始指纹库。The second number of flat layer sample trajectory detection data is randomly selected from the third number of sample trajectory detection data to obtain the initial fingerprint library. 12.如权利要求11所述的方法,其特征在于,所述在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于数量阈值的样本轨迹检测数据的情况下,对轨迹点数量大于数量阈值的样本轨迹检测数据进行分割处理,包括:12. The method according to claim 11, wherein when the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than a number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold comprises: 在所述第一数量的样本轨迹检测数据中包括轨迹点数量大于所述数量阈值的样本轨迹检测数据的情况下,以划分数值为间隔对轨迹点数量大于所述数量阈值的样本轨迹检测数据进行分割,得到第四数量的样本轨迹检测数据,所述划分数值为小于或等于所述数量阈值的数值;In a case where the first number of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is greater than the number threshold, segmenting the sample trajectory detection data whose number of trajectory points is greater than the number threshold at intervals of a segmentation value to obtain a fourth number of sample trajectory detection data, wherein the segmentation value is a value less than or equal to the number threshold; 在所述第四数量的样本轨迹检测数据中包括轨迹点数量小于所述划分数值的样本轨迹检测数据的情况下,将轨迹点数量小于所述划分数值的样本轨迹检测数据删除。In the case that the fourth amount of sample trajectory detection data includes sample trajectory detection data whose number of trajectory points is smaller than the division value, the sample trajectory detection data whose number of trajectory points is smaller than the division value is deleted. 13.如权利要求5所述的方法,其特征在于,所述通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理之后,还包括:13. The method according to claim 5, characterized in that after the sample trajectory detection data in the fingerprint test set is traversed and processed by the second classification model, it also includes: 获取所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行分类的正确量,以及通过所述第二分类模型对所述指纹测试集中的样本轨迹检测数据进行遍历处理后,添加至所述第二指纹库中的样本轨迹检测数据的添加量;Obtaining the correct amount of sample trajectory detection data in the fingerprint test set classified by the second classification model, and the amount of sample trajectory detection data added to the second fingerprint library after traversing the sample trajectory detection data in the fingerprint test set through the second classification model; 将所述正确量除以所述指纹测试集的样本总量,得到分类准确率,所述指纹测试集的样本总量为通过所述第二分类模型将所述指纹测试集中的样本轨迹检测数据添加至所述第二指纹库之前,所述指纹测试集中所包括的样本轨迹检测数据的数量;The correct amount is divided by the total number of samples in the fingerprint test set to obtain the classification accuracy, where the total number of samples in the fingerprint test set is the number of sample trajectory detection data included in the fingerprint test set before the sample trajectory detection data in the fingerprint test set is added to the second fingerprint library through the second classification model; 将所述添加量除以所述样本总量,得到所述轨迹利用率,所述分类准确率和所述轨迹利用率用于评估所述第一分类模型的定位性能。The added amount is divided by the total number of samples to obtain the track utilization rate. The classification accuracy and the track utilization rate are used to evaluate the positioning performance of the first classification model. 14.一种电子设备,其特征在于,所述电子设备包括:处理器和存储器,所述存储器用于存储一个或多个程序,所述一个或多个程序包括指令,当所述处理器执行所述指令时,所述电子设备用于执行如权利要求1-4中任一项所述的室内定位方法,或者,所述电子设备用于执行如权利要求5-13中任一项所述指纹库的构建方法。14. An electronic device, characterized in that the electronic device comprises: a processor and a memory, the memory is used to store one or more programs, the one or more programs include instructions, when the processor executes the instructions, the electronic device is used to execute the indoor positioning method as described in any one of claims 1-4, or the electronic device is used to execute the fingerprint library construction method as described in any one of claims 5-13. 15.一种计算机可读存储介质,用于存储一个或多个程序,其中所述一个或多个程序被配置为被一个或多个处理器执行,所述一个或多个程序包括指令,所述指令使得电子设备执行如权利要求1-4中任一项所述的室内定位方法,或者,所述指令使得电子设备执行如权利要求5-13中任一项所述的指纹库的构建方法。15. A computer-readable storage medium for storing one or more programs, wherein the one or more programs are configured to be executed by one or more processors, and the one or more programs include instructions, which enable an electronic device to execute the indoor positioning method described in any one of claims 1-4, or the instructions enable an electronic device to execute the fingerprint library construction method described in any one of claims 5-13.
CN202211171058.3A 2022-09-23 2022-09-23 Indoor positioning method, fingerprint library construction method, electronic equipment and storage medium Active CN116761249B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211171058.3A CN116761249B (en) 2022-09-23 2022-09-23 Indoor positioning method, fingerprint library construction method, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211171058.3A CN116761249B (en) 2022-09-23 2022-09-23 Indoor positioning method, fingerprint library construction method, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116761249A CN116761249A (en) 2023-09-15
CN116761249B true CN116761249B (en) 2024-04-12

Family

ID=87953880

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211171058.3A Active CN116761249B (en) 2022-09-23 2022-09-23 Indoor positioning method, fingerprint library construction method, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116761249B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106162868A (en) * 2016-06-08 2016-11-23 南京理工大学 High efficiency indoor localization method based on location fingerprint
CN107203754A (en) * 2017-05-26 2017-09-26 北京邮电大学 A kind of license plate locating method and device based on deep learning
CN108984785A (en) * 2018-07-27 2018-12-11 武汉大学 A kind of update method and device of the fingerprint base based on historical data and increment
CN110636466A (en) * 2019-09-06 2019-12-31 联泰集群(北京)科技有限责任公司 WiFi indoor positioning system based on channel state information under machine learning
WO2020215783A1 (en) * 2019-04-25 2020-10-29 华为技术有限公司 Locating method and apparatus, and storage medium
CN112135250A (en) * 2020-08-12 2020-12-25 浙江大华技术股份有限公司 Indoor positioning method and device, computer equipment and readable storage medium
CN112437485A (en) * 2020-10-29 2021-03-02 北京邮电大学 Positioning method and device of fingerprint space interpolation method based on neural network
CN113747385A (en) * 2021-08-27 2021-12-03 中移(杭州)信息技术有限公司 Indoor positioning method, device, equipment and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3227707B1 (en) * 2014-12-04 2024-04-03 HERE Global B.V. Supporting positioning quality assurance

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106162868A (en) * 2016-06-08 2016-11-23 南京理工大学 High efficiency indoor localization method based on location fingerprint
CN107203754A (en) * 2017-05-26 2017-09-26 北京邮电大学 A kind of license plate locating method and device based on deep learning
CN108984785A (en) * 2018-07-27 2018-12-11 武汉大学 A kind of update method and device of the fingerprint base based on historical data and increment
WO2020215783A1 (en) * 2019-04-25 2020-10-29 华为技术有限公司 Locating method and apparatus, and storage medium
CN110636466A (en) * 2019-09-06 2019-12-31 联泰集群(北京)科技有限责任公司 WiFi indoor positioning system based on channel state information under machine learning
CN112135250A (en) * 2020-08-12 2020-12-25 浙江大华技术股份有限公司 Indoor positioning method and device, computer equipment and readable storage medium
CN112437485A (en) * 2020-10-29 2021-03-02 北京邮电大学 Positioning method and device of fingerprint space interpolation method based on neural network
CN113747385A (en) * 2021-08-27 2021-12-03 中移(杭州)信息技术有限公司 Indoor positioning method, device, equipment and computer readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于机器学习的室内无线指纹定位技术研究;谭航;中国优秀硕士论文;全文 *

Also Published As

Publication number Publication date
CN116761249A (en) 2023-09-15

Similar Documents

Publication Publication Date Title
US10360479B2 (en) Device and method for processing metadata
CN107534685B (en) A business processing method, device, readable storage medium and chip system
WO2023016050A1 (en) Card information display method and electronic device
CN103049515A (en) Method, device and equipment for classifying application programs
WO2015057464A1 (en) Cloud service hosting on client device
CN115655310B (en) Data calibration method, electronic device and readable storage medium
CN111444813A (en) Method, device, equipment and storage medium for identifying attribute classification of target object
CN114881711A (en) Method for carrying out anomaly analysis based on request behavior and electronic equipment
CN116761249B (en) Indoor positioning method, fingerprint library construction method, electronic equipment and storage medium
US20250007871A1 (en) Message processing method and related apparatus
CN109451295A (en) A kind of method and system obtaining virtual information
CN115981573B (en) Data management method, electronic device and computer readable and writable storage medium
CN116668580B (en) Scene recognition method, electronic device and readable storage medium
CN115239025B (en) Payment prediction method and electronic equipment
CN114501389B (en) Mobile terminal, network sharing method and storage medium
CN116668576A (en) Method, equipment, cloud management platform, system and storage medium for acquiring data
CN118051287A (en) Application recommendation method and electronic device
US11360816B1 (en) Dynamic usage of storage and processing unit allocation
CN115562967A (en) Application program prediction method, electronic device and storage medium
CN115098449A (en) File cleaning method and electronic equipment
CN113961427A (en) System memory analysis method and electronic equipment
CN116668951B (en) Method for generating geofence, electronic equipment and storage medium
CN113407096A (en) Terminal device and picture processing method
CN116701795B (en) Page display method and electronic device
CN116723460B (en) Method for creating personal geofence and related equipment thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address