[go: up one dir, main page]

CN112073462B - Positioning method and device - Google Patents

Positioning method and device Download PDF

Info

Publication number
CN112073462B
CN112073462B CN202010779896.3A CN202010779896A CN112073462B CN 112073462 B CN112073462 B CN 112073462B CN 202010779896 A CN202010779896 A CN 202010779896A CN 112073462 B CN112073462 B CN 112073462B
Authority
CN
China
Prior art keywords
positioning
target
service
environment
services
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202010779896.3A
Other languages
Chinese (zh)
Other versions
CN112073462A (en
Inventor
孟欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changsha Youheng Network Technology Co Ltd
Original Assignee
Changsha Youheng Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changsha Youheng Network Technology Co Ltd filed Critical Changsha Youheng Network Technology Co Ltd
Priority to CN202010779896.3A priority Critical patent/CN112073462B/en
Publication of CN112073462A publication Critical patent/CN112073462A/en
Application granted granted Critical
Publication of CN112073462B publication Critical patent/CN112073462B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/51Discovery or management thereof, e.g. service location protocol [SLP] or web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/02Services making use of location information
    • H04W4/029Location-based management or tracking services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W64/00Locating users or terminals or network equipment for network management purposes, e.g. mobility management
    • H04W64/003Locating users or terminals or network equipment for network management purposes, e.g. mobility management locating network equipment

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a positioning method and a positioning device, and relates to the technical field of computer application. Receiving a positioning request triggered by a user in a page, wherein the page runs in a target environment; determining target positioning service corresponding to the target environment from a plug-in unit packaged with a plurality of positioning services according to the corresponding relation between the preset operation environment and the positioning service types; and obtaining user position data by utilizing the target positioning service. The technical scheme of the invention improves the configuration efficiency of the positioning service.

Description

Positioning method and device
Technical Field
The embodiment of the invention relates to the technical field of computer application, in particular to a positioning method and device.
Background
Web pages may be opened in a variety of operating environments, such as a browser, application, and the like. When a user uses a web page, the user often needs to trigger a positioning function in the web page to position the user.
And the positioning modes supported by different operating environments may be different. Whenever a page is configured to need to run in a certain running environment, a developer needs to perform a complex configuration process to locate service related configurations for the page.
Disclosure of Invention
The embodiment of the invention provides a positioning method and a positioning device, which are used for solving the problem of complex positioning service configuration in the traditional scheme.
A first aspect of the present invention provides a positioning method, comprising:
receiving a positioning request triggered by a user in a page, wherein the page runs in a target environment;
determining target positioning service corresponding to the target environment from a plug-in unit packaged with a plurality of positioning services according to the corresponding relation between the preset operation environment and the positioning service types;
and obtaining user position data by utilizing the target positioning service.
A second aspect of the present invention provides a positioning device comprising:
the receiving module is used for receiving a positioning request triggered by a user in a page, and the page runs in a target environment;
the first determining module is used for determining target positioning services corresponding to the target environment from the plug-in units packaged with various positioning services according to the corresponding relation between the preset operation environment and the positioning service types;
and the first positioning module is used for obtaining the user position data by utilizing the target positioning service.
A third aspect of the present invention provides a client, including a storage component and a processing component;
the storage component stores one or more computer instructions, wherein the one or more computer instructions are for the processing component to invoke and execute;
the processing assembly is configured to:
receiving a positioning request triggered by a user in a page, wherein the page runs in a target environment;
determining target positioning service corresponding to the target environment from a plug-in unit packaged with a plurality of positioning services according to the corresponding relation between the preset operation environment and the positioning service types;
and obtaining user position data by utilizing the target positioning service.
According to the invention, through presetting the corresponding relation between the operation environment and the positioning service types and uniformly packaging the positioning services in the plug-in units, the target positioning service corresponding to the target environment operated by the page is determined from the plug-in units packaged with the positioning services based on the corresponding relation, the problem that when a certain page is configured to be operated in a certain operation environment, a developer needs to execute a complex configuration process to perform configuration related to the positioning service for the page is solved, the development and configuration of new positioning service for different operation environments are not needed, the development efficiency is improved, and the maintainability is enhanced.
These and other aspects of the invention will be more readily apparent from the following description of the embodiments.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions of the conventional solutions, the drawings that are required to be used in the description of the embodiments or the conventional solutions will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to the drawings without any inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of one embodiment of a positioning method provided by the present invention;
FIG. 2 is a schematic view of an embodiment of a positioning device according to the present invention;
fig. 3 is a schematic structural diagram of an embodiment of a client according to the present invention.
DETAILED DESCRIPTION OF EMBODIMENT (S) OF INVENTION
In order to enable those skilled in the art to better understand the present invention, the following description will make clear and complete descriptions of the technical solutions according to the embodiments of the present invention with reference to the accompanying drawings.
In some of the flows described in the specification of the present invention and the above figures, a plurality of operations occurring in a particular order are included, but it should be understood that the operations may be performed out of order or performed in parallel, the sequence numbers of the operations being 101, 102, etc., merely for distinguishing between the various operations, the sequence numbers themselves not representing any order of execution. In addition, the flows may include more or fewer operations, and the operations may be performed sequentially or in parallel. It should be noted that, the descriptions of "first" and "second" herein are used to distinguish different messages, devices, modules, etc., and do not represent a sequence, and are not limited to the "first" and the "second" being different types.
The embodiment of the invention is mainly applicable to the scene of acquiring the position data when the user uses the webpage. Specifically, the user may trigger a positioning function in the web page to request to acquire the position data, and at this time, may perform positioning by using a certain positioning manner to acquire the position data of the user. Typically, web pages may be opened in a variety of operating environments, and the positioning methods supported by different operating environments may also be different.
In the conventional scheme, each time a certain page is configured to be required to run in a certain running environment, a developer needs to execute a complex configuration process to perform positioning service related configuration for the page, so that development efficiency is low and maintainability is poor.
Therefore, in order to solve the above problems encountered in the conventional solution and improve development efficiency and maintainability, the inventors propose the technical solution of the present invention: receiving a positioning request triggered by a user in a page, wherein the page runs in a target environment; determining target positioning service corresponding to the target environment from a plug-in unit packaged with a plurality of positioning services according to the corresponding relation between the preset operation environment and the positioning service types; and obtaining user position data by utilizing the target positioning service. By presetting the corresponding relation between the running environment and the positioning service types and uniformly packaging various positioning services in the plug-in, the purpose of determining the target positioning service corresponding to the target environment of the page running from the plug-in packaged with the various positioning services based on the corresponding relation is achieved, the problem that when a certain page is configured to be required to run in a certain running environment, a developer needs to execute a complex configuration process to perform positioning service related configuration for the page is solved, the purpose of not needing to perform new positioning service development configuration for different running environments is achieved, the development efficiency is improved, and maintainability is enhanced.
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
As shown in fig. 1, a flowchart of an embodiment of a positioning method provided by the present invention may include the following steps:
101: and receiving a positioning request triggered by a user in a page, wherein the page runs in a target environment.
In this embodiment, the page may refer to a web page, and the web page may be embedded in a plurality of different operating environments and run in a plurality of operating environments, such as various application programs and the like. The user may open and use the web page in a variety of different operating environments to implement the functionality provided by the web page.
Alternatively, the web page may be run in a variety of operating environments, which may include at least one of: browser running environment, application running environment, applet running environment. The browser running environment may mean that the web page may run in a browser, and a user may open and use the web page through the browser, where the type of the browser may be any type, which is not specifically limited herein. An application running environment may refer to that the web page may run in an application, and a user may open and use the web page through the application, where the application may refer to an application that includes the web page, which is not specifically limited herein. An applet-running environment may refer to the web page that may be run in an applet, which may be opened and used by a user. In this embodiment, the above three specific operating environments are taken as examples, and the operating environments are explained. In an actual scenario, the running environments of the web pages can be various, and the web pages are not illustrated one by one.
The target environment of the page running can refer to any one of a plurality of running environments.
Receiving a user-triggered positioning request in a page may be in response to a user-triggered positioning operation in the page, and generating a positioning request based on the positioning operation. Specifically, the operation of triggering positioning in the page in response to the user may include an operation of inputting address information on the page in response to the user, an operation of clicking a positioning button on the page in response to the user, or the like. The manner in which the user triggers the positioning operation in the page may be set according to the actual situation, which is not specifically limited herein.
102: and determining the target positioning service corresponding to the target environment from the plug-in unit packaged with the plurality of positioning services according to the corresponding relation between the preset operation environment and the positioning service types.
The positioning service may refer to positioning by a certain positioning method to obtain position data, and in this embodiment, the position data may refer to longitude and latitude data. The location services may be of different types and the different types of location services may be located using different manners of location. Alternatively, the plurality of location services may include a browser location service, an application location service, an applet location service, an IP location service, and the like. The browser positioning service may refer to positioning by using a positioning mode of a browser, the application positioning service may refer to positioning by using a positioning mode of an application, and the applet positioning service may refer to positioning by using a positioning mode of an applet. The different positioning modes can be implemented according to actual situations, for example, the positioning mode of the application program can be that the application program performs positioning by utilizing the positioning capability of the application program or positioning by utilizing the positioning capability of an external positioning tool, and the like, which is not particularly limited.
In practical application, the positioning service type may correspond to an operation environment, and in general, the operation environment may support multiple positioning services, and location data may be obtained by performing positioning with different positioning services. If a certain type of location service among the plurality of location services can obtain the location data more quickly and accurately than other types of location services, the operation environment can be determined to correspond to the type of location service. For example, the operating environment a may support three positioning services, namely, positioning service a, positioning service b and positioning service c, and the positioning using the positioning service a may obtain the position data more quickly and accurately than the positioning services b and c, so that it may be determined that the operating environment a corresponds to the positioning service a.
Based on the correspondence between the location service type and the operation environment, the correspondence between the operation environment and the location service type can be preset. For example, the correspondence may include a browser runtime corresponding to a browser location service, an application runtime corresponding to an application location service, an applet runtime corresponding to an applet location service, and so on. The corresponding relation between the operation environment and the location service type may be set according to the actual situation, which is not limited herein.
Further, the plurality of positioning services can be uniformly packaged, and the corresponding relation between the plurality of positioning services and the preset positioning service type and the running environment can be integrated to obtain the plug-in unit containing the plurality of positioning services. The plug-in can provide a calling interface for calling in a plurality of different running environments, and the plug-in can acquire proper positioning service from the plug-in to position.
Specifically, the obtaining of the appropriate positioning service from the plug-in for positioning may be determining the target positioning service corresponding to the target environment from the plug-in according to the preset correspondence between the running environment and the type of the positioning service. For example, if the target running environment of the page is a browser, selecting a browser positioning service from within the plug-in as a target positioning service; if the target running environment of the page is an application program, selecting an application program positioning service from the plug-in as a target positioning service; if the target operating environment of the page is an applet, an applet location service is selected from within the plug-in as a target location service, etc.
Optionally, determining, from the plugin, the target location service corresponding to the target environment according to the preset correspondence between the running environment and the location service type may further include:
and determining the target positioning service corresponding to the target environment from the plug-in according to the identification information of the target environment and the corresponding relation between the preset operation environment and the positioning service type.
When the target environment obtains the corresponding positioning service, the plug-in is called through a provided interface, the interface can contain the identification information of the target environment so that the plug-in can determine the target environment, and then the target positioning service corresponding to the target environment is determined from the plug-in according to the corresponding relation between the preset running environment and the type of the positioning service.
103: user location data is obtained using the target location service.
User location data, such as latitude and longitude data, may be obtained by locating using a target location service obtained from the plug-in.
In practical application, in response to a positioning operation triggered by a user in a page, a positioning request can be obtained based on the positioning operation, an operating environment of the page is taken as a target environment, and a target positioning service is selected from a plug-in unit packaged with a plurality of positioning services based on the target environment. Specifically, according to the corresponding relation between the preset operation environment and the positioning service type, a target positioning service corresponding to the target environment can be determined from the plug-in, and the user position data can be obtained by utilizing the target positioning service for positioning.
Taking a customer order of the home service industry as an example, a certain customer can open an order page through a browser, address information is input in the order page for a service person to definitely receive the order information, at the moment, the order page is used as a webpage, and a positioning request can be obtained based on the positioning operation in response to a user, namely, the positioning operation triggered by the customer in the webpage. At this time, the running environment of the order page is a browser, and the browser is used as a target environment, and the target location service is selected from the plug-ins packaged with the plurality of location services based on the browser running environment. Specifically, the plug-in is called by using the target environment, that is, an interface provided by the browser, and the interface may include identification information of the browser, so that the plug-in determines the browser, and then determines a target positioning service corresponding to the browser, that is, a browser positioning service, from the plug-in according to a preset corresponding relationship between the running environment and the positioning service type. The browser positioning service is utilized for positioning, so that the position data, such as longitude and latitude data, of the user can be obtained.
In this embodiment, by presetting a correspondence between an operating environment and a location service type, and uniformly encapsulating multiple location services in a plug-in, a target location service corresponding to a target environment in which a page operates is determined from the plug-in encapsulated with multiple location services based on the correspondence, which solves a problem that when a page is configured to be operated in a certain operating environment, a developer needs to execute a complex configuration process to perform configuration related to the location service for the page, realizes that new location service development configuration is not required for different operating environments, improves development efficiency, and enhances maintainability.
In practical application, some positioning services have limitations of authority setting during positioning, for example, in some application programs, the positioning authority of the application program needs to be acquired by adopting the application program positioning service, if the positioning authority cannot be acquired, the positioning service of the application program cannot be used for positioning, and the user position data cannot be acquired. Thus, in certain embodiments, the method may further comprise:
if the user position data is not successfully obtained by using the target positioning service, the user position data is obtained by using the IP positioning service.
Wherein the IP positioning service is encapsulated within the plug-in.
If the user location data is not successfully obtained by the target location service, that is, the positioning by the target location service fails, the type of the location service can be switched, for example, the location is performed by using the IP location service. The IP positioning service can successfully position when the target positioning service is limited by the positioning authority without acquiring the positioning authority of the application program, and acquire the user position data.
When the positioning by using the target positioning service fails, the positioning is performed by using the IP positioning service so as to obtain the user position data, thereby ensuring that the positioning can be completed and the user position data can be successfully obtained, avoiding the situation that the user position data cannot be obtained when the positioning by using the target positioning service fails and enhancing the use experience of the user.
In order to further enhance the use experience of the user, when positioning fails by using the target positioning service, the user can be informed of the reason of the positioning failure, so that the user can clearly determine the reason of the positioning failure and perform corresponding processing. Thus, in certain embodiments, the method may further comprise:
if the user position data is not successfully obtained by utilizing the target positioning service, determining a positioning failure reason;
and outputting prompt information corresponding to the positioning failure reasons, wherein the prompt information corresponding to the same positioning failure reasons under different operating environments is the same.
In practical applications, there may be a plurality of reasons for failure in positioning using the target positioning service, for example, positioning authority problems, network problems, and the like may be included. Specifically, the positioning authority problem may include that the positioning authority of the target positioning service cannot be obtained in the target environment, that is, the target positioning service cannot be supported, and the positioning cannot be performed by using the target positioning service, and at this time, the positioning by using the target positioning service fails; or, the network problem may include that the network signal is poor, the network support cannot be obtained, and the like in the target environment, and the target positioning service cannot be utilized to perform smooth positioning under the network condition, so that positioning failure and the like may be caused. The reasons for the positioning failure may be various, and may be determined according to actual situations, and are not particularly limited herein.
Different positioning services have different processing modes for positioning failure, for example, when positioning failure of the browser positioning service occurs, a user can be prompted to open a positioning authority page of current equipment operated by the browser, for example, the positioning authority page can comprise a smart phone, a tablet personal computer and the like, and the positioning authority page of the browser is requested to be acquired; when positioning by using the application positioning service fails, a user can be prompted to open a native positioning authority page of the electronic equipment operated by the application, such as a smart phone, a tablet computer and the like, and request to acquire the application positioning authority; when the positioning of the applet positioning service fails, a user can be prompted to open an applet positioning authority page to request to acquire applet positioning authority and the like. Furthermore, the positioning failure reasons obtained by different positioning services can be integrated, and prompt information corresponding to the positioning failure reasons is output, so that a user can determine the failure reasons.
For example, the prompt message may be that the application positioning authority cannot be obtained, the application positioning service cannot be utilized for positioning, and the positioning authority is opened; or, it is impossible to detect the network signal or the network signal is poor, and it is impossible to perform positioning by using the applet positioning service, please perform operations when the network signal is good, etc. The corresponding prompt messages of the same positioning failure cause under different running environments can be the same. The setting of the prompt information may be processed according to the actual situation, and is not particularly limited here.
When positioning failure is performed by utilizing the target positioning service, determining a positioning failure reason, outputting prompt information corresponding to the positioning failure reason, facilitating a user to clearly determine the positioning failure reason, and correspondingly processing the positioning failure reason, thereby enhancing the user experience.
In practical application, after obtaining user position data, namely longitude and latitude data, by using the target positioning service, there is a problem that the obtained position data is inconsistent with the position data required by the page in format, and at this time, the obtained position data needs to be converted. Thus, in certain embodiments, the method may further comprise:
if the coordinate system corresponding to the target positioning service is different from the coordinate system supported by the page, performing coordinate conversion on the user position data so as to be matched with the page.
The coordinate system of the position data obtained when the positioning service performs positioning is different, for example, the coordinate system can comprise a WGS-84 coordinate system (World Geodetic System-1984 Coordinate System, earth center coordinate system), a GCJ-02 coordinate system (national survey agency 02 standard coordinate system), a BD-09 coordinate system (hundred degree coordinate system) and other different coordinate systems.
When the target positioning service is utilized for positioning, whether a coordinate system corresponding to the target positioning service and a coordinate system supported by the page are the same or not can be determined, and if the coordinate systems are the same, the processing can be directly performed based on the position data obtained by the target positioning service; if the position data are different, coordinate system conversion is needed to be carried out on the position data obtained by the target positioning service, and the position data are converted into position data under a coordinate system supported by the page. The conversion relation between different coordinate systems can be preset, and the conversion relation can be packaged in the plug-in.
By converting the position data obtained by the target positioning service into a coordinate system, the position data under the coordinate system required by the webpage can be obtained, and subsequent data processing is facilitated. The conversion relation is packaged in the plug-in, so that when the requirement on the webpage is changed, data conversion can be performed timely, and the position data under the coordinate system of the requirement on the webpage is ensured to be obtained.
As shown in fig. 2, a schematic structural diagram of an embodiment of a positioning device according to the present invention may include the following modules:
a receiving module 201, configured to receive a positioning request triggered by a user in a page, where the page runs in a target environment;
a first determining module 202, configured to determine, according to a preset correspondence between an operation environment and a location service type, a target location service corresponding to a target environment from a plug-in unit in which a plurality of location services are packaged;
a first positioning module 203 for obtaining user location data using a target positioning service.
In this embodiment, by presetting a correspondence between an operating environment and a location service type, and uniformly encapsulating multiple location services in a plug-in, a target location service corresponding to a target environment in which a page operates is determined from the plug-in encapsulated with multiple location services based on the correspondence, which solves a problem that when a page is configured to be operated in a certain operating environment, a developer needs to execute a complex configuration process to perform configuration related to the location service for the page, realizes that new location service development configuration is not required for different operating environments, improves development efficiency, and enhances maintainability.
In some embodiments, the first determination module 202 may include:
and the determining unit is used for determining the target positioning service corresponding to the target environment from the plug-in unit packaged with the plurality of positioning services according to the identification information of the target environment and the corresponding relation between the preset running environment and the positioning service type.
In some embodiments, the apparatus may further comprise:
and the conversion module is used for carrying out coordinate conversion on the user position data to match with the page if the coordinate system corresponding to the target positioning service is different from the coordinate system supported by the page.
By converting the position data obtained by the target positioning service into a coordinate system, the position data under the coordinate system required by the webpage can be obtained, and subsequent data processing is facilitated. The conversion relation is packaged in the plug-in, so that when the requirement on the webpage is changed, data conversion can be performed timely, and the position data under the coordinate system of the requirement on the webpage is ensured to be obtained.
In some embodiments, the apparatus may further comprise:
and the second positioning module is used for acquiring the user position data by using the IP positioning service if the user position data cannot be successfully acquired by using the target positioning service, and the IP positioning service is encapsulated in the plug-in.
When the positioning by using the target positioning service fails, the positioning is performed by using the IP positioning service so as to obtain the user position data, thereby ensuring that the positioning can be completed and the user position data can be successfully obtained, avoiding the situation that the user position data cannot be obtained when the positioning by using the target positioning service fails and enhancing the use experience of the user.
In some embodiments, the apparatus may further comprise:
the second determining module is used for determining a positioning failure reason if the user position data is not successfully obtained by utilizing the target positioning service;
the output module is used for outputting prompt information corresponding to the positioning failure reasons, wherein the prompt information corresponding to the same positioning failure reason under different operation environments is the same.
When positioning failure is performed by utilizing the target positioning service, determining a positioning failure reason, outputting prompt information corresponding to the positioning failure reason, facilitating a user to clearly determine the positioning failure reason, and correspondingly processing the positioning failure reason, thereby enhancing the user experience.
Referring to fig. 3, a schematic structural diagram of an embodiment of a client provided by the present invention includes a storage component 301 and a processing component 302;
the storage component 301 stores one or more computer instructions, wherein the one or more computer instructions are for execution by the processing component 302;
the processing component 302 is configured to:
receiving a positioning request triggered by a user in a page, wherein the page runs in a target environment;
determining target positioning service corresponding to the target environment from a plug-in unit packaged with a plurality of positioning services according to the corresponding relation between the preset operation environment and the positioning service types;
user location data is obtained using the target location service.
In this embodiment, by presetting a correspondence between an operating environment and a location service type, and uniformly encapsulating multiple location services in a plug-in, a target location service corresponding to a target environment in which a page operates is determined from the plug-in encapsulated with multiple location services based on the correspondence, which solves a problem that when a page is configured to be operated in a certain operating environment, a developer needs to execute a complex configuration process to perform configuration related to the location service for the page, realizes that new location service development configuration is not required for different operating environments, improves development efficiency, and enhances maintainability.
The apparatus embodiments described above are merely illustrative, wherein the elements illustrated as separate elements may or may not be physically separate, and the elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course by means of hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in part as a software product, which may be stored in a computer-readable storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform the method described in the various embodiments or portions of the embodiments.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (8)

1. A positioning method, comprising:
receiving a positioning request triggered by a user in a page, wherein the page operates in a target environment, and the target environment is any one of a plurality of operating environments;
determining target positioning services corresponding to the target environment from a plug-in unit packaged with various positioning services according to the corresponding relation between the preset running environment and the positioning service types, wherein the positioning services comprise browser positioning services, application program positioning services, applet positioning services and IP positioning services, and the various running environments comprise at least one of the following: browser running environment, application running environment and applet running environment;
obtaining user location data using the target location service;
if the user position data is not successfully obtained by utilizing the target positioning service, obtaining the user position data by utilizing an IP positioning service, wherein the IP positioning service is encapsulated in the plug-in;
wherein the determining the target positioning service corresponding to the target environment from the plug-in unit packaged with the plurality of positioning services comprises:
and when the running environment supports a plurality of positioning services, determining the positioning service with the highest positioning speed and positioning precision in the plurality of positioning services as the target positioning service.
2. The method according to claim 1, wherein the method further comprises:
and if the coordinate system corresponding to the target positioning service is different from the coordinate system supported by the page, performing coordinate conversion on the user position data so as to be matched with the page.
3. The method according to claim 1, wherein the method further comprises:
if the user position data is not successfully obtained by utilizing the target positioning service, determining a positioning failure reason;
and outputting prompt information corresponding to the positioning failure reasons, wherein the prompt information corresponding to the same positioning failure reasons under different operating environments is the same.
4. The method of claim 1, wherein determining the target location service corresponding to the target environment from within the plug-in having the plurality of location services encapsulated therein according to the preset correspondence between the operation environment and the location service type comprises:
and determining the target positioning service corresponding to the target environment from the plug-in unit packaged with various positioning services according to the identification information of the target environment and the corresponding relation between the preset operation environment and the positioning service type.
5. A positioning device, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving a positioning request triggered by a user in a page, the page operates in a target environment, and the target environment is any one of a plurality of operating environments;
the first determining module is configured to determine, from a plug-in unit in which a plurality of positioning services are encapsulated, a target positioning service corresponding to the target environment according to a preset correspondence between an operating environment and a positioning service type, where the positioning service includes a browser positioning service, an application positioning service, an applet positioning service, and an IP positioning service, and the operating environment includes at least one of: browser running environment, application running environment and applet running environment;
the first positioning module is used for obtaining user position data by utilizing the target positioning service;
the second positioning module is used for obtaining the user position data by using an IP positioning service if the user position data is not successfully obtained by using the target positioning service, and the IP positioning service is encapsulated in the plug-in unit;
wherein, the first determining module is further specifically configured to:
and when the running environment supports a plurality of positioning services, determining the positioning service with the highest positioning speed and positioning precision in the plurality of positioning services as the target positioning service.
6. The apparatus of claim 5, wherein the apparatus further comprises:
and the conversion module is used for carrying out coordinate conversion on the user position data so as to be matched with the page if the coordinate system corresponding to the target positioning service is different from the coordinate system supported by the page.
7. The apparatus of claim 5, wherein the apparatus further comprises:
the second determining module is used for determining a positioning failure reason if the user position data is not successfully obtained by utilizing the target positioning service;
and the output module is used for outputting prompt information corresponding to the positioning failure reasons, wherein the prompt information corresponding to the same positioning failure reason under different operating environments is the same.
8. The client is characterized by comprising a storage component and a processing component;
the storage component stores one or more computer instructions, wherein the one or more computer instructions are for the processing component to invoke and execute;
the processing assembly is configured to:
receiving a positioning request triggered by a user in a page, wherein the page operates in a target environment, and the target environment is any one of a plurality of operating environments;
determining target positioning services corresponding to the target environment from a plug-in unit packaged with various positioning services according to the corresponding relation between a preset running environment and positioning service types, wherein the positioning services comprise browser positioning services, application program positioning services, applet positioning services and IP positioning services, and the running environment comprises at least one of the following: browser running environment, application running environment and applet running environment;
obtaining user location data using the target location service;
if the user position data is not successfully obtained by utilizing the target positioning service, obtaining the user position data by utilizing an IP positioning service, wherein the IP positioning service is encapsulated in the plug-in;
wherein the determining the target positioning service corresponding to the target environment from the plug-in unit packaged with the plurality of positioning services comprises:
and when the running environment supports a plurality of positioning services, determining the positioning service with the highest positioning speed and positioning precision in the plurality of positioning services as the target positioning service.
CN202010779896.3A 2020-08-05 2020-08-05 Positioning method and device Active CN112073462B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010779896.3A CN112073462B (en) 2020-08-05 2020-08-05 Positioning method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010779896.3A CN112073462B (en) 2020-08-05 2020-08-05 Positioning method and device

Publications (2)

Publication Number Publication Date
CN112073462A CN112073462A (en) 2020-12-11
CN112073462B true CN112073462B (en) 2023-10-27

Family

ID=73656378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010779896.3A Active CN112073462B (en) 2020-08-05 2020-08-05 Positioning method and device

Country Status (1)

Country Link
CN (1) CN112073462B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112632410A (en) * 2020-12-24 2021-04-09 平安银行股份有限公司 Environment adaptive positioning method and system
CN114629951A (en) * 2022-03-22 2022-06-14 康键信息技术(深圳)有限公司 Address service switching method, apparatus, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1449500A (en) * 2000-06-30 2003-10-15 诺基亚有限公司 Method and device for position determination
CN106131795A (en) * 2016-08-30 2016-11-16 维沃移动通信有限公司 A kind of localization method and mobile terminal
CN107040892A (en) * 2017-04-13 2017-08-11 广东欧珀移动通信有限公司 Method and device for acquiring location information of mobile terminal and mobile terminal
CN108076429A (en) * 2017-12-13 2018-05-25 广东欧珀移动通信有限公司 Positioning method, positioning device, storage medium and mobile terminal
CN109164477A (en) * 2018-08-29 2019-01-08 维沃移动通信有限公司 A kind of application positioning method and mobile terminal
CN110389756A (en) * 2019-07-23 2019-10-29 深圳市元征科技股份有限公司 Software Development Kit funcall method, system and electronic equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1449500A (en) * 2000-06-30 2003-10-15 诺基亚有限公司 Method and device for position determination
CN106131795A (en) * 2016-08-30 2016-11-16 维沃移动通信有限公司 A kind of localization method and mobile terminal
CN107040892A (en) * 2017-04-13 2017-08-11 广东欧珀移动通信有限公司 Method and device for acquiring location information of mobile terminal and mobile terminal
CN108076429A (en) * 2017-12-13 2018-05-25 广东欧珀移动通信有限公司 Positioning method, positioning device, storage medium and mobile terminal
CN109164477A (en) * 2018-08-29 2019-01-08 维沃移动通信有限公司 A kind of application positioning method and mobile terminal
CN110389756A (en) * 2019-07-23 2019-10-29 深圳市元征科技股份有限公司 Software Development Kit funcall method, system and electronic equipment and medium

Also Published As

Publication number Publication date
CN112073462A (en) 2020-12-11

Similar Documents

Publication Publication Date Title
US20210248062A1 (en) System and Method for Data Collection and Analysis of Information Relating to Mobile Applications
CN108984388B (en) Method and terminal equipment for generating automatic test case
CN103777967B (en) Page returning method, page generation method and device
CN110289983B (en) Load balancing application creation method and device, computer equipment and storage medium
CN110442502B (en) Point burying method, device, equipment and storage medium
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN112073462B (en) Positioning method and device
CN112631924A (en) Automatic testing method and device, computer equipment and storage medium
CN113986270B (en) Distributed application deployment method and device, storage medium and electronic equipment
CN114218072A (en) Test script generation method and device, storage medium and computer equipment
CN105515909B (en) A kind of data acquisition test method and apparatus
CN112241362A (en) Test method, test device, server and storage medium
CN103812982B (en) A kind of cross operating system realizes the method and system of computer monitoring testing mobile phone client
CN109495319B (en) Method, device and equipment for determining fault information of CDN node
CN113032167B (en) Page communication method, device and equipment
CN111506507A (en) State detection method and device for business service, electronic device, and storage medium
CN110022332B (en) Hypertext transfer security protocol proxy method, device, equipment and medium
CN117130933A (en) Baffle service method, system, equipment and storage medium
CN111488286A (en) Method and device for independently developing Android module
CN112256564B (en) Application program running method and device and electronic equipment
CN113315676B (en) Method and device for detecting broken link and electronic equipment
CN112671615B (en) Method, system and storage medium for collecting front-end user operation behavior data
CN105339974A (en) Simulating sensors
CN109756393B (en) Information processing method, system, medium, and computing device
CN108108369B (en) Common interface library call error handling method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant