Method and device for positioning mobile terminal, electronic equipment and storage medium
By acquiring and orthogonalizing the characteristics of the positioning device through the ultra-wideband sensor in the mobile terminal, the accuracy and stability of indoor positioning are improved by using the distance prediction model, solving the problems of low positioning accuracy and poor stability in the existing technology.
Patent Information
- Application Number
- CN202510761358.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-09
- Publication Date
- 2025-09-16
AI Technical Summary
Existing indoor positioning technologies such as Wi-Fi and Bluetooth positioning have problems with low positioning accuracy and poor stability.
The ultra-wideband sensor in the mobile terminal is used to obtain the distance-related features of at least four positioning devices, perform feature space orthogonalization, use the distance prediction model to obtain the target distance based on sample orthogonal feature space training, and construct a three-dimensional coordinate system to locate the position of the mobile terminal.
It improves positioning accuracy and stability, reduces the correlation and redundant data between features, and determines the location of the mobile terminal quickly and accurately.
Smart Images

Figure CN120659009A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of positioning technology, and in particular to a method, device, electronic device and storage medium for positioning a mobile terminal. Background Art
[0002] Indoor positioning technology has widespread application demand in smart buildings, security monitoring, emergency rescue and other fields. Existing indoor positioning technologies, such as Wireless Fidelity (Wi-Fi) positioning and Bluetooth positioning, have problems such as low positioning accuracy and poor stability. Summary of the Invention
[0003] The present invention provides a method, device, electronic device and storage medium for locating a mobile terminal, which are used to solve the defects of low positioning accuracy and poor stability in the prior art, improve the ranging accuracy of the UWB sensor in the mobile terminal, and further improve the positioning accuracy and stability.
[0004] The present invention provides a method for locating a mobile terminal, comprising: Acquiring distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal; orthogonalizing the feature space of the distance-related features corresponding to each positioning device to obtain the orthogonal feature space corresponding to each positioning device; Inputting each of the orthogonal feature spaces into a distance prediction model to obtain a target distance between the mobile terminal and each of the positioning devices output by the distance prediction model; the distance prediction model is trained based on sample orthogonal feature spaces corresponding to sample positioning devices; Based on each of the target distances, the target position of the mobile terminal is located.
[0005] According to a method for locating a mobile terminal provided by the present invention, the method of performing feature space orthogonalization on the distance-related features corresponding to each positioning device to obtain an orthogonal feature space corresponding to each positioning device includes: standardizing the distance-related features to obtain a feature space matrix corresponding to the positioning device; determining a feature space covariance matrix corresponding to the feature space matrix; determining at least one eigenvalue corresponding to the feature space covariance matrix and an eigenvector corresponding to each eigenvalue; and performing spatial orthogonalization on the distance-related features based on the eigenvalues and the eigenvectors corresponding to the eigenvalues to obtain an orthogonal feature space corresponding to the positioning device.
[0006] According to a method for positioning a mobile terminal provided by the present invention, the distance-related features are spatially orthogonalized based on the eigenvalues and the eigenvectors corresponding to the eigenvalues to obtain an orthogonal feature space corresponding to the positioning device, including: sorting the eigenvalues based on the size of each eigenvalue to obtain an arrangement order of the eigenvalues; determining at least one target eigenvalue from each eigenvalue based on the arrangement order of the eigenvalues; and normalizing the eigenvectors corresponding to the target eigenvalues to obtain the orthogonal feature space.
[0007] According to a method for positioning a mobile terminal provided by the present invention, the target position of the mobile terminal is positioned based on each target distance, including: determining the spatial position of each positioning device; constructing a three-dimensional coordinate system based on the spatial position of each positioning device; at least one positioning device is located on a coordinate axis of the three-dimensional coordinate system, and the origin of the three-dimensional coordinate system is the circumcenter of the base triangle formed by the positioning devices; and positioning the target position of the mobile terminal based on the coordinate position of each positioning device in the three-dimensional coordinate system and the target distance between the mobile terminal and each positioning device.
[0008] According to a method for locating a mobile terminal provided by the present invention, before obtaining the distance-related features corresponding to at least one positioning device through an ultra-wideband sensor in the mobile terminal, the method further includes: determining the straight-line distance between any two candidate positioning devices; and determining the candidate positioning devices whose straight-line distances are equal and can form an equilateral triangle as the positioning devices.
[0009] According to a method for locating a mobile terminal provided by the present invention, the training process of the distance prediction model includes: obtaining a sample orthogonal feature space corresponding to a sample positioning device and a true distance between the sample positioning device and the mobile terminal; inputting the sample orthogonal feature space and the true distance corresponding to the sample orthogonal feature space into at least one initial random forest model to obtain a first predicted distance output by each of the initial random forest models; each of the initial random forest models has a different number of decision trees, a different minimum number of samples required for internal nodes of each of the initial random forest models, and a different minimum number of samples required for leaf nodes of each of the initial random forest models; determining a first difference value between the true distance and the first predicted distance corresponding to the true distance based on a loss function; performing a first training on each of the initial random forest models based on each of the first difference values to obtain a candidate random forest model corresponding to each of the initial random forest models; determining a target random forest model from each of the candidate random forest models based on a root mean square error of each of the candidate random models; and performing a second training on the target random forest model to obtain the distance prediction model.
[0010] According to a method for locating a mobile terminal provided by the present invention, the target random forest model is trained for a second time to obtain the distance prediction model, including: grouping the first predicted distances corresponding to the sample positioning devices output by the target random forest model to obtain at least one first predicted distance set; determining distribution feature information corresponding to each of the first predicted distance sets; inputting each of the distribution feature information, the first predicted distance, and the true distance into the target random forest model to obtain a second predicted distance output by the target random forest model; determining a second difference value between the second predicted distance and the true distance based on the loss function; and training the target random forest model for a second time based on the second difference value to obtain the distance prediction model.
[0011] The present invention also provides a device for locating a mobile terminal, comprising the following modules: an acquisition module, configured to acquire distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal; An orthogonalization module, configured to perform feature space orthogonalization on the distance-related features corresponding to each positioning device to obtain an orthogonal feature space corresponding to each positioning device; A prediction module, configured to input each of the orthogonal feature spaces into a distance prediction model to obtain a target distance between the mobile terminal and each of the positioning devices output by the distance prediction model; the distance prediction model is trained based on sample orthogonal feature spaces corresponding to sample positioning devices; A positioning module is used to locate the target position of the mobile terminal based on each of the target distances.
[0012] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any of the above methods for locating a mobile terminal when executing the computer program.
[0013] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method for locating a mobile terminal as described above is implemented.
[0014] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above methods for locating a mobile terminal.
[0015] The method, device, electronic device and storage medium for locating a mobile terminal provided by the present invention obtain distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal, perform feature space orthogonalization on the distance-related features corresponding to each positioning device, and obtain an orthogonal feature space corresponding to each positioning device; input each orthogonal feature space into a distance prediction model to obtain a target distance between the mobile terminal and each positioning device output by the distance prediction model; and locate the target position of the mobile terminal based on each target distance. In this way, the distance-related features are obtained through the ultra-wideband sensor, thereby improving the accuracy of the distance-related feature data; then, the distance-related feature data is orthogonalized in feature space to reduce the correlation and redundant data between the distance-related features; then, the orthogonal feature space is input into the distance prediction model to quickly and accurately obtain the target distance between the mobile terminal and the positioning device. The high-accuracy target distance is used to further improve the accuracy and stability of mobile terminal positioning. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the present invention or the prior art, a brief introduction is given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0017] Figure 1 It is a flow chart of the method for locating a mobile terminal provided by the present invention.
[0018] Figure 2 It is a schematic diagram of the three-dimensional coordinate system provided by the present invention.
[0019] Figure 3 It is a structural diagram of the device for positioning a mobile terminal provided by the present invention.
[0020] Figure 4 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0021] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.
[0022] UWB technology is widely used in the field of indoor positioning due to its high temporal resolution and strong anti-interference ability, but how to effectively use UWB signals for high-precision positioning remains a challenge.
[0023] The following combination Figure 1-Figure 2 The present invention describes a method for positioning a mobile terminal. The method can be applied to indoor positioning in any place. The execution subject of the method can be an electronic device or a method for positioning a mobile terminal set in the electronic device. The device for positioning the mobile terminal can be implemented by software, hardware, or a combination of the two.
[0024] Figure 1 FIG. 1 is a flow chart of a method for locating a mobile terminal provided by the present invention, such as Figure 1 As shown, the method includes the following: Step 101: Acquire distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal.
[0025] Here, the positioning device can be a signal transmission source, the mobile terminal can include but is not limited to a computer, a mobile phone, a tablet, a wearable electronic device, etc., and the ultra-wide sensor can be integrated inside the mobile terminal or fixed on the mobile terminal.
[0026] Here, the distance-related feature refers to the distance-related feature between the mobile terminal and the positioning device. The distance-related feature may include one or more of the UWB ranging result, the value of the first path, the difference between the peak path index and the first path index, the power of the first path, the received signal strength, the first path ratio, and the skewness of the received UWB signal.
[0027] The value of the first path refers to the actual distance of the signal path from the transmitter (ie, the positioning device) directly to the receiver (ie, the mobile terminal).
[0028] The First Path Index (FPI) is the index of the signal path directly from the transmitter to the receiver and is a key signal used in UWB positioning systems for distance and positioning. The Peak Path Index (PPI) is the index of the path with the largest amplitude in the received signal, meaning the path with the highest signal strength. In non-line-of-sight (NLOS) environments, due to signal reflections and multipath, the PPI may not be the direct path, but rather a path that has been reflected or scattered. The difference between the PPI and the FPI is used to determine whether the signal is traveling in non-line-of-sight (NLOS) conditions. A large difference between the FPI and PPI may indicate that the signal has been affected by obstacles during propagation, causing the direct path to be attenuated or blocked, leaving the reflected path as the primary signal component. In this case, the possibility of an NLOS condition can be considered. By comparing the positional relationship between these two paths, a metric can be derived to determine the likelihood of an NLOS condition, which can be used to assess the accuracy and reliability of the positioning system.
[0029] The first path power is the power of the signal path directly from the transmitter to the receiver, which affects the positioning accuracy and signal reliability.
[0030] Received Signal Strength Indication (RSSI) is a measurement of the power present in a received radio signal. It is usually expressed as a negative value in dBm. A higher RSSI value indicates a better signal.
[0031] The first path ratio is the ratio of the first path signal power to the total received signal power. It reflects the strength of the direct path (LOS) signal relative to other multipath (NLOS) signals.
[0032] UWB signal bias generally refers to the measurement error caused by factors such as signal reflection and non-line-of-sight propagation when measuring distance. This error can affect the accuracy of positioning systems, especially in indoor environments where walls and other obstacles can cause the signal to experience multiple reflections and refractions, leading to a discrepancy between the measured distance and the actual distance.
[0033] It should be noted that if you only want to determine the distance between the mobile terminal and the positioning device, you do not need to select a dedicated positioning device. However, for better positioning in the future, you need to screen the positioning devices. The following is a method for screening positioning devices: Before acquiring the distance-related features corresponding to at least one positioning device through the ultra-wideband sensor in the mobile terminal, the method further includes: determining the straight-line distance between any two candidate positioning devices; and determining the candidate positioning devices with equal straight-line distances and capable of forming an equilateral triangle as the positioning devices.
[0034] It should be noted that the number of positioning devices is at least four, and the straight-line distance between any two positioning devices among all the positioning devices is equal, that is, any three positioning devices can form an equilateral triangle.
[0035] In the embodiment of the present invention, by screening the positioning devices, a plurality of positioning devices with two equal positioning devices are obtained, which is conducive to the subsequent establishment of a three-dimensional coordinate system for positioning the mobile terminal and improving the positioning accuracy and stability.
[0036] Step 102: perform feature space orthogonalization on the distance-related features corresponding to each positioning device to obtain an orthogonal feature space corresponding to each positioning device.
[0037] Here, feature space orthogonalization is used to reduce the correlation between features, so the feature correlation in the orthogonal feature space is less than that in the distance-correlated features.
[0038] Here, the feature space orthogonalization may be performed directly on the distance-related features; or the feature space orthogonalization may be performed after preprocessing the distance-related features, which is not limited in the present invention.
[0039] Exemplarily, a multi-dimensional feature space matrix of the positioning device can be obtained according to the distance-related features, and feature space orthogonalization is performed on the multi-dimensional feature space matrix to obtain a corresponding orthogonal feature space.
[0040] Furthermore, performing feature space orthogonalization on the distance-related features corresponding to each positioning device to obtain the orthogonal feature space corresponding to each positioning device includes: Normalizing the distance-related features to obtain a feature space matrix corresponding to the positioning device; Determining a feature space covariance matrix corresponding to the feature space matrix; Determine at least one eigenvalue corresponding to the eigenspace covariance matrix and an eigenvector corresponding to each eigenvalue; Based on the eigenvalues and the eigenvectors corresponding to the eigenvalues, spatial orthogonalization is performed on the distance-related features to obtain an orthogonal feature space corresponding to the positioning device.
[0041] Here, standardization is used to make the distance-related features satisfy a normal distribution, that is, the data in the feature space matrix of each positioning device satisfy a normal distribution.
[0042] Here, the method for determining the feature space covariance matrix may be any appropriate method, for example, using a pre-trained covariance model to directly output the feature space covariance matrix; or using a traditional calculation method to calculate the feature space covariance matrix.
[0043] Here, the method for determining the eigenvalues corresponding to the eigenvalues of the eigenspace covariance matrix and the eigenvectors corresponding to the eigenvalues can be any suitable method, such as obtaining them using conventional calculation methods or directly outputting them using a pre-trained calculation model. A matrix can correspond to multiple eigenvalues and multiple eigenvectors.
[0044] The method for determining the orthogonal feature space can be any appropriate method, for example, selecting a target eigenvalue from multiple eigenvalues and constructing an orthogonal feature space from the eigenvectors corresponding to the target eigenvalues; or, fusing the various features and constructing an orthogonal feature space using the fused features.
[0045] In the embodiment of the present invention, by standardizing the distance-related features, normalizing the feature vectors, and finally performing spatial orthogonalization, the accuracy of the data is improved, the correlation between the features is reduced, and the positioning accuracy is improved.
[0046] Exemplarily, the spatial orthogonalization of the distance-related features based on the eigenvalues and the eigenvectors corresponding to the eigenvalues to obtain the orthogonal feature space corresponding to the positioning device includes: sorting each eigenvalue based on the size of each eigenvalue to obtain an arrangement order of the eigenvalues; determining at least one target eigenvalue from each eigenvalue based on the arrangement order of the eigenvalues; and normalizing the eigenvectors corresponding to the target eigenvalues to obtain the orthogonal feature space.
[0047] Here, the order of the eigenvalues may be arranged from large to small or from small to large.
[0048] Here, the target eigenvalue is the larger eigenvalue. If the feature order is from large to small, the first k eigenvalues are selected as the target eigenvalues; if the feature order is from small to large, the last k eigenvalues are selected as the eigenvalues.
[0049] Here, normalization is to fix the feature vector to a specific range, such as [0, 1] or [-1, 1], to ensure the comparability of the data.
[0050] It should be noted that the number of target eigenvalues is the same as the dimension of the orthogonal feature space.
[0051] Exemplarily, the distance-related features include features of seven dimensions: UWB ranging result, value of the first path, difference between the peak path index and the first path index, power of the first path, received signal strength, first path ratio, and skewness of the received UWB signal. According to the size of the eigenvalue, k dimensions are selected from the seven dimensions to construct an orthogonal feature space, where k is less than or equal to 7.
[0052] In another embodiment, principal component analysis may be used to reduce the correlation between features.
[0053] In the embodiment of the present invention, an orthogonal feature space is reconstructed by using eigenvalues and eigenvectors corresponding to the eigenvalues, thereby reducing the correlation between features and further improving positioning accuracy.
[0054] Step 103: Input each of the orthogonal feature spaces into a distance prediction model to obtain a target distance between the mobile terminal and each of the positioning devices output by the distance prediction model.
[0055] The distance prediction model is obtained by training based on the sample orthogonal feature space corresponding to the sample positioning device.
[0056] Step 104: Locate the target position of the mobile terminal based on the target distances.
[0057] Here, the method for determining the target position can be any appropriate problem, for example, outputting the target position through a pre-trained positioning model; for example, calculating the target using a calculation formula, etc.
[0058] Furthermore, locating the target position of the mobile terminal based on each target distance includes: determining the spatial position of each positioning device; constructing a three-dimensional coordinate system based on the spatial position of each positioning device; at least one positioning device is located on the coordinate axis of the three-dimensional coordinate system, and the origin of the three-dimensional coordinate system is the circumcenter of the base triangle formed by the positioning devices; locating the target position of the mobile terminal based on the coordinate position of each positioning device in the three-dimensional coordinate system and the target distance between the mobile terminal and each positioning device.
[0059] Here, the spatial position of the positioning device is a three-dimensional spatial coordinate. For example, there are four positioning devices, namely signal transmitters F1, F2, F3, and F4. The coordinates of F1 are ( x 1, y 1, z 1) F2 coordinates are ( x 2, y 2, z 2) F3 coordinates are ( x 3, y 3,z 3) F4 coordinates are ( x 4, y 4, z 4), the coordinates of the mobile terminal are M ( x , y , z ), the spatial positioning equation is established based on the three-dimensional spatial coordinates of the signal transmitter, the coordinates of the mobile terminal and the target distance as follows (1): (1) Among them, R1 is the target distance between the mobile terminal and the signal transmission source F1, R2 is the target distance between the mobile terminal and the signal transmission source F2, R3 is the target distance between the mobile terminal and the signal transmission source F3, and R4 is the target distance between the mobile terminal and the signal transmission source F4.
[0060] Each signal transmitting source is connected to other signal transmitting sources to obtain a base equilateral triangle. The circumcenter of the base equilateral triangle is used as the origin to establish a three-dimensional coordinate system.
[0061] The method for determining the target position of the mobile terminal can be any appropriate method, for example, establishing a positioning equation group based on the coordinate position of the signal transmitter and the target distance, and solving the positioning equation group; for example, using a pre-trained model to directly output the target position, etc.
[0062] For example, Figure 2 is a schematic diagram of the three-dimensional coordinate system provided by the present invention, such as Figure 2 As shown, the signal transmission sources F1, F2, F3, and F4 are distributed at the four vertices of the equilateral triangle. The signal transmission source F1 is located on the axis with the coordinates ( x 1,0,0), the positions of signal transmitters F2 and F3 are placed symmetrically about the coordinate system axis, and the coordinates of signal transmitter F2 are ( x 2, y 2, 0 ), the coordinates of F3 are ( x 2,- y 2, 0 ), F4 is located on the Z axis, the coordinate is ( 0 , 0,z 4), according to the three-dimensional coordinate system, the spatial positioning equations can be simplified to the following formula (2): (2) Assume that the length of each side of the equilateral triangle is L, where L is the distance between any two signal transmitters. Based on the circumcenter properties of the equilateral triangle and the Pythagorean theorem, we can obtain the following formula (3): (3) Furthermore, by substituting formula (3) into formula (2), the target coordinates of the mobile terminal can be obtained as follows: (4) In the embodiment of the present invention, a three-dimensional coordinate system and a positioning equation group are established by positioning devices with equal distances between each other, which can be directly calculated manually, greatly reducing the amount of calculation in actual applications.
[0063] In an embodiment of the present invention, distance-related features are acquired through an ultra-wideband sensor, thereby improving the accuracy of the distance-related feature data. The distance-related feature data is then orthogonalized in feature space to reduce the correlation and redundant data between the distance-related features. Subsequently, the orthogonal feature space is input into a distance prediction model to quickly and accurately obtain the target distance between the mobile terminal and the positioning device. Utilizing the highly accurate target distance, the accuracy and stability of positioning the mobile terminal are further improved.
[0064] Furthermore, the training process of the distance prediction model includes: obtaining a sample orthogonal feature space corresponding to a sample positioning device and a true distance between the sample positioning device and the mobile terminal; inputting the sample orthogonal feature space and the true distance corresponding to the sample orthogonal feature space into at least one initial random forest model to obtain a first predicted distance output by each initial random forest model; each initial random forest model has a different number of decision trees, each initial random forest model has a different minimum number of samples required for internal nodes, and each initial random forest model has a different minimum number of samples required for leaf nodes; based on a loss function, determining a first difference value between the true distance and the first predicted distance corresponding to the true distance; based on each first difference value, performing a first training on each initial random forest model to obtain a candidate random forest model corresponding to each initial random forest model; based on the root mean square error of each candidate random model, determining a target random forest model from each candidate random forest model; and performing a second training on the target random forest model to obtain the distance prediction model.
[0065] Here, after obtaining a large amount of data, a part of it can be used as training sample data and the other part as test data. The training sample data is more than the test data. Generally, the training sample data accounts for 80% and the test data accounts for 20%.
[0066] Here, the sample orthogonal feature space can be obtained according to the distance-related features of the sample positioning device. The calculation method of the sample orthogonal feature space can be determined according to step 102, which will not be described in detail here.
[0067] Here, the distance-related characteristics of the sample positioning device and the corresponding real distance may be obtained through an ultra-wideband sensor; or may be obtained based on public data, which is not limited in the present invention.
[0068] Here, the number of decision trees can range from 100 to 300, the minimum number of samples required for classification internal nodes can range from 2 to 20, and the minimum number of samples required for leaf nodes can range from 5 to 10. The number of initial random forest models can be determined based on the number of decision trees, the minimum number of samples required for classification internal nodes, and the minimum number of samples required for leaf nodes. For example, the number of initial random forest models can be 200 times 18 times 5, which equals 18,000. Specifically, the sample orthogonal feature space and the corresponding true distance of the sample positioning device are input into each initial random forest model to obtain a candidate random forest model.
[0069] Here, the loss function can be the root mean square error or the squared decision error.
[0070] The candidate random forest model is essentially the model obtained after the first training of each initial random forest model.
[0071] Here, the candidate random model with the smallest root mean square error can be used as the target random forest model. For example, the error is minimized when the number of decision trees, the minimum number of samples required to split an internal node, and the minimum number of samples required for a leaf node are 200, 10, and 5, respectively. Alternatively, the candidate random model with a value close to the mean root mean square error can be used as the target random forest model. After obtaining the target random forest model, it is trained a second time to obtain a distance prediction model.
[0072] In an embodiment of the present invention, by setting multiple groups of hyperparameters such as the number of decision trees, the minimum number of samples required to split internal nodes, and the minimum number of samples required for leaf nodes, the model corresponding to each group of hyperparameters is trained to obtain the hyperparameters of the optimal model, thereby improving the performance of the model and the accuracy of the prediction distance. In addition, by using the sample orthogonal feature space, the overfitting of the model can be reduced.
[0073] Furthermore, the target random forest model is trained a second time to obtain the distance prediction model, including: grouping the first predicted distances corresponding to the sample positioning devices output by the target random forest model to obtain at least one first predicted distance set; determining distribution feature information corresponding to each of the first predicted distance sets; inputting each of the distribution feature information, the first predicted distance, and the true distance into the target random forest model to obtain a second predicted distance output by the target random forest model; determining a second difference value between the second predicted distance and the true distance based on the loss function; and training the target random forest model a second time based on the second difference value to obtain the distance prediction model.
[0074] Here, the predicted distances corresponding to the same true distances may be grouped into N groups, where N is any appropriate number, such as 10. That is, the true distances in each first predicted distance set are the same.
[0075] Here, the distribution feature information may include: minimum value, maximum value, mean value, standard deviation, skewness, and kurtosis. Specifically, the minimum value, maximum value, mean value, standard deviation, skewness, and kurtosis, the first predicted distance, and the true distance may be input into the target random forest model to obtain a second predicted distance output by the target random forest model. A second difference value between the second predicted distance and the true distance may be determined based on the loss function. Based on the second difference value, the target random forest model may be trained a second time to obtain a distance prediction model.
[0076] Among them, the average The calculation is as follows formula (5), the center distance The calculation of skewness is as follows: The calculation of kurtosis is as follows: The calculation is as follows formula (8): (5) Where n is the length of the group, for example 10, is the m-th prediction result in each group.
[0077] (6) in, represents the order of the central moment, when When it is 2, is the standard deviation, (7) (8) Here, the loss function can be the root mean square error or the squared decision error.
[0078] In an embodiment of the present invention, based on the first training, the target random forest model is trained again using the distribution feature information and the first predicted distance to obtain a distance prediction model. In this way, through two trainings, the performance of the model and the accuracy of the predicted distance are improved.
[0079] The following describes an apparatus for positioning a mobile terminal provided by the present invention. The apparatus for positioning a mobile terminal described below and the method for positioning a mobile terminal described above can refer to each other.
[0080] Figure 3 FIG. 1 is a schematic diagram of the structure of the device for positioning a mobile terminal provided by the present invention, such as Figure 3 As shown, the apparatus 300 for locating a mobile terminal includes: An acquisition module 301 is configured to acquire distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal; An orthogonalization module 302 is configured to perform feature space orthogonalization on the distance-related features corresponding to each positioning device to obtain an orthogonal feature space corresponding to each positioning device; Prediction module 303, configured to input each of the orthogonal feature spaces into a distance prediction model to obtain a target distance between the mobile terminal and each of the positioning devices output by the distance prediction model; the distance prediction model is trained based on sample orthogonal feature spaces corresponding to sample positioning devices; The positioning module 304 is configured to locate the target position of the mobile terminal based on the target distances.
[0081] In some embodiments, the orthogonalization module 302 is specifically used to: standardize the distance-related features to obtain a feature space matrix corresponding to the positioning device; determine a feature space covariance matrix corresponding to the feature space matrix; determine at least one eigenvalue corresponding to the feature space covariance matrix and an eigenvector corresponding to each eigenvalue; and based on the eigenvalues and the eigenvectors corresponding to the eigenvalues, perform spatial orthogonalization on the distance-related features to obtain an orthogonal feature space corresponding to the positioning device.
[0082] In some embodiments, the orthogonalization module 302 is further specifically used to: sort each of the eigenvalues based on the size of each of the eigenvalues to obtain an arrangement order of the eigenvalues; determine at least one target eigenvalue from each of the eigenvalues based on the arrangement order of the eigenvalues; and normalize the eigenvector corresponding to the target eigenvalue to obtain the orthogonal feature space.
[0083] In some embodiments, the positioning module 304 is specifically used to: determine the spatial position of each of the positioning devices; construct a three-dimensional coordinate system based on the spatial position of each of the positioning devices; at least one of the positioning devices is located on the coordinate axis of the three-dimensional coordinate system, and the origin of the three-dimensional coordinate system is the circumcenter of the base triangle formed by the positioning devices; locate the target position of the mobile terminal based on the coordinate position of each of the positioning devices in the three-dimensional coordinate system and the target distance between the mobile terminal and each of the positioning devices.
[0084] In some embodiments, before acquiring the distance-related features corresponding to at least one positioning device through the ultra-wideband sensor in the mobile terminal, the apparatus 300 for positioning the mobile terminal further includes a determination module, specifically configured to: determine the straight-line distance between any two candidate positioning devices; and determine the candidate positioning devices having the same straight-line distance and forming an equilateral triangle as the positioning devices.
[0085] In some embodiments, the device 300 for locating a mobile terminal further includes a training module, which is specifically used to: obtain a sample orthogonal feature space corresponding to a sample positioning device and a true distance between the sample positioning device and the mobile terminal; input the sample orthogonal feature space and the true distance corresponding to the sample orthogonal feature space into at least one initial random forest model to obtain a first predicted distance output by each of the initial random forest models; each of the initial random forest models has a different number of decision trees, each of the initial random forest models has a different minimum number of samples required for internal nodes, and each of the initial random forest models has a different minimum number of samples required for leaf nodes; based on a loss function, determine a first difference value between the true distance and the first predicted distance corresponding to the true distance; based on each of the first difference values, perform a first training on each of the initial random forest models to obtain a candidate random forest model corresponding to each of the initial random forest models; based on the root mean square error of each of the candidate random models, determine a target random forest model from each of the candidate random forest models; and perform a second training on the target random forest model to obtain the distance prediction model.
[0086] In some embodiments, the training module is further specifically used to: group the first predicted distances corresponding to the sample positioning devices output by the target random forest model to obtain at least one first predicted distance set; determine the distribution feature information corresponding to each of the first predicted distance sets; input each of the distribution feature information, the first predicted distance and the true distance into the target random forest model to obtain a second predicted distance output by the target random forest model; determine a second difference value between the second predicted distance and the true distance based on the loss function; and perform a second training on the target random forest model based on the second difference value to obtain the distance prediction model.
[0087] Figure 4 Schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other via the communication bus 440. The processor 410 may call logic instructions in the memory 430 to execute a method for locating a mobile terminal, the method comprising: acquiring distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal; performing feature space orthogonalization on the distance-related features corresponding to each of the positioning devices to obtain an orthogonal feature space corresponding to each of the positioning devices; inputting each of the orthogonal feature spaces into a distance prediction model to obtain a target distance between the mobile terminal and each of the positioning devices output by the distance prediction model; the distance prediction model is trained based on sample orthogonal feature spaces corresponding to sample positioning devices; and locating the target position of the mobile terminal based on each of the target distances.
[0088] Furthermore, the logic instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the portion that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product, stored in a storage medium, includes instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a mobile hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0089] On the other hand, the present invention also provides a computer program product, which includes a computer program, and the computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the method for positioning a mobile terminal provided by the above methods, the method including: obtaining distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal; performing feature space orthogonalization on the distance-related features corresponding to each of the positioning devices to obtain an orthogonal feature space corresponding to each of the positioning devices; inputting each of the orthogonal feature spaces into a distance prediction model to obtain the target distance between the mobile terminal and each of the positioning devices output by the distance prediction model; the distance prediction model is trained based on the sample orthogonal feature space corresponding to the sample positioning device; and locating the target position of the mobile terminal based on each of the target distances.
[0090] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for positioning a mobile terminal provided by the above-mentioned methods, the method comprising: obtaining distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal; performing feature space orthogonalization on the distance-related features corresponding to each of the positioning devices to obtain an orthogonal feature space corresponding to each of the positioning devices; inputting each of the orthogonal feature spaces into a distance prediction model to obtain the target distance between the mobile terminal and each of the positioning devices output by the distance prediction model; the distance prediction model is trained based on sample orthogonal feature spaces corresponding to sample positioning devices; and locating the target position of the mobile terminal based on each of the target distances.
[0091] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0092] Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented using software plus a necessary general-purpose hardware platform, or of course, hardware. Based on this understanding, the essence of the above technical solution, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, or an optical disk, and includes a number of instructions for causing a computer device (such as a personal computer, server, or network device) to execute the methods described in each embodiment or certain portions of the embodiments.
[0093] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A method for locating a mobile terminal, characterized in that: include: Acquiring distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal; orthogonalizing the feature space of the distance-related features corresponding to each positioning device to obtain the orthogonal feature space corresponding to each positioning device; Inputting each of the orthogonal feature spaces into a distance prediction model to obtain a target distance between the mobile terminal and each of the positioning devices output by the distance prediction model; the distance prediction model is trained based on sample orthogonal feature spaces corresponding to sample positioning devices; Based on each of the target distances, the target position of the mobile terminal is located.
2. The method for locating a mobile terminal according to claim 1, wherein: The performing feature space orthogonalization on the distance-related features corresponding to each positioning device to obtain the orthogonal feature space corresponding to each positioning device includes: Normalizing the distance-related features to obtain a feature space matrix corresponding to the positioning device; Determining a feature space covariance matrix corresponding to the feature space matrix; Determine at least one eigenvalue corresponding to the eigenspace covariance matrix and an eigenvector corresponding to each eigenvalue; Based on the eigenvalues and the eigenvectors corresponding to the eigenvalues, spatial orthogonalization is performed on the distance-related features to obtain an orthogonal feature space corresponding to the positioning device.
3. The method for locating a mobile terminal according to claim 2, wherein: The performing spatial orthogonalization on the distance-related features based on the eigenvalues and the eigenvectors corresponding to the eigenvalues to obtain an orthogonal feature space corresponding to the positioning device includes: Sorting the eigenvalues based on the magnitude of the eigenvalues to obtain an arrangement order of the eigenvalues; Determining at least one target eigenvalue from each of the eigenvalues based on an arrangement order of the eigenvalues; The eigenvector corresponding to the target eigenvalue is normalized to obtain the orthogonal eigenspace.
4. The method for locating a mobile terminal according to any one of claims 1 to 3, characterized in that: The locating the target position of the mobile terminal based on each of the target distances includes: Determining the spatial position of each of the positioning devices; Constructing a three-dimensional coordinate system based on the spatial positions of the respective positioning devices; at least one of the positioning devices is located on a coordinate axis of the three-dimensional coordinate system, and the origin of the three-dimensional coordinate system is the circumcenter of the base triangle formed by the positioning devices; The target position of the mobile terminal is located based on the coordinate position of each positioning device in the three-dimensional coordinate system and the target distance between the mobile terminal and each positioning device.
5. The method for locating a mobile terminal according to claim 4, wherein: Before acquiring the distance-related feature corresponding to at least one positioning device through the ultra-wideband sensor in the mobile terminal, the method further includes: Determine the straight-line distance between any two candidate positioning devices; The candidate positioning devices with equal straight-line distances and capable of forming an equilateral triangle are determined as the positioning devices.
6. The method for locating a mobile terminal according to any one of claim 5, wherein: The training process of the distance prediction model includes: Acquire a sample orthogonal feature space corresponding to a sample positioning device and a real distance between the sample positioning device and the mobile terminal; Inputting the sample orthogonal feature space and the true distance corresponding to the sample orthogonal feature space into at least one initial random forest model to obtain a first predicted distance output by each of the initial random forest models; each of the initial random forest models has a different number of decision trees, a different minimum number of samples required for internal nodes of each of the initial random forest models, and a different minimum number of samples required for leaf nodes of each of the initial random forest models; determining, based on a loss function, a first difference value between the actual distance and a first predicted distance corresponding to the actual distance; Based on each of the first difference values, performing a first training on each of the initial random forest models to obtain a candidate random forest model corresponding to each of the initial random forest models; Determining a target random forest model from the candidate random forest models based on the root mean square error of each candidate random forest model; The target random forest model is trained a second time to obtain the distance prediction model.
7. The method for locating a mobile terminal according to claim 6, wherein: The second training of the target random forest model to obtain the distance prediction model includes: Grouping the first predicted distances corresponding to the sample positioning devices output by the target random forest model to obtain at least one first predicted distance set; Determining distribution feature information corresponding to each of the first prediction distance sets; Inputting each of the distribution feature information, the first predicted distance, and the true distance into the target random forest model to obtain a second predicted distance output by the target random forest model; determining a second difference value between the second predicted distance and the true distance based on the loss function; Based on the second difference value, the target random forest model is trained for a second time to obtain the distance prediction model.
8. A device for locating a mobile terminal, characterized in that: include: an acquisition module, configured to acquire distance-related features corresponding to at least four positioning devices through an ultra-wideband sensor in the mobile terminal; An orthogonalization module, configured to perform feature space orthogonalization on the distance-related features corresponding to each positioning device to obtain an orthogonal feature space corresponding to each positioning device; A prediction module, configured to input each of the orthogonal feature spaces into a distance prediction model to obtain a target distance between the mobile terminal and each of the positioning devices output by the distance prediction model; the distance prediction model is trained based on sample orthogonal feature spaces corresponding to sample positioning devices; A positioning module is used to locate the target position of the mobile terminal based on each of the target distances.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the method for locating a mobile terminal according to any one of claims 1 to 7 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for locating a mobile terminal according to any one of claims 1 to 7 is implemented.