A positioning method, terminal device and storage medium with reduced power consumption

By pre-storing location information in the terminal device and returning it when conditions are met, the problem of high energy consumption of the fuzzy positioning function is solved, and the effect of reducing power consumption is achieved.

CN115968026BActive Publication Date: 2025-09-19HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111186469.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-12
Publication Date
2025-09-19
Estimated Expiration
2041-10-12

AI Technical Summary

Technical Problem

Terminal devices consume a lot of energy when using the fuzzy positioning function, and existing technologies have failed to effectively reduce power consumption.

Method used

By pre-storing the terminal device's most recent location information that meets the fuzzy positioning requirements and returning the location information when the preset conditions are met, the number and frequency of actual positioning requests are reduced, and the calls to satellite communication, mobile communication and Wi-Fi modules are reduced.

Benefits of technology

It effectively reduces the energy consumption of the terminal device in providing the fuzzy positioning function, reduces the number of times of calculating and obtaining the position, and reduces the power consumption cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115968026B_ABST
    Figure CN115968026B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a positioning method, terminal device, and storage medium for reducing power consumption. The positioning method is applied to a terminal device that pre-stores first location information, where the first location information is the most recently acquired location information that meets fuzzy positioning requirements. The method includes: obtaining a first positioning request sent by an application on the terminal device; and when the location acquisition permission of the application is fuzzy positioning, feeding back the first location information to the application. By feeding back the first location information to the application, the execution or non-execution of positioning request commands or actions is reduced, thereby reducing energy consumption generated when the terminal device provides the fuzzy positioning function.
Need to check novelty before this filing date? Find Prior Art

Description

Technical field

[0001] The embodiments of the present application relate to the field of positioning technology, and in particular to a positioning method, terminal device, and storage medium for reducing power consumption. [Background Technology]

[0002] Users use location-based services (LBS) through their devices to access features like mapping, navigation, and location awareness. However, applications (APPs) installed on these devices can obtain the user's specific location information based on their location data, increasing the risk of privacy leaks.

[0003] In the prior art, terminal devices can provide a fuzzy positioning function to fuzzy the user's location information so that the application can only obtain the user's approximate location information, thereby protecting the user's privacy.

[0004] However, when the terminal device uses the fuzzy positioning function, the energy consumption of the terminal device during positioning is not taken into consideration, resulting in high energy consumption during the positioning process. [Summary of the invention]

[0005] The embodiments of the present application provide a positioning method, terminal device, and storage medium that reduce power consumption, thereby reducing energy consumption generated when the terminal device provides a fuzzy positioning function.

[0006] In a first aspect, the present application provides a positioning method with reduced power consumption, which can be applied to a terminal device, wherein the terminal device pre-stores first location information, where the first location information is the location information most recently obtained by the terminal device that meets fuzzy positioning requirements, and the method includes:

[0007] Obtaining a first positioning request sent by an application of the terminal device;

[0008] When the location acquisition permission of the application is fuzzy positioning, the first location information is fed back to the application.

[0009] Through the above-mentioned positioning method, the present application does not actually execute the command or action of the positioning request after obtaining the first positioning request and location acquisition permission of the application, but returns the pre-stored first location information as fuzzy location information to the application, so that the terminal device does not need to actually execute the command or action of the positioning request, and the software system of the terminal device does not need to drive the satellite communication module, mobile communication module, and Wi-Fi electronic module through the physical interface, thereby reducing the energy consumption of the terminal device 101 in providing the fuzzy positioning function.

[0010] In one possible implementation, after obtaining the first positioning request sent by the application of the terminal device, the method further includes:

[0011] Determining whether the first location information meets a preset condition;

[0012] When the location acquisition permission of the application is fuzzy positioning, feeding back the first location information to the application includes:

[0013] When the location acquisition permission of the application is fuzzy positioning, and when the first location information does not meet a preset condition, the first location information is fed back to the application.

[0014] Through the above-mentioned positioning method, the present application will execute the action or command of the first positioning request sent by the application only after the preset conditions are met, and obtain the current fuzzy location information of the terminal device, thereby greatly reducing the frequency of the terminal device actually calling the satellite communication module, mobile communication module or Wi-Fi module through the physical interface, and reducing the energy consumption of the terminal device in providing the fuzzy positioning function.

[0015] In one possible implementation, the preset condition is that a difference between a time instant when the first location information is generated and a current time instant reaches a preset time threshold; and determining whether the first location information satisfies the preset condition includes:

[0016] Obtaining a generation time of the first position information;

[0017] Determining whether the difference between the generation time and the current time is greater than or equal to a preset time threshold;

[0018] When the difference between the generation time and the current time is less than the preset time threshold, the first location information does not meet the preset condition;

[0019] When the difference between the generation time and the current time is greater than or equal to the preset time threshold, the first location information meets the preset condition.

[0020] The positioning method provided by the present application uses the first location information as the fuzzy location information returned by the application's positioning request, which is used to reduce the terminal device's execution of the command or action of the positioning request, thereby reducing the energy consumption of the terminal device when providing the fuzzy positioning function. However, in the above positioning method, the first location information stored by the terminal device may exist for a long time, and the user's terminal device may move a long distance. At this time, there is a large error between the first location information and the current position of the terminal device after movement, which may not meet the requirements of fuzzy positioning. The embodiment of the present application uses the above positioning method to determine whether the first location information at the current moment meets the requirements of fuzzy positioning based on the comparison between the difference between the generation time of the first location information and the current moment and the preset time threshold. Compared with the terminal device continuously obtaining location information to ensure the requirements of fuzzy positioning, it can reduce the number of times the location is obtained, and reduce the power consumption cost and computing cost of achieving fuzzy positioning.

[0021] In one possible implementation, the terminal device is pre-set with preset time thresholds for different first location information corresponding to different movement states. When the preset condition is that the difference between the time when the first location information is generated and the current time reaches the preset time threshold, determining whether the first location information meets the preset condition includes:

[0022] Obtaining a generation time of the first position information;

[0023] Determining a current mobility state of the terminal device, and determining, based on a current preset time threshold corresponding to the current mobility state, whether a difference between the generation time and the current time is greater than or equal to the current preset time threshold;

[0024] When the difference between the generation time and the current time is less than the current preset time threshold, the first location information does not meet the preset condition;

[0025] When the difference between the generation time and the current time is greater than or equal to the current preset time threshold, the first location information meets the preset condition.

[0026] The present application uses the above-mentioned positioning method and selects the corresponding current preset time threshold in combination with the current mobile state of the terminal device. It can reduce the frequency of the terminal device updating the first location information while ensuring that the first location information meets the fuzzy positioning requirements, thereby reducing the number of times the terminal device executes the positioning request command or action, and reducing the energy consumption of the terminal device when providing the fuzzy positioning function.

[0027] In one possible implementation, the preset condition is that a deviation between the location represented by the first location information and the current location of the terminal device reaches a preset distance threshold; and determining whether the first location information satisfies the preset condition includes:

[0028] Obtaining the current location of the terminal device;

[0029] Determining whether a deviation between the location represented by the first location information and the current location of the terminal device is greater than or equal to the preset distance threshold;

[0030] When the deviation between the position represented by the first position information and the current position of the terminal device is less than the preset distance threshold, the first position information does not meet the preset condition;

[0031] When the deviation between the position represented by the first position information and the current position of the terminal device is greater than or equal to the preset distance threshold, the first position information meets the preset condition.

[0032] Through the above-mentioned positioning method, the present application can obtain the approximate location information of the current terminal device in combination with the current usage status of the terminal device, and then determine whether the deviation between the location of the current terminal device and the location represented by the first location information reaches a preset distance threshold, and determine whether the first location information at the current moment needs to be re-acquired. Compared with the method in which the terminal device continuously obtains location information to ensure that the fuzzy positioning requirements are met, the number of times the location is obtained can be reduced, and the power consumption cost and computing cost of implementing fuzzy positioning can be reduced.

[0033] In one possible implementation, when the location acquisition permission of the application is fuzzy positioning and when the first location information meets a preset condition, feeding back the first location information to the application includes:

[0034] Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements;

[0035] acquiring updated first location information according to the second location information;

[0036] Feedback the updated first location information to the application.

[0037] In one possible implementation, when the terminal device does not store the first location information, and when the location acquisition permission of the application is fuzzy positioning, feeding back the first location information to the application includes:

[0038] Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements;

[0039] acquiring updated first location information according to the second location information;

[0040] Feedback the updated first location information to the application.

[0041] In one possible implementation, when the location acquisition permission of the application is not fuzzy positioning, the method further includes:

[0042] Change the first positioning request sent by the application of the terminal device to a second positioning request, and obtain the location information of the terminal device based on the second positioning request, wherein the energy consumption of obtaining the location information based on the second positioning request is lower than the energy consumption of obtaining the location information based on the first positioning request sent by the application.

[0043] Through the above positioning method, the present application can reduce the energy consumption of the terminal device when providing the positioning function by converting the first positioning request with higher energy consumption into the second positioning request with lower energy consumption when the location acquisition permission of the application is not fuzzy positioning.

[0044] In a second aspect, the present application provides a positioning method with reduced power consumption, which is applied to a terminal device, wherein the terminal device pre-stores first location information, where the first location information is the location information most recently obtained by the terminal device that meets the fuzzy positioning requirements, and the method includes:

[0045] Determine the target application for sending the positioning request;

[0046] Obtaining location access permission for the target application;

[0047] When the location acquisition permission of the target application is fuzzy positioning, the first location information is fed back to the target application.

[0048] In one possible implementation, after determining the target application for sending the positioning request, the method further includes:

[0049] Determining whether the first location information meets a preset condition;

[0050] When the location acquisition permission of the target application is fuzzy positioning, feeding back the first location information to the target application includes:

[0051] When the location acquisition authority of the target application is fuzzy positioning and when the first location information does not meet a preset condition, the first location information is fed back to the target application.

[0052] In one possible implementation, the preset condition is that a difference between a time instant when the first location information is generated and a current time instant reaches a preset time threshold; and determining whether the first location information satisfies the preset condition includes:

[0053] Obtaining a generation time of the first position information;

[0054] Determining whether the difference between the generation time and the current time is greater than or equal to a preset time threshold;

[0055] When the difference between the generation time and the current time is less than the preset time threshold, the first location information does not meet the preset condition;

[0056] When the difference between the generation time and the current time is greater than or equal to the preset time threshold, the first location information meets the preset condition.

[0057] In one possible implementation, the terminal device is pre-set with preset time thresholds for different first location information corresponding to different movement states. When the preset condition is that the difference between the time when the first location information is generated and the current time reaches the preset time threshold, determining whether the first location information meets the preset condition includes:

[0058] Obtaining a generation time of the first position information;

[0059] Determining a current mobility state of the terminal device, and determining, based on a current preset time threshold corresponding to the current mobility state, whether a difference between the generation time and the current time is greater than or equal to the current preset time threshold;

[0060] When the difference between the generation time and the current time is less than the current preset time threshold, the first location information does not meet the preset condition;

[0061] When the difference between the generation time and the current time is greater than or equal to the current preset time threshold, the first location information meets the preset condition.

[0062] In one possible implementation, the preset condition is that a deviation between the location represented by the first location information and the current location of the terminal device reaches a preset distance threshold; and determining whether the first location information satisfies the preset condition includes:

[0063] Obtaining the current location of the terminal device;

[0064] Determining whether a deviation between the location represented by the first location information and the current location of the terminal device is greater than or equal to the preset distance threshold;

[0065] When the deviation between the position represented by the first position information and the current position of the terminal device is less than the preset distance threshold, the first position information does not meet the preset condition;

[0066] When the deviation between the position represented by the first position information and the current position of the terminal device is greater than or equal to the preset distance threshold, the first position information meets the preset condition.

[0067] In one possible implementation, when the location acquisition permission of the application is fuzzy positioning and when the first location information meets a preset condition, feeding back the first location information to the application includes:

[0068] Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements;

[0069] acquiring updated first location information according to the second location information;

[0070] Feedback the updated first location information to the application.

[0071] In one possible implementation, when the terminal device does not store the first location information, and when the location acquisition permission of the application is fuzzy positioning, feeding back the first location information to the application includes:

[0072] Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements;

[0073] acquiring updated first location information according to the second location information;

[0074] Feedback the updated first location information to the application.

[0075] In a third aspect, the present application provides a terminal device, including:

[0076] A storage module, configured to store first location information, where the first location information is the location information most recently acquired by the terminal device that meets the fuzzy positioning requirement;

[0077] An acquisition module, configured to obtain a first positioning request sent by an application of the terminal device;

[0078] The positioning information feedback module feeds back the first position information to the application when the location acquisition permission of the application is fuzzy positioning.

[0079] In one possible implementation, the terminal device further includes a determination module, configured to determine whether the first location information satisfies a preset condition and send a determination result to the positioning information feedback module; the positioning information feedback module is specifically configured to:

[0080] When the location acquisition permission of the application is fuzzy positioning, and when the first location information does not meet a preset condition, the first location information is fed back to the application.

[0081] In one possible implementation, the preset condition is that the difference between the time when the first location information is generated and the current time reaches a preset time threshold; and the determining module is specifically configured to:

[0082] Obtaining a generation time of the first position information;

[0083] Determining whether the difference between the generation time and the current time is greater than or equal to a preset time threshold;

[0084] When the difference between the generation time and the current time is less than the preset time threshold, the first location information does not meet the preset condition;

[0085] When the difference between the generation time and the current time is greater than or equal to the preset time threshold, the first location information meets the preset condition.

[0086] In one possible implementation, the terminal device is pre-set with preset time thresholds for different first location information corresponding to different movement states. When the preset condition is that the difference between the time when the first location information is generated and the current time reaches the preset time threshold, the determination module is specifically configured to:

[0087] Obtaining a generation time of the first position information;

[0088] Determining a current mobility state of the terminal device, and determining, based on a current preset time threshold corresponding to the current mobility state, whether a difference between the generation time and the current time is greater than or equal to the current preset time threshold;

[0089] When the difference between the generation time and the current time is less than the current preset time threshold, the first location information does not meet the preset condition;

[0090] When the difference between the generation time and the current time is greater than or equal to the current preset time threshold, the first location information meets the preset condition.

[0091] In one possible implementation, the preset condition is that a deviation between the location represented by the first location information and the current location of the terminal device reaches a preset distance threshold; and the determining module is specifically configured to:

[0092] Obtaining the current location of the terminal device;

[0093] Determining whether a deviation between the location represented by the first location information and the current location of the terminal device is greater than or equal to the preset distance threshold;

[0094] When the deviation between the position represented by the first position information and the current position of the terminal device is less than the preset distance threshold, the first position information does not meet the preset condition;

[0095] When the deviation between the position represented by the first position information and the current position of the terminal device is greater than or equal to the preset distance threshold, the first position information meets the preset condition.

[0096] In one possible implementation, the positioning information feedback module is further configured to:

[0097] When the location acquisition permission of the application is fuzzy positioning, and when the first location information meets the preset conditions,

[0098] Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements;

[0099] acquiring updated first location information according to the second location information;

[0100] Feedback the updated first location information to the application.

[0101] In one possible implementation, the positioning information feedback module is further configured to:

[0102] When the terminal device does not store the first location information, and when the location acquisition permission of the application is fuzzy positioning,

[0103] Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements;

[0104] acquiring updated first location information according to the second location information;

[0105] Feedback the updated first location information to the application.

[0106] In one possible implementation, the positioning information feedback module is further configured to:

[0107] When the location acquisition permission of the application is not fuzzy positioning, the first positioning request sent by the application of the terminal device is changed to a second positioning request, and the location information of the terminal device is obtained based on the second positioning request, wherein the energy consumption of obtaining the location information based on the second positioning request is lower than the energy consumption of obtaining the location information based on the first positioning request sent by the application.

[0108] In a fourth aspect, the present application provides a terminal device comprising: at least one processor; and at least one memory communicatively connected to the processor, wherein: the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the method provided in the first aspect or the second aspect.

[0109] In a fifth aspect, the present application provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the method provided in the first aspect or the second aspect.

[0110] It should be understood that the second to fifth aspects of the embodiments of the present application are consistent with the technical solutions of the first aspect of the embodiments of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here.

Brief Description of the Drawings

[0111] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0112] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application;

[0113] Figure 2 It is the software structure diagram of the terminal device;

[0114] Figure 3 This is a schematic diagram of the principle of a terminal device processing an application location request in the prior art;

[0115] Figure 4 This is a flow chart of a positioning method provided by an embodiment of the present application;

[0116] Figure 5 is a flow chart of a positioning method provided by another embodiment of the present application;

[0117] Figure 6 is a flow chart of a positioning method provided by another embodiment of the present application;

[0118] Figure 7 is a flow chart of a positioning method provided by another embodiment of the present application;

[0119] Figure 8 is a flow chart of a positioning method provided by another embodiment of the present application;

[0120] Figure 9 is a flow chart of a positioning method provided by another embodiment of the present application;

[0121] Figure 10 is a flow chart of a positioning method provided by another embodiment of the present application;

[0122] Figure 11 This is a schematic diagram of the structure of a terminal device provided by an embodiment of this specification;

[0123] Figure 12 This is a schematic diagram of the principle of processing an application location request by an acquisition module provided in an embodiment of this specification;

[0124] Figure 13 It is a structural diagram of a terminal device provided in one embodiment of this specification. [Specific implementation method]

[0125] In order to better understand the technical solutions of this specification, the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0126] It should be clear that the embodiments described are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this specification.

[0127] The terms used in the examples of this application are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a," "an," "the," and "the" used in the examples of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0128] Location-based service: It can refer to the use of one or more positioning technologies to obtain the current location information and service information of the terminal device.

[0129] The location information may be information representing the geographical location of the terminal device 101, such as longitude, latitude, altitude, time, etc.

[0130] The service information may be weather information, building information, restaurant information, travel information, etc. near the location of the terminal device 101.

[0131] For example, a user can send the current location information of the terminal device 101 and a request to a location service provider through the terminal device 101 to convert the longitude and latitude of the current location information into a place name and obtain service information related to the place name. The place name can be a country name, province name, city name, street name, building name, etc.

[0132] The above-mentioned positioning technologies include: satellite positioning, Wi-Fi positioning, base station positioning and IP address (Internet protocol address) positioning.

[0133] Exemplarily, the terminal device 101 may directly obtain the current location information of the terminal device 101 through satellite positioning or base station positioning.

[0134] Satellite positioning refers to the process by which the terminal device 101 receives, captures, and tracks satellite signals to obtain one or more of the terminal device's current longitude, latitude, and altitude. Satellite positioning offers high accuracy, but it consumes significant energy. Furthermore, because the terminal device 101 uses satellite timing, acquiring initial location information may take a significant amount of time.

[0135] Satellite positioning can be achieved through the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the Beidou Navigation Satellite System (BDS), the Galileo Satellite Navigation System, etc.

[0136] The following uses GPS as an example to illustrate the principle of positioning of the terminal device 101 through the satellite 102.

[0137] GPS consists of a space segment, a ground segment, and a user segment. The space segment includes one or more satellites 102. The ground segment consists of multiple ground stations. The user segment refers to the terminal device 101 used by the user, which is equipped with a GPS receiver. When the satellite 102 and the terminal device 101 communicate, the longitude and latitude of the terminal device 101 are obtained using triangulation methods based on the communication delay between multiple satellites 102 and the same terminal device 101. Specifically, the satellites 102 in the space segment can continuously broadcast signals for positioning and receive information and instructions sent by multiple ground stations in the ground segment to maintain normal operation. The GPS receiver in the terminal device 101 can capture, track, and lock onto the signals sent by the satellites 102. The GPS receiver can process the signals sent by the satellites 102 and obtain the current location information of the terminal device 101.

[0138] Base station positioning: The terminal device 101 can communicate with the base station 103 in the mobile network through an electronic module or chip connected to the mobile network. The terminal device 101 can calculate the location information of the terminal device 101 by the communication time difference between the terminal device 101 and the base station 103.

[0139] The mobile network involved in the embodiments of the present application may refer to a wireless communication network formed by mobile communication technologies such as the third generation mobile communication technology (3G), the fourth generation mobile communication technology (4G), and the fifth generation mobile communication technology (5G).

[0140] For example, triangulation positioning can be performed using three base stations 103 near the terminal device 101. Since the position of each base station 103 is fixed, the location of the terminal device 101 can be calculated using the time required for wireless signals to transfer between the three base stations 103.

[0141] Triangulation: Also known as triangulation, triangulation is a method of measuring the distance to a target by measuring the angle between the target point and the known endpoints of a fixed reference line. When terminal device 101 is within the signal range of three base stations 103, triangulation can determine the latitude and longitude of terminal device 101.

[0142] Exemplarily, the terminal device 101 may obtain location information through base station information or Wi-Fi information.

[0143] The base station information may include one or more of a base station identification code (Base station ID), a location area code (LAC), a mobile country code (MCC), a mobile network code (MNC), a cell identity, and a signal strength.

[0144] For example, the terminal device 101 can obtain base station information by communicating with the base station 103. The terminal device 101 can access the network 105 through the base station 103 or a Wi-Fi device and send the base station information to the location service provider's server 106. The location service provider's server 106 calculates the location information of the terminal device 101 based on the received base station information and then feeds the location information back to the terminal device 101.

[0145] For example, network 105 may be the Internet.

[0146] Wi-Fi positioning: Each device with a Wi-Fi electronic module or chip has a fixed MAC address. When the Wi-Fi device is turned on, it scans and collects signals broadcast by surrounding wireless access points (APs), obtains the MAC address broadcast by AP 104 and the signal strength connected to AP 104.

[0147] The Wi-Fi involved in the embodiments of the present application refers to a type of device, electronic module or chip that complies with the IEEE 802.11 standard. The terminal device 101 can access a wireless local area network and search for surrounding wireless access points 104 through a Wi-Fi electronic module, Wi-Fi chip, or Wi-Fi device.

[0148] Wireless access point 104: A wireless local area network (WLAN) access point, also known as a hotspot or wireless access point. Wireless access point 104 allows at least one terminal device 101 to access the WLAN. It is understood that wireless access point 104 is equipped with at least a Wi-Fi electronic module or chip. For example, wireless access point 104 can be a wireless router, wireless gateway, wireless bridge, wireless repeater, or other device.

[0149] MAC address (Media access control address): Media access control address, also known as LAN address, MAC address, Ethernet address or physical address. The MAC address can be used to confirm the location information of the wireless access point 104. In the seven-layer model (Open system interconnection, OSI) model, the second layer, the data link layer, is responsible for the MAC address. The MAC address is used to uniquely identify a network interface card (NIC) of a network device in the network. For example, if a terminal device 101 has one or more network cards, each network card needs and will have a unique MAC address.

[0150] For example, the Wi-Fi information may include one or more of a MAC address, a BSSID, and a signal strength. The BSSID may refer to the MAC address of the wireless access point 104 .

[0151] For example, the terminal device 101 sends data such as the MAC address, BSSID, and signal strength to the server 106 via the network. The server 106 retrieves the geographic location of the wireless access point 104 corresponding to the MCA address based on the MAC address, and calculates the location information of the terminal device 101 based on the signal strength. The server 106 then feeds the location information of the terminal device 101 back to the terminal device 101.

[0152] Exemplarily, the terminal device 101 may obtain the current location information of the terminal device 101 through IP address positioning.

[0153] IP address positioning: When a terminal device 101 accesses the internet, it is assigned an IP address. The allocation of IP addresses is geographically dependent. By using the existing mapping between IP addresses and regions, the location of the terminal device 101 can be located within a city-sized area.

[0154] It is understandable that the terminal device 101 can access the Internet through the base station 103 and the wireless access point 104.

[0155] The terminal device 101 involved in the embodiment of the present application can obtain the current location information of the terminal device 101 through one or a combination of satellite positioning, Wi-Fi positioning, base station positioning, and IP address positioning.

[0156] Terminal device 101 may include one or more of a satellite communication module, a Wi-Fi electronic module, and a mobile communication module. The satellite communication module is used to receive signals transmitted by satellite 102 for satellite positioning. The Wi-Fi electronic module is used to connect to wireless access point 104 for Wi-Fi positioning. The mobile communication module is used to connect to base station 103 for base station positioning. Terminal device 101 can access the internet through the Wi-Fi electronic module or the mobile communication module to achieve IP address positioning.

[0157] For example, the terminal device 101 can be a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile internet device (MID), a wearable device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a personal digital assistant (PDA), etc., and the embodiments of the present application are not limited to this.

[0158] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 In the description, the terminal device 101 is taken as a mobile phone as an example, and this example does not constitute a limitation on the embodiments of the present application.

[0159] See also Figure 1 , the terminal device 101 can obtain one or more of satellite positioning information, base station positioning information, Wi-Fi positioning information, and IP address positioning information.

[0160] For example, satellite positioning information may refer to location information obtained by the terminal device 101 through satellite positioning. Base station positioning information may refer to location information obtained by the terminal device 101 through base station positioning. Wi-Fi positioning information may refer to location information obtained by the terminal device 101 through Wi-Fi positioning. IP address positioning information may refer to location information obtained by the terminal device 101 through IP address positioning.

[0161] It should be understood that the base station location information involved in the embodiments of the present application may include base station information, Wi-Fi location information may include Wi-Fi information, and IP address location information may include IP addresses.

[0162] Optionally, the terminal device 101 may obtain the current location information of the terminal device 101 via the satellite 102 .

[0163] Optionally, the terminal device 101 may also connect to three base stations 103 and use triangulation to calculate the current location information of the terminal device 101 .

[0164] Optionally, the terminal device 101 may obtain base station information through the base station 103. Alternatively, the terminal device 101 may obtain Wi-Fi information through the wireless access point 104. The terminal device 101 may send the base station information or Wi-Fi information to the server 106 via the network 105, and the server 106 may feedback the current location information of the terminal device 101.

[0165] Optionally, the terminal device 101 may obtain the current location information of the terminal device 101 by accessing an IP address assigned by the Internet.

[0166] The terminal device 101 involved in the embodiments of the present application is deployed with a software system. The software system of the terminal device 101 can adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. The embodiments of the present application use the Android system with a layered architecture as an example to illustrate the software structure block diagram of the terminal device 101. This example does not constitute a limitation on the embodiments of the present application.

[0167] Figure 2 It is a software structure block diagram of the terminal device 101.

[0168] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0169] The application layer can include a series of application packages. Figure 2 As shown, the application package may include applications (APPs) such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message. Applications are also called apps. Applications are software generated through analysis, design, and coding, and can be installed on terminal device 101.

[0170] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0171] like Figure 2 As shown, the application framework layer may include a location manager, a content provider, a phone manager, a resource manager, and a Wi-Fi manager.

[0172] The location manager is used to provide location management functions for the terminal device 101. For example, it returns satellite positioning information, base station positioning information, Wi-Fi positioning information, and IP address positioning information. For example, the location manager can obtain location information from a location provider. For example, a GPS positioning provider provides GPS positioning information, while a network positioning provider provides base station positioning information or Wi-Fi positioning information.

[0173] It should be noted that the location manager can obtain satellite positioning-related information provided by the satellite communication module. Satellite positioning-related information may include the status of the satellite communication module, time, longitude, latitude, altitude, etc. The status of the satellite communication module may include whether the satellite communication module is started or stopped, the first positioning, and satellite changes.

[0174] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0175] The phone manager is used to provide communication functions for the terminal device 101. For example, it manages call status (including connection and disconnection). The phone manager can also obtain information about the terminal device 101, including status and signal strength. Terminal device 101 information includes device information, SIM card information, and network information. Terminal device 101 status includes call status and service status. Network information includes network type, operator name, base station information, etc.

[0176] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0177] The Wi-Fi manager is used to provide Wi-Fi functions for the terminal device 101, such as turning Wi-Fi on or off, scanning for nearby wireless access points 104, connecting to wireless access points 104, and Wi-Fi signal strength. For example, the Wi-Fi manager can obtain Wi-Fi information, such as the Wi-Fi connection status, signal strength, MAC address, IP address, SSID, Wi-Fi electronic module status, and other Wi-Fi information of the terminal device 101, which will not be described in detail here.

[0178] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.

[0179] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0180] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0181] The system library can include multiple functional modules, such as the surface manager, media libraries, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0182] The kernel layer is the layer between hardware and software. The kernel layer includes at least display drivers, GPS drivers, Wi-Fi drivers, sensor drivers, etc.

[0183] The following is an example of the workflow of the software and hardware of the terminal device 101, combined with the map application positioning scenario.

[0184] When the touch sensor receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into raw input events (including touch coordinates, timestamp of the touch operation, and other information). The raw input events are stored in the kernel layer. The application framework layer obtains the raw input events from the kernel layer and identifies the control corresponding to the input event. For example, if the touch operation is a touch single-click operation and the control corresponding to the single-click operation is the control of the map application icon, the map application calls the location manager of the application framework layer to start the satellite communication module (such as a GPS receiver), and then starts the GPS driver by calling the kernel layer, and obtains the current satellite positioning information of the terminal device 101, such as longitude, latitude, altitude, etc., through the satellite communication module.

[0185] Figure 3 This is a schematic diagram of the principle of the terminal device 101 processing the application location request in the prior art.

[0186] For example, an application can invoke an application programming interface (API) of the software system to cause the software system to execute a positioning request command or positioning request action issued by the application. The software system can drive a satellite communication module, a Wi-Fi electronic module, or a mobile communication module via a physical interface to obtain the location information of the terminal device 101. The API can be a location manager, a phone manager, or a Wi-Fi manager. The physical interface can be an I / O interface.

[0187] See also Figure 3 ,The process of application 1 obtaining location information through the software system is as follows:

[0188] After receiving the positioning request from application 1, the software system executes the positioning request command or action through the location manager;

[0189] The location manager obtains positioning-related information by calling the kernel layer to drive one or more of the satellite communication module, mobile communication module, and Wi-Fi electronic module;

[0190] The software system of the terminal device 101 obtains the location information based on the positioning-related information;

[0191] The software system of the terminal device 101 returns the location information to the application 1 .

[0192] Positioning-related information may include one or more of satellite positioning information, base station information, Wi-Fi information, and IP address.

[0193] Optionally, the software system of the terminal device 101 may use the satellite positioning information returned by the satellite communication module as the location information and return the location information to the application 1 .

[0194] Optionally, the software system of the terminal device 101 can send one or more of the acquired base station information, Wi-Fi information, and IP addresses to the location service provider's server 106 via the Internet, thereby acquiring the location name and returning the location name to the application 1.

[0195] Exemplarily, the location manager may read satellite positioning information in the satellite communication module through a physical interface.

[0196] For example, the location manager can obtain the base station information through the phone manager. The phone manager reads the base station information in the mobile communication module through the physical interface.

[0197] For example, the location manager may obtain Wi-Fi information through a Wi-Fi manager, and the Wi-Fi manager may read the Wi-Fi information in the Wi-Fi electronic module through a physical interface.

[0198] Exemplarily, the location manager may also obtain, through the phone manager or the Wi-Fi manager, the IP address assigned when the terminal device 101 accesses the Internet.

[0199] Alternatively, the application can obtain location information by integrating a software development kit (SDK). An SDK is a collection of development tools used to create applications for specific software packages, software frameworks, hardware platforms, software systems, and the like. A software development kit may provide files that contain application program interface (API) files for a particular programming language. For example, a positioning SDK may obtain positioning-related information by calling a software system's API and calculate the location information of the terminal device 101 based on the positioning-related information.

[0200] See also Figure 3 The process of application 2 obtaining location information through the positioning SDK is as follows:

[0201] After the positioning SDK of application 2 receives the positioning request, the positioning SDK calls the API in the software system;

[0202] If the positioning SDK requests satellite positioning information, you can obtain satellite positioning information through the location manager; the process of the location manager obtaining satellite positioning information is the same as Figure 3 The process of obtaining satellite positioning information by application 1 shown in FIG is the same and will not be repeated here;

[0203] If the positioning SDK requests base station information, you can obtain the base station information through the phone manager;

[0204] If the positioning SDK requests Wi-Fi information, you can obtain the Wi-Fi information through the Wi-Fi manager;

[0205] The positioning SDK can calculate the current location information of the terminal device 101 based on one or more of satellite positioning information, base station information, and Wi-Fi information.

[0206] In addition, the positioning SDK can obtain the IP address assigned to the terminal device 101 for accessing the Internet through the phone manager and the Wi-Fi manager, and obtain the current location information of the terminal device 101 through the IP address.

[0207] The terminal device 101 may provide a fuzzy positioning function that may process precise location information into fuzzy location information that meets fuzzy positioning requirements.

[0208] Precise location information may be information indicating the precise location of the terminal device 101. For example, satellite positioning information may be the precise location information. The precise location information may include the exact longitude and latitude of the terminal device 101's location. The precise location information may also include altitude and time information provided by a satellite positioning timing service.

[0209] Base station positioning information or Wi-Fi positioning information may be less accurate than satellite positioning information. However, within a certain time range, base station information and / or Wi-Fi information obtained multiple times can be considered accurate location information. The certain time range can be within a few seconds or minutes. Multiple times can be two, three, four, or more times. In some possible implementations, multiple times can mean three, four, or more times, which is not limited in this embodiment of the present application.

[0210] The fuzzy positioning information may refer to the position information in which the deviation between the position provided by the terminal device 101 and the precise position of the terminal device 101 is within a certain range. The certain range may mean that the deviation between the position provided by the terminal device 101 and the precise position of the terminal device 101 is within a preset distance threshold.

[0211] For example, the preset distance threshold may be 500m. When the deviation between the location provided by the terminal device 101 and the location represented by the precise location information is greater than 500m, the fuzzy positioning requirement is not met. In the embodiment of the present application, the preset distance may be determined based on actual conditions, and the specific value of the preset distance threshold is not specifically limited.

[0212] In one possible implementation, after the terminal device 101 obtains the current precise location information of the terminal device 101, the current precise location information of the terminal device 101 can be fuzzy processed to obtain fuzzy location information, which can prevent the application from obtaining the user's precise location and thereby protect the user's privacy.

[0213] However, the above-mentioned implementation method of fuzzy positioning does not take into account that the essence of fuzzy positioning is to obtain inaccurate location information compared to relatively precise location information. If fuzzy processing is performed on the basis of obtaining precise location information, the terminal device 101 will need to obtain precise location information when providing the fuzzy positioning function, resulting in a large amount of energy consumed by the terminal device 101 when providing the fuzzy positioning function.

[0214] Combine Figure 3 The schematic diagram of the principle of the terminal device 101 processing the positioning request of the application program is shown, which illustrates the energy consumption of the terminal device 101 providing the fuzzy positioning function in the existing related art.

[0215] See also Figure 3 ,Application 1 obtains precise location information by calling the software system through the API, and then processes the precise location information through the fuzzy algorithm to obtain fuzzy location information.

[0216] See also Figure 3,The software system processes the precise base station information, Wi-Fi information, and IP address through a fuzzy algorithm, and then the positioning SDK obtains one or more of the fuzzy base station information, Wi-Fi information, and IP address, and then calculates the fuzzy location information and returns the fuzzy location information to the application 2.

[0217] Exemplarily, the energy consumption in the process of the satellite communication module acquiring the positioning-related information is greater than the energy consumption in the process of the mobile communication module and the Wi-Fi electronic module acquiring the positioning-related information.

[0218] When the above-mentioned application 1 and application 2 obtain fuzzy location information, the software system of the terminal device 101 is required to execute commands or actions to obtain precise location information, so that the energy consumption generated when the terminal device 101 provides the fuzzy positioning function is not much different from the energy consumption generated when the terminal device 101 is precisely positioned, and thus the actual energy consumed when the terminal device 101 provides the fuzzy positioning function is not reduced.

[0219] Based on the above problems, an embodiment of the present application provides a positioning method, which reduces the energy consumption generated when the terminal device 101 provides a fuzzy positioning function by not actually executing the positioning request command or action, or reducing the number of times the terminal device 101 actually executes the positioning request command or action.

[0220] Figure 4 This is a flow chart of a positioning method provided by an embodiment of the present application. Figure 4 As shown, the above positioning method can be applied to the terminal device 101. The terminal device 101 pre-stores the first position information. The first position information can be the position information that meets the fuzzy positioning requirement that the terminal device 101 has recently acquired.

[0221] Optionally, the first location information may be stored in a positioning cache. The terminal device 101 is provided with a positioning cache. Alternatively, the terminal device 101 allocates a cache from an existing storage area as the positioning cache. The first location information may also be stored in other storage media of the terminal device 101, which is not limited in this embodiment of the present application.

[0222] Optionally, the first location information may include one or more of satellite positioning information, base station positioning information, Wi-Fi positioning information, and IP address positioning information that have been blurred. For example, the first location information may be longitude, latitude, altitude, etc. that have been blurred. For another example, the first location information may be base station information, Wi-Fi information, or IP address information that have been blurred.

[0223] The above positioning method may include:

[0224] Step 401: Acquire a first positioning request sent by an application of the terminal device 101.

[0225] Optionally, the first positioning request may refer to an application requesting the location information of the terminal device 101. The embodiment of the present application does not specifically limit the specific content of the first positioning request and the method of sending the first positioning request. For example, the application may specify to use one or more positioning technologies including satellite positioning, base station positioning, Wi-Fi positioning, and IP address positioning to obtain location information.

[0226] Optionally, the terminal device 101 obtains a first positioning request sent by an application. The application may send the first positioning request to a location service program deployed in the terminal device 101. Figure 3 , the location service program can be a location manager.

[0227] Optionally, the application may send a first positioning request to the SDK running on the terminal device 101. Figure 3 When an application integrates a positioning SDK, the application can send a first positioning request to the positioning SDK. The positioning SDK can send the first positioning request to a location manager deployed in the terminal device 101. The positioning SDK can also send a call request regarding the first positioning request to a phone manager or a Wi-Fi manager.

[0228] Step 402: When the location acquisition permission of the application is fuzzy positioning, the first location information is fed back to the application.

[0229] Optionally, the terminal device 101 may set a location acquisition permission for the application. The location acquisition permission may be fuzzy positioning or precise positioning to obtain precise location information.

[0230] Optionally, the terminal device 101 may check the location acquisition permission of the application program in response to the first positioning request sent by the application program.

[0231] Optionally, the terminal device 101 may modify the location acquisition permission of the application in response to a user operation. The user operation may be to enable the fuzzy positioning function of the application. Alternatively, the user operation may be to disable the fuzzy positioning function of the application.

[0232] Optionally, in another possible implementation, the positioning method may include:

[0233] Determine the target application for sending the positioning request;

[0234] Obtaining location access permission for the target application;

[0235] When the location acquisition permission of the target application is fuzzy positioning, the first location information is fed back to the target application.

[0236] Optionally, sending the positioning request may be sending a first positioning request.

[0237] The embodiment of the present application uses the above-mentioned positioning method. After obtaining the first positioning request and location acquisition permission of the application, the command or action of the first positioning request is not actually executed, but the pre-stored first location information is returned to the application as fuzzy location information, so that the terminal device 101 does not need to actually execute the command or action of the positioning request, and thus the software system of the terminal device 101 does not need to drive the satellite communication module, mobile communication module, and Wi-Fi electronic module through the physical interface, thereby reducing the energy consumption of the terminal device 101 in providing the fuzzy positioning function.

[0238] Figure 5 This is a flow chart of a positioning method provided by another embodiment of the present application. Figure 5 As shown, this application Figure 4 In the embodiment shown, after obtaining the first positioning request sent by the application of the terminal device 101 in step 401, the following steps are further included:

[0239] Step 501: Determine whether the first location information meets a preset condition.

[0240] Optionally, in another possible implementation manner, after determining the target application to send the positioning request, the method may further include:

[0241] It is determined whether the first location information meets a preset condition.

[0242] Optionally, the preset condition may be that the difference between the time when the first location information is generated and the current time reaches a preset time threshold. The generation time may indicate the time when the first location information is generated. The current time may be the current time when the terminal device 101 determines whether the first location information meets the preset condition.

[0243] Optionally, reaching the preset time threshold may be that the difference between the generation time of the first position information and the current time is greater than or equal to the preset time threshold.

[0244] Optionally, the terminal device 101 may pre-set a preset time threshold. The terminal device 101 may modify the preset time threshold in response to a user operation.

[0245] Optionally, the preset time threshold may be a fixed value, for example, 1 minute, 5 minutes, 10 minutes or longer.

[0246] Optionally, the preset condition may also be that the deviation between the position represented by the first position information and the current position of the terminal device 101 reaches a preset distance threshold. The current position of the terminal device 101 may be obtained through network information or communication information.

[0247] It should be noted that in addition to satellite positioning, base station positioning, and Wi-Fi positioning, the terminal device 101 also needs to ensure the communication needs of the terminal device 101. For example, the terminal device 101 can access the base station and access the Internet, so the terminal device 101 can obtain the current location of the terminal device 101 through network information or communication information.

[0248] Exemplarily, when the terminal device 101 accesses the network, the current location of the terminal device 101 can be obtained through network information. For example, when the terminal device 101 accesses the network, the area where the terminal device 101 is located can be roughly obtained based on the assigned IP address. For another example, when the terminal device 101 takes public transportation, it needs to scan a code to ride. By scanning the code, the terminal device 101 can at least obtain the name of the current station, such as the name of a subway station, a bus stop, a train station, a high-speed rail station, etc., and then obtain the current location of the terminal device 101. The above is an exemplary description of the implementation method of the terminal device 101 obtaining the current location of the terminal device 101 through network information. The embodiments of the present application do not limit the specific implementation method of the terminal device 101 obtaining the current location through network information.

[0249] Exemplarily, the terminal device 101 can obtain the current location of the terminal device 101 through communication information. For example, when the terminal device 101 is connected to different base stations, it may obtain information about the current location, such as welcome information and weather information pushed by some base stations, including the current location. For another example, when the terminal device 101 uses a near-field communication (NFC) module, a Bluetooth module, etc. to interact with access control, subway gates or other devices, the terminal device 101 can obtain information about the device interacting with the terminal device 101, and then obtain the current location through the information of the device interacting with the terminal device 101. The above is an exemplary description of the implementation method of the terminal device 101 obtaining the current location of the terminal device 101 through communication information. The embodiments of the present application do not limit the specific implementation method of the terminal device 101 obtaining the current location through communication information.

[0250] Optionally, determining whether the first location information meets a preset condition includes:

[0251] Get the current location of the terminal device;

[0252] Determining whether a deviation between the location represented by the first location information and the current location of the terminal device is greater than or equal to a preset distance threshold;

[0253] When the deviation between the position represented by the first position information and the current position of the terminal device is less than the preset distance threshold, the first position information does not meet the preset condition;

[0254] When the deviation between the position represented by the first position information and the current position of the terminal device is greater than or equal to a preset distance threshold, the first position information meets the preset condition.

[0255] like Figure 5 As shown, this application Figure 4 In the illustrated embodiment, in step 402, when the location acquisition permission of the application is fuzzy positioning, feeding back the first location information to the application includes:

[0256] Step 502: When the location acquisition permission of the application is fuzzy positioning and when the first location information does not meet a preset condition, the first location information is fed back to the application.

[0257] The embodiment of the present application uses the above-mentioned positioning method to execute the action or command of the first positioning request sent by the application only after the first location information meets the preset conditions, and obtain the current fuzzy location information of the terminal device 101, thereby greatly reducing the frequency of the terminal device 101 actually calling the satellite communication module, mobile communication module or Wi-Fi module through the physical interface, and reducing the energy consumption of the terminal device 101 in providing the fuzzy positioning function.

[0258] It should be understood that after the first location information meets the preset conditions, the terminal device 101 actually executes the command or action of the first positioning request, and the first location information obtained is not directly fed back to the application that sent the first positioning request, but is stored in the positioning cache. Figure 5 The corresponding method further includes step 503:

[0259] When the location acquisition permission of the application is fuzzy positioning, and when the first location information meets the preset conditions, the updated first location information is fed back to the application.

[0260] The step of feeding the first location information back to the application may include: updating the first location information, storing the updated first location information, and feeding the stored first location information back to the application. Subsequent embodiments will describe this in detail.

[0261] Figure 6 This is a flow chart of a positioning method provided by another embodiment of the present application. Figure 6 As shown, this application Figure 5 In the illustrated embodiment, determining whether the first location information satisfies a preset condition in step 501 may include:

[0262] Step 601: Obtain the generation time of the first position information.

[0263] Optionally, to obtain the generation time of the first location information, the first location information stored in the terminal device 101 may be queried first.

[0264] Optionally, the terminal device 101 may access a storage area of ​​the terminal device, such as a positioning cache area storing the first location information, in response to a determination result that the location acquisition permission of the application is fuzzy positioning.

[0265] Optionally, the terminal device 101 accesses the positioning cache area to read data in the positioning cache area.

[0266] Optionally, the data in the positioning buffer may include first location information. The data in the positioning buffer may also include the time when the first location information was stored. The first location information is location information that at least meets the fuzzy positioning requirements. For example, it may be fuzzy location information obtained after obtaining precise location information and then applying a fuzzy algorithm, or it may be precise location information obtained previously. The fuzzy location information may include information such as longitude, latitude, altitude, location name, and the time when the location was generated.

[0267] Optionally, the first location information may be information such as longitude, latitude, and altitude that meets the fuzzy location requirement. For example, the first location information may be obtained by fuzzifying information such as longitude, latitude, and altitude in the current positioning information.

[0268] Optionally, the first location information may also be one or more of base station information, Wi-Fi information, and IP address that meet the fuzzy location requirement. For example, the first location information may be obtained by fuzzifying information such as base station information, Wi-Fi information, and IP address in the current positioning information.

[0269] Optionally, when the terminal device 101 reads the first location information in the positioning cache, it may record the current time. The storage duration may be the difference between the reading time and the time when the location is generated.

[0270] Step 602: Determine whether the difference between the generation time and the current time is greater than or equal to a preset time threshold.

[0271] When the difference between the generation time and the current time is less than the preset time threshold, the first location information does not meet the preset condition.

[0272] Optionally, when the difference between the generation time and the current time is less than a preset time threshold, the terminal device 101 may execute step 502 .

[0273] When the difference between the generation time and the current time is greater than or equal to the preset time threshold, the first location information meets the preset condition. When the difference between the generation time and the current time is greater than or equal to the preset time threshold, the terminal device 101 may execute step 503.

[0274] The positioning method provided by the embodiment of the present application uses the first location information stored in the terminal device 101 as the fuzzy location information returned by the application positioning request, which is used to reduce the terminal device 101's execution of the command or action of the positioning request, thereby reducing the energy consumption of the terminal device 101 in providing the fuzzy positioning function. However, in the above positioning method, the first location information may exist for a long time, and the user's terminal device 101 may move a long distance. At this time, there is a large error between the first location information and the terminal device 101 after movement, and it may not meet the requirements of fuzzy positioning. The embodiment of the present application uses the above positioning method to determine whether the first location information at the current moment meets the requirements of fuzzy positioning based on the comparison between the difference between the generation time of the first location information and the current moment and the preset time threshold. Compared with the terminal device 101 to ensure the requirements of fuzzy positioning by continuously obtaining location information, the number of times the location is obtained can be reduced, and the power consumption cost and computing cost of achieving fuzzy positioning can be reduced.

[0275] Optionally, the terminal device 101 may be in different current mobile states, and thus the position change is also different. Therefore, the terminal device 101 is pre-set with different preset time thresholds for the first position information corresponding to different mobile states. Figure 7 As shown, this application Figure 5 In the illustrated embodiment, before determining whether the difference between the generation time and the current time is greater than or equal to the preset time threshold in step 602, the following steps are further included:

[0276] Step 701: Acquire the mobility status of the terminal device 101.

[0277] Optionally, a sensor is provided in the terminal device 101. The sensor can be used to sense the movement state of the terminal device 101. For example, the sensor can be a gyroscope sensor, an air pressure sensor, an acceleration sensor, etc.

[0278] It can be understood that the gyroscope sensor is used to sense angular velocity and can perceive changes in the posture of the terminal device 101.

[0279] The acceleration sensor can measure the acceleration of the terminal device 101 and obtain the acceleration, cadence, etc. of the movement of the terminal device 101.

[0280] The air pressure sensor can measure air pressure, and the terminal device 101 can obtain the altitude through the air pressure sensor. When the altitude changes, the terminal device 101 may be in a moving state.

[0281] Optionally, information such as movement speed, movement acceleration, and movement direction can be calculated based on the data acquired by the sensor. The movement state of the terminal device 101 can be obtained based on the movement speed, movement acceleration, and movement direction.

[0282] Step 702 : Select a corresponding current preset time threshold according to the movement state of the terminal device 101 .

[0283] It can be understood that in the subsequent determination of whether the difference between the generation moment and the current moment is greater than or equal to the preset time threshold, it is specifically determined whether the difference between the generation moment and the current moment is greater than or equal to the current preset time threshold corresponding to the mobile state of the terminal device 101.

[0284] Optionally, the movement state of the terminal device 101 can be determined based on data sensed by sensors within the terminal device 101. The movement state of the terminal device 101 can include stationary, slow walking, fast walking, jogging, sprinting, cycling, riding in a car, etc. For example, the terminal device 101 can determine the movement state of the terminal device 101 based on an acceleration sensor and / or a gyroscope sensor.

[0285] Optionally, the preset time threshold corresponding to stationary state is greater than the preset time threshold corresponding to slow walking. The preset time threshold corresponding to slow walking is greater than the preset time threshold corresponding to brisk walking. The preset time threshold corresponding to brisk walking is greater than the preset time threshold corresponding to running. The preset time threshold corresponding to jogging is greater than the preset time threshold corresponding to sprinting. The preset time threshold corresponding to sprinting is greater than the preset time threshold corresponding to cycling. The preset time threshold corresponding to cycling is greater than the preset time threshold corresponding to riding a vehicle.

[0286] For example, when the terminal device 101 obtains that the moving speed of the terminal device 101 is less than the slow walking speed threshold, the moving state of the terminal device 101 is determined to be slow walking. The slow walking speed threshold may be 3.00 to 6.00 km / h.

[0287] For example, when the terminal device 101 obtains that the moving speed of the terminal device 101 is less than the fast walking speed threshold, the moving state of the terminal device 101 is determined to be fast walking. The fast walking speed threshold may be 6.10 to 8.00 km / h.

[0288] For example, when the terminal device 101 obtains that the moving speed of the terminal device 101 is less than the jogging moving speed threshold, the moving state of the terminal device 101 is determined to be jogging. The jogging moving speed threshold may be 8.10-10.00 km / h.

[0289] For example, when the terminal device 101 obtains that the moving speed of the terminal device 101 is less than the sprint moving speed threshold, the moving state of the terminal device 101 is determined to be sprinting. The sprint moving speed threshold may be 10.10-12.00 km / h.

[0290] Optionally, in the same movement state, movement states of different user types correspond to different update thresholds.

[0291] For example, the terminal device 101 may pre-store different preset time thresholds corresponding to the mobility states of different user types. The terminal device 101 may select the preset time threshold corresponding to the mobility state based on the user type to improve the accuracy of the preset time threshold setting and avoid the terminal device 101 from irrationally updating the first location information.

[0292] It is understandable that the terminal device 101 stores a preset time threshold table corresponding to preset time thresholds of different user types. The terminal device 101 can modify the preset time threshold in the preset time threshold table according to the type of the terminal device 101's mobility state.

[0293] Optionally, the user type may be an elderly person, a child, an adult, etc. The embodiments of the present application do not limit the user type.

[0294] Optionally, different user types may have different thresholds for determining movement status. For example, the slow walking speed threshold for the elderly may be 3.00 to 4.51 km / h, while the slow walking speed threshold for adults may be 4.52 to 6.00 km / h.

[0295] It should be understood that the brisk walking speed threshold for the elderly is different from that for adults. Similarly, the jogging speed threshold for the elderly is different from that for adults, the sprinting speed threshold for the elderly is different from that for adults, and the cycling speed threshold for the elderly is different from that for adults. Furthermore, the thresholds for determining movement status for children are different from those for adults and the elderly, and will not be further elaborated here.

[0296] The embodiment of the present application uses the above-mentioned positioning method and selects the corresponding current preset time threshold in combination with the current mobile state of the terminal device 101. It can reduce the frequency of the terminal device 101 updating the first location information while ensuring that the first location information meets the fuzzy positioning requirements, thereby reducing the number of times the terminal device 101 executes the positioning request command or action, and reducing the energy consumption of the terminal device 101 when providing the fuzzy positioning function.

[0297] Figure 8 This is a flow chart of a positioning method provided by another embodiment of the present application. Figure 8 As shown, this application Figures 5 to 7 In any of the embodiments shown, when the location acquisition permission of the application is fuzzy positioning and the first location information meets the preset conditions, step 503 of feeding back the updated first location information to the application may include:

[0298] Step 801: Acquire the second location information of the terminal device 101.

[0299] Optionally, the second location information is the location information currently obtained by the terminal device 101 that meets the fuzzy positioning requirements.

[0300] Exemplarily, the step of obtaining the second location information may include:

[0301] Step 8011: Acquire current positioning information, which may be at least one of current base station positioning information, current Wi-Fi positioning information, and current IP address positioning information.

[0302] Understandably, combined Figures 1 to 3 The terminal device 101 can use one or more positioning technologies including satellite positioning, base station positioning, Wi-Fi positioning, and IP address positioning to obtain the current positioning information of the terminal device 101.

[0303] Step 8012: Fuzzy the current positioning information to obtain the second position information of the terminal device 101.

[0304] Among them, the current positioning information is fuzzified, and differential privacy technology can be used to obtain the blurred positioning information. The embodiment of the present invention does not limit the specific method of obtaining the blurred positioning information, and will not be elaborated here.

[0305] Step 802: Acquire updated first location information according to the second location information.

[0306] Optionally, acquiring updated first location information according to the second location information may be changing the first location information to the second location information, or the second location information may overwrite the first location information.

[0307] Optionally, acquiring the updated first location information according to the second location information may also be pointing the address of the first location information to the address storing the second location information.

[0308] Step 803: Feedback the updated first location information to the application.

[0309] When updating the first location information, the embodiments of the present application can update the first location information by obtaining the current base station positioning information, the current Wi-Fi positioning information, and the current IP address positioning information, that is, positioning is performed through one or more technologies of base station positioning, Wi-Fi positioning, and IP address positioning. Satellite positioning with higher energy consumption can be converted into base station positioning, Wi-Fi positioning, or IP address positioning with lower energy consumption, further reducing the energy consumption of the terminal device 101 when providing the fuzzy positioning function.

[0310] The embodiment of the present invention provides that the first location information can be stored in the terminal device 101. When the application sends the first positioning request, the stored first location information can be fed back to the application. However, in actual operation, there are cases where the terminal device 101 does not store the first location information, such as the initialization case. Therefore, Figure 9 As shown, this application Figures 4 to 8 In any of the illustrated embodiments, when the location acquisition permission of the application is fuzzy positioning, step 402 feeds the first location information back to the application, further comprising:

[0311] Step 901: Determine whether the terminal device 101 stores first location information. If the first location information is stored, step 501 may be executed.

[0312] Optionally, when the terminal device 101 does not store the first location information, steps 801 to 803 may be executed.

[0313] Alternatively, as Figure 6 In the illustrated embodiment, step 601 may include step 901. When the terminal device 101 stores the first location information, step 602 is executed.

[0314] Optionally, when the terminal device 101 does not store the first location information, steps 801 to 803 may be executed.

[0315] The embodiment of the present application uses the above-mentioned positioning method to obtain the first location information through a positioning technology with low energy consumption such as base station positioning, Wi-Fi positioning or IP address positioning when the terminal device 101 does not store the first location information.

[0316] It should be understood that in this application, based on the fact that the number of times the terminal device 101 actually executes the command or action of the positioning request by setting preset conditions is reduced, thereby reducing the energy consumption when the terminal device 101 provides the fuzzy positioning function, the current positioning information obtained in steps 801 to 803 can also be obtained by using satellite positioning to obtain satellite positioning information, which can also reduce the number of times the terminal device 101 actually executes the command or action of the positioning request, thereby reducing the energy consumption when the terminal device 101 provides the fuzzy positioning function.

[0317] The embodiment of the present invention is based on the purpose of reducing power consumption. After receiving the first positioning request of the application, the content of the first positioning request can be modified, thereby changing the positioning mode requested in the first positioning request to another positioning mode to reduce power consumption. Figure 10 As shown, this application Figures 4 to 9 In any of the illustrated embodiments, after obtaining the first positioning request sent by the application of the terminal device 101 in step 401, the following steps are further included:

[0318] Step 1001: When the location acquisition permission of the application is not fuzzy positioning, the first positioning request sent by the application of the terminal device 101 is changed to a second positioning request, and the location information of the terminal device 101 is obtained according to the second positioning request.

[0319] Optionally, energy consumption of acquiring location information according to the second positioning request is lower than energy consumption of acquiring location information according to the first positioning request sent by the application.

[0320] It is understandable that when the location acquisition permission of the application is not fuzzy positioning, the terminal device 101 needs to feedback accurate location information to the application. The positioning method requested in the first positioning request sent by the application at this time may be a satellite positioning method with high energy consumption.

[0321] Optionally, the second positioning request may refer to the requested positioning method being one or more of base station positioning, Wi-Fi positioning, and IP address positioning. Exemplarily, the second positioning request may refer to obtaining one or more of base station positioning information, Wi-Fi positioning information, and IP address positioning information multiple times within a certain time range.

[0322] It is understandable that the energy consumption of obtaining location information using satellite positioning is greater than that of obtaining location information using base station positioning, Wi-Fi positioning, or IP address positioning. The energy consumption of obtaining location information using IP address positioning is less than that of obtaining location information using base station positioning or Wi-Fi positioning.

[0323] The embodiment of the present application uses the above-mentioned positioning method. When the location acquisition permission of the application is not fuzzy positioning, the energy consumption of the terminal device 101 when providing the positioning function can be reduced by converting the first positioning request with higher energy consumption into the second positioning request with lower energy consumption.

[0324] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0325] Figure 11 FIG. 1 is a schematic diagram of the structure of a terminal device 101 provided in one embodiment of this specification. Figure 11 As shown, the terminal device 101 may include: a storage module 111 , an acquisition module 112 and a positioning information feedback module 113 .

[0326] The storage module 111 is configured to store first location information. The first location information is the location information that the terminal device 101 has recently acquired and meets the fuzzy positioning requirement.

[0327] The acquisition module 112 is configured to obtain a first positioning request sent by an application of the terminal device 101 .

[0328] The positioning information feedback module 113 is configured to feed back the first position information to the application when the location acquisition permission of the application is fuzzy positioning.

[0329] Optionally, the terminal device 101 further includes:

[0330] The determination module is used to determine whether the first location information meets a preset condition and send the determination result to the positioning information feedback module 113.

[0331] Optionally, the positioning information feedback module 113 is specifically configured to:

[0332] When the location acquisition permission of the application is fuzzy positioning, and when the first location information does not meet the preset conditions, the first location information is fed back to the application.

[0333] Optionally, when the preset condition is that the difference between the time when the first location information is generated and the current time reaches a preset time threshold, the determination module is specifically configured to:

[0334] Obtaining a generation time of the first position information;

[0335] Determine whether the difference between the generation time and the current time is greater than or equal to a preset time threshold;

[0336] When the difference between the generation time and the current time is less than the preset time threshold, the first location information does not meet the preset condition;

[0337] When the difference between the generation time and the current time is greater than or equal to the preset time threshold, the first location information meets the preset condition.

[0338] Optionally, the terminal device 101 is pre-set with preset time thresholds for different first location information corresponding to different movement states. When the preset condition is that the difference between the generation time of the first location information and the current time reaches the preset time threshold, the determination module is specifically configured to:

[0339] Obtaining a generation time of the first position information;

[0340] Determine the current mobility state of the terminal device, and determine whether the difference between the generated time and the current time is greater than or equal to the current preset time threshold based on the current preset time threshold corresponding to the current mobility state;

[0341] When the difference between the generation time and the current time is less than the current preset time threshold, the first location information does not meet the preset condition;

[0342] When the difference between the generation time and the current time is greater than or equal to the current preset time threshold, the first location information meets the preset condition.

[0343] Optionally, when the preset condition is that the deviation between the location represented by the first location information and the current location of the terminal device reaches a preset distance threshold, the determination module is specifically configured to:

[0344] Get the current location of the terminal device;

[0345] Determining whether a deviation between the location represented by the first location information and the current location of the terminal device is greater than or equal to a preset distance threshold;

[0346] When the deviation between the position represented by the first position information and the current position of the terminal device is less than the preset distance threshold, the first position information does not meet the preset condition;

[0347] When the deviation between the position represented by the first position information and the current position of the terminal device is greater than or equal to a preset distance threshold, the first position information meets the preset condition.

[0348] Optionally, the positioning information feedback module 113 is further configured to:

[0349] When the location acquisition permission of the application is fuzzy positioning, and when the first location information meets the preset conditions,

[0350] Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets the fuzzy positioning requirement;

[0351] acquiring updated first location information according to the second location information;

[0352] The updated first position information is fed back to the application.

[0353] Optionally, the positioning information feedback module 113 is further configured to:

[0354] When the terminal device does not store the first location information, and when the location acquisition permission of the application is fuzzy positioning,

[0355] Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets the fuzzy positioning requirement;

[0356] acquiring updated first location information according to the second location information;

[0357] The updated first position information is fed back to the application.

[0358] Optionally, the positioning information feedback module 113 is further configured to:

[0359] When the location acquisition permission of the application is not fuzzy positioning, the first positioning request sent by the application of the terminal device 101 is changed to a second positioning request, and the location information of the terminal device is obtained based on the second positioning request, wherein the energy consumption of obtaining the location information based on the second positioning request is lower than the energy consumption of obtaining the location information based on the first positioning request sent by the application.

[0360] Optionally, the positioning information feedback module 113 involved in the embodiment of the present application can call a location manager, a phone manager, and a Wi-Fi manager.

[0361] Figure 12 This is a schematic diagram of the principle of the acquisition module processing the positioning request provided by an embodiment of this specification. Figure 12 After application 1 or application 2 sends a positioning request to the software system in the terminal device 101, the software system in the terminal device 101 can redirect the acquisition module 112 to obtain the positioning request sent by application 1 or application 2.

[0362] Understandably, Figure 12 The positioning request involved may be a first positioning request or a second positioning request.

[0363] Optionally, a redirection submodule is provided in the acquisition module 112. The redirection submodule can be used to notify the application program to call the positioning information feedback module 113 when sending a positioning request.

[0364] The acquisition module 112 of the embodiment of the present application can use the redirection submodule to enable the application or positioning SDK to call the positioning information feedback module 113 when sending a positioning request, instead of calling the location manager, phone manager or Wi-Fi manager.

[0365] Optionally, the acquisition module 112 may further include an interception submodule configured to prevent the application or positioning SDK from calling the location manager, phone manager, or Wi-Fi manager by intercepting the calling instruction when the application or positioning SDK sends a positioning request.

[0366] Figure 11 The terminal device 101 provided in the embodiment shown can be used to execute the present invention. Figures 4 to 10 The technical solution of the method embodiment shown, its implementation principle and technical effects can be further referred to the relevant description in the method embodiment.

[0367] Figure 13 This is a schematic diagram of the structure of a terminal device provided by an embodiment of this specification. Figure 13 As shown, the terminal device may include at least one processor; and at least one memory in communication with the processor, wherein: the memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the instructions of this specification. Figures 4 to 10 The embodiment shown provides a positioning method.

[0368] The terminal device may be a smart electronic device such as a smartphone, a tablet computer, or a laptop computer. This embodiment does not limit the form of the terminal device.

[0369] like Figure 13 As shown, the terminal device 101 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a sensor module 180, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, an acceleration sensor 180E, a fingerprint sensor 180H, a touch sensor 180K, etc.

[0370] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the terminal device 101. In other embodiments of the present application, the terminal device 101 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0371] 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 processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0372] 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.

[0373] The processor 110 may also include 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 is using in a loop.

[0374] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0375] It is understood that the interface connection relationship between the modules illustrated in the embodiment of the present invention is merely an illustrative illustration and does not constitute a structural limitation on the terminal device 101. In other embodiments of the present application, the terminal device 101 may also adopt a different interface connection method from the above embodiment, or a combination of multiple interface connection methods.

[0376] The wireless communication function of the terminal device 101 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.

[0377] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal device 101 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.

[0378] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the terminal device 101. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a 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. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0379] The modem 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- or 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 passed to the application processor. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.

[0380] 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 the terminal device 101. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0381] In some embodiments, antenna 1 of terminal device 101 is coupled to mobile communication module 150 , and antenna 2 is coupled to wireless communication module 160 , so that terminal device 101 can communicate with the network and other devices through wireless communication technology.

[0382] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device 101. The external memory card communicates with the processor 110 through the external memory interface 120 to implement data storage.

[0383] The internal memory 121 can be used to store computer executable program code, which includes instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function, etc. The data storage area can store data created during the use of the terminal device 101 (such as audio data, phone book, etc.). In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 101 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0384] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be located on display screen 194. There are many types of pressure sensors 180A, such as resistive, inductive, and capacitive. A capacitive pressure sensor can include at least two parallel plates made of conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Terminal device 101 determines the intensity of the pressure based on this change in capacitance. When a touch operation is applied to display screen 194, terminal device 101 detects the intensity of the touch operation based on pressure sensor 180A. Terminal device 101 can also calculate the location of the touch based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch location but with different touch operation intensities can correspond to different operation instructions. For example, when a touch operation with an intensity less than a first pressure threshold is applied to a short message application icon, an instruction to view short messages is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to a short message application icon, an instruction to create a new short message is executed.

[0385] The gyroscope sensor 180B can be used to determine the motion posture of the terminal device 101. In some embodiments, the angular velocity of the terminal device 101 around three axes (i.e., x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyroscope sensor 180B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal device 101 shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the terminal device 101 through reverse motion to achieve anti-shake. The gyroscope sensor 180B can also be used for navigation and somatosensory game scenes.

[0386] The air pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal device 101 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.

[0387] Accelerometer 180E can detect the magnitude of acceleration of terminal device 101 in all directions (generally three axes). It can also detect the magnitude and direction of gravity when terminal device 101 is stationary. It can also be used to identify the electronic device's posture, enabling applications such as switching between landscape and portrait modes and pedometers.

[0388] The fingerprint sensor 180H is used to collect fingerprints. The terminal device 101 can use the collected fingerprint characteristics to implement fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0389] The touch sensor 180K is also called a "touch device." The touch sensor 180K can be provided on the display screen 194. 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 applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 194. In other embodiments, the touch sensor 180K can also be provided on the surface of the terminal device 101, at a location different from that of the display screen 194.

[0390] The embodiment of the present application provides a non-transitory computer-readable storage medium, wherein the non-transitory computer-readable storage medium stores computer instructions, wherein the computer instructions enable the computer to execute the instructions of the present invention. Figures 4 to 10 The embodiment shown provides a positioning method.

[0391] The above-mentioned non-transitory computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM) or a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by an instruction execution system, device or device or used in combination with it.

[0392] Computer program code for carrying out the operations of this specification may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server.

[0393] In the description of the embodiments of the present invention, the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and features of different embodiments or examples without contradiction.

[0394] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of the technical features being referred to. Thus, a feature specified as "first" or "second" may explicitly or implicitly include at least one such feature. Throughout this specification, "plurality" means at least two, such as two or three, unless otherwise specifically defined.

[0395] The word "if," as used herein, may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to the determination" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)," depending on the context.

[0396] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

Claims

1. A positioning method for reducing power consumption, characterized in that: Applied to a terminal device, the terminal device pre-stores first location information, the first location information being the location information most recently acquired by the terminal device that meets fuzzy positioning requirements, the location information meeting the fuzzy positioning requirements being fuzzy location information obtained by fuzzifying the precise location information of the terminal device, the method comprising: Obtaining a first positioning request sent by an application of the terminal device, wherein the location acquisition permission of the application is one of fuzzy positioning for obtaining fuzzy location information and precise positioning for obtaining precise location information; When the location acquisition permission of the application is fuzzy positioning, the first location information is fed back to the application.

2. The method according to claim 1, characterized in that After obtaining the first positioning request sent by the application of the terminal device, the method further includes: Determining whether the first location information meets a preset condition; When the location acquisition permission of the application is fuzzy positioning, feeding back the first location information to the application includes: When the location acquisition permission of the application is fuzzy positioning, and when the first location information does not meet a preset condition, the first location information is fed back to the application.

3. The method according to claim 2, characterized in that The preset condition is that the difference between the generation time of the first position information and the current time reaches a preset time threshold; The determining whether the first location information meets a preset condition includes: Obtaining a generation time of the first position information; Determining whether the difference between the generation time and the current time is greater than or equal to the preset time threshold; When the difference between the generation time and the current time is less than the preset time threshold, the first location information does not meet the preset condition; When the difference between the generation time and the current time is greater than or equal to the preset time threshold, the first location information meets the preset condition.

4. The method according to claim 2, characterized in that The terminal device is pre-set with preset time thresholds for different first location information corresponding to different movement states. When the preset condition is that the difference between the time when the first location information is generated and the current time reaches the preset time threshold, determining whether the first location information meets the preset condition includes: Obtaining a generation time of the first position information; Determining a current mobility state of the terminal device, and determining, based on a current preset time threshold corresponding to the current mobility state, whether a difference between the generation time and the current time is greater than or equal to the current preset time threshold; When the difference between the generation time and the current time is less than the current preset time threshold, the first location information does not meet the preset condition; When the difference between the generation time and the current time is greater than or equal to the current preset time threshold, the first location information meets the preset condition.

5. The method according to claim 2, characterized in that The preset condition is that the deviation between the position represented by the first position information and the current position of the terminal device reaches a preset distance threshold; The determining whether the first location information meets a preset condition includes: Obtaining the current location of the terminal device; Determining whether a deviation between the location represented by the first location information and the current location of the terminal device is greater than or equal to the preset distance threshold; When the deviation between the position represented by the first position information and the current position of the terminal device is less than the preset distance threshold, the first position information does not meet the preset condition; When the deviation between the position represented by the first position information and the current position of the terminal device is greater than or equal to the preset distance threshold, the first position information meets the preset condition.

6. The method according to any one of claims 2 to 5, characterized in that: When the location acquisition permission of the application is fuzzy positioning and the first location information meets a preset condition, feeding back the first location information to the application includes: Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements; acquiring updated first location information according to the second location information; Feedback the updated first location information to the application.

7. The method according to claim 1, characterized in that When the terminal device does not store the first location information, and when the location acquisition permission of the application is fuzzy positioning, feeding back the first location information to the application includes: Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements; acquiring updated first location information according to the second location information; Feedback the updated first location information to the application.

8. The method according to claim 1 or 2 or 3 or 4 or 5 or 7, characterized in that When the location acquisition permission of the application is not fuzzy positioning, the method further includes: Change the first positioning request sent by the application of the terminal device to a second positioning request, and obtain the location information of the terminal device based on the second positioning request, wherein the energy consumption of obtaining the location information based on the second positioning request is lower than the energy consumption of obtaining the location information based on the first positioning request sent by the application.

9. A positioning method for reducing power consumption, characterized in that: Applied to a terminal device, the terminal device pre-stores first location information, the first location information being the location information most recently acquired by the terminal device that meets fuzzy positioning requirements, the location information meeting the fuzzy positioning requirements being fuzzy location information obtained by fuzzifying the precise location information of the terminal device, the method comprising: Determining a target application for sending a positioning request, wherein the location acquisition permission of the target application is one of fuzzy positioning for obtaining fuzzy location information and precise positioning for obtaining precise location information; Obtaining location access permission for the target application; When the location acquisition permission of the target application is fuzzy positioning, the first location information is fed back to the target application.

10. A terminal device, characterized in that: include: a storage module, configured to store first location information, where the first location information is the location information most recently acquired by the terminal device that meets the fuzzy positioning requirement, where the location information that meets the fuzzy positioning requirement is fuzzy location information obtained by fuzzifying the precise location information of the terminal device; An acquisition module, configured to acquire a first positioning request sent by an application of the terminal device, wherein the location acquisition permission of the application is one of fuzzy positioning of obtaining fuzzy location information and precise positioning of obtaining precise location information; The positioning information feedback module is used to feed back the first position information to the application when the location acquisition permission of the application is fuzzy positioning.

11. The terminal device according to claim 10, characterized in that The terminal device further includes a determination module, configured to determine whether the first location information meets a preset condition, and send a determination result to the positioning information feedback module; The positioning information feedback module is specifically used to: When the location acquisition permission of the application is fuzzy location, and when the first location information does not meet a preset condition, the first location information is fed back to the application.

12. The terminal device according to claim 11, characterized in that The preset condition is that the difference between the generation time of the first position information and the current time reaches a preset time threshold; The determining module is specifically configured to: Obtaining a generation time of the first position information; Determining whether the difference between the generation time and the current time is greater than or equal to a preset time threshold; When the difference between the generation time and the current time is less than the preset time threshold, the first location information does not meet the preset condition; When the difference between the generation time and the current time is greater than or equal to the preset time threshold, the first location information meets the preset condition.

13. The terminal device according to claim 11, characterized in that The terminal device is pre-set with preset time thresholds for different first location information corresponding to different movement states. When the preset condition is that the difference between the time when the first location information is generated and the current time reaches the preset time threshold, the determination module is specifically configured to: Obtaining a generation time of the first position information; Determining a current mobility state of the terminal device, and determining, based on a current preset time threshold corresponding to the current mobility state, whether a difference between the generation time and the current time is greater than or equal to the current preset time threshold; When the difference between the generation time and the current time is less than the current preset time threshold, the first location information does not meet the preset condition; When the difference between the generation time and the current time is greater than or equal to the current preset time threshold, the first location information meets the preset condition.

14. The terminal device according to any one of claims 11, characterized in that: The preset condition is that the deviation between the position represented by the first position information and the current position of the terminal device reaches a preset distance threshold; The determining module is specifically configured to: Obtaining the current location of the terminal device; Determining whether a deviation between the location represented by the first location information and the current location of the terminal device is greater than or equal to the preset distance threshold; When the deviation between the position represented by the first position information and the current position of the terminal device is less than the preset distance threshold, the first position information does not meet the preset condition; When the deviation between the position represented by the first position information and the current position of the terminal device is greater than or equal to the preset distance threshold, the first position information meets the preset condition.

15. The terminal device according to any one of claims 11 to 14, characterized in that: The positioning information feedback module is further used to: When the location acquisition permission of the application is fuzzy positioning, and when the first location information meets the preset conditions, Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements; acquiring updated first location information according to the second location information; Feedback the updated first location information to the application.

16. The terminal device according to claim 10, characterized in that The positioning information feedback module is further used to: When the terminal device does not store the first location information, and when the location acquisition permission of the application is fuzzy positioning, Acquire second location information of the terminal device, wherein the second location information is location information currently acquired by the terminal device that meets fuzzy positioning requirements; acquiring updated first location information according to the second location information; Feedback the updated first location information to the application.

17. The terminal device according to claim 10 or 11 or 12 or 13 or 14 or 16, characterized in that: The positioning information feedback module is further used to: When the location acquisition permission of the application is not fuzzy positioning, the first positioning request sent by the application of the terminal device is changed to a second positioning request, and the location information of the terminal device is obtained based on the second positioning request, wherein the energy consumption of obtaining the location information based on the second positioning request is lower than the energy consumption of obtaining the location information based on the first positioning request sent by the application.

18. A terminal device, characterized in that: include: at least one processor; as well as at least one memory in communication with the processor, wherein: The memory stores program instructions that can be executed by the processor, and the processor can execute the method according to any one of claims 1 to 9 by calling the program instructions.

19. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores computer instructions, and the computer instructions enable the computer to execute the method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Positioning method and apparatus

    CN107231678A