Positioning scene recognition method and device, and electronic device
Patent Information
- Application Number
- CN202311646093.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-30
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2043-11-30
AI Technical Summary
[0003]目前所采用的识别定位场景的方式,成本较高,适用的场景具有局限性,难以广泛应用
[0015]本申请实施例公开的定位场景识别方法、装置、电子设备及存储介质,根据接收的卫星信号获取观测序列,该观测序列包括N组卫星特征信息,根据隐马尔科夫模型确定观测序列对应的状态序列,该状态序列包括与N组卫星特征信息一一对应的N个定位场景,再根据该状态序列确定电子设备所处的目标定位场景。在本申请实施例中,利用隐马尔科夫模型对观测序列中包含的N组卫星特征信息进行状态估计预测,得到状态序列,能够准确地识别电子设备所处的定位场景,且基于卫星特征信息进行场景识别,计算量更小;而且,隐马尔科夫模型是根据多组预设卫星特征信息与多个预设定位场景分别对应的隶属度构建的,不必进行大规模的数据采样,且无需外部设备辅助,不需要进行像位置指纹库等的后期维护,降低了成本,适用性更强。
Smart Images

Figure CN117630989B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of positioning technology, specifically to a positioning scene recognition method, device, and electronic device. Background Technology
[0002] To provide users with more accurate services, it is necessary to accurately identify the location scenario of the electronic device being used, such as indoor scenarios, outdoor scenarios, and transitional indoor-outdoor scenarios. Currently, the following methods are mainly used for location scenario identification: Method 1: Deploy positioning devices outdoors or indoors and use these devices to identify the location scenario of the electronic device; Method 2: Establish a location fingerprint database and use location fingerprints to perceive the surrounding environment information of the electronic device and identify the location scenario of the electronic device.
[0003] The current methods for identifying and locating scenarios are costly, have limited applicability, and are difficult to apply widely. Summary of the Invention
[0004] This application discloses a location scene recognition method, device, electronic device, and storage medium, which can accurately identify the location scene of the electronic device, with low computational load and reduced cost, and wider applicability.
[0005] This application discloses a location scene recognition method applied to an electronic device, the method comprising:
[0006] An observation sequence is obtained based on the received satellite signals, and the observation sequence includes N sets of satellite feature information; where N is a positive integer.
[0007] The state sequence corresponding to the observation sequence is determined according to the Hidden Markov Model. The state sequence includes N positioning scenarios that correspond one-to-one with the N sets of satellite feature information. The Hidden Markov Model is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios.
[0008] The target location scenario of the electronic device is determined based on the state sequence.
[0009] This application discloses a positioning scene recognition device, applied to an electronic device, the device comprising:
[0010] An observation sequence acquisition module is used to acquire an observation sequence based on received satellite signals. The observation sequence includes N sets of satellite feature information, where N is a positive integer.
[0011] The state sequence determination module is used to determine the state sequence corresponding to the observation sequence based on the hidden Markov model. The state sequence includes N positioning scenarios that correspond one-to-one with the N sets of satellite feature information. The hidden Markov model is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios.
[0012] The scene determination module is used to determine the target positioning scene of the electronic device based on the state sequence.
[0013] This application discloses an electronic device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the method described above.
[0014] This application discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor in an electronic device, causes the electronic device to implement the method described above.
[0015] The positioning scene recognition method, apparatus, electronic device, and storage medium disclosed in this application acquire an observation sequence based on received satellite signals. This observation sequence includes N sets of satellite feature information. A hidden Markov model is used to determine the state sequence corresponding to the observation sequence. This state sequence includes N positioning scenes that correspond one-to-one with the N sets of satellite feature information. The target positioning scene where the electronic device is located is then determined based on the state sequence. In this application embodiment, the state sequence is obtained by using a hidden Markov model to estimate and predict the state of the N sets of satellite feature information contained in the observation sequence. This can accurately identify the positioning scene where the electronic device is located. Moreover, scene recognition based on satellite feature information requires less computation. Furthermore, the hidden Markov model is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenes, eliminating the need for large-scale data sampling, external equipment assistance, and post-maintenance such as location fingerprint databases, thus reducing costs and increasing applicability. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is an application scenario diagram of the localization scene recognition method in one embodiment;
[0018] Figure 2This is a flowchart of a scene recognition method in one embodiment;
[0019] Figure 3 This is a probability diagram of a hidden Markov model in one embodiment;
[0020] Figure 4 A flowchart of a scene recognition method in another embodiment;
[0021] Figure 5 This is a flowchart for determining the target carrier-to-noise ratio corresponding to the current detection time in one embodiment;
[0022] Figure 6 A flowchart illustrating the construction of the emission probability matrix in a hidden Markov model in one embodiment;
[0023] Figure 7 This is a flowchart of a method for constructing a hidden Markov model in one embodiment;
[0024] Figure 8 This is a block diagram of a scene recognition device in one embodiment;
[0025] Figure 9 A block diagram of a hidden Markov model construction apparatus in one embodiment;
[0026] Figure 10 This is a structural block diagram of an electronic device in one embodiment. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0028] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0029] It is understood that the terms "first," "second," etc., used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first carrier-to-noise ratio may be referred to as a second carrier-to-noise ratio, and similarly, a second carrier-to-noise ratio may be referred to as a first carrier-to-noise ratio. Both the first carrier-to-noise ratio and the second carrier-to-noise ratio are carrier-to-noise ratios of satellite signals, but they are not the same carrier-to-noise ratio. The term "multiple" as used in this application refers to two or more. The term "and / or" as used in this application refers to one of the schemes, or any combination of multiple schemes.
[0030] Figure 1 This is an application scenario diagram of the scene recognition method in one embodiment. For example... Figure 1 As shown, the positioning scene recognition method provided in this embodiment can be applied to electronic device 110, which may include, but is not limited to, mobile phones, wearable devices (such as smart glasses, smartwatches, etc.), tablet computers, vehicle terminals, laptops, PCs (Personal Computers), etc. Electronic device 110 may include a positioning module, which can be used to receive satellite signals transmitted by one or more satellites 120 in a satellite system, and to locate the electronic device 110 based on the received satellite signals. Optionally, the satellite system may include, but is not limited to, GPS (Global Positioning System), GNSS (Global Navigation Satellite System), etc.
[0031] In some embodiments, the positioning algorithm used by the electronic device 110 may be an absolute positioning algorithm. The electronic device 110 receives satellite signals sent by multiple satellites 120 through the positioning module, calculates the distance between the electronic device 110 and each satellite 120 based on the received satellite signals sent by multiple satellites 120, and thus calculates the position information of the electronic device 110 to achieve positioning of the electronic device 110.
[0032] In some embodiments, the positioning algorithm used by the electronic device 110 may be a relative positioning algorithm. The electronic device 110 can establish a communication connection with the base station 130. The base station 130 can monitor multiple satellites 120 in the navigation satellite system, receive satellite signals transmitted by the multiple satellites 120, determine the positioning result of the base station 130 based on the received satellite signals, and send the positioning result to the electronic device. The electronic device 110 can also receive satellite signals transmitted by multiple satellites 120 through the positioning module, calculate the position information of the electronic device 110 based on the received satellite signals and the positioning result sent by the base station 130, and realize the positioning of the electronic device 110.
[0033] It should be noted that the positioning algorithm used by the electronic device 110 may also be other positioning algorithms, and this application embodiment does not limit this.
[0034] In this embodiment, the electronic device 110 can identify the target positioning scene it is in based on received satellite signals. The electronic device 110 can acquire an observation sequence based on the received satellite signals. This prediction sequence may include N sets of satellite feature information, where N can be a positive integer. The electronic device 110 can determine the state sequence corresponding to the observation sequence based on a Hidden Markov Model (HMM). This state sequence may include N positioning scenes corresponding one-to-one with the N sets of satellite feature information. The HMM can be constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenes. The electronic device 110 can determine the target positioning scene it is in based on the determined state sequence.
[0035] like Figure 2 As shown, in one embodiment, a location scene recognition method is provided. This method can be applied to the aforementioned electronic device and may include the following steps:
[0036] Step 210: Obtain the observation sequence based on the received satellite signals. The observation sequence includes N sets of satellite feature information. N is a positive integer.
[0037] In some embodiments, the positioning module in the electronic device can detect and receive satellite signals emitted by one or more satellites in a satellite system according to a preset detection frequency, and can generate satellite feature information corresponding to each detection time based on the satellite signals received at each detection time. The detection frequency can be set according to actual needs, for example, the detection frequency can be once per second, once every 10 seconds, once every 8 seconds, etc., and is not limited here.
[0038] Optionally, the detection frequency can be determined based on the usage scenario of the electronic device. This usage scenario can refer to the scenario where the electronic device is located and provides corresponding services. Different services will correspond to different usage scenarios. For example, if the usage scenario of the electronic device is a shopping mall scenario, and the detection frequency is once every 10 seconds or once every 8 seconds, it could be determined by identifying that the electronic device is inside the mall (i.e., an indoor scenario) and providing shopping guidance services. Another example is a smart home scenario, where the detection frequency is once every 1 second, and so on, based on identifying that the electronic device is at home (i.e., an indoor scenario) and providing smart home control services. Yet another example is a navigation scenario, where the detection frequency is once every 2 seconds, and so on, based on identifying that the electronic device is outdoors and providing navigation services. However, these are not limited to these scenarios.
[0039] Optionally, the detection frequency can also be set by the user, who can set the detection frequency according to their own needs.
[0040] The observation sequence includes N sets of satellite feature information, which correspond one-to-one with N detection times. The satellite feature information corresponding to the first detection time can be generated based on the satellite signal received at that first detection time, which can be any detection time. The satellite feature information can be used to characterize the characteristics of the satellite signal received at the corresponding detection time and / or the satellite transmitting the satellite signal. For example, the satellite feature information can be used to characterize the strength, quality, and other characteristics of the received satellite signal, and can also be used to characterize the satellite being blocked, etc.
[0041] In some embodiments, each set of satellite characteristic information may include one or more parameters such as target carrier-to-noise ratio (CNR), satellite elevation angle, and satellite azimuth angle. CNR is a standard measurement scale used to indicate the relationship between a carrier wave and carrier noise. Target CNR can be used to characterize the strength and quality of the satellite signal received at a corresponding detection time; a higher target CNR indicates a stronger and better quality satellite signal received at the corresponding detection time. Satellite elevation angle refers to the angle between the satellite and the horizon where the electronic device is located. It can be used to describe the position of the satellite passing above the electronic device at a certain detection time. For example, a satellite elevation angle of 90° indicates that the satellite is directly above the electronic device; a larger elevation angle indicates that the satellite is closer to the electronic device. Satellite azimuth angle refers to the azimuth angle of the satellite relative to the location of the electronic device. For example, the satellite azimuth angle can be the angle between the line connecting the electronic device to the satellite and true north. Satellite elevation angle and satellite azimuth angle can be used to characterize the degree of satellite obstruction at the corresponding detection time.
[0042] In some embodiments, the electronic device can acquire an observation sequence every N detection times. The observation sequence includes N sets of satellite feature information corresponding to the current N detection times. Based on the observation sequence, the target positioning scene where the electronic device is located can be determined. While accurately identifying the target positioning scene where the electronic device is located, the amount of computation can be reduced.
[0043] In other embodiments, the electronic device may also acquire an observation sequence according to a preset detection frequency. That is, after generating satellite feature information based on the received satellite signals at each detection moment, an observation sequence can be acquired. This observation sequence may include the satellite feature information corresponding to the current detection moment, as well as the satellite feature information corresponding to the N-1 detection moments prior to the current detection moment. The target positioning scene in which the electronic device is located is determined based on this observation sequence. A higher frequency of identifying the target positioning scene in which the electronic device is located allows for more accurate identification of the target positioning scene.
[0044] It should be noted that N can be set according to actual needs. For example, N can be 10, 15, 17, etc., but it is not limited to this. The larger N is, the more accurate the recognition result will be, but the computational load will also be higher. You can choose an appropriate N according to actual needs.
[0045] In this embodiment, satellite feature information can be used as the observation value for location scene recognition, without involving sensors such as IMU (Inertial Measurement Unit). Therefore, during the detection process, users do not need to use electronic devices in a specific posture / mode, which improves the convenience of location scene recognition.
[0046] Step 220: Determine the state sequence corresponding to the observation sequence based on the hidden Markov model. The state sequence includes N positioning scenarios that correspond one-to-one with N sets of satellite feature information.
[0047] Hidden Markov Models (HMMs) can be used to describe a Markov process with hidden unknown parameters. A Markov process is a discrete stochastic process that possesses the Markov property, where the transition of each state in a Markov process depends only on one or more previous states. Satellite feature information is closely related to the positioning scenario; different positioning scenarios correspond to different satellite feature information, and there is a probabilistic relationship between satellite feature information and the positioning scenario. Therefore, satellite feature information is used as the observable state in the HMM, and the positioning scenario is used as the hidden state to construct an HMM for identifying the target positioning scenario of an electronic device.
[0048] Multiple sets of preset satellite feature information and multiple preset positioning scenarios can be pre-set. Each set of preset satellite feature information contains different specific values. The multiple preset positioning scenarios may include, but are not limited to, indoor scenarios, outdoor scenarios, indoor-to-outdoor scenarios, and outdoor-to-indoor scenarios. A Hidden Markov Model is constructed based on the multiple sets of preset satellite feature information and multiple preset positioning scenarios to identify the target positioning scenario in which the electronic device is located.
[0049] In one implementation, the preset satellite characteristic information may include a preset carrier-to-noise ratio (CNR). The range of values for the preset CNR can be determined; for example, the range can be defined as 15 dB·Hz to 45 dB·Hz (decibels·hertz). Multiple preset CNRs can be selected from this range according to a preset step size to obtain a set of observations. For example, if the preset step size is 0.5 dB·Hz, then 61 preset CNRs can be set, and the resulting set of observations may include 61 preset CNRs.
[0050] O={O1(CN0≤15), O2(CN0=15.5), O3(CN0=16),…,O 60 (CN0=44.5), O 61 (CN0≥45);
[0051] Where O represents the set of observations, CN0 represents the carrier-to-noise ratio (CNR), O1 (CN0≤15) represents the first group with a preset CNR of less than or equal to 15 dB·Hz, O2 (CN0=15.5) represents the second group with a preset CNR of 15.5, and so on. It should be noted that the preset satellite feature information may also include other information besides the preset CNR, such as preset satellite elevation angle and preset satellite azimuth angle. Therefore, the resulting set of observations may include multiple sets of preset satellite feature information, and each set may contain different information.
[0052] In some embodiments, a Hidden Markov Model (HMM) may include three important parameters: an initial state probability vector, a state transition probability matrix, and an emission probability matrix. The HMM can be represented as:
[0053] λ = (A, B, π);
[0054] Where π represents the initial state probability vector, A represents the state transition probability matrix, and B represents the transmission probability matrix. The initial state probability vector π can be used to characterize the probability that the satellite feature information corresponding to the first detection time in the observation sequence belongs to each preset positioning scenario. The state transition probability matrix A can be used to indicate the scenario transition probability of multiple preset positioning scenarios. The state transition probability matrix A can include P*P elements, where P is the number of preset positioning scenarios, and element a ijThe transmission probability matrix represents the probability that a device is in the i-th preset positioning scenario at detection time t and transitions to the j-th preset positioning scenario at detection time t+1. The transmission probability matrix indicates the probability of each set of preset satellite feature information occurring in each preset positioning scenario, i.e., the probability of generating each set of preset satellite feature information in each preset positioning scenario. The transmission probability matrix can also be called the observation probability matrix. The transmission probability matrix may contain Q*P elements, where Q is the number of sets of preset satellite feature information. It can represent the probability of the x-th set of preset satellite feature information occurring in the j-th preset positioning scenario.
[0055] In some embodiments, the state transition probability matrix can be determined based on the detection frequency of the detected satellite feature information. When the detection frequency is high, the probability of the electronic device switching between different preset positioning scenarios at two adjacent detection times is low. For example, if the detection frequency is once every second, the probability of the electronic device switching between different preset positioning scenarios within one second is low. Therefore, the elements in the state transition probability matrix that characterize the probability of state transition between different preset positioning scenarios can be set to lower values, while the elements that characterize the probability of state transition within the same preset positioning scenario can be set to higher values. For example, taking a detection frequency of once every second and preset positioning scenarios including indoor and outdoor scenarios as an example, the state transition probability matrix can be as follows:
[0056]
[0057] Wherein, the element a in the state transition probability matrix A 11 =0.9, indicating that the probability of being in an indoor scene at the next detection time is 0.9 if the scene was indoors at the previous detection time; element a 12 =0.1, indicating that the probability of being in an indoor scene at the previous detection time and in an outdoor scene at the next detection time is 0.1; element a 21 =0.1, indicating that the probability of being in an outdoor scene at the previous detection time and in an indoor scene at the next detection time is 0.1; element a 22 =0.9 means that if the person was in an outdoor scene at the previous detection time, the probability of being in an outdoor scene at the next detection time is 0.9.
[0058] When the detection frequency is low, the electronic device is more likely to switch between different preset positioning scenarios at two adjacent detection times. For example, if the detection frequency is once every 10 seconds, the probability of the electronic device switching between different preset positioning scenarios within 10 seconds is high. Therefore, the value of the element in the state transition probability matrix that represents the probability of state transition between different preset positioning scenarios can be increased, while the value of the element that represents the probability of state transition within the same preset positioning scenario can be decreased. For example, taking a detection frequency of once every 10 seconds and preset positioning scenarios including indoor and outdoor scenarios as an example, the state transition probability matrix can be as follows:
[0059]
[0060] Wherein, the element a in the state transition probability matrix A 11 =0.6, indicating that the probability of being in an indoor scene at the next detection time is 0.6 if the scene was indoors at the previous detection time; element a 12 =0.4, indicating that the probability of being in an indoor scene at the previous detection time and in an outdoor scene at the next detection time is 0.4; element a 21 =0.4, indicating that the probability of being in an outdoor scene at the previous detection time and in an indoor scene at the next detection time is 0.4; element a 22 =0.6, which means that if the scene was outdoors at the previous detection time, the probability of being outdoors at the next detection time is 0.6.
[0061] The state transition probability matrix of the Hidden Markov Model can be dynamically adjusted according to the detection frequency of satellite feature information, making the state transition probability matrix more accurate and thus improving the accuracy of the Hidden Markov Model.
[0062] For example, Figure 3 This is a probability diagram of a hidden Markov model in one embodiment. For example... Figure 3 As shown, taking a preset positioning scene including indoor and outdoor scenes as an example, where S0 represents the indoor scene, S1 represents the outdoor scene, and the observation sequence is a sequence related to time t, the observation sequence may include {O t1 O t2 O t3 O t4 ,…}, where O t1 O represents the satellite feature information corresponding to the t1th detection time. t2 This represents the satellite feature information corresponding to the t2th detection time, ..., and so on. The transition between indoor scene S0 and outdoor scene S1 is a Markov transition process. This indicates that the detection time t1 is in indoor scene S0. This indicates that the detection time t1 is in outdoor scene S1. This indicates that the second detection time is within the indoor scene S0. This indicates that the second detection time is in the outdoor scene S1, ..., and so on. This represents the transmission probability of the satellite feature information corresponding to the t1-th detection time and the indoor scene S0, that is, at the t1-th detection time, the indoor scene S0 contains satellite feature information O. t1 The probability, This represents the satellite feature information corresponding to the t1th detection time and the transmission probability corresponding to the outdoor scene S1, that is, at the t1th detection time, the outdoor scene S1 contains satellite feature information O. t1 The probability, This represents the satellite feature information corresponding to the t2th detection time and the emission probability corresponding to the indoor scene S0. Let t2 represent the satellite feature information corresponding to the detection time t2 and the transmission probability corresponding to the outdoor scene S1, ..., and so on.
[0063] In related technologies, when constructing a Hidden Markov Model (HMM) for identifying the target positioning scenario of an electronic device, it is necessary to collect a large amount of satellite feature information in multiple preset positioning scenarios, and to statistically analyze the large amount of satellite feature information collected in each preset positioning scenario to construct an HMM. For example, taking a preset positioning scenario that includes indoor and outdoor scenarios, and satellite feature information that includes carrier-to-noise ratio (CNR), it is necessary to detect a large amount of satellite signal CNR in both indoor and outdoor scenarios, and to statistically analyze the number of detections (i.e., the number of times detected) corresponding to each set of preset CNR in indoor and outdoor scenarios. Based on the number of detections corresponding to each set of preset CNR in indoor and outdoor scenarios, a transmission probability matrix is constructed, thereby constructing an HMM. For example, the transmission probability matrix can be constructed using formula (1):
[0064]
[0065] Among them, S j O represents the j-th preset positioning scene. x Represents the preset carrier-to-noise ratio of the x-th group, num(O x ) represents the number of detections in the j-th preset localization scene with the x-th preset carrier-to-noise ratio. This method of constructing a Hidden Markov Model requires the collection of a large amount of data, making it difficult and costly to implement.
[0066] In this embodiment, the Hidden Markov Model (HMM) can be constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios. Membership degree is a concept in fuzzy evaluation functions, and it can be used to characterize the degree to which preset satellite feature information belongs to the corresponding preset positioning scenario. Taking the first preset satellite feature information and the first preset positioning scenario as an example, where the first preset satellite feature information is any set of preset satellite feature information and the first preset positioning scenario is any preset positioning scenario, the membership degree between the first preset satellite feature information and the first preset positioning scenario can be used to characterize the degree to which the first preset satellite feature information belongs to the first preset positioning scenario. A higher membership degree indicates a higher degree to which the first preset satellite feature information belongs to the first preset positioning scenario, and a lower membership degree indicates a lower degree to which the first preset satellite feature information belongs to the first preset positioning scenario.
[0067] In some embodiments, membership functions corresponding to each preset positioning scenario can be constructed based on historical measurement experience. These membership functions can be used to calculate the membership degree of each set of preset satellite feature information relative to the corresponding preset positioning scenario. For example, multiple preset positioning scenarios include indoor and outdoor scenarios. Based on historical measurement experience, when the carrier-to-noise ratio (CNR) of the received satellite signal is below a second CNR threshold, the electronic device is likely in an indoor scenario; when the CNR of the received satellite signal is above a third CNR threshold, it is likely in an outdoor scenario. Therefore, the membership function corresponding to the indoor scenario can be constructed based on the second CNR threshold, and the membership function corresponding to the outdoor scenario can be constructed based on the third CNR threshold, where the second CNR threshold is less than the third CNR threshold. For example, the second CNR threshold can be 15 dB·Hz, and the third CNR threshold can be 45 dB·Hz, but these are not limited to this. The second and third CNR thresholds can be adjusted based on actual test data.
[0068] For multiple pre-set sets of satellite feature information, the membership degree between each set of pre-set satellite feature information and each pre-set positioning scenario can be calculated according to the membership function corresponding to each pre-set positioning scenario. A hidden Markov model can then be constructed based on the membership degree between each set of pre-set satellite feature information and each pre-set positioning scenario.
[0069] Furthermore, the launch probability matrix in the Hidden Markov Model can be constructed based on the membership degrees of each set of preset satellite feature information and each preset positioning scenario. The launch probability matrix is thus constructed by calculating the membership degrees of each set of preset satellite feature information and each preset positioning scenario. Membership functions corresponding to each preset positioning scenario are constructed based on historical measurement experience, and the membership degrees of each set of preset satellite feature information and each preset positioning scenario are calculated based on these membership functions. This eliminates the need for large-scale data collection, reduces costs, and improves the applicability of the solution.
[0070] After acquiring the observation sequence, the electronic device can determine the corresponding state sequence based on the constructed Hidden Markov Model. The state sequence can be used to characterize the positioning scenario most likely to be in the electronic device at N detection times. This state sequence can include N positioning scenarios that correspond one-to-one with the N sets of satellite feature information in the observation sequence. These N positioning scenarios correspond one-to-one with the N detection times, which can be understood as the satellite feature information corresponding to the N detection times in the observation sequence most likely originating from these N positioning scenarios.
[0071] In some embodiments, electronic devices can calculate the state sequence corresponding to an observation sequence using the Viterbi algorithm and a constructed Hidden Markov Model. The Viterbi algorithm is a dynamic programming algorithm that can be used to find the Viterbi path—the hidden state sequence—most likely to generate the observation event sequence. Using the Viterbi algorithm, the Viterbi path corresponding to an observation sequence containing N sets of satellite feature information can be found, thus obtaining the state sequence.
[0072] As a specific implementation method, an initial state probability vector can be calculated first based on the first set of satellite feature information in the observation sequence. The first set of satellite feature information refers to the satellite feature information corresponding to the first detection time in the observation sequence. This initial state probability vector can include the probability that the first set of satellite feature information belongs to each preset positioning scenario. For example, the initial state probability vector π = (π1, π2, ..., π P ), where π1 represents the probability that the first set of satellite feature information belongs to the first preset positioning scenario, π2 represents the probability that the first set of satellite feature information belongs to the second preset positioning scenario, and so on.
[0073] For the first detection time, the initial maximum probability value and initial node state corresponding to each preset positioning scenario can be calculated based on the initial state probability vector, the first set of satellite feature information, and the transmission probability corresponding to each preset positioning scenario. Specifically, the initial first probability value and initial second probability value corresponding to each preset positioning scenario can be calculated using formulas (2) and (3):
[0074] δ1(i)=π i b i (O1), i=1,2,…,P Formula (2);
[0075] Ψ1(i)=0,i=1,2,…,P Formula (3);
[0076] Among them, b i (O1) represents the transmission probability corresponding to the first set of satellite feature information and the i-th preset positioning scenario; δ1(i) represents the maximum probability value corresponding to the i-th preset positioning scenario at the first detection time, i.e., the initial maximum probability value corresponding to the i-th preset positioning scenario; Ψ1(i) represents the node state corresponding to the i-th preset positioning scenario at the first detection time, i.e., the initial node state corresponding to the i-th preset positioning scenario. At the t-th detection time, the maximum probability value corresponding to the i-th preset positioning scenario can be understood as the maximum probability value of all single paths of the i-th preset positioning scenario at the t-th detection time; at the t-th detection time, the node state corresponding to the i-th preset positioning scenario can be understood as the previous state of the path with the highest probability corresponding to the maximum probability value of the i-th preset positioning scenario at the t-th detection time, i.e., the preset positioning scenario corresponding to the path with the highest probability corresponding to the maximum probability value of the i-th preset positioning scenario at the t-1-th detection time.
[0077] Specifically, the maximum probability value and node state corresponding to each preset positioning scene at each detection time can be calculated using formulas (4) and (5):
[0078]
[0079]
[0080] Among them, b i (O t ) represents the transmission probability corresponding to the satellite characteristic signal at the t-th detection time and the ith preset positioning scenario; δ t-1 (j) represents the maximum probability value corresponding to the j-th preset positioning scene at the (t-1)-th detection time; δ t (i) represents the maximum probability value corresponding to the i-th preset positioning scene at the t-th detection time; Ψ t (i) represents the node state corresponding to the i-th preset positioning scene at the t-th detection time, where t can be greater than 1 and less than or equal to N; a ji This represents the probability that the device is in the j-th preset positioning scene at the (t-1)-th detection time and switches to the i-th preset positioning scene at the t-th detection time.
[0081] When the electronic device calculates the maximum probability value corresponding to each preset positioning scenario at the Nth detection time, the termination condition is met. Based on the maximum probability value corresponding to each preset positioning scenario at the Nth detection time, the termination node corresponding to the Nth detection time can be determined. This termination node can be the preset positioning scenario with the maximum probability value at the Nth detection time. The maximum probability values corresponding to each preset positioning scenario at the Nth detection time can be compared, and the maximum value can be determined. The preset positioning scenario corresponding to this maximum value is taken as the termination node. Specifically, the termination node can be determined using formulas (6) and (7):
[0082]
[0083]
[0084] Among them, P * This represents the maximum value selected from the maximum probability values corresponding to each preset positioning scenario at the Nth detection time. This indicates the terminating node.
[0085] The optimal path can be backtracked based on the termination node to find the optimal path (i.e., the path with the highest probability) corresponding to the termination node. This optimal path is the state sequence corresponding to the observation sequence. Specifically, the state sequence can be determined according to the order t = N-1, N-2, ..., 1 using formulas (8) and (9):
[0086]
[0087]
[0088] Among them, I * Represents a state sequence; This represents the node corresponding to the t-th detection time sequence on the optimal path, which is the localization scene corresponding to the t-th detection time sequence in the state sequence.
[0089] In this embodiment, the state sequence corresponding to the observation sequence is calculated using the constructed Hidden Markov Model and the Vibbit Algorithm. This reduces the computational load and improves computational efficiency. Furthermore, since both the observation sequence and the state sequence are time-based sequences, the Hidden Markov Model and the Vibbit Algorithm are used to perform probability estimation on the time-based observation sequence. This preserves the historical information of the time sequence during the calculation process, which is more consistent with the actual characteristics of satellite signals and improves the accuracy of the generated state sequence. This, in turn, improves the accuracy of identifying the target positioning scene where the electronic device is located.
[0090] It should be noted that other algorithms besides the Dimension Bit algorithm can also be used to determine the state sequence corresponding to the observation sequence based on the constructed Hidden Markov Model. For example, approximation algorithms can be used, but it is not limited to these.
[0091] Step 230: Determine the target location scenario of the electronic device based on the state sequence.
[0092] After determining the state sequence, the target location scenario of the electronic device can be determined based on the state sequence. The methods for determining the target location scenario of the electronic device based on the state sequence may include, but are not limited to, one or more of the following:
[0093] Method 1: The number of times each preset positioning scenario appears in the state sequence can be counted, and the preset positioning scenario with the most occurrences can be used as the target positioning scenario of the electronic device.
[0094] Method 2: Count the number of times each preset positioning scenario appears in the state sequence, and take the preset positioning scenario with a frequency greater than the threshold as the target positioning scenario of the electronic device.
[0095] Optionally, if there are multiple preset positioning scenarios that appear more than a threshold number of times, the preset positioning scenario with the most occurrences can be selected as the target positioning scenario for the electronic device, or the preset positioning scenario with the most consecutive occurrences can be selected as the target positioning scenario for the electronic device.
[0096] Method 3: If there are R consecutive positioning scenarios in the state sequence that are the first preset positioning scenarios, then the target positioning scenario where the electronic device is located can be determined as the first preset positioning scenario. The first preset positioning scenario can be any preset positioning scenario. Here, R can be an integer greater than 1. Optionally, the value of R can be adjusted according to N. The larger N is, the larger R can be, which can avoid misjudgment due to R being too small when N is large, thus improving the accuracy of identifying the target positioning scenario where the electronic device is located.
[0097] Furthermore, the multiple preset positioning scenarios may include indoor scenarios and outdoor scenarios. If there are R consecutive positioning scenarios that are indoor scenarios in the state sequence, then the target positioning scenario where the electronic device is located can be determined to be an indoor scenario; and / or, if there are R consecutive positioning scenarios that are outdoor scenarios in the state sequence, then the target positioning scenario where the electronic device is located can be determined to be an outdoor scenario.
[0098] Optionally, if there are no R consecutive indoor positioning scenarios in the state sequence, the target positioning scenario of the electronic device can be determined to be an outdoor scenario; and / or, if there are no R consecutive outdoor positioning scenarios in the state sequence, the target positioning scenario of the electronic device can be determined to be an indoor scenario.
[0099] By identifying the target positioning scene of an electronic device through R consecutive identical positioning scenes, the accuracy and stability of determining the target positioning scene of the electronic device can be improved.
[0100] In this embodiment, a hidden Markov model is used to estimate and predict the state of N sets of satellite feature information contained in the observation sequence to obtain a state sequence. This can accurately identify the positioning scene of the electronic device, and the scene recognition based on satellite feature information requires less computation. Moreover, the hidden Markov model is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenes, which eliminates the need for large-scale data sampling, external equipment assistance, and post-maintenance such as location fingerprint databases, thereby reducing costs and increasing applicability.
[0101] It should be noted that although the above embodiments only use satellite feature information as the observation value for scene recognition, other embodiments may also combine other observations for scene recognition, such as IMU measurement data, etc. This application embodiment does not limit this.
[0102] In some embodiments, the aforementioned satellite feature information may include the target carrier-to-noise ratio (CNR). The CNR detected at each detection time can be used as the observation value of a Hidden Markov Model (HMM) to determine the state sequence, thereby identifying the target positioning scenario in which the electronic device is located. For example... Figure 4 As shown, a location scene recognition method is provided, which can be applied to the aforementioned electronic device. The method may include the following steps:
[0103] Step 402: Determine the first carrier-to-noise ratio corresponding to each satellite signal based on one or more satellite signals received at the current detection time.
[0104] The positioning module in the electronic device can detect and receive satellite signals transmitted by one or more satellites in a satellite system according to a preset detection frequency. The electronic device can acquire one or more satellite signals received by the positioning module at the current detection time and calculate the first carrier-to-noise ratio corresponding to each received satellite signal. Furthermore, the first carrier-to-noise ratio corresponding to each satellite signal can be calculated based on the received power and noise power corresponding to each satellite signal.
[0105] Step 404: Determine the target carrier-to-noise ratio corresponding to the current detection time based on the first carrier-to-noise ratio corresponding to one or more satellite signals.
[0106] The target carrier-to-noise ratio (CNR) at the current detection time can be used to reflect the signal strength and quality of the satellite signal received at the current detection time. In some embodiments, the electronic device determines the target CNR at the current detection time based on the first CNR corresponding to one or more satellite signals received at the current detection time, and this determination may include, but is not limited to, the following methods:
[0107] Method 1: Calculate the average value of the first carrier-to-noise ratio corresponding to each satellite signal received at the current detection time, and use this average value as the target carrier-to-noise ratio corresponding to the current detection time.
[0108] Method 2: Arrange the first carrier-to-noise ratios (CNRs) of each satellite signal received at the current detection time in descending order, and obtain the first M CNRs. M can be a positive integer, such as 4, 5, 6, etc., but is not limited to these. Calculate the average of the first M CNRs and use this average as the target CNR for the current detection time. By selecting the M largest CNRs and averaging them, the target CNR can more accurately reflect the received satellite signal situation, improving the accuracy of subsequent positioning scene identification.
[0109] Method 3: Determine the median value of the first carrier-to-noise ratio corresponding to each satellite signal received at the current detection time, and use this median value as the target carrier-to-noise ratio corresponding to the current detection time.
[0110] In some embodiments, relying solely on the first carrier-to-noise ratio of each received satellite signal may not accurately identify the target positioning scene where the electronic device is located. For example, the first carrier-to-noise ratio of the received satellite signal may be large in some indoor scenes, making it easy to identify as an outdoor scene. Therefore, the first carrier-to-noise ratio of each received satellite signal can be corrected before determining the target carrier-to-noise ratio, thereby improving the accuracy of subsequent positioning scene identification.
[0111] like Figure 5 As shown, in one embodiment, the step of determining the target carrier-to-noise ratio corresponding to the current detection time based on the first carrier-to-noise ratios corresponding to one or more satellite signals may include steps 502 to 504.
[0112] Step 502: Based on the satellite angle information corresponding to each satellite signal, correct the first carrier-to-noise ratio corresponding to each satellite signal to obtain the second carrier-to-noise ratio corresponding to each satellite signal.
[0113] In an ideal scenario, a higher satellite elevation angle indicates that the satellite is directly above the electronic device. The electronic device's ability to receive the satellite signal suggests an unobstructed area above it, likely indicating an outdoor environment, resulting in a higher carrier-to-noise ratio (CNR) for the received signal. Similarly, a wider coverage area corresponding to the satellite azimuth angle detected by the electronic device also suggests an outdoor environment, further contributing to a higher CNR. However, in some cases, the CNR of the received satellite signal may not accurately identify the positioning environment. For example, in indoor environments, the CNR of the satellite signal from the satellite with a lower elevation angle may be higher than that from the satellite with a higher elevation angle. Or, in indoor environments, a narrow coverage area corresponding to the detected satellite azimuth angle may result in a higher CNR for the received signal.
[0114] Therefore, in this embodiment, the first carrier-to-noise ratio (CNR) of each satellite signal can be corrected based on the satellite angle information corresponding to each satellite signal received at the current detection time to obtain the second CNR of each satellite signal. Here, the satellite angle information corresponding to the satellite signal refers to the angle information of the satellite transmitting the signal, which may include the satellite elevation angle and / or the satellite azimuth angle.
[0115] Optionally, if the satellite elevation angle corresponding to the satellite signal is less than a first angle threshold, it indicates that the satellite transmitting the signal is far from directly above the electronic device, and the first carrier-to-noise ratio (CNR) corresponding to the satellite signal can be reduced to obtain a second CNR. Furthermore, the larger the absolute value of the difference between the satellite elevation angle corresponding to the satellite signal and the first angle threshold, the greater the reduction. If the satellite elevation angle corresponding to the satellite signal is greater than or equal to the first angle threshold, it indicates that the satellite transmitting the signal is close to directly above the electronic device, and the first CNR corresponding to the satellite signal can be increased to obtain a second CNR. Furthermore, the larger the absolute value of the difference between the satellite elevation angle corresponding to the satellite signal and the first angle threshold, the greater the increase. The first angle threshold can be set according to actual needs; for example, it can be 80°, 75°, 83°, etc., but is not limited to these.
[0116] Optionally, the coverage area can be determined based on the satellite azimuth angles corresponding to each satellite signal received at the current detection time. This coverage area can be the sum of the satellite azimuth angles corresponding to each satellite signal, or the union of the ranges of the satellite azimuth angles corresponding to each satellite signal. Optionally, if the coverage area is less than a second angle threshold, it indicates that the range of satellites that the electronic device can detect and track at the current detection time is relatively narrow. In this case, the first carrier-to-noise ratio (CNR) corresponding to the satellite signal can be reduced to obtain a second CNR. Furthermore, the larger the absolute value of the difference between the coverage area and the second angle threshold, the greater the reduction. If the coverage area is greater than or equal to the second angle threshold, it indicates that the range of satellites that the electronic device can detect and track at the current detection time is relatively wide. In this case, the first CNR corresponding to the satellite signal can be increased to obtain a second CNR. Furthermore, the larger the absolute value of the difference between the coverage area and the second angle threshold, the greater the increase. The second angle threshold can be set according to actual needs; for example, the second angle threshold can be 180°, 170°, 185°, etc., but is not limited to these.
[0117] In one implementation, the electronic device can determine the target satellite signal with a first carrier-to-noise ratio greater than the first carrier-to-noise ratio threshold from one or more satellite signals received at the current detection time, determine the coverage area according to the satellite azimuth angle corresponding to each target satellite signal, and then correct the first carrier-to-noise ratio corresponding to each satellite signal according to the coverage area and the satellite elevation angle corresponding to each satellite signal to obtain the second carrier-to-noise ratio corresponding to each satellite signal.
[0118] The electronic device can compare the first carrier-to-noise ratio (CNR) of each satellite signal received at the current detection time with a first CNR threshold, and determine whether the first CNR of each satellite signal is greater than the first CNR threshold. Satellite signals with a CNR greater than the first CNR threshold can be used as target satellite signals. The azimuth angles corresponding to each target satellite signal are obtained, and the coverage area is determined based on these azimuth angles. This coverage area can be the sum of the azimuth angles corresponding to each target satellite signal, or it can be the union of the ranges of the azimuth angles corresponding to each target satellite signal. The first CNR threshold can be set according to actual needs, such as 30dB·Hz, 31dB·Hz, 35dB·Hz, etc., but is not limited to these. By filtering out satellite signals with a CNR greater than the first CNR threshold, the determined coverage area can be more accurate, improving the accuracy of correcting the first CNR of the satellite signals.
[0119] The first carrier-to-noise ratio (CNR) of a satellite signal can be corrected based on the determined coverage area and the satellite elevation angle corresponding to the satellite signal to obtain the second CNR. Taking the first satellite signal as an example, this first satellite signal can be any satellite signal received at the current detection time. The first CNR of the first satellite signal can be corrected based on the first correction value and the second correction value corresponding to the first satellite signal to obtain the second CNR corresponding to the first satellite signal. The first correction value is determined based on the coverage area, and the first correction value is positively correlated with the coverage area; the larger the coverage area, the larger the first correction value. The second correction value corresponding to the first satellite signal is determined based on the satellite elevation angle corresponding to the first satellite signal, and the second correction value is positively correlated with the satellite elevation angle; the larger the satellite elevation angle, the larger the second correction value.
[0120] Optionally, when the coverage area is less than the second angle threshold, the first correction value can be less than 0; when the coverage area is greater than or equal to the second angle threshold, the first correction value can be greater than 0; when the satellite elevation angle is less than the first angle threshold, the second correction value can be less than 0, and when the satellite elevation angle is greater than or equal to the first angle threshold, the second correction value can be greater than 0. The first carrier-to-noise ratio corresponding to the first satellite signal can be added to the first correction value and the second correction value to obtain the second carrier-to-noise ratio corresponding to the first satellite signal.
[0121] Specifically, the first carrier-to-noise ratio corresponding to each satellite signal can be corrected using formula (10):
[0122]
[0123] Where CN0 represents the first carrier-to-noise ratio corresponding to the satellite signal, α represents the satellite elevation angle, and β represents the coverage area. after This represents the corrected carrier-to-noise ratio, i.e., the second carrier-to-noise ratio; for example, the first angle threshold can be 80°, and the second angle threshold can be 180°. This is the second correction value. This is the first correction value.
[0124] In this embodiment, the first carrier-to-noise ratio of the satellite signal can be corrected based on the satellite elevation angle and / or satellite azimuth angle corresponding to the received satellite signal. This can reduce the carrier-to-noise ratio of the satellite signal received by the electronic device in an indoor scene, making it easier to determine that the device is in an indoor scene; and increase the carrier-to-noise ratio of the satellite signal received by the electronic device in an outdoor scene, making it easier to determine that the device is in an outdoor scene, thereby improving the accuracy of subsequent identification of the target positioning scene of the electronic device.
[0125] Step 504: Determine the target carrier-to-noise ratio corresponding to the current detection time based on the second carrier-to-noise ratio corresponding to one or more satellite signals.
[0126] The electronic device can determine the target carrier-to-noise ratio (CNR) for the current detection time based on the corrected second carrier-to-noise ratios (CNRs) corresponding to each satellite signal. Optionally, the first M CNRs can be selected from the CNRs corresponding to one or more satellite signals received at the current detection time, arranged in descending order of CNR, and the average of these M CNRs can be calculated as the target CNR for the current detection time. Since the second CNRs are corrected, they better reflect the positioning scenario of the electronic device at the current detection time. By selecting the M largest second CNRs and averaging them to calculate the target CNR, the accuracy of subsequent positioning scenario identification can be improved.
[0127] It should be noted that the target carrier-to-noise ratio corresponding to the current detection time can also be determined by other methods based on the second carrier-to-noise ratio corresponding to each satellite signal obtained by correction. For example, the average value of the second carrier-to-noise ratio corresponding to each satellite signal can be directly calculated as the target carrier-to-noise ratio, or the median value of the second carrier-to-noise ratio corresponding to each satellite signal can be used as the target carrier-to-noise ratio.
[0128] Step 406: Obtain the target carrier-to-noise ratio corresponding to N detection times to obtain the observation sequence.
[0129] The observation sequence can include N sets of target carrier-to-noise ratios (CNRs), with each of the N sets corresponding to one of the N detection times. Optionally, the electronic device can generate an observation sequence every N detection times. After obtaining the target CNR corresponding to the current detection time, it can determine whether to accumulate N sets of target CNRs. If N sets of target CNRs have been accumulated, they can be used as the observation sequence. If N sets of target CNRs have not yet been accumulated, satellite signals can be detected and received at the next detection time to determine the target CNR corresponding to the next detection time, until N sets of target CNRs are accumulated. When generating the observation sequence, the accumulation can be reset to zero, and the accumulation of the N sets of target CNRs included in the next observation sequence can begin.
[0130] Optionally, the electronic device can also generate an observation sequence every M detection times, where M can be a positive integer less than N, such as M being 1, 2, 3, etc. After obtaining the target carrier-to-noise ratio corresponding to the current detection time, it can determine whether the time difference between the current detection time and the previous detection time for generating the observation sequence is equal to M detection times. If so, an observation sequence can be generated based on the target carrier-to-noise ratio corresponding to the current detection time and the target carrier-to-noise ratios corresponding to the N-1 detection times before the current detection time. If not, satellite signals can be detected and received at the next detection time to determine the target carrier-to-noise ratio corresponding to the next detection time, until the M detection times required to generate the observation sequence are met.
[0131] Each time an electronic device generates an observation sequence, it can identify the target location scene in which the electronic device is located. The frequency of identifying the target location scene in which the electronic device is located can be flexibly adjusted according to actual needs. When the recognition accuracy requirement is high, the detection frequency and the frequency of generating observation sequences can be increased, thereby increasing the recognition frequency of the location scene. When power consumption needs to be considered, the detection frequency and the frequency of generating observation sequences can be reduced, thereby reducing the recognition frequency of the location scene and reducing the power consumption of the electronic device.
[0132] Step 408: Determine the state sequence corresponding to the observation sequence based on the hidden Markov model. The state sequence includes N positioning scenes that correspond one-to-one with the N sets of target carrier-to-noise ratios.
[0133] Step 410: Determine the target location scenario of the electronic device based on the state sequence.
[0134] The descriptions of steps 406 to 410 can be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0135] In this embodiment, the electronic device can use a hidden Markov model to estimate and predict the state of N sets of target carrier-to-noise ratios contained in the observation sequence, so as to identify the target positioning scene in which the electronic device is located. This reduces the amount of computation and improves the accuracy of scene recognition. Moreover, the first carrier-to-noise ratio of the satellite signal can be corrected according to the satellite angle information such as the satellite elevation angle and satellite azimuth angle corresponding to the satellite signal, which improves the accuracy of the calculated target carrier-to-noise ratio and further improves the accuracy of identifying the target positioning scene in which the electronic device is located, making it more adaptable.
[0136] In some embodiments, the Hidden Markov Model includes a state transition probability matrix and a transmission probability matrix. The transmission probability matrix is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios. When the satellite feature information includes the target carrier-to-noise ratio (CNR), the preset satellite feature information may include the preset CNR. For example... Figure 6 As shown, constructing the emission probability matrix in a Hidden Markov Model can include the following steps:
[0137] Step 602: Obtain the set of observations, which includes multiple preset carrier-to-noise ratios.
[0138] Multiple preset carrier-to-noise ratios can be set in advance to obtain a set of observations. For example, the obtained set of observations may include 61 preset carrier-to-noise ratios.
[0139] O={O1(CN0≤15), O2(CN0=15.5), O3(CN0=16),…,O 60 (CN0=44.5), O 61 (CN0≥45).
[0140] Step 604: Calculate the membership degree of the first preset carrier-to-noise ratio and the corresponding preset positioning scene according to the membership function of each preset positioning scene; the first preset carrier-to-noise ratio is any preset carrier-to-noise ratio.
[0141] In some embodiments, membership functions corresponding to each preset positioning scenario can be constructed based on historical measurement experience. These membership functions can be used to calculate the membership degree of each preset carrier-to-noise ratio (CNR) relative to its corresponding preset positioning scenario. Based on the membership functions corresponding to each preset positioning scenario, the membership degree between each preset CNR and each preset positioning scenario can be calculated, and a transmission probability matrix can be constructed based on the membership degree between each preset CNR and each preset positioning scenario.
[0142] Taking the first preset carrier-to-noise ratio as an example, the first preset carrier-to-noise ratio can be any preset carrier-to-noise ratio. The membership degree between the first preset carrier-to-noise ratio and each preset positioning scene can be calculated according to the membership function corresponding to each preset positioning scene.
[0143] In one implementation, the preset positioning scenarios may include indoor and outdoor scenarios. The membership function corresponding to the indoor scenario is constructed based on a second carrier-to-noise ratio threshold, and the membership function corresponding to the outdoor scenario is constructed based on a third carrier-to-noise ratio threshold. The second carrier-to-noise ratio threshold is less than the third carrier-to-noise ratio threshold.
[0144] The aforementioned second and third carrier-to-noise ratio thresholds can be determined based on historical measurement experience. When the carrier-to-noise ratio of the received satellite signal is less than or equal to the second carrier-to-noise ratio threshold, the electronic device is likely in an indoor environment. When the carrier-to-noise ratio of the received satellite signal is greater than or equal to the third carrier-to-noise ratio threshold, the electronic device is likely in an outdoor environment.
[0145] In some embodiments, if the first preset carrier-to-noise ratio is less than or equal to the second carrier-to-noise ratio threshold, the membership degree of the first preset carrier-to-noise ratio corresponding to the indoor scene is determined to be 1; if the first preset carrier-to-noise ratio is greater than the second carrier-to-noise ratio threshold, the membership degree of the first preset carrier-to-noise ratio corresponding to the indoor scene is determined based on the difference between the first preset carrier-to-noise ratio and the second carrier-to-noise ratio threshold; if the first preset carrier-to-noise ratio is less than the third carrier-to-noise ratio threshold, the membership degree of the first preset carrier-to-noise ratio corresponding to the outdoor scene is determined based on the difference between the first preset carrier-to-noise ratio and the third carrier-to-noise ratio threshold; if the first preset carrier-to-noise ratio is greater than or equal to the third carrier-to-noise ratio threshold, the membership degree of the first preset carrier-to-noise ratio corresponding to the outdoor scene is determined to be 1.
[0146] Specifically, the membership function corresponding to the indoor scene can be shown in formula (11), and the membership degree of each preset carrier-to-noise ratio corresponding to the indoor scene can be calculated using formula (11); the membership function corresponding to the outdoor scene can be shown in formula (12), and the membership degree of each preset carrier-to-noise ratio corresponding to the outdoor scene can be calculated using formula (12):
[0147]
[0148]
[0149] Among them, O x f can represent the preset carrier-to-noise ratio of the x-th group in the observation set. in f represents the membership degree between the preset carrier-to-noise ratio and the indoor scene. out This represents the membership degree of the preset carrier-to-noise ratio corresponding to the outdoor scene. For example, the second carrier-to-noise ratio threshold can be 15dB·Hz, and the third carrier-to-noise ratio threshold can be 45dB·Hz.
[0150] Step 606: Calculate the transmission probability corresponding to the first preset carrier-to-noise ratio and each preset positioning scenario based on the membership degree of the first preset carrier-to-noise ratio and each preset positioning scenario.
[0151] In some embodiments, after calculating the membership degree of the first preset carrier-to-noise ratio and each preset positioning scenario, the probability that the first preset carrier-to-noise ratio belongs to each preset positioning scenario can be calculated based on the membership degree of the first preset carrier-to-noise ratio and each preset positioning scenario, and then the transmission probability of the first preset carrier-to-noise ratio and each preset positioning scenario can be calculated based on the probability that the first preset carrier-to-noise ratio belongs to each preset positioning scenario.
[0152] Taking the first preset positioning scenario as an example, the first preset positioning scenario can be any preset positioning scenario. The membership degree of the first preset carrier-to-noise ratio corresponding to the first preset positioning scenario can be calculated, and the ratio of this membership degree to the sum of the membership degrees can be used to obtain the probability that the first preset carrier-to-noise ratio belongs to the first preset positioning scenario. The sum of the membership degrees is the sum of the membership degrees of the first preset carrier-to-noise ratio and each preset positioning scenario. Specifically, the probability that the preset carrier-to-noise ratio belongs to each preset positioning scenario can be calculated using formula (13):
[0153]
[0154] Among them, S i This represents the i-th preset positioning scenario. P(S) represents the membership degree between the x-th preset carrier-to-noise ratio and the ith preset localization scene. i |O x ) represents the probability that the x-th preset carrier-to-noise ratio belongs to the ith preset positioning scene.
[0155] For example, the multiple preset positioning scenarios can include indoor and outdoor scenarios. The probability of the preset carrier-to-noise ratio belonging to the indoor and outdoor scenarios can be calculated using formulas (14) and (15), respectively:
[0156]
[0157] P(S1|O x )=1-P(S0|O x ) formula (15);
[0158] Where S0 represents an indoor scene, S1 represents an outdoor scene, and f in (O x ) represents the membership degree of the x-th preset carrier-to-noise ratio and the corresponding indoor scene, f out (O x P(S0|O) represents the membership degree of the x-th preset carrier-to-noise ratio corresponding to the outdoor scene. x P(S1|O) represents the probability that the x-th preset carrier-to-noise ratio belongs to an indoor scene. x ) represents the probability that the x-th preset carrier-to-noise ratio belongs to an outdoor scene.
[0159] The transmission probability corresponding to the first preset carrier-to-noise ratio and each preset positioning scenario can be calculated based on the first probability corresponding to the first preset carrier-to-noise ratio, the probability that the first preset carrier-to-noise ratio belongs to each preset positioning scenario, and the second probability corresponding to each preset positioning scenario. Here, the first probability corresponding to the first preset carrier-to-noise ratio refers to the probability of the first preset carrier-to-noise ratio occurring, and the second probability corresponding to the preset positioning scenario refers to the probability of that preset positioning scenario occurring.
[0160] Furthermore, taking the first preset positioning scenario as an example, the probability that the first preset carrier-to-noise ratio belongs to the first preset positioning scenario can be multiplied by the first probability corresponding to the first preset carrier-to-noise ratio, and then the product can be divided by the second probability corresponding to the first preset positioning scenario to obtain the transmission probability of the first preset carrier-to-noise ratio corresponding to the first preset positioning scenario. The transmission probability of the first preset carrier-to-noise ratio corresponding to the first preset positioning scenario is used to characterize the probability of the first preset carrier-to-noise ratio appearing in the first preset positioning scenario.
[0161] Specifically, the preset carrier-to-noise ratio and the transmission probability corresponding to each preset positioning scenario can be calculated using formula (16):
[0162]
[0163] Among them, P(O) x P(S) represents the first probability corresponding to the preset carrier-to-noise ratio of the x-th group. i ) represents the second probability corresponding to the i-th preset positioning scenario. This represents the transmission probability corresponding to the preset carrier-to-noise ratio of the x-th group and the preset positioning scenario of the ith.
[0164] It should be noted that the first probability corresponding to each preset carrier-to-noise ratio and the second probability corresponding to each preset positioning scenario can be determined according to the actual situation and can be set in combination with historical experience. This application embodiment does not make specific limitations.
[0165] Step 608: Construct a transmission probability matrix based on the preset carrier-to-noise ratio of each group and the transmission probability corresponding to each preset positioning scenario.
[0166] For example, let the set of observations be O = {O1(CN0≤15), O2(CN0=15.5), O3(CN0=16), ..., O 60 (CN0=44.5), O 61 (CN0≥45), taking the preset positioning scenarios including indoor and outdoor scenarios as an example, the emission probability matrix can be constructed as follows:
[0167]
[0168] In practical applications of Hidden Markov Models, after acquiring an observation sequence containing satellite feature information corresponding to N detection times, an electronic device can calculate an initial state probability vector based on the first set of satellite feature information in the observation sequence. In some embodiments, the membership degree between the first set of satellite feature information and each preset positioning scenario can be calculated based on the membership function corresponding to each preset positioning scenario. Then, based on the membership degree between the first set of satellite feature information and each preset positioning scenario, the probability that the first set of satellite feature information belongs to each preset positioning scenario is determined, thus obtaining the initial state probability vector.
[0169] Specifically, the pre-set multiple preset positioning scenarios may include indoor scenarios and outdoor scenarios. The first set of satellite feature information can be substituted into the above formulas (11) and (12) respectively to calculate the membership degree of the first set of satellite feature information to the indoor scenario and the membership degree of the first set of satellite feature information to the outdoor scenario. Then, the probability of the first set of satellite feature information belonging to the indoor scenario and the outdoor scenario can be calculated by formulas (14) and (15) respectively, so as to obtain the initial state probability vector.
[0170] In this embodiment, a membership function corresponding to each preset positioning scenario is constructed based on historical test experience. The membership function corresponding to each preset positioning scenario is used to calculate the preset carrier-to-noise ratio and the transmission probability corresponding to each preset positioning scenario, thereby constructing a transmission probability matrix. This eliminates the need for large-scale data sampling, reducing costs. Furthermore, it eliminates the need for post-maintenance similar to a fingerprint database, allowing the Hidden Markov Model to be used for a long time and making it more adaptable.
[0171] like Figure 7 As shown, in one embodiment, a method for constructing a Hidden Markov Model is provided, which can be applied to electronic devices. The method may include the following steps:
[0172] Step 710: Calculate the membership degree corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios.
[0173] Step 720: Construct a Hidden Markov Model (HMM) based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios. The HMM is used to identify the target positioning scenario of the electronic device based on the satellite feature signals corresponding to the satellite signals received by the electronic device.
[0174] In some embodiments, the Hidden Markov Model includes a state transition probability matrix and a launch probability matrix. Step 720 may include: constructing a launch probability matrix based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios.
[0175] In some embodiments, the preset satellite feature information includes a preset carrier-to-noise ratio (CNR). Before step 710, the method further includes: acquiring an observation set, the observation set including multiple sets of preset CNRs; step 710 includes: calculating the membership degree of a first preset CNR to each preset positioning scenario according to the membership function corresponding to each preset positioning scenario; the first preset CNR is any preset CNR; the step of constructing a launch probability matrix based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios includes: calculating the launch probability of the first preset CNR to each preset positioning scenario based on the membership degrees corresponding to the first preset CNR to each preset positioning scenario; constructing a launch probability matrix based on the launch probabilities corresponding to each set of preset CNRs to each preset positioning scenario.
[0176] In some embodiments, the multiple preset positioning scenarios include indoor scenarios and outdoor scenarios; the membership function corresponding to the indoor scenario is constructed based on a second carrier-to-noise ratio threshold, and the membership function corresponding to the outdoor scenario is constructed based on a third carrier-to-noise ratio threshold, wherein the second carrier-to-noise ratio threshold is less than the third carrier-to-noise ratio threshold.
[0177] In some embodiments, the step of calculating the membership degree between the first preset carrier-to-noise ratio and each preset positioning scene according to the membership function corresponding to each preset positioning scene includes: if the first preset carrier-to-noise ratio is less than or equal to a second carrier-to-noise ratio threshold, then the membership degree between the first preset carrier-to-noise ratio and the indoor scene is determined to be 1; if the first preset carrier-to-noise ratio is greater than the second carrier-to-noise ratio threshold, then the membership degree between the first preset carrier-to-noise ratio and the indoor scene is determined according to the difference between the first preset carrier-to-noise ratio and the second carrier-to-noise ratio threshold; if the first preset carrier-to-noise ratio is less than a third carrier-to-noise ratio threshold, then the membership degree between the first preset carrier-to-noise ratio and the outdoor scene is determined according to the difference between the first preset carrier-to-noise ratio and the third carrier-to-noise ratio threshold; if the first preset carrier-to-noise ratio is greater than or equal to the third carrier-to-noise ratio threshold, then the membership degree between the first preset carrier-to-noise ratio and the outdoor scene is determined to be 1.
[0178] In some embodiments, the state transition probability matrix is determined based on the detection frequency of satellite feature information.
[0179] It should be noted that the description of the method for constructing the hidden Markov model provided in the embodiments of this application can be referred to the relevant description of the localization scene recognition method provided in the above embodiments, and will not be repeated here.
[0180] In this embodiment, a membership function corresponding to each preset positioning scenario is constructed based on historical test experience. The membership function corresponding to each preset positioning scenario is used to calculate the preset carrier-to-noise ratio and the transmission probability corresponding to each preset positioning scenario, thereby constructing a transmission probability matrix. This eliminates the need for large-scale data sampling, reducing costs. Furthermore, it eliminates the need for post-maintenance similar to a fingerprint database, allowing the Hidden Markov Model to be used for a long time and making it more adaptable.
[0181] like Figure 8 As shown, in one embodiment, a positioning scene recognition device 800 is provided, which can be applied to the above-mentioned electronic device. The positioning scene recognition device 800 may include an observation sequence acquisition module 810, a state sequence determination module 820, and a scene determination module 830.
[0182] The observation sequence acquisition module 810 is used to acquire an observation sequence based on the received satellite signals. The observation sequence includes N sets of satellite feature information; N is a positive integer.
[0183] The state sequence determination module 820 is used to determine the state sequence corresponding to the observation sequence based on the hidden Markov model. The state sequence includes N positioning scenarios that correspond one-to-one with N sets of satellite feature information. The hidden Markov model is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios.
[0184] Scene determination module 830 is used to determine the target positioning scene of the electronic device based on the state sequence.
[0185] In one embodiment, satellite feature information includes target carrier-to-noise ratio, and the observation sequence acquisition module 810 may include...
[0186] The first determining unit is used to determine the first carrier-to-noise ratio corresponding to each satellite signal based on one or more satellite signals received at the current detection time.
[0187] The second determining unit is used to determine the target carrier-to-noise ratio corresponding to the current detection time based on the first carrier-to-noise ratio corresponding to one or more satellite signals.
[0188] The sequence generation unit is used to obtain the target carrier-to-noise ratio corresponding to N detection times, and thus obtain the observation sequence.
[0189] In one embodiment, the second determining unit includes a correction subunit and a determining subunit.
[0190] The correction subunit is used to correct the first carrier-to-noise ratio (CNR) of each satellite signal based on the satellite angle information corresponding to each satellite signal, so as to obtain the second CNR of each satellite signal.
[0191] The determination sub-unit is used to determine the target carrier-to-noise ratio corresponding to the current detection time based on the second carrier-to-noise ratio corresponding to one or more satellite signals.
[0192] In one embodiment, the satellite angle information includes the satellite elevation angle and the satellite azimuth angle; the correction subunit is further configured to determine, from one or more satellite signals, the corresponding target satellite signal with a first carrier-to-noise ratio greater than a first carrier-to-noise ratio threshold, and determine the coverage area according to the satellite azimuth angle corresponding to each target satellite signal; and correct the first carrier-to-noise ratio corresponding to each satellite signal according to the coverage area and the satellite elevation angle corresponding to each satellite signal to obtain the second carrier-to-noise ratio corresponding to each satellite signal.
[0193] In one embodiment, the correction subunit is further configured to correct the first carrier-to-noise ratio corresponding to the first satellite signal based on the first correction value and the second correction value corresponding to the first satellite signal, to obtain the second carrier-to-noise ratio corresponding to the first satellite signal; the first satellite signal is any satellite signal received at the current detection time; wherein, the first correction value is determined based on the coverage area, and the first correction value is positively correlated with the coverage area; the second correction value corresponding to the first satellite signal is determined based on the satellite elevation angle corresponding to the first satellite signal, and the second correction value is positively correlated with the satellite elevation angle.
[0194] In one embodiment, determining the sub-unit is further configured to select the first M second carrier noise ratios from the second carrier noise ratios corresponding to one or more satellite signals respectively, in descending order of carrier noise ratio, where M is a positive integer; and calculate the average value of the first M second carrier noise ratios as the target carrier noise ratio corresponding to the current detection time.
[0195] In one embodiment, the Hidden Markov Model includes a state transition probability matrix and a launch probability matrix. The state transition probability matrix is used to indicate the scene transition probability of multiple preset positioning scenarios. The launch probability matrix is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios. The launch probability matrix is used to indicate the probability of each set of preset satellite feature information occurring in each preset positioning scenario.
[0196] In one embodiment, the location scene recognition device 800 further includes a construction module.
[0197] The module is used to construct a launch probability matrix based on multiple sets of preset satellite feature information and the membership degrees corresponding to multiple preset positioning scenarios.
[0198] The construction module includes an acquisition unit, a first calculation unit, a second calculation unit, and a construction unit.
[0199] The acquisition unit is used to acquire a set of observations, which includes multiple preset carrier-to-noise ratios.
[0200] The first calculation unit is used to calculate the first preset carrier-to-noise ratio and the membership degree corresponding to each preset positioning scene according to the membership function corresponding to each preset positioning scene; the first preset carrier-to-noise ratio is any preset carrier-to-noise ratio.
[0201] The second calculation unit is used to calculate the transmission probability corresponding to the first preset carrier-to-noise ratio and each preset positioning scenario based on the membership degree of the first preset carrier-to-noise ratio and each preset positioning scenario.
[0202] The construction unit is used to construct the transmission probability matrix based on the preset carrier-to-noise ratio and the transmission probability corresponding to each preset positioning scenario.
[0203] In one embodiment, the multiple preset positioning scenarios include indoor scenarios and outdoor scenarios; the membership function corresponding to the indoor scenario is constructed based on a second carrier-to-noise ratio threshold, and the membership function corresponding to the outdoor scenario is constructed based on a third carrier-to-noise ratio threshold, wherein the second carrier-to-noise ratio threshold is less than the third carrier-to-noise ratio threshold.
[0204] In one embodiment, the first calculation unit is further configured to: if the first preset carrier-to-noise ratio is less than or equal to the second carrier-to-noise ratio threshold, determine that the membership degree of the first preset carrier-to-noise ratio corresponding to the indoor scene is 1; if the first preset carrier-to-noise ratio is greater than the second carrier-to-noise ratio threshold, determine that the membership degree of the first preset carrier-to-noise ratio corresponding to the indoor scene is based on the difference between the first preset carrier-to-noise ratio and the second carrier-to-noise ratio threshold; if the first preset carrier-to-noise ratio is less than the third carrier-to-noise ratio threshold, determine that the membership degree of the first preset carrier-to-noise ratio corresponding to the outdoor scene is based on the difference between the first preset carrier-to-noise ratio and the third carrier-to-noise ratio threshold; and if the first preset carrier-to-noise ratio is greater than or equal to the third carrier-to-noise ratio threshold, determine that the membership degree of the first preset carrier-to-noise ratio corresponding to the outdoor scene is 1.
[0205] In one embodiment, the state transition probability matrix is determined based on the detection frequency of satellite feature information.
[0206] In one embodiment, the scene determination module 830 is further configured to determine that the target location scene of the electronic device is an indoor scene if there are R consecutive location scenes in the state sequence that are indoor scenes, where R is an integer greater than 1; and / or, if there are R consecutive location scenes in the state sequence that are outdoor scenes, determine that the target location scene of the electronic device is an outdoor scene.
[0207] In this embodiment, a hidden Markov model is used to estimate and predict the state of N sets of satellite feature information contained in the observation sequence to obtain a state sequence. This can accurately identify the positioning scene of the electronic device, and the scene recognition based on satellite feature information requires less computation. Moreover, the hidden Markov model is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenes, which eliminates the need for large-scale data sampling, external equipment assistance, and post-maintenance such as location fingerprint databases, thereby reducing costs and increasing applicability.
[0208] like Figure 9 As shown, in one embodiment, a hidden Markov model construction apparatus 900 is provided, which can be applied to electronic devices. The hidden Markov model construction apparatus 900 may include a membership calculation module 910 and a construction module 920.
[0209] The membership calculation module 910 is used to calculate the membership degree corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios.
[0210] Module 920 is used to construct a Hidden Markov Model (HMM) based on multiple sets of preset satellite feature information and the membership degrees corresponding to multiple preset positioning scenarios. The HMM is used to identify the target positioning scenario of the electronic device based on the satellite feature signals corresponding to the satellite signals received by the electronic device.
[0211] In one embodiment, the Hidden Markov Model includes a state transition probability matrix and a launch probability matrix. The construction module 920 is also used to construct the launch probability matrix based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios.
[0212] In one embodiment, the preset satellite feature information includes a preset carrier-to-noise ratio. The hidden Markov model construction apparatus 900 also includes an acquisition module.
[0213] The acquisition module is used to acquire a set of observations, which includes multiple preset carrier-to-noise ratios.
[0214] The membership calculation module 910 is also used to calculate the membership degree of the first preset carrier-to-noise ratio and the corresponding preset positioning scene according to the membership function of each preset positioning scene; the first preset carrier-to-noise ratio is any preset carrier-to-noise ratio.
[0215] The construction module 920 is also used to calculate the transmission probability corresponding to the first preset carrier-to-noise ratio and each preset positioning scenario based on the membership degree corresponding to the first preset carrier-to-noise ratio and each preset positioning scenario; and to construct a transmission probability matrix based on the transmission probability corresponding to each preset carrier-to-noise ratio and each preset positioning scenario.
[0216] In one embodiment, the multiple preset positioning scenarios include indoor scenarios and outdoor scenarios; the membership function corresponding to the indoor scenario is constructed based on a second carrier-to-noise ratio threshold, and the membership function corresponding to the outdoor scenario is constructed based on a third carrier-to-noise ratio threshold, wherein the second carrier-to-noise ratio threshold is less than the third carrier-to-noise ratio threshold.
[0217] In one embodiment, the membership calculation module 910 is further configured to: if the first preset carrier-to-noise ratio is less than or equal to the second carrier-to-noise ratio threshold, determine that the membership degree of the first preset carrier-to-noise ratio corresponding to the indoor scene is 1; if the first preset carrier-to-noise ratio is greater than the second carrier-to-noise ratio threshold, determine that the membership degree of the first preset carrier-to-noise ratio corresponding to the indoor scene is based on the difference between the first preset carrier-to-noise ratio and the second carrier-to-noise ratio threshold; if the first preset carrier-to-noise ratio is less than the third carrier-to-noise ratio threshold, determine that the membership degree of the first preset carrier-to-noise ratio corresponding to the outdoor scene is based on the difference between the first preset carrier-to-noise ratio and the third carrier-to-noise ratio threshold; and if the first preset carrier-to-noise ratio is greater than or equal to the third carrier-to-noise ratio threshold, determine that the membership degree of the first preset carrier-to-noise ratio corresponding to the outdoor scene is 1.
[0218] In one embodiment, the state transition probability matrix is determined based on the detection frequency of satellite feature information.
[0219] In this embodiment, a membership function corresponding to each preset positioning scenario is constructed based on historical test experience. The membership function corresponding to each preset positioning scenario is used to calculate the preset carrier-to-noise ratio and the transmission probability corresponding to each preset positioning scenario, thereby constructing a transmission probability matrix. This eliminates the need for large-scale data sampling, reducing costs. Furthermore, it eliminates the need for post-maintenance similar to a fingerprint database, allowing the Hidden Markov Model to be used for a long time and making it more adaptable.
[0220] Figure 10 This is a structural block diagram of an electronic device in one embodiment. For example... Figure 10 As shown, the electronic device 1000 may include one or more of the following components: a processor 1010 and a memory 1020 coupled to the processor 1010, wherein the memory 1020 may store one or more computer programs, which may be configured to implement the methods described in the above embodiments when executed by one or more processors 1010.
[0221] The processor 1010 may include one or more processing cores. The processor 1010 connects to various parts within the electronic device 1000 using various interfaces and lines, and performs various functions and processes data of the electronic device 1000 by running or executing instructions, programs, code sets, or instruction sets stored in the memory 1020, and by calling data stored in the memory 1020. Optionally, the processor 1010 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). The processor 1010 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into the processor 1010 and may be implemented separately through a communication chip.
[0222] The memory 1020 may include random access memory (RAM) or read-only memory (ROM). The memory 1020 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1020 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described above. The data storage area may also store data created by the electronic device 1000 during use.
[0223] The electronic device 1000 may also include a positioning module, which can be used to receive satellite signals transmitted by satellites in a satellite navigation system to achieve positioning function.
[0224] Understandably, the electronic device 1000 may include more or fewer structural elements than those shown in the above block diagram, such as radio frequency modules, power modules, physical buttons, WiFi (Wireless Fidelity) modules, speakers, Bluetooth modules, sensors, etc., and may not be limited herein.
[0225] This application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the methods described in the above embodiments.
[0226] This application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program can be executed by a processor to implement the methods described in the above embodiments.
[0227] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, ROM, etc.
[0228] Any references to memory, storage, databases, or other media used herein may include non-volatile and / or volatile memory. Suitable non-volatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache. By way of illustration and not limitation, RAM may take many forms, such as Static RAM (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus DRAM (RDRAM), and Direct Rambus DRAM (DRDRAM).
[0229] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also recognize that the embodiments described in the specification are optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0230] In the various embodiments of this application, it should be understood that the sequence number of each process does not necessarily imply 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 this application.
[0231] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they can be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0232] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0233] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0234] The foregoing has provided a detailed description of a location scene recognition method, apparatus, and electronic device disclosed in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for scene recognition, characterized in that, Applied to electronic devices, the method includes: An observation sequence is obtained based on the received satellite signals, and the observation sequence includes N sets of satellite feature information; where N is a positive integer. The state sequence corresponding to the observation sequence is determined according to the Hidden Markov Model. The state sequence includes N positioning scenarios that correspond one-to-one with the N sets of satellite feature information. The Hidden Markov Model is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios. The target positioning scenario of the electronic device is determined based on the state sequence; The satellite characteristic information includes the target carrier-to-noise ratio, and the step of obtaining the observation sequence based on the received satellite signals includes: Based on one or more satellite signals received at the current detection time, determine the first carrier-to-noise ratio corresponding to each of the satellite signals; Based on the first carrier-to-noise ratios corresponding to the one or more satellite signals, the target carrier-to-noise ratio corresponding to the current detection time is determined; Obtain the target carrier-to-noise ratio corresponding to N detection times to obtain the observation sequence.
2. The method according to claim 1, characterized in that, Determining the target carrier-to-noise ratio corresponding to the current detection time based on the first carrier-to-noise ratios corresponding to the one or more satellite signals includes: Based on the satellite angle information corresponding to each of the satellite signals, the first carrier-to-noise ratio corresponding to each of the satellite signals is corrected to obtain the second carrier-to-noise ratio corresponding to each of the satellite signals. The target carrier-to-noise ratio corresponding to the current detection time is determined based on the second carrier-to-noise ratio corresponding to the one or more satellite signals.
3. The method according to claim 2, characterized in that, The satellite angle information includes the satellite elevation angle and the satellite azimuth angle; the step of correcting the first carrier-to-noise ratio corresponding to each satellite signal based on the satellite angle information corresponding to each satellite signal to obtain the second carrier-to-noise ratio corresponding to each satellite signal includes: From the one or more satellite signals, determine the target satellite signal whose first carrier-to-noise ratio is greater than the first carrier-to-noise ratio threshold, and determine the coverage area according to the satellite azimuth angle corresponding to each target satellite signal; Based on the coverage area and the satellite elevation angle corresponding to each satellite signal, the first carrier-to-noise ratio corresponding to each satellite signal is corrected to obtain the second carrier-to-noise ratio corresponding to each satellite signal.
4. The method according to claim 3, characterized in that, The step of correcting the first carrier-to-noise ratio (CNR) of each satellite signal based on the coverage area and the satellite elevation angle corresponding to each satellite signal to obtain the second CNR of each satellite signal includes: Based on the first correction value and the second correction value corresponding to the first satellite signal, the first carrier-to-noise ratio corresponding to the first satellite signal is corrected to obtain the second carrier-to-noise ratio corresponding to the first satellite signal; the first satellite signal is any satellite signal received at the current detection time. The first correction value is determined based on the coverage area, and the first correction value is positively correlated with the coverage area. The second correction value corresponding to the first satellite signal is determined based on the satellite elevation angle corresponding to the first satellite signal, and the second correction value is positively correlated with the satellite elevation angle.
5. The method according to any one of claims 2 to 4, characterized in that, Determining the target carrier-to-noise ratio corresponding to the current detection time based on the second carrier-to-noise ratios corresponding to the one or more satellite signals includes: According to the order of carrier-to-noise ratio from largest to smallest, select the first M second carrier-to-noise ratios from the second carrier-to-noise ratios corresponding to the one or more satellite signals respectively, where M is a positive integer; The average value of the second carrier-to-noise ratio of the first M values is calculated as the target carrier-to-noise ratio corresponding to the current detection time.
6. The method according to any one of claims 1 to 4, characterized in that, The hidden Markov model includes a state transition probability matrix and a transmission probability matrix. The state transition probability matrix is used to indicate the scene transition probability of the multiple preset positioning scenarios. The launch probability matrix is constructed based on the membership degrees corresponding to the multiple sets of preset satellite feature information and the multiple preset positioning scenarios respectively; the launch probability matrix is used to indicate the probability of each set of preset satellite feature information occurring in each preset positioning scenario.
7. The method according to claim 6, characterized in that, The preset satellite feature information includes a preset carrier-to-noise ratio; Constructing the emission probability matrix includes: Obtain a set of observations, which includes multiple preset carrier-to-noise ratios; Based on the membership function corresponding to each preset positioning scenario, calculate the first preset carrier-to-noise ratio and the membership degree corresponding to each preset positioning scenario; the first preset carrier-to-noise ratio is any of the preset carrier-to-noise ratios. Based on the membership degree of the first preset carrier-to-noise ratio and each preset positioning scenario, calculate the transmission probability of the first preset carrier-to-noise ratio and each preset positioning scenario. A transmission probability matrix is constructed based on the preset carrier-to-noise ratio of each group and the transmission probability corresponding to each preset positioning scenario.
8. The method according to claim 7, characterized in that, The multiple preset positioning scenarios include indoor scenarios and outdoor scenarios; the membership function corresponding to the indoor scenario is constructed based on a second carrier-to-noise ratio threshold, and the membership function corresponding to the outdoor scenario is constructed based on a third carrier-to-noise ratio threshold, wherein the second carrier-to-noise ratio threshold is less than the third carrier-to-noise ratio threshold.
9. The method according to claim 8, characterized in that, The step of calculating the membership degree of the first preset carrier-to-noise ratio and the membership degree of each preset positioning scene according to the membership function corresponding to each preset positioning scene includes: If the first preset carrier-to-noise ratio is less than or equal to the second carrier-to-noise ratio threshold, then the membership degree between the first preset carrier-to-noise ratio and the indoor scene is determined to be 1. If the first preset carrier-to-noise ratio is greater than the second carrier-to-noise ratio threshold, then the membership degree of the first preset carrier-to-noise ratio and the indoor scene is determined based on the difference between the first preset carrier-to-noise ratio and the second carrier-to-noise ratio threshold. If the first preset carrier-to-noise ratio is less than the third carrier-to-noise ratio threshold, then the membership degree of the first preset carrier-to-noise ratio and the outdoor scene is determined based on the difference between the first preset carrier-to-noise ratio and the third carrier-to-noise ratio threshold. If the first preset carrier-to-noise ratio is greater than or equal to the third carrier-to-noise ratio threshold, then the membership degree between the first preset carrier-to-noise ratio and the outdoor scene is determined to be 1.
10. The method according to claim 6, characterized in that, The state transition probability matrix is determined based on the detection frequency of the satellite feature information.
11. The method according to any one of claims 1-4 and 7-10, characterized in that, The multiple preset positioning scenarios include indoor and outdoor scenarios; determining the target positioning scenario of the electronic device based on the state sequence includes: If there are R consecutive positioning scenarios in the state sequence that are indoor scenarios, then the target positioning scenario where the electronic device is located is determined to be the indoor scenario, where R is an integer greater than 1; and / or, If there are R consecutive outdoor scenes in the state sequence, then the target positioning scene where the electronic device is located is determined to be the outdoor scene.
12. A positioning scene recognition device, characterized in that, Applied to electronic devices, the device includes: An observation sequence acquisition module is used to acquire an observation sequence based on received satellite signals. The observation sequence includes N sets of satellite feature information, where N is a positive integer. The state sequence determination module is used to determine the state sequence corresponding to the observation sequence based on the hidden Markov model. The state sequence includes N positioning scenarios that correspond one-to-one with the N sets of satellite feature information. The hidden Markov model is constructed based on the membership degrees corresponding to multiple sets of preset satellite feature information and multiple preset positioning scenarios. A scene determination module is used to determine the target positioning scene of the electronic device based on the state sequence. The satellite feature information includes the target carrier-to-noise ratio, and the observation sequence acquisition module includes: The first determining unit is configured to determine the first carrier-to-noise ratio corresponding to each of the satellite signals based on one or more satellite signals received at the current detection time. The second determining unit is used to determine the target carrier-to-noise ratio corresponding to the current detection time based on the first carrier-to-noise ratios corresponding to the one or more satellite signals respectively; The sequence generation unit is used to obtain the target carrier-to-noise ratio corresponding to N detection times, and thus obtain the observation sequence.
13. An electronic device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the electronic device causes the electronic device to perform the method as described in any one of claims 1 to 11.
Citation Information
Patent Citations
Indoor and outdoor seamless positioning algorithm based on smart phone scene recognition
CN113534226A