Positioning acquisition method and electronic device
By switching the acquisition frequency under positioning prediction conditions and using historical information to infer positioning, the problem of high power consumption in real-time positioning of electronic devices is solved, and a balance between power consumption and positioning accuracy is achieved.
Patent Information
- Application Number
- CN202311289174.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2043-09-27
AI Technical Summary
During the real-time acquisition of location information, electronic devices consume excessive power, especially in navigation and sports applications, leading to rapid battery depletion.
By switching to a low-frequency sampling frequency when the positioning prediction conditions are met, and using historical positioning information to infer and calculate positioning prediction information, the sampling frequency is reduced; when the conditions are not met, the sampling frequency is switched to a high-frequency sampling frequency to ensure the accuracy and reliability of the positioning information.
It effectively reduces the power consumption of electronic devices for positioning, while ensuring the accuracy and reliability of positioning information and adapting to changes in different device states.
Smart Images

Figure CN119767242B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present solution relates to the technical field of communication, and in particular, to a positioning acquisition method and an electronic device. BACKGROUND
[0002] When a user travels, an electronic device needs to determine a travel route or a position. For example, the user plans a navigation route by a vehicle and drives according to the navigation route. In the above process, the electronic device, such as a vehicle device or a mobile phone, needs to continuously acquire the position of the user in real time. However, the process of acquiring the position in real time causes a large increase in power consumption of the electronic device. SUMMARY
[0003] The present solution provides a positioning acquisition method and an electronic device, which can save positioning power consumption.
[0004] In a first aspect, the present solution provides a positioning acquisition method, which is applied to an electronic device, the electronic device is installed with a first application, and the method comprises: starting to acquire positioning information in response to a first operation acting on the first application; acquiring positioning collection information based on a first sampling rate in a case where a positioning prediction condition is not met; and acquiring positioning collection information based on a second sampling rate in a case where the positioning prediction condition is met; the first sampling rate is greater than the second sampling rate.
[0005] The first application can request to acquire continuous positioning information for multiple times.
[0006] In the embodiments of the present solution, in the case where the electronic device meets the positioning prediction condition, the collection frequency can be kept low, and if not, the collection frequency needs to be switched to high to ensure the accuracy and reliability of the positioning information. According to the state of different electronic devices, the electronic device can also support the switching of different low-frequency collection, so as to further reduce the positioning power consumption and ensure the accuracy of the positioning information.
[0007] In a possible implementation, in the case where the positioning prediction condition is met, the method further comprises: acquiring first positioning prediction information based on historical positioning collection information; and wherein the first positioning prediction information is combined with the positioning collection information acquired based on the second sampling rate to form positioning information, and the sampling rate of the positioning information formed by the combination is the same as the first sampling rate. In this way, in the case where the electronic device meets the positioning prediction condition, the collection frequency can be kept low, the sampling frequency can be reduced, the power consumption of acquiring the positioning information from the satellite system can be reduced, in addition, the first positioning prediction information is predicted, the sampling rate of the positioning information is ensured to be high, and the accuracy of the positioning information acquired by the first application is maintained.
[0008] In a possible implementation, the method further includes: acquiring positioning collection information based on the first sampling rate when the positioning prediction condition is not met. In this way, high-frequency collection can be switched to in a poor condition or environment, so as to ensure the accuracy of the collected positioning information.
[0009] In a possible implementation, the positioning information includes longitude and latitude and altitude; and when the second sampling rate is half of the first sampling rate, the acquiring of the first positioning prediction information based on the historical positioning collection information includes: determining longitude (x1, y1) and altitude h1 of the first positioning prediction information based on second longitude (X1, Y1) and first altitude H1 of the first positioning collection information, second longitude (X2, Y2) and second altitude H2 of the second positioning collection information, and third longitude (X3, Y3) and third altitude H3 of the third positioning collection information.
[0010] If the collection frequencies between the first positioning collection information and the second positioning collection information and between the second positioning collection information and the third positioning collection information are both the first sampling rate, the longitude (x1, y1) and the altitude h1 are determined as:
[0011]
[0012] If the collection frequency between the first positioning collection information and the second positioning collection information is the first sampling rate, and the collection frequency between the second positioning collection information and the third positioning collection information is the second sampling rate, the longitude (x1, y1) and the altitude h1 are determined as:
[0013]
[0014] If the collection frequencies between the first positioning collection information and the second positioning collection information and between the second positioning collection information and the third positioning collection information are both the second sampling rate, the longitude (x1, y1) and the altitude h1 are determined as:
[0015]
[0016] Wherein, ΔX1=X2-X1, ΔX2=X3-X2, ΔY1=Y2-Y1, ΔY2=Y3-Y2; ΔH2=H3-H2, ΔH1=Y2-Y1; ΔX is the displacement amount of the positioning information in the longitude direction; ΔY is the displacement amount of the positioning information in the latitude direction; ΔH is the displacement amount of the positioning information in the altitude direction; the first positioning collection information, the second positioning collection information and the third positioning collection information are three nearest historical positioning collection information obtained from far to near in time. In this way, when the positioning prediction information is obtained in the manner of two interpolation, the longitude and latitude and the altitude of the positioning prediction information can be calculated according to the above calculation formula, and the accuracy of the calculation of the positioning information can be ensured.
[0017] In a possible implementation, the positioning information comprises longitude and latitude and altitude; the obtaining of the first positioning prediction information based on the historical positioning collection information comprises: determining longitude x1 and latitude y1 and altitude h1 of the first positioning prediction information based on second longitude X1 and second latitude Y1 and first altitude H1 of the first positioning collection information, second longitude X2 and second latitude Y2 and second altitude H2 of the second positioning collection information, and third longitude X3 and third latitude Y3 and third altitude H3 of the third positioning collection information as: x1=X last +Δx; y1=Y last +Δy; h1=H last +Δh.
[0018]
[0019] Wherein, k1 is the number of the positioning prediction information obtained between the first positioning collection information and the second positioning collection information; k2 is the number of the positioning prediction information obtained between the second positioning collection information and the third positioning collection information; X last , Y last and H lastThe coordinates are, in order, the longitude, latitude, and altitude of the most recently acquired positioning information; ΔX1 = X2 - X1, ΔX2 = X3 - X2, ΔY1 = Y2 - Y1, ΔY2 = Y3 - Y2; ΔH2 = H3 - H2, ΔH1 = Y2 - Y1; ΔX is the displacement of the positioning information in the longitude direction; ΔY is the displacement of the positioning information in the latitude direction; ΔH is the displacement of the positioning information in the altitude direction; the first, second, and third positioning information are the three most recent historical positioning information acquired in order of time from farthest to closest. Thus, when acquiring positioning prediction information using k+1 interpolation, the latitude, longitude, and altitude of the positioning prediction information can be calculated according to the above formulas, ensuring the accuracy of the calculated positioning information and enabling adaptive calculation of positioning information, thus accelerating the calculation process.
[0020] In one possible implementation, the location prediction information includes time information, and the method for obtaining the first location prediction information based on historical location acquisition information further includes: determining the time information of the first location prediction information as t1 = T. last +Δt; where Δt=1 / f1; f1 is the first sampling rate, T last This is the time information of the most recently acquired location data. This allows for time-based reasoning and processing, ensuring the accuracy and reliability of the time data.
[0021] In one possible implementation, determining the second sampling rate includes: determining the second sampling rate to be half of the first sampling rate. In this way, the electronic device can acquire the second sampling rate in a defined manner, requiring less computation and effectively reducing the frequency, thus ensuring fast computation.
[0022] In one possible implementation, determining the second sampling rate includes: determining the second sampling rate as f2 = f1 / K when the displacement change rate is less than a first threshold change rate; the displacement change rate is the rate of change of latitude and longitude displacement in historical positioning data; determining the second sampling rate as f2 = f1 / K when the displacement change rate is less than the first threshold change rate and the first displacement is less than a first distance; the first displacement is the latitude and longitude displacement between the two most recently acquired historical positioning data; and determining the second sampling rate as f2 = f1 / 2 when the displacement change rate is greater than or equal to the first threshold change rate and less than the second threshold change rate; wherein the first threshold change rate is less than the second threshold change rate, K is an integer greater than 2, f2 is the second sampling rate, and f1 is the first sampling rate. In this way, the sampling rate obtained in different situations is different, and the sampling rate can be further precisely adjusted to ensure the accuracy of the obtained sampling rate and to further reduce the sampling rate, achieving more precise power consumption reduction processing.
[0023] wherein the displacement change rate is a speed of displacement change in latitude and longitude in historical positioning collection information.
[0024] In a possible implementation, in a case where the displacement change rate is less than the first threshold change rate and the first displacement is less than the first distance, the method further comprises: acquiring acceleration information, and monitoring whether the electronic device is in a state of being about to be stationary based on the acceleration information; and in a case where it is determined that the electronic device is in the state of being about to be stationary, the electronic device keeps the second sampling rate as f2=f1 / K. In this way, the device needs to be monitored in the state of being about to be stationary, the accuracy of the down-sampling opportunity is ensured, the device can be monitored sensitively, the sampling rate can be adjusted rapidly, and the timeliness of the adjustment is ensured.
[0025] In a possible implementation, the positioning prediction condition comprises one or more of a collection frequency condition, a satellite signal quality condition, and a positioning change condition; the collection frequency condition is a condition that the first sampling rate is greater than or equal to a first threshold sampling rate; the satellite signal quality condition is a condition that a first satellite quantity is greater than or equal to a threshold satellite quantity, and / or a first signal strength is greater than or equal to a threshold signal strength; and the positioning change condition is a condition that a movement change angle is less than a threshold included angle, and / or a displacement change rate is greater than or equal to (greater than) a second threshold change rate; wherein the first satellite quantity is a quantity of satellites from which the electronic device can currently receive satellite signals; and the first signal strength is a degree of signal quality of received satellite information. In this way, the collection frequency condition limits the collection frequency, ensures that it is necessary to reduce the sampling frequency only in a case where the positioning is collected at a high frequency, and ensures an accurate opportunity of switching the sampling rate. The satellite signal quality condition can ensure that the signal quality received by the electronic device is good, for example, the signal quality is good in an open place and the signal quality is poor in a sheltered place; the sampling frequency of the electronic device is reduced when the signal quality is good, and the accuracy of the positioning information obtained by the electronic device is ensured. In the positioning change condition, the smaller the threshold included angle is in a case where the movement speed is faster, the smaller the threshold included angle limit is in a case where the movement speed of the electronic device is increased, and the threshold included angle limit can make the direction of the electronic device be in a small range, and the accuracy of the predicted positioning information is ensured.
[0026] In a possible implementation, in a case where the positioning prediction condition comprises the positioning change condition, the method further comprises: determining a displacement change rate R=|S1-S2| / S2 based on first latitude and longitude (X1, Y1) of first positioning collection information, second latitude and longitude (X2, Y2) of second positioning collection information, and third latitude and longitude (X3, Y3) of third positioning collection information; S1 and S2 are displacements of two consecutive times of collecting positioning information, and are respectively
[0027] ΔX1=X2-X1, ΔX2=X3-X2, ΔY1=Y2-Y1, ΔY2=Y3-Y2; ΔX is the displacement amount of the positioning information in the longitude direction; ΔY is the displacement amount of the positioning information in the latitude direction; and / or determining a movement change angle based on the second positioning acquisition information of the second longitude and latitude (X2, Y2) and the third positioning acquisition information of the third longitude and latitude (X3, Y3) Wherein, the first positioning acquisition information, the second positioning acquisition information and the third positioning acquisition information are the last three historical positioning acquisition information obtained from far to near in time. In this way, the electronic device calculates the displacement change rate and / or the movement change angle, ensuring the accuracy of the positioning change condition judgment and the accuracy of the sampling rate calculation.
[0028] In a possible implementation, the range of the threshold included angle is 2°-10°; and the range of the second threshold change rate is 5%-15%. In this way, the accuracy and reliability of the inferred positioning information can be ensured by limiting the threshold included angle and the second threshold change rate.
[0029] In a possible implementation, after the acquisition frequency is switched from the first sampling rate to the second sampling rate, the method further comprises: judging whether the positioning prediction condition is met, and switching the acquisition frequency from the second sampling rate to the first sampling rate if the positioning prediction condition is not met. In this way, the positioning prediction condition is detected when the low-frequency acquisition is performed, and the acquisition frequency is switched back to the high frequency if the positioning prediction condition is not met, so as to ensure the accuracy of the positioning information.
[0030] In a possible implementation, the positioning acquisition information is obtained based on the second sampling rate if the positioning prediction condition is met.
[0031] In a possible implementation, after the acquisition frequency is switched from the first sampling rate to the second sampling rate, the method further comprises: determining that the electronic device is in a first low-frequency state if the first positioning acquisition information is obtained based on the second sampling rate; determining that the electronic device is in a second low-frequency state and determining a third sampling rate if the positioning prediction condition is met, and switching the acquisition frequency from the second sampling rate to the third sampling rate, wherein the third sampling rate is smaller than the first sampling rate, the second sampling rate is different from the third sampling rate, the first low-frequency state corresponds to the second sampling rate, and the second low-frequency state corresponds to the third sampling rate. The first low-frequency state and the second low-frequency state are different low-frequency acquisition states. In this way, the low-frequency sampling rates can be switched, so as to more accurately control the power consumption and balance the accuracy of the positioning information and the power consumption.
[0032] In a possible implementation, the first low-frequency state and the second low-frequency state are different low-frequency states of the electronic device; the low-frequency states include a state of approaching stillness, a state of small-amplitude variable speed, and a state of uniform speed; when a displacement change rate is less than a first threshold change rate, the electronic device is in the state of uniform speed, and a corresponding sampling rate of the state of uniform speed is f2=f1 / K; when the displacement change rate is less than the first threshold change rate and a first displacement is less than a first distance, the electronic device is in the state of approaching stillness, and a corresponding sampling rate of the state of approaching stillness is f2=f1 / K; when the displacement change rate is greater than or equal to the first threshold change rate and less than a second threshold change rate, the electronic device is in the state of small-amplitude variable speed, and a corresponding sampling rate of the state of small-amplitude variable speed is f2=f1 / 2; wherein the first threshold change rate is less than the second threshold change rate, K is an integer greater than 2, f2 is a second sampling rate, and f1 is a first sampling rate. In this way, different low-frequency states can be switched between each other, and the conditions for judgment can ensure the timing of switching to be accurate.
[0033] In a possible implementation, when the electronic device acquires positioning collection information once, the process of determining whether the positioning prediction condition is met is performed once. In this way, the positioning prediction condition is determined once every time the positioning collection information is acquired, thereby ensuring the timeliness and accuracy of the electronic device being in the preparation state and the control state.
[0034] In a possible implementation, when the electronic device does not acquire positioning collection information through the first sampling rate, if the process of determining whether the positioning prediction condition is met is performed once and it is determined that the positioning prediction condition is met, the sampling rate is determined once. In this way, in the control state, the sampling rate is acquired once every time it is determined that the positioning prediction condition is met, thereby ensuring the sensitivity and timeliness of switching between different low-frequency sampling rates.
[0035] In a possible implementation, the electronic device comprises a positioning module and a GPS driver, the obtaining the positioning collection information based on the first sampling rate comprises: obtaining the positioning collection information based on the first sampling rate by the GPS driver; the GPS driver sends the positioning collection information to the positioning module; the determining whether the positioning prediction condition is met, and in the case that the positioning prediction condition is met, determining the second sampling rate and switching the collection frequency from the first sampling rate to the second sampling rate comprises: determining whether the positioning prediction condition is met by the positioning module, and in the case that the positioning prediction condition is met, determining the second sampling rate; sending the sampling frequency switching instruction to the GPS driver by the positioning module, the sampling frequency switching instruction comprising the second sampling rate; the GPS driver obtains the positioning collection information according to the second sampling rate. In this way, the GPS driver can realize the switching between different sampling rates, and reduce the power consumption of obtaining the positioning information.
[0036] In a possible implementation, the electronic device further comprises a position management module, the obtaining the first positioning prediction information based on the historical positioning collection information comprises: calculating the first positioning prediction information based on the historical positioning collection information by the positioning module, and performing filling processing on the first positioning prediction information to obtain the positioning information; the positioning module sends the positioning information to the position management module. In this way, the power consumption of obtaining the positioning information can be reduced.
[0037] In a second aspect, an embodiment of the present application provides an electronic device, comprising: one or more processors and one or more memories; the one or more processors are coupled with the one or more memories, and the one or more memories are configured to store computer program codes, the computer program codes comprising computer instructions, when the one or more processors execute the computer instructions, causing the electronic device to perform the positioning obtaining method in the first aspect or any possible implementation manner of the first aspect.
[0038] In a third aspect, an embodiment of the present application provides a computer storage medium, comprising computer instructions, when the computer instructions run on an electronic device, causing the device to perform the positioning obtaining method in any possible implementation manner of the first aspect.
[0039] In a fourth aspect, an embodiment of the present application provides a computer program product, when the computer program product runs on a computer, causing the computer to perform the positioning obtaining method in any possible implementation manner of the first aspect.
[0040] In a fifth aspect, an embodiment of the present application provides a chip system applied to an electronic device, the chip system comprising one or more processors configured to invoke computer instructions to cause the electronic device to perform the positioning acquisition method according to the first aspect or any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF DRAWINGS
[0041] The drawings used in the embodiments of the present application are described below.
[0042] Figure 1 is a hardware structure schematic diagram provided by an embodiment of the present application;
[0043] Figure 2 is a software structure block diagram of an electronic device provided by an embodiment of the present application;
[0044] Figure 3 is a schematic diagram of a satellite positioning system provided by an embodiment of the present application;
[0045] Figure 4A and Figure 4B are a group of software framework schematic diagrams provided by an embodiment of the present application;
[0046] Figure 5 is a flowchart of an electronic device positioning information acquisition method provided by an embodiment of the present application;
[0047] Figure 6 is a positioning latitude and longitude change schematic diagram provided by an embodiment of the present application;
[0048] Figure 7 is a method flowchart for determining a sampling frequency provided by an embodiment of the present application;
[0049] Figure 8A and Figure 8B are a group of positioning prediction information acquisition method schematic diagrams provided by an embodiment of the present application;
[0050] Figures 9A-9D are another group of positioning prediction information acquisition method schematic diagrams provided by an embodiment of the present application;
[0051] Figure 10 is a method flowchart for determining a sampling frequency provided by an embodiment of the present application;
[0052] Figures 11A-11D is an interactive method flowchart for positioning information acquisition provided by an embodiment of the present application;
[0053] Figure 12 is a method schematic diagram for predicting a reporting time provided by an embodiment of the present application;
[0054] Figures 13A-13DFIG. 2 is another flowchart illustrating a method for acquiring positioning information according to an embodiment of the present application. DETAILED DESCRIPTION
[0055] The terminology used in the following embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the present application. As used in the specification and the appended claims of the present application, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0056] An electronic device can be a device that provides voice and / or data connectivity to a user. An electronic device can be a handheld terminal, a notebook computer, a subscriber unit, a cellular phone, a smart phone, a wireless data card, a personal digital assistant (PDA) computer, a tablet computer, a wireless modem, a handheld device, a laptop computer, a cordless phone, or a wireless local loop (WLL) station, a machine type communication (MTC) terminal, a wearable device (e.g., a smart watch, a smart band, a pedometer, etc.), a vehicle-mounted device (e.g., a car, a bicycle, an electric vehicle, an airplane, a ship, a train, a high-speed rail, etc.), a virtual reality (VR) device, an augmented reality (AR) device, a wireless terminal in industrial control, a smart robot, a plant device, a wireless terminal in self driving, a wireless terminal in remote medical surgery, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, or a wireless terminal in a smart home, a flight device (e.g., a smart robot, a hot air balloon, a drone, an airplane), or other devices that can access a network.
[0057] In order to better understand the embodiments of the present application, the structure of the electronic device of the embodiments of the present application is introduced as follows:
[0058] Figure 1 The hardware structure schematic diagram of the electronic device is shown. The electronic device can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a sensor module 180, a display screen 194, and the like. Among them, the sensor module 180 can include an acceleration sensor 180E, a touch sensor 180K, and the like.
[0059] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than the diagram, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.
[0060] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the electronic device. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, and the like on the received electromagnetic waves, and transmit to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic waves by the antenna 1 to radiate it out.
[0061] The modem processor can include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal is transmitted to the application processor after being processed by the baseband processor.
[0062] The wireless communication module 160 can provide a solution for wireless communication applied to the electronic device, including Wireless Local Area Networks (WLAN) (e.g., a Wireless Fidelity (Wi-Fi) network), Bluetooth (BT), a Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), Infrared (IR) technology, and the like. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, frequency-modulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and radiate it as an electromagnetic wave via the antenna 2.
[0063] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device can communicate with a network and other devices through wireless communication technology.
[0064] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.
[0065] The controller can generate operation control signals according to instruction operation codes and timing signals to complete the control of fetching and executing instructions.
[0066] The processor 110 can also have a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has just used or is using repeatedly. If the processor 110 needs to use the instructions or data again, it can be called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thus improving the efficiency of the system.
[0067] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is illustrative and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device can also use different interface connection modes in the above embodiments, or a combination of multiple interface connection modes.
[0068] The wireless communication function of the electronic device can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.
[0069] The electronic device realizes the display function through the GPU, the display screen 194, and the application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0070] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can use a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diode (QLED), etc.
[0071] The sensor module 180 can include one or more sensors, which can be of the same type or different types. It can be understood that Figure 1 The sensor module 180 shown is only an exemplary division, and other division methods are also possible, which are not limited in the present application.
[0072] The acceleration sensor 180E can detect the magnitude of acceleration of the electronic device in various directions (typically three axes). The magnitude and direction of gravity can be detected when the electronic device is stationary. It can also be used to identify the electronic device posture, applied to landscape / portrait screen switching, pedometer, etc.
[0073] The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K can be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also referred to as a "touch screen". The touch sensor 180K is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the touch event type. Visual output related to the touch operation can be provided through the display screen 194. In other embodiments, the touch sensor 180K can also be disposed on the surface of the electronic device, which is different from the position where the display screen 194 is located.
[0074] In the embodiments of the present application, the electronic device can include a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes central processing unit (CPU), memory management unit (MMU), and memory (also known as main memory) and other hardware. The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux operating system, Unix operating system, Android operating system, iOS operating system, or windows operating system, etc. The application layer includes browsers, address books, word processing software, instant messaging software, etc.
[0075] The software system of the electronic device can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture, etc. The embodiments of the present application take the Android system with a layered architecture as an example to exemplarily illustrate the software structure of the electronic device.
[0076] Figure 2 is a software structure block diagram of the electronic device of the embodiments of the present application. Figure 2 An electronic device obtains positioning information.
[0077] A layered architecture divides software into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom, the application layer (App layer), the application framework layer (application framework, FWK layer), the hardware abstraction layer (Hardware Abstraction Layer, HAL), the kernel layer and the hardware layer.
[0078] The application layer can include a series of application packages. As shown in Figure 2 , the application layer can include XX map, XX navigation, weather and calendar applications. It should be noted that the application packages that the electronic device can include can not be limited to the above-mentioned applications, and can also include other applications, or can not include the above-mentioned applications, and the present application does not limit this.
[0079] An application in the application layer can request geographic location information from the FWK layer. For example, XX navigation sends a location acquisition request to the FWK layer (location management module). The location acquisition request can include a location start acquisition request and a location end acquisition request to determine the start and end of location acquisition. After the FWK starts acquiring positioning information, XX navigation can receive positioning information from the FWK layer.
[0080] The application framework layer provides APIs and programming frameworks for the applications in the application layer. The application framework layer includes some pre-defined functions.
[0081] As shown in Figure 2 , the application framework layer can include a location management module (Location Manager), which can manage the functions of geographic location information. The location management module can be based on the location request of each application in the application layer, and report the positioning information to the corresponding application. For example, the location management module receives a location information request from XX navigation, and the location management module can acquire positioning information from the HAL layer and report the acquired positioning information to XX navigation.
[0082] The positioning module of the HAL layer can receive a positioning request from the FWK layer. The positioning request can include a reporting interval and parameter information. The reporting interval can indicate the sampling frequency information or the period information of acquiring positioning information; the parameter information can include the data structure information (GPSLocation data structure) of the positioning information. The data structure information can include the storage type and structure of the positioning information. For example, latitude and longitude, altitude, timestamp, and other data structures (information content).
[0083] After the positioning module receives the positioning request from the GPS driver, the positioning module can read the positioning information through the GPS standard protocol interface based on the reporting interval. After reading the positioning information, the positioning module can fill the data based on the data structure information (GPSLocation data structure). The filled positioning information is reported to the FWK layer.
[0084] The positioning module can also receive the positioning start-stop information from the FWK layer. The positioning start-stop information can be used to indicate the start or stop of acquiring positioning information. The positioning module can start or end the acquisition of positioning information based on the positioning start-stop information. The positioning module can send a positioning start-stop instruction to the GPS driver based on the positioning start-stop information. The positioning start-stop instruction is used to instruct the GPS driver to start or end the acquisition of GPS information.
[0085] The kernel layer is the layer between hardware and software. The kernel layer can include GPS drivers, display drivers, etc.
[0086] The GPS driver can control the GPS chip to parse and process navigation text data and convert the data format to obtain positioning information, and send the positioning information to the HAL module through the GPS standard protocol. The GPS driver can send the parsed positioning information to the HAL module through the GPS standard protocol interface. The GPS standard protocol interface can include a universal asynchronous receiver / transmitter (UART) interface, a universal serial bus (USB) interface, a serial peripheral interface (SPI) interface, and an inter integrated circuit (I2C) interface, etc.
[0087] The GPS driver can receive the positioning acquisition instruction from the HAL layer and acquire positioning information based on the positioning acquisition instruction. The positioning acquisition instruction can include a sampling frequency. The sampling frequency can be the frequency of acquiring positioning information.
[0088] The GPS driver can determine to start acquiring positioning signals or end acquiring positioning information based on the positioning start-stop instruction issued by the HAL layer. For example, in the case where the positioning start-stop instruction indicates to start acquiring positioning information, the GPS driver can control the communication module and the GPS chip to acquire GPS positioning signals and parse GPS-related data.
[0089] The hardware layer can include a communication module, a GPS chip, and a display screen, etc. The communication module can receive positioning information from a satellite positioning system. The GPS chip can parse and process the received navigation text data.
[0090] The communication module can include a radio frequency module and a baseband module. The radio frequency module can transmit or receive signals to the satellite. The satellite can transmit a positioning signal to the electronic device through a specific carrier frequency band, and the electronic device can receive the positioning signal through the radio frequency module. The carrier frequency band used by the satellite positioning system can be carrier L1, L2, pseudo-noise code C / A code, P code navigation text D code, which is not limited in the present application. The baseband module can demodulate the positioning signal according to the specific carrier frequency band to obtain navigation text data, and then transmit the navigation text data to the GPS chip.
[0091] The GPS chip receives the navigation text data from the baseband module and can analyze and process the navigation text data. The analysis and processing can include demodulation of the navigation text data, pseudo-distance calculation of the user position, ephemeris calculation of the satellite position, and the like. After the analysis and processing of the navigation text data is completed, the data format conversion according to the GPS standard can be performed to obtain positioning information. After the GPS chip obtains the positioning information, the positioning information can be transmitted through the UART interface. The GPS chip can use a drive polling method to obtain the positioning information. For example, the GPS chip can periodically report the positioning information to the GPS drive according to the time interval of the sampling period corresponding to the sampling frequency.
[0092] With the gradual popularization of smart electronic devices, the use of GPS for high-precision satellite positioning has gradually increased. In daily travel, vehicle navigation, running, and other scenarios, most customers will use smart terminals (electronic devices). For example, the electronic device is installed with navigation software (such as XX map, vehicle map), the user wants to reach position B, opens the XX map software of the electronic device, and determines the destination as position B, and the XX map will obtain GPS positioning information and plan a route according to the positioning information.
[0093] The electronic device can obtain positioning information through a satellite positioning system, such as Figure 3 A schematic diagram of a satellite positioning system is provided for the embodiments of the present application. As shown in Figure 3 In the satellite positioning system, the electronic device needs to receive broadcast information from 4 or more satellites to obtain positioning information. Due to the long distance between the satellites, the positioning process takes a long time. After the electronic device obtains the positioning information, it needs to be calculated, and the calculation process is complex and consumes a large amount of power.
[0094] In the embodiments of the present application, the satellite positioning system can be obtained through a global positioning system (GPS), a Beidou satellite navigation system, a GLONASS, a Galileo satellite navigation system, etc. The embodiments of the present application are not limited.
[0095] In the process of positioning by using a satellite positioning system, a high power consumption is caused. For example, for a navigation application of an XX map, the collection frequency of positioning information is about 1s / time (1Hz) of a fixed frequency; and for a motion application, the collection frequency is 2s / time (0.5Hz). The positioning chip calling is accompanied by the collection of the positioning information of accurate positioning, and the power consumption is increased. Further, in the navigation process, the higher the reporting frequency of the position information of the user is, the greater the power consumption is.
[0096] Exemplarily, through testing, the power consumption feedback data of a vehicle-mounted navigation system is obtained. When the vehicle-mounted navigation system is in a navigation process, the battery power consumption speed is 719mA, 172mAh is consumed in 14 minutes and 20 seconds of navigation, and the battery capacity is close to 3%.
[0097] In conclusion, the power consumption of the acquisition process of the positioning information is large, and the high frequency of acquiring the positioning information further increases the power consumption of the acquisition of the positioning information of the electronic device.
[0098] In view of the above technical problems, the embodiment of the present application provides a positioning information acquisition method and an electronic device. The electronic device can switch the collection frequency of the positioning information. When the electronic device meets a positioning prediction condition, the collection frequency can be switched from a high frequency to a low frequency, and new positioning information is calculated according to the recently collected positioning information. The reduction of the collection frequency of the positioning information can reduce the power consumption of the electronic device. Of course, when the electronic device meets the positioning prediction condition, the low frequency collection frequency can be maintained, and if not, the high frequency collection frequency needs to be switched to ensure the accuracy and reliability of the positioning information. According to the state of the electronic device, the electronic device can also support the switching of different low frequency collections, so as to further reduce the positioning power consumption and ensure the accuracy of the positioning information.
[0099] Figure 4A And Figure 4B is a set of software framework schematic diagrams exemplarily disclosed by the embodiment of the present application.
[0100] As Figure 4A shown, the layered architecture can also divide the Android system into five layers from top to bottom, namely, an application program layer (an App layer), an application program framework layer, a hardware abstraction layer, a kernel layer and a hardware layer.
[0101] The positioning module of the HAL layer can include a positioning frequency switching module. The positioning frequency switching module is a functional module for managing the switching of the positioning information collection frequency. After receiving the positioning information request from the location management module, the positioning frequency switching module can determine whether the current collection frequency needs to be switched, thereby achieving the switching between different positioning information collection frequencies. In the case of collecting positioning information at a low frequency, the positioning frequency switching module can also calculate the positioning information and report the calculated positioning information to the location management module according to the high-frequency requirement of the location management module.
[0102] The kernel layer can also include an acceleration driver, which can obtain acceleration information from an acceleration sensor. The hardware layer can also include an acceleration sensor, and the description of the acceleration sensor can refer to the related content in Figure 1 , which will not be described here.
[0103] In the embodiments of the present application, if the electronic device is in a mode, the acceleration driver can obtain acceleration data from the acceleration sensor to determine whether the state of the electronic device is in a stationary or moving state. Of course, the electronic device can also call the AR algorithm of the sensorhub or the state of the terminal device such as stationary or moving.
[0104] As shown in Figure 4B , unlike Figure 4A , the location manager of the FWK layer can include a positioning frequency switching module. The execution function of the positioning frequency switching module can refer to the positioning frequency switching module in Figure 4A . On the basis of the above, the positioning frequency switching module can also send the calculated positioning information to the corresponding application program according to the request of the corresponding application program. Figure 4B The related description of the remaining modules can refer to the content of Figure 4A , which will not be described here.
[0105] It should be noted that in the above Figure 4A and Figure 4B software framework diagrams, the positioning frequency switching module can be in the FWK layer, the HAL layer, or other layers. The above is only an exemplary description and is not limited.
[0106] Figure 4A and Figure 4B The related description of the remaining modules can refer to the related content of Figure 2 , which will not be described here.
[0107] In combination with the related description of Figure 4A and Figure 4B , the process of the electronic device obtaining positioning information from the satellite positioning system is specifically described.
[0108] Figure 5FIG. 1 is a flowchart of an electronic device positioning information acquisition method according to an embodiment of the present application. As shown in FIG. 1, the positioning information acquisition method can include, but is not limited to, the following steps: Figure 5
[0109] In the case that the electronic device acquires the positioning information request, S501 is performed.
[0110] The positioning state can indicate whether the electronic device is in the process of positioning. The positioning state can include an open state and a closed state. The open state can indicate that the positioning information is being acquired; the closed state can indicate that the positioning information is not currently acquired. In the case that the electronic device acquires the positioning information request, the positioning state can be switched from the closed state to the open state. In the case that the positioning state is determined to be in the open state, the electronic device determines that the positioning state condition is met; in the case that the positioning state is determined to be in the closed state, the electronic device determines that the positioning state condition is not met.
[0111] Exemplarily, the user clicks XX navigation in the electronic device, and the XX navigation application can request to open the positioning information acquisition function, that is, the XX navigation can send a first positioning start-stop request to the FWK layer to request to start acquiring positioning information. After the FWK layer receives the positioning start-stop request, the first positioning request state can be determined to be adjusted from the closed state to the open state. After a period of time, the user clicks to exit the XX navigation, and the XX navigation can send a second positioning start-stop request to the FWK layer to request to end acquiring positioning information. After the FWK layer receives the second positioning start-stop request, the electronic device can determine that the positioning request state is adjusted from the open state to the closed state. The above-mentioned positioning state condition can be met in the open state time period.
[0112] It should be noted that if the above-mentioned judgment process is performed by the positioning module of the HAL layer, the positioning start-stop instruction sent by the FWK layer to the HAL layer can be used for judgment, and the specific process can be reasonably referred to the above-mentioned exemplary description, which will not be described herein.
[0113] S501: The electronic device acquires positioning information based on a first sampling rate.
[0114] In the case that the electronic device starts to acquire positioning information, the electronic device can request positioning information from the satellite positioning system based on the acquisition frequency. At this time, the acquisition frequency is the first sampling rate, for example, 1 Hz.
[0115] The positioning collection information is positioning information requested by the electronic device from the satellite positioning system. The positioning information can include a timestamp, a satellite number, a signal strength, an altitude, a longitude and a latitude. The timestamp can represent a time since the GPS chip is started, and can indirectly represent the acquisition time of the positioning information. The satellite number can represent the number of satellites that can be communicated by the electronic device. The signal strength can represent the strength of the satellite signal received by the electronic device, such as signal power, signal-to-noise ratio, and the like, without limitation. The altitude and the longitude and latitude can represent the spatial geographical position of the current electronic device, i.e., the longitude, latitude and altitude.
[0116] In the embodiments of the present application, the positioning information can include two types: positioning collection information and positioning prediction information. The positioning collection information can refer to the positioning information obtained by the electronic device from the satellite positioning system, especially the altitude, longitude and latitude information. The positioning prediction information can refer to the positioning information obtained by the electronic device based on the positioning collection information obtained at the moment, and it can be understood that the positioning prediction information comes from the electronic device itself rather than the satellite positioning system.
[0117] S502: The electronic device determines whether the positioning prediction condition is met. In the case where the positioning prediction condition is met, S503 is performed; in the case where the positioning prediction condition is not met, S501 is performed.
[0118] In the embodiments of the present application, the sampling frequency of the electronic device corresponds to at least two states: a preparation state and a control state. The preparation state can correspond to a high-frequency sampling frequency; the control state can correspond to a low-frequency sampling frequency. The electronic device can switch between the high-frequency and low-frequency sampling frequencies. Assuming that the electronic device starts positioning collection according to a first sampling rate and is in the preparation state (at this time, the first sampling rate can be greater than a certain sampling threshold (the sampling frequency is high)). After the electronic device acquires the positioning collection information according to the first sampling rate, it needs to further determine whether to remain in the preparation state (i.e., whether to switch the sampling frequency), and in the case where the positioning prediction condition is met, it is determined to switch the sampling frequency. S503 is performed; otherwise, it remains in the preparation state (without switching the sampling frequency), and S501 is performed.
[0119] In the preparation state, the electronic device determines whether the positioning prediction condition is met once for each positioning collection (S502 is performed once). The positioning prediction condition can be a condition for determining whether to switch the positioning information collection frequency.
[0120] The positioning prediction condition can include one or more of the following three conditions: a collection frequency condition, a satellite signal quality condition and a positioning change condition. The present application does not limit the conditions included in the positioning prediction condition.
[0121] The collection frequency condition is that the first sampling rate is greater than or equal to (greater than) the first threshold sampling rate. Alternatively, the first sampling period is less than or equal to (less than) the first threshold period.
[0122] The electronic device can determine that the first sampling rate is greater than or equal to (greater than) the first threshold sampling rate. In the case where the first sampling rate is greater than or equal to (greater than) the first threshold sampling rate, the collection frequency condition is met; in the case where the first sampling rate is less than (less than or equal to) the first threshold sampling rate, the collection frequency condition is not met. The electronic device can determine whether the current is in a high-frequency satellite positioning frequency, that is, whether there is a need for downsampling. In the case of high frequency, it can be determined that downsampling is needed, otherwise, downsampling is not needed. In this way, the limitation of the collection frequency ensures that there is a need to reduce the sampling frequency only in the case of high-frequency sampling positioning, and ensures the accurate timing of switching the sampling rate.
[0123] The first threshold sampling rate can be greater than or equal to 0.2 Hz. The first threshold period can be less than or equal to 5 s.
[0124] The satellite signal quality condition is that the first satellite quantity is greater than or equal to (greater than) the threshold satellite quantity and / or the first signal strength is greater than or equal to (greater than) the threshold signal strength.
[0125] The satellite signal quality condition can measure the degree of satellite signal quality. The satellite signal quality condition can include one or more of the satellite quantity condition and the signal strength condition.
[0126] The satellite quantity condition is that the first satellite quantity is greater than or equal to (greater than) the threshold satellite quantity.
[0127] The electronic device can be provided with a threshold satellite quantity. The GPS driver of the electronic device can obtain the first satellite quantity through the communication module. In the case where the first satellite quantity (the currently obtained satellite quantity) is greater than or equal to (greater than) the threshold satellite quantity, it is determined that the satellite quantity condition is met; in the case where the first satellite quantity (the currently obtained satellite quantity) is less than (less than or equal to) the threshold satellite quantity, it is determined that the satellite quantity condition is not met.
[0128] Exemplarily, in the case where the threshold satellite quantity is 4 and the first satellite quantity is 7 (7>4), the electronic device can meet the satellite quantity condition; in the case where the first satellite quantity is 2 (2<4), the electronic device can not meet the satellite quantity condition.
[0129] The threshold satellite quantity range can be 3-5.
[0130] The signal strength condition is that the first signal strength is greater than or equal to (greater than) the threshold signal strength.
[0131] The electronic device can be provided with a threshold signal strength. The GPS driving of the electronic device can obtain a first signal strength through the communication module. In the case that the first signal strength (the number of satellites currently acquired) is greater than or equal to (greater than) the threshold signal strength, it is determined that the signal strength condition is met; in the case that the first signal strength (the number of satellites currently acquired) is less than (equal to or less than) the threshold signal strength, it is determined that the signal strength condition is not met. Wherein, the signal strength can indicate the strength of the satellite signal received by the electronic device, for example, the reference signal receiving power (RSRP). In this way, the signal strength and the number of satellites can ensure that the signal quality received by the electronic device is good, for example, the signal quality is good in an open place, and the signal quality is poor in a shielding place; reducing the sampling frequency of the electronic device when the signal quality is good can ensure the accuracy of the positioning information acquired by the electronic device.
[0132] The above-mentioned signal strength condition can also be a condition that the signal-to-noise ratio of the satellite signal is greater than a threshold signal-to-noise ratio, for example, the signal-to-interference plus noise ratio (SINR) and the like. The specific data type compared by the signal strength condition is not limited in the present application.
[0133] Exemplarily, the threshold signal strength is -48dBm (signal-to-noise ratio data), the first signal strength is -21dBm, and -21dBm>-48dBm, so it can be determined that the signal strength condition is met.
[0134] The positioning change condition: the movement change angle is less than a threshold included angle, and / or, the displacement change rate is greater than or equal to (greater than) a threshold change rate.
[0135] The movement change amount includes the displacement change rate and / or the movement change angle. The corresponding threshold change amount includes the threshold change rate and / or the threshold included angle. Wherein, the displacement change rate is the proportional value of the displacement change of the last two times; the movement change angle is the included angle size of the longitude and latitude in the positioning information collected for two times.
[0136] First step: the electronic device can calculate the movement displacement amount and / or the displacement change rate based on the last two (or three) times of collected positioning information.
[0137] The parameters of the positioning information can be represented as longitude X, latitude Y, time stamp T, and altitude H. The last two times of collected positioning information are the first positioning collection information and the second positioning collection information. The first positioning collection information includes the first longitude and latitude (X1, Y1); the second positioning collection information includes the second longitude and latitude (X2, Y2).
[0138] Figure 6is a positioning latitude and longitude change schematic diagram disclosed by an embodiment of the present application. As shown in Figure 6 The plane where the latitude and longitude is located can be abstracted as a plane rectangular coordinate system, and the first latitude and longitude (X1, Y1) and the second latitude and longitude (X2, Y2) are respectively located at two points in the plane rectangular coordinate system. (X1, Y1) can be simplified to determine the origin. The electronic device calculates the movement displacement and / or the movement change angle based on the two points in the plane rectangular coordinate system abstracted in Figure 6 .
[0139] The electronic device can calculate the movement displacement based on the first latitude and longitude (X1, Y1) and the second latitude and longitude (X2, Y2) as Of course, in order to facilitate calculation, the movement displacement S = ΔX 2 + ΔY 2 may also be defined. Wherein, ΔY = Y2-Y1, ΔX = X2-X1.
[0140] The electronic device can also calculate the movement change angle θ based on the first latitude and longitude (X1, Y1) and the second latitude and longitude (X2, Y2).
[0141]
[0142] Further, the positioning information collected in the last three times further includes third positioning collection information, and the third positioning collection information can include third latitude and longitude (X3, Y3). The electronic device can determine the displacement change rate in the case that the first latitude and longitude (X1, Y1), the second latitude and longitude (X2, Y2) and the third latitude and longitude (X3, Y3) are known. Wherein, the displacement in the latitude and longitude direction is ΔX1 = X2-X1; ΔX2 = X3-X2. ΔY1 = Y2-Y1; ΔY2 = Y3-Y2. The electronic device can determine the displacement before and after as The electronic device can calculate the displacement change rate R = |S1-S2| / S2 based on the displacement before and after S1 and S2.
[0143] Second step: The electronic device determines whether the positioning change condition is met.
[0144] Case 1: The electronic device can determine whether the positioning change condition is met based on the movement change angle and the threshold included angle.
[0145] In the case that the movement change angle is greater than or equal to (greater than) the threshold included angle θ1, the electronic device can determine that the positioning change condition is not met; in the case that the movement displacement is less than (less than or equal to) the threshold displacement S1, and / or, the movement change angle is less than (less than or equal to) the threshold included angle θ1, the electronic device can determine that the positioning change condition is met.
[0146] The change of the positioning coordinates can determine the turning condition and the speed condition of the electronic device. In the case of large displacement change, the electronic device cannot reduce the sampling rate to ensure the accuracy of the positioning information. In the case of small displacement change, the electronic device reduces the positioning sampling frequency, and the predicted positioning information can also meet the requirement of the accuracy of the positioning information, and the power consumption can be effectively reduced.
[0147] It should be noted that the threshold angle θ1 can be a fixed value or a variable value. In the case of a variable threshold angle, the electronic device can first determine the threshold angle θ1 before executing the positioning change condition.
[0148] For example, the first distance is 20 m (corresponding to a moving displacement speed of about 70 km / h), the first angle is 3°, the second angle is 5°, and in the case of a current moving displacement of 31 m > 20 m, the threshold angle can be determined to be 3°; in the case of a current moving displacement of 16 m < 20 m, the threshold angle can be determined to be 5°.
[0149] In the embodiments of the present application, the threshold angle ranges from 2° to 10°.
[0150] Alternatively, the electronic device can set the threshold angle based on the moving speed. For example, the higher the moving speed, the smaller the threshold angle. For example, the moving speed and the threshold angle are inversely proportional, etc. For example, in the process of walking with the electronic device, the threshold angle is determined to be 8 degrees, in the process of riding, the threshold angle is determined to be 6 degrees; in the process of driving, the threshold angle is determined to be 5 degrees; in the process of high-speed rail, the threshold angle is determined to be 2 degrees, etc. In this way, the faster the moving speed, the smaller the threshold angle, and the electronic device can ensure that the moving speed increases and the threshold angle limit becomes smaller. The threshold angle limit can make the direction of the electronic device within a small range, and ensure the accuracy of the predicted positioning information.
[0151] Case 2: The electronic device can determine whether the positioning change condition is met based on the displacement change rate R and the second threshold change rate R2.
[0152] The electronic device can determine whether the displacement change rate R is greater than or equal to (greater than) the second threshold change rate. In the case of greater than or equal to (greater than) the second threshold change rate, the electronic device can determine that the positioning change condition is not met. In the case of less than (less than or equal to) the second threshold change rate, the electronic device can determine that the positioning change condition is met. In this way, in the above two cases, the displacement change rate and the moving change angle limit can ensure that the acceleration of the electronic device is small, and the turning angle is small, so that the electronic device can be in a stable state, thereby ensuring the accuracy of the predicted positioning information.
[0153] The range of the second threshold rate of change can be 5% to 15%, for example, 10%.
[0154] It should be noted that the determination of whether the positioning change condition is met by the electronic device can include case 1 and / or case 2, which is not limited in the present application.
[0155] The positioning prediction condition is met only when all conditions in the positioning prediction condition are met. That is, in the case where the above-mentioned positioning prediction condition is met including the positioning change condition, the positioning change condition needs to be met to meet the positioning prediction condition. In the embodiments of the present application, the execution order of all conditions in the positioning prediction condition is not limited.
[0156] In order to save the acquisition power of the positioning information, the electronic device can reduce the collection frequency of the positioning collection information, but the reduction of the collection frequency will affect the effect of the application on the positioning data processing. Therefore, the determination of whether to reduce the frequency is determined by the positioning prediction condition to ensure the acquisition effect of the positioning information.
[0157] S503: The electronic device determines the second sampling rate.
[0158] The electronic device can determine the second sampling rate when it is determined that the sampling frequency needs to be switched. The second sampling rate can be used for positioning sampling after switching.
[0159] In one possible implementation, the electronic device can directly determine the second sampling rate based on the current sampling frequency.
[0160] The electronic device can directly determine the second sampling rate as half of the first sampling rate. Of course, the electronic device can directly determine the second sampling rate as 1 / 3 of the first sampling rate, etc., and the determination method of the second sampling rate is not limited in the present application. In this way, the electronic device can directly determine the second sampling rate as half of the first sampling rate, which is simple and effective in determining the second sampling rate, and is fast and efficient in determining the second sampling rate.
[0161] For example, assuming that the first sampling rate is f1 and the second sampling rate is f2, the electronic device can determine f2 = f1 / 2.
[0162] In another possible implementation, the electronic device can determine the second sampling rate based on the displacement rate of change.
[0163] After the electronic device calculates the displacement rate of change R = |S1-S2| / S2, it determines the second sampling rate based on the displacement rate of change R.
[0164] After obtaining the displacement rate of change, the electronic device can determine the size of the second sampling rate according to different judgment conditions. The relationship between different second sampling rates and judgment conditions is described below.
[0165] The electronic device can be provided with two threshold change rates, a first threshold change rate R1 and a second threshold change rate R2. The first threshold change rate is less than the second threshold change rate, and the two threshold change rates can divide the displacement change rate into three different ranges. In the case where the displacement change rate R is less than (less than or equal to) the first threshold change rate, it can be further determined whether the current state is a uniform speed change or a state tending to be stationary based on the displacement size. In the case where the displacement change rate R is less than (less than or equal to) the second threshold change rate and greater than or equal to (greater than) the first threshold change rate, it can be determined to be in a small amplitude variable speed state. In the case where the displacement change rate R is greater than or equal to (greater than) the second threshold change rate, it can be determined to be in a large amplitude variable speed state, and it is determined that the positioning change condition (the positioning prediction condition is not satisfied) in S502 is not satisfied, and it is determined to execute S501. In this way, the second sampling rate can be determined based on the state of the electronic device, and different states mean different second sampling rates. The more the electronic device tends to move, the higher the sampling rate, and the more the electronic device tends to be stationary or smooth, the lower the sampling rate, which can ensure that the positioning information obtained by the electronic device is more accurate and more accurate. That is, the electronic device can be provided with different low-frequency sampling rates, and the electronic device can determine a sampling rate each time it obtains positioning collection information. If the sampling rate changes, the electronic device can switch between low frequencies, which can further reduce the power consumption of positioning collection.
[0166] The above determination process is specifically described as follows:
[0167] After switching to the control state, the electronic device can include three different low-frequency states of collecting positioning information: a uniform forward state, a stationary state, and a small amplitude variable speed state. Different conditions correspond to different low-frequency states, and the sampling rate determined by the electronic device can also be different.
[0168] 1. The condition of the uniform forward state: the displacement change rate R is less than the first threshold change rate.
[0169] The electronic device can determine whether the displacement change rate R is less than (less than or equal to) the first threshold change rate. In the case where it is less than (less than or equal to) the first threshold change rate, the electronic device can determine that the condition of uniform forward is satisfied, and the electronic device can determine the second sampling rate as f2 = f1 / K. Wherein, f1 is the first sampling rate, and k is an integer greater than 2. In the case where it is greater than or equal to (greater than) the first threshold change rate, the electronic device can continue to determine according to other conditions.
[0170] When the above condition of uniform forward is satisfied, the electronic device can determine the positioning prediction information according to the k interpolation strategy.
[0171] Optionally, the condition of the uniform advancing state further comprises a condition that the displacements S1 and S2 are greater than or equal to the first distance. That is, in the case that the displacement change rate R is less than (less than or equal to) the first threshold change rate and the displacements S1 and S2 are greater than or equal to the first distance, it can be determined that the condition of the uniform advancing state is satisfied. Otherwise, it is not satisfied.
[0172] 2. Condition of the state of approaching to be stationary: the displacement change rate R is less than the second threshold change rate, the displacements S1 and S2 are less than the first distance, and the displacement is close to 0.
[0173] The electronic device can determine whether the displacement change rate R is less than (less than or equal to) the second threshold change rate. In the case that the displacement change rate R is less than (less than or equal to) the second threshold change rate, the electronic device can determine that the condition of approaching to be stationary is satisfied, the electronic device can determine the second sampling rate as f2 = f1 / K, and the acceleration state monitoring mode is started. Wherein, f1 is the first sampling rate, and k is an integer greater than 2. In the case that the displacement change rate R is greater than or equal to (greater than) the second threshold change rate, the electronic device can continue to determine according to other conditions.
[0174] In the acceleration state monitoring mode, the electronic device starts to acquire acceleration data from the accelerator sensor and determines whether the acquired acceleration data is greater than (greater than or equal to) the threshold acceleration. In the case that the acceleration data is greater than (greater than or equal to) the threshold acceleration, it is determined to be in the stationary state, and the second sampling rate is maintained; in the case that the acceleration data is less than or equal to (less than) the threshold acceleration, it is determined to be in the motion state, and the second sampling rate is switched to the first sampling rate. Optionally, the determination results of the stationary state and the motion state can also be the state of the terminal device calling the sensorhub ready-made AR algorithm or stationary, motion, etc. The present application does not limit this.
[0175] Wherein, the first threshold change rate is greater than or equal to the second threshold change rate.
[0176] 3. Condition of the small amplitude acceleration state: the displacement change rate R is greater than or equal to (greater than) the first threshold change rate and less than (less than or equal to) the second threshold change rate.
[0177] The electronic device can determine whether the displacement change rate R is less than (less than or equal to) the second threshold change rate. In the case that the displacement change rate R is greater than or equal to (greater than) the first threshold change rate, the electronic device can determine that the condition of approaching to be stationary is satisfied, the electronic device can determine the second sampling rate as f2 = f1 / 2. Wherein, f1 is the first sampling rate, that is, k is 2. At this time, the positioning prediction information can be acquired according to the two interpolation strategies. In the case that the displacement change rate R is greater than or equal to (greater than) the second threshold change rate, it has been determined that the positioning prediction condition is not satisfied, and the first sampling rate can be maintained.
[0178] Figure 7 is a flowchart of a method for determining a sampling frequency according to an embodiment of the present application. As shown in the method can be steps performed by S502 and S503: Figure 7
[0179] The steps of S502 can include S701-S706:
[0180] S701: The electronic device determines whether the first sampling rate is greater than or equal to (greater than) the first threshold sampling rate. If the first sampling rate is greater than or equal to (greater than) the first threshold sampling rate, S702 is performed; otherwise, S705 is performed.
[0181] Specifically, S701 can refer to the acquisition frequency condition in S502 described above, and details are not repeated.
[0182] S702: The electronic device determines whether the first number of satellites is greater than or equal to (greater than) the threshold number of satellites, and / or, the first signal strength is greater than or equal to (greater than) the threshold signal strength. If the first number of satellites is greater than or equal to (greater than) the threshold number of satellites, and / or, the first signal strength is greater than or equal to (greater than) the threshold signal strength, S703 is performed; otherwise, S705 is performed.
[0183] Specifically, S702 can refer to the satellite signal quality condition in S502 described above, and details are not repeated.
[0184] S703: The electronic device determines whether the movement change angle is less than (less than or equal to) the threshold angle. If the movement change angle is less than (less than or equal to) the threshold angle, S704 is performed; otherwise, S705 is performed.
[0185] Specifically, S703 can refer to case 1 of the positioning change condition in S502 described above, and details are not repeated.
[0186] S704: The electronic device determines whether the displacement change rate is greater than (greater than or equal to) the second threshold change rate. If the displacement change rate is greater than (greater than or equal to) the second threshold change rate, S705 is performed; otherwise, S706 is performed.
[0187] Specifically, S704 can refer to case 2 of the positioning change condition in S502 described above, and details are not repeated.
[0188] S705: The electronic device determines that the positioning prediction condition is not met.
[0189] S706: The electronic device determines that the positioning prediction condition is met.
[0190] The above determining whether to switch the sampling rate based on the conditions can ensure the accuracy of the switching timing, ensure the accuracy and effectiveness of the positioning information obtained by the electronic device, and improve the accuracy of providing the position to the user.
[0191] The step S503 can include S707-S711.
[0192] S707: The electronic device determines whether the displacement change rate is less than or equal to (less than) the first threshold change rate. If the displacement change rate is less than or equal to (less than) the first threshold change rate, S709 is performed; otherwise, S708 is performed.
[0193] Specifically, S707 can refer to the related content in S503 described above, and details are not described herein.
[0194] S708: The electronic device determines that it is in a small-amplitude acceleration state, and determines that the second sampling rate is f1 / 2.
[0195] Specifically, S708 can refer to the related content of the condition of the small-amplitude acceleration state in S503 described above, and details are not described herein.
[0196] S709: The electronic device determines whether the first displacement and the second displacement are less than or equal to (less than) the first distance. If the first displacement and the second displacement are less than or equal to (less than) the first distance, S711 is performed; otherwise, S710 is performed.
[0197] Specifically, S709 can refer to the related content in S503 described above, and details are not described herein, where the first displacement can be S1, and the second displacement can be S2.
[0198] S710: The electronic device determines that it is in a uniform forward state, and determines that the second sampling rate is f1 / K. K is an integer greater than 2.
[0199] Specifically, S710 can refer to the related content of the condition of the uniform forward state in S503 described above, and details are not described herein.
[0200] S711: The electronic device determines that it is in a state of tending to be stationary, determines that the second sampling rate is f1 / K, and starts the acceleration state monitoring mode.
[0201] Specifically, S711 can refer to the related content of the condition of the state of tending to be stationary in S503 described above, and details are not described herein.
[0202] It should be further noted that the above Figure 7 The above is only an example to illustrate one possible execution process of S502 and S503, and the present application is not limited thereto.
[0203] Through the execution of S707-S711, the electronic device can quickly and effectively switch to the second sampling rate. The size of the second sampling rate can be flexibly changed according to the travel state of the electronic device, ensuring that as much as possible is predicted in the case of small changes, reducing the number of collections, and when the change is large, more collection positioning information is collected, ensuring the accuracy of the positioning information, and balancing the device power and positioning accuracy according to the specific situation of the device.
[0204] S504: The electronic device switches the positioning collection frequency from the first sampling rate to the second sampling rate.
[0205] The electronic device can switch the first sampling rate to the second sampling rate. In the case of switching the collection frequency from the first sampling rate to the second sampling rate, the electronic device keeps the first sampling rate to obtain the positioning information, and the electronic device needs to predict the positioning information. That is, the electronic device can perform S505-S507 to obtain the positioning collection information according to the low-frequency sampling frequency, and add the predicted positioning prediction information to ensure the frequency of the reported positioning information unchanged.
[0206] The prediction positioning module of the electronic device can send a sampling switching instruction to the GPS driver when determining to switch the sampling frequency to the second sampling rate. The sampling switching instruction can instruct the GPS driver to switch the acquisition frequency of the positioning information. The sampling switching instruction can include the second sampling rate. After receiving the sampling switching instruction, the GPS driver can acquire the positioning information according to the second sampling rate. The way of acquiring the positioning information can refer to the related description in Figure 2 , which will not be described here.
[0207] S505: The electronic device collects positioning based on the second sampling rate to obtain positioning collection information, and obtains positioning prediction information based on historical positioning collection information.
[0208] The electronic device can determine the second sampling rate, and can first acquire the positioning collection information according to the second sampling rate. For details, refer to the related description of S501 and Figure 3 , which will not be described here.
[0209] The positioning prediction information is obtained based on the historical positioning collection information according to the timing of the second sampling rate and the first sampling rate. The timing and number of times of obtaining the positioning prediction information can be determined based on the second sampling rate and the first sampling rate. For example, if the second sampling rate is half of the first sampling rate, the electronic device obtains the positioning prediction information once for each positioning collection information. If the second sampling rate is 1 / 3 of the first sampling rate, the electronic device obtains the positioning prediction information twice in succession for each positioning collection information. After switching, the frequency of the positioning information formed by the positioning prediction information and the positioning collection information is the first sampling rate.
[0210] Secondly, the process of acquiring the positioning prediction information based on the positioning collection information by the electronic device is specifically explained:
[0211] The parameters of the positioning information to be predicted can include longitude X, latitude Y, time stamp T, and altitude H.
[0212] The second sampling rate of the electronic device is different from the time multiple relationship of the first sampling rate, and the corresponding position relationship is also different. The present application uses a two interpolation strategy and a k interpolation strategy to respectively explain the acquisition method of the positioning prediction information.
[0213] In the embodiment of the present application, the electronic device can acquire the positioning collection information according to different k interpolation size strategies and different time occasions, and the acquisition method of the positioning prediction information should be different.
[0214] If the second sampling rate corresponds to the two interpolation (k = 1) strategy, the electronic device calculates the positioning prediction information according to the two interpolation strategy.
[0215] Strategy one: k = 1, at this time, the second sampling rate is half of the first sampling rate, that is, f2 = f1 / 2, and the positioning prediction information can be determined as:
[0216] In the embodiment of the present application, k can represent the number of inserted positioning prediction information in the current positioning collection information, K = k + 1.
[0217] Figure 8A And Figure 8B is an exemplary positioning prediction information acquisition method disclosed in the embodiment of the present application. As Figure 8AAs shown, the electronic device reports the positioning information at the first sampling rate, and the electronic device obtains the positioning collection information at the first sampling rate, that is, obtains the positioning information D1, D2 and D3 at the time T1, T2 and T3 respectively. In D1, the longitude and latitude are (X1, Y1), and the altitude is H1 (not shown); in D2, the longitude and latitude are (X2, Y2), and the altitude is H2 (not shown); in D3, the longitude and latitude are (X3, Y3), and the altitude is H3 (not shown). At the time t1 after the time T3, the electronic device determines to switch the collection frequency to the second collection frequency (the collection period is doubled before the switch) (for details, refer to S502 and S503), and the electronic device can determine that the positioning prediction information, that is, the positioning information d1 of the first prediction point, needs to be obtained, and the time of the positioning information corresponds to the time T4 in the first sampling rate. At the time T5, the positioning collection information D4 is obtained at the second sampling rate, and in D4, the longitude and latitude are (X4, Y4), and the altitude is H4 (not shown). The electronic device determines that the positioning information d2 of the second prediction point needs to be obtained, and the time of the positioning information corresponds to the time T6 in the first sampling rate. At the time T7, the positioning collection information D5 is obtained at the second sampling rate, and in D5, the longitude and latitude are (X5, Y5), and the altitude is H5 (not shown).
[0218] I. Determining the positioning prediction information based on three consecutive real historical positioning collection information.
[0219] The electronic device can obtain the positioning prediction information based on the three most recently obtained positioning collection information.
[0220] The positioning prediction information d1 of the first prediction point: the positioning prediction information d1 of the first prediction point is determined based on D1, D2 and D3. d1 includes the longitude and latitude (x1, y1) and the altitude h1, that is, x1, y1 and h1 are determined:
[0221] Wherein, ΔX1=X2-X1, ΔX2=X3-X2, ΔY1=Y2-Y1, ΔY2=Y3-Y2; ΔH2=H3-H2, ΔH1=Y2-Y1; ΔX is the displacement of the positioning information in the longitude direction; ΔY is the displacement of the positioning information in the latitude direction; ΔH is the displacement of the positioning information in the altitude direction; D1, D2 and D3 are three most recently obtained historical positioning collection information from far to near in time.
[0222] The electronic device can then determine x1, y1 and h1 in d1 based on D1, D2 and D3:
[0223]
[0224] Positioning prediction information d2 of the second prediction point: the positioning prediction information d2 of the second prediction point is determined based on D2, D3 and D4. d2 includes longitude and latitude (x2, y2) and altitude h2, that is, x2, y2 and h2 are determined:
[0225] Wherein, X3=X4-X3; AX2=X3-X2; AY3=Y4-Y3, AY2=Y3-Y2; AH3=H4-H3, AH2=Y3-Y2. The electronic device can then determine x2, y2 and h2 in d2 based on D2, D3 and D4:
[0226]
[0227] As shown in Figure 8B , the positioning collection information is acquired at a second sampling rate. At time Tf, positioning information Dn is acquired, at time Tf-2, positioning information Dn-1 is acquired, and at time Tf-4, positioning information Dn-2 is acquired. Dn-2 includes longitude and latitude (Xn-2, Yn-2) and altitude Hn-2 (not shown); Dn-1 includes longitude and latitude (Xn-1, Yn-1) and altitude Hn-1 (not shown); Dn includes longitude and latitude (Xn, Yn) and altitude Hn (not shown). At the same time, the electronic device also needs to acquire positioning prediction information based on historical positioning collection information.
[0228] Positioning prediction information dm of the mth prediction point: the positioning prediction information dm of the mth prediction point is determined based on Dn-2, Dn-1 and Dn. dm includes longitude and latitude (xm, ym) and altitude hm (not shown), that is, xm, ym and hm are determined: wherein the mth prediction point can be the third prediction point and the prediction points thereafter.
[0229] The electronic device can first determine the displacement in the longitude and latitude and altitude directions based on the positioning collection information Dn-2, Dn-1 and Dn:
[0230] AXn-2=Xn-1-Xn-2
[0231] AYn-2=Yn-1-Yn-2
[0232] AHn-2=Hn-1-Hn-2
[0233] AXn-1=Xn-Xn-1
[0234] AYn-1=Yn-Yn-1
[0235] AHn-1=Hn-Hn-1
[0236] The electronic device can then determine xm, ym, and hm in dm based on AXn-1, AXn-2, AYn-1, AYn-2, AHn-1, and AHn-2:
[0237]
[0238] If the second sampling rate corresponds to a multiple interpolation (k>2) strategy, the electronic device calculates the positioning prediction information according to the multiple interpolation strategy.
[0239] In the embodiments of the present application, in order to distinguish the longitude, latitude, and altitude of the positioning prediction information, the longitude, latitude, and altitude of the positioning collection information are represented by lowercase letters and uppercase letters.
[0240] The electronic device can calculate the longitude of the next positioning prediction information as x next =X last +Δx; the latitude as y next =Y last +Δx; and the altitude as h next =H last +Δh. Wherein X last , Y last , and H last may be the longitude, latitude, and altitude of the previous positioning information, respectively, which are known information. ΔX, ΔY, and ΔH may be the displacement amounts in longitude, latitude, and altitude from the historical positioning collection information to the next positioning prediction information, respectively.
[0241] Therefore, before calculating x next , y next , and h next of the next positioning prediction information, ΔX, ΔY, and ΔH can be calculated first.
[0242] The longitude, latitude, and altitude of the first positioning collection information are X1, Y1, and H1, respectively; the longitude, latitude, and altitude of the second positioning collection information are X2, Y2, and H2, respectively; and the longitude, latitude, and altitude of the third positioning collection information are X3, Y3, and H3, respectively. The first positioning collection information D1, the second positioning collection information D2, and the third positioning collection information D3 can be the three most recent positioning information collected by the electronic device, and the three most recently acquired GPS positioning collection information D1 (X1, Y1), D2 (X2, Y2), and D3 (X3, Y3); the distances from the current time are far to near, respectively. The number of interpolation positioning prediction information between the first positioning collection information and the second positioning collection information is k1, and the number of interpolation positioning prediction information between the second positioning collection information and the third positioning collection information is k2.
[0243] The electronic device can calculate two displacement vectors Two altitude variation amounts are ΔH1=H2-H1; ΔH2=H3-H2. It is assumed that k1 virtual points are inserted between D1 and D2, and k2 virtual points are inserted between D2 and D3. Wherein, k1 and k2 are both positive integers.
[0244] Then the displacement variation amount of the next virtual point is:
[0245]
[0246] The reporting point longitude and latitude coordinates of the next virtual point are the last reporting point coordinates plus the displacement variation amount:
[0247] d next (x next ,y next ,h next )=(X last +Δx,Y last +Δy,H last +Δh)
[0248] X last , Y last and H last are the longitude, latitude and altitude in the last obtained positioning information. For example, if the last obtained positioning information includes X3, Y3 and H3, X last =X3; Y last =Y3; H last =H3; if the last obtained positioning information is positioning prediction information, including x1, y1 and h1; X last =x3; Y last =y3; H last =h3.
[0249] In the above formula, k1 and k2 can also be 1 and 2, and 2 and 1 respectively, which can solve the problem in strategy one, and the present application is not limited.
[0250] Strategy two: k=2, at this time, the third sampling rate is one third of the first sampling rate, i.e. f3=f1 / 3, and the positioning prediction information can be calculated as:
[0251] Figures 9A-9D is another set of positioning prediction information acquisition method disclosed by the embodiment of the present application.
[0252] As Figure 9AAs shown, the electronic device reports the positioning information at the first sampling rate, and the electronic device obtains the positioning collection information at the first sampling rate, that is, obtains the positioning information D1, D2 and D3 at T1, T2 and T3 respectively. In D1, the longitude and latitude are (X1, Y1), and the altitude is H1 (not shown); in D2, the longitude and latitude are (X2, Y2), and the altitude is H2 (not shown); in D3, the longitude and latitude are (X3, Y3), and the altitude is H3 (not shown). At t1 after T3, the electronic device determines to switch the collection frequency to the third sampling rate 2 (the collection period is twice that before the switch) (for details, refer to S502 and S503), and determines to obtain the positioning prediction information, that is, the positioning information d1 of the first prediction point, and the time of the positioning information corresponds to T4 in the first sampling rate; and to obtain the positioning information d2 of the second prediction point, and the time of the positioning information corresponds to T5 in the first sampling rate. At T6, the positioning collection information D4 is obtained at the second sampling rate, and in D4, the longitude and latitude are (X4, Y4), and the altitude is H4 (not shown). Then, the electronic device needs to obtain the positioning prediction information d3 and d4 of the third and fourth prediction points. At T9, the positioning collection information D5 is obtained at the second sampling rate, and in D5, the longitude and latitude are (X5, Y5), and the altitude is H5 (not shown).
[0253] First prediction point: positioning prediction information d1 (x(d1), y(d1), h(d1)): At this time, k1=0 and k2=0.
[0254] The electronic device can calculate two displacement vectors The two altitude change amounts are ΔH1=H2-H1; ΔH2=H3-H2.
[0255]
[0256]
[0257] Wherein, x(d2)=X(D3)+Δx; y(d2)=Y(D3)+Δy; h(d2)=H(D3)+Δh.
[0258] Second prediction point: positioning prediction information d2 (x(d2), y(d2), h(d2)): At this time, k1=0 and k2=0.
[0259] Unlike the d1 positioning point, x(d2)=X(d1)+Δx; y(d2)=Y(d1)+Δy; h(d2)=H(d1)+Δh.
[0260] The 3rd prediction point: the positioning prediction information d3(x(d3), y(d3), h(d3)): at this time, k1=0 and k2=2.
[0261] The electronic device can calculate two displacement vectors
[0262] The two altitude change amounts are ΔH2=H3-H2; ΔH3=H4-H3.
[0263]
[0264] Wherein, x(d3)=X(D4)+Δx; y(d3)=Y(D4)+Δy; h(d3)=H(D4)+Δh.
[0265] The 4th prediction point: the positioning prediction information d4(x(d4), y(d4), h(d4)): at this time, k1=0 and k2=2.
[0266] Different from the d3 prediction point, x(d4)=X(d3)+Δx; y(d4)=Y(d3)+Δy; h(d4)=H(d3)+Δh.
[0267] The 5th prediction point: in the positioning prediction information d4(x(d4), y(d4), h(d4)), k1=2 and k2=2, which is not shown in the figure, and the calculation method is the same as the above, and details are omitted.
[0268] As shown in FIG. 2, Figure 9B At t2, the electronic device switches from the third sampling rate to the second sampling rate, and k(sampling rate) switches from three interpolation to two interpolation. Therefore, before Tq, the positioning prediction information is obtained according to three interpolation, and the sampling frequency is f / 3; after Tq, the positioning prediction information is obtained according to two interpolation, and the sampling frequency is f / 2.
[0269] The ath prediction point: in the positioning prediction information da(x(da), y(da), h(da)), k1=2 and k2=2.
[0270] The electronic device can calculate two displacement vectors The two altitude change amounts are ΔH b-2 =Hb-3-Hb-2; ΔH b-1 =Hb-2-Hb-1.
[0271]
[0272] Among them, x(da)=X(Db-1)+Δx; y(da)=Y(Db-1)+Δy; h(da)=H(Db-1)+Δh.
[0273] The (a+1)th prediction point: In the location prediction information da+1(x(da+1), y(da+1), h(da+1)), k1=2 and k2=1.
[0274] Electronic devices can calculate two displacement vectors:
[0275]
[0276] The two altitude changes are ΔH b-2 =Hb-1-Hb-2; ΔH b-1 =Hb-Hb-1.
[0277]
[0278] Among them, x(da+1)=X(Db)+Δx; y(da)=Y(Db)+Δy; h(da)=H(Db)+Δh.
[0279] like Figure 9C As shown, at time t3, the electronic device switches from the second sampling rate to the third sampling rate, and k (sampling rate) switches from binary interpolation to tri-interpolation. Therefore, before time Tr, positioning prediction information is acquired using binary interpolation with a sampling frequency of f / 2; after time Tr, positioning prediction information is acquired using tri-interpolation with a sampling frequency of f / 3.
[0280] For the l-th prediction point: in the location prediction information dl(x(dl), y(dl), h(dl)), k1 = 1 and k2 = 1.
[0281] Electronic devices can calculate two displacement vectors:
[0282]
[0283] The two altitude changes are ΔH p-4 =Hp-3-Hp-4; ΔH p-3 =Hp-2-Hp-3.
[0284]
[0285] Among them, x(dl)=X(Dp-2)+Δx; y(dl)=Y(Dp-2)+Δy; h(dl)=H(Dp-2)+Δh.
[0286] For the (l+1)th prediction point: in the location prediction information dl+1(x(dl+1), y(dl+1), h(dl+1)), k1=1 and k2=1.
[0287] Unlike the prediction point l, x(dl+1) = X(dl) + Δx; y(dl) = Y(dl) + Δy; h(dl) = H(dl) + Δh.
[0288] The (l+2)th prediction point: In the location prediction information dl+2(x(dl+2), y(dl+2), h(dl+2)), k1=1 and k2=2.
[0289] Electronic devices can calculate two displacement vectors:
[0290]
[0291] The two altitude changes are ΔH p-3 =Hp-2-Hp-3; ΔH p-2 =Hp-1-Hp-2.
[0292]
[0293] Among them, x(dl+2)=X(Dp-1)+Δx; y(dl+2)=Y(Dp-1)+Δy; h(dl+2)=H(Dp-1)+Δh.
[0294] The (l+3)th prediction point: In the location prediction information dl+3(x(dl+3), y(dl+3), h(dl+3)), k1=1 and k2=2.
[0295] Unlike the (l+2)th prediction point, x(dl+3) = X(dl+2) + Δx; y(dl+3) = Y(dl+2) + Δy; h(dl+3) = H(dl+2) + Δh.
[0296] like Figure 9D As shown, at time t4, the electronic device switches from the third sampling rate to the first sampling rate. Therefore, before time To, positioning prediction information is acquired using tri-interpolation with a sampling frequency of f / 3; after time To, the sampling frequency is f. Assume e-3 is a value greater than l+3, where k1 = 2 and k2 = 2 from the e-3th prediction point to the eth prediction point. The specific calculation method can be found in the above process and will not be elaborated here.
[0297] Figure 9D After time t4, you can refer to Figure 8BAfter the description of the time t2 in the above, the electronic device can determine to exit the management state through the process of S507, and then execute the processes of S508 and S501, S502, which are not described herein.
[0298] Since the conditions of the electronic device are different, the size of the set sampling rate is also different. The present application only takes k=2 or k=1 as an example for description, and does not limit the specific value. Of course, the switching between the above different low-frequency sampling rates is only an exemplary description, and other sampling rates can also be switched. The present application does not limit this.
[0299] It should be noted that the determination methods of the third sampling rate and the second sampling rate can refer to the related description of S504. The third sampling rate can be understood as another second sampling rate, and the present application does not repeat the description.
[0300] In addition, in addition to determining the latitude, longitude and altitude in the positioning collection information, the electronic device can also determine the positioning time.
[0301] Specifically, the positioning time of the positioning prediction information can be the nearest T=T last +ΔT. Wherein, T last is the positioning time in the positioning collection information obtained last time. ΔT=1 / f, wherein f is the first sampling rate, and 1 / f is the time period of collecting positioning information.
[0302] Exemplarily, as shown in Figure 9A , the positioning time T(d1) of the first prediction point is T(D3)+1 / f; and the positioning time T(d2) of the second prediction point is T(d2)+1 / f.
[0303] S506: The electronic device reports the positioning prediction information based on the first sampling rate.
[0304] After the electronic device obtains the positioning prediction information, the electronic device can report the positioning prediction information according to the first sampling rate.
[0305] It should be noted that if the electronic device truly obtains the positioning information from the bottom layer (GPS driver), there is a certain time difference. That is, when the bottom layer obtains the positioning information from the satellite positioning system, there is a time required for the information to be transmitted from the high altitude to the ground, and there is also a time required for the protocol analysis process of the positioning information. Therefore, the acquisition time of the positioning collection information is greater than the acquisition time of the positioning prediction information. Therefore, in order to make the information of the positioning prediction information as close as possible to the collected positioning information, the electronic device can determine the reporting time according to the last reporting time and the reporting period (the collection period of the positioning information) to ensure the accuracy of the time. For details, refer to the related description of Figure 12 , which is not described herein.
[0306] S507: The electronic device determines whether the positioning prediction condition is met. In the case where the positioning prediction condition is met, S505 is performed; otherwise, S508 is performed.
[0307] The electronic device needs to determine whether the positioning prediction condition is met once for each time the positioning collection information is acquired. The positioning prediction condition can determine whether the electronic device maintains low-frequency sampling. If the positioning prediction condition is met, the control state is continued to be maintained; otherwise, the electronic device is switched to the preparation state.
[0308] The positioning prediction condition can include a satellite signal quality condition and a positioning change condition, both of which can be described with reference to S502, and thus will not be described herein.
[0309] If the displacement exceeds the threshold or the displacement direction changes greatly (such as a turning or a speed reduction), or if the GPS signal is poor or the number of searched satellites is small, the above determination process immediately switches to GPS positioning, exits the control, and switches back to actual GPS positioning, thereby avoiding the influence of positioning drift.
[0310] S508: The electronic device switches the positioning collection frequency from the second sampling rate to the first sampling rate.
[0311] The electronic device can switch the positioning collection frequency from the second sampling rate to the first sampling rate. The description of S508 can be described with reference to the related description of S504, and thus will not be described herein.
[0312] After S508 is performed, the electronic device can continue to perform S501.
[0313] S509: The electronic device re-determines the second sampling rate.
[0314] Optionally, before S505, the electronic device can also perform the process of S509.
[0315] In S509, if the second sampling rate re-determined by the electronic device is different from the previous sampling rate, that is, a third sampling rate is determined, the electronic device also needs to switch the sampling frequency from the second sampling rate to the third sampling rate. At this time, the third sampling rate can be understood as the re-determined second sampling rate, and S505 is continued to be performed.
[0316] In combination with Figure 7 It is explained that the execution processes of S507 and S509, Figure 10 are a method flowchart for determining a sampling frequency. As Figure 10 shown in the method, the method can be the steps performed by S507 and S509:
[0317] The steps of S507 can include S1001-S1005:
[0318] S1001: The electronic device determines whether the first satellite quantity is greater than or equal to (greater than) a threshold satellite quantity, and / or, the first signal strength is greater than or equal to (greater than) a threshold signal strength. In the case where the first satellite quantity is greater than or equal to (greater than) the threshold satellite quantity, and / or, the first signal strength is greater than or equal to (greater than) the threshold signal strength, S1002 is performed; otherwise, S1003 is performed.
[0319] S1002: The electronic device determines whether the movement change angle is less than (less than or equal to) a threshold included angle. In the case where the movement change angle is less than (less than or equal to) the threshold included angle, S1004 is performed; otherwise, S1003 is performed.
[0320] S1003: The electronic device determines that the positioning prediction condition is not met.
[0321] S1004: The electronic device determines whether the displacement change rate is greater than (greater than or equal to) a second threshold change rate. In the case where the displacement change rate is greater than (greater than or equal to) the second threshold change rate, S1003 is performed; otherwise, S1005 is performed.
[0322] S1005: The electronic device determines that the positioning prediction condition is met.
[0323] The steps of S509 can include S1006-S1010:
[0324] S1006: The electronic device determines whether the displacement change rate is less than or equal to (less than) a first threshold change rate. In the case where the displacement change rate is less than or equal to (less than) the first threshold change rate, S1008 is performed; otherwise, S1007 is performed.
[0325] S1007: The electronic device determines that it is in a small-amplitude acceleration state, and determines that the second sampling rate is f1 / 2.
[0326] S1008: The electronic device determines whether the first displacement and the second displacement are less than or equal to (less than) a first distance. In the case where the first displacement and the second displacement are less than or equal to (less than) the first distance, S1010 is performed; otherwise, S1009 is performed.
[0327] S1009: The electronic device determines that it is in a uniform forward state, and determines that the second sampling rate is f1 / K. K is an integer greater than 2.
[0328] S1010: The electronic device determines that it is in a state of tending to be stationary, determines that the second sampling rate is f1 / K, and starts an acceleration state monitoring mode.
[0329] It should be further explained that the above Figure 10 The description of the aboveFigure 7 The relevant descriptions are omitted.
[0330] go through Figure 10 In the processing, the electronic device can quickly and effectively use a second sampling rate. The magnitude of the second sampling rate can be flexibly changed according to the movement status of the electronic device. When the change is small, it can predict as many things as possible and reduce the number of samplings. When the change is large, it can collect more positioning information to ensure the accuracy of the positioning information. It can balance the issues of device power and positioning accuracy according to the specific situation of the device.
[0331] In the above embodiments, the frequency of location information collection can be switched between high and low frequencies, which can reduce the power consumption of location collection. On the other hand, due to the judgment of switching conditions, the reliability of the location information inferred during low-frequency collection can be guaranteed.
[0332] It should be noted that in the process of judgment, the sampling rate is used for judgment and processing in the embodiments of this application. Following the same logic, it can also be processed according to the period duration corresponding to the positioning acquisition frequency. This application does not limit this change.
[0333] In the above process, Figure 5 The electronic device can switch the acquisition frequency of positioning information. When it is in a high-frequency state, the electronic device can determine whether to switch to a low frequency. If the positioning prediction conditions are met, the acquisition frequency can be switched to a low frequency, which reduces positioning power consumption while ensuring the accuracy of positioning information.
[0334] Combination Figure 4A , Figure 4B and Figure 5 Method Flowchart Explanation Figures 11A-11D The content. Figures 11A-11D This is a schematic diagram of an interactive method for obtaining location information disclosed in an embodiment of this application. Figures 11A-11D As shown, the interactive method for obtaining location information may include, but is not limited to, the following steps:
[0335] Figures 11A-11D The modules involved, such as the first application, location management module, positioning module, and GPS driver, can be found in [the relevant documentation / reference]. Figure 3 , Figure 4A and Figure 4B The description includes a positioning module that may further include a positioning frequency switching module. In this case, the positioning module can be used to determine whether to switch the positioning acquisition frequency, and to acquire positioning prediction information at a low-frequency acquisition frequency. The specific process is explained below:
[0336] Figure 11AThe steps S1101-S1120 can include a process that the electronic device starts to collect positioning information according to a high-frequency sampling frequency, and reports the positioning collection information to an application.
[0337] S1101: A first application acquires a first operation, and in response to the first operation, a positioning state is started, and it is determined to start to acquire positioning information.
[0338] The first application can be an application program that requests to continuously acquire positioning information, for example, XX map, XX navigation, and the like, and the present application is not limited thereto.
[0339] The first application starts the positioning state in response to the user starting the first operation, and determines to continuously acquire positioning information based on a first sampling rate.
[0340] S1102: The first application sends a location start acquisition request to a location management module.
[0341] The first application can send a location start acquisition request to the location management module in response to the first operation. Correspondingly, the location management module can receive the location start acquisition request from the first application. The location start acquisition request is used to request to continuously acquire positioning information.
[0342] S1103: The location management module sends a first positioning request to a positioning module.
[0343] The location management module can send a first positioning request to the positioning module after acquiring the location start acquisition request of the first application. Correspondingly, the positioning module can receive the first positioning request from the location management module.
[0344] The first positioning request can instruct the positioning module to start to collect positioning information. The first positioning request can include a first sampling rate, a parameter format of the positioning information, and the like. The first sampling rate can represent a frequency at which the positioning module acquires positioning information; and the parameter format of the positioning information represents format information of the positioning module reporting the positioning information to the location management module.
[0345] S1104: The positioning module sends a first positioning start-stop instruction to a GPS driver.
[0346] The positioning module can send a first positioning start-stop instruction to the GPS driver after receiving the first positioning request from the location management module. Correspondingly, the GPS driver can receive the first positioning start-stop instruction from the positioning module.
[0347] The first positioning start-stop instruction can be used to instruct the GPS driver to start to acquire positioning information according to the first sampling rate. The first positioning start-stop instruction can include the first sampling rate.
[0348] S1105: The GPS driver starts to collect positioning information according to the first sampling rate.
[0349] After receiving the first positioning start-stop instruction, the GPS driver can drive to start collecting positioning information according to the first sampling rate. The frequency of collecting positioning information by the GPS driver is the first sampling rate, that is, the positioning information can be understood as being obtained according to a certain sampling period, and the sampling period is the inverse of the sampling frequency. The specific process of collecting positioning information by the GPS driver can be referred to the related description in the foregoing embodiment, and will not be described here. Figure 3
[0350] S1106: The GPS driver sends the first positioning collection information to the positioning module.
[0351] After collecting the first positioning collection information, the GPS driver can send the first positioning collection information to the positioning module. Correspondingly, the positioning module can receive the first positioning collection information from the GPS driver.
[0352] S1107: The positioning module performs filling processing on the first positioning collection information to obtain the first positioning information.
[0353] After receiving the first positioning collection information, the positioning module can perform filling processing on the first positioning collection information to obtain the first positioning information. Specifically, the positioning module can perform filling processing on the first positioning collection information according to the parameter format of the positioning information, to ensure that the first positioning information after filling meets the specified format.
[0354] S1108: The positioning module sends the first positioning information to the position management module.
[0355] After performing S1107, the positioning module can send the first positioning information to the position management module. Correspondingly, the position management module can receive the first positioning information from the positioning module.
[0356] S1109: The position management module sends the first positioning information to the first application.
[0357] After receiving the first positioning information, the position management module can send the first positioning information to the first application. Correspondingly, the first application can receive the first positioning information from the position management module.
[0358] S1110: The first application performs application processing based on the first positioning information.
[0359] After receiving the first positioning information, the first application can perform application processing based on the first positioning information. The process of processing is related to the business of the first application, such as planning for a user, displaying a user position, and the like, which are not limited in the present application.
[0360] S1111: The GPS driver sends the second positioning collection information to the positioning module.
[0361] The GPS driver can continue to acquire the positioning collection information at the first sampling rate and report.
[0362] S1112: The positioning module performs filling processing on the second positioning collection information to obtain second positioning information.
[0363] S1113: The positioning module sends the second positioning information to the position management module.
[0364] S1114: The position management module sends the second positioning information to the first application.
[0365] S1115: The first application performs application processing based on the second positioning information.
[0366] The processing procedures of S1111-S1115 can refer to the related descriptions of S1106-S1110, and will not be described herein.
[0367] S1116: The GPS driver sends third positioning collection information to the positioning module.
[0368] The GPS driver can continue to acquire the positioning collection information at the first sampling rate and report.
[0369] S1117: The positioning module performs filling processing on the third positioning collection information to obtain third positioning information.
[0370] S1118: The positioning module sends the third positioning information to the position management module.
[0371] S1119: The position management module sends the third positioning information to the first application.
[0372] S1120: The first application performs application processing based on the third positioning information.
[0373] The processing procedures of S1116-S1120 can refer to the related descriptions of S1106-S1110, and will not be described herein.
[0374] Figure 11B S1121-S1135 can be included, specifically including that the electronic device determines that the positioning prediction condition is met in the preparation state, switches the positioning sampling frequency from a high frequency sampling to a low frequency sampling after the positioning prediction condition is met, and acquires positioning information after the switching.
[0375] S1121: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction condition is met.
[0376] The process of determining whether the positioning prediction condition is met can refer to the processing procedure of S502, which will not be described herein.
[0377] Wherein, the positioning module can determine whether the positioning prediction condition is met in the case that at least three positioning collection information are continuously acquired. After that, the process of determining whether the positioning prediction condition is met is executed once every time the first positioning collection information is received.
[0378] Exemplarily, as shown in the following table, Figure 8A the electronic device determines that D1, D2 and D3 (which can correspond to the first positioning collection information, the second positioning collection information and the third positioning collection information) are acquired, the determination of whether the positioning prediction condition is met can be started. If only D1 and D2 are acquired, and no positioning collection information is acquired before D1, the positioning module can not determine. D2, D3 and D4 are the same, and the determination is made.
[0379] S1122: The positioning module determines the second sampling rate.
[0380] After the positioning module determines that the positioning prediction condition is met, the second sampling rate can be determined, which can be specifically referred to the related description of S503, and details are not described herein. For example, the second sampling rate can be f2 = f1 / 2, and f1 is the first sampling rate.
[0381] S1123: The positioning module sends a first sampling frequency switching instruction to the GPS driver.
[0382] After the positioning module determines the second sampling rate, the positioning module can send a first sampling frequency switching instruction to the GPS driver. Correspondingly, the GPS driver can receive the first sampling frequency switching instruction from the positioning module. The first sampling frequency switching instruction includes the second sampling rate. The first sampling frequency switching instruction is used to instruct the GPS driver to switch the frequency to the second sampling rate.
[0383] S1124: The GPS driver collects positioning information according to the second sampling rate.
[0384] The GPS driver executes the switching process, i.e., can collect positioning information according to the second sampling rate.
[0385] S1125: The positioning module calculates the first positioning prediction information.
[0386] In the case that the second sampling rate is equal to half of the first sampling rate, the positioning module can calculate the first positioning prediction information based on the second positioning collection information and the third positioning collection information.
[0387] S1126: The positioning module performs padding processing on the first positioning prediction information to obtain the fourth positioning information.
[0388] Wherein, S1126 can refer to the related description of S1107, S1112 and S1117, and details are not described herein.
[0389] S1127: The positioning module sends the fourth positioning information to the location management module based on the reported time.
[0390] The positioning module can send the fourth positioning information to the location management module according to the predicted reporting time based on the first sampling rate. The positioning module sends the fourth positioning information to the location management module at the reporting time. Correspondingly, the location management module can receive the fourth positioning information from the positioning module.
[0391] Figure 12 This is a schematic diagram illustrating an exemplary method for predicting reporting time disclosed in an embodiment of this application. For example... Figure 12 As shown, location information is reported at times Tm-2 and Tm-1. Since the second sampling rate is switched between Tm-2 and Tm-1, after obtaining the location prediction information, the positioning module can determine the next reporting time for location information, ensuring that the reporting time is aligned with the actual data collection reporting time. The electronic device can report according to the period of the first sampling rate, or it can determine the current reporting time Tm based on the previous reporting time Tm-1. For example, given f1 and a reporting time interval of 1 / f1, the interval between Tm-2 and Tm-1 is 1 / f1; the interval between Tm-1 and Tm is 1 / f1. Therefore, Tm = Tm-1 + 1 / f1.
[0392] Generally, the positioning module determines whether it can predict the location point and the calculation time for predicting the location point is relatively small, less than 1ms. However, assuming the time between Tm+1 and Tn is less than 1ms, if the location information is reported to the location management module immediately after acquisition, the application's location information acquisition time will be misaligned. If the first application processes data according to the location information acquisition time, it will lead to poor business data processing performance. Aligning the reporting time in the above process ensures the correctness and reliability of business data processing.
[0393] S1128: The location management module sends the fourth location information to the first application.
[0394] S1129: The first application performs application processing based on the fourth location information.
[0395] The descriptions of S1128 and S1129 can be found in the descriptions of S1109 and S1110, and will not be repeated here.
[0396] S1130: The GPS driver sends the fourth positioning acquisition information to the positioning module.
[0397] S1131: The positioning module fills in the fourth positioning information to obtain the fifth positioning information.
[0398] S1132: The positioning module sends the fifth positioning information to the position management module.
[0399] S1133: The position management module sends the fifth positioning information to the first application.
[0400] S1134: The first application performs application processing based on the fifth positioning information.
[0401] The processing procedures of S1130-S1134 can refer to the related descriptions of S1106-S1110, and will not be described herein.
[0402] S1135: After obtaining the positioning collection information, the positioning module determines whether the positioning prediction condition is met.
[0403] The execution procedure of S1135 can refer to the related content of S1121, and will not be described herein.
[0404] Figure 11C S1136-S1153 can be included, specifically including the process that the electronic device determines whether the positioning prediction condition is met in the management state, switches the positioning sampling frequency from low frequency sampling to high frequency when the positioning prediction condition is not met, and obtains the positioning information after the switching.
[0405] S1136: The GPS driver sends the q-1th positioning collection information to the positioning module.
[0406] S1137: The positioning module performs padding processing on the q-1th positioning collection information to obtain the s-1th positioning information.
[0407] S1138: The positioning module sends the s-1th positioning information to the position management module.
[0408] S1139: The position management module sends the s-1th positioning information to the first application.
[0409] S1140: The first application performs application processing based on the s-1th positioning information.
[0410] The processing procedures of S1136-S1140 can refer to the related descriptions of S1106-S1110, and will not be described herein.
[0411] S1141: After obtaining the positioning collection information, the positioning module determines whether the positioning prediction condition is met.
[0412] The execution procedure of S1141 can refer to the related content of S1121, and will not be described herein.
[0413] At this time, it is determined that the positioning prediction condition is not met, and the positioning module can switch the sampling frequency from low frequency to high frequency.
[0414] S1142: The positioning module sends a second collection frequency switching instruction to the GPS driver.
[0415] If the positioning prediction condition is not met, the positioning module can send a second collection frequency switching instruction to the GPS driver; correspondingly, the GPS driver can receive the second collection frequency switching instruction from the positioning module. The second collection frequency switching instruction can include the first sampling rate.
[0416] S1142 can refer to the content of S1123, and details are omitted.
[0417] S1143: The GPS driver sends the qth positioning collection information to the positioning module.
[0418] S1144: The positioning module performs padding processing on the qth positioning collection information to obtain the sth positioning information.
[0419] S1145: The positioning module sends the sth positioning information to the position management module.
[0420] S1146: The position management module sends the sth positioning information to the first application.
[0421] S1147: The first application performs application processing based on the sth positioning information.
[0422] The processing procedures of S1143-S1147 can refer to the related descriptions of S1106-S1110, and details are omitted.
[0423] S1148: After obtaining the positioning collection information, the positioning module determines whether the positioning prediction condition is met.
[0424] The execution procedure of S1148 can refer to the related content of S1121, and details are omitted.
[0425] S1149: The GPS driver sends the q+1th positioning collection information to the positioning module.
[0426] S1150: The positioning module performs padding processing on the q+1th positioning collection information to obtain the s+1th positioning information.
[0427] S1151: The positioning module sends the s+1th positioning information to the position management module.
[0428] S1152: The position management module sends the s+1th positioning information to the first application.
[0429] S1153: The first application performs application processing based on the s+1th positioning information.
[0430] The processes of S1149-S1153 can refer to the related description of S1106-S1110, and will not be repeated.
[0431] Figure 11D S1154-S1158 can be included, and specifically, the electronic device exits the process of collecting the positioning information.
[0432] S1154: The first application acquires a second operation, and in response to the second operation, the positioning state is closed.
[0433] The first application closes the positioning state in response to the second operation of the user exiting the first application, and determines to end the acquisition of the positioning information.
[0434] S1155: The first application sends a location end acquisition request to the location management module.
[0435] The first application can send the location end acquisition request to the location management module in response to the second operation. Correspondingly, the location management module can receive the location end acquisition request from the first application. The location end acquisition request is used to request to end the acquisition of the positioning information.
[0436] S1156: The location management module sends an end positioning request to the positioning module.
[0437] The location management module can send the end positioning request to the positioning module after acquiring the location end acquisition request of the first application. Correspondingly, the positioning module can receive the end positioning request from the location management module.
[0438] S1157: The positioning module sends a second positioning start-stop instruction to the GPS driver.
[0439] The positioning module can send the second positioning start-stop instruction to the GPS driver after receiving the second positioning request from the location management module. Correspondingly, the GPS driver can receive the second positioning start-stop instruction from the positioning module.
[0440] The second positioning start-stop instruction can be used to instruct the GPS driver to stop acquiring the positioning information.
[0441] S1158: The GPS driver ends the collection of the positioning information.
[0442] The GPS driver stops acquiring the positioning information after acquiring the second positioning start-stop instruction.
[0443] Figures 13A-13D is another flowchart of an interaction method for acquiring positioning information disclosed by the embodiments of the present application. As shown in Figures 13A-13D the interaction method for acquiring positioning information can include but is not limited to the following steps:
[0444] Figure 13A The steps S1301-S1320 can be included, specifically including the process that the electronic device starts to collect positioning information according to a high-frequency sampling frequency, and reports the positioning collection information to the application.
[0445] S1301: The first application acquires a first operation, and in response to the first operation, a positioning state is started, and it is determined to start acquiring positioning information.
[0446] S1302: The first application sends a location start acquisition request to a location management module.
[0447] S1303: The location management module sends a first positioning request to a positioning module.
[0448] S1304: The positioning module sends a first positioning start-stop instruction to a GPS driver.
[0449] S1305: The GPS driver starts to collect positioning information according to a first sampling rate.
[0450] S1306: The GPS driver sends first positioning collection information to the positioning module.
[0451] S1307: The positioning module performs filling processing on the first positioning collection information to obtain first positioning information.
[0452] S1308: The positioning module sends the first positioning information to the location management module.
[0453] S1309: The location management module sends the first positioning information to the first application.
[0454] S1310: The first application performs application processing based on the first positioning information.
[0455] S1311: The GPS driver sends second positioning collection information to the positioning module.
[0456] S1312: The positioning module performs filling processing on the second positioning collection information to obtain second positioning information.
[0457] S1313: The positioning module sends the second positioning information to the location management module.
[0458] S1314: The location management module sends the second positioning information to the first application.
[0459] S1315: The first application performs application processing based on the second positioning information.
[0460] S1316: The GPS driver sends third positioning collection information to the positioning module.
[0461] S1317: The positioning module performs filling processing on the third positioning collection information, to obtain third positioning information.
[0462] S1318: The positioning module sends the third positioning information to the position management module.
[0463] S1319: The position management module sends the third positioning information to the first application.
[0464] S1320: The first application performs application processing based on the third positioning information.
[0465] The processing procedures of S1301-S1320 can refer to the related descriptions of S1101-S1120, and will not be described herein.
[0466] Figure 13B S1321-S1341 can be included, specifically including that the electronic device determines that the positioning prediction condition is met in the preparation state, in the case that the positioning prediction condition is met, the third sampling rate is determined in combination with the process shown in FIG. 13B. Figure 9B The process of switching the positioning sampling frequency from the high-frequency sampling to the low-frequency (third sampling rate), and the process of acquiring the positioning information after the switching.
[0467] S1321: After the positioning module acquires the positioning collection information, it determines whether the positioning prediction condition is met.
[0468] At this time, it is determined in S1321 that the positioning prediction condition is met.
[0469] S1322: The positioning module determines the third sampling rate.
[0470] The positioning module determines that the previous sampling rate is the first sampling rate, and thus determines that the sampling frequencies of the two are different, and the process of switching can be performed.
[0471] S1323: The positioning module sends a third sampling frequency switching instruction to the GPS driver.
[0472] The third sampling frequency switching instruction includes the third sampling rate, i.e., the value of f2=f1 / 3.
[0473] S1324: The GPS driver collects positioning information according to the third sampling rate.
[0474] S1325: The positioning module calculates the first positioning prediction information.
[0475] S1326: The positioning module performs filling processing on the first positioning prediction information, to obtain fourth positioning information.
[0476] S1327: The positioning module sends the fourth positioning information to the position management module based on the reporting time.
[0477] S1327 can refer to the related description of S1127, and details are not described herein. Figure 12
[0478] S1328: The position management module sends the fourth positioning information to the first application.
[0479] S1329: The first application performs application processing based on the fourth positioning information.
[0480] The processing procedure of S1321-S1329 can refer to the related description of S1121-S1129, and details are not described herein.
[0481] S1330: The positioning module calculates second positioning prediction information.
[0482] S1331: The positioning module performs padding processing on the second positioning prediction information to obtain fifth positioning information.
[0483] S1332: The positioning module sends the fifth positioning information to the position management module based on the reporting time.
[0484] S1333: The position management module sends the fifth positioning information to the first application.
[0485] S1334: The first application performs application processing based on the fifth positioning information.
[0486] The processing procedure of S1330-S1334 can refer to the related description of S1125-S1129, and details are not described herein.
[0487] S1335: The GPS driver sends fourth positioning collection information to the positioning module.
[0488] S1336: The positioning module performs padding processing on the fourth positioning collection information to obtain sixth positioning information.
[0489] S1337: The positioning module sends the sixth positioning information to the position management module.
[0490] S1338: The position management module sends the sixth positioning information to the first application.
[0491] S1339: The first application performs application processing based on the sixth positioning information.
[0492] S1340: After obtaining the positioning collection information, the positioning module determines whether the positioning prediction condition is met.
[0493] S1341: The positioning module determines the third sampling rate.
[0494] The processes of S1335-S1341 can refer to the related descriptions of S1136-S1122, and will not be described herein.
[0495] Figure 13C S1342-S1361 can be included, specifically including that the electronic device determines that the positioning prediction condition is met in the preparation state, in the case that the positioning prediction condition is met, the electronic device combines the first positioning information and the second positioning information to obtain the qth positioning information, and the electronic device sends the qth positioning information to the first application. Figure 9C The process of switching the positioning sampling frequency from the low frequency (third sampling rate) to the low frequency (second sampling rate), and the process of obtaining the positioning information after the switching.
[0496] S1342: The GPS driver sends the b-1th positioning collection information to the positioning module.
[0497] S1343: The positioning module performs padding processing on the b-1th positioning collection information to obtain the qth positioning information.
[0498] S1344: The positioning module sends the qth positioning information to the position management module.
[0499] S1345: The position management module sends the qth positioning information to the first application.
[0500] S1346: The first application performs application processing based on the qth positioning information.
[0501] The processes of S1342-S1346 can refer to the related descriptions of S1106-S1110, and will not be described herein.
[0502] S1347: After obtaining the positioning collection information, the positioning module determines whether the positioning prediction condition is met.
[0503] The execution process of S1341 can refer to the related content of S1121, and will not be described herein.
[0504] At this time, it is determined that the positioning prediction condition is not met, and the positioning module can switch from the low frequency to the high frequency sampling frequency.
[0505] S1348: The positioning module determines the second sampling rate.
[0506] At this time, the positioning module determines that the second sampling rate is different from the previous third sampling rate, and therefore, switching between different low frequencies is required, and therefore, S1349 is executed.
[0507] S1349: The positioning module sends a fourth collection frequency switching instruction to the GPS driver.
[0508] The fourth collection frequency switching instruction can include the second sampling rate.
[0509] Wherein, S1349 can refer to the content of S1123, and no longer be described.
[0510] S1350: The positioning module calculates the a-th positioning prediction information.
[0511] S1351: The positioning module performs padding processing on the a-th positioning prediction information to obtain the q+1-th positioning information.
[0512] S1352: The positioning module sends the q+1-th positioning information to the position management module based on the reporting time.
[0513] S1353: The position management module sends the q+1-th positioning information to the first application.
[0514] S1354: The first application performs application processing based on the q+1-th positioning information.
[0515] Wherein, the processing procedures of S1350-S1354 can refer to the related description of S1125-S1129, and no longer be described.
[0516] S1355: The GPS driver sends the b-th positioning collection information to the positioning module.
[0517] S1356: The positioning module performs padding processing on the b-th positioning collection information to obtain the q+2-th positioning information.
[0518] S1357: The positioning module sends the q+2-th positioning information to the position management module.
[0519] S1358: The position management module sends the q+2-th positioning information to the first application.
[0520] S1359: The first application performs application processing based on the q+2-th positioning information.
[0521] Wherein, the processing procedures of S1355-S1359 can refer to the related description of S1125-S1129, and no longer be described.
[0522] S1360: After obtaining the positioning collection information, the positioning module determines whether the positioning prediction condition is met.
[0523] Wherein, the execution process of S1341 can refer to the related content of S1321, and no longer be described.
[0524] At this time, it is determined that the positioning prediction condition is met.
[0525] S1361: The positioning module determines the second sampling rate.
[0526] The second sampling rate is the same as the last sampling rate, and no switching is performed.
[0527] The processes of S1360-S1361 can refer to the related description of S1321-S1322, and will not be repeated here.
[0528] Figure 13D S1362-S1366 can be included, and specifically, the electronic device exits the process of collecting positioning information.
[0529] S1362: The first application acquires a second operation, and in response to the second operation, the positioning state is closed.
[0530] S1363: The first application sends a location end acquisition request to the location management module.
[0531] S1364: The location management module sends an end positioning request to the positioning module.
[0532] S1365: The positioning module sends a second positioning start-stop instruction to the GPS driver.
[0533] S1366: The GPS driver ends the collection of positioning information.
[0534] The related description of S1362-S1366 can refer to the related description of S1154-S1158.
[0535] It should be noted that in the case of the sampling rate being the second sampling rate, the user clicks to exit the first application, and the electronic device can directly exit the process of collecting positioning information.
[0536] In the above embodiments, all or part of the functions can be realized by software, hardware, or a combination of software and hardware. When realized by software, all or part of the computer program product can be realized. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state disk (SSD)), etc.
[0537] Those skilled in the art can understand that all or part of the processes in the above-mentioned method embodiments can be implemented by a computer program instructing relevant hardware to complete, the program can be stored in a computer readable storage medium, and the program can include the processes of the above-mentioned method embodiments when executed. The aforementioned storage medium includes ROM or random storage memory RAM, magnetic disc or optical disc and various storage code medium.
Claims
1. A method for obtaining location information, characterized in that, The method is applied to an electronic device having a first application installed, and the method includes: In response to a first operation performed on the first application, location information acquisition begins; If the location prediction conditions are not met, the location information is acquired based on the first sampling rate. Under the condition of satisfying the location prediction, location acquisition information is obtained based on the second sampling rate; first location prediction information is obtained based on historical location acquisition information; wherein, the first location prediction information and the location acquisition information obtained based on the second sampling rate are combined to form location information, and the sampling rate of the combined location information is the same as the first sampling rate; The first sampling rate is greater than the second sampling rate; the positioning prediction conditions include satellite signal quality conditions and / or positioning change conditions, wherein the positioning change conditions are that the movement change angle is less than the threshold angle, and / or that the displacement change rate is greater than or equal to (greater than) the second threshold change rate.
2. The method according to claim 1, characterized in that, The process of starting to acquire location information includes: Location information is acquired based on the first sampling rate; The method further includes: Determine whether the positioning prediction condition is met. If the positioning prediction condition is met, determine the second sampling rate and switch the sampling frequency from the first sampling rate to the second sampling rate; the sampling frequency is the frequency at which positioning information is collected.
3. The method according to claim 1 or 2, characterized in that, The location information includes latitude, longitude, and altitude; When the second sampling rate is half of the first sampling rate, the step of obtaining the first positioning prediction information based on historical positioning information includes: Based on the first latitude and longitude (X1, Y1) and first altitude H1 of the first positioning acquisition information, the second latitude and longitude (X2, Y2) and second altitude H2 of the second positioning acquisition information, and the third latitude and longitude (X3, Y3) and third altitude H3 of the third positioning acquisition information, the latitude and longitude (x1, y1) and altitude h1 of the first positioning prediction information are determined. If the sampling frequency between the first and second location acquisition information, and between the second and third location acquisition information, is the same as the first sampling rate, then the latitude and longitude (x1, y1) and altitude h1 are determined as follows: If the sampling frequency between the first and second positioning information is the first sampling rate, and the sampling frequency between the second and third positioning information is the second sampling rate, then the latitude and longitude (x1, y1) and altitude h1 are determined as follows: If the sampling frequencies between the first and second positioning information, and between the second and third positioning information, are both the second sampling rate, then the latitude and longitude (x1, y1) and altitude h1 are determined as follows: Wherein, ΔX1 = X2 - X1, ΔX2 = X3 - X2, ΔY1 = Y2 - Y1, ΔY2 = Y3 - Y2; ΔH2 = H3 - H2, ΔH1 = Y2 - Y1; ΔX is the displacement of the positioning information in the longitude direction; ΔY is the displacement of the positioning information in the latitude direction; ΔH is the displacement of the positioning information in the altitude direction; the first positioning acquisition information, the second positioning acquisition information, and the third positioning acquisition information are the three most recent historical positioning acquisition information obtained from farthest to nearth in time.
4. The method according to claim 1 or 2, characterized in that, The location information includes latitude, longitude, and altitude; the acquisition of the first location prediction information based on historical location data includes: Based on the first latitude and longitude (X1, Y1) and first altitude H1 of the first positioning acquisition information, the second latitude and longitude (X2, Y2) and second altitude H2 of the second positioning acquisition information, and the third latitude and longitude (X3, Y3) and third altitude H3 of the third positioning acquisition information, the latitude and longitude (x1, y1) and altitude h1 of the first positioning prediction information are determined as follows: x1 = X last +Δx;y1=Y last +Δy;h1=H last +Δh; Where k1 is the number of positioning prediction information obtained between the first positioning acquisition information and the second positioning acquisition information; k2 is the number of positioning prediction information obtained between the second positioning acquisition information and the third positioning acquisition information; X last Y last and H last The first, second, and third positioning information are, in order, the longitude, latitude, and altitude of the most recently acquired positioning information; ΔX1 = X2 - X1, ΔX2 = X3 - X2, ΔY1 = Y2 - Y1, ΔY2 = Y3 - Y2; ΔH2 = H3 - H2, ΔH1 = Y2 - Y1; ΔX is the displacement of the positioning information in the longitude direction; ΔY is the displacement of the positioning information in the latitude direction; ΔH is the displacement of the positioning information in the altitude direction; the first, second, and third positioning information are, in order, the three most recent historical positioning information acquired from farthest to closest in time.
5. The method according to any one of claims 1-4, characterized in that, The location prediction information includes time information, and the method for obtaining the first location prediction information based on historical location data further includes: The time information of the first positioning prediction information is determined to be t1 = T. last +Δt; Where Δt = 1 / f1; f1 is the first sampling rate, T last This refers to the time information of the most recently acquired location data.
6. The method according to any one of claims 2-5, characterized in that, Determining the second sampling rate includes: The second sampling rate is determined to be half of the first sampling rate.
7. The method according to any one of claims 2-5, characterized in that, Determining the second sampling rate includes: If the rate of change of displacement is less than the rate of change of the first threshold, the second sampling rate is determined to be f2 = f1 / K; the rate of change of displacement is the rate of change of displacement in latitude and longitude in the historical positioning information. If the displacement change rate is less than the first threshold change rate and the first displacement is less than the first distance, the second sampling rate is determined to be f2 = f1 / K; the first displacement is the displacement in latitude and longitude between the two most recently acquired historical positioning data. If the displacement change rate is greater than or equal to the first threshold change rate and less than the second threshold change rate, the second sampling rate is determined to be f2 = f1 / 2; Wherein, the first threshold change rate is less than the second threshold change rate, K is an integer greater than 2; f2 is the second sampling rate, and f1 is the first sampling rate.
8. The method according to claim 7, characterized in that, When the rate of change of displacement is less than the first threshold rate of change and the first displacement is less than the first distance, the method further includes: Acquire acceleration information and monitor whether the electronic device is approaching a stationary state based on the acceleration information; if it is determined that the electronic device is approaching a stationary state, the electronic device maintains the second sampling rate of f2 = f1 / K.
9. The method according to any one of claims 1-8, characterized in that, The satellite signal quality condition is that the number of first satellites is greater than or equal to the number of threshold satellites, and / or the first signal strength is greater than or equal to the signal strength of the threshold; the number of first satellites is the number of satellites that the current electronic device can receive satellite signals from; the first signal strength is the quality of the received satellite information.
10. The method according to claim 9, characterized in that, When the positioning prediction conditions include the positioning change conditions, the method further includes: Based on the first latitude and longitude (X1, Y1) of the first location acquisition information, the second latitude and longitude (X2, Y2) of the second location acquisition information, and the third latitude and longitude (X3, Y3) of the third location acquisition information, the displacement change rate R = |S1-S2| / S2 is determined; S1 and S2 are the displacements from two consecutive location acquisitions, respectively. ΔX1 = X2 - X1, ΔX2 = X3 - X2, ΔY1 = Y2 - Y1, ΔY2 = Y3 - Y2; ΔX is the displacement of the positioning information in the longitude direction; ΔY is the displacement of the positioning information in the latitude direction; and / or The movement angle is determined based on the second latitude and longitude (X2, Y2) of the second positioning information and the third latitude and longitude (X3, Y3) of the third positioning information. The first location acquisition information, the second location acquisition information, and the third location acquisition information are the three most recent historical location acquisition information obtained in order of time from farthest to closest.
11. The method according to claim 9 or 10, characterized in that, The threshold angle ranges from 2° to 10°; the second threshold change rate ranges from 5% to 15%.
12. The method according to any one of claims 2-11, characterized in that, After switching the sampling frequency from the first sampling rate to the second sampling rate, the method further includes: Determine whether the positioning prediction condition is met. If the positioning prediction condition is not met, switch the sampling frequency from the second sampling rate to the first sampling rate.
13. The method according to claim 12, characterized in that, If the positioning prediction conditions are met, positioning information is acquired based on the second sampling rate.
14. The method according to any one of claims 2-11, characterized in that, After switching the sampling frequency from the first sampling rate to the second sampling rate, the method further includes: Based on the first positioning information obtained based on the second sampling rate, it is determined that the electronic device is in a first low-frequency state; If the positioning prediction conditions are met, the electronic device is determined to be in a second low-frequency state, and a third sampling rate is determined. The sampling frequency is then switched from the second sampling rate to the third sampling rate. The third sampling rate is less than the first sampling rate. The second sampling rate is different from the third sampling rate. The first low-frequency state corresponds to the second sampling rate. The second low-frequency state corresponds to the third sampling rate. The first low-frequency state and the second low-frequency state are different low-frequency positioning information collection states.
15. The method according to claim 14, characterized in that, The first low-frequency state and the second low-frequency state are low-frequency states of different electronic devices; the low-frequency states include a state of near-stationary state, a state of slight speed change, and a state of constant speed forward movement; When the rate of change of displacement is less than the first threshold rate of change, the electronic device is in the uniform forward motion state, and the sampling rate corresponding to the uniform forward motion state is f2 = f1 / K; When the displacement change rate is less than the first threshold change rate and the first displacement is less than the first distance, the electronic device is in the near-stationary state, and the sampling rate corresponding to the near-stationary state is f2 = f1 / K; When the displacement change rate is greater than or equal to the first threshold change rate and less than the second threshold change rate, the electronic device is in the small speed change state, and the sampling rate corresponding to the small speed change state is f2 = f1 / 2; Wherein, the first threshold change rate is less than the second threshold change rate, K is an integer greater than 2; f2 is the second sampling rate, and f1 is the first sampling rate.
16. The method according to any one of claims 1-15, characterized in that, When the electronic device acquires a location acquisition information, it executes the process of determining whether the location prediction conditions are met.
17. The method according to claim 2, characterized in that, The electronic device includes a positioning module and a GPS driver. The step of acquiring positioning information based on the first sampling rate includes: The GPS driver acquires positioning information based on the first sampling rate. The GPS driver sends the location acquisition information to the positioning module; The step of determining whether the positioning prediction condition is met, and if the positioning prediction condition is met, determining the second sampling rate and switching the sampling frequency from the first sampling rate to the second sampling rate, includes: The positioning module determines whether the positioning prediction conditions are met. If the positioning prediction conditions are met, a second sampling rate is determined. The positioning module sends a sampling frequency switching command to the GPS driver, and the sampling frequency switching command includes the second sampling rate. The GPS driver acquires positioning information according to the second sampling rate.
18. The method according to claim 17, characterized in that, The electronic device further includes a location management module, which obtains first location prediction information based on historical location data, including: The positioning module calculates first positioning prediction information based on the historical positioning information, and then fills in the first positioning prediction information to obtain positioning information. The positioning module sends the positioning information to the location management module.
19. An electronic device, characterized in that, include: One or more processors and one or more memories; the one or more processors are coupled to the one or more memories, the one or more memories being used to store computer program code, the computer program code including computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1-18.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method as described in any one of claims 1-18.
Citation Information
Patent Citations
Information acquisition device, operation method thereof and control method of positioning unit
CN114488201A