A Reverse Address Resolution Method for Multi-Coordinate System Fusion in Mobile Devices

By using a multi-coordinate system fusion-based reverse address resolution method, the problem of mismatch between GPS coordinate system and domestic map services was solved, achieving high-precision, high-availability, and cross-platform consistent positioning resolution, and reducing resource waste.

CN123075362APending Publication Date: 2026-11-10THE SECOND CONSTR OF CHINA CONSTR EIGHTH ENG DIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611024668.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-10
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

In existing technologies, the mismatch between the GPS coordinate system of mobile devices and the coordinate system of domestic map services leads to positioning deviations, the coordinate transformation algorithm has insufficient accuracy, the success rate of a single positioning source is low, there is a lack of fault tolerance and fallback mechanisms, repeated positioning requests waste resources, and the positioning behavior is inconsistent across platforms.

Method used

A multi-coordinate system fusion method is adopted, which achieves high-precision coordinate transformation and address resolution by means of adaptive coordinate system detection, multi-source localization fusion, hierarchical and downgraded address resolution and cache management, combined with sine series offset model, seven-parameter Bursa model and dual iterative convergence algorithm, thus shielding cross-platform differences.

Benefits of technology

It improves coordinate transformation accuracy to within ±1.5 meters, achieves a positioning success rate of 99%, reduces response time for repeated requests by 90%, and ensures consistent positioning and resolution across platforms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123075362A_ABST
    Figure CN123075362A_ABST
Patent Text Reader

Abstract

This invention discloses a reverse address resolution method for mobile terminal multi-coordinate system fusion, relating to the fields of mobile positioning, coordinate transformation, reverse address resolution, and IoT location services. The scheme involves: acquiring mobile terminal positioning data and performing coordinate system adaptive detection to determine if it is in the WGS-84 coordinate system or has been transformed; verifying, eliminating anomalies, dynamically adjusting weights, and weighted fusion of valid positioning sources from GPS, network base station, and Wi-Fi positioning; when transformation is required, obtaining the GCJ-02 target resolution coordinates based on Krasovsky ellipsoid parameters, a sinusoidal series migration model, a regional adaptive seven-parameter model, and a dual iterative convergence method; then performing downgraded address resolution based on the main map service, backup map service, local cache, and the last valid location, and managing the cache of the transformation and resolution results. The beneficial effects of this invention are: improved coordinate transformation accuracy and positioning availability, reduced redundant transformations and resolution requests, and improved consistency of cross-platform positioning resolution results.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of mobile positioning, coordinate transformation, reverse address parsing, and IoT location services, and particularly to a reverse address parsing method for mobile terminal multi-coordinate system fusion. Background Technology

[0002] With the rapid development of mobile applications and IoT technologies, location-based services (LBS) have become one of the core functions of mobile applications. In business scenarios such as intelligent operation and maintenance, inspection management, and work order scheduling, obtaining the user's current location and converting it into a readable address is a crucial foundational capability. The raw coordinates output by the GPS module of mobile devices use the WGS-84 (World Geodetic System 1984) globally unified coordinate system. However, according to the requirements of the State Bureau of Surveying and Mapping, map services within China must use the encrypted GCJ-02 (State Bureau of Surveying and Mapping 2002) coordinate system (commonly known as the "Mars coordinate system"). Furthermore, Baidu Maps has further encrypted this system, forming the BD-09 coordinate system.

[0003] Problems with existing technology: (1) Coordinate system mismatch leads to significant positioning deviation. The coordinate offset between WGS-84 and GCJ-02 can reach 100 to 500 meters within China, and the offset direction and magnitude in different areas exhibit nonlinear characteristics. Directly using the original GPS coordinates for address resolution in domestic map services will cause the positioning point to deviate significantly from the actual location, affecting the accuracy of address resolution.

[0004] (2) Existing coordinate transformation algorithms are not accurate enough. Currently, most of the publicly available WGS-84 to GCJ-02 transformation algorithms are based on empirical formulas and use simple linear offsets or low-order polynomial fitting. These methods have a transformation error of 2 to 10 meters in most areas, and the error can reach more than 15 meters in remote areas (such as Xinjiang, Tibet, and the northeastern border), which cannot meet the requirements of refined operation and maintenance services for sub-meter positioning accuracy.

[0005] (3) Low success rate of single positioning source. In weak GPS environments such as indoors, underground parking lots, and dense building complexes, the satellite positioning signal of mobile devices is severely attenuated, and the success rate of GPS positioning alone is only about 70%. Existing solutions usually report positioning failure directly, lacking multi-source fusion and intelligent degradation mechanisms, resulting in poor user experience.

[0006] (4) Address resolution lacks a fault-tolerant fallback mechanism. Existing reverse address resolution solutions typically rely on the API of a single map service provider. When the API becomes unavailable due to network fluctuations, quota limitations, or service failures, address resolution fails directly, lacking redundancy switching and tiered degradation strategies for multiple service providers.

[0007] (5) Repeated location requests lead to resource waste. In actual business scenarios (such as inspection check-in, location check-in), repeated location requests for the same location occur frequently within a short period of time. The existing solution executes the complete location-conversion-parsing process for each request, resulting in unnecessary API calls and power consumption, and the response time cannot meet the needs of real-time interaction.

[0008] (6) Inconsistent location behavior across platforms. There are differences in the behavior of location APIs, coordinate system returns, and permission management among platforms such as iOS, Android, and WeChat Mini Programs. Existing solutions are usually developed for a single platform and lack a unified cross-platform encapsulation, resulting in inconsistent location effects for the same business on different platforms.

[0009] Therefore, it is necessary to provide a reverse address parsing method for multi-coordinate system fusion on mobile devices to solve the above problems. Summary of the Invention

[0010] To achieve the aforementioned objectives and address the aforementioned technical problems, this invention provides a reverse address parsing method for multi-coordinate system fusion on mobile devices, to achieve the following goals: (1) High-precision coordinate transformation: The transformation accuracy from WGS-84 to GCJ-02 is improved to within ±1.5 meters (±0.5 meters in the core area) to meet the needs of refined business; (2) High-availability positioning acquisition: Through multi-source positioning fusion and hierarchical degradation strategy, the positioning success rate is improved from about 70% to more than 99%; (3) Efficient address resolution: Through the cache management mechanism, the response time of repeated location requests is reduced by more than 90%, and the number of map API calls is reduced by more than 90%; (4) Cross-platform consistency: Through unified interface encapsulation, the differences in positioning behavior of platforms such as iOS, Android, and WeChat Mini Programs are shielded, ensuring consistent positioning resolution effect across platforms.

[0011] To achieve the above objectives, this invention provides a reverse address parsing method for multi-coordinate system fusion on mobile devices, comprising the following steps: Step S1: Adaptive coordinate system detection, automatically identify the coordinate system type returned by the mobile device positioning, and determine whether it is the WGS-84 coordinate system or the converted GCJ-02 coordinate system; Step S2: Positioning processing, verifying the validity of location information from at least one of GPS positioning, network base station positioning, and WIFI positioning; when at least two valid positioning sources exist, performing positioning fusion on the location information from the at least two valid positioning sources, and outputting positioning coordinates through a precision-weighted average method; when only one valid positioning source exists, using the location information of that valid positioning source as the positioning coordinates; wherein, the positioning coordinates include WGS-84 positioning coordinates or converted coordinates; Step S3: Coordinate transformation. When the positioning coordinates are WGS-84 positioning coordinates and coordinate transformation is required, the WGS-84 positioning coordinates are converted into target analytical coordinates in the GCJ-02 coordinate system. The coordinate transformation uses Krasovsky ellipsoid parameters and includes calculating the initial offset based on a sinusoidal series migration model, performing spatial residual correction based on a regional adaptive seven-parameter model, and optimizing the transformation result based on a dual iterative convergence method. Step S4: Hierarchical and downgraded address resolution. Based on the target resolution coordinates, address resolution is performed sequentially through the main map service provider's reverse address resolution service, the backup map service provider's reverse address resolution service, local cache address matching, and the last valid location return. If the current level of resolution fails or the response times out, the next level is entered for resolution to obtain structured address information. Step S5: Cache management, the target parsed coordinates and the structured address information are stored and cached in a spatial grid, and the corresponding coordinate transformation results and / or address parsing results are returned in subsequent positioning requests based on the cache validity period and cache hit results.

[0012] The adaptive coordinate system detection in step S1 employs a multi-level decision-making strategy: The first level is geographic boundary determination. When the coordinates are located outside the legally defined surveying and mapping area of ​​China (longitude 72.004°~137.8347°, latitude 0.8293°~55.8271°), they are directly determined to be in the WGS-84 coordinate system without conversion. The second level is source label detection, which directly reads the coordinate system type label returned by the positioning API. The third level is offset feature determination, which calculates the residual through GCJ-02 encrypted inverse transformation. If the residual is significantly smaller than the direct offset, it is determined to be GCJ-02. The fourth level is landmark matching verification, which uses the precise WGS-84 coordinates of known landmarks for comparison and verification.

[0013] The sinusoidal series migration model in step S3 uses multi-frequency sinusoidal series expansions for both latitude and longitude migrations, including: polynomial terms to fit large-scale linear migration trends and nonlinear curvature effects, containing cross terms to describe the coupling effect of latitude and longitude migrations; and square root terms. This describes the decay characteristics of the offset growth rate in regions far from the reference point; multi-frequency sine terms, including... , High-frequency components, , Mid-frequency components, and , Low-frequency components are used to fit the periodic perturbations introduced by GCJ-02 encryption; and ellipsoidal projection correction converts the plane offset into spherical latitude and longitude increments through a latitude-dependent ellipsoidal curvature correction factor.

[0014] The seven-parameter Bursa model in step S3 uses region-adaptive parameters, dividing China into multiple regional grids of approximately 1°×1°, and assigning an independent set of seven parameters to each grid. These seven parameter sets include three translation parameters. , , Three rotation parameters , , A scaling factor The coordinates of the known control points in the region, WGS-84 and GCJ-02, were obtained by least-squares fitting.

[0015] The dual-iteration convergence method in step S3 includes: The initial offset calculated using the sinusoidal series offset model is used as the initial value for iteration. Perform a forward transformation based on the current offset estimate to obtain the current transformation estimate coordinates; Perform an approximate inverse transformation on the current transformed estimated coordinates to obtain the inverse calculated coordinates; Calculate the deviation between the inverse coordinates and the original WGS-84 coordinates, and correct the current offset estimate based on the deviation; Repeat the forward transformation, approximate inverse transformation, and deviation correction until the deviation between two adjacent iterations is less than the preset convergence threshold or the preset maximum number of iterations is reached.

[0016] Step S2 includes: The validity of the latitude and longitude, positioning accuracy, and acquisition time output by each positioning source is verified. When there is only one valid location source, the location information of that valid location source is returned directly. When there are at least two valid positioning sources, calculate the distance relationship between each valid positioning source and remove abnormal positioning sources whose distances from other valid positioning sources exceed a preset distance threshold. The basic weights of each valid positioning source are dynamically adjusted based on the positioning environment; The latitude and longitude coordinates of each effective positioning source are weighted and fused according to the inverse weight of positioning accuracy to obtain the positioning coordinates; The positioning environment includes at least one of the following: an open outdoor environment, an indoor environment, an urban canyon environment, and an underground environment.

[0017] Step S5 includes: Map the target's analytical coordinates to grid keys according to a preset grid size; The coordinate transformation results and the address resolution results are respectively associated with and stored with the grid key; Upon receiving a new location request, query whether there are valid cached results in the current grid and its adjacent grids; If a valid cached result exists, the corresponding coordinate transformation result and / or address resolution result will be returned directly. If the cached result exceeds the preset validity period or the cache capacity exceeds the preset capacity threshold, the cached data will be deleted according to the least recently used rule.

[0018] In step S4, the hierarchical and downgraded address resolution is triggered by the following conditions: the downgrade from level 1 to level 2 is triggered by the main map service provider's reverse address resolution service timeout or error return; the downgrade from level 2 to level 3 is triggered by the backup map service provider's reverse address resolution service timeout or error return; the downgrade from level 3 to level 4 is triggered by no matching result in the local cache; and level 4 returns a null value and prompts the user when there is no last valid location.

[0019] It also includes a cross-platform unified encapsulation layer, which uses the uni.getLocation unified interface of the UniApp framework to shield the differences in location APIs between iOS, Android and WeChat Mini Program platforms. Specifically, the iOS platform uses CLLocationManager.authorizationStatus to check location permissions, the Android platform uses LocationManager.isProviderEnabled to check GPS service status, and WeChat Mini Programs directly use the GCJ-02 mode of wx.getLocation to avoid coordinate transformation.

[0020] The beneficial effects of the technical solution provided by the embodiments of the present invention are as follows: (1) Improve coordinate transformation accuracy. This invention employs a three-layer progressive algorithm combining sinusoidal series offset, a seven-parameter Bursa model, and dual iterative convergence to progressively correct the transformation results from WGS-84 coordinates to GCJ-02 coordinates. Compared to the traditional method which typically has a transformation error of 2–10 meters, this invention can control the transformation error within ±1.5 meters; in core areas, such as urban areas in central and eastern China, the transformation error can be controlled within ±0.5 meters, thus meeting the positioning accuracy requirements of business scenarios such as inspection check-in, work order positioning, and location check-in. Specifically, in core areas, the transformation error of the traditional method is typically 2–5 meters, while this invention can control it within ±0.3–0.6 meters; in remote areas, the transformation error of the traditional method is typically 10–15 meters, while this invention can control it within ±0.8–1.5 meters; and on average nationwide, the transformation error of the traditional method is typically 5–8 meters, while this invention can control it within approximately ±0.7 meters.

[0021] (2) Improved Positioning Availability. This invention achieves usable location results in various positioning environments through multi-source positioning fusion of GPS, network base station, and WIFI positioning. Compared to the approximately 70% success rate of GPS positioning alone, this invention can increase the success rate to over 99%. In weak GPS environments such as indoors, underground parking lots, and urban canyons, even if the GPS positioning signal is weak or unavailable, the system can still return usable location information based on network base station positioning and / or WIFI positioning, reducing positioning failures caused by the failure of a single positioning source.

[0022] (3) Improved address resolution fault tolerance. This invention adopts a tiered and degraded address resolution strategy, which can return usable results under different abnormal conditions. When the main map service interface fails, times out, or becomes unavailable, the system automatically switches to the backup map service; when the network is unavailable or external map services cannot be called, the system uses the cached address as the resolution result; when positioning completely fails or the cached address is unavailable, the system returns the last valid location information. Thus, this invention can improve the fault tolerance of the reverse address resolution process and avoid business process interruption due to a single map service failure, network anomaly, or positioning failure.

[0023] (4) Improve caching performance. This invention uses a spatial grid caching mechanism to manage the caching of coordinate transformation results and address resolution results. In scenarios with repeated location requests, the system can prioritize hitting cached results, thereby reducing repeated coordinate transformations and repeated map service calls. Compared to re-executing location, transformation, and address resolution each time, this invention can reduce the response time of repeated requests by more than 90%, for example, from 500-2000 milliseconds to less than 50 milliseconds; at the same time, the number of map service interface calls can be reduced by more than 90%, and the cache hit rate can reach more than 90%, which is especially suitable for business scenarios with a large number of repeated requests for the same location in a short period of time, such as inspection check-in, location attendance, and work order filling.

[0024] (5) Improve cross-platform consistency. This invention uses a unified interface encapsulation to shield the differences in positioning interfaces, coordinate system return types, and permission management among platforms such as iOS, Android, and WeChat Mini Programs. This allows different platforms to use the same coordinate transformation algorithm, the same address resolution and degradation strategy, and return structured address information in a consistent format. Therefore, this invention can ensure that the positioning resolution results of the same service are consistent across different mobile platforms, reducing the difficulty of cross-platform adaptation. Attached Figure Description

[0025] Figure 1 This is an overall flowchart of the reverse address parsing method for mobile terminal multi-coordinate system fusion according to an embodiment of the present invention.

[0026] Figure 2 This is a complete flowchart of the conversion from WGS-84 coordinates to GCJ-02 coordinates according to an embodiment of the present invention.

[0027] Figure 3 This is an overall system architecture diagram of an embodiment of the present invention.

[0028] Figure 4 This is a flowchart of the coordinate transformation engine according to an embodiment of the present invention.

[0029] Figure 5 This is a flowchart of the multi-source localization fusion process according to an embodiment of the present invention.

[0030] Figure 6 This is a flowchart illustrating the hierarchical and downgraded address resolution process according to an embodiment of the present invention.

[0031] Figure 7 This is a flowchart of the coordinate caching mechanism in an embodiment of the present invention. Detailed Implementation

[0032] The present invention will be further described below with reference to embodiments. It should be understood that the following embodiments are for illustrative purposes only and are not intended to limit the scope of protection of the present invention. Where there is no conflict, the technical features in the following embodiments can be combined with each other.

[0033] Example 1: To achieve the above-mentioned objectives, the reverse address parsing method of the present invention adopts a layered processing architecture, and the overall processing flow is as follows: Figure 1 As shown.

[0034] Step 1: Coordinate System Adaptive Detection (1) Detection principle: Different devices and platforms return coordinate system types that are inconsistent. For example: 1) Direct GPS hardware output: WGS-84 coordinate system; 2) WeChat Mini Program wx.getLocation({type: "gcj02"}): has been converted to GCJ-02; 3) UniApp uni.getLocation(): Returns WGS-84 by default; 4) Amap SDK location result: GCJ-02; To avoid deviations caused by inconsistencies in coordinate systems, this invention designs an adaptive coordinate system detection mechanism that automatically determines the coordinate system type of the input coordinates and performs the transformation only when necessary.

[0035] (2) Detection method The adaptive detection function employs a multi-level decision-making strategy to automatically determine whether the input coordinates belong to the WGS-84 coordinate system or the GCJ-02 coordinate system, and decide whether coordinate transformation is required.

[0036] Input longitude ,latitude Optional configuration parameters (including sourceType), output coordinate system type (coordinateType), and whether transformation is required (needTransform) are as follows: 1) First level – Geographic boundary determination: Determine the input coordinates (longitude) ,latitude ) Whether it is located outside the legally designated surveying and mapping area in China. If the coordinates are not within China, they are directly determined to be in the WGS-84 coordinate system, and no conversion is required.

[0037] 2) Second level – Source tag detection: If the caller has explicitly specified the coordinate system type (sourceType) in the parameters, then the specified type will be used directly. If GCJ-02 is specified, no conversion is required; if WGS-84 is specified, conversion is required.

[0038] 3) Third Level – Offset Feature Determination: Call the offset feature determination sub-function to calculate the offset feature and confidence level of the coordinate. If the confidence level is greater than 0.8, the determination result is adopted; if the determination is WGS-84, conversion is required; if the determination is GCJ-02, no conversion is required.

[0039] <1> Offset Feature Determination Subfunction: Utilizing the non-linear characteristics of GCJ-02 encrypted offsets, this function determines whether the current coordinates have been encrypted using GCJ-02. The specific steps are as follows: Step 1: Calculate the expected GCJ-02 offset of this location under the WGS-84 assumption (call the offset calculation sub-function) to obtain the longitude offset. and latitude offset .

[0040] Step 2: Convert the offset from angle to distance (multiply by an approximation factor of 111,000 meters per degree). Calculate the Euclidean norm of the offset distance:

[0041] in, This represents the calculated actual offset distance, in meters. This is the longitude offset; This represents the latitude offset; the coefficient 111000 is an approximate conversion constant for converting latitude and longitude degrees to actual ground distances (meters) (i.e., each degree of latitude and longitude near the equator is approximately 111 km).

[0042] Step 3: Determine if the offset distance is within the characteristic range of GCJ-02 (80-600 meters). If it is within this range, perform reverse verification: <1.1> Subtract the expected offset from the current coordinates to obtain the inverse transformed coordinates:

[0043]

[0044] in, This represents the longitude estimate after the inverse transformation; This represents the latitude estimate after the inverse transformation; and These are the current longitude and latitude coordinates, respectively. and These are the corresponding longitude and latitude offsets, respectively.

[0045] <1.2> Calculate the expected offset again for the inverse transformation coordinates. <1.3> Calculate the residual distance between two offsets:

[0046] in: This represents the calculated actual residual distance (unit: meters). and These are the longitude and latitude offsets obtained by inverse calculation using the inverse transformation function, respectively. and These are the longitude and latitude offsets calculated within the current iteration period, respectively; the coefficient 111000 is an approximate conversion constant for converting latitude and longitude degrees into actual ground distances (meters).

[0047] <1.4> If the residual distance is less than 30% of the original offset distance (i.e. This indicates that the current coordinates already contain GCJ-02 offset features, and are therefore determined to be in the GCJ-02 coordinate system with a confidence level of 0.9.

[0048] Step 4: If the above conditions are not met, the default judgment is WGS-84 coordinate system with a confidence level of 0.6.

[0049] <2> The expected offset calculation sub-function for GCJ-02 calculates the expected offset from WGS-84 to GCJ-02 at a given coordinate based on the Krasovsky ellipsoid parameters and the multi-frequency sinusoidal series model. Formula description: <2.1> Basic ellipsoid parameters: semi-major axis The value is 6378245 meters; the square of the first eccentricity. The value is 0.00669342162296594323; <2.2> Reference offset (relative to the approximate geographic center of the domestic region):

[0050]

[0051] in: This indicates the current longitude offset relative to the reference point; This indicates the latitude offset of the current latitude relative to the reference point; The input is the current raw longitude coordinates; The input is the current raw latitude coordinates; <2.3> Latitude Offset Calculation:

[0052] in: This represents the calculated latitude offset; and These represent the coordinate offsets of the current latitude and longitude relative to the reference point; It is a sine function; Pi is a constant.

[0053] <2.4> Longitude offset Calculation:

[0054] in: This represents the calculated longitude offset; and These represent the coordinate offsets of the current latitude and longitude relative to the reference point; It is a sine function; Pi is a constant.

[0055] <2.5> Ellipsoidal projection correction:

[0056]

[0057]

[0058]

[0059]

[0060]

[0061] <2.6> Output:

[0062] in, The input is the current latitude coordinate; Pi is the mathematical constant of a circle. The semi-major axis of the preset encrypted reference ellipsoid is explicitly set to 6,378,245 meters in this embodiment. The first eccentricity square of the preset encrypted reference ellipsoid is explicitly set to 0.00669342162296594323 in this embodiment.

[0063] <2.7> Formula Design Principles: polynomial terms ( , , (etc.) Fitting large-scale linear shift trends and nonlinear curvature effects, cross terms Describe the coupling effect of latitude and longitude offset; The term describes the decay characteristics of the offset growth rate in regions far from the reference point; the sinusoidal term employs a multi-frequency design: high frequency... , Describes local fine-grained migration; intermediate frequency , Describes medium-scale migration; low frequency , Describes large-scale migration trends; coefficients The amplitude of the sinusoidal terms at each frequency is normalized and adjusted.

[0064] 4) Level Four – Landmark Matching Verification: If the third-level confidence level is insufficient, the landmark matching verification sub-function is invoked. If the confidence level is greater than 0.7, the judgment result is adopted.

[0065] <3> Landmark matching and verification sub-function: Using pre-defined known landmark WGS-84 coordinates and their corresponding GCJ-02 coordinates, the coordinate system type of the input coordinates is determined by distance comparison. The specific steps are as follows: Step 1: Establish a landmark database. Pre-set several typical landmark WGS-84 and GCJ-02 coordinate pairs, for example: Shanghai Oriental Pearl Tower: WGS-84 (121.4934, 31.2378), GCJ-02 (121.4997, 31.2397); Guangzhou Tower: WGS-84 (113.3120, 23.1076), GCJ-02 (113.3183, 23.1095); more landmarks can be added as needed for different regions.

[0066] Step 2: Find the nearest landmark. Traverse the landmark database, use the Haversine distance formula to calculate the distance between the input coordinates and the WGS-84 coordinates of each landmark, and select the landmark with the smallest distance as the reference.

[0067] Step 3: Validity check. If the nearest landmark is more than 50 kilometers away, it is considered that there is no sufficiently close reference landmark, and the decision is returned to WGS-84 with a confidence level of 0.3.

[0068] Step 4: Coordinate system type comparison. Calculate the distance from the input coordinates to the nearest landmark's WGS-84 coordinates. Distance to the coordinates of the nearest landmark GCJ-02 ;like If the input coordinates are closer to the GCJ-02 coordinates of the landmark, then it is determined to be GCJ-02, with a confidence level of 0.85; if If the input coordinates are closer to the landmark's WGS-84 coordinates, then it is determined to be WGS-84 with a confidence level of 0.85; otherwise, it cannot be determined and is determined to be WGS-84 by default with a confidence level of 0.5.

[0069] <4> Haversine distance formula: Calculates the great circle distance (in meters) between two points on the Earth's surface at latitude and longitude coordinates; assuming the Earth's average radius is: Given two points and First, convert the angle to radians:

[0070]

[0071] Calculate intermediate quantities :

[0072] Calculate the great circle distance:

[0073] Output This is the distance (in meters) between two points on the ground.

[0074] 5) Safety net strategy: If none of the above judgments can determine the coordinate system type, the default judgment is WGS-84 coordinate system and a transformation is performed (a safety strategy, it is better to perform more transformations than to omit any).

[0075] (3) Anti-duplication conversion mechanism To prevent the same coordinate from being converted from WGS-84 to GCJ-02 multiple times (each repeated conversion will accumulate offset error), the system marks the coordinate as "converted" after the conversion is completed. Subsequent modules will skip the conversion step directly upon detecting this mark.

[0076] Step 2: Multi-source localization fusion (1) Converged architecture: There are three main sources of location information for mobile devices: 1) GPS positioning: Location is obtained through GPS satellite signals, with an accuracy of typically 5-15 meters (outdoors), but greatly affected by the environment. 2) Network positioning (base station positioning): Location is obtained through triangulation of mobile base stations, with an accuracy of typically 100-500 meters, but still usable indoors and underground. 3) Wi-Fi positioning: Location is obtained by matching the MAC address of a Wi-Fi hotspot with a location database, with an accuracy of typically 20-50 meters, suitable for indoor scenarios.

[0077] This invention designs a multi-source positioning fusion algorithm based on precision weighting, which fuses information from three positioning sources to obtain a more accurate and reliable location estimate than that from a single source.

[0078] (2) Weighted fusion algorithm The basic fusion uses a precision-inverse weighted formula:

[0079]

[0080] in: , The latitude and longitude of a location source; For the first The base weights of each location source are (GPS: 0.6, Network: 0.3, WIFI: 0.1). For the first The positioning accuracy (in meters) reported by each positioning source.

[0081] Multi-source localization fusion combined with dynamic weight adjustment is implemented as follows: <1> Multi-source positioning fusion function: It performs precision-weighted fusion of the results from three positioning sources: GPS positioning, network base station positioning, and WIFI positioning, and outputs a more accurate and reliable fused location estimate than that from a single source.

[0082] Basic weight configuration: GPS basic weight: 0.6, network base station basic weight: 0.3, WIFI basic weight: 0.1; Step 1 – Data Validation: Filter the input location source array, removing invalid data with empty latitude and longitude coordinates or negative positioning accuracy. If there is no valid location source, return an empty value; if there is only one valid location source, directly return the coordinates of that source.

[0083] Step 2 – Outlier Removal: Call the outlier removal sub-function to remove outlier data points that deviate significantly from other location sources.

[0084] Step 3 – Dynamic Weight Calculation: Call the dynamic weight calculation sub-function to dynamically adjust the weights of each location source based on the current environmental conditions (indoor / outdoor, GPS signal strength, whether it is an urban canyon, whether it is underground, etc.).

[0085] As one implementation method, the basic weights of the GPS positioning source, network base station positioning source, and WIFI positioning source can be set to 0.6, 0.3, and 0.1, respectively. During dynamic weight adjustment, the system can adjust the above basic weights according to the positioning environment. In an open outdoor environment, when the GPS positioning source is available and the GPS positioning accuracy is less than 20 meters, the weight of the GPS positioning source can be adjusted to 0.80, the weight of the network base station positioning source to 0.15, and the weight of the WIFI positioning source to 0.05; in an indoor environment or when the GPS signal is weak but the WIFI positioning source is available, the weight of the WIFI positioning source can be adjusted to 0.50, the weight of the network base station positioning source to 0.30, and the weight of the GPS positioning source can be adjusted to 0.20 when the GPS positioning source is available, otherwise the weight of the GPS positioning source can be adjusted to 0; in an urban canyon environment, when the GPS positioning accuracy is high... At a distance of 50 meters, the weight of the GPS positioning source can be adjusted to 0.30, and the weight of the network base station positioning source can be adjusted to 0.40. If the Wi-Fi positioning source is available, its weight can be adjusted to 0.30; otherwise, its weight can be adjusted to 0. In underground environments or when the GPS positioning source is unavailable, the weight of the GPS positioning source can be adjusted to 0. When both the Wi-Fi and network base station positioning sources are available, the weight of the Wi-Fi positioning source can be adjusted to 0.60, and the weight of the network base station positioning source can be adjusted to 0.40. When only the network base station positioning source is available, its weight can be adjusted to 1.00. After these weight adjustments, the system normalizes the weights of each positioning source so that the sum of their weights is 1. In practical applications, the base weights and dynamically adjusted weights of each positioning source can be adjusted according to the positioning environment, positioning accuracy, signal strength, and service requirements.

[0086] Step Four – Precision Inverse Weighted Fusion: For each valid location source, calculate its final weight. :

[0087] in: Indicates the first The final physical participation weight of each location source. Indicates the system is the first The inherent dynamic base weights assigned to each location source. For the first The estimated positioning accuracy (in meters) reported in real time by each positioning source. Since this value is inversely proportional to the actual accuracy (a smaller value indicates higher accuracy), its reciprocal is calculated... This enables weight gain amplification of high-precision sources.

[0088] The formula for calculating the merged latitude and longitude: The system uses the full probability weighted average formula to normalize and eliminate hidden surface areas on the coordinates of all participating positioning sources, and calculates the high-confidence latitude and longitude center coordinates after fusion. :

[0089]

[0090] in Right now This represents the total number of spatial positioning sources that actually participate in multi-source fusion within the current calculation cycle.

[0091] Step 5 – Fusion Accuracy Estimation: Call the fusion accuracy estimation sub-function. Taking into account the covariance matrix of errors from each source and the final weight distribution, the overall estimation accuracy of the fused center coordinates is calculated:

[0092] Algorithm output structure:

[0093] <2> Outlier Removal Subfunction: Before weighted fusion, outlier location sources whose distances from all other location sources exceed a threshold are removed, which can effectively prevent deviations in fusion results caused by the failure or interference of a certain location source.

[0094] As one implementation method, during the outlier removal process, the system can set a preset distance threshold of 500 meters for anomaly detection. For each valid location source, the system calculates the distance between that location source and all other valid location sources. When the distance between that location source and all other valid location sources exceeds 500 meters, the location source is identified as an outlier and removed. If no valid location source exists after removal, the system can sort each location source according to its average distance to other location sources from smallest to largest, retaining the location source with the smallest average distance to ensure that subsequent positioning processes still have at least one usable location source. In practical applications, the preset distance threshold can be adjusted according to the positioning scenario, location source accuracy, and allowable error in the service.

[0095] The specific logic is as follows: If the number of location sources does not exceed two, outlier detection cannot be performed, and all location sources are returned directly. The outlier detection threshold is set to 500 meters.

[0096] For each location source, perform the following calculation: <2.1> Calculate the distance between this location source and all other location sources; <2.2> Calculate the average value of these distances, avgDist; <2.3> Determine whether all distances exceed the 500-meter threshold (allExceed flag); Removal rule: Mark the location source where allExceed is true as an outlier and remove it.

[0097] Safety baseline: If no location source remains after removal (all sources are abnormal to each other), then sort by average distance from smallest to largest, and retain the location source with the smallest average distance (i.e. the one closest to other sources) to ensure that at least one location source participates in subsequent fusion.

[0098] <3> Dynamic weight calculation sub-function: dynamically adjusts the basic weights of the three positioning sources based on the current positioning environment conditions.

[0099] Using the base weights (GPS: 0.6, Network: 0.3, WIFI: 0.1) as initial values, the weights are adjusted for the following four scenarios based on environmental information: Scenario 1: Outdoor open environment (not indoors, GPS available, and GPS accuracy <20 meters): GPS weight increased to 0.80; network weight decreased to 0.15; WIFI weight decreased to 0.05; Reason: GPS signal quality is high and should be used as the primary positioning source.

[0100] Scenario 2: Indoor environment or weak GPS signal (isIndoor is true or gpsSignalStrength is "weak", and WIFI is available): The weight of WIFI is increased to 0.50; the weight of network remains at 0.30; the weight of GPS is reduced to 0.20 (if GPS is available), otherwise it is 0; the reason is that indoor GPS signal attenuation is severe, and WIFI positioning accuracy is better.

[0101] Scenario 3: Urban canyon environment (isUrbanCanyon is true and GPS accuracy > 50 meters): GPS weight reduced to 0.30; network weight increased to 0.40; WIFI weight is 0.30 (if available), otherwise 0; Reason: High-rise building reflections cause severe GPS multipath effect.

[0102] Scenario 4: Underground parking lot or GPS unavailable (isUnderground is true or no GPS): GPS weight is set to 0; if both WIFI and network are available: WIFI weight 0.60, network weight 0.40; if only network is available: network weight 1.00; reason: GPS is completely unavailable in underground environments.

[0103] Normalization: After adjusting the weights above, the sum of all weights is normalized to 1 to ensure that the sum of all weight values ​​is always equal to 1.

[0104] <4> Fusion accuracy estimation sub-function: Estimates the overall positioning accuracy after multi-source positioning fusion. Step 1: Calculate the weighted average accuracy; The system first introduces the final weights of each positioning source, performs weighted smoothing and superposition of the accuracy indicators of each source, and calculates the multi-source basic weighted average accuracy value. :

[0105] Step 2: Calculate the multi-source fusion accuracy gain coefficient; To reflect the spatial geometric gain effect brought about by distributed multi-source joint positioning, the system introduces a statistical error convergence formula to calculate the multi-source fusion accuracy gain coefficient. :

[0106] This coefficient reflects the spatial gain effect of multi-source fusion: as the number of independent localization sources participating in the fusion increases... The increase in precision gain coefficient The nonlinear monotonically decreasing trend indicates that the uncertainty range after fusion is continuously reduced and the fusion accuracy is improved.

[0107] Step 3: Calculate the final fusion accuracy; the system couples the weighted average accuracy with the accuracy gain coefficient through a product, and then uses the maximum value operator. Explicitly set an absolute physical lower bound for the system's convergence accuracy to prevent overly optimistic and irrational convergence estimates due to the superposition of multiple sources:

[0108] The constant 5 represents the system's preset hard lower limit for the highest gain of fusion accuracy (i.e., limiting the final estimation accuracy to no less than 5m to ensure the robustness and reliability of the positioning results within the engineering defense boundary).

[0109] (4) Fusion effect After multi-source localization fusion: Location success rate: Increased from approximately 70% with a single GPS to over 99% (results can be returned as long as any location source is available); Positioning accuracy: When GPS is available, the fusion accuracy is better than GPS alone (because it incorporates multipath correction information from auxiliary positioning sources); when GPS is unavailable, the fusion accuracy is better than single network or Wi-Fi positioning. Positioning stability: Reduces positioning fluctuations and makes position output smoother; Step 3: High-precision coordinate transformation engine (core) The coordinate transformation engine of this invention adopts a three-layer progressive algorithm structure, which gradually improves the transformation accuracy from coarse to fine.

[0110] (1) First layer: Sine series migration based on Krasovsky ellipsoid: 1) Basic ellipsoid parameters: This invention uses the Krasovsky ellipsoid (Krasovsky 1940) as the basic reference ellipsoid, with the following parameters: semi-major axis: First eccentricity squared: ; The Krasovsky ellipsoid was chosen because the encryption algorithm for the GCJ-02 coordinate system is designed based on the parameters of this ellipsoid, and using this ellipsoid can guarantee the theoretical consistency of the offset calculation.

[0111] 2) Sine series shift model Using the approximate geographical center of the domestic region (105.0° longitude, 35.0° latitude) as the reference origin, the offsets in the longitude and latitude directions are expanded using multi-frequency sine series: Latitude offset calculation formula (transformLat):

[0112] Longitude offset calculation formula (transformLon):

[0113] in, (longitude offset relative to the reference point) (Latitude offset relative to the reference point).

[0114] polynomial terms (such as) , , ): Fitting large-scale linear shift trends and nonlinear curvature effects. Among them, the cross term... The coupling effect of latitude and longitude offset is described.

[0115] Item: Describes the decay characteristics of the offset growth rate in regions far from the reference point.

[0116] Sine term: Fitting the periodic perturbation introduced by GCJ-02 encryption.

[0117] Multi-frequency design adopted: , High-frequency components describe local fine-grained offsets; , : Mid-frequency component, describing medium-scale migration; , Low-frequency components describe large-scale migration trends; coefficients The amplitude of the sinusoidal terms at each frequency is normalized to ensure a balanced contribution from different frequency components.

[0118] 3) Ellipsoidal projection correction When converting the above planar offset into spherical latitude and longitude increments, the effect of ellipsoid curvature must be considered:

[0119]

[0120]

[0121]

[0122]

[0123]

[0124]

[0125]

[0126] in, This is a latitude-dependent ellipsoid curvature correction factor, reflecting the spherical geometric characteristics where the higher the latitude, the smaller the radius of the longitude circle.

[0127] (2) Second layer: Improved seven-parameter Bursa model: While the sinusoidal series migration model provides good basic transformation accuracy globally, residuals still exist in local areas (especially in regions with complex terrain and strong migration nonlinearity). To further improve accuracy, this invention introduces an improved seven-parameter Bursa-Wolf model for spatial residual correction based on the sinusoidal series migration.

[0128] 1) Classical seven-parameter Bursa model: The classic Bursa model describes the affine transformation relationship between two geocentric coordinate systems:

[0129]

[0130]

[0131] in:( , , ( ) represents WGS-84 spatial rectangular coordinates; , , () represents the GCJ-02 spatial rectangular coordinates; , , There are three translation parameters; , , There are three rotation parameters; is the scale factor.

[0132] 2) Improvements to the present invention This invention makes the following improvements to the classic Bursa model: 2.1) Regional Adaptive Parameters: The classic Bursa model uses a globally uniform seven-parameter set, while this invention divides China into multiple regional grids (each approximately 1° × 1°), and assigns an independent set of seven parameters to each grid. The regional parameters are obtained by least-squares fitting of the WGS-84 and GCJ-02 coordinates of known control points within the region.

[0133] 2.2) Nonlinear residual compensation: The output of the Bursa model is used as the initial correction value, and the residual terms of the sinusoidal series shift are superimposed to form a combined correction model:

[0134] in, , These are the weighting coefficients. This is the offset of the sine series. This represents the regional residual compensation value.

[0135] 2.3) Coordinate Forward and Inverse Calculation Iteration: Since the encryption process of GCJ-02 is nonlinear, directly applying the Bursa model will result in theoretical deviations. This invention adopts an iterative strategy of "forward calculation-inverse calculation-correction". In each iteration: the current estimated value is forward-applied to the Bursa transformation; the deviation between the transformation result and the target coordinates is calculated; and the seven parameters are corrected in reverse based on the deviation.

[0136] 3) Complete implementation logic of the seven-parameter Bursa model: <1> Bursa model residual correction function: Based on the sinusoidal series offset, the correction increment of the seven-parameter Bursa model and regional residual compensation are superimposed to form a combined correction model.

[0137] Input: WGS-84 longitude ,latitude First-level sine series offset and Output: Corrected GCJ-02 coordinates .

[0138] The specific steps are as follows: Step 1: Call the "Region Seven Parameter Acquisition Sub-function" to obtain the set of seven parameters for the current region based on the input coordinates:

[0139] Step 2: Call the "Latitude and Longitude to Spatial Rectangular Coordinates" subfunction to convert WGS-84 latitude and longitude to spatial rectangular coordinates:

[0140] Step 3: Call the "Seven-parameter Bursa Space Transformation Subfunction" to perform a seven-parameter affine transformation on the spatial rectangular coordinates, obtaining the transformed spatial rectangular coordinates. :

[0141] Step 4: Call the "Spatial Rectangular Coordinates to Latitude and Longitude Conversion Subfunction" to convert the transformed spatial rectangular coordinates back to latitude and longitude:

[0142] Step 5: Calculate the latitude and longitude increments generated by the Bursa transform:

[0143]

[0144] Step Six: Nonlinear Residual Compensation (Combined Correction Model), Setting Weighting Coefficients (Bursa weight) (Residual compensation weight): Regional residual compensation value:

[0145]

[0146] Final offset of the combination:

[0147]

[0148] Output the final corrected coordinates: Final longitude ; Final latitude ; General formula for combined correction model:

[0149] in: This represents the total offset vector of the combined space at the final output of the system. This represents the offset vector of the first-layer base plane calculated by the multi-frequency sinusoidal series model. This represents the spatial three-dimensional affine increment vector obtained by solving the seven-parameter Bursa model transformation. This represents the feature vector for compensating for the inhomogeneity of the introduced regional local topological distortion.

[0150] <2> Sub-function for obtaining the seven parameters of the region: The territory of China is divided into multiple regional grids, with "longitude_latitude" as the index key, and each region stores seven parameters. , , Three translation parameters, , , Three rotation parameters, The scale factor is a parameter obtained by least-squares fitting of the WGS-84 / GCJ-02 coordinates of known control points within the region.

[0151] Input: WGS-84 longitude ,latitude Output: a seven-parameter object The marked areas include: North China region (center 110°E, 35°N): , , , , , , ; East China region (center 118°E, 28°N): , , , , , , ; South China region (center 108°E, 18°N): , , , , , , ; Southwest region (center 98°E, 22°N): , , , , , , ; Northwest region (center 72°E, 32°N): , , , , , , ; Northeast region (center 120°E, 40°N): , , , , , , ; Algorithm: Traverse all grid centers and calculate the Euclidean distance from the current coordinates to each center.

[0152] Select the region with the smallest distance and return its seven parameters. If no match is found, the parameters for the North China region will be used by default.

[0153] <3> Sub-functions for converting latitude and longitude to rectangular coordinates: Convert WGS-84 latitude and longitude coordinates (geodetic coordinates) to geocentric rectangular coordinates. .

[0154] Input: Longitude ,latitude , the earth is high (Default is 0); Output: Unit: meters; Ellipsoid parameters: ; ; Angle to radians:

[0155]

[0156] Calculate the radius of curvature of the zonal loop:

[0157] Calculation of spatial rectangular coordinates:

[0158]

[0159]

[0160] <4> Spatial rectangular coordinates to latitude and longitude sub-function: Geocentric Cartesian coordinates Convert back to latitude and longitude coordinates. Input: Spatial rectangular coordinates (meters); Output: Calculated geodetic longitude Earth's latitude and Earth High (Unit: meters); Longitude calculation (direct solution):

[0161] The system first calculates the auxiliary projection radius:

[0162] Latitude calculation (iterative solution, 5 iterations): Initial latitude estimation:

[0163] Iterative formula (repeated 5 times):

[0164]

[0165]

[0166] Final latitude:

[0167] Geodetic height calculation:

[0168]

[0169] <5> Seven-parameter Bursa space transformation subfunction: Apply a seven-parameter affine transformation to the WGS-84 spatial rectangular coordinates to obtain the GCJ-02 spatial rectangular coordinates.

[0170] Input: WGS-84 spatial rectangular coordinates Seven parameters Output: GCJ-02 spatial rectangular coordinates ; Set the scale factor Transformation formula: .

[0171] (3) Third layer: Double iterative convergence algorithm: To further eliminate residual errors, this invention designs a dual iterative convergence algorithm. The core idea of ​​this algorithm is to use the known WGS-84→GCJ-02 forward transform function to find the optimal transform result through iterative approximation.

[0172] Dual Iteration Process <1> High-precision WGS-84 to GCJ-02 complete conversion function: Integrating a three-layer progressive algorithm (sine series offset + seven-parameter Bursa correction + dual iterative convergence) to achieve high-precision coordinate conversion from WGS-84 to GCJ-02.

[0173] Input: WGS-84 longitude ,latitude Output: GCJ-02 coordinates ; Pre-check: If the coordinates are located outside of China, return to the original coordinates directly without performing a conversion.

[0174] First layer – Sine series linear approximation: Calling the “sine series linear approximation subfunction” calculates the initial longitude offset based on the Krasovsky ellipsoid parameters. and latitude offset And directly assign it to the current iterative state initial value control variable. :

[0175] The second layer—Bursa model residual correction: Calling the "Bursa model residual correction function" (seven-parameter Bursa model), the sinusoidal series offset and the Bursa space transformation result are combined to obtain a more accurate offset, updating the initial values ​​for iteration. (Corrected longitude offset) (Corrected latitude offset) The third layer – dual iterative convergence: setting a convergence threshold (Approximately 0.0003 meters above the ground) Maximum number of iterations For any iteration order The following convergence tracking state chain is executed: <1.1> Call the "Nonlinear Transformation Subfunction" and input the current offset estimate. The corrected offset is obtained as follows:

[0176] <1.2> Calculate the deviation between two adjacent iterations:

[0177]

[0178] <1.3> Convergence Criterion: If and If the iteration converges, the loop terminates. <1.4> Otherwise, update the offset estimate: , Continue to the next iteration; Output – Final transformed coordinates:

[0179] .

[0180] <2> Sine series linear approximation subfunction: the first layer of the three-layer progressive algorithm, which calculates the initial offset from WGS-84 to GCJ-02.

[0181] Input: Longitude ,latitude Long half shaft eccentricity square Output: That is, the offset (in degrees) in the latitude and longitude directions; Calculate the reference offset: , ; Latitude offset Calculation:

[0182] Longitude offset Calculation:

[0183] Ellipsoidal projection correction:

[0184]

[0185]

[0186]

[0187]

[0188]

[0189] return .

[0190] <3> Nonlinear transformation sub-function: The third core iterative function of the three-layer progressive algorithm, which gradually eliminates residual errors through the iterative strategy of "forward transformation → inverse calculation → residual correction".

[0191] Input: Original WGS-84 coordinates Current offset estimate ellipsoid parameters Output: That is, the corrected offset; Step 1 – Overlay Offset: Overlay the current offset estimate onto the original coordinates to obtain the current estimated GCJ-02 coordinates.

[0192]

[0193] Step Two – Inverse Topological Projection Calculation: The system will overlay the instantaneous encrypted spatial coordinates obtained in step one. As the base, the aforementioned basic sinusoidal series offset model formula is called in reverse to perform an approximate inverse transformation.

[0194] After this sub-function is executed, it directly returns the current local projection offset feature to the control loop. Subsequently, the system subtracts the mapping increment from the current instantaneous coordinates in reverse order, thereby accurately recalculating back the original geodetic coordinate space. :

[0195]

[0196] .

[0197] Step 3 – Calculate the residuals: Compare the deviations between the inverse transformation results and the original WGS-84 coordinates:

[0198]

[0199] Step 4 – Correcting the offset: A correction factor of 0.5 is used to ensure stable convergence of the iteration (avoiding oscillations).

[0200]

[0201] Convergence Explanation: A correction coefficient of 0.5 ensures that the iteration converges stably near the optimal solution without oscillation. The GCJ-02 forward transform function is continuous and monotonic, the inverse transform maintains monotonicity, and the deviation norm monotonically decreases, guaranteeing global convergence.

[0202] <4> GCJ-02→WGS-84 Approximate Inverse Transform Subfunction: Used for backward calculation in double iteration.

[0203] Input: GCJ-02 coordinates Output: Approximate WGS-84 coordinates ; If the coordinates are located outside of China, return to the original coordinates directly.

[0204] Otherwise, the offset is calculated by calling the "sine series linear approximation sub-function" on the GCJ-02 coordinates. Then subtract that offset in the opposite direction: Approximately WGS-84 longitude; Approximately WGS-84 latitude; 1) Key technical parameters: Convergence threshold: 0.00001 (arcsecond level), equivalent to approximately 0.0003 meters of ground distance; Maximum number of iterations: 10 (actual measurements show that convergence is achieved in most cases in 3-5 iterations); Iteration function: "Nonlinear transformation sub-function" integrates sine series shift, Bursa correction, and regional residual compensation; 2) Convergence Proof: The theoretical basis for iterative convergence lies in the fact that the forward transformation function of GCJ-02 is continuous and monotonic, and its inverse transformation also maintains monotonicity. A correction coefficient of 0.5 is introduced into the iterative function "nonlinear transformation sub-function" to ensure stable convergence of the iteration (avoiding oscillations), and the deviation norm monotonically decreases, guaranteeing the global convergence of the algorithm. Experimental results show that in most cases, the convergence threshold can be reached in 3-5 iterations.

[0205] As one implementation method, during the dual-iteration convergence process, the system can set a preset convergence threshold and a preset maximum number of iterations. The preset convergence threshold can be set to 0.00001, and the preset maximum number of iterations can be set to 10. When the longitude and latitude deviations of two adjacent iterations are both less than 0.00001, iterative convergence is determined. When the number of iterations reaches 10, even if the preset convergence threshold is not met, iteration stops and the current conversion result is output to avoid continuous occupation of mobile computing resources. Furthermore, a correction coefficient can be introduced during residual correction, which can be set to 0.5 to reduce the risk of iterative oscillations and improve convergence stability. In most positioning scenarios, convergence is achieved after 3 to 5 iterations. In practical applications, the preset convergence threshold, preset maximum number of iterations, and correction coefficient can all be adjusted according to the mobile computing performance, positioning accuracy requirements, and response time requirements.

[0206] (4) Complete conversion process Combining the above three-layer algorithms, the complete WGS-84 → GCJ-02 conversion process is as follows: Figure 2 As shown.

[0207] (5) Accuracy verification The conversion accuracy of this invention was verified on several typical urban landmarks, and the results are shown in Table 1: Table 1

[0208] The verification results show that: in the core area of ​​central and eastern China (longitude 100°~130°, latitude 20°~45°): conversion error ≤ ±0.6m; in the western and northern edge areas: conversion error ≤ ±1.5m; the national average conversion error is approximately ±0.7m. This accuracy is significantly better than the 2~10 meter error level of traditional methods, meeting the sub-meter positioning service requirements.

[0209] Step 4: Tiered and Degraded Address Resolution Strategy As one implementation method, the primary map service provider's reverse address resolution service can be the reverse address resolution service provided by Amap, and the backup map service provider's reverse address resolution service can be the reverse address resolution service provided by Tianditu. Amap and Tianditu are merely examples of primary and backup map service providers. In practical applications, other map service providers capable of providing reverse address resolution services can be selected based on business needs, interface availability, call quotas, and deployment environment.

[0210] In this embodiment, the hierarchical and degraded address resolution can include the following four levels: the first level, calling the Gaode Map reverse address resolution service; the second level, calling the Tianditu reverse address resolution service when the first level resolution fails or the response times out; the third level, querying the local cached address when the second level resolution fails or the response times out; and the fourth level, returning the last valid location when there is no matching result in the local cached address.

[0211] As one implementation, the response timeout for both the primary map service provider's reverse address resolution service and the backup map service provider's reverse address resolution service can be set to 5 seconds. If the Amap reverse address resolution service does not return a resolution result or returns an error message within 5 seconds, the system enters the backup map service provider's resolution level; if the Tianditu reverse address resolution service, acting as the backup map service provider, does not return a resolution result or returns an error message within 5 seconds, the system enters the local cache address matching level. In practical applications, the response timeout can be adjusted based on network conditions, interface response speed, and real-time business requirements.

[0212] Strategy Design: To ensure that usable address results can be returned under various network environments and location conditions, this invention designs a four-level degradation resolution strategy; (1) Level 1 parsing: high-precision positioning + direct conversion + API reverse parsing Conditions: GPS positioning is successful and accuracy is ≤50 meters; process: 1) Obtain the raw GPS WGS-84 coordinates; 2) Convert to GCJ-02 coordinates using a high-precision coordinate transformation engine; 3) Call the Gaode Map reverse geocoding API to perform address parsing; The structured address information returned by the API includes: province, city, district (county); street, township; road name and distance; house number; nearby POI (point of interest); AOI (area point of interest) information.

[0213] (2) Second-level parsing: Reverse parsing of backup API Condition: Level 1 parsing failed (Gaode API unavailable or timed out); process: 1) Use the same GCJ-02 coordinates; 2) Call the Tianditu (National Geographic Information Public Service Platform) reverse geocoding API; Reasons for choosing Tianditu as a backup service: Tianditu is an official platform led by the State Bureau of Surveying and Mapping, and its data is highly authoritative. It uses different infrastructure than Gaode Maps and therefore there is no common cause of failure. The GCJ-02 coordinate system is used as well, so no additional transformation is required.

[0214] (3) Three-level resolution: cache address matching Condition: Both primary and secondary resolutions failed (network completely unavailable); Process: 1) Search the local cache for historical parsing results near the current location; 2) If a match is found (distance ≤ 100 meters), return the cached address and mark it as "approximate address"; 3) If no match is found, proceed to level four parsing; (4) Level 4 analysis: Returning to the final known position Condition: All parsing methods are unavailable; Process: 1) Return the location coordinates of the last successfully acquired location of the device; 2) Return the address of the last successfully resolved location corresponding to the coordinates; 3) Mark isCached: true in the returned result to indicate to the user that the address may not be the latest location; (5) Downgrade triggering conditions Degradation between levels is triggered by the conditions recorded in Table 2 below: Table 2

[0215] (6) The same strategy for forward address resolution Forward address resolution (address → latitude and longitude) uses the same hierarchical degradation strategy: Step 5: Cache Management (1) Caching architecture This invention designs a two-layer caching architecture: First layer: Coordinate cache Cache object: Conversion result from WGS-84 to GCJ-02; TTL: 5 minutes; Grid precision: approximately 10 meters; Storage structure:

[0216] Second layer: Address cache Cache object: GCJ-02 coordinates → structured address resolution result; TTL: 30 minutes; Mesh precision: approximately 10 meters; Storage structure:

[0217] (2) Spatial gridding To support location-based cache matching, this invention employs spatial gridding technology. The geographic space is divided into regular grids with sides approximately 10 meters long, each grid corresponding to a unique grid key. .

[0218] 1) Grid key generation The geographic space is divided into regular grids with sides of approximately 10 meters, and a unique key value is generated for each grid.

[0219] Input: Longitude ,latitude Grid size (Default 0.0001°, approximately 10 meters); Output: Grid key string ; Calculate the coordinates of the bottom left corner of the grid cell:

[0220]

[0221] Grid key format: and After retaining 4 decimal places, they are concatenated using a specific separator "_":

[0222] Example:

[0223] in, This corresponds to a ground distance of approximately 10 meters (approximately 11.1 meters near the equator and approximately 8–10 meters in mid-latitude regions).

[0224] 2) 3×3 neighborhood grid bond generation sub-function When querying the cache, it not only matches the current grid, but also matches the 8 adjacent grids (3×3 grid window) to ensure that the cache is hit even near grid boundaries: Centered on the current grid, generate 9 grid keys, including the current grid and 8 surrounding adjacent grids, for use in caching neighborhood searches during queries.

[0225] Input: Longitude ,latitude Grid size (Default 0.0001°); Output: An array of 9 grid keys ; ;

[0226]

[0227] Call the grid key generation sub-function Generate the grid key set matrix at this offset position:

[0228] This design ensures that queries near grid boundaries also hit the cache.

[0229] (3) Cache lifecycle management As one implementation, the system sets cache expiration and cache capacity for the coordinate transformation cache and the address resolution cache, respectively. The coordinate transformation cache stores the conversion results between WGS-84 coordinates and GCJ-02 coordinates, with a cache expiration of 5 minutes and a maximum cache capacity of 500 entries. The address resolution cache stores the correspondence between GCJ-02 coordinates and structured address information, with a cache expiration of 30 minutes and a maximum cache capacity of 200 entries. When a new location request hits an unexpired coordinate transformation cache, the system directly returns the corresponding coordinate transformation result; when a new location request hits an unexpired address resolution cache, the system directly returns the corresponding structured address information. When either the coordinate transformation cache or the address resolution cache exceeds its corresponding cache capacity, the system deletes cache entries that have not been accessed for a long time according to the least recently used rule. In practical applications, the cache expiration and cache capacity can be adjusted according to the mobile device's storage space, service request frequency, address change frequency, and cache hit rate requirements.

[0230] 1) Write strategy After each successful coordinate transformation, Write coordinates to the cache; after each successful address resolution, [the cache will be...]. For write address caching; use The Least Recently Used (LRU) policy manages cache size. 2) Reading strategy Upon receiving a location request, first calculate the grid key of the current WGS-84 coordinates; query the coordinate cache: if a match is found and the coordinates are not expired, directly use the cached GCJ-02 coordinates (skip the conversion step); query the address cache: if a match is found and the address is not expired, directly return the cached address (skip the API call); if the cache is not found or has expired, execute the normal process and update the cache. 3) Expiration Policy Coordinate cache TTL = 5 minutes: Considering the mobility of user locations, the impact of coordinate changes within 5 minutes is within an acceptable range; Address cache TTL = 30 minutes: Address information is relatively stable, and a 30-minute expiration time can significantly reduce repeated API calls; 4) Capacity control Maximum coordinate cache capacity: 500 entries; maximum address cache capacity: 200 entries; when the capacity limit is reached, [the cache will be set to...]. The strategy evicts the least used cached items; Complete implementation process of coordinate caching: <1> A complete address retrieval function with cache management: a complete entry point integrating coordinate caching, address caching, and four-level degradation.

[0231] Input: WGS-84 longitude ,latitude Output: Address resolution result (including cache hit flag fromCache); Step 1: Call the "buffered coordinate transformation sub-function" to convert WGS-84 to GCJ-02.

[0232] Step 2: Address Cache Lookup – The spatial gridding method from Step 5 is called to generate 9 grid keys. The address cache (addressCache) is traversed to look up the keys: skip non-existent items; delete expired items with a TTL of more than 30 minutes; if a match is found, the cache address is returned directly (marked fromCache: true).

[0233] Step 3: If the address cache misses, call the "Level 4 Degradation Address Resolution" function (see Step 4) to resolve the cache. If successful, call the spatial grid generation key from Step 5 to write the address, coordinates, timestamp, and source to the address cache (addressCache).

[0234] <2> The cached coordinate transformation sub-function prioritizes checking the cache; if no match is found, the transformation is performed and written to the cache.

[0235] Input: WGS-84 longitude ,latitude Output: GCJ-02 coordinates ; Step 1: Coordinate Cache Query – Call the “Grid Key Generation Sub-function” to generate a key and search in the coordinate cache (coordCache). If a key is found but the time-to-live (TTL) is more than 5 minutes, the expired entry is deleted and considered a miss; if a key is found and the key is not expired, the GCJ-02 coordinates are returned directly (skipping the conversion calculation).

[0236] Step 2: If no match is found, execute "coordinate transformation wgs84ToGcj02" (see Step 3).

[0237] Step 3: Write the conversion result and the current timestamp to the coordinate cache (coordCache).

[0238] <3> LRU cache class: Least Recently Used The strategy's cache data structure.

[0239] Initialization: Set the maximum capacity maxSize and use an ordered map as the underlying storage.

[0240] The get(key) operation returns an empty value if the key does not exist; if it exists, the old key is deleted and then re-inserted at the end (marked as "recently used"), and the corresponding value is returned.

[0241] Write operation set(key, value): If the key already exists, delete the old entry first; if the cache is full (current quantity ≥ maxSize), evict the least recently used entry in a loop until there is space; insert the new entry at the end.

[0242] The delete(key) operation: directly deletes the specified key.

[0243] Cache instance configuration: CoordCache: Maximum capacity 500 entries, TTL = 5 minutes; Address cache (addressCache): Maximum capacity 200 entries, TTL = 30 minutes; Cache statistics: Returns the current usage and maximum capacity of the two caches for performance monitoring.

[0244] (4) Cache performance Based on actual testing, the performance of this caching mechanism is as follows: Cache hit rate: >90% (in scenarios involving repetitive location tracking, such as inspection check-in); API call reduction: >90%; Cache hit response time: <50ms (compared to 500-2000ms for the full process); Balancing cache hit rate and precision: 10-meter grid precision achieves high hit rate while ensuring address accuracy.

[0245] Step 6: Unified packaging across platforms (1) Platform Difference Analysis The differences in location APIs across different platforms are shown in Table 3: Table 3

[0246] (2) Unified interface design This invention shields platform differences through the uni.getLocation unified interface of the UniApp framework and implements a complete coordinate transformation and address resolution process on top of it.

[0247] (3) Access Control Location permission detection and processing across all platforms are uniformly encapsulated: 1) iOS permission detection The permission status can be checked using the `authorizationStatus()` method of `CLLocationManager`. A status value of 2 indicates that permission has been denied (`kCLAuthorizationStatusDenied`), while other values ​​indicate that permission has been granted or is pending.

[0248] 2) Android permission detection The GPS service is enabled can be checked using the isProviderEnabled() method of LocationManager.

[0249] 3) System location service detection Is the cross-platform detection system-level location service enabled? iOS platform: The system location service is detected by calling CLLocationManager.locationServicesEnabled() via native bridging.

[0250] On the Android platform: Obtain a LocationManager service instance through native bridging and call isProviderEnabled(GPS_PROVIDER) to check whether the GPS service is enabled.

[0251] (4) Integration with WeChat Mini Program SDK For the WeChat Mini Program environment, this invention also integrates the Gaode Map WeChat Mini Program SDK (AMapWX), which directly utilizes its native GCJ-02 positioning capabilities, avoiding the conversion steps from WGS-84 to GCJ-02.

[0252] Example 2: Smart Inspection Check-in Scenario (1) Application scenarios Inspection personnel for a certain smart energy operation and maintenance system need to sign in at their inspection points upon arrival. These inspection points are typically located in complex environments such as factories, substations, and power distribution rooms (including indoor, outdoor, and underground locations).

[0253] (2) Implementation process Step 1: Inspection personnel open the APP and enter the inspection check-in page. Step 2: Click the "Check-in" button to trigger a location request. Step 3: The system calls uni.getLocation() to obtain the raw GPS coordinates. Example returns: longitude=116.3974, latitude=39.9093 (WGS-84) Step 4: Coordinate System Adaptive Detection → Coordinates are located within China (72.004 < 116.3974 < 137.8347) → Determined to be WGS-84, requires conversion. Step 5: Check coordinate cache → gridKey = getGridKey(116.3974, 39.9093) → If the match is successful and the coordinates are not expired (<5 minutes), the cached GCJ-02 coordinates will be used directly. → If a match is not found, perform a high-precision coordinate transformation. Step 6: High-precision coordinate transformation (WGS-84 → GCJ-02) 6.1 Calculation of Sine Series Offset x = 116.3974 - 105.0 = 11.3974 y = 39.9093 - 35.0 = 4.9093 Calculate transformLat(x, y) and transformLon(x, y). Perform ellipsoidal projection correction Obtain the initial transformed coordinates 6.2 Seven-parameter Bursa model correction Loading seven parameters for the Beijing area Perform spatial rectangular coordinate transformation Overlay area residual compensation 6.3 Dual Iteration Convergence Using the corrected coordinates as the initial values The algorithm converges after 3 iterations (delta < 0.00001). Output the final GCJ-02 coordinates: longitude=116.4032, latitude=39.9156 → Write the transformation result to the coordinate cache Step 7: Check address cache → gridKey = getGridKey(116.4032, 39.9156) → If the cached address is returned and the cached address is not expired (<30 minutes), the cached address will be returned directly. → If no match is found, perform hierarchical address resolution. Step 8: First-level address resolution (Gaode reverse geocoding) → Calling the Amap API: https: / / restapi.amap.com / v3 / geocode / regeo?key=API_KEY&location=117.1066,36.6651 → Return: { "info": "OK", "regeocode": { "formatted_address": "Renheng Park Century, Kunshun Road, Yaojia Street, Lixia District, Jinan City, Shandong Province", "addressComponent": { "province": "Shandong Province", "city": "Jinan City", "district": "Lixia District", "township": "Yaojia Subdistrict" } } } → Parsing successful, returned address → Write (GCJ-02 coordinates, address) to address cache Step 9: Enter the address into the sign-in form → Check-in location: Renheng Park Century, Kunshun Road, Yaojia Street, Lixia District, Jinan City, Shandong Province → Check-in coordinates: 117.1066, 36.6651 (GCJ-02) → Check-in time: 2026-04-22 10:30:00 Step 10: Check-in complete (Repeated check-in at the same location within 5 minutes) → Return results directly from cache → Response time < 50ms (compared to 800ms for the first check-in) (3) Performance data: First check-in response time: about 800ms (500ms for location + 50ms for conversion + 250ms for parsing); Repeat check-in response time: <50ms (directly hit the cache); Performance improvement: >90%; Location success rate: 99.5% (indoor power distribution room scenario, with WIFI location as a backup).

[0254] Example 3: Location Acquisition Scenario for Reporting Incidents and Repairs (1) Application scenario: When maintenance personnel discover equipment failure, they submit a repair work order through the "Report Fault" function of the APP. The system needs to automatically obtain the location information of the current fault location and fill it into the work order form.

[0255] (2) Implementation process: This scenario realizes one-tap position acquisition through the Location component: <!-- Report and repair form page --> The Location component internally executes the following process: Step 1: The user clicks the position acquisition icon Step 2: Call uni.getLocation() to obtain GPS coordinates Example: res.longitude=121.4737, res.latitude=31.2304 Step 3: Call wgs84ToGcj02(res.longitude, res.latitude) Perform coordinate conversion Output: { lat: 31.2362, lon: 121.4801} Step 4: Call decodeLnglat(lon, lat) 4.1 Call the AMap reverse geocoding API 4.2 Parse the returned structured address Output: detailAddress = "Nanjing Road Pedestrian Street, Huangpu District, Shanghai" Step 5: Transfer the result to the parent component through the change event Step 6: The parent component receives the result and fills it into the work order form Route planning extension When maintenance personnel travel to the fault location, the system can also provide route planning and navigation functions: Step 1: Obtain the current position of the maintenance personnel (WGS-84 → GCJ-02 conversion) Step 2: Convert the fault address to GCJ-02 coordinates through forward geocoding getAmapLngLat("Nanjing Road Pedestrian Street, Huangpu District, Shanghai") → { location: "121.4801,31.2362"} Step 3: Pass the start and end point coordinates to the Tianditu route component currentLocation = `${startLon},${startLat}&${endLon},${endLat}` Step 4: Execute driving route search in the Tianditu component new T.DrivingRoute(map, { policy: 3}).search(start, end) Step 5: To enable external navigation, construct the Amap / Tencent Map URL Scheme. → Gaode Map: amapuri: / / route / plan / ?dlat=31.2362&dlon=121.4801&dev=0 → Tencent: qqmap: / / map / routeplan?tocoord=31.2362,121.4801 (dev=0 indicates coordinates GCJ-02, no additional conversion is needed).

[0256] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. For those skilled in the art, various modifications and improvements can be made without departing from the concept of the present invention, such as adjusting the grid size, cache validity period, map service provider type, location source weight, regional grid division method, convergence threshold, and maximum number of iterations. All such modifications and improvements should fall within the protection scope of the present invention.

Claims

1. A reverse address parsing method for multi-coordinate system fusion in mobile terminals, characterized in that, Includes the following steps: Step S1: Adaptive coordinate system detection, automatically identify the coordinate system type returned by the mobile device positioning, and determine whether it is the WGS-84 coordinate system or the converted GCJ-02 coordinate system; Step S2: Positioning processing, verifying the validity of location information from at least one of GPS positioning, network base station positioning, and WIFI positioning; when at least two valid positioning sources exist, performing positioning fusion on the location information from the at least two valid positioning sources, and outputting positioning coordinates through a precision-weighted average method; when only one valid positioning source exists, using the location information of that valid positioning source as the positioning coordinates; wherein, the positioning coordinates include WGS-84 positioning coordinates or converted coordinates; Step S3: Coordinate transformation. When the positioning coordinates are WGS-84 positioning coordinates and coordinate transformation is required, the WGS-84 positioning coordinates are converted into target analytical coordinates in the GCJ-02 coordinate system. The coordinate transformation uses Krasovsky ellipsoid parameters and includes calculating the initial offset based on a sinusoidal series migration model, performing spatial residual correction based on a regional adaptive seven-parameter model, and optimizing the transformation result based on a dual iterative convergence method. Step S4: Hierarchical and downgraded address resolution. Based on the target resolution coordinates, address resolution is performed sequentially through the main map service provider's reverse address resolution service, the backup map service provider's reverse address resolution service, local cache address matching, and the last valid location return. If the current level of resolution fails or the response times out, the next level is entered for resolution to obtain structured address information. Step S5: Cache management, the target parsed coordinates and the structured address information are stored and cached in a spatial grid, and the corresponding coordinate transformation results and / or address parsing results are returned in subsequent positioning requests based on the cache validity period and cache hit results.

2. The reverse address parsing method for mobile terminal multi-coordinate system fusion as described in claim 1, characterized in that: The adaptive coordinate system detection in step S1 employs a multi-level decision-making strategy: The first level is the geographical boundary determination. When the coordinates are located outside the legally designated surveying and mapping area of ​​China (longitude 72.004°~137.8347°, latitude 0.8293°~55.8271°), they are directly determined to be in the WGS-84 coordinate system without conversion. The second level is source label detection, which directly reads the coordinate system type label returned by the positioning API; The third level is offset feature determination. The residual is calculated by inverse transformation of GCJ-02 encryption. If the residual is significantly smaller than the direct offset, it is determined to be GCJ-02. The fourth level is landmark matching verification, which uses the precise WGS-84 coordinates of known landmarks for comparison and verification.

3. The reverse address parsing method for mobile terminal multi-coordinate system fusion as described in claim 2, characterized in that: The sinusoidal series migration model in step S3, where the latitude and longitude migrations are expanded using multi-frequency sinusoidal series expansions, includes: The polynomial term is used to fit large-scale linear offset trends and nonlinear curvature effects, and includes cross terms to describe the coupling effect of latitude and longitude offsets. Square root term This is used to describe the decay characteristics of the offset growth rate in regions far from the reference point; Multi-frequency sine terms, including , High-frequency components, , Mid-frequency components, and , Low-frequency components are used to fit the periodic perturbations introduced by GCJ-02 encryption; And ellipsoidal projection correction, which converts the plane offset into spherical latitude and longitude increments through a latitude-related ellipsoidal curvature correction factor.

4. The reverse address parsing method for mobile terminal multi-coordinate system fusion as described in claim 3, characterized in that: The seven-parameter Bursa model in step S3 uses region-adaptive parameters, dividing China into multiple regional grids of approximately 1°×1°, and assigning an independent set of seven parameters to each grid. This set of seven parameters includes three translation parameters. , , Three rotation parameters , , A scaling factor The coordinates of the known control points in the region, WGS-84 and GCJ-02, were obtained by least-squares fitting.

5. The reverse address parsing method for mobile terminal multi-coordinate system fusion as described in claim 4, characterized in that: The dual-iteration convergence method in step S3 includes: The initial offset calculated using the sinusoidal series offset model is used as the initial value for iteration. Perform a forward transformation based on the current offset estimate to obtain the current transformation estimate coordinates; Perform an approximate inverse transformation on the current transformed estimated coordinates to obtain the inverse calculated coordinates; Calculate the deviation between the inverse coordinates and the original WGS-84 coordinates, and correct the current offset estimate based on the deviation; Repeat the forward transformation, approximate inverse transformation, and deviation correction until the deviation between two adjacent iterations is less than the preset convergence threshold or the preset maximum number of iterations is reached.

6. The reverse address parsing method for mobile terminal multi-coordinate system fusion as described in claim 5, characterized in that: Step S2 includes: The validity of the latitude and longitude, positioning accuracy, and acquisition time output by each positioning source is verified. When there is only one valid location source, the location information of that valid location source is returned directly. When there are at least two valid positioning sources, calculate the distance relationship between each valid positioning source and remove abnormal positioning sources whose distances from other valid positioning sources exceed a preset distance threshold. The basic weights of each valid positioning source are dynamically adjusted based on the positioning environment; The latitude and longitude coordinates of each effective positioning source are weighted and fused according to the inverse weight of positioning accuracy to obtain the positioning coordinates; The positioning environment includes at least one of the following: an open outdoor environment, an indoor environment, an urban canyon environment, and an underground environment.

7. The reverse address parsing method for mobile terminal multi-coordinate system fusion as described in claim 6, characterized in that: Step S5 includes: Map the target's analytical coordinates to grid keys according to a preset grid size; The coordinate transformation results and the address resolution results are respectively associated with and stored with the grid key; Upon receiving a new location request, query whether there are valid cached results in the current grid and its adjacent grids; If a valid cached result exists, the corresponding coordinate transformation result and / or address resolution result will be returned directly. If the cached result exceeds the preset validity period or the cache capacity exceeds the preset capacity threshold, the cached data will be deleted according to the least recently used rule.

8. The reverse address parsing method for mobile terminal multi-coordinate system fusion as described in claim 7, characterized in that: In step S4, the hierarchical and downgraded address resolution is triggered by the following conditions: the downgrade from level 1 to level 2 is triggered by the main map service provider's reverse address resolution service timeout or error return; the downgrade from level 2 to level 3 is triggered by the backup map service provider's reverse address resolution service timeout or error return. The trigger condition for downgrading from level 3 to level 4 is that there is no matching result in the local cache; level 4 returns an empty value and prompts the user when there is no last valid position.

9. The reverse address parsing method for mobile terminal multi-coordinate system fusion as described in claim 8, characterized in that: It also includes a cross-platform unified encapsulation layer, which uses the uni.getLocation unified interface of the UniApp framework to shield the differences in location APIs between iOS, Android and WeChat Mini Program platforms. Specifically, the iOS platform uses CLLocationManager.authorizationStatus to check location permissions, the Android platform uses LocationManager.isProviderEnabled to check GPS service status, and WeChat Mini Programs directly use the GCJ-02 mode of wx.getLocation to avoid coordinate transformation.