Positioning method, navigation method, electronic equipment and storage medium
By obtaining beacon signals multiple times around the electronic device and calculating the state probability using the Hidden Markov model, the positioning problem of electronic devices when they cannot receive the GPS signal is solved, and accurate and reliable positioning and navigation are achieved.
Patent Information
- Application Number
- CN202410064994.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-16
- Publication Date
- 2025-07-18
AI Technical Summary
Electronic devices cannot accurately obtain their own location information when they cannot receive signals from positioning systems such as GPS, especially in scenarios where signals such as underground parking lots are blocked by buildings.
By obtaining beacon signals multiple times within the preset range around the electronic device, using the Hidden Markov model to process beacon position information, calculate the state probability of the candidate position, and select the most trusted position as the device position.
Even in the event that GPS signals cannot be received, the location of the electronic device can be accurately and reliably positioned, and the user can be guided to the target device through a navigation method.
Smart Images

Figure CN120334846A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of positioning technology, and in particular, to a positioning method, a navigation method, an electronic device, and a storage medium. Background Art
[0002] Currently, electronic devices such as mobile phones can usually use positioning systems such as GPS for positioning. However, in some scenarios, the electronic device may not be able to receive the signal of the positioning system or the received signal quality is poor, resulting in the electronic device being unable to accurately obtain its own location information. For example, when the electronic device is in an underground parking lot, since the underground parking lot is usually located below a building and has a relatively large depth, and the underground parking lot usually has a wall structure formed by materials such as concrete, these buildings and wall structures will block the propagation of the positioning system signal, causing the electronic device to be unable to receive the signal.
[0003] Correspondingly, a new technical solution is needed in this field to solve the above problems. Summary of the Invention
[0004] In order to overcome the above defects, the present application is proposed to provide a positioning method, a navigation method, an electronic device, and a storage medium that solve or at least partially solve the technical problem of how to accurately and reliably perform positioning in the case of being unable to receive the signal of a positioning system such as GPS.
[0005] In a first aspect, a positioning method is provided, which is applied to an electronic device and includes:
[0006] In response to a user's operation, obtain beacon signals multiple times, where the beacon signals are signals of beacons within a preset range around the electronic device, and the beacon signals include beacon positions;
[0007] For each obtained beacon signal, obtain a candidate position of the electronic device when the beacon signal is obtained this time according to the beacon position;
[0008] If there are multiple candidate positions, use the beacon signal as the observation information of the hidden Markov model and the candidate positions as the state information of the hidden Markov model, and obtain the state probabilities of the candidate positions through the hidden Markov model;
[0009] Select one of the candidate positions as the device position of the electronic device when the beacon signal is obtained this time according to the state probabilities of the candidate positions.
[0010] In a technical solution of the above positioning method, the obtaining the state probabilities of the candidate positions through the hidden Markov model includes:
[0011] Obtain the device location of the electronic device when the beacon signal was last obtained, and obtain the first observation probability of the device location;
[0012] For each candidate location of the electronic device when the beacon signal is obtained this time, obtain the second observation probability and the state transition probability of each candidate location, and obtain the state probability of each candidate location according to the first observation probability and the second observation probability and the state transition probability of each candidate location;
[0013] Among them, the state transition probability of each candidate location is the probability that the electronic device transfers from the device location when the beacon signal was last obtained to each candidate location.
[0014] In a technical solution of the above positioning method, the selecting one candidate location as the device location of the electronic device when the beacon signal is obtained this time includes:
[0015] Obtain the device location of the electronic device every time the beacon signal was obtained before the last time, and obtain the state probability of each device location;
[0016] Obtain the state probability of each candidate location of the electronic device when the beacon signal is obtained this time;
[0017] Adopt the Viterbi algorithm, and select one candidate location as the device location of the electronic device when the beacon signal is obtained this time according to the state probability of each device location and the state probability of each candidate location.
[0018] In a technical solution of the above positioning method, the method further includes:
[0019] If there is only one candidate location of the electronic device when the beacon signal is obtained this time, use the candidate location as the device location of the electronic device when the beacon signal is obtained this time.
[0020] In a technical solution of the above positioning method, before obtaining the state probability of each candidate location through the hidden Markov model, the method further includes:
[0021] If the beacon signal obtained this time is the first acquisition, use all the candidate locations of the electronic device when the beacon signal is obtained this time as the device location of the electronic device when the beacon signal is obtained this time; or,
[0022] If the beacon signal obtained this time is the first acquisition, randomly select one from all the candidate locations as the device location of the electronic device when the beacon signal is obtained this time.
[0023] In a technical solution of the above positioning method, the obtaining the candidate locations of the electronic device when the beacon signal is obtained this time includes:
[0024] Obtain the intensity of the beacon signal obtained this time;
[0025] According to the intensity, obtain the distance from the electronic device to the beacon that outputs the beacon signal;
[0026] According to the distance and the beacon position in the beacon signal, obtain the position range of the electronic device;
[0027] According to the position range, obtain the candidate positions of the electronic device.
[0028] In a technical solution of the above positioning method, the obtaining the position range of the electronic device according to the distance and the beacon position in the beacon signal includes:
[0029] Taking the distance as the radius and the beacon position as the center, obtain a circular area;
[0030] According to the boundary of the circular area, obtain the position range of the electronic device.
[0031] In a technical solution of the above positioning method, the obtaining the candidate positions of the electronic device according to the position range includes:
[0032] If the beacon signal obtained this time is the beacon signal of one beacon, obtain the position range of the electronic device obtained by using the beacon signal of this beacon;
[0033] Uniformly select multiple positions from the position range as the candidate positions of the electronic device.
[0034] In a technical solution of the above positioning method, the obtaining the candidate positions of the electronic device according to the position range includes:
[0035] If the beacon signal obtained this time includes the beacon signals of two beacons, obtain the two position ranges of the electronic device obtained by using the beacon signals of these two beacons, and obtain the intersection position of these two position ranges;
[0036] Take the intersection position as the candidate position of the electronic device.
[0037] In a second aspect, a navigation method is provided, which is applied to an electronic device, and the method includes:
[0038] Obtain the position of the intelligent device;
[0039] Adopt the positioning method provided in the foregoing first aspect to obtain the device position of the electronic device each time when the beacon signal is obtained during multiple acquisitions of the beacon signal;
[0040] For the position of the device when acquiring the beacon signal each time, based on the position of the device and the intelligent device, generate and output a first direction guidance;
[0041] Wherein, the first direction guidance is used to indicate the direction from the electronic device to the intelligent device.
[0042] In a technical solution of the above navigation method, before generating and outputting the first direction guidance according to the position of the device and the position of the intelligent device, it further includes:
[0043] If there are multiple positions of the device when acquiring the beacon signal this time, acquire the beacon signal acquired this time, and acquire the beacon position in the beacon signal;
[0044] Generate and output a second direction guidance according to the beacon position and the position of the intelligent device;
[0045] Wherein, the second direction guidance is used to indicate the direction from the beacon to the intelligent device.
[0046] In a third aspect, a computer-readable storage medium is provided, which stores multiple program codes, and the program codes are suitable for being loaded and run by a processor to execute the method described in any one of the technical solutions of the above positioning or navigation method.
[0047] In a fourth aspect, an electronic device is provided, which includes at least one processor; and a memory communicatively connected to the at least one processor; wherein, a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method described in any one of the technical solutions of the above positioning or navigation method is implemented.
[0048] Solution 1. A positioning method, characterized in that it is applied to an electronic device, and the method includes:
[0049] In response to a user's operation, acquire beacon signals multiple times, where the beacon signals are signals of beacons within a preset range around the electronic device, and the beacon signals include beacon positions;
[0050] For each acquired beacon signal, according to the beacon position, acquire the candidate position of the electronic device when acquiring the beacon signal this time;
[0051] If there are multiple candidate positions, use the beacon signal as the observation information of the hidden Markov model and the candidate positions as the state information of the hidden Markov model, and obtain the state probabilities of each candidate position through the hidden Markov model;
[0052] Select one of the candidate locations as the device location of the electronic device when acquiring the beacon signal this time according to the state probabilities of the candidate locations.
[0053] Solution 2. The method according to Solution 1, wherein the obtaining the state probabilities of the candidate locations through the hidden Markov model includes:
[0054] Obtain the device location of the electronic device when acquiring the beacon signal last time, and obtain the first observation probability of the device location;
[0055] For each candidate location of the electronic device when acquiring the beacon signal this time, obtain the second observation probability and the state transition probability of each candidate location, and obtain the state probabilities of each candidate location according to the first observation probability and the second observation probability and the state transition probability of each candidate location;
[0056] Wherein, the state transition probability of each candidate location is the probability that the electronic device transfers from the device location when acquiring the beacon signal last time to each candidate location.
[0057] Solution 3. The method according to Solution 1, wherein the selecting one candidate location as the device location of the electronic device when acquiring the beacon signal this time includes:
[0058] Obtain the device location of the electronic device when acquiring the beacon signal each time before the last time, and obtain the state probability of each device location;
[0059] Obtain the state probabilities of the candidate locations of the electronic device when acquiring the beacon signal this time;
[0060] Adopt the Viterbi algorithm, and select one candidate location as the device location of the electronic device when acquiring the beacon signal this time according to the state probabilities of each device location and the state probabilities of the candidate locations.
[0061] Solution 4. The method according to Solution 1, wherein the method further includes:
[0062] If there is only one candidate location of the electronic device when acquiring the beacon signal this time, use the candidate location as the device location of the electronic device when acquiring the beacon signal this time.
[0063] Solution 5. The method according to Solution 1, wherein before obtaining the state probabilities of the candidate locations through the hidden Markov model, the method further includes:
[0064] If this acquisition of the beacon signal is the first acquisition, use all the candidate locations of the electronic device when acquiring the beacon signal this time as the device location of the electronic device when acquiring the beacon signal this time; or,
[0065] If the beacon signal obtained this time is the first time to obtain, randomly select one from all the candidate positions as the device position of the electronic device when obtaining the beacon signal this time.
[0066] Solution 6. The method according to any one of Solutions 1 to 5, wherein obtaining the candidate position of the electronic device when obtaining the beacon signal this time includes:
[0067] Obtain the intensity of the beacon signal obtained this time;
[0068] According to the intensity, obtain the distance from the electronic device to the beacon that outputs the beacon signal;
[0069] According to the distance and the beacon position in the beacon signal, obtain the position range of the electronic device;
[0070] According to the position range, obtain the candidate position of the electronic device.
[0071] Solution 7. The method according to Solution 6, wherein obtaining the position range of the electronic device according to the distance and the beacon position in the beacon signal includes:
[0072] Take the distance as the radius and the beacon position as the center of the circle to obtain a circular area;
[0073] According to the boundary of the circular area, obtain the position range of the electronic device.
[0074] Solution 8. The method according to Solution 7, wherein obtaining the candidate position of the electronic device according to the position range includes:
[0075] If the beacon signal obtained this time is the beacon signal of one beacon, obtain the position range of the electronic device obtained by using the beacon signal of this beacon;
[0076] Uniformly select multiple positions from the position range as the candidate positions of the electronic device.
[0077] Solution 9. The method according to Solution 7, wherein obtaining the candidate position of the electronic device according to the position range includes:
[0078] If the beacon signal obtained this time includes the beacon signals of two beacons, obtain the two position ranges of the electronic device obtained by using the beacon signals of these two beacons, and obtain the intersection position of these two position ranges;
[0079] Take the intersection position as the candidate position of the electronic device.
[0080] Solution 10. A navigation method, characterized in that it is applied to an electronic device, and the method includes:
[0081] Obtain the location of the intelligent device;
[0082] Adopt the positioning method described in any one of Solutions 1 to 9 to obtain the device location of the electronic device each time a beacon signal is obtained during multiple acquisitions of the beacon signal;
[0083] For the device location each time a beacon signal is obtained, generate and output a first direction guidance according to the device location and the location of the intelligent device;
[0084] Wherein, the first direction guidance is used to indicate the direction from the electronic device to the intelligent device.
[0085] Solution 11. The method according to Solution 10, characterized in that, before generating and outputting the first direction guidance according to the device location and the location of the intelligent device, it further includes:
[0086] If there are multiple device locations when the beacon signal is obtained this time, obtain the beacon signal obtained this time and obtain the beacon location in the beacon signal;
[0087] Generate and output a second direction guidance according to the beacon location and the location of the intelligent device;
[0088] Wherein, the second direction guidance is used to indicate the direction from the beacon to the intelligent device.
[0089] Solution 12. A computer-readable storage medium, in which multiple program codes are stored, characterized in that the program codes are suitable for being loaded and run by a processor to execute the positioning method described in any one of Solutions 1 to 9 or to execute the navigation method described in any one of Solutions 10 to 11.
[0090] Solution 13. An electronic device, characterized in that it includes:
[0091] At least one processor;
[0092] And a memory communicatively connected to the at least one processor;
[0093] Wherein, a computer program is stored in the memory, and when the computer program is executed by the at least one processor, it implements the positioning method described in any one of Solutions 1 to 9 or executes the navigation method described in any one of Solutions 10 to 11.
[0094] One or more of the above technical solutions of the present application have at least one or more of the following beneficial effects:
[0095] In the technical solution of the positioning method for an electronic device provided by the present application, beacon signals can be obtained multiple times in response to a user's operation. The beacon signals are signals of beacons within a preset range around the electronic device, and the beacon signals include beacon positions. For each obtained beacon signal, according to the beacon position, a candidate position of the electronic device when the beacon signal is obtained this time is acquired. If there are multiple candidate positions, using the beacon signal as the observation information of the hidden Markov model and the candidate positions as the state information of the hidden Markov model, the state probabilities of the candidate positions are obtained through the hidden Markov model. According to the state probabilities of the candidate positions, one candidate position is selected as the device position of the electronic device when the beacon signal is obtained this time.
[0096] Through the above implementation manner, the position of the electronic device can be obtained by using the positions of the beacons within the preset range around the electronic device. In this way, even if the electronic device cannot receive signals from positioning systems such as GPS, positioning can be performed accurately and reliably. In addition, through the above implementation manner, when multiple candidate positions are obtained by using a certain obtained beacon signal, one candidate position can be accurately selected from the multiple candidate positions as the device position of the electronic device through the hidden Markov model, ensuring the reliability and accuracy of positioning the electronic device.
[0097] In the technical solution of the navigation method for an electronic device provided by the present application, the position of the intelligent device can be obtained, and the device position of the electronic device when each beacon signal is obtained is acquired by using the foregoing positioning method. For the device position when each beacon signal is obtained, according to the device position and the position of the intelligent device, a first direction guide is generated and output, and the first direction guide is used to indicate the direction from the electronic device to the intelligent device.
[0098] Through the above implementation manner, the user can be accurately and reliably guided to move or approach the intelligent device by using the first direction guide, which helps the user quickly find the intelligent device. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] Referring to the accompanying drawings, the disclosure of the present application will become easier to understand. It is easy for those skilled in the art to understand that these drawings are only for illustrative purposes and are not intended to limit the protection scope of the present application. Among them:
[0100] Figure 1 is a schematic main step flow diagram of the positioning method according to an embodiment of the present application;
[0101] Figure 2 is a schematic main step flow diagram of the method for obtaining the state probability of candidate positions according to an embodiment of the present application;
[0102] Figure 3Schematic diagram of the main steps of a method for obtaining candidate locations of an electronic device according to an embodiment of the present application;
[0103] Figure 4 Schematic diagram of obtaining candidate locations according to a location range according to an embodiment of the present application;
[0104] Figure 5 Schematic diagram of obtaining candidate locations according to two location ranges according to an embodiment of the present application;
[0105] Figure 6 Schematic diagram of obtaining candidate locations according to three location ranges according to an embodiment of the present application;
[0106] Figure 7 Schematic diagram of obtaining the centroid location as a candidate location according to an embodiment of the present application;
[0107] Figure 8 Schematic diagram of the main steps of a method for obtaining the device location of an electronic device using the Viterbi algorithm according to an embodiment of the present application;
[0108] Figure 9 Schematic diagram of the main steps of a navigation method according to an embodiment of the present application;
[0109] Figure 10 Schematic diagram of the initial navigation state according to an embodiment of the present application;
[0110] Figure 11 Schematic diagram of the navigation process according to an embodiment of the present application Figure 1 ;
[0111] Figure 12 Schematic diagram of the navigation process according to an embodiment of the present application Figure 2 ;
[0112] Figure 13 Schematic diagram of the navigation process according to an embodiment of the present application Figure 3 ;
[0113] Figure 14 Schematic diagram of the navigation process according to an embodiment of the present application Figure 4 ;
[0114] Figure 15 Schematic diagram of the main structure of an electronic device according to an embodiment of the present application.
[0115] List of reference numerals:
[0116] 11: Memory; 12: Processor. Detailed implementation manners
[0117] Some embodiments of the present application will be described below with reference to the accompanying drawings. Those skilled in the art should understand that these embodiments are only used to explain the technical principles of the present application and are not intended to limit the protection scope of the present application.
[0118] In the description of the present application, a "processor" may include hardware, software, or a combination of both. The processor may be a central processing unit, a microprocessor, an image processor, a digital signal processor, or any other suitable processor. The processor has data and / or signal processing functions. The processor may be implemented in software, in hardware, or in a combination of both. A computer-readable storage medium includes any suitable medium that can store program code, such as a magnetic disk, a hard disk, an optical disk, a flash memory, a read-only memory, a random access memory, and the like.
[0119] In each embodiment of the present application, the relevant user personal information that may be involved is strictly in accordance with the requirements of laws and regulations, following the principles of legality, legitimacy, and necessity, and for a reasonable purpose based on the business scenario, to process the personal information actively provided by the user during the use of the product / service or generated due to the use of the product / service, as well as the personal information obtained with the user's authorization.
[0120] The user personal information processed by the present application will vary depending on the specific product / service scenario. It is subject to the specific scenario of the user's use of the product / service and may involve the user's account information, device information, driving information, vehicle information, or other relevant information. The present application will treat the user's personal information and its processing with a high degree of diligence.
[0121] The present application attaches great importance to the security of user personal information and has taken security protection measures that meet industry standards and are reasonable and feasible to protect the user's information and prevent personal information from being accessed, publicly disclosed, used, modified, damaged, or lost without authorization.
[0122] Some terms involved in the present application will be explained here first.
[0123] An electronic device may be, but is not limited to, a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), an augmented reality (AR) / virtual reality (VR) device, etc.
[0124] A beacon can provide or output a signal containing its own location. The beacon in the embodiments of the present application can be pre-deployed manually, and its main function is to provide or output a positioning device of its own location. In addition, the beacon in the embodiments of the present application can also be a smart device. The main function of the smart device is not to provide or output its own location, but to achieve other functions. However, the smart device can interact with the electronic device and supply or output a signal containing its own location to the electronic device. The smart device can be pre-deployed manually or not. The smart devices in the embodiments of the present application include, but are not limited to, driving devices, smart vehicles, robots, energy replenishment facilities, etc. The energy replenishment facilities can be charging piles, etc. Among them, driving devices, smart vehicles, robots, etc. are not pre-deployed manually, and the energy replenishment facilities can be pre-deployed manually.
[0125] The embodiments of the positioning method provided by the present application will be described below.
[0126] Refer to the appendix Figure 1 , Figure 1 is a schematic flowchart of the main steps of a positioning method according to an embodiment of the present application. This method is applied to an electronic device. As Figure 1 shown, the positioning method in the embodiments of the present application mainly includes the following steps S101 to step S106.
[0127] Step S101: In response to the user's operation, obtain beacon signals multiple times. The beacon signals are signals of beacons within a preset range around the electronic device, and the beacon signals include beacon positions. Among them, obtaining beacon signals multiple times can also be understood as obtaining N beacon signals, where N is a positive integer greater than 1. In addition, i can be used to represent the number of times of obtaining beacon signals, i = 1...N, i = 1 represents the first time of obtaining beacon signals, and i = N represents the Nth time of obtaining beacon signals.
[0128] The electronic device and the beacon can communicate. Those skilled in the art can flexibly set the communication method between the two according to actual needs as long as the electronic device can obtain the beacon signal.
[0129] In some embodiments, both the electronic device and the beacon are provided with Bluetooth modules, and the two can communicate via Bluetooth. Specifically, the electronic device sends out a Bluetooth broadcast requesting to obtain the beacon position, and the Bluetooth broadcast can be received by the beacons within the preset range of the electronic device. When the beacon receives the Bluetooth broadcast, it sends a Bluetooth signal containing its own position to the electronic device.
[0130] When the beacon is a beacon that has been manually pre-deployed in advance (such as a positioning device or energy replenishment facility whose main function is to provide or output its own location), the beacon location will be set in the beacon in advance; when the beacon is not an intelligent device that has been manually pre-deployed in advance (such as a driving device, intelligent vehicle, robot, etc.), the intelligent device can obtain its own location according to the positioning method configured by itself. Those skilled in the art can flexibly configure the positioning methods of different intelligent devices according to actual needs, and this embodiment does not specifically limit the positioning methods adopted by intelligent devices. For example, for a driving device, an inertial navigation algorithm can be used to determine the location of the driving device. For another example, location information can be marked on a parking space, and when the driving device parks in the parking space, it can identify the location information marked on the parking space through OCR (Optical Character Recognition) technology, and use this location information as the location of the driving device. When an electronic device requests to obtain the location, this location is sent to the electronic device.
[0131] In some embodiments, both the electronic device and the beacon are provided with WIFI modules, and the two can communicate through WIFI. Specifically, the beacon can have the function of a WIFI hotspot, and the beacon location can be encrypted and used as the name of the WIFI hotspot. The electronic device scans and analyzes the name of this WIFI hotspot to obtain the beacon location.
[0132] The beacon being within a preset range around the electronic device means that the distance between this beacon and the electronic device is within this preset range, and this preset range can be a distance value. For example, this distance value can be 5 meters. In addition, this preset range is a relatively small distance value, such as the preset range being less than a set value. If the beacon is within the preset range around the electronic device, it indicates that this beacon is near the electronic device. Those skilled in the art can flexibly set the specific value of the preset range according to actual needs, and this embodiment does not specifically limit it.
[0133] The electronic device can obtain beacon signals regularly. Among them, obtaining beacon signals regularly can be to obtain beacon signals in sequence according to a preset time interval or a preset moving distance. When obtaining beacon signals according to a preset time interval, the electronic device obtains a beacon signal every time this preset time interval elapses; when obtaining beacon signals according to a preset moving distance, the electronic device obtains a beacon signal every time it moves this preset moving distance. Those skilled in the art can flexibly set the values of the above-mentioned preset time interval and preset moving distance according to actual needs, and this embodiment does not specifically limit them.
[0134] Step S102: For each acquired beacon signal, according to the beacon position, obtain the candidate positions of the electronic device when the beacon signal is acquired this time. It can also be understood that for the beacon signal acquired for the i-th time, according to the beacon position, obtain the candidate positions of the electronic device when the beacon signal is acquired for the i-th time, where i = 1... N.
[0135] Since the beacon position in the beacon signal is the position of the beacon near the electronic device, the beacon position can be used to assist in obtaining the device position of the electronic device. Specifically, the candidate positions of the electronic device can be obtained first using the beacon position, and then the candidate positions can be screened to obtain the device position of the electronic device.
[0136] Step S103: For each acquired beacon signal, determine whether the number of candidate positions obtained according to the beacon signal is multiple; if it is multiple, go to Step S104; if it is not multiple, that is, it is one, go to Step S106. It can also be understood that for the beacon signal acquired for the i-th time, determine whether the number of candidate positions obtained according to the beacon signal is multiple, where i = 1... N.
[0137] Step S104: For each acquired beacon signal, use the beacon signal as the observation information of the Hidden Markov Model, and use the candidate positions as the state information of the Hidden Markov Model to obtain the state probabilities of the candidate positions through the Hidden Markov Model. It can also be understood that for the beacon signal acquired for the i-th time, obtain the state probabilities of the candidate positions of the electronic device when the beacon signal is acquired for the i-th time through the Hidden Markov Model, where i = 1... N.
[0138] The higher the state probability, the higher the credibility of the candidate position, and vice versa, the lower the credibility of the candidate position. Therefore, in this embodiment, the state probabilities of the candidate positions can be obtained, and the candidate positions can be screened according to the state probabilities to obtain the device position of the electronic device.
[0139] In this embodiment, a conventional Hidden Markov Model can be used to obtain the state probabilities of the candidate positions of the electronic device when the beacon signal is acquired this time using the above-mentioned beacon signal and candidate positions. The embodiments of the present application do not make specific limitations on this.
[0140] In some embodiments, it can be obtained through Figure 2 the following steps S1041 to S1042 shown, the state probabilities of the candidate positions of the electronic device when the beacon signal is acquired this time. It can also be understood that the state probabilities of the candidate positions of the electronic device when the beacon signal is acquired for the i-th time are obtained through the following steps, where i = 1... N.
[0141] Step S1041: Obtain the device location when the electronic device last obtained the beacon signal, and obtain the first observation probability of the device location. It can also be understood as obtaining the device location when the electronic device obtained the beacon signal for the (i - 1)-th time, and obtaining the first observation probability of this device location.
[0142] The first observation probability of the device location can be understood as the probability of this device location among all the candidate locations when the electronic device last (i.e., for the (i - 1)-th time) obtained the beacon signal. For each obtained beacon signal, the probabilities of each candidate location when the electronic device obtains the beacon signal are equal. It can also be understood as the probabilities of all candidate locations when the electronic device obtains the beacon signal for the i-th time are the same, where i = 1…N. For example, if there are 2 candidate locations when the electronic device last obtained the beacon signal and the probabilities of these 2 candidate locations are equal, then the probability of the device location selected from these 2 candidate locations is 0.5.
[0143] Step S1042: For each candidate location, obtain the second observation probability and the state transition probability of each candidate location. According to the first observation probability and the second observation probability and the state transition probability of each candidate location, obtain the state probability of each candidate location. Among them, the state transition probability of each candidate location is the probability that the electronic device transfers from the device location when it last (i.e., for the (i - 1)-th time) obtained the beacon signal to each candidate location.
[0144] The second observation probability of the candidate location can be understood as the probability of this candidate location among all the candidate locations when the electronic device obtains the beacon signal this time (i.e., for the i-th time). The meaning of the second observation probability is similar to that of the first observation probability and will not be elaborated here.
[0145] In the embodiments of the present invention, a conventional method for obtaining the state transition probability in the technical field of hidden Markov models can be used to obtain the above state transition probability, and this embodiment does not make specific limitations on this. In addition, a conventional method for obtaining the state probability in the technical field of hidden Markov models can also be used to obtain the above state probability. For example, obtain the product of the first observation probability, the second observation probability, and the state transition probability, and use this product as the state probability of the candidate location.
[0146] Based on the method described in the above Step S1041 to Step S1042, the relevant information (such as the first observation probability, the state transition probability) of the device location when the electronic device last (i.e., for the (i - 1)-th time) obtained the beacon signal can be used to accurately obtain the state probability of the candidate location when the electronic device obtains the beacon signal this time (i.e., for the i-th time).
[0147] Step S105: According to the state probabilities of each candidate location, select a candidate location as the device location when the electronic device obtains the beacon signal this time (i.e., for the i-th time).
[0148] Since the state probability can represent the credibility of the candidate location being the device location, the candidate locations can be screened according to the state probability, and one can be selected as the device location. For example, in some embodiments, the candidate location with the maximum state probability can be used as the device location.
[0149] In this embodiment, if the beacon signal obtained this time (i.e., the i-th time) is the first time (i.e., i = 1) to obtain, all candidate locations of the electronic device when obtaining the beacon signal this time (i.e., the i-th time) are used as the device location of the electronic device when obtaining the beacon signal this time (i.e., the i-th time), or one can also be randomly selected from the candidate locations when obtaining the beacon signal this time (i.e., the i-th time) as the device location.
[0150] Step S106: Use the candidate location as the device location of the electronic device when obtaining the beacon signal this time (i.e., the i-th time). Since there is only one candidate location, this candidate location is directly used as the device location without further screening.
[0151] Based on the method described in the above steps S101 to S106, the device location of the electronic device can be obtained by using the positions of beacons within a preset range around the electronic device. In this way, even if the electronic device cannot receive signals from positioning systems such as GPS, it can be accurately and reliably positioned. In addition, when multiple candidate locations are obtained by using the beacon signal obtained at a certain time (i.e., i takes any value from 1 to N), one can be accurately selected from the multiple candidate locations as the device location of the electronic device through the hidden Markov model, ensuring the reliability and accuracy of the positioning. The hidden Markov model is actually a probability model about time series, which can fully exploit the probability of time series information. In the embodiment of the present application, the device locations of the electronic device when obtaining the beacon signal at the i-th time and the (i - 1)-th time can be understood as a set of time series information. In this set of time series information, the information with an earlier time arrangement is the device location of the electronic device when obtaining the beacon signal at the i-th time, and the information with a later time arrangement is the device location of the electronic device when obtaining the beacon signal at the (i - 1)-th time. When there are multiple candidate locations of the electronic device when obtaining the beacon signal at the i-th time, since the hidden Markov model can fully exploit the probability of time series information, the state probability of each candidate location can be accurately predicted through the hidden Markov model. This state probability represents the credibility of the candidate location being the device location. In this way, which candidate location is the device location can be accurately determined by using the state probability of each candidate location.
[0152] The following further describes steps S102 and S105 above.
[0153] 1. Description of step S102.
[0154] In some embodiments of the above step S102, it can be obtained by Figure 3 the following steps S1021 to S1024 as shown, the candidate position of the electronic device when obtaining the beacon signal this time. It can also be understood that the candidate position of the electronic device when obtaining the beacon signal for the i-th time is obtained through the following steps, where i = 1...N.
[0155] Step S1021: Obtain the strength (Received Signal Strength Indication) of the beacon signal obtained this time (i.e., the i-th time). When the electronic device communicates with the beacon via Bluetooth, the strength of the beacon signal is the strength of the Bluetooth signal; when the electronic device communicates with the beacon via WIFI, the strength of the beacon signal is the strength of the WIFI signal. In this embodiment, a conventional signal strength acquisition method can be used to obtain the strength of the beacon signal, and this embodiment does not make specific limitations on this.
[0156] Step S1022: According to the strength, obtain the distance from the electronic device to the beacon that outputs the beacon signal. Specifically, this distance can be shown as the following formula (1).
[0157] d = 10 (|RSSI|-A) / (10*n) (1)
[0158] The meanings of the parameters in formula (1) are: d represents the distance from the electronic device to the beacon that outputs the beacon signal, RSSI represents the strength of the beacon signal, A represents the strength when the above distance is 1 meter, and n represents the preset environmental attenuation factor.
[0159] Step S1023: According to the above distance and the beacon position in the beacon signal, obtain the position range of the electronic device.
[0160] Taking the beacon position as the starting point, all positions with a distance of the above distance from this starting point may be the candidate positions of the electronic device. Therefore, the position range formed by all positions with a distance of the above distance from this starting point can be used as the position range of the electronic device.
[0161] Step S1024: According to the position range, obtain the candidate position of the electronic device.
[0162] After obtaining the position range of the electronic device, one or more positions can be selected from the position range as the candidate positions of the electronic device.
[0163] Based on the method described in the above steps S1021 to S1024, the position range of the electronic device can be accurately obtained by using the strength of the beacon signal and the beacon position in the beacon signal, and then the candidate position of the electronic device can be accurately and conveniently obtained.
[0164] The above steps S1023 and S1024 will be further described below.
[0165] In some embodiments of the above step S1023, a circular area can be obtained with the above distance as the radius and the beacon position as the center, and then the position range of the electronic device can be obtained according to the boundary of the circular area. For example, the boundary of the circular area can be directly used as the position range of the electronic device, or the boundary of the circular area can be increased or decreased, and the increased or decreased boundary can be used as the position range of the electronic device. Through this embodiment, the position range of the electronic device can be expanded as much as possible, so as to select candidate positions as accurately as possible.
[0166] In some embodiments of the above step S1024, there may be one beacon, two beacons, or even at least three beacons within the preset range around the electronic device. For these three cases, different methods can be used respectively to obtain the candidate positions of the electronic device.
[0167] 1. The beacon signal obtained this time is the beacon signal of one beacon
[0168] In this case, the position range of the electronic device obtained by using the beacon signal of this beacon can be obtained, and multiple positions can be evenly selected from this position range as the candidate positions of the electronic device, and the distance between every two adjacent positions is equal. For example, as Figure 4 shown, when the position range is the boundary of the above circular area, 6 positions can be evenly selected from this boundary as candidate positions, namely positions A to F. Through this embodiment, the candidate positions of the electronic device can be obtained as accurately as possible when there is one beacon signal.
[0169] 2. The beacon signal obtained this time includes the beacon signals of two beacons
[0170] In this case, two position ranges of the electronic device obtained by using the beacon signals of these two beacons can be obtained, and the intersection position of these two position ranges can be obtained, and then the intersection position can be used as the candidate position of the electronic device. The intersection position is shared by the two position ranges, and the credibility of the electronic device being at this position is also relatively high. Therefore, the intersection position can be directly used as the candidate position of the electronic device. For example, as Figure 5 shown, when the position range is the boundary of the above circular area, the boundaries of the two circular areas intersect at positions G and H, and positions G and H are used as the candidate positions of the electronic device. Through this embodiment, the candidate positions of the electronic device can be obtained as accurately as possible when there are two beacon signals.
[0171] 3. The beacon signal obtained this time includes the beacon signals of at least three beacons
[0172] In this case, at least three position ranges of the electronic device obtained from beacon signals using at least three beacons can be acquired. The above-mentioned at least three position ranges can form an intersection position, and this intersection position can accurately represent the position of the electronic device. Therefore, this intersection position can be used as the candidate position of the electronic device. In addition, since there is only one candidate position, this candidate position will also become the device position of the electronic device. For example, as Figure 6 shown, when the position range is the boundary of the above circular area, the boundaries of three circular areas intersect at position I, and position I is used as the candidate position of the electronic device.
[0173] In practical applications, due to problems such as signal instability or ranging errors, the above-mentioned at least three position ranges may form multiple intersection positions or may not form intersection positions. In this regard, a three-point positioning method can be used to obtain the candidate position. Specifically, the reference position between every two adjacent position ranges of the electronic device can be acquired, and then all the reference positions are connected to form a closed figure, and the centroid position of this closed figure is acquired as the candidate position of the electronic device. In addition, since there is only one candidate position, this candidate position will also become the device position of the electronic device.
[0174] The method for obtaining the reference position will be described below.
[0175] If two adjacent position ranges form an intersection position, then this intersection position is used as the reference position. Refer to the appendix Figure 7 , there are three circular position ranges A, B, and C. A and B are adjacent, B and C are adjacent, and A and C are adjacent. Taking A and C as an example, these two position ranges form an intersection position E, and the intersection position E is used as the target position of the electronic device between A and C.
[0176] If two adjacent position ranges form two intersection positions, then the intersection position closer to other position ranges is selected as the reference position. Refer to the appendix again Figure 7 , B and C form two intersection positions G and H. G is closer to another position range A. Therefore, the intersection position G is used as the target position of the electronic device between B and C.
[0177] If two adjacent position ranges cannot form an intersection position, then the connection line of the center points of these two position ranges is acquired, then the intersection points of this connection line with these two position ranges are acquired respectively, and finally the midpoint position on this connection line between the two intersection points is acquired as the reference position. Refer to the appendix again Figure 7 , no intersection position can be formed between A and B. The connection line of the centers of these two position ranges is acquired, then the intersection points of these two connection lines with A and B are acquired respectively, and finally the midpoint position F on this connection line between the two intersection points is acquired as the target position. The above reference positions E, G, and F form a closed figure, that isFigure 7 For the triangle in , obtain the centroid position D of this triangle as the candidate position of the electronic device, and this candidate position is also the device position of the electronic device.
[0178] Through the above embodiments, when there are at least three beacon signals, the candidate position of the electronic device can be obtained as accurately as possible.
[0179] Second, describe step S105.
[0180] In some embodiments of the above step S105, it can be through Figure 8 The following steps S1051 to S1053 shown, select a candidate position as the device position of the electronic device when obtaining beacon signals this time. It can also be understood that, through the following steps, select a candidate position as the device position of the electronic device when obtaining beacon signals for the i-th time, where i = 1...N.
[0181] Step S1051: Obtain the device positions of the electronic device each time when obtaining beacon signals before the previous time (i.e., the (i - 1)-th time), and obtain the state probability of each device position. It can also be understood as obtaining the device positions of the electronic device when obtaining beacon signals for the (i - 1)-th time, the (i - 2)-th time until the 1st time (i.e., i = 1).
[0182] The method for obtaining the state probability of the device position is similar to the method described in the foregoing steps S1041 to S1042, and will not be elaborated here.
[0183] Step S1052: Obtain the state probabilities of each candidate position of the electronic device when obtaining beacon signals this time (i.e., the i-th time). The method for obtaining the state probability of the candidate position is the same as the method described in the foregoing steps S1041 to S1042, and will not be elaborated here.
[0184] Step S1053: Use the Viterbi algorithm to select a candidate position as the device position of the electronic device when obtaining beacon signals this time according to the state probability of each device position and the state probabilities of each candidate position.
[0185] In this embodiment, a conventional Viterbi algorithm can be used. According to the state probability of each device position and the state probabilities of each candidate position, select an optimal candidate position as the device position from all candidate positions of the electronic device when obtaining beacon signals this time (i.e., the i-th time). This optimal candidate position may be the one with the largest state probability, or may not be the one with the largest state probability, but the path formed by this optimal candidate position and all previous device positions is the shortest, and this path can also be called the Viterbi path.
[0186] Based on the method described in the above steps S1051 to S1053, candidate positions that can form the shortest path can be selected as the device position, minimizing the moving distance of the electronic device as much as possible. If navigation is performed using the device position, it helps to quickly find the navigation target.
[0187] Next, an embodiment of the navigation method provided in this application will be described.
[0188] Refer to the attached Figure 9 , Figure 9 which is a schematic flowchart of the main steps of a positioning method according to an embodiment of this application. This method is applied to an electronic device. As Figure 9 shown, the positioning method in the embodiment of this application mainly includes the following steps S201 to S203.
[0189] Step S201: Obtain the position of the intelligent device.
[0190] The position of the intelligent device is the navigation target. Before the user leaves the intelligent device, the electronic device can pre-obtain the position of the intelligent device. The obtaining method is similar to the relevant methods in the foregoing embodiment of the positioning method and will not be elaborated here. For example, for a driving device, an inertial navigation algorithm can be used to determine the position where the driving device is located. Another example is that position information can be marked on the parking space. When the driving device parks in the parking space, it can identify the position information marked on the parking space through OCR technology and use this position information as the position of the driving device. When the electronic device requests to obtain the position, this position is sent to the electronic device.
[0191] Step S202: Use the positioning method to obtain the device position of the electronic device each time when the beacon signal is obtained during multiple acquisitions of the beacon signal. It can also be understood as obtaining the device position of the electronic device when the beacon signal is obtained for the i-th time, where i = 1...N, and N is a positive integer greater than 1.
[0192] The positioning method can be the method described in the foregoing embodiment of the positioning method.
[0193] Step S203: For the device position when the beacon signal is obtained each time, generate and output a first direction guidance according to the device position and the position of the intelligent device. It can also be understood as generating and outputting a first direction guidance for the device position when the beacon signal is obtained for the i-th time according to the device position and the position of the intelligent device, where i = 1...N.
[0194] The first direction guidance is used to indicate the direction from the electronic device to the intelligent device. Under the guidance of this direction, the user can accurately move to near the intelligent device and find the intelligent device.
[0195] In this embodiment, the presentation form of the first direction guidance is not specifically limited, as long as it can clearly indicate the direction from the electronic device to the intelligent device. For example, the first direction guidance can be an arrow pointing to the intelligent device.
[0196] Based on the method described in the above steps S201 to S203, the first direction guidance can be used to accurately and reliably guide the user to move or approach the intelligent device, which helps the user quickly find the intelligent device.
[0197] According to the description of step S105 in the foregoing embodiment of the positioning method, if the beacon signal obtained this time (i.e., the i-th time) is the first time (i.e., i = 1) to obtain, then all candidate positions of the electronic device when obtaining the beacon signal this time (i.e., the i-th time) can be used as the device position of the electronic device when obtaining the beacon signal this time (i.e., the i-th time). That is to say, there will be multiple device positions at this time. For this situation, in some embodiments, before performing step S203, it can be first determined whether the device position when obtaining the beacon signal this time (i.e., the i-th time) is multiple. If it is multiple, then perform the following step S205, otherwise continue to perform step S203.
[0198] Step S205: Obtain the beacon signal obtained this time (i.e., the i-th time), and obtain the beacon position in the beacon signal; generate and output a second direction guidance according to the beacon position and the position of the intelligent device, where the second direction guidance is used to indicate the direction from the beacon to the intelligent device. Through this embodiment, when the device position of the electronic device is multiple, the beacon can be used as a reference for navigation to guide the user to move from the beacon position to the intelligent device.
[0199] The following combines the attached Figure 10 to the attached Figure 14 and takes the electronic device as a mobile phone and the intelligent device as a vehicle as an example to briefly describe the positioning method and navigation method provided by this application.
[0200] Refer to the attached Figure 10 After the user parks the vehicle in the underground parking lot, the mobile phone obtains and stores the position of the vehicle so that the direction guidance can be generated according to the position of the vehicle during navigation. There are also other vehicles parked in the underground parking lot, and some charging piles are also set. These other vehicles and charging piles are used as beacons to locate the user's mobile phone. Figure 10 Each triangle in Figure 10 represents a beacon respectively. The user starts navigation from the Figure 10 initial position, and the navigation destination is the vehicle parking position. The line between the initial position and the vehicle parking position in Figure 11 to the attached Figure 14 represents the navigation path. The following combines the attached
[0201] Refer to the appendix Figure 11 , when the mobile phone obtains the signal of the beacon within its preset range for the first time (i.e., i = 1), it only obtains the signal of one beacon, and determines the position range of the mobile phone according to the beacon position in the signal. This position range is the boundary of the circular area with the beacon position as the center and the distance from the mobile phone to the beacon as the radius, that is Figure 11 the dashed circle in. At this time, 6 positions can be evenly selected from the boundary of the circular area as candidate positions. Since this is the first time (i.e., i = 1) to obtain the beacon signal, these 6 candidate positions can be directly used as the device positions of the mobile phone. According to the method described in step S205 above, when there are multiple device positions, the second direction guidance can be generated and output according to the beacon position and the vehicle parking position to indicate the direction from the beacon to the vehicle parking position, that is Figure 11 the arrow in.
[0202] Refer to the appendix Figure 12 , after the user walks a certain distance or for a certain period of time according to the second direction guidance in Figure 11 , the mobile phone obtains the signal of the beacon within its preset range for the second time (i.e., i = 2), and also obtains the signals of two beacons. The two position ranges of the mobile phone are respectively determined according to the beacon positions in the two beacon signals. Similar to Figure 11 , these two position ranges are also the boundaries of the circular area, that is Figure 12 the dashed circles in. There are two intersection positions for these two position ranges. These two intersection positions are used as the candidate positions of the mobile phone. Then, through the method described in steps S104 to S105 in the foregoing positioning method embodiment, one is selected from the two candidate positions as the device position of the mobile phone. Finally, the first direction guidance is generated and output according to this device position and the vehicle parking position to indicate the direction from the mobile phone to the vehicle parking position, that is Figure 12 the arrow in.
[0203] Next, the method of selecting one from the two candidate positions as the device position of the mobile phone through the method described in steps S104 to S105 in the foregoing positioning method embodiment is briefly described again.
[0204] Specifically, the largest state probability can be obtained through the following formula (2), and the candidate position corresponding to this state probability is used as the device position.
[0205]
[0206] The meanings of the parameters in formula (2) are: p ijis the maximum state probability; i represents the number of times the mobile phone obtains the beacon signal, i = 1, 2, where i = 1 represents the first time the mobile phone obtains the beacon signal, and i = 2 represents the second time the mobile phone obtains the beacon signal; n represents the serial number of the device position when the mobile phone obtains the beacon signal for the first time, n = 1, 2, 3, 4, 5, 6; p i-1,n represents the first observation probability of the nth device position when the mobile phone obtains the beacon signal for the (i - 1)th time, p nj represents the probability that the mobile phone transfers from the nth device position when obtaining the beacon signal for the (i - 1)th time to the jth device position when obtaining the beacon signal for the ith time, p j represents the second observation probability of the jth device position when the mobile phone obtains the beacon signal for the ith time, p i-1,n p nj p j represents the state probability of the jth device position when the mobile phone obtains the beacon signal for the ith time.
[0207] Refer to Appendix Figure 13 , after the user walks a certain distance or for a certain period of time according to the first direction guidance in Figure 12 , the mobile phone obtains the signals of beacons within its preset range for the third time (i.e., i = 3), and also obtains the signals of two beacons for the third time (i.e., i = 3). The subsequent process is similar to that of Figure 12 , and finally, the first direction guidance will also be generated and output according to the device position of the mobile phone and the vehicle parking position to indicate the direction from the mobile phone to the vehicle parking position, that is, Figure 13 the arrow in Figure 13 . The process of Appendix
[0208] will not be elaborated here. Figure 14 Refer to Appendix Figure 13 , after the user walks a certain distance or for a certain period of time according to the first direction guidance in Figure 11 , the mobile phone obtains the signals of beacons within its preset range for the fourth time (i.e., i = 4), and only obtains the signals of one beacon for the fourth time (i.e., i = 4). Similar to the process of Appendix Figure 14 , six positions can be evenly selected from the boundary of the circular area as candidate positions. Then, through the method described in steps S104 to S105 in the foregoing positioning method embodiments, one is selected from the six candidate positions as the device position of the mobile phone. Finally, the first direction guidance is generated and output according to this device position and the vehicle parking position to indicate the direction from the mobile phone to the vehicle parking position, that is, Figure 14 the arrow in
[0209] Through the above embodiments, even if the mobile phone cannot receive signals from positioning systems such as GPS in an underground parking lot, it is still possible to accurately and reliably perform positioning and navigation and quickly find the vehicle.
[0210] It should be noted that although the steps are described in a specific order in the above embodiments, those skilled in the art can understand that, in order to achieve the effects of this application, it is not necessary to execute different steps in such an order. They can be executed simultaneously (in parallel) or in other orders. These adjusted solutions are equivalent technical solutions to the technical solutions described in this application, and therefore will also fall within the protection scope of this application.
[0211] Those skilled in the art can understand that all or part of the processes in the method of implementing the above embodiments of this application can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable storage medium can include: any entity or device, medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory, random access memory, electrical carrier signal, telecommunication signal, and software distribution medium that can carry the computer program code. It should be noted that the content included in the computer-readable storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable storage medium does not include electrical carrier signals and telecommunication signals.
[0212] Another aspect of this application also provides a computer-readable storage medium.
[0213] In an embodiment of a computer-readable storage medium according to this application, the computer-readable storage medium can be configured to store a program for executing the positioning or navigation method in the above method embodiments. This program can be loaded and run by a processor to implement the above positioning or navigation method. For the sake of convenience of description, only the parts related to the embodiments of this application are shown. For the specific technical details not disclosed, please refer to the method part of the embodiments of this application. The computer-readable storage medium can be a storage device formed by various electronic devices. Optionally, the computer-readable storage medium in the embodiments of this application is a non-transitory computer-readable storage medium.
[0214] Another aspect of this application also provides an electronic device.
[0215] In an embodiment of an electronic device according to the present application, the electronic device may include at least one processor; and a memory communicatively connected to the at least one processor; wherein, a computer program is stored in the memory, and when the computer program is executed by the at least one processor, the method described in any of the above embodiments is implemented. Refer to the appended Figure 15 , Figure 15 It is exemplarily shown in the figure that the memory 11 and the processor 12 are communicatively connected via a bus.
[0216] So far, the technical solution of the present application has been described in conjunction with an embodiment shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present application is obviously not limited to these specific embodiments. Without departing from the principle of the present application, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will all fall within the protection scope of the present application.
Claims
1. A positioning method, characterized in that, Applied to an electronic device, the method includes: In response to a user's operation, obtaining beacon signals multiple times, where the beacon signals are signals of beacons within a preset range around the electronic device, and the beacon signals include beacon positions; For each obtained beacon signal, obtaining a candidate position of the electronic device when the beacon signal is obtained this time according to the beacon position; If there are multiple candidate positions, using the beacon signal as the observation information of the hidden Markov model and the candidate positions as the state information of the hidden Markov model, obtaining the state probabilities of the candidate positions through the hidden Markov model; According to the state probabilities of the candidate positions, selecting one of the candidate positions as the device position of the electronic device when the beacon signal is obtained this time.
2. The method according to claim 1, characterized in that The obtaining the state probabilities of the candidate positions through the hidden Markov model includes: Obtaining the device position of the electronic device when the beacon signal was obtained last time, and obtaining the first observation probability of the device position; For each candidate position of the electronic device when the beacon signal is obtained this time, obtaining the second observation probability and the state transition probability of each candidate position, and obtaining the state probabilities of the candidate positions according to the first observation probability and the second observation probability and the state transition probability of each candidate position; Wherein, the state transition probability of each candidate position is the probability that the electronic device transfers from the device position when the beacon signal was obtained last time to each candidate position.
3. The method according to claim 1, characterized in that, The selecting one candidate position as the device position of the electronic device when the beacon signal is obtained this time includes: Obtaining the device positions of the electronic device when the beacon signal was obtained each time before the last time, and obtaining the state probability of each device position; Obtaining the state probabilities of the candidate positions of the electronic device when the beacon signal is obtained this time; Using the Viterbi algorithm, according to the state probabilities of each device position and the state probabilities of the candidate positions, selecting one candidate position as the device position of the electronic device when the beacon signal is obtained this time.
4. The method according to claim 1, wherein The method further includes: If there is one candidate position of the electronic device when the beacon signal is obtained this time, using the candidate position as the device position of the electronic device when the beacon signal is obtained this time.
5. The method according to claim 1, characterized in that, Before obtaining the state probabilities of the candidate positions through the hidden Markov model, the method further includes: If this obtaining of the beacon signal is the first obtaining, using all the candidate positions of the electronic device when the beacon signal is obtained this time as the device position of the electronic device when the beacon signal is obtained this time; or, If this obtaining of the beacon signal is the first obtaining, randomly selecting one from all the candidate positions as the device position of the electronic device when the beacon signal is obtained this time.
6. The method according to any one of claims 1 to 5, characterized in that, The obtaining the candidate position of the electronic device when the beacon signal is obtained this time includes: Obtaining the intensity of the beacon signal obtained this time; According to the intensity, obtaining the distance from the electronic device to the beacon that outputs the beacon signal; According to the distance and the beacon position in the beacon signal, obtaining the position range of the electronic device; According to the position range, obtaining the candidate position of the electronic device.
7. The method according to claim 6, characterized in that, Obtaining a position range of the electronic device according to the distance and the beacon position in the beacon signal includes: Taking the distance as the radius and the beacon position as the center, obtaining a circular area; According to the boundary of the circular area, obtaining the position range of the electronic device.
8. The method according to claim 7, wherein Obtaining candidate positions of the electronic device according to the position range includes: If the beacon signal obtained this time is the beacon signal of one beacon, obtaining the position range of the electronic device obtained by using the beacon signal of this beacon; Uniformly selecting a plurality of positions from the position range as candidate positions of the electronic device.
9. The method according to claim 7, wherein Obtaining candidate positions of the electronic device according to the position range includes: If the beacon signal obtained this time includes the beacon signals of two beacons, obtaining two position ranges of the electronic device obtained by using the beacon signals of these two beacons, and obtaining the intersection position of these two position ranges; Taking the intersection position as the candidate position of the electronic device.
10. A navigation method, characterized in that, Applied to an electronic device, the method includes: Obtaining the position of the intelligent device; Adopting the positioning method according to any one of claims 1 to 9, obtaining the device position of the electronic device each time the beacon signal is obtained during multiple acquisitions of the beacon signal; For the device position each time the beacon signal is obtained, generating and outputting a first direction guide according to the device position and the position of the intelligent device; Wherein, the first direction guide is used to indicate the direction from the electronic device to the intelligent device.