Positioning acquisition method and electronic equipment
By dynamically adjusting the frequency of positioning information collection in electronic devices according to positioning prediction conditions, the problem of power consumption increase when electronic devices acquire positioning information in real time is solved, and the power consumption reduction and accuracy and reliability of positioning information are achieved.
Patent Information
- Application Number
- CN202311289174.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-27
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2043-09-27
AI Technical Summary
In the process of obtaining position information in real time, electronic devices lead to increased power consumption, affecting the battery life and efficiency of the equipment.
By switching the acquisition frequency of positioning information in the electronic device, the sampling rate is dynamically adjusted according to the positioning prediction conditions, and switch from high frequency to low frequency to reduce power consumption.
It effectively reduces the power consumption during the acquisition of positioning information, extends the battery life of the device, and ensures the accuracy and reliability of positioning information.
Smart Images

Figure CN119767242A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a positioning acquisition method and electronic equipment. Background Art
[0002] When users travel, they need electronic devices to locate their travel routes or locations. For example, users plan navigation information through the vehicle and drive according to the navigation route. In the above process, electronic devices such as vehicle-mounted devices and mobile phones need to continuously obtain the user's location in real time. However, the process of obtaining location information in real time will cause the power consumption of electronic devices to increase significantly. Summary of the invention
[0003] The present application provides a positioning acquisition method and an electronic device, which can save positioning power consumption.
[0004] In a first aspect, the present application provides a positioning acquisition method, which is applied to an electronic device, wherein the electronic device has a first application installed, and the method includes: starting to acquire positioning information in response to a first operation acting on the first application; when a positioning prediction condition is not met, acquiring positioning acquisition information based on a first sampling rate; when the positioning prediction condition is met, acquiring positioning acquisition information based on a second sampling rate; the first sampling rate is greater than the second sampling rate.
[0005] The first application may request to obtain positioning information for multiple consecutive times.
[0006] In the embodiment of the present application, when the electronic device meets the positioning prediction conditions, the low-frequency collection frequency can be maintained. If it does not meet the conditions, it needs to switch to a high-frequency collection frequency to ensure the accuracy and reliability of the positioning information. According to the status of different electronic devices, the electronic device can also support the switching of different low-frequency collections, thereby further reducing the positioning power consumption and ensuring the accuracy of the positioning information.
[0007] In a possible implementation, when the positioning prediction condition is met, the method further includes: obtaining first positioning prediction information based on historical positioning acquisition information; wherein the first positioning prediction information is combined with the positioning acquisition information obtained 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, when the electronic device meets the positioning prediction condition, the low-frequency acquisition frequency can be maintained, the sampling frequency can be reduced, and the power consumption of obtaining positioning information from the satellite system can be reduced. In addition, the first positioning prediction information is inferred to ensure that the sampling rate of the positioning information is high frequency, thereby maintaining the accuracy of the positioning information obtained by the first application.
[0008] In a possible implementation, the method further includes: acquiring positioning acquisition information based on the first sampling rate when the positioning prediction condition is not met. In this way, when the conditions or environment are poor, high-frequency acquisition can be switched to ensure the accuracy of the acquired positioning information.
[0009] In a possible implementation, the positioning information includes longitude and latitude and altitude; when the second sampling rate is half of the first sampling rate, the acquiring the first positioning prediction information based on the historical positioning collection information includes: determining the longitude and latitude (x1, y1) and altitude h1 of the first positioning prediction information based on the second longitude and latitude (X1, Y1) and the first altitude H1 of the first positioning collection information, the second longitude and latitude (X2, Y2) and the second altitude H2 of the second positioning collection information, and the third longitude and latitude (X3, Y3) and the third altitude H3 of the third positioning collection information;
[0010] If the acquisition frequencies between the first positioning acquisition information and the second positioning acquisition information, and between the second positioning acquisition information and the third positioning acquisition information are both the first sampling rate, the longitude and latitude (x1, y1) and the altitude h1 are determined as:
[0011]
[0012]
[0013]
[0014] If the acquisition frequency between the first positioning acquisition information and the second positioning acquisition information is the first sampling rate, and the acquisition frequency between the second positioning acquisition information and the third positioning acquisition information is the second sampling rate, the longitude and latitude (x1, y1) and the altitude h1 are determined as follows:
[0015]
[0016]
[0017]
[0018] If the acquisition frequencies between the first positioning acquisition information and the second positioning acquisition information, and between the second positioning acquisition information and the third positioning acquisition information are both the second sampling rate, the longitude and latitude (x1, y1) and the altitude h1 are determined as:
[0019]
[0020]
[0021]
[0022] Among them, Δ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 respectively the three most recent historical positioning acquisition information acquired from far to near in time. In this way, when the positioning prediction information is acquired by binary interpolation, the longitude and latitude and altitude of the positioning prediction information can be calculated according to the above calculation formula, which can ensure the accuracy of the calculated positioning information.
[0023] In a possible implementation, the positioning information includes longitude and latitude and altitude; the obtaining of the first positioning prediction information based on the historical positioning collection information includes: determining the longitude and latitude (x1, y1) and the altitude h1 of the first positioning prediction information based on the second longitude and latitude (X1, Y1) and the first altitude H1 of the first positioning collection information, the second longitude and latitude (X2, Y2) and the second altitude H2 of the second positioning collection information, and the third longitude and latitude (X3, Y3) and the third altitude H3 of the third positioning collection information as follows: x1=X last +Δx;y1=Y last +Δy;h1=H last +Δh;
[0024]
[0025]
[0026]
[0027] Wherein, k1 is the number of positioning prediction information obtained between the first positioning collection information and the second positioning collection information; k2 is the number of positioning prediction information obtained between the second positioning collection information and the third positioning collection information; X last , Y last and H lastThey are respectively 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 positioning acquisition information, the second positioning acquisition information and the third positioning acquisition information are respectively the three most recent historical positioning acquisition information acquired from far to near in time. In this way, when the positioning prediction information is acquired in a k+1 interpolation manner, the longitude and latitude and altitude of the positioning prediction information can be calculated according to the above calculation formula, which can ensure the accuracy of the calculated positioning information, and can adaptively calculate the positioning information to accelerate the calculation process.
[0028] In a possible implementation manner, the positioning prediction information includes time information, and the method of obtaining the first positioning prediction information based on the historical positioning collection information further includes: determining that the time information of the first positioning prediction information is t1=T last +Δt; where Δt=1 / f1; f1 is the first sampling rate, T last The time information of the most recently acquired positioning information can be inferred and processed to ensure the accuracy and reliability of the time.
[0029] In a 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 obtain the second sampling rate in a certain manner, with less calculation and effective frequency reduction, thereby ensuring the speed of calculation.
[0030] In a possible implementation, the second sampling rate is determined as follows: when the displacement change rate is less than the first threshold change rate, the second sampling rate is determined as f2=f1 / K; the displacement change rate is the change rate of the displacement in longitude and latitude in the historical positioning acquisition information; when 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 as f2=f1 / K; the first displacement is the displacement in longitude and latitude between the two most recently collected historical positioning acquisition information; 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 second sampling rate is determined as 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. In this way, the sampling rates obtained in different situations are different, and the sampling rate can be further adjusted accurately to ensure the accuracy of the obtained sampling rate, and the sampling rate can be further reduced to achieve more accurate power consumption reduction processing.
[0031] The displacement change rate is the speed of displacement change in longitude and latitude in the historical positioning collection information.
[0032] In a possible implementation, when 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 includes: acquiring acceleration information, and monitoring whether the electronic device is in a state of tending to be stationary based on the acceleration information; when it is determined that the electronic device is in a state of tending to be stationary, the electronic device maintains the second sampling rate as f2=f1 / K. In this way, the device needs to be monitored in the state of tending to be stationary to ensure the accuracy of the downsampling timing, and can be monitored sensitively to achieve rapid adjustment of the sampling rate and ensure the timeliness of the adjustment.
[0033] In a possible implementation, the positioning prediction condition includes one or more of the following conditions: the acquisition frequency condition, the satellite signal quality condition, and the positioning change condition; the acquisition frequency condition is the condition that the first sampling rate is greater than or equal to the first threshold sampling rate; the satellite signal quality condition is the condition that the first number of satellites is greater than or equal to the threshold number of satellites, and / or the first signal strength is greater than or equal to the threshold signal strength; the positioning change condition is the condition that the moving change angle is less than the threshold angle, and / or the displacement change rate is greater than or equal to (greater than) the second threshold change rate; wherein, the first number of satellites is the number of satellites that the electronic device can currently receive satellite signals; the first signal strength is the signal quality of the satellite information received. In this way, the limitation of the acquisition frequency in the acquisition frequency condition ensures that it is necessary to reduce the sampling frequency only when it is in the case of high-frequency sampling positioning, and ensures the accurate timing 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 electronic device has good signal quality in an open place, and poor signal quality in a shielded place; when the signal quality is good, reducing the sampling frequency of the electronic device can ensure the accuracy of the positioning information obtained by the electronic device. The faster the moving speed in the positioning change condition, the smaller the threshold angle. The electronic device can ensure that the moving speed increases and the threshold angle limit becomes smaller. The limit of the threshold angle can make the direction of the electronic device within a smaller range, thereby ensuring the accuracy of the inferred positioning prediction information.
[0034] In a possible implementation, when the positioning prediction condition includes the positioning change condition, the method further includes: determining a displacement change rate R=|S1-S2| / S2 based on a first longitude and latitude (X1, Y1) of the first positioning collection information, a second longitude and latitude (X2, Y2) of the second positioning collection information, and a third longitude and latitude (X3, Y3) of the third positioning collection information; S1 and S2 are displacements of two consecutive collections of positioning information, 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 dimensional direction; and / or the movement change angle is determined based on the second longitude and latitude (X2, Y2) of the second positioning collection information and the third longitude and latitude (X3, Y3) of the third positioning collection information 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 acquired from far to near in time. In this way, the electronic device calculates the displacement change rate and / or the movement change angle to ensure the accuracy of the positioning change condition judgment and the accuracy of the sampling rate calculation.
[0035] In a possible implementation, the threshold angle is in the range of 2° to 10°, and the second threshold change rate is in the range of 5% to 15%. In this way, the definition of the threshold angle and the second threshold change rate can ensure the accuracy and reliability of the inferred positioning information.
[0036] In a possible implementation, after the acquisition frequency is switched from the first sampling rate to the second sampling rate, the method further includes: determining whether the positioning prediction condition is met, and if the positioning prediction condition is not met, switching the acquisition frequency from the second sampling rate to the first sampling rate. In this way, when acquiring at a low frequency, the positioning prediction condition needs to be detected, and if it is not met, it needs to be switched back to a high frequency to ensure the accuracy of the positioning information.
[0037] In a possible implementation, when the positioning prediction condition is met, the positioning collection information is acquired based on the second sampling rate.
[0038] In a possible implementation, after the acquisition frequency is switched from the first sampling rate to the second sampling rate, the method further includes: determining that the electronic device is in a first low-frequency state when the first positioning acquisition information is acquired based on the second sampling rate; determining that the electronic device is in a second low-frequency state when the positioning prediction condition is satisfied, and determining a third sampling rate, and switching the acquisition frequency from the second sampling rate to the third sampling rate, wherein the third sampling rate is less than the first sampling rate, the second sampling rate is different from the third sampling rate, and the first low-frequency state corresponds to the second sampling rate; and the second low-frequency state is different from the third sampling rate in terms of the low-frequency acquisition of positioning information. In this way, different low-frequency sampling rates can be switched to ensure more precise regulation of power consumption reduction and achieve a balance between the accuracy of positioning information and power consumption.
[0039] 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 state includes a state tending to be stationary, a state of small speed change and a state of uniform forward movement; when the displacement change rate is less than the first threshold change rate, the electronic device is in the state of uniform forward movement, and the sampling rate corresponding to the uniform forward movement 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 state tending to be stationary, and the sampling rate corresponding to the state tending to be stationary 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 state of small speed change, and the sampling rate corresponding to the state of small speed change 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. In this way, different low-frequency states can be switched to each other, and the judgment conditions can ensure the accurate timing of switching.
[0040] In a possible implementation, when the electronic device acquires the positioning collection information once, the process of determining whether the positioning prediction condition is satisfied is executed once. In this way, each time the positioning collection information is acquired, the positioning prediction condition is determined once, ensuring the timeliness and accuracy of the electronic device in the preparation state and the control state.
[0041] In a possible implementation, when the electronic device does not obtain the positioning collection information through the first sampling rate, if the process of determining whether the positioning prediction condition is met is executed once, and the positioning prediction condition is determined to be met, the sampling rate is determined once. In this way, in the control state, if the positioning prediction condition is determined to be met each time, the sampling rate is obtained once, ensuring the sensitivity and timeliness of the switching of different low-frequency sampling rates.
[0042] In a possible implementation, the electronic device includes a positioning module and a GPS driver, and the acquisition of positioning acquisition information based on the first sampling rate includes: acquiring positioning acquisition information based on the first sampling rate through the GPS driver; the GPS driver sends the positioning acquisition information to the positioning module; the judgment of whether the positioning prediction condition is met, and if the positioning prediction condition is met, determining the second sampling rate, and switching the acquisition frequency from the first sampling rate to the second sampling rate includes: judging whether the positioning prediction condition is met through the positioning module, and if the positioning prediction condition is met, determining the second sampling rate; sending a sampling frequency switching instruction to the GPS driver through the positioning module, the sampling frequency switching instruction includes the second sampling rate; the GPS driver acquires positioning acquisition information according to the second sampling rate. In this way, the GPS driver can switch between different sampling rates and reduce the power consumption of acquiring positioning information.
[0043] In a possible implementation, the electronic device further includes a location management module, and acquiring first location prediction information based on historical location acquisition information includes: calculating first location prediction information based on the historical location acquisition information by the location module, and performing filling processing on the first location prediction information to obtain location information; and the location module sends the location information to the location management module. In this way, the power consumption of location acquisition can be reduced.
[0044] 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 to the one or more memories, the one or more memories are used to store computer program code, the computer program code includes computer instructions, and when the one or more processors execute the computer instructions, the electronic device performs the positioning acquisition method described in the first aspect or any possible implementation method of the first aspect.
[0045] In a third aspect, an embodiment of the present application provides a computer storage medium, including computer instructions, which, when executed on an electronic device, enables the device to execute the positioning acquisition method in any possible implementation of the first aspect.
[0046] In a fourth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer executes the positioning acquisition method in any possible implementation of the first aspect.
[0047] In a fifth aspect, an embodiment of the present application provides a chip system, which is applied to an electronic device, and the chip system includes one or more processors, which are used to call computer instructions so that the electronic device executes the positioning acquisition method described in the first aspect or any possible implementation method of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The following is an introduction to the drawings used in the embodiments of the present application.
[0049] Figure 1 It is a schematic diagram of a hardware structure provided by an embodiment of the present application;
[0050] Figure 2 It is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0051] Figure 3 is a schematic diagram of a satellite positioning system provided in an embodiment of the present application;
[0052] Figure 4A and Figure 4B It is a set of software framework schematic diagrams provided in the embodiments of the present application;
[0053] Figure 5 This is a flow chart of a method for obtaining positioning information of an electronic device provided in an embodiment of the present application;
[0054] Figure 6 This is a schematic diagram of positioning longitude and latitude changes provided in an embodiment of the present application;
[0055] Figure 7 It is a flow chart of a method for determining a sampling frequency provided in an embodiment of the present application;
[0056] Fig. 8A and Figure 8B is a schematic diagram of a method for obtaining positioning prediction information provided by an embodiment of the present application;
[0057] FIG. 9A to FIG. 9D is another schematic diagram of a method for obtaining positioning prediction information provided by an embodiment of the present application;
[0058] Fig.10 It is a flow chart of a method for determining a sampling frequency provided in an embodiment of the present application;
[0059] FIG. 11A to FIG. 11D This is a flow chart of an interactive method for obtaining positioning information provided by an embodiment of the present application;
[0060] Fig.12 This is a schematic diagram of a method for predicting reporting time provided in an embodiment of the present application;
[0061] FIG. 13A to FIG. 13DIt is a flowchart of another interactive method for obtaining positioning information provided in an embodiment of the present application. DETAILED DESCRIPTION
[0062] The terms used in the following embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to be used as limitations on the embodiments of the present application. As used in the specification and the appended claims of the embodiments of the present application, the singular expressions "one", "a kind of", "said", "above", "the" and "this" are intended to also include plural expressions, unless there is a clear indication to the contrary in the context. It should also be understood that the term "and / or" used in the embodiments of the present application refers to and includes any or all possible combinations of one or more listed items.
[0063] An electronic device may be a device that provides voice and / or data connectivity to a user. The electronic device may 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 (handheld), a laptop computer, a cordless phone or a wireless local loop (WLL) station, a machine type communication (MTC) terminal, a wearable device (such as a smart watch, a smart bracelet, a pedometer, etc.), an in-vehicle device (such as a car, a bicycle, an electric car, 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, an intelligent robot, a workshop equipment, 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 smart city, etc. The invention relates to wireless terminals in a smart city, wireless terminals in a smart home, flying equipment (for example, intelligent robots, hot air balloons, drones, airplanes) or other devices that can access the network.
[0064] In order to better understand the embodiments of the present application, the structure of the electronic device in the embodiments of the present application is introduced below:
[0065] Figure 1 The hardware structure diagram of the electronic device is shown. The electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging 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, etc. Among them, the sensor module 180 may include an acceleration sensor 180E, a touch sensor 180K, etc.
[0066] It is to be understood that the structure illustrated 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 may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0067] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G, etc., applied to electronic devices. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (Low Noise Amplifier, LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1.
[0068] The modulation and demodulation processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is transmitted to the application processor.
[0069] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to electronic devices. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0070] In some embodiments, antenna 1 of the electronic device is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that the electronic device can communicate with the network and other devices through wireless communication technology.
[0071] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (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. Different processing units may be independent devices or integrated into one or more processors.
[0072] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0073] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.
[0074] It is understandable that the interface connection relationship between the modules illustrated in the embodiments of the present application is a schematic illustration and does not constitute a structural limitation on the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
[0075] The wireless communication function of the electronic device can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0076] The electronic device implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
[0077] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc.
[0078] The sensor module 180 may include one or more sensors, which may be of the same type or of different types. Figure 1 The sensor module 180 shown is only an exemplary division method. There may be other division methods, which are not limited in this application.
[0079] The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device in all directions (generally three axes). When the electronic device is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the posture of the electronic device and is applied to applications such as horizontal and vertical screen switching and pedometers.
[0080] The touch sensor 180K is also called a "touch panel". The touch sensor 180K can be set on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, also called 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 type of touch event. 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 set on the surface of the electronic device, which is different from the position of the display screen 194.
[0081] In an embodiment of the present application, the electronic device may 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 hardware such as a central processing unit (CPU), a memory management unit (MMU), and a memory (also called main memory). The operating system may be any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a Windows operating system. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software.
[0082] The software system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture, etc. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.
[0083] Figure 2 It is a software structure block diagram of the electronic device according to an embodiment of the present application. Figure 2 The invention describes a process of an electronic device obtaining positioning information.
[0084] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers, from top to bottom: application layer (App layer), application framework layer (FWK layer), hardware abstraction layer (HAL), kernel layer and hardware layer.
[0085] The application layer can include a series of application packages. Figure 2 As shown, the application layer may include applications such as XX map, XX navigation, weather and calendar. It should be noted that the application package that the electronic device may include may not be limited to the above applications, but may also include other applications or may not include the above applications, and this application is not limited to this.
[0086] 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 FWK starts acquiring location information, XX Navigation can receive location information from the FWK layer.
[0087] The application framework layer provides API and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.
[0088] like Figure 2 As shown, the application framework layer may include a location management module (Location Manager), which can manage the function of geographic location information. The location management module can report location information to the corresponding application based on the location request of each application in the application layer. For example, the location management module receives a location information request from XX navigation, and the location management module can obtain location information from the HAL layer and report the obtained location information to XX navigation.
[0089] The positioning module of the HAL layer can receive the positioning request from the FWK layer. The positioning request may include the reporting interval and parameter information. The reporting interval may indicate the sampling frequency information or period information for obtaining the positioning information; the parameter information may include the data structure information (GPSLocation data structure) of the positioning information. The data structure information may include the storage type and structure of the positioning information. For example, data structures (information content) such as latitude and longitude, altitude, timestamp, etc.
[0090] After receiving 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 in the data based on the data structure information (GPSLocation data structure) and report the filled positioning information to the FWK layer.
[0091] The positioning module can also receive positioning start and end information from the FWK layer. The positioning start and end information can be used to indicate the start or stop of obtaining positioning information. The positioning module can start or end the acquisition of positioning information based on the positioning start and end information. The positioning module can send positioning start and end instructions to the GPS driver based on the positioning start and end information. The positioning start and end instructions are used to instruct the GPS driver to start or end the acquisition of GPS information.
[0092] The kernel layer is the layer between hardware and software. The kernel layer can contain GPS drivers, display drivers, etc.
[0093] The GPS driver can control the GPS chip navigation telegram data to perform parsing and data format conversion, obtain positioning information, and send the positioning information to the HAL module through the GPS standard protocol. Among them, 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 synchronous serial bus (SPI) interface, and an integrated circuit bus (IC) interface, etc.
[0094] The GPS driver may receive a positioning acquisition instruction from the HAL layer, and acquire positioning information based on the positioning acquisition instruction. The positioning acquisition instruction may include a sampling frequency. The sampling frequency may be a frequency for acquiring positioning information.
[0095] The GPS driver can determine to start acquiring the positioning signal or end acquiring the positioning information based on the positioning start and end instructions issued by the HAL layer. For example, when the positioning start and end instructions indicate to start acquiring the positioning information, the GPS driver can control the communication module and the GPS chip to acquire the GPS positioning signal and parse GPS-related data.
[0096] The hardware layer may include a communication module, a GPS chip, a display screen, etc. The communication module may receive positioning information from a satellite positioning system, and the GPS chip may parse and process the received navigation message data.
[0097] Among them, the communication module may include a radio frequency module and a baseband module. The radio frequency module can send or receive signals to the satellite. The satellite can send positioning signals to the electronic device through a specific carrier frequency band, and the electronic device can receive the positioning signal through the radio frequency module. Among them, the carrier frequency band used by the satellite positioning system can be carrier L1, L2, pseudo-noise code C / A code, P code navigation message D code, which is not limited in this application. The baseband module can demodulate the positioning signal according to the specific carrier frequency band to obtain navigation message data, and then send the navigation message data to the GPS chip.
[0098] The GPS chip receives the navigation message data from the baseband module and can parse and process the navigation message data. The parse and process may include demodulation of the navigation message data, pseudo-distance estimation of the user position, ephemeris estimation of the satellite position, and the like. After the parse and process of the navigation message data is completed, the data format can be converted according to the GPS standard to obtain the 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 driver polling method to obtain the positioning information. Exemplarily, the GPS chip can regularly report the positioning information to the GPS driver according to the time interval of the sampling period corresponding to the sampling frequency.
[0099] With the gradual promotion and popularization of smart electronic devices, the use scenarios of using GPS for high-precision satellite positioning are gradually increasing. In daily travel, car 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, car map), the user wants to reach location B, open the XX map software of the electronic device, and determine the destination as location B, XX map will obtain GPS and other positioning information, and plan the route according to the positioning information.
[0100] Electronic devices can obtain positioning information through satellite positioning systems, such as Figure 3 This is a schematic diagram of a satellite positioning system proposed in an embodiment of the present application. Figure 3 As shown in the figure, in this satellite positioning system, electronic devices need to receive the broadcast information of 4 or more satellites at the same time to obtain positioning information. Due to the long distance of satellites, the positioning process takes a long time. After the electronic device obtains the positioning information, it needs to perform a solution, which is complex and consumes a lot of power.
[0101] In the embodiment of the present application, the satellite positioning system can be obtained through the Global Positioning System (GPS), Beidou Satellite Navigation System, GLONASS, Galileo Satellite Navigation System and other positioning systems, which is not limited in the embodiment of the present application.
[0102] When electronic devices use satellite positioning systems for positioning, they consume a lot of power. For example, for navigation applications on XX maps, the frequency of collecting positioning information is a fixed frequency of about 1s / time (1Hz); while the frequency of collecting sports applications is 2s / time (0.5Hz). Along with the collection of precise positioning information, the positioning chip call will increase power consumption. Furthermore, during the navigation process, the higher the frequency of reporting the user's location information, the greater the power consumption.
[0103] For example, after testing, the power consumption feedback data of the vehicle navigation system shows that when the vehicle navigation system is in the process of navigation, the battery consumption rate is 719mA, and the navigation consumes 172mAh in 14 minutes and 20 seconds, which is close to 3% of the battery capacity.
[0104] In summary, the process of obtaining positioning information itself consumes a lot of power, and the high frequency of obtaining positioning information further increases the power consumption of electronic equipment in collecting positioning information.
[0105] In response to the above technical problems, the embodiments of the present application propose a method for obtaining positioning information and an electronic device. The collection frequency of positioning information can be switched in the electronic device. When the electronic device meets the positioning prediction conditions, it can switch from a high-frequency collection frequency to a low-frequency collection frequency, and at the same time, infer and calculate new positioning information according to the most recently collected positioning information. Reducing the frequency of collecting positioning information can reduce the power consumption of the electronic device. Of course, when the electronic device meets the positioning prediction conditions, the low-frequency collection frequency can be maintained. If it is not satisfied, it needs to be switched to a high-frequency collection frequency to ensure the accuracy and reliability of the positioning information. According to the status of different electronic devices, the electronic device can also support switching between different low-frequency collections, which can further reduce the positioning power consumption and ensure the accuracy of the positioning information.
[0106] Figure 4A and Figure 4B It is a set of software framework schematic diagrams exemplarily disclosed in the embodiments of the present application.
[0107] like Figure 4A As shown, the layered architecture can also divide the Android system into five layers, from top to bottom: application layer (App layer), application framework layer, hardware abstraction layer, kernel layer and hardware layer.
[0108] Among them, the positioning module of the HAL layer may include a positioning frequency switching module. The positioning frequency switching module is a functional module that manages 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 it is necessary to switch the current collection frequency, so as to realize 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 infer and calculate the positioning information, and report the inferred positioning information according to the high frequency requirements of the location management module.
[0109] 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. For a description of the acceleration sensor, refer to Figure 1 The relevant content in will not be repeated here.
[0110] In the embodiment of the present application, if the electronic device is in the mode, the acceleration drive can obtain acceleration data from the acceleration sensor to determine whether the state of the electronic device is in a static or moving state. Of course, the electronic device can also call the sensorhub's ready-made AR algorithm or the state of the terminal device such as static or moving.
[0111] like Figure 4B As shown, Figure 4A The difference is that the location manager of the FWK layer can include a positioning frequency switching module. The execution function of the positioning frequency switching module can be referred to Figure 4A Based on the above, the positioning frequency switching module can also send the inferred positioning information to the corresponding application according to the request of the corresponding application. Figure 4B For descriptions of other modules, please refer to Figure 4A The content is not repeated here.
[0112] It should be noted that the above Figure 4A and Figure 4B In the software framework diagram, the positioning frequency switching module can be located in the FWK layer, the HAL layer, or other layers. The above description is only an exemplary description and is not limiting.
[0113] Figure 4A and Figure 4B For the description of other modules, please refer to Figure 2 The relevant content will not be elaborated on here.
[0114] Combination Figure 4A and Figure 4B The relevant description specifically explains the process of an electronic device obtaining positioning information from a satellite positioning system.
[0115] Figure 5This is a flow chart of a method for obtaining electronic device location information disclosed in an embodiment of the present application. Figure 5 As shown, the method for obtaining positioning information may include but is not limited to the following steps:
[0116] When the electronic device obtains a location information request, it executes S501.
[0117] The positioning state may indicate whether the electronic device is in the process of positioning. The positioning state may include an on state and an off state. The on state may indicate that positioning information is being obtained; the off state may indicate that positioning information is not currently being obtained. When the electronic device obtains a positioning information request, the positioning state may be switched from the off state to the on state. When it is determined that the positioning state is in the on state, the electronic device determines that the positioning state condition is met; when it is determined that the positioning state is in the off state, the electronic device determines that the positioning state condition is not met.
[0118] Exemplarily, when a user clicks on XX navigation in an electronic device, the XX navigation application can request to start the positioning information acquisition function, that is, XX navigation can send a first positioning start and stop request to the FWK layer to request to start acquiring positioning information. After the FWK layer receives the positioning start and stop request, it can determine that the first positioning request state is adjusted from the closed state to the open state. After a period of time, when the user clicks to exit XX navigation, XX navigation can send a second positioning start and stop request to the FWK layer to request to end acquiring positioning information. After the FWK layer receives the second positioning start and stop request, the electronic device can determine that the positioning request state is adjusted from the open state to the closed state. The positioning state condition can be met within the above-mentioned open state time period.
[0119] It should be noted that if the above judgment process is executed by the positioning module of the HAL layer, the judgment can be made based on the positioning start and end instructions sent by the FWK layer to the HAL layer. The specific process can be similarly referred to the above exemplary description and will not be repeated.
[0120] S501: The electronic device performs positioning collection based on a first sampling rate to obtain positioning collection information.
[0121] When the electronic device starts to obtain the positioning information, it can request the satellite positioning system for the positioning information based on the acquisition frequency. At this time, the acquisition frequency is the first sampling rate, for example, 1 Hz.
[0122] Positioning collection information is the positioning information requested by the electronic device from the satellite positioning system. Positioning information may include timestamp, number of satellites, signal strength, altitude, longitude and latitude. Among them, the timestamp can indicate the time since the GPS chip was started, which can indirectly indicate the time when the positioning information was acquired; the number of satellites can indicate the number of satellites that the electronic device can communicate with; the signal strength can indicate the strength of the satellite signal received by the electronic device. For example, signal power, signal-to-noise ratio, etc., are not limited. Altitude and longitude and latitude can indicate the spatial geographical location of the current electronic device, that is, longitude, latitude and altitude.
[0123] In the embodiments of the present application, positioning information may include two types: positioning acquisition information and positioning prediction information. Among them, positioning acquisition information may refer to the positioning information obtained by the electronic device from the satellite positioning system, especially information such as altitude, longitude and latitude. Positioning prediction information may refer to the positioning information inferred by the electronic device based on the positioning acquisition information obtained nearby. It can be understood that the positioning prediction information comes from the current electronic device itself rather than the satellite positioning system.
[0124] S502: The electronic device determines whether the positioning prediction condition is met. If the positioning prediction condition is met, S503 is executed; if the positioning prediction condition is not met, S501 is executed.
[0125] In an embodiment 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 may correspond to a high-frequency sampling frequency; the control state may correspond to a low-frequency sampling frequency. The electronic device can switch between high-frequency and low-frequency sampling frequencies. Assume that after the electronic device starts positioning acquisition, it performs positioning acquisition according to the first sampling rate and is in a preparation state (at this time, the first sampling rate may be greater than a certain sampling threshold (the sampling frequency is high frequency)). After the electronic device obtains the positioning acquisition information according to the first sampling rate, and needs to further determine whether it still maintains the preparation state (that is, determine whether to switch the sampling frequency), it determines to switch the sampling frequency when the positioning prediction conditions are met. Execute S503; otherwise, remain in the preparation state (do not switch the sampling frequency), and execute S501.
[0126] When the electronic device is in the ready state, each time the positioning is collected, it is judged whether the positioning prediction condition is met (S502 is executed once). The positioning prediction condition can be a condition for judging whether to switch the positioning information collection frequency.
[0127] The positioning prediction conditions may include one or more of the following three conditions: acquisition frequency conditions, satellite signal quality conditions, and positioning change conditions. The present application does not limit the specific conditions included in the positioning prediction conditions.
[0128] Acquisition frequency condition: 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.
[0129] The electronic device can determine whether the first sampling rate is greater than or equal to (greater than) the first threshold sampling rate. When the first sampling rate is greater than or equal to (greater than) the first threshold sampling rate, the acquisition frequency condition is met; when the first sampling rate is less than (less than or equal to) the first threshold sampling rate, the acquisition frequency condition is not met. The electronic device can determine whether the current satellite positioning frequency is high-frequency, that is, whether it is necessary to downsample. If it is high frequency, it can be determined that downsampling is required, otherwise no downsampling is required. In this way, the limitation of the acquisition frequency ensures that it is necessary to reduce the sampling frequency only in the case of high-frequency sampling and positioning, and ensures the accurate timing of switching the sampling rate.
[0130] The first threshold sampling rate may be greater than or equal to 0.2 Hz, and the first threshold period may be less than or equal to 5 s.
[0131] Satellite signal quality condition: the first number of satellites is greater than or equal to (greater than) a threshold number of satellites and / or the first signal strength is greater than or equal to (greater than) a threshold signal strength.
[0132] The satellite signal quality condition can measure the quality of the satellite signal. The satellite signal quality condition can include one or more of the satellite quantity condition and the signal strength condition.
[0133] Satellite quantity condition: the first satellite quantity is greater than or equal to (greater than) a threshold satellite quantity.
[0134] The electronic device may be provided with a threshold number of satellites. The GPS driver of the electronic device may obtain the first number of satellites through the communication module. When the first number of satellites (the number of satellites currently obtained) is greater than or equal to (greater than) the threshold number of satellites, it is determined that the satellite number condition is met; when the first number of satellites (the number of satellites currently obtained) is less than (less than or equal to) the threshold number of satellites, it is determined that the satellite number condition is not met.
[0135] Exemplarily, when the threshold number of satellites is 4 and the first number of satellites is 7 (7>4), the electronic device may meet the satellite number condition; when the first number of satellites is 2 (2<4), the electronic device may not meet the satellite number condition.
[0136] The threshold number of satellites may range from 3 to 5.
[0137] Signal strength condition: the first signal strength is greater than or equal to (greater than) a threshold signal strength.
[0138] The electronic device may be provided with a threshold signal strength. The GPS driver of the electronic device may obtain the first signal strength through the communication module. When 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; when the first signal strength (the number of satellites currently acquired) is less than (less than or equal to) the threshold signal strength, it is determined that the signal strength condition is not met. Among them, the signal strength may 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 electronic device has good signal quality in an open place, and poor signal quality in a shielded place; when the signal quality is good, reducing the sampling frequency of the electronic device can ensure the accuracy of the positioning information acquired by the electronic device.
[0139] The above signal strength condition may 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, a signal to interference plus noise ratio (SINR), etc. The present application does not limit the specific data type compared by the signal strength condition.
[0140] Exemplarily, the threshold signal strength is -48 dBm (signal-to-noise ratio data), the first signal strength is -21 dBm, and -21 dBm>-48 dBm, so it can be determined that the signal strength condition is met.
[0141] Positioning change conditions: the movement change angle is less than the threshold angle, and / or the displacement change rate is greater than or equal to (greater than) the threshold change rate.
[0142] The movement change includes the displacement change rate and / or the movement change angle. The corresponding threshold change includes the threshold change rate and / or the threshold angle. The displacement change rate is the ratio of the two most recent displacement changes; the movement change angle is the angle between the longitude and latitude in the positioning information collected twice in a row.
[0143] Step 1: The electronic device can calculate the movement displacement and / or displacement change rate based on the positioning information collected two (or three times) recently.
[0144] The parameters of the positioning information can be expressed as longitude X, latitude Y, timestamp T, and altitude H. The two most recently 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).
[0145] Figure 6Schematic diagram of the change of positioning longitude and latitude disclosed in the embodiment of this application. Figure 6 As shown, the plane where the longitude and latitude are located can be abstracted into a plane rectangular coordinate system, and the first longitude and latitude (X1, Y1) and the second longitude and latitude (X2, Y2) are located at two points in the plane rectangular coordinate system. (X1, Y1) can be simplified and determined as the origin. Figure 6 The displacement and / or the change angle of movement of two points in the plane rectangular coordinate system abstracted from the image are calculated.
[0146] The electronic device can calculate the movement displacement based on the first longitude and latitude (X1, Y1) and the second longitude and latitude (X2, Y2): Of course, for the convenience of calculation, the displacement S can also be defined as 2 +ΔY 2 . Among them, ΔY=Y2-Y1, ΔX=X2-X1.
[0147] The electronic device may also calculate a movement change angle θ based on the first longitude and latitude (X1, Y1) and the second longitude and latitude (X2, Y2).
[0148]
[0149] Furthermore, the positioning information collected in the last three times also includes the third positioning collection information, and the third positioning collection information may include the third longitude and latitude (X3, Y3). The electronic device can determine the displacement change rate when the first longitude and latitude (X1, Y1), the second longitude and latitude (X2, Y2) and the third longitude and latitude (X3, Y3) are known. Among them, the two displacements in the longitude and latitude directions are ΔX1=X2-X1; ΔX2=X3-X2. ΔY1=Y2-Y1; ΔY2=Y3-Y2. The electronic device can determine that the two displacements before and after are The electronic device can calculate the displacement change rate as R=|S1-S2| / S2 based on the two displacements S1 and S2.
[0150] Step 2: The electronic device determines whether the positioning change conditions are met.
[0151] Case 1: The electronic device can determine whether the positioning change condition is met based on the movement change angle and the threshold angle.
[0152] When the moving change angle is greater than or equal to (greater than) the threshold angle θ1, the electronic device can determine that the positioning change condition is not met; when the moving displacement is less than (less than or equal to) the threshold displacement S1, and / or the moving change angle is less than (less than or equal to) the threshold angle θ1, the electronic device can determine that the positioning change condition is met.
[0153] The changes in the above-mentioned positioning coordinates can be used to determine the turning situation and speed of the electronic device. When the displacement changes greatly, the electronic device cannot reduce the sampling rate in order to ensure the accuracy of the positioning information, thereby ensuring the accuracy of the positioning information. When the displacement changes slightly, the electronic device reduces the positioning sampling frequency, and the predicted positioning information can also meet the requirements of the positioning information accuracy, and can effectively reduce power consumption.
[0154] It should be noted that the threshold angle θ1 may be a preset fixed value or a variable value. When the threshold angle is a variable value, the electronic device may first determine the threshold angle θ1 before executing the above determination of the positioning change condition.
[0155] Exemplarily, the first distance is 20m (corresponding to a moving displacement speed of approximately 70km / h), the first angle is 3°, the second angle is 5°, and when the current moving displacement is 31m>20m, the threshold angle can be determined to be 3°; when the current moving displacement is 16m<20m, the threshold angle can be determined to be 5°.
[0156] In the embodiment of the present application, the threshold angle ranges from 2° to 10°.
[0157] Optionally, the electronic device can set a threshold angle based on the moving speed, and the threshold angle becomes smaller as the moving speed increases. For example, the moving speed is inversely proportional to the threshold angle. For example, when the user is walking with the electronic device, the threshold angle is determined to be 8 degrees, and when the user is riding, the threshold angle is determined to be 6 degrees; when driving, the threshold angle is determined to be 5 degrees; when riding a high-speed train, the threshold angle is determined to be 2 degrees... In this way, the faster the moving speed, the smaller the threshold angle. The electronic device can ensure that the moving speed increases and the threshold angle limit becomes smaller. The limit of the threshold angle can make the direction of the electronic device within a smaller range, ensuring the accuracy of the inferred positioning prediction information.
[0158] 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.
[0159] 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 being greater than or equal to (greater than) the second threshold change rate, the electronic device can determine that the positioning change condition is not satisfied. In the case of being less than (less than or equal to) the second threshold change rate, the electronic device can determine that the positioning change condition is satisfied. In this way, in the above two cases, the limitation of the displacement change rate and the movement change angle can ensure that the acceleration of the electronic device is small and the turning angle is small, thereby ensuring that the electronic device is in a stable state, thereby ensuring the accuracy of the predicted positioning information.
[0160] The second threshold change rate may range from 5% to 15%, for example, 10%.
[0161] It should be noted that the electronic device's determination of whether the positioning change condition is met may include case 1 and / or case 2, and the present application does not limit this.
[0162] The positioning prediction condition is satisfied only when all conditions in the positioning prediction condition are satisfied. That is, when the above-mentioned positioning prediction condition includes the positioning change condition, the positioning change condition needs to be satisfied before the positioning prediction condition is satisfied. In the embodiment of the present application, the execution order of all conditions in the positioning prediction condition is not limited.
[0163] In order to save power for acquiring positioning information, electronic devices can reduce the frequency of collecting positioning information. However, a lower collection frequency will affect the effect of the application on positioning data processing. Therefore, here, by judging the positioning prediction conditions, it is determined whether to reduce the frequency to ensure the effect of obtaining positioning information.
[0164] S503: The electronic device determines a second sampling rate.
[0165] When the electronic device determines that the sampling frequency needs to be switched, it can determine a second sampling rate, which can be used for positioning sampling after the switch.
[0166] In a possible implementation manner: the electronic device may directly determine the second sampling rate based on the current sampling frequency.
[0167] 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 present application does not limit the method for determining the second sampling rate. 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 to determine the second sampling rate, and the second sampling rate is determined quickly and efficiently.
[0168] Exemplarily, assuming that the first sampling rate is f1 and the second sampling rate is f2, the electronic device may determine that f2=f1 / 2.
[0169] In another possible implementation manner: the electronic device may determine the second sampling rate based on the displacement change rate.
[0170] After the electronic device calculates the displacement change rate as R=|S1-S2| / S2, it determines the second sampling rate based on the displacement change rate R.
[0171] When the displacement change rate is obtained, 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.
[0172] The electronic device may 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 above two threshold change rates can divide the displacement change rate into three different ranges. When the displacement change rate R is less than (less than or equal to) the first threshold change rate, it can be further determined based on the displacement size whether it is currently in a uniform change or static state. When 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 speed change state. When 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 speed change state, and it is determined that the positioning change condition in S502 is not met (that is, the positioning prediction condition is not met), and it is judged to execute S501. In this way, the second sampling rate can be determined based on the state of the electronic device. Different states mean different second sampling rates. The more the electronic device tends to move, the higher the sampling rate. The more static or stable it is, the lower the sampling rate, which can ensure that the positioning information inferred by the electronic device is more accurate and precise. That is, the electronic device can be set with different low-frequency sampling rates. Each time the electronic device obtains positioning collection information, it can determine the sampling rate once. If the sampling rate changes, the electronic device can switch between low frequencies, which can further reduce the power consumption of positioning collection.
[0173] The above judgment process is described in detail as follows:
[0174] After switching to the control state, the electronic device may include three different states of low-frequency acquisition of positioning information: a uniform forward state, a stationary state, and a slightly variable speed state. Different conditions correspond to different low-frequency states, and the sampling rate determined by the electronic device may also be different.
[0175] 1. Conditions for uniform forward movement: the displacement change rate R is less than the first threshold change rate.
[0176] 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 of less than (less than or equal to) the first threshold change rate, the electronic device can determine that the condition of uniform speed movement is met, and the electronic device can determine the second sampling rate as f2=f1 / K. Where f1 is the first sampling rate, and k is an integer greater than 2. In the case of greater than or equal to (greater than) the first threshold change rate, the electronic device can continue to make judgments according to other conditions.
[0177] When the above-mentioned uniform moving condition is met, the electronic device can determine the positioning prediction information according to the k interpolation strategy.
[0178] Optionally, the condition of the uniform forward state also includes the condition that the displacements S1 and S2 are greater than or equal to the first distance. That is, if 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 forward state is met. Otherwise, it is not met.
[0179] 2. Conditions for approaching a stationary state: 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.
[0180] The electronic device can determine whether the displacement change rate R is less than (less than or equal to) the second threshold change rate. When it is less than (less than or equal to) the second threshold change rate, the electronic device can determine that the condition of tending to stillness is met, and the electronic device can determine the second sampling rate as f2=f1 / K, and turn on the acceleration state monitoring mode. Where f1 is the first sampling rate, and k is an integer greater than 2. When it is greater than or equal to (greater than) the second threshold change rate, the electronic device can continue to make judgments according to other conditions.
[0181] In the acceleration state monitoring mode, the electronic device starts to obtain acceleration data from the accelerometer sensor and determines whether the acquired acceleration data is greater than (greater than or equal to) the threshold acceleration. If the acceleration data is greater than (greater than or equal to) the threshold acceleration, it is determined to be in a stationary state and the second sampling rate is maintained; if the acceleration data is less than or equal to (less than) the threshold acceleration, it is determined to be in a moving state and the second sampling rate is switched to the first sampling rate. Optionally, the judgment results of the stationary state and the moving state can also be that the electronic device calls the sensorhub's ready-made AR algorithm or the state of the terminal device such as stationary or moving, which is not limited in this application.
[0182] The first threshold change rate is greater than or equal to the second threshold change rate.
[0183] 3. Conditions for the small speed change 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.
[0184] The electronic device can determine whether the displacement change rate R is less than (less than or equal to) the second threshold change rate. When it is greater than or equal to (greater than) the first threshold change rate, the electronic device can determine that the condition of tending to stillness is met, and the electronic device can determine the second sampling rate as f2=f1 / 2. Among them, f1 is the first sampling rate, that is, k is 2. At this time, the positioning prediction information can be obtained according to the binary interpolation strategy. When it is greater than or equal to (greater than) the second threshold change rate, the electronic device has determined that the positioning prediction condition is not met, and the first sampling rate can be kept unchanged.
[0185] Figure 7 FIG. 1 is a flow chart of a method for determining a sampling frequency proposed in an exemplary embodiment of the present application. Figure 7 The method shown may be steps performed by S502 and S503:
[0186] The steps of S502 may include S701 to S706:
[0187] S701: The electronic device determines whether the first sampling rate is greater than or equal to (greater than) a first threshold sampling rate. If the first sampling rate is greater than or equal to (greater than) the first threshold sampling rate, execute S702; otherwise, execute S705.
[0188] Among them, S701 may specifically refer to the collection frequency condition in the above S502, which will not be described in detail.
[0189] S702: The electronic device determines whether the number of first satellites is greater than or equal to (greater than) a threshold number of satellites, and / or the first signal strength is greater than or equal to (greater than) a threshold signal strength. If the number of first satellites is greater than or equal to (greater than) a threshold number of satellites, and / or the first signal strength is greater than or equal to (greater than) a threshold signal strength, S703 is executed; otherwise, S705 is executed.
[0190] Specifically, S702 may refer to the satellite signal quality condition in S502 above, which will not be described in detail.
[0191] S703: The electronic device determines whether the moving change angle is less than (less than or equal to) the threshold angle. If the moving change angle is less than (less than or equal to) the threshold angle, execute S704; otherwise, execute S705.
[0192] Specifically, S703 may refer to the situation 1 of the positioning change condition in S502 above, and will not be described in detail.
[0193] 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, execute S705; otherwise, execute S706.
[0194] Specifically, S704 may refer to the situation 2 of the positioning change condition in S502 above, and will not be described in detail.
[0195] S705: The electronic device determines that the positioning prediction condition is not met.
[0196] S706: The electronic device determines that the positioning prediction condition is met.
[0197] The above-mentioned determination of whether to switch the sampling rate based on various conditions can ensure the accuracy of the switching timing, ensure that the positioning information acquired by the electronic device is accurate and effective, and ensure the accuracy of the location provided to the user.
[0198] The steps of S503 may include S707 to S711:
[0199] S707: The electronic device determines whether the displacement change rate is less than or equal to (smaller than) the first threshold change rate. If the displacement change rate is less than or equal to (smaller than) the first threshold change rate, execute S709; otherwise, execute S708.
[0200] Among them, S707 may refer to the relevant content in the above S503 for details, which will not be repeated here.
[0201] S708: The electronic device determines that it is in a slightly accelerated state and determines that the second sampling rate is f1 / 2.
[0202] Specifically, S708 may refer to the relevant contents of the conditions of the slight acceleration state in the above S503, which will not be described in detail.
[0203] S709: The electronic device determines whether the first displacement and the second displacement are less than or equal to (smaller than) the first distance. If the first displacement and the second displacement are less than or equal to (smaller than) the first distance, execute S711; otherwise, execute S710.
[0204] The first displacement may refer to S1, the second displacement may refer to S2, and S709 may refer to the relevant content in the above S503 for details, which will not be described in detail.
[0205] S710: The electronic device determines that it is in a uniform forward motion state, and determines a second sampling rate as f1 / K, where k is an integer greater than 2.
[0206] Among them, S710 may specifically refer to the relevant contents of the conditions of the uniform forward state in the above S503, which will not be elaborated herein.
[0207] S711: The electronic device determines that it is in a stationary state, determines that the second sampling rate is f1 / K, and turns on the acceleration state monitoring mode.
[0208] Specifically, S711 may refer to the relevant contents of the condition of tending to a stationary state in the above S503, which will not be described in detail.
[0209] It should be further explained that the above Figure 7 This is merely an illustrative description of a possible execution process of S502 and S503, and the present application does not limit this.
[0210] After the execution process of S707 to S711, the electronic device can quickly and effectively set the second sampling rate. The size of the second sampling rate can be flexibly changed with the travel state of the electronic device, ensuring that when the change is small, as much prediction as possible is made to reduce the number of collections, and when the change is large, more positioning information is collected to ensure the accuracy of the positioning information, and the device power and positioning accuracy can be balanced according to the specific situation of the device.
[0211] S504: The electronic device switches the positioning collection frequency from the first sampling rate to the second sampling rate.
[0212] The electronic device can switch the first sampling rate to the second sampling rate. When the acquisition frequency is switched from the first sampling rate to the second sampling rate, the electronic device maintains the first sampling rate to obtain positioning information, and the electronic device needs to predict the positioning information. That is, the electronic device can execute S505 to S507, obtain the positioning acquisition information according to the low-frequency sampling frequency, and add the inferred positioning prediction information to ensure that the frequency of reporting the positioning information remains unchanged.
[0213] When the prediction positioning module of the electronic device determines to switch the sampling frequency to the second sampling rate, it can send a sampling switching instruction to the GPS driver, and 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 obtain the positioning information according to the second sampling rate. The method of obtaining the positioning information can refer to Figure 2 The relevant description in is not repeated here.
[0214] S505: The electronic device performs positioning collection based on the second sampling rate to obtain positioning collection information, and acquires positioning prediction information based on the historical positioning collection information.
[0215] After the electronic device can determine the second sampling rate, it can first obtain the positioning collection information according to the second sampling rate. Figure 3 The relevant description is not repeated here.
[0216] The acquisition of positioning prediction information based on historical positioning collection information is performed according to the timing of the second sampling rate and the first sampling rate. The timing and number of times the positioning prediction information is acquired each time 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 acquires positioning prediction information once each time the positioning collection information is acquired. If the second sampling rate is 1 / 3 of the first sampling rate, the electronic device acquires positioning prediction information twice in succession each time the positioning collection information is acquired. After the switch, the frequency of the positioning information formed by the positioning prediction information and the positioning collection information is the first sampling rate.
[0217] Secondly, the process of the electronic device obtaining the positioning prediction information based on the positioning collection information is specifically described:
[0218] The parameters of the positioning information that need to be predicted may include longitude X, latitude Y, timestamp T, and altitude H.
[0219] The time multiple relationship between the second sampling rate of the electronic device and the first sampling rate is different, and the corresponding position relationship is also different. This application uses a two-interpolation strategy and a k-interpolation strategy to respectively illustrate the method of obtaining positioning prediction information:
[0220] In the embodiment of the present application, the electronic device can obtain the positioning acquisition information according to different k interpolation size strategies and at different times, and the method of obtaining the positioning prediction information should be different.
[0221] If the second sampling rate corresponds to a binary interpolation (k=1) strategy, the electronic device calculates the positioning prediction information according to the binary interpolation strategy.
[0222] Strategy 1: k = 1. At this time, the second sampling rate is half of the first sampling rate, that is, f2 = f1 / 2. The positioning prediction information can be determined as:
[0223] In the embodiment of the present application, k may represent the amount of positioning prediction information inserted into the current positioning collection information, K=k+1.
[0224] Fig. 8A and Figure 8B Schematic diagram of a method for obtaining positioning prediction information disclosed in an exemplary embodiment of the present application. Fig. 8AAs shown, the electronic device reports the positioning information according to the first sampling rate, and the electronic device obtains the positioning collection information according to the first sampling rate, that is, the positioning information D1, D2 and D3 are obtained at T1, T2 and T3 respectively. Among them, the longitude and latitude in D1 are (X1, Y1), and the altitude is H1 (not shown); the longitude and latitude in D2 are (X2, Y2), and the altitude is H2 (not shown); the longitude and latitude in D3 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 second collection frequency (the collection cycle is twice the previous one) (for details, please refer to S502 and S503), and the electronic device can determine that it needs 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 the T4 moment in the first sampling rate. At T5, the positioning collection information D4 is obtained according to the second sampling rate, and the longitude and latitude in D4 are (X4, Y4), and the altitude is H4 (not shown). The electronic device determines that it needs to obtain the positioning information d2 of the second prediction point, and the time of the positioning information corresponds to the time T6 in the first sampling rate. At time T7, the positioning acquisition information D5 is obtained according to the second sampling rate, and the longitude and latitude in D5 are (X5, Y5) and the altitude is H5 (not shown).
[0225] 1. Determine the positioning prediction information based on three consecutive real historical positioning collection information.
[0226] The electronic device can obtain positioning prediction information based on the three most recently acquired positioning collection information.
[0227] Position prediction information d1 of the first prediction point: The position prediction information d1 of the first prediction point is determined based on D1, D2 and D3. d1 includes longitude and latitude (x1, y1) and altitude h1, that is, x1, y1 and h1 are determined:
[0228] Among them, Δ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 respectively the three most recent historical positioning collection information obtained from far to near in time.
[0229] The electronic device can then determine x1, y1, and h1 in d1 based on D1, D2, and D3:
[0230]
[0231]
[0232]
[0233] Position prediction information d2 of the second prediction point: The position 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:
[0234] Among them, X3 = X4-X3; ΔX2 = X3-X2; ΔY3 = Y4-Y3, ΔY2 = Y3-Y2; ΔH3 = H4-H3, ΔH2 = Y3-Y2. The electronic device can then determine x2, y2, and h2 in d2 based on D2, D3, and D4:
[0235]
[0236]
[0237]
[0238] like Figure 8B As shown, the positioning acquisition information is obtained according to the second sampling rate. At time Tf, the positioning information Dn is obtained. At time Tf-2, the positioning information Dn-1 is obtained; at time Tf-4, the positioning information Dn-2 is obtained. 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 obtain positioning prediction information based on historical positioning acquisition information.
[0239] 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.
[0240] The electronic device can first determine the displacement in the direction of longitude, latitude and altitude based on the positioning collection information Dn-2, Dn-1 and Dn:
[0241] ΔXn-2=Xn-1-Xn-2
[0242] ΔYn-2=Yn-1-Yn-2
[0243] ΔHn-2=Hn-1-Hn-2
[0244] ΔXn-1=Xn-Xn-1
[0245] ΔYn-1=Yn-Yn-1
[0246] ΔHn-1=Hn-Hn-1
[0247] The electronic device can then determine xm, ym, and hm in dm based on ΔXn-1, ΔXn-2, ΔYn-1, ΔYn-2, ΔHn-1, and ΔHn-2:
[0248]
[0249]
[0250]
[0251] If the second sampling rate corresponds to a multi-interpolation (k>2) strategy, the electronic device calculates the positioning prediction information according to the multi-interpolation strategy.
[0252] In the embodiment of the present application, in order to distinguish the representation, the longitude, latitude, and altitude of the positioning prediction information are represented by lowercase letters; the longitude, latitude, and altitude of the positioning collection information are represented by uppercase letters.
[0253] The electronic device can calculate the longitude of the next positioning prediction information as x next =X last +Δx; latitude is y next =Y last +Δx; altitude is h next =H last +Δh. Among them, X last , Y last and H last The longitude, latitude and altitude of the previous positioning information may be respectively known information. ΔX, ΔY and ΔH may be respectively the displacements in longitude, latitude and altitude from the historical positioning collection information to the next positioning prediction information.
[0254] Therefore, when calculating the next positioning prediction information x next ,y next and h next Before, ΔX, ΔY and ΔH can be calculated accordingly.
[0255] The longitude, latitude, and altitude in the first positioning collection information are X1, Y1, and H1, respectively; the longitude, latitude, and altitude in the second positioning collection information are X2, Y2, and H2, respectively; the longitude, latitude, and altitude in the third positioning collection information are X3, Y3, and H3, respectively. Among them, 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 continuously collected by the electronic device, the three most recently acquired GPS positioning collection information D1 (X1, Y1), D2 (X2, Y2), and D3 (X3, Y3); in order from far to near from the current time. Among them, the number of interpolated positioning prediction information between the first positioning collection information and the second positioning collection information is k1, and the number of interpolated positioning prediction information between the second positioning collection information and the third positioning collection information is k2.
[0256] The electronic device can calculate two displacement vectors The two altitude changes are ΔH1=H2-H1; ΔH2=H3-H2. Assume that k1 virtual points are inserted between D1 and D2, and k2 virtual points are inserted between D2 and D3. Where k1 and k2 are both positive integers.
[0257] Then the displacement change of the next virtual point is:
[0258]
[0259]
[0260]
[0261] The latitude and longitude coordinates of the next virtual point are the coordinates of the last reported point plus the displacement change:
[0262] d next (x next ,y next ,h next )=(X last +Δx,Y last +Δy,H last +Δh)
[0263] X last , Y last and H last The latitude, longitude and altitude in the most recently acquired positioning information. For example, if the most recently acquired positioning information includes X3, Y3 and H3, X last =X3;Y last =Y3;H last =H3; if the most recently acquired positioning information is positioning prediction information, including x1, y1 and h1; Xlast =x3;Y last =y3;H last =h3.
[0264] 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 1, and this application is not limited.
[0265] Strategy 2: k = 2. At this time, the third sampling rate is one third of the first sampling rate, that is, f3 = f1 / 3. The positioning prediction information can be calculated as:
[0266] FIG. 9A to FIG. 9D It is a schematic diagram of another group of positioning prediction information acquisition methods exemplarily disclosed in an embodiment of the present application.
[0267] like Fig. 9A As shown, the electronic device reports the positioning information according to the first sampling rate, and the electronic devices all obtain the positioning collection information according to the first sampling rate, that is, the positioning information D1, D2 and D3 are obtained at T1, T2 and T3 respectively. Among them, the longitude and latitude in D1 are (X1, Y1), and the altitude is H1 (not shown); the longitude and latitude in D2 are (X2, Y2), and the altitude is H2 (not shown); the longitude and latitude in D3 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, please refer to S502 and S503), and the electronic device determines that it needs 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 the T4 moment in the first sampling rate; it is also necessary to obtain the positioning information d2 of the second prediction point, and the time of the positioning information corresponds to the T5 moment in the first sampling rate. At time T6, the positioning acquisition information D4 is acquired according to the second sampling rate, the longitude and latitude in D4 are (X4, Y4), and the altitude is H4 (not shown). Afterwards, the electronic device needs to acquire the positioning prediction information d3 and d4 of the third and fourth prediction points. At time T9, the positioning acquisition information D5 is acquired according to the second sampling rate, the longitude and latitude in D5 are (X5, Y5), and the altitude is H5 (not shown).
[0268] The lth prediction point: positioning prediction information d1 (x(d1), y(d1), h(d1)): At this time, k1=0 and k2=0.
[0269] The electronic device can calculate two displacement vectors The two altitude changes are ΔH1=H2-H1; ΔH2=H3-H2.
[0270]
[0271]
[0272]
[0273]
[0274] Among them, x(d2)=X(D3)+Δx; y(d2)=Y(D3)+Δy; h(d2)=H(D3)+Δh.
[0275] The second prediction point: positioning prediction information d2 (x(d2), y(d2), h(d2)): At this time, k1=0 and k2=0.
[0276] Different from the positioning point d1, x(d2)=X(d1)+Δx; y(d2)=Y(d1)+Δy; h(d2)=H(d1)+Δh.
[0277] The third prediction point: positioning prediction information d3 (x(d3), y(d3), h(d3)): At this time, k1=0 and k2=2.
[0278] The electronic device can calculate two displacement vectors The two altitude changes are ΔH2=H3-H2; ΔH3=H4-H3.
[0280]
[0281] Among them, x(d3)=X(D4)+Δx; y(d3)=Y(D4)+Δy; h(d3)=H(D4)+Δh.
[0282] The 4th prediction point: positioning prediction information d4 (x(d4), y(d4), h(d4)): At this time, k1=0 and k2=2.
[0283] Different from the predicted point d3, x(d4)=X(d3)+Δx; y(d4)=Y(d3)+Δy; h(d4)=H(d3)+Δh.
[0284] The 5th prediction point: In the positioning prediction information d4 (x(d4), y(d4), h(d4)), k1=2 and k2=2, which are not shown in the figure. The calculation method is the same as above and will not be repeated.
[0285] like Fig. 9B As shown, at time 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 time Tq, the positioning prediction information is obtained according to the three interpolation, and the sampling frequency is f / 3; after time Tq, the positioning prediction information is obtained according to the two interpolation, and the sampling frequency is f / 2.
[0286] The ath prediction point: in the positioning prediction information da(x(da), y(da), h(da)), k1=2 and k2=2.
[0287] The electronic device can calculate two displacement vectors The difference between the two altitudes is ΔH b-2 =Hb-3-Hb-2; ΔH b-1 =Hb-2-Hb-1.
[0288]
[0289] Among them, x(da)=X(Db-1)+Δx; y(da)=Y(Db-1)+Δy; h(da)=H(Db-1)+Δh.
[0290] The a+1th prediction point: in the positioning prediction information da+1 (x(da+1), y(da+1), h(da+1)), k1=2 and k2=1.
[0291] The electronics can calculate two displacement vectors:
[0292]
[0293]
[0294] The difference between the two altitudes is ΔH b-2 =Hb-1-Hb-2; ΔH b-1 =Hb-Hb-1.
[0295]
[0296] Among them, x(da+1)=X(Db)+Δx; y(da)=Y(Db)+Δy; h(da)=H(Db)+Δh.
[0297] like Fig. 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 triple interpolation. Therefore, before time Tr, the positioning prediction information is obtained according to binary interpolation, and the sampling frequency is f / 2; after time Tr, the positioning prediction information is obtained according to triple interpolation, and the sampling frequency is f / 3.
[0298] The lth prediction point: in the positioning prediction information dl(x(dl), y(dl), h(dl)), k1=1 and k2=1.
[0299] The electronics can calculate two displacement vectors:
[0300]
[0301]
[0302] The difference between the two altitudes is ΔH p-4 =Hp-3-Hp-4; ΔH p-3 =Hp-2-Hp-3.
[0303]
[0304] Among them, x(dl)=X(Dp-2)+Δx; y(dl)=Y(Dp-2)+Δy; h(dl)=H(Dp-2)+Δh.
[0305] The l+1th prediction point: in the positioning prediction information dl+1(x(dl+1), y(dl+1), h(dl+1)), k1=1 and k2=1.
[0306] Different from the lth prediction point, x(dl+1)=X(dl)+Δx; y(dl)=Y(dl)+Δy; h(dl)=H(dl)+Δh.
[0307] The l+2th prediction point: in the positioning prediction information dl+2 (x(dl+2), y(dl+2), h(dl+2)), k1=1 and k2=2.
[0308] The electronics can calculate two displacement vectors:
[0309]
[0310]
[0311] The difference between the two altitudes is ΔH p-3 =Hp-2-Hp-3; ΔH p-2 =Hp-1-Hp-2.
[0312]
[0313] Among them, x(dl+2)=X(Dp-1)+Δx; y(dl+2)=Y(Dp-1)+Δy; h(dl+2)=H(Dp-1)+Δh.
[0314] The l+3th prediction point: in the positioning prediction information dl+3 (x(dl+3), y(dl+3), h(dl+3)), k1=1 and k2=2.
[0315] Different from the l+2th prediction point, x(dl+3)=X(dl+2)+Δx; y(dl+3)=Y(dl+2)+Δy; h(dl+3)=H(dl+2)+Δh.
[0316] like Fig.9D As shown, at time t4, the electronic device switches from the third sampling rate to the first sampling rate. Therefore, before time To, the positioning prediction information is obtained according to the three interpolation, and the sampling frequency is f / 3; after time To, the sampling frequency is f. Assume that 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 refer to the above process and will not be repeated here.
[0317] Fig.9D After the t4 moment in the Figure 8B As described in the description after the moment t2, the electronic device can go through the process of S507 to determine the exit from the control state, and then execute the processes of S508 and S501 and S502, which will not be repeated.
[0318] Due to the different conditions of the electronic device, the size of the set sampling rate is also different. This application only takes k=2 or k=1 as an example for explanation, 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, which is not limited in this application.
[0319] It should be noted that the determination methods of the third sampling rate and the second sampling rate can refer to the relevant description of S504, and the third sampling rate can be understood as another second sampling rate, which is not elaborated in this application.
[0320] In addition to determining the latitude, longitude and altitude in the positioning collection information, the electronic device can also determine the positioning time.
[0321] Specifically, the positioning time of the positioning prediction information can be the most recent T = T last +ΔT. Where, T last is the positioning time in the most recently acquired positioning collection information. ΔT=1 / f, where f is the first sampling rate and 1 / f is the time period for collecting positioning information.
[0322] For example, Fig. 9A As shown, the positioning time of the first prediction point is T(d1)=T(d3)+1 / f; the positioning time of the second prediction point is T(d2)=T(d2)+1 / f.
[0323] S506: The electronic device reports positioning prediction information based on the first sampling rate.
[0324] After the electronic device acquires the positioning prediction information, it may report the positioning prediction information according to the first sampling rate.
[0325] It should be noted that if the electronic device actually obtains the positioning information from the bottom layer (GPS driven), there will be a certain time difference. That is, it can be understood that when the bottom layer obtains the positioning information from the satellite positioning system, it takes time for the information to be transmitted from high altitude to the ground, and the parsing process of the positioning information according to the protocol also takes time. Therefore, the acquisition time of the positioning information is greater than the acquisition time of the positioning prediction information. Therefore, in order to make 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 (positioning information collection period) to ensure the accuracy of the time. For details, please refer to Fig.12 The relevant description is not repeated here.
[0326] S507: The electronic device determines whether the positioning prediction condition is met. If the positioning prediction condition is met, S505 is executed; otherwise, S508 is executed.
[0327] Each time an electronic device obtains positioning information, it needs to determine whether it meets the positioning prediction conditions. The positioning prediction conditions can determine whether the electronic device maintains low-frequency sampling. If the positioning prediction conditions are met, it continues to maintain the control state, otherwise it switches to the preparation state.
[0328] The positioning prediction conditions may include satellite signal quality conditions and positioning change conditions. The satellite signal quality conditions and positioning change conditions may refer to the relevant descriptions in S502 and will not be repeated here.
[0329] In the above judgment process, if the added displacement exceeds the threshold or the displacement direction changes significantly (such as turning, deceleration, etc.), or the GPS signal is poor, the number of searched satellites is small, etc., it will immediately switch to GPS positioning, exit control, and switch back to the actual GPS positioning to avoid the impact of positioning drift.
[0330] S508: The electronic device switches the positioning collection frequency from the second sampling rate to the first sampling rate.
[0331] The electronic device may switch the positioning acquisition frequency from the second acquisition rate to the first sampling rate. The description of S508 may refer to the related description of S504, which will not be repeated here.
[0332] After executing S508 , the electronic device may continue to execute S501 .
[0333] S509: The electronic device re-determines the second sampling rate.
[0334] Optionally, the electronic device may further perform the process of S509 before S505.
[0335] In S509, if the second sampling rate re-determined by the electronic device is different from the previous sampling rate, that is, when the 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 continue to execute S505.
[0336] Combination Figure 7 Explanation, the execution process of S507 and S509, Fig.10 1 is a flow chart of a method for determining a sampling frequency disclosed in an embodiment of the present application. Fig.10 The method shown may be steps performed by S507 and S509:
[0337] The steps of S507 may include S1001 to S1005:
[0338] S1001: The electronic device determines whether the number of first satellites is greater than or equal to (greater than) a threshold number of satellites, and / or the first signal strength is greater than or equal to (greater than) a threshold signal strength. If the number of first satellites is greater than or equal to (greater than) a threshold number of satellites, and / or the first signal strength is greater than or equal to (greater than) a threshold signal strength, S1002 is executed; otherwise, S1003 is executed.
[0339] S1002: The electronic device determines whether the moving change angle is less than (less than or equal to) a threshold angle. If the moving change angle is less than (less than or equal to) the threshold angle, execute S1004; otherwise, execute S1003.
[0340] S1003: The electronic device determines that the positioning prediction condition is not met.
[0341] S1004: 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, execute S1003; otherwise, execute S1005.
[0342] S1005: The electronic device determines that the positioning prediction condition is met.
[0343] The steps of S509 may include S1006 to S1010:
[0344] S1006: The electronic device determines whether the displacement change rate is less than or equal to (smaller than) the first threshold change rate. If the displacement change rate is less than or equal to (smaller than) the first threshold change rate, execute S1008; otherwise, execute S1007.
[0345] S1007: The electronic device determines that it is in a slightly accelerated state and determines that the second sampling rate is f1 / 2.
[0346] S1008: The electronic device determines whether the first displacement and the second displacement are less than or equal to (smaller than) the first distance. If the first displacement and the second displacement are less than or equal to (smaller than) the first distance, execute S1010; otherwise, execute S1009.
[0347] S1009: The electronic device determines that it is in a uniform forward motion state, and determines a second sampling rate as f1 / K, where K is an integer greater than 2.
[0348] S1010: The electronic device determines that it is in a stationary state, determines that the second sampling rate is f1 / K, and turns on the acceleration state monitoring mode.
[0349] It should be further explained that the above Fig.10 For a description, refer to Figure 7 The relevant description is not repeated here.
[0350] go through Fig.10 The processing process of the electronic device can quickly and effectively use the second sampling rate. The size of the second sampling rate can be flexibly changed with the travel state of the electronic device, ensuring that when the change is small, as much prediction as possible is made to reduce the number of collections. When the change is large, more positioning information is collected to ensure the accuracy of the positioning information, and the problem of balancing the device power and positioning accuracy can be balanced according to the specific situation of the device.
[0351] In the above implementation, the frequency of collecting positioning information can realize the switching of high frequency to low frequency, which can reduce the power consumption of positioning collection. On the other hand, due to the judgment of the switching condition, the reliability of the positioning information inferred during low frequency collection can be guaranteed.
[0352] It should be pointed out that in the judgment process of the embodiment of the present application, the sampling rate is used for judgment and processing. According to the same logic, it can also be processed according to the cycle duration corresponding to the positioning acquisition frequency. The present application does not limit this change.
[0353] In the above process, Figure 5 The electronic device can realize the switching of positioning information collection. When in a high-frequency state, the electronic device can determine whether to switch to a low frequency. When the positioning prediction conditions are met, the collection frequency can be switched to a low frequency, thereby reducing the positioning power consumption while ensuring the accuracy of the positioning information.
[0354] Combination Figure 4A , Figure 4B and Figure 5 Flowchart of the method FIG. 11A to FIG. 11D content. FIG. 11A to FIG. 11D1 is a flow chart of an interactive method for obtaining positioning information disclosed in an embodiment of the present application. FIG. 11A to FIG. 11D As shown, the interactive method for obtaining positioning information may include but is not limited to the following steps:
[0355] FIG. 11A to FIG. 11D The first application, location management module, positioning module, GPS driver and other modules involved can be referred to Figure 3 , Figure 4A and Figure 4B The positioning module may further include a positioning frequency switching module. At this time, the positioning module may be used to determine whether to switch the positioning acquisition frequency, and the process of obtaining positioning prediction information at a low frequency acquisition frequency. The specific process is described below:
[0356] Fig.11A The steps S1101 to S1120 may be included, specifically including a process in which the electronic device starts to collect positioning information according to a high-frequency sampling frequency and reports the collected positioning information to the application.
[0357] S1101: The first application obtains a first operation. In response to the first operation, the positioning state is turned on and it is determined to start obtaining positioning information.
[0358] The first application may be an application program that requests continuous acquisition of positioning information, such as XX map, XX navigation, etc., which is not limited in the present application.
[0359] In response to a first start operation by the user, the first application turns on the positioning state and determines to continuously obtain positioning information based on the first sampling rate.
[0360] S1102: The first application sends a location start acquisition request to the location management module.
[0361] In response to the first operation, the first application may send a location start acquisition request to the location management module. Correspondingly, the location management module may receive the location start acquisition request from the first application. The location start acquisition request is used to request continuous acquisition of positioning information.
[0362] S1103: The location management module sends a first positioning request to the positioning module.
[0363] After the location management module obtains the location start acquisition request of the first application, it can send the first positioning request to the positioning module. Correspondingly, the positioning module can receive the first positioning request from the location management module.
[0364] The first positioning request may instruct the positioning module to start collecting positioning information. The first positioning request may include a first sampling rate, a parameter format of the positioning information, etc. The first sampling rate may indicate the frequency at which the positioning module obtains positioning information; the parameter format of the positioning information indicates the format information of the positioning module reporting the positioning information to the location management module.
[0365] S1104: The positioning module sends a first positioning start and end instruction to the GPS driver.
[0366] After receiving the first positioning request from the location management module, the positioning module may send a first positioning start and end instruction to the GPS driver. Correspondingly, the GPS driver may receive the first positioning start and end instruction from the positioning module.
[0367] The first positioning start and stop instruction may be used to instruct the GPS driver to start acquiring positioning information according to the first sampling rate. The first positioning start and stop instruction may include the first sampling rate.
[0368] S1105: The GPS driver starts collecting positioning information according to the first sampling rate.
[0369] After the GPS driver receives the first positioning start and stop instruction, it can drive to start collecting positioning information according to the first sampling rate. The frequency of GPS driver collecting positioning information is the first sampling rate, which can be understood as obtaining positioning information according to a certain sampling period, and the sampling period is the inverse of the sampling frequency. The specific process of GPS driver collecting positioning information can be referred to Figure 3 The relevant description in is not repeated here.
[0370] S1106: The GPS driver sends the first positioning collection information to the positioning module.
[0371] After the GPS driver collects the first positioning information, it can send the first positioning information to the positioning module. Correspondingly, the positioning module can receive the first positioning information from the GPS driver.
[0372] S1107: The positioning module performs filling processing on the first positioning collection information to obtain first positioning information.
[0373] After receiving the first positioning acquisition information, the positioning module can fill the first positioning acquisition information to obtain the first positioning information. Specifically, the positioning module can fill the first positioning acquisition information according to the parameter format of the positioning information to ensure that the filled first positioning information meets the specified format.
[0374] S1108: The positioning module sends first positioning information to the location management module.
[0375] After executing S1107, the positioning module may send the first positioning information to the position management module. Correspondingly, the position management module may receive the first positioning information from the positioning module.
[0376] S1109: The location management module sends first positioning information to the first application.
[0377] After receiving the first positioning information, the location management module may send the first positioning information to the first application. Correspondingly, the first application may receive the first positioning information from the location management module.
[0378] S1110: The first application performs application processing based on the first positioning information.
[0379] After receiving the first positioning information, the first application can perform application processing based on the first positioning information. The processing process is related to the business of the first application, such as user planning, displaying user location, etc., which is not limited in this application.
[0380] S1111: The GPS driver sends the second positioning collection information to the positioning module.
[0381] The GPS driver can continue to obtain and report positioning information according to the first sampling rate
[0382] S1112: The positioning module performs filling processing on the second positioning collection information to obtain second positioning information.
[0383] S1113: The positioning module sends second positioning information to the location management module.
[0384] S1114: The location management module sends second positioning information to the first application.
[0385] S1115: The first application performs application processing based on the second positioning information.
[0386] The processing process of S1111 to S1115 can refer to the relevant description of S1106 to S1110 and will not be repeated here.
[0387] S1116: The GPS driver sends the third positioning collection information to the positioning module.
[0388] The GPS driver can continue to obtain and report the positioning collection information according to the first sampling rate.
[0389] S1117: The positioning module performs filling processing on the third positioning collection information to obtain third positioning information.
[0390] S1118: The positioning module sends the third positioning information to the location management module.
[0391] S1119: The location management module sends third positioning information to the first application.
[0392] S1120: The first application performs application processing based on the third positioning information.
[0393] The processing process of S1116 to S1120 may refer to the relevant description of S1106 to S1110 and will not be repeated here.
[0394] Fig. 11B It may include S1121 to S1135, specifically including a process in which the electronic device determines that a positioning prediction condition is met in a preparation state, switches the positioning sampling frequency from high frequency sampling to low frequency sampling when the positioning prediction condition is met, and obtains positioning information after the switching.
[0395] S1121: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction conditions are met.
[0396] The process of determining whether the positioning prediction condition is met may refer to the processing process of S502 and will not be described in detail here.
[0397] The positioning module can determine whether the positioning prediction condition is met when at least three positioning acquisition information are continuously acquired. Thereafter, each time the first positioning acquisition information is received, a process of determining whether the positioning prediction condition is met is executed.
[0398] For example, Fig. 8A As shown, when the electronic device determines that three positioning collection information D1, D2 and D3 (which may correspond to the first positioning collection information, the second positioning collection information and the third positioning collection information) are obtained, it can start to judge whether the positioning prediction condition is met. If only two positioning collection information D1 and D2 are obtained, and no positioning collection information has been obtained before D1, the positioning module may not make a judgment. D2, D3 and D4 are judged in the same way.
[0399] S1122: The positioning module determines a second sampling rate.
[0400] After the positioning module determines that the positioning prediction condition is met, the second sampling rate may be determined. For details, please refer to the relevant description of S503, which will not be repeated here. For example, the second sampling rate may be f2=f1 / 2, where f1 is the first sampling rate.
[0401] S1123: The positioning module sends a first sampling frequency switching instruction to the GPS driver.
[0402] 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.
[0403] S1124: The GPS driver collects positioning information according to the second sampling rate.
[0404] The GPS driver performs the switching process, that is, the positioning information can be collected according to the second sampling rate.
[0405] S1125: The positioning module calculates first positioning prediction information.
[0406] When 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.
[0407] S1126: The positioning module fills the first positioning prediction information to obtain fourth positioning information.
[0408] Among them, S1126 can refer to the relevant descriptions of S1107, S1112 and S1117, which will not be repeated here.
[0409] S1127: The positioning module sends fourth positioning information to the location management module based on the reporting time.
[0410] The positioning module can send the fourth positioning information to the location management module according to the reporting time based on the predicted reporting time of 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.
[0411] Fig.12 Schematic diagram of a method for predicting reporting time disclosed in an exemplary embodiment of the present application. Fig.12 As shown, the positioning information is reported at time Tm-2 and time Tm-1. Since the second sampling rate is switched to between time Tm-2 and time Tm-1, after obtaining the positioning prediction information, the positioning module can first determine the reporting time of the next reporting of the positioning information, so that the reporting time point can be aligned with the reporting time of the actual collected information. The electronic device can report according to the period of the first sampling rate, or determine the reporting time Tm based on the previous reporting time Tm-1. For example, if f1 is known, the reporting time interval is 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.
[0412] Generally speaking, the positioning module determines whether it is able to predict the positioning point and the time consumption for calculating the predicted positioning point is small, which can be less than 1ms; assuming that the time between Tm+1 and Tn is less than 1ms, if the positioning information is immediately reported to the location management module after it is obtained, the time when the application obtains the positioning information will be confused. If the first application processes the data according to the time when the positioning information is obtained, it will lead to poor service data processing effect. In the above process, aligning the reporting time can ensure the correctness and reliability of service data processing.
[0413] S1128: The location management module sends fourth positioning information to the first application.
[0414] S1129: The first application performs application processing based on the fourth positioning information.
[0415] Among them, the description of S1128 and S1129 can refer to the relevant description of S1109 and S1110, and will not be repeated here.
[0416] S1130: The GPS driver sends fourth positioning collection information to the positioning module.
[0417] S1131: The positioning module performs filling processing on the fourth positioning collection information to obtain fifth positioning information.
[0418] S1132: The positioning module sends fifth positioning information to the location management module.
[0419] S1133: The location management module sends fifth positioning information to the first application.
[0420] S1134: The first application performs application processing based on the fifth positioning information.
[0421] The processing process of S1130 to S1134 may refer to the relevant description of S1106 to S1110 and will not be repeated here.
[0422] S1135: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction conditions are met.
[0423] Among them, the execution process of S1135 can refer to the relevant content of S1121 and will not be repeated here.
[0424] Fig. 11C It may include S1136 to S1153, specifically including the process of the electronic device determining whether the positioning prediction conditions are met in a control state, switching the positioning sampling frequency from low-frequency sampling to high-frequency sampling if the positioning prediction conditions are not met, and obtaining the positioning information after the switching.
[0425] S1136: The GPS driver sends the q-1th positioning collection information to the positioning module.
[0426] S1137: The positioning module performs filling processing on the q-1th positioning collection information to obtain the s-1th fifth positioning information.
[0427] S1138: The positioning module sends the s-1th positioning information to the location management module.
[0428] S1139: The location management module sends the s-1th positioning information to the first application.
[0429] S1140: The first application performs application processing based on the s-1th positioning information.
[0430] The processing process of S1136 to S1140 can refer to the relevant description of S1106 to S1110 and will not be repeated here.
[0431] S1141: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction conditions are met.
[0432] Among them, the execution process of S1141 can refer to the relevant content of S1121 and will not be repeated here.
[0433] 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.
[0434] S1142: The positioning module sends a second acquisition frequency switching instruction to the GPS driver.
[0435] If it is determined that the positioning prediction condition is not met, the positioning module may send a second acquisition frequency switching instruction to the GPS driver; correspondingly, the GPS driver may receive the second acquisition frequency switching instruction from the positioning module. The second acquisition frequency switching instruction may include the first sampling rate.
[0436] Among them, S1142 can refer to the content of S1123 and will not be repeated here.
[0437] S1143: The GPS driver sends the qth positioning collection information to the positioning module.
[0438] S1144: The positioning module performs filling processing on the qth positioning collection information to obtain the sth positioning information.
[0439] S1145: The positioning module sends the sth positioning information to the location management module.
[0440] S1146: The location management module sends the sth positioning information to the first application.
[0441] S1147: The first application performs application processing based on the sth positioning information.
[0442] The processing process of S1143 to S1147 can refer to the relevant description of S1106 to S1110 and will not be repeated here.
[0443] S1148: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction conditions are met.
[0444] Among them, the execution process of S1148 can refer to the relevant content of S1121 and will not be repeated here.
[0445] S1149: The GPS driver sends the q+1th positioning collection information to the positioning module.
[0446] S1150: The positioning module performs filling processing on the q+1th positioning collection information to obtain the s+1th positioning information.
[0447] S1151: The positioning module sends the (s+1)th positioning information to the location management module.
[0448] S1152: The location management module sends the (s+1)th positioning information to the first application.
[0449] S1153: The first application performs application processing based on the (s+1)th positioning information.
[0450] The processing process of S1149 to S1153 can refer to the relevant description of S1106 to S1110 and will not be repeated here.
[0451] Fig.11D It may include S1154 to S1158, specifically including the process of the electronic device exiting the collection of positioning information.
[0452] S1154: The first application obtains a second operation, and in response to the second operation, turns off the positioning state.
[0453] In response to the user's second operation of exiting the first application, the first application turns off the positioning state and determines to end obtaining the positioning information.
[0454] S1155: The first application sends a location end acquisition request to the location management module.
[0455] In response to the second operation, the first application may send a location acquisition end request to the location management module. Correspondingly, the location management module may receive the location acquisition end request from the first application. The location acquisition end request is used to request to end acquisition of positioning information.
[0456] S1156: The location management module sends a request to end positioning to the positioning module.
[0457] After the location management module obtains the location end acquisition request of the first application, it can send an end positioning request to the positioning module. Correspondingly, the positioning module can receive the end positioning request from the location management module.
[0458] S1157: The positioning module drives the second positioning start and end instructions to the GPS.
[0459] After receiving the second positioning request from the location management module, the positioning module may send a second positioning start and end instruction to the GPS driver. Correspondingly, the GPS driver may receive the second positioning start and end instruction from the positioning module.
[0460] The second positioning start and stop instruction can be used to instruct the GPS driver to stop acquiring positioning information.
[0461] S1158: The GPS driver finishes collecting positioning information.
[0462] After the GPS driver obtains the second positioning start and stop instruction, it stops obtaining positioning information.
[0463] FIG. 13A to FIG. 13D FIG. 1 is a flow chart of another interactive method for obtaining positioning information disclosed in an embodiment of the present application. FIG. 13A to FIG. 13D As shown, the interactive method for obtaining positioning information may include but is not limited to the following steps:
[0464] Fig.13A The steps S1301 to S1320 may be included, specifically including a process in which the electronic device starts to collect positioning information according to a high-frequency sampling frequency and reports the collected positioning information to the application.
[0465] S1301: The first application obtains a first operation. In response to the first operation, the positioning state is turned on and it is determined to start obtaining positioning information.
[0466] S1302: The first application sends a location start acquisition request to the location management module.
[0467] S1303: The location management module sends a first positioning request to the positioning module.
[0468] S1304: The positioning module sends a first positioning start and end instruction to the GPS driver.
[0469] S1305: The GPS driver starts collecting positioning information according to the first sampling rate.
[0470] S1306: The GPS driver sends the first positioning collection information to the positioning module.
[0471] S1307: The positioning module performs filling processing on the first positioning collection information to obtain first positioning information.
[0472] S1308: The positioning module sends first positioning information to the location management module.
[0473] S1309: The location management module sends first positioning information to the first application.
[0474] S1310: The first application performs application processing based on the first positioning information.
[0475] S1311: The GPS driver sends the second positioning collection information to the positioning module.
[0476] S1312: The positioning module fills the second positioning collection information to obtain second positioning information.
[0477] S1313: The positioning module sends second positioning information to the location management module.
[0478] S1314: The location management module sends second positioning information to the first application.
[0479] S1315: The first application performs application processing based on the second positioning information.
[0480] S1316: The GPS driver sends the third positioning collection information to the positioning module.
[0481] S1317: The positioning module fills the third positioning collection information to obtain third positioning information.
[0482] S1318: The positioning module sends the third positioning information to the location management module.
[0483] S1319: The location management module sends third positioning information to the first application.
[0484] S1320: The first application performs application processing based on the third positioning information.
[0485] Among them, the processing process of S1301 to S1320 can refer to the relevant description of S1101 to S1120 and will not be repeated here.
[0486] Fig. 13B The method may include S1321 to S1341, specifically including the electronic device determining that a positioning prediction condition is met in a preparation state, and combining the positioning prediction condition with the electronic device. Fig. 9B The process shown in FIG. 1 determines the third sampling rate to be f2=f1 / 3, switches the positioning sampling frequency from high frequency sampling to low frequency (third sampling rate), and obtains the positioning information after the switching.
[0487] S1321: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction conditions are met.
[0488] At this time, it is determined in S1321 that the positioning prediction conditions are met.
[0489] S1322: The positioning module determines a third sampling rate.
[0490] The positioning module determines that the previous sampling rate is the first sampling rate, and therefore determines that the sampling frequencies of the two are different, and a switching process can be executed.
[0491] S1323: The positioning module sends a third sampling frequency switching instruction to the GPS driver.
[0492] The third sampling frequency switching instruction includes a third sampling rate, ie, a value of f2=f1 / 3.
[0493] S1324: The GPS driver collects positioning information according to the third sampling rate.
[0494] S1325: The positioning module calculates first positioning prediction information.
[0495] S1326: The positioning module performs filling processing on the first positioning prediction information to obtain fourth positioning information.
[0496] S1327: The positioning module sends fourth positioning information to the location management module based on the reporting time.
[0497] Among them, S1327 can refer to Fig.12 The relevant description is not repeated here.
[0498] S1328: The location management module sends fourth positioning information to the first application.
[0499] S1329: The first application performs application processing based on the fourth positioning information.
[0500] Among them, the processing process of S1321~S1329 can refer to the relevant description of S1121~S1129 and will not be repeated here.
[0501] S1330: The positioning module calculates second positioning prediction information.
[0502] S1331: The positioning module fills the second positioning prediction information to obtain fifth positioning information.
[0503] S1332: The positioning module sends fifth positioning information to the location management module based on the reporting time.
[0504] S1333: The location management module sends fifth positioning information to the first application.
[0505] S1334: The first application performs application processing based on the fifth positioning information.
[0506] Among them, the processing process of S1330~S1334 can refer to the relevant description of S1125~S1129 and will not be repeated here.
[0507] S1335: The GPS driver sends the fourth positioning collection information to the positioning module.
[0508] S1336: The positioning module fills the fourth positioning collection information to obtain sixth positioning information.
[0509] S1337: The positioning module sends sixth positioning information to the location management module.
[0510] S1338: The location management module sends sixth positioning information to the first application.
[0511] S1339: The first application performs application processing based on the sixth positioning information.
[0512] S1340: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction conditions are met.
[0513] S1341: The positioning module determines a third sampling rate.
[0514] Among them, the processing process of S1335~S1341 can refer to the relevant description of S1136~S1122 and will not be repeated here.
[0515] Fig. 13C The method may include S1342 to S1361, specifically including the electronic device determining that a positioning prediction condition is met in a preparation state, and combining the positioning prediction condition with the electronic device. Fig. 9C The process shown is to determine the second sampling rate as f2=f1 / 2, switch the positioning sampling frequency from low frequency (third sampling rate) to low frequency (second sampling rate), and obtain positioning information after switching.
[0516] S1342: The GPS driver sends the b-1th positioning collection information to the positioning module.
[0517] S1343: The positioning module performs filling processing on the b-1th positioning collection information to obtain the qth positioning information.
[0518] S1344: The positioning module sends the qth positioning information to the location management module.
[0519] S1345: The location management module sends the qth positioning information to the first application.
[0520] S1346: The first application performs application processing based on the qth positioning information.
[0521] The processing process of S1342 to S1346 can refer to the relevant description of S1106 to S1110 and will not be repeated here.
[0522] S1347: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction conditions are met.
[0523] Among them, the execution process of S1341 can refer to the relevant content of S1121 and will not be repeated here.
[0524] 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.
[0525] S1348: The positioning module determines a second sampling rate.
[0526] At this time, the positioning module determines that the second sampling rate is different from the previous third sampling rate, so it is necessary to switch between different low frequencies, and thus S1349 is executed.
[0527] S1349: The positioning module sends a fourth acquisition frequency switching instruction to the GPS driver.
[0528] The fourth acquisition frequency switching instruction may include the second sampling rate.
[0529] Among them, S1349 can refer to the content of S1123 and will not be repeated here.
[0530] S1350: The positioning module calculates the ath positioning prediction information.
[0531] S1351: The positioning module performs padding processing on the ath positioning prediction information to obtain the q+1th positioning information.
[0532] S1352: The positioning module sends the q+1th positioning information to the location management module based on the reporting time.
[0533] S1353: The location management module sends the q+1th positioning information to the first application.
[0534] S1354: The first application performs application processing based on the (q+1)th positioning information.
[0535] The processing process of S1350 to S1354 can refer to the relevant description of S1125 to S1129 and will not be repeated here.
[0536] S1355: The GPS driver sends the bth positioning collection information to the positioning module.
[0537] S1356: The positioning module performs filling processing on the b-th positioning collection information to obtain the q+2-th positioning information.
[0538] S1357: The positioning module sends the q+2th positioning information to the location management module.
[0539] S1358: The location management module sends the q+2th positioning information to the first application.
[0540] S1359: The first application performs application processing based on the q+2th positioning information.
[0541] Among them, the processing process of S1355~S1359 can refer to the relevant description of S1125~S1129 and will not be repeated here.
[0542] S1360: After acquiring the positioning collection information, the positioning module determines whether the positioning prediction conditions are met.
[0543] Among them, the execution process of S1341 can refer to the relevant content of S1321 and will not be repeated here.
[0544] At this time, it is determined that the positioning prediction conditions are met.
[0545] S1361: The positioning module determines a second sampling rate.
[0546] The second sampling rate is the same as the previous sampling rate and does not switch.
[0547] Among them, the processing process of S1360~S1361 can refer to the relevant description of S1321~S1322, and will not be repeated here.
[0548] Fig.13D It may include S1362 to S1366, specifically including the process of the electronic device exiting the collection of positioning information.
[0549] S1362: The first application obtains a second operation, and in response to the second operation, turns off the positioning state.
[0550] S1363: The first application sends a location end acquisition request to the location management module.
[0551] S1364: The location management module sends a request to end positioning to the positioning module.
[0552] S1365: The positioning module drives the second positioning start and end instructions to the GPS.
[0553] S1366: The GPS driver ends collecting positioning information.
[0554] Among them, the relevant descriptions of S1362~S1366 can refer to the relevant descriptions in S1154~S1158.
[0555] It should be noted that, when the sampling rate is 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.
[0556] In the above embodiments, all or part of the functions can be implemented by software, hardware, or a combination of software and hardware. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. 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 a computer can access or a data storage device such as a server or a data center that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)), etc.
[0557] Those skilled in the art can understand that to implement all or part of the processes in the above-mentioned embodiments, the processes can be completed by computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. When the programs are executed, they can include the processes of the above-mentioned method embodiments. The aforementioned storage media include: ROM or random access memory RAM, magnetic disk or optical disk and other media that can store program codes.
Claims
1. A positioning acquisition method, characterized in that: The method is applied to an electronic device, the electronic device having a first application installed therein, and the method comprises: In response to a first operation performed on the first application, starting to obtain positioning information; When the positioning prediction condition is not met, acquiring positioning collection information based on the first sampling rate; When the positioning prediction condition is met, acquiring positioning collection information based on a second sampling rate; The first sampling rate is greater than the second sampling rate.
2. The method according to claim 1, characterized in that The step of starting to obtain positioning information includes: Acquire positioning collection information based on the first sampling rate; The method further comprises: Determine whether the positioning prediction condition is met, and if the positioning prediction condition is met, determine a second sampling rate, and switch the acquisition frequency from the first sampling rate to the second sampling rate; the acquisition frequency is the frequency for collecting positioning information.
3. The method according to claim 2, characterized in that When the positioning prediction condition is met, the method further includes: The first positioning prediction information is obtained based on the historical positioning collection information; wherein the first positioning prediction information is combined with the positioning collection information obtained 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.
4. The method according to claim 3, characterized in that: The positioning information includes latitude, longitude and altitude; In a case where the second sampling rate is half of the first sampling rate, the acquiring first positioning prediction information based on the historical positioning collection information includes: Determine the longitude and latitude (x1, y1) and the altitude h1 of the first positioning prediction information based on the second longitude and latitude (X1, Y1) and the first altitude H1 of the first positioning collection information, the second longitude and latitude (X2, Y2) and the second altitude H2 of the second positioning collection information, and the third longitude and latitude (X3, Y3) and the third altitude H3 of the third positioning collection information; If the acquisition frequencies between the first positioning acquisition information and the second positioning acquisition information, and between the second positioning acquisition information and the third positioning acquisition information are both the first sampling rate, the longitude and latitude (x1, y1) and the altitude h1 are determined as: If the acquisition frequency between the first positioning acquisition information and the second positioning acquisition information is the first sampling rate, and the acquisition frequency between the second positioning acquisition information and the third positioning acquisition information is the second sampling rate, the longitude and latitude (x1, y1) and the altitude h1 are determined as follows: If the acquisition frequencies between the first positioning acquisition information and the second positioning acquisition information, and between the second positioning acquisition information and the third positioning acquisition information are both the second sampling rate, the longitude and latitude (x1, y1) and the altitude h1 are determined as: Among them, Δ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 collection information, the second positioning collection information and the third positioning collection information are respectively the three most recent historical positioning collection information acquired from far to near in time.
5. The method according to claim 3, characterized in that: The positioning information includes longitude, latitude and altitude; the acquiring first positioning prediction information based on historical positioning collection information includes: Based on the second longitude and latitude (X1, Y1) and the first altitude H1 of the first positioning collection information, the second longitude and latitude (X2, Y2) and the second altitude H2 of the second positioning collection information, and the third longitude and latitude (X3, Y3) and the third altitude H3 of the third positioning collection information, the longitude and latitude (x1, y1) and the altitude h1 of the first positioning prediction information are determined as follows: x1=X last +Δx;y1=Y last +Δy;h1=H last +Δh; Wherein, k1 is the number of positioning prediction information obtained between the first positioning collection information and the second positioning collection information; k2 is the number of positioning prediction information obtained between the second positioning collection information and the third positioning collection information; X last , Y last and H last They are respectively 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 positioning acquisition information, the second positioning acquisition information and the third positioning acquisition information are respectively the three most recent historical positioning acquisition information acquired from far to near in time.
6. The method according to any one of claims 3 to 5, characterized in that: The positioning prediction information includes time information, and the first positioning prediction information is obtained based on the historical positioning collection information. The method also includes: Determine the time information of the first positioning prediction information as t1=T last +Δt; Wherein, Δt=1 / f1; f1 is the first sampling rate, T last The time information of the most recently acquired positioning information.
7. The method according to any one of claims 2 to 6, characterized in that: The determining of the second sampling rate comprises: The second sampling rate is determined to be half of the first sampling rate.
8. The method according to any one of claims 2 to 6, characterized in that: The determining of the second sampling rate comprises: When the displacement change rate is less than the first threshold change rate, the second sampling rate is determined to be f2=f1 / K; the displacement change rate is the change rate of the displacement on the longitude and latitude in the historical positioning collection information; When 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 longitude and latitude between the two most recently collected historical positioning collection information; When the displacement change rate is greater than or equal to the first threshold change rate and less than the second threshold change rate, determining the second sampling rate to be f2=f1 / 2; Among them, the first threshold change rate is smaller 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.
9. The method according to claim 8, characterized in that When 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 includes: Acceleration information is acquired, and based on the acceleration information, whether the electronic device is in a state tending to be stationary is monitored; when it is determined that the electronic device is in a state tending to be stationary, the electronic device maintains the second sampling rate as f2=f1 / K.
10. The method according to any one of claims 1 to 9, characterized in that: The positioning prediction conditions include one or more of the following conditions: acquisition frequency condition, satellite signal quality condition and positioning change condition; The acquisition 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 the number of first satellites is greater than or equal to a threshold number of satellites, and / or the first signal strength is greater than or equal to a threshold signal strength; the positioning change condition is a condition that the movement change angle is less than a threshold angle, and / or the displacement change rate is greater than or equal to (greater than) a second threshold change rate; The first number of satellites is the number of satellites whose satellite signals can be received by the electronic device at present; and the first signal strength is the signal quality of the received satellite information.
11. The method according to claim 10, characterized in that In a case where the positioning prediction condition includes the positioning change condition, the method further includes: The displacement change rate R = |S1-S2| / S2 is determined based on the first longitude and latitude (X1, Y1) of the first positioning collection information, the second longitude and latitude (X2, Y2) of the second positioning collection information, and the third longitude and latitude (X3, Y3) of the third positioning collection information; S1 and S2 are the displacements of two consecutive collections of positioning information, 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 Determine the moving change angle based on the second longitude and latitude (X2, Y2) of the second positioning collection information and the third longitude and latitude (X3, Y3) of the third positioning collection information The first positioning collection information, the second positioning collection information and the third positioning collection information are respectively the three most recent historical positioning collection information acquired from far to near in time.
12. The method according to claim 10 or 11, characterized in that: The range of the threshold angle is 2° to 10°; the range of the second threshold change rate is 5% to 15%.
13. The method according to any one of claims 2 to 12, characterized in that: After switching the acquisition frequency from the first sampling rate to the second sampling rate, the method further includes: Determine whether the positioning prediction condition is met, and if the positioning prediction condition is not met, switch the acquisition frequency from the second sampling rate to the first sampling rate.
14. The method according to claim 13, characterized in that When the positioning prediction condition is met, positioning collection information is acquired based on the second sampling rate.
15. The method according to any one of claims 2 to 12, characterized in that: After switching the acquisition frequency from the first sampling rate to the second sampling rate, the method further includes: In a case where the first positioning collection information is acquired based on the second sampling rate, determining that the electronic device is in a first low-frequency state; When it is determined that the positioning prediction condition is met, it is determined that the electronic device is in a second low-frequency state, and a third sampling rate is determined, and the acquisition frequency is 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, and the first low-frequency state and the second low-frequency state are different states of low-frequency acquisition of positioning information.
16. The method according to claim 15, characterized in that The first low-frequency state and the second low-frequency state are different low-frequency states of the electronic device; the low-frequency state includes a stationary state, a slightly variable speed state, and a uniform forward speed state; When the displacement change rate is less than the first threshold change rate, the electronic device is in the uniform forward state, and the uniform forward state corresponds to a sampling rate of 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 stationary state, and the sampling rate corresponding to the 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; Among them, the first threshold change rate is smaller 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.
17. The method according to any one of claims 1 to 16, characterized in that: When the electronic device acquires positioning collection information once, the process of determining whether the positioning prediction condition is met is executed once.
18. The method according to claim 3, characterized in that The electronic device includes a positioning module and a GPS driver, and the acquiring positioning collection information based on the first sampling rate includes: Acquiring positioning collection information based on the first sampling rate through the GPS driver; The GPS driver sends the positioning collection information to the positioning module; The determining whether the positioning prediction condition is met, determining a second sampling rate if the positioning prediction condition is met, and switching the acquisition frequency from the first sampling rate to the second sampling rate includes: The positioning module is used to determine whether the positioning prediction conditions are met, and if the positioning prediction conditions are met, the second sampling rate is determined; the positioning module sends a sampling frequency switching instruction to the GPS driver, and the sampling frequency switching instruction includes the second sampling rate; the GPS driver obtains positioning collection information according to the second sampling rate.
19. The method according to claim 18, characterized in that The electronic device further includes a location management module, which acquires first location prediction information based on historical location collection information, including: Calculating 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 positioning information; The positioning module sends the positioning information to the location management module.
20. 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 are used to store computer program codes, the computer program codes include computer instructions, and when the one or more processors execute the computer instructions, the electronic device executes the method as described in any one of claims 1-19.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 19 is implemented.
Citation Information
Patent Citations
Equipment positioning method and related equipment
CN112637758A
Information acquisition device, operation method thereof and control method of positioning unit
CN114488201A
Cited By
Multi-station unmanned aerial vehicle identification and positioning system and identification and positioning method
CN121284492A
A multi-station unmanned aerial vehicle identification and positioning system and an identification and positioning method
CN121284492B