Positioning method and device, electronic equipment and storage medium
By acquiring and processing the WIFI signals of smart devices and using neural network models for positioning, the problem of inaccurate device positioning in smart homes is solved, and efficient and accurate device positioning and navigation are achieved.
Patent Information
- Application Number
- CN202411276992.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-13
AI Technical Summary
In smart home environments, traditional device positioning methods are inefficient when looking for specific devices due to inaccurate positioning.
By obtaining the WIFI signal of the smart device, extracting the target characteristics of the signal, and inputting it into a pre-established positioning model, determining the position information of the device and improving the positioning accuracy. The method includes obtaining WIFI signals of multiple smart devices, extracting their target features, positioning using neural network models, and generating navigation paths based on location information, and updating navigation paths in real time to improve user experience.
It achieves higher device positioning accuracy and user experience, and can quickly and accurately locate and navigate to smart devices, improving users' search efficiency in smart home environments.
Smart Images

Figure CN119136309A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of device positioning, and in particular, relates to a positioning method, device, electronic device and storage medium. Background Art
[0002] In a smart home environment, users often need to find and locate specific home devices, such as remote controls, speakers, cameras, etc. However, traditional positioning methods usually rely on the device's own positioning function, which is often not accurate enough. Due to the inaccurate positioning, the search efficiency is low when the user is searching. Summary of the invention
[0003] The embodiments of the present application provide a positioning method, an apparatus, an electronic device, and a storage medium, which can improve the positioning accuracy of a smart device.
[0004] According to a first aspect of the present application, an embodiment of the present application provides a positioning method, including:
[0005] Acquire a first WIFI signal of a first smart device;
[0006] Extracting target features of the first WIFI signal;
[0007] The target feature of the first WIFI signal is input into a pre-established positioning model to determine the location information of the first smart device.
[0008] In some embodiments, the method further comprises:
[0009] When trigger information for searching for a third smart device triggered by the second smart device is obtained, a second WIFI signal of the second smart device and a third WIFI signal of the third smart device are obtained;
[0010] Extracting a target feature of the second WIFI signal, and extracting a target feature of the third WIFI signal;
[0011] Inputting the target feature of the second WIFI signal into the positioning model to determine the first location information of the second smart device, and inputting the target feature of the third WIFI signal into the positioning model to determine the second location information of the third smart device;
[0012] The first position information and the second position information are output.
[0013] In some embodiments, the outputting the first position information and the second position information includes:
[0014] determining a distance between the first location information and the second location information;
[0015] When the distance is greater than a distance threshold, generating a navigation path based on the first position information and the second position information;
[0016] The navigation path is output.
[0017] In some embodiments, the method further comprises:
[0018] Acquire a fourth WIFI signal of the second smart device in real time;
[0019] Extracting a target feature of the fourth WIFI signal, and inputting the target feature of the fourth WIFI signal into the positioning model to determine the real-time position of the second smart device;
[0020] The navigation route is updated based on the real-time location.
[0021] In some embodiments, the method further comprises:
[0022] When the distance is less than the distance threshold, determining the position of the third smart device based on the second position information;
[0023] The radar is output with the first position information as the center of the radar and the azimuth determined as the azimuth of the radar, and the second position information is output.
[0024] In some embodiments, the method further comprises:
[0025] Get sample WIFI signals from smart devices;
[0026] Preprocessing the sample WIFI signal to obtain a processed sample WIFI signal;
[0027] Extract sample target features from the processed sample WIFI signals;
[0028] Marking the location information of the smart device corresponding to the sample target feature to generate a sample data set;
[0029] The neural network model is trained based on the sample data set to obtain the positioning model.
[0030] In some embodiments, the training of the neural network model based on the sample data set to obtain the positioning model includes:
[0031] Dividing the sample data set into a training set and a test set;
[0032] Training the neural network model based on the training set, and evaluating the trained neural network model based on the test set;
[0033] When the evaluation result meets the requirements, the trained neural network model is determined as the positioning model.
[0034] According to a second aspect of the present application, an embodiment of the present application provides a positioning device, including:
[0035] A first acquisition module, used to acquire a first WIFI signal of a first smart device;
[0036] An extraction module, used to extract target features of the first WIFI signal;
[0037] The positioning module is used to input the target feature of the first WIFI signal into a pre-established positioning model to determine the location information of the first smart device.
[0038] According to the third aspect of the present application, an embodiment of the present application 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 methods described above when executing the computer program.
[0039] According to a fourth aspect of the present application, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in any one of the above is implemented.
[0040] According to a fifth aspect of the present application, an embodiment of the present application provides a computer program product, which, when executed on a terminal device, enables the electronic device to execute any of the methods described above.
[0041] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0042] The positioning method provided in the embodiment of the present application can improve positioning accuracy by acquiring a first WIFI signal of a first smart device; extracting a target feature of the first WIFI signal; and inputting the target feature of the first WIFI signal into a pre-established positioning model to determine the location information of the first smart device.
[0043] It can be understood that the beneficial effects of the second to fifth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0045] Figure 1 A schematic diagram of the implementation process of a positioning method provided for the implementation of this application;
[0046] Figure 2 A schematic diagram of a flow chart of another positioning method provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of the structure of a positioning device provided in an embodiment of the present application;
[0048] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0050] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0051] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0052] As used in the specification of this application and the appended claims, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to locating" depending on the context. Similarly, the phrases "if it is determined" or "if it is located" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce it is located" or "in response to locating" depending on the context.
[0053] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0054] 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 phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. appearing 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.
[0055] Based on the technical problems of the related technology, the embodiments of the present application provide a positioning method that can be applied to electronic devices such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0056] The functions implemented by the positioning method provided in the embodiment of the present application can be implemented by a processor of an electronic device calling a program code, wherein the program code can be stored in a computer storage medium.
[0057] Figure 1 A schematic diagram of the implementation flow of a positioning method provided for the implementation of this application, such as Figure 1 As shown, the positioning method includes:
[0058] Step S101, obtaining a first WIFI signal of a first smart device.
[0059] In an embodiment of the present application, the first smart device may include a smart phone, a smart wearable device, a smart watch, etc. The first smart device has a WiFi function turned on and can communicate with the electronic device through WiFi. In this case, the electronic device can obtain a first WiFi signal of the first smart device.
[0060] Step S102: extracting target features of the first WIFI signal.
[0061] In an embodiment of the present application, according to the requirements of the positioning model, appropriate features are selected from the scanned WiFi signals for extraction. Common features include RSSI value, SSID, signal volatility, channel number, etc. In this case, the electronic device extracts the target feature of the first WiFi signal.
[0062] In the embodiment of the present application, the extracted features may be subjected to necessary processing, such as normalization, encoding, etc., to ensure that they meet the requirements of the model input. For example, the RSSI value may be converted into a relative strength value through a formula, and the SSID may be converted into a numerical vector through one-hot encoding.
[0063] In the embodiments of the present application, the feature set can be further optimized through feature selection algorithms (such as PCA, mutual information method, etc.), redundant and irrelevant features can be removed, and the training efficiency and prediction performance of the model can be improved.
[0064] Step S103: input the target feature of the first WIFI signal into a pre-established positioning model to determine the location information of the first smart device.
[0065] In the embodiment of the present application, the first WIFI signal target feature is used as input data and passed to the positioning model. The positioning model calculates the location information of the first smart device as output through internal algorithms and parameters based on the input feature data. As an example, the location information may be a specific coordinate point (such as longitude and latitude).
[0066] In the embodiment of the present application, the positioning model includes a pre-trained algorithm or system, which learns the mapping relationship between a large number of known WiFi signal features and corresponding location information to master how to infer the location of the device from new WiFi signal features. These models generally include but are not limited to machine learning algorithms such as neural networks, decision trees, and support vector machines.
[0067] The positioning method provided in the embodiment of the present application can improve the positioning accuracy by acquiring the first WIFI signal of the first smart device, extracting the target feature of the first WIFI signal, inputting the target feature of the first WIFI signal into a pre-established positioning model, and determining the location information of the first smart device.
[0068] The positioning method provided in the embodiment of the present application can realize the positioning function of smart devices based on WiFi signals through the above steps. It has the advantages of accuracy, easy deployment, low cost, etc., and is very suitable for application in complex indoor environments such as smart homes and smart offices.
[0069] In the present application, the target features of the WiFi signals may be consistent or inconsistent, and the embodiments of the present application do not impose any limitation on this.
[0070] According to this application, the positioning method also includes communication and collaboration between multiple smart devices, and location positioning using WiFi signals. The following is a detailed explanation of these additional steps:
[0071] In some embodiments, the positioning method further includes:
[0072] Step S104: when the trigger information for searching for the third smart device triggered by the second smart device is obtained, a second WIFI signal of the second smart device and a third WIFI signal of the third smart device are obtained.
[0073] In this step, the first smart device, the second smart device, and the third smart device are different smart devices.
[0074] In this step, the trigger information is a request initiated by the user through the user interface of the second smart device, indicating that the user wants to find the third smart device. The trigger information may be a button click, a voice command, or other forms of input.
[0075] In this step, after receiving the trigger information, the electronic device will start to monitor and obtain the WiFi signals sent by the second smart device and the third smart device respectively. These signals may contain information such as SSID, MAC address (if available), RSSI value, etc.
[0076] Step S105, extracting target features of the second WIFI signal, and extracting target features of the third WIFI signal.
[0077] In this step, similar to step S102, feature extraction of the WIFI signal is performed, specifically, feature extraction is performed on the second WIFI signal and the third WIFI signal respectively. The electronic device extracts a series of target features from the WiFi signals of the second and third smart devices, and these features are used in the subsequent positioning process. The selection of features may be based on multiple aspects such as signal strength, stability, and frequency characteristics.
[0078] Step S106: Input the target feature of the second WIFI signal into the positioning model to determine the first location information of the second smart device, and input the target feature of the third WIFI signal into the positioning model to determine the second location information of the third smart device.
[0079] In this step, the extracted target features of the second WIFI signal and the target features of the third WIFI signal are respectively input into the pre-established positioning model. The positioning model uses these features to estimate the locations of the second and third smart devices. Since the positioning model has been trained to understand and parse these features, it can output relatively accurate location information.
[0080] Step S107: output the first position information and the second position information.
[0081] In this step, once the location information of the second smart device and the third smart device is determined, the electronic device will output the information to the user in some form. The output method may include displaying a map and location markers on a screen, sending a notification to the user's mobile device, or broadcasting by voice.
[0082] In these embodiments, in this way, the positioning method can not only support the location positioning of a single smart device, but also be expanded to simultaneously position multiple devices, allowing users to search for multiple devices at the same time, improving search efficiency, and providing users with more convenient and practical services.
[0083] The positioning method according to the present application is not limited to simply outputting the location information of two smart devices, but also further provides practical functions based on the location information, such as calculating the distance between the devices, generating navigation paths, etc. The following is a detailed explanation:
[0084] In some embodiments, step S107, outputting the first location information and the second location information, includes:
[0085] Step S1071, determining the distance between the first position information and the second position information.
[0086] In this step, after obtaining the first location information of the second smart device (denoted as A) and the second location information of the third smart device (denoted as B), the electronic device uses a certain geospatial distance calculation method (such as Euclidean distance, Manhattan distance, Haversine formula, etc., depending on the representation form of the location information, such as longitude and latitude coordinates) to calculate the distance between A and B. The calculated distance value will be stored for subsequent use, such as comparison with a distance threshold.
[0087] Step S1072: when the distance is greater than the distance threshold, generate a navigation path based on the first position information and the second position information.
[0088] In this step, the electronic device compares the calculated distance with a preset distance threshold, which may vary depending on the application scenario, and is used to determine whether the distance between the two devices is far enough to determine whether the user may need navigation to help find the target device.
[0089] In this step, if the distance is greater than the threshold, the electronic device will use a map service or a path planning algorithm (such as A* algorithm, Dijkstra algorithm, Yen's algorithm, etc.) to generate a navigation path from A to B. This path may be optimal (i.e., shortest or fastest), or it may take other factors into consideration (such as avoiding congestion, preferring specific roads, etc.).
[0090] In this step, in some cases, the electronic device may further optimize the generated navigation path according to user preferences or other factors.
[0091] Step S1073, output the navigation path.
[0092] In this step, the electronic device will display the generated navigation path in a user-friendly manner. This may include drawing the path on a map, providing text instructions (such as turn instructions), sending navigation instructions to the user's mobile device (such as navigation through a mobile phone APP), etc.
[0093] In this step, the electronic device may also provide interactive functions related to the navigation path, such as adjusting the starting point or end point, viewing different path options, etc.
[0094] In these embodiments, through these steps, the positioning method not only provides the location information of the smart device, but also further helps the user solve the problem of "how to get there", thereby improving the user experience and practicality.
[0095] In a further extended positioning method embodiment, a real-time location tracking function for the second smart device (i.e., the device currently being used by the user to find the third smart device) is added, and the navigation path is dynamically updated according to its real-time location. The following is a detailed explanation of the newly added steps:
[0096] In some embodiments, the positioning method further includes:
[0097] Step S108, acquiring a fourth WIFI signal of the second smart device in real time.
[0098] In this step, the electronic device can continuously and uninterruptedly monitor and obtain the WiFi signal sent by the second smart device. This is usually achieved through the device's WiFi module or a dedicated sensor to ensure the real-time and accuracy of the data.
[0099] In this step, the collected fourth WIFI signal includes information related to the current location of the second smart device, such as signal strength, channel number, SSID, etc.
[0100] Step S109: extracting the target feature of the fourth WIFI signal, and inputting the target feature of the fourth WIFI signal into the positioning model to determine the real-time position of the second smart device.
[0101] In this step, similar to the previous step, the electronic device extracts a series of target features from the fourth WIFI signal, which can also be understood and parsed by the positioning model.
[0102] In this step, the extracted target features of the fourth WIFI signal are input into a pre-established positioning model, and the model uses these features to estimate the real-time location of the second smart device. Since this process is real-time, it can reflect the latest location information of the device.
[0103] Step S100, updating the navigation path based on the real-time location.
[0104] In this step, once the real-time location of the second smart device is obtained, the electronic device will update the previously generated navigation path based on this location information. This usually involves recalculating the optimal path from the current location to the target location (i.e., the location of the third smart device).
[0105] In this step, since the location of the second smart device changes in real time, the navigation path also needs to be dynamically adjusted accordingly, which ensures that the user can always follow the latest and optimal path to the target device.
[0106] In this step, the electronic device may optionally also notify the user of the route update information in real time, such as through APP push notifications, voice prompts, etc. on the mobile device, so that the user can promptly understand the changes in the route and make corresponding adjustments.
[0107] In these embodiments, through these newly added steps, the positioning method not only provides static location information and navigation paths, but also realizes real-time location tracking of the second smart device and dynamic update of the navigation path, further improving the user experience and practicality.
[0108] According to the present application, the positioning method also includes that when the distance between the second smart device and the third smart device is less than a preset distance threshold, the electronic device will no longer generate a detailed navigation path, but can take a more intuitive way to instruct the user how to find the third smart device. The following is a detailed explanation of the newly added steps:
[0109] In some embodiments, the positioning method further includes:
[0110] Step S110: when the distance is less than the distance threshold, determine the position of the third smart device based on the second location information.
[0111] In this step, first, the electronic device compares whether the distance between the second smart device (i.e., the device the user is using) and the third smart device is less than a preset distance threshold. If less than, it is considered that the user is close enough to the target device, and no detailed navigation path is required.
[0112] In this step, the electronic device then determines the position of the third smart device relative to the second smart device based on the second location information (i.e., the position of the second smart device). This usually involves calculating the relative angle or direction between the two locations, and may be combined with map information to provide a more accurate position description.
[0113] Step S120, taking the first position information as the center of the radar, taking the azimuth determined as the azimuth of the radar, and outputting the radar, and outputting the second position information.
[0114] In this step, in order to more intuitively display the position of the third smart device, the system can generate a radar-like interface, in which the first location information (i.e., the position of the second smart device) is used as the center point of the radar, and the position of the third smart device is marked at the corresponding position of the radar.
[0115] In this step, in addition to the radar interface, the electronic device can also simultaneously output the second location information (i.e. the specific location information of the third smart device) so that the user can understand the exact location of the target device. This information can be presented in text form, voice prompts or other user-friendly ways.
[0116] In these embodiments, in this way, when the user finds the second smart device and approaches the third smart device, the electronic device can provide a more intuitive and concise indication method to help the user quickly find the third smart device. At the same time, the use of the radar interface also makes the positioning process more vivid and interesting, improving the user experience.
[0117] It should be noted that although the "first location information" is mentioned here as the center of the radar, in actual scenarios, since we are discussing the situation where the second smart device is looking for the third smart device, the "first location information" here may refer to a fixed reference point (such as the home center, office center, etc. set by the user), or simply the current location of the second smart device (if the "first location information" and "second location information" refer to the same device at this time). However, in most cases, for the sake of simplicity and clarity, we may regard the "first location information" as the current location of the second smart device and use it as the center of the radar.
[0118] According to the present application, the positioning method also includes a training process of the positioning model, through which the accuracy and reliability of the positioning position determined by the positioning model can be ensured. The following is a detailed explanation of these steps:
[0119] In some embodiments, the positioning method further includes:
[0120] Step S130, obtaining a sample WIFI signal of the smart device.
[0121] In this step, a large number of WiFi signals from different smart devices in different locations need to be collected as samples. These samples should cover a wide range of scenarios and conditions to ensure that the trained model has sufficient generalization ability.
[0122] In this step, the samples should include WiFi signals from smart devices of different models and brands to reflect the diversity in actual use.
[0123] In this step, samples should be collected in different geographical locations and in different indoor or outdoor environments to cover possible positioning scenarios.
[0124] Step S140: pre-process the sample WIFI signal to obtain a processed sample WIFI signal.
[0125] In this step, since the WiFi signal may be subject to various interferences during the transmission process, the original signal needs to be denoised to improve the signal-to-noise ratio.
[0126] In this step, for weaker signals, enhancement processing may be required to better extract features.
[0127] In this step, in order to eliminate the dimensional differences between different samples, it is usually necessary to standardize or normalize the signal.
[0128] Step S150, extracting sample target features from the processed sample WIFI signals.
[0129] In this step, features useful for positioning, such as signal strength, frequency characteristics, channel number, etc., are extracted from the processed WiFi signals.
[0130] In this step, if too many features are extracted, it may increase the complexity of model training. Therefore, feature dimensionality reduction technology can be used to reduce the number of features.
[0131] Step S160: annotate the location information of the smart device corresponding to the sample target feature to generate a sample data set.
[0132] In this step, each sample feature is labeled with the location information of the corresponding smart device, which can be obtained through GPS, indoor positioning system and other means.
[0133] In this step, the labeled sample features and location information are combined to form a complete sample data set.
[0134] Step S170, training the neural network model based on the sample data set to obtain a positioning model.
[0135] In this step, a suitable neural network model is selected as the basis of the positioning model, such as convolutional neural network (CNN), recurrent neural network (RNN), deep neural network (DNN), etc.
[0136] In this step, the neural network model is trained using a sample data set, and the performance of the model is optimized by continuously adjusting the model parameters.
[0137] In this step, during the training process, the performance of the model needs to be regularly evaluated, such as positioning accuracy, recall rate, F1 score and other indicators, to ensure that the model can meet actual needs.
[0138] In this step, based on the performance evaluation results, the model is further optimized and adjusted to improve the accuracy and robustness of the model.
[0139] In these embodiments, through the above steps, a positioning model that can accurately locate the position of the smart device can be trained. This model can be applied to various practical scenarios to provide users with convenient positioning services.
[0140] According to the present application, the positioning method further includes the step of using the sample data set to train the neural network model to obtain the positioning model, wherein the data set is divided into a training set and a test set, model training is performed, and model evaluation is performed, etc., so as to ensure the accuracy of the positioning model. The following is a detailed explanation of these steps:
[0141] In some embodiments, step S170, training a neural network model based on a sample data set to obtain a positioning model, includes:
[0142] Step S171, dividing the sample data set into a training set and a test set.
[0143] In this step, the entire sample data set needs to be divided into two subsets: training set and test set. The training set is used to train the neural network model so that it can learn the patterns and features in the data. The test set is used to evaluate the performance of the trained model to ensure that the model can also show good generalization ability on unseen data.
[0144] In this step, the ratio of the training set to the test set is determined according to the specific application scenario and the size of the data set. For example, the ratio is 70% training set, 30% test set, or 80% training set, 20% test set, etc.
[0145] Step S172: training the neural network model based on the training set, and evaluating the trained neural network model based on the test set.
[0146] In this step, the neural network model is trained using the sample data in the training set. During the training process, the model will continuously learn the mapping relationship between the input data (i.e., sample features) and the output data (i.e., location information), and adjust its own parameters to minimize the prediction error.
[0147] In this step, after the model training is completed, the model is evaluated using the sample data in the test set. The main purpose of the evaluation is to check how the model performs on unseen data, including key indicators such as positioning accuracy, recall rate, F1 score, etc. The evaluation results can be used to determine whether the model meets actual needs.
[0148] Step S173: When the evaluation result meets the requirements, the trained neural network model is determined as the positioning model.
[0149] In this step, whether the evaluation results meet the requirements usually depends on the preset evaluation criteria, which may include the threshold of positioning accuracy, the minimum requirement of recall rate, etc.
[0150] In this step, if the evaluation results meet the preset evaluation criteria, the trained neural network model can be determined as the final positioning model. This model will be used in subsequent positioning tasks to provide users with accurate positioning services.
[0151] It should be noted that if the evaluation results do not meet the requirements, it may be necessary to readjust the model parameters, change the model structure, or add more training data to improve the model performance and re-train and evaluate the process. This process may require multiple iterations to obtain a satisfactory positioning model.
[0152] In summary, this application achieves high-precision and low-latency positioning of the WiFi positioning system by introducing machine learning algorithms and optimizing the fingerprint database, providing users with more accurate and efficient positioning services.
[0153] Figure 2 A flow chart of another positioning method provided in an embodiment of the present application is shown as follows: Figure 2 As shown, the specific implementation method of the present invention is as follows:
[0154] The specific implementation method of the present invention is as follows (such as Figure 2 shown):
[0155] S1: Data acquisition and preprocessing.
[0156] In a smart home environment, use professional WiFi signal scanning equipment or software to perform a comprehensive WiFi signal scan in each area. Record the WiFi signal data of each scan point, including the name (SSID), signal strength (RSSI), channel and other information of each WiFi access point. Remove duplicate, invalid or abnormal data records to ensure data quality. Then convert the data into JSON format to suit machine learning model processing.
[0157] S2: Feature extraction.
[0158] Using feature extraction techniques in machine learning, such as the principal component analysis (PCA) algorithm, extract features that affect positioning from WiFi signal fingerprint data, such as RSSI value (a measure of WiFi signal strength, reflecting the attenuation of the signal during propagation), SSID (SSID is the unique identifier of a WiFi access point. By recording the identifier of the access point, it can help identify the signal source at different locations), signal volatility, and the trend of signal strength changes. Perform necessary transformations on the selected features, such as normalizing the RSSI value, to better adapt to the machine learning model.
[0159] S3: Model training.
[0160] The preprocessed data is divided into a training set and a test set. Usually 70% of the data is used as the training set and 30% of the data is used as the test set. The random forest machine learning algorithm is used to train the WiFi fingerprint positioning model. The trained model is evaluated using the test set (indicators include accuracy, recall, and F1 score). The evaluation results can help you understand the performance of the model in different scenarios. According to the performance of the model on the validation set, adjust the model's parameters, change the feature combination, try different machine learning algorithms, etc. to improve the accuracy and generalization ability of the model. Finally, as the smart home environment changes (such as adding or reducing WiFi access points, moving devices, etc.), the WiFi fingerprint database and machine learning model need to be updated regularly to maintain the accuracy of positioning.
[0161] S4: Positioning and searching.
[0162] When a user needs to find a smart home device, the electronic device can collect the WiFi signal data of the current location in real time. Features are extracted from the real-time collected WiFi signal data and matched with the trained model. The model outputs location information based on the matched WiFi signal features to help users locate the target smart home device.
[0163] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0164] According to the foregoing embodiments, the embodiments of the present application provide a positioning device, and each module included in the device and each unit included in each module can be implemented by a processor in a computer device. Of course, it can also be implemented by a specific logic circuit. In the process of implementation, the processor can be a central processing unit (CPU, Central Processing Unit), a microprocessor (MPU, Microprocessor Unit), a digital signal processor (DSP, Digital Signal Processing) or a field programmable gate array (FPGA, Field Programmable Gate Array), etc.
[0165] The present application embodiment provides a positioning device, Figure 3 A schematic diagram of a positioning device provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the positioning device 400 includes:
[0166] A first acquisition module 401 is used to acquire a first WIFI signal of a first smart device;
[0167] An extraction module 402, configured to extract target features of the first WIFI signal;
[0168] The positioning module 403 is used to input the target feature of the first WIFI signal into a pre-established positioning model to determine the location information of the first smart device.
[0169] In some embodiments, in the positioning device 400:
[0170] The first acquisition module 401 is further configured to acquire a second WIFI signal of the second smart device and a third WIFI signal of the third smart device when trigger information for searching for a third smart device is acquired.
[0171] The extraction module 402 is further used to extract the target feature of the second WIFI signal and the target feature of the third WIFI signal;
[0172] The positioning module 403 is also used to input the target feature of the second WIFI signal into the positioning model to determine the first location information of the second smart device, and input the target feature of the third WIFI signal into the positioning model to determine the second location information of the third smart device; and output the first location information and the second location information.
[0173] In some embodiments, the positioning module 403 is specifically used to:
[0174] determining a distance between the first location information and the second location information;
[0175] When the distance is greater than a distance threshold, generating a navigation path based on the first position information and the second position information;
[0176] The navigation path is output.
[0177] In some embodiments, the first acquisition module 401 is further used to acquire a fourth WIFI signal of the second smart device in real time;
[0178] The extraction module 402 is further used to extract the target feature of the fourth WIFI signal, and input the target feature of the fourth WIFI signal into the positioning model to determine the real-time position of the second smart device;
[0179] The positioning module 403 is further configured to update the navigation path based on the real-time position.
[0180] In some embodiments, the positioning module 403 is also used to
[0181] When the distance is less than the distance threshold, determining the position of the third smart device based on the second position information;
[0182] The radar is output with the first position information as the center of the radar and the azimuth determined as the azimuth of the radar, and the second position information is output.
[0183] In some embodiments, the positioning device 400 further includes: a model training module, which is used to:
[0184] Get sample WIFI signals from smart devices;
[0185] Preprocessing the sample WIFI signal to obtain a processed sample WIFI signal;
[0186] Extract sample target features from the processed sample WIFI signal;
[0187] Marking the location information of the smart device corresponding to the sample target feature to generate a sample data set;
[0188] The neural network model is trained based on the sample data set to obtain the positioning model.
[0189] In some embodiments, the model training module is specifically used to:
[0190] Training a neural network model based on the sample data set to obtain the positioning model includes:
[0191] Dividing the sample data set into a training set and a test set;
[0192] Training the neural network model based on the training set, and evaluating the trained neural network model based on the test set;
[0193] When the evaluation result meets the requirements, the trained neural network model is determined as the positioning model.
[0194] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0195] in addition, Figure 3 The positioning device shown may be a software unit, a hardware unit, or a combination of software and hardware, which is built into an existing electronic device, or may be integrated into the electronic device as an independent pendant, or may exist as an independent terminal device.
[0196] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can 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 scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0197] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 4 As shown, the electronic device 3 of this embodiment may include: at least one processor 30 ( Figure 4Only one processor 30 is shown in the figure), a memory 31, and a computer program 32 stored in the memory 31 and executable on at least one processor 30. When the processor 30 executes the computer program 32, the steps in any of the above-mentioned method embodiments are implemented. For example, Figure 1 Steps S101 to S103 in the illustrated embodiment. Alternatively, when the processor 30 executes the computer program 32, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 3 Functions of modules 401 to 403 are shown.
[0198] Exemplarily, the computer program 32 may be divided into one or more modules / units, one or more modules / units are stored in the memory 31, and are executed by the processor 30 to complete the present application. One or more modules / units may be a series of computer program 32 instruction segments capable of completing specific functions, and the instruction segments are used to describe the execution process of the computer program 32 in the electronic device 3.
[0199] The embodiment of the present application further provides a computer-readable storage medium, which stores a computer program 32. When the computer program 32 is executed by the processor 30, the steps in the above-mentioned method embodiments can be implemented.
[0200] An embodiment of the present application provides a computer program product. When the computer program product runs on an electronic device, the electronic device can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0201] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. According to this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program 32, and the computer program 32 can be stored in a computer-readable storage medium, and the computer program 32 can implement the steps of the above-mentioned various method embodiments when executed by the processor 30. Among them, the computer program 32 includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the terminal, a recording medium, a computer memory, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), an electric carrier signal, a telecommunication signal, and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0202] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0203] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0204] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0205] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0206] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A positioning method, characterized in that: include: Acquire a first WIFI signal of a first smart device; Extracting target features of the first WIFI signal; The target feature of the first WIFI signal is input into a pre-established positioning model to determine the location information of the first smart device.
2. The method according to claim 1, characterized in that: The method further comprises: When trigger information for searching for a third smart device triggered by the second smart device is obtained, a second WIFI signal of the second smart device and a third WIFI signal of the third smart device are obtained; Extracting a target feature of the second WIFI signal, and extracting a target feature of the third WIFI signal; Inputting the target feature of the second WIFI signal into the positioning model to determine the first location information of the second smart device, and inputting the target feature of the third WIFI signal into the positioning model to determine the second location information of the third smart device; The first position information and the second position information are output.
3. The method according to claim 2, characterized in that The outputting the first position information and the second position information includes: determining a distance between the first location information and the second location information; When the distance is greater than a distance threshold, generating a navigation path based on the first position information and the second position information; The navigation path is output.
4. The method according to claim 3, characterized in that The method further comprises: Acquire a fourth WIFI signal of the second smart device in real time; Extracting a target feature of the fourth WIFI signal, and inputting the target feature of the fourth WIFI signal into the positioning model to determine the real-time position of the second smart device; The navigation route is updated based on the real-time location.
5. The method according to claim 3, characterized in that: The method further comprises: When the distance is less than the distance threshold, determining the position of the third smart device based on the second position information; The radar is output with the first position information as the center of the radar and the azimuth determined as the azimuth of the radar, and the second position information is output.
6. The method according to claim 1, characterized in that The method further comprises: Get sample WIFI signals from smart devices; Preprocessing the sample WIFI signal to obtain a processed sample WIFI signal; Extract sample target features from the processed sample WIFI signal; Marking the location information of the smart device corresponding to the sample target feature to generate a sample data set; The neural network model is trained based on the sample data set to obtain the positioning model.
7. The method according to claim 6, characterized in that The step of training the neural network model based on the sample data set to obtain the positioning model includes: Dividing the sample data set into a training set and a test set; Training the neural network model based on the training set, and evaluating the trained neural network model based on the test set; When the evaluation result meets the requirements, the trained neural network model is determined as the positioning model.
8. A positioning device, characterized in that: include: A first acquisition module, used to acquire a first WIFI signal of a first smart device; An extraction module, used to extract target features of the first WIFI signal; The positioning module is used to input the target feature of the first WIFI signal into a pre-established positioning model to determine the location information of the first smart device.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
